@dashforge/tw 0.1.0-beta → 0.2.0-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.
Files changed (185) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/index.d.ts +1 -82
  3. package/dist/index.esm.js +1563 -2
  4. package/dist/src/components/AspectRatio/AspectRatio.d.ts +36 -0
  5. package/dist/src/components/AspectRatio/AspectRatio.d.ts.map +1 -0
  6. package/dist/src/components/AspectRatio/aspectRatio.types.d.ts +50 -0
  7. package/dist/src/components/AspectRatio/aspectRatio.types.d.ts.map +1 -0
  8. package/dist/src/components/Box/Box.d.ts +36 -0
  9. package/dist/src/components/Box/Box.d.ts.map +1 -0
  10. package/dist/src/components/Box/box.types.d.ts +54 -0
  11. package/dist/src/components/Box/box.types.d.ts.map +1 -0
  12. package/dist/src/components/Box/box.variants.d.ts +402 -0
  13. package/dist/src/components/Box/box.variants.d.ts.map +1 -0
  14. package/dist/src/components/Container/Container.d.ts +35 -0
  15. package/dist/src/components/Container/Container.d.ts.map +1 -0
  16. package/dist/src/components/Container/container.types.d.ts +41 -0
  17. package/dist/src/components/Container/container.types.d.ts.map +1 -0
  18. package/dist/src/components/Container/container.variants.d.ts +93 -0
  19. package/dist/src/components/Container/container.variants.d.ts.map +1 -0
  20. package/dist/src/components/Divider/Divider.d.ts +50 -0
  21. package/dist/src/components/Divider/Divider.d.ts.map +1 -0
  22. package/dist/src/components/Divider/divider.types.d.ts +47 -0
  23. package/dist/src/components/Divider/divider.types.d.ts.map +1 -0
  24. package/dist/src/components/Divider/divider.variants.d.ts +129 -0
  25. package/dist/src/components/Divider/divider.variants.d.ts.map +1 -0
  26. package/dist/src/components/Grid/Grid.d.ts +32 -0
  27. package/dist/src/components/Grid/Grid.d.ts.map +1 -0
  28. package/dist/src/components/Grid/grid.types.d.ts +103 -0
  29. package/dist/src/components/Grid/grid.types.d.ts.map +1 -0
  30. package/dist/src/components/Grid/grid.variants.d.ts +453 -0
  31. package/dist/src/components/Grid/grid.variants.d.ts.map +1 -0
  32. package/dist/src/components/Stack/Stack.d.ts +24 -0
  33. package/dist/src/components/Stack/Stack.d.ts.map +1 -0
  34. package/dist/src/components/Stack/stack.types.d.ts +61 -0
  35. package/dist/src/components/Stack/stack.types.d.ts.map +1 -0
  36. package/dist/src/components/Stack/stack.variants.d.ts +163 -0
  37. package/dist/src/components/Stack/stack.variants.d.ts.map +1 -0
  38. package/dist/src/components/Typography/Typography.d.ts +42 -0
  39. package/dist/src/components/Typography/Typography.d.ts.map +1 -0
  40. package/dist/src/components/Typography/typography.types.d.ts +61 -0
  41. package/dist/src/components/Typography/typography.types.d.ts.map +1 -0
  42. package/dist/src/components/Typography/typography.variants.d.ts +167 -0
  43. package/dist/src/components/Typography/typography.variants.d.ts.map +1 -0
  44. package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts +42 -0
  45. package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
  46. package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts +42 -0
  47. package/dist/src/components/VisuallyHidden/visuallyHidden.types.d.ts.map +1 -0
  48. package/dist/src/index.d.ts +22 -0
  49. package/dist/src/index.d.ts.map +1 -1
  50. package/package.json +3 -3
  51. package/src/components/AspectRatio/AspectRatio.test.tsx +173 -0
  52. package/src/components/AspectRatio/AspectRatio.tsx +73 -0
  53. package/src/components/AspectRatio/aspectRatio.types.ts +54 -0
  54. package/src/components/Box/Box.test.tsx +349 -0
  55. package/src/components/Box/Box.tsx +83 -0
  56. package/src/components/Box/box.types.ts +61 -0
  57. package/src/components/Box/box.variants.ts +211 -0
  58. package/src/components/Container/Container.test.tsx +209 -0
  59. package/src/components/Container/Container.tsx +74 -0
  60. package/src/components/Container/container.types.ts +45 -0
  61. package/src/components/Container/container.variants.ts +81 -0
  62. package/src/components/Divider/Divider.test.tsx +241 -0
  63. package/src/components/Divider/Divider.tsx +140 -0
  64. package/src/components/Divider/divider.types.ts +52 -0
  65. package/src/components/Divider/divider.variants.ts +115 -0
  66. package/src/components/Grid/Grid.test.tsx +321 -0
  67. package/src/components/Grid/Grid.tsx +148 -0
  68. package/src/components/Grid/grid.types.ts +112 -0
  69. package/src/components/Grid/grid.variants.ts +133 -0
  70. package/src/components/Stack/Stack.test.tsx +309 -0
  71. package/src/components/Stack/Stack.tsx +115 -0
  72. package/src/components/Stack/stack.types.ts +68 -0
  73. package/src/components/Stack/stack.variants.ts +80 -0
  74. package/src/components/Typography/Typography.test.tsx +230 -0
  75. package/src/components/Typography/Typography.tsx +112 -0
  76. package/src/components/Typography/typography.types.ts +65 -0
  77. package/src/components/Typography/typography.variants.ts +113 -0
  78. package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +86 -0
  79. package/src/components/VisuallyHidden/VisuallyHidden.tsx +59 -0
  80. package/src/components/VisuallyHidden/visuallyHidden.types.ts +45 -0
  81. package/src/index.ts +49 -0
  82. package/dist/components/AppShell/AppShell.d.ts +0 -32
  83. package/dist/components/AppShell/AppShell.d.ts.map +0 -1
  84. package/dist/components/AppShell/appShell.types.d.ts +0 -62
  85. package/dist/components/AppShell/appShell.types.d.ts.map +0 -1
  86. package/dist/components/AppShell/appShell.variants.d.ts +0 -65
  87. package/dist/components/AppShell/appShell.variants.d.ts.map +0 -1
  88. package/dist/components/Autocomplete/Autocomplete.d.ts +0 -32
  89. package/dist/components/Autocomplete/Autocomplete.d.ts.map +0 -1
  90. package/dist/components/Autocomplete/autocomplete.types.d.ts +0 -214
  91. package/dist/components/Autocomplete/autocomplete.types.d.ts.map +0 -1
  92. package/dist/components/Autocomplete/autocomplete.variants.d.ts +0 -214
  93. package/dist/components/Autocomplete/autocomplete.variants.d.ts.map +0 -1
  94. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -23
  95. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
  96. package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts +0 -98
  97. package/dist/components/Breadcrumbs/breadcrumbs.types.d.ts.map +0 -1
  98. package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts +0 -85
  99. package/dist/components/Breadcrumbs/breadcrumbs.variants.d.ts.map +0 -1
  100. package/dist/components/Button/Button.d.ts +0 -44
  101. package/dist/components/Button/Button.d.ts.map +0 -1
  102. package/dist/components/Button/button.types.d.ts +0 -66
  103. package/dist/components/Button/button.types.d.ts.map +0 -1
  104. package/dist/components/Button/button.variants.d.ts +0 -104
  105. package/dist/components/Button/button.variants.d.ts.map +0 -1
  106. package/dist/components/Checkbox/Checkbox.d.ts +0 -31
  107. package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
  108. package/dist/components/Checkbox/checkbox.types.d.ts +0 -86
  109. package/dist/components/Checkbox/checkbox.types.d.ts.map +0 -1
  110. package/dist/components/Checkbox/checkbox.variants.d.ts +0 -109
  111. package/dist/components/Checkbox/checkbox.variants.d.ts.map +0 -1
  112. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +0 -38
  113. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +0 -1
  114. package/dist/components/ConfirmDialog/confirmDialog.types.d.ts +0 -80
  115. package/dist/components/ConfirmDialog/confirmDialog.types.d.ts.map +0 -1
  116. package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts +0 -90
  117. package/dist/components/ConfirmDialog/confirmDialog.variants.d.ts.map +0 -1
  118. package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -49
  119. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +0 -1
  120. package/dist/components/DateTimePicker/dateTimePicker.types.d.ts +0 -95
  121. package/dist/components/DateTimePicker/dateTimePicker.types.d.ts.map +0 -1
  122. package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts +0 -165
  123. package/dist/components/DateTimePicker/dateTimePicker.variants.d.ts.map +0 -1
  124. package/dist/components/LeftNav/LeftNav.d.ts +0 -34
  125. package/dist/components/LeftNav/LeftNav.d.ts.map +0 -1
  126. package/dist/components/LeftNav/leftNav.types.d.ts +0 -136
  127. package/dist/components/LeftNav/leftNav.types.d.ts.map +0 -1
  128. package/dist/components/LeftNav/leftNav.variants.d.ts +0 -143
  129. package/dist/components/LeftNav/leftNav.variants.d.ts.map +0 -1
  130. package/dist/components/NumberField/NumberField.d.ts +0 -18
  131. package/dist/components/NumberField/NumberField.d.ts.map +0 -1
  132. package/dist/components/NumberField/numberField.types.d.ts +0 -79
  133. package/dist/components/NumberField/numberField.types.d.ts.map +0 -1
  134. package/dist/components/NumberField/numberField.variants.d.ts +0 -169
  135. package/dist/components/NumberField/numberField.variants.d.ts.map +0 -1
  136. package/dist/components/OTPField/OTPField.d.ts +0 -25
  137. package/dist/components/OTPField/OTPField.d.ts.map +0 -1
  138. package/dist/components/OTPField/otpField.types.d.ts +0 -74
  139. package/dist/components/OTPField/otpField.types.d.ts.map +0 -1
  140. package/dist/components/OTPField/otpField.variants.d.ts +0 -105
  141. package/dist/components/OTPField/otpField.variants.d.ts.map +0 -1
  142. package/dist/components/RadioGroup/RadioGroup.d.ts +0 -35
  143. package/dist/components/RadioGroup/RadioGroup.d.ts.map +0 -1
  144. package/dist/components/RadioGroup/radioGroup.types.d.ts +0 -103
  145. package/dist/components/RadioGroup/radioGroup.types.d.ts.map +0 -1
  146. package/dist/components/RadioGroup/radioGroup.variants.d.ts +0 -166
  147. package/dist/components/RadioGroup/radioGroup.variants.d.ts.map +0 -1
  148. package/dist/components/Snackbar/Snackbar.d.ts +0 -37
  149. package/dist/components/Snackbar/Snackbar.d.ts.map +0 -1
  150. package/dist/components/Snackbar/snackbar.types.d.ts +0 -86
  151. package/dist/components/Snackbar/snackbar.types.d.ts.map +0 -1
  152. package/dist/components/Snackbar/snackbar.variants.d.ts +0 -153
  153. package/dist/components/Snackbar/snackbar.variants.d.ts.map +0 -1
  154. package/dist/components/Switch/Switch.d.ts +0 -15
  155. package/dist/components/Switch/Switch.d.ts.map +0 -1
  156. package/dist/components/Switch/switch.types.d.ts +0 -47
  157. package/dist/components/Switch/switch.types.d.ts.map +0 -1
  158. package/dist/components/Switch/switch.variants.d.ts +0 -105
  159. package/dist/components/Switch/switch.variants.d.ts.map +0 -1
  160. package/dist/components/TextField/TextField.d.ts +0 -25
  161. package/dist/components/TextField/TextField.d.ts.map +0 -1
  162. package/dist/components/TextField/textField.types.d.ts +0 -72
  163. package/dist/components/TextField/textField.types.d.ts.map +0 -1
  164. package/dist/components/TextField/textField.variants.d.ts +0 -160
  165. package/dist/components/TextField/textField.variants.d.ts.map +0 -1
  166. package/dist/components/Textarea/Textarea.d.ts +0 -16
  167. package/dist/components/Textarea/Textarea.d.ts.map +0 -1
  168. package/dist/components/Textarea/textarea.types.d.ts +0 -63
  169. package/dist/components/Textarea/textarea.types.d.ts.map +0 -1
  170. package/dist/components/Textarea/textarea.variants.d.ts +0 -197
  171. package/dist/components/Textarea/textarea.variants.d.ts.map +0 -1
  172. package/dist/components/TopBar/TopBar.d.ts +0 -33
  173. package/dist/components/TopBar/TopBar.d.ts.map +0 -1
  174. package/dist/components/TopBar/topBar.types.d.ts +0 -49
  175. package/dist/components/TopBar/topBar.types.d.ts.map +0 -1
  176. package/dist/components/TopBar/topBar.variants.d.ts +0 -79
  177. package/dist/components/TopBar/topBar.variants.d.ts.map +0 -1
  178. package/dist/components/_shared/resolveValidationState.d.ts +0 -42
  179. package/dist/components/_shared/resolveValidationState.d.ts.map +0 -1
  180. package/dist/hooks/useAccessState.d.ts +0 -37
  181. package/dist/hooks/useAccessState.d.ts.map +0 -1
  182. package/dist/index.d.ts.map +0 -1
  183. package/dist/tsconfig.lib.tsbuildinfo +0 -1
  184. package/dist/utils/cn.d.ts +0 -26
  185. package/dist/utils/cn.d.ts.map +0 -1
