Skip to content

Commit be5ac8a

Browse files
authored
Merge pull request #926 from strapi/release/1.6.6
2 parents edf31a0 + b577ab8 commit be5ac8a

Some content is hidden

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

68 files changed

+1680
-3943
lines changed

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: yarn bootstrap
3030

3131
- name: Build
32-
run: yarn build
32+
run: yarn build --ignore=@strapi/design-system-docs
3333

3434
- name: Run TSC
3535
run: yarn test:ts
@@ -75,7 +75,7 @@ jobs:
7575
run: yarn bootstrap
7676

7777
- name: Build
78-
run: yarn build
78+
run: yarn build --ignore=@strapi/design-system-docs
7979

8080
- name: Unit / Integration tests
8181
run: yarn test

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ dist
99
storybook-static
1010
test-results
1111
playwright-report
12-
packages/strapi-icons/src
12+
packages/strapi-icons/src
13+
coverage

docs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"scripts": {
2727
"build": "build-storybook",
28+
"clean": "rm -rf storybook-static node_modules",
2829
"develop": "start-storybook -p 6006",
2930
"lint": "eslint --ext .mdx ."
3031
}

docs/stories/DateTimePicker.stories.mdx

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ import { DateTimePicker } from '@strapi/design-system/DateTimePicker';
5252
label={'Date time picker'}
5353
disabled={false}
5454
name="datetimepicker"
55-
onChange={(e) => setValue(e)}
5655
clearLabel="Clear"
57-
onClear={() => setValue(undefined)}
58-
value={value}
56+
step={15}
5957
hint="This is a super description"
6058
selectedDateLabel={() => `Date picker, current is undefined`}
6159
/>

docs/stories/IconButton.stories.mdx

+14-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ minimal and by so, efficient in small areas. Icon Buttons should be associated w
4343
<Box paddingBottom={3}>
4444
<Typography>{currentAction}</Typography>
4545
</Box>
46-
<Flex>
46+
<Flex background="neutral100" gap={1} padding={2}>
4747
<IconButton onClick={() => setCurrentAction('edit')} label="Edit" icon={<Pencil />} />
4848
<IconButton onClick={() => setCurrentAction('Create')} label="Create" icon={<Plus />} />
4949
<IconButton onClick={() => setCurrentAction('Delete')} label="Delete" icon={<Trash />} />
@@ -68,7 +68,7 @@ Depending on the status of an action or the permissions, an IconButton can be un
6868
<Box paddingBottom={3}>
6969
<Typography>{currentAction}</Typography>
7070
</Box>
71-
<Flex>
71+
<Flex background="neutral100" gap={1} padding={2}>
7272
<IconButton disabled onClick={() => setCurrentAction('edit')} label="Edit" icon={<Pencil />} />
7373
<IconButton disabled onClick={() => setCurrentAction('Create')} label="Create" icon={<Plus />} />
7474
<IconButton disabled onClick={() => setCurrentAction('Delete')} label="Delete" icon={<Trash />} />
@@ -89,7 +89,9 @@ the button.**
8989
<Canvas>
9090
<Story name="without tooltip">
9191
<Box padding={7}>
92-
<IconButton onClick={() => console.log('edit')} aria-label="Edit" icon={<Pencil />} />
92+
<Flex background="neutral100" gap={1} padding={2}>
93+
<IconButton onClick={() => console.log('edit')} aria-label="Edit" icon={<Pencil />} />
94+
</Flex>
9395
</Box>
9496
</Story>
9597
</Canvas>
@@ -101,12 +103,14 @@ IconButtons can be used within another component is a Group shape.
101103
<Canvas>
102104
<Story name="group">
103105
<Box padding={7}>
104-
<IconButtonGroup>
105-
<IconButton onClick={() => console.log('edit')} label="Edit" icon={<Pencil />} />
106-
<IconButton onClick={() => console.log('Create')} label="Create" icon={<Plus />} />
107-
<IconButton onClick={() => console.log('Delete')} label="Delete" icon={<Trash />} />
108-
<IconButton onClick={() => console.log('Publish')} label="Publish" icon={<Play />} />
109-
</IconButtonGroup>
106+
<Flex background="neutral100" gap={1} padding={2}>
107+
<IconButtonGroup>
108+
<IconButton onClick={() => console.log('edit')} label="Edit" icon={<Pencil />} />
109+
<IconButton onClick={() => console.log('Create')} label="Create" icon={<Plus />} />
110+
<IconButton onClick={() => console.log('Delete')} label="Delete" icon={<Trash />} />
111+
<IconButton onClick={() => console.log('Publish')} label="Publish" icon={<Play />} />
112+
</IconButtonGroup>
113+
</Flex>
110114
</Box>
111115
</Story>
112116
</Canvas>
@@ -124,7 +128,7 @@ IconButtons can take Icons as their children and can be fully accessible without
124128
<Box paddingBottom={3}>
125129
<Typography>{currentAction}</Typography>
126130
</Box>
127-
<Flex>
131+
<Flex background="neutral100" gap={1} padding={2}>
128132
<IconButton onClick={() => setCurrentAction('Edit')} aria-label="Edit">
129133
<Pencil />
130134
</IconButton>

