@orioncactuscorp/ui 1.6.0 → 1.7.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 +22 -3
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +206 -214
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/ActionArea/ActionAreaLayout.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +13 -13
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/IconButton/IconButton.css +1 -1
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Loading/Loading.css +1 -1
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Menu/Menu.js +156 -140
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +571 -391
- package/dist/components/Modal/Modal.module.scss.js +58 -38
- package/dist/components/Modal/snapPoints.js +59 -35
- package/dist/components/Modal/useModalDrag.js +754 -579
- package/dist/components/Modal.js +7 -6
- package/dist/components/Skeleton/Skeleton.css +1 -0
- package/dist/components/Skeleton/Skeleton.js +55 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js +16 -0
- package/dist/components/Skeleton.d.ts +6 -0
- package/dist/components/Skeleton.js +4 -0
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.js +45 -48
- package/dist/components/internal/DisclosureIndicator.js +39 -0
- package/dist/components/internal/Pressable.js +28 -27
- package/dist/foundations/motion.css +1 -1
- package/dist/foundations/space.css +1 -1
- package/dist/foundations.css +2 -2
- package/dist/index.js +90 -87
- package/dist/react/motion.js +79 -74
- package/dist/styles.css +14 -13
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/Menu/Menu.d.ts +1 -1
- package/dist/ui/src/components/Menu/Menu.d.ts.map +1 -1
- package/dist/ui/src/components/Menu/index.d.ts +1 -1
- package/dist/ui/src/components/Menu/index.d.ts.map +1 -1
- package/dist/ui/src/components/Menu/types.d.ts +6 -2
- package/dist/ui/src/components/Menu/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +3 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/contexts.d.ts +2 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/index.d.ts +2 -2
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +7 -10
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +17 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +2 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Skeleton/Skeleton.d.ts +4 -0
- package/dist/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/ui/src/components/Skeleton/index.d.ts +3 -0
- package/dist/ui/src/components/Skeleton/index.d.ts.map +1 -0
- package/dist/ui/src/components/Skeleton/types.d.ts +17 -0
- package/dist/ui/src/components/Skeleton/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextButton/TextButton.d.ts.map +1 -1
- package/dist/ui/src/components/TextButton/types.d.ts +4 -2
- package/dist/ui/src/components/TextButton/types.d.ts.map +1 -1
- package/dist/ui/src/components/internal/DisclosureIndicator.d.ts +10 -0
- package/dist/ui/src/components/internal/DisclosureIndicator.d.ts.map +1 -0
- package/dist/ui/src/components/internal/Pressable.d.ts +8 -1
- package/dist/ui/src/components/internal/Pressable.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +5 -3
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts +3 -1
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/motion.d.ts +2 -2
- package/dist/ui/src/utils/motion.d.ts.map +1 -1
- package/dist/utils/motion.js +24 -18
- package/dist/vscode/oc-ui-vars.css +6 -4
- package/package.json +1 -1
- package/src/scss/foundations/motion.scss +3 -1
- package/src/scss/foundations/responsive.test.ts +22 -0
- package/src/scss/foundations/space.scss +9 -4
- package/src/scss/mixins/_motion.scss +5 -8
- package/src/scss/mixins/_motion.test.ts +20 -0
|
@@ -1,48 +1,68 @@
|
|
|
1
|
-
import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y",
|
|
1
|
+
import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA", n = "oc-Modal-module__viewport__8dW9u", e = "oc-Modal-module__surfaceMotion__fJnTQ", _ = "oc-Modal-module__bottomFill__wKrvv", l = "oc-Modal-module__surface__FnAX8", d = "oc-Modal-module__header__NS30G", i = "oc-Modal-module__footer__Oyz-R", t = "oc-Modal-module__small__qdBEU", c = "oc-Modal-module__medium__JRDXg", r = "oc-Modal-module__large__O42Af", g = "oc-Modal-module__fixed__Gj1Dv", m = "oc-Modal-module__navigationSection__oHkbv", s = "oc-Modal-module__handle__Fan4V", u = "oc-Modal-module__headerInner__F5nxn", v = "oc-Modal-module__headerLeading__v735-", M = "oc-Modal-module__headerTrailing__hQamr", h = "oc-Modal-module__headerTitle__tJ2Qv", f = "oc-Modal-module__close__058gy", b = "oc-Modal-module__navigationDialogTitle__vkGhC", T = "oc-Modal-module__navigationHeading__XioS6", y = "oc-Modal-module__navigation__ldQt-", P = "oc-Modal-module__navigationTitle__ncfjD", I = "oc-Modal-module__navigationIndicator__swRE1", F = "oc-Modal-module__navigationPanel__conuU", k = "oc-Modal-module__navigationPanelScroll__UO-ue", p = "oc-Modal-module__navigationPanelFrame__RljMi", S = "oc-Modal-module__navigationPanelInner__k0D4f", j = "oc-Modal-module__body__3zIj9", C = "oc-Modal-module__bodyContainer__t57Y6", D = "oc-Modal-module__bodyContent__fRK23", R = {
|
|
2
2
|
trigger: o,
|
|
3
|
-
backdrop:
|
|
4
|
-
viewport:
|
|
5
|
-
surfaceMotion:
|
|
6
|
-
bottomFill:
|
|
7
|
-
surface:
|
|
3
|
+
backdrop: a,
|
|
4
|
+
viewport: n,
|
|
5
|
+
surfaceMotion: e,
|
|
6
|
+
bottomFill: _,
|
|
7
|
+
surface: l,
|
|
8
8
|
"oc-modal-reject-shake": "oc-Modal-module__oc-modal-reject-shake__RJrNe",
|
|
9
|
-
header:
|
|
10
|
-
footer:
|
|
11
|
-
small:
|
|
12
|
-
medium:
|
|
13
|
-
large:
|
|
14
|
-
fixed:
|
|
15
|
-
|
|
9
|
+
header: d,
|
|
10
|
+
footer: i,
|
|
11
|
+
small: t,
|
|
12
|
+
medium: c,
|
|
13
|
+
large: r,
|
|
14
|
+
fixed: g,
|
|
15
|
+
navigationSection: m,
|
|
16
|
+
handle: s,
|
|
16
17
|
headerInner: u,
|
|
17
|
-
headerLeading:
|
|
18
|
-
headerTrailing:
|
|
19
|
-
headerTitle:
|
|
18
|
+
headerLeading: v,
|
|
19
|
+
headerTrailing: M,
|
|
20
|
+
headerTitle: h,
|
|
20
21
|
close: f,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
navigationDialogTitle: b,
|
|
23
|
+
navigationHeading: T,
|
|
24
|
+
navigation: y,
|
|
25
|
+
navigationTitle: P,
|
|
26
|
+
navigationIndicator: I,
|
|
27
|
+
navigationPanel: F,
|
|
28
|
+
navigationPanelScroll: k,
|
|
29
|
+
navigationPanelFrame: p,
|
|
30
|
+
navigationPanelInner: S,
|
|
31
|
+
body: j,
|
|
32
|
+
bodyContainer: C,
|
|
33
|
+
bodyContent: D
|
|
24
34
|
};
|
|
25
35
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
a as backdrop,
|
|
37
|
+
j as body,
|
|
38
|
+
C as bodyContainer,
|
|
39
|
+
D as bodyContent,
|
|
40
|
+
_ as bottomFill,
|
|
31
41
|
f as close,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
R as default,
|
|
43
|
+
g as fixed,
|
|
44
|
+
i as footer,
|
|
45
|
+
s as handle,
|
|
46
|
+
d as header,
|
|
37
47
|
u as headerInner,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
v as headerLeading,
|
|
49
|
+
h as headerTitle,
|
|
50
|
+
M as headerTrailing,
|
|
51
|
+
r as large,
|
|
52
|
+
c as medium,
|
|
53
|
+
y as navigation,
|
|
54
|
+
b as navigationDialogTitle,
|
|
55
|
+
T as navigationHeading,
|
|
56
|
+
I as navigationIndicator,
|
|
57
|
+
F as navigationPanel,
|
|
58
|
+
p as navigationPanelFrame,
|
|
59
|
+
S as navigationPanelInner,
|
|
60
|
+
k as navigationPanelScroll,
|
|
61
|
+
m as navigationSection,
|
|
62
|
+
P as navigationTitle,
|
|
63
|
+
t as small,
|
|
64
|
+
l as surface,
|
|
65
|
+
e as surfaceMotion,
|
|
46
66
|
o as trigger,
|
|
47
|
-
|
|
67
|
+
n as viewport
|
|
48
68
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
function
|
|
1
|
+
function y(e, t) {
|
|
2
2
|
return typeof e == "string" ? Number.parseFloat(e) : e > 1 ? e : e * t;
|
|
3
3
|
}
|
|
4
4
|
function v(e) {
|
|
5
5
|
return Number.isFinite(e) && e > 0;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function X({
|
|
8
8
|
snapPoints: e,
|
|
9
9
|
defaultSnapPoint: t,
|
|
10
|
-
viewportHeight:
|
|
10
|
+
viewportHeight: i
|
|
11
11
|
}) {
|
|
12
12
|
if (!e?.length) return;
|
|
13
|
-
const
|
|
14
|
-
(c) =>
|
|
15
|
-
),
|
|
16
|
-
if (!
|
|
17
|
-
const n = Math.max(...
|
|
13
|
+
const a = e.map(
|
|
14
|
+
(c) => y(c, i)
|
|
15
|
+
), r = a.filter(v).sort((c, g) => c - g);
|
|
16
|
+
if (!r.length) return;
|
|
17
|
+
const n = Math.max(...r), o = t !== void 0 ? e.findIndex((c) => c === t) : -1, u = o >= 0 && a[o] ? a[o] : n;
|
|
18
18
|
return {
|
|
19
|
-
snapHeights:
|
|
19
|
+
snapHeights: r,
|
|
20
20
|
sheetHeight: n,
|
|
21
|
-
visibleTranslate: Math.max(0, n -
|
|
21
|
+
visibleTranslate: Math.max(0, n - u)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
return Number.isFinite(
|
|
24
|
+
function l(e, t) {
|
|
25
|
+
const i = Number.parseFloat(e.getPropertyValue(t));
|
|
26
|
+
return Number.isFinite(i) ? i : 0;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function w(e, t) {
|
|
29
29
|
switch (e) {
|
|
30
30
|
case "left":
|
|
31
31
|
return { x: t.minX, y: 0 };
|
|
@@ -47,33 +47,57 @@ function y(e, t) {
|
|
|
47
47
|
return { x: 0, y: 0 };
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function S({
|
|
51
|
+
position: e,
|
|
52
|
+
viewportRect: t,
|
|
53
|
+
paddingTop: i,
|
|
54
|
+
paddingBottom: a
|
|
55
|
+
}) {
|
|
56
|
+
if (e === "top" || e.startsWith("top-"))
|
|
57
|
+
return {
|
|
58
|
+
y: `calc(${i - t.height / 2}px + 50%)`
|
|
59
|
+
};
|
|
60
|
+
if (e === "bottom" || e.startsWith("bottom-"))
|
|
61
|
+
return {
|
|
62
|
+
y: `calc(${t.height / 2 - a}px - 50%)`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function Y({
|
|
51
66
|
defaultSnapPosition: e,
|
|
52
67
|
snapPositions: t,
|
|
53
|
-
surfaceMotion:
|
|
68
|
+
surfaceMotion: i
|
|
54
69
|
}) {
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
70
|
+
const a = i.parentElement;
|
|
71
|
+
if (!a || !t.length) return;
|
|
72
|
+
const r = a.getBoundingClientRect(), n = i.getBoundingClientRect();
|
|
73
|
+
if (r.width <= 0 || r.height <= 0 || n.width <= 0 || n.height <= 0)
|
|
59
74
|
return;
|
|
60
|
-
const
|
|
61
|
-
minX:
|
|
62
|
-
maxX:
|
|
63
|
-
minY:
|
|
64
|
-
maxY:
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
const o = window.getComputedStyle(a), u = l(o, "padding-left"), c = l(o, "padding-right"), g = l(o, "padding-top"), d = l(o, "padding-bottom"), m = {
|
|
76
|
+
minX: u + n.width / 2 - r.width / 2,
|
|
77
|
+
maxX: r.width - c - n.width / 2 - r.width / 2,
|
|
78
|
+
minY: g + n.height / 2 - r.height / 2,
|
|
79
|
+
maxY: r.height - d - n.height / 2 - r.height / 2
|
|
80
|
+
}, s = t.map((h) => {
|
|
81
|
+
const p = S({
|
|
82
|
+
position: h,
|
|
83
|
+
viewportRect: r,
|
|
84
|
+
paddingTop: g,
|
|
85
|
+
paddingBottom: d
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
key: h,
|
|
89
|
+
...w(h, m),
|
|
90
|
+
...p ? { settledTranslate: p } : {}
|
|
91
|
+
};
|
|
92
|
+
}), x = e ?? t[0], f = s.find((h) => h.key === x) ?? s[0];
|
|
93
|
+
if (f)
|
|
70
94
|
return {
|
|
71
|
-
bounds:
|
|
72
|
-
defaultTarget:
|
|
73
|
-
targets:
|
|
95
|
+
bounds: m,
|
|
96
|
+
defaultTarget: f,
|
|
97
|
+
targets: s
|
|
74
98
|
};
|
|
75
99
|
}
|
|
76
100
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
Y as resolveModalPopupSnapPositions,
|
|
102
|
+
X as resolveModalSnapMetrics
|
|
79
103
|
};
|