@konstructio/ui 0.1.4 → 0.1.6
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/Avatar/hooks/use-gravatar-url.js +21 -16
- package/dist/components/Badge/Badge.js +13 -13
- package/dist/components/Button/Button.js +20 -19
- package/dist/components/Button/Button.variants.js +5 -2
- package/dist/components/Checkbox/Checkbox.variants.js +1 -2
- package/dist/components/Datepicker/components/DatePickerContent/DatePickerContent.js +7 -7
- package/dist/components/Sheet/Sheet.js +308 -123
- package/dist/components/Sheet/components/SheetStep/SheetStep.js +94 -0
- package/dist/components/Sheet/components/index.js +4 -0
- package/dist/components/Sheet/utils/index.js +34 -7
- package/dist/lib/components/Button/Button.types.d.ts +2 -0
- package/dist/lib/components/Button/Button.variants.d.ts +1 -0
- package/dist/lib/components/Sheet/Sheet.d.ts +10 -4
- package/dist/lib/components/Sheet/Sheet.types.d.ts +12 -0
- package/dist/lib/components/Sheet/components/SheetStep/SheetStep.d.ts +8 -0
- package/dist/lib/components/Sheet/components/SheetStep/SheetStep.types.d.ts +32 -0
- package/dist/lib/components/Sheet/components/index.d.ts +2 -0
- package/dist/lib/components/Sheet/utils/index.d.ts +17 -2
- package/dist/package.json +3 -3
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
4
|
-
if (!
|
|
5
|
-
const e = new TextEncoder().encode(r.trim().toLowerCase()),
|
|
6
|
-
return `${
|
|
7
|
-
},
|
|
8
|
-
const [
|
|
9
|
-
return
|
|
1
|
+
import { useEffect as c, useState as v } from "react";
|
|
2
|
+
var d = "https://gravatar.com/avatar", o = /* @__PURE__ */ new Map(), l = (r, t) => `${r.trim().toLowerCase()}|${t}`, f = (r) => Array.from(new Uint8Array(r)).map((t) => t.toString(16).padStart(2, "0")).join(""), h = async (r, t) => {
|
|
3
|
+
const n = globalThis.crypto?.subtle;
|
|
4
|
+
if (!n) return null;
|
|
5
|
+
const e = new TextEncoder().encode(r.trim().toLowerCase()), a = f(await n.digest("SHA-256", e));
|
|
6
|
+
return `${d}/${a}?d=404&s=${t}`;
|
|
7
|
+
}, p = (r, t) => {
|
|
8
|
+
const [n, e] = v(() => r ? o.get(l(r, t)) ?? null : null);
|
|
9
|
+
return c(() => {
|
|
10
10
|
if (!r) {
|
|
11
11
|
e(null);
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const a = l(r, t);
|
|
15
|
+
if (o.has(a)) {
|
|
16
|
+
e(o.get(a) ?? null);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let s = !1;
|
|
20
|
+
return h(r, t).then((u) => {
|
|
21
|
+
o.set(a, u), s || e(u);
|
|
17
22
|
}), () => {
|
|
18
|
-
|
|
23
|
+
s = !0;
|
|
19
24
|
};
|
|
20
|
-
}, [r, t]),
|
|
25
|
+
}, [r, t]), n;
|
|
21
26
|
};
|
|
22
27
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
h as buildGravatarUrl,
|
|
29
|
+
p as useGravatarUrl
|
|
25
30
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { t as x } from "../../x-C8O1IsaM.js";
|
|
2
2
|
import { LoaderIcon as D } from "../../assets/icons/components/Loader.js";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as c } from "../../utils-DnIJruo0.js";
|
|
4
4
|
import { badgeVariants as V, buttonDismissVariants as j } from "./Badge.variants.js";
|
|
5
5
|
import { t as f } from "../../dist-CK8FUUUn.js";
|
|
6
6
|
import { useEffect as E, useRef as L, useState as P } from "react";
|
|
7
7
|
import { jsx as s, jsxs as p } from "react/jsx-runtime";
|
|
8
|
-
var q = ({ className: b, dismissible:
|
|
9
|
-
const
|
|
10
|
-
a.stopPropagation(),
|
|
8
|
+
var q = ({ className: b, dismissible: g = !1, isSelectable: h = !0, label: i, leftIcon: n, loading: o = !1, rightIcon: l, size: m, variant: d, onClick: e, onDismiss: v }) => {
|
|
9
|
+
const u = L(null), [r, N] = P("visible"), y = (a) => {
|
|
10
|
+
a.stopPropagation(), v?.(), N("hidden");
|
|
11
11
|
};
|
|
12
12
|
return E(() => {
|
|
13
13
|
if (r !== "hidden") return;
|
|
14
|
-
const a = new AbortController(), t =
|
|
14
|
+
const a = new AbortController(), t = u.current;
|
|
15
15
|
return t?.addEventListener("animationend", (w) => {
|
|
16
16
|
w.target === t && (t.style.setProperty("display", "none"), t.remove());
|
|
17
17
|
}, { signal: a.signal }), () => a.abort();
|
|
18
18
|
}, [r]), /* @__PURE__ */ p("span", {
|
|
19
|
-
ref:
|
|
20
|
-
className:
|
|
21
|
-
variant:
|
|
19
|
+
ref: u,
|
|
20
|
+
className: c(V({
|
|
21
|
+
variant: d,
|
|
22
22
|
size: m,
|
|
23
23
|
className: b
|
|
24
24
|
}), {
|
|
25
|
-
"select-none": !
|
|
26
|
-
"cursor-pointer tap-target outline-none focus-visible:ring-1 focus-visible:ring-aurora-500
|
|
25
|
+
"select-none": !h,
|
|
26
|
+
"cursor-pointer tap-target outline-none focus-visible:ring-1 focus-visible:ring-aurora-500 pointer-coarse:motion-safe:active:scale-95": e
|
|
27
27
|
}),
|
|
28
28
|
role: e ? "button" : void 0,
|
|
29
29
|
onClick: e,
|
|
@@ -42,11 +42,11 @@ var q = ({ className: b, dismissible: v = !1, isSelectable: g = !0, label: i, le
|
|
|
42
42
|
children: n
|
|
43
43
|
}) : null,
|
|
44
44
|
i,
|
|
45
|
-
|
|
45
|
+
g ? /* @__PURE__ */ p("button", {
|
|
46
46
|
type: "button",
|
|
47
|
-
className:
|
|
47
|
+
className: c(j({
|
|
48
48
|
size: m,
|
|
49
|
-
variant:
|
|
49
|
+
variant: d
|
|
50
50
|
})),
|
|
51
51
|
onClick: y,
|
|
52
52
|
"aria-label": "Dismiss",
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import { buttonVariants as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
7
|
-
const
|
|
1
|
+
import { t as b } from "../../dist-CK8FUUUn.js";
|
|
2
|
+
import { t as l } from "../../utils-DnIJruo0.js";
|
|
3
|
+
import { buttonVariants as v } from "./Button.variants.js";
|
|
4
|
+
import { forwardRef as B } from "react";
|
|
5
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
6
|
+
var j = B(({ appearance: r, asChild: o = !1, className: e, disabled: t = !1, pressEffect: n = !0, shape: a, size: m, theme: s, variant: p, version: f, ...u }, i) => {
|
|
7
|
+
const c = o ? b : "button", x = o && t ? {
|
|
8
8
|
"aria-disabled": !0,
|
|
9
9
|
tabIndex: -1
|
|
10
10
|
} : { disabled: t };
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
ref:
|
|
13
|
-
"data-theme":
|
|
14
|
-
className:
|
|
11
|
+
return /* @__PURE__ */ N(c, {
|
|
12
|
+
ref: i,
|
|
13
|
+
"data-theme": s,
|
|
14
|
+
className: l(v({
|
|
15
15
|
appearance: r,
|
|
16
|
-
className:
|
|
16
|
+
className: e,
|
|
17
17
|
disabled: t,
|
|
18
|
+
pressEffect: n,
|
|
18
19
|
shape: a,
|
|
19
|
-
size:
|
|
20
|
-
variant:
|
|
21
|
-
version:
|
|
20
|
+
size: m,
|
|
21
|
+
variant: p,
|
|
22
|
+
version: f
|
|
22
23
|
}), o && t && "pointer-events-none"),
|
|
23
|
-
...
|
|
24
|
-
...
|
|
24
|
+
...x,
|
|
25
|
+
...u
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
j.displayName = "KonstructButton";
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
j as Button
|
|
30
31
|
};
|
|
@@ -20,8 +20,6 @@ var a = r([
|
|
|
20
20
|
"rounded",
|
|
21
21
|
"transition-[color,background-color,border-color,transform]",
|
|
22
22
|
"duration-150",
|
|
23
|
-
"active:scale-[0.97]",
|
|
24
|
-
"motion-reduce:active:scale-100",
|
|
25
23
|
"whitespace-nowrap",
|
|
26
24
|
"h-10",
|
|
27
25
|
"pointer-coarse:min-h-11",
|
|
@@ -41,6 +39,10 @@ var a = r([
|
|
|
41
39
|
"kubefirst:text-white"
|
|
42
40
|
], {
|
|
43
41
|
variants: {
|
|
42
|
+
pressEffect: {
|
|
43
|
+
true: "pointer-coarse:motion-safe:active:scale-[0.97]",
|
|
44
|
+
false: ""
|
|
45
|
+
},
|
|
44
46
|
variant: {
|
|
45
47
|
primary: "",
|
|
46
48
|
secondary: ["bg-white"],
|
|
@@ -322,6 +324,7 @@ var a = r([
|
|
|
322
324
|
}
|
|
323
325
|
],
|
|
324
326
|
defaultVariants: {
|
|
327
|
+
pressEffect: !0,
|
|
325
328
|
variant: "primary",
|
|
326
329
|
version: "default",
|
|
327
330
|
disabled: !1,
|
|
@@ -9,8 +9,7 @@ var t = e([
|
|
|
9
9
|
"focus-visible:outline-2",
|
|
10
10
|
"focus-visible:outline-offset-2",
|
|
11
11
|
"focus-visible:outline-aurora-500",
|
|
12
|
-
"active:scale-90",
|
|
13
|
-
"motion-reduce:active:scale-100",
|
|
12
|
+
"pointer-coarse:motion-safe:active:scale-90",
|
|
14
13
|
"border",
|
|
15
14
|
"rounded",
|
|
16
15
|
"w-5",
|
|
@@ -6,22 +6,22 @@ import { t as k } from "../../../../chevron-right-D4OkgIIT.js";
|
|
|
6
6
|
import '../../../../style.css';/* empty css */
|
|
7
7
|
import { useState as g } from "react";
|
|
8
8
|
import { jsx as a } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
const [
|
|
9
|
+
var w = ({ className: o, showOutsideDays: n = !0, animate: l = !0, arrowClassName: s, monthsClassName: d, defaultSelected: i, onSelect: m, ...u }) => {
|
|
10
|
+
const [c, x] = g(() => i), b = (e) => {
|
|
11
11
|
e && (x(e), m?.(e));
|
|
12
12
|
};
|
|
13
13
|
return /* @__PURE__ */ a(f, {
|
|
14
14
|
className: t(h({ className: o })),
|
|
15
15
|
animate: l,
|
|
16
16
|
mode: "single",
|
|
17
|
-
selected:
|
|
17
|
+
selected: c,
|
|
18
18
|
onSelect: b,
|
|
19
19
|
showOutsideDays: n,
|
|
20
20
|
role: "dialog",
|
|
21
21
|
"aria-label": "Datepicker",
|
|
22
22
|
classNames: {
|
|
23
23
|
chevron: t("cursor-pointer", "text-slate-500", "w-5", "h-5", "text-slate-500", "w-4", "h-4", "dark:text-metal-200"),
|
|
24
|
-
day_button: t("h-7.5", "aria-selected:opacity-100", "font-semibold", "hover:rounded-full", "cursor-pointer", "tap-target", "rounded-full", "w-7.5", "pointer-coarse:size-10", "
|
|
24
|
+
day_button: t("h-7.5", "aria-selected:opacity-100", "font-semibold", "hover:rounded-full", "cursor-pointer", "tap-target", "rounded-full", "w-7.5", "pointer-coarse:size-10", "pointer-coarse:motion-safe:active:scale-90", "transition-transform"),
|
|
25
25
|
day: "text-center text-sm leading-5",
|
|
26
26
|
month_caption: t("text-slate-700", "font-semibold", "text-sm", "pl-1", "h-8", "flex", "items-center", "dark:text-white"),
|
|
27
27
|
months: t("flex", "flex-col", "relative", "px-5", "py-4", "rounded-lg", "shadow-md", "px-6", "py-4", "w-[307px]", "justify-center", "items-center", "border", "border-transparent", "dark:bg-metal-800", "dark:border-metal-700", d),
|
|
@@ -42,10 +42,10 @@ var v = ({ className: o, showOutsideDays: n = !0, animate: l = !0, arrowClassNam
|
|
|
42
42
|
className: t(e),
|
|
43
43
|
...r
|
|
44
44
|
}) },
|
|
45
|
-
...
|
|
45
|
+
...u
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
w.displayName = "DatePickerContent";
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
w as DatePickerContent
|
|
51
51
|
};
|