From 56f3223e1614d8b6c41a74c6cdcc9009c2f82c7f Mon Sep 17 00:00:00 2001 From: eirikbacker Date: Thu, 12 Sep 2024 09:58:25 +0200 Subject: [PATCH 1/2] fix(Select): rename from nativeselect --- .../app/komponenter/component-list.ts | 4 +- .../Previews/Components/Components.tsx | 6 +- .../components/ThemeToolbar/ThemeToolbar.tsx | 10 ++-- packages/css/index.css | 2 +- .../css/{native-select.css => select.css} | 60 +++++++++---------- .../src/components/Card/Card.stories.tsx | 6 +- .../src/components/form/Checkbox/Checkbox.mdx | 2 +- .../src/components/form/NativeSelect/index.ts | 2 - .../NativeSelect.mdx => Select/Select.mdx} | 20 +++---- .../Select.stories.tsx} | 30 +++++----- .../Select.test.tsx} | 12 ++-- .../NativeSelect.tsx => Select/Select.tsx} | 37 +++++------- .../react/src/components/form/Select/index.ts | 2 + .../useSelect.ts} | 47 ++++++--------- packages/react/src/components/index.ts | 2 +- packages/react/stories/showcase.stories.tsx | 6 +- packages/react/stories/testing.stories.tsx | 6 +- 17 files changed, 119 insertions(+), 135 deletions(-) rename packages/css/{native-select.css => select.css} (52%) delete mode 100644 packages/react/src/components/form/NativeSelect/index.ts rename packages/react/src/components/form/{NativeSelect/NativeSelect.mdx => Select/Select.mdx} (57%) rename packages/react/src/components/form/{NativeSelect/NativeSelect.stories.tsx => Select/Select.stories.tsx} (79%) rename packages/react/src/components/form/{NativeSelect/NativeSelect.test.tsx => Select/Select.test.tsx} (90%) rename packages/react/src/components/form/{NativeSelect/NativeSelect.tsx => Select/Select.tsx} (75%) create mode 100644 packages/react/src/components/form/Select/index.ts rename packages/react/src/components/form/{NativeSelect/useNativeSelect.ts => Select/useSelect.ts} (51%) diff --git a/apps/storefront/app/komponenter/component-list.ts b/apps/storefront/app/komponenter/component-list.ts index 798374a302..d2f614bdd9 100644 --- a/apps/storefront/app/komponenter/component-list.ts +++ b/apps/storefront/app/komponenter/component-list.ts @@ -95,9 +95,9 @@ export const data = [ url: 'https://storybook.designsystemet.no/?path=/docs/komponenter-modal--docs', }, { - title: 'Native Select', + title: 'Select', image: 'Select.svg', - url: 'https://storybook.designsystemet.no/?path=/docs/komponenter-nativeselect--docs', + url: 'https://storybook.designsystemet.no/?path=/docs/komponenter-select--docs', }, { title: 'Pagination', diff --git a/apps/theme/components/Previews/Components/Components.tsx b/apps/theme/components/Previews/Components/Components.tsx index b705fb5c44..c7cb0aa02e 100644 --- a/apps/theme/components/Previews/Components/Components.tsx +++ b/apps/theme/components/Previews/Components/Components.tsx @@ -11,11 +11,11 @@ import { Heading, HelpText, Link, - NativeSelect, Pagination, Paragraph, Radio, Search, + Select, Skeleton, Spinner, Switch, @@ -86,12 +86,12 @@ export const Components = () => {
- + diff --git a/apps/theme/components/ThemeToolbar/ThemeToolbar.tsx b/apps/theme/components/ThemeToolbar/ThemeToolbar.tsx index 35a304fd65..d6a4f595bb 100644 --- a/apps/theme/components/ThemeToolbar/ThemeToolbar.tsx +++ b/apps/theme/components/ThemeToolbar/ThemeToolbar.tsx @@ -1,5 +1,5 @@ import type { CssColor } from '@adobe/leonardo-contrast-colors'; -import { Button, NativeSelect, Tooltip } from '@digdir/designsystemet-react'; +import { Button, Select, Tooltip } from '@digdir/designsystemet-react'; import type { ColorError, ContrastMode, @@ -107,7 +107,7 @@ export const ThemeToolbar = ({ />
- - +
- ))} - +
diff --git a/packages/react/stories/testing.stories.tsx b/packages/react/stories/testing.stories.tsx index 5dc4306d4d..2815fbd22b 100644 --- a/packages/react/stories/testing.stories.tsx +++ b/packages/react/stories/testing.stories.tsx @@ -5,8 +5,8 @@ import { Checkbox, Chip, Combobox, - NativeSelect, Radio, + Select, Switch, Tag, Textfield, @@ -51,11 +51,11 @@ export const MediumRow: StoryFn<{ suffix='suffix' /> - + Sogndal From 459651d8bdbeaa1b1792d3eba77d1035bdef96fd Mon Sep 17 00:00:00 2001 From: Eirik Backer Date: Thu, 12 Sep 2024 09:59:43 +0200 Subject: [PATCH 2/2] Create odd-hornets-sleep.md --- .changeset/odd-hornets-sleep.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/odd-hornets-sleep.md diff --git a/.changeset/odd-hornets-sleep.md b/.changeset/odd-hornets-sleep.md new file mode 100644 index 0000000000..082f9b9408 --- /dev/null +++ b/.changeset/odd-hornets-sleep.md @@ -0,0 +1,6 @@ +--- +"@digdir/designsystemet-css": patch +"@digdir/designsystemet-react": patch +--- + +Select: Rename from `NativeSelect`