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.
@@ -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
@@ -26,6 +26,8 @@ const preview: Preview = {
26
26
  viewports: INITIAL_VIEWPORTS,
27
27
  },
28
28
  },
29
+
30
+ tags: ['autodocs']
29
31
  }
30
32
 
31
33
  export default preview
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.22.5",
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.1",
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/addon-a11y": "^8.2.1",
26
- "@storybook/addon-essentials": "^8.2.1",
27
- "@storybook/addon-interactions": "^8.2.1",
28
- "@storybook/addon-links": "^8.2.1",
29
- "@storybook/addon-mdx-gfm": "^8.2.1",
30
- "@storybook/blocks": "^8.2.1",
31
- "@storybook/nextjs": "^8.2.1",
32
- "@storybook/react": "^8.2.1",
33
- "@storybook/test": "^8.2.1",
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.1",
51
+ "storybook": "^8.2.5",
51
52
  "ts-node": "^10.9.2",
52
53
  "typescript": "^5"
53
54
  },
@@ -37,9 +37,10 @@
37
37
  height: 100%;
38
38
  }
39
39
  }
40
-
41
- .icon-button {
40
+ button {
42
41
  pointer-events: auto;
42
+ }
43
+ .icon-button {
43
44
  margin-top: 5px;
44
45
  .icon {
45
46
  width: config.$icon-size-3x;
@@ -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
- const cssClasses = classNames(props.className, 'icon-button', variant)
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={cssClasses}
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-9x;
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;
@@ -4,6 +4,11 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ # 0.22.6
8
+
9
+ * Add property to IconButton component for set the visibility.
10
+ * Fix table actions alignment in CardTable component.
11
+
7
12
  # 0.22.5
8
13
 
9
14
  * Add more actions to CardTable component.
@@ -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',