@namroodinc/liquid-editorial 0.6.5 → 0.6.7
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/README.md +23 -0
- package/UPGRADING.md +86 -0
- package/dist/chunks/{Avatar-C9ublbzK.cjs → Avatar-B_2lI7fS.cjs} +2 -2
- package/dist/chunks/{Avatar-C9ublbzK.cjs.map → Avatar-B_2lI7fS.cjs.map} +1 -1
- package/dist/chunks/{Avatar-BtblwihO.js → Avatar-DdFEOumt.js} +2 -2
- package/dist/chunks/{Avatar-BtblwihO.js.map → Avatar-DdFEOumt.js.map} +1 -1
- package/dist/chunks/{Board-z688-51u.js → Board-B8wK079I.js} +2 -2
- package/dist/chunks/{Board-z688-51u.js.map → Board-B8wK079I.js.map} +1 -1
- package/dist/chunks/{Board-CUt4j2-8.cjs → Board-CMf5Azt0.cjs} +2 -2
- package/dist/chunks/{Board-CUt4j2-8.cjs.map → Board-CMf5Azt0.cjs.map} +1 -1
- package/dist/chunks/{ColourField-DXGpNP08.js → ColourField-DC6cLb9h.js} +2 -2
- package/dist/chunks/{ColourField-DXGpNP08.js.map → ColourField-DC6cLb9h.js.map} +1 -1
- package/dist/chunks/{ColourField-BqhYB4ZE.cjs → ColourField-NnFxLEsh.cjs} +2 -2
- package/dist/chunks/{ColourField-BqhYB4ZE.cjs.map → ColourField-NnFxLEsh.cjs.map} +1 -1
- package/dist/chunks/EntryPicker-CR8Phuzl.js +180 -0
- package/dist/chunks/EntryPicker-CR8Phuzl.js.map +1 -0
- package/dist/chunks/EntryPicker-D7JIgx23.cjs +2 -0
- package/dist/chunks/EntryPicker-D7JIgx23.cjs.map +1 -0
- package/dist/chunks/{FormEditor-C5XtP-N7.js → FormEditor-BSfxVqLn.js} +192 -146
- package/dist/chunks/FormEditor-BSfxVqLn.js.map +1 -0
- package/dist/chunks/FormEditor-DNcSAnRF.cjs +2 -0
- package/dist/chunks/FormEditor-DNcSAnRF.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-DEJ-u-ZR.js → RichTextEditor-CNkwWist.js} +2 -2
- package/dist/chunks/{RichTextEditor-DEJ-u-ZR.js.map → RichTextEditor-CNkwWist.js.map} +1 -1
- package/dist/chunks/{RichTextEditor-Ddk7qaqg.cjs → RichTextEditor-DAnjElUO.cjs} +2 -2
- package/dist/chunks/{RichTextEditor-Ddk7qaqg.cjs.map → RichTextEditor-DAnjElUO.cjs.map} +1 -1
- package/dist/chunks/context-BONPXF-V.cjs.map +1 -1
- package/dist/chunks/context-CXvOl4Kt.js.map +1 -1
- package/dist/chunks/frame-BBVQTBcX.cjs +2 -0
- package/dist/chunks/frame-BBVQTBcX.cjs.map +1 -0
- package/dist/chunks/frame-De6IuTQz.js +189 -0
- package/dist/chunks/frame-De6IuTQz.js.map +1 -0
- package/dist/chunks/group-Bj9ZKc0R.cjs +2 -0
- package/dist/chunks/group-Bj9ZKc0R.cjs.map +1 -0
- package/dist/chunks/group-Ckz4Xya-.js +34 -0
- package/dist/chunks/group-Ckz4Xya-.js.map +1 -0
- package/dist/chunks/limit-BX6-o1a2.cjs +2 -0
- package/dist/chunks/limit-BX6-o1a2.cjs.map +1 -0
- package/dist/chunks/limit-ChteDN4T.js +18 -0
- package/dist/chunks/limit-ChteDN4T.js.map +1 -0
- package/dist/chunks/mergeRefs-C6_5pADN.js +19 -0
- package/dist/chunks/mergeRefs-C6_5pADN.js.map +1 -0
- package/dist/chunks/mergeRefs-CZ-SArlE.cjs +2 -0
- package/dist/chunks/mergeRefs-CZ-SArlE.cjs.map +1 -0
- package/dist/chunks/useLimit-BOmHKdJE.js +73 -0
- package/dist/chunks/useLimit-BOmHKdJE.js.map +1 -0
- package/dist/chunks/useLimit-DXe_VmYl.cjs +2 -0
- package/dist/chunks/useLimit-DXe_VmYl.cjs.map +1 -0
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.js +1 -1
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.js +1 -1
- package/dist/components/EntryPicker/index.cjs +1 -2
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +1 -171
- package/dist/components/EntryPicker/limit.d.cts +8 -0
- package/dist/components/EntryPicker/limit.d.cts.map +1 -0
- package/dist/components/EntryPicker/limit.d.ts +8 -0
- package/dist/components/EntryPicker/limit.d.ts.map +1 -0
- package/dist/components/Field/context.d.cts +6 -0
- package/dist/components/Field/context.d.cts.map +1 -1
- package/dist/components/Field/context.d.ts +6 -0
- package/dist/components/Field/context.d.ts.map +1 -1
- package/dist/components/Field/frame.d.cts +1 -1
- package/dist/components/Field/frame.d.cts.map +1 -1
- package/dist/components/Field/frame.d.ts +1 -1
- package/dist/components/Field/frame.d.ts.map +1 -1
- package/dist/components/Field/group.d.cts +1 -1
- package/dist/components/Field/group.d.cts.map +1 -1
- package/dist/components/Field/group.d.ts +1 -1
- package/dist/components/Field/group.d.ts.map +1 -1
- package/dist/components/Field/header.d.cts +12 -0
- package/dist/components/Field/header.d.cts.map +1 -0
- package/dist/components/Field/header.d.ts +12 -0
- package/dist/components/Field/header.d.ts.map +1 -0
- package/dist/components/Field/index.cjs +1 -1
- package/dist/components/Field/index.cjs.map +1 -1
- package/dist/components/Field/index.d.cts +1 -1
- package/dist/components/Field/index.d.cts.map +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/Field/limit-reading.d.cts +12 -0
- package/dist/components/Field/limit-reading.d.cts.map +1 -0
- package/dist/components/Field/limit-reading.d.ts +12 -0
- package/dist/components/Field/limit-reading.d.ts.map +1 -0
- package/dist/components/Field/limit.d.cts +8 -0
- package/dist/components/Field/limit.d.cts.map +1 -0
- package/dist/components/Field/limit.d.ts +8 -0
- package/dist/components/Field/limit.d.ts.map +1 -0
- package/dist/components/Field/style.css +77 -0
- package/dist/components/Field/types.d.cts +12 -1
- package/dist/components/Field/types.d.cts.map +1 -1
- package/dist/components/Field/types.d.ts +12 -1
- package/dist/components/Field/types.d.ts.map +1 -1
- package/dist/components/Field/useLimit.d.cts +18 -0
- package/dist/components/Field/useLimit.d.cts.map +1 -0
- package/dist/components/Field/useLimit.d.ts +18 -0
- package/dist/components/Field/useLimit.d.ts.map +1 -0
- package/dist/components/FormEditor/README.md +62 -0
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +21 -8
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +21 -8
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.cjs.map +1 -1
- package/dist/components/SearchField/index.d.cts.map +1 -1
- package/dist/components/SearchField/index.d.ts.map +1 -1
- package/dist/components/SearchField/index.js +27 -22
- package/dist/components/SearchField/index.js.map +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.js +1 -1
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/TagsInput/index.cjs +1 -1
- package/dist/components/TagsInput/index.cjs.map +1 -1
- package/dist/components/TagsInput/index.d.cts.map +1 -1
- package/dist/components/TagsInput/index.d.ts.map +1 -1
- package/dist/components/TagsInput/index.js +36 -30
- package/dist/components/TagsInput/index.js.map +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.cjs.map +1 -1
- package/dist/components/TextField/index.d.cts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index.js +35 -20
- package/dist/components/TextField/index.js.map +1 -1
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/internal/mergeRefs.d.cts +5 -1
- package/dist/internal/mergeRefs.d.cts.map +1 -1
- package/dist/internal/mergeRefs.d.ts +5 -1
- package/dist/internal/mergeRefs.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/FormEditor-BbsvbufQ.cjs +0 -2
- package/dist/chunks/FormEditor-BbsvbufQ.cjs.map +0 -1
- package/dist/chunks/FormEditor-C5XtP-N7.js.map +0 -1
- package/dist/chunks/frame-Bs_jaQRw.js +0 -70
- package/dist/chunks/frame-Bs_jaQRw.js.map +0 -1
- package/dist/chunks/frame-CNxvbg0D.cjs +0 -2
- package/dist/chunks/frame-CNxvbg0D.cjs.map +0 -1
- package/dist/chunks/group-CzbacuAY.js +0 -29
- package/dist/chunks/group-CzbacuAY.js.map +0 -1
- package/dist/chunks/group-pKDQtq-9.cjs +0 -2
- package/dist/chunks/group-pKDQtq-9.cjs.map +0 -1
- package/dist/chunks/mergeRefs-Bc3qS0Tt.cjs +0 -2
- package/dist/chunks/mergeRefs-Bc3qS0Tt.cjs.map +0 -1
- package/dist/chunks/mergeRefs-DGM402mE.js +0 -10
- package/dist/chunks/mergeRefs-DGM402mE.js.map +0 -1
- package/dist/components/EntryPicker/index.cjs.map +0 -1
- package/dist/components/EntryPicker/index.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as e } from "./frame-De6IuTQz.js";
|
|
2
|
+
import { t } from "./useLimit-BOmHKdJE.js";
|
|
3
|
+
import { r as n, t as r } from "./binding-Bshy43sG.js";
|
|
4
|
+
import { useEffect as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Field/group.tsx
|
|
7
|
+
function o({ label: o, hint: s, error: c, isRequired: l, count: u, limit: d, limitDisplay: f, limitVisibility: p, showLimitRing: m, children: h, className: g, ..._ }) {
|
|
8
|
+
let { frame: v, attributes: y } = n(_);
|
|
9
|
+
return t(_, d), i(() => {
|
|
10
|
+
if (v && u !== void 0) return v.reportCount(u), () => v.reportCount(void 0);
|
|
11
|
+
}, [v, u]), v ? /* @__PURE__ */ a("div", {
|
|
12
|
+
...y,
|
|
13
|
+
className: g,
|
|
14
|
+
children: h
|
|
15
|
+
}) : /* @__PURE__ */ a(e, {
|
|
16
|
+
label: o,
|
|
17
|
+
hint: s,
|
|
18
|
+
error: c,
|
|
19
|
+
isRequired: l,
|
|
20
|
+
count: u,
|
|
21
|
+
limit: d,
|
|
22
|
+
limitDisplay: f,
|
|
23
|
+
limitVisibility: p,
|
|
24
|
+
showLimitRing: m,
|
|
25
|
+
isGroup: !0,
|
|
26
|
+
className: g,
|
|
27
|
+
groupBinding: r(_),
|
|
28
|
+
children: () => h
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { o as t };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=group-Ckz4Xya-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-Ckz4Xya-.js","names":["FieldFrame","useGroupBinding","fieldAttributes","FieldGroup","binding","useReportedLimit","limit","useEffect","frame","count","attributes","children"],"sources":["../../src/components/Field/group.tsx"],"sourcesContent":["import { useEffect, type ReactNode } from \"react\";\nimport { FieldFrame } from \"./frame\";\nimport { fieldAttributes, useGroupBinding } from \"./binding\";\nimport type { FieldBinding, FieldProps } from \"./types\";\nimport { useReportedLimit } from \"./useLimit\";\n\nexport interface FieldGroupProps extends FieldBinding, Omit<FieldProps, \"children\" | \"isGroup\"> {\n children: ReactNode;\n className?: string;\n}\n\n/**\n * Standalone groups render their own Field frame. Bound to an enclosing Field,\n * they render only their controls and report their count to its label.\n */\nexport function FieldGroup({\n label,\n hint,\n error,\n isRequired,\n count,\n limit,\n limitDisplay,\n limitVisibility,\n showLimitRing,\n children,\n className,\n ...binding\n}: FieldGroupProps) {\n const { frame, attributes } = useGroupBinding(binding);\n useReportedLimit(binding, limit);\n useEffect(() => {\n if (!frame || count === undefined) {\n return;\n }\n frame.reportCount(count);\n return () => frame.reportCount(undefined);\n }, [frame, count]);\n if (frame) {\n return (\n <div\n {...attributes}\n className={className}\n >\n {children}\n </div>\n );\n }\n return (\n <FieldFrame\n label={label}\n hint={hint}\n error={error}\n isRequired={isRequired}\n count={count}\n limit={limit}\n limitDisplay={limitDisplay}\n limitVisibility={limitVisibility}\n showLimitRing={showLimitRing}\n isGroup\n className={className}\n groupBinding={fieldAttributes(binding)}\n >\n {() => children}\n </FieldFrame>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgBG,EAAW,EACzB,UACA,SACA,UACA,eACA,UACA,UACA,iBACA,oBACA,kBACA,aACA,cACA,GAAGC,KACe;CAClB,IAAM,EAAE,UAAO,kBAAeH,EAAgBG,CAAO;CAmBrD,OAlBAC,EAAiBD,GAASE,CAAK,GAC/BC,QAAgB;EACd,IAAKC,KAASC,MAAU,KAAA,GAIxB,OADAD,EAAM,YAAYC,CAAK,SACVD,EAAM,YAAY,KAAA,CAAS;CAC1C,GAAG,CAACA,GAAOC,CAAK,CAAC,GACbD,IAEA,kBAAC,OAAD;EACE,GAAIE;EACO;EAEV;CACE,CAAA,IAIP,kBAACV,GAAD;EACS;EACD;EACC;EACK;EACL;EACA;EACO;EACG;EACF;EACf,SAAA;EACW;EACX,cAAcE,EAAgBE,CAAO;EAE9B,gBAAAO;CACG,CAAA;AAEhB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){return!!(e&&Number.isFinite(e.max)&&e.max>0&&Number.isFinite(e.count)&&e.count>=0)}function t(t,n){return e(t)&&(n!==`nearLimit`||t.count/t.max>=.8)?t:void 0}function n({count:e,max:t}){let n=e/t;return n>=1?`danger`:n>=.85?`warning`:void 0}function r({count:e,max:t},n){return n===`remaining`?`${t-e} remaining`:`${e} of ${t} used`}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
2
|
+
//# sourceMappingURL=limit-BX6-o1a2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-BX6-o1a2.cjs","names":["usableLimit","limit","visibleLimit","visibility","limitTone","ratio","count","max","limitDescription","display"],"sources":["../../src/components/Field/limit.ts"],"sourcesContent":["import type { FieldLimit, FieldLimitOptions } from \"./types\";\n\n/** Keep invalid limits out of the presentation without changing input enforcement. */\nexport function usableLimit(limit: FieldLimit | undefined): limit is FieldLimit {\n return Boolean(\n limit &&\n Number.isFinite(limit.max) &&\n limit.max > 0 &&\n Number.isFinite(limit.count) &&\n limit.count >= 0,\n );\n}\n\nexport function visibleLimit(\n limit: FieldLimit | undefined,\n visibility: FieldLimitOptions[\"limitVisibility\"],\n) {\n return usableLimit(limit) && (visibility !== \"nearLimit\" || limit.count / limit.max >= 0.8)\n ? limit\n : undefined;\n}\n\n/** Warning from 85% usage, danger at and above the limit. */\nexport function limitTone({ count, max }: FieldLimit) {\n const ratio = count / max;\n return ratio >= 1 ? \"danger\" : ratio >= 0.85 ? \"warning\" : undefined;\n}\n\nexport function limitDescription(\n { count, max }: FieldLimit,\n display: FieldLimitOptions[\"limitDisplay\"],\n) {\n return display === \"remaining\" ? `${max - count} remaining` : `${count} of ${max} used`;\n}\n"],"mappings":"AAGA,SAAgBA,EAAY,EAAoD,CAC9E,MAAO,GACLC,GACA,OAAO,SAASA,EAAM,GAAG,GACzBA,EAAM,IAAM,GACZ,OAAO,SAASA,EAAM,KAAK,GAC3BA,EAAM,OAAS,EAEnB,CAEA,SAAgBC,EACd,EACA,EACA,CACA,OAAOF,EAAYC,CAAK,IAAME,IAAe,aAAeF,EAAM,MAAQA,EAAM,KAAO,IACnFA,EACA,IAAA,EACN,CAGA,SAAgBG,EAAU,CAAE,QAAO,OAAmB,CACpD,IAAMC,EAAQC,EAAQC,EACtB,OAAOF,GAAS,EAAI,SAAWA,GAAS,IAAO,UAAY,IAAA,EAC7D,CAEA,SAAgBG,EACd,CAAE,QAAO,OACT,EACA,CACA,OAAOC,IAAY,YAAc,GAAGF,EAAMD,EAAM,YAAc,GAAGA,EAAM,MAAMC,EAAI,MACnF,C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/Field/limit.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return !!(e && Number.isFinite(e.max) && e.max > 0 && Number.isFinite(e.count) && e.count >= 0);
|
|
4
|
+
}
|
|
5
|
+
function t(t, n) {
|
|
6
|
+
return e(t) && (n !== "nearLimit" || t.count / t.max >= .8) ? t : void 0;
|
|
7
|
+
}
|
|
8
|
+
function n({ count: e, max: t }) {
|
|
9
|
+
let n = e / t;
|
|
10
|
+
return n >= 1 ? "danger" : n >= .85 ? "warning" : void 0;
|
|
11
|
+
}
|
|
12
|
+
function r({ count: e, max: t }, n) {
|
|
13
|
+
return n === "remaining" ? `${t - e} remaining` : `${e} of ${t} used`;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as i, n, e as r, r as t };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=limit-ChteDN4T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-ChteDN4T.js","names":["usableLimit","limit","visibleLimit","visibility","limitTone","ratio","count","max","limitDescription","display"],"sources":["../../src/components/Field/limit.ts"],"sourcesContent":["import type { FieldLimit, FieldLimitOptions } from \"./types\";\n\n/** Keep invalid limits out of the presentation without changing input enforcement. */\nexport function usableLimit(limit: FieldLimit | undefined): limit is FieldLimit {\n return Boolean(\n limit &&\n Number.isFinite(limit.max) &&\n limit.max > 0 &&\n Number.isFinite(limit.count) &&\n limit.count >= 0,\n );\n}\n\nexport function visibleLimit(\n limit: FieldLimit | undefined,\n visibility: FieldLimitOptions[\"limitVisibility\"],\n) {\n return usableLimit(limit) && (visibility !== \"nearLimit\" || limit.count / limit.max >= 0.8)\n ? limit\n : undefined;\n}\n\n/** Warning from 85% usage, danger at and above the limit. */\nexport function limitTone({ count, max }: FieldLimit) {\n const ratio = count / max;\n return ratio >= 1 ? \"danger\" : ratio >= 0.85 ? \"warning\" : undefined;\n}\n\nexport function limitDescription(\n { count, max }: FieldLimit,\n display: FieldLimitOptions[\"limitDisplay\"],\n) {\n return display === \"remaining\" ? `${max - count} remaining` : `${count} of ${max} used`;\n}\n"],"mappings":";AAGA,SAAgBA,EAAY,GAAoD;CAC9E,OAAO,GACLC,KACA,OAAO,SAASA,EAAM,GAAG,KACzBA,EAAM,MAAM,KACZ,OAAO,SAASA,EAAM,KAAK,KAC3BA,EAAM,SAAS;AAEnB;AAEA,SAAgBC,EACd,GACA,GACA;CACA,OAAOF,EAAYC,CAAK,MAAME,MAAe,eAAeF,EAAM,QAAQA,EAAM,OAAO,MACnFA,IACA,KAAA;AACN;AAGA,SAAgBG,EAAU,EAAE,UAAO,UAAmB;CACpD,IAAMC,IAAQC,IAAQC;CACtB,OAAOF,KAAS,IAAI,WAAWA,KAAS,MAAO,YAAY,KAAA;AAC7D;AAEA,SAAgBG,EACd,EAAE,UAAO,UACT,GACA;CACA,OAAOC,MAAY,cAAc,GAAGF,IAAMD,EAAM,cAAc,GAAGA,EAAM,MAAMC,EAAI;AACnF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/internal/mergeRefs.ts
|
|
2
|
+
function e(...e) {
|
|
3
|
+
return (t) => {
|
|
4
|
+
let n = e.map((e) => {
|
|
5
|
+
if (typeof e == "function") {
|
|
6
|
+
let n = e(t);
|
|
7
|
+
return typeof n == "function" ? n : () => e(null);
|
|
8
|
+
}
|
|
9
|
+
if (e) return e.current = t, () => {
|
|
10
|
+
e.current = null;
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
return () => n.forEach((e) => e?.());
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as t };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=mergeRefs-C6_5pADN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeRefs-C6_5pADN.js","names":["mergeRefs","refs","cleanups","ref","cleanup","node"],"sources":["../../src/internal/mergeRefs.ts"],"sourcesContent":["import type { Ref, RefCallback } from \"react\";\n\n/**\n * Send the same node to internal and forwarded refs. The returned cleanup keeps\n * host-ref semantics on React 19: a callback ref's own cleanup runs on detach in\n * place of a null call. React 18 ignores it and detaches with null as before.\n */\nexport function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T> {\n return (node) => {\n const cleanups = refs.map((ref) => {\n if (typeof ref === \"function\") {\n const cleanup = ref(node);\n return typeof cleanup === \"function\" ? cleanup : () => ref(null);\n }\n if (ref) {\n ref.current = node;\n return () => {\n ref.current = null;\n };\n }\n });\n return () => cleanups.forEach((cleanup) => cleanup?.());\n };\n}\n"],"mappings":";AAOA,SAAgBA,EAAa,GAAGC,GAA8C;CAC5E,QAAQ,MAAS;EACf,IAAMC,IAAWD,EAAK,KAAK,MAAQ;GACjC,IAAI,OAAOE,KAAQ,YAAY;IAC7B,IAAMC,IAAUD,EAAIE,CAAI;IACxB,OAAO,OAAOD,KAAY,aAAaA,UAAgBD,EAAI,IAAI;GACjE;GACA,IAAIA,GAEF,OADA,EAAI,UAAUE,SACD;IACX,EAAI,UAAU;GAChB;EAEJ,CAAC;EACD,aAAaH,EAAS,SAAS,MAAYE,IAAU,CAAC;CACxD;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(...e){return t=>{let n=e.map(e=>{if(typeof e==`function`){let n=e(t);return typeof n==`function`?n:()=>e(null)}if(e)return e.current=t,()=>{e.current=null}});return()=>n.forEach(e=>e?.())}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
2
|
+
//# sourceMappingURL=mergeRefs-CZ-SArlE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeRefs-CZ-SArlE.cjs","names":["mergeRefs","refs","cleanups","ref","cleanup","node"],"sources":["../../src/internal/mergeRefs.ts"],"sourcesContent":["import type { Ref, RefCallback } from \"react\";\n\n/**\n * Send the same node to internal and forwarded refs. The returned cleanup keeps\n * host-ref semantics on React 19: a callback ref's own cleanup runs on detach in\n * place of a null call. React 18 ignores it and detaches with null as before.\n */\nexport function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T> {\n return (node) => {\n const cleanups = refs.map((ref) => {\n if (typeof ref === \"function\") {\n const cleanup = ref(node);\n return typeof cleanup === \"function\" ? cleanup : () => ref(null);\n }\n if (ref) {\n ref.current = node;\n return () => {\n ref.current = null;\n };\n }\n });\n return () => cleanups.forEach((cleanup) => cleanup?.());\n };\n}\n"],"mappings":"AAOA,SAAgBA,EAAa,GAAGC,EAA8C,CAC5E,MAAQ,IAAS,CACf,IAAMC,EAAWD,EAAK,IAAK,GAAQ,CACjC,GAAI,OAAOE,GAAQ,WAAY,CAC7B,IAAMC,EAAUD,EAAIE,CAAI,EACxB,OAAO,OAAOD,GAAY,WAAaA,MAAgBD,EAAI,IAAI,CACjE,CACA,GAAIA,EAEF,MADA,GAAI,QAAUE,MACD,CACX,EAAI,QAAU,IAChB,CAEJ,CAAC,EACD,UAAaH,EAAS,QAAS,GAAYE,IAAU,CAAC,CACxD,CACF,C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as e } from "./context-CXvOl4Kt.js";
|
|
2
|
+
import { r as t } from "./limit-ChteDN4T.js";
|
|
3
|
+
import { useContext as n, useEffect as r, useId as i, useMemo as a } from "react";
|
|
4
|
+
//#region src/components/Field/useLimit.ts
|
|
5
|
+
function o(o) {
|
|
6
|
+
let s = n(e), c = i(), l = s && o["aria-labelledby"] === s.labelId ? s.reportLimit : void 0, u = a(() => l && ((e) => l(c, t(e) ? e : void 0)), [l, c]);
|
|
7
|
+
return r(() => () => u?.(void 0), [u]), u;
|
|
8
|
+
}
|
|
9
|
+
function s(e, t) {
|
|
10
|
+
let n = o(e), i = t?.count, a = t?.max;
|
|
11
|
+
r(() => {
|
|
12
|
+
n?.(i === void 0 || a === void 0 ? void 0 : {
|
|
13
|
+
count: i,
|
|
14
|
+
max: a
|
|
15
|
+
});
|
|
16
|
+
}, [
|
|
17
|
+
n,
|
|
18
|
+
i,
|
|
19
|
+
a
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
function c(e, { value: t, defaultValue: n, maxLength: i, ...a }) {
|
|
23
|
+
let s = o(a), c = t == null ? void 0 : String(t).length;
|
|
24
|
+
r(() => {
|
|
25
|
+
let t = e.current;
|
|
26
|
+
if (s && t) {
|
|
27
|
+
if (i === void 0) s(void 0);
|
|
28
|
+
else if (c !== void 0) s({
|
|
29
|
+
count: c,
|
|
30
|
+
max: i
|
|
31
|
+
});
|
|
32
|
+
else return l(t, () => s({
|
|
33
|
+
count: t.value.length,
|
|
34
|
+
max: i
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
}, [
|
|
38
|
+
e,
|
|
39
|
+
s,
|
|
40
|
+
i,
|
|
41
|
+
c,
|
|
42
|
+
n == null ? "" : String(n)
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
function l(e, t) {
|
|
46
|
+
let n, r = (r) => {
|
|
47
|
+
r.target === e.form && (clearTimeout(n), n = setTimeout(t));
|
|
48
|
+
}, i = e.ownerDocument, a = u(e, t);
|
|
49
|
+
return e.addEventListener("input", t), e.addEventListener("change", t), i.addEventListener("reset", r, !0), t(), () => {
|
|
50
|
+
clearTimeout(n), a(), e.removeEventListener("input", t), e.removeEventListener("change", t), i.removeEventListener("reset", r, !0);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function u(e, t) {
|
|
54
|
+
let n = Object.getOwnPropertyDescriptor(e, "value"), r = n ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), "value"), i = r?.get, a = r?.set;
|
|
55
|
+
if (!i || !a || n?.configurable === !1) return () => {};
|
|
56
|
+
let o = !0, s = {
|
|
57
|
+
configurable: !0,
|
|
58
|
+
enumerable: r.enumerable,
|
|
59
|
+
get() {
|
|
60
|
+
return i.call(this);
|
|
61
|
+
},
|
|
62
|
+
set(e) {
|
|
63
|
+
a.call(this, e), o && t();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return Object.defineProperty(e, "value", s), () => {
|
|
67
|
+
o = !1, Object.getOwnPropertyDescriptor(e, "value")?.set === s.set && (n ? Object.defineProperty(e, "value", n) : Reflect.deleteProperty(e, "value"));
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { c as n, s as t };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=useLimit-BOmHKdJE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLimit-BOmHKdJE.js","names":["FieldFrameContext","usableLimit","useLimitReport","frame","useContext","key","useId","reportLimit","binding","report","useMemo","limit","useEffect","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./context-BONPXF-V.cjs"),t=require("./limit-BX6-o1a2.cjs");let n=require("react");function r(r){let i=(0,n.useContext)(e.t),a=(0,n.useId)(),o=i&&r[`aria-labelledby`]===i.labelId?i.reportLimit:void 0,s=(0,n.useMemo)(()=>o&&(e=>o(a,t.r(e)?e:void 0)),[o,a]);return(0,n.useEffect)(()=>()=>s?.(void 0),[s]),s}function i(e,t){let i=r(e),a=t?.count,o=t?.max;(0,n.useEffect)(()=>{i?.(a===void 0||o===void 0?void 0:{count:a,max:o})},[i,a,o])}function a(e,{value:t,defaultValue:i,maxLength:a,...s}){let c=r(s),l=t==null?void 0:String(t).length;(0,n.useEffect)(()=>{let t=e.current;if(c&&t){if(a===void 0)c(void 0);else if(l!==void 0)c({count:l,max:a});else return o(t,()=>c({count:t.value.length,max:a}))}},[e,c,a,l,i==null?``:String(i)])}function o(e,t){let n,r=r=>{r.target===e.form&&(clearTimeout(n),n=setTimeout(t))},i=e.ownerDocument,a=s(e,t);return e.addEventListener(`input`,t),e.addEventListener(`change`,t),i.addEventListener(`reset`,r,!0),t(),()=>{clearTimeout(n),a(),e.removeEventListener(`input`,t),e.removeEventListener(`change`,t),i.removeEventListener(`reset`,r,!0)}}function s(e,t){let n=Object.getOwnPropertyDescriptor(e,`value`),r=n??Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`),i=r?.get,a=r?.set;if(!i||!a||n?.configurable===!1)return()=>{};let o=!0,s={configurable:!0,enumerable:r.enumerable,get(){return i.call(this)},set(e){a.call(this,e),o&&t()}};return Object.defineProperty(e,"value",s),()=>{o=!1,Object.getOwnPropertyDescriptor(e,`value`)?.set===s.set&&(n?Object.defineProperty(e,"value",n):Reflect.deleteProperty(e,`value`))}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
2
|
+
//# sourceMappingURL=useLimit-DXe_VmYl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLimit-DXe_VmYl.cjs","names":["useContext","FieldFrameContext","useId","useMemo","usableLimit","require_context","require_limit","react","useLimitReport","frame","key","reportLimit","binding","report","limit","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/mergeRefs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),n=require("../Drawer/index.cjs"),r=require("../SideNav/index.cjs"),i=require("../TopNav/index.cjs"),a=require("../../chunks/observeElementWidth-BCJM2FAw.cjs");let o=require("react"),s=require("react/jsx-runtime");var c=(0,o.forwardRef)(function({brand:c,navigation:l,actions:u,navigationLabel:d=`Main`,scrollMode:f=`container`,contentPadding:p=`default`,className:m,children:h,...g},_){let[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(!1),S=(0,o.useRef)(null),C=(0,o.useRef)(null),w=(0,o.useRef)(!1),T=(0,o.useId)(),E=(0,o.useMemo)(()=>t.t(y,_),[_]);(0,o.useEffect)(()=>v?a.t(v,e=>{e<768||(document.getElementById(T)?.contains(document.activeElement)&&(w.current=!0),x(!1))}):void 0,[v,T]),(0,o.useEffect)(()=>{!b&&w.current&&(w.current=!1,(S.current?.querySelector(`[aria-current='page']`)??S.current?.querySelector(`a[href]`)??C.current)?.focus())},[b]);let D=u?.(`drawer`);return(0,s.jsxs)(`div`,{...g,ref:E,"data-scroll-mode":f,"data-content-padding":p,className:[`ds-appshell`,m].filter(Boolean).join(` `),children:[(0,s.jsxs)(`div`,{className:`ds-appshell__frame`,"aria-hidden":b||void 0,ref:e=>{e&&(e.inert=b)},children:[(0,s.jsx)(i.TopNav,{brand:c,actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{className:`ds-appshell__actions`,children:u?.(`topnav`)}),(0,s.jsx)(e.Button,{variant:`simple`,size:`lg`,isIconOnly:!0,iconStart:`menu`,className:`ds-appshell__toggle`,"aria-label":`Open navigation`,"aria-expanded":b,"aria-controls":T,onClick:()=>x(!0)})]})}),(0,s.jsxs)(`div`,{className:`ds-appshell__body`,children:[(0,s.jsx)(r.SideNav,{ref:S,className:`ds-appshell__desktop-nav`,label:d,children:l}),(0,s.jsx)(`main`,{ref:C,className:`ds-appshell__main`,tabIndex:-1,children:h})]})]}),(0,s.jsx)(n.Drawer,{id:T,isOpen:b,onClose:()=>x(!1),variant:`navigation`,side:`end`,portalContainer:f===`document`?void 0:v,dir:g.dir,title:c,"aria-label":`Navigation`,closeLabel:`Close navigation`,footer:D?(0,s.jsx)(r.SideNavFooter,{children:D}):void 0,children:(0,s.jsx)(r.SideNav,{className:`ds-appshell__mobile-nav`,label:d,onClick:e=>{let t=e.target instanceof Element?e.target.closest(`a[href]`):null,n=e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||t?.target===`_blank`;t&&!n&&x(!1)},children:l})})]})});exports.AppShell=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button as e } from "../Button/index.js";
|
|
2
|
-
import { t } from "../../chunks/mergeRefs-
|
|
2
|
+
import { t } from "../../chunks/mergeRefs-C6_5pADN.js";
|
|
3
3
|
import { Drawer as n } from "../Drawer/index.js";
|
|
4
4
|
import { SideNav as r, SideNavFooter as i } from "../SideNav/index.js";
|
|
5
5
|
import { TopNav as a } from "../TopNav/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Avatar-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Avatar-B_2lI7fS.cjs");exports.Avatar=e.t,exports.AvatarGroup=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Avatar, n as AvatarGroup } from "../../chunks/Avatar-
|
|
1
|
+
export { t as Avatar, n as AvatarGroup } from "../../chunks/Avatar-DdFEOumt.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Board-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Board-CMf5Azt0.cjs");exports.Board=e.t,exports.BoardCard=e.n,exports.BoardColumn=e.r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Board, n as BoardCard, r as BoardColumn } from "../../chunks/Board-
|
|
1
|
+
export { t as Board, n as BoardCard, r as BoardColumn } from "../../chunks/Board-B8wK079I.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-Bj9ZKc0R.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({isIndeterminate:e=!1,className:t,children:i,...a},o){let s=(0,n.useRef)(null);return(0,n.useEffect)(()=>{s.current&&(s.current.indeterminate=e)},[e]),(0,r.jsxs)(`label`,{className:[`ds-choice`,t].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{type:`checkbox`,className:`ds-choice__control`,"data-kind":`checkbox`,ref:e=>{s.current=e,typeof o==`function`?o(e):o&&(o.current=e)},...a}),i&&(0,r.jsx)(`span`,{className:`ds-choice__label`,children:i})]})}),a=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsxs)(`label`,{className:[`ds-choice`,e].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:i,type:`radio`,className:`ds-choice__control`,"data-kind":`radio`,...n}),t&&(0,r.jsx)(`span`,{className:`ds-choice__label`,children:t})]})});function o({label:n,columns:i=1,children:a,className:o,...s}){return(0,r.jsx)(e.t,{...s,label:n,className:[`ds-choice-group`,o].filter(Boolean).join(` `),children:i===1?(0,r.jsx)(t.Stack,{gap:`sm`,children:a}):(0,r.jsx)(t.Grid,{columns:i,gap:`sm`,className:`ds-choice-group__grid ds-field-group-grid`,style:{"--field-group-columns":i},children:a})})}exports.Checkbox=i,exports.ChoiceGroup=o,exports.Radio=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/group-
|
|
1
|
+
import { t as e } from "../../chunks/group-Ckz4Xya-.js";
|
|
2
2
|
import { Grid as t, Stack as n } from "../Grid/index.js";
|
|
3
3
|
import { forwardRef as r, useEffect as i, useRef as a } from "react";
|
|
4
4
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/ColourField-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/ColourField-NnFxLEsh.cjs");exports.ColourField=e.t,exports.ColourPanel=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ColourField, n as ColourPanel } from "../../chunks/ColourField-
|
|
1
|
+
export { t as ColourField, n as ColourPanel } from "../../chunks/ColourField-DC6cLb9h.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/transitionDuration-B4UnScFc.cjs"),n=require("../../chunks/mergeRefs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/transitionDuration-B4UnScFc.cjs"),n=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),r=require("../../chunks/useModalDialog-Cgus9408.cjs"),i=require("../../chunks/portalScope-BVA1-Ypu.cjs");let a=require("react"),o=require("react-dom"),s=require("react/jsx-runtime");function c(e,n){let[r,i]=(0,a.useState)(e),[o,s]=(0,a.useState)(!1);return r!==e&&(i(e),s(!e)),(0,a.useEffect)(()=>{if(!o||e)return;let r=t.t(n.current),i=window.setTimeout(()=>s(!1),r);return()=>window.clearTimeout(i)},[o,e,n]),[o,s]}var l=(0,a.forwardRef)(function({isOpen:t,onClose:l,title:u,description:d,side:f=`end`,size:p=`md`,variant:m=`default`,closeLabel:h=`Close`,portalContainer:g,footer:_,className:v,children:y,...b},x){let S=(0,a.useRef)(null),C=(0,a.useRef)(null),w=(0,a.useRef)(null),T=(0,a.useId)(),E=(0,a.useId)(),[D,O]=c(t,C),{onScrimMouseDown:k}=r.t({isOpen:t,panelRef:S,onClose:l,initialFocus:m===`navigation`?()=>w.current:void 0,preventScroll:!0,container:g});return i.n(C,t,{keepDir:b.dir!==void 0}),!t&&!D||typeof document>`u`?null:(0,o.createPortal)((0,s.jsx)(`div`,{ref:e=>{C.current=e,e&&(e.inert=!t)},className:`ds-drawer-scrim`,dir:b.dir,"data-side":f,"data-variant":m,"data-contained":g?``:void 0,"data-state":t?`open`:`closed`,"aria-hidden":!t||void 0,onTransitionEnd:e=>{e.target===e.currentTarget&&e.propertyName===`opacity`&&!t&&O(!1)},onMouseDown:k,children:(0,s.jsxs)(`div`,{...b,ref:n.t(S,x),role:`dialog`,"aria-modal":`true`,"aria-labelledby":b[`aria-label`]?void 0:b[`aria-labelledby`]??T,"aria-describedby":d?E:void 0,tabIndex:-1,"data-side":f,"data-size":p,"data-variant":m,className:[`ds-drawer`,`ds-field-surface`,v].filter(Boolean).join(` `),children:[(0,s.jsxs)(`header`,{className:`ds-drawer__head`,children:[(0,s.jsxs)(`div`,{className:`ds-drawer__titles`,children:[(0,s.jsx)(`h2`,{id:T,className:`ds-drawer__title`,children:u}),d&&(0,s.jsx)(`p`,{id:E,className:`ds-drawer__description`,children:d})]}),(0,s.jsx)(e.Button,{ref:w,variant:`simple`,size:m===`navigation`?`lg`:`sm`,isIconOnly:!0,iconStart:`x`,className:m===`navigation`?`ds-drawer__close`:void 0,"aria-label":h,onClick:l})]}),(0,s.jsx)(`div`,{className:`ds-drawer__body`,children:y}),_&&(0,s.jsx)(`footer`,{className:`ds-drawer__footer`,children:_})]})}),g??document.body)});exports.Drawer=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button as e } from "../Button/index.js";
|
|
2
2
|
import { t } from "../../chunks/transitionDuration-BIBA3V7G.js";
|
|
3
|
-
import { t as n } from "../../chunks/mergeRefs-
|
|
3
|
+
import { t as n } from "../../chunks/mergeRefs-C6_5pADN.js";
|
|
4
4
|
import { t as r } from "../../chunks/useModalDialog-Dh-_6A0j.js";
|
|
5
5
|
import { n as i } from "../../chunks/portalScope-AzzPM54i.js";
|
|
6
6
|
import { forwardRef as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-WOhlu6Rp.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/mergeRefs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-WOhlu6Rp.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),r=require("../../chunks/portalScope-BVA1-Ypu.cjs"),i=require("../Drawer/index.cjs"),a=require("../../chunks/observeElementWidth-BCJM2FAw.cjs"),o=require("../../chunks/movableHost-CajG9_5Z.cjs");let s=require("react"),c=require("react-dom"),l=require("react/jsx-runtime");var u=360,d=600,f=900;function ee(e){return e<u?`tight`:e<d?`compact`:e<f?`narrow`:`wide`}var p={clean:`No changes`,dirty:`Unsaved changes`,saving:`Saving…`,saved:`Saved`,error:`Couldn't save`,offline:`Offline · kept in this tab`},m={clean:void 0,dirty:void 0,saving:`spinner`,saved:`check`,error:`alert-triangle`,offline:`clock`},h=new Set([`clean`,`dirty`]);function g(e){return typeof e==`string`?e.trim()!==``:e!=null&&typeof e!=`boolean`}function _({saveState:t,savedAgo:n,statusLabel:r}){let i=m[t],a=h.has(t)&&g(r)?r:void 0;return(0,l.jsxs)(`div`,{className:`ds-edit-layout__status`,"data-state":t,role:`status`,"aria-live":`polite`,children:[i&&(0,l.jsx)(e.t,{name:i,className:t===`saving`?`ds-icon--spin`:void 0}),t===`dirty`&&(0,l.jsx)(`span`,{className:`ds-edit-layout__dirty`,"aria-hidden":`true`}),(0,l.jsxs)(`span`,{title:typeof a==`string`?a:void 0,children:[a??p[t],t===`saved`&&n?(0,l.jsxs)(l.Fragment,{children:[` `,n]}):null]})]})}function v({text:e,bodyRef:n,onKeepEditing:r}){let i=(0,s.useRef)(null),a=(0,s.useRef)(null);return(0,s.useEffect)(()=>{a.current=document.activeElement;let e=requestAnimationFrame(()=>i.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,l.jsxs)(`div`,{className:`ds-edit-layout__confirmation`,children:[(0,l.jsx)(`strong`,{children:e}),(0,l.jsx)(t.Button,{ref:i,size:`xs`,onClick:()=>{r?.(),requestAnimationFrame(()=>{(a.current?.isConnected?a.current:n.current?.querySelector(`input, textarea, button, [contenteditable='true']`))?.focus({preventScroll:!0})})},children:`Keep editing`})]})}function y({backLabel:e,onBack:n,compact:r,status:i,actions:a,confirmLeave:o,confirmation:s,onLeave:c,detailsToggle:u}){return(0,l.jsxs)(`header`,{className:`ds-edit-layout__bar`,children:[(0,l.jsx)(t.Button,{variant:`simple`,size:`sm`,iconStart:`arrow-left`,isIconOnly:r,"aria-label":`Back to ${e}`,onClick:n,children:e}),o?s:i,(0,l.jsxs)(`div`,{className:`ds-edit-layout__actions`,children:[o?(0,l.jsx)(t.Button,{variant:`danger`,size:`sm`,onClick:c,children:`Leave anyway`}):a,r&&u]})]})}function b({label:e,detailsId:n,expanded:r,opensSheet:i,sheetOpen:a,toggleRef:o,contentRef:s,collapsed:c,onToggle:u}){return(0,l.jsxs)(`aside`,{className:`ds-edit-layout__rail`,"aria-label":e,children:[(0,l.jsxs)(`header`,{className:`ds-edit-layout__rail-head`,children:[r&&(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(t.Button,{ref:o,variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:r?`chevrons-right`:`chevrons-left`,className:`ds-edit-layout__toggle`,"aria-label":`${r?`Collapse`:`Expand`} ${e}`,"aria-expanded":r||a,"aria-controls":n,"aria-haspopup":i?`dialog`:void 0,onClick:u})]}),r?(0,l.jsx)(`div`,{id:n,ref:s,className:`ds-edit-layout__rail-content`}):(0,l.jsx)(`div`,{className:`ds-edit-layout__rail-icons`,children:c?c(u):(0,l.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`info`,"aria-label":`Show ${e}`,onClick:u})})]})}var x=(0,s.forwardRef)(function({backLabel:e,onBack:u,saveState:d=`clean`,statusLabel:f,savedAgo:p,actions:m,rail:h,railCollapsed:g,railLabel:x=`Details`,railOpen:S,defaultRailOpen:C=!0,onRailToggle:w,confirmLeave:T=!1,confirmText:E=`Leave without saving?`,onKeepEditing:D,onLeave:O,children:k,className:A,onFocus:j,...M},N){let P=(0,s.useRef)(null),te=(0,s.useMemo)(()=>n.t(P,N),[N]),F=(0,s.useRef)(null),I=(0,s.useRef)(null),L=(0,s.useRef)(null),R=(0,s.useRef)(null),z=(0,s.useRef)(null),[B]=(0,s.useState)(()=>o.t(`ds-edit-layout__rail-host`)),[V,H]=(0,s.useState)(`wide`),[U,W]=(0,s.useState)(C),[G,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),Y=(0,s.useId)(),X=V===`tight`||V===`compact`,Z=V!==`wide`,Q=!Z&&(S??U);G&&(T||!Z)&&K(!1),(0,s.useLayoutEffect)(()=>{let e;return a.t(P.current,t=>{let n=ee(t);n!==e&&(e=n,J(!1),H(n))})},[]),(0,s.useLayoutEffect)(()=>{B&&o.n(B,L.current??R.current,z.current)}),(0,s.useEffect)(()=>{let e=z.current;e&&r.i(e)&&r.i(document.activeElement)&&I.current?.focus({preventScroll:!0})},[V,Q,G]);let $=()=>{Z?K(!0):(J(!0),W(!Q),w?.(!Q))},ne=typeof h==`function`?h(()=>(0,c.flushSync)(()=>K(!1))):h;return(0,l.jsxs)(`div`,{...M,ref:te,className:[`ds-edit-layout`,A].filter(Boolean).join(` `),"data-compact":X||void 0,"data-tight":V===`tight`||void 0,"data-expanded":Q||void 0,"data-animate":q||void 0,onFocus:e=>{z.current=e.target,j?.(e)},children:[(0,l.jsxs)(`div`,{className:`ds-edit-layout__main`,children:[(0,l.jsx)(y,{backLabel:e,onBack:u,compact:X,status:(0,l.jsx)(_,{saveState:d,statusLabel:f,savedAgo:p}),actions:m,confirmLeave:T,confirmation:(0,l.jsx)(v,{text:E,bodyRef:F,onKeepEditing:D}),onLeave:O,detailsToggle:(0,l.jsx)(t.Button,{ref:I,variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`info`,"aria-label":x,"aria-haspopup":`dialog`,"aria-expanded":G,"aria-controls":Y,onClick:$})}),(0,l.jsx)(`div`,{ref:F,className:`ds-edit-layout__body`,children:(0,l.jsx)(`div`,{className:`ds-edit-layout__content`,children:k})})]}),!X&&(0,l.jsx)(b,{label:x,detailsId:Y,expanded:Q,opensSheet:Z,sheetOpen:G,toggleRef:I,contentRef:L,collapsed:g,onToggle:$}),(0,l.jsx)(i.Drawer,{id:Z?Y:void 0,dir:M.dir,isOpen:G,onClose:()=>K(!1),side:`end`,size:`md`,title:x,closeLabel:`Close ${x}`,className:`ds-edit-layout__sheet`,children:Z&&(0,l.jsx)(`div`,{ref:R,className:`ds-edit-layout__rail-content`})}),B&&(0,c.createPortal)(ne,B)]})});exports.EditLayout=x;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../chunks/Icon-spaFBU4S.js";
|
|
2
2
|
import { Button as t } from "../Button/index.js";
|
|
3
|
-
import { t as n } from "../../chunks/mergeRefs-
|
|
3
|
+
import { t as n } from "../../chunks/mergeRefs-C6_5pADN.js";
|
|
4
4
|
import { i as r } from "../../chunks/portalScope-AzzPM54i.js";
|
|
5
5
|
import { Drawer as i } from "../Drawer/index.js";
|
|
6
6
|
import { t as a } from "../../chunks/observeElementWidth-BlQOlW2t.js";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/EntryPicker-D7JIgx23.cjs");exports.EntryPicker=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/EntryPicker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/EntryPicker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOlE,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7F,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgCD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,YAAiB,EACjB,aAAa,EACb,IAAiB,EACjB,GAAG,EACH,KAAiB,EACjB,UAAoC,EACpC,QAA2B,EAC3B,SAAmB,EACnB,UAAsB,EACtB,aAAoB,EACpB,UAAkB,EAClB,SAAS,EACT,GAAG,UAAU,EACd,EAAE,gBAAgB,+BA6LlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EntryPicker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EntryPicker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOlE,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7F,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgCD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,YAAiB,EACjB,aAAa,EACb,IAAiB,EACjB,GAAG,EACH,KAAiB,EACjB,UAAoC,EACpC,QAA2B,EAC3B,SAAmB,EACnB,UAAsB,EACtB,aAAoB,EACpB,UAAkB,EAClB,SAAS,EACT,GAAG,UAAU,EACd,EAAE,gBAAgB,+BA6LlB"}
|
|
@@ -1,171 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Button as t } from "../Button/index.js";
|
|
3
|
-
import { Modal as n } from "../Modal/index.js";
|
|
4
|
-
import { t as r } from "../../chunks/group-CzbacuAY.js";
|
|
5
|
-
import { SearchField as i } from "../SearchField/index.js";
|
|
6
|
-
import { SortableList as a, SortableListItem as o } from "../SortableList/index.js";
|
|
7
|
-
import { useMemo as s, useState as c } from "react";
|
|
8
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/EntryPicker/index.tsx
|
|
10
|
-
function f(...e) {
|
|
11
|
-
return e.filter(Boolean).join(" ");
|
|
12
|
-
}
|
|
13
|
-
function p(e, t) {
|
|
14
|
-
return !t || [
|
|
15
|
-
e.title,
|
|
16
|
-
e.subtitle,
|
|
17
|
-
...e.keywords ?? []
|
|
18
|
-
].filter(Boolean).join(" ").toLowerCase().includes(t.toLowerCase());
|
|
19
|
-
}
|
|
20
|
-
function m({ item: t }) {
|
|
21
|
-
return /* @__PURE__ */ u("span", {
|
|
22
|
-
className: "ds-entry__thumb",
|
|
23
|
-
children: t.imageUrl ? /* @__PURE__ */ u("img", {
|
|
24
|
-
src: t.imageUrl,
|
|
25
|
-
alt: "",
|
|
26
|
-
loading: "lazy"
|
|
27
|
-
}) : /* @__PURE__ */ u(e, {
|
|
28
|
-
name: "file-text",
|
|
29
|
-
size: 20
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function h({ items: h, value: g, defaultValue: _ = [], onValueChange: v, mode: y = "multiple", max: b, label: x = "Entries", emptyLabel: S = "Nothing selected yet.", addLabel: C = "Choose entries", itemLabel: w = "entry", itemsLabel: T = "entries", isReorderable: E = !0, isDisabled: D = !1, className: O, ...k }) {
|
|
34
|
-
let [A, j] = c(_), M = g ?? A, [N, P] = c(!1), [F, I] = c(""), L = s(() => new Map(h.map((e) => [e.id, e])), [h]), R = s(() => h.filter((e) => p(e, F)), [h, F]), z = y === "multiple" && b !== void 0 && M.length >= b, B = (e) => {
|
|
35
|
-
D || (g === void 0 && j(e), v?.(e));
|
|
36
|
-
}, V = (e) => {
|
|
37
|
-
y === "single" ? (B(M[0] === e ? [] : [e]), P(!1)) : M.includes(e) ? B(M.filter((t) => t !== e)) : z || B([...M, e]);
|
|
38
|
-
}, H = M.map((e) => L.get(e) ?? {
|
|
39
|
-
id: e,
|
|
40
|
-
title: e
|
|
41
|
-
}), U = E && y === "multiple" && H.length > 1, W = (e) => /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(m, { item: e }), /* @__PURE__ */ d("span", {
|
|
42
|
-
className: "ds-entry__body",
|
|
43
|
-
children: [/* @__PURE__ */ u("span", {
|
|
44
|
-
className: "ds-entry__title",
|
|
45
|
-
children: e.title
|
|
46
|
-
}), e.subtitle && /* @__PURE__ */ u("span", {
|
|
47
|
-
className: "ds-entry__subtitle",
|
|
48
|
-
children: e.subtitle
|
|
49
|
-
})]
|
|
50
|
-
})] });
|
|
51
|
-
return /* @__PURE__ */ d(r, {
|
|
52
|
-
...k,
|
|
53
|
-
className: f("ds-entry-picker", O),
|
|
54
|
-
label: x,
|
|
55
|
-
count: M.length,
|
|
56
|
-
children: [
|
|
57
|
-
H.length === 0 ? /* @__PURE__ */ u("p", {
|
|
58
|
-
className: "ds-entry-picker__empty",
|
|
59
|
-
children: S
|
|
60
|
-
}) : U ? /* @__PURE__ */ u(a, {
|
|
61
|
-
items: M,
|
|
62
|
-
onReorder: B,
|
|
63
|
-
isDisabled: D,
|
|
64
|
-
children: H.map((e) => /* @__PURE__ */ u(o, {
|
|
65
|
-
id: e.id,
|
|
66
|
-
label: e.title,
|
|
67
|
-
action: /* @__PURE__ */ u(t, {
|
|
68
|
-
variant: "simple",
|
|
69
|
-
size: "sm",
|
|
70
|
-
isIconOnly: !0,
|
|
71
|
-
iconStart: "x",
|
|
72
|
-
"aria-label": `Remove ${e.title}`,
|
|
73
|
-
isDisabled: D,
|
|
74
|
-
onClick: () => B(M.filter((t) => t !== e.id))
|
|
75
|
-
}),
|
|
76
|
-
children: /* @__PURE__ */ u("div", {
|
|
77
|
-
className: "ds-entry",
|
|
78
|
-
children: W(e)
|
|
79
|
-
})
|
|
80
|
-
}, e.id))
|
|
81
|
-
}) : /* @__PURE__ */ u("ul", {
|
|
82
|
-
className: "ds-entry-picker__list",
|
|
83
|
-
children: H.map((e) => /* @__PURE__ */ d("li", {
|
|
84
|
-
className: "ds-entry-picker__row",
|
|
85
|
-
children: [/* @__PURE__ */ u("div", {
|
|
86
|
-
className: "ds-entry",
|
|
87
|
-
children: W(e)
|
|
88
|
-
}), /* @__PURE__ */ u(t, {
|
|
89
|
-
variant: "simple",
|
|
90
|
-
size: "sm",
|
|
91
|
-
isIconOnly: !0,
|
|
92
|
-
iconStart: "x",
|
|
93
|
-
"aria-label": `Remove ${e.title}`,
|
|
94
|
-
isDisabled: D,
|
|
95
|
-
onClick: () => B(M.filter((t) => t !== e.id))
|
|
96
|
-
})]
|
|
97
|
-
}, e.id))
|
|
98
|
-
}),
|
|
99
|
-
/* @__PURE__ */ d("div", {
|
|
100
|
-
className: "ds-entry-picker__actions",
|
|
101
|
-
children: [/* @__PURE__ */ u(t, {
|
|
102
|
-
variant: "neutral",
|
|
103
|
-
size: "sm",
|
|
104
|
-
iconStart: "plus",
|
|
105
|
-
isDisabled: D,
|
|
106
|
-
onClick: () => P(!0),
|
|
107
|
-
children: C
|
|
108
|
-
}), M.length > 0 && /* @__PURE__ */ u(t, {
|
|
109
|
-
variant: "simple",
|
|
110
|
-
size: "sm",
|
|
111
|
-
isDisabled: D,
|
|
112
|
-
onClick: () => B([]),
|
|
113
|
-
children: "Clear"
|
|
114
|
-
})]
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ d(n, {
|
|
117
|
-
isOpen: N,
|
|
118
|
-
onClose: () => P(!1),
|
|
119
|
-
title: C,
|
|
120
|
-
description: y === "single" ? `Choose one ${w}.` : b === void 0 ? `Choose as many ${T} as you need.` : `Choose up to ${b} ${T}.`,
|
|
121
|
-
footer: /* @__PURE__ */ u(t, {
|
|
122
|
-
variant: "primary",
|
|
123
|
-
onClick: () => P(!1),
|
|
124
|
-
children: "Done"
|
|
125
|
-
}),
|
|
126
|
-
children: [/* @__PURE__ */ u("div", {
|
|
127
|
-
className: "ds-entry-picker__search",
|
|
128
|
-
children: /* @__PURE__ */ u(i, {
|
|
129
|
-
value: F,
|
|
130
|
-
placeholder: `Search ${T}`,
|
|
131
|
-
onChange: (e) => I(e.target.value),
|
|
132
|
-
onClear: () => I("")
|
|
133
|
-
})
|
|
134
|
-
}), /* @__PURE__ */ d("ul", {
|
|
135
|
-
className: "ds-entry-picker__results",
|
|
136
|
-
children: [R.map((n) => {
|
|
137
|
-
let r = M.includes(n.id), i = D || n.isDisabled || !r && z;
|
|
138
|
-
return /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d(t, {
|
|
139
|
-
variant: r ? "active" : "simple",
|
|
140
|
-
size: "lg",
|
|
141
|
-
className: "ds-entry-picker__result",
|
|
142
|
-
"aria-pressed": r,
|
|
143
|
-
isDisabled: !!i,
|
|
144
|
-
onClick: () => V(n.id),
|
|
145
|
-
children: [/* @__PURE__ */ u("span", {
|
|
146
|
-
className: "ds-entry",
|
|
147
|
-
children: W(n)
|
|
148
|
-
}), r && /* @__PURE__ */ u(e, {
|
|
149
|
-
name: "check",
|
|
150
|
-
size: 20
|
|
151
|
-
})]
|
|
152
|
-
}) }, n.id);
|
|
153
|
-
}), R.length === 0 && /* @__PURE__ */ d("li", {
|
|
154
|
-
className: "ds-entry-picker__no-results",
|
|
155
|
-
children: [
|
|
156
|
-
"No ",
|
|
157
|
-
T,
|
|
158
|
-
" match “",
|
|
159
|
-
F,
|
|
160
|
-
"”."
|
|
161
|
-
]
|
|
162
|
-
})]
|
|
163
|
-
})]
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
export { h as EntryPicker };
|
|
170
|
-
|
|
171
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { t as EntryPicker } from "../../chunks/EntryPicker-CR8Phuzl.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FieldLimit } from "../Field/types.cjs";
|
|
2
|
+
import type { EntryPickerMode } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Only an explicitly capped multiple selection has a usage limit. Pure, so
|
|
5
|
+
* FormEditor's model derives the same server-rendered limit the picker reports.
|
|
6
|
+
*/
|
|
7
|
+
export declare function selectionLimit(mode: EntryPickerMode, count: number, max: number | undefined): FieldLimit | undefined;
|
|
8
|
+
//# sourceMappingURL=limit.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit.d.cts","sourceRoot":"","sources":["../../../src/components/EntryPicker/limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,UAAU,GAAG,SAAS,CAExB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FieldLimit } from "../Field/types.js";
|
|
2
|
+
import type { EntryPickerMode } from ".";
|
|
3
|
+
/**
|
|
4
|
+
* Only an explicitly capped multiple selection has a usage limit. Pure, so
|
|
5
|
+
* FormEditor's model derives the same server-rendered limit the picker reports.
|
|
6
|
+
*/
|
|
7
|
+
export declare function selectionLimit(mode: EntryPickerMode, count: number, max: number | undefined): FieldLimit | undefined;
|
|
8
|
+
//# sourceMappingURL=limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit.d.ts","sourceRoot":"","sources":["../../../src/components/EntryPicker/limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,UAAU,GAAG,SAAS,CAExB"}
|