@@ -1,165 +0,0 @@
1
- import { type VariantProps } from 'tailwind-variants';
2
- /**
3
- * Tailwind-variants recipe for `<DateTimePicker>` with 6 slots.
4
- *
5
- * Styling mirrors `<TextField>` for layout / sizes / error states so
6
- * the two field types compose visually in the same form.
7
- *
8
- * Native `<input type="date|time|datetime-local">` quirks handled here:
9
- *
10
- * - The browser-rendered placeholder mask (e.g., `mm/dd/yyyy`) is
11
- * invisible on `bg-neutral-50` by default in some themes; we keep
12
- * the same neutral palette and rely on the input's own contrast
13
- * rules (no extra `::placeholder` styling — browsers don't honor it
14
- * on these input types).
15
- * - The native picker indicator (calendar / clock icon) is
16
- * browser-supplied; we ensure it stays visible in dark mode via
17
- * `color-scheme: light dark` on the input (set inline below).
18
- */
19
- export declare const dateTimePickerVariants: import("tailwind-variants").TVReturnType<{
20
- size: {
21
- sm: {
22
- inputWrapper: string;
23
- input: string;
24
- };
25
- md: {
26
- inputWrapper: string;
27
- input: string;
28
- };
29
- lg: {
30
- inputWrapper: string;
31
- input: string;
32
- };
33
- };
34
- layout: {
35
- stacked: {
36
- root: string;
37
- };
38
- inline: {
39
- root: string;
40
- label: string;
41
- };
42
- };
43
- error: {
44
- true: {
45
- inputWrapper: string;
46
- };
47
- };
48
- fullWidth: {
49
- true: {
50
- root: string;
51
- inputWrapper: string;
52
- };
53
- };
54
- disabled: {
55
- true: {
56
- inputWrapper: string;
57
- };
58
- };
59
- }, {
60
- root: string;
61
- label: string;
62
- requiredMark: string;
63
- inputWrapper: string[];
64
- input: string[];
65
- helperText: string;
66
- errorText: string;
67
- }, undefined, {
68
- size: {
69
- sm: {
70
- inputWrapper: string;
71
- input: string;
72
- };
73
- md: {
74
- inputWrapper: string;
75
- input: string;
76
- };
77
- lg: {
78
- inputWrapper: string;
79
- input: string;
80
- };
81
- };
82
- layout: {
83
- stacked: {
84
- root: string;
85
- };
86
- inline: {
87
- root: string;
88
- label: string;
89
- };
90
- };
91
- error: {
92
- true: {
93
- inputWrapper: string;
94
- };
95
- };
96
- fullWidth: {
97
- true: {
98
- root: string;
99
- inputWrapper: string;
100
- };
101
- };
102
- disabled: {
103
- true: {
104
- inputWrapper: string;
105
- };
106
- };
107
- }, {
108
- root: string;
109
- label: string;
110
- requiredMark: string;
111
- inputWrapper: string[];
112
- input: string[];
113
- helperText: string;
114
- errorText: string;
115
- }, import("tailwind-variants").TVReturnType<{
116
- size: {
117
- sm: {
118
- inputWrapper: string;
119
- input: string;
120
- };
121
- md: {
122
- inputWrapper: string;
123
- input: string;
124
- };
125
- lg: {
126
- inputWrapper: string;
127
- input: string;
128
- };
129
- };
130
- layout: {
131
- stacked: {
132
- root: string;
133
- };
134
- inline: {
135
- root: string;
136
- label: string;
137
- };
138
- };
139
- error: {
140
- true: {
141
- inputWrapper: string;
142
- };
143
- };
144
- fullWidth: {
145
- true: {
146
- root: string;
147
- inputWrapper: string;
148
- };
149
- };
150
- disabled: {
151
- true: {
152
- inputWrapper: string;
153
- };
154
- };
155
- }, {
156
- root: string;
157
- label: string;
158
- requiredMark: string;
159
- inputWrapper: string[];
160
- input: string[];
161
- helperText: string;
162
- errorText: string;
163
- }, undefined, unknown, unknown, undefined>>;
164
- export type DateTimePickerVariants = VariantProps<typeof dateTimePickerVariants>;
165
- //# sourceMappingURL=dateTimePicker.variants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateTimePicker.variants.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker/dateTimePicker.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA8DjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,34 +0,0 @@
1
- import type { LeftNavProps } from './leftNav.types.js';
2
- /**
3
- * Dashforge TW LeftNav — router-agnostic sidebar navigation.
4
- *
5
- * Pure presentational. The consumer wires `activeId` from the current
6
- * route. Each row renders as a real `<a>` (with `href`) or a `<button>`
7
- * (with `onSelect`); `linkComponent` swaps in a router-aware link
8
- * component for SPA navigation.
9
- *
10
- * Modes:
11
- * - **Expanded** (`collapsed={false}`): full-width with labels +
12
- * badges + group children visible.
13
- * - **Rail** (`collapsed={true}`): 56px wide, icons only, labels
14
- * hidden from sighted users (still announced to screen readers via
15
- * `sr-only`). Group children are hidden — clicking the group
16
- * header is a no-op visually in rail mode (consumer is expected
17
- * to either expand the nav or surface a flyout in a follow-up).
18
- *
19
- * **A11y**:
20
- * - `<nav aria-label="…">` landmark.
21
- * - `aria-current="page"` on the active row.
22
- * - Groups expose `aria-expanded` / `aria-controls` and the children
23
- * wrapper is `role="region" aria-labelledby="…-header"`.
24
- * - Rail-mode tooltips via the native `title` attribute (preserves
25
- * hover discoverability when labels are visually hidden).
26
- *
27
- * **Re-render contract**:
28
- * - Rows are extracted into stable sub-components so a single
29
- * `activeId` change re-renders all rows but each does only its
30
- * own `useAccessState` lookup; this is the price of per-row RBAC.
31
- * - Group expand/collapse re-renders ONLY that group (local state).
32
- */
33
- export declare function LeftNav(props: LeftNavProps): import("react/jsx-runtime").JSX.Element;
34
- //# sourceMappingURL=LeftNav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LeftNav.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/LeftNav.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,YAAY,EACb,MAAM,oBAAoB,CAAC;AA+M5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAkF1C"}
@@ -1,136 +0,0 @@
1
- import type { ReactNode, ComponentType, AnchorHTMLAttributes, Ref } from 'react';
2
- import type { AccessRequirement } from '@dashforge/rbac';
3
- import type { LeftNavVariants } from './leftNav.variants.js';
4
- /**
5
- * One row in the LeftNav. May be either a clickable item OR a group
6
- * (a header that owns nested children, optionally collapsible).
7
- */
8
- export type LeftNavNode = LeftNavItem | LeftNavGroup;
9
- export interface LeftNavItem {
10
- kind?: 'item';
11
- /** Stable id used for `activeId` matching + React keys. */
12
- id: string;
13
- label: ReactNode;
14
- icon?: ReactNode;
15
- /**
16
- * Destination for navigation. Omit for a pure-callback item (use
17
- * `onSelect`).
18
- */
19
- href?: string;
20
- /** Fired when the row is clicked (in addition to navigation). */
21
- onSelect?: () => void;
22
- /** Optional pill / counter rendered to the right of the label. */
23
- badge?: ReactNode;
24
- /** Per-item disabled flag. */
25
- disabled?: boolean;
26
- /** RBAC access requirement — hides / disables the row. */
27
- access?: AccessRequirement;
28
- }
29
- export interface LeftNavGroup {
30
- kind: 'group';
31
- id: string;
32
- label: ReactNode;
33
- icon?: ReactNode;
34
- children: LeftNavItem[];
35
- /**
36
- * Initial expanded state when used in uncontrolled mode. Default
37
- * `true` (groups open by default — most app navs want immediate
38
- * visibility).
39
- */
40
- defaultExpanded?: boolean;
41
- /** Controlled expanded state. Provide `onExpandedChange` to update. */
42
- expanded?: boolean;
43
- /** RBAC access requirement — hides / disables the whole group. */
44
- access?: AccessRequirement;
45
- }
46
- /**
47
- * Polymorphic link component prop. Defaults to `<a>`. Pass a
48
- * router-aware component (react-router `Link`, Next `Link`) for SPA
49
- * navigation.
50
- */
51
- export type LeftNavLinkComponent = ComponentType<AnchorHTMLAttributes<HTMLAnchorElement> & {
52
- ref?: Ref<HTMLAnchorElement>;
53
- }>;
54
- export interface LeftNavSlotProps {
55
- root?: {
56
- className?: string;
57
- };
58
- brand?: {
59
- className?: string;
60
- };
61
- list?: {
62
- className?: string;
63
- };
64
- item?: {
65
- className?: string;
66
- };
67
- itemLink?: {
68
- className?: string;
69
- };
70
- itemActive?: {
71
- className?: string;
72
- };
73
- itemIcon?: {
74
- className?: string;
75
- };
76
- itemLabel?: {
77
- className?: string;
78
- };
79
- itemBadge?: {
80
- className?: string;
81
- };
82
- group?: {
83
- className?: string;
84
- };
85
- groupHeader?: {
86
- className?: string;
87
- };
88
- groupChildren?: {
89
- className?: string;
90
- };
91
- footer?: {
92
- className?: string;
93
- };
94
- collapseToggle?: {
95
- className?: string;
96
- };
97
- }
98
- /**
99
- * Props for `<LeftNav>`.
100
- *
101
- * Router-agnostic sidebar navigation. The consumer drives the active
102
- * item via `activeId` (typically derived from the current route).
103
- *
104
- * Rail / drawer responsive behaviour is handled by `<AppShell>`; this
105
- * component renders the actual nav content and exposes a `collapsed`
106
- * prop for the icon-only "rail" rendering.
107
- */
108
- export interface LeftNavProps extends LeftNavVariants {
109
- items: LeftNavNode[];
110
- /** Currently-active item id (highlight + `aria-current="page"`). */
111
- activeId?: string;
112
- /**
113
- * Icon-only rail mode. When `true`, labels and group children are
114
- * visually hidden (kept for screen readers via `sr-only`).
115
- */
116
- collapsed?: boolean;
117
- /** Fired when the user clicks the collapse-toggle button. */
118
- onCollapseChange?: (collapsed: boolean) => void;
119
- /** Fired when a group's expanded state changes (controlled or not). */
120
- onGroupExpandedChange?: (groupId: string, expanded: boolean) => void;
121
- /** Brand / logo node rendered at the top. */
122
- brand?: ReactNode;
123
- /** Footer node (e.g., user badge). */
124
- footer?: ReactNode;
125
- /** Override the link component. @default 'a' */
126
- linkComponent?: LeftNavLinkComponent;
127
- /** Visible label of the nav landmark. @default 'Main navigation' */
128
- ariaLabel?: string;
129
- /** Root className shortcut. */
130
- sx?: string;
131
- /** Per-slot className overrides. */
132
- slotProps?: LeftNavSlotProps;
133
- /** Show / hide the collapse toggle button. @default true */
134
- showCollapseToggle?: boolean;
135
- }
136
- //# sourceMappingURL=leftNav.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leftNav.types.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/leftNav.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,GAAG,EACJ,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,i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AE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sCAAsC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gDAAgD;IAChD,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
@@ -1,143 +0,0 @@
1
- import { type VariantProps } from 'tailwind-variants';
2
- /**
3
- * Tailwind-variants recipe for `<LeftNav>`.
4
- *
5
- * Slots:
6
- * - `root` — `<nav>` landmark
7
- * - `brand` — top brand/logo wrapper
8
- * - `list` — `<ul>` containing items & groups
9
- * - `item` — `<li>` wrapper
10
- * - `itemLink` — clickable row (`<a>` or `<button>`)
11
- * - `itemActive` — active state on the row
12
- * - `itemIcon` — icon slot inside a row
13
- * - `itemLabel` — text label slot
14
- * - `itemBadge` — right-aligned pill
15
- * - `group` — wrapper around a group header + children
16
- * - `groupHeader` — clickable header row (`<button>`)
17
- * - `groupChildren` — `<ul>` containing the group's items
18
- * - `footer` — bottom slot (user badge, etc.)
19
- * - `collapseToggle` — rail-mode toggle button
20
- */
21
- export declare const leftNavVariants: import("tailwind-variants").TVReturnType<{
22
- width: {
23
- sm: {
24
- root: string;
25
- };
26
- md: {
27
- root: string;
28
- };
29
- lg: {
30
- root: string;
31
- };
32
- };
33
- collapsed: {
34
- true: {
35
- root: string;
36
- brand: string;
37
- list: string;
38
- itemLink: string;
39
- itemLabel: string;
40
- itemBadge: string;
41
- groupHeader: string;
42
- groupChildren: string;
43
- footer: string;
44
- };
45
- };
46
- }, {
47
- root: string[];
48
- brand: string[];
49
- list: string;
50
- item: string;
51
- itemLink: string[];
52
- itemActive: string;
53
- itemIcon: string;
54
- itemLabel: string;
55
- itemBadge: string[];
56
- group: string;
57
- groupHeader: string[];
58
- groupChildren: string;
59
- footer: string[];
60
- collapseToggle: string[];
61
- }, undefined, {
62
- width: {
63
- sm: {
64
- root: string;
65
- };
66
- md: {
67
- root: string;
68
- };
69
- lg: {
70
- root: string;
71
- };
72
- };
73
- collapsed: {
74
- true: {
75
- root: string;
76
- brand: string;
77
- list: string;
78
- itemLink: string;
79
- itemLabel: string;
80
- itemBadge: string;
81
- groupHeader: string;
82
- groupChildren: string;
83
- footer: string;
84
- };
85
- };
86
- }, {
87
- root: string[];
88
- brand: string[];
89
- list: string;
90
- item: string;
91
- itemLink: string[];
92
- itemActive: string;
93
- itemIcon: string;
94
- itemLabel: string;
95
- itemBadge: string[];
96
- group: string;
97
- groupHeader: string[];
98
- groupChildren: string;
99
- footer: string[];
100
- collapseToggle: string[];
101
- }, import("tailwind-variants").TVReturnType<{
102
- width: {
103
- sm: {
104
- root: string;
105
- };
106
- md: {
107
- root: string;
108
- };
109
- lg: {
110
- root: string;
111
- };
112
- };
113
- collapsed: {
114
- true: {
115
- root: string;
116
- brand: string;
117
- list: string;
118
- itemLink: string;
119
- itemLabel: string;
120
- itemBadge: string;
121
- groupHeader: string;
122
- groupChildren: string;
123
- footer: string;
124
- };
125
- };
126
- }, {
127
- root: string[];
128
- brand: string[];
129
- list: string;
130
- item: string;
131
- itemLink: string[];
132
- itemActive: string;
133
- itemIcon: string;
134
- itemLabel: string;
135
- itemBadge: string[];
136
- group: string;
137
- groupHeader: string[];
138
- groupChildren: string;
139
- footer: string[];
140
- collapseToggle: string[];
141
- }, undefined, unknown, unknown, undefined>>;
142
- export type LeftNavVariants = VariantProps<typeof leftNavVariants>;
143
- //# sourceMappingURL=leftNav.variants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leftNav.variants.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/leftNav.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwE1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { NumberFieldProps } from './numberField.types.js';
2
- /**
3
- * Dashforge TW NumberField — bridge-integrated numeric input.
4
- *
5
- * Mirrors `@dashforge/ui/NumberField` semantics: storage type is
6
- * `number | null`, NaN is never written, `Number.isFinite` is the guard.
7
- * Renders a native `<input type="number">` with an OPTIONAL +/− stepper
8
- * (opt-in via `showStepper`). The native browser spinner is suppressed
9
- * in CSS so visual consistency is preserved cross-browser.
10
- *
11
- * **A11y**:
12
- * - `aria-invalid` from resolved validation state
13
- * - `aria-describedby` links the input to the helper/error text
14
- * - `min` / `max` / `step` forwarded to the native input (which exposes
15
- * `aria-valuemin` / `aria-valuemax` automatically)
16
- */
17
- export declare function NumberField(props: NumberFieldProps): import("react/jsx-runtime").JSX.Element | null;
18
- //# sourceMappingURL=NumberField.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAuC/D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kDAsOlD"}
@@ -1,79 +0,0 @@
1
- import type { ChangeEventHandler, FocusEventHandler, InputHTMLAttributes, ReactNode } from 'react';
2
- import type { Engine } from '@dashforge/ui-core';
3
- import type { AccessRequirement } from '@dashforge/rbac';
4
- import type { NumberFieldVariants } from './numberField.variants.js';
5
- export interface NumberFieldSlotProps {
6
- root?: {
7
- className?: string;
8
- };
9
- label?: {
10
- className?: string;
11
- };
12
- requiredMark?: {
13
- className?: string;
14
- };
15
- inputWrapper?: {
16
- className?: string;
17
- };
18
- input?: {
19
- className?: string;
20
- };
21
- stepper?: {
22
- className?: string;
23
- };
24
- stepperButton?: {
25
- className?: string;
26
- };
27
- helperText?: {
28
- className?: string;
29
- };
30
- errorText?: {
31
- className?: string;
32
- };
33
- }
34
- /**
35
- * Props for `<NumberField>`.
36
- *
37
- * Value contract (mirrors `@dashforge/ui/NumberField`):
38
- * - Bridge storage type: `number | null` (NEVER `NaN`).
39
- * - UI display: `number → String(number)`, `null/undefined → ""`.
40
- * - On user input:
41
- * - empty string → `setValue(name, null)`
42
- * - parseable number → `setValue(name, parsed)`
43
- * - non-numeric input → no bridge write (UI string is kept as-is for UX,
44
- * but the bridge stays at the last valid value)
45
- * - Parsing uses `Number(...)` + `Number.isFinite(...)`. No locale parsing.
46
- */
47
- export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'name' | 'type' | 'size' | 'onChange' | 'onBlur' | 'value' | 'defaultValue'>, NumberFieldVariants {
48
- name: string;
49
- rules?: unknown;
50
- label?: ReactNode;
51
- helperText?: ReactNode;
52
- required?: boolean;
53
- error?: boolean;
54
- disabled?: boolean;
55
- /** Engine predicate — field not rendered when it returns `false`. */
56
- visibleWhen?: (engine: Engine) => boolean;
57
- /** RBAC access requirement (combines with explicit `disabled`). */
58
- access?: AccessRequirement;
59
- /** Root className shortcut (`cn`'d with the variant root class). */
60
- sx?: string;
61
- /** Per-slot className overrides. */
62
- slotProps?: NumberFieldSlotProps;
63
- /** Controlled value (form mode reads from the bridge if omitted). */
64
- value?: number | string | null;
65
- /** Default value (uncontrolled, standalone mode only). */
66
- defaultValue?: number | string | null;
67
- /** Min allowed value (passed to the input + clamps stepper). */
68
- min?: number;
69
- /** Max allowed value (passed to the input + clamps stepper). */
70
- max?: number;
71
- /** Stepper step size. Default 1. */
72
- step?: number;
73
- /** Show inline +/− stepper buttons inside the input wrapper. Default false. */
74
- showStepper?: boolean;
75
- /** Change handler — receives the native event; consume value via bridge. */
76
- onChange?: ChangeEventHandler<HTMLInputElement>;
77
- onBlur?: FocusEventHandler<HTMLInputElement>;
78
- }
79
- //# sourceMappingURL=numberField.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numberField.types.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/numberField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,aAAa,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,UAAU,CAAC,EAAE;QAA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