Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 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
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
{
"path": "lib/components/internal/widget-exports.js",
"brotli": false,
"limit": "890 kB",
"limit": "891 kB",
"ignore": "react-dom"
}
],
Expand Down
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
20 changes: 16 additions & 4 deletions pages/button-dropdown/disabled-reason.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ 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,
labelTag: 'Disabled',
},
{
id: 'manage-state',
text: 'Manage instance state',
secondaryText: 'Option to start/stop/edit instance',
disabledReason: 'Instance state must not be pending or stopping.',
disabled: true,
},
Expand All @@ -22,6 +29,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 @@ -32,6 +40,7 @@ const actionsItems: ButtonDropdownProps.Items = [
{
id: 'stop-protection',
text: 'Change stop protection',
labelTag: 'Ctrl + D',
},
{
id: 'shutdown-behavior',
Expand Down Expand Up @@ -112,14 +121,17 @@ export const selectableGroupItems: ButtonDropdownProps.Items = [
itemType: 'checkbox',
checked: true,
disabled: false,
secondaryText: 'Manage the settings',
labelTag: 'Ctrl + S',
},
{
text: 'Disabled setting',
id: 'setting',
itemType: 'checkbox',
checked: true,
disabled: true,
disabledReason: 'disabled reason',
disabledReason: '',
secondaryText: "Can't be modified",
},
],
},
Expand All @@ -130,7 +142,7 @@ export default function DescriptionPage() {
const [isRightAligned, setIsRightAligned] = useState(false);
return (
<>
<h1>Descriptions in ButtonDropdown</h1>
<h1>Failure Reason in ButtonDropdown</h1>
<label>
<input
type="checkbox"
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
4 changes: 4 additions & 0 deletions pages/button-dropdown/expandable.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const items: ButtonDropdownProps['items'] = [
items: [...Array(2)].map((_, index) => ({
id: 'category1Subitem' + index,
text: 'Sub item ' + index,
secondaryText: `Option ${index}`,
})),
},
{
Expand All @@ -22,11 +23,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 +48,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
2 changes: 2 additions & 0 deletions pages/button-dropdown/permutations-main-action.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ const launchInstanceItem = {
const launchInstanceFromTemplateItem = {
text: 'Launch instance from template',
iconName: 'file',
secondaryText: 'Use an existing template',
} as const;

const viewInstancesItem = {
text: 'View instances',
href: 'https://instances.com',
external: true,
externalIconAriaLabel: '(opens in new tab)',
labelTag: 'Ctrl + Click',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something broke here. If you go to this permutations page in the browser, you'll see the following error message:

hook.js:608 Warning: React does not recognize the labelTag prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase labeltag instead. If you accidentally passed it from a parent component, remove it from the DOM element.

That's also why the a11y tests are failing

Copy link
Author

@kuahuu kuahuu Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found the issue was these props are passing to another internal component and wasn't included in the destructuring assignment, causing it to be spread onto a DOM element. Remove the labelTag in this page as we do have labelTag in other permutation pages.

} as const;

const permutations = createPermutations<ButtonDropdownProps>([
Expand Down
33 changes: 33 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 @@ -89,29 +112,39 @@ const withExpandedGroups: ButtonDropdownProps['items'] = [
{
id: 'start',
text: 'Start',
secondaryText: 'This is the Start option',
labelTag: 'Ctrl + S',
},
{
id: 'stop',
text: 'Stop',
secondaryText: 'This is the Stop Option',
disabled: true,
},
{
id: 'hibernate',
text: 'Hibernate',
secondaryText: 'This is the Hibernate Option',
labelTag: 'Ctrl + H',
disabled: true,
},
{
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
Loading