agroptima-design-system 1.2.26-beta.3 → 1.2.26
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agroptima-design-system",
|
|
3
|
-
"version": "1.2.26
|
|
3
|
+
"version": "1.2.26",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "npm run storybook",
|
|
6
6
|
"storybook": "storybook dev -p 6006 --ci",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"eslint-plugin-storybook": "^10.1.11",
|
|
50
50
|
"jest": "^30.2.0",
|
|
51
51
|
"jest-axe": "^10.0.0",
|
|
52
|
-
"jest-environment-jsdom": "^30.
|
|
52
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
53
53
|
"prettier": "^3.8.0",
|
|
54
54
|
"storybook": "^10.1.11",
|
|
55
55
|
"storybook-addon-tag-badges": "^3.0.4",
|
|
@@ -43,9 +43,12 @@ details summary::-webkit-details-marker {
|
|
|
43
43
|
|
|
44
44
|
&.primary,
|
|
45
45
|
&.secondary {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
&[open] {
|
|
47
|
+
.collapsible-header {
|
|
48
|
+
background: transparent;
|
|
49
|
+
border-bottom: 3px solid var(--primary-color-600);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
49
52
|
|
|
50
53
|
&.disabled {
|
|
51
54
|
.collapsible-header {
|
|
@@ -66,12 +69,6 @@ details summary::-webkit-details-marker {
|
|
|
66
69
|
background: var(--primary-color-50);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
&.open {
|
|
70
|
-
.collapsible-header {
|
|
71
|
-
background: transparent;
|
|
72
|
-
border-bottom: 3px solid var(--primary-color-600);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
&.secondary .collapsible-content {
|
|
@@ -83,7 +80,7 @@ details summary::-webkit-details-marker {
|
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
.collapsible
|
|
83
|
+
.collapsible[open] {
|
|
87
84
|
.collapsible-arrow {
|
|
88
85
|
transform: rotate(90deg);
|
|
89
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './Collapsible.scss'
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentPropsWithoutRef } from 'react'
|
|
3
3
|
import { classNames } from '../../utils/classNames'
|
|
4
4
|
import { Icon } from '../Icon'
|
|
5
5
|
|
|
@@ -25,13 +25,8 @@ export function Collapsible({
|
|
|
25
25
|
noHorizontalPadding = false,
|
|
26
26
|
...props
|
|
27
27
|
}: CollapsibleProps) {
|
|
28
|
-
const [isOpen, setIsOpen] = useState(props.open)
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
setIsOpen(props.open)
|
|
32
|
-
}, [props.open])
|
|
33
28
|
const cssClasses = classNames('collapsible', variant, className, {
|
|
34
|
-
open:
|
|
29
|
+
open: props.open,
|
|
35
30
|
disabled: disabled,
|
|
36
31
|
})
|
|
37
32
|
const contentCssClasses = classNames('collapsible-content', {
|
|
@@ -40,16 +35,7 @@ export function Collapsible({
|
|
|
40
35
|
})
|
|
41
36
|
|
|
42
37
|
return (
|
|
43
|
-
<details
|
|
44
|
-
name={name}
|
|
45
|
-
className={cssClasses}
|
|
46
|
-
aria-label={title}
|
|
47
|
-
onToggle={(e) => {
|
|
48
|
-
setIsOpen(e.currentTarget.open)
|
|
49
|
-
props.onToggle?.(e)
|
|
50
|
-
}}
|
|
51
|
-
{...props}
|
|
52
|
-
>
|
|
38
|
+
<details name={name} className={cssClasses} aria-label={title} {...props}>
|
|
53
39
|
<summary className="collapsible-header">
|
|
54
40
|
<Icon className="collapsible-arrow" name="AngleRight" size="4" />
|
|
55
41
|
<span className="collapsible-title">{title}</span>
|