Skip to content

Commit 23c4682

Browse files
authored
Merge pull request #173 from fortanix/mkrause/250420-replace-dropdown-with-listbox
Replace all instances of Dropdown with ListBox, and remove the Dropdown component
2 parents 3d3d94f + 538346e commit 23c4682

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1251
-1063
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ jobs:
2828
cache: 'npm'
2929
- run: npm ci
3030
#- run: npm run build --if-present
31-
- run: npm run verify verify:source
3231
- run: npm test
3332
- run: cd tests/installation && npm ci && npm test

.storybook/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const config: StorybookConfig = {
1212
},
1313
framework: {
1414
name: '@storybook/react-vite',
15-
options: {},
15+
options: {
16+
strictMode: true,
17+
},
1618
},
1719
stories: [
1820
'../src/**/*.mdx',

.vscode/custom.css-data.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": 1.1,
44
"properties": [
55
{ "name": "interpolate-size" },
6-
{ "name": "position-try-fallbacks" }
6+
{ "name": "position-try-fallbacks" },
7+
{ "name": "reading-flow" },
8+
{ "name": "reading-order" }
79
],
810
"atDirectives": [
911
{

app/Demo.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ export const Demo = () => {
2727
<Header slot="actions">
2828
<UserMenu userName="Anand Kashyap"/>
2929
{/* <UserMenu userName="Anand Kashyap – Very Long Name That Will Overflow"/> */}
30-
<AccountSelector className="select-action"/>
31-
<SolutionSelector className="select-action"/>
30+
<AccountSelector className="select-action" accounts={null}>
31+
{accountSelected => accountSelected?.label ?? 'Accounts'}
32+
</AccountSelector>
33+
<SolutionSelector className="select-action" solutions={null}/>
3234
</Header>
3335
</AppLayout.Header>
3436
{/* Container around the sidebar that grows to full height, allowing the sidebar to be sticky */}

app/lib.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export { Tab, Tabs } from '../src/components/navigations/Tabs/Tabs.tsx';
7979
export { SpinnerModal } from '../src/components/overlays/SpinnerModal/SpinnerModal.tsx';
8080
export { DialogModal } from '../src/components/overlays/DialogModal/DialogModal.tsx';
8181
export { DialogOverlay } from '../src/components/overlays/DialogOverlay/DialogOverlay.tsx';
82-
export { DropdownMenu } from '../src/components/overlays/DropdownMenu/DropdownMenu.tsx';
8382
export { DropdownMenuProvider } from '../src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx';
8483
export { ToastProvider, notify } from '../src/components/overlays/ToastProvider/ToastProvider.tsx';
8584
export { Tooltip } from '../src/components/overlays/Tooltip/Tooltip.tsx';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"lint:style": "stylelint 'src/**/*.scss'",
5555
"lint:script": "biome lint",
5656
"lint": "npm run lint:style; npm run lint:script",
57-
"test": "npm run check:types && npm run lint:style",
57+
"test": "npm run check:types && npm run lint:style && npm run verify verify:source",
5858
"test-ui": "vitest --ui",
5959
"coverage": "vitest run --coverage",
6060
"test:storybook": "test-storybook --failOnConsole --browsers chromium --maxWorkers=1",

package.json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const packageConfig = {
7979
// Test
8080
// Note: use `vitest run --root=. src/...` to run a single test file
8181
//'test:unit': 'vitest run --root=.', // Need to specify `--root=.` since the vite root is set to `./app`
82-
'test': 'npm run check:types && npm run lint:style', // TODO: add `lint:script`, `test:unit`
82+
'test': 'npm run check:types && npm run lint:style && npm run verify verify:source', // TODO: add `lint:script`, `test:unit`
8383
'test-ui': 'vitest --ui',
8484
'coverage': 'vitest run --coverage',
8585

scripts/import.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ const runImportColorsSemantic = async (args: ScriptArgs) => {
216216
throw new Error(`Should not happen`);
217217
}
218218

219+
if (tokenValue.match(/#[a-z0-9]{3,6}/i)) {
220+
throw new Error(`Found semantic color token defined using a hardcoded hex color: '${tokenName}'`);
221+
}
222+
219223
// Replace references to primitive color tokens with their Sass variable equivalent
220224
const color = tokenValue.replaceAll(/var\(--(.+?)-(\d+)\)/g, '\$color-$1-$2');
221225

src/components/actions/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const Button = (props: ButtonProps) => {
147147
return (
148148
<button
149149
aria-label={accessibleName}
150-
aria-disabled={!isInteractive}
150+
aria-disabled={isInteractive ? undefined : true}
151151
disabled={disabled}
152152
{...propsRest}
153153
type={buttonType} // Not overridable

src/components/containers/Banner/Banner.module.scss

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,22 @@
3434
color: bk.$theme-banner-text-default;
3535

3636
.bk-banner__header {
37-
display: flex;
38-
flex-direction: row;
37+
@include bk.flex-row;
3938
align-items: flex-start;
4039
gap: bk.$spacing-4;
4140

4241
.bk-banner__header__text {
4342
margin-inline-end: auto; // Space between text and actions
4443

45-
min-inline-size: 0;
46-
display: flex;
47-
flex-flow: row wrap;
44+
@include bk.flex-row;
45+
flex-wrap: wrap;
4846
gap: bk.$spacing-1;
4947

5048
.bk-banner__title {
5149
$icon-size: 1.3em;
5250
margin-inline-start: calc(-1 * (bk.$spacing-2 + $icon-size));
5351

54-
min-inline-size: 0;
55-
display: flex;
56-
flex-direction: row;
52+
@include bk.flex-row;
5753
gap: bk.$spacing-2;
5854
align-items: center;
5955

@@ -73,8 +69,9 @@
7369
}
7470
}
7571
.bk-banner__actions {
76-
display: flex;
77-
flex-direction: row;
72+
flex-shrink: 0;
73+
74+
@include bk.flex-row;
7875
align-items: center;
7976
gap: bk.$spacing-3 calc(bk.$spacing-6 / 2);
8077

0 commit comments

Comments
 (0)