agroptima-design-system 0.34.4-beta.0 → 0.34.4

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.34.4-beta.0",
3
+ "version": "0.34.4",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -14,7 +14,7 @@ $border-line: 1px solid color_alias.$neutral-color-200;
14
14
  .line {
15
15
  border: $border-line;
16
16
  }
17
-
17
+
18
18
  .long {
19
19
  flex: 1;
20
20
  margin-left: config.$space-3x;
@@ -28,4 +28,10 @@ $border-line: 1px solid color_alias.$neutral-color-200;
28
28
  .icon {
29
29
  margin-right: config.$space-2x;
30
30
  }
31
+
32
+ .link {
33
+ color: color_alias.$primary-color-600;
34
+ text-decoration-line: underline;
35
+ cursor: default;
36
+ }
31
37
  }
@@ -1,4 +1,5 @@
1
1
  import './Divider.scss'
2
+ import Link from 'next/link'
2
3
  import { classNames } from '../utils/classNames'
3
4
  import type { IconType } from './Icon'
4
5
  import { Icon } from './Icon'
@@ -7,13 +8,17 @@ export interface DividerProps extends React.ComponentPropsWithoutRef<'div'> {
7
8
  title: string
8
9
  variant?: string
9
10
  icon?: IconType
11
+ hasAction?: boolean
12
+ onClick?: () => void
10
13
  }
11
14
 
12
15
  export function Divider({
13
16
  title,
14
17
  variant = 'primary',
15
18
  icon,
19
+ hasAction,
16
20
  className,
21
+ onClick = () => {},
17
22
  }: DividerProps) {
18
23
  const cssClasses = classNames('divider', variant, className)
19
24
 
@@ -24,7 +29,9 @@ export function Divider({
24
29
  ) : (
25
30
  <div className="short line"></div>
26
31
  )}
27
- <span>{title}</span>
32
+ <span onClick={onClick} className={classNames({ link: hasAction })}>
33
+ {title}
34
+ </span>
28
35
  <div className="long line"></div>
29
36
  </div>
30
37
  )
@@ -8,6 +8,10 @@ import { Meta } from "@storybook/blocks";
8
8
 
9
9
  * Update DatePicker related stories with a defaultValue
10
10
 
11
+ ## 0.33.4
12
+
13
+ * Add hasAction and onClick props to Divider component
14
+
11
15
  ## 0.33.1
12
16
 
13
17
  * Add onChange prop to RadioGroup component
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import { Button } from '../atoms/Button'
3
3
  import { Card } from '../atoms/Card'
4
4
  import { Collapsible } from '../atoms/Collapsible'
5
+ import { Divider } from '../atoms/Divider'
5
6
  import { Actions, Form as FormComponent } from '../atoms/Form'
6
7
  import { FormContainer } from '../atoms/Form'
7
8
  import { Input } from '../atoms/Input'
