agroptima-design-system 0.26.0-beta.9 → 0.26.0
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 +1 -2
- package/src/atoms/Button/BaseButton.tsx +7 -1
- package/src/atoms/Button/IconButton.tsx +0 -4
- package/src/atoms/Drawer.tsx +3 -3
- package/src/atoms/Input.scss +4 -1
- 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 +6 -0
- package/tests/Drawer.spec.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "0.26.0
|
|
3
|
+
"version": "0.26.0",
|
|
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",
|
|
@@ -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}>
|
|
@@ -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
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>
|
|
@@ -11,6 +11,12 @@ import { Meta } from "@storybook/blocks";
|
|
|
11
11
|
* Add Dot option to Badge component.
|
|
12
12
|
* Add Drawer component.
|
|
13
13
|
|
|
14
|
+
# 0.25.8
|
|
15
|
+
|
|
16
|
+
* Remove focus style for file Input component
|
|
17
|
+
* Download and Upload icons
|
|
18
|
+
* Add visible prop to buttons
|
|
19
|
+
|
|
14
20
|
# 0.25.7
|
|
15
21
|
|
|
16
22
|
* Add styles for file Input component
|