@protonradio/proton-ui 0.6.18-beta.8 → 0.6.18-beta.9
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/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +30 -30
- package/dist/index.es.js.map +1 -1
- package/dist/utils-Bz7OvzU8.js +2 -0
- package/dist/{utils-61LoaAd7.js.map → utils-Bz7OvzU8.js.map} +1 -1
- package/dist/utils-CfiNJPhX.mjs +115 -0
- package/dist/{utils-CF14T2dp.mjs.map → utils-CfiNJPhX.mjs.map} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +1 -1
- package/package.json +1 -1
- package/dist/utils-61LoaAd7.js +0 -2
- package/dist/utils-CF14T2dp.mjs +0 -117
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import g, { useLayoutEffect as pr, useState as D, useRef as S, createElement as Qt, useEffect as F, createContext as O, useContext as A, useMemo as oe, isValidElement as hr, forwardRef as
|
|
1
|
+
import g, { useLayoutEffect as pr, useState as D, useRef as S, createElement as Qt, useEffect as F, createContext as O, useContext as A, useMemo as oe, isValidElement as hr, forwardRef as fe, useCallback as ne, cloneElement as vr } from "react";
|
|
2
2
|
import en, { createPortal as tn } from "react-dom";
|
|
3
3
|
import { useMenu as nn, useOverlay as mr, FocusScope as pt, useMenuItem as rn, useButton as De, useRadioGroup as br, useRadio as gr, VisuallyHidden as on, useDialog as yr, useTextField as xr, useClipboard as _r, useSearchField as $r, useOverlayTrigger as Sr, usePopover as Er, Overlay as wr, DismissButton as Cr, useFocusRing as we, useHover as Rr, useId as Lt, mergeProps as me, useMenuTrigger as Pr, useMenuSection as Tr, useTooltipTrigger as jr, OverlayContainer as Nr, useOverlayPosition as Mr, useTooltip as kr, useListBox as Ar, useOption as Or, useSelect as an, HiddenSelect as ln, useSwitch as Ir, useTableHeaderRow as Dr, useTableColumnHeader as Lr, useTableRowGroup as Br, useTableRow as Hr, useTableCell as Vr, useTable as Kr } from "react-aria";
|
|
4
4
|
import { useTreeState as sn, Item as ht, useRadioGroupState as Wr, useOverlayTriggerState as Fr, useMenuTriggerState as Gr, useTooltipTriggerState as cn, useSelectState as un, useToggleState as Ur, useTableState as zr } from "react-stately";
|
|
5
|
-
import { b as E, i as vt, h as dn } from "./utils-
|
|
5
|
+
import { b as E, i as vt, h as dn } from "./utils-CfiNJPhX.mjs";
|
|
6
6
|
import { THEMES as le, BREAKPOINTS as fn } from "./constants.es.js";
|
|
7
|
-
import { transparentize as
|
|
7
|
+
import { transparentize as de, toRgba as Xe } from "color2k";
|
|
8
8
|
import { G as Q, S as Ne, W as Me, D as ke, B as Yr } from "./colors-Dwh4VIMR.mjs";
|
|
9
9
|
import { c as Na } from "./colors-Dwh4VIMR.mjs";
|
|
10
10
|
var rt = { exports: {} }, _e = {};
|
|
@@ -133,14 +133,14 @@ function Jr() {
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
|
-
var Z = Object.assign, B = 0, U, Y, q, ae,
|
|
136
|
+
var Z = Object.assign, B = 0, U, Y, q, ae, pe, _t, $t;
|
|
137
137
|
function St() {
|
|
138
138
|
}
|
|
139
139
|
St.__reactDisabledLog = !0;
|
|
140
140
|
function Hn() {
|
|
141
141
|
{
|
|
142
142
|
if (B === 0) {
|
|
143
|
-
U = console.log, Y = console.info, q = console.warn, ae = console.error,
|
|
143
|
+
U = console.log, Y = console.info, q = console.warn, ae = console.error, pe = console.group, _t = console.groupCollapsed, $t = console.groupEnd;
|
|
144
144
|
var a = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
@@ -182,7 +182,7 @@ function Jr() {
|
|
|
182
182
|
value: ae
|
|
183
183
|
}),
|
|
184
184
|
group: Z({}, a, {
|
|
185
|
-
value:
|
|
185
|
+
value: pe
|
|
186
186
|
}),
|
|
187
187
|
groupCollapsed: Z({}, a, {
|
|
188
188
|
value: _t
|
|
@@ -282,7 +282,7 @@ function Jr() {
|
|
|
282
282
|
} finally {
|
|
283
283
|
Fe = !1, Ke.current = k, Vn(), Error.prepareStackTrace = N;
|
|
284
284
|
}
|
|
285
|
-
var
|
|
285
|
+
var ve = a ? a.displayName || a.name : "", ue = ve ? Re(ve) : "";
|
|
286
286
|
return typeof a == "function" && Pe.set(a, ue), ue;
|
|
287
287
|
}
|
|
288
288
|
function Wn(a, m, b) {
|
|
@@ -471,7 +471,7 @@ function Jr() {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
var ze = w.ReactCurrentOwner, Nt = w.ReactDebugCurrentFrame;
|
|
474
|
-
function
|
|
474
|
+
function he(a) {
|
|
475
475
|
if (a) {
|
|
476
476
|
var m = a._owner, b = Te(a.type, a._source, m ? m.type : null);
|
|
477
477
|
Nt.setExtraStackFrame(b);
|
|
@@ -521,7 +521,7 @@ Check the top-level render call using <` + b + ">.");
|
|
|
521
521
|
return;
|
|
522
522
|
kt[b] = !0;
|
|
523
523
|
var $ = "";
|
|
524
|
-
a && a._owner && a._owner !== ze.current && ($ = " It was passed a child from " + V(a._owner.type) + "."),
|
|
524
|
+
a && a._owner && a._owner !== ze.current && ($ = " It was passed a child from " + V(a._owner.type) + "."), he(a), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, $), he(null);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
function Ot(a, m) {
|
|
@@ -573,11 +573,11 @@ Check the top-level render call using <` + b + ">.");
|
|
|
573
573
|
for (var m = Object.keys(a.props), b = 0; b < m.length; b++) {
|
|
574
574
|
var $ = m[b];
|
|
575
575
|
if ($ !== "children" && $ !== "key") {
|
|
576
|
-
|
|
576
|
+
he(a), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", $), he(null);
|
|
577
577
|
break;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
a.ref !== null && (
|
|
580
|
+
a.ref !== null && (he(a), R("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
var It = {};
|
|
@@ -600,8 +600,8 @@ Check the top-level render call using <` + b + ">.");
|
|
|
600
600
|
if (ee !== void 0)
|
|
601
601
|
if ($)
|
|
602
602
|
if (Ge(ee)) {
|
|
603
|
-
for (var
|
|
604
|
-
Ot(ee[
|
|
603
|
+
for (var ve = 0; ve < ee.length; ve++)
|
|
604
|
+
Ot(ee[ve], a);
|
|
605
605
|
Object.freeze && Object.freeze(ee);
|
|
606
606
|
} else
|
|
607
607
|
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -853,7 +853,7 @@ const Zr = ({ children: t }) => {
|
|
|
853
853
|
);
|
|
854
854
|
}, Ze = "rgb(83, 82, 83)";
|
|
855
855
|
function to(t) {
|
|
856
|
-
const e =
|
|
856
|
+
const e = de(t.PRIMARY.PRIMARY_LIGHTEST, 0.4), n = de(t.PRIMARY.PRIMARY_LIGHTEST, 0.8);
|
|
857
857
|
return {
|
|
858
858
|
[le.DARK]: {
|
|
859
859
|
"--proton-control__background-color": Xe(Ze),
|
|
@@ -868,7 +868,7 @@ function to(t) {
|
|
|
868
868
|
"--proton-control__background-color": Q.WHITE,
|
|
869
869
|
"--proton-control__text-color": Q.GRAY_DARK,
|
|
870
870
|
"--proton-control__border-color": Q.GRAY_LIGHT,
|
|
871
|
-
"--proton-control__shadow-color":
|
|
871
|
+
"--proton-control__shadow-color": de(
|
|
872
872
|
Xe(Ze),
|
|
873
873
|
0.9
|
|
874
874
|
),
|
|
@@ -879,7 +879,7 @@ function to(t) {
|
|
|
879
879
|
[le.CUSTOM_DARK]: {
|
|
880
880
|
"--proton-control__background-color": Xe(Ze),
|
|
881
881
|
"--proton-control__text-color": Q.WHITE,
|
|
882
|
-
"--proton-control__border-color":
|
|
882
|
+
"--proton-control__border-color": n,
|
|
883
883
|
"--proton-control__shadow-color": e,
|
|
884
884
|
"--proton-color__primary": t.BRAND.PRIMARY,
|
|
885
885
|
"--proton-color__primary-light": t.BRAND.PRIMARY_LIGHT,
|
|
@@ -1160,7 +1160,7 @@ function pa(t) {
|
|
|
1160
1160
|
/* @__PURE__ */ s.jsx(fo, { ...t })
|
|
1161
1161
|
] }) : null;
|
|
1162
1162
|
}
|
|
1163
|
-
const po =
|
|
1163
|
+
const po = fe(
|
|
1164
1164
|
({
|
|
1165
1165
|
prefix: t,
|
|
1166
1166
|
suffix: e,
|
|
@@ -1203,9 +1203,9 @@ const po = de(
|
|
|
1203
1203
|
"--input-background": (() => {
|
|
1204
1204
|
switch (j) {
|
|
1205
1205
|
case le.CUSTOM_DARK:
|
|
1206
|
-
return
|
|
1206
|
+
return de(R.PRIMARY.PRIMARY_SUPER_LIGHT, 0.6);
|
|
1207
1207
|
case le.DARK:
|
|
1208
|
-
return
|
|
1208
|
+
return de(Q.GRAY_MEDIUM, 0.5);
|
|
1209
1209
|
default:
|
|
1210
1210
|
return Q.WHITE;
|
|
1211
1211
|
}
|
|
@@ -1858,7 +1858,7 @@ function Ro(t) {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
function Po(t) {
|
|
1860
1860
|
let e = (n, r) => A(ot) ? null : t(n, r);
|
|
1861
|
-
return e.displayName = t.displayName || t.name,
|
|
1861
|
+
return e.displayName = t.displayName || t.name, fe(e);
|
|
1862
1862
|
}
|
|
1863
1863
|
const be = typeof document < "u" ? g.useLayoutEffect : () => {
|
|
1864
1864
|
};
|
|
@@ -2189,7 +2189,7 @@ function qo(t, e, n, r, o, i) {
|
|
|
2189
2189
|
}, o);
|
|
2190
2190
|
}
|
|
2191
2191
|
function Jo(t, e) {
|
|
2192
|
-
let n = ({ node: o }) => e(o.props, o.props.ref, o), r =
|
|
2192
|
+
let n = ({ node: o }) => e(o.props, o.props.ref, o), r = fe((o, i) => {
|
|
2193
2193
|
if (!A(Sn)) {
|
|
2194
2194
|
if (e.length >= 3) throw new Error(e.name + " cannot be rendered outside a collection.");
|
|
2195
2195
|
return e(o, i);
|
|
@@ -2685,7 +2685,7 @@ function $i(t, e) {
|
|
|
2685
2685
|
"data-placement": n
|
|
2686
2686
|
});
|
|
2687
2687
|
}
|
|
2688
|
-
const Si = /* @__PURE__ */
|
|
2688
|
+
const Si = /* @__PURE__ */ fe($i), ct = /* @__PURE__ */ O(null), Ei = /* @__PURE__ */ O(null), wi = /* @__PURE__ */ O({});
|
|
2689
2689
|
function jn(t) {
|
|
2690
2690
|
return null;
|
|
2691
2691
|
}
|
|
@@ -2872,7 +2872,7 @@ function Ti({ props: t, collection: e, menuRef: n }) {
|
|
|
2872
2872
|
}
|
|
2873
2873
|
}));
|
|
2874
2874
|
}
|
|
2875
|
-
const ji = /* @__PURE__ */
|
|
2875
|
+
const ji = /* @__PURE__ */ fe(Pi);
|
|
2876
2876
|
function Ni(t, e, n) {
|
|
2877
2877
|
var r, o;
|
|
2878
2878
|
let i = A(yt), { CollectionBranch: l } = A(En), [c, u] = ri();
|
|
@@ -3150,7 +3150,7 @@ function Ii({ UNSTABLE_portalContainer: t, ...e }, n) {
|
|
|
3150
3150
|
isExiting: l
|
|
3151
3151
|
}));
|
|
3152
3152
|
}
|
|
3153
|
-
const Di = /* @__PURE__ */
|
|
3153
|
+
const Di = /* @__PURE__ */ fe(Ii);
|
|
3154
3154
|
function Li(t) {
|
|
3155
3155
|
let e = A(xt), n = S(null), [r, o] = D(0);
|
|
3156
3156
|
be(() => {
|
|
@@ -3342,7 +3342,7 @@ function Hi({ item: t, state: e }) {
|
|
|
3342
3342
|
}
|
|
3343
3343
|
);
|
|
3344
3344
|
}
|
|
3345
|
-
const Bn =
|
|
3345
|
+
const Bn = fe(
|
|
3346
3346
|
(t, e) => {
|
|
3347
3347
|
let { buttonProps: n } = De(
|
|
3348
3348
|
{
|
|
@@ -3804,7 +3804,7 @@ const Ra = ({
|
|
|
3804
3804
|
"data-testid": r
|
|
3805
3805
|
}) => {
|
|
3806
3806
|
const { className: o, palette: i, theme: l } = ie(), c = n ? /* @__PURE__ */ s.jsx(Yi, { delay: 50, closeDelay: 75, ...n, children: e }) : e, u = {
|
|
3807
|
-
"--text-emphasis-highlight": l === le.CUSTOM_DARK ?
|
|
3807
|
+
"--text-emphasis-highlight": l === le.CUSTOM_DARK ? de(i.SECONDARY.SECONDARY_LIGHT, 0.3) : de(Yr.PRIMARY, 0.5)
|
|
3808
3808
|
};
|
|
3809
3809
|
if (t) {
|
|
3810
3810
|
const f = vt(t);
|
|
@@ -3931,8 +3931,8 @@ function Pa({
|
|
|
3931
3931
|
F(() => {
|
|
3932
3932
|
if (!v.current) return;
|
|
3933
3933
|
const B = (q) => {
|
|
3934
|
-
const ae = Math.floor(q / (e + z)),
|
|
3935
|
-
x(
|
|
3934
|
+
const ae = Math.floor(q / (e + z)), pe = Zi(M, ae);
|
|
3935
|
+
x(pe);
|
|
3936
3936
|
}, U = v.current.clientWidth;
|
|
3937
3937
|
B(U);
|
|
3938
3938
|
const Y = new ResizeObserver((q) => {
|
|
@@ -3998,14 +3998,14 @@ function Pa({
|
|
|
3998
3998
|
}
|
|
3999
3999
|
),
|
|
4000
4000
|
y.map((B, U) => {
|
|
4001
|
-
const Y = U / y.length * l, q = n !== void 0 && r !== void 0 && (Y < n || Y > r), ae = o === 0 ? !1 : Y <= o,
|
|
4001
|
+
const Y = U / y.length * l, q = n !== void 0 && r !== void 0 && (Y < n || Y > r), ae = o === 0 ? !1 : Y <= o, pe = _ !== null && Y <= _;
|
|
4002
4002
|
return /* @__PURE__ */ s.jsx(
|
|
4003
4003
|
qi,
|
|
4004
4004
|
{
|
|
4005
4005
|
amplitude: B,
|
|
4006
4006
|
isDisabled: q,
|
|
4007
4007
|
isPlayed: ae,
|
|
4008
|
-
isHovered:
|
|
4008
|
+
isHovered: pe,
|
|
4009
4009
|
isVisible: R,
|
|
4010
4010
|
hasAnimated: P,
|
|
4011
4011
|
resolution: e,
|