@orioncactuscorp/ui 1.15.1 → 1.16.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/CHANGELOG.md +73 -0
- package/README.md +15 -15
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.js +9 -9
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +20 -20
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.js +5 -5
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/CheckMark/CheckMark.js +6 -6
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +15 -15
- package/dist/components/Field/Field.css +1 -1
- package/dist/components/IconButton/IconButton.css +1 -1
- package/dist/components/IconButton/IconButton.js +9 -9
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Interaction/Interaction.js +19 -12
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/bottomSheetRelease.js +114 -0
- package/dist/components/Modal/modalScrollArbitration.js +49 -47
- package/dist/components/Modal/useModalDrag.js +928 -983
- package/dist/components/PositionSnap/PositionSnap.css +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.css +1 -1
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +262 -264
- package/dist/components/Skeleton/Skeleton.css +1 -1
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Switch/Switch.js +7 -7
- package/dist/components/Tabs/Tabs.css +1 -1
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.js +17 -17
- package/dist/foundations/touch.css +1 -0
- package/dist/foundations.css +1 -0
- package/dist/styles.css +21 -20
- package/dist/ui/src/components/Interaction/Interaction.d.ts.map +1 -1
- package/dist/ui/src/components/Interaction/types.d.ts +2 -0
- package/dist/ui/src/components/Interaction/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetRelease.d.ts +19 -0
- package/dist/ui/src/components/Modal/bottomSheetRelease.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/index.d.ts +1 -1
- package/dist/ui/src/components/ScrollArea/index.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/types.d.ts +2 -0
- package/dist/ui/src/components/ScrollArea/types.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +1 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/vscode/oc-ui-vars.css +1 -0
- package/docs/responsive-foundation-profile.md +1 -0
- package/docs/scss-helpers.md +1 -3
- package/docs/selector-contract.md +27 -3
- package/docs/tokens.md +6 -0
- package/package.json +1 -1
- package/src/scss/foundations/touch.scss +3 -0
- package/src/scss/foundations/touch.test.ts +37 -0
- package/src/scss/foundations/typo.scss +1 -1
- package/src/scss/index.scss +1 -0
- package/src/scss/mixins/_fluid.test.ts +0 -16
- package/src/scss/mixins/_utils.scss +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const L = "ocModalTouchScrollLock", r = {
|
|
1
|
+
const L = "ocModalTouchScrollLock", T = /* @__PURE__ */ new Set(["auto", "overlay", "scroll"]), r = {
|
|
2
2
|
allowDrag: !1,
|
|
3
3
|
preventDefault: !1,
|
|
4
4
|
resetAnchor: !1
|
|
@@ -6,20 +6,22 @@ const L = "ocModalTouchScrollLock", r = {
|
|
|
6
6
|
allowDrag: !1,
|
|
7
7
|
preventDefault: !1,
|
|
8
8
|
resetAnchor: !0
|
|
9
|
-
},
|
|
9
|
+
}, R = {
|
|
10
10
|
allowDrag: !0,
|
|
11
11
|
preventDefault: !1,
|
|
12
12
|
resetAnchor: !1
|
|
13
|
-
},
|
|
13
|
+
}, i = {
|
|
14
14
|
allowDrag: !0,
|
|
15
15
|
preventDefault: !0,
|
|
16
16
|
resetAnchor: !1
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
return e ?
|
|
18
|
+
function O(e) {
|
|
19
|
+
return e ? i : R;
|
|
20
20
|
}
|
|
21
21
|
function c(e) {
|
|
22
|
-
|
|
22
|
+
if (!e) return !1;
|
|
23
|
+
const o = e.ownerDocument.defaultView?.getComputedStyle(e).overflowY;
|
|
24
|
+
return !!(o && T.has(o) && e.scrollHeight > e.clientHeight + 1);
|
|
23
25
|
}
|
|
24
26
|
function s(e) {
|
|
25
27
|
return !c(e) || e.scrollTop <= 1;
|
|
@@ -27,41 +29,41 @@ function s(e) {
|
|
|
27
29
|
function p(e) {
|
|
28
30
|
return !c(e) || e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
|
|
29
31
|
}
|
|
30
|
-
function
|
|
32
|
+
function _(e) {
|
|
31
33
|
const t = e.closest(
|
|
32
34
|
'[data-oc-modal-sheet-resizing="true"]'
|
|
33
35
|
);
|
|
34
36
|
if (!t) return null;
|
|
35
|
-
const
|
|
37
|
+
const o = Number.parseFloat(
|
|
36
38
|
t.style.getPropertyValue(
|
|
37
39
|
"--oc-modal-resize-target-scrollport-height"
|
|
38
40
|
)
|
|
39
41
|
);
|
|
40
|
-
return Number.isFinite(
|
|
42
|
+
return Number.isFinite(o) ? o : null;
|
|
41
43
|
}
|
|
42
|
-
function
|
|
44
|
+
function d(e) {
|
|
43
45
|
if (!e)
|
|
44
46
|
return { canScroll: !1, scrolledFromTop: !1, scrolledToBottom: !0 };
|
|
45
|
-
const t =
|
|
47
|
+
const t = _(e);
|
|
46
48
|
if (t === null)
|
|
47
49
|
return {
|
|
48
50
|
canScroll: c(e),
|
|
49
51
|
scrolledFromTop: !s(e),
|
|
50
52
|
scrolledToBottom: p(e)
|
|
51
53
|
};
|
|
52
|
-
const
|
|
54
|
+
const o = e.firstElementChild?.getBoundingClientRect().height ?? e.scrollHeight, n = o > t + 1;
|
|
53
55
|
return {
|
|
54
|
-
canScroll:
|
|
55
|
-
scrolledFromTop:
|
|
56
|
-
scrolledToBottom: !
|
|
56
|
+
canScroll: n,
|
|
57
|
+
scrolledFromTop: n && e.scrollTop > 1,
|
|
58
|
+
scrolledToBottom: !n || o - t - e.scrollTop <= 1
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
function m(e, t) {
|
|
60
|
-
let
|
|
61
|
-
for (;
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
64
|
-
|
|
62
|
+
let o = e;
|
|
63
|
+
for (; o && o !== t; ) {
|
|
64
|
+
if (o instanceof HTMLElement && c(o))
|
|
65
|
+
return o;
|
|
66
|
+
o = o.parentElement;
|
|
65
67
|
}
|
|
66
68
|
return t;
|
|
67
69
|
}
|
|
@@ -95,58 +97,58 @@ function f(e) {
|
|
|
95
97
|
].join(",")
|
|
96
98
|
);
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function h(e, t) {
|
|
99
101
|
return t ? t.ownerDocument : typeof Node < "u" && e instanceof Node ? e.ownerDocument : typeof document > "u" ? null : document;
|
|
100
102
|
}
|
|
101
103
|
function a({
|
|
102
104
|
boundary: e,
|
|
103
105
|
target: t
|
|
104
106
|
}) {
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
107
|
+
const o = h(t, e ?? null), n = o?.getSelection?.() ?? o?.defaultView?.getSelection?.();
|
|
108
|
+
if (!n || n.rangeCount === 0 || n.isCollapsed)
|
|
107
109
|
return !1;
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
110
|
-
for (let l = 0; l <
|
|
111
|
-
const D =
|
|
112
|
-
if (
|
|
110
|
+
const u = e ?? (typeof Node < "u" && t instanceof Node ? t : null);
|
|
111
|
+
if (!u) return !0;
|
|
112
|
+
for (let l = 0; l < n.rangeCount; l += 1) {
|
|
113
|
+
const D = n.getRangeAt(l).commonAncestorContainer;
|
|
114
|
+
if (u.contains(D) || D.contains(u))
|
|
113
115
|
return !0;
|
|
114
116
|
}
|
|
115
117
|
return !1;
|
|
116
118
|
}
|
|
117
|
-
function
|
|
119
|
+
function A({
|
|
118
120
|
target: e,
|
|
119
121
|
chrome: t,
|
|
120
|
-
bodyNode:
|
|
122
|
+
bodyNode: o
|
|
121
123
|
}) {
|
|
122
|
-
if (t || typeof Element > "u" || !(e instanceof Element) || f(e) || a({ target: e, boundary:
|
|
123
|
-
const
|
|
124
|
-
return c(
|
|
124
|
+
if (t || typeof Element > "u" || !(e instanceof Element) || f(e) || a({ target: e, boundary: o })) return !1;
|
|
125
|
+
const n = m(e, o);
|
|
126
|
+
return c(n) && s(n);
|
|
125
127
|
}
|
|
126
|
-
function
|
|
128
|
+
function H({
|
|
127
129
|
target: e,
|
|
128
130
|
deltaY: t,
|
|
129
|
-
chrome:
|
|
130
|
-
bodyNode:
|
|
131
|
-
canExpand:
|
|
131
|
+
chrome: o,
|
|
132
|
+
bodyNode: n,
|
|
133
|
+
canExpand: u
|
|
132
134
|
}) {
|
|
133
135
|
if (typeof Element > "u" || !(e instanceof Element) || f(e)) return r;
|
|
134
|
-
if (
|
|
135
|
-
if (a({ target: e, boundary:
|
|
136
|
+
if (o) return O(t !== 0);
|
|
137
|
+
if (a({ target: e, boundary: n }))
|
|
136
138
|
return r;
|
|
137
|
-
const l = m(e,
|
|
138
|
-
return c(l) ? t > 0 ? s(l) ?
|
|
139
|
+
const l = m(e, n);
|
|
140
|
+
return c(l) ? t > 0 ? s(l) ? i : S : t < 0 ? u ? i : S : r : O(t !== 0);
|
|
139
141
|
}
|
|
140
|
-
function
|
|
142
|
+
function E({
|
|
141
143
|
target: e,
|
|
142
144
|
bodyNode: t
|
|
143
145
|
}) {
|
|
144
|
-
return typeof Element > "u" || !(e instanceof Element) || f(e) || a({ target: e, boundary: t }) ? r :
|
|
146
|
+
return typeof Element > "u" || !(e instanceof Element) || f(e) || a({ target: e, boundary: t }) ? r : i;
|
|
145
147
|
}
|
|
146
148
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
H as getBottomTouchDragDecision,
|
|
150
|
+
d as getModalScrollState,
|
|
151
|
+
E as getPopupTouchDragDecision,
|
|
150
152
|
m as getScrollableAncestor,
|
|
151
153
|
a as hasActiveTextSelection,
|
|
152
154
|
p as isAtScrollBottom,
|
|
@@ -154,5 +156,5 @@ export {
|
|
|
154
156
|
c as isScrollableElement,
|
|
155
157
|
g as setModalBodyTouchScrollLock,
|
|
156
158
|
f as shouldIgnoreDragTarget,
|
|
157
|
-
|
|
159
|
+
A as shouldLockModalBodyTouchScroll
|
|
158
160
|
};
|