agroptima-design-system 0.27.21 → 0.27.23
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 +2 -2
- package/.storybook/preview.ts +2 -2
- package/eslint.config.mjs +15 -3
- package/package.json +10 -9
- package/src/atoms/Alert/Alert.tsx +4 -3
- package/src/atoms/Alert/AlertContainer.tsx +1 -1
- package/src/atoms/Badge.tsx +2 -2
- package/src/atoms/Button/Button.tsx +5 -5
- package/src/atoms/Button/FloatingButton.tsx +3 -3
- package/src/atoms/Button/IconButton.tsx +3 -3
- package/src/atoms/Button/SubmitButton.tsx +1 -1
- package/src/atoms/Button/index.ts +5 -5
- package/src/atoms/Card/Card.tsx +1 -1
- package/src/atoms/Card/index.ts +2 -2
- package/src/atoms/CardMenu/CardMenuOption.tsx +4 -4
- package/src/atoms/CardsTable/CardsTable.tsx +1 -1
- package/src/atoms/CardsTable/CardsTableCell.tsx +1 -1
- package/src/atoms/CardsTable/CardsTableRow.tsx +1 -1
- package/src/atoms/CardsTable/index.ts +5 -5
- package/src/atoms/CardsTableList.tsx +6 -6
- package/src/atoms/CheckableTag/CheckableTag.tsx +1 -1
- package/src/atoms/CheckableTag/CheckableTagGroup.tsx +1 -1
- package/src/atoms/Checkbox.tsx +1 -1
- package/src/atoms/Collapsible.tsx +1 -1
- package/src/atoms/DetailItem.tsx +1 -1
- package/src/atoms/Drawer.tsx +2 -2
- package/src/atoms/EmptyState.tsx +2 -2
- package/src/atoms/Form/Actions.tsx +1 -1
- package/src/atoms/Form/Form.tsx +1 -1
- package/src/atoms/Form/index.ts +2 -2
- package/src/atoms/Icon.tsx +2 -2
- package/src/atoms/Input.tsx +5 -5
- package/src/atoms/Menu/MenuDropdown.tsx +2 -2
- package/src/atoms/Menu/MenuLink.tsx +4 -4
- package/src/atoms/Menu/index.ts +2 -2
- package/src/atoms/Modal.tsx +2 -2
- package/src/atoms/Multiselect.tsx +6 -6
- package/src/atoms/Pagination/Ellipsis.tsx +1 -1
- package/src/atoms/Pagination/Pagination.tsx +1 -1
- package/src/atoms/Pagination/PaginationArrow.tsx +2 -2
- package/src/atoms/Pagination/PaginationNumber.tsx +2 -2
- package/src/atoms/Pagination/index.ts +2 -2
- package/src/atoms/Popover/Popover.tsx +3 -3
- package/src/atoms/Popover/PopoverMenu.tsx +1 -1
- package/src/atoms/Popover/PopoverMenuOption.tsx +2 -2
- package/src/atoms/QuantitySelector.tsx +3 -3
- package/src/atoms/RadioButton.tsx +1 -1
- package/src/atoms/Select.tsx +7 -7
- package/src/atoms/TextArea.tsx +2 -2
- package/src/icons/index.tsx +2 -2
- package/src/stories/Card.stories.js +1 -1
- package/src/stories/CardsTable.stories.js +5 -6
- package/src/stories/CardsTableList.stories.ts +1 -1
- package/src/stories/Changelog.mdx +5 -0
- package/src/stories/Collapsible.stories.js +3 -3
- package/src/stories/Drawer.stories.js +2 -3
- package/src/stories/Form.stories.js +2 -2
- package/src/stories/Input.stories.ts +1 -1
- package/src/stories/Menu.stories.js +1 -2
- package/src/stories/Modal.stories.js +3 -3
- package/src/stories/Multiselect.stories.ts +1 -1
- package/src/stories/Pagination.stories.js +1 -2
- package/src/stories/Popover.stories.js +1 -1
- package/src/stories/QuantitySelector.stories.ts +1 -1
- package/src/stories/Select.stories.ts +1 -1
- package/src/stories/TextArea.stories.ts +1 -1
- package/tests/Alert.spec.tsx +2 -2
- package/tests/Badge.spec.tsx +2 -2
- package/tests/Button.spec.tsx +3 -3
- package/tests/Card.spec.tsx +2 -2
- package/tests/CardMenuOption.spec.tsx +1 -1
- package/tests/CardsTable.spec.tsx +6 -6
- package/tests/CheckableTag.spec.tsx +2 -2
- package/tests/Checkbox.spec.tsx +1 -1
- package/tests/Collapsible.spec.tsx +1 -1
- package/tests/Drawer.spec.tsx +3 -3
- package/tests/EmptyState.spec.tsx +2 -2
- package/tests/FloatingButton.spec.tsx +3 -3
- package/tests/Icon.spec.tsx +1 -1
- package/tests/IconButton.spec.tsx +3 -3
- package/tests/Input.spec.tsx +1 -1
- package/tests/Menu.spec.tsx +2 -2
- package/tests/Modal.spec.tsx +1 -1
- package/tests/Multiselect.spec.tsx +2 -2
- package/tests/Pagination.spec.tsx +2 -2
- package/tests/Popover.spec.tsx +2 -2
- package/tests/Select.spec.tsx +1 -1
- package/tests/a11y.spec.tsx +0 -1
- package/tests/library.ts +2 -2
package/src/atoms/Select.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import './Select.scss'
|
|
2
3
|
import React, { useRef, useState } from 'react'
|
|
3
|
-
import { Icon } from './Icon'
|
|
4
|
-
import { IconButton } from './Button'
|
|
5
|
-
import { classNames } from '../utils/classNames'
|
|
6
|
-
import { buildHelpText } from '../utils/buildHelpText'
|
|
7
|
-
import { useOutsideClick } from '../hooks/useOutsideClick'
|
|
8
4
|
import { useOpen } from '../hooks/useOpen'
|
|
9
|
-
import '
|
|
10
|
-
import { Input } from './Input'
|
|
5
|
+
import { useOutsideClick } from '../hooks/useOutsideClick'
|
|
11
6
|
import { useSearch } from '../hooks/useSearch'
|
|
7
|
+
import { buildHelpText } from '../utils/buildHelpText'
|
|
8
|
+
import { classNames } from '../utils/classNames'
|
|
9
|
+
import { IconButton } from './Button'
|
|
10
|
+
import { Icon } from './Icon'
|
|
11
|
+
import { Input } from './Input'
|
|
12
12
|
|
|
13
13
|
export type Variant = 'primary'
|
|
14
14
|
export type Option = { id: string; label: string }
|
package/src/atoms/TextArea.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { classNames } from '../utils/classNames'
|
|
2
|
-
import { buildHelpText } from '../utils/buildHelpText'
|
|
3
1
|
import './Input.scss'
|
|
2
|
+
import { buildHelpText } from '../utils/buildHelpText'
|
|
3
|
+
import { classNames } from '../utils/classNames'
|
|
4
4
|
|
|
5
5
|
export type TextAreaVariant = 'primary'
|
|
6
6
|
|
package/src/icons/index.tsx
CHANGED
|
@@ -6,11 +6,11 @@ import AngleRight from './angle-right.svg'
|
|
|
6
6
|
import AngleUp from './angle-up.svg'
|
|
7
7
|
import ArrowBack from './arrow-back.svg'
|
|
8
8
|
import Calendar from './calendar.svg'
|
|
9
|
+
import ChangePassword from './change-password.svg'
|
|
9
10
|
import Check from './check.svg'
|
|
10
11
|
import CheckboxActive from './checkbox-active.svg'
|
|
11
12
|
import CheckboxInactive from './checkbox-inactive.svg'
|
|
12
13
|
import CheckboxIndeterminate from './checkbox-indeterminate.svg'
|
|
13
|
-
import ChangePassword from './change-password.svg'
|
|
14
14
|
import Client from './client.svg'
|
|
15
15
|
import Close from './close.svg'
|
|
16
16
|
import Comment from './comment.svg'
|
|
@@ -34,6 +34,7 @@ import Invoice from './invoice.svg'
|
|
|
34
34
|
import Loading from './loading.svg'
|
|
35
35
|
import Logout from './logout.svg'
|
|
36
36
|
import Minus from './minus.svg'
|
|
37
|
+
import PDF from './pdf.svg'
|
|
37
38
|
import Product from './product.svg'
|
|
38
39
|
import ReturnDeliveryNote from './return-delivery-note.svg'
|
|
39
40
|
import Salesman from './salesman.svg'
|
|
@@ -46,7 +47,6 @@ import Sorter from './sorter.svg'
|
|
|
46
47
|
import Upload from './upload.svg'
|
|
47
48
|
import UserMenu from './user-menu.svg'
|
|
48
49
|
import Warning from './warning.svg'
|
|
49
|
-
import PDF from './pdf.svg'
|
|
50
50
|
|
|
51
51
|
export {
|
|
52
52
|
Add,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconButton } from '../atoms/Button'
|
|
2
|
-
import { Card, CardHeader, CardContent, CardFooter } from '../atoms/Card'
|
|
3
2
|
import { Button } from '../atoms/Button'
|
|
3
|
+
import { Card, CardContent, CardFooter, CardHeader } from '../atoms/Card'
|
|
4
4
|
|
|
5
5
|
const figmaPrimaryDesign = {
|
|
6
6
|
design: {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
2
|
+
import { Badge } from '../atoms/Badge'
|
|
3
|
+
import { IconButton } from '../atoms/Button'
|
|
4
|
+
import { Button } from '../atoms/Button'
|
|
3
5
|
import {
|
|
4
6
|
CardsTable,
|
|
7
|
+
CardsTableBody,
|
|
8
|
+
CardsTableCell,
|
|
5
9
|
CardsTableHead,
|
|
6
10
|
CardsTableHeader,
|
|
7
11
|
CardsTableRow,
|
|
8
|
-
CardsTableBody,
|
|
9
|
-
CardsTableCell,
|
|
10
12
|
} from '../atoms/CardsTable'
|
|
11
|
-
import { IconButton } from '../atoms/Button'
|
|
12
|
-
import { Badge } from '../atoms/Badge'
|
|
13
13
|
import { Checkbox } from '../atoms/Checkbox'
|
|
14
14
|
import { Popover, PopoverMenu, PopoverMenuOption } from '../atoms/Popover'
|
|
15
|
-
import { Button } from '../atoms/Button'
|
|
16
15
|
|
|
17
16
|
const figmaPrimaryDesign = {
|
|
18
17
|
design: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { Button } from '../atoms/Button'
|
|
3
|
+
import { Card } from '../atoms/Card'
|
|
2
4
|
import { Collapsible } from '../atoms/Collapsible'
|
|
5
|
+
import { Actions, Form as FormComponent } from '../atoms/Form'
|
|
3
6
|
import { Input } from '../atoms/Input'
|
|
4
7
|
import { Select } from '../atoms/Select'
|
|
5
|
-
import { Card } from '../atoms/Card'
|
|
6
|
-
import { Form as FormComponent, Actions } from '../atoms/Form'
|
|
7
|
-
import { Button } from '../atoms/Button'
|
|
8
8
|
|
|
9
9
|
const figmaPrimaryDesign = {
|
|
10
10
|
design: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { Drawer } from '../atoms/Drawer'
|
|
4
|
-
import { CheckableTagGroup, CheckableTag } from '../atoms/CheckableTag'
|
|
2
|
+
import { CheckableTag, CheckableTagGroup } from '../atoms/CheckableTag'
|
|
5
3
|
import { Collapsible } from '../atoms/Collapsible'
|
|
4
|
+
import { Drawer } from '../atoms/Drawer'
|
|
6
5
|
|
|
7
6
|
const figmaPrimaryDesign = {
|
|
8
7
|
design: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Form, Actions } from '../atoms/Form'
|
|
2
|
-
import { Input } from '../atoms/Input'
|
|
3
1
|
import { Button } from '../atoms/Button'
|
|
2
|
+
import { Actions, Form } from '../atoms/Form'
|
|
3
|
+
import { Input } from '../atoms/Input'
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Design System/Atoms/Form',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Modal } from '../atoms/Modal'
|
|
3
|
-
import { DetailItem } from '../atoms/DetailItem'
|
|
4
|
-
import { Collapsible } from '../atoms/Collapsible'
|
|
5
2
|
import { Card } from '../atoms/Card'
|
|
3
|
+
import { Collapsible } from '../atoms/Collapsible'
|
|
4
|
+
import { DetailItem } from '../atoms/DetailItem'
|
|
5
|
+
import { Modal } from '../atoms/Modal'
|
|
6
6
|
|
|
7
7
|
const figmaPrimaryDesign = {
|
|
8
8
|
design: {
|
package/tests/Alert.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { screen, render } from '@testing-library/react'
|
|
4
3
|
import { Alert } from '../src/atoms/Alert'
|
|
4
|
+
import type { Variant } from '../src/atoms/Alert/Alert'
|
|
5
5
|
|
|
6
6
|
describe('Alert', () => {
|
|
7
7
|
const variants = ['info', 'success', 'warning', 'error']
|
package/tests/Badge.spec.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Variant } from '../src/atoms/Badge'
|
|
2
|
-
import React from 'react'
|
|
3
1
|
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import type { Variant } from '../src/atoms/Badge'
|
|
4
4
|
import { Badge } from '../src/atoms/Badge'
|
|
5
5
|
|
|
6
6
|
describe('Badge', () => {
|
package/tests/Button.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { screen, render, getByRole } from '@testing-library/react'
|
|
1
|
+
import { getByRole, render, screen } from '@testing-library/react'
|
|
4
2
|
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import type { ButtonVariant } from '../src/atoms/Button/Button'
|
|
5
5
|
import { Button } from '../src/atoms/Button/Button'
|
|
6
6
|
|
|
7
7
|
describe('Button', () => {
|
package/tests/Card.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
3
|
-
import
|
|
2
|
+
import React from 'react'
|
|
4
3
|
import { Button } from '../src/atoms/Button'
|
|
4
|
+
import { Card, CardContent, CardFooter, CardHeader } from '../src/atoms/Card'
|
|
5
5
|
|
|
6
6
|
describe('Product card', () => {
|
|
7
7
|
it('renders the expected structure and data', () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Badge } from '../src/atoms/Badge'
|
|
4
|
+
import { IconButton } from '../src/atoms/Button'
|
|
3
5
|
import {
|
|
6
|
+
Alignment,
|
|
4
7
|
CardsTable,
|
|
8
|
+
CardsTableBody,
|
|
9
|
+
CardsTableCell,
|
|
5
10
|
CardsTableHead,
|
|
6
11
|
CardsTableHeader,
|
|
7
12
|
CardsTableRow,
|
|
8
|
-
CardsTableBody,
|
|
9
|
-
CardsTableCell,
|
|
10
|
-
Alignment,
|
|
11
13
|
} from '../src/atoms/CardsTable'
|
|
12
|
-
import { IconButton } from '../src/atoms/Button'
|
|
13
|
-
import { Badge } from '../src/atoms/Badge'
|
|
14
14
|
|
|
15
15
|
describe('CardsTable', () => {
|
|
16
16
|
it('renders', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Variant } from '../src/atoms/CheckableTag'
|
|
2
|
-
import React from 'react'
|
|
3
1
|
import { render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import type { Variant } from '../src/atoms/CheckableTag'
|
|
4
4
|
import { CheckableTag } from '../src/atoms/CheckableTag'
|
|
5
5
|
|
|
6
6
|
describe('CheckableTag', () => {
|
package/tests/Checkbox.spec.tsx
CHANGED
package/tests/Drawer.spec.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
3
|
-
import
|
|
4
|
-
import { Collapsible } from '../src/atoms/Collapsible'
|
|
2
|
+
import React from 'react'
|
|
5
3
|
import { CheckableTag, CheckableTagGroup } from '../src/atoms/CheckableTag'
|
|
4
|
+
import { Collapsible } from '../src/atoms/Collapsible'
|
|
5
|
+
import { Drawer } from '../src/atoms/Drawer'
|
|
6
6
|
|
|
7
7
|
describe('Drawer', () => {
|
|
8
8
|
it('renders with expected title, content and buttons', () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Button } from '../src/atoms/Button/Button'
|
|
3
4
|
import type { Variant } from '../src/atoms/EmptyState'
|
|
4
5
|
import { EmptyState } from '../src/atoms/EmptyState'
|
|
5
|
-
import { Button } from '../src/atoms/Button/Button'
|
|
6
6
|
|
|
7
7
|
describe('EmptyState', () => {
|
|
8
8
|
const variants = ['primary']
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { screen, render } from '@testing-library/react'
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
4
2
|
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import type { Variant } from '../src/atoms/Button/FloatingButton'
|
|
5
5
|
import { FloatingButton } from '../src/atoms/Button/FloatingButton'
|
|
6
6
|
|
|
7
7
|
describe('Floating Button', () => {
|
package/tests/Icon.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { screen, render } from '@testing-library/react'
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
4
2
|
import userEvent from '@testing-library/user-event'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import type { Variant } from '../src/atoms/Button/IconButton'
|
|
5
5
|
import { IconButton } from '../src/atoms/Button/IconButton'
|
|
6
6
|
|
|
7
7
|
describe('Icon Button', () => {
|
package/tests/Input.spec.tsx
CHANGED
package/tests/Menu.spec.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
3
|
-
import
|
|
2
|
+
import React from 'react'
|
|
4
3
|
import { MenuDropdown, MenuLink } from '../src/atoms/Menu'
|
|
4
|
+
import { Menu } from '../src/atoms/Menu/Menu'
|
|
5
5
|
|
|
6
6
|
describe('Menu', () => {
|
|
7
7
|
it('renders first-level menu', () => {
|
package/tests/Modal.spec.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render, screen } from '@testing-library/react'
|
|
3
2
|
import userEvent from '@testing-library/user-event'
|
|
4
|
-
import
|
|
3
|
+
import React from 'react'
|
|
5
4
|
import { Placeholder } from 'storybook/internal/components'
|
|
5
|
+
import { Multiselect } from '../src/atoms/Multiselect'
|
|
6
6
|
|
|
7
7
|
describe('Multiselect', () => {
|
|
8
8
|
it('renders', async () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
2
|
+
import React from 'react'
|
|
3
3
|
import {
|
|
4
|
+
Ellipsis,
|
|
4
5
|
Pagination,
|
|
5
6
|
PaginationArrow,
|
|
6
7
|
PaginationNumber,
|
|
7
|
-
Ellipsis,
|
|
8
8
|
} from '../src/atoms/Pagination'
|
|
9
9
|
|
|
10
10
|
describe('Pagination', () => {
|
package/tests/Popover.spec.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { render } from '@testing-library/react'
|
|
3
2
|
import userEvent from '@testing-library/user-event'
|
|
4
|
-
import
|
|
3
|
+
import React from 'react'
|
|
5
4
|
import { Button } from '../src/atoms/Button'
|
|
5
|
+
import { Popover, PopoverMenu, PopoverMenuOption } from '../src/atoms/Popover'
|
|
6
6
|
|
|
7
7
|
describe('PopoverMenu', () => {
|
|
8
8
|
it('shows when click on button', async () => {
|
package/tests/Select.spec.tsx
CHANGED
package/tests/a11y.spec.tsx
CHANGED
package/tests/library.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * as CardsTable from '../src/stories/CardsTable.stories'
|
|
|
3
3
|
export * as CardsTableList from '../src/stories/CardsTableList.stories'
|
|
4
4
|
export * as Checkbox from '../src/stories/Checkbox.stories'
|
|
5
5
|
export * as EmptyState from '../src/stories/EmptyState.stories'
|
|
6
|
+
export * as Form from '../src/stories/Form.stories'
|
|
6
7
|
export * as IconButton from '../src/stories/IconButton.stories'
|
|
7
8
|
export * as Input from '../src/stories/Input.stories'
|
|
8
|
-
export * as Multiselect from '../src/stories/Multiselect.stories'
|
|
9
9
|
export * as Modal from '../src/stories/Modal.stories'
|
|
10
|
+
export * as Multiselect from '../src/stories/Multiselect.stories'
|
|
10
11
|
export * as Select from '../src/stories/Select.stories'
|
|
11
|
-
export * as Form from '../src/stories/Form.stories'
|