Skip to content

Commit

Permalink
feat(SubnavigationButton): add disabled styles
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Feb 5, 2025
1 parent 4f2d7c0 commit cb1f70c
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 20 deletions.
3 changes: 3 additions & 0 deletions packages/vkui/src/components/SubnavigationButton/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SubnavigationButtonExample = () => {
const [size, setSize] = useState('m');
const [chevron, setChevron] = useState(false);
const [selected, setSelected] = useState(false);
const [disabled, setDisabled] = useState(false);
const [addBefore, setAddBefore] = useState(false);
const [addAfter, setAddAfter] = useState(false);

Expand All @@ -34,6 +35,7 @@ const SubnavigationButtonExample = () => {
after={buttonAfter}
chevron={chevron}
selected={selected}
disabled={disabled}
onClick={noop}
>
{mode} button
Expand Down Expand Up @@ -91,6 +93,7 @@ const SubnavigationButtonExample = () => {
</FormItem>
<FormItem top="props">
<Checkbox onChange={(e) => setSelected(e.target.checked)}>selected</Checkbox>
<Checkbox onChange={(e) => setDisabled(e.target.checked)}>disabled</Checkbox>
<Checkbox onChange={(e) => setChevron(e.target.checked)}>chevron</Checkbox>
<Checkbox onChange={(e) => setAddBefore(e.target.checked)}>add before</Checkbox>
<Checkbox onChange={(e) => setAddAfter(e.target.checked)}>add after</Checkbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const SubnavigationButtonPlayground = (props: ComponentPlaygroundProps) =
</Counter>,
],
children: ['Фильтры'],
disabled: [undefined, true],
},
]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
border-radius: var(--vkui--size_border_radius--regular);
}

.disabled {
opacity: var(--vkui--opacity_disable_accessibility);
}

.in {
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const SubnavigationButton = ({
appearanceStyles[appearance],
selected && styles.selected,
sizeY !== 'regular' && sizeYClassNames[sizeY],
restProps.disabled && styles.disabled,
)}
>
<span className={styles.in}>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb1f70c

Please sign in to comment.