@burojs/ui-shadcn 0.4.0 → 0.6.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/README.md +22 -5
- package/dist/bulk-summary-CwSd6Yjb.cjs +108 -0
- package/dist/bulk-summary-CwSd6Yjb.cjs.map +1 -0
- package/dist/bulk-summary-GxMDP4bw.js +108 -0
- package/dist/bulk-summary-GxMDP4bw.js.map +1 -0
- package/dist/button-BxnnE28H.cjs +55 -0
- package/dist/button-BxnnE28H.cjs.map +1 -0
- package/dist/button-MWVeZaqj.js +44 -0
- package/dist/button-MWVeZaqj.js.map +1 -0
- package/dist/candidates-gate-Bb70LPAy.js +135 -0
- package/dist/candidates-gate-Bb70LPAy.js.map +1 -0
- package/dist/candidates-gate-D33jXLHO.cjs +153 -0
- package/dist/candidates-gate-D33jXLHO.cjs.map +1 -0
- package/dist/candidates-relation-picker-B116Bmqi.js +31 -0
- package/dist/candidates-relation-picker-B116Bmqi.js.map +1 -0
- package/dist/candidates-relation-picker-Cy0rTxvI.cjs +31 -0
- package/dist/candidates-relation-picker-Cy0rTxvI.cjs.map +1 -0
- package/dist/check-confirm-dialog--gPFnEeg.cjs +1547 -0
- package/dist/check-confirm-dialog--gPFnEeg.cjs.map +1 -0
- package/dist/check-confirm-dialog-bRT8lt0d.js +1245 -0
- package/dist/check-confirm-dialog-bRT8lt0d.js.map +1 -0
- package/dist/dialog-B_rt9S1c.js +63 -0
- package/dist/dialog-B_rt9S1c.js.map +1 -0
- package/dist/dialog-DRNUq9EA.cjs +112 -0
- package/dist/dialog-DRNUq9EA.cjs.map +1 -0
- package/dist/filter-builder-Bhn-dhZV.js +1621 -0
- package/dist/filter-builder-Bhn-dhZV.js.map +1 -0
- package/dist/filter-builder-nXqtM_h4.cjs +1789 -0
- package/dist/filter-builder-nXqtM_h4.cjs.map +1 -0
- package/dist/flow-runtime-D3avVH0I.cjs +255 -0
- package/dist/flow-runtime-D3avVH0I.cjs.map +1 -0
- package/dist/flow-runtime-s6lkRPKF.js +252 -0
- package/dist/flow-runtime-s6lkRPKF.js.map +1 -0
- package/dist/flow-screen-CCvgDI9G.js +704 -0
- package/dist/flow-screen-CCvgDI9G.js.map +1 -0
- package/dist/flow-screen-Ci_Sik4Y.cjs +708 -0
- package/dist/flow-screen-Ci_Sik4Y.cjs.map +1 -0
- package/dist/index.cjs +3420 -11986
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1843 -2015
- package/dist/index.d.ts +1849 -2021
- package/dist/index.js +3090 -11675
- package/dist/index.js.map +1 -1
- package/dist/inline-flow-host-B6FI0ctQ.js +112 -0
- package/dist/inline-flow-host-B6FI0ctQ.js.map +1 -0
- package/dist/inline-flow-host-DV1et3c6.cjs +112 -0
- package/dist/inline-flow-host-DV1et3c6.cjs.map +1 -0
- package/dist/input-BI0czGyI.cjs +23 -0
- package/dist/input-BI0czGyI.cjs.map +1 -0
- package/dist/input-CUPStzZO.js +17 -0
- package/dist/input-CUPStzZO.js.map +1 -0
- package/dist/label-66W1qbke.js +29 -0
- package/dist/label-66W1qbke.js.map +1 -0
- package/dist/label-w6JYf2cF.cjs +36 -0
- package/dist/label-w6JYf2cF.cjs.map +1 -0
- package/dist/markdown/index.cjs +1 -1
- package/dist/markdown/index.d.cts +2 -3
- package/dist/markdown/index.d.ts +2 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-flow-route-hdnULWqd.cjs +277 -0
- package/dist/page-flow-route-hdnULWqd.cjs.map +1 -0
- package/dist/page-flow-route-i3ZfJ1sd.js +277 -0
- package/dist/page-flow-route-i3ZfJ1sd.js.map +1 -0
- package/dist/place-node-C5SmIAYU.cjs +8139 -0
- package/dist/place-node-C5SmIAYU.cjs.map +1 -0
- package/dist/place-node-NraNYKPx.js +7597 -0
- package/dist/place-node-NraNYKPx.js.map +1 -0
- package/dist/related-list-cards-BWZ9GfOG.js +42 -0
- package/dist/related-list-cards-BWZ9GfOG.js.map +1 -0
- package/dist/related-list-cards-CFq3meUn.cjs +42 -0
- package/dist/related-list-cards-CFq3meUn.cjs.map +1 -0
- package/dist/related-list-timeline-CCzl71aA.cjs +142 -0
- package/dist/related-list-timeline-CCzl71aA.cjs.map +1 -0
- package/dist/related-list-timeline-yrPsjA3F.js +142 -0
- package/dist/related-list-timeline-yrPsjA3F.js.map +1 -0
- package/dist/related-rows-ea43qhhy.cjs +208 -0
- package/dist/related-rows-ea43qhhy.cjs.map +1 -0
- package/dist/related-rows-o0_t-Yce.js +185 -0
- package/dist/related-rows-o0_t-Yce.js.map +1 -0
- package/dist/relation-create-IA40t1hi.cjs +364 -0
- package/dist/relation-create-IA40t1hi.cjs.map +1 -0
- package/dist/relation-create-h6F9B4C4.js +339 -0
- package/dist/relation-create-h6F9B4C4.js.map +1 -0
- package/dist/relation-many-picker-C8zFEjwd.cjs +467 -0
- package/dist/relation-many-picker-C8zFEjwd.cjs.map +1 -0
- package/dist/relation-many-picker-bvkjkv-k.js +466 -0
- package/dist/relation-many-picker-bvkjkv-k.js.map +1 -0
- package/dist/relation-picker-Z0ZJJ5uS.js +493 -0
- package/dist/relation-picker-Z0ZJJ5uS.js.map +1 -0
- package/dist/relation-picker-dialog-0IzkjmiA.cjs +304 -0
- package/dist/relation-picker-dialog-0IzkjmiA.cjs.map +1 -0
- package/dist/relation-picker-dialog-B6nIiJBf.js +303 -0
- package/dist/relation-picker-dialog-B6nIiJBf.js.map +1 -0
- package/dist/relation-picker-gag0qSR5.cjs +516 -0
- package/dist/relation-picker-gag0qSR5.cjs.map +1 -0
- package/dist/resource-page-router-3RUf9d1j.js +1588 -0
- package/dist/resource-page-router-3RUf9d1j.js.map +1 -0
- package/dist/resource-page-router-PXfMW9nh.cjs +1785 -0
- package/dist/resource-page-router-PXfMW9nh.cjs.map +1 -0
- package/dist/{rich-text-IDFvyvRE.js → rich-text-DFerywgz.js} +7 -4
- package/dist/{rich-text-IDFvyvRE.js.map → rich-text-DFerywgz.js.map} +1 -1
- package/dist/{rich-text-lndbYqzR.cjs → rich-text-vTyVjDoa.cjs} +25 -22
- package/dist/{rich-text-lndbYqzR.cjs.map → rich-text-vTyVjDoa.cjs.map} +1 -1
- package/dist/search-access-CPPmfuvy.js +654 -0
- package/dist/search-access-CPPmfuvy.js.map +1 -0
- package/dist/search-access-Dugvttlg.cjs +791 -0
- package/dist/search-access-Dugvttlg.cjs.map +1 -0
- package/dist/shell-BPlk8hEa.js +205 -0
- package/dist/shell-BPlk8hEa.js.map +1 -0
- package/dist/shell-DxhlsPwm.cjs +271 -0
- package/dist/shell-DxhlsPwm.cjs.map +1 -0
- package/dist/skeleton-U2noefj5.js +13 -0
- package/dist/skeleton-U2noefj5.js.map +1 -0
- package/dist/skeleton-_1gP7wan.cjs +18 -0
- package/dist/skeleton-_1gP7wan.cjs.map +1 -0
- package/dist/styles.css +241 -9
- package/dist/toaster-C02XbB9r.js +135 -0
- package/dist/toaster-C02XbB9r.js.map +1 -0
- package/dist/toaster-Cr51X7bz.cjs +195 -0
- package/dist/toaster-Cr51X7bz.cjs.map +1 -0
- package/dist/use-dialog-filter-state-C--oMAZG.js +87 -0
- package/dist/use-dialog-filter-state-C--oMAZG.js.map +1 -0
- package/dist/use-dialog-filter-state-Dhe8PcB5.cjs +92 -0
- package/dist/use-dialog-filter-state-Dhe8PcB5.cjs.map +1 -0
- package/dist/{use-theme-BwPWinB2.cjs → use-theme-DFlpXils.cjs} +12 -1
- package/dist/use-theme-DFlpXils.cjs.map +1 -0
- package/dist/{use-theme-IHmtrhEt.js → use-theme-dnE3Od3I.js} +7 -2
- package/dist/use-theme-dnE3Od3I.js.map +1 -0
- package/package.json +16 -14
- package/dist/use-theme-BwPWinB2.cjs.map +0 -1
- package/dist/use-theme-IHmtrhEt.js.map +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { h as useFlowChrome, m as text } from "./check-confirm-dialog-bRT8lt0d.js";
|
|
2
|
+
import { t as Button } from "./button-MWVeZaqj.js";
|
|
3
|
+
import { HostedFlowScreen } from "./flow-screen-CCvgDI9G.js";
|
|
4
|
+
import { useOptionalT, useScreenState, useTestIds } from "@burojs/react";
|
|
5
|
+
import { IconLoader2 } from "@tabler/icons-react";
|
|
6
|
+
import { useEffect, useMemo } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useFlowRun } from "@burojs/react/flows";
|
|
9
|
+
//#region src/flows/inline-flow-host.tsx
|
|
10
|
+
function InlineFlowHost({ resource = "", name = "", target: givenTarget, label, record, lease, placementKey, stale = false, onDiscard }) {
|
|
11
|
+
const tid = useTestIds();
|
|
12
|
+
const own = useFlowChrome(resource, name);
|
|
13
|
+
const chrome = label === void 0 ? own : {
|
|
14
|
+
...own,
|
|
15
|
+
label,
|
|
16
|
+
labelText: label
|
|
17
|
+
};
|
|
18
|
+
const target = useMemo(() => givenTarget ?? {
|
|
19
|
+
resource,
|
|
20
|
+
action: name
|
|
21
|
+
}, [
|
|
22
|
+
givenTarget,
|
|
23
|
+
resource,
|
|
24
|
+
name
|
|
25
|
+
]);
|
|
26
|
+
const flow = useFlowRun(target, {
|
|
27
|
+
...record === void 0 ? {} : { record },
|
|
28
|
+
surface: "inline",
|
|
29
|
+
...lease === void 0 ? {} : { lease }
|
|
30
|
+
});
|
|
31
|
+
flow.holdThen(true);
|
|
32
|
+
const { run, snapshot, compiled } = flow;
|
|
33
|
+
const binding = useMemo(() => ({
|
|
34
|
+
kind: "inline",
|
|
35
|
+
close: () => flow.reset(),
|
|
36
|
+
finish: () => {
|
|
37
|
+
flow.runThen();
|
|
38
|
+
flow.reset();
|
|
39
|
+
}
|
|
40
|
+
}), [flow.reset, flow.runThen]);
|
|
41
|
+
const holder = useScreenState()?.inline;
|
|
42
|
+
const t = useOptionalT();
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (lease === void 0 || holder === void 0) return;
|
|
45
|
+
lease.mounted += 1;
|
|
46
|
+
lease.label = chrome.labelText;
|
|
47
|
+
holder.touch();
|
|
48
|
+
return () => {
|
|
49
|
+
lease.mounted -= 1;
|
|
50
|
+
holder.touch();
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
lease,
|
|
54
|
+
holder,
|
|
55
|
+
chrome.labelText
|
|
56
|
+
]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (lease === void 0 || holder === void 0 || run === null) return;
|
|
59
|
+
const sync = () => {
|
|
60
|
+
const now = run.getSnapshot();
|
|
61
|
+
if (lease.initial === void 0 && now.history.includes("open")) lease.initial = JSON.stringify(now.values);
|
|
62
|
+
const dirty = now.outcome?.outcome !== "success" && (now.outcome?.outcome === "unknown" || lease.initial !== void 0 && JSON.stringify(now.values) !== lease.initial);
|
|
63
|
+
const locked = now.control === "running";
|
|
64
|
+
if (dirty === lease.dirty && locked === lease.locked) return;
|
|
65
|
+
lease.dirty = dirty;
|
|
66
|
+
lease.locked = locked;
|
|
67
|
+
holder.touch();
|
|
68
|
+
};
|
|
69
|
+
sync();
|
|
70
|
+
return run.subscribe(sync);
|
|
71
|
+
}, [
|
|
72
|
+
lease,
|
|
73
|
+
holder,
|
|
74
|
+
run
|
|
75
|
+
]);
|
|
76
|
+
const opened = run !== null && compiled !== null && (snapshot.history.includes("open") || snapshot.step === "outcome");
|
|
77
|
+
return jsxs("div", {
|
|
78
|
+
"data-testid": tid.inlineFlow(compiled?.flowId ?? `${resource}/actions/${name}`, placementKey),
|
|
79
|
+
"data-buro-host": "inline",
|
|
80
|
+
className: "flex min-h-0 flex-col gap-4",
|
|
81
|
+
children: [stale ? jsxs("div", {
|
|
82
|
+
role: "status",
|
|
83
|
+
"data-buro-flow-state": "stale",
|
|
84
|
+
className: "flex flex-wrap items-center gap-2 text-sm text-muted-foreground",
|
|
85
|
+
children: [jsx("span", { children: text(t, "flow.noLongerApplies", "This action no longer applies") }), jsx(Button, {
|
|
86
|
+
type: "button",
|
|
87
|
+
size: "sm",
|
|
88
|
+
variant: "outline",
|
|
89
|
+
onClick: onDiscard,
|
|
90
|
+
children: text(t, "flow.discard", "Discard")
|
|
91
|
+
})]
|
|
92
|
+
}) : null, opened ? jsx("fieldset", {
|
|
93
|
+
disabled: stale,
|
|
94
|
+
className: "m-0 min-w-0 border-0 p-0",
|
|
95
|
+
children: jsx(HostedFlowScreen, {
|
|
96
|
+
binding,
|
|
97
|
+
host: "inline",
|
|
98
|
+
run,
|
|
99
|
+
compiled,
|
|
100
|
+
label: chrome.labelText,
|
|
101
|
+
record
|
|
102
|
+
})
|
|
103
|
+
}) : jsx(IconLoader2, {
|
|
104
|
+
className: "h-5 w-5 animate-spin self-center",
|
|
105
|
+
"aria-hidden": "true"
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { InlineFlowHost };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=inline-flow-host-B6FI0ctQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-flow-host-B6FI0ctQ.js","names":[],"sources":["../src/flows/inline-flow-host.tsx"],"sourcesContent":["'use client';\n/**\n * The inline host (P6 3.12): an item flow drawn in place in a show tree. The run lives in the\n * placement's lease, held by the screen, so a tab switch away and back finds the typed input and\n * a write in flight, and the flow's attempt slot stays the one P4 keys on (user, flow, record).\n */\nimport type { FlowTarget, Row } from '@burojs/core';\nimport type { InlineLease } from '@burojs/react';\nimport { useOptionalT, useScreenState, useTestIds } from '@burojs/react';\nimport { useFlowRun } from '@burojs/react/flows';\nimport { IconLoader2 } from '@tabler/icons-react';\nimport { type ReactElement, useEffect, useMemo } from 'react';\nimport { Button } from '../primitives/button.js';\nimport { text, useFlowChrome } from './chrome.js';\nimport { type FlowHostBinding, HostedFlowScreen } from './flow-screen.js';\n\nexport interface InlineFlowHostProps {\n /** The resource of an item flow on a record screen; a page names `target` instead. */\n readonly resource?: string;\n readonly name?: string;\n /** The flow, when it is not an item flow of the screen's resource (a page's, P7 3.15). */\n readonly target?: FlowTarget;\n /** The label of a flow with no resource to ask (an app flow's). */\n readonly label?: string;\n /** The record an item flow runs on; none on a page. */\n readonly record?: Row;\n readonly lease?: InlineLease;\n readonly placementKey: string;\n /**\n * The flow no longer applies to the record (its `when` turned false) while the input is dirty\n * or the attempt unresolved: the node stays, read-only, with \"no longer applies\" and Discard.\n */\n readonly stale?: boolean;\n readonly onDiscard?: () => void;\n}\n\nexport function InlineFlowHost({\n resource = '',\n name = '',\n target: givenTarget,\n label,\n record,\n lease,\n placementKey,\n stale = false,\n onDiscard,\n}: InlineFlowHostProps): ReactElement {\n const tid = useTestIds();\n const own = useFlowChrome(resource, name);\n const chrome = label === undefined ? own : { ...own, label, labelText: label };\n const target = useMemo<FlowTarget>(\n () => givenTarget ?? { resource, action: name },\n [givenTarget, resource, name],\n );\n const flow = useFlowRun(target, {\n ...(record === undefined ? {} : { record }),\n surface: 'inline',\n ...(lease === undefined ? {} : { lease }),\n });\n // `then` is this host's to run, once the form it succeeded in has started over.\n flow.holdThen(true);\n const { run, snapshot, compiled } = flow;\n const binding = useMemo<FlowHostBinding>(\n () => ({\n kind: 'inline',\n close: () => flow.reset(),\n finish: () => {\n flow.runThen();\n flow.reset();\n },\n }),\n // biome-ignore lint/correctness/useExhaustiveDependencies: reset and runThen are stable callbacks\n [flow.reset, flow.runThen],\n );\n const holder = useScreenState()?.inline;\n const t = useOptionalT();\n // The lease's guard state, from the run: unsaved input or an unresolved attempt (dirty), a\n // write in flight (locked), and whether a node shows it. The screen's blockers read these\n // when the node is not on screen (tab switched, placement hidden).\n useEffect(() => {\n if (lease === undefined || holder === undefined) return;\n lease.mounted += 1;\n lease.label = chrome.labelText;\n holder.touch();\n return () => {\n lease.mounted -= 1;\n holder.touch();\n };\n }, [lease, holder, chrome.labelText]);\n useEffect(() => {\n if (lease === undefined || holder === undefined || run === null) return;\n const sync = () => {\n const now = run.getSnapshot();\n if (lease.initial === undefined && now.history.includes('open'))\n lease.initial = JSON.stringify(now.values);\n const dirty =\n now.outcome?.outcome !== 'success' &&\n (now.outcome?.outcome === 'unknown' ||\n (lease.initial !== undefined && JSON.stringify(now.values) !== lease.initial));\n const locked = now.control === 'running';\n if (dirty === lease.dirty && locked === lease.locked) return;\n lease.dirty = dirty;\n lease.locked = locked;\n holder.touch();\n };\n sync();\n return run.subscribe(sync);\n }, [lease, holder, run]);\n const opened =\n run !== null &&\n compiled !== null &&\n (snapshot.history.includes('open') || snapshot.step === 'outcome');\n return (\n <div\n data-testid={tid.inlineFlow(compiled?.flowId ?? `${resource}/actions/${name}`, placementKey)}\n data-buro-host=\"inline\"\n className=\"flex min-h-0 flex-col gap-4\"\n >\n {stale ? (\n <div\n role=\"status\"\n data-buro-flow-state=\"stale\"\n className=\"flex flex-wrap items-center gap-2 text-sm text-muted-foreground\"\n >\n <span>{text(t, 'flow.noLongerApplies', 'This action no longer applies')}</span>\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onDiscard}>\n {text(t, 'flow.discard', 'Discard')}\n </Button>\n </div>\n ) : null}\n {opened ? (\n <fieldset disabled={stale} className=\"m-0 min-w-0 border-0 p-0\">\n <HostedFlowScreen\n binding={binding}\n host=\"inline\"\n run={run}\n compiled={compiled}\n label={chrome.labelText}\n record={record}\n />\n </fieldset>\n ) : (\n <IconLoader2 className=\"h-5 w-5 animate-spin self-center\" aria-hidden=\"true\" />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,eAAe,EAC7B,WAAW,IACX,OAAO,IACP,QAAQ,aACR,OACA,QACA,OACA,cACA,QAAQ,OACR,aACoC;CACpC,MAAM,MAAM,WAAW;CACvB,MAAM,MAAM,cAAc,UAAU,IAAI;CACxC,MAAM,SAAS,UAAU,KAAA,IAAY,MAAM;EAAE,GAAG;EAAK;EAAO,WAAW;CAAM;CAC7E,MAAM,SAAS,cACP,eAAe;EAAE;EAAU,QAAQ;CAAK,GAC9C;EAAC;EAAa;EAAU;CAAI,CAC9B;CACA,MAAM,OAAO,WAAW,QAAQ;EAC9B,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO;EACzC,SAAS;EACT,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;CACzC,CAAC;CAED,KAAK,SAAS,IAAI;CAClB,MAAM,EAAE,KAAK,UAAU,aAAa;CACpC,MAAM,UAAU,eACP;EACL,MAAM;EACN,aAAa,KAAK,MAAM;EACxB,cAAc;GACZ,KAAK,QAAQ;GACb,KAAK,MAAM;EACb;CACF,IAEA,CAAC,KAAK,OAAO,KAAK,OAAO,CAC3B;CACA,MAAM,SAAS,eAAe,CAAC,EAAE;CACjC,MAAM,IAAI,aAAa;CAIvB,gBAAgB;EACd,IAAI,UAAU,KAAA,KAAa,WAAW,KAAA,GAAW;EACjD,MAAM,WAAW;EACjB,MAAM,QAAQ,OAAO;EACrB,OAAO,MAAM;EACb,aAAa;GACX,MAAM,WAAW;GACjB,OAAO,MAAM;EACf;CACF,GAAG;EAAC;EAAO;EAAQ,OAAO;CAAS,CAAC;CACpC,gBAAgB;EACd,IAAI,UAAU,KAAA,KAAa,WAAW,KAAA,KAAa,QAAQ,MAAM;EACjE,MAAM,aAAa;GACjB,MAAM,MAAM,IAAI,YAAY;GAC5B,IAAI,MAAM,YAAY,KAAA,KAAa,IAAI,QAAQ,SAAS,MAAM,GAC5D,MAAM,UAAU,KAAK,UAAU,IAAI,MAAM;GAC3C,MAAM,QACJ,IAAI,SAAS,YAAY,cACxB,IAAI,SAAS,YAAY,aACvB,MAAM,YAAY,KAAA,KAAa,KAAK,UAAU,IAAI,MAAM,MAAM,MAAM;GACzE,MAAM,SAAS,IAAI,YAAY;GAC/B,IAAI,UAAU,MAAM,SAAS,WAAW,MAAM,QAAQ;GACtD,MAAM,QAAQ;GACd,MAAM,SAAS;GACf,OAAO,MAAM;EACf;EACA,KAAK;EACL,OAAO,IAAI,UAAU,IAAI;CAC3B,GAAG;EAAC;EAAO;EAAQ;CAAG,CAAC;CACvB,MAAM,SACJ,QAAQ,QACR,aAAa,SACZ,SAAS,QAAQ,SAAS,MAAM,KAAK,SAAS,SAAS;CAC1D,OACE,KAAC,OAAD;EACE,eAAa,IAAI,WAAW,UAAU,UAAU,GAAG,SAAS,WAAW,QAAQ,YAAY;EAC3F,kBAAe;EACf,WAAU;EAHZ,UAAA,CAKG,QACC,KAAC,OAAD;GACE,MAAK;GACL,wBAAqB;GACrB,WAAU;GAHZ,UAAA,CAKE,IAAC,QAAD,EAAA,UAAO,KAAK,GAAG,wBAAwB,+BAA+B,EAAQ,CAAA,GAC9E,IAAC,QAAD;IAAQ,MAAK;IAAS,MAAK;IAAK,SAAQ;IAAU,SAAS;IACxD,UAAA,KAAK,GAAG,gBAAgB,SAAS;GAC5B,CAAA,CACL;EACH,CAAA,IAAA,MACH,SACC,IAAC,YAAD;GAAU,UAAU;GAAO,WAAU;GACnC,UAAA,IAAC,kBAAD;IACW;IACT,MAAK;IACA;IACK;IACV,OAAO,OAAO;IACN;GACT,CAAA;EACO,CAAA,IAEV,IAAC,aAAD;GAAa,WAAU;GAAmC,eAAY;EAAQ,CAAA,CAE7E;;AAET"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const require_check_confirm_dialog = require("./check-confirm-dialog--gPFnEeg.cjs");
|
|
2
|
+
const require_button = require("./button-BxnnE28H.cjs");
|
|
3
|
+
const require_flow_screen = require("./flow-screen-Ci_Sik4Y.cjs");
|
|
4
|
+
let _burojs_react = require("@burojs/react");
|
|
5
|
+
let _tabler_icons_react = require("@tabler/icons-react");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _burojs_react_flows = require("@burojs/react/flows");
|
|
9
|
+
//#region src/flows/inline-flow-host.tsx
|
|
10
|
+
function InlineFlowHost({ resource = "", name = "", target: givenTarget, label, record, lease, placementKey, stale = false, onDiscard }) {
|
|
11
|
+
const tid = (0, _burojs_react.useTestIds)();
|
|
12
|
+
const own = require_check_confirm_dialog.useFlowChrome(resource, name);
|
|
13
|
+
const chrome = label === void 0 ? own : {
|
|
14
|
+
...own,
|
|
15
|
+
label,
|
|
16
|
+
labelText: label
|
|
17
|
+
};
|
|
18
|
+
const target = (0, react.useMemo)(() => givenTarget ?? {
|
|
19
|
+
resource,
|
|
20
|
+
action: name
|
|
21
|
+
}, [
|
|
22
|
+
givenTarget,
|
|
23
|
+
resource,
|
|
24
|
+
name
|
|
25
|
+
]);
|
|
26
|
+
const flow = (0, _burojs_react_flows.useFlowRun)(target, {
|
|
27
|
+
...record === void 0 ? {} : { record },
|
|
28
|
+
surface: "inline",
|
|
29
|
+
...lease === void 0 ? {} : { lease }
|
|
30
|
+
});
|
|
31
|
+
flow.holdThen(true);
|
|
32
|
+
const { run, snapshot, compiled } = flow;
|
|
33
|
+
const binding = (0, react.useMemo)(() => ({
|
|
34
|
+
kind: "inline",
|
|
35
|
+
close: () => flow.reset(),
|
|
36
|
+
finish: () => {
|
|
37
|
+
flow.runThen();
|
|
38
|
+
flow.reset();
|
|
39
|
+
}
|
|
40
|
+
}), [flow.reset, flow.runThen]);
|
|
41
|
+
const holder = (0, _burojs_react.useScreenState)()?.inline;
|
|
42
|
+
const t = (0, _burojs_react.useOptionalT)();
|
|
43
|
+
(0, react.useEffect)(() => {
|
|
44
|
+
if (lease === void 0 || holder === void 0) return;
|
|
45
|
+
lease.mounted += 1;
|
|
46
|
+
lease.label = chrome.labelText;
|
|
47
|
+
holder.touch();
|
|
48
|
+
return () => {
|
|
49
|
+
lease.mounted -= 1;
|
|
50
|
+
holder.touch();
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
lease,
|
|
54
|
+
holder,
|
|
55
|
+
chrome.labelText
|
|
56
|
+
]);
|
|
57
|
+
(0, react.useEffect)(() => {
|
|
58
|
+
if (lease === void 0 || holder === void 0 || run === null) return;
|
|
59
|
+
const sync = () => {
|
|
60
|
+
const now = run.getSnapshot();
|
|
61
|
+
if (lease.initial === void 0 && now.history.includes("open")) lease.initial = JSON.stringify(now.values);
|
|
62
|
+
const dirty = now.outcome?.outcome !== "success" && (now.outcome?.outcome === "unknown" || lease.initial !== void 0 && JSON.stringify(now.values) !== lease.initial);
|
|
63
|
+
const locked = now.control === "running";
|
|
64
|
+
if (dirty === lease.dirty && locked === lease.locked) return;
|
|
65
|
+
lease.dirty = dirty;
|
|
66
|
+
lease.locked = locked;
|
|
67
|
+
holder.touch();
|
|
68
|
+
};
|
|
69
|
+
sync();
|
|
70
|
+
return run.subscribe(sync);
|
|
71
|
+
}, [
|
|
72
|
+
lease,
|
|
73
|
+
holder,
|
|
74
|
+
run
|
|
75
|
+
]);
|
|
76
|
+
const opened = run !== null && compiled !== null && (snapshot.history.includes("open") || snapshot.step === "outcome");
|
|
77
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
78
|
+
"data-testid": tid.inlineFlow(compiled?.flowId ?? `${resource}/actions/${name}`, placementKey),
|
|
79
|
+
"data-buro-host": "inline",
|
|
80
|
+
className: "flex min-h-0 flex-col gap-4",
|
|
81
|
+
children: [stale ? (0, react_jsx_runtime.jsxs)("div", {
|
|
82
|
+
role: "status",
|
|
83
|
+
"data-buro-flow-state": "stale",
|
|
84
|
+
className: "flex flex-wrap items-center gap-2 text-sm text-muted-foreground",
|
|
85
|
+
children: [(0, react_jsx_runtime.jsx)("span", { children: require_check_confirm_dialog.text(t, "flow.noLongerApplies", "This action no longer applies") }), (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
86
|
+
type: "button",
|
|
87
|
+
size: "sm",
|
|
88
|
+
variant: "outline",
|
|
89
|
+
onClick: onDiscard,
|
|
90
|
+
children: require_check_confirm_dialog.text(t, "flow.discard", "Discard")
|
|
91
|
+
})]
|
|
92
|
+
}) : null, opened ? (0, react_jsx_runtime.jsx)("fieldset", {
|
|
93
|
+
disabled: stale,
|
|
94
|
+
className: "m-0 min-w-0 border-0 p-0",
|
|
95
|
+
children: (0, react_jsx_runtime.jsx)(require_flow_screen.HostedFlowScreen, {
|
|
96
|
+
binding,
|
|
97
|
+
host: "inline",
|
|
98
|
+
run,
|
|
99
|
+
compiled,
|
|
100
|
+
label: chrome.labelText,
|
|
101
|
+
record
|
|
102
|
+
})
|
|
103
|
+
}) : (0, react_jsx_runtime.jsx)(_tabler_icons_react.IconLoader2, {
|
|
104
|
+
className: "h-5 w-5 animate-spin self-center",
|
|
105
|
+
"aria-hidden": "true"
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
exports.InlineFlowHost = InlineFlowHost;
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=inline-flow-host-DV1et3c6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-flow-host-DV1et3c6.cjs","names":["useTestIds","useFlowChrome","useMemo","useFlowRun","useScreenState","useOptionalT","text","Button","HostedFlowScreen","IconLoader2"],"sources":["../src/flows/inline-flow-host.tsx"],"sourcesContent":["'use client';\n/**\n * The inline host (P6 3.12): an item flow drawn in place in a show tree. The run lives in the\n * placement's lease, held by the screen, so a tab switch away and back finds the typed input and\n * a write in flight, and the flow's attempt slot stays the one P4 keys on (user, flow, record).\n */\nimport type { FlowTarget, Row } from '@burojs/core';\nimport type { InlineLease } from '@burojs/react';\nimport { useOptionalT, useScreenState, useTestIds } from '@burojs/react';\nimport { useFlowRun } from '@burojs/react/flows';\nimport { IconLoader2 } from '@tabler/icons-react';\nimport { type ReactElement, useEffect, useMemo } from 'react';\nimport { Button } from '../primitives/button.js';\nimport { text, useFlowChrome } from './chrome.js';\nimport { type FlowHostBinding, HostedFlowScreen } from './flow-screen.js';\n\nexport interface InlineFlowHostProps {\n /** The resource of an item flow on a record screen; a page names `target` instead. */\n readonly resource?: string;\n readonly name?: string;\n /** The flow, when it is not an item flow of the screen's resource (a page's, P7 3.15). */\n readonly target?: FlowTarget;\n /** The label of a flow with no resource to ask (an app flow's). */\n readonly label?: string;\n /** The record an item flow runs on; none on a page. */\n readonly record?: Row;\n readonly lease?: InlineLease;\n readonly placementKey: string;\n /**\n * The flow no longer applies to the record (its `when` turned false) while the input is dirty\n * or the attempt unresolved: the node stays, read-only, with \"no longer applies\" and Discard.\n */\n readonly stale?: boolean;\n readonly onDiscard?: () => void;\n}\n\nexport function InlineFlowHost({\n resource = '',\n name = '',\n target: givenTarget,\n label,\n record,\n lease,\n placementKey,\n stale = false,\n onDiscard,\n}: InlineFlowHostProps): ReactElement {\n const tid = useTestIds();\n const own = useFlowChrome(resource, name);\n const chrome = label === undefined ? own : { ...own, label, labelText: label };\n const target = useMemo<FlowTarget>(\n () => givenTarget ?? { resource, action: name },\n [givenTarget, resource, name],\n );\n const flow = useFlowRun(target, {\n ...(record === undefined ? {} : { record }),\n surface: 'inline',\n ...(lease === undefined ? {} : { lease }),\n });\n // `then` is this host's to run, once the form it succeeded in has started over.\n flow.holdThen(true);\n const { run, snapshot, compiled } = flow;\n const binding = useMemo<FlowHostBinding>(\n () => ({\n kind: 'inline',\n close: () => flow.reset(),\n finish: () => {\n flow.runThen();\n flow.reset();\n },\n }),\n // biome-ignore lint/correctness/useExhaustiveDependencies: reset and runThen are stable callbacks\n [flow.reset, flow.runThen],\n );\n const holder = useScreenState()?.inline;\n const t = useOptionalT();\n // The lease's guard state, from the run: unsaved input or an unresolved attempt (dirty), a\n // write in flight (locked), and whether a node shows it. The screen's blockers read these\n // when the node is not on screen (tab switched, placement hidden).\n useEffect(() => {\n if (lease === undefined || holder === undefined) return;\n lease.mounted += 1;\n lease.label = chrome.labelText;\n holder.touch();\n return () => {\n lease.mounted -= 1;\n holder.touch();\n };\n }, [lease, holder, chrome.labelText]);\n useEffect(() => {\n if (lease === undefined || holder === undefined || run === null) return;\n const sync = () => {\n const now = run.getSnapshot();\n if (lease.initial === undefined && now.history.includes('open'))\n lease.initial = JSON.stringify(now.values);\n const dirty =\n now.outcome?.outcome !== 'success' &&\n (now.outcome?.outcome === 'unknown' ||\n (lease.initial !== undefined && JSON.stringify(now.values) !== lease.initial));\n const locked = now.control === 'running';\n if (dirty === lease.dirty && locked === lease.locked) return;\n lease.dirty = dirty;\n lease.locked = locked;\n holder.touch();\n };\n sync();\n return run.subscribe(sync);\n }, [lease, holder, run]);\n const opened =\n run !== null &&\n compiled !== null &&\n (snapshot.history.includes('open') || snapshot.step === 'outcome');\n return (\n <div\n data-testid={tid.inlineFlow(compiled?.flowId ?? `${resource}/actions/${name}`, placementKey)}\n data-buro-host=\"inline\"\n className=\"flex min-h-0 flex-col gap-4\"\n >\n {stale ? (\n <div\n role=\"status\"\n data-buro-flow-state=\"stale\"\n className=\"flex flex-wrap items-center gap-2 text-sm text-muted-foreground\"\n >\n <span>{text(t, 'flow.noLongerApplies', 'This action no longer applies')}</span>\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onDiscard}>\n {text(t, 'flow.discard', 'Discard')}\n </Button>\n </div>\n ) : null}\n {opened ? (\n <fieldset disabled={stale} className=\"m-0 min-w-0 border-0 p-0\">\n <HostedFlowScreen\n binding={binding}\n host=\"inline\"\n run={run}\n compiled={compiled}\n label={chrome.labelText}\n record={record}\n />\n </fieldset>\n ) : (\n <IconLoader2 className=\"h-5 w-5 animate-spin self-center\" aria-hidden=\"true\" />\n )}\n </div>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_use_theme = require("./use-theme-DFlpXils.cjs");
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_use_theme.__toESM(react, 1);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region src/primitives/input.tsx
|
|
6
|
+
const Input = react.forwardRef(({ className, type, ...props }, ref) => {
|
|
7
|
+
return (0, react_jsx_runtime.jsx)("input", {
|
|
8
|
+
type,
|
|
9
|
+
className: require_use_theme.cn("flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input-disabled", className),
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
Input.displayName = "Input";
|
|
15
|
+
//#endregion
|
|
16
|
+
Object.defineProperty(exports, "Input", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return Input;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=input-BI0czGyI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-BI0czGyI.cjs","names":["React","cn"],"sources":["../src/primitives/input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/cn.js';\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input-disabled',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n"],"mappings":";;;;;AAOA,MAAM,QAAQA,MAAM,YACjB,EAAE,WAAW,MAAM,GAAG,SAAS,QAAQ;CACtC,QACE,GAAA,kBAAA,IAAA,CAAC,SAAD;EACQ;EACN,WAAWC,kBAAAA,GACT,yZACA,SACF;EACK;EACL,GAAI;CACL,CAAA;AAEL,CACF;AACA,MAAM,cAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { l as cn } from "./use-theme-dnE3Od3I.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/primitives/input.tsx
|
|
5
|
+
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
6
|
+
return jsx("input", {
|
|
7
|
+
type,
|
|
8
|
+
className: cn("flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input-disabled", className),
|
|
9
|
+
ref,
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
Input.displayName = "Input";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Input as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=input-CUPStzZO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-CUPStzZO.js","names":[],"sources":["../src/primitives/input.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/cn.js';\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input-disabled',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n"],"mappings":";;;;AAOA,MAAM,QAAQ,MAAM,YACjB,EAAE,WAAW,MAAM,GAAG,SAAS,QAAQ;CACtC,OACE,IAAC,SAAD;EACQ;EACN,WAAW,GACT,yZACA,SACF;EACK;EACL,GAAI;CACL,CAAA;AAEL,CACF;AACA,MAAM,cAAc"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { l as cn } from "./use-theme-dnE3Od3I.js";
|
|
2
|
+
import { useOptionalT } from "@burojs/react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7
|
+
//#region src/primitives/label.tsx
|
|
8
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
9
|
+
const Label = React.forwardRef(({ className, required, children, ...props }, ref) => {
|
|
10
|
+
const t = useOptionalT();
|
|
11
|
+
return jsxs(LabelPrimitive.Root, {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn(labelVariants(), className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [children, required && jsxs(Fragment$1, { children: [jsx("span", {
|
|
16
|
+
className: "ml-0.5 text-destructive",
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
children: "*"
|
|
19
|
+
}), jsxs("span", {
|
|
20
|
+
className: "sr-only",
|
|
21
|
+
children: [" ", t("validation.requiredHint", { defaultValue: "(required)" })]
|
|
22
|
+
})] })]
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Label as t };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=label-66W1qbke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-66W1qbke.js","names":[],"sources":["../src/primitives/label.tsx"],"sourcesContent":["'use client';\nimport { useOptionalT } from '@burojs/react';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/cn.js';\n\nconst labelVariants = cva(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n);\n\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n /**\n * When true, append a destructive-colored asterisk after the label text\n * plus a screen-reader-only \"(required)\" hint. This is the single-source\n * required-indicator style — every form should render its required-field\n * label as `<Label required>...</Label>` rather than hand-rolling the\n * asterisk markup. The visual asterisk is `aria-hidden`; AT users get\n * the spoken hint via the sr-only span. (Inputs are still expected to\n * carry their own `aria-required` / `required` HTML attributes for the\n * native semantics.)\n */\n required?: boolean;\n };\n\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, required, children, ...props }, ref) => {\n // Localized so that a screen-reader user in a non-English app does not\n // hear an English \"(required)\".\n const t = useOptionalT();\n return (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}>\n {children}\n {required && (\n <>\n <span className=\"ml-0.5 text-destructive\" aria-hidden=\"true\">\n *\n </span>\n <span className=\"sr-only\">\n {' '}\n {t('validation.requiredHint', { defaultValue: '(required)' })}\n </span>\n </>\n )}\n </LabelPrimitive.Root>\n );\n },\n);\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n"],"mappings":";;;;;;;AAQA,MAAM,gBAAgB,IACpB,4FACF;AAiBA,MAAM,QAAQ,MAAM,YACjB,EAAE,WAAW,UAAU,UAAU,GAAG,SAAS,QAAQ;CAGpD,MAAM,IAAI,aAAa;CACvB,OACE,KAAC,eAAe,MAAhB;EAA0B;EAAK,WAAW,GAAG,cAAc,GAAG,SAAS;EAAG,GAAI;EAA9E,UAAA,CACG,UACA,YACC,KAAA,YAAA,EAAA,UAAA,CACE,IAAC,QAAD;GAAM,WAAU;GAA0B,eAAY;GAAO,UAAA;EAEvD,CAAA,GACN,KAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACG,KACA,EAAE,2BAA2B,EAAE,cAAc,aAAa,CAAC,CACxD;EACN,CAAA,CAAA,EAAA,CAAA,CAEe;;AAEzB,CACF;AACA,MAAM,cAAc,eAAe,KAAK"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const require_use_theme = require("./use-theme-DFlpXils.cjs");
|
|
2
|
+
let _burojs_react = require("@burojs/react");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_use_theme.__toESM(react, 1);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let class_variance_authority = require("class-variance-authority");
|
|
7
|
+
let _radix_ui_react_label = require("@radix-ui/react-label");
|
|
8
|
+
_radix_ui_react_label = require_use_theme.__toESM(_radix_ui_react_label, 1);
|
|
9
|
+
//#region src/primitives/label.tsx
|
|
10
|
+
const labelVariants = (0, class_variance_authority.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
11
|
+
const Label = react.forwardRef(({ className, required, children, ...props }, ref) => {
|
|
12
|
+
const t = (0, _burojs_react.useOptionalT)();
|
|
13
|
+
return (0, react_jsx_runtime.jsxs)(_radix_ui_react_label.Root, {
|
|
14
|
+
ref,
|
|
15
|
+
className: require_use_theme.cn(labelVariants(), className),
|
|
16
|
+
...props,
|
|
17
|
+
children: [children, required && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("span", {
|
|
18
|
+
className: "ml-0.5 text-destructive",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
children: "*"
|
|
21
|
+
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
22
|
+
className: "sr-only",
|
|
23
|
+
children: [" ", t("validation.requiredHint", { defaultValue: "(required)" })]
|
|
24
|
+
})] })]
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
Label.displayName = _radix_ui_react_label.Root.displayName;
|
|
28
|
+
//#endregion
|
|
29
|
+
Object.defineProperty(exports, "Label", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function() {
|
|
32
|
+
return Label;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=label-w6JYf2cF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-w6JYf2cF.cjs","names":["cva","React","useOptionalT","LabelPrimitive","cn"],"sources":["../src/primitives/label.tsx"],"sourcesContent":["'use client';\nimport { useOptionalT } from '@burojs/react';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/cn.js';\n\nconst labelVariants = cva(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n);\n\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n /**\n * When true, append a destructive-colored asterisk after the label text\n * plus a screen-reader-only \"(required)\" hint. This is the single-source\n * required-indicator style — every form should render its required-field\n * label as `<Label required>...</Label>` rather than hand-rolling the\n * asterisk markup. The visual asterisk is `aria-hidden`; AT users get\n * the spoken hint via the sr-only span. (Inputs are still expected to\n * carry their own `aria-required` / `required` HTML attributes for the\n * native semantics.)\n */\n required?: boolean;\n };\n\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, required, children, ...props }, ref) => {\n // Localized so that a screen-reader user in a non-English app does not\n // hear an English \"(required)\".\n const t = useOptionalT();\n return (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}>\n {children}\n {required && (\n <>\n <span className=\"ml-0.5 text-destructive\" aria-hidden=\"true\">\n *\n </span>\n <span className=\"sr-only\">\n {' '}\n {t('validation.requiredHint', { defaultValue: '(required)' })}\n </span>\n </>\n )}\n </LabelPrimitive.Root>\n );\n },\n);\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n"],"mappings":";;;;;;;;;AAQA,MAAM,iBAAA,GAAgBA,yBAAAA,IAAAA,CACpB,4FACF;AAiBA,MAAM,QAAQC,MAAM,YACjB,EAAE,WAAW,UAAU,UAAU,GAAG,SAAS,QAAQ;CAGpD,MAAM,KAAA,GAAIC,cAAAA,aAAAA,CAAa;CACvB,QACE,GAAA,kBAAA,KAAA,CAACC,sBAAe,MAAhB;EAA0B;EAAK,WAAWC,kBAAAA,GAAG,cAAc,GAAG,SAAS;EAAG,GAAI;EAA9E,UAAA,CACG,UACA,aACC,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,EACE,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAA0B,eAAY;GAAO,UAAA;EAEvD,CAAA,IACN,GAAA,kBAAA,KAAA,CAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACG,KACA,EAAE,2BAA2B,EAAE,cAAc,aAAa,CAAC,CACxD;EACN,CAAA,CAAA,EAAA,CAAA,CAEe;;AAEzB,CACF;AACA,MAAM,cAAcD,sBAAe,KAAK"}
|
package/dist/markdown/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_use_theme = require("../use-theme-
|
|
3
|
+
const require_use_theme = require("../use-theme-DFlpXils.cjs");
|
|
4
4
|
let _burojs_react = require("@burojs/react");
|
|
5
5
|
let _tabler_icons_react = require("@tabler/icons-react");
|
|
6
6
|
let react = require("react");
|
|
@@ -1182,9 +1182,8 @@ declare function docSlug(text: string): string;
|
|
|
1182
1182
|
* The current fragment, DECODED, without its `#`.
|
|
1183
1183
|
*
|
|
1184
1184
|
* `window.location.hash` hands back a percent-encoded string —
|
|
1185
|
-
* `#%D0%BF%D0%BE%D1%87%D0%B5%D0%BC%D1%83…` for
|
|
1186
|
-
* comparison against a slug fails, silently, for
|
|
1187
|
-
* project writes its documentation in. It works perfectly in English, which is
|
|
1185
|
+
* `#%D0%BF%D0%BE%D1%87%D0%B5%D0%BC%D1%83…` for a non-ASCII slug — so every
|
|
1186
|
+
* comparison against a slug fails, silently, for every non-ASCII alphabet. It works perfectly in ASCII-only slugs, which is
|
|
1188
1187
|
* the worst possible way for it to be wrong.
|
|
1189
1188
|
*/
|
|
1190
1189
|
declare function readDocHash(): string;
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -1182,9 +1182,8 @@ declare function docSlug(text: string): string;
|
|
|
1182
1182
|
* The current fragment, DECODED, without its `#`.
|
|
1183
1183
|
*
|
|
1184
1184
|
* `window.location.hash` hands back a percent-encoded string —
|
|
1185
|
-
* `#%D0%BF%D0%BE%D1%87%D0%B5%D0%BC%D1%83…` for
|
|
1186
|
-
* comparison against a slug fails, silently, for
|
|
1187
|
-
* project writes its documentation in. It works perfectly in English, which is
|
|
1185
|
+
* `#%D0%BF%D0%BE%D1%87%D0%B5%D0%BC%D1%83…` for a non-ASCII slug — so every
|
|
1186
|
+
* comparison against a slug fails, silently, for every non-ASCII alphabet. It works perfectly in ASCII-only slugs, which is
|
|
1188
1187
|
* the worst possible way for it to be wrong.
|
|
1189
1188
|
*/
|
|
1190
1189
|
declare function readDocHash(): string;
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as docSlug, c as scrollToDocAnchor, i as docShareUrl, l as cn, n as useTheme, o as findDocAnchor, r as DOC_ID_PREFIX, s as readDocHash } from "../use-theme-dnE3Od3I.js";
|
|
3
3
|
import { useOptionalT } from "@burojs/react";
|
|
4
4
|
import { IconCheck, IconChevronDown, IconLink } from "@tabler/icons-react";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|