@dashforge/tw 0.1.0-beta → 0.2.1-beta
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/A11Y.md +130 -0
- package/CHANGELOG.md +231 -0
- package/dist/index.d.ts +1 -82
- package/dist/index.esm.js +1608 -11
- package/dist/src/components/AspectRatio/AspectRatio.d.ts +36 -0
- package/dist/src/components/AspectRatio/AspectRatio.d.ts.map +1 -0
- package/dist/src/components/AspectRatio/aspectRatio.types.d.ts +50 -0
- package/dist/src/components/AspectRatio/aspectRatio.types.d.ts.map +1 -0
- package/dist/src/components/Box/Box.d.ts +36 -0
- package/dist/src/components/Box/Box.d.ts.map +1 -0
- package/dist/src/components/Box/box.types.d.ts +54 -0
- package/dist/src/components/Box/box.types.d.ts.map +1 -0
- package/dist/src/components/Box/box.variants.d.ts +402 -0
- package/dist/src/components/Box/box.variants.d.ts.map +1 -0
- package/dist/src/components/Button/Button.d.ts.map +1 -1
- package/dist/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/src/components/Container/Container.d.ts +35 -0
- package/dist/src/components/Container/Container.d.ts.map +1 -0
- package/dist/src/components/Container/container.types.d.ts +41 -0
- package/dist/src/components/Container/container.types.d.ts.map +1 -0
- package/dist/src/components/Container/container.variants.d.ts +93 -0
- package/dist/src/components/Container/container.variants.d.ts.map +1 -0
- package/dist/src/components/Divider/Divider.d.ts +50 -0
- package/dist/src/components/Divider/Divider.d.ts.map +1 -0
- package/dist/src/components/Divider/divider.types.d.ts +47 -0
- package/dist/src/components/Divider/divider.types.d.ts.map +1 -0
- package/dist/src/components/Divider/divider.variants.d.ts +129 -0
- package/dist/src/components/Divider/divider.variants.d.ts.map +1 -0
- package/dist/src/components/Grid/Grid.d.ts +32 -0
- package/dist/src/components/Grid/Grid.d.ts.map +1 -0
- package/dist/src/components/Grid/grid.types.d.ts +103 -0
- package/dist/src/components/Grid/grid.types.d.ts.map +1 -0
- package/dist/src/components/Grid/grid.variants.d.ts +453 -0
- package/dist/src/components/Grid/grid.variants.d.ts.map +1 -0
- package/dist/src/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/src/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/src/components/Stack/Stack.d.ts +24 -0
- package/dist/src/components/Stack/Stack.d.ts.map +1 -0
- package/dist/src/components/Stack/stack.types.d.ts +61 -0
- package/dist/src/components/Stack/stack.types.d.ts.map +1 -0
- package/dist/src/components/Stack/stack.variants.d.ts +163 -0
- package/dist/src/components/Stack/stack.variants.d.ts.map +1 -0
- package/dist/src/components/Typography/Typography.d.ts +42 -0
- package/dist/src/components/Typography/Typography.d.ts.map +1 -0
- package/dist/src/components/Typography/typography.types.d.ts +61 -0
- package/dist/src/components/Typography/typography.types.d.ts.map +1 -0
- package/dist/src/components/Typography/typography.variants.d.ts +167 -0
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -0
- package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts +42 -0
- package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts +42 -0
- package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts.map +1 -0
- package/dist/src/index.d.ts +23 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/AspectRatio/AspectRatio.test.tsx +173 -0
- package/src/components/AspectRatio/AspectRatio.tsx +73 -0
- package/src/components/AspectRatio/aspectRatio.types.ts +54 -0
- package/src/components/Box/Box.test.tsx +349 -0
- package/src/components/Box/Box.tsx +83 -0
- package/src/components/Box/box.types.ts +61 -0
- package/src/components/Box/box.variants.ts +211 -0
- package/src/components/Button/Button.tsx +11 -0
- package/src/components/Checkbox/Checkbox.tsx +26 -2
- package/src/components/Container/Container.test.tsx +209 -0
- package/src/components/Container/Container.tsx +74 -0
- package/src/components/Container/container.types.ts +45 -0
- package/src/components/Container/container.variants.ts +81 -0
- package/src/components/Divider/Divider.test.tsx +241 -0
- package/src/components/Divider/Divider.tsx +140 -0
- package/src/components/Divider/divider.types.ts +52 -0
- package/src/components/Divider/divider.variants.ts +115 -0
- package/src/components/Grid/Grid.test.tsx +321 -0
- package/src/components/Grid/Grid.tsx +148 -0
- package/src/components/Grid/grid.types.ts +112 -0
- package/src/components/Grid/grid.variants.ts +133 -0
- package/src/components/NumberField/NumberField.tsx +30 -2
- package/src/components/RadioGroup/RadioGroup.tsx +23 -1
- package/src/components/Stack/Stack.test.tsx +309 -0
- package/src/components/Stack/Stack.tsx +115 -0
- package/src/components/Stack/stack.types.ts +68 -0
- package/src/components/Stack/stack.variants.ts +80 -0
- package/src/components/Typography/Typography.test.tsx +230 -0
- package/src/components/Typography/Typography.tsx +112 -0
- package/src/components/Typography/typography.types.ts +65 -0
- package/src/components/Typography/typography.variants.ts +113 -0
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +86 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +59 -0
- package/src/components/VisuallyHidden/visuallyHidden.types.ts +45 -0
- package/src/index.ts +50 -1
- package/LICENSE +0 -21
- package/dist/components/AppShell/AppShell.d.ts +0 -32
- package/dist/components/AppShell/AppShell.d.ts.map +0 -1
- package/dist/components/AppShell/appShell.types.d.ts +0 -62
- package/dist/components/AppShell/appShell.types.d.ts.map +0 -1
- package/dist/components/AppShell/appShell.variants.d.ts +0 -65
- package/dist/components/AppShell/appShell.variants.d.ts.map +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -32
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +0 -1
- package/dist/components/Autocomplete/autocomplete.types.d.ts +0 -214
- package/dist/components/Autocomplete/autocomplete.types.d.ts.map +0 -1
- package/dist/components/Autocomplete/autocomplete.variants.d.ts +0 -214
- package/dist/components/Autocomplete/autocomplete.variants.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -23
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts +0 -98
- package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts +0 -85
- package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts +0 -44
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/button.types.d.ts +0 -66
- package/dist/components/Button/button.types.d.ts.map +0 -1
- package/dist/components/Button/button.variants.d.ts +0 -104
- package/dist/components/Button/button.variants.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -31
- package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/Checkbox/checkbox.types.d.ts +0 -86
- package/dist/components/Checkbox/checkbox.types.d.ts.map +0 -1
- package/dist/components/Checkbox/checkbox.variants.d.ts +0 -109
- package/dist/components/Checkbox/checkbox.variants.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +0 -38
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts +0 -80
- package/dist/components/ConfirmDialog/confirmDialog.types.d.ts.map +0 -1
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts +0 -90
- package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts.map +0 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -49
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +0 -1
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts +0 -95
- package/dist/components/DateTimePicker/dateTimePicker.types.d.ts.map +0 -1
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts +0 -165
- package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts.map +0 -1
- package/dist/components/LeftNav/LeftNav.d.ts +0 -34
- package/dist/components/LeftNav/LeftNav.d.ts.map +0 -1
- package/dist/components/LeftNav/leftNav.types.d.ts +0 -136
- package/dist/components/LeftNav/leftNav.types.d.ts.map +0 -1
- package/dist/components/LeftNav/leftNav.variants.d.ts +0 -143
- package/dist/components/LeftNav/leftNav.variants.d.ts.map +0 -1
- package/dist/components/NumberField/NumberField.d.ts +0 -18
- package/dist/components/NumberField/NumberField.d.ts.map +0 -1
- package/dist/components/NumberField/numberField.types.d.ts +0 -79
- package/dist/components/NumberField/numberField.types.d.ts.map +0 -1
- package/dist/components/NumberField/numberField.variants.d.ts +0 -169
- package/dist/components/NumberField/numberField.variants.d.ts.map +0 -1
- package/dist/components/OTPField/OTPField.d.ts +0 -25
- package/dist/components/OTPField/OTPField.d.ts.map +0 -1
- package/dist/components/OTPField/otpField.types.d.ts +0 -74
- package/dist/components/OTPField/otpField.types.d.ts.map +0 -1
- package/dist/components/OTPField/otpField.variants.d.ts +0 -105
- package/dist/components/OTPField/otpField.variants.d.ts.map +0 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -35
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +0 -1
- package/dist/components/RadioGroup/radioGroup.types.d.ts +0 -103
- package/dist/components/RadioGroup/radioGroup.types.d.ts.map +0 -1
- package/dist/components/RadioGroup/radioGroup.variants.d.ts +0 -166
- package/dist/components/RadioGroup/radioGroup.variants.d.ts.map +0 -1
- package/dist/components/Snackbar/Snackbar.d.ts +0 -37
- package/dist/components/Snackbar/Snackbar.d.ts.map +0 -1
- package/dist/components/Snackbar/snackbar.types.d.ts +0 -86
- package/dist/components/Snackbar/snackbar.types.d.ts.map +0 -1
- package/dist/components/Snackbar/snackbar.variants.d.ts +0 -153
- package/dist/components/Snackbar/snackbar.variants.d.ts.map +0 -1
- package/dist/components/Switch/Switch.d.ts +0 -15
- package/dist/components/Switch/Switch.d.ts.map +0 -1
- package/dist/components/Switch/switch.types.d.ts +0 -47
- package/dist/components/Switch/switch.types.d.ts.map +0 -1
- package/dist/components/Switch/switch.variants.d.ts +0 -105
- package/dist/components/Switch/switch.variants.d.ts.map +0 -1
- package/dist/components/TextField/TextField.d.ts +0 -25
- package/dist/components/TextField/TextField.d.ts.map +0 -1
- package/dist/components/TextField/textField.types.d.ts +0 -72
- package/dist/components/TextField/textField.types.d.ts.map +0 -1
- package/dist/components/TextField/textField.variants.d.ts +0 -160
- package/dist/components/TextField/textField.variants.d.ts.map +0 -1
- package/dist/components/Textarea/Textarea.d.ts +0 -16
- package/dist/components/Textarea/Textarea.d.ts.map +0 -1
- package/dist/components/Textarea/textarea.types.d.ts +0 -63
- package/dist/components/Textarea/textarea.types.d.ts.map +0 -1
- package/dist/components/Textarea/textarea.variants.d.ts +0 -197
- package/dist/components/Textarea/textarea.variants.d.ts.map +0 -1
- package/dist/components/TopBar/TopBar.d.ts +0 -33
- package/dist/components/TopBar/TopBar.d.ts.map +0 -1
- package/dist/components/TopBar/topBar.types.d.ts +0 -49
- package/dist/components/TopBar/topBar.types.d.ts.map +0 -1
- package/dist/components/TopBar/topBar.variants.d.ts +0 -79
- package/dist/components/TopBar/topBar.variants.d.ts.map +0 -1
- package/dist/components/_shared/resolveValidationState.d.ts +0 -42
- package/dist/components/_shared/resolveValidationState.d.ts.map +0 -1
- package/dist/hooks/useAccessState.d.ts +0 -37
- package/dist/hooks/useAccessState.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/utils/cn.d.ts +0 -26
- package/dist/utils/cn.d.ts.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from './button.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Dashforge TW Button — action component with RBAC support.
|
|
4
|
-
*
|
|
5
|
-
* Mirrors the public contract of the MUI-side
|
|
6
|
-
* `@dashforge/ui/Button` (RBAC behaviour identical) while rendering
|
|
7
|
-
* through Tailwind classes + the `dashforgePreset` color scales. Like
|
|
8
|
-
* the MUI version, this is NOT a form field — there is no bridge
|
|
9
|
-
* integration and no `DashFormContext` consumption.
|
|
10
|
-
*
|
|
11
|
-
* **`asChild`** mirrors the shadcn/Radix pattern: when set, the
|
|
12
|
-
* immediate child element receives the Button's resolved className
|
|
13
|
-
* and the Button DOM is not emitted. Useful for router Links, anchor
|
|
14
|
-
* tags, or any element that should look like a button without
|
|
15
|
-
* nesting one inside it.
|
|
16
|
-
*
|
|
17
|
-
* **Override precedence**: `sx` wins over variant classes via
|
|
18
|
-
* `tailwind-merge` inside `cn()`. Variants win over the `base` class
|
|
19
|
-
* group (TV's `compoundVariants` handle color×variant combos
|
|
20
|
-
* explicitly).
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <Button onClick={onSave}>Save</Button>
|
|
25
|
-
*
|
|
26
|
-
* <Button variant="outline" color="danger" size="lg" sx="ml-4">
|
|
27
|
-
* Delete
|
|
28
|
-
* </Button>
|
|
29
|
-
*
|
|
30
|
-
* <Button asChild variant="solid" color="primary">
|
|
31
|
-
* <Link to="/dashboard">Open Dashboard</Link>
|
|
32
|
-
* </Button>
|
|
33
|
-
*
|
|
34
|
-
* <Button
|
|
35
|
-
* loading
|
|
36
|
-
* access={{ resource: 'article', action: 'publish', onUnauthorized: 'disable' }}
|
|
37
|
-
* onClick={onPublish}
|
|
38
|
-
* >
|
|
39
|
-
* Publish
|
|
40
|
-
* </Button>
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
44
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA8BrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,MAAM,2GA8DjB,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import type { AccessRequirement } from '@dashforge/rbac';
|
|
3
|
-
import type { ButtonVariants } from './button.variants.js';
|
|
4
|
-
/**
|
|
5
|
-
* Props for the Dashforge TW `<Button>` component.
|
|
6
|
-
*
|
|
7
|
-
* Extends the native `<button>` attributes (so `onClick`, `type`,
|
|
8
|
-
* `aria-*`, `data-*` etc. all flow through), narrowed in two places:
|
|
9
|
-
*
|
|
10
|
-
* - `disabled` is kept (combines with RBAC + loading via OR)
|
|
11
|
-
* - `className` is omitted — use `sx` instead. This keeps the
|
|
12
|
-
* override path **single and explicit**: `sx` is the escape hatch
|
|
13
|
-
* for adding utility classes, and `tailwind-merge` (via `cn()`)
|
|
14
|
-
* guarantees it wins over any conflicting variant class.
|
|
15
|
-
*
|
|
16
|
-
* Plus the variant axes from `tailwind-variants` and Dashforge-specific
|
|
17
|
-
* additions:
|
|
18
|
-
*
|
|
19
|
-
* - `access` — RBAC requirement (hide / disable / readonly)
|
|
20
|
-
* - `asChild` — Radix Slot polymorphism: when `true`, renders the
|
|
21
|
-
* immediate child element with the Button's class merged in, so
|
|
22
|
-
* `<Button asChild><a href="/x">Go</a></Button>` produces a styled
|
|
23
|
-
* `<a>` with no extra wrapper DOM
|
|
24
|
-
*/
|
|
25
|
-
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'color'>, Pick<ButtonVariants, 'variant' | 'color' | 'size' | 'fullWidth' | 'loading'> {
|
|
26
|
-
/**
|
|
27
|
-
* RBAC access control requirement.
|
|
28
|
-
*
|
|
29
|
-
* Controls button visibility and interaction based on user
|
|
30
|
-
* permissions:
|
|
31
|
-
* - `onUnauthorized: 'hide'` → button does not render
|
|
32
|
-
* - `onUnauthorized: 'disable'` → button renders disabled
|
|
33
|
-
* - `onUnauthorized: 'readonly'` → button renders disabled
|
|
34
|
-
* (buttons do not support true readonly semantics; disabled is
|
|
35
|
-
* used as fallback)
|
|
36
|
-
*
|
|
37
|
-
* Combines with `disabled` and `loading` props via OR logic.
|
|
38
|
-
*/
|
|
39
|
-
access?: AccessRequirement;
|
|
40
|
-
/**
|
|
41
|
-
* When `true`, the immediate child element is rendered with the
|
|
42
|
-
* Button's classes merged in (via `@radix-ui/react-slot`). The
|
|
43
|
-
* Button DOM element is not emitted.
|
|
44
|
-
*
|
|
45
|
-
* Common pattern: render a router `Link` with Button styling.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```tsx
|
|
49
|
-
* <Button asChild variant="solid">
|
|
50
|
-
* <Link to="/dashboard">Dashboard</Link>
|
|
51
|
-
* </Button>
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
asChild?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Tailwind utility classes appended **after** the variant classes,
|
|
57
|
-
* so they win on any conflict via `tailwind-merge`.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```tsx
|
|
61
|
-
* <Button sx="md:w-1/2 shadow-xl">Save</Button>
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
sx?: string;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=button.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,WAKf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,EAC1E,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9E;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;OAQG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
/**
|
|
3
|
-
* Tailwind-variants recipe for `<Button>`.
|
|
4
|
-
*
|
|
5
|
-
* Three independent axes plus two booleans:
|
|
6
|
-
* - `variant`: visual treatment (solid / outline / ghost / link)
|
|
7
|
-
* - `color`: semantic intent role (primary / secondary / success /
|
|
8
|
-
* warning / danger)
|
|
9
|
-
* - `size`: sm / md / lg
|
|
10
|
-
* - `fullWidth`: stretches to container width
|
|
11
|
-
* - `loading`: visually + functionally disabled, used together with
|
|
12
|
-
* an inline spinner rendered by the component
|
|
13
|
-
*
|
|
14
|
-
* Color × variant combinations are expressed via `compoundVariants` so
|
|
15
|
-
* each pair owns its bg / text / border / hover / focus quartet without
|
|
16
|
-
* a `dark:` variant explosion. Dark mode swap is delegated entirely to
|
|
17
|
-
* the runtime CSS-vars from `@dashforge/tw-theme` — the same class
|
|
18
|
-
* resolves to a different value when `data-dash-tw-theme="dark"` flips.
|
|
19
|
-
*
|
|
20
|
-
* Token references:
|
|
21
|
-
* - Surface bg / border / text → `*-primary-*`, `*-danger-*`, etc.
|
|
22
|
-
* (resolved via `dashforgePreset()`)
|
|
23
|
-
* - Hover / focus / active states→ one tone deeper on the same scale
|
|
24
|
-
* (`primary-600` from `primary-500`)
|
|
25
|
-
* - Disabled → opacity drop + no pointer-events
|
|
26
|
-
*/
|
|
27
|
-
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
28
|
-
variant: {
|
|
29
|
-
solid: string;
|
|
30
|
-
outline: string;
|
|
31
|
-
ghost: string;
|
|
32
|
-
link: string;
|
|
33
|
-
};
|
|
34
|
-
color: {
|
|
35
|
-
primary: string;
|
|
36
|
-
secondary: string;
|
|
37
|
-
success: string;
|
|
38
|
-
warning: string;
|
|
39
|
-
danger: string;
|
|
40
|
-
};
|
|
41
|
-
size: {
|
|
42
|
-
sm: string;
|
|
43
|
-
md: string;
|
|
44
|
-
lg: string;
|
|
45
|
-
};
|
|
46
|
-
fullWidth: {
|
|
47
|
-
true: string;
|
|
48
|
-
};
|
|
49
|
-
loading: {
|
|
50
|
-
true: string;
|
|
51
|
-
};
|
|
52
|
-
}, undefined, string[], {
|
|
53
|
-
variant: {
|
|
54
|
-
solid: string;
|
|
55
|
-
outline: string;
|
|
56
|
-
ghost: string;
|
|
57
|
-
link: string;
|
|
58
|
-
};
|
|
59
|
-
color: {
|
|
60
|
-
primary: string;
|
|
61
|
-
secondary: string;
|
|
62
|
-
success: string;
|
|
63
|
-
warning: string;
|
|
64
|
-
danger: string;
|
|
65
|
-
};
|
|
66
|
-
size: {
|
|
67
|
-
sm: string;
|
|
68
|
-
md: string;
|
|
69
|
-
lg: string;
|
|
70
|
-
};
|
|
71
|
-
fullWidth: {
|
|
72
|
-
true: string;
|
|
73
|
-
};
|
|
74
|
-
loading: {
|
|
75
|
-
true: string;
|
|
76
|
-
};
|
|
77
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
78
|
-
variant: {
|
|
79
|
-
solid: string;
|
|
80
|
-
outline: string;
|
|
81
|
-
ghost: string;
|
|
82
|
-
link: string;
|
|
83
|
-
};
|
|
84
|
-
color: {
|
|
85
|
-
primary: string;
|
|
86
|
-
secondary: string;
|
|
87
|
-
success: string;
|
|
88
|
-
warning: string;
|
|
89
|
-
danger: string;
|
|
90
|
-
};
|
|
91
|
-
size: {
|
|
92
|
-
sm: string;
|
|
93
|
-
md: string;
|
|
94
|
-
lg: string;
|
|
95
|
-
};
|
|
96
|
-
fullWidth: {
|
|
97
|
-
true: string;
|
|
98
|
-
};
|
|
99
|
-
loading: {
|
|
100
|
-
true: string;
|
|
101
|
-
};
|
|
102
|
-
}, undefined, string[], unknown, unknown, undefined>>;
|
|
103
|
-
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
104
|
-
//# sourceMappingURL=button.variants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Button/button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAiIzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { CheckboxProps } from './checkbox.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Dashforge TW Checkbox — bridge-integrated form control.
|
|
4
|
-
*
|
|
5
|
-
* Renders through Radix `Checkbox.Root` + `Checkbox.Indicator`, styled
|
|
6
|
-
* with the `checkboxVariants` TV recipe. Behaviour at the bridge level
|
|
7
|
-
* is a direct port of `@dashforge/ui/Checkbox` (MUI):
|
|
8
|
-
*
|
|
9
|
-
* - When mounted inside `DashFormProvider`, registers with the bridge
|
|
10
|
-
* (`bridge.register`), reads `bridge.getValue` for the checked
|
|
11
|
-
* state, writes `bridge.setValue` on change, fires
|
|
12
|
-
* `registration.onChange` / `onBlur` for RHF.
|
|
13
|
-
* - When mounted outside, behaves as a plain uncontrolled checkbox.
|
|
14
|
-
* - `visibleWhen` predicates the engine state; `false` → returns null.
|
|
15
|
-
* - `useAccessState(access)` resolves RBAC; `visible: false` → null.
|
|
16
|
-
* - `unregister`-on-unmount is StrictMode-safe (queueMicrotask +
|
|
17
|
-
* `isMountedRef`, mirrors the MUI-side pattern).
|
|
18
|
-
* - Error gating: bridge error shows only after `touched` or after
|
|
19
|
-
* the form has been submitted (`submitCount > 0`).
|
|
20
|
-
*
|
|
21
|
-
* Renderer differences vs MUI:
|
|
22
|
-
*
|
|
23
|
-
* - No `FormControlLabel` wrapper — uses a native `<label htmlFor>`
|
|
24
|
-
* bound via `useId()`. The label click toggles via HTML semantics.
|
|
25
|
-
* - The Radix root is a `<button>`, so it's keyboard-accessible by
|
|
26
|
-
* default (Space toggles).
|
|
27
|
-
* - Slot overrides are class-based (`slotProps={{ control: { className } }}`)
|
|
28
|
-
* rather than MUI slot components.
|
|
29
|
-
*/
|
|
30
|
-
export declare function Checkbox(props: CheckboxProps): import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
-
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA2BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kDAmK5C"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { AccessRequirement } from '@dashforge/rbac';
|
|
3
|
-
import type { Engine } from '@dashforge/ui-core';
|
|
4
|
-
import type { CheckboxVariants } from './checkbox.variants.js';
|
|
5
|
-
/**
|
|
6
|
-
* Per-slot className overrides for `<Checkbox>`. Shape mirrors the
|
|
7
|
-
* MUI-side `slotProps` convention: object-per-slot with a `className`
|
|
8
|
-
* key, so future extensions (style, aria-*, data-*) are additive.
|
|
9
|
-
*/
|
|
10
|
-
export interface CheckboxSlotProps {
|
|
11
|
-
root?: {
|
|
12
|
-
className?: string;
|
|
13
|
-
};
|
|
14
|
-
control?: {
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
indicator?: {
|
|
18
|
-
className?: string;
|
|
19
|
-
};
|
|
20
|
-
label?: {
|
|
21
|
-
className?: string;
|
|
22
|
-
};
|
|
23
|
-
helperText?: {
|
|
24
|
-
className?: string;
|
|
25
|
-
};
|
|
26
|
-
errorText?: {
|
|
27
|
-
className?: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Props for the Dashforge TW `<Checkbox>` component.
|
|
32
|
-
*
|
|
33
|
-
* Behaves identically to `@dashforge/ui/Checkbox` (MUI) at the bridge
|
|
34
|
-
* level — same `name` / `rules` / `visibleWhen` / `access` semantics,
|
|
35
|
-
* same validation gating (touched OR submitCount > 0). The visual
|
|
36
|
-
* surface is rendered via Radix Checkbox + Tailwind classes.
|
|
37
|
-
*
|
|
38
|
-
* Note: the `error` prop here is the **public** form-validation
|
|
39
|
-
* semaphore (boolean override); it threads into the variant via
|
|
40
|
-
* `checkboxVariants({ error })` internally. The variant axis name and
|
|
41
|
-
* the prop name happen to coincide — same meaning.
|
|
42
|
-
*/
|
|
43
|
-
export interface CheckboxProps extends Pick<CheckboxVariants, 'size'> {
|
|
44
|
-
/** Bridge field name (required when used inside `DashFormProvider`). */
|
|
45
|
-
name: string;
|
|
46
|
-
/** Visible label rendered next to the control. Click also toggles the box. */
|
|
47
|
-
label?: ReactNode;
|
|
48
|
-
/** Forwarded to the bridge as RHF rules — opaque to this component. */
|
|
49
|
-
rules?: unknown;
|
|
50
|
-
/**
|
|
51
|
-
* Engine predicate. When provided, the component renders only when
|
|
52
|
-
* the predicate returns truthy against the current engine state.
|
|
53
|
-
*/
|
|
54
|
-
visibleWhen?: (engine: Engine) => boolean;
|
|
55
|
-
/** Initial / controlled checked state. */
|
|
56
|
-
checked?: boolean;
|
|
57
|
-
/** Default checked when used uncontrolled. */
|
|
58
|
-
defaultChecked?: boolean;
|
|
59
|
-
/** Disabled — combined with RBAC disabled via OR. */
|
|
60
|
-
disabled?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Forces helper text below the control. When the bridge surfaces an
|
|
63
|
-
* error and `helperText` is undefined, the bridge's error message
|
|
64
|
-
* shows up here (gated by `touched || submitCount > 0`).
|
|
65
|
-
*/
|
|
66
|
-
helperText?: ReactNode;
|
|
67
|
-
/**
|
|
68
|
-
* Explicit error flag. When `true`, the control renders with the
|
|
69
|
-
* danger ring + the error-text slot is used for `helperText`.
|
|
70
|
-
* Overrides the bridge's auto-detected error.
|
|
71
|
-
*/
|
|
72
|
-
error?: boolean;
|
|
73
|
-
/** RBAC requirement. */
|
|
74
|
-
access?: AccessRequirement;
|
|
75
|
-
/** Root-level Tailwind override. Wins over variant classes via `cn()`. */
|
|
76
|
-
sx?: string;
|
|
77
|
-
/** Per-slot overrides — see `CheckboxSlotProps`. */
|
|
78
|
-
slotProps?: CheckboxSlotProps;
|
|
79
|
-
/**
|
|
80
|
-
* Called when the user toggles the control. When inside a
|
|
81
|
-
* `DashFormProvider`, the bridge update happens first, then this
|
|
82
|
-
* callback fires with the new checked state.
|
|
83
|
-
*/
|
|
84
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=checkbox.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/checkbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,UAAU,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACtC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IAEb,8EAA8E;IAC9E,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAE1C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,8CAA8C;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,wBAAwB;IACxB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,oDAAoD;IACpD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAE9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
/**
|
|
3
|
-
* Tailwind-variants recipe for `<Checkbox>` with slots.
|
|
4
|
-
*
|
|
5
|
-
* Slots:
|
|
6
|
-
* - `root` — outer flex wrapper enclosing the control + label
|
|
7
|
-
* - `control` — the visible square (Radix `Checkbox.Root`)
|
|
8
|
-
* - `indicator` — checkmark SVG container (Radix `Checkbox.Indicator`)
|
|
9
|
-
* - `label` — text label associated with the control
|
|
10
|
-
* - `helperText` — descriptive line below
|
|
11
|
-
* - `errorText` — error message line (semantic counterpart of helperText)
|
|
12
|
-
*
|
|
13
|
-
* Variants:
|
|
14
|
-
* - `size` : sm / md / lg (drives control box dimensions + label text size)
|
|
15
|
-
* - `error` : bool — swaps borders + helper-text color to danger tones
|
|
16
|
-
*/
|
|
17
|
-
export declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
18
|
-
size: {
|
|
19
|
-
sm: {
|
|
20
|
-
control: string;
|
|
21
|
-
label: string;
|
|
22
|
-
indicator: string;
|
|
23
|
-
};
|
|
24
|
-
md: {
|
|
25
|
-
control: string;
|
|
26
|
-
label: string;
|
|
27
|
-
indicator: string;
|
|
28
|
-
};
|
|
29
|
-
lg: {
|
|
30
|
-
control: string;
|
|
31
|
-
label: string;
|
|
32
|
-
indicator: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
error: {
|
|
36
|
-
true: {
|
|
37
|
-
control: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
}, {
|
|
41
|
-
root: string;
|
|
42
|
-
control: string[];
|
|
43
|
-
indicator: string;
|
|
44
|
-
label: string;
|
|
45
|
-
helperText: string;
|
|
46
|
-
errorText: string;
|
|
47
|
-
}, undefined, {
|
|
48
|
-
size: {
|
|
49
|
-
sm: {
|
|
50
|
-
control: string;
|
|
51
|
-
label: string;
|
|
52
|
-
indicator: string;
|
|
53
|
-
};
|
|
54
|
-
md: {
|
|
55
|
-
control: string;
|
|
56
|
-
label: string;
|
|
57
|
-
indicator: string;
|
|
58
|
-
};
|
|
59
|
-
lg: {
|
|
60
|
-
control: string;
|
|
61
|
-
label: string;
|
|
62
|
-
indicator: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
error: {
|
|
66
|
-
true: {
|
|
67
|
-
control: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
}, {
|
|
71
|
-
root: string;
|
|
72
|
-
control: string[];
|
|
73
|
-
indicator: string;
|
|
74
|
-
label: string;
|
|
75
|
-
helperText: string;
|
|
76
|
-
errorText: string;
|
|
77
|
-
}, import("tailwind-variants").TVReturnType<{
|
|
78
|
-
size: {
|
|
79
|
-
sm: {
|
|
80
|
-
control: string;
|
|
81
|
-
label: string;
|
|
82
|
-
indicator: string;
|
|
83
|
-
};
|
|
84
|
-
md: {
|
|
85
|
-
control: string;
|
|
86
|
-
label: string;
|
|
87
|
-
indicator: string;
|
|
88
|
-
};
|
|
89
|
-
lg: {
|
|
90
|
-
control: string;
|
|
91
|
-
label: string;
|
|
92
|
-
indicator: string;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
error: {
|
|
96
|
-
true: {
|
|
97
|
-
control: string;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
}, {
|
|
101
|
-
root: string;
|
|
102
|
-
control: string[];
|
|
103
|
-
indicator: string;
|
|
104
|
-
label: string;
|
|
105
|
-
helperText: string;
|
|
106
|
-
errorText: string;
|
|
107
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
108
|
-
export type CheckboxVariants = VariantProps<typeof checkboxVariants>;
|
|
109
|
-
//# sourceMappingURL=checkbox.variants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/checkbox.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAgD3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ConfirmDialogProviderProps, ConfirmFn } from './confirmDialog.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* `useConfirm()` — returns the imperative `confirm()` function.
|
|
4
|
-
*
|
|
5
|
-
* Throws if called outside a `<ConfirmDialogProvider>`. The thrown error
|
|
6
|
-
* tells the developer exactly what to do — no silent no-op (silently
|
|
7
|
-
* resolving `false` would be a footgun for destructive actions).
|
|
8
|
-
*/
|
|
9
|
-
export declare function useConfirm(): ConfirmFn;
|
|
10
|
-
/**
|
|
11
|
-
* Dashforge TW ConfirmDialog provider.
|
|
12
|
-
*
|
|
13
|
-
* Imperative confirmation modal built on the native HTML `<dialog>`
|
|
14
|
-
* element + `showModal()`. Why native:
|
|
15
|
-
*
|
|
16
|
-
* 1. **AAA-grade a11y for free** — browsers implement focus trap,
|
|
17
|
-
* Escape key, inert background, and `aria-modal` semantics natively.
|
|
18
|
-
* 2. **Zero new deps** — no `@radix-ui/react-dialog` or Aria stack.
|
|
19
|
-
* 3. **Smaller bundle** — ~1 KB of logic vs. ~25 KB for Aria Dialog.
|
|
20
|
-
*
|
|
21
|
-
* **Behaviour**:
|
|
22
|
-
* - `confirm(opts)` returns a `Promise<boolean>`.
|
|
23
|
-
* - Backdrop click resolves `false` (unless `disableBackdropClose`).
|
|
24
|
-
* - Escape key resolves `false` (unless `disableEscapeClose`).
|
|
25
|
-
* - Cancel button resolves `false`.
|
|
26
|
-
* - Confirm button resolves `true`.
|
|
27
|
-
* - At most ONE dialog open at a time — concurrent `confirm()` calls
|
|
28
|
-
* queue and fire FIFO (so a destructive action can't accidentally
|
|
29
|
-
* race a benign one).
|
|
30
|
-
*
|
|
31
|
-
* **A11y**:
|
|
32
|
-
* - `<dialog>` ⇒ implicit `role="dialog"` + `aria-modal="true"`.
|
|
33
|
-
* - `aria-labelledby` wires the title id to the dialog.
|
|
34
|
-
* - Focus is auto-trapped by `showModal()`.
|
|
35
|
-
* - First focusable element receives focus on open (browser-managed).
|
|
36
|
-
*/
|
|
37
|
-
export declare function ConfirmDialogProvider(props: ConfirmDialogProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,0BAA0B,EAC1B,SAAS,EAGV,MAAM,0BAA0B,CAAC;AAalC;;;;;;GAMG;AACH,wBAAgB,UAAU,IAAI,SAAS,CAQtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAkLtE"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ConfirmDialogVariants } from './confirmDialog.variants.js';
|
|
3
|
-
/**
|
|
4
|
-
* Severity / intent of the confirmation request — drives the accent
|
|
5
|
-
* color of the confirm button (info / warning / danger / success).
|
|
6
|
-
*/
|
|
7
|
-
export type ConfirmSeverity = 'info' | 'warning' | 'danger' | 'success';
|
|
8
|
-
export interface ConfirmDialogSlotProps {
|
|
9
|
-
backdrop?: {
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
dialog?: {
|
|
13
|
-
className?: string;
|
|
14
|
-
};
|
|
15
|
-
title?: {
|
|
16
|
-
className?: string;
|
|
17
|
-
};
|
|
18
|
-
body?: {
|
|
19
|
-
className?: string;
|
|
20
|
-
};
|
|
21
|
-
actions?: {
|
|
22
|
-
className?: string;
|
|
23
|
-
};
|
|
24
|
-
confirmButton?: {
|
|
25
|
-
className?: string;
|
|
26
|
-
};
|
|
27
|
-
cancelButton?: {
|
|
28
|
-
className?: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* One-shot confirmation request.
|
|
33
|
-
*
|
|
34
|
-
* Passed to `confirm()` from `useConfirm()` — the consumer awaits the
|
|
35
|
-
* returned promise. Resolves `true` when the user clicks confirm,
|
|
36
|
-
* `false` otherwise (cancel, backdrop, Escape).
|
|
37
|
-
*/
|
|
38
|
-
export interface ConfirmOptions {
|
|
39
|
-
title?: ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* Body content. Either a plain node (rendered inside `<p>`) or a
|
|
42
|
-
* fully custom render — accepted as a ReactNode to keep the API simple.
|
|
43
|
-
*/
|
|
44
|
-
body?: ReactNode;
|
|
45
|
-
/** Confirm button label. @default 'Confirm' */
|
|
46
|
-
confirmLabel?: ReactNode;
|
|
47
|
-
/** Cancel button label. @default 'Cancel' */
|
|
48
|
-
cancelLabel?: ReactNode;
|
|
49
|
-
/** Severity drives confirm button color. @default 'info' */
|
|
50
|
-
severity?: ConfirmSeverity;
|
|
51
|
-
/** Disable the backdrop-click close. @default false */
|
|
52
|
-
disableBackdropClose?: boolean;
|
|
53
|
-
/** Disable the Escape-key close. @default false */
|
|
54
|
-
disableEscapeClose?: boolean;
|
|
55
|
-
/** Per-slot className overrides for this single invocation. */
|
|
56
|
-
slotProps?: ConfirmDialogSlotProps;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Imperative API exposed by `useConfirm()`.
|
|
60
|
-
*
|
|
61
|
-
* ```tsx
|
|
62
|
-
* const confirm = useConfirm();
|
|
63
|
-
* const ok = await confirm({
|
|
64
|
-
* title: 'Delete record?',
|
|
65
|
-
* body: 'This action cannot be undone.',
|
|
66
|
-
* severity: 'danger',
|
|
67
|
-
* confirmLabel: 'Delete',
|
|
68
|
-
* });
|
|
69
|
-
* if (ok) { ... }
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export type ConfirmFn = (options?: ConfirmOptions) => Promise<boolean>;
|
|
73
|
-
export interface ConfirmDialogProviderProps extends ConfirmDialogVariants {
|
|
74
|
-
children: ReactNode;
|
|
75
|
-
/** Default options merged into every `confirm()` invocation. */
|
|
76
|
-
defaults?: ConfirmOptions;
|
|
77
|
-
/** Per-slot className overrides applied to ALL invocations. */
|
|
78
|
-
slotProps?: ConfirmDialogSlotProps;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=confirmDialog.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirmDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmDialog/confirmDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,aAAa,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvE,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE,QAAQ,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC"}
|