Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a3f2998
feat: Support secondaryText and labelTag for button-dropdown
Aug 29, 2025
0318384
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Sep 12, 2025
a06cf13
Add the missing document snapshots
Sep 12, 2025
390b77e
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Sep 15, 2025
77e2289
Merge commit
Sep 29, 2025
cc28835
remove unused css styling and move API description into the applicabl…
Sep 29, 2025
da3f4e4
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Oct 10, 2025
30b7018
move usage of internalBox in button-dropdown and use styles instead
Oct 10, 2025
0e1347b
fix the integration test and increase the size limit
Oct 10, 2025
f43c798
test
timogasda Oct 13, 2025
f6068d5
Revert "test"
timogasda Oct 15, 2025
8e6a9ed
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
timogasda Oct 15, 2025
7ee0478
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Oct 23, 2025
5d132f9
fix the broken integ and a11y tests. Correct the font and color of la…
Oct 23, 2025
201e320
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
kuahuu Oct 23, 2025
9f8f63a
feat: Bottom drawer (v2) (#3922)
georgylobko Oct 24, 2025
fd77494
chore: Close autosuggest dropdown when recovery button is focused and…
taheramr Oct 24, 2025
0500609
feat: Add support for download links in ButtonDropdown (#3694)
TrevorBurnham Oct 24, 2025
b507d79
chore: consistently use direct imports for Lodash functions (#3796)
TrevorBurnham Oct 24, 2025
2e78d15
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
kuahuu Oct 24, 2025
1b6b30f
chore: add instructions for updating snapshots (#3970)
mxschll Oct 27, 2025
46aa1fb
fix: vertical centering for h2 headers without description in expanda…
Who-is-PS Oct 27, 2025
23b0078
fix: Make CopyToClipboard popup optimistic (#3855)
TrevorBurnham Oct 27, 2025
b50818b
chore: Remove/deprecate unused tokens (#3965)
gethinwebster Oct 27, 2025
cba475f
chore: Add componentSelector as a new prop for funnelStart (#3971)
georgylobko Oct 27, 2025
b0abc2e
bump the bundle size and removed the duplicated unit tests
Oct 27, 2025
171aea8
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
kuahuu Oct 28, 2025
370e0bc
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Oct 29, 2025
68a44bf
update the example pages and add color for highlight/hover of seconda…
Oct 29, 2025
c14985d
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Oct 30, 2025
2563406
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Nov 10, 2025
ff78818
update the way of highlight setting of secondary-text
Nov 10, 2025
0b5102a
revert change in package.json and bring back hightlight for secondary…
Nov 10, 2025
df3e187
revert changes in package-lock.json
Nov 10, 2025
c083437
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Nov 12, 2025
c00febf
update the API description
Nov 12, 2025
c984af4
update doc snapshot
Nov 12, 2025
9402b66
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
Nov 14, 2025
3a09864
correct the colors of disabled secondary text and label tag; update t…
Nov 14, 2025
e0c5657
update the description of secondaryText and labelTag
Nov 14, 2025
ea892cf
remove new test utils and update tests
cansuaa Nov 19, 2025
97b53fd
Merge branch 'main' into button-dropdown-secondaryText-labelTags-and-…
cansuaa Nov 19, 2025
1764486
re-add disabled reason
cansuaa Nov 19, 2025
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
29 changes: 29 additions & 0 deletions pages/button-dropdown/checkboxes.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,35 @@ const getItems = (firstChecked: boolean, secondChecked: boolean, thirdChecked: b
id: 'id5',
text: 'Option without checkbox',
},
{
id: 'id6',
text: 'Disabled option with secondaryText',
secondaryText: 'This is a secondary text',
disabled: true,
},
{
id: 'id7',
text: 'Option with icon and secondaryText',
iconName: 'gen-ai',
secondaryText: 'This is a secondary text',
},
{
id: 'id8',
text: 'Option with checkbox, icon, and secondaryText',
iconName: 'gen-ai',
secondaryText: 'This is a secondary text',
checked: thirdChecked,
itemType: 'checkbox',
},
{
id: 'id8',
text: 'Option with checkbox, icon, labelTag, and secondaryText',
iconName: 'gen-ai',
secondaryText: 'This is a secondary text',
checked: thirdChecked,
itemType: 'checkbox',
labelTag: 'Ctrl + L',
},
];
return items;
};
Expand Down
11 changes: 9 additions & 2 deletions pages/button-dropdown/disabled-reason.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ import { ButtonDropdown, ButtonDropdownProps } from '~components';
import ScreenshotArea from '../utils/screenshot-area';

const actionsItems: ButtonDropdownProps.Items = [
{ id: 'connect', text: 'Connect', disabledReason: 'Instance must be running.', disabled: true },
{ id: 'details', text: 'View details', disabledReason: 'A single instance needs to be selected.', disabled: true },
{ id: 'connect', text: 'Connect', disabledReason: 'Instance must be running.', disabled: true, labelTag: 'Disabled' },
{
id: 'details',
text: 'View details',
disabledReason: 'A single instance needs to be selected.',
disabled: true,
},
{
id: 'manage-state',
text: 'Manage instance state',
Expand All @@ -22,6 +27,7 @@ const actionsItems: ButtonDropdownProps.Items = [
{
id: 'auto-scaling',
text: 'Attach to Auto Scaling Group',
secondaryText: 'Manage the Instance to Auto Scaling Group',
disabledReason: 'Instance must be running and not already be attached to an Auto Scaling Group.',
disabled: true,
},
Expand All @@ -38,6 +44,7 @@ const actionsItems: ButtonDropdownProps.Items = [
text: 'Change shutdown behavior',
disabledReason: "Instance can't be a spot instance.",
disabled: true,
labelTag: 'Ctrl + D',
},
],
},
Expand Down
27 changes: 21 additions & 6 deletions pages/button-dropdown/events.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,32 @@ const dropdownItems = [
{
text: 'enabled category',
items: [
{ id: 'c1long1', text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown' },
{ id: 'c1_disabled_item', text: 'disabled item', disabled: true },
{
id: 'c1long1',
text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown',
secondaryText: 'Very long option',
},
{ id: 'c1_disabled_item', text: 'disabled item', disabled: true, secondaryText: 'Disabled option' },
{ id: 'c1_enabled_item', text: 'option2' },
{ id: 'c1long2', text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown', disabled: true },
{ id: 'c1i3', text: 'option3' },
{ id: 'c1i4', text: 'option4' },
{
id: 'c1long2',
text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown',
disabled: true,
secondaryText: 'Very long option',
},
{ id: 'c1i3', text: 'option3', secondaryText: 'option 3' },
{ id: 'c1i4', text: 'option4', secondaryText: 'option 4' },
],
},
{
text: 'disabled category',
disabled: true,
items: [
{ id: 'dci1', text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown' },
{
id: 'dci1',
text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown',
secondaryText: 'Very long option',
},
{ id: 'item_in_disabled_category', text: 'option4' },
{ id: 'dci5', text: 'option5' },
],
Expand All @@ -35,11 +48,13 @@ const dropdownItems = [
id: 'individual_disabled_item',
text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown',
disabled: true,
labelTag: 'Disabled',
},
{
id: 'plain_href',
text: 'option6',
href: '#',
labelTag: 'Link',
},
{
id: 'plain_href_prevented',
Expand Down
3 changes: 3 additions & 0 deletions pages/button-dropdown/expandable.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export const items: ButtonDropdownProps['items'] = [
items: [...Array(50)].map((_, index) => ({
id: 'category2Subitem' + index,
text: 'Cat 2 Sub item ' + index,
secondaryText: `Option ${index}`,
})),
},
...[...Array(10)].map((_, index) => ({
id: 'item' + index,
text: 'Item ' + index,
secondaryText: `Option ${index}`,
})),
{
id: 'category3',
Expand All @@ -45,6 +47,7 @@ export const items: ButtonDropdownProps['items'] = [
{
id: 'item10',
text: 'Item 10',
secondaryText: 'This is the last option',
},
];

Expand Down
3 changes: 3 additions & 0 deletions pages/button-dropdown/icon-expandable.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const items: ButtonDropdownProps['items'] = [
items: [...Array(2)].map((_, index) => ({
id: 'category1Subitem' + index,
text: 'Sub item ' + index,
secondaryText: `Option ${index}`,
})),
},
{
Expand All @@ -35,6 +36,7 @@ export const items: ButtonDropdownProps['items'] = [
id: 'item1',
text: 'Item 1',
iconName: 'settings',
secondaryText: 'Option 1',
},
{
id: 'category3',
Expand All @@ -50,6 +52,7 @@ export const items: ButtonDropdownProps['items'] = [
items: [...Array(2)].map((_, index) => ({
id: 'category3Subitem' + index,
text: 'Sub item ' + index,
labelTag: ' Number ' + index,
})),
},
];
Expand Down
27 changes: 27 additions & 0 deletions pages/button-dropdown/item-element.permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@ const permutations = createPermutations<ItemProps>([
onItemActivate: [() => {}],
highlightItem: [() => {}],
},

// With secondaryText
{
item: [
{ id: '1', text: 'Option', secondaryText: 'This is the first option' },
{ id: '2', text: 'Option 2', secondaryText: 'This is the second option' },
],
disabled: [false, true],
highlighted: [false, true],
hasCategoryHeader: [false],
showDivider: [false],
onItemActivate: [() => {}],
highlightItem: [() => {}],
},
// With labelTag
{
item: [
{ id: '1', text: 'Option', labelTag: 'This is a label tag' },
{ id: '2', text: 'Option 2', secondaryText: 'This is the second option', labelTag: 'This is a label tag' },
],
disabled: [false, true],
highlighted: [false, true],
hasCategoryHeader: [false],
showDivider: [false],
onItemActivate: [() => {}],
highlightItem: [() => {}],
},
// With icons
{
item: [
Expand Down
1 change: 1 addition & 0 deletions pages/button-dropdown/main-action.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function ButtonDropdownPage() {
{
text: 'Launch instance from template',
id: 'launch-instance-from-template',
secondaryText: 'Use the existing templates',
},
]}
onItemClick={() => setClickedButton('Launch instance from template')}
Expand Down
1 change: 1 addition & 0 deletions pages/button-dropdown/permutations-main-action.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const launchInstanceItem = {
const launchInstanceFromTemplateItem = {
text: 'Launch instance from template',
iconName: 'file',
secondaryText: 'Use an existing template',
} as const;

const viewInstancesItem = {
Expand Down
28 changes: 28 additions & 0 deletions pages/button-dropdown/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ const items: ButtonDropdownProps['items'] = [
text: 'Option 6',
disabled: true,
},
{
id: 'id7',
text: 'Option 7',
secondaryText: 'This is option 7',
},
{
id: 'id8',
text: 'Option 8',
labelTag: 'Ctrl + 8',
},
{
id: 'id9',
text: 'Option 9',
secondaryText: 'This is option 9',
labelTag: 'Ctrl + 9',
},
];

const withNestedOptions: ButtonDropdownProps['items'] = [
Expand All @@ -49,10 +65,14 @@ const withNestedOptions: ButtonDropdownProps['items'] = [
{
id: '1',
text: 'Destroy',
secondaryText: 'This is the Destroy option',
labelTag: 'Ctrl + D',
},
{
id: '2',
text: 'Restart',
secondaryText: 'This is the Restart option',
labelTag: 'Ctrl + R',
},
],
},
Expand All @@ -77,10 +97,13 @@ const withExpandedGroups: ButtonDropdownProps['items'] = [
{
id: 'connect',
text: 'Connect',
secondaryText: 'This is the Connect option',
labelTag: 'Ctrl + C',
},
{
id: 'password',
text: 'Get password',
secondaryText: 'This is the Get password option',
},
{
id: 'states',
Expand All @@ -103,15 +126,20 @@ const withExpandedGroups: ButtonDropdownProps['items'] = [
{
id: 'reboot',
text: 'Reboot',
secondaryText: 'This is the Reboot Option',
labelTag: 'Ctrl + B',
disabled: true,
},
{
id: 'terminate',
text: 'Terminate',
secondaryText: 'This is the Terminate Option',
},
{
id: 'external',
text: 'Root Page',
secondaryText: '',
labelTag: 'Ctrl + P',
external: true,
href: '/#/light/',
},
Expand Down
3 changes: 3 additions & 0 deletions pages/button-dropdown/utils/button-dropdown-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ const dropdownItems = [
id: 'id7',
text: 'option5',
disabled: true,
secondaryText: 'This is a disabled option',
labelTag: 'Disabled',
},
{
id: 'id8',
text: 'VeryLongOptionTextValueHereToTestTheCaseWithThisDropdown',
secondaryText: 'This is the option with a long description, This is the option with a long description',
},
{ id: 'id9', text: 'option6' },
];
Expand Down
5 changes: 5 additions & 0 deletions pages/button-dropdown/word-wrap.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const dropdownItems = [
{
id: 'id0',
text: 'a very long text that may overflow horizontally as in this example that is unnecessarily longer just to exemplify a long text',
secondaryText:
'A very long text that may overflow horizontally as in this example that is unnecessarily longer just to exemplify a long text',
labelTag: 'Label',
},
{ id: 'id1', text: 'option1', disabled: true },
{ id: 'id2', text: 'option2' },
Expand All @@ -28,6 +31,7 @@ const dropdownItems = [
{
id: 'id5',
text: 'AVeryLongWordThatMayOverflowHorizontallyAsInThisExampleThatIsUnnecessarilyLongerJustToExemplifyALongWord',
labelTag: 'Label',
},
{ id: 'id6', text: 'option4' },
],
Expand All @@ -44,6 +48,7 @@ const dropdownItems = [
{
id: 'id9',
text: 'option9',
secondaryText: 'This is a disabled option',
disabled: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5632,7 +5632,7 @@ The following properties are supported across all types:
- \`lang\` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.
- \`disabled\` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.
- \`disabledReason\` (string) - (Optional) Displays text near the \`text\` property when item is disabled. Use to provide additional context.
- \`description\` (string) - additional data that will be passed to a \`data-description\` attribute.
- \`description\` (string) - additional data that will be passed to a \`data-description\` attribute. **Deprecated**, has no effect.
- \`ariaLabel\` (string) - (Optional) - ARIA label of the item element.

### action
Expand All @@ -5645,6 +5645,8 @@ The following properties are supported across all types:
- \`iconAlt\` (string) - (Optional) Specifies alternate text for the icon when using \`iconUrl\`.
- \`iconUrl\` (string) - (Optional) Specifies the URL of a custom icon.
- \`iconSvg\` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the \`svg\` slot of the [icon component](/components/icon/).
- \`secondaryText\` (string) - (Optional) Further information about the action that appears below the label.
- \`labelTag\` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.

### checkbox

Expand All @@ -5655,6 +5657,8 @@ When \`type\` is set to "checkbox", the values set to \`href\`, \`external\` and
- \`iconAlt\` (string) - (Optional) Specifies alternate text for the icon when using \`iconUrl\`.
- \`iconUrl\` (string) - (Optional) Specifies the URL of a custom icon.
- \`iconSvg\` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the \`svg\` slot of the [icon component](/components/icon/).
- \`secondaryText\` (string) - (Optional) Further information about the action that appears below the label.
- \`labelTag\` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.

### group

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ describe.each([true, false])(
await page.setWindowSize(mobileDimensions);
await page.focusOnTheTrigger();
await page.keys(['Enter', ...new Array(13).fill('ArrowDown'), 'Enter', 'ArrowDown']);
expect(await page.getFocusedElementText()).toBe('Item 10');
expect(await page.getFocusedElementText()).toBe('Item 10\nThis is the last option');
})
);
test(
Expand All @@ -193,7 +193,7 @@ describe.each([true, false])(
expect(await page.getFocusedElementText()).toBe('Sub item 1');
// move to the next group, expand it, move one item down
await page.keys(['ArrowDown', 'Enter', 'ArrowDown']);
expect(await page.getFocusedElementText()).toBe('Cat 2 Sub item 0');
expect(await page.getFocusedElementText()).toBe('Cat 2 Sub item 0\nOption 0');
expect(await page.getItemCount('category1Subitem1')).toEqual(0);
})
);
Expand Down Expand Up @@ -251,7 +251,7 @@ describe.each([true, false])(
expect(await page.getItemCount('category2Subitem1')).toEqual(1);
await page.keys(['ArrowDown']);
expect(await page.getItemCount('category2Subitem2')).toEqual(1);
expect(await page.getFocusedElementText()).toBe('Cat 2 Sub item 1');
expect(await page.getFocusedElementText()).toBe('Cat 2 Sub item 1\nOption 1');
})
);
test(
Expand Down
4 changes: 2 additions & 2 deletions src/button-dropdown/__integ__/button-dropdown-items.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test(
await page.openDropdown();
await page.keys('ArrowDown');

await expect(page.getFocusedElementText()).resolves.toBe('Restart');
await expect(page.getHighlightedElementText()).resolves.toBe('Restart');
await expect(page.getFocusedElementText()).resolves.toBe('Restart\nCtrl + R\nThis is the Restart option');
await expect(page.getHighlightedElementText()).resolves.toBe('Restart\nCtrl + R\nThis is the Restart option');
})
);
Loading
Loading