@@ -102,6 +103,7 @@ export const PrimaryOpened = {
102
103
  render: () => (
103
104
  <>
104
105
  <Collapsible title="My personal data" name="personal-data" open>
106
+ <Divider title="19/01/2025 - My gaming diary" variant="primary" />
105
107
  <FormContainer fluid>
106
108
  <Input
107
109
  accessibilityLabel="Fill the form name"
@@ -8,7 +8,7 @@ const meta = {
8
8
  docs: {
9
9
  description: {
10
10
  component:
11
- '<h2>Usage guidelines</h2><p>DateRangePicker component allows users to select past, present, or future dates in a visual way in range or single format.</p>',
11
+ '<h2>Usage guidelines</h2><p>DateRangePicker component allows users to select past, present, or future dates in a visual way in range or single format. To avoid problems with Chromatic builds, always add a defaultValue.</p>',
12
12
  },
13
13
  },
14
14
  },
@@ -8,7 +8,7 @@ const meta = {
8
8
  docs: {
9
9
  description: {
10
10
  component:
11
- '<h2>Usage guidelines</h2><p>DateRangePicker component allows users to select past, present, or future dates in a visual way in range or single format.</p>',
11
+ '<h2>Usage guidelines</h2><p>DateRangePicker component allows users to select past, present, or future dates in a visual way in range or single format. To avoid problems with Chromatic builds, always add a defaultValue.</p>',
12
12
  },
13
13
  },
14
14
  },
@@ -50,3 +50,13 @@ export const WithIcon: Story = {
50
50
  },
51
51
  parameters: figmaPrimaryDesign,
52
52
  }
53
+
54
+ export const WithLink: Story = {
55
+ args: {
56
+ title: '19/01/2025 - My gaming diary',
57
+ variant: 'primary',
58
+ hasAction: true,
59
+ onClick: () => alert('click'),
60
+ },
61
+ parameters: figmaPrimaryDesign,
62
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
- import { Button, IconButton } from '../atoms/Button'
3
- import { Card } from '../atoms/Card'
4
- import { DetailItem } from '../atoms/DetailItem'
2
+ import { Button } from '../atoms/Button'
3
+ import { Collapsible } from '../atoms/Collapsible'
4
+ import { Divider } from '../atoms/Divider'
5
5
  import { FormContainer } from '../atoms/Form'
6
6
  import { Input } from '../atoms/Input'
7
7
  import {
@@ -393,32 +393,39 @@ const OpenAndCloseFormModal = () => {
393
393
  { label: 'Save', type: 'submit' },
394
394
  ]}
395
395
  >
396
- <FormContainer fluid>
397
- <Input name="input" label="Input" placeholder="Type something" />
398
- <Select
399
- label="Select"
400
- name="select"
401
- helpText="This is a help text"
402
- placeholder="Select an option"
403
- options={[
404
- { id: '1', label: 'Option 1' },
405
- { id: '2', label: 'Option 2' },
406
- { id: '3', label: 'Option 3' },
407
- { id: '4', label: 'Option 4' },
408
- { id: '5', label: 'Option 5' },
409
- { id: '6', label: 'Option 6' },
410
- { id: '7', label: 'Option 7' },
411
- { id: '8', label: 'Option 8' },
412
- { id: '9', label: 'Option 9' },
413
- { id: '10', label: 'Option 10' },
414
- { id: '11', label: 'Option 11' },
415
- { id: '12', label: 'Option 12' },
416
- { id: '13', label: 'Option 13' },
417
- { id: '14', label: 'Option 14' },
418
- { id: '15', label: 'Option 15' },
419
- ]}
396
+ <Collapsible title="My personal data" name="personal-data">
397
+ <Divider
398
+ title="19/01/2025 - My gaming diary"
399
+ variant="primary"
400
+ href="link.com"
420
401
  />
421
- </FormContainer>
402
+ <FormContainer fluid>
403
+ <Input name="input" label="Input" placeholder="Type something" />
404
+ <Select
405
+ label="Select"
406
+ name="select"
407
+ helpText="This is a help text"
408
+ placeholder="Select an option"
409
+ options={[
410
+ { id: '1', label: 'Option 1' },
411
+ { id: '2', label: 'Option 2' },
412
+ { id: '3', label: 'Option 3' },
413
+ { id: '4', label: 'Option 4' },
414
+ { id: '5', label: 'Option 5' },
415
+ { id: '6', label: 'Option 6' },
416
+ { id: '7', label: 'Option 7' },
417
+ { id: '8', label: 'Option 8' },
418
+ { id: '9', label: 'Option 9' },
419
+ { id: '10', label: 'Option 10' },
420
+ { id: '11', label: 'Option 11' },
421
+ { id: '12', label: 'Option 12' },
422
+ { id: '13', label: 'Option 13' },
423
+ { id: '14', label: 'Option 14' },
424
+ { id: '15', label: 'Option 15' },
425
+ ]}
426
+ />
427
+ </FormContainer>
428
+ </Collapsible>
422
429
  </Modal>
423
430
 
424
431
  <Button