docs/stories/TextButton.stories.mdx

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
22

33
import { ArrowLeft, ArrowRight } from '@strapi/icons';
4-
import { TextButton } from '@strapi/design-system';
4+
import { Icon, TextButton } from '@strapi/design-system';
55

66
<Meta title="Design System/Components/TextButton" component={TextButton} />
77

@@ -33,7 +33,17 @@ Depending on the permissions a user have or the status of an action, a TextButto
3333
<Canvas>
3434
<Story name="base">
3535
<div>
36-
<TextButton endIcon={<ArrowRight />} startIcon={<ArrowLeft />}>
36+
<TextButton>Click on me</TextButton>
37+
</div>
38+
</Story>
39+
</Canvas>
40+
41+
## Icons
42+
43+
<Canvas>
44+
<Story name="icons">
45+
<div>
46+
<TextButton endIcon={<Icon as={ArrowRight} />} startIcon={<Icon as={ArrowLeft} />}>
3747
Click on me
3848
</TextButton>
3949
</div>
@@ -45,7 +55,7 @@ Depending on the permissions a user have or the status of an action, a TextButto
4555
<Canvas>
4656
<Story name="disabled">
4757
<div>
48-
<TextButton disabled startIcon={<ArrowLeft />} endIcon={<ArrowRight />}>
58+
<TextButton disabled startIcon={<Icon as={ArrowLeft} />}>
4959
Disabled TextButton
5060
</TextButton>
5161
</div>
@@ -57,7 +67,7 @@ Depending on the permissions a user have or the status of an action, a TextButto
5767
<Canvas>
5868
<Story name="loading">
5969
<div>
60-
<TextButton loading startIcon={<ArrowLeft />} endIcon={<ArrowRight />}>
70+
<TextButton loading startIcon={<Icon as={ArrowLeft} />}>
6171
Loading
6272
</TextButton>
6373
</div>

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packages": ["packages/*", "docs"],
3-
"version": "1.6.5",
3+
"version": "1.6.6",
44
"npmClient": "yarn",
55
"useWorkspaces": true
66
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"bootstrap": "lerna bootstrap",
1414
"develop": "lerna run develop --stream",
1515
"build": "lerna run build",
16-
"clean": "lerna clean",
16+
"clean": "lerna run clean && rm -rf node_modules",
1717
"format": "lerna run format",
1818
"lint": "lerna run lint",
1919
"lint-staged": "lerna run lint -- ",

packages/strapi-design-system/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@strapi/design-system",
3-
"version": "1.6.5",
3+
"version": "1.6.6",
44
"license": "MIT",
55
"type": "module",
66
"sideEffects": false,
@@ -29,7 +29,7 @@
2929
"devDependencies": {
3030
"@juggle/resize-observer": "^3.4.0",
3131
"@playwright/test": "1.27.1",
32-
"@strapi/icons": "^1.6.5",
32+
"@strapi/icons": "^1.6.6",
3333
"@swc/core": "^1.3.11",
3434
"@swc/jest": "^0.2.23",
3535
"@testing-library/jest-dom": "5.16.5",
@@ -62,6 +62,7 @@
6262
"develop": "vite build --watch",
6363
"build": "yarn build:prod",
6464
"build:prod": "vite build",
65+
"clean": "rm -rf dist node_modules",
6566
"generate:types": "tsc --noEmit false --emitDeclarationOnly --declarationDir dist",
6667
"lint": "eslint . --ext .js,.jsx,.tsx,.ts",
6768
"format": "yarn lint --fix",

packages/strapi-design-system/src/BaseButton/BaseButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface BaseButtonProps<TElement extends HTMLElement = HTMLButtonElemen
2828
}
2929

3030
export const BaseButton = React.forwardRef<HTMLButtonElement, BaseButtonProps>(
31-
({ disabled, children, ...props }, ref) => {
31+
({ disabled, children, background = 'neutral0', ...props }, ref) => {
3232
return (
3333
<BaseButtonWrapper
3434
ref={ref}
@@ -38,7 +38,7 @@ export const BaseButton = React.forwardRef<HTMLButtonElement, BaseButtonProps>(
3838
disabled={disabled}
3939
padding={2}
4040
hasRadius
41-
background="neutral0"
41+
background={background}
4242
borderColor="neutral200"
4343
cursor="pointer"
4444
{...props}

packages/strapi-design-system/src/DatePicker/DatePicker.js

-138
This file was deleted.

0 commit comments

Comments
 (0)