@speles7172/controls 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/DetailList.d.ts +35 -0
- package/dist/DetailList.d.ts.map +1 -0
- package/dist/DetailList.js +18 -0
- package/dist/DetailList.js.map +1 -0
- package/dist/IconButton.d.ts +47 -0
- package/dist/IconButton.d.ts.map +1 -0
- package/dist/IconButton.js +18 -0
- package/dist/IconButton.js.map +1 -0
- package/dist/Modal.d.ts +23 -1
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +62 -9
- package/dist/Modal.js.map +1 -1
- package/dist/RecordModal.d.ts +58 -0
- package/dist/RecordModal.d.ts.map +1 -0
- package/dist/RecordModal.js +53 -0
- package/dist/RecordModal.js.map +1 -0
- package/dist/SideNav.d.ts +69 -0
- package/dist/SideNav.d.ts.map +1 -0
- package/dist/SideNav.js +118 -0
- package/dist/SideNav.js.map +1 -0
- package/dist/icons.d.ts +1 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +3 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +331 -0
- package/package.json +1 -1
package/dist/Modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useRef, useState } from 'react';
|
|
2
|
+
import { createContext, useContext, useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import { CheckIcon, CloseIcon, DeleteIcon } from './icons.js';
|
|
4
4
|
const UNSAVED_LABELS = {
|
|
5
5
|
title: 'Unsaved changes',
|
|
@@ -29,6 +29,19 @@ const UNSAVED_LABELS = {
|
|
|
29
29
|
* right entry.
|
|
30
30
|
*/
|
|
31
31
|
const openModals = [];
|
|
32
|
+
/** Outside a `<Modal>` there is nothing to guard, and the action runs at once. */
|
|
33
|
+
const ModalGuardContext = createContext((action) => action());
|
|
34
|
+
/**
|
|
35
|
+
* The guard of the `<Modal>` around this component.
|
|
36
|
+
*
|
|
37
|
+
* For a control inside a dialog that moves away from a form without closing —
|
|
38
|
+
* a record's "back to the read view" — and must not drop somebody's typing
|
|
39
|
+
* silently on the way. `guard(() => setMode('view'))` switches at once when
|
|
40
|
+
* nothing was edited, and asks when something was.
|
|
41
|
+
*/
|
|
42
|
+
export function useModalGuard() {
|
|
43
|
+
return useContext(ModalGuardContext);
|
|
44
|
+
}
|
|
32
45
|
/** What `body.style.overflow` was before the first modal took it. */
|
|
33
46
|
let releasedOverflow = '';
|
|
34
47
|
/** Everything a `Tab` can land on, in document order. */
|
|
@@ -108,7 +121,7 @@ function submitterOf(form) {
|
|
|
108
121
|
* so a dark console would open a light dialog. `position: fixed` covers the
|
|
109
122
|
* viewport from wherever the element sits.
|
|
110
123
|
*/
|
|
111
|
-
export function Modal({ title, onClose, children, footer, wide = false, closeLabel = 'Close', dismissible = true, dirty, onSave, unsavedLabels, labelledBy, className, theme = 'light', }) {
|
|
124
|
+
export function Modal({ title, onClose, children, footer, headerActions, wide = false, closeLabel = 'Close', dismissible = true, dirty, onSave, unsavedLabels, labelledBy, className, theme = 'light', }) {
|
|
112
125
|
const panel = useRef(null);
|
|
113
126
|
const confirmPanel = useRef(null);
|
|
114
127
|
const titleId = useId();
|
|
@@ -124,6 +137,20 @@ export function Modal({ title, onClose, children, footer, wide = false, closeLab
|
|
|
124
137
|
const [confirming, setConfirming] = useState(false);
|
|
125
138
|
/** The form *Save* submitted, whose leaving means the save went through. */
|
|
126
139
|
const savedForm = useRef(null);
|
|
140
|
+
/**
|
|
141
|
+
* What finishes once the prompt is answered with Discard, or once a Save has
|
|
142
|
+
* gone through: `null` for closing the dialog, else the action a
|
|
143
|
+
* {@link useModalGuard} caller asked for.
|
|
144
|
+
*/
|
|
145
|
+
const pendingAction = useRef(null);
|
|
146
|
+
const finish = () => {
|
|
147
|
+
const action = pendingAction.current;
|
|
148
|
+
pendingAction.current = null;
|
|
149
|
+
if (action === null)
|
|
150
|
+
onClose();
|
|
151
|
+
else
|
|
152
|
+
action();
|
|
153
|
+
};
|
|
127
154
|
const onReach = (event) => {
|
|
128
155
|
const form = event.target instanceof Element ? event.target.closest('form') : null;
|
|
129
156
|
if (form === null || !panel.current?.contains(form))
|
|
@@ -144,26 +171,47 @@ export function Modal({ title, onClose, children, footer, wide = false, closeLab
|
|
|
144
171
|
const requestClose = () => {
|
|
145
172
|
if (!dismissible)
|
|
146
173
|
return;
|
|
174
|
+
pendingAction.current = null;
|
|
147
175
|
const unsaved = dirty ?? editedForm() !== null;
|
|
148
176
|
if (unsaved)
|
|
149
177
|
setConfirming(true);
|
|
150
178
|
else
|
|
151
179
|
onClose();
|
|
152
180
|
};
|
|
181
|
+
/** The same question, for leaving a form without closing — see {@link useModalGuard}. */
|
|
182
|
+
const guard = (action) => {
|
|
183
|
+
// A locked dialog (a save under way) stays where it is, as its close does.
|
|
184
|
+
if (!dismissible)
|
|
185
|
+
return;
|
|
186
|
+
const unsaved = dirty ?? editedForm() !== null;
|
|
187
|
+
if (!unsaved) {
|
|
188
|
+
action();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
pendingAction.current = action;
|
|
192
|
+
setConfirming(true);
|
|
193
|
+
};
|
|
153
194
|
const discard = () => {
|
|
154
195
|
setConfirming(false);
|
|
155
|
-
|
|
196
|
+
// An earlier Save that was refused is over: its form leaving now is the discard, not that save.
|
|
197
|
+
savedForm.current = null;
|
|
198
|
+
finish();
|
|
156
199
|
};
|
|
157
200
|
const save = () => {
|
|
158
201
|
setConfirming(false);
|
|
159
202
|
if (onSave !== undefined) {
|
|
203
|
+
// The caller's save decides what happens next; a guarded action does not
|
|
204
|
+
// outlive it.
|
|
205
|
+
pendingAction.current = null;
|
|
160
206
|
onSave();
|
|
161
207
|
return;
|
|
162
208
|
}
|
|
163
209
|
const form = editedForm();
|
|
164
210
|
const submitter = form === null ? null : submitterOf(form);
|
|
165
|
-
if (form === null || submitter === null)
|
|
211
|
+
if (form === null || submitter === null) {
|
|
212
|
+
pendingAction.current = null;
|
|
166
213
|
return;
|
|
214
|
+
}
|
|
167
215
|
savedForm.current = form;
|
|
168
216
|
form.requestSubmit(submitter);
|
|
169
217
|
};
|
|
@@ -175,7 +223,7 @@ export function Modal({ title, onClose, children, footer, wide = false, closeLab
|
|
|
175
223
|
useEffect(() => {
|
|
176
224
|
if (savedForm.current !== null && !savedForm.current.isConnected) {
|
|
177
225
|
savedForm.current = null;
|
|
178
|
-
|
|
226
|
+
finish();
|
|
179
227
|
}
|
|
180
228
|
});
|
|
181
229
|
// Into the prompt when it opens, and back to the panel when it is waved away
|
|
@@ -226,8 +274,10 @@ export function Modal({ title, onClose, children, footer, wide = false, closeLab
|
|
|
226
274
|
// the key that this dialog refused.
|
|
227
275
|
event.stopPropagation();
|
|
228
276
|
// Escape on the prompt is "keep editing" — the gentlest way out of it.
|
|
229
|
-
if (confirming)
|
|
277
|
+
if (confirming) {
|
|
278
|
+
pendingAction.current = null;
|
|
230
279
|
setConfirming(false);
|
|
280
|
+
}
|
|
231
281
|
else
|
|
232
282
|
requestClose();
|
|
233
283
|
return;
|
|
@@ -298,13 +348,16 @@ export function Modal({ title, onClose, children, footer, wide = false, closeLab
|
|
|
298
348
|
// this may be about to open, or out of the dialog left standing.
|
|
299
349
|
event.preventDefault();
|
|
300
350
|
requestClose();
|
|
301
|
-
}, children: _jsxs("div", { className: `ctl-modal${wide ? ' ctl-modal-wide' : ''}${className ? ` ${className}` : ''}`, role: "dialog", "aria-modal": "true", "aria-labelledby": labelledBy ?? titleId, tabIndex: -1, ref: panel, onFocusCapture: onReach, onPointerDownCapture: onReach, onMouseDownCapture: onReach, children: [_jsxs("div", { className: "ctl-modal-head", children: [_jsx("h2", { className: "ctl-modal-title", id: titleId, children: title }), _jsx("button", { type: "button", className: "ctl-modal-close", "aria-label": closeLabel,
|
|
351
|
+
}, children: _jsxs("div", { className: `ctl-modal${wide ? ' ctl-modal-wide' : ''}${className ? ` ${className}` : ''}`, role: "dialog", "aria-modal": "true", "aria-labelledby": labelledBy ?? titleId, tabIndex: -1, ref: panel, onFocusCapture: onReach, onPointerDownCapture: onReach, onMouseDownCapture: onReach, children: [_jsxs("div", { className: "ctl-modal-head", children: [_jsx("h2", { className: "ctl-modal-title", id: titleId, children: title }), headerActions !== undefined && (_jsx("div", { className: "ctl-modal-head-actions", children: _jsx(ModalGuardContext.Provider, { value: guard, children: headerActions }) })), _jsx("button", { type: "button", className: "ctl-modal-close", "aria-label": closeLabel,
|
|
302
352
|
// The same string on `title`: on a touch screen there is no hover,
|
|
303
353
|
// and on a desktop the tooltip is the only thing that names an
|
|
304
354
|
// icon-only control to somebody not using a screen reader.
|
|
305
|
-
title: closeLabel, disabled: !dismissible, onClick: requestClose, children: _jsx(CloseIcon, { size: 18, "aria-hidden": "true" }) })] }), _jsx("div", { className: "ctl-modal-body", children: children }), footer !== undefined && _jsx("div", { className: "ctl-modal-foot", children: footer }), confirming && (
|
|
355
|
+
title: closeLabel, disabled: !dismissible, onClick: requestClose, children: _jsx(CloseIcon, { size: 18, "aria-hidden": "true" }) })] }), _jsxs(ModalGuardContext.Provider, { value: guard, children: [_jsx("div", { className: "ctl-modal-body", children: children }), footer !== undefined && _jsx("div", { className: "ctl-modal-foot", children: footer })] }), confirming && (
|
|
306
356
|
// Inside the panel rather than a second modal: it asks about *this*
|
|
307
357
|
// dialog, covers it, and needs none of the stack bookkeeping above.
|
|
308
|
-
_jsx("div", { className: "ctl-modal-confirm-scrim", children: _jsxs("div", { className: "ctl-modal-confirm", role: "alertdialog", "aria-modal": "true", "aria-labelledby": `${confirmId}-title`, "aria-describedby": `${confirmId}-message`, tabIndex: -1, ref: confirmPanel, children: [_jsx("h3", { className: "ctl-modal-confirm-title", id: `${confirmId}-title`, children: words.title }), _jsx("p", { className: "ctl-modal-confirm-message", id: `${confirmId}-message`, children: canSave ? words.message : words.discardMessage }), _jsxs("div", { className: "ctl-modal-confirm-actions", children: [_jsx("button", { type: "button", className: "ctl-btn ctl-btn-ghost", onClick: () =>
|
|
358
|
+
_jsx("div", { className: "ctl-modal-confirm-scrim", children: _jsxs("div", { className: "ctl-modal-confirm", role: "alertdialog", "aria-modal": "true", "aria-labelledby": `${confirmId}-title`, "aria-describedby": `${confirmId}-message`, tabIndex: -1, ref: confirmPanel, children: [_jsx("h3", { className: "ctl-modal-confirm-title", id: `${confirmId}-title`, children: words.title }), _jsx("p", { className: "ctl-modal-confirm-message", id: `${confirmId}-message`, children: canSave ? words.message : words.discardMessage }), _jsxs("div", { className: "ctl-modal-confirm-actions", children: [_jsx("button", { type: "button", className: "ctl-btn ctl-btn-ghost", onClick: () => {
|
|
359
|
+
pendingAction.current = null;
|
|
360
|
+
setConfirming(false);
|
|
361
|
+
}, children: words.keepEditing }), _jsxs("button", { type: "button", className: "ctl-btn ctl-btn-danger", onClick: discard, children: [_jsx(DeleteIcon, { size: 16, "aria-hidden": "true" }), words.discard] }), canSave && (_jsxs("button", { type: "button", className: "ctl-btn ctl-btn-primary", onClick: save, children: [_jsx(CheckIcon, { size: 16, "aria-hidden": "true" }), words.save] }))] })] }) }))] }) }));
|
|
309
362
|
}
|
|
310
363
|
//# sourceMappingURL=Modal.js.map
|
package/dist/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../src/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAmB9D,MAAM,cAAc,GAAiC;IACnD,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,mCAAmC;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OAAO,EAAE,GAAG,EAAE;4CACZ,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;4CAC7B,aAAa,CAAC,KAAK,CAAC,CAAC;wCACvB,CAAC,YAEA,KAAK,CAAC,WAAW,GACX,EACT,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,wBAAwB,EAAC,OAAO,EAAE,OAAO,aACvE,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,EAC1C,KAAK,CAAC,OAAO,IACP,EACR,OAAO,IAAI,CACV,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,IAAI,aACrE,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,EACzC,KAAK,CAAC,IAAI,IACJ,CACV,IACG,IACF,GACF,CACP,IACG,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ModalProps } from './Modal.js';
|
|
3
|
+
/** Whether the record is being read or changed. */
|
|
4
|
+
export type RecordModalMode = 'view' | 'edit';
|
|
5
|
+
/** The words a record dialog adds to a `<Modal>`, for an application that does not read English. */
|
|
6
|
+
export interface RecordModalLabels {
|
|
7
|
+
/** The pencil in the header, read mode. Default `Edit`. */
|
|
8
|
+
edit?: string;
|
|
9
|
+
/** The close button. Default `Close`. */
|
|
10
|
+
close?: string;
|
|
11
|
+
/** The eye in the header, edit mode — back to the read view. Default `Back to details`. */
|
|
12
|
+
view?: string;
|
|
13
|
+
}
|
|
14
|
+
/** What the edit content is handed, for a form that ends by going back to the read view. */
|
|
15
|
+
export interface RecordModalEditControls {
|
|
16
|
+
/** Back to the read view at once — call it after a save, or from the form's Cancel. */
|
|
17
|
+
view(): void;
|
|
18
|
+
}
|
|
19
|
+
export interface RecordModalProps extends Pick<ModalProps, 'dirty' | 'onSave' | 'unsavedLabels' | 'wide' | 'theme' | 'dismissible' | 'className'> {
|
|
20
|
+
title: string;
|
|
21
|
+
onClose(): void;
|
|
22
|
+
/** The record as read — usually a `<DetailList>` and the panels under it. */
|
|
23
|
+
view: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* The record as a form. Absent, the dialog is read-only and offers no Edit.
|
|
26
|
+
* A function is handed {@link RecordModalEditControls}, so a form whose
|
|
27
|
+
* mode is not controlled can still go back to the read view after it saves.
|
|
28
|
+
*/
|
|
29
|
+
edit?: ReactNode | ((controls: RecordModalEditControls) => ReactNode);
|
|
30
|
+
/** The mode, when the caller holds it. Pass with `onModeChange`. */
|
|
31
|
+
mode?: RecordModalMode;
|
|
32
|
+
/** Told of every switch — controlled or not. */
|
|
33
|
+
onModeChange?(mode: RecordModalMode): void;
|
|
34
|
+
/** Where an uncontrolled dialog starts. Default `view`. */
|
|
35
|
+
initialMode?: RecordModalMode;
|
|
36
|
+
/** More header actions, before Edit — a history icon, a print. Shown in both modes. */
|
|
37
|
+
headerActions?: ReactNode;
|
|
38
|
+
/** The read view's footer: the record's verbs (Approve, Delete). Hidden while editing. */
|
|
39
|
+
footer?: ReactNode;
|
|
40
|
+
/** A footer while editing, for a form whose buttons are not inside it. Usually left out. */
|
|
41
|
+
editFooter?: ReactNode;
|
|
42
|
+
labels?: RecordModalLabels;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A record opened read-first in a dialog, with an Edit pencil in the header that
|
|
46
|
+
* turns the same dialog into its form.
|
|
47
|
+
*
|
|
48
|
+
* Reading comes first because most opens are to look, and a form opened to look
|
|
49
|
+
* at is a form one stray keystroke away from a change nobody meant. The record's
|
|
50
|
+
* verbs sit in the footer of the read view; the form brings its own Save and
|
|
51
|
+
* Cancel.
|
|
52
|
+
*
|
|
53
|
+
* Everything a `<Modal>` does it still does — Escape, the focus trap, and the
|
|
54
|
+
* unsaved-changes prompt on every way out — plus one more way out guarded the
|
|
55
|
+
* same way: going back from the form to the read view.
|
|
56
|
+
*/
|
|
57
|
+
export declare function RecordModal({ title, onClose, view, edit, mode: controlledMode, onModeChange, initialMode, headerActions, footer, editFooter, labels, ...modal }: RecordModalProps): import("react").JSX.Element;
|
|
58
|
+
//# sourceMappingURL=RecordModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordModal.d.ts","sourceRoot":"","sources":["../src/RecordModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAEnE,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C,oGAAoG;AACpG,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD,4FAA4F;AAC5F,MAAM,WAAW,uBAAuB;IACtC,uFAAuF;IACvF,IAAI,IAAI,IAAI,CAAC;CACd;AAED,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,CAAC;IAC/G,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;IAChB,6EAA6E;IAC7E,IAAI,EAAE,SAAS,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,uBAAuB,KAAK,SAAS,CAAC,CAAC;IACtE,oEAAoE;IACpE,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,gDAAgD;IAChD,YAAY,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C,2DAA2D;IAC3D,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,uFAAuF;IACvF,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,0FAA0F;IAC1F,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAYD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,WAAoB,EACpB,aAAa,EACb,MAAM,EACN,UAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,gBAAgB,+BA2ClB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { IconButton } from './IconButton.js';
|
|
4
|
+
import { EditIcon, ViewIcon } from './icons.js';
|
|
5
|
+
import { Modal, useModalGuard } from './Modal.js';
|
|
6
|
+
const LABELS = {
|
|
7
|
+
edit: 'Edit',
|
|
8
|
+
close: 'Close',
|
|
9
|
+
view: 'Back to details',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Back to the read view, through the dialog's guard: a form with unsaved edits
|
|
13
|
+
* gets the same *Save / Discard / Keep editing* prompt the close button raises,
|
|
14
|
+
* rather than having its typing thrown away by a header icon.
|
|
15
|
+
*/
|
|
16
|
+
function BackToView({ label, onView, disabled }) {
|
|
17
|
+
const guard = useModalGuard();
|
|
18
|
+
return _jsx(IconButton, { icon: ViewIcon, label: label, onClick: () => guard(onView), disabled: disabled });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A record opened read-first in a dialog, with an Edit pencil in the header that
|
|
22
|
+
* turns the same dialog into its form.
|
|
23
|
+
*
|
|
24
|
+
* Reading comes first because most opens are to look, and a form opened to look
|
|
25
|
+
* at is a form one stray keystroke away from a change nobody meant. The record's
|
|
26
|
+
* verbs sit in the footer of the read view; the form brings its own Save and
|
|
27
|
+
* Cancel.
|
|
28
|
+
*
|
|
29
|
+
* Everything a `<Modal>` does it still does — Escape, the focus trap, and the
|
|
30
|
+
* unsaved-changes prompt on every way out — plus one more way out guarded the
|
|
31
|
+
* same way: going back from the form to the read view.
|
|
32
|
+
*/
|
|
33
|
+
export function RecordModal({ title, onClose, view, edit, mode: controlledMode, onModeChange, initialMode = 'view', headerActions, footer, editFooter, labels, ...modal }) {
|
|
34
|
+
const words = { ...LABELS, ...labels };
|
|
35
|
+
const [ownMode, setOwnMode] = useState(initialMode);
|
|
36
|
+
const requested = controlledMode ?? ownMode;
|
|
37
|
+
// No form, no edit mode — whatever was asked for.
|
|
38
|
+
const mode = edit === undefined ? 'view' : requested;
|
|
39
|
+
const setMode = (next) => {
|
|
40
|
+
if (controlledMode === undefined)
|
|
41
|
+
setOwnMode(next);
|
|
42
|
+
onModeChange?.(next);
|
|
43
|
+
};
|
|
44
|
+
const actions = (_jsxs(_Fragment, { children: [headerActions, edit !== undefined && mode === 'view' && (_jsx(IconButton, { icon: EditIcon, label: words.edit, tone: "accent", onClick: () => setMode('edit') })), mode === 'edit' && _jsx(BackToView, { label: words.view, onView: () => setMode('view'), disabled: modal.dismissible === false })] }));
|
|
45
|
+
const content = mode === 'edit' && edit !== undefined
|
|
46
|
+
? typeof edit === 'function'
|
|
47
|
+
? edit({ view: () => setMode('view') })
|
|
48
|
+
: edit
|
|
49
|
+
: view;
|
|
50
|
+
const foot = mode === 'edit' ? editFooter : footer;
|
|
51
|
+
return (_jsx(Modal, { ...modal, title: title, onClose: onClose, closeLabel: words.close, headerActions: actions, ...(foot === undefined ? {} : { footer: foot }), children: _jsx("div", { className: `ctl-record ctl-record-${mode}`, children: content }) }));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=RecordModal.js.map
|
|
@@ -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AAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,YAEhD,cAAK,SAAS,EAAE,yBAAyB,IAAI,EAAE,YAAG,OAAO,GAAO,GAC1D,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
import type { ControlTheme } from './types.js';
|
|
3
|
+
/** One destination in the menu. */
|
|
4
|
+
export interface SideNavItem {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon: ComponentType<{
|
|
8
|
+
size?: number | string;
|
|
9
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
10
|
+
}>;
|
|
11
|
+
/** The page on screen. Drawn in the accent and announced with `aria-current="page"`. */
|
|
12
|
+
current?: boolean;
|
|
13
|
+
/** Go there. Called on a plain click; with `href`, a ctrl/⌘/middle click is left to the browser. */
|
|
14
|
+
onSelect(): void;
|
|
15
|
+
/**
|
|
16
|
+
* The address, when there is one: the item becomes a link, so it can be
|
|
17
|
+
* opened in a new tab and copied — which a button never can.
|
|
18
|
+
*/
|
|
19
|
+
href?: string;
|
|
20
|
+
/** A count or a dot after the label — unread messages, tasks overdue. */
|
|
21
|
+
badge?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** A group of destinations. Without a `label`, it is the top block and cannot fold. */
|
|
24
|
+
export interface SideNavSection {
|
|
25
|
+
key: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
items: readonly SideNavItem[];
|
|
28
|
+
}
|
|
29
|
+
export interface SideNavProps {
|
|
30
|
+
sections: readonly SideNavSection[];
|
|
31
|
+
/** An icon-only rail: section headings go, and each item's label becomes its tooltip. */
|
|
32
|
+
collapsed?: boolean;
|
|
33
|
+
/** The sections open, when the caller holds them. Pass with `onToggleSection`. */
|
|
34
|
+
openSections?: readonly string[];
|
|
35
|
+
/** Told when a section heading is pressed, controlled or not. */
|
|
36
|
+
onToggleSection?(key: string, open: boolean): void;
|
|
37
|
+
/** Where an uncontrolled menu starts. Default: every section open. */
|
|
38
|
+
defaultOpenSections?: readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* A `localStorage` key under which an uncontrolled menu remembers which
|
|
41
|
+
* sections were folded. Left out, nothing is remembered.
|
|
42
|
+
*/
|
|
43
|
+
storageKey?: string;
|
|
44
|
+
/** Above the items — a logo, the application's name, a collapse button. */
|
|
45
|
+
header?: ReactNode;
|
|
46
|
+
/** Pinned below them — who is signed in, sign out. */
|
|
47
|
+
footer?: ReactNode;
|
|
48
|
+
'aria-label'?: string;
|
|
49
|
+
className?: string;
|
|
50
|
+
theme?: ControlTheme;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* An application's vertical menu.
|
|
54
|
+
*
|
|
55
|
+
* Calm by design: one accent, on the page you are on; a section heading small
|
|
56
|
+
* and muted, folding its items behind a chevron; nothing else coloured. Items
|
|
57
|
+
* a person may not reach are not passed — the menu has no idea of permissions,
|
|
58
|
+
* and deciding them is the server's anyway.
|
|
59
|
+
*
|
|
60
|
+
* Every direction is logical, so the same markup sits on the right with its
|
|
61
|
+
* chevrons mirrored in a right-to-left page — which is where it is mostly used.
|
|
62
|
+
*
|
|
63
|
+
* Folded sections are either the caller's (`openSections` +
|
|
64
|
+
* `onToggleSection`) or the menu's own, remembered under `storageKey` when one
|
|
65
|
+
* is given. On the collapsed rail every item is shown, folded or not, since
|
|
66
|
+
* there is no heading left to unfold them with.
|
|
67
|
+
*/
|
|
68
|
+
export declare function SideNav({ sections, collapsed, openSections, onToggleSection, defaultOpenSections, storageKey, header, footer, 'aria-label': ariaLabel, className, theme, }: SideNavProps): import("react").JSX.Element;
|
|
69
|
+
//# sourceMappingURL=SideNav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../src/SideNav.tsx"],"names":[],"mappings":"AAA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IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AA4ED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,MAAM,EACN,MAAM,EACN,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,KAAe,GAChB,EAAE,YAAY,+BAuFd"}
|
package/dist/SideNav.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useState } from 'react';
|
|
3
|
+
import { ChevronDownIcon } from './icons.js';
|
|
4
|
+
/**
|
|
5
|
+
* The folded sections a menu remembered. Every read and write is wrapped: the
|
|
6
|
+
* accessor itself throws in a private window or with site data blocked, and a
|
|
7
|
+
* menu that would not render because it could not remember a chevron is the
|
|
8
|
+
* worst possible trade.
|
|
9
|
+
*/
|
|
10
|
+
function readFolded(storageKey) {
|
|
11
|
+
if (storageKey === undefined)
|
|
12
|
+
return null;
|
|
13
|
+
try {
|
|
14
|
+
const raw = window.localStorage.getItem(storageKey);
|
|
15
|
+
if (raw === null)
|
|
16
|
+
return null;
|
|
17
|
+
const parsed = JSON.parse(raw);
|
|
18
|
+
return Array.isArray(parsed) ? parsed.filter((entry) => typeof entry === 'string') : null;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function writeFolded(storageKey, folded) {
|
|
25
|
+
if (storageKey === undefined)
|
|
26
|
+
return;
|
|
27
|
+
try {
|
|
28
|
+
window.localStorage.setItem(storageKey, JSON.stringify(folded));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// Nothing to do: the menu still works, it just will not remember.
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** A plain primary click: what a link should hand to the application rather than the browser. */
|
|
35
|
+
function isPlainClick(event) {
|
|
36
|
+
return event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
37
|
+
}
|
|
38
|
+
function Entry({ item, collapsed }) {
|
|
39
|
+
const Icon = item.icon;
|
|
40
|
+
const className = `ctl-sidenav-item${item.current === true ? ' ctl-sidenav-item-current' : ''}`;
|
|
41
|
+
const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "ctl-sidenav-icon", children: _jsx(Icon, { size: 18, "aria-hidden": "true" }) }), _jsx("span", { className: "ctl-sidenav-label", children: item.label }), item.badge !== undefined && item.badge !== null && _jsx("span", { className: "ctl-sidenav-badge", children: item.badge })] }));
|
|
42
|
+
// The label is visible text when expanded, so it names the item already; on
|
|
43
|
+
// the rail it is hidden, and the tooltip and `aria-label` carry it instead.
|
|
44
|
+
const naming = collapsed ? { title: item.label, 'aria-label': item.label } : {};
|
|
45
|
+
const current = item.current === true ? { 'aria-current': 'page' } : {};
|
|
46
|
+
return (_jsx("li", { className: "ctl-sidenav-entry", children: item.href !== undefined ? (_jsx("a", { className: className, href: item.href, ...naming, ...current, onClick: (event) => {
|
|
47
|
+
if (!isPlainClick(event))
|
|
48
|
+
return;
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
item.onSelect();
|
|
51
|
+
}, children: body })) : (_jsx("button", { type: "button", className: className, ...naming, ...current, onClick: () => item.onSelect(), children: body })) }));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* An application's vertical menu.
|
|
55
|
+
*
|
|
56
|
+
* Calm by design: one accent, on the page you are on; a section heading small
|
|
57
|
+
* and muted, folding its items behind a chevron; nothing else coloured. Items
|
|
58
|
+
* a person may not reach are not passed — the menu has no idea of permissions,
|
|
59
|
+
* and deciding them is the server's anyway.
|
|
60
|
+
*
|
|
61
|
+
* Every direction is logical, so the same markup sits on the right with its
|
|
62
|
+
* chevrons mirrored in a right-to-left page — which is where it is mostly used.
|
|
63
|
+
*
|
|
64
|
+
* Folded sections are either the caller's (`openSections` +
|
|
65
|
+
* `onToggleSection`) or the menu's own, remembered under `storageKey` when one
|
|
66
|
+
* is given. On the collapsed rail every item is shown, folded or not, since
|
|
67
|
+
* there is no heading left to unfold them with.
|
|
68
|
+
*/
|
|
69
|
+
export function SideNav({ sections, collapsed = false, openSections, onToggleSection, defaultOpenSections, storageKey, header, footer, 'aria-label': ariaLabel, className, theme = 'light', }) {
|
|
70
|
+
const baseId = useId();
|
|
71
|
+
// Uncontrolled, the menu remembers what is *folded*, so a section added later
|
|
72
|
+
// arrives open rather than hidden behind a heading nobody has pressed.
|
|
73
|
+
const initialFolded = (key) => {
|
|
74
|
+
const remembered = readFolded(key);
|
|
75
|
+
if (remembered !== null)
|
|
76
|
+
return remembered;
|
|
77
|
+
if (defaultOpenSections === undefined)
|
|
78
|
+
return [];
|
|
79
|
+
return sections
|
|
80
|
+
.filter((section) => section.label !== undefined && !defaultOpenSections.includes(section.key))
|
|
81
|
+
.map((section) => section.key);
|
|
82
|
+
};
|
|
83
|
+
// What is folded belongs to the key it was read under: a new key (another
|
|
84
|
+
// person, another workspace) reads its own before anything is written to it,
|
|
85
|
+
// during the render that changes it rather than after a paint.
|
|
86
|
+
const [own, setOwn] = useState(() => ({ key: storageKey, folded: initialFolded(storageKey) }));
|
|
87
|
+
let current = own;
|
|
88
|
+
if (own.key !== storageKey) {
|
|
89
|
+
current = { key: storageKey, folded: initialFolded(storageKey) };
|
|
90
|
+
setOwn(current);
|
|
91
|
+
}
|
|
92
|
+
const folded = current.folded;
|
|
93
|
+
const setFolded = (update) => setOwn((previous) => ({ key: previous.key, folded: update(previous.folded) }));
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (openSections === undefined && own.key === storageKey)
|
|
96
|
+
writeFolded(storageKey, own.folded);
|
|
97
|
+
}, [own, openSections, storageKey]);
|
|
98
|
+
const isOpen = (key) => (openSections !== undefined ? openSections.includes(key) : !folded.includes(key));
|
|
99
|
+
const toggle = (key) => {
|
|
100
|
+
const open = !isOpen(key);
|
|
101
|
+
if (openSections === undefined) {
|
|
102
|
+
setFolded((current) => (open ? current.filter((entry) => entry !== key) : [...current, key]));
|
|
103
|
+
}
|
|
104
|
+
onToggleSection?.(key, open);
|
|
105
|
+
};
|
|
106
|
+
return (_jsxs("nav", { className: `ctl ctl-sidenav${collapsed ? ' ctl-sidenav-collapsed' : ''}${className === undefined ? '' : ` ${className}`}`, "data-ctl-theme": theme, "aria-label": ariaLabel, children: [header !== undefined && _jsx("div", { className: "ctl-sidenav-header", children: header }), _jsx("div", { className: "ctl-sidenav-body", children: sections.map((section) => {
|
|
107
|
+
if (section.items.length === 0)
|
|
108
|
+
return null;
|
|
109
|
+
const list = (id) => (_jsx("ul", { className: "ctl-sidenav-list", id: id, "aria-label": collapsed ? section.label : undefined, children: section.items.map((item) => (_jsx(Entry, { item: item, collapsed: collapsed }, item.key))) }));
|
|
110
|
+
if (section.label === undefined || collapsed) {
|
|
111
|
+
return (_jsx("div", { className: "ctl-sidenav-section", children: list() }, section.key));
|
|
112
|
+
}
|
|
113
|
+
const open = isOpen(section.key);
|
|
114
|
+
const listId = `${baseId}-${section.key}`;
|
|
115
|
+
return (_jsxs("div", { className: "ctl-sidenav-section", children: [_jsxs("button", { type: "button", className: "ctl-sidenav-heading", "aria-expanded": open, "aria-controls": listId, onClick: () => toggle(section.key), children: [_jsx("span", { className: "ctl-sidenav-heading-label", children: section.label }), _jsx(ChevronDownIcon, { className: "ctl-sidenav-chevron", size: 14, "aria-hidden": "true" })] }), open && list(listId)] }, section.key));
|
|
116
|
+
}) }), footer !== undefined && _jsx("div", { className: "ctl-sidenav-footer", children: footer })] }));
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=SideNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideNav.js","sourceRoot":"","sources":["../src/SideNav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AAC;oBAED,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBACjC,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;oBAC1C,OAAO,CACL,eAAuB,SAAS,EAAC,qBAAqB,aACpD,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,qBAAqB,mBAChB,IAAI,mBACJ,MAAM,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAElC,eAAM,SAAS,EAAC,2BAA2B,YAAE,OAAO,CAAC,KAAK,GAAQ,EAClE,KAAC,eAAe,IAAC,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,IACzE,EACR,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,KAXb,OAAO,CAAC,GAAG,CAYf,CACP,CAAC;gBACJ,CAAC,CAAC,GACE,EACL,MAAM,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,oBAAoB,YAAE,MAAM,GAAO,IACvE,CACP,CAAC;AACJ,CAAC"}
|
package/dist/icons.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* meaning is what a caller is choosing between — and because two meanings
|
|
27
27
|
* sometimes want the same drawing.
|
|
28
28
|
*/
|
|
29
|
-
export { ArrowDown as MoveDownIcon, ArrowDown as SortDescendingIcon, ArrowUp as MoveUpIcon, ArrowUp as SortAscendingIcon, ArrowUpDown as SortableIcon, Calendar as CalendarIcon, Check as CheckIcon, ChevronDown as ChevronDownIcon, ChevronLeft as PreviousIcon, ChevronRight as ChevronRightIcon, ChevronRight as NextIcon, Inbox as EmptyIcon, Loader2 as SpinnerIcon, Search as SearchIcon, Square as UncheckedIcon, SquareCheck as CheckedIcon, X as CloseIcon, CircleAlert as ErrorIcon, CircleCheck as SuccessIcon, Info as InfoIcon, TriangleAlert as AlertIcon, Copy as CopyIcon, Download as DownloadIcon, ExternalLink as OpenIcon, Eye as ViewIcon, ListFilter as FilterIcon, Paperclip as AttachIcon, Pencil as EditIcon, Play as RunIcon, Plus as AddIcon, Printer as PrintIcon, RefreshCw as RefreshIcon, RotateCcw as RestoreIcon, Save as SaveIcon, Send as SendIcon, Trash2 as DeleteIcon, Upload as UploadIcon, Mic as RecordIcon, Square as StopIcon, AtSign as MentionIcon, Bot as AssistantIcon, FileText as FileIcon, Image as ImageIcon, ListTodo as TaskIcon, NotebookPen as NoteIcon, Bell as NotificationIcon, CalendarClock as ScheduleIcon, ChartColumn as StatisticsIcon, Clock as TimeIcon, Database as DatabaseIcon, HardDriveDownload as BackupIcon, History as HistoryIcon, KeyRound as KeyIcon, Languages as TranslateIcon, Mail as MailIcon, MapPin as LocationIcon, MessageSquare as ThreadIcon, Monitor as DeviceIcon, Route as RoutingIcon, ScrollText as LogIcon, SlidersHorizontal as SettingsIcon, Sparkles as SparklesIcon, SpellCheck as GrammarIcon, Table as TableIcon, User as UserIcon, WandSparkles as AssistIcon, } from 'lucide-react';
|
|
29
|
+
export { ArrowDown as MoveDownIcon, ArrowDown as SortDescendingIcon, ArrowUp as MoveUpIcon, ArrowUp as SortAscendingIcon, ArrowUpDown as SortableIcon, Calendar as CalendarIcon, Check as CheckIcon, ChevronDown as ChevronDownIcon, ChevronLeft as PreviousIcon, ChevronRight as ChevronRightIcon, ChevronRight as NextIcon, Inbox as EmptyIcon, Loader2 as SpinnerIcon, Search as SearchIcon, Square as UncheckedIcon, SquareCheck as CheckedIcon, X as CloseIcon, CircleAlert as ErrorIcon, CircleCheck as SuccessIcon, Info as InfoIcon, TriangleAlert as AlertIcon, Copy as CopyIcon, Download as DownloadIcon, ExternalLink as OpenIcon, Eye as ViewIcon, ListFilter as FilterIcon, Paperclip as AttachIcon, Pencil as EditIcon, Play as RunIcon, Plus as AddIcon, Printer as PrintIcon, RefreshCw as RefreshIcon, RotateCcw as RestoreIcon, Save as SaveIcon, Send as SendIcon, Trash2 as DeleteIcon, Upload as UploadIcon, Mic as RecordIcon, Square as StopIcon, AtSign as MentionIcon, Bot as AssistantIcon, FileText as FileIcon, Image as ImageIcon, ListTodo as TaskIcon, NotebookPen as NoteIcon, Bell as NotificationIcon, CalendarClock as ScheduleIcon, ChartColumn as StatisticsIcon, Clock as TimeIcon, Database as DatabaseIcon, HardDriveDownload as BackupIcon, History as HistoryIcon, KeyRound as KeyIcon, Languages as TranslateIcon, Mail as MailIcon, MapPin as LocationIcon, MessageSquare as ThreadIcon, Monitor as DeviceIcon, Route as RoutingIcon, ScrollText as LogIcon, SlidersHorizontal as SettingsIcon, Sparkles as SparklesIcon, SpellCheck as GrammarIcon, Table as TableIcon, User as UserIcon, WandSparkles as AssistIcon, ArrowLeftRight as TransferIcon, BadgeDollarSign as SalaryIcon, Building as CompanyIcon, Building2 as BuildingIcon, CloudDownload as SyncIcon, Folder as FolderIcon, Globe as LanguageIcon, HandCoins as IncomeIcon, House as HomeIcon, Landmark as OrganizationIcon, ListChecks as ListIcon, LogOut as SignOutIcon, Menu as MenuIcon, PanelLeftClose as CollapseSidebarIcon, PanelLeftOpen as ExpandSidebarIcon, Phone as PhoneIcon, Receipt as ExpenseIcon, ShieldCheck as RoleIcon, Store as VendorIcon, UserCheck as ImpersonateIcon, UserCog as MembersIcon, Users as ContactsIcon, UsersRound as GroupIcon, UserX as StopImpersonatingIcon, } from 'lucide-react';
|
|
30
30
|
/**
|
|
31
31
|
* The default icon size, in pixels.
|
|
32
32
|
*
|
package/dist/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAEL,SAAS,IAAI,YAAY,EACzB,SAAS,IAAI,kBAAkB,EAC/B,OAAO,IAAI,UAAU,EACrB,OAAO,IAAI,iBAAiB,EAC5B,WAAW,IAAI,YAAY,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ClB,OAAO,IAAI,WAAW,EACtB,WAAW,IAAI,QAAQ,EACvB,KAAK,IAAI,UAAU,EACnB,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,YAAY,EACrB,UAAU,IAAI,SAAS,EACvB,KAAK,IAAI,qBAAqB,GAC/B,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,eAAO,MAAM,SAAS,KAAK,CAAC"}
|
package/dist/icons.js
CHANGED
|
@@ -34,7 +34,9 @@ CircleAlert as ErrorIcon, CircleCheck as SuccessIcon, Info as InfoIcon, Triangle
|
|
|
34
34
|
/* The verbs. */
|
|
35
35
|
Copy as CopyIcon, Download as DownloadIcon, ExternalLink as OpenIcon, Eye as ViewIcon, ListFilter as FilterIcon, Paperclip as AttachIcon, Pencil as EditIcon, Play as RunIcon, Plus as AddIcon, Printer as PrintIcon, RefreshCw as RefreshIcon, RotateCcw as RestoreIcon, Save as SaveIcon, Send as SendIcon, Trash2 as DeleteIcon, Upload as UploadIcon, Mic as RecordIcon, Square as StopIcon,
|
|
36
36
|
/* The nouns each console is about. */
|
|
37
|
-
AtSign as MentionIcon, Bot as AssistantIcon, FileText as FileIcon, Image as ImageIcon, ListTodo as TaskIcon, NotebookPen as NoteIcon, Bell as NotificationIcon, CalendarClock as ScheduleIcon, ChartColumn as StatisticsIcon, Clock as TimeIcon, Database as DatabaseIcon, HardDriveDownload as BackupIcon, History as HistoryIcon, KeyRound as KeyIcon, Languages as TranslateIcon, Mail as MailIcon, MapPin as LocationIcon, MessageSquare as ThreadIcon, Monitor as DeviceIcon, Route as RoutingIcon, ScrollText as LogIcon, SlidersHorizontal as SettingsIcon, Sparkles as SparklesIcon, SpellCheck as GrammarIcon, Table as TableIcon, User as UserIcon, WandSparkles as AssistIcon,
|
|
37
|
+
AtSign as MentionIcon, Bot as AssistantIcon, FileText as FileIcon, Image as ImageIcon, ListTodo as TaskIcon, NotebookPen as NoteIcon, Bell as NotificationIcon, CalendarClock as ScheduleIcon, ChartColumn as StatisticsIcon, Clock as TimeIcon, Database as DatabaseIcon, HardDriveDownload as BackupIcon, History as HistoryIcon, KeyRound as KeyIcon, Languages as TranslateIcon, Mail as MailIcon, MapPin as LocationIcon, MessageSquare as ThreadIcon, Monitor as DeviceIcon, Route as RoutingIcon, ScrollText as LogIcon, SlidersHorizontal as SettingsIcon, Sparkles as SparklesIcon, SpellCheck as GrammarIcon, Table as TableIcon, User as UserIcon, WandSparkles as AssistIcon,
|
|
38
|
+
/* An application's menu and the records it opens. */
|
|
39
|
+
ArrowLeftRight as TransferIcon, BadgeDollarSign as SalaryIcon, Building as CompanyIcon, Building2 as BuildingIcon, CloudDownload as SyncIcon, Folder as FolderIcon, Globe as LanguageIcon, HandCoins as IncomeIcon, House as HomeIcon, Landmark as OrganizationIcon, ListChecks as ListIcon, LogOut as SignOutIcon, Menu as MenuIcon, PanelLeftClose as CollapseSidebarIcon, PanelLeftOpen as ExpandSidebarIcon, Phone as PhoneIcon, Receipt as ExpenseIcon, ShieldCheck as RoleIcon, Store as VendorIcon, UserCheck as ImpersonateIcon, UserCog as MembersIcon, Users as ContactsIcon, UsersRound as GroupIcon, UserX as StopImpersonatingIcon, } from 'lucide-react';
|
|
38
40
|
/**
|
|
39
41
|
* The default icon size, in pixels.
|
|
40
42
|
*
|
package/dist/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO;AACL,oCAAoC;AACpC,SAAS,IAAI,YAAY,EACzB,SAAS,IAAI,kBAAkB,EAC/B,OAAO,IAAI,UAAU,EACrB,OAAO,IAAI,iBAAiB,EAC5B,WAAW,IAAI,YAAY,EAC3B,QAAQ,IAAI,YAAY,EACxB,KAAK,IAAI,SAAS,EAClB,WAAW,IAAI,eAAe,EAC9B,WAAW,IAAI,YAAY,EAC3B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EAClB,OAAO,IAAI,WAAW,EACtB,WAAW,IAAI,QAAQ,EACvB,KAAK,IAAI,UAAU,EACnB,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,YAAY,EACrB,UAAU,IAAI,SAAS,EACvB,KAAK,IAAI,qBAAqB,GAC/B,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,11 @@
|
|
|
46
46
|
*/
|
|
47
47
|
export { SearchableMultiSelect, type SearchableMultiSelectProps, } from './SearchableMultiSelect.js';
|
|
48
48
|
export { SearchableSelect, type SearchableSelectProps } from './SearchableSelect.js';
|
|
49
|
-
export { Modal, type ModalProps } from './Modal.js';
|
|
49
|
+
export { Modal, useModalGuard, type ModalGuard, type ModalProps, type ModalUnsavedLabels } from './Modal.js';
|
|
50
|
+
export { RecordModal, type RecordModalEditControls, type RecordModalLabels, type RecordModalMode, type RecordModalProps, } from './RecordModal.js';
|
|
51
|
+
export { IconButton, type IconButtonProps, type IconButtonSize, type IconButtonTone, type IconComponent, } from './IconButton.js';
|
|
52
|
+
export { DetailList, type DetailItem, type DetailListProps } from './DetailList.js';
|
|
53
|
+
export { SideNav, type SideNavItem, type SideNavProps, type SideNavSection } from './SideNav.js';
|
|
50
54
|
export { DataTable, tableToCsv, SortableColumn, type ColumnDef, type DataTableProps, type DataTablePagination, type DataTablePaginationAuto, type DataTablePaginationControlled, type SortDirection, } from './DataTable.js';
|
|
51
55
|
export { csvCell, csvFileName, downloadCsv, toCsv, type CsvValue } from './csv.js';
|
|
52
56
|
export { downloadBlob, downloadFileName, downloadUrl, svgImage, svgToPng } from './download.js';
|