Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update visual snapshots: Fix/refactor segmented button #2259

Open
wants to merge 1 commit into
base: fix/refactor-segmented-button
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions packages/components/src/components/segment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@
| ---------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- | -------------- |
| `adjacentSiblings` | `adjacent-siblings` | | `"left" \| "leftright" \| "right"` | `undefined` |
| `ariaDescriptionTranslation` | `aria-description-translation` | a11y text for getting meaningful value. `$buttonNumber` and `$selected` are template variables and will be replaces by their corresponding properties. | `string` | `'$selected'` |
| `ariaLabelSegment` | `aria-label-segment` | (optional) aria-label attribute needed for icon-only segments | `string` | `undefined` |
| `ariaLabelSegment` | `aria-label-segment` | (optional) aria-label attribute needed for icon-only buttons | `string` | `undefined` |
| `ariaLangDeselected` | `aria-lang-deselected` | (optional) translation of 'deselected | `string` | `'deselected'` |
| `ariaLangSelected` | `aria-lang-selected` | (optional) translation of 'selected | `string` | `'selected'` |
| `disabled` | `disabled` | (optional) If `true`, the segment is disabled | `boolean` | `false` |
| `hasIcon` | `has-icon` | (optional) position within group | `boolean` | `undefined` |
| `iconOnly` | `icon-only` | (optional) position within group | `boolean` | `undefined` |
| `disabled` | `disabled` | (optional) If `true`, the button is disabled | `boolean` | `false` |
| `iconOnly` | `icon-only` | (optional) icon only segment | `boolean` | `false` |
| `iconText` | `icon-text` | (optional) segment with icon and text | `boolean` | `false` |
| `multiSelect` | `multi-select` | (optional) multi select segment | `boolean` | `false` |
| `position` | `position` | (optional) position within group | `number` | `undefined` |
| `segmentId` | `segment-id` | (optional) segment's id | `string` | `undefined` |
| `selected` | `selected` | (optional) If `true`, the segment is selected | `boolean` | `false` |
| `selectedIndex` | `selected-index` | (optional) the index of the currently selected segment in the segmented-button | `string` | `undefined` |
| `size` | `size` | (optional) The size of the segment | `"large" \| "medium" \| "small"` | `'small'` |
| `selected` | `selected` | (optional) If `true`, the button is selected | `boolean` | `false` |
| `size` | `size` | (optional) The size of the button | `"large" \| "medium" \| "small"` | `'small'` |
| `styles` | `styles` | (optional) Injected CSS styles | `string` | `undefined` |
| `textOnly` | `text-only` | (optional) position within group | `boolean` | `undefined` |
| `width` | `width` | (optional) Segment width set to ensure that all segments have the same width | `string` | `undefined` |
| `width` | `width` | (optional) Button width set to ensure that all buttons have the same width | `string` | `undefined` |


## Events

| Event | Description | Type |
| ------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `scale-click` | Emitted when button is clicked | `CustomEvent<{ id: string; selected: boolean; }>` |
| `scaleClick` | <span style="color:red">**[DEPRECATED]**</span> in v3 in favor of kebab-case event names<br/><br/> | `CustomEvent<{ id: string; selected: boolean; }>` |
| Event | Description | Type |
| ------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `scale-click` | Emitted when button is clicked | `CustomEvent<{ id: string; selected: boolean; value: string; }>` |
| `scaleClick` | <span style="color:red">**[DEPRECATED]**</span> in v3 in favor of kebab-case event names<br/><br/> | `CustomEvent<{ id: string; selected: boolean; value: string; }>` |


## Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
| `disabled` | `disabled` | (optional) If `true`, the button is disabled | `boolean` | `false` |
| `fullWidth` | `full-width` | (optional) If `true`, expand to container width | `boolean` | `false` |
| `helperText` | `helper-text` | (optional) If `true`, show error message | `string` | `'Please select an option'` |
| `iconOnly` | `icon-only` | (optional) icon only | `boolean` | `false` |
| `invalid` | `invalid` | (optional) If `true`, show error message | `boolean` | `false` |
| `label` | `label` | (optional) Button label | `string` | `undefined` |
| `longestButtonWidth` | `longest-button-width` | | `string` | `undefined` |
| `multiSelect` | `multi-select` | (optional) Allow more than one button to be selected | `boolean` | `false` |
| `selectedIndex` | `selected-index` | (optional) the index of the selected segment | `number` | `undefined` |
| `size` | `size` | (optional) The size of the button | `"large" \| "medium" \| "small"` | `'small'` |
| `styles` | `styles` | (optional) Injected CSS styles | `string` | `undefined` |

Expand Down