@path58/ui 2.0.0 → 2.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/dist/atoms/Alert/Alert.d.ts +39 -0
- package/dist/atoms/Alert/Alert.d.ts.map +1 -0
- package/dist/atoms/Alert/index.d.ts +3 -0
- package/dist/atoms/Alert/index.d.ts.map +1 -0
- package/dist/atoms/Banner/Banner.d.ts +48 -0
- package/dist/atoms/Banner/Banner.d.ts.map +1 -0
- package/dist/atoms/Banner/index.d.ts +3 -0
- package/dist/atoms/Banner/index.d.ts.map +1 -0
- package/dist/atoms/Layout/Layout.d.ts +47 -0
- package/dist/atoms/Layout/Layout.d.ts.map +1 -0
- package/dist/atoms/Layout/index.d.ts +3 -0
- package/dist/atoms/Layout/index.d.ts.map +1 -0
- package/dist/atoms/StatusPill/StatusPill.d.ts +47 -0
- package/dist/atoms/StatusPill/StatusPill.d.ts.map +1 -0
- package/dist/atoms/StatusPill/index.d.ts +3 -0
- package/dist/atoms/StatusPill/index.d.ts.map +1 -0
- package/dist/atoms/Toast/Toast.d.ts +49 -0
- package/dist/atoms/Toast/Toast.d.ts.map +1 -0
- package/dist/atoms/Toast/index.d.ts +3 -0
- package/dist/atoms/Toast/index.d.ts.map +1 -0
- package/dist/atoms/index.d.ts +5 -0
- package/dist/atoms/index.d.ts.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2561 -294
- package/dist/molecules/ConfirmDialog/ConfirmDialog.d.ts +43 -0
- package/dist/molecules/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/molecules/ConfirmDialog/index.d.ts +3 -0
- package/dist/molecules/ConfirmDialog/index.d.ts.map +1 -0
- package/dist/molecules/Modal/Modal.d.ts +39 -0
- package/dist/molecules/Modal/Modal.d.ts.map +1 -0
- package/dist/molecules/Modal/index.d.ts +3 -0
- package/dist/molecules/Modal/index.d.ts.map +1 -0
- package/dist/molecules/PromptDialog/PromptDialog.d.ts +46 -0
- package/dist/molecules/PromptDialog/PromptDialog.d.ts.map +1 -0
- package/dist/molecules/PromptDialog/index.d.ts +3 -0
- package/dist/molecules/PromptDialog/index.d.ts.map +1 -0
- package/dist/molecules/index.d.ts +3 -0
- package/dist/molecules/index.d.ts.map +1 -1
- package/dist/organisms/ToastProvider/ToastProvider.d.ts +53 -0
- package/dist/organisms/ToastProvider/ToastProvider.d.ts.map +1 -0
- package/dist/organisms/ToastProvider/index.d.ts +4 -0
- package/dist/organisms/ToastProvider/index.d.ts.map +1 -0
- package/dist/organisms/ToastProvider/useToast.d.ts +28 -0
- package/dist/organisms/ToastProvider/useToast.d.ts.map +1 -0
- package/dist/organisms/ToolAuthGate/ToolAuthGate.d.ts +47 -0
- package/dist/organisms/ToolAuthGate/ToolAuthGate.d.ts.map +1 -0
- package/dist/organisms/ToolAuthGate/index.d.ts +3 -0
- package/dist/organisms/ToolAuthGate/index.d.ts.map +1 -0
- package/dist/organisms/ToolFooter/ToolFooter.d.ts +21 -0
- package/dist/organisms/ToolFooter/ToolFooter.d.ts.map +1 -0
- package/dist/organisms/ToolFooter/index.d.ts +3 -0
- package/dist/organisms/ToolFooter/index.d.ts.map +1 -0
- package/dist/organisms/ToolTopbar/ToolTopbar.d.ts +27 -0
- package/dist/organisms/ToolTopbar/ToolTopbar.d.ts.map +1 -0
- package/dist/organisms/ToolTopbar/index.d.ts +3 -0
- package/dist/organisms/ToolTopbar/index.d.ts.map +1 -0
- package/dist/organisms/index.d.ts +5 -0
- package/dist/organisms/index.d.ts.map +1 -1
- package/dist/organisms/inputs/MoneyInput.d.ts +34 -0
- package/dist/organisms/inputs/MoneyInput.d.ts.map +1 -0
- package/dist/organisms/inputs/NumberInput.d.ts +36 -0
- package/dist/organisms/inputs/NumberInput.d.ts.map +1 -0
- package/dist/organisms/inputs/PercentInput.d.ts +36 -0
- package/dist/organisms/inputs/PercentInput.d.ts.map +1 -0
- package/dist/organisms/inputs/TextInput.d.ts +31 -0
- package/dist/organisms/inputs/TextInput.d.ts.map +1 -0
- package/dist/organisms/inputs/index.d.ts +18 -0
- package/dist/organisms/inputs/index.d.ts.map +1 -0
- package/dist/organisms/inputs/useBlurOnEnterEscapeClickOut.d.ts +29 -0
- package/dist/organisms/inputs/useBlurOnEnterEscapeClickOut.d.ts.map +1 -0
- package/dist/organisms/inputs/useNumericInputState.d.ts +23 -0
- package/dist/organisms/inputs/useNumericInputState.d.ts.map +1 -0
- package/dist/primitives/Dialog/Dialog.d.ts +63 -0
- package/dist/primitives/Dialog/Dialog.d.ts.map +1 -0
- package/dist/primitives/Dialog/index.d.ts +3 -0
- package/dist/primitives/Dialog/index.d.ts.map +1 -0
- package/dist/primitives/P58Button.d.ts.map +1 -1
- package/dist/primitives/P58Card.d.ts.map +1 -1
- package/dist/primitives/P58Eyebrow.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +14 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ConfirmDialog.css';
|
|
3
|
+
export type ConfirmDialogVariant = 'default' | 'danger';
|
|
4
|
+
export interface ConfirmDialogProps {
|
|
5
|
+
/** Whether the dialog is open. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** Fires when the user clicks Confirm (or presses Enter on focused confirm). */
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
/** Fires when the user clicks Cancel, presses ESC, or clicks the backdrop. */
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
/** Title rendered in the modal header (used as `aria-labelledby` source). */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Body message — string or rich ReactNode. */
|
|
14
|
+
message: string | React.ReactNode;
|
|
15
|
+
/** Confirm button label. Default "Confirm". */
|
|
16
|
+
confirmLabel?: string;
|
|
17
|
+
/** Cancel button label. Default "Cancel". */
|
|
18
|
+
cancelLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Variant — `default` uses the brand accent for confirm; `danger` routes the
|
|
21
|
+
* confirm CTA to the sacred `--p58-danger` palette (BRAND_ARCH § 5 status
|
|
22
|
+
* semantics; NEVER `--p58-accent`).
|
|
23
|
+
*/
|
|
24
|
+
variant?: ConfirmDialogVariant;
|
|
25
|
+
/**
|
|
26
|
+
* When true, both buttons disable and the confirm button shows a spinner.
|
|
27
|
+
* Use during async confirm flow (e.g. delete-in-progress).
|
|
28
|
+
*/
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* ConfirmDialog — DSGN-3.6.3
|
|
33
|
+
*
|
|
34
|
+
* Modal preset for yes/no flows. Renders a Modal with title + message + a
|
|
35
|
+
* cancel/confirm button group in the footer. The `danger` variant is for
|
|
36
|
+
* destructive actions (delete, discard) and routes the confirm CTA through
|
|
37
|
+
* the sacred status palette (`--p58-danger`).
|
|
38
|
+
*
|
|
39
|
+
* Composition stack: ConfirmDialog → Modal → Dialog (focus-trap + ARIA).
|
|
40
|
+
*/
|
|
41
|
+
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
42
|
+
export default ConfirmDialog;
|
|
43
|
+
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/molecules/ConfirmDialog/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAGrC,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,gFAAgF;IAChF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsDtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecules/ConfirmDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DialogProps } from '../../primitives/Dialog';
|
|
3
|
+
import './Modal.css';
|
|
4
|
+
export type ModalSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface ModalProps extends Omit<DialogProps, 'children'> {
|
|
6
|
+
/** Header slot (typically `<h2 id="...">Title</h2>` referenced by aria-labelledby). */
|
|
7
|
+
header?: React.ReactNode;
|
|
8
|
+
/** Body slot. */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** Footer slot (typically action buttons). */
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
/** Size variant — sm (360 px) / md (480 px, default) / lg (640 px). */
|
|
13
|
+
size?: ModalSize;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the dismissive close × is rendered in the header. Default true.
|
|
16
|
+
* The × always triggers `onClose`. Useful to set false for forced-decision
|
|
17
|
+
* flows (ConfirmDialog danger variant may opt to set this false).
|
|
18
|
+
*/
|
|
19
|
+
dismissible?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Modal — DSGN-3.6.3
|
|
23
|
+
*
|
|
24
|
+
* Dialog + content slots. Composes the Dialog primitive (DSGN-3.6.2); does
|
|
25
|
+
* NOT re-instantiate FocusTrap — Dialog already owns the trap.
|
|
26
|
+
*
|
|
27
|
+
* Slots:
|
|
28
|
+
* - `header` → top, with optional × dismiss control on the right
|
|
29
|
+
* - children → body (the default slot)
|
|
30
|
+
* - `footer` → bottom (typically action buttons)
|
|
31
|
+
*
|
|
32
|
+
* Sizes: sm 360 px / md 480 px (default) / lg 640 px — driven by CSS classes.
|
|
33
|
+
* No px literals in TSX.
|
|
34
|
+
*
|
|
35
|
+
* Token consumption: per DSGN-3.6.1 D1 Modal row.
|
|
36
|
+
*/
|
|
37
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
38
|
+
export default Modal;
|
|
39
|
+
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/D,uFAAuF;IACvF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,iBAAiB;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,uEAAuE;IACvE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAmCtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecules/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './PromptDialog.css';
|
|
3
|
+
export type PromptDialogInputType = 'text' | 'email' | 'url';
|
|
4
|
+
export interface PromptDialogProps {
|
|
5
|
+
/** Whether the dialog is open. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** Fires with the input value when the user confirms. */
|
|
8
|
+
onConfirm: (value: string) => void;
|
|
9
|
+
/** Fires when the user cancels (Cancel click, ESC, backdrop click). */
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
/** Title rendered in the modal header (used as aria-labelledby source). */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Label rendered above the input. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Placeholder text. */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Initial value when the dialog opens. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Confirm button label. Default "Save". */
|
|
20
|
+
confirmLabel?: string;
|
|
21
|
+
/** Cancel button label. Default "Cancel". */
|
|
22
|
+
cancelLabel?: string;
|
|
23
|
+
/** When true, blocks empty-string submit. Default false. */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** HTML input type. Default 'text'. */
|
|
26
|
+
inputType?: PromptDialogInputType;
|
|
27
|
+
/**
|
|
28
|
+
* Custom validator. Receives the current value; returns an error string to
|
|
29
|
+
* display (and block submit) or `undefined` to accept. Runs on blur + submit.
|
|
30
|
+
*/
|
|
31
|
+
validator?: (value: string) => string | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* PromptDialog — DSGN-3.6.3
|
|
35
|
+
*
|
|
36
|
+
* Modal + single-input preset. Internal state for the input value (controlled
|
|
37
|
+
* internally to keep the consumer API minimal — value emits via onConfirm).
|
|
38
|
+
* Validation runs on blur + submit. Errors render inline with
|
|
39
|
+
* `aria-describedby` so screen-readers announce them when the input regains
|
|
40
|
+
* focus.
|
|
41
|
+
*
|
|
42
|
+
* Composition stack: PromptDialog → Modal → Dialog (focus-trap + ARIA).
|
|
43
|
+
*/
|
|
44
|
+
export declare const PromptDialog: React.FC<PromptDialogProps>;
|
|
45
|
+
export default PromptDialog;
|
|
46
|
+
//# sourceMappingURL=PromptDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptDialog.d.ts","sourceRoot":"","sources":["../../../src/molecules/PromptDialog/PromptDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAI1D,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,yDAAyD;IACzD,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACnD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgGpD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecules/PromptDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/molecules/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/molecules/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ToastAction, type ToastVariant } from '../../atoms/Toast';
|
|
3
|
+
import './ToastProvider.css';
|
|
4
|
+
export { useToast } from './useToast';
|
|
5
|
+
export type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
6
|
+
export interface ToastInit {
|
|
7
|
+
message: string | React.ReactNode;
|
|
8
|
+
variant?: ToastVariant;
|
|
9
|
+
/** Auto-dismiss after this many ms. `-1` = persistent. Default: provider's `defaultDuration`. */
|
|
10
|
+
duration?: number;
|
|
11
|
+
action?: ToastAction;
|
|
12
|
+
}
|
|
13
|
+
export interface ToastApi {
|
|
14
|
+
/** Fire a generic toast; returns the toast id (used to dismiss later). */
|
|
15
|
+
toast: ((opts: ToastInit) => string) & {
|
|
16
|
+
success: (message: ToastInit['message'], opts?: Omit<ToastInit, 'message' | 'variant'>) => string;
|
|
17
|
+
warning: (message: ToastInit['message'], opts?: Omit<ToastInit, 'message' | 'variant'>) => string;
|
|
18
|
+
danger: (message: ToastInit['message'], opts?: Omit<ToastInit, 'message' | 'variant'>) => string;
|
|
19
|
+
info: (message: ToastInit['message'], opts?: Omit<ToastInit, 'message' | 'variant'>) => string;
|
|
20
|
+
};
|
|
21
|
+
/** Dismiss a specific toast by id. */
|
|
22
|
+
dismiss: (id: string) => void;
|
|
23
|
+
/** Dismiss every visible toast. */
|
|
24
|
+
dismissAll: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* React Context published by ToastProvider; consumed by useToast (sibling
|
|
28
|
+
* module). Exported so the hook in useToast.ts can read it.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ToastContext: React.Context<ToastApi | null>;
|
|
31
|
+
export interface ToastProviderProps {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
/** Stack position. Default top-right. */
|
|
34
|
+
position?: ToastPosition;
|
|
35
|
+
/** Max simultaneously visible. Oldest dismisses when queue exceeds. Default 3. */
|
|
36
|
+
maxVisible?: number;
|
|
37
|
+
/** Default auto-dismiss in ms (when a toast doesn't specify its own). Default 5000. */
|
|
38
|
+
defaultDuration?: number;
|
|
39
|
+
/** Portal mount target. Default `document.body`. */
|
|
40
|
+
portalRoot?: HTMLElement;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* ToastProvider — DSGN-3.6.4 (organism)
|
|
44
|
+
*
|
|
45
|
+
* Owns the toast queue + portal mount + position stack. Consumers wrap their
|
|
46
|
+
* app once at the root and use `useToast()` anywhere underneath.
|
|
47
|
+
*
|
|
48
|
+
* SSR note: portal mount is deferred to `useEffect` (client-only) — works under
|
|
49
|
+
* Next.js / Remix without hydration mismatch warnings.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ToastProvider: React.FC<ToastProviderProps>;
|
|
52
|
+
export default ToastProvider;
|
|
53
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToastProvider/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAS,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,qBAAqB,CAAC;AAK7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAMD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AE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+EtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToastProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ToastApi } from './ToastProvider';
|
|
2
|
+
/**
|
|
3
|
+
* useToast — DSGN-3.6.4 (hook)
|
|
4
|
+
*
|
|
5
|
+
* Returns the toast API. Must be called inside a `<ToastProvider>` subtree.
|
|
6
|
+
*
|
|
7
|
+
* Outside a Provider:
|
|
8
|
+
* - Dev mode → console.warn ("[useToast] called outside <ToastProvider>...")
|
|
9
|
+
* - All modes → returns a stable no-op API so calls don't crash partial trees
|
|
10
|
+
*
|
|
11
|
+
* Convenience methods are available on the returned `toast`:
|
|
12
|
+
* - `toast(opts)` — generic; opts: { message, variant?, duration?, action? }
|
|
13
|
+
* - `toast.success(msg, opts?)` — pre-set variant: success
|
|
14
|
+
* - `toast.warning(msg, opts?)` — pre-set variant: warning
|
|
15
|
+
* - `toast.danger(msg, opts?)` — pre-set variant: danger
|
|
16
|
+
* - `toast.info(msg, opts?)` — pre-set variant: info
|
|
17
|
+
*
|
|
18
|
+
* Plus `dismiss(id)` to remove a specific toast and `dismissAll()` to clear.
|
|
19
|
+
*
|
|
20
|
+
* Extracted to a standalone module per DSGN-3.6.4 ASSIGNMENT D3
|
|
21
|
+
* (`production/packages/ui/src/organisms/ToastProvider/useToast.ts`).
|
|
22
|
+
* ToastContext + Provider stay in ToastProvider.tsx; this hook reads the
|
|
23
|
+
* context but ships separately so consumers and tree-shakers see the
|
|
24
|
+
* cleanest dependency cut.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useToast: () => ToastApi;
|
|
27
|
+
export default useToast;
|
|
28
|
+
//# sourceMappingURL=useToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToastProvider/useToast.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,QAAQ,QAAO,QA2B3B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import './ToolAuthGate.css';
|
|
2
|
+
/**
|
|
3
|
+
* ToolAuthGate — third chrome organism for Path58 consultancy tools.
|
|
4
|
+
*
|
|
5
|
+
* Joins ToolTopbar + ToolFooter as the canonical pre-authenticated surface
|
|
6
|
+
* for any Path58 consultancy tool that uses Supabase magic-link auth.
|
|
7
|
+
*
|
|
8
|
+
* Replaces 5 ad-hoc per-tool AuthGate implementations (TOOL-002/003/005/006/007)
|
|
9
|
+
* that drifted to 4 different visual treatments before consolidation here.
|
|
10
|
+
*
|
|
11
|
+
* Brand canon:
|
|
12
|
+
* - path58-tool theme (cream-cool / navy / restrained-lime)
|
|
13
|
+
* - Filled navy CTA (var(--p58-blue-900)) — Path58 brand-canon for primary action
|
|
14
|
+
* - Card surface (var(--p58-surface)) on page bg (var(--p58-bg))
|
|
15
|
+
* - Money-moment-utility-aware (path58-light loaded first per DSGN-1.5.3 Finding #8)
|
|
16
|
+
*
|
|
17
|
+
* Source: DSGN-1.5.3 TOOL-002 reference AuthGate (commit 11c3589) — most polished
|
|
18
|
+
* implementation; this organism canonicalizes its visual treatment.
|
|
19
|
+
*
|
|
20
|
+
* Per CLIENT_TOOL_BRANDING_POLICY v1.1.0:
|
|
21
|
+
* - Engagement-context badge ("For {clientName} engagement · {toolId}")
|
|
22
|
+
* - Tool name as h1
|
|
23
|
+
* - Path58 logo top of card (consumer supplies logoSrc; default fallback gracefully)
|
|
24
|
+
*/
|
|
25
|
+
export interface ToolAuthGateProps {
|
|
26
|
+
/** Tool display name (e.g., "Revenue Factory Canvas") */
|
|
27
|
+
toolName: string;
|
|
28
|
+
/** Tool ID (e.g., "TOOL-002") */
|
|
29
|
+
toolId: string;
|
|
30
|
+
/** Client engagement name — caller passes window.__P58_CONFIG__?.clientName ?? 'Client' */
|
|
31
|
+
clientName: string;
|
|
32
|
+
/**
|
|
33
|
+
* Async magic-link send handler.
|
|
34
|
+
* Returns { ok: true } on success or { ok: false, error?: string } on failure.
|
|
35
|
+
* Caller wires this to their tool-local Supabase client + RUNBOOK auth flow.
|
|
36
|
+
*/
|
|
37
|
+
onSendMagicLink: (email: string) => Promise<{
|
|
38
|
+
ok: boolean;
|
|
39
|
+
error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Optional brand logo override; defaults to deploy-time `_brand/path58/assets/path58-logo-wide-text.svg` */
|
|
42
|
+
logoSrc?: string;
|
|
43
|
+
/** Optional className passthrough on the outer container */
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function ToolAuthGate({ toolName, toolId, clientName, onSendMagicLink, logoSrc, className, }: ToolAuthGateProps): import("react").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=ToolAuthGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolAuthGate.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolAuthGate/ToolAuthGate.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E,6GAA6G;IAC7G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,MAAM,EACN,UAAU,EACV,eAAe,EACf,OAA0B,EAC1B,SAAS,GACV,EAAE,iBAAiB,+BAmFnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolAuthGate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ToolFooter.css';
|
|
3
|
+
export interface ToolFooterProps {
|
|
4
|
+
/** Tool display name (e.g., "Revenue Factory Canvas"). Required. Renders emphasized inline in attribution prose. */
|
|
5
|
+
toolName: string;
|
|
6
|
+
/** Tool version semver string (e.g., "0.3.0"). Required. Renders as "v{toolVersion}" in attribution. */
|
|
7
|
+
toolVersion: string;
|
|
8
|
+
/** Client engagement name (e.g., "Nimble"). Required. Renders as "For {clientName} engagement" in attribution. */
|
|
9
|
+
clientName: string;
|
|
10
|
+
/** Show the path58-mark icon left of attribution. Default: true. */
|
|
11
|
+
showMark?: boolean;
|
|
12
|
+
/** "About this tool" callback. When undefined, the About button does NOT render.
|
|
13
|
+
* When defined: tool's thin Footer.tsx wrapper hosts modal state + renders tool-local <AboutThisTool>
|
|
14
|
+
* per CLIENT_TOOL_BRANDING_POLICY v1.0.0. */
|
|
15
|
+
onAbout?: () => void;
|
|
16
|
+
/** Show the Print button (internally calls `window.print()`). Default: true. */
|
|
17
|
+
showPrint?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const ToolFooter: React.FC<ToolFooterProps>;
|
|
20
|
+
export default ToolFooter;
|
|
21
|
+
//# sourceMappingURL=ToolFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolFooter.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolFooter/ToolFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,eAAe;IAC9B,oHAAoH;IACpH,QAAQ,EAAE,MAAM,CAAC;IAEjB,wGAAwG;IACxG,WAAW,EAAE,MAAM,CAAC;IAEpB,kHAAkH;IAClH,UAAU,EAAE,MAAM,CAAC;IAEnB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;kDAE8C;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,gFAAgF;IAChF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuChD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolFooter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ToolTopbar.css';
|
|
3
|
+
export interface ToolTopbarProps {
|
|
4
|
+
/** Tool display name shown LEFT after the divider. Required. */
|
|
5
|
+
toolName: string;
|
|
6
|
+
/** Canonical tool ID (e.g., "TOOL-002"). Shown in the meta cluster on RIGHT. Required. */
|
|
7
|
+
toolId: string;
|
|
8
|
+
/** Client engagement name (e.g., "Nimble"). Renders inside the engagement chip on RIGHT as "For {clientName} engagement". Required. */
|
|
9
|
+
clientName: string;
|
|
10
|
+
/** Last-saved ISO timestamp. `null` or `undefined` triggers save-state UI:
|
|
11
|
+
* - `undefined` (prop omitted) AND `saving === undefined` → no save UI at all (TOOL-001 static-tool path).
|
|
12
|
+
* - `null` AND `!saving` → "Not saved yet" idle state.
|
|
13
|
+
* - String AND `!saving` → "Auto-saved · HH:MM" saved state.
|
|
14
|
+
*/
|
|
15
|
+
savedAt?: string | null;
|
|
16
|
+
/** Save in flight. Renders "Saving…" state with amber pulsing dot when true. */
|
|
17
|
+
saving?: boolean;
|
|
18
|
+
/** Sign-out handler. When undefined, Sign out button does NOT render (TOOL-001 static-tool path). */
|
|
19
|
+
onSignOut?: () => void;
|
|
20
|
+
/** Tool-specific action buttons (and selects, attribution chips, etc.) slotted into RIGHT cluster between meta and Sign out.
|
|
21
|
+
* Convention: use `<Button variant="secondary" size="sm">` for actions, `<Button variant="primary" size="sm">` for THE tool's primary CTA (e.g., "Save version").
|
|
22
|
+
* TOOL-001 uses this slot for the WbD attribution chip. */
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const ToolTopbar: React.FC<ToolTopbarProps>;
|
|
26
|
+
export default ToolTopbar;
|
|
27
|
+
//# sourceMappingURL=ToolTopbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolTopbar.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolTopbar/ToolTopbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IAEjB,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IAEf,uIAAuI;IACvI,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,qGAAqG;IACrG,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB;;gEAE4D;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA8BD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyDhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organisms/ToolTopbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -7,4 +7,9 @@ export * from './SearchSection';
|
|
|
7
7
|
export * from './TagFilterList';
|
|
8
8
|
export * from './CategoryGroup';
|
|
9
9
|
export * from './ArtifactList';
|
|
10
|
+
export * from './ToastProvider';
|
|
11
|
+
export * from './ToolTopbar';
|
|
12
|
+
export * from './ToolFooter';
|
|
13
|
+
export * from './ToolAuthGate';
|
|
14
|
+
export * from './inputs';
|
|
10
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/organisms/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/organisms/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAK7B,cAAc,gBAAgB,CAAC;AAI/B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FocusEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import './TextInput.css';
|
|
3
|
+
export type MoneyInputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface MoneyInputProps {
|
|
5
|
+
/** Visible label text. Required for a11y; never omit. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Controlled numeric value. null = empty (renders as "0" per Tsvika 2026-06-19 spec). */
|
|
8
|
+
value: number | null;
|
|
9
|
+
/** Fires on commit (Enter blur OR click-outside blur) with the parsed value. */
|
|
10
|
+
onChange: (next: number | null) => void;
|
|
11
|
+
hint?: string;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
size?: MoneyInputSize;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Hide the visible label (sr-only). For table-cell consumption. Default: false. */
|
|
18
|
+
hideLabel?: boolean;
|
|
19
|
+
min?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
/** Step for rounding on commit. Default 1 = integer-only (cents → step=0.01). */
|
|
22
|
+
step?: number;
|
|
23
|
+
/** BCP-47 locale tag for Intl.NumberFormat (default 'en-US'). */
|
|
24
|
+
locale?: string;
|
|
25
|
+
/** Prefix character — default '$'. Currency-parameterization deferred per REQ-19-003. */
|
|
26
|
+
prefix?: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
|
|
30
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
31
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function MoneyInput({ label, value, onChange, hint, errorMessage, size, required, invalid, disabled, hideLabel, min, max, step, locale, prefix, id: providedId, name, autoComplete, onFocus, onBlur, }: MoneyInputProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=MoneyInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/organisms/inputs/MoneyInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gFAAgF;IAChF,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAExC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,CAAC;IAErE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACpD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,IAAW,EACX,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,IAAQ,EACR,MAAgB,EAChB,MAAY,EACZ,EAAE,EAAE,UAAU,EACd,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,GACP,EAAE,eAAe,+BAwGjB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FocusEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import './TextInput.css';
|
|
3
|
+
export type NumberInputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface NumberInputProps {
|
|
5
|
+
/** Visible label text. Required for a11y; never omit. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Controlled numeric value. null = empty. */
|
|
8
|
+
value: number | null;
|
|
9
|
+
/** Fires on commit (Enter blur OR click-outside blur) with the parsed value. */
|
|
10
|
+
onChange: (next: number | null) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
/** Shown below input when invalid; replaces hint while invalid. */
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
size?: NumberInputSize;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Hide the visible label (sr-only). For table-cell consumption. Default: false. */
|
|
20
|
+
hideLabel?: boolean;
|
|
21
|
+
/** Inclusive lower bound. Omit to allow negatives. */
|
|
22
|
+
min?: number;
|
|
23
|
+
/** Inclusive upper bound. */
|
|
24
|
+
max?: number;
|
|
25
|
+
/** Step for rounding on commit. Default 1 = integer-only. */
|
|
26
|
+
step?: number;
|
|
27
|
+
/** BCP-47 locale tag for Intl.NumberFormat (default 'en-US'). */
|
|
28
|
+
locale?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
|
|
32
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
33
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function NumberInput({ label, value, onChange, placeholder, hint, errorMessage, size, required, invalid, disabled, hideLabel, min, max, step, locale, id: providedId, name, autoComplete, onFocus, onBlur, }: NumberInputProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/organisms/inputs/NumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gFAAgF;IAChF,QAAQ,EAAE,CAAC,IAAI,EAAE,MA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FocusEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import './TextInput.css';
|
|
3
|
+
export type PercentInputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface PercentInputProps {
|
|
5
|
+
/** Visible label text. Required for a11y; never omit. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Controlled numeric value. null = empty (renders as "0" per Tsvika 2026-06-19 spec). */
|
|
8
|
+
value: number | null;
|
|
9
|
+
/** Fires on commit (Enter blur OR click-outside blur) with the parsed value. */
|
|
10
|
+
onChange: (next: number | null) => void;
|
|
11
|
+
hint?: string;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
size?: PercentInputSize;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Hide the visible label (sr-only). For table-cell consumption. Default: false. */
|
|
18
|
+
hideLabel?: boolean;
|
|
19
|
+
/** Default 0. Override to allow negatives. */
|
|
20
|
+
min?: number;
|
|
21
|
+
/** Default 100. Override for basis-point-style or unbounded use. */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Step for rounding on commit. Default 1 = integer percent. */
|
|
24
|
+
step?: number;
|
|
25
|
+
/** BCP-47 locale tag for Intl.NumberFormat (default 'en-US'). */
|
|
26
|
+
locale?: string;
|
|
27
|
+
/** Suffix character — default '%'. */
|
|
28
|
+
suffix?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
|
|
32
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
33
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function PercentInput({ label, value, onChange, hint, errorMessage, size, required, invalid, disabled, hideLabel, min, max, step, locale, suffix, id: providedId, name, autoComplete, onFocus, onBlur, }: PercentInputProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=PercentIn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,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACpD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,IAAW,EACX,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,GAAO,EACP,GAAS,EACT,IAAQ,EACR,MAAgB,EAChB,MAAY,EACZ,EAAE,EAAE,UAAU,EACd,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,GACP,EAAE,iBAAiB,+BAuGnB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FocusEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import './TextInput.css';
|
|
3
|
+
export type TextInputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type TextInputType = 'text' | 'email' | 'tel' | 'url' | 'password';
|
|
5
|
+
export interface TextInputProps {
|
|
6
|
+
/** Visible label text. Required for a11y; never omit. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Controlled value. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Fires on every keystroke AND on Escape revert (with the pre-focus snapshot). */
|
|
11
|
+
onChange: (next: string) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
hint?: string;
|
|
14
|
+
size?: TextInputSize;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Hide the visible label (sr-only). For table-cell consumption where the column header is the visible label. Default: false. */
|
|
19
|
+
hideLabel?: boolean;
|
|
20
|
+
/** Shown below input when invalid; replaces hint while invalid. */
|
|
21
|
+
errorMessage?: string;
|
|
22
|
+
id?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
|
|
25
|
+
inputMode?: InputHTMLAttributes<HTMLInputElement>['inputMode'];
|
|
26
|
+
type?: TextInputType;
|
|
27
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
28
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function TextInput({ label, value, onChange, placeholder, hint, size, required, invalid, disabled, hideLabel, errorMessage, id: providedId, name, autoComplete, inputMode, type, onFocus: userOnFocus, onBlur: userOnBlur, }: TextInputProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../src/organisms/inputs/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAGf,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iIAAiI;IACjI,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MA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