solid-tom-ui 0.2.0 → 0.2.1
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 +49 -98
- package/dist/lib.d.ts +0 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/dist/components/blank/blank.js +0 -2
- package/dist/components/blank/blank.js.map +0 -1
package/README.md
CHANGED
|
@@ -17,12 +17,16 @@ Built on **Tailwind CSS 4** and **DaisyUI 5**, leveraging SolidJS fine-grained r
|
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
npm install solid-tom-ui
|
|
20
|
+
|
|
21
|
+
pnpm i solid-tom-ui
|
|
22
|
+
|
|
23
|
+
bun i solid-tom-ui
|
|
20
24
|
```
|
|
21
25
|
|
|
22
26
|
### Peer dependencies
|
|
23
27
|
|
|
24
28
|
```bash
|
|
25
|
-
npm install solid-js
|
|
29
|
+
npm install solid-js
|
|
26
30
|
```
|
|
27
31
|
|
|
28
32
|
Optional (only needed for specific components):
|
|
@@ -42,7 +46,17 @@ Optional (only needed for specific components):
|
|
|
42
46
|
@import 'solid-tom-ui/styles';
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
Make sure this CSS file is imported in your app entry point:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
// src/index.tsx
|
|
53
|
+
import './app.css';
|
|
54
|
+
import { render } from 'solid-js/web';
|
|
55
|
+
import App from './App';
|
|
56
|
+
|
|
57
|
+
render(() => <App />, document.getElementById('root')!);
|
|
58
|
+
```
|
|
59
|
+
---
|
|
46
60
|
|
|
47
61
|
### 2. Use components
|
|
48
62
|
|
|
@@ -60,38 +74,47 @@ function App() {
|
|
|
60
74
|
|
|
61
75
|
---
|
|
62
76
|
|
|
63
|
-
|
|
77
|
+
## Advanced Setup (Custom Theme)
|
|
64
78
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npm install tailwindcss daisyui
|
|
69
|
-
```
|
|
79
|
+
Overwrite css variable
|
|
70
80
|
|
|
71
81
|
```css
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
:root {
|
|
83
|
+
--color-base-100: white;
|
|
84
|
+
--color-base-content: black;
|
|
75
85
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
86
|
+
--color-primary: red;
|
|
87
|
+
--color-primary-content: white;
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
--color-secondary: red;
|
|
90
|
+
--color-secondary-content: white;
|
|
91
|
+
|
|
92
|
+
--color-accent: red;
|
|
93
|
+
--color-accent-content: white;
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
--color-neutral: red;
|
|
96
|
+
--color-neutral-content: white;
|
|
83
97
|
|
|
84
|
-
|
|
98
|
+
--color-info: red;
|
|
99
|
+
--color-info-content: white;
|
|
85
100
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
| `solidUi` | Light (default) | `data-theme="solidUi"` |
|
|
89
|
-
| `dim` | Dark (prefers-dark) | `data-theme="dim"` |
|
|
101
|
+
--color-success: red;
|
|
102
|
+
--color-success-content: white;
|
|
90
103
|
|
|
91
|
-
|
|
104
|
+
--color-warning: red;
|
|
105
|
+
--color-warning-content: white;
|
|
92
106
|
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
--color-error: red;
|
|
108
|
+
--color-error-content: white;
|
|
109
|
+
--radius-selector: 8px;
|
|
110
|
+
--radius-field: 4px;
|
|
111
|
+
--radius-box: 6px;
|
|
112
|
+
--size-selector: 4px;
|
|
113
|
+
--size-field: 4px;
|
|
114
|
+
--border: 1px;
|
|
115
|
+
--depth: 0;
|
|
116
|
+
--noise: 0;
|
|
117
|
+
}
|
|
95
118
|
```
|
|
96
119
|
|
|
97
120
|
---
|
|
@@ -162,7 +185,7 @@ document.documentElement.setAttribute('data-theme', 'dim');
|
|
|
162
185
|
### Utilities
|
|
163
186
|
| Component | Description |
|
|
164
187
|
|-----------|-------------|
|
|
165
|
-
| `
|
|
188
|
+
| `CodePreview` | Code preview |
|
|
166
189
|
|
|
167
190
|
---
|
|
168
191
|
|
|
@@ -201,78 +224,6 @@ Every component exposes a `class` prop to override individual slots:
|
|
|
201
224
|
/>
|
|
202
225
|
```
|
|
203
226
|
|
|
204
|
-
### Utilities
|
|
205
|
-
|
|
206
|
-
```tsx
|
|
207
|
-
import { cn, getColor, renderCSSAnimation, createThrottle } from 'solid-tom-ui';
|
|
208
|
-
|
|
209
|
-
// Tailwind class merging
|
|
210
|
-
cn('btn btn-primary', isActive && 'btn-active', props.class);
|
|
211
|
-
|
|
212
|
-
// Get DaisyUI color class
|
|
213
|
-
getColor('primary'); // → 'color-primary'
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Toast
|
|
217
|
-
|
|
218
|
-
```tsx
|
|
219
|
-
import { toast, Toaster } from 'solid-tom-ui';
|
|
220
|
-
|
|
221
|
-
// Add <Toaster /> once at the app root
|
|
222
|
-
function App() {
|
|
223
|
-
return (
|
|
224
|
-
<>
|
|
225
|
-
<Toaster />
|
|
226
|
-
<MyPage />
|
|
227
|
-
</>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Use anywhere
|
|
232
|
-
toast.success('Saved!');
|
|
233
|
-
toast.error('Something went wrong', { duration: 5000 });
|
|
234
|
-
toast.info('New update available');
|
|
235
|
-
toast.warning('Disk space low');
|
|
236
|
-
toast('Custom message', { color: 'accent' });
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
## Table
|
|
240
|
-
|
|
241
|
-
The `Table` component supports virtual scrolling, column pinning, sort, filter, expandable rows, and pagination via `@tanstack/solid-table`.
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
import { Table } from 'solid-tom-ui';
|
|
245
|
-
import { createSolidTable, getCoreRowModel } from '@tanstack/solid-table';
|
|
246
|
-
|
|
247
|
-
const table = createSolidTable({
|
|
248
|
-
get data() { return rows(); },
|
|
249
|
-
columns,
|
|
250
|
-
getCoreRowModel: getCoreRowModel(),
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
<Table table={table} height={400} />
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## Input variants
|
|
257
|
-
|
|
258
|
-
```tsx
|
|
259
|
-
import {
|
|
260
|
-
InputText,
|
|
261
|
-
InputPassword,
|
|
262
|
-
InputNumber,
|
|
263
|
-
InputTextarea,
|
|
264
|
-
InputOTP,
|
|
265
|
-
InputRange,
|
|
266
|
-
InputColor,
|
|
267
|
-
InputDate,
|
|
268
|
-
} from 'solid-tom-ui';
|
|
269
|
-
|
|
270
|
-
<InputText placeholder="Name" />
|
|
271
|
-
<InputPassword placeholder="Password" />
|
|
272
|
-
<InputNumber min={0} max={100} />
|
|
273
|
-
<InputOTP length={6} onComplete={code => verify(code)} />
|
|
274
|
-
```
|
|
275
|
-
|
|
276
227
|
## TypeScript
|
|
277
228
|
|
|
278
229
|
All prop types are exported:
|
|
@@ -283,4 +234,4 @@ import type { ButtonProps, ModalProps, BaseColorProps, SolidComponent } from 'so
|
|
|
283
234
|
|
|
284
235
|
## License
|
|
285
236
|
|
|
286
|
-
MIT © [
|
|
237
|
+
MIT © [Truong Tom](https://github.com/truongtom1993)
|
package/dist/lib.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export type { AnimationConfig } from './utils/helper';
|
|
|
2
2
|
export type { BaseColorProps, SolidComponent } from './type';
|
|
3
3
|
export * from './components/avatar';
|
|
4
4
|
export * from './components/badge';
|
|
5
|
-
export * from './components/blank';
|
|
6
5
|
export * from './components/breadcrumb';
|
|
7
6
|
export * from './components/button';
|
|
8
7
|
export * from './components/carousel';
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,C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,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Avatar as e}from"./components/avatar/avatar.js";import{Badge as t}from"./components/badge/badge.js";import{
|
|
1
|
+
import{Avatar as e}from"./components/avatar/avatar.js";import{Badge as t}from"./components/badge/badge.js";import{Breadcrumb as n}from"./components/breadcrumb/breadcrumb.js";import{Button as r}from"./components/button/button.js";import{Carousel as i}from"./components/carousel/carousel.js";import{ChatBubble as a}from"./components/chat-bubble/chatBubble.js";import{Checkbox as o}from"./components/checkbox/checkbox.js";import{Collapse as s}from"./components/collapse/collapse.js";import{createContextMenuHandle as c}from"./components/context-menu/context-menu.store.js";import{ContextMenu as l}from"./components/context-menu/context-menu.js";import{CODE_PREVIEW_THEMES as u,CodePreview as d}from"./components/code-preview/code-preview.js";import{Diff as f}from"./components/diff/diff.js";import{Divider as p}from"./components/divider/divider.js";import{ComponentDrawer as m,Drawer as h}from"./components/drawer/drawer.js";import{Dropdown as g}from"./components/dropdown/dropdown.js";import{FloatButton as _}from"./components/float-button/float-button.js";import{ImagePreview as v}from"./components/image-preview/image-preview.js";import{Hover3DImage as y}from"./components/hover-3d-image/hover-3d-image.js";import{Indicator as b}from"./components/indicator/indicator.js";import{Input as x}from"./components/input/input.js";import{Loading as S,Spinner as C}from"./components/loading/loading.js";import{Mansory as w}from"./components/mansory/mansory.js";import{Menu as T}from"./components/menu/menu.js";import{Modal as E}from"./components/modal/modal.js";import{closeAllModals as D,createModal as O}from"./components/modal/modalContext.js";import{Select as k}from"./components/select/select.js";import{Pagination as A}from"./components/pagination/pagination.js";import{progressBar as j}from"./components/progress-bar/progress-bar.js";import{QrCode as M}from"./components/qr-code/qr-code.js";import{Rating as N}from"./components/rating/rating.js";import{SelectZone as P,SelectZoneItem as F}from"./components/select-zone/select-zone.js";import{Skeleton as I}from"./components/skeleton/skeleton.js";import{Slider as L}from"./components/slider/slider.js";import{Splitter as R,SplitterPanel as z}from"./components/splitter/splitter.js";import{Steps as B}from"./components/steps/steps.js";import{Swap as V}from"./components/swap/swap.js";import{Switch as H}from"./components/switch/switch.js";import{Tooltip as U}from"./components/tooltip/tooltip.js";import{Tab as W}from"./components/tab/tab.js";import{Table as G}from"./components/table/table.js";import{createColumnHelper as K}from"./components/table/index.js";import{TextRotate as q}from"./components/text-rotate/text-rotate.js";import{Timeline as J}from"./components/timeline/timeline.js";import{Toaster as Y,toast as X}from"./components/toast/toast.js";import{createTour as Z}from"./components/tour/tour.js";import{Upload as Q}from"./components/upload/upload.js";export{e as Avatar,t as Badge,n as Breadcrumb,r as Button,u as CODE_PREVIEW_THEMES,i as Carousel,a as ChatBubble,o as Checkbox,d as CodePreview,s as Collapse,m as ComponentDrawer,l as ContextMenu,f as Diff,p as Divider,h as Drawer,g as Dropdown,_ as FloatButton,y as Hover3DImage,v as ImagePreview,b as Indicator,x as Input,S as Loading,w as Mansory,T as Menu,E as Modal,A as Pagination,M as QrCode,N as Rating,k as Select,P as SelectZone,F as SelectZoneItem,I as Skeleton,L as Slider,C as Spinner,R as Splitter,z as SplitterPanel,B as Steps,V as Swap,H as Switch,W as Tab,G as Table,q as TextRotate,J as Timeline,Y as Toaster,U as Tooltip,Q as Upload,D as closeAllModals,K as createColumnHelper,c as createContextMenuHandle,O as createModal,Z as createTour,j as progressBar,X as toast};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blank.js","names":["Component","BlankProps","Blank","p"],"sources":["../../../src/components/blank/blank.tsx"],"sourcesContent":["import { Component } from 'solid-js';\n\ntype BlankProps = {};\nexport const Blank: Component<BlankProps> = p => {\n return <></>;\n};\n"],"mappings":"AAGA,IAAaE,EAA+BC,GAC1C,EAAA"}
|