prometeo-design-system 7.4.0 → 7.4.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/dist/AttachInput.es.js +93 -79
- package/dist/Button.es.js +1 -1
- package/dist/Card.es.js +77 -59
- package/dist/Collapsible.css +1 -0
- package/dist/Collapsible.d.ts +6 -0
- package/dist/Collapsible.es.js +78 -0
- package/dist/{DatePicker-CcRHWIOk.js → DatePicker-BlmJnSpU.js} +1045 -1036
- package/dist/DatePicker.es.js +1 -1
- package/dist/HelperComponent.es.js +8 -8
- package/dist/Popover.es.js +52 -52
- package/dist/RecurrentDatePicker.es.js +1 -1
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/SelectLegacy.es.js +1 -1
- package/dist/components/AttachInput/AttachInput.types.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts +4 -0
- package/dist/components/Card/CardContext.d.ts +1 -1
- package/dist/components/Collapsible/Collapsible.d.ts +19 -0
- package/dist/components/Collapsible/Collapsible.types.d.ts +29 -0
- package/dist/components/Collapsible/CollapsibleContext.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +5 -6
- package/dist/components/Input/types.d.ts +5 -0
- package/dist/exports/Collapsible.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/prometeo-design-system.es.js +7 -5
- package/dist/styles.css +1 -1
- package/package.json +5 -1
package/dist/AttachInput.es.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { useDropzone as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { j as t } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { c as o } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { memo as P, forwardRef as E, useCallback as G } from "react";
|
|
4
|
+
import { useDropzone as H } from "react-dropzone";
|
|
5
|
+
import _ from "./CardBackground.es.js";
|
|
6
|
+
import q from "./PlainTooltip.es.js";
|
|
7
|
+
import K from "./HelperComponent.es.js";
|
|
7
8
|
import { c as i } from "./index-BOQuZ0gG.js";
|
|
8
|
-
import { UploadCloud as
|
|
9
|
-
import { Info as
|
|
10
|
-
const
|
|
11
|
-
"relative w-full radius-large transition-colors duration-200 overflow-hidden flex flex-col items-center justify-center text-center gap-1 p-3",
|
|
9
|
+
import { UploadCloud as O } from "./Icons/UploadCloud.es.js";
|
|
10
|
+
import { Info as U } from "./Icons/Info.es.js";
|
|
11
|
+
const W = i(
|
|
12
|
+
"relative w-full radius-large transition-colors duration-200 overflow-hidden flex flex-col items-center justify-center text-center gap-1 p-3 flex-1",
|
|
12
13
|
{
|
|
13
14
|
variants: {
|
|
14
15
|
disabled: {
|
|
@@ -20,14 +21,14 @@ const O = i(
|
|
|
20
21
|
disabled: !1
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
),
|
|
24
|
+
), J = {
|
|
24
25
|
disabled: "text-[var(--border-disabled-ondisabled)]",
|
|
25
26
|
"drag-active": "text-[var(--border-brand-secondary-default)]",
|
|
26
27
|
"drag-reject": "text-[var(--border-error-onneutral-default)]",
|
|
27
28
|
default: "text-[var(--border-neutral-primary-default)]",
|
|
28
29
|
error: "text-[var(--border-error-onneutral-default)]",
|
|
29
30
|
success: "text-[var(--border-success-onneutral-default)]"
|
|
30
|
-
},
|
|
31
|
+
}, L = (r, e, n) => n ? "disabled" : e === "active" ? "drag-active" : e === "reject" ? "drag-reject" : r, Q = i(
|
|
31
32
|
"prometeo-fonts-body-medium text-balanced text-neutral-secondary-default",
|
|
32
33
|
{
|
|
33
34
|
variants: {
|
|
@@ -40,14 +41,14 @@ const O = i(
|
|
|
40
41
|
disabled: !1
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
),
|
|
44
|
+
), X = i("icon-neutral-tertiary-default", {
|
|
44
45
|
variants: {
|
|
45
46
|
disabled: {
|
|
46
47
|
true: "icon-disabled-default!",
|
|
47
48
|
false: ""
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
}),
|
|
51
|
+
}), Y = i(
|
|
51
52
|
"prometeo-fonts-label-large flex items-center px-3 gap-0.5",
|
|
52
53
|
{
|
|
53
54
|
variants: {
|
|
@@ -66,81 +67,92 @@ const O = i(
|
|
|
66
67
|
disabled: !1
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
),
|
|
70
|
-
const e =
|
|
71
|
-
return e < 1 ? `${Math.round(
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
70
|
+
), Z = (r) => {
|
|
71
|
+
const e = r / 1048576;
|
|
72
|
+
return e < 1 ? `${Math.round(r / 1024)} KB` : e < 1024 ? `${e % 1 === 0 ? e : e.toFixed(1)} MB` : `${(e / 1024).toFixed(1)} GB`;
|
|
73
|
+
}, N = (r) => Object.keys(r).map((e) => r[e].join(", ")).join(" "), F = (r, e, n) => {
|
|
74
|
+
if (r.some(
|
|
74
75
|
(d) => d.errors.some((u) => u.code === "too-many-files")
|
|
75
76
|
))
|
|
76
77
|
return `Máximo ${e} ${e === 1 ? "archivo" : "archivos"} permitido${e === 1 ? "" : "s"}`;
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
},
|
|
78
|
+
const s = r.length;
|
|
79
|
+
return s === 1 ? "El archivo no pudo cargarse" : `${s} archivos no pudieron cargarse`;
|
|
80
|
+
}, ee = (r, e) => e ? "reject" : r ? "active" : "idle", w = E(
|
|
80
81
|
({
|
|
81
|
-
onFilesAccepted:
|
|
82
|
+
onFilesAccepted: r,
|
|
82
83
|
onFilesRejected: e,
|
|
83
84
|
className: n,
|
|
84
85
|
label: c,
|
|
85
|
-
subtitle:
|
|
86
|
+
subtitle: s = "Arrastra y suelta los archivos aquí, o haz clic para seleccionar",
|
|
86
87
|
acceptedFormats: d,
|
|
87
88
|
status: u,
|
|
88
89
|
supportingText: f,
|
|
89
|
-
showSupportingText:
|
|
90
|
+
showSupportingText: z,
|
|
90
91
|
disabled: a = !1,
|
|
91
92
|
accept: m,
|
|
92
93
|
maxFiles: h = 1,
|
|
93
|
-
maxSize:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
maxSize: v,
|
|
95
|
+
cardBackground: b,
|
|
96
|
+
...C
|
|
97
|
+
}, M) => {
|
|
98
|
+
const D = G(
|
|
99
|
+
(j, y) => {
|
|
100
|
+
j.length > 0 && r?.(j), y.length > 0 && e?.(y);
|
|
99
101
|
},
|
|
100
|
-
[
|
|
102
|
+
[r, e]
|
|
101
103
|
), {
|
|
102
104
|
getRootProps: V,
|
|
103
105
|
getInputProps: $,
|
|
104
106
|
isDragActive: k,
|
|
105
107
|
isDragReject: A,
|
|
106
|
-
fileRejections:
|
|
107
|
-
} =
|
|
108
|
+
fileRejections: g
|
|
109
|
+
} = H({
|
|
108
110
|
onDrop: D,
|
|
109
111
|
accept: m,
|
|
110
112
|
maxFiles: h,
|
|
111
113
|
disabled: a,
|
|
112
|
-
maxSize:
|
|
113
|
-
...
|
|
114
|
-
}),
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
c && /* @__PURE__ */
|
|
114
|
+
maxSize: v,
|
|
115
|
+
...C
|
|
116
|
+
}), p = g.length > 0, l = p ? "error" : u ?? "default", x = ee(k, A), R = L(l, x, a), S = J[R], I = p ? F([...g], h) : typeof f == "function" ? f() : f, B = d ?? N(m ?? {}), T = N(m ?? {});
|
|
117
|
+
return /* @__PURE__ */ t.jsxs("div", { className: o("w-full flex flex-col gap-1 h-[136px]", n), children: [
|
|
118
|
+
c && /* @__PURE__ */ t.jsx(
|
|
117
119
|
"label",
|
|
118
120
|
{
|
|
119
|
-
className:
|
|
121
|
+
className: Y({
|
|
120
122
|
visualStatus: l,
|
|
121
123
|
disabled: a
|
|
122
124
|
}),
|
|
123
125
|
children: c
|
|
124
126
|
}
|
|
125
127
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ t.jsxs(
|
|
127
129
|
"div",
|
|
128
130
|
{
|
|
129
|
-
ref:
|
|
131
|
+
ref: M,
|
|
130
132
|
...V(),
|
|
131
|
-
className:
|
|
133
|
+
className: W({ disabled: a }),
|
|
132
134
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ t.jsx("input", { ...$() }),
|
|
136
|
+
/* @__PURE__ */ t.jsx(
|
|
137
|
+
_,
|
|
138
|
+
{
|
|
139
|
+
color: "neutral",
|
|
140
|
+
variant: "default",
|
|
141
|
+
forced: "default",
|
|
142
|
+
...b,
|
|
143
|
+
className: o("absolute inset-0", b?.className)
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ t.jsx(
|
|
135
147
|
"svg",
|
|
136
148
|
{
|
|
137
149
|
"aria-hidden": !0,
|
|
138
|
-
className:
|
|
139
|
-
"absolute inset-0 w-full h-full pointer-events-none overflow-visible transition-colors duration-200",
|
|
150
|
+
className: o(
|
|
151
|
+
"absolute inset-0 z-[1] w-full h-full pointer-events-none overflow-visible transition-colors duration-200",
|
|
140
152
|
S,
|
|
141
153
|
!a && x === "idle" && "group-hover:text-[var(--border-brand-secondary-hover)] group-active:text-[var(--border-brand-secondary-pressed)]"
|
|
142
154
|
),
|
|
143
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ t.jsx(
|
|
144
156
|
"rect",
|
|
145
157
|
{
|
|
146
158
|
x: "0.5",
|
|
@@ -156,51 +168,53 @@ const O = i(
|
|
|
156
168
|
)
|
|
157
169
|
}
|
|
158
170
|
),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
className: J({
|
|
163
|
-
disabled: a
|
|
164
|
-
}),
|
|
165
|
-
children: o
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
/* @__PURE__ */ r.jsx(
|
|
169
|
-
q,
|
|
171
|
+
s && /* @__PURE__ */ t.jsx("p", { className: o(Q({ disabled: a }), "relative z-[1]"), children: s }),
|
|
172
|
+
/* @__PURE__ */ t.jsx(
|
|
173
|
+
O,
|
|
170
174
|
{
|
|
171
175
|
size: 20,
|
|
172
|
-
className:
|
|
173
|
-
disabled: a
|
|
174
|
-
})
|
|
176
|
+
className: o(X({ disabled: a }), "relative z-[1]")
|
|
175
177
|
}
|
|
176
178
|
),
|
|
177
|
-
!
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
179
|
+
!p && /* @__PURE__ */ t.jsxs("div", { className: "relative z-[1] w-full overflow-hidden flex justify-center items-center gap-0.5", children: [
|
|
180
|
+
/* @__PURE__ */ t.jsxs(
|
|
181
|
+
"p",
|
|
182
|
+
{
|
|
183
|
+
className: o(
|
|
184
|
+
"prometeo-fonts-body-xsmall text-neutral-tertiary-default line-clamp-1",
|
|
185
|
+
a && "text-disabled-default!"
|
|
186
|
+
),
|
|
187
|
+
children: [
|
|
188
|
+
B,
|
|
189
|
+
v !== void 0 && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
190
|
+
" ",
|
|
191
|
+
"· Máx. ",
|
|
192
|
+
Z(v)
|
|
193
|
+
] })
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ t.jsx(q, { title: T, children: /* @__PURE__ */ t.jsx(
|
|
198
|
+
U,
|
|
188
199
|
{
|
|
189
200
|
size: 12,
|
|
190
|
-
className:
|
|
201
|
+
className: o(
|
|
202
|
+
"icon-neutral-tertiary-default shrink-0",
|
|
203
|
+
a && "icon-disabled-default!"
|
|
204
|
+
)
|
|
191
205
|
}
|
|
192
206
|
) })
|
|
193
207
|
] })
|
|
194
208
|
]
|
|
195
209
|
}
|
|
196
210
|
),
|
|
197
|
-
|
|
211
|
+
z && /* @__PURE__ */ t.jsx(K, { variant: l, disabled: a, className: o(l === "default" && !a && "[&>p]:text-neutral-tertiary-default! [&>svg]:icon-neutral-tertiary-default!"), children: I })
|
|
198
212
|
] });
|
|
199
213
|
}
|
|
200
214
|
);
|
|
201
|
-
|
|
202
|
-
const
|
|
215
|
+
w.displayName = "AttachInput";
|
|
216
|
+
const ue = P(w);
|
|
203
217
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
218
|
+
ue as AttachInput,
|
|
219
|
+
ue as default
|
|
206
220
|
};
|
package/dist/Button.es.js
CHANGED
package/dist/Card.es.js
CHANGED
|
@@ -1,112 +1,130 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { c as
|
|
4
|
-
import { c as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const a =
|
|
1
|
+
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { createContext as z, useContext as w, memo as s, forwardRef as F, useMemo as H } from "react";
|
|
3
|
+
import { c as i } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { c as d } from "./index-BOQuZ0gG.js";
|
|
5
|
+
import V from "./CardBackground.es.js";
|
|
6
|
+
const C = z(null);
|
|
7
|
+
function m() {
|
|
8
|
+
const a = w(C);
|
|
9
9
|
if (!a)
|
|
10
10
|
throw new Error(
|
|
11
11
|
"Card compound components (Card.Header, Card.Content, Card.Footer) must be used inside <Card>"
|
|
12
12
|
);
|
|
13
13
|
return a;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
"relative overflow-hidden dropshadow-100 radius-medium border border-neutral-default-default p-3 shrink-0",
|
|
15
|
+
const k = d(
|
|
16
|
+
"relative overflow-hidden dropshadow-100 radius-medium border border-neutral-default-default p-3 shrink-0 *:z-10",
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
|
-
|
|
19
|
+
orientation: {
|
|
20
20
|
vertical: "flex flex-col",
|
|
21
21
|
horizontal: "flex flex-row"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
defaultVariants: {
|
|
25
|
-
|
|
25
|
+
orientation: "vertical"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
),
|
|
28
|
+
), b = d("shrink-0 z-10", {
|
|
29
29
|
variants: {
|
|
30
|
-
|
|
30
|
+
orientation: {
|
|
31
31
|
vertical: "",
|
|
32
32
|
horizontal: ""
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), y = d("shrink-0 z-10", {
|
|
36
36
|
variants: {
|
|
37
|
-
|
|
37
|
+
orientation: {
|
|
38
38
|
vertical: "",
|
|
39
39
|
horizontal: ""
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
42
|
+
}), E = d("flex-1 min-h-0 min-w-0 z-10"), g = F(function({
|
|
43
43
|
variant: r = "1-slot",
|
|
44
|
-
direction: t
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
direction: t,
|
|
45
|
+
orientation: o,
|
|
46
|
+
cardBackground: n,
|
|
47
|
+
children: h,
|
|
48
|
+
className: v,
|
|
49
|
+
...N
|
|
50
|
+
}, p) {
|
|
51
|
+
const l = o ?? t ?? "vertical", j = H(
|
|
52
|
+
() => ({ orientation: l, variant: r }),
|
|
53
|
+
[l, r]
|
|
53
54
|
);
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ e.jsx(C.Provider, { value: j, children: /* @__PURE__ */ e.jsxs(
|
|
55
56
|
"div",
|
|
56
57
|
{
|
|
57
|
-
ref:
|
|
58
|
-
className:
|
|
59
|
-
|
|
58
|
+
ref: p,
|
|
59
|
+
className: i(
|
|
60
|
+
k({ orientation: l }),
|
|
61
|
+
v
|
|
62
|
+
),
|
|
63
|
+
...N,
|
|
60
64
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
65
|
+
/* @__PURE__ */ e.jsx(
|
|
66
|
+
V,
|
|
63
67
|
{
|
|
64
|
-
...
|
|
65
|
-
className:
|
|
68
|
+
...n,
|
|
69
|
+
className: i(
|
|
66
70
|
"inset-0 absolute z-0",
|
|
67
|
-
|
|
71
|
+
n?.className
|
|
68
72
|
)
|
|
69
73
|
}
|
|
70
74
|
),
|
|
71
|
-
|
|
75
|
+
h
|
|
72
76
|
]
|
|
73
77
|
}
|
|
74
78
|
) });
|
|
75
|
-
}),
|
|
79
|
+
}), u = s(function({
|
|
76
80
|
children: r,
|
|
77
81
|
className: t,
|
|
78
|
-
...
|
|
82
|
+
...o
|
|
79
83
|
}) {
|
|
80
|
-
const {
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
84
|
+
const { orientation: n } = m();
|
|
85
|
+
return /* @__PURE__ */ e.jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: i(b({ orientation: n }), t),
|
|
89
|
+
...o,
|
|
90
|
+
children: r
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}), f = s(function({
|
|
83
94
|
children: r,
|
|
84
95
|
className: t,
|
|
85
|
-
...
|
|
96
|
+
...o
|
|
86
97
|
}) {
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
}),
|
|
98
|
+
return /* @__PURE__ */ e.jsx("div", { className: i(E(), t), ...o, children: r });
|
|
99
|
+
}), x = s(function({
|
|
89
100
|
children: r,
|
|
90
101
|
className: t,
|
|
91
|
-
...
|
|
102
|
+
...o
|
|
92
103
|
}) {
|
|
93
|
-
const {
|
|
94
|
-
return /* @__PURE__ */
|
|
104
|
+
const { orientation: n } = m();
|
|
105
|
+
return /* @__PURE__ */ e.jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: i(y({ orientation: n }), t),
|
|
109
|
+
...o,
|
|
110
|
+
children: r
|
|
111
|
+
}
|
|
112
|
+
);
|
|
95
113
|
});
|
|
96
|
-
function
|
|
97
|
-
return a.variant === r.variant && a.direction === r.direction && a.className === r.className && a.children === r.children && a.cardBackground === r.cardBackground;
|
|
114
|
+
function B(a, r) {
|
|
115
|
+
return a.variant === r.variant && a.direction === r.direction && a.orientation === r.orientation && a.className === r.className && a.children === r.children && a.cardBackground === r.cardBackground;
|
|
98
116
|
}
|
|
99
|
-
const c =
|
|
100
|
-
c.Header =
|
|
101
|
-
c.Content =
|
|
102
|
-
c.Footer =
|
|
117
|
+
const c = s(g, B);
|
|
118
|
+
c.Header = u;
|
|
119
|
+
c.Content = f;
|
|
120
|
+
c.Footer = x;
|
|
103
121
|
c.displayName = "Card";
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
u.displayName = "Card.Header";
|
|
123
|
+
f.displayName = "Card.Content";
|
|
124
|
+
x.displayName = "Card.Footer";
|
|
107
125
|
export {
|
|
108
126
|
c as Card,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
127
|
+
f as CardContent,
|
|
128
|
+
x as CardFooter,
|
|
129
|
+
u as CardHeader
|
|
112
130
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pyrion-collapsible-content[data-orientation=vertical]{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s ease-out,opacity .1s ease-in;opacity:0}.pyrion-collapsible-content[data-orientation=vertical][data-expanded=true]{grid-template-rows:1fr;opacity:1;transition:grid-template-rows .25s ease-out,opacity .15s ease-out 50ms}.pyrion-collapsible-content[data-orientation=horizontal]{display:grid;grid-template-columns:0fr;transition:grid-template-columns .25s ease-out,opacity .1s ease-in;opacity:0}.pyrion-collapsible-content[data-orientation=horizontal][data-expanded=true]{grid-template-columns:1fr;opacity:1;transition:grid-template-columns .25s ease-out,opacity .15s ease-out 50ms}.pyrion-collapsible-inner{overflow:hidden}.pyrion-collapsible-content[data-orientation=vertical] .pyrion-collapsible-inner{min-height:0}.pyrion-collapsible-content[data-orientation=horizontal] .pyrion-collapsible-inner{min-width:0}.pyrion-collapsible-trigger{display:flex;align-items:center;cursor:pointer;background:none;border:none;padding:0;width:100%;text-align:left;color:inherit;font:inherit}.pyrion-collapsible-trigger:disabled{cursor:not-allowed;opacity:.4}.pyrion-collapsible-trigger svg{transition:transform .25s ease;flex-shrink:0}.pyrion-collapsible-trigger[data-expanded=true] svg{transform:rotate(180deg)}.pyrion-collapsible-trigger[data-orientation=horizontal][data-expanded=true] svg{transform:rotate(90deg)}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { createContext as g, useContext as j, memo as v, useState as y, useCallback as O } from "react";
|
|
3
|
+
const u = g(null);
|
|
4
|
+
function d() {
|
|
5
|
+
const e = j(u);
|
|
6
|
+
if (!e)
|
|
7
|
+
throw new Error(
|
|
8
|
+
"Collapsible sub-components must be used inside <Collapsible>"
|
|
9
|
+
);
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function N({
|
|
13
|
+
orientation: e = "vertical",
|
|
14
|
+
defaultOpen: t = !1,
|
|
15
|
+
open: n,
|
|
16
|
+
onOpenChange: o,
|
|
17
|
+
disabled: l = !1,
|
|
18
|
+
children: s,
|
|
19
|
+
className: a
|
|
20
|
+
}) {
|
|
21
|
+
const r = n !== void 0, [x, m] = y(t), p = r ? n : x, f = O(() => {
|
|
22
|
+
if (l) return;
|
|
23
|
+
const c = !p;
|
|
24
|
+
r || m(c), o?.(c);
|
|
25
|
+
}, [l, r, p, o]);
|
|
26
|
+
return /* @__PURE__ */ i.jsx(
|
|
27
|
+
u.Provider,
|
|
28
|
+
{
|
|
29
|
+
value: { isOpen: p, toggle: f, orientation: e, disabled: l },
|
|
30
|
+
children: /* @__PURE__ */ i.jsx("div", { className: a, children: s })
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function C({
|
|
35
|
+
children: e,
|
|
36
|
+
className: t,
|
|
37
|
+
...n
|
|
38
|
+
}) {
|
|
39
|
+
const { isOpen: o, toggle: l, orientation: s, disabled: a } = d();
|
|
40
|
+
return /* @__PURE__ */ i.jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
className: `pyrion-collapsible-trigger${t ? ` ${t}` : ""}`,
|
|
45
|
+
onClick: l,
|
|
46
|
+
disabled: a,
|
|
47
|
+
"aria-expanded": o,
|
|
48
|
+
"data-expanded": o,
|
|
49
|
+
"data-orientation": s,
|
|
50
|
+
...n,
|
|
51
|
+
children: e
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function b({ children: e, className: t }) {
|
|
56
|
+
const { isOpen: n, orientation: o } = d();
|
|
57
|
+
return /* @__PURE__ */ i.jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: `pyrion-collapsible-content${t ? ` ${t}` : ""}`,
|
|
61
|
+
"data-expanded": n,
|
|
62
|
+
"data-orientation": o,
|
|
63
|
+
...n ? {} : { inert: !0 },
|
|
64
|
+
children: /* @__PURE__ */ i.jsx("div", { className: "pyrion-collapsible-inner", children: e })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
const $ = Object.assign(v(N), {
|
|
69
|
+
Trigger: C,
|
|
70
|
+
Content: b
|
|
71
|
+
});
|
|
72
|
+
$.displayName = "Collapsible";
|
|
73
|
+
C.displayName = "Collapsible.Trigger";
|
|
74
|
+
b.displayName = "Collapsible.Content";
|
|
75
|
+
export {
|
|
76
|
+
$ as Collapsible,
|
|
77
|
+
$ as default
|
|
78
|
+
};
|