@alfadocs/ui-kit 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{anamnesis-summary-rows-F-cCmFAn.js → anamnesis-summary-rows-d44s_whc.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-BjlF2rTz.js → antenatal-schedule-timeline-B1k8QkA6.js} +3 -3
- package/dist/_chunks/{appointment-card-BhcPJpXh.js → appointment-card-Dzr3GeVz.js} +73 -90
- package/dist/_chunks/{appointment-timeline-CMPvzlGZ.js → appointment-timeline-0mwtpErq.js} +3 -3
- package/dist/_chunks/{appointment-tray-3c_FLxXJ.js → appointment-tray-4FUu_5NX.js} +2 -2
- package/dist/_chunks/armchair-BaLDW6Hz.js +23 -0
- package/dist/_chunks/{booking-CQMJUFG-.js → booking-DHkKcUIl.js} +4 -4
- package/dist/_chunks/{calendar-4dXTvsCz.js → calendar-B4Gnyu1C.js} +553 -437
- package/dist/_chunks/calendar-event-card-Bjdbik8G.js +425 -0
- package/dist/_chunks/{care-plan-card-DQjVRDxO.js → care-plan-card-aDN4oem9.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CMpoeNkb.js → care-plan-entry-card-BEhANdBE.js} +2 -2
- package/dist/_chunks/{care-plan-header-CxYoq23f.js → care-plan-header-CkpPyQqG.js} +2 -2
- package/dist/_chunks/{color-picker-D-tUwxxT.js → color-picker-oZ6zYks8.js} +164 -151
- package/dist/_chunks/control-room-rail-Cj2iX9h_.js +337 -0
- package/dist/_chunks/{cycle-calculator-DzgO1vzP.js → cycle-calculator-DmtYGhqq.js} +3 -3
- package/dist/_chunks/{date-picker-Bp64zk2p.js → date-picker-CepI_oI2.js} +77 -74
- package/dist/_chunks/{date-picker-variants-pKAJfnWr.js → date-picker-variants-DfuooXEK.js} +7 -2
- package/dist/_chunks/{date-range-picker-CDrZ8Zh0.js → date-range-picker-BD8P_rJq.js} +46 -45
- package/dist/_chunks/{date-time-picker-DVETwpzc.js → date-time-picker-3I2vVKGV.js} +2 -2
- package/dist/_chunks/{due-date-calculator-wK8Tajzz.js → due-date-calculator-BF_Ikofx.js} +4 -4
- package/dist/_chunks/{entity-card-9_62gY7l.js → entity-card-DmrgYSEX.js} +4 -4
- package/dist/_chunks/{gestational-age-calculator-C_uDAeP_.js → gestational-age-calculator-CxZelpu2.js} +5 -5
- package/dist/_chunks/{hcg-doubling-BaXkJhT-.js → hcg-doubling-CpU7H5rQ.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-DH4JYpKU.js → link-cell-renderer-BZQtsuFz.js} +2 -2
- package/dist/_chunks/{notes-panel-DlnENphf.js → notes-panel-e9cJWVRg.js} +2 -2
- package/dist/_chunks/{operator-hero-CCDnIa1S.js → operator-hero-BnFv-Uef.js} +2 -2
- package/dist/_chunks/{parse-JqixfsU0.js → parse-MN9bGkrY.js} +2 -2
- package/dist/_chunks/{patient-details-qnsqYBGQ.js → patient-details-xrqe13az.js} +160 -159
- package/dist/_chunks/{patient-table-DwshfVsQ.js → patient-table-BqYomX50.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-BBIG7NFL.js → payment-automation-upsell-DwQW2fRp.js} +52 -63
- package/dist/_chunks/{payment-request-card-BjjBMdsp.js → payment-request-card-YVCcCZ25.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BVS_9YU2.js → pregnancy-dating-DtToyMyc.js} +5 -5
- package/dist/_chunks/{radiograph-panel.agent-CiHwgISa.js → radiograph-panel.agent-C3trfWqB.js} +3 -3
- package/dist/_chunks/repeat-CvQa5rZt.js +17 -0
- package/dist/_chunks/resource-chip-DYTG0IQQ.js +83 -0
- package/dist/_chunks/{rich-text-editor-DARnq_6N.js → rich-text-editor-BDfFtK4H.js} +2 -2
- package/dist/_chunks/subDays-BLl3y3pd.js +8 -0
- package/dist/agent-catalog.json +2 -2
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/calendar.d.ts +138 -12
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/calendar-event-card.d.ts +48 -11
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/color-picker/index.d.ts +1 -1
- package/dist/components/color-picker/index.js +4 -3
- package/dist/components/color-picker/palettes.d.ts +10 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts +11 -0
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-details/patient-details.d.ts +8 -0
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/resource-chip/index.d.ts +3 -0
- package/dist/components/resource-chip/index.js +5 -0
- package/dist/components/resource-chip/resource-chip.d.ts +26 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/host-compat.css +7 -1
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.js +4 -0
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.js +4 -0
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.js +4 -0
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.js +4 -0
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.js +4 -0
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.js +4 -0
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.js +4 -0
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.js +4 -0
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.js +4 -0
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.js +4 -0
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.js +4 -0
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.js +4 -0
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.js +4 -0
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.js +4 -0
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.js +4 -0
- package/dist/index.js +961 -958
- package/dist/locales/ar.json +4 -0
- package/dist/locales/de.json +4 -0
- package/dist/locales/el.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/es.json +4 -0
- package/dist/locales/fr.json +4 -0
- package/dist/locales/hi.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/locales/ja.json +4 -0
- package/dist/locales/nl.json +4 -0
- package/dist/locales/pl.json +4 -0
- package/dist/locales/pt.json +4 -0
- package/dist/locales/ro.json +4 -0
- package/dist/locales/ru.json +4 -0
- package/dist/locales/sq.json +4 -0
- package/dist/locales/sv.json +4 -0
- package/dist/locales/tr.json +4 -0
- package/dist/locales/zh.json +4 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/tokens.css +40 -24
- package/package.json +5 -1
- package/dist/_chunks/calendar-event-card-C6qGtywL.js +0 -257
- package/dist/_chunks/control-room-rail-IH1eBjrK.js +0 -333
- package/dist/_chunks/subDays-CAUv47M1.js +0 -8
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { jsx as h, jsxs as D, Fragment as lo } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useCallback as g, useMemo as T, useRef as B, useContext as H, useId as io, useEffect as ao, createContext as co, forwardRef as uo } from "react";
|
|
3
|
+
import { useTranslation as po } from "react-i18next";
|
|
4
|
+
import { I as G } from "./icon-button-DA2CAGHZ.js";
|
|
5
|
+
import { a as fo } from "./panel-header-D313n_9-.js";
|
|
6
|
+
import { T as mo } from "./tool-rail-CHyUmulN.js";
|
|
7
|
+
import { u as go } from "./use-persistent-state-nZwZAnE9.js";
|
|
8
|
+
import { S as Ro } from "./star-Bf9L2Uot.js";
|
|
9
|
+
import { X as vo } from "./x-B5YnXwCz.js";
|
|
10
|
+
const ho = {
|
|
11
|
+
id: "control-room-rail",
|
|
12
|
+
capabilities: ["open", "close", "select_single"],
|
|
13
|
+
state: {
|
|
14
|
+
activeToolId: {
|
|
15
|
+
type: "string | null",
|
|
16
|
+
descriptionKey: "ui.toolRail.agent.state.activeToolId",
|
|
17
|
+
description: "Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.",
|
|
18
|
+
read: (t) => t.getActiveToolId()
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
actions: {
|
|
22
|
+
open: {
|
|
23
|
+
// Pure ephemeral panel state (open) — no data loss, no external effect.
|
|
24
|
+
safety: "read",
|
|
25
|
+
argsType: "{ id: string }",
|
|
26
|
+
argsSchema: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: { id: { type: "string" } },
|
|
29
|
+
required: ["id"]
|
|
30
|
+
},
|
|
31
|
+
idempotent: !0,
|
|
32
|
+
descriptionKey: "ui.toolRail.agent.actions.open",
|
|
33
|
+
description: "Open the given tool's panel.",
|
|
34
|
+
examples: [{ args: { id: "inbox" }, note: "Open the inbox tool panel." }],
|
|
35
|
+
invoke: (t, n) => {
|
|
36
|
+
t.open(n.id);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
close: {
|
|
40
|
+
safety: "read",
|
|
41
|
+
idempotent: !0,
|
|
42
|
+
descriptionKey: "ui.toolRail.agent.actions.close",
|
|
43
|
+
description: "Collapse the rail to its strip (no active tool).",
|
|
44
|
+
invoke: (t) => {
|
|
45
|
+
t.close();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
select_tool: {
|
|
49
|
+
safety: "read",
|
|
50
|
+
argsType: "{ id: string | null }",
|
|
51
|
+
argsSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: { id: { type: ["string", "null"] } },
|
|
54
|
+
required: ["id"]
|
|
55
|
+
},
|
|
56
|
+
idempotent: !0,
|
|
57
|
+
descriptionKey: "ui.toolRail.agent.actions.selectTool",
|
|
58
|
+
description: "Set the active tool by id (opens its panel), or pass null to collapse.",
|
|
59
|
+
invoke: (t, n) => {
|
|
60
|
+
t.setActiveTool(n.id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
domHooks: {
|
|
65
|
+
root: {
|
|
66
|
+
attr: "data-component",
|
|
67
|
+
value: "control-room-rail",
|
|
68
|
+
description: "Marks the ControlRoomRail wrapper."
|
|
69
|
+
},
|
|
70
|
+
instanceId: {
|
|
71
|
+
attr: "data-component-id",
|
|
72
|
+
sourceProp: "id",
|
|
73
|
+
description: "Sourced from the id prop. Required to address a specific rail from the agent."
|
|
74
|
+
},
|
|
75
|
+
item: {
|
|
76
|
+
attr: "data-tool-id",
|
|
77
|
+
description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, S = co(null);
|
|
81
|
+
function jo({
|
|
82
|
+
globalTools: t = [],
|
|
83
|
+
children: n
|
|
84
|
+
}) {
|
|
85
|
+
const [u, s] = _(
|
|
86
|
+
() => /* @__PURE__ */ new Map()
|
|
87
|
+
), p = g(
|
|
88
|
+
(i, l) => {
|
|
89
|
+
s((a) => {
|
|
90
|
+
const M = new Map(a);
|
|
91
|
+
return M.set(i, l), M;
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
[]
|
|
95
|
+
), P = g((i) => {
|
|
96
|
+
s((l) => {
|
|
97
|
+
if (!l.has(i)) return l;
|
|
98
|
+
const a = new Map(l);
|
|
99
|
+
return a.delete(i), a;
|
|
100
|
+
});
|
|
101
|
+
}, []), f = T(
|
|
102
|
+
() => Array.from(u.values()).flat(),
|
|
103
|
+
[u]
|
|
104
|
+
), v = B(null), k = g((i) => {
|
|
105
|
+
v.current = i;
|
|
106
|
+
}, []), m = g((i) => {
|
|
107
|
+
var l;
|
|
108
|
+
(l = v.current) == null || l.setActiveTool(i);
|
|
109
|
+
}, []), b = g(() => {
|
|
110
|
+
var i;
|
|
111
|
+
(i = v.current) == null || i.setActiveTool(null);
|
|
112
|
+
}, []), y = T(
|
|
113
|
+
() => ({
|
|
114
|
+
globalTools: t,
|
|
115
|
+
contextualTools: f,
|
|
116
|
+
registerContextualTools: p,
|
|
117
|
+
unregisterContextualTools: P,
|
|
118
|
+
registerRail: k,
|
|
119
|
+
openTool: m,
|
|
120
|
+
closeTool: b
|
|
121
|
+
}),
|
|
122
|
+
[
|
|
123
|
+
t,
|
|
124
|
+
f,
|
|
125
|
+
p,
|
|
126
|
+
P,
|
|
127
|
+
k,
|
|
128
|
+
m,
|
|
129
|
+
b
|
|
130
|
+
]
|
|
131
|
+
);
|
|
132
|
+
return /* @__PURE__ */ h(S.Provider, { value: y, children: n });
|
|
133
|
+
}
|
|
134
|
+
function Ho(t) {
|
|
135
|
+
const n = H(S), u = n == null ? void 0 : n.registerContextualTools, s = n == null ? void 0 : n.unregisterContextualTools, p = io();
|
|
136
|
+
ao(() => {
|
|
137
|
+
if (!(!u || !s))
|
|
138
|
+
return u(p, t), () => s(p);
|
|
139
|
+
}, [u, s, p, t]);
|
|
140
|
+
}
|
|
141
|
+
function To() {
|
|
142
|
+
const t = H(S);
|
|
143
|
+
return T(() => {
|
|
144
|
+
if (!t) return [];
|
|
145
|
+
const n = t.contextualTools.map((s) => ({
|
|
146
|
+
...s,
|
|
147
|
+
scope: "contextual"
|
|
148
|
+
})), u = t.globalTools.map((s) => ({
|
|
149
|
+
...s,
|
|
150
|
+
scope: "global"
|
|
151
|
+
}));
|
|
152
|
+
return [...n, ...u];
|
|
153
|
+
}, [t]);
|
|
154
|
+
}
|
|
155
|
+
function Ko() {
|
|
156
|
+
const t = H(S), n = g(() => {
|
|
157
|
+
}, []);
|
|
158
|
+
return {
|
|
159
|
+
openTool: (t == null ? void 0 : t.openTool) ?? n,
|
|
160
|
+
closeTool: (t == null ? void 0 : t.closeTool) ?? n
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function yo() {
|
|
164
|
+
const t = H(S), n = g((u) => {
|
|
165
|
+
}, []);
|
|
166
|
+
return (t == null ? void 0 : t.registerRail) ?? n;
|
|
167
|
+
}
|
|
168
|
+
const qo = uo(function({
|
|
169
|
+
tools: n,
|
|
170
|
+
railLabel: u,
|
|
171
|
+
reorderable: s = !0,
|
|
172
|
+
favoriteIds: p,
|
|
173
|
+
defaultFavoriteIds: P,
|
|
174
|
+
pinnedFavoriteIds: f,
|
|
175
|
+
onFavoriteIdsChange: v,
|
|
176
|
+
persistFavoritesKey: k = "ui.controlRoom.favorites",
|
|
177
|
+
activeToolId: m,
|
|
178
|
+
defaultActiveToolId: b = null,
|
|
179
|
+
onActiveToolChange: y,
|
|
180
|
+
...i
|
|
181
|
+
}, l) {
|
|
182
|
+
const { t: a } = po(), [M, J] = _(
|
|
183
|
+
m ?? b ?? null
|
|
184
|
+
), L = m !== void 0 ? m : M, Q = g(
|
|
185
|
+
(o) => {
|
|
186
|
+
m === void 0 && J(o), y == null || y(o);
|
|
187
|
+
},
|
|
188
|
+
[m, y]
|
|
189
|
+
), U = To(), C = n ?? U, K = p !== void 0, [W, Y] = go(
|
|
190
|
+
k,
|
|
191
|
+
() => P ?? C.filter((o) => o.scope === "global").map((o) => o.id),
|
|
192
|
+
{ disabled: K }
|
|
193
|
+
), q = K ? p : W, A = T(() => f != null && f.length ? [
|
|
194
|
+
...f,
|
|
195
|
+
...q.filter((o) => !f.includes(o))
|
|
196
|
+
] : q, [f, q]), d = T(() => {
|
|
197
|
+
const o = /* @__PURE__ */ new Map();
|
|
198
|
+
for (const r of C) o.set(r.id, r);
|
|
199
|
+
return o;
|
|
200
|
+
}, [C]), w = T(
|
|
201
|
+
() => new Set(A.filter((o) => d.has(o))),
|
|
202
|
+
[A, d]
|
|
203
|
+
), O = (o) => {
|
|
204
|
+
const r = o(A.filter((e) => d.has(e)));
|
|
205
|
+
K || Y((e) => o(e.filter((c) => d.has(c)))), v == null || v(r);
|
|
206
|
+
}, E = T(() => {
|
|
207
|
+
if (!s) return C;
|
|
208
|
+
const o = A.filter((e) => d.has(e)).map((e) => ({
|
|
209
|
+
...d.get(e),
|
|
210
|
+
scope: "global",
|
|
211
|
+
reorderable: !0
|
|
212
|
+
})), r = C.filter((e) => !w.has(e.id)).map((e) => ({
|
|
213
|
+
...e,
|
|
214
|
+
scope: "contextual",
|
|
215
|
+
reorderable: !0
|
|
216
|
+
}));
|
|
217
|
+
return [...o, ...r];
|
|
218
|
+
}, [s, C, A, d, w]), [Z, F] = _(""), z = B(!1), I = (o, r) => {
|
|
219
|
+
const e = r ? a("controlRoom.pinnedAnnounce", {
|
|
220
|
+
tool: o,
|
|
221
|
+
defaultValue: "Pinned {{tool}} to favourites"
|
|
222
|
+
}) : a("controlRoom.unpinnedAnnounce", {
|
|
223
|
+
tool: o,
|
|
224
|
+
defaultValue: "Removed {{tool}} from favourites"
|
|
225
|
+
});
|
|
226
|
+
z.current = !z.current, F(z.current ? e : `${e}`);
|
|
227
|
+
}, oo = (o) => {
|
|
228
|
+
var r;
|
|
229
|
+
I(((r = d.get(o)) == null ? void 0 : r.label) ?? o, !w.has(o)), O(
|
|
230
|
+
(e) => e.includes(o) ? e.filter((c) => c !== o) : [...e, o]
|
|
231
|
+
);
|
|
232
|
+
}, to = (o, r) => {
|
|
233
|
+
var c;
|
|
234
|
+
const e = (c = E[o]) == null ? void 0 : c.id;
|
|
235
|
+
e !== void 0 && O((x) => {
|
|
236
|
+
const V = x.filter((R) => d.has(R)), j = V.length;
|
|
237
|
+
if (o < j) {
|
|
238
|
+
if (r >= j) return V.filter((so) => so !== e);
|
|
239
|
+
const R = V.slice();
|
|
240
|
+
return R.splice(o, 1), R.splice(r, 0, e), R;
|
|
241
|
+
}
|
|
242
|
+
if (r <= j) {
|
|
243
|
+
const R = V.slice();
|
|
244
|
+
return R.splice(Math.min(r, j), 0, e), R;
|
|
245
|
+
}
|
|
246
|
+
return x;
|
|
247
|
+
});
|
|
248
|
+
}, eo = ({
|
|
249
|
+
tool: o,
|
|
250
|
+
from: r,
|
|
251
|
+
to: e
|
|
252
|
+
}) => {
|
|
253
|
+
const c = w.size, x = r < c;
|
|
254
|
+
return x && e >= c ? a("controlRoom.unpinnedAnnounce", {
|
|
255
|
+
tool: o.label,
|
|
256
|
+
defaultValue: "Removed {{tool}} from favourites"
|
|
257
|
+
}) : !x && e <= c ? a("controlRoom.pinnedAnnounce", {
|
|
258
|
+
tool: o.label,
|
|
259
|
+
defaultValue: "Pinned {{tool}} to favourites"
|
|
260
|
+
}) : x && e < c ? a("controlRoom.reorderAnnounce", {
|
|
261
|
+
tool: o.label,
|
|
262
|
+
to: e + 1,
|
|
263
|
+
total: c,
|
|
264
|
+
defaultValue: "{{tool}} moved to position {{to}} of {{total}}"
|
|
265
|
+
}) : "";
|
|
266
|
+
}, X = B(null), $ = yo(), no = g(
|
|
267
|
+
(o) => {
|
|
268
|
+
X.current = o, $(o), typeof l == "function" ? l(o) : l && (l.current = o);
|
|
269
|
+
},
|
|
270
|
+
[$, l]
|
|
271
|
+
), N = L != null ? d.get(L) ?? null : null, ro = N ? /* @__PURE__ */ D(lo, { children: [
|
|
272
|
+
s ? (() => {
|
|
273
|
+
const o = w.has(N.id);
|
|
274
|
+
return /* @__PURE__ */ h(
|
|
275
|
+
G,
|
|
276
|
+
{
|
|
277
|
+
icon: /* @__PURE__ */ h(
|
|
278
|
+
Ro,
|
|
279
|
+
{
|
|
280
|
+
"aria-hidden": "true",
|
|
281
|
+
fill: o ? "currentColor" : "none",
|
|
282
|
+
className: o ? "ds:text-[color:var(--accent)]" : void 0
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
intent: "ghost",
|
|
286
|
+
size: "sm",
|
|
287
|
+
"aria-pressed": o,
|
|
288
|
+
"aria-label": a("controlRoom.favorite", {
|
|
289
|
+
defaultValue: "Favourite"
|
|
290
|
+
}),
|
|
291
|
+
onClick: () => oo(N.id)
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
})() : null,
|
|
295
|
+
/* @__PURE__ */ h(
|
|
296
|
+
G,
|
|
297
|
+
{
|
|
298
|
+
icon: /* @__PURE__ */ h(vo, { "aria-hidden": "true" }),
|
|
299
|
+
intent: "ghost",
|
|
300
|
+
size: "sm",
|
|
301
|
+
"aria-label": a("controlRoom.close", { defaultValue: "Close" }),
|
|
302
|
+
onClick: () => {
|
|
303
|
+
var o;
|
|
304
|
+
return (o = X.current) == null ? void 0 : o.close();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
] }) : null;
|
|
309
|
+
return /* @__PURE__ */ D(fo, { actions: ro, children: [
|
|
310
|
+
/* @__PURE__ */ h(
|
|
311
|
+
mo,
|
|
312
|
+
{
|
|
313
|
+
ref: no,
|
|
314
|
+
dataComponent: "control-room-rail",
|
|
315
|
+
agentAdapter: ho,
|
|
316
|
+
tools: E,
|
|
317
|
+
activeToolId: m,
|
|
318
|
+
defaultActiveToolId: b,
|
|
319
|
+
onActiveToolChange: Q,
|
|
320
|
+
railLabel: u ?? a("controlRoom.railLabel", { defaultValue: "Control room" }),
|
|
321
|
+
onReorder: s ? to : void 0,
|
|
322
|
+
formatReorderAnnouncement: s ? eo : void 0,
|
|
323
|
+
...i
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
s ? /* @__PURE__ */ h("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: Z }) : null
|
|
327
|
+
] });
|
|
328
|
+
});
|
|
329
|
+
export {
|
|
330
|
+
jo as C,
|
|
331
|
+
qo as a,
|
|
332
|
+
To as b,
|
|
333
|
+
ho as c,
|
|
334
|
+
Ho as d,
|
|
335
|
+
Ko as u
|
|
336
|
+
};
|
|
337
|
+
//# sourceMappingURL=control-room-rail-Cj2iX9h_.js.map
|
|
@@ -4,12 +4,12 @@ import { c as q } from "./index-D2ZczOXr.js";
|
|
|
4
4
|
import { useTranslation as z } from "react-i18next";
|
|
5
5
|
import { u as B } from "./registry-DvAUVLHh.js";
|
|
6
6
|
import { F as S } from "./form-field-CahJzTxp.js";
|
|
7
|
-
import { D as Y } from "./date-picker-
|
|
7
|
+
import { D as Y } from "./date-picker-CepI_oI2.js";
|
|
8
8
|
import { N as H } from "./number-input-Cgu2TtA8.js";
|
|
9
9
|
import { C as M } from "./card-DPmk26CL.js";
|
|
10
10
|
import { B as T } from "./badge-sTusUqZD.js";
|
|
11
11
|
import { I as U } from "./insert-result-LCNTskNJ.js";
|
|
12
|
-
import { a as m, c as V } from "./date-picker-variants-
|
|
12
|
+
import { a as m, c as V } from "./date-picker-variants-DfuooXEK.js";
|
|
13
13
|
import { C as J } from "./check-DrFSN__t.js";
|
|
14
14
|
import { H as Q } from "./heart--qCA4ffe.js";
|
|
15
15
|
import { c as X } from "./createLucideIcon-DhHxpK9K.js";
|
|
@@ -422,4 +422,4 @@ export {
|
|
|
422
422
|
ie as L,
|
|
423
423
|
se as p
|
|
424
424
|
};
|
|
425
|
-
//# sourceMappingURL=cycle-calculator-
|
|
425
|
+
//# sourceMappingURL=cycle-calculator-DmtYGhqq.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import * as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { f as T, i as
|
|
10
|
-
import { C as
|
|
11
|
-
import { C as
|
|
12
|
-
import { p as
|
|
13
|
-
const
|
|
2
|
+
import { forwardRef as ie, useContext as oe, useState as y, useRef as K, useEffect as de, useCallback as R, useMemo as le, useImperativeHandle as ce } from "react";
|
|
3
|
+
import { useTranslation as pe } from "react-i18next";
|
|
4
|
+
import * as k from "@radix-ui/react-popover";
|
|
5
|
+
import { u as ue } from "./use-controllable-state-BiY4xTzM.js";
|
|
6
|
+
import { u as fe, F as me } from "./form-field-context-B3APVHKx.js";
|
|
7
|
+
import { u as he } from "./registry-DvAUVLHh.js";
|
|
8
|
+
import { u as ge, g as ve, b as ye, i as ke, c as be, t as Ce, d as De, p as Pe, D as Se, C as xe, e as we, f as Ie } from "./date-picker-variants-DfuooXEK.js";
|
|
9
|
+
import { f as T, i as Oe, b as Ne } from "./format-4HNwNGrN.js";
|
|
10
|
+
import { C as Ve } from "./calendar-days-BGWklvE-.js";
|
|
11
|
+
import { C as Fe } from "./check-DrFSN__t.js";
|
|
12
|
+
import { p as Ae } from "./parse-MN9bGkrY.js";
|
|
13
|
+
const Ke = {
|
|
14
14
|
id: "date-picker",
|
|
15
15
|
// Persisted single date (value state + set_date) → select_single + set_value,
|
|
16
16
|
// plus open/close of the calendar popover.
|
|
@@ -21,8 +21,8 @@ const Ae = {
|
|
|
21
21
|
descriptionKey: "ui.agent.datePicker.state.value",
|
|
22
22
|
description: "Currently-selected ISO date, or null.",
|
|
23
23
|
read: (a) => {
|
|
24
|
-
var
|
|
25
|
-
return ((
|
|
24
|
+
var l;
|
|
25
|
+
return ((l = a.getValue()) == null ? void 0 : l.toISOString()) ?? null;
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
isOpen: {
|
|
@@ -51,8 +51,8 @@ const Ae = {
|
|
|
51
51
|
descriptionKey: "ui.agent.datePicker.actions.setDate",
|
|
52
52
|
description: "Select a specific date (ISO yyyy-mm-dd).",
|
|
53
53
|
examples: [{ args: { date: "2026-06-23" }, note: "Select 23 Jun 2026." }],
|
|
54
|
-
invoke: (a,
|
|
55
|
-
a.setValue(new Date(
|
|
54
|
+
invoke: (a, l) => {
|
|
55
|
+
a.setValue(new Date(l.date));
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
clear: {
|
|
@@ -96,40 +96,41 @@ const Ae = {
|
|
|
96
96
|
description: "Sourced from the id prop."
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, Re = ie(
|
|
100
100
|
({
|
|
101
101
|
value: a,
|
|
102
|
-
defaultValue:
|
|
102
|
+
defaultValue: l,
|
|
103
103
|
onChange: M,
|
|
104
104
|
minDate: m,
|
|
105
105
|
maxDate: h,
|
|
106
106
|
disabledDates: c,
|
|
107
107
|
weekStartsOn: j,
|
|
108
|
-
presets:
|
|
108
|
+
presets: b,
|
|
109
109
|
size: x = "md",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"aria-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
chrome: q = "input",
|
|
111
|
+
disabled: B,
|
|
112
|
+
placeholder: E,
|
|
113
|
+
className: L,
|
|
114
|
+
id: _,
|
|
115
|
+
"aria-label": H,
|
|
116
|
+
"aria-labelledby": W
|
|
117
|
+
}, J) => {
|
|
118
|
+
const { t: w, i18n: I } = pe(), p = fe(), O = oe(me) !== null, C = _ ?? p.id, N = p.disabled || B, z = p.invalid ? "error" : "default", u = ge(I.language), f = ve(I.language), G = E ?? w("inputs.datePicker.placeholder", "Select date"), [Q, V] = ue({
|
|
118
119
|
value: a,
|
|
119
|
-
defaultValue:
|
|
120
|
+
defaultValue: l,
|
|
120
121
|
onChange: M
|
|
121
|
-
}), n =
|
|
122
|
+
}), n = Q, [i, s] = y(!1), [U, D] = y(
|
|
122
123
|
n ? T(n, f, { locale: u }) : ""
|
|
123
|
-
), [F, g] = y(!1), [
|
|
124
|
-
|
|
124
|
+
), [F, g] = y(!1), [X, P] = y(n ?? /* @__PURE__ */ new Date()), S = K(null);
|
|
125
|
+
de(() => {
|
|
125
126
|
n ? (D(T(n, f, { locale: u })), g(!1)) : D("");
|
|
126
127
|
}, [n, f, u]);
|
|
127
|
-
const
|
|
128
|
+
const Y = ye(
|
|
128
129
|
m,
|
|
129
130
|
h,
|
|
130
131
|
c
|
|
131
|
-
),
|
|
132
|
-
(e) => m &&
|
|
132
|
+
), Z = R(
|
|
133
|
+
(e) => m && ke(e, m) || h && be(e, h) ? !0 : Array.isArray(c) ? c.some(
|
|
133
134
|
(t) => t.toDateString() === e.toDateString()
|
|
134
135
|
) : typeof c == "function" ? c(e) : !1,
|
|
135
136
|
[m, h, c]
|
|
@@ -138,24 +139,24 @@ const Ae = {
|
|
|
138
139
|
V(e);
|
|
139
140
|
},
|
|
140
141
|
[V]
|
|
141
|
-
),
|
|
142
|
+
), $ = (e) => {
|
|
142
143
|
const t = e.target.value;
|
|
143
144
|
if (D(t), t.length === 0) {
|
|
144
145
|
g(!1), o(void 0);
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
}, $ = (e) => {
|
|
150
|
-
e.key === "Enter" && i && (e.preventDefault(), s(!1)), e.key === "Escape" && i && (e.preventDefault(), s(!1)), e.key === "ArrowDown" && !i && (e.preventDefault(), s(!0));
|
|
148
|
+
const d = Ae(t, f, /* @__PURE__ */ new Date(), { locale: u });
|
|
149
|
+
Oe(d) && !Z(d) ? (g(!1), o(d), P(d)) : t.length === f.length && g(!0);
|
|
151
150
|
}, ee = (e) => {
|
|
151
|
+
e.key === "Enter" && i && (e.preventDefault(), s(!1)), e.key === "Escape" && i && (e.preventDefault(), s(!1)), e.key === "ArrowDown" && !i && (e.preventDefault(), s(!0));
|
|
152
|
+
}, te = (e) => {
|
|
152
153
|
var t;
|
|
153
154
|
e && (o(e), s(!1), (t = S.current) == null || t.focus());
|
|
154
|
-
},
|
|
155
|
-
var
|
|
155
|
+
}, ae = (e) => {
|
|
156
|
+
var d;
|
|
156
157
|
const t = e.date();
|
|
157
|
-
o(t), P(t), s(!1), (
|
|
158
|
-
},
|
|
158
|
+
o(t), P(t), s(!1), (d = S.current) == null || d.focus();
|
|
159
|
+
}, re = (e) => n ? Ne(e.date(), n) : !1, ne = w("inputs.datePicker.gridLabel", "Calendar"), se = le(
|
|
159
160
|
() => ({
|
|
160
161
|
getValue: () => n,
|
|
161
162
|
setValue: (e) => o(e),
|
|
@@ -166,66 +167,68 @@ const Ae = {
|
|
|
166
167
|
}),
|
|
167
168
|
[n, o, i]
|
|
168
169
|
), A = K(null);
|
|
169
|
-
return
|
|
170
|
+
return ce(J, () => A.current, []), he(Ke, se, C), /* @__PURE__ */ r(k.Root, { open: i, onOpenChange: s, children: /* @__PURE__ */ v(
|
|
170
171
|
"div",
|
|
171
172
|
{
|
|
172
173
|
ref: A,
|
|
173
|
-
className:
|
|
174
|
+
className: L,
|
|
174
175
|
"data-component": "date-picker",
|
|
175
176
|
"data-component-id": C,
|
|
176
177
|
children: [
|
|
177
178
|
/* @__PURE__ */ v("div", { className: "ds:relative", children: [
|
|
178
|
-
/* @__PURE__ */ r(
|
|
179
|
+
/* @__PURE__ */ r(k.Trigger, { asChild: !0, disabled: N, children: /* @__PURE__ */ r(
|
|
179
180
|
"input",
|
|
180
181
|
{
|
|
181
182
|
ref: S,
|
|
182
183
|
id: C,
|
|
183
184
|
type: "text",
|
|
184
185
|
role: "combobox",
|
|
185
|
-
value:
|
|
186
|
-
placeholder:
|
|
186
|
+
value: U,
|
|
187
|
+
placeholder: G,
|
|
187
188
|
disabled: N,
|
|
188
|
-
"aria-label": O ? void 0 :
|
|
189
|
-
"aria-labelledby": O ? void 0 :
|
|
189
|
+
"aria-label": O ? void 0 : H,
|
|
190
|
+
"aria-labelledby": O ? void 0 : W,
|
|
190
191
|
"aria-describedby": p.describedBy || void 0,
|
|
191
192
|
"aria-invalid": p.invalid || F || void 0,
|
|
192
193
|
"aria-required": p.required || void 0,
|
|
193
194
|
"aria-haspopup": "dialog",
|
|
194
195
|
"aria-expanded": i,
|
|
195
|
-
onChange:
|
|
196
|
-
onKeyDown:
|
|
196
|
+
onChange: $,
|
|
197
|
+
onKeyDown: ee,
|
|
197
198
|
onClick: () => !i && s(!0),
|
|
198
|
-
className:
|
|
199
|
+
className: Ce({
|
|
199
200
|
size: x,
|
|
200
|
-
tone: F ? "error" :
|
|
201
|
+
tone: F ? "error" : z,
|
|
202
|
+
chrome: q
|
|
201
203
|
})
|
|
202
204
|
}
|
|
203
205
|
) }),
|
|
204
|
-
/* @__PURE__ */ r("span", { "aria-hidden": "true", className:
|
|
206
|
+
/* @__PURE__ */ r("span", { "aria-hidden": "true", className: De({ size: x }), children: /* @__PURE__ */ r(Ve, {}) })
|
|
205
207
|
] }),
|
|
206
|
-
/* @__PURE__ */ r(
|
|
207
|
-
|
|
208
|
+
/* @__PURE__ */ r(k.Portal, { children: /* @__PURE__ */ r(
|
|
209
|
+
k.Content,
|
|
208
210
|
{
|
|
209
211
|
sideOffset: 4,
|
|
210
212
|
align: "start",
|
|
211
|
-
|
|
213
|
+
"data-component": "date-picker-content",
|
|
214
|
+
className: Ie(),
|
|
212
215
|
onOpenAutoFocus: (e) => {
|
|
213
216
|
e.preventDefault();
|
|
214
217
|
},
|
|
215
218
|
children: /* @__PURE__ */ v("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
|
|
216
|
-
|
|
217
|
-
const t =
|
|
219
|
+
b && b.length > 0 ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-[8rem] ds:border-e ds:border-border ds:pe-[var(--spacing-md)]", children: b.map((e) => {
|
|
220
|
+
const t = re(e);
|
|
218
221
|
return /* @__PURE__ */ v(
|
|
219
222
|
"button",
|
|
220
223
|
{
|
|
221
224
|
type: "button",
|
|
222
225
|
"aria-pressed": t,
|
|
223
|
-
onClick: () =>
|
|
224
|
-
className:
|
|
226
|
+
onClick: () => ae(e),
|
|
227
|
+
className: Pe({ active: t }),
|
|
225
228
|
children: [
|
|
226
229
|
/* @__PURE__ */ r("span", { className: "ds:min-w-0 ds:truncate", children: e.label }),
|
|
227
230
|
t ? /* @__PURE__ */ r(
|
|
228
|
-
|
|
231
|
+
Fe,
|
|
229
232
|
{
|
|
230
233
|
"aria-hidden": "true",
|
|
231
234
|
className: "ds:size-4 ds:shrink-0 ds:text-primary"
|
|
@@ -236,21 +239,21 @@ const Ae = {
|
|
|
236
239
|
e.label
|
|
237
240
|
);
|
|
238
241
|
}) }) : null,
|
|
239
|
-
/* @__PURE__ */ r("div", { role: "region", "aria-label":
|
|
240
|
-
|
|
242
|
+
/* @__PURE__ */ r("div", { role: "region", "aria-label": ne, children: /* @__PURE__ */ r(
|
|
243
|
+
Se,
|
|
241
244
|
{
|
|
242
245
|
mode: "single",
|
|
243
246
|
selected: n,
|
|
244
|
-
onSelect:
|
|
245
|
-
month:
|
|
247
|
+
onSelect: te,
|
|
248
|
+
month: X,
|
|
246
249
|
onMonthChange: P,
|
|
247
|
-
disabled:
|
|
250
|
+
disabled: Y,
|
|
248
251
|
weekStartsOn: j,
|
|
249
252
|
locale: u,
|
|
250
253
|
showOutsideDays: !0,
|
|
251
254
|
fixedWeeks: !0,
|
|
252
|
-
classNames:
|
|
253
|
-
components: { Chevron:
|
|
255
|
+
classNames: we,
|
|
256
|
+
components: { Chevron: xe }
|
|
254
257
|
}
|
|
255
258
|
) })
|
|
256
259
|
] })
|
|
@@ -261,9 +264,9 @@ const Ae = {
|
|
|
261
264
|
) });
|
|
262
265
|
}
|
|
263
266
|
);
|
|
264
|
-
|
|
267
|
+
Re.displayName = "DatePicker";
|
|
265
268
|
export {
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
Re as D,
|
|
270
|
+
Ke as d
|
|
268
271
|
};
|
|
269
|
-
//# sourceMappingURL=date-picker-
|
|
272
|
+
//# sourceMappingURL=date-picker-CepI_oI2.js.map
|
|
@@ -1940,7 +1940,12 @@ const Ae = "ds:bg-[var(--calendar-range-fill)]", gs = "ds:size-[var(--min-target
|
|
|
1940
1940
|
// on the input chrome (tokens `--shadow-input`), so `input` stays default.
|
|
1941
1941
|
chrome: {
|
|
1942
1942
|
input: "ds:rounded-[var(--radius-sm)] ds:bg-input ds:shadow-[var(--shadow-input)]",
|
|
1943
|
-
button:
|
|
1943
|
+
button: (
|
|
1944
|
+
// font-medium matches the kit Button's base weight — a
|
|
1945
|
+
// button-chrome trigger sits among Buttons, and the regular-400
|
|
1946
|
+
// value read as a different face beside their medium labels.
|
|
1947
|
+
"ds:rounded-[var(--radius-md)] ds:bg-transparent ds:shadow-none ds:font-medium ds:hover:bg-muted/10 ds:active:bg-muted/20"
|
|
1948
|
+
)
|
|
1944
1949
|
}
|
|
1945
1950
|
},
|
|
1946
1951
|
compoundVariants: [
|
|
@@ -2086,4 +2091,4 @@ export {
|
|
|
2086
2091
|
mt as w,
|
|
2087
2092
|
Hn as x
|
|
2088
2093
|
};
|
|
2089
|
-
//# sourceMappingURL=date-picker-variants-
|
|
2094
|
+
//# sourceMappingURL=date-picker-variants-DfuooXEK.js.map
|