Skip to content

Commit ec2fc0c

Browse files
enhancement! : remove all field label, field hint, field errors from all possible inputs (#1693)
Co-authored-by: Josh <[email protected]>
1 parent 5e13104 commit ec2fc0c

File tree

74 files changed

+2751
-2765
lines changed

Some content is hidden

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

74 files changed

+2751
-2765
lines changed

.changeset/clean-otters-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@strapi/design-system': major
3+
---
4+
5+
enhancement!: removed field wrapper components from inputs to streamline and inputs stories are moved under `stories/inputs` folder.

.changeset/eight-humans-brake.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@strapi/design-system': major
3+
---
4+
5+
chore!: remove CreatableCombobox
6+
7+
Users should instead use `<Combobox createable />`.

.changeset/green-starfishes-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@strapi/design-system': major
3+
---
4+
5+
enhancement!: ToggleInput renamed to just Toggle

BREAKING_CHANGES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,34 @@ This was just a wrapped component around `Flex`. You should use `Flex` instead.
4444

4545
This is the same component as `ToggleInput` and therefore you should use that instead.
4646

47+
### Removed field wrapper components from inputs
48+
49+
We're making inputs more composable by breaking down the pieces from components like labels, hints, and error messages, focusing solely on exporting the inputs themselves. This simplifies the structure and reduces DOM size, especially in cases where only aria-labels are needed. Users can still use Field components they used alongside inputs.
50+
51+
```tsx
52+
// before
53+
return <SingleSelect label={label} error={error} required={required} value={value} onChange={handleChange} />;
54+
55+
// after
56+
return (
57+
<Field>
58+
<FieldLabel>{label}</FieldLabel>
59+
<SingleSelect label={label} error={error} required={required} value={value} onChange={handleChange} />
60+
<FieldError />
61+
<FieldHint />
62+
</Field>
63+
);
64+
```
65+
66+
### Components renaming
67+
68+
`ToggleInput` has been renamed to just `Toggle`.
69+
70+
```ts
71+
- import { ToggleInput } from '@strapi/design-system'
72+
+ import { Toggle } from '@strapi/design-system'
73+
```
74+
4775
### Icon Updates
4876

4977
Many of the icons have been updated visually, this will effect snapshot tests. The default size is `1.6rem` for an icon, in the Strapi design-system this equates to 16px. We have also ensured that `paths` do not have any `fill` or `stroke` properties set, this allows the icon to be styled with CSS except for specific use cases we don't expect users to encounter. The default `color` is `currentColor` which means it will inherit the color of the parent element.

docs/.storybook/preview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const preview: Preview = {
3131
['Overview', 'Icons', ['Overview', '*']],
3232
'Primitives',
3333
['Overview', '*'],
34+
'Inputs',
3435
'Design System',
3536
['Technical Components', 'Components'],
3637
'Utilities',

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@storybook/react-vite": "^7.6.17",
2323
"@storybook/theming": "7.6.17",
2424
"eslint-plugin-mdx": "^3.1.5",
25+
"outdent": "0.8.0",
2526
"storybook": "^7.6.17",
2627
"typescript": "5.4.5",
2728
"vite": "^5.0.2"

docs/stories/Accordion.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const Group = {
153153
/>
154154
<AccordionContent>
155155
<Box padding={3}>
156-
<TextInput label="Name" />
156+
<TextInput aria-label="Name" />
157157
</Box>
158158
</AccordionContent>
159159
</Accordion>

docs/stories/Checkbox.mdx

Lines changed: 0 additions & 73 deletions
This file was deleted.

docs/stories/Checkbox.stories.tsx

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)