agroptima-design-system 0.22.2 → 0.22.4-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.22.2",
3
+ "version": "0.22.4-beta.1",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -1,5 +1,4 @@
1
1
  import { classNames } from '../utils/classNames'
2
- import { Button, ButtonProps } from './Button'
3
2
  import './EmptyState.scss'
4
3
  import { Icon, IconType } from './Icon'
5
4
 
@@ -7,25 +6,21 @@ export type Variant = 'primary'
7
6
 
8
7
  export interface EmptyStateProps extends React.ComponentPropsWithoutRef<'div'> {
9
8
  icon?: IconType
10
- text?: string
11
9
  variant?: Variant
12
- button?: ButtonProps
13
10
  }
14
11
 
15
12
  export function EmptyState({
16
13
  className,
17
14
  icon = 'EmptyState',
18
- text = 'No data',
19
15
  variant = 'primary',
20
- button,
16
+ children,
21
17
  }: EmptyStateProps): React.JSX.Element {
22
18
  const cssClasses = classNames('empty-state', variant, className)
23
19
 
24
20
  return (
25
21
  <div className={cssClasses}>
26
22
  <Icon name={icon} />
27
- <p>{text}</p>
28
- {button?.label && <Button {...button} />}
23
+ {children}
29
24
  </div>
30
25
  )
31
26
  }
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 1.5 16 0l-1.5 1.5L13 0l-1.5 1.5L10 0 8.5 1.5 7 0 5.5 1.5 4 0 2.5 1.5 1 0v20l1.5-1.5L4 20l1.5-1.5L7 20l1.5-1.5L10 20l1.5-1.5L13 20l1.5-1.5L16 20l1.5-1.5L19 20V0l-1.5 1.5ZM17 17.09H3V2.91h14v14.18ZM4 13h12v2H4v-2Zm0-4h12v2H4V9Zm0-4h12v2H4V5Z" fill="#161C26"/></svg>
@@ -36,6 +36,7 @@ import Show from './show.svg'
36
36
  import ShowOff from './show-off.svg'
37
37
  import Sorter from './sorter.svg'
38
38
  import Warning from './warning.svg'
39
+ import DeliveryNote from './delivery-note.svg'
39
40
 
40
41
  export {
41
42
  Add,
@@ -54,6 +55,7 @@ export {
54
55
  Close,
55
56
  Comment,
56
57
  Delete,
58
+ DeliveryNote,
57
59
  Done,
58
60
  DoubleArrowLeft,
59
61
  DoubleArrowRight,
@@ -4,6 +4,16 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ # 0.22.4
8
+
9
+ BREAKING CHANGES
10
+
11
+ * EmptyState text and button props have been removed and children elements can be passed to the component.
12
+
13
+ # 0.22.3
14
+
15
+ * Add Delivery Note icon
16
+
7
17
  # 0.22.2
8
18
 
9
19
  * Add IconButton secondary variant
@@ -0,0 +1,46 @@
1
+ import { Button } from '../atoms/Button'
2
+ import { EmptyState } from '../atoms/EmptyState'
3
+
4
+ const figmaPrimaryDesign = {
5
+ design: {
6
+ type: 'figma',
7
+ url: 'https://www.figma.com/file/DN2ova21vWqCRvPspBXgI1/Design-System?type=design&node-id=1719-258&mode=dev',
8
+ },
9
+ }
10
+
11
+ const meta = {
12
+ title: 'Design System/Atoms/EmptyState',
13
+ component: EmptyState,
14
+ tags: ['autodocs'],
15
+ argTypes: {
16
+ icon: {
17
+ description: 'A default icon is set for the empty state.',
18
+ },
19
+ variant: {
20
+ description: 'Variant used.',
21
+ },
22
+ },
23
+ parameters: figmaPrimaryDesign,
24
+ }
25
+
26
+ export default meta
27
+
28
+ export const PrimaryCustom = {
29
+ render: () => (
30
+ <EmptyState variant="primary">
31
+ <p>
32
+ There are no videogames yet. You can import videogames to your{' '}
33
+ <a href="#">list</a>.
34
+ </p>
35
+ <Button label="Import videogames" onClick={() => alert('click')}></Button>
36
+ </EmptyState>
37
+ ),
38
+ }
39
+
40
+ export const PrimaryBasic = {
41
+ render: () => (
42
+ <EmptyState variant="primary">
43
+ <p>No data</p>
44
+ </EmptyState>
45
+ ),
46
+ }
package/tsconfig.json CHANGED
@@ -22,6 +22,6 @@
22
22
  "@/*": ["./src/*"]
23
23
  }
24
24
  },
25
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/stories/CardsTable.stories.js", "src/stories/Modal.stories.js", "src/stories/Typography.stories.mdx", "src/stories/Card.stories.js", "src/stories/Menu.stories.js"],
25
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/stories/CardsTable.stories.js", "src/stories/Modal.stories.js", "src/stories/Typography.stories.mdx", "src/stories/Card.stories.js", "src/stories/Menu.stories.js", "src/stories/EmptyState.stories.js"],
26
26
  "exclude": ["node_modules"]
27
27
  }
@@ -1,54 +0,0 @@
1
- import { EmptyState } from '../atoms/EmptyState'
2
- import { StoryObj } from '@storybook/react'
3
-
4
- const meta = {
5
- title: 'Design System/Atoms/EmptyState',
6
- component: EmptyState,
7
- tags: ['autodocs'],
8
- argTypes: {
9
- icon: {
10
- description: 'A default icon is set for the empty state.',
11
- },
12
- text: {
13
- description: 'Label used to describe the empty state.',
14
- },
15
- variant: {
16
- description: 'Variant used.',
17
- },
18
- buttonLabel: {
19
- description: 'Label used on the button.',
20
- },
21
- action: {
22
- description: 'Action called when button is pressed.',
23
- },
24
- },
25
- }
26
-
27
- const figmaPrimaryDesign = {
28
- design: {
29
- type: 'figma',
30
- url: 'https://www.figma.com/file/DN2ova21vWqCRvPspBXgI1/Design-System?type=design&node-id=1719-258&mode=dev',
31
- },
32
- }
33
-
34
- export default meta
35
- type Story = StoryObj<typeof meta>
36
-
37
- export const PrimaryCustom: Story = {
38
- args: {
39
- variant: 'primary',
40
- text: 'There are no videogames yet. You can import videogames to your list.',
41
- button: {
42
- label: 'Import videogames',
43
- onClick: () => alert('click'),
44
- },
45
- },
46
- parameters: figmaPrimaryDesign,
47
- }
48
-
49
- export const PrimaryBasic: Story = {
50
- args: {
51
- variant: 'primary',
52
- },
53
- parameters: figmaPrimaryDesign,
54
- }