@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
package/dist/react/motion.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as H } from "react/jsx-runtime";
|
|
3
|
-
import { useRef as i, useState as C, useCallback as q, useEffect as y, useLayoutEffect as
|
|
3
|
+
import { useRef as i, useState as C, useCallback as q, useEffect as y, useLayoutEffect as it } from "react";
|
|
4
|
+
import { mergeRefs as st } from "../utils/mergeRefs.js";
|
|
4
5
|
import { createSpringAnimator as at } from "../utils/spring/animator.js";
|
|
5
6
|
import { resolveOcMotion as ut } from "../utils/motion.js";
|
|
6
7
|
const V = "block-size";
|
|
7
|
-
function lt(t, n) {
|
|
8
|
-
typeof t == "function" ? t(n) : t && (t.current = n);
|
|
9
|
-
}
|
|
10
8
|
function A(t) {
|
|
11
9
|
const n = i(t);
|
|
12
10
|
return y(() => {
|
|
@@ -21,7 +19,7 @@ function dt() {
|
|
|
21
19
|
return c(), r.addEventListener("change", c), () => r.removeEventListener("change", c);
|
|
22
20
|
}, []), t;
|
|
23
21
|
}
|
|
24
|
-
function
|
|
22
|
+
function lt(t) {
|
|
25
23
|
if (!t) return 0;
|
|
26
24
|
const n = t.getBoundingClientRect().height;
|
|
27
25
|
return Math.max(0, n || t.scrollHeight);
|
|
@@ -29,16 +27,16 @@ function ft(t) {
|
|
|
29
27
|
function U(t) {
|
|
30
28
|
return t ? Math.max(0, t.getBoundingClientRect().height) : 0;
|
|
31
29
|
}
|
|
32
|
-
function
|
|
33
|
-
return n === "rendered" ? U(t) :
|
|
30
|
+
function ft(t, n) {
|
|
31
|
+
return n === "rendered" ? U(t) : lt(t);
|
|
34
32
|
}
|
|
35
33
|
function j(t) {
|
|
36
34
|
return `${Math.max(0, t).toFixed(3)}px`;
|
|
37
35
|
}
|
|
38
|
-
function
|
|
39
|
-
const r = A(n), [c,
|
|
36
|
+
function mt(t, n) {
|
|
37
|
+
const r = A(n), [c, l] = C(t), u = i(t), f = q(
|
|
40
38
|
(s) => {
|
|
41
|
-
u.current !== s && (u.current = s,
|
|
39
|
+
u.current !== s && (u.current = s, l(s), r.current?.(s));
|
|
42
40
|
},
|
|
43
41
|
[r]
|
|
44
42
|
);
|
|
@@ -49,12 +47,12 @@ function Mt({
|
|
|
49
47
|
className: n = "",
|
|
50
48
|
contentProps: r,
|
|
51
49
|
disableAnimation: c = !1,
|
|
52
|
-
durationFactor:
|
|
50
|
+
durationFactor: l = 1,
|
|
53
51
|
extraBounce: u,
|
|
54
52
|
enterPhase: f = "enter",
|
|
55
53
|
exitPhase: s = "exit",
|
|
56
|
-
forceMount:
|
|
57
|
-
intent:
|
|
54
|
+
forceMount: d = !1,
|
|
55
|
+
intent: g = "expand",
|
|
58
56
|
measureBlockSize: z = "content",
|
|
59
57
|
onExitComplete: W,
|
|
60
58
|
onMotionStateChange: Y,
|
|
@@ -67,7 +65,7 @@ function Mt({
|
|
|
67
65
|
"data-oc-component": D = "motion-expand",
|
|
68
66
|
...F
|
|
69
67
|
}) {
|
|
70
|
-
const E = i(null), B = i(null), a = i(null), G = i(o ||
|
|
68
|
+
const E = i(null), B = i(null), a = i(null), G = i(o || d), I = i(!1), R = dt(), [m, J] = C(() => o || d), S = i(m), O = A(W), { motionState: K, setMotionState: h } = mt(
|
|
71
69
|
o ? "open" : "closed",
|
|
72
70
|
Y
|
|
73
71
|
), {
|
|
@@ -75,14 +73,12 @@ function Mt({
|
|
|
75
73
|
style: X,
|
|
76
74
|
"data-oc-part": Z = "content",
|
|
77
75
|
...tt
|
|
78
|
-
} = r ?? {}, w = o || m ||
|
|
76
|
+
} = r ?? {}, w = o || m || d, et = {
|
|
79
77
|
...$,
|
|
80
78
|
overflow: "hidden"
|
|
81
79
|
}, p = q((e) => {
|
|
82
80
|
S.current = e, J(e);
|
|
83
|
-
}, [])
|
|
84
|
-
E.current = e, lt(_, e);
|
|
85
|
-
};
|
|
81
|
+
}, []);
|
|
86
82
|
return y(() => {
|
|
87
83
|
S.current = m;
|
|
88
84
|
}, [m]), y(
|
|
@@ -90,28 +86,28 @@ function Mt({
|
|
|
90
86
|
a.current?.destroy(), a.current = null;
|
|
91
87
|
},
|
|
92
88
|
[]
|
|
93
|
-
),
|
|
89
|
+
), it(() => {
|
|
94
90
|
if (!w) return;
|
|
95
91
|
const e = E.current, P = B.current;
|
|
96
92
|
if (!e || !P) return;
|
|
97
|
-
const
|
|
93
|
+
const nt = S.current, N = o ? ft(P, z) : 0, T = ut({
|
|
98
94
|
element: e,
|
|
99
|
-
intent:
|
|
95
|
+
intent: g,
|
|
100
96
|
phase: o ? f : s,
|
|
101
97
|
pace: b,
|
|
102
|
-
durationFactor:
|
|
98
|
+
durationFactor: l,
|
|
103
99
|
extraBounce: u,
|
|
104
100
|
reduced: x,
|
|
105
|
-
reducedMotion:
|
|
101
|
+
reducedMotion: R,
|
|
106
102
|
property: V
|
|
107
|
-
}),
|
|
103
|
+
}), ot = !I.current && G.current, rt = !c && !ot && T.animate, M = () => {
|
|
108
104
|
if (e.style.willChange = "", o) {
|
|
109
105
|
e.style.blockSize = "auto", h("open"), p(!0);
|
|
110
106
|
return;
|
|
111
107
|
}
|
|
112
|
-
e.style.blockSize = "0px", h("closed"),
|
|
108
|
+
e.style.blockSize = "0px", h("closed"), d || p(!1), O.current?.();
|
|
113
109
|
};
|
|
114
|
-
if (a.current?.destroy(), a.current = null, o && !
|
|
110
|
+
if (a.current?.destroy(), a.current = null, o && !nt && (e.style.blockSize = "0px", p(!0)), I.current = !0, !rt) {
|
|
115
111
|
M();
|
|
116
112
|
return;
|
|
117
113
|
}
|
|
@@ -127,8 +123,8 @@ function Mt({
|
|
|
127
123
|
spring: T.spring,
|
|
128
124
|
scheduler: L,
|
|
129
125
|
stabilityWindow: 0.02,
|
|
130
|
-
onUpdate: (
|
|
131
|
-
e.style.blockSize = j(
|
|
126
|
+
onUpdate: (ct) => {
|
|
127
|
+
e.style.blockSize = j(ct);
|
|
132
128
|
},
|
|
133
129
|
onComplete: M
|
|
134
130
|
});
|
|
@@ -137,18 +133,18 @@ function Mt({
|
|
|
137
133
|
};
|
|
138
134
|
}, [
|
|
139
135
|
c,
|
|
140
|
-
|
|
136
|
+
l,
|
|
141
137
|
u,
|
|
142
138
|
f,
|
|
143
139
|
s,
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
d,
|
|
141
|
+
g,
|
|
146
142
|
z,
|
|
147
143
|
O,
|
|
148
144
|
o,
|
|
149
145
|
b,
|
|
150
146
|
x,
|
|
151
|
-
|
|
147
|
+
R,
|
|
152
148
|
L,
|
|
153
149
|
p,
|
|
154
150
|
h,
|
|
@@ -157,13 +153,13 @@ function Mt({
|
|
|
157
153
|
"div",
|
|
158
154
|
{
|
|
159
155
|
...F,
|
|
160
|
-
ref:
|
|
156
|
+
ref: st(E, _),
|
|
161
157
|
className: n,
|
|
162
158
|
style: et,
|
|
163
159
|
"data-oc-component": D,
|
|
164
|
-
"data-oc-motion-intent":
|
|
160
|
+
"data-oc-motion-intent": g,
|
|
165
161
|
"data-oc-motion-state": K,
|
|
166
|
-
"data-oc-reduced-motion":
|
|
162
|
+
"data-oc-reduced-motion": R ? "true" : void 0,
|
|
167
163
|
"data-oc-state": o ? "open" : "closed",
|
|
168
164
|
children: /* @__PURE__ */ H(
|
|
169
165
|
"div",
|
package/dist/reset.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer oc-reset{*,*::before,*::after{box-sizing:border-box}html{-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}body{min-height:100dvh}body,h1,h2,h3,h4,h5,h6,p,ul,figure,blockquote,dl,dd,input{margin:0}h1,h2,h3,h4,h5,h6,input,button,textarea,select,label{font:inherit}h1,h2,h3,h4,h5,h6{text-wrap:balance}ul,ol{list-style:none;padding:0}a:not([class]){text-decoration-skip-ink:auto;color:currentColor}a:visited{color:currentColor}img,picture{max-width:100%;display:block;object-fit:cover}textarea:not([rows]){min-height:10em}:target{scroll-margin-block:5ex}svg{fill:currentColor;stroke:rgba(0,0,0,0)}textarea,button{padding:0;appearance:none}button:focus-visible{outline:
|
|
1
|
+
@layer oc-reset{*,*::before,*::after{box-sizing:border-box}html{-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}body{min-height:100dvh}body,h1,h2,h3,h4,h5,h6,p,ul,figure,blockquote,dl,dd,input{margin:0}h1,h2,h3,h4,h5,h6,input,button,textarea,select,label{font:inherit}h1,h2,h3,h4,h5,h6{text-wrap:balance}ul,ol{list-style:none;padding:0}a:not([class]){text-decoration-skip-ink:auto;color:currentColor}a:visited{color:currentColor}img,picture{max-width:100%;display:block;object-fit:cover}textarea:not([rows]){min-height:10em}:target{scroll-margin-block:5ex}svg{fill:currentColor;stroke:rgba(0,0,0,0)}textarea,button{padding:0;appearance:none}:where(button,a[href],summary,[tabindex]):where(:focus-visible){outline:var(--oc-focus-ring-width) solid var(--oc-color-theme-focus-ring);outline-offset:var(--oc-focus-ring-offset)}textarea,input[type=text]{color:currentColor;background-color:rgba(0,0,0,0)}input:not(input:-webkit-autofill)::-webkit-contacts-auto-fill-button{background-color:currentColor}iframe,textarea,button{border:none}
|
|
2
2
|
}
|