@orioncactuscorp/ui 1.9.2 → 1.11.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/README.md +119 -54
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +169 -177
- package/dist/components/ActionArea/ActionAreaLayout.js +20 -24
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/Cell/Cell.js +57 -58
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +50 -51
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Menu/Menu.module.scss.js +20 -22
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +585 -575
- package/dist/components/Modal/bottomSheetGeometry.js +46 -33
- package/dist/components/Modal/modalScrollArbitration.js +71 -49
- package/dist/components/Modal/snapPoints.js +42 -38
- package/dist/components/Modal/useModalContentBlockTransition.js +49 -44
- package/dist/components/Modal/useModalDrag.js +937 -854
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +197 -200
- package/dist/components/Select/Select.js +31 -34
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.js +208 -0
- package/dist/components/Tabs/Tabs.module.scss.js +27 -0
- package/dist/components/Tabs.d.ts +6 -0
- package/dist/components/Tabs.js +8 -0
- package/dist/components/TextArea/TextArea.js +57 -58
- package/dist/components/TextInput/TextInput.js +30 -33
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/foundations/color.theme.dark.css +1 -1
- package/dist/foundations/color.theme.light.css +1 -1
- package/dist/foundations/focus.css +1 -0
- package/dist/foundations/reset.css +1 -1
- package/dist/foundations.css +4 -3
- package/dist/index.js +69 -64
- package/dist/react/motion.js +31 -35
- package/dist/reset.css +1 -1
- package/dist/styles.css +14 -12
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -1
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +10 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/types.d.ts +16 -0
- package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts +13 -0
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +3 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +8 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +27 -10
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Radio/types.d.ts +16 -0
- package/dist/ui/src/components/Radio/types.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/Select/Select.d.ts.map +1 -1
- package/dist/ui/src/components/Switch/types.d.ts +10 -0
- package/dist/ui/src/components/Switch/types.d.ts.map +1 -1
- package/dist/ui/src/components/Tabs/Tabs.d.ts +7 -0
- package/dist/ui/src/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/index.d.ts +3 -0
- package/dist/ui/src/components/Tabs/index.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/types.d.ts +26 -0
- package/dist/ui/src/components/Tabs/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/ui/src/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +2 -0
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/mergeRefs.d.ts +13 -0
- package/dist/ui/src/utils/mergeRefs.d.ts.map +1 -0
- package/dist/utils/mergeRefs.js +24 -0
- package/dist/vscode/oc-ui-vars.css +13 -0
- package/docs/editor-setup.md +42 -0
- package/docs/motion.md +665 -0
- package/docs/responsive-foundation-profile.md +230 -0
- package/docs/scss-helpers.md +189 -0
- package/docs/selector-contract.md +260 -0
- package/docs/spring.md +382 -0
- package/docs/stability.md +62 -0
- package/docs/tokens.md +559 -0
- package/package.json +9 -4
- package/src/scss/foundations/color-theme.test.ts +14 -0
- package/src/scss/foundations/color.theme.dark.scss +1 -0
- package/src/scss/foundations/color.theme.light.scss +1 -0
- package/src/scss/foundations/focus.scss +4 -0
- package/src/scss/foundations/focus.test.ts +48 -0
- package/src/scss/foundations/reset.scss +9 -4
- package/src/scss/foundations/reset.test.ts +32 -0
- package/src/scss/index.scss +2 -0
- package/src/scss/mixins/_focus.scss +11 -0
- package/src/scss/mixins/_focus.test.ts +58 -0
|
@@ -1,260 +1,252 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { MotionExpand as
|
|
5
|
-
import
|
|
2
|
+
import { jsx as s, jsxs as k } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as T, useState as V, useMemo as U, useId as K, useCallback as M, createContext as $, useContext as q } from "react";
|
|
4
|
+
import { MotionExpand as O } from "../../react/motion.js";
|
|
5
|
+
import { mergeRefs as z } from "../../utils/mergeRefs.js";
|
|
6
|
+
import F from "../Interaction/Interaction.js";
|
|
6
7
|
import { DisclosureIndicator as G } from "../internal/DisclosureIndicator.js";
|
|
7
|
-
import { normalizeSlotIcon as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import { normalizeSlotIcon as E } from "../internal/slot.js";
|
|
9
|
+
import m from "./Accordion.module.scss.js";
|
|
10
|
+
const B = $(null), H = $(
|
|
10
11
|
null
|
|
11
12
|
);
|
|
12
|
-
function S(
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
throw new Error(`${
|
|
16
|
-
return
|
|
13
|
+
function S(o) {
|
|
14
|
+
const e = q(B);
|
|
15
|
+
if (!e)
|
|
16
|
+
throw new Error(`${o} must be used within Accordion.`);
|
|
17
|
+
return e;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
throw new Error(`${
|
|
22
|
-
return
|
|
19
|
+
function j(o) {
|
|
20
|
+
const e = q(H);
|
|
21
|
+
if (!e)
|
|
22
|
+
throw new Error(`${o} must be used within AccordionItem.`);
|
|
23
|
+
return e;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
return
|
|
25
|
+
function P(o, e) {
|
|
26
|
+
const t = Array.from(new Set(o.filter(Boolean)));
|
|
27
|
+
return e ? t : t.slice(0, 1);
|
|
27
28
|
}
|
|
28
|
-
function w(...
|
|
29
|
-
return
|
|
29
|
+
function w(...o) {
|
|
30
|
+
return o.filter(Boolean).join(" ");
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function J(t) {
|
|
35
|
-
return t ? Array.from(
|
|
36
|
-
t.querySelectorAll(
|
|
32
|
+
function J(o) {
|
|
33
|
+
return o ? Array.from(
|
|
34
|
+
o.querySelectorAll(
|
|
37
35
|
'[data-oc-component="accordion-summary"]:not(:disabled)'
|
|
38
36
|
)
|
|
39
|
-
).filter((
|
|
37
|
+
).filter((e) => e.getAttribute("aria-hidden") !== "true") : [];
|
|
40
38
|
}
|
|
41
39
|
function L({
|
|
42
|
-
root:
|
|
43
|
-
currentTarget:
|
|
44
|
-
key:
|
|
40
|
+
root: o,
|
|
41
|
+
currentTarget: e,
|
|
42
|
+
key: t,
|
|
45
43
|
loopFocus: r
|
|
46
44
|
}) {
|
|
47
|
-
const
|
|
45
|
+
const l = J(o), a = l.indexOf(e);
|
|
48
46
|
if (a < 0) return;
|
|
49
|
-
const c =
|
|
47
|
+
const c = l.length - 1;
|
|
50
48
|
let i = a;
|
|
51
|
-
|
|
49
|
+
t === "Home" ? i = 0 : t === "End" ? i = c : t === "ArrowDown" ? i = a === c ? r ? 0 : c : a + 1 : t === "ArrowUp" && (i = a === 0 ? r ? c : 0 : a - 1), l[i]?.focus();
|
|
52
50
|
}
|
|
53
|
-
function Q(
|
|
54
|
-
return
|
|
51
|
+
function Q(o) {
|
|
52
|
+
return o >= 2 && o <= 6;
|
|
55
53
|
}
|
|
56
|
-
function
|
|
57
|
-
children:
|
|
58
|
-
className:
|
|
59
|
-
collapsible:
|
|
54
|
+
function no({
|
|
55
|
+
children: o,
|
|
56
|
+
className: e = "",
|
|
57
|
+
collapsible: t = !0,
|
|
60
58
|
defaultValue: r = [],
|
|
61
|
-
disabled:
|
|
59
|
+
disabled: l = !1,
|
|
62
60
|
disableAnimation: a = !1,
|
|
63
61
|
divider: c = "neutral",
|
|
64
62
|
loopFocus: i = !0,
|
|
65
63
|
multiple: n = !0,
|
|
66
|
-
onValueChange:
|
|
67
|
-
ref:
|
|
68
|
-
value:
|
|
69
|
-
...
|
|
64
|
+
onValueChange: f,
|
|
65
|
+
ref: p,
|
|
66
|
+
value: A,
|
|
67
|
+
...g
|
|
70
68
|
}) {
|
|
71
|
-
const
|
|
72
|
-
() =>
|
|
73
|
-
),
|
|
74
|
-
v ?
|
|
69
|
+
const h = T(null), v = A !== void 0, [I, y] = V(
|
|
70
|
+
() => P(r, n)
|
|
71
|
+
), d = P(
|
|
72
|
+
v ? A : I,
|
|
75
73
|
n
|
|
76
|
-
),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!e) return;
|
|
85
|
-
D(s.filter((N) => N !== m));
|
|
74
|
+
), b = (x) => {
|
|
75
|
+
const D = P(x, n);
|
|
76
|
+
v || y(D), f?.(D);
|
|
77
|
+
}, C = (x) => {
|
|
78
|
+
if (l) return;
|
|
79
|
+
if (d.includes(x)) {
|
|
80
|
+
if (!t) return;
|
|
81
|
+
b(d.filter((N) => N !== x));
|
|
86
82
|
return;
|
|
87
83
|
}
|
|
88
|
-
|
|
84
|
+
b(n ? [...d, x] : [x]);
|
|
89
85
|
};
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
86
|
+
return /* @__PURE__ */ s(
|
|
87
|
+
B.Provider,
|
|
92
88
|
{
|
|
93
89
|
value: {
|
|
94
|
-
value:
|
|
95
|
-
collapsible:
|
|
96
|
-
disabled:
|
|
90
|
+
value: d,
|
|
91
|
+
collapsible: t,
|
|
92
|
+
disabled: l,
|
|
97
93
|
divider: c,
|
|
98
94
|
disableAnimation: a,
|
|
99
95
|
loopFocus: i,
|
|
100
|
-
rootRef:
|
|
101
|
-
toggleItem:
|
|
96
|
+
rootRef: h,
|
|
97
|
+
toggleItem: C
|
|
102
98
|
},
|
|
103
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ s(
|
|
104
100
|
"div",
|
|
105
101
|
{
|
|
106
|
-
ref:
|
|
107
|
-
className: w(
|
|
108
|
-
...
|
|
102
|
+
ref: z(h, p),
|
|
103
|
+
className: w(m.accordion, m[c], e),
|
|
104
|
+
...g,
|
|
109
105
|
"data-oc-component": "accordion",
|
|
110
|
-
"data-oc-disabled":
|
|
106
|
+
"data-oc-disabled": l ? "true" : void 0,
|
|
111
107
|
"data-oc-divider": c,
|
|
112
108
|
"data-oc-animation": a ? "disabled" : void 0,
|
|
113
|
-
children:
|
|
109
|
+
children: o
|
|
114
110
|
}
|
|
115
111
|
)
|
|
116
112
|
}
|
|
117
113
|
);
|
|
118
114
|
}
|
|
119
|
-
function
|
|
120
|
-
children:
|
|
121
|
-
className:
|
|
122
|
-
disabled:
|
|
115
|
+
function ro({
|
|
116
|
+
children: o,
|
|
117
|
+
className: e = "",
|
|
118
|
+
disabled: t = !1,
|
|
123
119
|
divider: r,
|
|
124
|
-
ref:
|
|
120
|
+
ref: l,
|
|
125
121
|
value: a,
|
|
126
122
|
...c
|
|
127
123
|
}) {
|
|
128
|
-
const i = S("AccordionItem"), n =
|
|
129
|
-
|
|
130
|
-
(
|
|
124
|
+
const i = S("AccordionItem"), n = K(), f = i.disabled || t, p = i.value.includes(a), A = r ?? i.divider, [g, h] = V(p), v = M((I) => {
|
|
125
|
+
h(
|
|
126
|
+
(y) => y === I ? y : I
|
|
131
127
|
);
|
|
132
128
|
}, []);
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
|
|
129
|
+
return /* @__PURE__ */ s(
|
|
130
|
+
H.Provider,
|
|
135
131
|
{
|
|
136
132
|
value: {
|
|
137
133
|
value: a,
|
|
138
|
-
open:
|
|
139
|
-
disabled:
|
|
140
|
-
divider:
|
|
134
|
+
open: p,
|
|
135
|
+
disabled: f,
|
|
136
|
+
divider: A,
|
|
141
137
|
summaryId: `${n}-summary`,
|
|
142
138
|
detailsId: `${n}-details`,
|
|
143
|
-
detailsPresent:
|
|
139
|
+
detailsPresent: g,
|
|
144
140
|
setDetailsPresent: v
|
|
145
141
|
},
|
|
146
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ s(
|
|
147
143
|
"div",
|
|
148
144
|
{
|
|
149
|
-
ref:
|
|
150
|
-
className: w(
|
|
145
|
+
ref: l,
|
|
146
|
+
className: w(m.item, e),
|
|
151
147
|
...c,
|
|
152
148
|
"data-oc-component": "accordion-item",
|
|
153
|
-
"data-oc-disabled":
|
|
154
|
-
"data-oc-divider":
|
|
155
|
-
"data-oc-state":
|
|
156
|
-
children:
|
|
149
|
+
"data-oc-disabled": f ? "true" : void 0,
|
|
150
|
+
"data-oc-divider": A,
|
|
151
|
+
"data-oc-state": p ? "open" : "closed",
|
|
152
|
+
children: o
|
|
157
153
|
}
|
|
158
154
|
)
|
|
159
155
|
}
|
|
160
156
|
);
|
|
161
157
|
}
|
|
162
|
-
function
|
|
163
|
-
children:
|
|
164
|
-
className:
|
|
165
|
-
content:
|
|
158
|
+
function ao({
|
|
159
|
+
children: o,
|
|
160
|
+
className: e = "",
|
|
161
|
+
content: t,
|
|
166
162
|
description: r,
|
|
167
|
-
disabled:
|
|
163
|
+
disabled: l = !1,
|
|
168
164
|
fillWidth: a = !1,
|
|
169
165
|
headingLevel: c = 3,
|
|
170
166
|
interactionVariant: i = "light",
|
|
171
167
|
leading: n,
|
|
172
|
-
onClick:
|
|
173
|
-
onKeyDown:
|
|
174
|
-
ref:
|
|
175
|
-
trailing:
|
|
176
|
-
type:
|
|
168
|
+
onClick: f,
|
|
169
|
+
onKeyDown: p,
|
|
170
|
+
ref: A,
|
|
171
|
+
trailing: g,
|
|
172
|
+
type: h = "button",
|
|
177
173
|
verticalAlign: v = "top",
|
|
178
174
|
...I
|
|
179
175
|
}) {
|
|
180
|
-
const
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
] }) :
|
|
184
|
-
|
|
185
|
-
};
|
|
186
|
-
return /* @__PURE__ */ d(P, { className: f.header, "data-oc-part": "header", children: /* @__PURE__ */ E(
|
|
176
|
+
const y = S("AccordionSummary"), d = j("AccordionSummary"), b = d.disabled || l, C = d.open && !y.collapsible, x = `h${Q(c) ? c : 3}`, D = t ?? (r ? /* @__PURE__ */ k("span", { "data-oc-part": "text", children: [
|
|
177
|
+
/* @__PURE__ */ s("span", { "data-oc-part": "label", children: o }),
|
|
178
|
+
/* @__PURE__ */ s("span", { "data-oc-part": "description", children: r })
|
|
179
|
+
] }) : o), N = E(n), R = E(g);
|
|
180
|
+
return /* @__PURE__ */ s(x, { className: m.header, "data-oc-part": "header", children: /* @__PURE__ */ k(
|
|
187
181
|
"button",
|
|
188
182
|
{
|
|
189
|
-
ref:
|
|
190
|
-
className: w(
|
|
183
|
+
ref: A,
|
|
184
|
+
className: w(m.summary, e),
|
|
191
185
|
...I,
|
|
192
|
-
type:
|
|
193
|
-
disabled:
|
|
194
|
-
"aria-disabled":
|
|
195
|
-
"aria-expanded":
|
|
196
|
-
"aria-controls":
|
|
197
|
-
id:
|
|
198
|
-
onClick: (
|
|
199
|
-
|
|
186
|
+
type: h,
|
|
187
|
+
disabled: b,
|
|
188
|
+
"aria-disabled": b || C ? "true" : I["aria-disabled"],
|
|
189
|
+
"aria-expanded": d.open,
|
|
190
|
+
"aria-controls": d.open || d.detailsPresent ? d.detailsId : void 0,
|
|
191
|
+
id: d.summaryId,
|
|
192
|
+
onClick: (u) => {
|
|
193
|
+
f?.(u), !(u.defaultPrevented || b || C) && y.toggleItem(d.value);
|
|
200
194
|
},
|
|
201
|
-
onKeyDown: (
|
|
202
|
-
|
|
203
|
-
root:
|
|
204
|
-
currentTarget:
|
|
205
|
-
key:
|
|
206
|
-
loopFocus:
|
|
195
|
+
onKeyDown: (u) => {
|
|
196
|
+
p?.(u), !(u.defaultPrevented || b) && (u.key === "ArrowDown" || u.key === "ArrowUp" || u.key === "Home" || u.key === "End") && (u.preventDefault(), L({
|
|
197
|
+
root: y.rootRef.current,
|
|
198
|
+
currentTarget: u.currentTarget,
|
|
199
|
+
key: u.key,
|
|
200
|
+
loopFocus: y.loopFocus
|
|
207
201
|
}));
|
|
208
202
|
},
|
|
209
203
|
"data-oc-component": "accordion-summary",
|
|
210
|
-
"data-oc-disabled":
|
|
204
|
+
"data-oc-disabled": b ? "true" : void 0,
|
|
211
205
|
"data-oc-fill-width": a ? "true" : "false",
|
|
212
|
-
"data-oc-state":
|
|
206
|
+
"data-oc-state": d.open ? "open" : "closed",
|
|
213
207
|
"data-oc-vertical-align": v,
|
|
214
208
|
children: [
|
|
215
|
-
n ? /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
209
|
+
n ? /* @__PURE__ */ s("span", { "data-oc-part": "leading", children: N }) : null,
|
|
210
|
+
/* @__PURE__ */ s("span", { "data-oc-part": "content", children: D }),
|
|
211
|
+
g === void 0 ? /* @__PURE__ */ s(
|
|
218
212
|
G,
|
|
219
213
|
{
|
|
220
|
-
className:
|
|
221
|
-
open:
|
|
214
|
+
className: m.trailing,
|
|
215
|
+
open: d.open,
|
|
222
216
|
part: "trailing",
|
|
223
217
|
"data-oc-rotate": "true",
|
|
224
218
|
rotationVariable: "--oc-accordion-chevron-rotation"
|
|
225
219
|
}
|
|
226
|
-
) :
|
|
227
|
-
|
|
220
|
+
) : R ? /* @__PURE__ */ s("span", { className: m.trailing, "data-oc-part": "trailing", children: R }) : null,
|
|
221
|
+
b ? null : /* @__PURE__ */ s(F, { variant: i, self: !0 })
|
|
228
222
|
]
|
|
229
223
|
}
|
|
230
224
|
) });
|
|
231
225
|
}
|
|
232
|
-
function
|
|
233
|
-
children:
|
|
234
|
-
className:
|
|
235
|
-
forceMount:
|
|
226
|
+
function co({
|
|
227
|
+
children: o,
|
|
228
|
+
className: e = "",
|
|
229
|
+
forceMount: t = !1,
|
|
236
230
|
ref: r,
|
|
237
|
-
region:
|
|
231
|
+
region: l = !1,
|
|
238
232
|
role: a,
|
|
239
233
|
...c
|
|
240
234
|
}) {
|
|
241
|
-
const i = S("AccordionDetails"), n =
|
|
242
|
-
(
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
[r, A]
|
|
235
|
+
const i = S("AccordionDetails"), n = j("AccordionDetails"), { setDetailsPresent: f } = n, p = U(
|
|
236
|
+
() => z(r, (A) => f(A !== null)),
|
|
237
|
+
[r, f]
|
|
246
238
|
);
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
|
|
239
|
+
return /* @__PURE__ */ s(
|
|
240
|
+
O,
|
|
249
241
|
{
|
|
250
|
-
ref:
|
|
251
|
-
className: w(
|
|
242
|
+
ref: p,
|
|
243
|
+
className: w(m.details, e),
|
|
252
244
|
open: n.open,
|
|
253
|
-
forceMount:
|
|
245
|
+
forceMount: t,
|
|
254
246
|
disableAnimation: i.disableAnimation,
|
|
255
247
|
intent: "expand",
|
|
256
248
|
contentProps: {
|
|
257
|
-
className:
|
|
249
|
+
className: m.panelInner,
|
|
258
250
|
"data-oc-part": "panel-inner"
|
|
259
251
|
},
|
|
260
252
|
...c,
|
|
@@ -262,52 +254,52 @@ function at({
|
|
|
262
254
|
"aria-labelledby": n.summaryId,
|
|
263
255
|
id: n.detailsId,
|
|
264
256
|
inert: n.open ? void 0 : !0,
|
|
265
|
-
role:
|
|
257
|
+
role: l ? "region" : a,
|
|
266
258
|
"data-oc-component": "accordion-details",
|
|
267
259
|
"data-oc-state": n.open ? "open" : "closed",
|
|
268
|
-
children:
|
|
260
|
+
children: o
|
|
269
261
|
}
|
|
270
262
|
);
|
|
271
263
|
}
|
|
272
|
-
function
|
|
273
|
-
children:
|
|
274
|
-
className:
|
|
275
|
-
ref:
|
|
264
|
+
function io({
|
|
265
|
+
children: o,
|
|
266
|
+
className: e = "",
|
|
267
|
+
ref: t,
|
|
276
268
|
...r
|
|
277
269
|
}) {
|
|
278
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ s(
|
|
279
271
|
"p",
|
|
280
272
|
{
|
|
281
|
-
ref:
|
|
282
|
-
className: w(
|
|
273
|
+
ref: t,
|
|
274
|
+
className: w(m.description, e),
|
|
283
275
|
...r,
|
|
284
276
|
"data-oc-component": "accordion-description",
|
|
285
|
-
children:
|
|
277
|
+
children: o
|
|
286
278
|
}
|
|
287
279
|
);
|
|
288
280
|
}
|
|
289
|
-
function
|
|
290
|
-
children:
|
|
291
|
-
className:
|
|
292
|
-
ref:
|
|
281
|
+
function so({
|
|
282
|
+
children: o,
|
|
283
|
+
className: e = "",
|
|
284
|
+
ref: t,
|
|
293
285
|
...r
|
|
294
286
|
}) {
|
|
295
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ s(
|
|
296
288
|
"div",
|
|
297
289
|
{
|
|
298
|
-
ref:
|
|
299
|
-
className: w(
|
|
290
|
+
ref: t,
|
|
291
|
+
className: w(m.content, e),
|
|
300
292
|
...r,
|
|
301
293
|
"data-oc-component": "accordion-content",
|
|
302
|
-
children:
|
|
294
|
+
children: o
|
|
303
295
|
}
|
|
304
296
|
);
|
|
305
297
|
}
|
|
306
298
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
299
|
+
so as AccordionContent,
|
|
300
|
+
io as AccordionDescription,
|
|
301
|
+
co as AccordionDetails,
|
|
302
|
+
ro as AccordionItem,
|
|
303
|
+
ao as AccordionSummary,
|
|
304
|
+
no as default
|
|
313
305
|
};
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as b, useCallback as h, useMemo as L, useEffect as N, useContext as O, createContext as C } from "react";
|
|
4
4
|
import { ActionArea as x } from "./ActionArea.js";
|
|
5
|
+
import { mergeRefs as R } from "../../utils/mergeRefs.js";
|
|
5
6
|
import d from "./ActionAreaLayout.module.scss.js";
|
|
6
|
-
const
|
|
7
|
+
const v = {
|
|
7
8
|
canScroll: !1,
|
|
8
9
|
scrolledToBottom: !0
|
|
9
|
-
},
|
|
10
|
+
}, S = 1, p = C(null);
|
|
10
11
|
function f(...o) {
|
|
11
12
|
return o.filter(Boolean).join(" ");
|
|
12
13
|
}
|
|
13
|
-
function R(o, t) {
|
|
14
|
-
typeof o == "function" ? o(t) : o && (o.current = t);
|
|
15
|
-
}
|
|
16
14
|
function E(o) {
|
|
17
|
-
if (!o) return
|
|
18
|
-
const t = o.scrollHeight - o.scrollTop - o.clientHeight, r = o.scrollHeight - o.clientHeight >
|
|
15
|
+
if (!o) return v;
|
|
16
|
+
const t = o.scrollHeight - o.scrollTop - o.clientHeight, r = o.scrollHeight - o.clientHeight > S;
|
|
19
17
|
return {
|
|
20
18
|
canScroll: r,
|
|
21
|
-
scrolledToBottom: !r || t <=
|
|
19
|
+
scrolledToBottom: !r || t <= S
|
|
22
20
|
};
|
|
23
21
|
}
|
|
24
22
|
function A(o) {
|
|
25
|
-
const t = O(
|
|
23
|
+
const t = O(p);
|
|
26
24
|
if (!t)
|
|
27
25
|
throw new Error(`${o} must be used within ActionAreaLayout.`);
|
|
28
26
|
return t;
|
|
@@ -36,14 +34,14 @@ function w({
|
|
|
36
34
|
ref: r,
|
|
37
35
|
...c
|
|
38
36
|
}) {
|
|
39
|
-
const [a, i] =
|
|
37
|
+
const [a, i] = b(v), u = L(
|
|
40
38
|
() => ({
|
|
41
39
|
...a,
|
|
42
40
|
setScrollState: i
|
|
43
41
|
}),
|
|
44
42
|
[a]
|
|
45
43
|
);
|
|
46
|
-
return /* @__PURE__ */ l(
|
|
44
|
+
return /* @__PURE__ */ l(p.Provider, { value: u, children: /* @__PURE__ */ l(
|
|
47
45
|
"div",
|
|
48
46
|
{
|
|
49
47
|
...c,
|
|
@@ -64,31 +62,29 @@ function _({
|
|
|
64
62
|
}) {
|
|
65
63
|
const { setScrollState: i } = A(
|
|
66
64
|
"ActionAreaLayout.Body"
|
|
67
|
-
), [u, g] =
|
|
65
|
+
), [u, g] = b(null), n = h(
|
|
68
66
|
(e) => {
|
|
69
67
|
i(
|
|
70
68
|
(s) => H(s, E(e))
|
|
71
69
|
);
|
|
72
70
|
},
|
|
73
71
|
[i]
|
|
74
|
-
), B =
|
|
75
|
-
(
|
|
76
|
-
g(e), R(c, e), n(e);
|
|
77
|
-
},
|
|
72
|
+
), B = L(
|
|
73
|
+
() => R(g, c, n),
|
|
78
74
|
[c, n]
|
|
79
75
|
);
|
|
80
|
-
return
|
|
76
|
+
return N(() => {
|
|
81
77
|
const e = u;
|
|
82
78
|
if (n(e), !e || typeof ResizeObserver > "u")
|
|
83
79
|
return;
|
|
84
|
-
const s = new ResizeObserver(() => n(e)),
|
|
80
|
+
const s = new ResizeObserver(() => n(e)), m = () => {
|
|
85
81
|
s.disconnect(), s.observe(e);
|
|
86
82
|
for (const T of Array.from(e.children))
|
|
87
83
|
s.observe(T);
|
|
88
84
|
n(e);
|
|
89
|
-
},
|
|
90
|
-
return
|
|
91
|
-
s.disconnect(),
|
|
85
|
+
}, y = typeof MutationObserver > "u" ? void 0 : new MutationObserver(m);
|
|
86
|
+
return m(), y?.observe(e, { childList: !0 }), () => {
|
|
87
|
+
s.disconnect(), y?.disconnect();
|
|
92
88
|
};
|
|
93
89
|
}, [u, n]), /* @__PURE__ */ l(
|
|
94
90
|
"div",
|
|
@@ -132,7 +128,7 @@ function j({
|
|
|
132
128
|
);
|
|
133
129
|
return /* @__PURE__ */ l(x, { ...t, background: o === "auto" ? r && !c : o });
|
|
134
130
|
}
|
|
135
|
-
const
|
|
131
|
+
const U = Object.assign(w, {
|
|
136
132
|
Body: _,
|
|
137
133
|
Footer: F,
|
|
138
134
|
ActionArea: j
|
|
@@ -142,5 +138,5 @@ export {
|
|
|
142
138
|
j as ActionAreaLayoutActionArea,
|
|
143
139
|
_ as ActionAreaLayoutBody,
|
|
144
140
|
F as ActionAreaLayoutFooter,
|
|
145
|
-
|
|
141
|
+
U as default
|
|
146
142
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.oc-Cell-module__cell__BDmja{font-size:calc(var(--oc-typo-size-body1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body1);display:flex;flex-direction:column;margin-block:calc(-1 * var(--oc-cell-padding));padding:0;color:var(--oc-color-theme-label-normal);list-style:none;--oc-cell-padding: var(--oc-space-item-padding-small);--oc-cell-padding-inline: var(--oc-space-item-padding-medium);--oc-cell-gap: .5em;--oc-cell-icon-size: 1.375rem;--oc-cell-disabled-opacity: .28;--oc-cell-interaction-margin-inline: var(--oc-space-item-padding-xsmall);--oc-cell-interaction-radius: var(--oc-atomic-radius-small);--oc-cell-divider-color: var(--oc-color-theme-line-normal-normal)}.oc-Cell-module__item__r5fW2{position:relative;display:flex;align-items:flex-start;gap:var(--oc-cell-gap);padding-block:var(--oc-cell-padding);min-inline-size:0;color:inherit;transform:scale(var(--oc-cell-press-scale, 1));transition:transform calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Cell-module__item__r5fW2{transition:none;transform:none}}.oc-Cell-module__item__r5fW2{--oc-cell-content-min-block-size: var(--oc-typo-height-body1)}.oc-Cell-module__item__r5fW2[data-oc-vertical-align=center]{align-items:center}.oc-Cell-module__item__r5fW2[data-oc-fill-width=true]{padding-inline:var(--oc-cell-padding-inline)}.oc-Cell-module__item__r5fW2[data-oc-fill-width=true]>[data-oc-component=interaction]{--oc-interaction-inset-x: 0;--oc-interaction-radius: 0}.oc-Cell-module__item__r5fW2[data-oc-fill-width=false]>[data-oc-component=interaction]{--oc-interaction-inset-x: calc(-1 * var(--oc-cell-interaction-margin-inline));--oc-interaction-radius: var(--oc-cell-interaction-radius)}.oc-Cell-module__item__r5fW2[data-oc-divider=normal]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-normal)}.oc-Cell-module__item__r5fW2[data-oc-divider=neutral]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-neutral)}.oc-Cell-module__item__r5fW2[data-oc-divider=alternative]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-alternative)}.oc-Cell-module__item__r5fW2[data-oc-divider=none]{--oc-cell-current-divider-color: transparent}.oc-Cell-module__item__r5fW2+.oc-Cell-module__item__r5fW2{border-block-start:1px solid var(--oc-cell-current-divider-color, var(--oc-cell-divider-color));transition:border-color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * .5) var(--oc-motion-timing-feedback),transform calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Cell-module__item__r5fW2+.oc-Cell-module__item__r5fW2{transform:none;transition-property:border-color;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * .5);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:focus-visible
|
|
1
|
+
.oc-Cell-module__cell__BDmja{font-size:calc(var(--oc-typo-size-body1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body1);display:flex;flex-direction:column;margin-block:calc(-1 * var(--oc-cell-padding));padding:0;color:var(--oc-color-theme-label-normal);list-style:none;--oc-cell-padding: var(--oc-space-item-padding-small);--oc-cell-padding-inline: var(--oc-space-item-padding-medium);--oc-cell-gap: .5em;--oc-cell-icon-size: 1.375rem;--oc-cell-disabled-opacity: .28;--oc-cell-interaction-margin-inline: var(--oc-space-item-padding-xsmall);--oc-cell-interaction-radius: var(--oc-atomic-radius-small);--oc-cell-divider-color: var(--oc-color-theme-line-normal-normal)}.oc-Cell-module__item__r5fW2{position:relative;display:flex;align-items:flex-start;gap:var(--oc-cell-gap);padding-block:var(--oc-cell-padding);min-inline-size:0;color:inherit;transform:scale(var(--oc-cell-press-scale, 1));transition:transform calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Cell-module__item__r5fW2{transition:none;transform:none}}.oc-Cell-module__item__r5fW2{--oc-cell-content-min-block-size: var(--oc-typo-height-body1)}.oc-Cell-module__item__r5fW2[data-oc-vertical-align=center]{align-items:center}.oc-Cell-module__item__r5fW2[data-oc-fill-width=true]{padding-inline:var(--oc-cell-padding-inline)}.oc-Cell-module__item__r5fW2[data-oc-fill-width=true]>[data-oc-component=interaction]{--oc-interaction-inset-x: 0;--oc-interaction-radius: 0}.oc-Cell-module__item__r5fW2[data-oc-fill-width=false]>[data-oc-component=interaction]{--oc-interaction-inset-x: calc(-1 * var(--oc-cell-interaction-margin-inline));--oc-interaction-radius: var(--oc-cell-interaction-radius)}.oc-Cell-module__item__r5fW2[data-oc-divider=normal]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-normal)}.oc-Cell-module__item__r5fW2[data-oc-divider=neutral]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-neutral)}.oc-Cell-module__item__r5fW2[data-oc-divider=alternative]{--oc-cell-current-divider-color: var(--oc-color-theme-line-normal-alternative)}.oc-Cell-module__item__r5fW2[data-oc-divider=none]{--oc-cell-current-divider-color: transparent}.oc-Cell-module__item__r5fW2+.oc-Cell-module__item__r5fW2{border-block-start:1px solid var(--oc-cell-current-divider-color, var(--oc-cell-divider-color));transition:border-color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * .5) var(--oc-motion-timing-feedback),transform calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Cell-module__item__r5fW2+.oc-Cell-module__item__r5fW2{transform:none;transition-property:border-color;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * .5);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:focus-visible>[data-oc-component=interaction]{opacity:var(--oc-interaction-opacity-focus);transform:scale(1)}@media(hover:hover){.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:hover:not([data-oc-disabled=true])>[data-oc-component=interaction]{opacity:var(--oc-interaction-opacity-hover);transform:scale(1)}}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:active:not([data-oc-disabled=true]){--oc-cell-press-scale: max(0, 1 + (.9875 - 1) * var(--oc-motion-scale-factor-feedback))}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:active:not([data-oc-disabled=true])>[data-oc-component=interaction]{opacity:var(--oc-interaction-opacity-active);transform:scale(1)}.oc-Cell-module__item__r5fW2[data-oc-disabled=true]{cursor:not-allowed}.oc-Cell-module__item__r5fW2[data-oc-disabled=true]>:where([data-oc-part=leading],[data-oc-part=content],[data-oc-part=trailing]){opacity:var(--oc-cell-disabled-opacity)}.oc-Cell-module__item__r5fW2[data-oc-disabled=true]>[data-oc-component=interaction]{pointer-events:none}.oc-Cell-module__item__r5fW2>[data-oc-component=interaction]{border-radius:var(--oc-interaction-radius)}.oc-Cell-module__item__r5fW2>[data-oc-part=leading],.oc-Cell-module__item__r5fW2>[data-oc-part=trailing]{position:relative;z-index:2;display:inline-flex;flex:none;align-items:center;min-block-size:var(--oc-cell-content-min-block-size);color:var(--oc-color-theme-label-alternative)}.oc-Cell-module__item__r5fW2>[data-oc-part=leading]>[data-oc-component=svg-icon],.oc-Cell-module__item__r5fW2>[data-oc-part=trailing]>[data-oc-component=svg-icon]{block-size:var(--oc-cell-icon-size)}.oc-Cell-module__item__r5fW2>[data-oc-part=content]{position:relative;z-index:2;display:flex;align-items:center;flex:1;min-block-size:var(--oc-cell-content-min-block-size);min-inline-size:0}.oc-Cell-module__item__r5fW2 [data-oc-part=text]{display:flex;flex-direction:column;gap:var(--oc-space-item-gap-atom);min-inline-size:0}.oc-Cell-module__item__r5fW2 [data-oc-part=label],.oc-Cell-module__item__r5fW2 [data-oc-part=description]{min-inline-size:0}.oc-Cell-module__item__r5fW2 [data-oc-part=description]{font-size:calc(var(--oc-typo-size-label1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-label1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-label1);color:var(--oc-color-theme-label-alternative)}.oc-Cell-module__item__r5fW2>[data-oc-part=trailing]{justify-content:flex-end}@media(hover:hover){.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:hover:not([data-oc-disabled=true]){--oc-cell-current-divider-color: transparent}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:hover:not([data-oc-disabled=true])+.oc-Cell-module__item__r5fW2{--oc-cell-current-divider-color: transparent}}@media(hover:none){.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:active:not([data-oc-disabled=true]){--oc-cell-current-divider-color: transparent}.oc-Cell-module__item__r5fW2[data-oc-interactive=true]:active:not([data-oc-disabled=true])+.oc-Cell-module__item__r5fW2{--oc-cell-current-divider-color: transparent}}.oc-Cell-module__item__r5fW2[data-oc-interactive=true] :where([data-oc-component=checkbox],[data-oc-component=radio],[data-oc-component=switch]) [data-oc-component=interaction]{display:none}.oc-Cell-module__normal__O7uwW{--oc-cell-divider-color: var(--oc-color-theme-line-normal-normal)}.oc-Cell-module__neutral__Fhigo{--oc-cell-divider-color: var(--oc-color-theme-line-normal-neutral)}.oc-Cell-module__alternative__7dShz{--oc-cell-divider-color: var(--oc-color-theme-line-normal-alternative)}.oc-Cell-module__none__s4kvs{--oc-cell-divider-color: transparent}
|