solid-tom-ui 1.0.11 → 1.0.15

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 (119) hide show
  1. package/README.md +246 -246
  2. package/dist/README.md +246 -246
  3. package/dist/components/avatar/avatar.js.map +1 -1
  4. package/dist/components/badge/badge.js.map +1 -1
  5. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  6. package/dist/components/button/button.js.map +1 -1
  7. package/dist/components/carousel/carousel.js.map +1 -1
  8. package/dist/components/chat-bubble/chatBubble.js.map +1 -1
  9. package/dist/components/checkbox/checkbox.js.map +1 -1
  10. package/dist/components/collapse/collapse.js.map +1 -1
  11. package/dist/components/context-menu/context-menu.js.map +1 -1
  12. package/dist/components/context-menu/context-menu.store.js.map +1 -1
  13. package/dist/components/divider/divider.js.map +1 -1
  14. package/dist/components/dropdown/dropdown.js.map +1 -1
  15. package/dist/components/dropdown/dropdown.store.js.map +1 -1
  16. package/dist/components/float-button/float-button.js.map +1 -1
  17. package/dist/components/hover-3d-image/hover-3d-image.js.map +1 -1
  18. package/dist/components/image-preview/image-preview.js.map +1 -1
  19. package/dist/components/input/input.js.map +1 -1
  20. package/dist/components/input/input.utils.js.map +1 -1
  21. package/dist/components/input/variants/input-color.js.map +1 -1
  22. package/dist/components/input/variants/input-date.js.map +1 -1
  23. package/dist/components/input/variants/input-number.d.ts.map +1 -1
  24. package/dist/components/input/variants/input-number.js +1 -1
  25. package/dist/components/input/variants/input-number.js.map +1 -1
  26. package/dist/components/input/variants/input-otp.js.map +1 -1
  27. package/dist/components/input/variants/input-password.js.map +1 -1
  28. package/dist/components/input/variants/input-radio.js.map +1 -1
  29. package/dist/components/input/variants/input-range.js.map +1 -1
  30. package/dist/components/input/variants/input-text.d.ts.map +1 -1
  31. package/dist/components/input/variants/input-text.js +1 -1
  32. package/dist/components/input/variants/input-text.js.map +1 -1
  33. package/dist/components/input/variants/input-textarea.js.map +1 -1
  34. package/dist/components/loading/loading.js.map +1 -1
  35. package/dist/components/mansory/mansory.js.map +1 -1
  36. package/dist/components/menu/menu.js.map +1 -1
  37. package/dist/components/modal/modal.js.map +1 -1
  38. package/dist/components/modal/modalContext.js.map +1 -1
  39. package/dist/components/pagination/pagination.js.map +1 -1
  40. package/dist/components/progress-bar/progress-bar.js.map +1 -1
  41. package/dist/components/qr-code/qr-code.js.map +1 -1
  42. package/dist/components/select/select.js +1 -1
  43. package/dist/components/select/select.js.map +1 -1
  44. package/dist/components/select-zone/select-zone.js.map +1 -1
  45. package/dist/components/skeleton/skeleton.js.map +1 -1
  46. package/dist/components/slider/slider.js.map +1 -1
  47. package/dist/components/splitter/splitter.js.map +1 -1
  48. package/dist/components/steps/steps.js.map +1 -1
  49. package/dist/components/swap/swap.js.map +1 -1
  50. package/dist/components/switch/switch.js.map +1 -1
  51. package/dist/components/tab/tab.js.map +1 -1
  52. package/dist/components/table/table.js.map +1 -1
  53. package/dist/components/timeline/timeline.js.map +1 -1
  54. package/dist/components/toast/icons/ErrorIcon.js.map +1 -1
  55. package/dist/components/toast/icons/IconCircle.js.map +1 -1
  56. package/dist/components/toast/icons/InfoIcon.js.map +1 -1
  57. package/dist/components/toast/icons/LoaderIcon.js.map +1 -1
  58. package/dist/components/toast/icons/SuccessIcon.js.map +1 -1
  59. package/dist/components/toast/icons/WarningIcon.js.map +1 -1
  60. package/dist/components/toast/toast.js.map +1 -1
  61. package/dist/components/toast/toast.store.js.map +1 -1
  62. package/dist/components/tooltip/tooltip.js.map +1 -1
  63. package/dist/components/tour/tour.js.map +1 -1
  64. package/dist/components/upload/upload.js.map +1 -1
  65. package/dist/components/z-index/z-index.context.js.map +1 -1
  66. package/dist/components/z-index/z-index.js.map +1 -1
  67. package/dist/components/z-index/z-index.store.js.map +1 -1
  68. package/dist/components/z-index/z-index.types.js.map +1 -1
  69. package/dist/package.json +1 -1
  70. package/dist/skill/avatar.skill.md.txt +255 -255
  71. package/dist/skill/badge.skill.md.txt +223 -223
  72. package/dist/skill/breadcrumb.skill.md.txt +177 -177
  73. package/dist/skill/button.skill.md.txt +198 -198
  74. package/dist/skill/carousel.skill.md.txt +406 -406
  75. package/dist/skill/chat-bubble.skill.md.txt +342 -342
  76. package/dist/skill/checkbox.skill.md.txt +326 -326
  77. package/dist/skill/code-preview.skill.md.txt +240 -240
  78. package/dist/skill/collapse.skill.md.txt +329 -329
  79. package/dist/skill/context-menu.skill.md.txt +233 -233
  80. package/dist/skill/diff.skill.md.txt +244 -244
  81. package/dist/skill/divider.skill.md.txt +151 -151
  82. package/dist/skill/doc.skill.md.txt +191 -191
  83. package/dist/skill/drawer.skill.md.txt +157 -157
  84. package/dist/skill/dropdown.skill.md.txt +198 -198
  85. package/dist/skill/float-button.skill.md.txt +315 -315
  86. package/dist/skill/hover-3d-image.skill.md.txt +120 -120
  87. package/dist/skill/iframe.skill.md.txt +114 -114
  88. package/dist/skill/image-preview.skill.md.txt +162 -162
  89. package/dist/skill/indicator.skill.md.txt +60 -60
  90. package/dist/skill/input.skill.md.txt +489 -489
  91. package/dist/skill/loading.skill.md.txt +127 -127
  92. package/dist/skill/menu.skill.md.txt +476 -476
  93. package/dist/skill/modal.skill.md.txt +359 -359
  94. package/dist/skill/pagination.skill.md.txt +405 -405
  95. package/dist/skill/progress-bar.skill.md.txt +207 -207
  96. package/dist/skill/qr-code.skill.md.txt +136 -136
  97. package/dist/skill/rating.skill.md.txt +167 -167
  98. package/dist/skill/select-zone.skill.md.txt +93 -93
  99. package/dist/skill/select.skill.md.txt +663 -663
  100. package/dist/skill/skeleton.skill.md.txt +192 -192
  101. package/dist/skill/slider.skill.md.txt +404 -404
  102. package/dist/skill/splitter.skill.md.txt +411 -411
  103. package/dist/skill/steps.skill.md.txt +264 -264
  104. package/dist/skill/swap.skill.md.txt +139 -139
  105. package/dist/skill/switch.skill.md.txt +191 -191
  106. package/dist/skill/tab.skill.md.txt +484 -484
  107. package/dist/skill/table.example.header.md.txt +666 -666
  108. package/dist/skill/table.skill.md.txt +1407 -1407
  109. package/dist/skill/text-rotate.skill.md.txt +186 -186
  110. package/dist/skill/timeline.skill.md.txt +247 -247
  111. package/dist/skill/toast.skill.md.txt +531 -531
  112. package/dist/skill/tooltip.skill.md.txt +222 -222
  113. package/dist/skill/tour.skill.md.txt +156 -156
  114. package/dist/skill/upload.skill.md.txt +358 -358
  115. package/dist/utils/cn.js.map +1 -1
  116. package/dist/utils/element-tracker.js.map +1 -1
  117. package/dist/utils/helper.js.map +1 -1
  118. package/dist/utils/hoc.js.map +1 -1
  119. package/package.json +132 -133
