agroptima-design-system 0.24.4 → 0.24.5

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.
Files changed (35) hide show
  1. package/jest.config.ts +10 -2
  2. package/package.json +4 -4
  3. package/src/atoms/Alert.scss +1 -1
  4. package/src/atoms/Alert.tsx +2 -1
  5. package/src/atoms/Button/Button.tsx +5 -3
  6. package/src/atoms/Button/FloatingButton.tsx +5 -3
  7. package/src/atoms/Button/IconButton.tsx +5 -3
  8. package/src/atoms/CardMenu/CardMenuOption.tsx +5 -3
  9. package/src/atoms/CardsTableList.tsx +3 -3
  10. package/src/atoms/Collapsible.tsx +1 -1
  11. package/src/atoms/EmptyState.tsx +2 -1
  12. package/src/atoms/Input.tsx +2 -1
  13. package/src/atoms/Menu/MenuDropdown.tsx +2 -1
  14. package/src/atoms/Menu/MenuLink.tsx +3 -2
  15. package/src/atoms/Modal.tsx +2 -1
  16. package/src/atoms/Pagination/PaginationArrow.tsx +2 -1
  17. package/src/atoms/Pagination/PaginationNumber.tsx +2 -1
  18. package/src/atoms/QuantitySelector.tsx +2 -1
  19. package/src/stories/Alert.stories.ts +1 -1
  20. package/src/stories/Badge.stories.ts +1 -1
  21. package/src/stories/Button.stories.ts +1 -1
  22. package/src/stories/CardsTableList.stories.ts +1 -1
  23. package/src/stories/Changelog.mdx +4 -0
  24. package/src/stories/Checkbox.stories.ts +1 -1
  25. package/src/stories/FloatingButton.stories.ts +1 -1
  26. package/src/stories/IconButton.stories.ts +1 -1
  27. package/src/stories/Input.stories.ts +1 -1
  28. package/src/stories/Multiselect.stories.ts +1 -1
  29. package/src/stories/QuantitySelector.stories.ts +1 -1
  30. package/src/stories/Select.stories.ts +1 -1
  31. package/src/stories/TextArea.stories.ts +1 -1
  32. package/src/utils/sort.ts +1 -1
  33. package/tests/Alert.spec.tsx +2 -1
  34. package/tests/Badge.spec.tsx +2 -1
  35. package/tsconfig.json +13 -1
package/jest.config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config } from 'jest'
2
- import nextJest from 'next/jest.js'
2
+ const nextJest = require('next/jest')
3
3
 
