agroptima-design-system 0.22.5 → 0.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +10 -0
- package/.storybook/preview.ts +2 -0
- package/package.json +13 -12
- package/src/atoms/Alert.scss +3 -2
- package/src/atoms/Button/IconButton.tsx +4 -2
- package/src/atoms/CardsTable/CardsTable.scss +1 -2
- package/src/settings/_config.scss +1 -1
- package/src/stories/Changelog.mdx +5 -0
- package/src/stories/IconButton.stories.ts +4 -0
package/.storybook/main.ts
CHANGED
|
@@ -10,6 +10,7 @@ function getAbsolutePath(value: string): any {
|
|
|
10
10
|
}
|
|
11
11
|
const config: StorybookConfig = {
|
|
12
12
|
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
13
|
+
|
|
13
14
|
addons: [
|
|
14
15
|
getAbsolutePath('@storybook/addon-links'),
|
|
15
16
|
getAbsolutePath('@storybook/addon-essentials'),
|
|
@@ -17,14 +18,19 @@ const config: StorybookConfig = {
|
|
|
17
18
|
'@storybook/addon-a11y',
|
|
18
19
|
'@storybook/addon-designs',
|
|
19
20
|
'@storybook/addon-mdx-gfm',
|
|
21
|
+
'@chromatic-com/storybook'
|
|
20
22
|
],
|
|
23
|
+
|
|
21
24
|
framework: {
|
|
22
25
|
name: '@storybook/nextjs',
|
|
23
26
|
options: {},
|
|
24
27
|
},
|
|
28
|
+
|
|
25
29
|
docs: {},
|
|
30
|
+
|
|
26
31
|
core: {},
|
|
27
32
|
staticDirs: ['../public'],
|
|
33
|
+
|
|
28
34
|
webpackFinal: async (config) => {
|
|
29
35
|
const pathToInlineSvg = resolve(__dirname, '../src/icons')
|
|
30
36
|
|
|
@@ -52,5 +58,9 @@ const config: StorybookConfig = {
|
|
|
52
58
|
|
|
53
59
|
return config
|
|
54
60
|
},
|
|
61
|
+
|
|
62
|
+
typescript: {
|
|
63
|
+
reactDocgen: 'react-docgen-typescript'
|
|
64
|
+
}
|
|
55
65
|
}
|
|
56
66
|
export default config
|
package/.storybook/preview.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.6",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "npm run storybook",
|
|
6
6
|
"storybook": "storybook dev -p 6006 --ci",
|
|
@@ -15,22 +15,23 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@storybook/addon-designs": "^8.0.3",
|
|
18
|
-
"@storybook/addon-viewport": "^8.2.
|
|
18
|
+
"@storybook/addon-viewport": "^8.2.5",
|
|
19
19
|
"next": "^14.0.3",
|
|
20
20
|
"react": "^18.2.0",
|
|
21
21
|
"react-dom": "^18.2.0",
|
|
22
22
|
"sass": "^1.69.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@storybook
|
|
26
|
-
"@storybook/addon-
|
|
27
|
-
"@storybook/addon-
|
|
28
|
-
"@storybook/addon-
|
|
29
|
-
"@storybook/addon-
|
|
30
|
-
"@storybook/
|
|
31
|
-
"@storybook/
|
|
32
|
-
"@storybook/
|
|
33
|
-
"@storybook/
|
|
25
|
+
"@chromatic-com/storybook": "^1.6.1",
|
|
26
|
+
"@storybook/addon-a11y": "^8.2.5",
|
|
27
|
+
"@storybook/addon-essentials": "^8.2.5",
|
|
28
|
+
"@storybook/addon-interactions": "^8.2.5",
|
|
29
|
+
"@storybook/addon-links": "^8.2.5",
|
|
30
|
+
"@storybook/addon-mdx-gfm": "^8.2.5",
|
|
31
|
+
"@storybook/blocks": "^8.2.5",
|
|
32
|
+
"@storybook/nextjs": "^8.2.5",
|
|
33
|
+
"@storybook/react": "^8.2.5",
|
|
34
|
+
"@storybook/test": "^8.2.5",
|
|
34
35
|
"@svgr/webpack": "^8.1.0",
|
|
35
36
|
"@testing-library/jest-dom": "^6.4.2",
|
|
36
37
|
"@testing-library/react": "^14.2.2",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"jest": "^29.7.0",
|
|
48
49
|
"jest-axe": "^8.0.0",
|
|
49
50
|
"jest-environment-jsdom": "^29.7.0",
|
|
50
|
-
"storybook": "^8.2.
|
|
51
|
+
"storybook": "^8.2.5",
|
|
51
52
|
"ts-node": "^10.9.2",
|
|
52
53
|
"typescript": "^5"
|
|
53
54
|
},
|
package/src/atoms/Alert.scss
CHANGED
|
@@ -9,6 +9,7 @@ interface CustomProps {
|
|
|
9
9
|
icon: IconType
|
|
10
10
|
variant?: Variant
|
|
11
11
|
disabled?: boolean
|
|
12
|
+
visible?: boolean
|
|
12
13
|
accessibilityLabel: string
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -18,17 +19,18 @@ export function IconButton({
|
|
|
18
19
|
accessibilityLabel,
|
|
19
20
|
icon,
|
|
20
21
|
disabled,
|
|
22
|
+
visible = true,
|
|
21
23
|
variant = 'primary',
|
|
22
24
|
...props
|
|
23
25
|
}: IconButtonProps) {
|
|
24
|
-
|
|
26
|
+
if (!visible) return null
|
|
25
27
|
|
|
26
28
|
return (
|
|
27
29
|
<BaseButton
|
|
28
30
|
disabled={disabled}
|
|
29
31
|
aria-label={accessibilityLabel}
|
|
30
32
|
{...props}
|
|
31
|
-
className={
|
|
33
|
+
className={classNames(props.className, 'icon-button', variant)}
|
|
32
34
|
>
|
|
33
35
|
<Icon name={icon} />
|
|
34
36
|
</BaseButton>
|
|
@@ -175,7 +175,6 @@
|
|
|
175
175
|
td.actions {
|
|
176
176
|
order: 0;
|
|
177
177
|
justify-content: center;
|
|
178
|
-
flex: 1;
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
td:has(.badge) {
|
|
@@ -249,7 +248,7 @@
|
|
|
249
248
|
inset: auto config.$space-3x config.$space-3x auto;
|
|
250
249
|
}
|
|
251
250
|
tr:has(.badge) {
|
|
252
|
-
padding-bottom: config.$space-
|
|
251
|
+
padding-bottom: config.$space-10x;
|
|
253
252
|
}
|
|
254
253
|
}
|
|
255
254
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Pending to clean the non-used agroptima variables and -bodegas from the name
|
|
2
2
|
/* Variables */
|
|
3
|
+
$space-halfx: 2px;
|
|
3
4
|
$space-1x: 4px;
|
|
4
5
|
$space-2x: 8px;
|
|
5
6
|
$space-3x: 12px;
|
|
6
7
|
$space-4x: 16px;
|
|
7
8
|
$space-5x: 20px;
|
|
8
|
-
$space-halfx: 2px;
|
|
9
9
|
$space-6x: 24px;
|
|
10
10
|
$space-7x: 28px;
|
|
11
11
|
$space-8x: 32px;
|
|
@@ -19,6 +19,10 @@ const meta = {
|
|
|
19
19
|
description: 'Icon from a list of values',
|
|
20
20
|
control: { type: 'select' },
|
|
21
21
|
},
|
|
22
|
+
visible: {
|
|
23
|
+
description: 'Is the button visible?',
|
|
24
|
+
control: { type: 'boolean', default: true },
|
|
25
|
+
},
|
|
22
26
|
href: {
|
|
23
27
|
description:
|
|
24
28
|
'If a link is provided, the component will be rendered as NextLink, otherwise as button',
|