package/dist/README.md CHANGED
@@ -1,246 +1,246 @@
1
- # solid-tom-ui
2
-
3
- > A blazing-fast, beautifully crafted UI component library for [SolidJS](https://solidjs.com), inspired by Ant Design.
4
-
5
- **Entire library ships at just ~1.5 MB.** Built on **Tailwind CSS 4** and **DaisyUI 5**, solid-tom-ui harnesses SolidJS fine-grained reactivity to deliver buttery-smooth UIs with near-zero overhead — no virtual DOM, no unnecessary re-renders, just raw speed.
6
-
7
- Customizing the look and feel is a first-class experience: swap the entire color scheme by overriding a handful of CSS variables, or dial in individual components through the unified `color` prop and per-slot `class` overrides — no CSS-in-JS, no build plugins, just plain CSS and Tailwind utilities you already know.
8
-
9
- ## Why solid-tom-ui?
10
-
11
- - **Featherlight** — the full library (45+ components, styles included) weighs only ~1.5 MB, keeping your app fast on any network
12
- - **Instant theming** — change primary colors, border radii, and shadows site-wide by editing a single CSS block; no rebuild required
13
- - **Pixel-perfect by default** — every component is designed to look great out of the box, while remaining fully customizable via `class` props or CSS variables
14
- - **SolidJS-native** — reactivity is handled at the signal level, so components update surgically without wasting a single render cycle
15
-
16
- ## Features
17
-
18
- - **45+ components** — from simple buttons to complex data tables with virtual scrolling
19
- - **Tree-shakeable** — each component is its own module; unused components are not bundled
20
- - **Typed** — full TypeScript support with exported prop interfaces
21
- - **Themeable** — DaisyUI color tokens + unified `color` prop across all components
22
- - **Accessible** — semantic HTML, ARIA attributes, keyboard navigation
23
- - **Zero CSS setup** — pre-compiled CSS bundle includes Tailwind + DaisyUI, no extra config needed
24
-
25
- ## Installation
26
-
27
- ```bash
28
- npm install solid-tom-ui
29
- or
30
- pnpm install solid-tom-ui
31
- or
32
- bun install solid-tom-ui
33
- ```
34
-
35
- ### Peer dependencies
36
-
37
- ```bash
38
- npm install solid-js
39
- ```
40
-
41
- Optional (only needed for specific components):
42
-
43
- | Package | Component |
44
- |---------|-----------|
45
- | `imask` | `Input` with mask |
46
- | `qrcode` | `QrCode` |
47
- | `@tanstack/solid-table` | `Table` |
48
-
49
- ## Setup
50
-
51
- ### 1. Import the pre-compiled CSS bundle
52
-
53
- ```css
54
- /* app.css */
55
- @import 'solid-tom-ui/styles';
56
- ```
57
-
58
- Make sure this CSS file is imported in your app entry point:
59
-
60
- ```tsx
61
- // src/index.tsx
62
- import './app.css';
63
- import { render } from 'solid-js/web';
64
- import App from './App';
65
-
66
- render(() => <App />, document.getElementById('root')!);
67
- ```
68
- ---
69
-
70
- ### 2. Use components
71
-
72
- ```tsx
73
- import { Button, Modal, toast } from 'solid-tom-ui';
74
-
75
- function App() {
76
- return (
77
- <Button color="primary" onClick={() => toast.success('Hello!')}>
78
- Click me
79
- </Button>
80
- );
81
- }
82
- ```
83
-
84
- ---
85
-
86
- ## Advanced Setup (Custom Theme)
87
-
88
- Overwrite css variable
89
-
90
- ```css
91
- :root {
92
- --color-base-100: white;
93
- --color-base-content: black;
94
-
95
- --color-primary: red;
96
- --color-primary-content: white;
97
-
98
- --color-secondary: red;
99
- --color-secondary-content: white;
100
-
101
- --color-accent: red;
102
- --color-accent-content: white;
103
-
104
- --color-neutral: red;
105
- --color-neutral-content: white;
106
-
107
- --color-info: red;
108
- --color-info-content: white;
109
-
110
- --color-success: red;
111
- --color-success-content: white;
112
-
113
- --color-warning: red;
114
- --color-warning-content: white;
115
-
116
- --color-error: red;
117
- --color-error-content: white;
118
- --radius-selector: 8px;
119
- --radius-field: 4px;
120
- --radius-box: 6px;
121
- --size-selector: 4px;
122
- --size-field: 4px;
123
- --border: 1px;
124
- --depth: 0;
125
- --noise: 0;
126
- }
127
- ```
128
-
129
- ---
130
-
131
- ## Components
132
-
133
- ### Layout & Navigation
134
- | Component | Description |
135
- |-----------|-------------|
136
- | `Breadcrumb` | Navigation breadcrumb trail |
137
- | `Divider` | Horizontal or vertical divider |
138
- | `Drawer` | Slide-in side panel |
139
- | `Dropdown` | Dropdown menu |
140
- | `Menu` | Vertical/horizontal navigation menu |
141
- | `Pagination` | Page navigation |
142
- | `Splitter` | Resizable split pane |
143
- | `Steps` | Step-by-step progress indicator |
144
- | `Tab` | Tabbed navigation |
145
-
146
- ### Data Display
147
- | Component | Description |
148
- |-----------|-------------|
149
- | `Avatar` | User avatar with fallback |
150
- | `Badge` | Status badge / tag |
151
- | `Carousel` | Image/content carousel |
152
- | `ChatBubble` | Chat message bubble |
153
- | `Diff` | Side-by-side diff viewer |
154
- | `Indicator` | Numeric badge overlay |
155
- | `Skeleton` | Loading skeleton placeholder |
156
- | `Table` | Feature-rich table (virtual scroll, sort, filter, pinned columns) |
157
- | `Timeline` | Vertical timeline |
158
- | `Tooltip` | Hover tooltip |
159
- | `Tour` | Interactive product tour |
160
-
161
- ### Input & Forms
162
- | Component | Description |
163
- |-----------|-------------|
164
- | `Checkbox` | Checkbox input |
165
- | `Input` | Text, password, number, textarea, color, date, range, OTP, masked inputs |
166
- | `Rating` | Star rating |
167
- | `Select` | Dropdown select |
168
- | `SelectZone` | Drag-to-select zone |
169
- | `Slider` | Range slider |
170
- | `Switch` | Toggle switch |
171
- | `Upload` | File upload with drag & drop |
172
-
173
- ### Feedback
174
- | Component | Description |
175
- |-----------|-------------|
176
- | `Loading` | Spinner / loading indicator |
177
- | `Modal` | Dialog modal |
178
- | `ProgressBar` | Progress bar |
179
- | `Toast` | Toast notifications (`toast.success()`, `toast.error()`, …) |
180
-
181
- ### Visual & Effects
182
- | Component | Description |
183
- |-----------|-------------|
184
- | `Collapse` | Collapsible content panel |
185
- | `ContextMenu` | Right-click context menu |
186
- | `FloatButton` | Floating action button |
187
- | `Hover3dImage` | 3D parallax image on hover |
188
- | `ImagePreview` | Lightbox image preview |
189
- | `Mansory` | Masonry grid layout |
190
- | `QrCode` | QR code generator |
191
- | `Swap` | Flip between two states |
192
- | `TextRotate` | Animated rotating text |
193
-
194
- ### Utilities
195
- | Component | Description |
196
- |-----------|-------------|
197
- | `CodePreview` | Code preview |
198
-
199
- ---
200
-
201
- ## API
202
-
203
- ### Color prop
204
-
205
- Most components accept a `color` prop:
206
-
207
- ```tsx
208
- type BaseColorProps =
209
- | 'primary' | 'secondary' | 'accent' | 'neutral'
210
- | 'info' | 'success' | 'warning' | 'error';
211
- ```
212
-
213
- ```tsx
214
- <Badge color="success">Active</Badge>
215
- <Button color="warning">Caution</Button>
216
- ```
217
-
218
- ### Class override (slot system)
219
-
220
- Every component exposes a `class` prop to override individual slots:
221
-
222
- ```tsx
223
- // Single-element components
224
- <Badge class="font-bold text-lg" />
225
-
226
- // Multi-slot components
227
- <Modal
228
- class={{
229
- root: 'max-w-2xl',
230
- header: 'bg-base-200',
231
- body: 'p-8',
232
- }}
233
- />
234
- ```
235
-
236
- ## TypeScript
237
-
238
- All prop types are exported:
239
-
240
- ```tsx
241
- import type { ButtonProps, ModalProps, BaseColorProps, SolidComponent } from 'solid-tom-ui';
242
- ```
243
-
244
- ## License
245
-
246
- MIT © [Truong Tom](https://github.com/truongtom1993)
1
+ # solid-tom-ui
2
+
3
+ > A blazing-fast, beautifully crafted UI component library for [SolidJS](https://solidjs.com), inspired by Ant Design.
4
+
5
+ **Entire library ships at just ~1.5 MB.** Built on **Tailwind CSS 4** and **DaisyUI 5**, solid-tom-ui harnesses SolidJS fine-grained reactivity to deliver buttery-smooth UIs with near-zero overhead — no virtual DOM, no unnecessary re-renders, just raw speed.
6
+
7
+ Customizing the look and feel is a first-class experience: swap the entire color scheme by overriding a handful of CSS variables, or dial in individual components through the unified `color` prop and per-slot `class` overrides — no CSS-in-JS, no build plugins, just plain CSS and Tailwind utilities you already know.
8
+
9
+ ## Why solid-tom-ui?
10
+
11
+ - **Featherlight** — the full library (45+ components, styles included) weighs only ~1.5 MB, keeping your app fast on any network
12
+ - **Instant theming** — change primary colors, border radii, and shadows site-wide by editing a single CSS block; no rebuild required
13
+ - **Pixel-perfect by default** — every component is designed to look great out of the box, while remaining fully customizable via `class` props or CSS variables
14
+ - **SolidJS-native** — reactivity is handled at the signal level, so components update surgically without wasting a single render cycle
15
+
16
+ ## Features
17
+
18
+ - **45+ components** — from simple buttons to complex data tables with virtual scrolling
19
+ - **Tree-shakeable** — each component is its own module; unused components are not bundled
20
+ - **Typed** — full TypeScript support with exported prop interfaces
21
+ - **Themeable** — DaisyUI color tokens + unified `color` prop across all components
22
+ - **Accessible** — semantic HTML, ARIA attributes, keyboard navigation
23
+ - **Zero CSS setup** — pre-compiled CSS bundle includes Tailwind + DaisyUI, no extra config needed
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ npm install solid-tom-ui
29
+ or
30
+ pnpm install solid-tom-ui
31
+ or
32
+ bun install solid-tom-ui
33
+ ```
34
+
35
+ ### Peer dependencies
36
+
37
+ ```bash
38
+ npm install solid-js
39
+ ```
40
+
41
+ Optional (only needed for specific components):
42
+
43
+ | Package | Component |
44
+ |---------|-----------|
45
+ | `imask` | `Input` with mask |
46
+ | `qrcode` | `QrCode` |
47
+ | `@tanstack/solid-table` | `Table` |
48
+
49
+ ## Setup
50
+
51
+ ### 1. Import the pre-compiled CSS bundle
52
+
53
+ ```css
54
+ /* app.css */
55
+ @import 'solid-tom-ui/styles';
56
+ ```
57
+
58
+ Make sure this CSS file is imported in your app entry point:
59
+
60
+ ```tsx
61
+ // src/index.tsx
62
+ import './app.css';
63
+ import { render } from 'solid-js/web';
64
+ import App from './App';
65
+
66
+ render(() => <App />, document.getElementById('root')!);
67
+ ```
68
+ ---
69
+
70
+ ### 2. Use components
71
+
72
+ ```tsx
73
+ import { Button, Modal, toast } from 'solid-tom-ui';
74
+
75
+ function App() {
76
+ return (
77
+ <Button color="primary" onClick={() => toast.success('Hello!')}>
78
+ Click me
79
+ </Button>
80
+ );
81
+ }
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Advanced Setup (Custom Theme)
87
+
88
+ Overwrite css variable
89
+
90
+ ```css
91
+ :root {
92
+ --color-base-100: white;
93
+ --color-base-content: black;
94
+
95
+ --color-primary: red;
96
+ --color-primary-content: white;
97
+
98
+ --color-secondary: red;
99
+ --color-secondary-content: white;
100
+
101
+ --color-accent: red;
102
+ --color-accent-content: white;
103
+
104
+ --color-neutral: red;
105
+ --color-neutral-content: white;
106
+
107
+ --color-info: red;
108
+ --color-info-content: white;
109
+
110
+ --color-success: red;
111
+ --color-success-content: white;
112
+
113
+ --color-warning: red;
114
+ --color-warning-content: white;
115
+
116
+ --color-error: red;
117
+ --color-error-content: white;
118
+ --radius-selector: 8px;
119
+ --radius-field: 4px;
120
+ --radius-box: 6px;
121
+ --size-selector: 4px;
122
+ --size-field: 4px;
123
+ --border: 1px;
124
+ --depth: 0;
125
+ --noise: 0;
126
+ }
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Components
132
+
133
+ ### Layout & Navigation
134
+ | Component | Description |
135
+ |-----------|-------------|
136
+ | `Breadcrumb` | Navigation breadcrumb trail |
137
+ | `Divider` | Horizontal or vertical divider |
138
+ | `Drawer` | Slide-in side panel |
139
+ | `Dropdown` | Dropdown menu |
140
+ | `Menu` | Vertical/horizontal navigation menu |
141
+ | `Pagination` | Page navigation |
142
+ | `Splitter` | Resizable split pane |
143
+ | `Steps` | Step-by-step progress indicator |
144
+ | `Tab` | Tabbed navigation |
145
+
146
+ ### Data Display
147
+ | Component | Description |
148
+ |-----------|-------------|
149
+ | `Avatar` | User avatar with fallback |
150
+ | `Badge` | Status badge / tag |
151
+ | `Carousel` | Image/content carousel |
152
+ | `ChatBubble` | Chat message bubble |
153
+ | `Diff` | Side-by-side diff viewer |
154
+ | `Indicator` | Numeric badge overlay |
155
+ | `Skeleton` | Loading skeleton placeholder |
156
+ | `Table` | Feature-rich table (virtual scroll, sort, filter, pinned columns) |
157
+ | `Timeline` | Vertical timeline |
158
+ | `Tooltip` | Hover tooltip |
159
+ | `Tour` | Interactive product tour |
160
+
161
+ ### Input & Forms
162
+ | Component | Description |
163
+ |-----------|-------------|
164
+ | `Checkbox` | Checkbox input |
165
+ | `Input` | Text, password, number, textarea, color, date, range, OTP, masked inputs |
166
+ | `Rating` | Star rating |
167
+ | `Select` | Dropdown select |
168
+ | `SelectZone` | Drag-to-select zone |
169
+ | `Slider` | Range slider |
170
+ | `Switch` | Toggle switch |
171
+ | `Upload` | File upload with drag & drop |
172
+
173
+ ### Feedback
174
+ | Component | Description |
175
+ |-----------|-------------|
176
+ | `Loading` | Spinner / loading indicator |
177
+ | `Modal` | Dialog modal |
178
+ | `ProgressBar` | Progress bar |
179
+ | `Toast` | Toast notifications (`toast.success()`, `toast.error()`, …) |
180
+
181
+ ### Visual & Effects
182
+ | Component | Description |
183
+ |-----------|-------------|
184
+ | `Collapse` | Collapsible content panel |
185
+ | `ContextMenu` | Right-click context menu |
186
+ | `FloatButton` | Floating action button |
187
+ | `Hover3dImage` | 3D parallax image on hover |
188
+ | `ImagePreview` | Lightbox image preview |
189
+ | `Mansory` | Masonry grid layout |
190
+ | `QrCode` | QR code generator |
191
+ | `Swap` | Flip between two states |
192
+ | `TextRotate` | Animated rotating text |
193
+
194
+ ### Utilities
195
+ | Component | Description |
196
+ |-----------|-------------|
197
+ | `CodePreview` | Code preview |
198
+
199
+ ---
200
+
201
+ ## API
202
+
203
+ ### Color prop
204
+
205
+ Most components accept a `color` prop:
206
+
207
+ ```tsx
208
+ type BaseColorProps =
209
+ | 'primary' | 'secondary' | 'accent' | 'neutral'
210
+ | 'info' | 'success' | 'warning' | 'error';
211
+ ```
212
+
213
+ ```tsx
214
+ <Badge color="success">Active</Badge>
215
+ <Button color="warning">Caution</Button>
216
+ ```
217
+
218
+ ### Class override (slot system)
219
+
220
+ Every component exposes a `class` prop to override individual slots:
221
+
222
+ ```tsx
223
+ // Single-element components
224
+ <Badge class="font-bold text-lg" />
225
+
226
+ // Multi-slot components
227
+ <Modal
228
+ class={{
229
+ root: 'max-w-2xl',
230
+ header: 'bg-base-200',
231
+ body: 'p-8',
232
+ }}
233
+ />
234
+ ```
235
+
236
+ ## TypeScript
237
+
238
+ All prop types are exported:
239
+
240
+ ```tsx
241
+ import type { ButtonProps, ModalProps, BaseColorProps, SolidComponent } from 'solid-tom-ui';
242
+ ```
243
+
244
+ ## License
245
+
246
+ MIT © [Truong Tom](https://github.com/truongtom1993)
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":["cn","cva","VariantProps","Component","createMemo","For","Match","mergeProps","ParentComponent","Show","Switch","AvatarGroup","AvatarProps","variants","mask","heart","hexagon","squircle","square","circle","status","online","offline","AvatarVariantsProps","Avatar","p","ReturnType","const","effect","_el$","_tmpl$","_$insert","_$createComponent","children","when","placeholder","Element","image","_el$2","_c$","_$memo","_el$3","_tmpl$2","_$effect","_$setAttribute","_p$","_v$","class","avatar","_v$2","width","e","_$className","t","_$setStyleProperty","undefined","root","Group","props","renderWidth","_el$4","each","avatars","_$mergeProps","counter","_el$5","_tmpl$3","_el$6","firstChild","_el$7","_v$3","_v$4","_v$5","a","group"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport {\n Component,\n createMemo,\n For,\n Match,\n mergeProps,\n ParentComponent,\n Show,\n Switch,\n} from 'solid-js';\nimport type { AvatarGroup, AvatarProps } from './avatar.types';\n\nconst variants = cva('', {\n variants: {\n mask: {\n heart: 'mask mask-heart',\n hexagon: 'mask mask-hexagon',\n squircle: 'mask mask-squircle',\n square: 'rounded-lg',\n circle: 'rounded-full',\n },\n status: {\n online: 'avatar-online',\n offline: 'avatar-offline',\n },\n },\n});\n\nexport type AvatarVariantsProps = VariantProps<typeof variants>;\n\nexport function Avatar(p: AvatarProps): ReturnType<Component<AvatarProps>> {\n p = mergeProps(\n {\n mask: 'circle' as const,\n effect: true,\n },\n p,\n );\n\n return (\n <div\n class={cn(\n 'avatar',\n p.placeholder && 'avatar-placeholder',\n variants({ status: p.status }),\n p.effect && 'avatar-effect',\n p.class?.root,\n )}\n >\n <Switch>\n <Match when={p.placeholder}>{p.placeholder as Element}</Match>\n <Match when={p.image}>\n <div\n class={cn(variants({ mask: p.mask }), p.class?.avatar)}\n style={{ width: typeof p.width === 'string' ? p.width : `${p.width}px` }}\n >\n {p.image && <img src={p.image} />}\n </div>\n </Match>\n </Switch>\n </div>\n );\n}\n\nAvatar.Group = (props: AvatarGroup): ReturnType<ParentComponent> => {\n const renderWidth = createMemo(() => {\n return typeof props.width === 'string' ? props.width : `${props.width}px`;\n });\n return (\n <div class={cn('avatar-group -space-x-6', props.class?.group)}>\n <For each={props.avatars}>{avatar => <Avatar {...avatar} width={renderWidth()} />}</For>\n <Show when={props.counter}>\n <div class={cn('avatar avatar-placeholder', props.class?.placeholder)}>\n <div\n class={cn('bg-neutral text-neutral-content', props.class?.counter)}\n style={{\n width: renderWidth(),\n }}\n >\n +{props.counter}\n </div>\n </div>\n </Show>\n </div>\n );\n};\n"],"mappings":"6YAcMa,EAAWZ,EAAI,GAAI,CACvBY,SAAU,CACRC,KAAM,CACJC,MAAO,kBACPC,QAAS,oBACTC,SAAU,qBACVC,OAAQ,aACRC,OAAQ,eACT,CACDC,OAAQ,CACNC,OAAQ,gBACRC,QAAS,iBACX,CACF,CACD,CAAC,CAIF,SAAgBE,EAAOC,EAAoD,CASzE,MARAA,GAAIlB,EACF,CACEO,KAAM,SACNc,OAAQ,GACT,CACDH,EACD,MAED,CAAA,IAAAI,EAAAC,GAAA,CAQK,OARLC,EAAAF,EAAAG,EAUKtB,EAAM,CAAA,IAAAuB,UAAA,CAAA,MAAA,CAAAD,EACJ1B,EAAK,CAAA,IAAC4B,MAAI,CAAA,OAAET,EAAEU,aAAW,IAAAF,UAA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A,IAACwD,MAAI,CAAA,OAAEH,EAAMI,SAAO7B,SAAGe,GAAMhB,EAAKR,EAAMuC,EAAKf,EAAM,CAAA,IAAEE,OAAK,CAAA,OAAES,GAAa,EAAA,CAAA,CAAA,CAAI,CAAA,CAAA,KAAA,CAAA5B,EAAA6B,EAAA5B,EAChFvB,EAAI,CAAA,IAACyB,MAAI,CAAA,OAAEwB,EAAMM,SAAO,IAAA/B,UAAA,CAAA,IAAAgC,EAAAC,GAAA,CAAAC,EAAAF,EAAAG,WAKG,OALHD,EAAAC,WAAArC,EAAAoC,MAQjBT,EAAMM,QAAO,KAAA,CAAArB,EAAAE,GAAA,CAAA,IAAAyB,EAPPtE,EAAG,4BAA6B0D,EAAMX,OAAOZ,YAAY,CAAAoC,EAE1DvE,EAAG,kCAAmC0D,EAAMX,OAAOiB,QAAQ,CAAAQ,EAEzDb,GAAa,CAAA,OAAAW,IAAAzB,EAAAM,GAAAC,EAAAa,EAAApB,EAAAM,EAAAmB,EAAA,CAAAC,IAAA1B,EAAAQ,GAAAD,EAAAe,EAAAtB,EAAAQ,EAAAkB,EAAA,CAAAC,IAAA3B,EAAA4B,GAAAnB,EAAAa,EAAA,QAAAtB,EAAA4B,EAAAD,EAAA,CAAA3B,GAAA,CAAAM,EAAAI,IAAAA,GAAAF,EAAAE,IAAAA,GAAAkB,EAAAlB,IAAAA,GAAA,CAAA,CAAAU,GAAA,CAAA,CAAA,KAAA,CAAAtB,MAAAS,EAAAQ,EAPlB5D,EAAG,0BAA2B0D,EAAMX,OAAO2B,MAAM,CAAA,CAAA,CAAAd,KAAA"}
1
+ {"version":3,"file":"avatar.js","names":["cn","cva","VariantProps","Component","createMemo","For","Match","mergeProps","ParentComponent","Show","Switch","AvatarGroup","AvatarProps","variants","mask","heart","hexagon","squircle","square","circle","status","online","offline","AvatarVariantsProps","Avatar","p","ReturnType","const","effect","_el$","_tmpl$","_$insert","_$createComponent","children","when","placeholder","Element","image","_el$2","_c$","_$memo","_el$3","_tmpl$2","_$effect","_$setAttribute","_p$","_v$","class","avatar","_v$2","width","e","_$className","t","_$setStyleProperty","undefined","root","Group","props","renderWidth","_el$4","each","avatars","_$mergeProps","counter","_el$5","_tmpl$3","_el$6","firstChild","_el$7","_v$3","_v$4","_v$5","a","group"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\r\nimport { cva, VariantProps } from 'class-variance-authority';\r\nimport {\r\n Component,\r\n createMemo,\r\n For,\r\n Match,\r\n mergeProps,\r\n ParentComponent,\r\n Show,\r\n Switch,\r\n} from 'solid-js';\r\nimport type { AvatarGroup, AvatarProps } from './avatar.types';\r\n\r\nconst variants = cva('', {\r\n variants: {\r\n mask: {\r\n heart: 'mask mask-heart',\r\n hexagon: 'mask mask-hexagon',\r\n squircle: 'mask mask-squircle',\r\n square: 'rounded-lg',\r\n circle: 'rounded-full',\r\n },\r\n status: {\r\n online: 'avatar-online',\r\n offline: 'avatar-offline',\r\n },\r\n },\r\n});\r\n\r\nexport type AvatarVariantsProps = VariantProps<typeof variants>;\r\n\r\nexport function Avatar(p: AvatarProps): ReturnType<Component<AvatarProps>> {\r\n p = mergeProps(\r\n {\r\n mask: 'circle' as const,\r\n effect: true,\r\n },\r\n p,\r\n );\r\n\r\n return (\r\n <div\r\n class={cn(\r\n 'avatar',\r\n p.placeholder && 'avatar-placeholder',\r\n variants({ status: p.status }),\r\n p.effect && 'avatar-effect',\r\n p.class?.root,\r\n )}\r\n >\r\n <Switch>\r\n <Match when={p.placeholder}>{p.placeholder as Element}</Match>\r\n <Match when={p.image}>\r\n <div\r\n class={cn(variants({ mask: p.mask }), p.class?.avatar)}\r\n style={{ width: typeof p.width === 'string' ? p.width : `${p.width}px` }}\r\n >\r\n {p.image && <img src={p.image} />}\r\n </div>\r\n </Match>\r\n </Switch>\r\n </div>\r\n );\r\n}\r\n\r\nAvatar.Group = (props: AvatarGroup): ReturnType<ParentComponent> => {\r\n const renderWidth = createMemo(() => {\r\n return typeof props.width === 'string' ? props.width : `${props.width}px`;\r\n });\r\n return (\r\n <div class={cn('avatar-group -space-x-6', props.class?.group)}>\r\n <For each={props.avatars}>{avatar => <Avatar {...avatar} width={renderWidth()} />}</For>\r\n <Show when={props.counter}>\r\n <div class={cn('avatar avatar-placeholder', props.class?.placeholder)}>\r\n <div\r\n class={cn('bg-neutral text-neutral-content', props.class?.counter)}\r\n style={{\r\n width: renderWidth(),\r\n }}\r\n >\r\n +{props.counter}\r\n </div>\r\n </div>\r\n </Show>\r\n </div>\r\n );\r\n};\r\n"],"mappings":"6YAcMa,EAAWZ,EAAI,GAAI,CACvBY,SAAU,CACRC,KAAM,CACJC,MAAO,kBACPC,QAAS,oBACTC,SAAU,qBACVC,OAAQ,aACRC,OAAQ,eACT,CACDC,OAAQ,CACNC,OAAQ,gBACRC,QAAS,iBACX,CACF,CACD,CAAC,CAIF,SAAgBE,EAAOC,EAAoD,CASzE,MARAA,GAAIlB,EACF,CACEO,KAAM,SACNc,OAAQ,GACT,CACDH,EACD,MAED,CAAA,IAAAI,EAAAC,GAAA,CAQK,OARLC,EAAAF,EAAAG,EAUKtB,EAAM,CAAA,IAAAuB,UAAA,CAAA,MAAA,CAAAD,EACJ1B,EAAK,CAAA,IAAC4B,MAAI,CAAA,OAAET,EAAEU,aAAW,IAAAF,UAAA,CAAA,OAAGR,EAAEU,aAAsB,CAAA,CAAAH,EACpD1B,EAAK,CAAA,IAAC4B,MAAI,CAAA,OAAET,EAAEY,OAAK,IAAAJ,UAAA,CAAA,IAAAK,EAAAR,GAAA,CAGsD,OAHtDC,EAAAO,OAAA,CAAA,IAAAC,EAAAC,MAAA,CAAA,CAKff,EAAEY,MAAK,CAAA,UAAPE,GAAA,OAAA,CAAA,IAAAE,EAAAC,GAAA,CAA4B,OAA5BC,MAAAC,EAAAH,EAAA,MAAqBhB,EAAEY,MAAK,CAAA,CAAAI,KAAI,IAAA,CAAA,CAAAE,EAAAE,GAAA,CAAA,IAAAC,EAH1B9C,EAAGa,E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PPtE,EAAG,4BAA6B0D,EAAMX,OAAOZ,YAAY,CAAAoC,EAE1DvE,EAAG,kCAAmC0D,EAAMX,OAAOiB,QAAQ,CAAAQ,EAEzDb,GAAa,CAAA,OAAAW,IAAAzB,EAAAM,GAAAC,EAAAa,EAAApB,EAAAM,EAAAmB,EAAA,CAAAC,IAAA1B,EAAAQ,GAAAD,EAAAe,EAAAtB,EAAAQ,EAAAkB,EAAA,CAAAC,IAAA3B,EAAA4B,GAAAnB,EAAAa,EAAA,QAAAtB,EAAA4B,EAAAD,EAAA,CAAA3B,GAAA,CAAAM,EAAAI,IAAAA,GAAAF,EAAAE,IAAAA,GAAAkB,EAAAlB,IAAAA,GAAA,CAAA,CAAAU,GAAA,CAAA,CAAA,KAAA,CAAAtB,MAAAS,EAAAQ,EAPlB5D,EAAG,0BAA2B0D,EAAMX,OAAO2B,MAAM,CAAA,CAAA,CAAAd,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["cn","cva","VariantProps","Component","mergeProps","BadgeProps","getColor","variants","size","xs","sm","md","lg","xl","outline","soft","dashed","BadgeVariantsProps","Badge","p","color","content","const","_el$","_tmpl$","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$effect","_$className","class","child","_el$3","Element","root"],"sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport { Component, mergeProps } from 'solid-js';\nimport type { BadgeProps } from './badge.types';\nimport { getColor } from '@/utils/helper';\n\nconst variants = cva('', {\n variants: {\n size: {\n '3xs': 'bad-3xs',\n '2xs': 'bad-2xs',\n xs: 'bad-xs',\n sm: 'bad-sm',\n md: 'bad-md',\n lg: 'bad-lg',\n xl: 'bad-xl',\n '2xl': 'bad-2xl',\n '3xl': 'bad-3xl',\n },\n variants: {\n outline: 'bad03',\n soft: 'bad02',\n dashed: 'bad04',\n },\n },\n});\nexport type BadgeVariantsProps = VariantProps<typeof variants>;\n\nexport const Badge: Component<BadgeProps> = p => {\n p = mergeProps({ size: 'md', color: 'primary', content: 'lorem', variants: 'soft' } as const, p);\n\n return (\n <div\n class={cn(\n 'bad00',\n variants({ size: p.size, variants: p.variants }),\n getColor(p.color),\n p.class?.root,\n )}\n >\n {typeof p.content === 'string' ? (\n <span class={cn('bad01', p.class?.child)}>{p.content}</span>\n ) : (\n <div class={p.class?.child}>{p.content as Element}</div>\n )}\n </div>\n );\n};\n"],"mappings":"qSAMMO,EAAWN,EAAI,GAAI,CACvBM,SAAU,CACRC,KAAM,CACJ,MAAO,UACP,MAAO,UACPC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJ,MAAO,UACP,MAAO,UACR,CACDN,SAAU,CACRO,QAAS,QACTC,KAAM,QACNC,OAAQ,QACV,CACF,CACD,CAAC,CAGWE,EAA+BC,IAC1CA,EAAIf,EAAW,CAAEI,KAAM,KAAMY,MAAO,UAAWC,QAAS,QAASd,SAAU,OAAQ,CAAWY,EAAE,MAEhG,CAAA,IAAAI,EAAAC,GAAA,CAOK,OAPLC,EAAAF,OAAA,CAAA,IAAAG,EAAAC,MASK,OAAOR,EAAEE,SAAY,SAAQ,CAAA,UAA7BK,GAAA,MAAA,CAAA,IAAAE,EAAAC,GAAA,CACyC,OADzCJ,EAAAG,MAC4CT,EAAEE,QAAO,CAAAS,MAAAC,EAAAH,EAAvC5B,EAAG,QAASmB,EAAEa,OAAOC,MAAM,CAAA,CAAA,CAAAL,KAAA,MAAA,CAAA,IAAAM,EAAAV,GAAA,CAEd,OAFcC,EAAAS,MAEXf,EAAEE,QAAkB,CAAAS,MAAAC,EAAAG,EAArCf,EAAEa,OAAOC,MAAK,CAAA,CAAAC,KAC3B,IAAA,CAAA,CAAAJ,MAAAC,EAAAR,EAXMvB,EACL,QACAO,EAAS,CAAEC,KAAMW,EAAEX,KAAMD,SAAUY,EAAEZ,SAAU,CAAC,CAChDD,EAASa,EAAEC,MAAM,CACjBD,EAAEa,OAAOI,KACV,CAAA,CAAA,CAAAb,KAAA"}
1
+ {"version":3,"file":"badge.js","names":["cn","cva","VariantProps","Component","mergeProps","BadgeProps","getColor","variants","size","xs","sm","md","lg","xl","outline","soft","dashed","BadgeVariantsProps","Badge","p","color","content","const","_el$","_tmpl$","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$effect","_$className","class","child","_el$3","Element","root"],"sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\r\nimport { cva, VariantProps } from 'class-variance-authority';\r\nimport { Component, mergeProps } from 'solid-js';\r\nimport type { BadgeProps } from './badge.types';\r\nimport { getColor } from '@/utils/helper';\r\n\r\nconst variants = cva('', {\r\n variants: {\r\n size: {\r\n '3xs': 'bad-3xs',\r\n '2xs': 'bad-2xs',\r\n xs: 'bad-xs',\r\n sm: 'bad-sm',\r\n md: 'bad-md',\r\n lg: 'bad-lg',\r\n xl: 'bad-xl',\r\n '2xl': 'bad-2xl',\r\n '3xl': 'bad-3xl',\r\n },\r\n variants: {\r\n outline: 'bad03',\r\n soft: 'bad02',\r\n dashed: 'bad04',\r\n },\r\n },\r\n});\r\nexport type BadgeVariantsProps = VariantProps<typeof variants>;\r\n\r\nexport const Badge: Component<BadgeProps> = p => {\r\n p = mergeProps({ size: 'md', color: 'primary', content: 'lorem', variants: 'soft' } as const, p);\r\n\r\n return (\r\n <div\r\n class={cn(\r\n 'bad00',\r\n variants({ size: p.size, variants: p.variants }),\r\n getColor(p.color),\r\n p.class?.root,\r\n )}\r\n >\r\n {typeof p.content === 'string' ? (\r\n <span class={cn('bad01', p.class?.child)}>{p.content}</span>\r\n ) : (\r\n <div class={p.class?.child}>{p.content as Element}</div>\r\n )}\r\n </div>\r\n );\r\n};\r\n"],"mappings":"qSAMMO,EAAWN,EAAI,GAAI,CACvBM,SAAU,CACRC,KAAM,CACJ,MAAO,UACP,MAAO,UACPC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJC,GAAI,SACJ,MAAO,UACP,MAAO,UACR,CACDN,SAAU,CACRO,QAAS,QACTC,KAAM,QACNC,OAAQ,QACV,CACF,CACD,CAAC,CAGWE,EAA+BC,IAC1CA,EAAIf,EAAW,CAAEI,KAAM,KAAMY,MAAO,UAAWC,QAAS,QAASd,SAAU,OAAQ,CAAWY,EAAE,MAEhG,CAAA,IAAAI,EAAAC,GAAA,CAOK,OAPLC,EAAAF,OAAA,CAAA,IAAAG,EAAAC,MASK,OAAOR,EAAEE,SAAY,SAAQ,CAAA,UAA7BK,GAAA,MAAA,CAAA,IAAAE,EAAAC,GAAA,CACyC,OADzCJ,EAAAG,MAC4CT,EAAEE,QAAO,CAAAS,MAAAC,EAAAH,EAAvC5B,EAAG,QAASmB,EAAEa,OAAOC,MAAM,CAAA,CAAA,CAAAL,KAAA,MAAA,CAAA,IAAAM,EAAAV,GAAA,CAEd,OAFcC,EAAAS,MAEXf,EAAEE,QAAkB,CAAAS,MAAAC,EAAAG,EAArCf,EAAEa,OAAOC,MAAK,CAAA,CAAAC,KAC3B,IAAA,CAAA,CAAAJ,MAAAC,EAAAR,EAXMvB,EACL,QACAO,EAAS,CAAEC,KAAMW,EAAEX,KAAMD,SAAUY,EAAEZ,SAAU,CAAC,CAChDD,EAASa,EAAEC,MAAM,CACjBD,EAAEa,OAAOI,KACV,CAAA,CAAA,CAAAb,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","names":["SolidComponent","cn","Component","createMemo","For","BreadcrumbProps","items","class","Partial","Record","separate","onItemClick","e","MouseEvent","Breadcrumb","p","length","_el$","_tmpl$","_el$2","firstChild","$$click","target","tagName","_$insert","_$createComponent","each","children","item","index","_el$3","_tmpl$2","Element","_$effect","_$className","_$memo","root","_$delegateEvents"],"sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { SolidComponent } from '@/type';\nimport { cn } from '@/utils/cn';\nimport { Component, createMemo, For } from 'solid-js';\n\ntype BreadcrumbProps = {\n items: SolidComponent[];\n class?: Partial<Record<'root' | 'item', string>>;\n separate?: SolidComponent;\n onItemClick?: (e: MouseEvent) => void;\n};\nexport const Breadcrumb: Component<BreadcrumbProps> = p => {\n const length = createMemo(() => p.items.length - 1);\n return (\n <div class={cn('breadcrumbs', p.separate && 'separate', p.class?.root)}>\n <ul\n onClick={e => {\n if (e.target.tagName !== 'UL' && p.onItemClick) {\n p.onItemClick(e);\n }\n }}\n >\n <For each={p.items}>\n {(item, index) => {\n return (\n <>\n <li class={p.class?.item}>{item as Element}</li>\n {index() < length() && p.separate}\n </>\n );\n }}\n </For>\n </ul>\n </div>\n );\n};\n"],"mappings":"yPAUac,EAAyCC,GAAK,CACzD,IAAMC,EAASb,MAAiBY,EAAET,MAAMU,OAAS,EAAE,CACnD,WAAA,CAAA,IAAAC,EAAAC,GAAA,CAAAC,EAAAF,EAAAG,WACwE,MADxED,GAAAE,QAGeT,GAAK,CACRA,EAAEU,OAAOC,UAAY,MAAQR,EAAEJ,aACjCI,EAAEJ,YAAYC,EAAE,EAEnBY,EAAAL,EAAAM,EAEArB,EAAG,CAAA,IAACsB,MAAI,CAAA,OAAEX,EAAET,OAAKqB,UACdC,EAAMC,IACN,MAAA,CAAA,IAAAC,EAAAC,GAAA,CAE4B,OAF5BP,EAAAM,EAE+BF,EAAe,CAAAK,MAAAC,EAAAJ,EAA/Bf,EAAER,OAAOqB,KAAI,CAAA,CAAAE,KAAA,CAAAK,MACvBA,MAAAN,GAAO,CAAGb,GAAQ,CAAA,EAAA,EAAID,EAAEL,SAAQ,CAAA,CAGtC,CAAA,CAAA,CAAAuB,MAAAC,EAAAjB,EAhBKhB,EAAG,cAAec,EAAEL,UAAY,WAAYK,EAAER,OAAO6B,KAAK,CAAA,CAAA,CAAAnB,KAAA,EAqBxEoB,EAAA,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"breadcrumb.js","names":["SolidComponent","cn","Component","createMemo","For","BreadcrumbProps","items","class","Partial","Record","separate","onItemClick","e","MouseEvent","Breadcrumb","p","length","_el$","_tmpl$","_el$2","firstChild","$$click","target","tagName","_$insert","_$createComponent","each","children","item","index","_el$3","_tmpl$2","Element","_$effect","_$className","_$memo","root","_$delegateEvents"],"sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { SolidComponent } from '@/type';\r\nimport { cn } from '@/utils/cn';\r\nimport { Component, createMemo, For } from 'solid-js';\r\n\r\ntype BreadcrumbProps = {\r\n items: SolidComponent[];\r\n class?: Partial<Record<'root' | 'item', string>>;\r\n separate?: SolidComponent;\r\n onItemClick?: (e: MouseEvent) => void;\r\n};\r\nexport const Breadcrumb: Component<BreadcrumbProps> = p => {\r\n const length = createMemo(() => p.items.length - 1);\r\n return (\r\n <div class={cn('breadcrumbs', p.separate && 'separate', p.class?.root)}>\r\n <ul\r\n onClick={e => {\r\n if (e.target.tagName !== 'UL' && p.onItemClick) {\r\n p.onItemClick(e);\r\n }\r\n }}\r\n >\r\n <For each={p.items}>\r\n {(item, index) => {\r\n return (\r\n <>\r\n <li class={p.class?.item}>{item as Element}</li>\r\n {index() < length() && p.separate}\r\n </>\r\n );\r\n }}\r\n </For>\r\n </ul>\r\n </div>\r\n );\r\n};\r\n"],"mappings":"yPAUac,EAAyCC,GAAK,CACzD,IAAMC,EAASb,MAAiBY,EAAET,MAAMU,OAAS,EAAE,CACnD,WAAA,CAAA,IAAAC,EAAAC,GAAA,CAAAC,EAAAF,EAAAG,WACwE,MADxED,GAAAE,QAGeT,GAAK,CACRA,EAAEU,OAAOC,UAAY,MAAQR,EAAEJ,aACjCI,EAAEJ,YAAYC,EAAE,EAEnBY,EAAAL,EAAAM,EAEArB,EAAG,CAAA,IAACsB,MAAI,CAAA,OAAEX,EAAET,OAAKqB,UACdC,EAAMC,IACN,MAAA,CAAA,IAAAC,EAAAC,GAAA,CAE4B,OAF5BP,EAAAM,EAE+BF,EAAe,CAAAK,MAAAC,EAAAJ,EAA/Bf,EAAER,OAAOqB,KAAI,CAAA,CAAAE,KAAA,CAAAK,MACvBA,MAAAN,GAAO,CAAGb,GAAQ,CAAA,EAAA,EAAID,EAAEL,SAAQ,CAAA,CAGtC,CAAA,CAAA,CAAAuB,MAAAC,EAAAjB,EAhBKhB,EAAG,cAAec,EAAEL,UAAY,WAAYK,EAAER,OAAO6B,KAAK,CAAA,CAAA,CAAAnB,KAAA,EAqBxEoB,EAAA,CAAA,QAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["cn","cva","VariantProps","Component","Match","mergeProps","splitProps","Switch","ButtonProps","Opacity","from","to","rippleAnimate","target","HTMLButtonElement","duration","opacity","animate","boxShadow","easing","variants","size","xs","sm","md","lg","xl","color","neutral","primary","secondary","accent","info","success","warning","error","variant","default","simple","solid","outline","dashed","soft","text","link","shape","circle","square","loadingType","dots","ring","ball","bars","infinity","spinner","ButtonVariantsProps","Button","props","merge","const","disabled","loading","class","iconPlacement","loadingOptions","type","isShape","p","nativeProps","handleClick","e","MouseEvent","onClick","currentTarget","_el$","_tmpl$2","_$spread","_$mergeProps","icon","_$insert","_$createComponent","children","when","_el$2","_tmpl$","_$effect","_p$","_v$","_v$2","_$className","t","_$setStyleProperty","undefined","_$memo","Element","_c$","_el$3","_tmpl$3"],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Component, Match, mergeProps, splitProps, Switch } from 'solid-js';\nimport { ButtonProps } from './button.types';\n\ntype Opacity = {\n from: string;\n to: string;\n};\nexport function rippleAnimate(\n target: HTMLButtonElement,\n duration: number = 300,\n opacity: Opacity = { from: '20%', to: '10%' },\n) {\n if (!target) return;\n target.animate(\n [\n { boxShadow: `0 0 0 0 rgba(from var(--btn-color) r g b / ${opacity.from})` },\n { boxShadow: `0 0 0 6px rgba(from var(--btn-color) r g b / ${opacity.to})` },\n ],\n {\n duration,\n easing: 'linear',\n },\n );\n}\nconst variants = cva('', {\n variants: {\n size: {\n '4xs': 'bt-4xs',\n '3xs': 'bt-3xs',\n '2xs': 'bt-2xs',\n xs: 'bt-xs',\n sm: 'bt-sm',\n md: 'bt-md',\n lg: 'bt-lg',\n xl: 'bt-xl',\n '2xl': 'bt-2xl',\n '3xl': 'bt-3xl',\n '4xl': 'bt-4xl',\n },\n color: {\n neutral: 'btn-neutral',\n primary: 'btn-primary',\n secondary: 'btn-secondary',\n accent: 'btn-accent',\n info: 'btn-info',\n success: 'btn-success',\n warning: 'btn-warning',\n error: 'btn-error',\n },\n variant: {\n default: 'btn-default',\n simple: 'btn-default border-transparent',\n solid: '',\n outline: 'btn-outline',\n dashed: 'btn-dash',\n soft: 'btn-soft',\n text: 'btn-ghost',\n link: 'btn-link',\n },\n shape: {\n circle: 'aspect-square rounded-full',\n square: 'aspect-square',\n },\n loadingType: {\n dots: 'loading-dots',\n ring: 'loading-ring',\n ball: 'loading-ball',\n bars: 'loading-bars',\n infinity: 'loading-infinity',\n spinner: 'loading-spinner',\n },\n },\n});\nexport type ButtonVariantsProps = VariantProps<typeof variants>;\n\nexport const Button: Component<ButtonProps> = props => {\n const merge = mergeProps(\n {\n size: 'sm' as const,\n disabled: false,\n loading: false,\n color: 'secondary' as const,\n class: void 0,\n iconPlacement: 'start',\n loadingOptions: {\n type: 'spinner' as const,\n size: 20,\n },\n animate: 'ripple' as const,\n },\n props,\n );\n const isShape = merge.shape === 'square' || merge.shape === 'circle';\n const [p, nativeProps] = splitProps(merge, [\n 'size',\n 'iconPlacement',\n 'loading',\n 'variant',\n 'color',\n 'shape',\n 'icon',\n 'children',\n 'class',\n 'disabled',\n 'onClick',\n 'loadingOptions',\n 'animate',\n ]);\n const handleClick = (e: MouseEvent) => {\n p.onClick?.(e);\n if (p.animate === 'ripple') {\n const target = e.currentTarget as HTMLButtonElement;\n switch (p.variant) {\n case 'default':\n case 'simple':\n case 'link':\n return rippleAnimate(target, 300, { from: '8%', to: '2%' });\n default:\n return rippleAnimate(target);\n }\n }\n };\n return (\n <button\n {...nativeProps}\n class={cn(\n 'sbt',\n variants({ size: p.size, color: p.color, variant: p.variant, shape: p.shape }),\n !isShape && p.icon && (p.iconPlacement === 'start' ? 'flex-row' : 'flex-row-reverse'),\n p.icon && '[&_svg]:shrink-0',\n p.animate !== 'translate' && 'active:translate-none',\n p.class,\n )}\n {...(p.shape && { 'data-shape': p.shape })}\n onClick={handleClick}\n disabled={p.disabled || p.loading}\n >\n <Switch>\n <Match when={p.loading}>\n <span\n class={cn('loading shrink-0', variants({ loadingType: p.loadingOptions?.type }))}\n style={{ width: `${p.loadingOptions?.size}px` }}\n ></span>\n </Match>\n\n <Match when={!p.loading && p.icon}>{p.icon! as Element}</Match>\n </Switch>\n {!isShape && p.children && <span class=\"mb-px\">{p.children}</span>}\n </button>\n );\n};\n"],"mappings":"+XASA,SAAgBY,EACdC,EACAE,EAAmB,IACnBC,EAAmB,CAAEN,KAAM,MAAOC,GAAI,MAAO,CAC7C,CACKE,GACLA,EAAOI,QACL,CACE,CAAEC,UAAW,8CAA8CF,EAAQN,KAAI,GAAK,CAC5E,CAAEQ,UAAW,gDAAgDF,EAAQL,GAAE,GAAK,CAC7E,CACD,CACEI,WACAI,OAAQ,SAEZ,CAAC,CAEH,IAAMC,EAAWnB,EAAI,GAAI,CACvBmB,SAAU,CACRC,KAAM,CACJ,MAAO,SACP,MAAO,SACP,MAAO,SACPC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJ,MAAO,SACP,MAAO,SACP,MAAO,SACR,CACDC,MAAO,CACLC,QAAS,cACTC,QAAS,cACTC,UAAW,gBACXC,OAAQ,aACRC,KAAM,WACNC,QAAS,cACTC,QAAS,cACTC,MAAO,YACR,CACDC,QAAS,CACPC,QAAS,cACTC,OAAQ,iCACRC,MAAO,GACPC,QAAS,cACTC,OAAQ,WACRC,KAAM,WACNC,KAAM,YACNC,KAAM,WACP,CACDC,MAAO,CACLC,OAAQ,6BACRC,OAAQ,gBACT,CACDC,YAAa,CACXC,KAAM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EAAEN,SAAO,CAAA,CAAA,GAAA,GAAA,CAAAkB,EAAAL,EAAAM,EAEhCzE,EAAM,CAAA,IAAA0E,UAAA,CAAA,MAAA,CAAAD,EACJ5E,EAAK,CAAA,IAAC8E,MAAI,CAAA,OAAEf,EAAEN,SAAO,IAAAoB,UAAA,CAAA,IAAAE,EAAAC,GAAA,CAG2B,OAH3BC,EAAAC,GAAA,CAAA,IAAAC,EAEXvF,EAAG,mBAAoBoB,EAAS,CAAE4B,YAAamB,EAAEH,gBAAgBC,KAAM,CAAC,CAAC,CAAAuB,EAChE,GAAGrB,EAAEH,gBAAgB3C,KAAI,IAAI,OAAAkE,IAAAD,EAAAhB,GAAAmB,EAAAN,EAAAG,EAAAhB,EAAAiB,EAAA,CAAAC,IAAAF,EAAAI,GAAAC,EAAAR,EAAA,QAAAG,EAAAI,EAAAF,EAAA,CAAAF,GAAA,CAAAhB,EAAAsB,IAAAA,GAAAF,EAAAE,IAAAA,GAAA,CAAA,CAAAT,GAAA,CAAA,CAAAH,EAIhD5E,EAAK,CAAA,IAAC8E,MAAI,CAAA,OAAEW,MAAA,CAAC1B,EAAEN,QAAO,EAAA,EAAIM,EAAEW,MAAI,IAAAG,UAAA,CAAA,OAAGd,EAAEW,MAAgB,CAAA,CAAA,EAAA,CAAA,CAAA,KAAA,CAAAC,EAAAL,OAAA,CAAA,IAAAqB,EAAAF,MAAA,CAAA,EAEvD,CAAC3B,GAAWC,EAAEc,UAAQ,CAAA,UAAtBc,GAAA,OAAA,CAAA,IAAAC,EAAAC,GAAA,CAAyD,OAAzDlB,EAAAiB,MAA+C7B,EAAEc,SAAQ,CAAAe,KAAQ,IAAA,CAAA,KAAA,CAAAtB,KAAA"}
1
+ {"version":3,"file":"button.js","names":["cn","cva","VariantProps","Component","Match","mergeProps","splitProps","Switch","ButtonProps","Opacity","from","to","rippleAnimate","target","HTMLButtonElement","duration","opacity","animate","boxShadow","easing","variants","size","xs","sm","md","lg","xl","color","neutral","primary","secondary","accent","info","success","warning","error","variant","default","simple","solid","outline","dashed","soft","text","link","shape","circle","square","loadingType","dots","ring","ball","bars","infinity","spinner","ButtonVariantsProps","Button","props","merge","const","disabled","loading","class","iconPlacement","loadingOptions","type","isShape","p","nativeProps","handleClick","e","MouseEvent","onClick","currentTarget","_el$","_tmpl$2","_$spread","_$mergeProps","icon","_$insert","_$createComponent","children","when","_el$2","_tmpl$","_$effect","_p$","_v$","_v$2","_$className","t","_$setStyleProperty","undefined","_$memo","Element","_c$","_el$3","_tmpl$3"],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cn } from '@/utils/cn';\r\nimport { cva, type VariantProps } from 'class-variance-authority';\r\nimport { Component, Match, mergeProps, splitProps, Switch } from 'solid-js';\r\nimport { ButtonProps } from './button.types';\r\n\r\ntype Opacity = {\r\n from: string;\r\n to: string;\r\n};\r\nexport function rippleAnimate(\r\n target: HTMLButtonElement,\r\n duration: number = 300,\r\n opacity: Opacity = { from: '20%', to: '10%' },\r\n) {\r\n if (!target) return;\r\n target.animate(\r\n [\r\n { boxShadow: `0 0 0 0 rgba(from var(--btn-color) r g b / ${opacity.from})` },\r\n { boxShadow: `0 0 0 6px rgba(from var(--btn-color) r g b / ${opacity.to})` },\r\n ],\r\n {\r\n duration,\r\n easing: 'linear',\r\n },\r\n );\r\n}\r\nconst variants = cva('', {\r\n variants: {\r\n size: {\r\n '4xs': 'bt-4xs',\r\n '3xs': 'bt-3xs',\r\n '2xs': 'bt-2xs',\r\n xs: 'bt-xs',\r\n sm: 'bt-sm',\r\n md: 'bt-md',\r\n lg: 'bt-lg',\r\n xl: 'bt-xl',\r\n '2xl': 'bt-2xl',\r\n '3xl': 'bt-3xl',\r\n '4xl': 'bt-4xl',\r\n },\r\n color: {\r\n neutral: 'btn-neutral',\r\n primary: 'btn-primary',\r\n secondary: 'btn-secondary',\r\n accent: 'btn-accent',\r\n info: 'btn-info',\r\n success: 'btn-success',\r\n warning: 'btn-warning',\r\n error: 'btn-error',\r\n },\r\n variant: {\r\n default: 'btn-default',\r\n simple: 'btn-default border-transparent',\r\n solid: '',\r\n outline: 'btn-outline',\r\n dashed: 'btn-dash',\r\n soft: 'btn-soft',\r\n text: 'btn-ghost',\r\n link: 'btn-link',\r\n },\r\n shape: {\r\n circle: 'aspect-square rounded-full',\r\n square: 'aspect-square',\r\n },\r\n loadingType: {\r\n dots: 'loading-dots',\r\n ring: 'loading-ring',\r\n ball: 'loading-ball',\r\n bars: 'loading-bars',\r\n infinity: 'loading-infinity',\r\n spinner: 'loading-spinner',\r\n },\r\n },\r\n});\r\nexport type ButtonVariantsProps = VariantProps<typeof variants>;\r\n\r\nexport const Button: Component<ButtonProps> = props => {\r\n const merge = mergeProps(\r\n {\r\n size: 'sm' as const,\r\n disabled: false,\r\n loading: false,\r\n color: 'secondary' as const,\r\n class: void 0,\r\n iconPlacement: 'start',\r\n loadingOptions: {\r\n type: 'spinner' as const,\r\n size: 20,\r\n },\r\n animate: 'ripple' as const,\r\n },\r\n props,\r\n );\r\n const isShape = merge.shape === 'square' || merge.shape === 'circle';\r\n const [p, nativeProps] = splitProps(merge, [\r\n 'size',\r\n 'iconPlacement',\r\n 'loading',\r\n 'variant',\r\n 'color',\r\n 'shape',\r\n 'icon',\r\n 'children',\r\n 'class',\r\n 'disabled',\r\n 'onClick',\r\n 'loadingOptions',\r\n 'animate',\r\n ]);\r\n const handleClick = (e: MouseEvent) => {\r\n p.onClick?.(e);\r\n if (p.animate === 'ripple') {\r\n const target = e.currentTarget as HTMLButtonElement;\r\n switch (p.variant) {\r\n case 'default':\r\n case 'simple':\r\n case 'link':\r\n return rippleAnimate(target, 300, { from: '8%', to: '2%' });\r\n default:\r\n return rippleAnimate(target);\r\n }\r\n }\r\n };\r\n return (\r\n <button\r\n {...nativeProps}\r\n class={cn(\r\n 'sbt',\r\n variants({ size: p.size, color: p.color, variant: p.variant, shape: p.shape }),\r\n !isShape && p.icon && (p.iconPlacement === 'start' ? 'flex-row' : 'flex-row-reverse'),\r\n p.icon && '[&_svg]:shrink-0',\r\n p.animate !== 'translate' && 'active:translate-none',\r\n p.class,\r\n )}\r\n {...(p.shape && { 'data-shape': p.shape })}\r\n onClick={handleClick}\r\n disabled={p.disabled || p.loading}\r\n >\r\n <Switch>\r\n <Match when={p.loading}>\r\n <span\r\n class={cn('loading shrink-0', variants({ loadingType: p.loadingOptions?.type }))}\r\n style={{ width: `${p.loadingOptions?.size}px` }}\r\n ></span>\r\n </Match>\r\n\r\n <Match when={!p.loading && p.icon}>{p.icon! as Element}</Match>\r\n </Switch>\r\n {!isShape && p.children && <span class=\"mb-px\">{p.children}</span>}\r\n </button>\r\n );\r\n};\r\n"],"mappings":"+XASA,SAAgBY,EACdC,EACAE,EAAmB,IACnBC,EAAmB,CAAEN,KAAM,MAAOC,GAAI,MAAO,CAC7C,CACKE,GACLA,EAAOI,QACL,CACE,CAAEC,UAAW,8CAA8CF,EAAQN,KAAI,GAAK,CAC5E,CAAEQ,UAAW,gDAAgDF,EAAQL,GAAE,GAAK,CAC7E,CACD,CACEI,WACAI,OAAQ,SAEZ,CAAC,CAEH,IAAMC,EAAWnB,EAAI,GAAI,CACvBmB,SAAU,CACRC,KAAM,CACJ,MAAO,SACP,MAAO,SACP,MAAO,SACPC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJC,GAAI,QACJ,MAAO,SACP,MAAO,SACP,MAAO,SACR,CACDC,MAAO,CACLC,QAAS,cACTC,QAAS,cACTC,UAAW,gBACXC,OAAQ,aACRC,KAAM,WACNC,QAAS,cACTC,QAAS,cACTC,MAAO,YACR,CACDC,QAAS,CACPC,QAAS,cACTC,OAAQ,iCACRC,MAAO,GACPC,QAAS,cACTC,OAAQ,WACRC,KAAM,WACNC,KAAM,YACNC,KAAM,WACP,CACDC,MAAO,CACLC,OAAQ,6BACRC,OAAQ,gBACT,CACDC,YAAa,CACXC,KAAM,eACNC,KAAM,eACNC,KAAM,eACNC,KAAM,eACNC,SAAU,mBACVC,QAAS,kBACX,CACF,C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