4
4
  const createJestConfig = nextJest({
5
5
  dir: './',
@@ -12,6 +12,14 @@ const config: Config = {
12
12
  '^.+\\.(svg)$': '<rootDir>/tests/svg.mock.js',
13
13
  },
14
14
  setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
15
+ globals: {
16
+ 'ts-jest': {
17
+ useESM: true,
18
+ tsconfig: {
19
+ verbatimModuleSyntax: false,
20
+ },
21
+ },
22
+ },
15
23
  }
16
24
 
17
- export default createJestConfig(config)
25
+ module.exports = createJestConfig(config)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.24.4",
3
+ "version": "0.24.5",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -34,10 +34,10 @@
34
34
  "@storybook/test": "^8.2.5",
35
35
  "@svgr/webpack": "^8.1.0",
36
36
  "@testing-library/jest-dom": "^6.4.2",
37
- "@testing-library/react": "^14.2.2",
37
+ "@testing-library/react": "^16.0.0",
38
38
  "@types/jest": "^29.5.12",
39
39
  "@types/jest-axe": "^3.5.9",
40
- "@types/node": "^20.9.4",
40
+ "@types/node": "^22.1.0",
41
41
  "@types/react": "^18.2.38",
42
42
  "@types/react-dom": "^18.2.17",
43
43
  "eslint": "^8",
@@ -46,7 +46,7 @@
46
46
  "eslint-plugin-prettier": "^5.0.1",
47
47
  "eslint-plugin-storybook": "^0.8.0",
48
48
  "jest": "^29.7.0",
49
- "jest-axe": "^8.0.0",
49
+ "jest-axe": "^9.0.0",
50
50
  "jest-environment-jsdom": "^29.7.0",
51
51
  "storybook": "^8.2.5",
52
52
  "ts-node": "^10.9.2",
@@ -11,7 +11,7 @@
11
11
  align-items: flex-start;
12
12
  border-radius: config.$corner-radius-xxs;
13
13
  pointer-events: none;
14
- margin: 0 config.$space-4x;
14
+ margin: 0;
15
15
 
16
16
  &.fit-content {
17
17
  width: fit-content;
@@ -1,4 +1,5 @@
1
- import { IconButton, IconButtonProps } from './Button'
1
+ import type { IconButtonProps } from './Button'
2
+ import { IconButton } from './Button'
2
3
  import { Icon } from './Icon'
3
4
  import './Alert.scss'
4
5
  import { classNames } from '../utils/classNames'
@@ -1,7 +1,9 @@
1
- import './Button.scss'
2
- import { Icon, IconType } from '../Icon'
1
+ import type { IconType } from '../Icon'
2
+ import type { BaseButtonProps } from './BaseButton'
3
+ import { Icon } from '../Icon'
3
4
  import { classNames } from '../../utils/classNames'
4
- import { BaseButtonProps, BaseButton } from './BaseButton'
5
+ import { BaseButton } from './BaseButton'
6
+ import './Button.scss'
5
7
 
6
8
  interface CustomProps {
7
9
  label: string
@@ -1,7 +1,9 @@
1
- import './FloatingButton.scss'
2
- import { Icon, IconType } from '../Icon'
1
+ import type { IconType } from '../Icon'
2
+ import type { BaseButtonProps } from './BaseButton'
3
+ import { Icon } from '../Icon'
3
4
  import { classNames } from '../../utils/classNames'
4
- import { BaseButtonProps, BaseButton } from './BaseButton'
5
+ import { BaseButton } from './BaseButton'
6
+ import './FloatingButton.scss'
5
7
 
6
8
  export type Variant = 'primary'
7
9
 
@@ -1,7 +1,9 @@
1
- import './IconButton.scss'
2
- import { Icon, IconType } from '../Icon'
1
+ import type { IconType } from '../Icon'
2
+ import type { BaseButtonProps } from './BaseButton'
3
+ import { Icon } from '../Icon'
3
4
  import { classNames } from '../../utils/classNames'
4
- import { BaseButtonProps, BaseButton } from './BaseButton'
5
+ import { BaseButton } from './BaseButton'
6
+ import './IconButton.scss'
5
7
 
6
8
  export type Variant = 'primary' | 'secondary'
7
9
 
@@ -1,7 +1,9 @@
1
- import { Icon, IconType } from '../Icon'
2
- import './CardMenu.scss'
1
+ import type { IconType } from '../Icon'
2
+ import type { LinkProps as NextLinkProps } from 'next/link'
3
+ import { Icon } from '../Icon'
3
4
  import { classNames } from '../../utils/classNames'
4
- import Link, { LinkProps as NextLinkProps } from 'next/link'
5
+ import Link from 'next/link'
6
+ import './CardMenu.scss'
5
7
 
6
8
  export type Variant = 'primary'
7
9
 
@@ -1,4 +1,4 @@
1
- import './CardsTable/CardsTable.scss'
1
+ import type { IconType } from './Icon'
2
2
  import React, { useState } from 'react'
3
3
  import { sortBy } from '../utils/sort'
4
4
  import {
@@ -9,8 +9,8 @@ import {
9
9
  CardsTableHead,
10
10
  CardsTableBody,
11
11
  } from './CardsTable'
12
-
13
- import { Icon, IconType } from './Icon'
12
+ import { Icon } from './Icon'
13
+ import './CardsTable/CardsTable.scss'
14
14
 
15
15
  export type Variant = 'primary'
16
16
 
@@ -1,5 +1,5 @@
1
1
  import { classNames } from '../utils/classNames'
2
- import { Icon, IconType } from './Icon'
2
+ import { Icon } from './Icon'
3
3
  import './Collapsible.scss'
4
4
 
5
5
  export type Variant = 'primary'
@@ -1,6 +1,7 @@
1
+ import type { IconType } from './Icon'
1
2
  import { classNames } from '../utils/classNames'
3
+ import { Icon } from './Icon'
2
4
  import './EmptyState.scss'
3
- import { Icon, IconType } from './Icon'
4
5
 
5
6
  export type Variant = 'primary'
6
7
 
@@ -1,5 +1,6 @@
1
+ import type { IconType } from './Icon'
1
2
  import React, { useState } from 'react'
2
- import { Icon, IconType } from './Icon'
3
+ import { Icon } from './Icon'
3
4
  import { classNames } from '../utils/classNames'
4
5
  import { buildHelpText } from '../utils/buildHelpText'
5
6
  import './Input.scss'
@@ -1,5 +1,6 @@
1
+ import type { IconType } from '../Icon'
1
2
  import { classNames } from '../../utils/classNames'
2
- import { Icon, IconType } from '../Icon'
3
+ import { Icon } from '../Icon'
3
4
  import './Menu.scss'
4
5
 
5
6
  export type Variant = 'primary'
@@ -1,8 +1,9 @@
1
- import './Menu.scss'
1
+ import type { IconType } from '../Icon'
2
2
  import React from 'react'
3
- import { Icon, IconType } from '../Icon'
3
+ import { Icon } from '../Icon'
4
4
  import { classNames } from '../../utils/classNames'
5
5
  import Link from 'next/link'
6
+ import './Menu.scss'
6
7
 
7
8
  export type Variant = 'primary'
8
9
 
@@ -1,5 +1,6 @@
1
+ import type { ButtonProps } from './Button'
1
2
  import { classNames } from '../utils/classNames'
2
- import { Button, ButtonProps } from './Button'
3
+ import { Button } from './Button'
3
4
  import { Icon } from './Icon'
4
5
  import './Modal.scss'
5
6
 
@@ -1,7 +1,8 @@
1
+ import type { IconButtonProps } from '../Button'
1
2
  import React from 'react'
2
3
  import { classNames } from '../../utils/classNames'
4
+ import { IconButton } from '../Button'
3
5
  import './Pagination.scss'
4
- import { IconButton, IconButtonProps } from '../Button'
5
6
 
6
7
  export type Variant = 'primary'
7
8
 
@@ -1,7 +1,8 @@
1
+ import type { ButtonProps } from '../Button'
1
2
  import React from 'react'
2
3
  import { classNames } from '../../utils/classNames'
4
+ import { Button } from '../Button'
3
5
  import './Pagination.scss'
4
- import { Button, ButtonProps } from '../Button'
5
6
 
6
7
  export type Variant = 'primary'
7
8
 
@@ -1,6 +1,7 @@
1
+ import type { InputProps } from './Input'
1
2
  import React from 'react'
2
3
  import { classNames } from '../utils/classNames'
3
- import { Input, InputProps } from './Input'
4
+ import { Input } from './Input'
4
5
  import { Button } from './Button'
5
6
  import './QuantitySelector.scss'
6
7
 
@@ -1,5 +1,5 @@
1
1
  import { Alert } from '../atoms/Alert'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Alert',
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/react'
1
+ import type { StoryObj } from '@storybook/react'
2
2
  import { Badge } from '../atoms/Badge'
3
3
 
4
4
  const meta = {
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/react'
1
+ import type { StoryObj } from '@storybook/react'
2
2
  import { Button } from '../atoms/Button'
3
3
 
4
4
  const meta = {
@@ -1,5 +1,5 @@
1
1
  import { CardsTableList } from '../atoms/CardsTableList'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Cards Table List',
@@ -6,6 +6,10 @@ import { Meta } from "@storybook/blocks";
6
6
 
7
7
  # 0.24.4
8
8
 
9
+ * Remove margin from Alert component.
10
+
11
+ # 0.24.4
12
+
9
13
  * Details Modal component height has been changed to 100%.
10
14
  * Details Modal component footer has been changed to fixed.
11
15
  * Collapsible component accepts a new property `noHorizontalPadding`.
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/react'
1
+ import type { StoryObj } from '@storybook/react'
2
2
  import { Checkbox } from '../atoms/Checkbox'
3
3
 
4
4
  const meta = {
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/react'
1
+ import type { StoryObj } from '@storybook/react'
2
2
  import { FloatingButton } from '../atoms/Button'
3
3
 
4
4
  const meta = {
@@ -1,4 +1,4 @@
1
- import { StoryObj } from '@storybook/react'
1
+ import type { StoryObj } from '@storybook/react'
2
2
  import { IconButton } from '../atoms/Button'
3
3
 
4
4
  const meta = {
@@ -1,5 +1,5 @@
1
1
  import { Input } from '../atoms/Input'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Input',
@@ -1,5 +1,5 @@
1
1
  import { Multiselect } from '../atoms/Multiselect'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Multiselect',
@@ -1,5 +1,5 @@
1
1
  import { QuantitySelector } from '../atoms/QuantitySelector'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/QuantitySelector',
@@ -1,5 +1,5 @@
1
1
  import { Select } from '../atoms/Select'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Select',
@@ -1,5 +1,5 @@
1
1
  import { TextArea } from '../atoms/TextArea'
2
- import { StoryObj } from '@storybook/react'
2
+ import type { StoryObj } from '@storybook/react'
3
3
 
4
4
  const meta = {
5
5
  title: 'Design System/Atoms/Textarea',
package/src/utils/sort.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Row } from '../atoms/CardsTableList'
1
+ import type { Row } from '../atoms/CardsTableList'
2
2
  import { Order } from '../atoms/CardsTableList'
3
3
 
4
4
  interface Parse {
@@ -1,6 +1,7 @@
1
+ import type { Variant } from '@/atoms/Alert'
1
2
  import React from 'react'
2
3
  import { screen, render } from '@testing-library/react'
3
- import { Alert, Variant } from '@/atoms/Alert'
4
+ import { Alert } from '@/atoms/Alert'
4
5
 
5
6
  describe('Alert', () => {
6
7
  const variants = ['info', 'success', 'warning', 'error']
@@ -1,6 +1,7 @@
1
+ import type { Variant } from '@/atoms/Alert'
1
2
  import React from 'react'
2
3
  import { render } from '@testing-library/react'
3
- import { Badge, Variant } from '@/atoms/Badge'
4
+ import { Badge } from '@/atoms/Badge'
4
5
 
5
6
  describe('Badge', () => {
6
7
  const variants = [
package/tsconfig.json CHANGED
@@ -13,6 +13,7 @@
13
13
  "isolatedModules": true,
14
14
  "jsx": "preserve",
15
15
  "incremental": true,
16
+ "verbatimModuleSyntax": true,
16
17
  "plugins": [
17
18
  {
18
19
  "name": "next"
@@ -22,6 +23,17 @@
22
23
  "@/*": ["./src/*"]
23
24
  }
24
25
  },
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
+ "include": [
27
+ "next-env.d.ts",
28
+ "**/*.ts",
29
+ "**/*.tsx",
30
+ ".next/types/**/*.ts",
31
+ "src/stories/CardsTable.stories.js",
32
+ "src/stories/Modal.stories.js",
33
+ "src/stories/Typography.stories.mdx",
34
+ "src/stories/Card.stories.js",
35
+ "src/stories/Menu.stories.js",
36
+ "src/stories/EmptyState.stories.js"
37
+ ],
26
38
  "exclude": ["node_modules"]
27
39
  }