agroptima-design-system 0.25.1-beta.2 → 0.25.2
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/jest.config.ts +10 -2
- package/package.json +18 -16
- package/src/atoms/Alert.scss +1 -1
- package/src/atoms/Alert.tsx +2 -1
- package/src/atoms/Button/Button.tsx +5 -3
- package/src/atoms/Button/FloatingButton.tsx +5 -3
- package/src/atoms/Button/IconButton.tsx +6 -4
- package/src/atoms/CardMenu/CardMenuOption.tsx +5 -3
- package/src/atoms/CardsTableList.tsx +3 -3
- package/src/atoms/Collapsible.scss +11 -3
- package/src/atoms/Collapsible.tsx +7 -2
- package/src/atoms/DetailItem.scss +4 -0
- package/src/atoms/DetailItem.tsx +16 -1
- package/src/atoms/EmptyState.tsx +2 -1
- package/src/atoms/Icon.tsx +2 -1
- package/src/atoms/Input.scss +1 -0
- package/src/atoms/Input.tsx +6 -3
- package/src/atoms/Menu/MenuDropdown.tsx +2 -1
- package/src/atoms/Menu/MenuLink.tsx +3 -2
- package/src/atoms/Modal.scss +47 -25
- package/src/atoms/Modal.tsx +15 -12
- package/src/atoms/Multiselect.scss +4 -0
- package/src/atoms/Multiselect.tsx +56 -53
- package/src/atoms/Pagination/PaginationArrow.tsx +2 -1
- package/src/atoms/Pagination/PaginationNumber.tsx +2 -1
- package/src/atoms/PopoverMenu/PopoverMenu.scss +45 -0
- package/src/atoms/PopoverMenu/PopoverMenu.tsx +16 -0
- package/src/atoms/PopoverMenu/PopoverMenuOption.tsx +42 -0
- package/src/atoms/PopoverMenu/index.ts +4 -0
- package/src/atoms/QuantitySelector.tsx +2 -1
- package/src/icons/index.tsx +6 -0
- package/src/icons/invoice.svg +1 -0
- package/src/icons/pdf.svg +1 -0
- package/src/icons/user-menu.svg +1 -0
- package/src/stories/Alert.stories.ts +1 -1
- package/src/stories/Badge.stories.ts +1 -1
- package/src/stories/Button.stories.ts +1 -1
- package/src/stories/CardsTableList.stories.ts +1 -1
- package/src/stories/Changelog.mdx +46 -1
- package/src/stories/Checkbox.stories.ts +1 -1
- package/src/stories/Collapsible.stories.js +10 -0
- package/src/stories/FloatingButton.stories.ts +1 -1
- package/src/stories/IconButton.stories.ts +1 -1
- package/src/stories/Input.stories.ts +1 -1
- package/src/stories/Modal.stories.js +15 -1
- package/src/stories/Multiselect.stories.ts +7 -13
- package/src/stories/PopoverMenu.stories.js +43 -0
- 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/src/utils/sort.ts +1 -1
- package/tests/Alert.spec.tsx +2 -1
- package/tests/Badge.spec.tsx +2 -1
- package/tests/Button.spec.tsx +113 -0
- package/tests/Checkbox.spec.tsx +21 -0
- package/tests/Collapsible.spec.tsx +2 -2
- package/tests/EmptyState.spec.tsx +44 -0
- package/tests/FloatingButton.spec.tsx +86 -0
- package/tests/Icon.spec.tsx +19 -0
- package/tests/IconButton.spec.tsx +80 -0
- package/tests/Input.spec.tsx +90 -0
- package/tests/Multiselect.spec.tsx +114 -0
- package/tests/Pagination.spec.tsx +2 -2
- package/tests/PopoverMenu.spec.tsx +28 -0
- package/tests/Select.spec.tsx +121 -0
- package/tests/TextArea.spec.tsx +43 -0
- package/tests/utils/{classNames.spec.tx → classNames.spec.tsx} +1 -1
- package/tsconfig.json +13 -1
package/jest.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from 'jest'
|
|
2
|
-
|
|
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
|
-
|
|
25
|
+
module.exports = createJestConfig(config)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "npm run storybook",
|
|
6
6
|
"storybook": "storybook dev -p 6006 --ci",
|
|
@@ -11,33 +11,35 @@
|
|
|
11
11
|
"types": "tsc --noEmit",
|
|
12
12
|
"chromatic": "npx chromatic --exit-zero-on-changes",
|
|
13
13
|
"test": "jest",
|
|
14
|
+
"test-coverage": "jest --coverage",
|
|
14
15
|
"publish:beta": "npm publish --tag beta"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@storybook/addon-designs": "^8.0.3",
|
|
18
|
-
"@storybook/addon-viewport": "^8.2.
|
|
19
|
+
"@storybook/addon-viewport": "^8.2.9",
|
|
19
20
|
"next": "^14.0.3",
|
|
20
21
|
"react": "^18.2.0",
|
|
21
22
|
"react-dom": "^18.2.0",
|
|
22
23
|
"sass": "^1.69.4"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"@chromatic-com/storybook": "^1.
|
|
26
|
-
"@storybook/addon-a11y": "^8.2.
|
|
27
|
-
"@storybook/addon-essentials": "^8.2.
|
|
28
|
-
"@storybook/addon-interactions": "^8.2.
|
|
29
|
-
"@storybook/addon-links": "^8.2.
|
|
30
|
-
"@storybook/addon-mdx-gfm": "^8.2.
|
|
31
|
-
"@storybook/blocks": "^8.2.
|
|
32
|
-
"@storybook/nextjs": "^8.2.
|
|
33
|
-
"@storybook/react": "^8.2.
|
|
34
|
-
"@storybook/test": "^8.2.
|
|
26
|
+
"@chromatic-com/storybook": "^1.8.0",
|
|
27
|
+
"@storybook/addon-a11y": "^8.2.9",
|
|
28
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
29
|
+
"@storybook/addon-interactions": "^8.2.9",
|
|
30
|
+
"@storybook/addon-links": "^8.2.9",
|
|
31
|
+
"@storybook/addon-mdx-gfm": "^8.2.9",
|
|
32
|
+
"@storybook/blocks": "^8.2.9",
|
|
33
|
+
"@storybook/nextjs": "^8.2.9",
|
|
34
|
+
"@storybook/react": "^8.2.9",
|
|
35
|
+
"@storybook/test": "^8.2.9",
|
|
35
36
|
"@svgr/webpack": "^8.1.0",
|
|
36
37
|
"@testing-library/jest-dom": "^6.4.2",
|
|
37
|
-
"@testing-library/react": "^
|
|
38
|
+
"@testing-library/react": "^16.0.0",
|
|
39
|
+
"@testing-library/user-event": "^14.5.2",
|
|
38
40
|
"@types/jest": "^29.5.12",
|
|
39
41
|
"@types/jest-axe": "^3.5.9",
|
|
40
|
-
"@types/node": "^
|
|
42
|
+
"@types/node": "^22.1.0",
|
|
41
43
|
"@types/react": "^18.2.38",
|
|
42
44
|
"@types/react-dom": "^18.2.17",
|
|
43
45
|
"eslint": "^8",
|
|
@@ -46,9 +48,9 @@
|
|
|
46
48
|
"eslint-plugin-prettier": "^5.0.1",
|
|
47
49
|
"eslint-plugin-storybook": "^0.8.0",
|
|
48
50
|
"jest": "^29.7.0",
|
|
49
|
-
"jest-axe": "^
|
|
51
|
+
"jest-axe": "^9.0.0",
|
|
50
52
|
"jest-environment-jsdom": "^29.7.0",
|
|
51
|
-
"storybook": "^8.2.
|
|
53
|
+
"storybook": "^8.2.9",
|
|
52
54
|
"ts-node": "^10.9.2",
|
|
53
55
|
"typescript": "^5"
|
|
54
56
|
},
|
package/src/atoms/Alert.scss
CHANGED
package/src/atoms/Alert.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
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 {
|
|
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 '
|
|
2
|
-
import {
|
|
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 {
|
|
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 '
|
|
2
|
-
import {
|
|
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 {
|
|
5
|
+
import { BaseButton } from './BaseButton'
|
|
6
|
+
import './IconButton.scss'
|
|
5
7
|
|
|
6
8
|
export type Variant = 'primary' | 'secondary'
|
|
7
9
|
|
|
@@ -32,7 +34,7 @@ export function IconButton({
|
|
|
32
34
|
{...props}
|
|
33
35
|
className={classNames(props.className, 'icon-button', variant)}
|
|
34
36
|
>
|
|
35
|
-
<Icon name={icon} />
|
|
37
|
+
<Icon title={accessibilityLabel} name={icon} />
|
|
36
38
|
</BaseButton>
|
|
37
39
|
)
|
|
38
40
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
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
|
|
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 './
|
|
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
|
|
12
|
+
import { Icon } from './Icon'
|
|
13
|
+
import './CardsTable/CardsTable.scss'
|
|
14
14
|
|
|
15
15
|
export type Variant = 'primary'
|
|
16
16
|
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
|
|
17
17
|
.header {
|
|
18
18
|
display: flex;
|
|
19
|
-
align-items: center;
|
|
19
|
+
align-items: center !important;
|
|
20
20
|
gap: config.$space-3x;
|
|
21
21
|
padding: config.$space-5x;
|
|
22
22
|
cursor: default;
|
|
23
23
|
|
|
24
24
|
.icon {
|
|
25
|
-
width: config.$icon-size-4x;
|
|
26
|
-
height: config.$icon-size-4x;
|
|
25
|
+
width: config.$icon-size-4x !important;
|
|
26
|
+
height: config.$icon-size-4x !important;
|
|
27
27
|
> svg {
|
|
28
28
|
width: 100%;
|
|
29
29
|
height: 100%;
|
|
@@ -31,12 +31,20 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.title {
|
|
34
|
+
font-size: 1rem !important;
|
|
35
|
+
font-weight: normal !important;
|
|
34
36
|
flex: 1;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
.content {
|
|
39
41
|
padding: config.$space-7x;
|
|
42
|
+
padding-bottom: config.$space-3x;
|
|
43
|
+
|
|
44
|
+
&.no-horizontal-padding {
|
|
45
|
+
padding-left: 0;
|
|
46
|
+
padding-right: 0;
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
&.primary {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { classNames } from '../utils/classNames'
|
|
2
|
-
import { Icon
|
|
2
|
+
import { Icon } from './Icon'
|
|
3
3
|
import './Collapsible.scss'
|
|
4
4
|
|
|
5
5
|
export type Variant = 'primary'
|
|
@@ -10,6 +10,7 @@ export interface CollapsibleProps
|
|
|
10
10
|
variant?: Variant
|
|
11
11
|
name?: string
|
|
12
12
|
disabled?: boolean
|
|
13
|
+
noHorizontalPadding?: boolean
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function Collapsible({
|
|
@@ -19,12 +20,16 @@ export function Collapsible({
|
|
|
19
20
|
children,
|
|
20
21
|
disabled,
|
|
21
22
|
name,
|
|
23
|
+
noHorizontalPadding = false,
|
|
22
24
|
...props
|
|
23
25
|
}: CollapsibleProps): React.JSX.Element {
|
|
24
26
|
const cssClasses = classNames('collapsible', variant, className, {
|
|
25
27
|
open: props.open,
|
|
26
28
|
disabled: disabled,
|
|
27
29
|
})
|
|
30
|
+
const contentCssClasses = classNames('content', {
|
|
31
|
+
'no-horizontal-padding': noHorizontalPadding,
|
|
32
|
+
})
|
|
28
33
|
|
|
29
34
|
return (
|
|
30
35
|
<details name={name} className={cssClasses} {...props}>
|
|
@@ -32,7 +37,7 @@ export function Collapsible({
|
|
|
32
37
|
<Icon className="arrow" name="AngleRight" />
|
|
33
38
|
<span className="title">{title}</span>
|
|
34
39
|
</summary>
|
|
35
|
-
<div className=
|
|
40
|
+
<div className={contentCssClasses}>{children}</div>
|
|
36
41
|
</details>
|
|
37
42
|
)
|
|
38
43
|
}
|
package/src/atoms/DetailItem.tsx
CHANGED
|
@@ -3,9 +3,15 @@ import './DetailItem.scss'
|
|
|
3
3
|
|
|
4
4
|
export type Variant = 'primary'
|
|
5
5
|
|
|
6
|
+
export enum Alignment {
|
|
7
|
+
Left = 'left',
|
|
8
|
+
Right = 'right',
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
export interface DetailItemProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
7
12
|
variant?: Variant
|
|
8
13
|
title: string
|
|
14
|
+
align?: Alignment
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export function DetailItem({
|
|
@@ -13,11 +19,20 @@ export function DetailItem({
|
|
|
13
19
|
className,
|
|
14
20
|
variant = 'primary',
|
|
15
21
|
title,
|
|
22
|
+
align = Alignment.Left,
|
|
16
23
|
children,
|
|
17
24
|
...props
|
|
18
25
|
}: DetailItemProps): React.JSX.Element {
|
|
19
26
|
return (
|
|
20
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
className={classNames(
|
|
29
|
+
'detail-item',
|
|
30
|
+
variant,
|
|
31
|
+
`alignment-${align}`,
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
21
36
|
<div className="title">{title}</div>
|
|
22
37
|
<div className="information">{children}</div>
|
|
23
38
|
</div>
|
package/src/atoms/EmptyState.tsx
CHANGED
package/src/atoms/Icon.tsx
CHANGED
|
@@ -7,6 +7,7 @@ export type IconType = keyof typeof icons
|
|
|
7
7
|
export interface IconProps extends React.SVGAttributes<HTMLOrSVGElement> {
|
|
8
8
|
name: IconType
|
|
9
9
|
className?: string
|
|
10
|
+
title?: string
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const Icon: React.FC<IconProps> = ({ name, className, ...props }) => {
|
|
@@ -14,7 +15,7 @@ export const Icon: React.FC<IconProps> = ({ name, className, ...props }) => {
|
|
|
14
15
|
rotate: name === 'Loading',
|
|
15
16
|
})
|
|
16
17
|
return (
|
|
17
|
-
<span role="img" title={name} className={cssClasses}>
|
|
18
|
+
<span role="img" title={props.title || name} className={cssClasses}>
|
|
18
19
|
{icons[name](props)}
|
|
19
20
|
</span>
|
|
20
21
|
)
|
package/src/atoms/Input.scss
CHANGED
package/src/atoms/Input.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { IconType } from './Icon'
|
|
1
2
|
import React, { useState } from 'react'
|
|
2
|
-
import { Icon
|
|
3
|
+
import { Icon } from './Icon'
|
|
4
|
+
import { IconButton } from './Button/IconButton'
|
|
3
5
|
import { classNames } from '../utils/classNames'
|
|
4
6
|
import { buildHelpText } from '../utils/buildHelpText'
|
|
5
7
|
import './Input.scss'
|
|
@@ -75,9 +77,10 @@ export function Input({
|
|
|
75
77
|
/>
|
|
76
78
|
{suffix && <span className="input-suffix">{suffix}</span>}
|
|
77
79
|
{type === 'password' && (
|
|
78
|
-
<
|
|
80
|
+
<IconButton
|
|
81
|
+
accessibilityLabel={handlePasswordIcon()}
|
|
79
82
|
className="password-icon"
|
|
80
|
-
|
|
83
|
+
icon={handlePasswordIcon()}
|
|
81
84
|
onClick={handlePasswordVisibility}
|
|
82
85
|
/>
|
|
83
86
|
)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import type { IconType } from '../Icon'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { 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
|
|
package/src/atoms/Modal.scss
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
@use '../settings/typography/content' as typography;
|
|
3
3
|
@use '../settings/config';
|
|
4
4
|
@use '../settings/depth';
|
|
5
|
+
@use '../settings/breakpoints';
|
|
5
6
|
|
|
6
7
|
.modal-container {
|
|
7
8
|
position: fixed;
|
|
8
9
|
inset: 0;
|
|
9
10
|
z-index: depth.$z-modal;
|
|
10
11
|
margin: config.$space-4x;
|
|
12
|
+
margin-top: 3rem;
|
|
11
13
|
|
|
12
14
|
.backdrop {
|
|
13
15
|
position: fixed;
|
|
@@ -18,13 +20,13 @@
|
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
.modal {
|
|
21
|
-
top: 6.25rem;
|
|
22
23
|
margin: auto;
|
|
23
24
|
display: flex;
|
|
24
25
|
position: relative;
|
|
25
26
|
padding: config.$space-5x;
|
|
26
27
|
flex-direction: column;
|
|
27
28
|
align-items: flex-start;
|
|
29
|
+
justify-content: space-between;
|
|
28
30
|
gap: config.$space-2x;
|
|
29
31
|
flex-grow: 1;
|
|
30
32
|
border-radius: config.$corner-radius-xxs;
|
|
@@ -35,37 +37,50 @@
|
|
|
35
37
|
0px 6px 16px 0px rgba(0, 0, 0, 0.08),
|
|
36
38
|
0px 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
37
39
|
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
.scroll-area {
|
|
41
|
+
width: 100%;
|
|
42
|
+
padding-left: config.$space-halfx;
|
|
43
|
+
padding-right: config.$space-halfx;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
overflow-anchor: none;
|
|
46
|
+
|
|
47
|
+
.header {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: config.$space-2x;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
|
|
52
|
+
.icon {
|
|
53
|
+
margin-top: 4px;
|
|
54
|
+
min-width: config.$icon-size-5x;
|
|
55
|
+
width: config.$icon-size-5x;
|
|
56
|
+
height: config.$icon-size-5x;
|
|
57
|
+
> svg {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.title {
|
|
64
|
+
@include typography.h4;
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
67
|
|
|
54
|
-
.
|
|
55
|
-
|
|
68
|
+
.divider {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 1px;
|
|
71
|
+
background: color_alias.$neutral-color-200;
|
|
72
|
+
margin-bottom: config.$space-2x;
|
|
56
73
|
}
|
|
57
|
-
}
|
|
58
74
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
margin-bottom: config.$space-2x;
|
|
75
|
+
.body {
|
|
76
|
+
@include typography.body-regular-primary;
|
|
77
|
+
width: 100%;
|
|
78
|
+
}
|
|
64
79
|
}
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
&.details {
|
|
82
|
+
max-width: 50rem;
|
|
83
|
+
height: 100%;
|
|
69
84
|
}
|
|
70
85
|
|
|
71
86
|
.footer {
|
|
@@ -139,5 +154,12 @@
|
|
|
139
154
|
}
|
|
140
155
|
}
|
|
141
156
|
}
|
|
157
|
+
|
|
158
|
+
// Media queries
|
|
159
|
+
// Mobile & tablet cases
|
|
160
|
+
@media only screen and (max-width: breakpoints.$large) {
|
|
161
|
+
&.details {
|
|
162
|
+
}
|
|
163
|
+
}
|
|
142
164
|
}
|
|
143
165
|
}
|
package/src/atoms/Modal.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ButtonProps } from './Button'
|
|
1
2
|
import { classNames } from '../utils/classNames'
|
|
2
|
-
import { Button
|
|
3
|
+
import { Button } from './Button'
|
|
3
4
|
import { Icon } from './Icon'
|
|
4
5
|
import './Modal.scss'
|
|
5
6
|
|
|
@@ -47,17 +48,19 @@ export function Modal({
|
|
|
47
48
|
className={cssClasses}
|
|
48
49
|
{...props}
|
|
49
50
|
>
|
|
50
|
-
<div className="
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{title}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
51
|
+
<div className="scroll-area">
|
|
52
|
+
<div className="header">
|
|
53
|
+
{variant !== 'details' && (
|
|
54
|
+
<Icon name={IconVariant[variant]} className={variant} />
|
|
55
|
+
)}
|
|
56
|
+
<h4 id={`${id}-title`} className="title">
|
|
57
|
+
{title}
|
|
58
|
+
</h4>
|
|
59
|
+
</div>
|
|
60
|
+
{variant === 'details' && <div className="divider" />}
|
|
61
|
+
<div id={`${id}-body`} className="body">
|
|
62
|
+
{children}
|
|
63
|
+
</div>
|
|
61
64
|
</div>
|
|
62
65
|
<div className="footer">
|
|
63
66
|
{buttons.map(({ ...button }) => (
|