@simplysm/solid 13.0.77 → 13.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -217
- package/dist/components/data/Pagination.js +2 -2
- package/dist/components/data/Pagination.js.map +2 -2
- package/dist/components/data/Table.js +2 -2
- package/dist/components/data/Table.js.map +2 -2
- package/dist/components/data/calendar/Calendar.js +2 -2
- package/dist/components/data/calendar/Calendar.js.map +2 -2
- package/dist/components/data/kanban/Kanban.js +3 -3
- package/dist/components/data/kanban/Kanban.js.map +2 -2
- package/dist/components/data/list/ListItem.js +1 -1
- package/dist/components/data/list/ListItem.js.map +1 -1
- package/dist/components/data/list/ListItem.styles.js +1 -1
- package/dist/components/data/list/ListItem.styles.js.map +1 -1
- package/dist/components/data/sheet/DataSheet.js +16 -16
- package/dist/components/data/sheet/DataSheet.js.map +2 -2
- package/dist/components/data/sheet/DataSheet.styles.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.styles.js +2 -2
- package/dist/components/data/sheet/DataSheet.styles.js.map +1 -1
- package/dist/components/data/sheet/DataSheetConfigDialog.js +5 -5
- package/dist/components/data/sheet/DataSheetConfigDialog.js.map +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetExpansion.d.ts → createDataSheetExpansion.d.ts} +4 -4
- package/dist/components/data/sheet/hooks/createDataSheetExpansion.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetExpansion.js → createDataSheetExpansion.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetExpansion.js.map → createDataSheetExpansion.js.map} +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetFixedColumns.d.ts → createDataSheetFixedColumns.d.ts} +3 -3
- package/dist/components/data/sheet/hooks/createDataSheetFixedColumns.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetFixedColumns.js → createDataSheetFixedColumns.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetFixedColumns.js.map → createDataSheetFixedColumns.js.map} +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetHeaderCell.d.ts → createDataSheetHeaderCell.d.ts} +3 -3
- package/dist/components/data/sheet/hooks/createDataSheetHeaderCell.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetHeaderCell.js → createDataSheetHeaderCell.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetHeaderCell.js.map → createDataSheetHeaderCell.js.map} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetPaging.d.ts → createDataSheetPaging.d.ts} +4 -4
- package/dist/components/data/sheet/hooks/createDataSheetPaging.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetPaging.js → createDataSheetPaging.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetPaging.js.map → createDataSheetPaging.js.map} +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetReorder.d.ts → createDataSheetReorder.d.ts} +3 -3
- package/dist/components/data/sheet/hooks/createDataSheetReorder.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetReorder.js → createDataSheetReorder.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetReorder.js.map → createDataSheetReorder.js.map} +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetSelection.d.ts → createDataSheetSelection.d.ts} +4 -4
- package/dist/components/data/sheet/hooks/createDataSheetSelection.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetSelection.js → createDataSheetSelection.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetSelection.js.map → createDataSheetSelection.js.map} +2 -2
- package/dist/components/data/sheet/hooks/{useDataSheetSorting.d.ts → createDataSheetSorting.d.ts} +4 -4
- package/dist/components/data/sheet/hooks/createDataSheetSorting.d.ts.map +1 -0
- package/dist/components/data/sheet/hooks/{useDataSheetSorting.js → createDataSheetSorting.js} +3 -3
- package/dist/components/data/sheet/hooks/{useDataSheetSorting.js.map → createDataSheetSorting.js.map} +2 -2
- package/dist/components/disclosure/Dialog.d.ts +2 -2
- package/dist/components/disclosure/Dialog.d.ts.map +1 -1
- package/dist/components/disclosure/Dialog.js +4 -4
- package/dist/components/disclosure/Dialog.js.map +2 -2
- package/dist/components/disclosure/Tabs.js +3 -3
- package/dist/components/disclosure/Tabs.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.js +3 -3
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/data-select-button/DataSelectButton.d.ts +23 -9
- package/dist/components/features/data-select-button/DataSelectButton.d.ts.map +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.js +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.js.map +1 -1
- package/dist/components/features/permission-table/PermissionTable.js +2 -2
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelect.d.ts +23 -9
- package/dist/components/features/shared-data/SharedDataSelect.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelect.js.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts +25 -10
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectButton.js.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js.map +2 -2
- package/dist/components/feedback/Progress.d.ts +1 -1
- package/dist/components/feedback/Progress.d.ts.map +1 -1
- package/dist/components/feedback/Progress.js +3 -3
- package/dist/components/feedback/Progress.js.map +2 -2
- package/dist/components/form-control/Button.js +2 -2
- package/dist/components/form-control/Button.js.map +2 -2
- package/dist/components/form-control/DropdownTrigger.styles.js +2 -2
- package/dist/components/form-control/DropdownTrigger.styles.js.map +1 -1
- package/dist/components/form-control/ThemeToggle.js +4 -4
- package/dist/components/form-control/ThemeToggle.js.map +2 -2
- package/dist/components/form-control/checkbox/Checkbox.d.ts +3 -3
- package/dist/components/form-control/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/Checkbox.styles.js +3 -3
- package/dist/components/form-control/checkbox/Checkbox.styles.js.map +1 -1
- package/dist/components/form-control/checkbox/CheckboxGroup.js +2 -2
- package/dist/components/form-control/checkbox/CheckboxGroup.js.map +2 -2
- package/dist/components/form-control/checkbox/Radio.d.ts +3 -3
- package/dist/components/form-control/checkbox/Radio.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/RadioGroup.js +2 -2
- package/dist/components/form-control/checkbox/RadioGroup.js.map +2 -2
- package/dist/components/form-control/checkbox/SelectableBase.d.ts +3 -3
- package/dist/components/form-control/checkbox/SelectableBase.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/SelectableBase.js +10 -10
- package/dist/components/form-control/checkbox/SelectableBase.js.map +2 -2
- package/dist/components/form-control/color-picker/ColorPicker.js +2 -2
- package/dist/components/form-control/color-picker/ColorPicker.js.map +2 -2
- package/dist/components/form-control/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/form-control/date-range-picker/DateRangePicker.js.map +2 -2
- package/dist/components/form-control/editor/EditorToolbar.js +1 -1
- package/dist/components/form-control/editor/EditorToolbar.js.map +2 -2
- package/dist/components/form-control/editor/RichTextEditor.js +2 -2
- package/dist/components/form-control/editor/RichTextEditor.js.map +2 -2
- package/dist/components/form-control/field/Field.styles.js +7 -7
- package/dist/components/form-control/field/Field.styles.js.map +1 -1
- package/dist/components/form-control/field/NumberInput.js +1 -1
- package/dist/components/form-control/field/NumberInput.js.map +1 -1
- package/dist/components/form-control/field/TextInput.js +1 -1
- package/dist/components/form-control/field/TextInput.js.map +1 -1
- package/dist/components/form-control/field/Textarea.js +1 -1
- package/dist/components/form-control/field/Textarea.js.map +1 -1
- package/dist/components/form-control/numpad/Numpad.d.ts +2 -2
- package/dist/components/form-control/numpad/Numpad.d.ts.map +1 -1
- package/dist/components/form-control/numpad/Numpad.js +4 -4
- package/dist/components/form-control/numpad/Numpad.js.map +2 -2
- package/dist/components/form-control/select/Select.js +1 -1
- package/dist/components/form-control/select/Select.js.map +2 -2
- package/dist/components/form-control/state-preset/StatePreset.js +8 -8
- package/dist/components/form-control/state-preset/StatePreset.js.map +2 -2
- package/dist/components/layout/topbar/Topbar.js +3 -3
- package/dist/components/layout/topbar/Topbar.js.map +2 -2
- package/dist/providers/PwaUpdateProvider.d.ts.map +1 -1
- package/dist/providers/PwaUpdateProvider.js +11 -4
- package/dist/providers/PwaUpdateProvider.js.map +2 -2
- package/dist/styles/control.styles.d.ts +3 -3
- package/dist/styles/control.styles.d.ts.map +1 -1
- package/dist/styles/control.styles.js +2 -2
- package/dist/styles/control.styles.js.map +1 -1
- package/docs/data.md +204 -0
- package/docs/disclosure.md +139 -0
- package/docs/display.md +125 -0
- package/docs/features.md +282 -0
- package/docs/feedback.md +136 -0
- package/docs/form-controls.md +520 -0
- package/docs/helpers.md +172 -0
- package/docs/hooks.md +146 -0
- package/docs/layout.md +94 -0
- package/docs/providers.md +179 -0
- package/package.json +19 -18
- package/src/components/data/Pagination.tsx +2 -2
- package/src/components/data/Table.tsx +2 -2
- package/src/components/data/calendar/Calendar.tsx +2 -2
- package/src/components/data/kanban/Kanban.tsx +2 -2
- package/src/components/data/list/ListItem.styles.ts +1 -1
- package/src/components/data/list/ListItem.tsx +1 -1
- package/src/components/data/sheet/DataSheet.styles.ts +2 -2
- package/src/components/data/sheet/DataSheet.tsx +16 -16
- package/src/components/data/sheet/DataSheetConfigDialog.tsx +5 -5
- package/src/components/data/sheet/hooks/{useDataSheetExpansion.ts → createDataSheetExpansion.ts} +5 -5
- package/src/components/data/sheet/hooks/{useDataSheetFixedColumns.ts → createDataSheetFixedColumns.ts} +3 -3
- package/src/components/data/sheet/hooks/{useDataSheetHeaderCell.tsx → createDataSheetHeaderCell.tsx} +2 -2
- package/src/components/data/sheet/hooks/{useDataSheetPaging.ts → createDataSheetPaging.ts} +5 -5
- package/src/components/data/sheet/hooks/{useDataSheetReorder.ts → createDataSheetReorder.ts} +3 -3
- package/src/components/data/sheet/hooks/{useDataSheetSelection.ts → createDataSheetSelection.ts} +5 -5
- package/src/components/data/sheet/hooks/{useDataSheetSorting.ts → createDataSheetSorting.ts} +5 -5
- package/src/components/disclosure/Dialog.tsx +5 -5
- package/src/components/disclosure/Tabs.tsx +3 -3
- package/src/components/features/crud-sheet/CrudSheet.tsx +3 -3
- package/src/components/features/data-select-button/DataSelectButton.tsx +42 -11
- package/src/components/features/permission-table/PermissionTable.tsx +2 -2
- package/src/components/features/shared-data/SharedDataSelect.tsx +45 -14
- package/src/components/features/shared-data/SharedDataSelectButton.tsx +38 -11
- package/src/components/features/shared-data/SharedDataSelectList.tsx +1 -1
- package/src/components/feedback/Progress.tsx +4 -4
- package/src/components/form-control/Button.tsx +2 -2
- package/src/components/form-control/DropdownTrigger.styles.ts +2 -2
- package/src/components/form-control/ThemeToggle.tsx +4 -4
- package/src/components/form-control/checkbox/Checkbox.styles.ts +3 -3
- package/src/components/form-control/checkbox/Checkbox.tsx +3 -3
- package/src/components/form-control/checkbox/CheckboxGroup.tsx +2 -2
- package/src/components/form-control/checkbox/Radio.tsx +3 -3
- package/src/components/form-control/checkbox/RadioGroup.tsx +2 -2
- package/src/components/form-control/checkbox/SelectableBase.tsx +15 -15
- package/src/components/form-control/color-picker/ColorPicker.tsx +2 -2
- package/src/components/form-control/date-range-picker/DateRangePicker.tsx +1 -1
- package/src/components/form-control/editor/EditorToolbar.tsx +1 -1
- package/src/components/form-control/editor/RichTextEditor.tsx +2 -2
- package/src/components/form-control/field/Field.styles.ts +7 -7
- package/src/components/form-control/field/NumberInput.tsx +1 -1
- package/src/components/form-control/field/TextInput.tsx +1 -1
- package/src/components/form-control/field/Textarea.tsx +1 -1
- package/src/components/form-control/numpad/Numpad.tsx +6 -6
- package/src/components/form-control/select/Select.tsx +1 -1
- package/src/components/form-control/state-preset/StatePreset.tsx +9 -9
- package/src/components/layout/topbar/Topbar.tsx +3 -3
- package/src/providers/PwaUpdateProvider.tsx +12 -5
- package/src/styles/control.styles.ts +3 -3
- package/tests/components/data/sheet/hooks/{useDataSheetExpansion.spec.ts → createDataSheetExpansion.spec.ts} +16 -16
- package/tests/components/data/sheet/hooks/{useDataSheetFixedColumns.spec.ts → createDataSheetFixedColumns.spec.ts} +27 -27
- package/tests/components/data/sheet/hooks/{useDataSheetPaging.spec.ts → createDataSheetPaging.spec.ts} +16 -16
- package/tests/components/data/sheet/hooks/{useDataSheetReorder.spec.ts → createDataSheetReorder.spec.ts} +14 -14
- package/tests/components/data/sheet/hooks/{useDataSheetSelection.spec.ts → createDataSheetSelection.spec.ts} +26 -26
- package/tests/components/data/sheet/hooks/{useDataSheetSorting.spec.ts → createDataSheetSorting.spec.ts} +13 -13
- package/tests/components/disclosure/Dialog.spec.tsx +2 -2
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +55 -6
- package/tests/components/features/shared-data/SharedDataSelect.spec.tsx +40 -0
- package/tests/components/form-control/checkbox/Checkbox.spec.tsx +8 -8
- package/tests/components/form-control/checkbox/Radio.spec.tsx +9 -9
- package/tests/components/form-control/numpad/Numpad.spec.tsx +10 -10
- package/dist/components/data/sheet/hooks/useDataSheetExpansion.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetFixedColumns.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetHeaderCell.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetPaging.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetReorder.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetSelection.d.ts.map +0 -1
- package/dist/components/data/sheet/hooks/useDataSheetSorting.d.ts.map +0 -1
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
# Form Controls
|
|
2
|
+
|
|
3
|
+
## Button
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
theme?: "base" | "primary" | "success" | "warning" | "danger" | "danger-light" | "neutral";
|
|
8
|
+
variant?: "solid" | "outline" | "ghost";
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Standard button with semantic themes and visual variants.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## TextInput
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
interface TextInputProps {
|
|
22
|
+
value?: string;
|
|
23
|
+
onValueChange?: (value: string) => void;
|
|
24
|
+
type?: "text" | "password" | "email";
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
autocomplete?: JSX.HTMLAutocomplete;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
31
|
+
inset?: boolean;
|
|
32
|
+
format?: string;
|
|
33
|
+
required?: boolean;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
pattern?: string | RegExp;
|
|
37
|
+
validate?: (value: string) => string | undefined;
|
|
38
|
+
lazyValidation?: boolean;
|
|
39
|
+
class?: string;
|
|
40
|
+
style?: JSX.CSSProperties;
|
|
41
|
+
children?: JSX.Element;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Single-line text input with format masking and validation. Use `format` for input masks (e.g. `"XXX-XXXX-XXXX"`).
|
|
46
|
+
|
|
47
|
+
**Sub-component:** `TextInput.Prefix` — renders content before the input.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## NumberInput
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
interface NumberInputProps {
|
|
55
|
+
value?: number;
|
|
56
|
+
onValueChange?: (value: number | undefined) => void;
|
|
57
|
+
useGrouping?: boolean;
|
|
58
|
+
minimumFractionDigits?: number;
|
|
59
|
+
placeholder?: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
readOnly?: boolean;
|
|
63
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
64
|
+
inset?: boolean;
|
|
65
|
+
required?: boolean;
|
|
66
|
+
min?: number;
|
|
67
|
+
max?: number;
|
|
68
|
+
validate?: (value: number | undefined) => string | undefined;
|
|
69
|
+
lazyValidation?: boolean;
|
|
70
|
+
class?: string;
|
|
71
|
+
style?: JSX.CSSProperties;
|
|
72
|
+
children?: JSX.Element;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Numeric input with locale-aware formatting. `useGrouping` enables thousands separators (default: `true`).
|
|
77
|
+
|
|
78
|
+
**Sub-component:** `NumberInput.Prefix` — renders content before the input.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## DatePicker
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
interface DatePickerProps {
|
|
86
|
+
value?: DateOnly;
|
|
87
|
+
onValueChange?: (value: DateOnly | undefined) => void;
|
|
88
|
+
unit?: "year" | "month" | "date";
|
|
89
|
+
min?: DateOnly;
|
|
90
|
+
max?: DateOnly;
|
|
91
|
+
title?: string;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
readOnly?: boolean;
|
|
94
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
95
|
+
inset?: boolean;
|
|
96
|
+
required?: boolean;
|
|
97
|
+
validate?: (value: DateOnly | undefined) => string | undefined;
|
|
98
|
+
lazyValidation?: boolean;
|
|
99
|
+
class?: string;
|
|
100
|
+
style?: JSX.CSSProperties;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Date picker with calendar dropdown. `unit` controls the selection granularity (default: `"date"`).
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## DateTimePicker
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
interface DateTimePickerProps {
|
|
112
|
+
value?: DateTime;
|
|
113
|
+
onValueChange?: (value: DateTime | undefined) => void;
|
|
114
|
+
unit?: "minute" | "second";
|
|
115
|
+
min?: DateTime;
|
|
116
|
+
max?: DateTime;
|
|
117
|
+
title?: string;
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
readOnly?: boolean;
|
|
120
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
121
|
+
inset?: boolean;
|
|
122
|
+
required?: boolean;
|
|
123
|
+
validate?: (value: DateTime | undefined) => string | undefined;
|
|
124
|
+
lazyValidation?: boolean;
|
|
125
|
+
class?: string;
|
|
126
|
+
style?: JSX.CSSProperties;
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Combined date and time picker. `unit` controls time precision (default: `"minute"`).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## TimePicker
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
interface TimePickerProps {
|
|
138
|
+
value?: Time;
|
|
139
|
+
onValueChange?: (value: Time | undefined) => void;
|
|
140
|
+
unit?: "minute" | "second";
|
|
141
|
+
title?: string;
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
readOnly?: boolean;
|
|
144
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
145
|
+
inset?: boolean;
|
|
146
|
+
min?: Time;
|
|
147
|
+
max?: Time;
|
|
148
|
+
required?: boolean;
|
|
149
|
+
validate?: (value: Time | undefined) => string | undefined;
|
|
150
|
+
lazyValidation?: boolean;
|
|
151
|
+
class?: string;
|
|
152
|
+
style?: JSX.CSSProperties;
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Time-only picker. `unit` controls precision (default: `"minute"`).
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Textarea
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
interface TextareaProps {
|
|
164
|
+
value?: string;
|
|
165
|
+
onValueChange?: (value: string) => void;
|
|
166
|
+
placeholder?: string;
|
|
167
|
+
title?: string;
|
|
168
|
+
disabled?: boolean;
|
|
169
|
+
readOnly?: boolean;
|
|
170
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
171
|
+
inset?: boolean;
|
|
172
|
+
minRows?: number;
|
|
173
|
+
required?: boolean;
|
|
174
|
+
minLength?: number;
|
|
175
|
+
maxLength?: number;
|
|
176
|
+
validate?: (value: string) => string | undefined;
|
|
177
|
+
lazyValidation?: boolean;
|
|
178
|
+
class?: string;
|
|
179
|
+
style?: JSX.CSSProperties;
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Auto-resizing multi-line text input. `minRows` sets the minimum height (default: `1`).
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Select
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
// Single select
|
|
191
|
+
interface SelectSingleProps<TValue> {
|
|
192
|
+
multiple?: false;
|
|
193
|
+
value?: TValue;
|
|
194
|
+
onValueChange?: (value: TValue | undefined) => void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Multiple select
|
|
198
|
+
interface SelectMultipleProps<TValue> {
|
|
199
|
+
multiple: true;
|
|
200
|
+
value?: TValue[];
|
|
201
|
+
onValueChange?: (value: TValue[]) => void;
|
|
202
|
+
tagDirection?: "horizontal" | "vertical";
|
|
203
|
+
hideSelectAll?: boolean;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Common props
|
|
207
|
+
interface SelectCommonProps<TValue> {
|
|
208
|
+
items?: TValue[];
|
|
209
|
+
itemChildren?: (item: TValue, index: number, depth: number) => TValue[] | undefined;
|
|
210
|
+
renderValue?: (value: TValue) => JSX.Element;
|
|
211
|
+
itemSearchText?: (item: TValue) => string;
|
|
212
|
+
isItemHidden?: (item: TValue) => boolean;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
required?: boolean;
|
|
215
|
+
placeholder?: string;
|
|
216
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
217
|
+
inset?: boolean;
|
|
218
|
+
validate?: (value: unknown) => string | undefined;
|
|
219
|
+
lazyValidation?: boolean;
|
|
220
|
+
class?: string;
|
|
221
|
+
style?: JSX.CSSProperties;
|
|
222
|
+
children?: JSX.Element;
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Dropdown select with single or multiple selection modes. Supports two usage patterns:
|
|
227
|
+
|
|
228
|
+
1. **Items mode:** pass `items` array for automatic rendering.
|
|
229
|
+
2. **Children mode:** use `Select.Item` sub-components for declarative composition.
|
|
230
|
+
|
|
231
|
+
Providing `itemSearchText` enables a built-in search input. `itemChildren` enables tree-structured items.
|
|
232
|
+
|
|
233
|
+
**Sub-components:**
|
|
234
|
+
- `Select.Item` — selectable option (`{ value: TValue; disabled?: boolean }`)
|
|
235
|
+
- `Select.Header` — non-selectable header row
|
|
236
|
+
- `Select.Action` — non-selectable action row
|
|
237
|
+
- `Select.ItemTemplate` — custom item renderer
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Combobox
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
interface ComboboxProps<TValue> {
|
|
245
|
+
value?: TValue;
|
|
246
|
+
onValueChange?: (value: TValue) => void;
|
|
247
|
+
loadItems: (query: string) => TValue[] | Promise<TValue[]>;
|
|
248
|
+
renderValue: (value: TValue) => JSX.Element;
|
|
249
|
+
debounceMs?: number;
|
|
250
|
+
allowsCustomValue?: boolean;
|
|
251
|
+
parseCustomValue?: (text: string) => TValue;
|
|
252
|
+
disabled?: boolean;
|
|
253
|
+
required?: boolean;
|
|
254
|
+
validate?: (value: TValue | undefined) => string | undefined;
|
|
255
|
+
lazyValidation?: boolean;
|
|
256
|
+
placeholder?: string;
|
|
257
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
258
|
+
inset?: boolean;
|
|
259
|
+
class?: string;
|
|
260
|
+
style?: JSX.CSSProperties;
|
|
261
|
+
children?: JSX.Element;
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Autocomplete input with async item loading. `loadItems` is called with the current query string. `debounceMs` controls the debounce delay (default: `300`). Set `allowsCustomValue` to accept free-form input not in the results list.
|
|
266
|
+
|
|
267
|
+
**Sub-components:** `Combobox.Item`, `Combobox.ItemTemplate`
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Checkbox
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
interface CheckboxProps {
|
|
275
|
+
checked?: boolean;
|
|
276
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
277
|
+
disabled?: boolean;
|
|
278
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
279
|
+
inset?: boolean;
|
|
280
|
+
inline?: boolean;
|
|
281
|
+
required?: boolean;
|
|
282
|
+
validate?: (checked: boolean) => string | undefined;
|
|
283
|
+
lazyValidation?: boolean;
|
|
284
|
+
class?: string;
|
|
285
|
+
style?: JSX.CSSProperties;
|
|
286
|
+
children?: JSX.Element;
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Standard checkbox with label support via `children`.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Radio
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
interface RadioProps {
|
|
298
|
+
checked?: boolean;
|
|
299
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
300
|
+
disabled?: boolean;
|
|
301
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
302
|
+
inset?: boolean;
|
|
303
|
+
inline?: boolean;
|
|
304
|
+
required?: boolean;
|
|
305
|
+
validate?: (checked: boolean) => string | undefined;
|
|
306
|
+
lazyValidation?: boolean;
|
|
307
|
+
class?: string;
|
|
308
|
+
style?: JSX.CSSProperties;
|
|
309
|
+
children?: JSX.Element;
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Standalone radio button. For grouped radio buttons, use `RadioGroup`.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## CheckboxGroup
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
interface CheckboxGroupProps<TValue> {
|
|
321
|
+
value?: TValue[];
|
|
322
|
+
onValueChange?: (value: TValue[]) => void;
|
|
323
|
+
disabled?: boolean;
|
|
324
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
325
|
+
inline?: boolean;
|
|
326
|
+
inset?: boolean;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
validate?: (value: TValue[]) => string | undefined;
|
|
329
|
+
lazyValidation?: boolean;
|
|
330
|
+
class?: string;
|
|
331
|
+
style?: JSX.CSSProperties;
|
|
332
|
+
children?: JSX.Element;
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Group of checkboxes with multi-value binding.
|
|
337
|
+
|
|
338
|
+
**Sub-component:** `CheckboxGroup.Item` — `{ value: TValue; disabled?: boolean; children?: JSX.Element }`
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## RadioGroup
|
|
343
|
+
|
|
344
|
+
```typescript
|
|
345
|
+
interface RadioGroupProps<TValue> {
|
|
346
|
+
value?: TValue;
|
|
347
|
+
onValueChange?: (value: TValue) => void;
|
|
348
|
+
disabled?: boolean;
|
|
349
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
350
|
+
inline?: boolean;
|
|
351
|
+
inset?: boolean;
|
|
352
|
+
required?: boolean;
|
|
353
|
+
validate?: (value: TValue | undefined) => string | undefined;
|
|
354
|
+
lazyValidation?: boolean;
|
|
355
|
+
class?: string;
|
|
356
|
+
style?: JSX.CSSProperties;
|
|
357
|
+
children?: JSX.Element;
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Group of radio buttons with single-value binding.
|
|
362
|
+
|
|
363
|
+
**Sub-component:** `RadioGroup.Item` — `{ value: TValue; disabled?: boolean; children?: JSX.Element }`
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## ColorPicker
|
|
368
|
+
|
|
369
|
+
```typescript
|
|
370
|
+
interface ColorPickerProps {
|
|
371
|
+
value?: string;
|
|
372
|
+
onValueChange?: (value: string | undefined) => void;
|
|
373
|
+
title?: string;
|
|
374
|
+
disabled?: boolean;
|
|
375
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
376
|
+
inset?: boolean;
|
|
377
|
+
required?: boolean;
|
|
378
|
+
validate?: (value: string | undefined) => string | undefined;
|
|
379
|
+
lazyValidation?: boolean;
|
|
380
|
+
class?: string;
|
|
381
|
+
style?: JSX.CSSProperties;
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Color picker with hex `#RRGGBB` value format.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## DateRangePicker
|
|
390
|
+
|
|
391
|
+
```typescript
|
|
392
|
+
type DateRangePeriodType = "day" | "month" | "range";
|
|
393
|
+
|
|
394
|
+
interface DateRangePickerProps {
|
|
395
|
+
periodType?: DateRangePeriodType;
|
|
396
|
+
onPeriodTypeChange?: (value: DateRangePeriodType) => void;
|
|
397
|
+
from?: DateOnly;
|
|
398
|
+
onFromChange?: (value: DateOnly | undefined) => void;
|
|
399
|
+
to?: DateOnly;
|
|
400
|
+
onToChange?: (value: DateOnly | undefined) => void;
|
|
401
|
+
required?: boolean;
|
|
402
|
+
disabled?: boolean;
|
|
403
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
404
|
+
class?: string;
|
|
405
|
+
style?: JSX.CSSProperties;
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Date range picker with day, month, and custom range modes. Each value (`periodType`, `from`, `to`) is independently controllable.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## RichTextEditor
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
interface RichTextEditorProps {
|
|
417
|
+
value?: string;
|
|
418
|
+
onValueChange?: (value: string) => void;
|
|
419
|
+
disabled?: boolean;
|
|
420
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
421
|
+
class?: string;
|
|
422
|
+
style?: JSX.CSSProperties;
|
|
423
|
+
}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Rich text editor backed by Tiptap. `value` is an HTML string.
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Numpad
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
interface NumpadProps {
|
|
434
|
+
value?: number;
|
|
435
|
+
onValueChange?: (value: number | undefined) => void;
|
|
436
|
+
placeholder?: string;
|
|
437
|
+
required?: boolean;
|
|
438
|
+
inputDisabled?: boolean;
|
|
439
|
+
withEnterButton?: boolean;
|
|
440
|
+
withMinusButton?: boolean;
|
|
441
|
+
onEnterButtonClick?: () => void;
|
|
442
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
443
|
+
class?: string;
|
|
444
|
+
style?: JSX.CSSProperties;
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
On-screen number pad with optional enter and minus buttons.
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## StatePreset
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
interface StatePresetProps<TValue> {
|
|
456
|
+
storageKey: string;
|
|
457
|
+
value: TValue;
|
|
458
|
+
onValueChange: (value: TValue) => void;
|
|
459
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
460
|
+
class?: string;
|
|
461
|
+
style?: JSX.CSSProperties;
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Save and restore named presets of component state to sync storage. `storageKey` uniquely identifies the state entry.
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## ThemeToggle
|
|
470
|
+
|
|
471
|
+
```typescript
|
|
472
|
+
interface ThemeToggleProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
473
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Button that cycles through light, dark, and system theme modes.
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
## Invalid
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
interface InvalidProps {
|
|
485
|
+
message?: string;
|
|
486
|
+
variant?: "border" | "dot";
|
|
487
|
+
lazyValidation?: boolean;
|
|
488
|
+
}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Validation error indicator. When `message` is non-empty, the component renders in an invalid state. Used internally by form controls and can be composed for custom validation displays.
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Usage Examples
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
import { TextInput, Select, Checkbox, DatePicker } from "@simplysm/solid";
|
|
499
|
+
import { createSignal } from "solid-js";
|
|
500
|
+
|
|
501
|
+
const [name, setName] = createSignal("");
|
|
502
|
+
const [color, setColor] = createSignal<string>();
|
|
503
|
+
const [agreed, setAgreed] = createSignal(false);
|
|
504
|
+
const [date, setDate] = createSignal<DateOnly>();
|
|
505
|
+
|
|
506
|
+
<TextInput value={name()} onValueChange={setName} placeholder="Name" required />
|
|
507
|
+
|
|
508
|
+
<Select
|
|
509
|
+
items={["Red", "Green", "Blue"]}
|
|
510
|
+
value={color()}
|
|
511
|
+
onValueChange={setColor}
|
|
512
|
+
placeholder="Pick a color"
|
|
513
|
+
/>
|
|
514
|
+
|
|
515
|
+
<Checkbox checked={agreed()} onCheckedChange={setAgreed}>
|
|
516
|
+
I agree to the terms
|
|
517
|
+
</Checkbox>
|
|
518
|
+
|
|
519
|
+
<DatePicker value={date()} onValueChange={setDate} unit="date" />
|
|
520
|
+
```
|
package/docs/helpers.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Helpers
|
|
2
|
+
|
|
3
|
+
## mergeStyles
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
function mergeStyles(
|
|
7
|
+
...styles: (JSX.CSSProperties | string | undefined)[]
|
|
8
|
+
): JSX.CSSProperties;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Merges multiple style objects or CSS strings into a single `JSX.CSSProperties` object. Handles `undefined` values gracefully.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## createAppStructure
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
function createAppStructure<TModule, const TItems extends AppStructureItem<TModule>[]>(
|
|
19
|
+
getOpts: () => {
|
|
20
|
+
items: TItems;
|
|
21
|
+
usableModules?: Accessor<TModule[] | undefined>;
|
|
22
|
+
permRecord?: Accessor<Record<string, boolean> | undefined>;
|
|
23
|
+
},
|
|
24
|
+
): {
|
|
25
|
+
AppStructureProvider: ParentComponent;
|
|
26
|
+
useAppStructure(): AppStructure<TModule>;
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Creates an application navigation/permission structure from a declarative item tree. Returns a provider and a hook.
|
|
31
|
+
|
|
32
|
+
### AppStructure types
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
interface AppStructureGroupItem<TModule> {
|
|
36
|
+
code: string;
|
|
37
|
+
title: string;
|
|
38
|
+
icon?: Component<IconProps>;
|
|
39
|
+
modules?: TModule[];
|
|
40
|
+
requiredModules?: TModule[];
|
|
41
|
+
children: AppStructureItem<TModule>[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface AppStructureLeafItem<TModule> {
|
|
45
|
+
code: string;
|
|
46
|
+
title: string;
|
|
47
|
+
icon?: Component<IconProps>;
|
|
48
|
+
modules?: TModule[];
|
|
49
|
+
requiredModules?: TModule[];
|
|
50
|
+
component?: Component;
|
|
51
|
+
perms?: ("use" | "edit")[];
|
|
52
|
+
subPerms?: AppStructureSubPerm<TModule>[];
|
|
53
|
+
isNotMenu?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface AppMenu {
|
|
57
|
+
title: string;
|
|
58
|
+
href?: string;
|
|
59
|
+
icon?: Component<IconProps>;
|
|
60
|
+
children?: AppMenu[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface AppStructure<TModule> {
|
|
64
|
+
items: AppStructureItem<TModule>[];
|
|
65
|
+
usableRoutes: Accessor<AppRoute[]>;
|
|
66
|
+
usableMenus: Accessor<AppMenu[]>;
|
|
67
|
+
usableFlatMenus: Accessor<AppFlatMenu[]>;
|
|
68
|
+
usablePerms: Accessor<AppPerm<TModule>[]>;
|
|
69
|
+
allFlatPerms: AppFlatPerm<TModule>[];
|
|
70
|
+
getTitleChainByHref(href: string): string[];
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The structure automatically derives routes, menus, and permissions from the item tree, filtering by `usableModules` and `permRecord`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## createSlot
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
function createSlot<TProps extends { children: JSX.Element }>():
|
|
82
|
+
[Component<TProps>, () => [Accessor<TProps | undefined>, ParentComponent]];
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Creates a slot pattern for compound components. Returns a slot component and a hook to access the slot content.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## createSlots
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
interface SlotRegistrar<TItem> {
|
|
93
|
+
add(item: TItem): void;
|
|
94
|
+
remove(item: TItem): void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function createSlots<TItem>():
|
|
98
|
+
[Component, () => [Accessor<TItem[]>, ParentComponent]];
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Like `createSlot` but for multiple items. Items are collected from all rendered slot components.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## ripple (Directive)
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
function ripple(el: HTMLElement, accessor: Accessor<boolean>): void;
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
SolidJS directive that adds a Material-style ripple effect on click.
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { ripple } from "@simplysm/solid";
|
|
115
|
+
|
|
116
|
+
// Register the directive (required for TypeScript)
|
|
117
|
+
void ripple;
|
|
118
|
+
|
|
119
|
+
<div use:ripple={true}>Click me</div>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Style Constants
|
|
125
|
+
|
|
126
|
+
### base.styles
|
|
127
|
+
|
|
128
|
+
Background, border, and text color utilities mapped to the theme system:
|
|
129
|
+
|
|
130
|
+
- `bg.default`, `bg.subtle`, `bg.surface` — background colors
|
|
131
|
+
- `border.default`, `border.subtle` — border colors
|
|
132
|
+
- `text.default`, `text.muted`, `text.subtle` — text colors
|
|
133
|
+
|
|
134
|
+
### control.styles
|
|
135
|
+
|
|
136
|
+
Component sizing utilities:
|
|
137
|
+
|
|
138
|
+
- `pad.xs`, `pad.sm`, `pad.md`, `pad.lg`, `pad.xl` — padding by size
|
|
139
|
+
- `gap.xs` ... `gap.xl` — gap by size
|
|
140
|
+
- `ComponentSize` — `"xs" | "sm" | "md" | "lg" | "xl"`
|
|
141
|
+
|
|
142
|
+
### theme.styles
|
|
143
|
+
|
|
144
|
+
Semantic theme tokens:
|
|
145
|
+
|
|
146
|
+
- `SemanticTheme` — `"base" | "primary" | "success" | "warning" | "danger" | "danger-light" | "neutral"`
|
|
147
|
+
- `themeTokens` — maps each theme to `{ solid, subtle, outline, ghost }` Tailwind class sets
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Usage Examples
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { createAppStructure, mergeStyles } from "@simplysm/solid";
|
|
155
|
+
|
|
156
|
+
// App structure
|
|
157
|
+
const { AppStructureProvider, useAppStructure } = createAppStructure(() => ({
|
|
158
|
+
items: [
|
|
159
|
+
{ code: "home", title: "Home", component: HomePage },
|
|
160
|
+
{
|
|
161
|
+
code: "admin", title: "Admin", children: [
|
|
162
|
+
{ code: "users", title: "Users", component: UsersPage, perms: ["use", "edit"] },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
usableModules: () => currentModules(),
|
|
167
|
+
permRecord: () => userPerms(),
|
|
168
|
+
}));
|
|
169
|
+
|
|
170
|
+
// Merge styles
|
|
171
|
+
const style = mergeStyles(props.style, { padding: "8px" }, "color: red");
|
|
172
|
+
```
|