@drjoshcsimmons/scl 0.2.8 → 0.3.3
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/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.d.ts +5 -4
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/alert/index.d.ts.map +1 -1
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +4 -6
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +6 -7
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -2
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.d.ts +0 -3
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/separator/separator.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider/slider.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +6 -10
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/globals.css +223 -287
- package/dist/hooks/use-font-loaded.d.ts +2 -0
- package/dist/hooks/use-font-loaded.d.ts.map +1 -0
- package/dist/index.d.ts +2 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -185
- package/dist/index10.js +28 -51
- package/dist/index100.js +14 -30
- package/dist/index101.js +47 -12
- package/dist/index102.js +50 -6
- package/dist/index103.js +9 -25
- package/dist/index104.js +30 -9
- package/dist/index105.js +9 -9
- package/dist/index106.js +8 -3
- package/dist/index107.js +30 -30
- package/dist/index108.js +54 -8
- package/dist/index109.js +30 -30
- package/dist/index11.js +26 -16
- package/dist/index110.js +44 -51
- package/dist/index111.js +47 -29
- package/dist/index112.js +1 -1
- package/dist/index113.js +1 -1
- package/dist/index114.js +6 -48
- package/dist/index115.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +3 -3
- package/dist/index119.js +2 -48
- package/dist/index12.js +6 -5
- package/dist/index120.js +53 -6
- package/dist/index121.js +62 -18
- package/dist/index122.js +25 -9
- package/dist/index123.js +29 -38
- package/dist/index124.js +5 -18
- package/dist/index125.js +2 -25
- package/dist/index126.js +2 -29
- package/dist/index127.js +5 -5
- package/dist/index128.js +3 -2
- package/dist/index129.js +22 -51
- package/dist/index13.js +77 -134
- package/dist/index130.js +108 -60
- package/dist/index131.js +16 -2
- package/dist/index132.js +525 -2
- package/dist/index133.js +128 -5
- package/dist/index134.js +134 -3
- package/dist/index135.js +63 -22
- package/dist/index136.js +66 -110
- package/dist/index137.js +8 -15
- package/dist/index138.js +11 -522
- package/dist/index139.js +65 -127
- package/dist/index14.js +13 -97
- package/dist/index140.js +3 -133
- package/dist/index141.js +19 -61
- package/dist/index142.js +22 -68
- package/dist/index143.js +11 -7
- package/dist/index144.js +28 -14
- package/dist/index145.js +4 -65
- package/dist/index15.js +12 -71
- package/dist/index16.js +19 -254
- package/dist/index17.js +32 -138
- package/dist/index18.js +25 -89
- package/dist/index19.js +37 -18
- package/dist/index2.js +5 -5
- package/dist/index20.js +139 -10
- package/dist/index21.js +18 -19
- package/dist/index22.js +13 -35
- package/dist/index23.js +24 -22
- package/dist/index24.js +13 -34
- package/dist/index25.js +31 -114
- package/dist/index26.js +32 -16
- package/dist/index27.js +14 -74
- package/dist/index28.js +15 -12
- package/dist/index29.js +24 -29
- package/dist/index3.js +10 -22
- package/dist/index30.js +97 -108
- package/dist/index31.js +39 -25
- package/dist/index32.js +11 -65
- package/dist/index33.js +49 -44
- package/dist/index34.js +65 -85
- package/dist/index35.js +234 -15
- package/dist/index38.js +71 -98
- package/dist/index4.js +22 -37
- package/dist/index43.js +58 -13
- package/dist/index45.js +219 -207
- package/dist/index48.js +530 -9
- package/dist/index5.js +51 -34
- package/dist/index50.js +18 -11
- package/dist/index52.js +229 -298
- package/dist/index54.js +218 -100
- package/dist/index57.js +115 -245
- package/dist/index59.js +22 -12
- package/dist/index6.js +21 -75
- package/dist/index61.js +325 -119
- package/dist/index63.js +74 -117
- package/dist/index65.js +409 -210
- package/dist/index67.js +234 -311
- package/dist/index69.js +112 -16
- package/dist/index7.js +22 -27
- package/dist/index71.js +146 -67
- package/dist/index73.js +30 -434
- package/dist/index76.js +854 -62
- package/dist/index78.js +64 -23
- package/dist/index79.js +44 -5
- package/dist/index8.js +6 -27
- package/dist/index80.js +24 -49
- package/dist/index81.js +6 -33
- package/dist/index82.js +51 -10
- package/dist/index83.js +33 -7
- package/dist/index84.js +10 -124
- package/dist/index85.js +7 -14
- package/dist/index86.js +50 -130
- package/dist/index87.js +10 -218
- package/dist/index88.js +4 -14
- package/dist/index89.js +29 -68
- package/dist/index9.js +19 -34
- package/dist/index90.js +12 -47
- package/dist/index91.js +6 -50
- package/dist/index92.js +25 -9
- package/dist/index93.js +68 -3
- package/dist/index94.js +3 -649
- package/dist/index95.js +30 -15
- package/dist/index96.js +124 -29
- package/dist/index97.js +13 -46
- package/dist/index98.js +130 -50
- package/dist/index99.js +218 -10
- package/dist/lib/utils.d.ts +8 -8
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +5 -46
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +0 -21
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog/index.d.ts +0 -2
- package/dist/components/ui/alert-dialog/index.d.ts.map +0 -1
- package/dist/components/ui/combobox/combobox.d.ts +0 -31
- package/dist/components/ui/combobox/combobox.d.ts.map +0 -1
- package/dist/components/ui/combobox/index.d.ts +0 -3
- package/dist/components/ui/combobox/index.d.ts.map +0 -1
- package/dist/components/ui/command/command.d.ts +0 -85
- package/dist/components/ui/command/command.d.ts.map +0 -1
- package/dist/components/ui/command/index.d.ts +0 -2
- package/dist/components/ui/command/index.d.ts.map +0 -1
- package/dist/components/ui/dithered-image/dithered-image.d.ts +0 -21
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +0 -1
- package/dist/components/ui/dithered-image/index.d.ts +0 -3
- package/dist/components/ui/dithered-image/index.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +0 -2
- package/dist/components/ui/dropdown-menu/index.d.ts.map +0 -1
- package/dist/components/ui/form/form.d.ts +0 -24
- package/dist/components/ui/form/form.d.ts.map +0 -1
- package/dist/components/ui/form/index.d.ts +0 -2
- package/dist/components/ui/form/index.d.ts.map +0 -1
- package/dist/components/ui/sheet/index.d.ts +0 -2
- package/dist/components/ui/sheet/index.d.ts.map +0 -1
- package/dist/components/ui/sheet/sheet.d.ts +0 -26
- package/dist/components/ui/sheet/sheet.d.ts.map +0 -1
- package/dist/components/ui/statusline/index.d.ts +0 -2
- package/dist/components/ui/statusline/index.d.ts.map +0 -1
- package/dist/components/ui/statusline/statusline.d.ts +0 -40
- package/dist/components/ui/statusline/statusline.d.ts.map +0 -1
- package/dist/components/ui/terminal-textarea/index.d.ts +0 -2
- package/dist/components/ui/terminal-textarea/index.d.ts.map +0 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -16
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +0 -1
- package/dist/index146.js +0 -6
- package/dist/index147.js +0 -25
- package/dist/index148.js +0 -25
- package/dist/index149.js +0 -15
- package/dist/index150.js +0 -30
- package/dist/index151.js +0 -7
- package/dist/index36.js +0 -37
- package/dist/index37.js +0 -28
- package/dist/index39.js +0 -41
- package/dist/index40.js +0 -13
- package/dist/index41.js +0 -51
- package/dist/index42.js +0 -68
- package/dist/index44.js +0 -2265
- package/dist/index46.js +0 -13
- package/dist/index47.js +0 -227
- package/dist/index49.js +0 -13
- package/dist/index51.js +0 -243
- package/dist/index53.js +0 -14
- package/dist/index55.js +0 -20
- package/dist/index56.js +0 -35
- package/dist/index58.js +0 -14
- package/dist/index60.js +0 -75
- package/dist/index62.js +0 -62
- package/dist/index64.js +0 -256
- package/dist/index66.js +0 -532
- package/dist/index68.js +0 -251
- package/dist/index70.js +0 -163
- package/dist/index72.js +0 -33
- package/dist/index74.js +0 -862
- package/dist/index75.js +0 -11
- package/dist/index77.js +0 -48
package/dist/index144.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { getNonce as o } from "./index145.js";
|
|
2
|
+
function r() {
|
|
3
|
+
if (!document)
|
|
4
|
+
return null;
|
|
5
|
+
var t = document.createElement("style");
|
|
6
|
+
t.type = "text/css";
|
|
7
|
+
var e = o();
|
|
8
|
+
return e && t.setAttribute("nonce", e), t;
|
|
9
|
+
}
|
|
10
|
+
function l(t, e) {
|
|
11
|
+
t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
|
|
12
|
+
}
|
|
13
|
+
function a(t) {
|
|
14
|
+
var e = document.head || document.getElementsByTagName("head")[0];
|
|
15
|
+
e.appendChild(t);
|
|
16
|
+
}
|
|
17
|
+
var c = function() {
|
|
18
|
+
var t = 0, e = null;
|
|
19
|
+
return {
|
|
20
|
+
add: function(n) {
|
|
21
|
+
t == 0 && (e = r()) && (l(e, n), a(e)), t++;
|
|
22
|
+
},
|
|
23
|
+
remove: function() {
|
|
24
|
+
t--, !t && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
14
28
|
export {
|
|
15
|
-
|
|
29
|
+
c as stylesheetSingleton
|
|
16
30
|
};
|
package/dist/index145.js
CHANGED
|
@@ -1,68 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!(r instanceof Element))
|
|
5
|
-
return !1;
|
|
6
|
-
var t = window.getComputedStyle(r);
|
|
7
|
-
return (
|
|
8
|
-
// not-not-scrollable
|
|
9
|
-
t[e] !== "hidden" && // contains scroll inside self
|
|
10
|
-
!(t.overflowY === t.overflowX && !N(r) && t[e] === "visible")
|
|
11
|
-
);
|
|
12
|
-
}, D = function(r) {
|
|
13
|
-
return b(r, "overflowY");
|
|
14
|
-
}, E = function(r) {
|
|
15
|
-
return b(r, "overflowX");
|
|
16
|
-
}, T = function(r, e) {
|
|
17
|
-
var t = e.ownerDocument, l = e;
|
|
18
|
-
do {
|
|
19
|
-
typeof ShadowRoot < "u" && l instanceof ShadowRoot && (l = l.host);
|
|
20
|
-
var f = g(r, l);
|
|
21
|
-
if (f) {
|
|
22
|
-
var n = m(r, l), i = n[1], o = n[2];
|
|
23
|
-
if (i > o)
|
|
24
|
-
return !0;
|
|
25
|
-
}
|
|
26
|
-
l = l.parentNode;
|
|
27
|
-
} while (l && l !== t.body);
|
|
28
|
-
return !1;
|
|
29
|
-
}, H = function(r) {
|
|
30
|
-
var e = r.scrollTop, t = r.scrollHeight, l = r.clientHeight;
|
|
31
|
-
return [
|
|
32
|
-
e,
|
|
33
|
-
t,
|
|
34
|
-
l
|
|
35
|
-
];
|
|
36
|
-
}, p = function(r) {
|
|
37
|
-
var e = r.scrollLeft, t = r.scrollWidth, l = r.clientWidth;
|
|
38
|
-
return [
|
|
39
|
-
e,
|
|
40
|
-
t,
|
|
41
|
-
l
|
|
42
|
-
];
|
|
43
|
-
}, g = function(r, e) {
|
|
44
|
-
return r === "v" ? D(e) : E(e);
|
|
45
|
-
}, m = function(r, e) {
|
|
46
|
-
return r === "v" ? H(e) : p(e);
|
|
47
|
-
}, B = function(r, e) {
|
|
48
|
-
return r === "h" && e === "rtl" ? -1 : 1;
|
|
49
|
-
}, V = function(r, e, t, l, f) {
|
|
50
|
-
var n = B(r, window.getComputedStyle(e).direction), i = n * l, o = t.target, d = e.contains(o), c = !1, s = i > 0, h = 0, S = 0;
|
|
51
|
-
do {
|
|
52
|
-
if (!o)
|
|
53
|
-
break;
|
|
54
|
-
var u = m(r, o), v = u[0], C = u[1], y = u[2], w = C - y - n * v;
|
|
55
|
-
(v || w) && g(r, o) && (h += w, S += v);
|
|
56
|
-
var a = o.parentNode;
|
|
57
|
-
o = a && a.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? a.host : a;
|
|
58
|
-
} while (
|
|
59
|
-
// portaled content
|
|
60
|
-
!d && o !== document.body || // self content
|
|
61
|
-
d && (e.contains(o) || e === o)
|
|
62
|
-
);
|
|
63
|
-
return (s && Math.abs(h) < 1 || !s && Math.abs(S) < 1) && (c = !0), c;
|
|
1
|
+
var e = function() {
|
|
2
|
+
if (typeof __webpack_nonce__ < "u")
|
|
3
|
+
return __webpack_nonce__;
|
|
64
4
|
};
|
|
65
5
|
export {
|
|
66
|
-
|
|
67
|
-
T as locationCouldBeScrolled
|
|
6
|
+
e as getNonce
|
|
68
7
|
};
|
package/dist/index15.js
CHANGED
|
@@ -1,76 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Root as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Root as o } from "./index50.js";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { cx as p } from "./index2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const s = e.forwardRef(({ className: m, ...r }, a) => /* @__PURE__ */ t(
|
|
7
|
+
o,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
9
|
+
ref: a,
|
|
10
|
+
className: p("scl-label", m),
|
|
11
|
+
...r
|
|
12
12
|
}
|
|
13
13
|
));
|
|
14
|
-
|
|
15
|
-
const u = l.forwardRef(({ className: e, children: a, ...s }, g) => /* @__PURE__ */ r(D, { children: [
|
|
16
|
-
/* @__PURE__ */ o(f, {}),
|
|
17
|
-
/* @__PURE__ */ r(
|
|
18
|
-
n,
|
|
19
|
-
{
|
|
20
|
-
ref: g,
|
|
21
|
-
className: t(
|
|
22
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 bg-black p-6",
|
|
23
|
-
e
|
|
24
|
-
),
|
|
25
|
-
...s,
|
|
26
|
-
children: [
|
|
27
|
-
a,
|
|
28
|
-
/* @__PURE__ */ r(i, { className: "absolute right-4 top-4 ring-offset-background hover:text-primary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none cursor-pointer", children: [
|
|
29
|
-
/* @__PURE__ */ o(y, { className: "h-4 w-4" }),
|
|
30
|
-
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
31
|
-
] })
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
] }));
|
|
36
|
-
u.displayName = n.displayName;
|
|
37
|
-
const b = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: t("flex flex-col space-y-1.5 text-center sm:text-left", e), ...a });
|
|
38
|
-
b.displayName = "DialogHeader";
|
|
39
|
-
const h = ({ className: e, ...a }) => /* @__PURE__ */ o(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
className: t("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
43
|
-
...a
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
h.displayName = "DialogFooter";
|
|
47
|
-
const w = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
48
|
-
m,
|
|
49
|
-
{
|
|
50
|
-
ref: s,
|
|
51
|
-
className: t("text-lg font-semibold leading-none tracking-tight", e),
|
|
52
|
-
...a
|
|
53
|
-
}
|
|
54
|
-
));
|
|
55
|
-
w.displayName = m.displayName;
|
|
56
|
-
const v = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
57
|
-
c,
|
|
58
|
-
{
|
|
59
|
-
ref: s,
|
|
60
|
-
className: t("text-sm text-muted-foreground", e),
|
|
61
|
-
...a
|
|
62
|
-
}
|
|
63
|
-
));
|
|
64
|
-
v.displayName = c.displayName;
|
|
14
|
+
s.displayName = o.displayName;
|
|
65
15
|
export {
|
|
66
|
-
|
|
67
|
-
F as DialogClose,
|
|
68
|
-
u as DialogContent,
|
|
69
|
-
v as DialogDescription,
|
|
70
|
-
h as DialogFooter,
|
|
71
|
-
b as DialogHeader,
|
|
72
|
-
f as DialogOverlay,
|
|
73
|
-
D as DialogPortal,
|
|
74
|
-
w as DialogTitle,
|
|
75
|
-
z as DialogTrigger
|
|
16
|
+
s as Label
|
|
76
17
|
};
|
package/dist/index16.js
CHANGED
|
@@ -1,257 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Root as s, Anchor as a, Trigger as m, Portal as i, Content as r } from "./index52.js";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { cx as l } from "./index2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const R = s, x = m, A = a, v = f.forwardRef(({ className: t, align: e = "center", sideOffset: n = 4, ...c }, p) => /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(
|
|
7
|
+
r,
|
|
8
|
+
{
|
|
9
|
+
ref: p,
|
|
10
|
+
align: e,
|
|
11
|
+
sideOffset: n,
|
|
12
|
+
className: l("scl-popover-content", t),
|
|
13
|
+
...c
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
varying vec2 v_texCoord;
|
|
17
|
-
|
|
18
|
-
uniform sampler2D u_image;
|
|
19
|
-
uniform vec3 u_color;
|
|
20
|
-
|
|
21
|
-
void main() {
|
|
22
|
-
vec4 texColor = texture2D(u_image, v_texCoord);
|
|
23
|
-
// Dithered image is already black/white, just colorize the white pixels
|
|
24
|
-
vec3 finalColor = texColor.r * u_color;
|
|
25
|
-
gl_FragColor = vec4(finalColor, texColor.a);
|
|
26
|
-
}
|
|
27
|
-
`, B = `
|
|
28
|
-
precision mediump float;
|
|
29
|
-
|
|
30
|
-
varying vec2 v_texCoord;
|
|
31
|
-
|
|
32
|
-
uniform sampler2D u_image;
|
|
33
|
-
uniform sampler2D u_bayerTex;
|
|
34
|
-
uniform vec2 u_resolution;
|
|
35
|
-
uniform float u_ditherSize;
|
|
36
|
-
uniform vec3 u_color;
|
|
37
|
-
|
|
38
|
-
void main() {
|
|
39
|
-
vec2 pixelPos = mod(floor(gl_FragCoord.xy / u_ditherSize), 8.0);
|
|
40
|
-
vec4 texColor = texture2D(u_image, v_texCoord);
|
|
41
|
-
|
|
42
|
-
// Convert to grayscale using luminance
|
|
43
|
-
float gray = dot(texColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
44
|
-
|
|
45
|
-
// Look up threshold from Bayer texture
|
|
46
|
-
float threshold = texture2D(u_bayerTex, (pixelPos + 0.5) / 8.0).r;
|
|
47
|
-
float dithered = step(threshold, gray);
|
|
48
|
-
|
|
49
|
-
// Output color or black
|
|
50
|
-
vec3 finalColor = dithered * u_color;
|
|
51
|
-
gl_FragColor = vec4(finalColor, texColor.a);
|
|
52
|
-
}
|
|
53
|
-
`, N = [
|
|
54
|
-
0,
|
|
55
|
-
32,
|
|
56
|
-
8,
|
|
57
|
-
40,
|
|
58
|
-
2,
|
|
59
|
-
34,
|
|
60
|
-
10,
|
|
61
|
-
42,
|
|
62
|
-
48,
|
|
63
|
-
16,
|
|
64
|
-
56,
|
|
65
|
-
24,
|
|
66
|
-
50,
|
|
67
|
-
18,
|
|
68
|
-
58,
|
|
69
|
-
26,
|
|
70
|
-
12,
|
|
71
|
-
44,
|
|
72
|
-
4,
|
|
73
|
-
36,
|
|
74
|
-
14,
|
|
75
|
-
46,
|
|
76
|
-
6,
|
|
77
|
-
38,
|
|
78
|
-
60,
|
|
79
|
-
28,
|
|
80
|
-
52,
|
|
81
|
-
20,
|
|
82
|
-
62,
|
|
83
|
-
30,
|
|
84
|
-
54,
|
|
85
|
-
22,
|
|
86
|
-
3,
|
|
87
|
-
35,
|
|
88
|
-
11,
|
|
89
|
-
43,
|
|
90
|
-
1,
|
|
91
|
-
33,
|
|
92
|
-
9,
|
|
93
|
-
41,
|
|
94
|
-
51,
|
|
95
|
-
19,
|
|
96
|
-
59,
|
|
97
|
-
27,
|
|
98
|
-
49,
|
|
99
|
-
17,
|
|
100
|
-
57,
|
|
101
|
-
25,
|
|
102
|
-
15,
|
|
103
|
-
47,
|
|
104
|
-
7,
|
|
105
|
-
39,
|
|
106
|
-
13,
|
|
107
|
-
45,
|
|
108
|
-
5,
|
|
109
|
-
37,
|
|
110
|
-
63,
|
|
111
|
-
31,
|
|
112
|
-
55,
|
|
113
|
-
23,
|
|
114
|
-
61,
|
|
115
|
-
29,
|
|
116
|
-
53,
|
|
117
|
-
21
|
|
118
|
-
];
|
|
119
|
-
function w(n, m = 128) {
|
|
120
|
-
const t = new Uint8ClampedArray(n.data), o = n.width, d = n.height, _ = (r, a) => (a * o + r) * 4, f = (r, a, i) => {
|
|
121
|
-
if (r < 0 || r >= o || a < 0 || a >= d) return;
|
|
122
|
-
const E = _(r, a);
|
|
123
|
-
t[E] = Math.max(0, Math.min(255, t[E] + i)), t[E + 1] = Math.max(0, Math.min(255, t[E + 1] + i)), t[E + 2] = Math.max(0, Math.min(255, t[E + 2] + i));
|
|
124
|
-
};
|
|
125
|
-
for (let r = 0; r < d; r++)
|
|
126
|
-
for (let a = 0; a < o; a++) {
|
|
127
|
-
const i = _(a, r), E = t[i] * 0.299 + t[i + 1] * 0.587 + t[i + 2] * 0.114, c = E < m ? 0 : 255, u = Math.floor((E - c) / 8);
|
|
128
|
-
t[i] = c, t[i + 1] = c, t[i + 2] = c, f(a + 1, r, u), f(a + 2, r, u), f(a - 1, r + 1, u), f(a, r + 1, u), f(a + 1, r + 1, u), f(a, r + 2, u);
|
|
129
|
-
}
|
|
130
|
-
return new ImageData(t, o, d);
|
|
131
|
-
}
|
|
132
|
-
function G(n, m = 128) {
|
|
133
|
-
const t = new Uint8ClampedArray(n.data), o = n.width, d = n.height, _ = (r, a) => (a * o + r) * 4, f = (r, a, i, E) => {
|
|
134
|
-
if (r < 0 || r >= o || a < 0 || a >= d) return;
|
|
135
|
-
const c = _(r, a), u = i * E;
|
|
136
|
-
t[c] = Math.max(0, Math.min(255, t[c] + u)), t[c + 1] = Math.max(0, Math.min(255, t[c + 1] + u)), t[c + 2] = Math.max(0, Math.min(255, t[c + 2] + u));
|
|
137
|
-
};
|
|
138
|
-
for (let r = 0; r < d; r++)
|
|
139
|
-
for (let a = 0; a < o; a++) {
|
|
140
|
-
const i = _(a, r), E = t[i] * 0.299 + t[i + 1] * 0.587 + t[i + 2] * 0.114, c = E < m ? 0 : 255, u = E - c;
|
|
141
|
-
t[i] = c, t[i + 1] = c, t[i + 2] = c, f(a + 1, r, u, 7 / 16), f(a - 1, r + 1, u, 3 / 16), f(a, r + 1, u, 5 / 16), f(a + 1, r + 1, u, 1 / 16);
|
|
142
|
-
}
|
|
143
|
-
return new ImageData(t, o, d);
|
|
144
|
-
}
|
|
145
|
-
function I(n, m, t) {
|
|
146
|
-
const o = n.createShader(m);
|
|
147
|
-
return o ? (n.shaderSource(o, t), n.compileShader(o), n.getShaderParameter(o, n.COMPILE_STATUS) ? o : (console.error("Shader compile error:", n.getShaderInfoLog(o)), n.deleteShader(o), null)) : null;
|
|
148
|
-
}
|
|
149
|
-
function k(n, m, t) {
|
|
150
|
-
const o = n.createProgram();
|
|
151
|
-
return o ? (n.attachShader(o, m), n.attachShader(o, t), n.linkProgram(o), n.getProgramParameter(o, n.LINK_STATUS) ? o : (console.error("Program link error:", n.getProgramInfoLog(o)), n.deleteProgram(o), null)) : null;
|
|
152
|
-
}
|
|
153
|
-
const O = R.forwardRef(
|
|
154
|
-
({
|
|
155
|
-
className: n,
|
|
156
|
-
src: m,
|
|
157
|
-
alt: t,
|
|
158
|
-
width: o,
|
|
159
|
-
height: d,
|
|
160
|
-
ditherSize: _ = 1,
|
|
161
|
-
color: f = [0, 255, 0],
|
|
162
|
-
algorithm: r = "atkinson",
|
|
163
|
-
threshold: a = 128,
|
|
164
|
-
...i
|
|
165
|
-
}, E) => {
|
|
166
|
-
const c = R.useRef(null), u = R.useRef(null), b = R.useRef(null), p = R.useRef(null);
|
|
167
|
-
return R.useImperativeHandle(E, () => c.current), R.useEffect(() => {
|
|
168
|
-
const A = c.current;
|
|
169
|
-
if (!A) return;
|
|
170
|
-
const e = A.getContext("webgl", { preserveDrawingBuffer: !0 });
|
|
171
|
-
if (!e) {
|
|
172
|
-
console.error("WebGL not supported");
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
u.current = e;
|
|
176
|
-
const x = r === "bayer" ? B : F, l = I(e, e.VERTEX_SHADER, M), g = I(e, e.FRAGMENT_SHADER, x);
|
|
177
|
-
if (!l || !g) {
|
|
178
|
-
console.error("Failed to create shaders");
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
const s = k(e, l, g);
|
|
182
|
-
if (!s) {
|
|
183
|
-
console.error("Failed to create program");
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (e.useProgram(s), b.current = s, r === "bayer") {
|
|
187
|
-
const S = e.createTexture();
|
|
188
|
-
e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, S);
|
|
189
|
-
const P = new Uint8Array(N.map((y) => y / 64 * 255));
|
|
190
|
-
e.texImage2D(
|
|
191
|
-
e.TEXTURE_2D,
|
|
192
|
-
0,
|
|
193
|
-
e.LUMINANCE,
|
|
194
|
-
8,
|
|
195
|
-
8,
|
|
196
|
-
0,
|
|
197
|
-
e.LUMINANCE,
|
|
198
|
-
e.UNSIGNED_BYTE,
|
|
199
|
-
P
|
|
200
|
-
), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), p.current = S;
|
|
201
|
-
}
|
|
202
|
-
const T = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]), h = new Float32Array([0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0]), C = e.createBuffer();
|
|
203
|
-
e.bindBuffer(e.ARRAY_BUFFER, C), e.bufferData(e.ARRAY_BUFFER, T, e.STATIC_DRAW);
|
|
204
|
-
const D = e.getAttribLocation(s, "a_position");
|
|
205
|
-
e.enableVertexAttribArray(D), e.vertexAttribPointer(D, 2, e.FLOAT, !1, 0, 0);
|
|
206
|
-
const v = e.createBuffer();
|
|
207
|
-
e.bindBuffer(e.ARRAY_BUFFER, v), e.bufferData(e.ARRAY_BUFFER, h, e.STATIC_DRAW);
|
|
208
|
-
const U = e.getAttribLocation(s, "a_texCoord");
|
|
209
|
-
return e.enableVertexAttribArray(U), e.vertexAttribPointer(U, 2, e.FLOAT, !1, 0, 0), e.uniform1i(e.getUniformLocation(s, "u_image"), 0), r === "bayer" && e.uniform1i(e.getUniformLocation(s, "u_bayerTex"), 1), () => {
|
|
210
|
-
e.deleteProgram(s), e.deleteShader(l), e.deleteShader(g), p.current && e.deleteTexture(p.current);
|
|
211
|
-
};
|
|
212
|
-
}, [r]), R.useEffect(() => {
|
|
213
|
-
const A = c.current, e = u.current, x = b.current;
|
|
214
|
-
if (!A || !e || !x) return;
|
|
215
|
-
const l = new Image();
|
|
216
|
-
l.crossOrigin = "anonymous", l.onload = () => {
|
|
217
|
-
const g = l.naturalWidth / l.naturalHeight;
|
|
218
|
-
let s, T;
|
|
219
|
-
o && d ? (s = o, T = d) : o ? (s = o, T = Math.round(o / g)) : d ? (T = d, s = Math.round(d * g)) : (s = l.naturalWidth, T = l.naturalHeight), A.width = s, A.height = T, e.viewport(0, 0, s, T), e.useProgram(x);
|
|
220
|
-
let h = l;
|
|
221
|
-
if (r === "atkinson" || r === "floyd-steinberg") {
|
|
222
|
-
const D = document.createElement("canvas");
|
|
223
|
-
D.width = s, D.height = T;
|
|
224
|
-
const v = D.getContext("2d");
|
|
225
|
-
if (v) {
|
|
226
|
-
v.drawImage(l, 0, 0, s, T);
|
|
227
|
-
const U = v.getImageData(0, 0, s, T);
|
|
228
|
-
h = r === "atkinson" ? w(U, a) : G(U, a);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
r === "bayer" && (e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, p.current)), e.activeTexture(e.TEXTURE0);
|
|
232
|
-
const C = e.createTexture();
|
|
233
|
-
e.bindTexture(e.TEXTURE_2D, C), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), h instanceof ImageData, e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, h), r === "bayer" && (e.uniform2f(e.getUniformLocation(x, "u_resolution"), s, T), e.uniform1f(e.getUniformLocation(x, "u_ditherSize"), _)), e.uniform3f(
|
|
234
|
-
e.getUniformLocation(x, "u_color"),
|
|
235
|
-
f[0] / 255,
|
|
236
|
-
f[1] / 255,
|
|
237
|
-
f[2] / 255
|
|
238
|
-
), e.drawArrays(e.TRIANGLES, 0, 6), e.deleteTexture(C);
|
|
239
|
-
}, l.onerror = () => {
|
|
240
|
-
console.error("Failed to load image:", m);
|
|
241
|
-
}, l.src = m;
|
|
242
|
-
}, [m, o, d, _, f, r, a]), /* @__PURE__ */ X(
|
|
243
|
-
"canvas",
|
|
244
|
-
{
|
|
245
|
-
ref: c,
|
|
246
|
-
className: L("", n),
|
|
247
|
-
"aria-label": t,
|
|
248
|
-
role: "img",
|
|
249
|
-
...i
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
);
|
|
254
|
-
O.displayName = "DitheredImage";
|
|
15
|
+
) }));
|
|
16
|
+
v.displayName = r.displayName;
|
|
255
17
|
export {
|
|
256
|
-
|
|
18
|
+
R as Popover,
|
|
19
|
+
A as PopoverAnchor,
|
|
20
|
+
v as PopoverContent,
|
|
21
|
+
x as PopoverTrigger
|
|
257
22
|
};
|
package/dist/index17.js
CHANGED
|
@@ -1,141 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Root as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
e
|
|
32
|
-
),
|
|
33
|
-
...r
|
|
34
|
-
}
|
|
35
|
-
));
|
|
36
|
-
C.displayName = g.displayName;
|
|
37
|
-
const k = s.forwardRef(({ className: e, sideOffset: r = 4, ...o }, t) => /* @__PURE__ */ a(d, { children: /* @__PURE__ */ a(
|
|
38
|
-
c,
|
|
39
|
-
{
|
|
40
|
-
ref: t,
|
|
41
|
-
sideOffset: r,
|
|
42
|
-
className: n(
|
|
43
|
-
"z-[60] min-w-[8rem] overflow-hidden border-2 border-primary bg-black p-1 text-primary",
|
|
44
|
-
e
|
|
45
|
-
),
|
|
46
|
-
...o
|
|
47
|
-
}
|
|
48
|
-
) }));
|
|
49
|
-
k.displayName = c.displayName;
|
|
50
|
-
const G = s.forwardRef(({ className: e, inset: r, ...o }, t) => /* @__PURE__ */ a(
|
|
51
|
-
u,
|
|
52
|
-
{
|
|
53
|
-
ref: t,
|
|
54
|
-
className: n(
|
|
55
|
-
"relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
56
|
-
r && "pl-8",
|
|
57
|
-
e
|
|
58
|
-
),
|
|
59
|
-
...o
|
|
60
|
-
}
|
|
61
|
-
));
|
|
62
|
-
G.displayName = u.displayName;
|
|
63
|
-
const T = s.forwardRef(({ className: e, children: r, checked: o, ...t }, i) => /* @__PURE__ */ p(
|
|
64
|
-
m,
|
|
65
|
-
{
|
|
66
|
-
ref: i,
|
|
67
|
-
className: n(
|
|
68
|
-
"relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
69
|
-
e
|
|
70
|
-
),
|
|
71
|
-
checked: o,
|
|
72
|
-
...t,
|
|
73
|
-
children: [
|
|
74
|
-
/* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a(D, { className: "h-4 w-4" }) }) }),
|
|
75
|
-
r
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
));
|
|
79
|
-
T.displayName = m.displayName;
|
|
80
|
-
const j = s.forwardRef(({ className: e, children: r, ...o }, t) => /* @__PURE__ */ p(
|
|
81
|
-
y,
|
|
82
|
-
{
|
|
83
|
-
ref: t,
|
|
84
|
-
className: n(
|
|
85
|
-
"relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
86
|
-
e
|
|
87
|
-
),
|
|
88
|
-
...o,
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a(M, { className: "h-4 w-4 fill-current" }) }) }),
|
|
91
|
-
r
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
));
|
|
95
|
-
j.displayName = y.displayName;
|
|
96
|
-
const z = s.forwardRef(({ className: e, inset: r, ...o }, t) => /* @__PURE__ */ a(
|
|
97
|
-
f,
|
|
98
|
-
{
|
|
99
|
-
ref: t,
|
|
100
|
-
className: n("px-2 py-1.5 text-sm font-semibold", r && "pl-8", e),
|
|
101
|
-
...o
|
|
102
|
-
}
|
|
103
|
-
));
|
|
104
|
-
z.displayName = f.displayName;
|
|
105
|
-
const L = s.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ a(
|
|
106
|
-
b,
|
|
107
|
-
{
|
|
108
|
-
ref: o,
|
|
109
|
-
className: n("-mx-1 my-1 h-px bg-muted", e),
|
|
110
|
-
...r
|
|
111
|
-
}
|
|
112
|
-
));
|
|
113
|
-
L.displayName = b.displayName;
|
|
114
|
-
const P = ({ className: e, ...r }) => /* @__PURE__ */ a(
|
|
115
|
-
"span",
|
|
116
|
-
{
|
|
117
|
-
className: n(
|
|
118
|
-
"ml-auto text-xs tracking-widest text-primary border border-primary px-1",
|
|
119
|
-
e
|
|
120
|
-
),
|
|
121
|
-
...r
|
|
122
|
-
}
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Root as m, Indicator as t } from "./index63.js";
|
|
3
|
+
import * as d from "react";
|
|
4
|
+
import { cx as l } from "./index2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const n = d.forwardRef(
|
|
7
|
+
({ className: c, value: e = 0, showPercentage: a = !1, label: r, ...i }, p) => /* @__PURE__ */ s("div", { className: "scl-progress-wrapper", children: [
|
|
8
|
+
(r || a) && /* @__PURE__ */ s("div", { className: "scl-progress-label", children: [
|
|
9
|
+
r && /* @__PURE__ */ o("span", { children: r }),
|
|
10
|
+
a && /* @__PURE__ */ s("span", { children: [
|
|
11
|
+
Math.round(e),
|
|
12
|
+
"%"
|
|
13
|
+
] })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ o(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
ref: p,
|
|
19
|
+
className: l("scl-progress", c),
|
|
20
|
+
...i,
|
|
21
|
+
children: /* @__PURE__ */ o(
|
|
22
|
+
t,
|
|
23
|
+
{
|
|
24
|
+
className: "scl-progress__indicator",
|
|
25
|
+
style: { width: `${e}%` }
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] })
|
|
123
31
|
);
|
|
124
|
-
|
|
32
|
+
n.displayName = "Progress";
|
|
125
33
|
export {
|
|
126
|
-
|
|
127
|
-
T as DropdownMenuCheckboxItem,
|
|
128
|
-
k as DropdownMenuContent,
|
|
129
|
-
K as DropdownMenuGroup,
|
|
130
|
-
G as DropdownMenuItem,
|
|
131
|
-
z as DropdownMenuLabel,
|
|
132
|
-
O as DropdownMenuPortal,
|
|
133
|
-
U as DropdownMenuRadioGroup,
|
|
134
|
-
j as DropdownMenuRadioItem,
|
|
135
|
-
L as DropdownMenuSeparator,
|
|
136
|
-
P as DropdownMenuShortcut,
|
|
137
|
-
Q as DropdownMenuSub,
|
|
138
|
-
C as DropdownMenuSubContent,
|
|
139
|
-
I as DropdownMenuSubTrigger,
|
|
140
|
-
J as DropdownMenuTrigger
|
|
34
|
+
n as Progress
|
|
141
35
|
};
|