@solibo/solibo-ui 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/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 +1 -1
- 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 +54 -46
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +4 -4
- 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 +1 -1
- 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 +89 -89
- 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 -16298
- 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 +6 -6
- 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 +2 -2
- 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 +2 -2
- 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 +4 -4
- 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/{index-CMPTHneU.js → index-BlirPoN9.js} +8 -8
- package/dist/{index-BIpgkB-u.js → index-C3NJXvlq.js} +11 -11
- package/dist/index-CireNaZt.cjs +2 -0
- package/dist/index-O1kh8Vnq.cjs +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +379 -14
- 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.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,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 d=require("react/jsx-runtime"),tt=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const d=require("react/jsx-runtime"),tt=require("classix"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),I=10,A=.1,kt=.92,m=(h,x,R)=>Math.min(R,Math.max(x,h)),It=h=>new Promise((x,R)=>{const f=URL.createObjectURL(h),a=new globalThis.Image;a.onload=()=>{URL.revokeObjectURL(f),x(a)},a.onerror=()=>{URL.revokeObjectURL(f),R(new Error("croppable-image-load-failed"))},a.src=f}),Ot=async({file:h,fill:x,transform:R,viewport:f})=>{const a=await It(h),O=f.width/a.naturalWidth,M=f.height/a.naturalHeight,y=Math.max(O,M),D=a.naturalWidth*y,E=a.naturalHeight*y,Q=x==="width"?Math.max(A,O/y):x==="height"?Math.max(A,M/y):A,j=m(R.zoom,Q,I),w=y*j,b=D*j,B=E*j,p=(f.width-b)/2+R.offset.x,L=(f.height-B)/2+R.offset.y,S=m(-p/w,0,a.naturalWidth),T=m(-L/w,0,a.naturalHeight),v=m(f.width/w,1,Math.max(1,a.naturalWidth-S)),s=m(f.height/w,1,Math.max(1,a.naturalHeight-T)),_=document.createElement("canvas"),u=_.getContext("2d");if(!u)throw new Error("croppable-image-context-missing");_.width=Math.max(1,Math.round(v)),_.height=Math.max(1,Math.round(s)),u.drawImage(a,S,T,v,s,0,0,_.width,_.height);const U=h.type.startsWith("image/")?h.type:"image/jpeg",P=await new Promise(N=>{_.toBlob(N,U,kt)});if(!P)throw new Error("croppable-image-export-failed");return new globalThis.File([P],h.name,{lastModified:Date.now(),type:P.type||U})},St="_croppable_1kqo4_1",Ut="_empty_1kqo4_14",Pt="_media_1kqo4_22",qt="_overlay_1kqo4_33",Yt="_viewport_1kqo4_41",Xt="_draggable_1kqo4_53",At="_dragging_1kqo4_57",Dt="_inner_1kqo4_61",Wt="_standalone_1kqo4_77",z={croppable:St,empty:Ut,media:Pt,overlay:qt,viewport:Yt,draggable:Xt,dragging:At,inner:Dt,standalone:Wt},Ht=192,Z={offset:{x:0,y:0},zoom:1},xt="Select image",Zt=({children:h,fill:x="none",height:R,image:f,label:a,onCroppableChange:O,onFileChange:M,onImageChange:y,onTransformChange:D,transform:E,standalone:Q})=>{const j=c.useRef(null),w=c.useRef(null),b=c.useRef(null),B=c.useRef(null),p=c.useRef(y),L=c.useRef(null),S=c.useRef(null),T=c.useRef(null),v=c.useRef(new Map),s=c.useRef(Z),_=c.useRef(null),[u,U]=c.useState(null),[P,N]=c.useState(null),[et,V]=c.useState(!1),[wt,nt]=c.useState(Z),[F,ot]=c.useState(null),[g,yt]=c.useState({width:0,height:0}),W=(()=>{const t=g.width,n=g.height;if(!t||!n)return{width:0,height:0,minZoom:A};if(!u)return{width:t,height:n,minZoom:A};const o=t/u.width,e=n/u.height,r=Math.max(o,e),i=x==="width"?o/r:x==="height"?e/r:0;return{width:u.width*r,height:u.height*r,minZoom:Math.max(A,i)}})(),q=W.minZoom,H=E??wt,Y=m(H.zoom,q,I),$=P??f??null,rt=!h&&!!f&&!P&&!F,G=!rt,ct=h??($?d.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&U({width:n.naturalWidth,height:n.naturalHeight})},src:$}):null),X=ct==null,J=(t,n)=>{const{maxX:o,maxY:e}=it(n);return{x:m(t.x,-o,o),y:m(t.y,-e,e)}},st=(t,n)=>{const o=_.current;if(!o)return null;const e=o.getBoundingClientRect(),r=t-e.left-e.width/2,i=n-e.top-e.height/2;return{x:r,y:i}},bt=(t,n,o,e)=>{const r=m(n,q,I),i=m(o,q,I);if(r===0)return t;const l=i/r;return{x:(1-l)*e.x+l*t.x,y:(1-l)*e.y+l*t.y}},_t=(t,n,o)=>{const e=s.current.zoom,r=m(t,q,I),i=s.current.offset,l=o?bt(i,e,r,o):n,k=J(l,r);s.current={zoom:r,offset:k},E||nt({zoom:r,offset:k}),D==null||D({zoom:r,offset:k})},K=(t,n,o)=>{S.current={zoom:t,offset:n,anchor:o??null},w.current==null&&(w.current=window.requestAnimationFrame(()=>{w.current=null;const e=S.current;S.current=null;const r=(e==null?void 0:e.zoom)??s.current.zoom,i=(e==null?void 0:e.offset)??s.current.offset,l=(e==null?void 0:e.anchor)??null;_t(r,i,l)}))},zt=t=>{if(X||!G)return;const n=t.ctrlKey?.001:25e-5,o=s.current.zoom*Math.exp(-t.deltaY*n),e=st(t.clientX,t.clientY);K(o,s.current.offset,e)},it=t=>{const n=g.width,o=g.height;if(!n||!o)return{maxX:0,maxY:0};const e=m(t,q,I),r=W.width*e,i=W.height*e,l=Math.max(0,(r-n)/2),k=Math.max(0,(i-o)/2);return{maxX:l,maxY:k}},Rt=t=>{var r;const n=t.target,o=((r=n.files)==null?void 0:r[0])??null;if(L.current&&(URL.revokeObjectURL(L.current),L.current=null),!o){N(null),ot(null),M==null||M(null),n.value="";return}const e=URL.createObjectURL(o);L.current=e,N(e),U(null),ot(o),K(Z.zoom,Z.offset),s.current=Z,M==null||M(o),n.value=""},Mt=t=>{if(!(X||!G||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=v.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){b.current=null,j.current=null,V(!1);const[o,e]=Array.from(n.values());T.current=Math.hypot(o.x-e.x,o.y-e.y);return}}j.current=t.pointerId,b.current={x:t.clientX,y:t.clientY,originX:s.current.offset.x,originY:s.current.offset.y}}},Et=t=>{if(X||!G)return;if(t.pointerType==="touch"){const r=v.current;if(!r.has(t.pointerId))return;if(r.set(t.pointerId,{x:t.clientX,y:t.clientY}),r.size===2){const[i,l]=Array.from(r.values()),k=i.x-l.x,jt=i.y-l.y,ht=Math.hypot(k,jt),ft={x:(i.x+l.x)/2,y:(i.y+l.y)/2};if(T.current){const Lt=ht/T.current,Tt=s.current.zoom*Lt,vt=st(ft.x,ft.y);K(Tt,s.current.offset,vt)}T.current=ht;return}}if(j.current!==t.pointerId||!b.current||!C)return;const n=t.clientX-b.current.x,o=t.clientY-b.current.y,e=Math.abs(n)+Math.abs(o);!et&&e>2&&V(!0),!(e<=1)&&K(s.current.zoom,{x:b.current.originX+n,y:b.current.originY+o})},at=t=>{t.pointerType==="touch"&&(v.current.delete(t.pointerId),v.current.size<2&&(T.current=null)),j.current===t.pointerId&&(j.current=null,b.current=null,V(!1))};c.useEffect(()=>{if(!E)return;const t=m(E.zoom,q,I);s.current={zoom:t,offset:J(E.offset,t)}},[E,g.width,g.height,u==null?void 0:u.width,u==null?void 0:u.height]),c.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]),c.useEffect(()=>{const t=_.current;if(!t)return;const n=()=>{const r=t.getBoundingClientRect();yt(i=>i.width===r.width&&i.height===r.height?i:{width:r.width,height:r.height}),O&&O(r)};n();const o=()=>n();if(window.addEventListener("scroll",o,!0),typeof ResizeObserver>"u"){const r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",o,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",o,!0)}},[O]),c.useEffect(()=>{if(E)return;const t=s.current.offset,n=J(t,Y);t.x===n.x&&t.y===n.y||(s.current={zoom:s.current.zoom,offset:n},nt(o=>({...o,offset:n})))},[Y,u,g.width,g.height]),c.useEffect(()=>{$||U(null)},[$]),c.useEffect(()=>{p.current=y},[y]),c.useEffect(()=>{var o;if(!y)return;if(!F||!g.width||!g.height||h){(o=p.current)==null||o.call(p,null);return}let t=!0;const n=window.setTimeout(()=>{Ot({file:F,fill:x,transform:{zoom:Y,offset:H.offset},viewport:g}).then(e=>{var r;t&&((r=p.current)==null||r.call(p,e))}).catch(()=>{var e;t&&((e=p.current)==null||e.call(p,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[h,Y,H.offset,x,F,g]),c.useEffect(()=>()=>{w.current!=null&&(window.cancelAnimationFrame(w.current),w.current=null)},[]);const ut=it(Y),C=!X&&G&&(ut.maxX>0||ut.maxY>0),lt=()=>{var t;return(t=B.current)==null?void 0:t.click()},dt=t=>{t.preventDefault(),t.stopPropagation(),lt()};return d.jsxs("div",{className:tt(z.croppable,Q&&z.standalone),onClick:()=>{X&<()},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:Rt,ref:B,type:"file"}),d.jsx("div",{className:z.viewport,ref:_,onDragStart:t=>t.preventDefault(),onPointerDown:Mt,onPointerMove:Et,onPointerUp:at,onPointerCancel:at,onWheel:zt,style:{"--croppable-height":`${R??Ht}px`,"--croppable-zoom":Y,"--croppable-x":`${H.offset.x}px`,"--croppable-y":`${H.offset.y}px`,...u?{"--croppable-image-width":`${W.width}px`,"--croppable-image-height":`${W.height}px`}:null},children:X?d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]}):d.jsxs("div",{className:tt(z.media,C&&z.draggable,C&&et&&z.dragging),children:[d.jsx("div",{className:tt(z.inner),children:ct}),rt&&d.jsx("div",{className:z.overlay,children:d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]})})]})})]})};exports.Croppable=Zt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as J, jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import ot from "classix";
|
|
3
3
|
import { useRef as x, useState as S, useEffect as E } from "react";
|
|
4
4
|
import { Button as wt } from "../button/index.js";
|
|
5
5
|
import { Figure as xt } from "../figure/index.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const e=require("react/jsx-runtime"),p=require("classix"),a=require("react"),j=require("../button/index.cjs"),P=require("../icon/index.cjs"),T="_dialog_cz5d0_3",X="_close_cz5d0_34",E="_fullscreen_cz5d0_45",F="_structured_cz5d0_87",M="_content_cz5d0_87",S="_header_cz5d0_96",Y="_controls_cz5d0_101",r={dialog:T,close:X,fullscreen:E,structured:F,content:M,header:S,controls:Y},z=l=>a.Children.toArray(l).some(s=>a.isValidElement(s)?s.type===j.Button&&s.props.intent==="danger"?!0:z(s.props.children):!1),w=({children:l,className:s,controls:n,fullscreen:f=!1,header:_,onCancel:i,onClick:d,onClose:u,open:o=!1,setOpen:c,...B})=>{const g=a.useRef(null),m=z(n),h=f||_!=null||n!=null;a.useEffect(()=>{const t=g.current;t&&(o&&!t.open?t.showModal():!o&&t.open&&t.close())},[o]);const b=t=>{i==null||i(t),!(t.defaultPrevented||!c)&&(t.preventDefault(),c(!1))},q=t=>{if(d==null||d(t),m||t.defaultPrevented||t.target!==t.currentTarget||!c)return;const{bottom:N,left:R,right:D,top:k}=t.currentTarget.getBoundingClientRect();(t.clientX<R||t.clientX>D||t.clientY<k||t.clientY>N)&&c(!1)},y=t=>{u==null||u(t),o&&(c==null||c(!1))},x=c&&!m?e.jsx(j.Button,{"aria-label":"Close dialog",className:r.close,onClick:()=>c(!1),variant:"simple",children:e.jsx(P.Icon,{name:"X"})}):null;return e.jsx("dialog",{className:p(r.dialog,h&&r.structured,f&&r.fullscreen,s),onCancel:b,onClick:q,onClose:y,ref:g,...B,"data-component":"dialog",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:r.header,children:[_,x]}),e.jsx("div",{className:r.content,children:l}),n!=null&&e.jsx("div",{className:r.controls,children:n})]}):e.jsxs(e.Fragment,{children:[x,l]})})};exports.Dialog=w;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsx as e, jsxs as u, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/index39.css';const A = "
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import P from "classix";
|
|
3
|
+
import B, { useRef as T, useEffect as Y } from "react";
|
|
4
|
+
import { Button as N } from "../button/index.js";
|
|
5
|
+
import { Icon as w } from "../icon/index.js";
|
|
6
|
+
import '../../assets/index39.css';const A = "_dialog_cz5d0_3", F = "_close_cz5d0_34", I = "_fullscreen_cz5d0_45", M = "_structured_cz5d0_87", V = "_content_cz5d0_87", q = "_header_cz5d0_96", G = "_controls_cz5d0_101", c = {
|
|
7
7
|
dialog: A,
|
|
8
8
|
close: F,
|
|
9
9
|
fullscreen: I,
|
|
10
10
|
structured: M,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
content: V,
|
|
12
|
+
header: q,
|
|
13
13
|
controls: G
|
|
14
|
-
},
|
|
15
|
-
children:
|
|
14
|
+
}, x = (o) => B.Children.toArray(o).some((l) => B.isValidElement(l) ? l.type === N && l.props.intent === "danger" ? !0 : x(l.props.children) : !1), U = ({
|
|
15
|
+
children: o,
|
|
16
16
|
className: l,
|
|
17
17
|
controls: s,
|
|
18
18
|
fullscreen: f = !1,
|
|
19
19
|
header: m,
|
|
20
20
|
onCancel: n,
|
|
21
|
-
onClick:
|
|
22
|
-
onClose:
|
|
21
|
+
onClick: d,
|
|
22
|
+
onClose: i,
|
|
23
23
|
open: a = !1,
|
|
24
|
-
setOpen:
|
|
24
|
+
setOpen: t,
|
|
25
25
|
...R
|
|
26
26
|
}) => {
|
|
27
|
-
const _ =
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
27
|
+
const _ = T(null), g = x(s), h = f || m != null || s != null;
|
|
28
|
+
Y(() => {
|
|
29
|
+
const r = _.current;
|
|
30
|
+
r && (a && !r.open ? r.showModal() : !a && r.open && r.close());
|
|
31
31
|
}, [a]);
|
|
32
|
-
const k = (
|
|
33
|
-
n == null || n(
|
|
34
|
-
},
|
|
35
|
-
if (
|
|
32
|
+
const k = (r) => {
|
|
33
|
+
n == null || n(r), !(r.defaultPrevented || !t) && (r.preventDefault(), t(!1));
|
|
34
|
+
}, y = (r) => {
|
|
35
|
+
if (d == null || d(r), g || r.defaultPrevented || r.target !== r.currentTarget || !t) return;
|
|
36
36
|
const {
|
|
37
|
-
bottom:
|
|
38
|
-
left:
|
|
39
|
-
right:
|
|
40
|
-
top:
|
|
41
|
-
} =
|
|
42
|
-
(
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
return /* @__PURE__ */ e("dialog", { className:
|
|
47
|
-
/* @__PURE__ */ u("div", { className:
|
|
37
|
+
bottom: X,
|
|
38
|
+
left: b,
|
|
39
|
+
right: j,
|
|
40
|
+
top: E
|
|
41
|
+
} = r.currentTarget.getBoundingClientRect();
|
|
42
|
+
(r.clientX < b || r.clientX > j || r.clientY < E || r.clientY > X) && t(!1);
|
|
43
|
+
}, D = (r) => {
|
|
44
|
+
i == null || i(r), a && (t == null || t(!1));
|
|
45
|
+
}, z = t && !g ? /* @__PURE__ */ e(N, { "aria-label": "Close dialog", className: c.close, onClick: () => t(!1), variant: "simple", children: /* @__PURE__ */ e(w, { name: "X" }) }) : null;
|
|
46
|
+
return /* @__PURE__ */ e("dialog", { className: P(c.dialog, h && c.structured, f && c.fullscreen, l), onCancel: k, onClick: y, onClose: D, ref: _, ...R, "data-component": "dialog", children: h ? /* @__PURE__ */ u(p, { children: [
|
|
47
|
+
/* @__PURE__ */ u("div", { className: c.header, children: [
|
|
48
48
|
m,
|
|
49
|
-
|
|
49
|
+
z
|
|
50
50
|
] }),
|
|
51
|
-
/* @__PURE__ */ e("div", { className:
|
|
52
|
-
s != null && /* @__PURE__ */ e("div", { className:
|
|
53
|
-
] }) : /* @__PURE__ */ u(
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
/* @__PURE__ */ e("div", { className: c.content, children: o }),
|
|
52
|
+
s != null && /* @__PURE__ */ e("div", { className: c.controls, children: s })
|
|
53
|
+
] }) : /* @__PURE__ */ u(p, { children: [
|
|
54
|
+
z,
|
|
55
|
+
o
|
|
56
56
|
] }) });
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const r=require("react/jsx-runtime"),d=require("classix"),t="_divider_1oie5_1",s={divider:t},o=({className:e,...i})=>r.jsx("hr",{className:d(s.divider,e),...i,"data-component":"divider"});exports.Divider=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import e from "classix";
|
|
3
3
|
import '../../assets/index40.css';const o = "_divider_1oie5_1", t = {
|
|
4
4
|
divider: o
|
|
5
|
-
},
|
|
5
|
+
}, m = ({
|
|
6
6
|
className: i,
|
|
7
7
|
...d
|
|
8
8
|
}) => /* @__PURE__ */ r("hr", { className: e(t.divider, i), ...d, "data-component": "divider" });
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
m as Divider
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const l=require("react/jsx-runtime"),v=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const l=require("react/jsx-runtime"),v=require("classix"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-B3hIY9Bm.cjs"),X=require("../../index-O1kh8Vnq.cjs"),pe=require("../list/index.cjs"),V=require("../../index-CireNaZt.cjs");function L(n){return typeof n=="string"||typeof n=="number"?String(n):Array.isArray(n)?n.map(L).join(" "):a.isValidElement(n)?L(n.props.children):""}function fe(n){return a.isValidElement(n)&&n.type==="option"}function me(n){return a.isValidElement(n)&&n.type==="optgroup"}function _e(n){return a.isValidElement(n)&&n.type===a.Fragment}function he(n){return a.isValidElement(n)&&n.type===V.Select}function M(n,i,r=!1){const s=[];return a.Children.forEach(n,t=>{if(_e(t))s.push(...M(t.props.children,i,r));else if(fe(t)){const c=L(t.props.children).trim(),f=t.props.value!=null?String(t.props.value):c;s.push({disabled:r||!!t.props.disabled,groupLabel:i,hidden:!!t.props.hidden,isPlaceholder:!!(t.props.hidden&&f===""),label:t.props.children,selected:!!t.props.selected,text:c,value:f})}else me(t)&&s.push(...M(t.props.children,t.props.label,r||!!t.props.disabled))}),s}function ge(n){const i=n.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(t=>t==="*"?".*":t==="?"?".":t.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function xe(n,i){const r=ge(i),s=n.filter(t=>!t.hidden&&!t.isPlaceholder);return r?s.filter(t=>r.test([t.groupLabel,t.text,t.value].filter(Boolean).join(" "))):s}function be(n,i){return n.find(r=>r.value===i)??n.find(r=>r.isPlaceholder)??n[0]}function ve(n,i,r){var s,t;return i!=null?String(i):r!=null?String(r):((s=n.find(c=>c.selected))==null?void 0:s.value)??((t=n[0])==null?void 0:t.value)??""}function ye(n){if(he(n)){const{children:i,placeholder:r,...s}=n.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:n.props.children,props:n.props}}const we="_combobox_5r227_3",je="_dropdown_5r227_20",Se="_empty_5r227_25",Ne="_group_5r227_26",Ce="_placeholder_5r227_27",Ee="_filter_5r227_35",Ve="_native_5r227_45",Le="_option_5r227_55",Re="_options_5r227_76",$e="_panel_5r227_83",Be="_selected_5r227_108",Ie="_text_5r227_112",qe="_trigger_5r227_120",De="_minimal_5r227_157",Pe="_inline_5r227_217",ke="_label_5r227_249",o={combobox:we,"combobox-input":"_combobox-input_5r227_12",dropdown:je,empty:Se,group:Ne,placeholder:Ce,filter:Ee,native:Ve,option:Le,options:Re,panel:$e,selected:Be,text:Ie,trigger:qe,minimal:De,inline:Pe,label:ke,"inline-field":"_inline-field_5r227_255"};function Y(n,i){return{"--icon-svg":de.iconSVG(n,i)}}const Fe=({children:n,className:i,combobox:r=!1,createOption:s,emptyLabel:t="No matches found",label:c,renderOption:f,searchPlaceholder:R="Filter",selectedItems:Z,variant:g="default",...ee})=>{const $=ye(n),{defaultValue:ne,onChange:B,value:I,...te}=$.props,y=V.sanitizeSelectProps(te),{className:re,...se}=y,W=a.useRef(null),G=a.useRef(null),w=a.useId(),Q=a.useRef(null),m=a.useRef(null),x=M($.children),b=I!=null,q=ve(x,I,ne),[D,P]=a.useState(()=>q),[u,p]=a.useState(!1),[j,S]=a.useState(""),N=b?String(I):D,z={default:V.resolveColor("--colors-semantic-content-secondary"),white:V.resolveColor("--color-white","white")},O=g==="minimal"?z.white:z.default,C=be(x,N),le=Y("CaretDown",O),oe=Y("MagnifyingGlass",O),T=xe(x,j),_=j.trim(),E=!!(r&&s&&_&&s.isValid(_)),ie=c&&g==="inline"?X.formatInlineLabel(c):c,A=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===N,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!b&&!x.some(e=>e.value===D)&&P(q)},[q,D,b,x]),a.useEffect(()=>{var e;if(!u){S("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var h;(h=G.current)!=null&&h.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{b||P(e.target.value),B==null||B(e)},k=()=>{var e;p(!1),r||(e=W.current)==null||e.focus()},K=()=>{var e;S(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!E||(s.onCreate(_),K())},ce=e=>{var U;b||P(e);const d=Q.current;if(!d){k();return}const h=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;h==null||h.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ue=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&E&&(e.preventDefault(),H())},J=l.jsxs("div",{className:v(o.dropdown,g==="inline"&&o.inline,g==="minimal"&&o.minimal,i),onKeyDown:ue,ref:G,...ee,"data-component":"dropdown",children:[l.jsx("select",{...se,"aria-hidden":"true",className:v(o.native,re),onChange:ae,ref:Q,tabIndex:-1,value:N,children:$.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":y["aria-label"]??c??R,className:o["combobox-input"],disabled:y.disabled,onChange:e=>{S(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:R||void 0,ref:m,role:"combobox",type:"text",value:j})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${w} ${w}-value`:void 0,className:v(o.trigger,(C==null?void 0:C.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:y.disabled,onClick:()=>p(e=>!e),ref:W,style:le,variant:"simple",children:l.jsx("span",{className:o.text,id:`${w}-value`,children:A(C)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"MagnifyingGlass",onChange:e=>S(e.target.value),placeholder:R,ref:m,style:oe,type:"search",value:j}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[T.map(e=>{const d=e.value===N;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:v(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:A(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),E&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":L(s.render(_))||_,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(_)})})}),T.length===0&&!E&&l.jsx("li",{className:o.empty,children:t})]})]})]});return c?l.jsxs("div",{className:v(o.label,g==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:w,children:ie}),J]}):J};exports.Dropdown=Fe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|