agroptima-design-system 0.26.0-beta.9 → 0.26.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/.storybook/main.ts +3 -4
- package/package.json +1 -3
- package/src/atoms/Button/BaseButton.tsx +7 -1
- package/src/atoms/Button/Button.scss +7 -6
- package/src/atoms/Button/IconButton.tsx +0 -4
- package/src/atoms/Drawer.tsx +3 -3
- package/src/atoms/Input.scss +5 -2
- package/src/atoms/Modal.scss +1 -0
- package/src/icons/download.svg +1 -0
- package/src/icons/index.tsx +4 -0
- package/src/icons/upload.svg +1 -0
- package/src/stories/Button.stories.ts +4 -0
- package/src/stories/Changelog.mdx +11 -0
- package/tests/Drawer.spec.tsx +1 -1
package/.storybook/main.ts
CHANGED
|
@@ -17,8 +17,7 @@ const config: StorybookConfig = {
|
|
|
17
17
|
getAbsolutePath('@storybook/addon-interactions'),
|
|
18
18
|
'@storybook/addon-a11y',
|
|
19
19
|
'@storybook/addon-designs',
|
|
20
|
-
'@storybook
|
|
21
|
-
'@chromatic-com/storybook'
|
|
20
|
+
'@chromatic-com/storybook',
|
|
22
21
|
],
|
|
23
22
|
|
|
24
23
|
framework: {
|
|
@@ -60,7 +59,7 @@ const config: StorybookConfig = {
|
|
|
60
59
|
},
|
|
61
60
|
|
|
62
61
|
typescript: {
|
|
63
|
-
reactDocgen: 'react-docgen-typescript'
|
|
64
|
-
}
|
|
62
|
+
reactDocgen: 'react-docgen-typescript',
|
|
63
|
+
},
|
|
65
64
|
}
|
|
66
65
|
export default config
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "npm run storybook",
|
|
6
6
|
"storybook": "storybook dev -p 6006 --ci",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@storybook/addon-designs": "^8.0.3",
|
|
19
19
|
"@storybook/addon-viewport": "^8.3.2",
|
|
20
|
-
"agroptima-design-system": "^0.26.0-beta.3",
|
|
21
20
|
"next": "^14.0.3",
|
|
22
21
|
"react": "^18.2.0",
|
|
23
22
|
"react-dom": "^18.2.0",
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
"@storybook/addon-essentials": "^8.3.2",
|
|
30
29
|
"@storybook/addon-interactions": "^8.3.2",
|
|
31
30
|
"@storybook/addon-links": "^8.3.2",
|
|
32
|
-
"@storybook/addon-mdx-gfm": "^8.3.2",
|
|
33
31
|
"@storybook/blocks": "^8.3.2",
|
|
34
32
|
"@storybook/nextjs": "^8.3.2",
|
|
35
33
|
"@storybook/react": "^8.3.2",
|
|
@@ -2,6 +2,7 @@ import NextLink from 'next/link'
|
|
|
2
2
|
|
|
3
3
|
interface CommonProps {
|
|
4
4
|
disabled?: boolean
|
|
5
|
+
visible?: boolean
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
type HtmlButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
@@ -15,7 +16,12 @@ export type BaseButtonProps =
|
|
|
15
16
|
const hasHref = (props: HtmlButtonProps | AnchorProps): props is AnchorProps =>
|
|
16
17
|
'href' in props
|
|
17
18
|
|
|
18
|
-
export function BaseButton({
|
|
19
|
+
export function BaseButton({
|
|
20
|
+
children,
|
|
21
|
+
visible = true,
|
|
22
|
+
...props
|
|
23
|
+
}: BaseButtonProps) {
|
|
24
|
+
if (!visible) return null
|
|
19
25
|
if (hasHref(props)) {
|
|
20
26
|
return (
|
|
21
27
|
<NextLink href={props.href || ''} {...props}>
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
&.primary-outlined {
|
|
57
|
+
border: 1px solid color_alias.$primary-color-600;
|
|
57
58
|
@include button-style(
|
|
58
59
|
color_alias.$neutral-white,
|
|
59
60
|
color_alias.$primary-color-600,
|
|
60
61
|
color_alias.$primary-color-50
|
|
61
62
|
);
|
|
62
|
-
border: 1px solid color_alias.$primary-color-600;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
&.primary-ghost {
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
&.error-outlined {
|
|
98
|
+
border: 1px solid color_alias.$error-color-600;
|
|
98
99
|
@include button-style(
|
|
99
100
|
color_alias.$neutral-white,
|
|
100
101
|
color_alias.$error-color-600,
|
|
101
102
|
color_alias.$error-color-50
|
|
102
103
|
);
|
|
103
|
-
border: 1px solid color_alias.$error-color-600;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
&.error-ghost {
|
|
@@ -136,12 +136,13 @@
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
&.success-outlined {
|
|
139
|
+
border: 1px solid color_alias.$success-color-1000;
|
|
140
|
+
|
|
139
141
|
@include button-style(
|
|
140
142
|
color_alias.$neutral-white,
|
|
141
143
|
color_alias.$neutral-color-900,
|
|
142
144
|
color_alias.$success-color-50
|
|
143
145
|
);
|
|
144
|
-
border: 1px solid color_alias.$success-color-1000;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
&.success-ghost {
|
|
@@ -177,12 +178,12 @@
|
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
&.warning-outlined {
|
|
181
|
+
border: 1px solid color_alias.$warning-color-1000;
|
|
180
182
|
@include button-style(
|
|
181
183
|
color_alias.$neutral-white,
|
|
182
184
|
color_alias.$neutral-color-900,
|
|
183
185
|
color_alias.$warning-color-50
|
|
184
186
|
);
|
|
185
|
-
border: 1px solid color_alias.$warning-color-1000;
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
&.warning-ghost {
|
|
@@ -206,12 +207,12 @@
|
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
&.info-outlined {
|
|
210
|
+
border: 1px solid color_alias.$info-color-600;
|
|
209
211
|
@include button-style(
|
|
210
212
|
color_alias.$neutral-white,
|
|
211
213
|
color_alias.$info-color-600,
|
|
212
214
|
color_alias.$info-color-50
|
|
213
215
|
);
|
|
214
|
-
border: 1px solid color_alias.$info-color-600;
|
|
215
216
|
}
|
|
216
217
|
|
|
217
218
|
&.info-ghost {
|
|
@@ -235,12 +236,12 @@
|
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
&.neutral-outlined {
|
|
239
|
+
border: 1px solid color_alias.$neutral-color-100;
|
|
238
240
|
@include button-style(
|
|
239
241
|
color_alias.$neutral-white,
|
|
240
242
|
color_alias.$neutral-color-1000,
|
|
241
243
|
color_alias.$neutral-color-50
|
|
242
244
|
);
|
|
243
|
-
border: 1px solid color_alias.$neutral-color-100;
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
&.neutral-ghost {
|
|
@@ -11,7 +11,6 @@ interface CustomProps {
|
|
|
11
11
|
icon: IconType
|
|
12
12
|
variant?: Variant
|
|
13
13
|
disabled?: boolean
|
|
14
|
-
visible?: boolean
|
|
15
14
|
accessibilityLabel: string
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -21,12 +20,9 @@ export function IconButton({
|
|
|
21
20
|
accessibilityLabel,
|
|
22
21
|
icon,
|
|
23
22
|
disabled,
|
|
24
|
-
visible = true,
|
|
25
23
|
variant = 'primary',
|
|
26
24
|
...props
|
|
27
25
|
}: IconButtonProps) {
|
|
28
|
-
if (!visible) return null
|
|
29
|
-
|
|
30
26
|
return (
|
|
31
27
|
<BaseButton
|
|
32
28
|
disabled={disabled}
|
package/src/atoms/Drawer.tsx
CHANGED
|
@@ -11,7 +11,7 @@ export interface DrawerProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
11
11
|
variant?: Variant
|
|
12
12
|
title: string
|
|
13
13
|
buttons: ButtonProps[]
|
|
14
|
-
|
|
14
|
+
onClose: () => void
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function Drawer({
|
|
@@ -21,7 +21,7 @@ export function Drawer({
|
|
|
21
21
|
title,
|
|
22
22
|
buttons,
|
|
23
23
|
children,
|
|
24
|
-
|
|
24
|
+
onClose,
|
|
25
25
|
...props
|
|
26
26
|
}: DrawerProps): React.JSX.Element {
|
|
27
27
|
const cssClasses = classNames('drawer', variant, className)
|
|
@@ -40,7 +40,7 @@ export function Drawer({
|
|
|
40
40
|
<IconButton
|
|
41
41
|
icon="Close"
|
|
42
42
|
accessibilityLabel="Close"
|
|
43
|
-
onClick={
|
|
43
|
+
onClick={onClose}
|
|
44
44
|
/>
|
|
45
45
|
</div>
|
|
46
46
|
<div className="scroll-area">
|
package/src/atoms/Input.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use '../settings/color_alias';
|
|
2
2
|
@use '../settings/typography/form' as typography;
|
|
3
3
|
@use '../settings/config';
|
|
4
|
-
@import 'button/Button.scss';
|
|
4
|
+
@import './button/Button.scss';
|
|
5
5
|
|
|
6
6
|
.input-group {
|
|
7
7
|
@include typography.input-text;
|
|
@@ -127,7 +127,10 @@
|
|
|
127
127
|
}
|
|
128
128
|
&.file .input-container {
|
|
129
129
|
padding: 0;
|
|
130
|
-
border:
|
|
130
|
+
border: transparent;
|
|
131
|
+
&:has(input:focus) {
|
|
132
|
+
border: transparent;
|
|
133
|
+
}
|
|
131
134
|
input {
|
|
132
135
|
color: color_alias.$neutral-color-600;
|
|
133
136
|
&::before {
|
package/src/atoms/Modal.scss
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 6.706h-4.571V0H6.57v6.706H2l8 7.823 8-7.823ZM8.857 8.94V2.235h2.286v6.706h1.337L10 11.366 7.52 8.942h1.337ZM2 16.765h16V19H2v-2.235Z" fill="#161C26"/></svg>
|
package/src/icons/index.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import Delete from './delete.svg'
|
|
|
17
17
|
import Done from './done.svg'
|
|
18
18
|
import DoubleArrowLeft from './double-arrow-left.svg'
|
|
19
19
|
import DoubleArrowRight from './double-arrow-right.svg'
|
|
20
|
+
import Download from './download.svg'
|
|
20
21
|
import Edit from './edit.svg'
|
|
21
22
|
import EditColumns from './edit-columns.svg'
|
|
22
23
|
import EmptyState from './empty-customize.svg'
|
|
@@ -37,6 +38,7 @@ import Settings from './settings.svg'
|
|
|
37
38
|
import Show from './show.svg'
|
|
38
39
|
import ShowOff from './show-off.svg'
|
|
39
40
|
import Sorter from './sorter.svg'
|
|
41
|
+
import Upload from './upload.svg'
|
|
40
42
|
import UserMenu from './user-menu.svg'
|
|
41
43
|
import Warning from './warning.svg'
|
|
42
44
|
import DeliveryNote from './delivery-note.svg'
|
|
@@ -63,6 +65,7 @@ export {
|
|
|
63
65
|
Done,
|
|
64
66
|
DoubleArrowLeft,
|
|
65
67
|
DoubleArrowRight,
|
|
68
|
+
Download,
|
|
66
69
|
Edit,
|
|
67
70
|
EditColumns,
|
|
68
71
|
EmptyState,
|
|
@@ -84,6 +87,7 @@ export {
|
|
|
84
87
|
Show,
|
|
85
88
|
ShowOff,
|
|
86
89
|
Sorter,
|
|
90
|
+
Upload,
|
|
87
91
|
UserMenu,
|
|
88
92
|
Warning,
|
|
89
93
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.571 14.53h6.858V7.823H18L10 0 2 7.824h4.571v6.705ZM10 3.162l2.48 2.425h-1.337v6.706H8.857V5.588H7.52L10 3.163ZM2 16.765h16V19H2v-2.235Z" fill="#161C26"/></svg>
|
|
@@ -4,6 +4,11 @@ import { Meta } from "@storybook/blocks";
|
|
|
4
4
|
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
7
|
+
# 0.26.1
|
|
8
|
+
|
|
9
|
+
* Fix import button
|
|
10
|
+
* Fix Mixed Declarations in scss files
|
|
11
|
+
|
|
7
12
|
# 0.26.0
|
|
8
13
|
|
|
9
14
|
* Add CheckableTag & CheckableTagGroup components.
|
|
@@ -11,6 +16,12 @@ import { Meta } from "@storybook/blocks";
|
|
|
11
16
|
* Add Dot option to Badge component.
|
|
12
17
|
* Add Drawer component.
|
|
13
18
|
|
|
19
|
+
# 0.25.8
|
|
20
|
+
|
|
21
|
+
* Remove focus style for file Input component
|
|
22
|
+
* Download and Upload icons
|
|
23
|
+
* Add visible prop to buttons
|
|
24
|
+
|
|
14
25
|
# 0.25.7
|
|
15
26
|
|
|
16
27
|
* Add styles for file Input component
|