@solibo/solibo-ui 2.1.2 → 2.2.1
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/assets/Degular.woff2 +0 -0
- package/dist/assets/Geist.woff2 +0 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index49.css +1 -1
- package/dist/assets/index50.css +1 -1
- package/dist/assets/index51.css +1 -1
- package/dist/assets/index52.css +1 -1
- package/dist/assets/index53.css +1 -1
- package/dist/assets/index54.css +1 -1
- package/dist/assets/index55.css +1 -1
- package/dist/assets/index56.css +1 -0
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/menu-popover.css +1 -1
- package/dist/components/app-link/index.cjs +1 -1
- package/dist/components/app-link/index.js +1 -1
- package/dist/components/app-shell/index.cjs +1 -1
- package/dist/components/app-shell/index.js +3 -3
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +5 -5
- package/dist/components/avatar/index.cjs +1 -1
- package/dist/components/avatar/index.js +30 -30
- package/dist/components/badge/index.cjs +1 -1
- package/dist/components/badge/index.js +41 -39
- package/dist/components/banner/index.cjs +1 -1
- package/dist/components/banner/index.js +4 -4
- package/dist/components/branding/index.cjs +1 -1
- package/dist/components/branding/index.js +2 -2
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +29 -29
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +57 -49
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +5 -5
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +25 -25
- package/dist/components/collapsible/index.cjs +1 -1
- package/dist/components/collapsible/index.js +34 -18
- package/dist/components/controls/index.cjs +2 -2
- package/dist/components/controls/index.js +11 -11
- package/dist/components/croppable/index.cjs +1 -1
- package/dist/components/croppable/index.js +269 -233
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.js +38 -38
- package/dist/components/divider/index.cjs +1 -1
- package/dist/components/divider/index.js +3 -3
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +90 -90
- package/dist/components/dropzone/index.cjs +1 -1
- package/dist/components/dropzone/index.js +11 -11
- package/dist/components/editor/index.cjs +1 -55
- package/dist/components/editor/index.js +403 -16299
- package/dist/components/fieldset/index.cjs +1 -1
- package/dist/components/fieldset/index.js +3 -3
- package/dist/components/figure/index.cjs +1 -1
- package/dist/components/figure/index.js +14 -12
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.js +1 -1
- package/dist/components/footer/index.cjs +1 -1
- package/dist/components/footer/index.js +12 -8
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +9 -9
- package/dist/components/graph/index.cjs +1 -1
- package/dist/components/graph/index.js +12 -12
- package/dist/components/group/index.cjs +1 -1
- package/dist/components/group/index.js +38 -11
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +49 -32
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +7 -7
- package/dist/components/iframe/index.cjs +1 -1
- package/dist/components/iframe/index.js +71 -66
- package/dist/components/image/index.cjs +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +3 -3
- package/dist/components/link/index.cjs +1 -1
- package/dist/components/link/index.js +27 -14
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.js +62 -58
- package/dist/components/loading/index.cjs +1 -1
- package/dist/components/loading/index.js +5 -5
- package/dist/components/menu/index.cjs +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.js +2 -2
- package/dist/components/messages/index.cjs +1 -1
- package/dist/components/messages/index.js +6 -6
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +31 -29
- package/dist/components/object/index.cjs +1 -1
- package/dist/components/object/index.js +1 -1
- package/dist/components/page-layout/index.cjs +1 -1
- package/dist/components/page-layout/index.js +33 -20
- package/dist/components/panel/index.cjs +2 -0
- package/dist/components/panel/index.js +25 -0
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +35 -35
- package/dist/components/portal/index.cjs +1 -1
- package/dist/components/portal/index.js +22 -22
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +50 -50
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +3 -3
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.js +49 -49
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.js +29 -27
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +10 -10
- package/dist/components/toolbar/index.cjs +1 -1
- package/dist/components/toolbar/index.js +3 -3
- package/dist/components/tooltip/index.cjs +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/widget/index.cjs +1 -1
- package/dist/components/widget/index.js +22 -13
- package/dist/icons-BIdcCH-v.cjs +2 -0
- package/dist/{icons-CTtWkF6z.js → icons-DVeBguFb.js} +6 -3
- package/dist/index-7blZaPiA.cjs +2 -0
- package/dist/{index-CMPTHneU.js → index-Dd20d_9U.js} +9 -9
- package/dist/{index-BIpgkB-u.js → index-Dx-KtGBg.js} +12 -12
- package/dist/index-VLDsM9it.cjs +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +391 -17
- package/dist/index.js +59 -56
- package/dist/menu-popover-Ceb_9V67.js +77 -0
- package/dist/menu-popover-bqblnK6P.cjs +2 -0
- package/dist/styles/fonts.css +11 -0
- package/dist/tokens.json +1 -1
- package/package.json +15 -8
- package/dist/classix-5H4IWnMA.cjs +0 -2
- package/dist/classix-5H4IWnMA.cjs.map +0 -1
- package/dist/classix-DG18itHa.js +0 -9
- package/dist/classix-DG18itHa.js.map +0 -1
- package/dist/components/app-link/index.cjs.map +0 -1
- package/dist/components/app-link/index.js.map +0 -1
- package/dist/components/app-shell/index.cjs.map +0 -1
- package/dist/components/app-shell/index.js.map +0 -1
- package/dist/components/aside/index.cjs.map +0 -1
- package/dist/components/aside/index.js.map +0 -1
- package/dist/components/avatar/index.cjs.map +0 -1
- package/dist/components/avatar/index.js.map +0 -1
- package/dist/components/badge/index.cjs.map +0 -1
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/banner/index.cjs.map +0 -1
- package/dist/components/banner/index.js.map +0 -1
- package/dist/components/branding/index.cjs.map +0 -1
- package/dist/components/branding/index.js.map +0 -1
- package/dist/components/button/index.cjs.map +0 -1
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/card/index.cjs.map +0 -1
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/checkbox/index.cjs.map +0 -1
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/chip/index.cjs.map +0 -1
- package/dist/components/chip/index.js.map +0 -1
- package/dist/components/clipboard/index.cjs.map +0 -1
- package/dist/components/clipboard/index.js.map +0 -1
- package/dist/components/collapsible/index.cjs.map +0 -1
- package/dist/components/collapsible/index.js.map +0 -1
- package/dist/components/controls/index.cjs.map +0 -1
- package/dist/components/controls/index.js.map +0 -1
- package/dist/components/croppable/index.cjs.map +0 -1
- package/dist/components/croppable/index.js.map +0 -1
- package/dist/components/dialog/index.cjs.map +0 -1
- package/dist/components/dialog/index.js.map +0 -1
- package/dist/components/divider/index.cjs.map +0 -1
- package/dist/components/divider/index.js.map +0 -1
- package/dist/components/dropdown/index.cjs.map +0 -1
- package/dist/components/dropdown/index.js.map +0 -1
- package/dist/components/dropzone/index.cjs.map +0 -1
- package/dist/components/dropzone/index.js.map +0 -1
- package/dist/components/editor/index.cjs.map +0 -1
- package/dist/components/editor/index.js.map +0 -1
- package/dist/components/empty-state/index.cjs.map +0 -1
- package/dist/components/empty-state/index.js.map +0 -1
- package/dist/components/fieldset/index.cjs.map +0 -1
- package/dist/components/fieldset/index.js.map +0 -1
- package/dist/components/figure/index.cjs.map +0 -1
- package/dist/components/figure/index.js.map +0 -1
- package/dist/components/file/index.cjs.map +0 -1
- package/dist/components/file/index.js.map +0 -1
- package/dist/components/footer/index.cjs.map +0 -1
- package/dist/components/footer/index.js.map +0 -1
- package/dist/components/form/index.cjs.map +0 -1
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/graph/index.cjs.map +0 -1
- package/dist/components/graph/index.js.map +0 -1
- package/dist/components/group/index.cjs.map +0 -1
- package/dist/components/group/index.js.map +0 -1
- package/dist/components/header/index.cjs.map +0 -1
- package/dist/components/header/index.js.map +0 -1
- package/dist/components/icon/index.cjs.map +0 -1
- package/dist/components/icon/index.js.map +0 -1
- package/dist/components/iframe/index.cjs.map +0 -1
- package/dist/components/iframe/index.js.map +0 -1
- package/dist/components/image/index.cjs.map +0 -1
- package/dist/components/image/index.js.map +0 -1
- package/dist/components/input/index.cjs.map +0 -1
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/link/index.cjs.map +0 -1
- package/dist/components/link/index.js.map +0 -1
- package/dist/components/list/index.cjs.map +0 -1
- package/dist/components/list/index.js.map +0 -1
- package/dist/components/loading/index.cjs.map +0 -1
- package/dist/components/loading/index.js.map +0 -1
- package/dist/components/menu/index.cjs.map +0 -1
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/message/index.cjs.map +0 -1
- package/dist/components/message/index.js.map +0 -1
- package/dist/components/messages/index.cjs.map +0 -1
- package/dist/components/messages/index.js.map +0 -1
- package/dist/components/nav/index.cjs.map +0 -1
- package/dist/components/nav/index.js.map +0 -1
- package/dist/components/object/index.cjs.map +0 -1
- package/dist/components/object/index.js.map +0 -1
- package/dist/components/page-layout/index.cjs.map +0 -1
- package/dist/components/page-layout/index.js.map +0 -1
- package/dist/components/popover/index.cjs.map +0 -1
- package/dist/components/popover/index.js.map +0 -1
- package/dist/components/portal/index.cjs.map +0 -1
- package/dist/components/portal/index.js.map +0 -1
- package/dist/components/search/index.cjs.map +0 -1
- package/dist/components/search/index.js.map +0 -1
- package/dist/components/select/index.cjs.map +0 -1
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/sortable/index.cjs.map +0 -1
- package/dist/components/sortable/index.js.map +0 -1
- package/dist/components/table/index.cjs.map +0 -1
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/textarea/index.cjs.map +0 -1
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/toast/index.cjs.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toasts/index.cjs.map +0 -1
- package/dist/components/toasts/index.js.map +0 -1
- package/dist/components/toggle/index.cjs.map +0 -1
- package/dist/components/toggle/index.js.map +0 -1
- package/dist/components/toolbar/index.cjs.map +0 -1
- package/dist/components/toolbar/index.js.map +0 -1
- package/dist/components/tooltip/index.cjs.map +0 -1
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/widget/index.cjs.map +0 -1
- package/dist/components/widget/index.js.map +0 -1
- package/dist/icons-B3hIY9Bm.cjs +0 -2
- package/dist/icons-B3hIY9Bm.cjs.map +0 -1
- package/dist/icons-CTtWkF6z.js.map +0 -1
- package/dist/index-BIpgkB-u.js.map +0 -1
- package/dist/index-Bbauu1No.cjs +0 -2
- package/dist/index-Bbauu1No.cjs.map +0 -1
- package/dist/index-CMPTHneU.js.map +0 -1
- package/dist/index-DAjU2bTe.cjs +0 -2
- package/dist/index-DAjU2bTe.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/menu-popover-BV7nUXlb.js +0 -77
- package/dist/menu-popover-BV7nUXlb.js.map +0 -1
- package/dist/menu-popover-fGpFDJTo.cjs +0 -2
- package/dist/menu-popover-fGpFDJTo.cjs.map +0 -1
- package/dist/use-touched-B999bBr8.js.map +0 -1
- package/dist/use-touched-Bq5Gjbpz.cjs.map +0 -1
|
@@ -1,59 +1,67 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { Figure as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import '../../assets/index32.css';const
|
|
8
|
-
card:
|
|
9
|
-
head:
|
|
10
|
-
center:
|
|
11
|
-
content:
|
|
12
|
-
preview:
|
|
13
|
-
"preview-leading": "_preview-
|
|
14
|
-
"preview-trailing": "_preview-
|
|
15
|
-
"preview-content": "_preview-
|
|
16
|
-
margin:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"image-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import s from "classix";
|
|
3
|
+
import { Badge as T } from "../badge/index.js";
|
|
4
|
+
import { Checkbox as $ } from "../checkbox/index.js";
|
|
5
|
+
import { Figure as j } from "../figure/index.js";
|
|
6
|
+
import { Icon as k } from "../icon/index.js";
|
|
7
|
+
import '../../assets/index32.css';const z = "_card_1pyj3_1", B = "_head_1pyj3_28", F = "_center_1pyj3_40", q = "_content_1pyj3_52", x = "_preview_1pyj3_58", A = "_margin_1pyj3_98", C = "_outlined_1pyj3_142", G = "_clickable_1pyj3_148", H = "_muted_1pyj3_159", J = "_selected_1pyj3_164", e = {
|
|
8
|
+
card: z,
|
|
9
|
+
head: B,
|
|
10
|
+
center: F,
|
|
11
|
+
content: q,
|
|
12
|
+
preview: x,
|
|
13
|
+
"preview-leading": "_preview-leading_1pyj3_69",
|
|
14
|
+
"preview-trailing": "_preview-trailing_1pyj3_70",
|
|
15
|
+
"preview-content": "_preview-content_1pyj3_90",
|
|
16
|
+
margin: A,
|
|
17
|
+
outlined: C,
|
|
18
|
+
clickable: G,
|
|
19
|
+
muted: H,
|
|
20
|
+
selected: J,
|
|
21
|
+
"image-top": "_image-top_1pyj3_169",
|
|
22
|
+
"image-left": "_image-left_1pyj3_180"
|
|
23
|
+
}, U = ({
|
|
24
|
+
appearance: y = "default",
|
|
25
|
+
actions: v,
|
|
24
26
|
badge: o,
|
|
25
|
-
checkbox:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
checkbox: i,
|
|
28
|
+
className: N,
|
|
29
|
+
children: u,
|
|
30
|
+
emphasis: f = "default",
|
|
31
|
+
fullWidth: h = !1,
|
|
32
|
+
header: p,
|
|
33
|
+
icon: g,
|
|
34
|
+
image: l,
|
|
35
|
+
imagePosition: r = "top",
|
|
36
|
+
onClick: c,
|
|
37
|
+
onKeyDown: _,
|
|
38
|
+
preview: d,
|
|
39
|
+
selected: w = (i == null ? void 0 : i.checked) ?? !1,
|
|
40
|
+
tabIndex: E,
|
|
41
|
+
variant: a = "default",
|
|
42
|
+
...I
|
|
43
|
+
}) => /* @__PURE__ */ m("article", { className: s(e.card, y === "outlined" && e.outlined, f === "muted" && e.muted, c && e.clickable, w && e.selected, N), "data-emphasis": f, "data-minimal": a === "minimal", "data-span": h ? "all" : void 0, ...I, onClick: c, onKeyDown: (n) => {
|
|
44
|
+
_ == null || _(n), !(n.defaultPrevented || !c) && n.currentTarget === document.activeElement && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.currentTarget.click());
|
|
45
|
+
}, tabIndex: E ?? (c ? 0 : -1), "data-component": "card", children: [
|
|
46
|
+
l && a !== "minimal" && r === "top" && /* @__PURE__ */ t(j, { className: e[`image-${r}`], children: l }),
|
|
39
47
|
/* @__PURE__ */ m("section", { children: [
|
|
40
|
-
/* @__PURE__ */ m("div", { className:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
o && /* @__PURE__ */ t(
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
/* @__PURE__ */ m("div", { className: s(e.head, a === "minimal" && e.center), children: [
|
|
49
|
+
i && /* @__PURE__ */ t("span", { onClick: (n) => n.stopPropagation(), children: /* @__PURE__ */ t($, { ...i }) }),
|
|
50
|
+
l && a !== "minimal" && r === "left" && /* @__PURE__ */ t(j, { className: e[`image-${r}`], children: l }),
|
|
51
|
+
p,
|
|
52
|
+
o && /* @__PURE__ */ t(T, { ...o }),
|
|
53
|
+
g && /* @__PURE__ */ t(k, { name: g, size: "medium" }),
|
|
54
|
+
v
|
|
47
55
|
] }),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */ t("span", { className: e["preview-leading"], children:
|
|
51
|
-
/* @__PURE__ */ t("span", { className: e["preview-content"], children:
|
|
52
|
-
/* @__PURE__ */ t("span", { className: e["preview-trailing"], children:
|
|
56
|
+
u && a !== "minimal" && /* @__PURE__ */ t("div", { className: s(e.content, !!p && e.margin), children: u }),
|
|
57
|
+
d && a !== "minimal" && /* @__PURE__ */ m("div", { className: s(e.preview, !!p && e.margin), children: [
|
|
58
|
+
/* @__PURE__ */ t("span", { className: e["preview-leading"], children: d.leading }),
|
|
59
|
+
/* @__PURE__ */ t("span", { className: e["preview-content"], children: d.children }),
|
|
60
|
+
/* @__PURE__ */ t("span", { className: e["preview-trailing"], children: d.trailing })
|
|
53
61
|
] })
|
|
54
62
|
] })
|
|
55
63
|
] });
|
|
56
64
|
export {
|
|
57
|
-
|
|
65
|
+
U as Card
|
|
58
66
|
};
|
|
59
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-BIdcCH-v.cjs"),b=require("../loading/index.cjs"),h="_checkbox_3o7pi_3",l={checkbox:h},a=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("Check")};return e.jsxs("label",{className:l.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:"small",sticky:!0}),o&&o]})};exports.Checkbox=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { i as x } from "../../icons-
|
|
2
|
+
import { i as x } from "../../icons-DVeBguFb.js";
|
|
3
3
|
import { Loading as k } from "../loading/index.js";
|
|
4
|
-
import '../../assets/index33.css';const m = "
|
|
4
|
+
import '../../assets/index33.css';const m = "_checkbox_3o7pi_3", a = {
|
|
5
5
|
checkbox: m
|
|
6
6
|
}, d = ({
|
|
7
7
|
checked: s,
|
|
8
8
|
disabled: t,
|
|
9
9
|
isLoading: c,
|
|
10
10
|
label: o,
|
|
11
|
-
onChange:
|
|
12
|
-
...
|
|
11
|
+
onChange: i,
|
|
12
|
+
...r
|
|
13
13
|
}) => {
|
|
14
14
|
const n = {
|
|
15
15
|
"--icon-svg": x("Check")
|
|
16
16
|
};
|
|
17
17
|
return /* @__PURE__ */ h("label", { className: a.checkbox, "data-component": "checkbox", children: [
|
|
18
|
-
/* @__PURE__ */ e("input", { checked: s, disabled: t || c, onChange:
|
|
18
|
+
/* @__PURE__ */ e("input", { checked: s, disabled: t || c, onChange: i, type: "checkbox", style: n, ...r }),
|
|
19
19
|
c && /* @__PURE__ */ e(k, { size: "small", sticky: !0 }),
|
|
20
20
|
o && o
|
|
21
21
|
] });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index34.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index34.css');const e=require("react/jsx-runtime"),t=require("classix"),d=require("../icon/index.cjs"),p=require("../button/index.cjs"),_=require("../link/index.cjs"),h="_chip_zhdgo_1",m="_clickable_zhdgo_22",u="_divider_zhdgo_39",k="_link_zhdgo_47",i={chip:h,clickable:m,delete:"_delete_zhdgo_35",divider:u,link:k},x=({accessibleLabel:o,className:s,label:c,link:a,onDelete:l,...r})=>e.jsx(e.Fragment,{children:a?e.jsxs("span",{className:t(i.chip,s),...r,"data-component":"chip",children:[e.jsx(_.Link,{className:t(i.link,i.clickable),onClick:n=>n.stopPropagation(),to:a,children:c}),e.jsx("span",{"aria-hidden":"true",className:i.divider}),e.jsx(p.Button,{"aria-label":o??`Delete ${c}`,className:t(i.delete,i.clickable),icon:"X",onClick:n=>{n.stopPropagation(),l()},variant:"simple"})]}):e.jsxs("button",{...r,"aria-label":o??`Delete ${c}`,className:t(i.chip,i.clickable,s),onClick:n=>{n.stopPropagation(),l()},type:"button","data-component":"chip",children:[c,e.jsx(d.Icon,{name:"X",size:"small"})]})});exports.Chip=x;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Link as
|
|
6
|
-
import '../../assets/index34.css';const
|
|
7
|
-
chip:
|
|
8
|
-
clickable:
|
|
9
|
-
delete: "
|
|
10
|
-
divider:
|
|
11
|
-
link:
|
|
1
|
+
import { jsx as c, Fragment as s, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import e from "classix";
|
|
3
|
+
import { Icon as m } from "../icon/index.js";
|
|
4
|
+
import { Button as h } from "../button/index.js";
|
|
5
|
+
import { Link as _ } from "../link/index.js";
|
|
6
|
+
import '../../assets/index34.css';const k = "_chip_zhdgo_1", g = "_clickable_zhdgo_22", z = "_divider_zhdgo_39", b = "_link_zhdgo_47", i = {
|
|
7
|
+
chip: k,
|
|
8
|
+
clickable: g,
|
|
9
|
+
delete: "_delete_zhdgo_35",
|
|
10
|
+
divider: z,
|
|
11
|
+
link: b
|
|
12
12
|
}, N = ({
|
|
13
|
-
accessibleLabel:
|
|
14
|
-
className:
|
|
15
|
-
label:
|
|
13
|
+
accessibleLabel: n,
|
|
14
|
+
className: a,
|
|
15
|
+
label: t,
|
|
16
16
|
link: l,
|
|
17
17
|
onDelete: r,
|
|
18
|
-
...
|
|
19
|
-
}) => /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
18
|
+
...d
|
|
19
|
+
}) => /* @__PURE__ */ c(s, { children: l ? /* @__PURE__ */ p("span", { className: e(i.chip, a), ...d, "data-component": "chip", children: [
|
|
20
|
+
/* @__PURE__ */ c(_, { className: e(i.link, i.clickable), onClick: (o) => o.stopPropagation(), to: l, children: t }),
|
|
21
|
+
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: i.divider }),
|
|
22
|
+
/* @__PURE__ */ c(h, { "aria-label": n ?? `Delete ${t}`, className: e(i.delete, i.clickable), icon: "X", onClick: (o) => {
|
|
23
|
+
o.stopPropagation(), r();
|
|
24
24
|
}, variant: "simple" })
|
|
25
|
-
] }) : /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
}, type: "button", children: [
|
|
28
|
-
|
|
29
|
-
/* @__PURE__ */
|
|
25
|
+
] }) : /* @__PURE__ */ p("button", { ...d, "aria-label": n ?? `Delete ${t}`, className: e(i.chip, i.clickable, a), onClick: (o) => {
|
|
26
|
+
o.stopPropagation(), r();
|
|
27
|
+
}, type: "button", "data-component": "chip", children: [
|
|
28
|
+
t,
|
|
29
|
+
/* @__PURE__ */ c(m, { name: "X", size: "small" })
|
|
30
30
|
] }) });
|
|
31
31
|
export {
|
|
32
32
|
N as Chip
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index36.css');const n=require("react/jsx-runtime"),l=require("../icon/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index36.css');const n=require("react/jsx-runtime"),l=require("react"),u=require("../icon/index.cjs"),f="_collapsible_1nzgt_1",m="_content_1nzgt_12",b="_indicator_1nzgt_16",i={collapsible:f,content:m,indicator:b},v=({children:a,disabled:r,open:d,summary:p})=>{const s=l.useRef(null);return l.useEffect(()=>{const t=s.current;if(!t)return;let e;const c=()=>{e===void 0&&(e=t.open,t.open=!0)},o=()=>{e!==void 0&&(t.open=e,e=void 0)};return window.addEventListener("beforeprint",c),window.addEventListener("afterprint",o),()=>{window.removeEventListener("beforeprint",c),window.removeEventListener("afterprint",o),o()}},[]),n.jsxs("details",{ref:s,className:i.collapsible,open:r||d||void 0,"data-component":"collapsible",children:[n.jsxs("summary",{children:[n.jsx("span",{className:i.content,"data-content":"collapsible-summary",children:p}),!r&&n.jsx("span",{className:i.indicator,"data-content":"collapsible-indicator",children:n.jsx(u.Icon,{name:"CaretDown",size:"medium"})})]}),a]})};exports.Collapsible=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as f } from "react";
|
|
3
|
+
import { Icon as u } from "../icon/index.js";
|
|
4
|
+
import '../../assets/index36.css';const b = "_collapsible_1nzgt_1", v = "_content_1nzgt_12", w = "_indicator_1nzgt_16", r = {
|
|
5
|
+
collapsible: b,
|
|
6
|
+
content: v,
|
|
7
|
+
indicator: w
|
|
8
|
+
}, z = ({
|
|
8
9
|
children: l,
|
|
9
|
-
disabled:
|
|
10
|
-
open:
|
|
11
|
-
summary:
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
disabled: i,
|
|
11
|
+
open: d,
|
|
12
|
+
summary: p
|
|
13
|
+
}) => {
|
|
14
|
+
const s = m(null);
|
|
15
|
+
return f(() => {
|
|
16
|
+
const n = s.current;
|
|
17
|
+
if (!n) return;
|
|
18
|
+
let e;
|
|
19
|
+
const a = () => {
|
|
20
|
+
e === void 0 && (e = n.open, n.open = !0);
|
|
21
|
+
}, t = () => {
|
|
22
|
+
e !== void 0 && (n.open = e, e = void 0);
|
|
23
|
+
};
|
|
24
|
+
return window.addEventListener("beforeprint", a), window.addEventListener("afterprint", t), () => {
|
|
25
|
+
window.removeEventListener("beforeprint", a), window.removeEventListener("afterprint", t), t();
|
|
26
|
+
};
|
|
27
|
+
}, []), /* @__PURE__ */ c("details", { ref: s, className: r.collapsible, open: i || d || void 0, "data-component": "collapsible", children: [
|
|
28
|
+
/* @__PURE__ */ c("summary", { children: [
|
|
29
|
+
/* @__PURE__ */ o("span", { className: r.content, "data-content": "collapsible-summary", children: p }),
|
|
30
|
+
!i && /* @__PURE__ */ o("span", { className: r.indicator, "data-content": "collapsible-indicator", children: /* @__PURE__ */ o(u, { name: "CaretDown", size: "medium" }) })
|
|
31
|
+
] }),
|
|
32
|
+
l
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
19
35
|
export {
|
|
20
|
-
|
|
36
|
+
z as Collapsible
|
|
21
37
|
};
|
|
22
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const b=require("react/jsx-runtime"),Z=require("
|
|
2
|
-
`),[D,G]=l.useState(k);D!==k&&(G(k),C(f));const g=l.useCallback(()=>{var L,I,T;if(!a){C(f);return}const e=u.current,d=z.current;if(!e||!d)return;const W=Array.from(d.querySelectorAll('[data-component="button"]')),w=W.at(-1);if(!w)return;const v=W.slice(0,c.length).map(t=>t.getBoundingClientRect().width);if(v.length!==c.length)return;const m=getComputedStyle(e),H=p(m,"paddingLeft")+p(m,"paddingRight")+p(m,"borderLeftWidth")+p(m,"borderRightWidth"),J=ue(m.maxWidth),B=r==="embedded"?me(e,N.current):void 0;B&&(N.current=B);const Q=(B==null?void 0:B.availableWidth)??((L=e.parentElement)==null?void 0:L.clientWidth)??0,U=((I=window.visualViewport)==null?void 0:I.width)??document.documentElement.clientWidth,V=Math.min(...[J,Q,U].filter(t=>typeof t=="number"&&Number.isFinite(t)&&t>0));if(!Number.isFinite(V))return;const q=Math.max(0,V-H),P=((T=E.current)==null?void 0:T.getBoundingClientRect().width)??0,X=v.reduce((t,Y)=>t+Y,0);if(f===c.length&&P+X<=q){C(t=>t===f?t:f);return}let K=P+w.getBoundingClientRect().width,j=0;for(let t=0;t<f&&!(K+v[t]>q);t+=1)K+=v[t],j=t+1;C(t=>t===j?t:j)},[a,c.length,r,f]);if(l.useLayoutEffect(()=>{var d,W,w,v;if(g(),!a)return;const e=typeof ResizeObserver>"u"?void 0:new ResizeObserver(g);return u.current&&(e==null||e.observe(u.current)),(d=u.current)!=null&&d.parentElement&&(e==null||e.observe(u.current.parentElement)),r==="embedded"&&((W=u.current)!=null&&W.parentElement)&&Array.from(u.current.parentElement.children).forEach(m=>{m!==u.current&&(e==null||e.observe(m))}),E.current&&(e==null||e.observe(E.current)),window.addEventListener("resize",g),(w=window.visualViewport)==null||w.addEventListener("resize",g),(v=document.fonts)==null||v.ready.then(g),()=>{var m;e==null||e.disconnect(),window.removeEventListener("resize",g),(m=window.visualViewport)==null||m.removeEventListener("resize",g)}},[a,s,g,r]),M.length===0)return null;const $=a?c.slice(0,F):c,O=a?c.slice(F):[];return b.jsxs("div",{"data-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const b=require("react/jsx-runtime"),Z=require("classix"),l=require("react"),ee=require("../button/index.cjs"),A=require("../../menu-popover-bqblnK6P.cjs"),te="_controls_t1re6_13",ne="_inline_t1re6_43",ie="_embedded_t1re6_48",re="_fixed_t1re6_49",oe="_adaptive_t1re6_60",se="_measurement_t1re6_65",h={controls:te,default:"_default_t1re6_28",inline:ne,embedded:ie,fixed:re,adaptive:oe,measurement:se,"non-button-content":"_non-button-content_t1re6_99","overflow-trigger":"_overflow-trigger_t1re6_128"},de={primary:2,secondary:1,tertiary:0,simple:0},ce={default:h.default,embedded:h.embedded,fixed:h.fixed,inline:h.inline},ae=s=>de[s.props.variant??"secondary"];function le({buttons:s,menuAccessibleLabel:i,triggerAccessibleLabel:n}){const x=s.map(o=>({button:o,isDanger:o.props.intent==="danger",value:o}));return b.jsx(A.MenuPopover,{triggerAccessibleLabel:n,"data-component":"overflowmenu",children:({close:o,initialFocus:r})=>b.jsx(A.MenuActionList,{actions:x,initialFocus:r,menuAccessibleLabel:i,onSelect:()=>o(),usesMenuSemantics:!0})})}const p=(s,i)=>{const n=Number.parseFloat(String(s[i]));return Number.isFinite(n)?n:0},ue=s=>{if(!s.trim().endsWith("px"))return;const i=Number.parseFloat(s);return Number.isFinite(i)?i:void 0},me=(s,i)=>{const n=s.parentElement;if(!n)return;const x=n.getBoundingClientRect(),o=getComputedStyle(n),r=x.width||n.clientWidth,S=x.left+p(o,"borderLeftWidth")+p(o,"paddingLeft"),M=x.left+r-p(o,"borderRightWidth")-p(o,"paddingRight"),_=Array.from(n.children).slice(0,Array.from(n.children).indexOf(s)),y=_.reduce((f,u)=>Math.max(f,u.getBoundingClientRect().right),S),c=_.length>0?p(o,"columnGap"):0,a=Math.max(0,M-y-c),R=(i==null?void 0:i.parent)===n?Math.max(0,r-i.parentWidth):0;return{availableWidth:R>0?Math.max(a,((i==null?void 0:i.availableWidth)??0)+R):a,parent:n,parentWidth:r}},fe=({children:s,className:i,maxVisibleButtons:n,overflow:x,overflowAccessibleLabel:o="More actions",variant:r="default",...S})=>{const M=l.Children.toArray(s),_=[],y=[];M.forEach(e=>{l.isValidElement(e)&&e.type===ee.Button?_.push(e):y.push(e)});const c=_.map((e,d)=>({button:e,index:d,rank:ae(e)})).sort((e,d)=>e.rank-d.rank||e.index-d.index).map(({button:e,index:d})=>l.cloneElement(e,{key:e.key??d})),a=r==="embedded"||r==="fixed"&&x==="menu",R=typeof n=="number"&&Number.isFinite(n)?Math.floor(n):0,f=r==="embedded"&&R>0?Math.min(c.length,R):c.length,u=l.useRef(null),N=l.useRef(void 0),z=l.useRef(null),E=l.useRef(null),[F,C]=l.useState(f),k=c.map(e=>String(e.key)).join(`
|
|
2
|
+
`),[D,G]=l.useState(k);D!==k&&(G(k),C(f));const g=l.useCallback(()=>{var L,I,T;if(!a){C(f);return}const e=u.current,d=z.current;if(!e||!d)return;const W=Array.from(d.querySelectorAll('[data-component="button"]')),w=W.at(-1);if(!w)return;const v=W.slice(0,c.length).map(t=>t.getBoundingClientRect().width);if(v.length!==c.length)return;const m=getComputedStyle(e),H=p(m,"paddingLeft")+p(m,"paddingRight")+p(m,"borderLeftWidth")+p(m,"borderRightWidth"),J=ue(m.maxWidth),B=r==="embedded"?me(e,N.current):void 0;B&&(N.current=B);const Q=(B==null?void 0:B.availableWidth)??((L=e.parentElement)==null?void 0:L.clientWidth)??0,U=((I=window.visualViewport)==null?void 0:I.width)??document.documentElement.clientWidth,V=Math.min(...[J,Q,U].filter(t=>typeof t=="number"&&Number.isFinite(t)&&t>0));if(!Number.isFinite(V))return;const q=Math.max(0,V-H),P=((T=E.current)==null?void 0:T.getBoundingClientRect().width)??0,X=v.reduce((t,Y)=>t+Y,0);if(f===c.length&&P+X<=q){C(t=>t===f?t:f);return}let K=P+w.getBoundingClientRect().width,j=0;for(let t=0;t<f&&!(K+v[t]>q);t+=1)K+=v[t],j=t+1;C(t=>t===j?t:j)},[a,c.length,r,f]);if(l.useLayoutEffect(()=>{var d,W,w,v;if(g(),!a)return;const e=typeof ResizeObserver>"u"?void 0:new ResizeObserver(g);return u.current&&(e==null||e.observe(u.current)),(d=u.current)!=null&&d.parentElement&&(e==null||e.observe(u.current.parentElement)),r==="embedded"&&((W=u.current)!=null&&W.parentElement)&&Array.from(u.current.parentElement.children).forEach(m=>{m!==u.current&&(e==null||e.observe(m))}),E.current&&(e==null||e.observe(E.current)),window.addEventListener("resize",g),(w=window.visualViewport)==null||w.addEventListener("resize",g),(v=document.fonts)==null||v.ready.then(g),()=>{var m;e==null||e.disconnect(),window.removeEventListener("resize",g),(m=window.visualViewport)==null||m.removeEventListener("resize",g)}},[a,s,g,r]),M.length===0)return null;const $=a?c.slice(0,F):c,O=a?c.slice(F):[];return b.jsxs("div",{"data-dynamic-position":r==="fixed"?!0:void 0,"data-adaptive":a?!0:void 0,className:Z(h.controls,ce[r],a&&h.adaptive,i),ref:u,...S,"data-component":"controls",children:[a&&b.jsxs("div",{"aria-hidden":"true",className:h.measurement,ref:z,children:[c.map((e,d)=>l.cloneElement(e,{"aria-hidden":!0,id:void 0,key:`measure-${String(e.key??d)}`,onClick:void 0,ref:void 0,tabIndex:-1})),b.jsx(A.MenuPopover,{triggerAccessibleLabel:o,children:null})]}),r!=="embedded"&&y.length>0&&b.jsx("span",{className:h["non-button-content"],ref:E,children:y}),$,O.length>0&&b.jsx("span",{className:h["overflow-trigger"],children:b.jsx(le,{buttons:O,menuAccessibleLabel:o,triggerAccessibleLabel:o})})]})};exports.Controls=fe;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as G, jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import ne from "classix";
|
|
3
3
|
import { Children as ie, isValidElement as re, cloneElement as P, useRef as C, useState as T, useCallback as oe, useLayoutEffect as de } from "react";
|
|
4
4
|
import { Button as se } from "../button/index.js";
|
|
5
|
-
import { a as $, M as ce } from "../../menu-popover-
|
|
5
|
+
import { a as $, M as ce } from "../../menu-popover-Ceb_9V67.js";
|
|
6
6
|
import '../../assets/index37.css';const ae = "_controls_t1re6_13", le = "_inline_t1re6_43", ue = "_embedded_t1re6_48", me = "_fixed_t1re6_49", fe = "_adaptive_t1re6_60", he = "_measurement_t1re6_65", f = {
|
|
7
7
|
controls: ae,
|
|
8
8
|
default: "_default_t1re6_28",
|
|
@@ -46,12 +46,12 @@ const h = (d, i) => {
|
|
|
46
46
|
if (!d.trim().endsWith("px")) return;
|
|
47
47
|
const i = Number.parseFloat(d);
|
|
48
48
|
return Number.isFinite(i) ? i : void 0;
|
|
49
|
-
},
|
|
49
|
+
}, xe = (d, i) => {
|
|
50
50
|
const n = d.parentElement;
|
|
51
51
|
if (!n) return;
|
|
52
|
-
const g = n.getBoundingClientRect(), o = getComputedStyle(n), r = g.width || n.clientWidth, S = g.left + h(o, "borderLeftWidth") + h(o, "paddingLeft"), B = g.left + r - h(o, "borderRightWidth") - h(o, "paddingRight"), _ = Array.from(n.children).slice(0, Array.from(n.children).indexOf(d)),
|
|
52
|
+
const g = n.getBoundingClientRect(), o = getComputedStyle(n), r = g.width || n.clientWidth, S = g.left + h(o, "borderLeftWidth") + h(o, "paddingLeft"), B = g.left + r - h(o, "borderRightWidth") - h(o, "paddingRight"), _ = Array.from(n.children).slice(0, Array.from(n.children).indexOf(d)), x = _.reduce((m, l) => Math.max(m, l.getBoundingClientRect().right), S), c = _.length > 0 ? h(o, "columnGap") : 0, a = Math.max(0, B - x - c), W = (i == null ? void 0 : i.parent) === n ? Math.max(0, r - i.parentWidth) : 0;
|
|
53
53
|
return {
|
|
54
|
-
availableWidth:
|
|
54
|
+
availableWidth: W > 0 ? Math.max(a, ((i == null ? void 0 : i.availableWidth) ?? 0) + W) : a,
|
|
55
55
|
parent: n,
|
|
56
56
|
parentWidth: r
|
|
57
57
|
};
|
|
@@ -64,9 +64,9 @@ const h = (d, i) => {
|
|
|
64
64
|
variant: r = "default",
|
|
65
65
|
...S
|
|
66
66
|
}) => {
|
|
67
|
-
const B = ie.toArray(d), _ = [],
|
|
67
|
+
const B = ie.toArray(d), _ = [], x = [];
|
|
68
68
|
B.forEach((e) => {
|
|
69
|
-
re(e) && e.type === se ? _.push(e) :
|
|
69
|
+
re(e) && e.type === se ? _.push(e) : x.push(e);
|
|
70
70
|
});
|
|
71
71
|
const c = _.map((e, s) => ({
|
|
72
72
|
button: e,
|
|
@@ -77,7 +77,7 @@ const h = (d, i) => {
|
|
|
77
77
|
index: s
|
|
78
78
|
}) => P(e, {
|
|
79
79
|
key: e.key ?? s
|
|
80
|
-
})), a = r === "embedded" || r === "fixed" && g === "menu",
|
|
80
|
+
})), a = r === "embedded" || r === "fixed" && g === "menu", W = typeof n == "number" && Number.isFinite(n) ? Math.floor(n) : 0, m = r === "embedded" && W > 0 ? Math.min(c.length, W) : c.length, l = C(null), N = C(void 0), z = C(null), M = C(null), [F, E] = T(m), k = c.map((e) => String(e.key)).join(`
|
|
81
81
|
`), [H, J] = T(k);
|
|
82
82
|
H !== k && (J(k), E(m));
|
|
83
83
|
const p = oe(() => {
|
|
@@ -92,7 +92,7 @@ const h = (d, i) => {
|
|
|
92
92
|
if (!w) return;
|
|
93
93
|
const b = y.slice(0, c.length).map((t) => t.getBoundingClientRect().width);
|
|
94
94
|
if (b.length !== c.length) return;
|
|
95
|
-
const u = getComputedStyle(e), U = h(u, "paddingLeft") + h(u, "paddingRight") + h(u, "borderLeftWidth") + h(u, "borderRightWidth"), X = _e(u.maxWidth), R = r === "embedded" ?
|
|
95
|
+
const u = getComputedStyle(e), U = h(u, "paddingLeft") + h(u, "paddingRight") + h(u, "borderLeftWidth") + h(u, "borderRightWidth"), X = _e(u.maxWidth), R = r === "embedded" ? xe(e, N.current) : void 0;
|
|
96
96
|
R && (N.current = R);
|
|
97
97
|
const Y = (R == null ? void 0 : R.availableWidth) ?? ((I = e.parentElement) == null ? void 0 : I.clientWidth) ?? 0, Z = ((q = window.visualViewport) == null ? void 0 : q.width) ?? document.documentElement.clientWidth, O = Math.min(...[X, Y, Z].filter((t) => typeof t == "number" && Number.isFinite(t) && t > 0));
|
|
98
98
|
if (!Number.isFinite(O)) return;
|
|
@@ -119,7 +119,7 @@ const h = (d, i) => {
|
|
|
119
119
|
}, [a, d, p, r]), B.length === 0)
|
|
120
120
|
return null;
|
|
121
121
|
const Q = a ? c.slice(0, F) : c, V = a ? c.slice(F) : [];
|
|
122
|
-
return /* @__PURE__ */ G("div", { "data-
|
|
122
|
+
return /* @__PURE__ */ G("div", { "data-dynamic-position": r === "fixed" ? !0 : void 0, "data-adaptive": a ? !0 : void 0, className: ne(f.controls, ge[r], a && f.adaptive, i), ref: l, ...S, "data-component": "controls", children: [
|
|
123
123
|
a && /* @__PURE__ */ G("div", { "aria-hidden": "true", className: f.measurement, ref: z, children: [
|
|
124
124
|
c.map((e, s) => P(e, {
|
|
125
125
|
"aria-hidden": !0,
|
|
@@ -131,7 +131,7 @@ const h = (d, i) => {
|
|
|
131
131
|
})),
|
|
132
132
|
/* @__PURE__ */ v($, { triggerAccessibleLabel: o, children: null })
|
|
133
133
|
] }),
|
|
134
|
-
r !== "embedded" &&
|
|
134
|
+
r !== "embedded" && x.length > 0 && /* @__PURE__ */ v("span", { className: f["non-button-content"], ref: M, children: x }),
|
|
135
135
|
Q,
|
|
136
136
|
V.length > 0 && /* @__PURE__ */ v("span", { className: f["overflow-trigger"], children: /* @__PURE__ */ v(ve, { buttons: V, menuAccessibleLabel: o, triggerAccessibleLabel: o }) })
|
|
137
137
|
] });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const a=require("react/jsx-runtime"),ht=require("classix"),o=require("react"),Zt=require("../toolbar/index.cjs"),et=require("../button/index.cjs"),qt=require("../figure/index.cjs"),$t=require("../icon/index.cjs"),A=10,Z=.1,Gt=.92,y=(i,d,x)=>Math.min(x,Math.max(d,i)),Ft=i=>new Promise((d,x)=>{const z=URL.createObjectURL(i),s=new globalThis.Image;s.onload=()=>{URL.revokeObjectURL(z),d(s)},s.onerror=()=>{URL.revokeObjectURL(z),x(new Error("croppable-image-load-failed"))},s.src=z}),Jt=async({file:i,fill:d,transform:x,viewport:z})=>{const s=await Ft(i),D=z.width/s.naturalWidth,W=z.height/s.naturalHeight,O=Math.max(D,W),q=s.naturalWidth*O,H=s.naturalHeight*O,j=d==="width"?Math.max(Z,D/O):d==="height"?Math.max(Z,W/O):Z,S=y(x.zoom,j,A),R=O*S,v=q*S,M=H*S,nt=(z.width-v)/2+x.offset.x,P=(z.height-M)/2+x.offset.y,b=y(-nt/R,0,s.naturalWidth),_=y(-P/R,0,s.naturalHeight),$=y(z.width/R,1,Math.max(1,s.naturalWidth-b)),g=y(z.height/R,1,Math.max(1,s.naturalHeight-_)),h=document.createElement("canvas"),L=h.getContext("2d");if(!L)throw new Error("croppable-image-context-missing");h.width=Math.max(1,Math.round($)),h.height=Math.max(1,Math.round(g)),L.drawImage(s,b,_,$,g,0,0,h.width,h.height);const E=i.type.startsWith("image/")?i.type:"image/jpeg",U=await new Promise(u=>{h.toBlob(u,E,Gt)});if(!U)throw new Error("croppable-image-export-failed");return new globalThis.File([U],i.name,{lastModified:Date.now(),type:U.type||E})},Kt="_croppable_sjc2z_1",Qt="_empty_sjc2z_15",Vt="_action_sjc2z_23",Ct="_caption_sjc2z_31",te="_media_sjc2z_38",ee="_viewport_sjc2z_49",ne="_draggable_sjc2z_61",re="_dragging_sjc2z_65",ce="_inner_sjc2z_69",oe="_standalone_sjc2z_85",f={croppable:Kt,empty:Qt,action:Vt,caption:Ct,media:te,viewport:ee,draggable:ne,dragging:re,inner:ce,standalone:oe},se=192,T={offset:{x:0,y:0},zoom:1},Ut=(i,d)=>(i==null?void 0:i.file)===d.file&&(i==null?void 0:i.source)===d.source&&(i==null?void 0:i.settings)===d.settings,ie=({cancelLabel:i,children:d,fill:x="none",height:z,image:s,deleteLabel:D,saveLabel:W,uploadLabel:O,onCroppableChange:q,onDelete:H,onFileChange:j,onImageChange:S,onSave:R,onTransformChange:v,transform:M,standalone:nt})=>{const P=o.useRef(null),b=o.useRef(null),_=o.useRef(null),$=o.useRef(null),g=o.useRef(S),h=o.useRef(null),L=o.useRef(null),E=o.useRef(null),U=o.useRef(new Map),u=o.useRef(T),rt=o.useRef(null),[w,J]=o.useState(null),[ct,ot]=o.useState(null),[ft,K]=o.useState(!1),[Ot,st]=o.useState(T),[N,it]=o.useState(null),[m,St]=o.useState({width:0,height:0}),[pt,at]=o.useState(null),[G,Q]=o.useState(null),F=(()=>{const t=m.width,n=m.height;if(!t||!n)return{width:0,height:0,minZoom:Z};if(!w)return{width:t,height:n,minZoom:Z};const r=t/w.width,e=n/w.height,c=Math.max(r,e),l=x==="width"?r/c:x==="height"?e/c:0;return{width:w.width*c,height:w.height*c,minZoom:Math.max(Z,l)}})(),B=F.minZoom,X=M??Ot,Y=y(X.zoom,B,A),V=ct??s??null,mt=!d&&!!s&&!ct&&!N,C=!mt,xt=d??(V?a.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&J({width:n.naturalWidth,height:n.naturalHeight})},src:V}):null),I=xt==null,ut={file:N,source:ct,settings:JSON.stringify([x,Y,X.offset.x,X.offset.y,m.width,m.height])};o.useEffect(()=>{!G||!s||s===G.image&&s!==G.crop.source||(at(G.crop),Q(null))},[s,G]);const lt=(t,n)=>{const{maxX:r,maxY:e}=wt(n);return{x:y(t.x,-r,r),y:y(t.y,-e,e)}},gt=(t,n)=>{const r=rt.current;if(!r)return null;const e=r.getBoundingClientRect(),c=t-e.left-e.width/2,l=n-e.top-e.height/2;return{x:c,y:l}},vt=(t,n,r,e)=>{const c=y(n,B,A),l=y(r,B,A);if(c===0)return t;const p=l/c;return{x:(1-p)*e.x+p*t.x,y:(1-p)*e.y+p*t.y}},Pt=(t,n,r)=>{const e=u.current.zoom,c=y(t,B,A),l=u.current.offset,p=r?vt(l,e,c,r):n,k=lt(p,c);u.current={zoom:c,offset:k},M||st({zoom:c,offset:k}),v==null||v({zoom:c,offset:k})},tt=(t,n,r)=>{L.current={zoom:t,offset:n,anchor:r??null},b.current==null&&(b.current=window.requestAnimationFrame(()=>{b.current=null;const e=L.current;L.current=null;const c=(e==null?void 0:e.zoom)??u.current.zoom,l=(e==null?void 0:e.offset)??u.current.offset,p=(e==null?void 0:e.anchor)??null;Pt(c,l,p)}))},It=t=>{if(I||!C)return;const n=t.ctrlKey?.001:25e-5,r=u.current.zoom*Math.exp(-t.deltaY*n),e=gt(t.clientX,t.clientY);tt(r,u.current.offset,e)},wt=t=>{const n=m.width,r=m.height;if(!n||!r)return{maxX:0,maxY:0};const e=y(t,B,A),c=F.width*e,l=F.height*e,p=Math.max(0,(c-n)/2),k=Math.max(0,(l-r)/2);return{maxX:p,maxY:k}},Tt=t=>{var c;Q(null),at(null);const n=t.target,r=((c=n.files)==null?void 0:c[0])??null;if(h.current&&(URL.revokeObjectURL(h.current),h.current=null),!r){ot(null),it(null),j==null||j(null),n.value="";return}const e=URL.createObjectURL(r);h.current=e,ot(e),J(null),it(r),tt(T.zoom,T.offset),u.current=T,j==null||j(r),n.value=""},yt=()=>{Q(null),at(null),b.current!=null&&(window.cancelAnimationFrame(b.current),b.current=null),L.current=null,P.current=null,_.current=null,E.current=null,U.current.clear(),K(!1),h.current&&(URL.revokeObjectURL(h.current),h.current=null),ot(null),J(null),it(null),u.current=T,st(T),v==null||v(T),j==null||j(null)},Lt=t=>{t.stopPropagation(),yt()},Nt=t=>{t.stopPropagation(),yt(),H==null||H()},Xt=t=>{if(!(I||!C||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=U.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){_.current=null,P.current=null,K(!1);const[r,e]=Array.from(n.values());E.current=Math.hypot(r.x-e.x,r.y-e.y);return}}P.current=t.pointerId,_.current={x:t.clientX,y:t.clientY,originX:u.current.offset.x,originY:u.current.offset.y}}},Yt=t=>{if(I||!C)return;if(t.pointerType==="touch"){const c=U.current;if(!c.has(t.pointerId))return;if(c.set(t.pointerId,{x:t.clientX,y:t.clientY}),c.size===2){const[l,p]=Array.from(c.values()),k=l.x-p.x,Dt=l.y-p.y,Mt=Math.hypot(k,Dt),Et={x:(l.x+p.x)/2,y:(l.y+p.y)/2};if(E.current){const Wt=Mt/E.current,Ht=u.current.zoom*Wt,Bt=gt(Et.x,Et.y);tt(Ht,u.current.offset,Bt)}E.current=Mt;return}}if(P.current!==t.pointerId||!_.current||!dt)return;const n=t.clientX-_.current.x,r=t.clientY-_.current.y,e=Math.abs(n)+Math.abs(r);!ft&&e>2&&K(!0),!(e<=1)&&tt(u.current.zoom,{x:_.current.originX+n,y:_.current.originY+r})},zt=t=>{t.pointerType==="touch"&&(U.current.delete(t.pointerId),U.current.size<2&&(E.current=null)),P.current===t.pointerId&&(P.current=null,_.current=null,K(!1))};o.useEffect(()=>{if(!M)return;const t=y(M.zoom,B,A);u.current={zoom:t,offset:lt(M.offset,t)}},[M,m.width,m.height,w==null?void 0:w.width,w==null?void 0:w.height]),o.useEffect(()=>()=>{h.current&&URL.revokeObjectURL(h.current)},[]),o.useEffect(()=>{const t=rt.current;if(!t)return;const n=()=>{const c=t.getBoundingClientRect();St(l=>l.width===c.width&&l.height===c.height?l:{width:c.width,height:c.height}),q&&q(c)};n();const r=()=>n();if(window.addEventListener("scroll",r,!0),typeof ResizeObserver>"u"){const c=()=>n();return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",r,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",r,!0)}},[q]),o.useEffect(()=>{if(M)return;const t=u.current.offset,n=lt(t,Y);t.x===n.x&&t.y===n.y||(u.current={zoom:u.current.zoom,offset:n},st(r=>({...r,offset:n})))},[Y,w,m.width,m.height]),o.useEffect(()=>{V||J(null)},[V]),o.useEffect(()=>{g.current=S},[S]),o.useEffect(()=>{var r;if(!S)return;if(!N||!m.width||!m.height||d){(r=g.current)==null||r.call(g,null);return}let t=!0;const n=window.setTimeout(()=>{Jt({file:N,fill:x,transform:{zoom:Y,offset:X.offset},viewport:m}).then(e=>{var c;t&&((c=g.current)==null||c.call(g,e))}).catch(()=>{var e;t&&((e=g.current)==null||e.call(g,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[d,Y,X.offset,x,N,m]),o.useEffect(()=>()=>{b.current!=null&&(window.cancelAnimationFrame(b.current),b.current=null)},[]);const bt=wt(Y),dt=!I&&C&&(bt.maxX>0||bt.maxY>0),_t=!I&&!mt&&!!R&&!Ut(pt,ut),jt=!!s&&!d&&!!N&&!Ut(pt,ut),kt=!jt&&!I&&!!(N||H),Rt=()=>{var t;return(t=$.current)==null?void 0:t.click()},At=t=>{t.preventDefault(),t.stopPropagation(),Rt()};return a.jsxs("div",{className:ht(f.croppable,nt&&f.standalone),onClick:()=>{I&&Rt()},"data-component":"croppable",children:[a.jsx("input",{accept:"image/*",onChange:Tt,ref:$,type:"file"}),a.jsx("div",{className:f.viewport,ref:rt,onDragStart:t=>t.preventDefault(),onPointerDown:Xt,onPointerMove:Yt,onPointerUp:zt,onPointerCancel:zt,onWheel:It,style:{"--croppable-height":`${z??se}px`,"--croppable-zoom":Y,"--croppable-x":`${X.offset.x}px`,"--croppable-y":`${X.offset.y}px`,...w?{"--croppable-image-width":`${F.width}px`,"--croppable-image-height":`${F.height}px`}:null},children:I?a.jsx("div",{className:f.empty,children:a.jsx(qt.Figure,{children:a.jsx($t.Icon,{name:"Image",size:"large"})})}):a.jsx("div",{className:ht(f.media,dt&&f.draggable,dt&&ft&&f.dragging),children:a.jsx("div",{className:ht(f.inner),children:xt})})}),a.jsxs(Zt.Toolbar,{children:[_t&&a.jsxs("span",{className:f.action,children:[a.jsx(et.Button,{"aria-label":W??"Save image",icon:"FloppyDisk",onClick:()=>{Q({image:s,crop:ut}),R==null||R()},variant:"primary"}),W&&a.jsx("span",{className:f.caption,children:W})]}),!_t&&a.jsxs("span",{className:f.action,children:[a.jsx(et.Button,{"aria-label":O,icon:"UploadSimple",onClick:At,variant:"secondary"}),a.jsx("span",{className:f.caption,children:O})]}),jt&&a.jsxs("span",{className:f.action,children:[a.jsx(et.Button,{"aria-label":i??"Cancel changes",icon:"X",onClick:Lt,variant:"secondary"}),i&&a.jsx("span",{className:f.caption,children:i})]}),kt&&a.jsxs("span",{className:f.action,children:[a.jsx(et.Button,{"aria-label":D??"Delete image",icon:"Trash",intent:"danger",onClick:Nt,variant:"secondary"}),D&&a.jsx("span",{className:f.caption,children:D})]})]})]})};exports.Croppable=ie;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|