@sigx/daisyui 0.1.6
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/LICENSE +21 -0
- package/README.md +235 -0
- package/dist/buttons/Button.d.ts +18 -0
- package/dist/buttons/Button.d.ts.map +1 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ButtonGroup.d.ts.map +1 -0
- package/dist/buttons/index.d.ts +5 -0
- package/dist/buttons/index.d.ts.map +1 -0
- package/dist/buttons/index.js +2 -0
- package/dist/buttons-Dtj_5Uc3.js +61 -0
- package/dist/buttons-Dtj_5Uc3.js.map +1 -0
- package/dist/data/Table.d.ts +92 -0
- package/dist/data/Table.d.ts.map +1 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data-wxNpnX83.js +153 -0
- package/dist/data-wxNpnX83.js.map +1 -0
- package/dist/feedback/Accordion.d.ts +87 -0
- package/dist/feedback/Accordion.d.ts.map +1 -0
- package/dist/feedback/Badge.d.ts +73 -0
- package/dist/feedback/Badge.d.ts.map +1 -0
- package/dist/feedback/Countdown.d.ts +33 -0
- package/dist/feedback/Countdown.d.ts.map +1 -0
- package/dist/feedback/Diff.d.ts +43 -0
- package/dist/feedback/Diff.d.ts.map +1 -0
- package/dist/feedback/FileInput.d.ts +28 -0
- package/dist/feedback/FileInput.d.ts.map +1 -0
- package/dist/feedback/Indicator.d.ts +47 -0
- package/dist/feedback/Indicator.d.ts.map +1 -0
- package/dist/feedback/Kbd.d.ts +31 -0
- package/dist/feedback/Kbd.d.ts.map +1 -0
- package/dist/feedback/Modal.d.ts +51 -0
- package/dist/feedback/Modal.d.ts.map +1 -0
- package/dist/feedback/RadialProgress.d.ts +35 -0
- package/dist/feedback/RadialProgress.d.ts.map +1 -0
- package/dist/feedback/Rating.d.ts +34 -0
- package/dist/feedback/Rating.d.ts.map +1 -0
- package/dist/feedback/Skeleton.d.ts +24 -0
- package/dist/feedback/Skeleton.d.ts.map +1 -0
- package/dist/feedback/Steps.d.ts +60 -0
- package/dist/feedback/Steps.d.ts.map +1 -0
- package/dist/feedback/Swap.d.ts +53 -0
- package/dist/feedback/Swap.d.ts.map +1 -0
- package/dist/feedback/Timeline.d.ts +76 -0
- package/dist/feedback/Timeline.d.ts.map +1 -0
- package/dist/feedback/Toast.d.ts +30 -0
- package/dist/feedback/Toast.d.ts.map +1 -0
- package/dist/feedback/index.d.ts +31 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +2 -0
- package/dist/feedback-DFutN-Kz.js +817 -0
- package/dist/feedback-DFutN-Kz.js.map +1 -0
- package/dist/forms/Checkbox.d.ts +15 -0
- package/dist/forms/Checkbox.d.ts.map +1 -0
- package/dist/forms/FormField.d.ts +16 -0
- package/dist/forms/FormField.d.ts.map +1 -0
- package/dist/forms/Input.d.ts +19 -0
- package/dist/forms/Input.d.ts.map +1 -0
- package/dist/forms/Radio.d.ts +78 -0
- package/dist/forms/Radio.d.ts.map +1 -0
- package/dist/forms/Range.d.ts +15 -0
- package/dist/forms/Range.d.ts.map +1 -0
- package/dist/forms/Select.d.ts +28 -0
- package/dist/forms/Select.d.ts.map +1 -0
- package/dist/forms/Textarea.d.ts +17 -0
- package/dist/forms/Textarea.d.ts.map +1 -0
- package/dist/forms/Toggle.d.ts +15 -0
- package/dist/forms/Toggle.d.ts.map +1 -0
- package/dist/forms/index.d.ts +17 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +2 -0
- package/dist/forms-CuvlRMro.js +362 -0
- package/dist/forms-CuvlRMro.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/layout/Card.d.ts +65 -0
- package/dist/layout/Card.d.ts.map +1 -0
- package/dist/layout/Carousel.d.ts +56 -0
- package/dist/layout/Carousel.d.ts.map +1 -0
- package/dist/layout/Chat.d.ts +54 -0
- package/dist/layout/Chat.d.ts.map +1 -0
- package/dist/layout/Container.d.ts +17 -0
- package/dist/layout/Container.d.ts.map +1 -0
- package/dist/layout/Divider.d.ts +22 -0
- package/dist/layout/Divider.d.ts.map +1 -0
- package/dist/layout/Flex.d.ts +59 -0
- package/dist/layout/Flex.d.ts.map +1 -0
- package/dist/layout/Footer.d.ts +25 -0
- package/dist/layout/Footer.d.ts.map +1 -0
- package/dist/layout/Hero.d.ts +52 -0
- package/dist/layout/Hero.d.ts.map +1 -0
- package/dist/layout/Join.d.ts +40 -0
- package/dist/layout/Join.d.ts.map +1 -0
- package/dist/layout/Link.d.ts +20 -0
- package/dist/layout/Link.d.ts.map +1 -0
- package/dist/layout/Mask.d.ts +26 -0
- package/dist/layout/Mask.d.ts.map +1 -0
- package/dist/layout/Mockup.d.ts +95 -0
- package/dist/layout/Mockup.d.ts.map +1 -0
- package/dist/layout/Stack.d.ts +45 -0
- package/dist/layout/Stack.d.ts.map +1 -0
- package/dist/layout/index.d.ts +46 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout-0aaJX4B2.js +554 -0
- package/dist/layout-0aaJX4B2.js.map +1 -0
- package/dist/navigation/Breadcrumbs.d.ts +22 -0
- package/dist/navigation/Breadcrumbs.d.ts.map +1 -0
- package/dist/navigation/Drawer.d.ts +25 -0
- package/dist/navigation/Drawer.d.ts.map +1 -0
- package/dist/navigation/Dropdown.d.ts +40 -0
- package/dist/navigation/Dropdown.d.ts.map +1 -0
- package/dist/navigation/MenuComponent.d.ts +54 -0
- package/dist/navigation/MenuComponent.d.ts.map +1 -0
- package/dist/navigation/Navbar.d.ts +23 -0
- package/dist/navigation/Navbar.d.ts.map +1 -0
- package/dist/navigation/Pagination.d.ts +12 -0
- package/dist/navigation/Pagination.d.ts.map +1 -0
- package/dist/navigation/Tabs.d.ts +35 -0
- package/dist/navigation/Tabs.d.ts.map +1 -0
- package/dist/navigation/index.d.ts +15 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation-4cwyfLvr.js +285 -0
- package/dist/navigation-4cwyfLvr.js.map +1 -0
- package/dist/shared/styles.d.ts +79 -0
- package/dist/shared/styles.d.ts.map +1 -0
- package/dist/styles-DFkMxi90.js +126 -0
- package/dist/styles-DFkMxi90.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +73 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme-D9CUMvuT.js +118 -0
- package/dist/theme-D9CUMvuT.js.map +1 -0
- package/dist/typography/Text.d.ts +47 -0
- package/dist/typography/Text.d.ts.map +1 -0
- package/dist/typography/index.d.ts +3 -0
- package/dist/typography/index.d.ts.map +1 -0
- package/dist/typography/index.js +2 -0
- package/dist/typography-CU1RMGKA.js +112 -0
- package/dist/typography-CU1RMGKA.js.map +1 -0
- package/package.json +88 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Andreas Ekdahl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# @sigx/daisyui
|
|
2
|
+
|
|
3
|
+
Beautiful, accessible UI components for SignalX with full theme support, powered by [DaisyUI](https://daisyui.com/) and [Tailwind CSS](https://tailwindcss.com/).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **30+ DaisyUI themes** - Light, dark, and everything in between
|
|
8
|
+
- ⚡ **Full SignalX reactivity** - Components built with SignalX primitives
|
|
9
|
+
- 🔧 **Easy theme switching** - Built-in ThemeProvider and utilities
|
|
10
|
+
- 📦 **Tree-shakeable** - Import only what you need
|
|
11
|
+
- 🎯 **Type-safe** - Full TypeScript support with comprehensive types
|
|
12
|
+
- ♿ **Accessible** - Built on DaisyUI's accessible components
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @sigx/daisyui sigx daisyui tailwindcss
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
### 1. Set up your CSS (Tailwind CSS v4)
|
|
23
|
+
|
|
24
|
+
In your main CSS file, add the `@source` directive to tell Tailwind where to find component class names:
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
@import "tailwindcss";
|
|
28
|
+
@plugin "daisyui";
|
|
29
|
+
|
|
30
|
+
/* Tell Tailwind v4 to scan @sigx/daisyui for class names */
|
|
31
|
+
@source "../node_modules/@sigx/daisyui";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> **Note**: The path is relative to your CSS file. Adjust based on your project structure.
|
|
35
|
+
|
|
36
|
+
### 2. Set up Vite
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
// vite.config.ts
|
|
40
|
+
import { defineConfig } from 'vite';
|
|
41
|
+
import { sigxPlugin } from '@sigx/vite';
|
|
42
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
43
|
+
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
plugins: [sigxPlugin(), tailwindcss()],
|
|
46
|
+
esbuild: {
|
|
47
|
+
jsx: 'automatic',
|
|
48
|
+
jsxImportSource: 'sigx'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. Use components in your app
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { component, defineApp } from 'sigx';
|
|
57
|
+
import {
|
|
58
|
+
ThemeProvider,
|
|
59
|
+
Button,
|
|
60
|
+
Card,
|
|
61
|
+
Card.Body,
|
|
62
|
+
CardTitle,
|
|
63
|
+
ThemeSelector
|
|
64
|
+
} from '@sigx/daisyui';
|
|
65
|
+
|
|
66
|
+
const App = component(({ signal }) => {
|
|
67
|
+
const count = signal(0);
|
|
68
|
+
|
|
69
|
+
return () => (
|
|
70
|
+
<ThemeProvider defaultTheme="cupcake" darkMode>
|
|
71
|
+
<div class="p-8">
|
|
72
|
+
<ThemeSelector class="mb-4" />
|
|
73
|
+
|
|
74
|
+
<Card>
|
|
75
|
+
<Card.Body center>
|
|
76
|
+
<CardTitle>Counter: {count.value}</CardTitle>
|
|
77
|
+
<div class="flex gap-2">
|
|
78
|
+
<Button variant="primary" onClick={() => count.value++}>
|
|
79
|
+
Increment
|
|
80
|
+
</Button>
|
|
81
|
+
<Button variant="error" onClick={() => count.value--}>
|
|
82
|
+
Decrement
|
|
83
|
+
</Button>
|
|
84
|
+
</div>
|
|
85
|
+
</Card.Body>
|
|
86
|
+
</Card>
|
|
87
|
+
</div>
|
|
88
|
+
</ThemeProvider>
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
defineApp(App).mount('#app');
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Theme Support
|
|
96
|
+
|
|
97
|
+
### Using ThemeProvider
|
|
98
|
+
|
|
99
|
+
Wrap your app with `ThemeProvider` for automatic theme management:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import { ThemeProvider } from '@sigx/daisyui';
|
|
103
|
+
|
|
104
|
+
<ThemeProvider defaultTheme="cupcake" darkMode>
|
|
105
|
+
<App />
|
|
106
|
+
</ThemeProvider>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Theme utilities
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import {
|
|
113
|
+
setTheme,
|
|
114
|
+
getCurrentTheme,
|
|
115
|
+
toggleDarkMode,
|
|
116
|
+
initializeTheme
|
|
117
|
+
} from '@sigx/daisyui';
|
|
118
|
+
|
|
119
|
+
// Set theme programmatically
|
|
120
|
+
setTheme('cyberpunk');
|
|
121
|
+
|
|
122
|
+
// Get current theme
|
|
123
|
+
const theme = getCurrentTheme(); // 'cyberpunk'
|
|
124
|
+
|
|
125
|
+
// Toggle between light and dark
|
|
126
|
+
toggleDarkMode();
|
|
127
|
+
|
|
128
|
+
// Initialize theme from localStorage or system preference
|
|
129
|
+
initializeTheme({ defaultTheme: 'light', darkMode: true });
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Theme components
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { ThemeSelector, ThemeToggle } from '@sigx/daisyui';
|
|
136
|
+
|
|
137
|
+
// Dropdown to select from all themes
|
|
138
|
+
<ThemeSelector />
|
|
139
|
+
|
|
140
|
+
// Dropdown with specific themes only
|
|
141
|
+
<ThemeSelector themes={['light', 'dark', 'cupcake', 'cyberpunk']} />
|
|
142
|
+
|
|
143
|
+
// Light/dark toggle button
|
|
144
|
+
<ThemeToggle />
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Available Themes
|
|
148
|
+
|
|
149
|
+
All 32 DaisyUI themes are supported:
|
|
150
|
+
|
|
151
|
+
**Light themes:** light, cupcake, bumblebee, emerald, corporate, retro, cyberpunk, valentine, garden, lofi, pastel, fantasy, wireframe, cmyk, autumn, acid, lemonade, winter, nord
|
|
152
|
+
|
|
153
|
+
**Dark themes:** dark, synthwave, halloween, forest, aqua, black, luxury, dracula, business, night, coffee, dim, sunset
|
|
154
|
+
|
|
155
|
+
## Components
|
|
156
|
+
|
|
157
|
+
### Buttons
|
|
158
|
+
- `Button` - Primary button component with variants
|
|
159
|
+
- `ButtonGroup` - Group buttons together
|
|
160
|
+
|
|
161
|
+
### Forms
|
|
162
|
+
- `Input` - Text input with sync binding
|
|
163
|
+
- `Textarea` - Multi-line text input
|
|
164
|
+
- `Select` - Dropdown select
|
|
165
|
+
- `FormField` - Form field wrapper with label/error
|
|
166
|
+
- `Toggle` - Toggle switch
|
|
167
|
+
- `Checkbox` - Checkbox input
|
|
168
|
+
- `Radio` - Radio button
|
|
169
|
+
- `Range` - Range slider
|
|
170
|
+
|
|
171
|
+
### Layout
|
|
172
|
+
- `Container` - Centered container with max-width
|
|
173
|
+
- `Card`, `Card.Body`, `CardTitle`, `Card.Actions` - Card components
|
|
174
|
+
- `Stack`, `HStack`, `VStack` - Flexbox layouts
|
|
175
|
+
- `Divider` - Content divider
|
|
176
|
+
|
|
177
|
+
### Feedback
|
|
178
|
+
- `Modal`, `ModalHeader`, `ModalBody`, `ModalActions` - Modal dialog
|
|
179
|
+
- `Badge` - Status badges
|
|
180
|
+
- `Loading` - Loading indicators
|
|
181
|
+
- `Alert` - Alert messages
|
|
182
|
+
- `Progress` - Progress bars
|
|
183
|
+
- `Tooltip` - Tooltips
|
|
184
|
+
|
|
185
|
+
### Navigation
|
|
186
|
+
- `Tabs` - Tab navigation
|
|
187
|
+
- `Menu` - Menu list
|
|
188
|
+
- `Dropdown` - Dropdown menu
|
|
189
|
+
- `Drawer` - Side drawer
|
|
190
|
+
- `Breadcrumbs` - Breadcrumb navigation
|
|
191
|
+
- `Navbar` - Navigation bar
|
|
192
|
+
- `Pagination` - Page navigation
|
|
193
|
+
|
|
194
|
+
### Data Display
|
|
195
|
+
- `Table`, `Thead`, `Tbody`, `Tr`, `Th`, `Td` - Table components
|
|
196
|
+
- `Avatar` - User avatar
|
|
197
|
+
- `Stat`, `Stats` - Statistics display
|
|
198
|
+
|
|
199
|
+
## Tree-shaking
|
|
200
|
+
|
|
201
|
+
Import components individually for smaller bundles:
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
// Import only what you need
|
|
205
|
+
import { Button } from '@sigx/daisyui/buttons';
|
|
206
|
+
import { Card } from '@sigx/daisyui/layout';
|
|
207
|
+
import { ThemeProvider } from '@sigx/daisyui/theme';
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Two-way Binding
|
|
211
|
+
|
|
212
|
+
Form components support SignalX's model binding:
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
import { signal } from 'sigx';
|
|
216
|
+
import { Input, Toggle } from '@sigx/daisyui';
|
|
217
|
+
|
|
218
|
+
const App = component(({ signal }) => {
|
|
219
|
+
const form = signal({ name: '', enabled: false });
|
|
220
|
+
|
|
221
|
+
return () => (
|
|
222
|
+
<div>
|
|
223
|
+
<Input model={() => form.name} placeholder="Enter name" variant="bordered" />
|
|
224
|
+
<Toggle model={() => form.enabled} label="Enable feature" color="primary" />
|
|
225
|
+
|
|
226
|
+
<p>Name: {form.name}</p>
|
|
227
|
+
<p>Enabled: {form.enabled ? 'Yes' : 'No'}</p>
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DefineProp, DefineSlot, DefineEvent } from 'sigx';
|
|
2
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost' | 'link' | 'neutral';
|
|
3
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
4
|
+
export type ButtonProps = DefineProp<'variant', ButtonVariant, false> & DefineProp<'size', ButtonSize, false> & DefineProp<'outline', boolean, false> & DefineProp<'disabled', boolean, false> & DefineProp<'loading', boolean, false> & DefineProp<'block', boolean, false> & DefineProp<'circle', boolean, false> & DefineProp<'square', boolean, false> & DefineProp<'active', boolean, false> & DefineProp<'class', string, false> & DefineProp<'type', 'button' | 'submit' | 'reset', false> & DefineProp<'title', string, false> & DefineSlot<'default'> & DefineEvent<'click', MouseEvent>;
|
|
5
|
+
/**
|
|
6
|
+
* Button component with DaisyUI styling.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Button variant="primary" size="lg" onClick={() => console.log('clicked')}>
|
|
11
|
+
* Click Me
|
|
12
|
+
* </Button>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const Button: import("@sigx/runtime-core").ComponentFactory<ButtonProps, void, {
|
|
16
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEtE,MAAM,MAAM,aAAa,GACnB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,GACP,OAAO,GACP,MAAM,GACN,SAAS,CAAC;AAEhB,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,WAAW,GACjB,UAAU,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,GAC3C,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,GACrC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,GACrC,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GACtC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,GACrC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,GACnC,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,GACpC,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,GACpC,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,GACpC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,GAClC,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,EAAE,KAAK,CAAC,GACxD,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,GAClC,UAAU,CAAC,SAAS,CAAC,GACrB,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAsBvC;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;EAoCjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DefineProp, DefineSlot } from 'sigx';
|
|
2
|
+
export type ButtonGroupProps = DefineProp<'vertical', boolean, false> & DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
3
|
+
/**
|
|
4
|
+
* ButtonGroup component for grouping buttons together.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <ButtonGroup>
|
|
9
|
+
* <Button>Left</Button>
|
|
10
|
+
* <Button>Center</Button>
|
|
11
|
+
* <Button>Right</Button>
|
|
12
|
+
* </ButtonGroup>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const ButtonGroup: import("@sigx/runtime-core").ComponentFactory<ButtonGroupProps, void, {
|
|
16
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/buttons/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GACtB,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GACtC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,GAClC,UAAU,CAAC,SAAS,CAAC,CAAC;AAE5B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;;EAetB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/buttons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { component } from "sigx";
|
|
2
|
+
import { jsx, jsxs } from "sigx/jsx-runtime";
|
|
3
|
+
var variantClasses = {
|
|
4
|
+
primary: "btn-primary",
|
|
5
|
+
secondary: "btn-secondary",
|
|
6
|
+
accent: "btn-accent",
|
|
7
|
+
info: "btn-info",
|
|
8
|
+
success: "btn-success",
|
|
9
|
+
warning: "btn-warning",
|
|
10
|
+
error: "btn-error",
|
|
11
|
+
ghost: "btn-ghost",
|
|
12
|
+
link: "btn-link",
|
|
13
|
+
neutral: "btn-neutral"
|
|
14
|
+
};
|
|
15
|
+
var sizeClasses = {
|
|
16
|
+
xs: "btn-xs",
|
|
17
|
+
sm: "btn-sm",
|
|
18
|
+
md: "",
|
|
19
|
+
lg: "btn-lg"
|
|
20
|
+
};
|
|
21
|
+
const Button = component(({ props, slots, emit }) => {
|
|
22
|
+
const getClasses = () => {
|
|
23
|
+
const classes = ["btn"];
|
|
24
|
+
if (props.variant) classes.push(variantClasses[props.variant]);
|
|
25
|
+
if (props.size) {
|
|
26
|
+
const sizeClass = sizeClasses[props.size];
|
|
27
|
+
if (sizeClass) classes.push(sizeClass);
|
|
28
|
+
}
|
|
29
|
+
if (props.outline) classes.push("btn-outline");
|
|
30
|
+
if (props.loading) classes.push("loading");
|
|
31
|
+
if (props.block) classes.push("btn-block");
|
|
32
|
+
if (props.circle) classes.push("btn-circle");
|
|
33
|
+
if (props.square) classes.push("btn-square");
|
|
34
|
+
if (props.active) classes.push("btn-active");
|
|
35
|
+
if (props.class) classes.push(props.class);
|
|
36
|
+
return classes.join(" ");
|
|
37
|
+
};
|
|
38
|
+
return () => /* @__PURE__ */ jsxs("button", {
|
|
39
|
+
type: props.type ?? "button",
|
|
40
|
+
class: getClasses(),
|
|
41
|
+
disabled: props.disabled || props.loading,
|
|
42
|
+
title: props.title,
|
|
43
|
+
onClick: (e) => emit("click", e),
|
|
44
|
+
children: [props.loading && /* @__PURE__ */ jsx("span", { class: "loading loading-spinner" }), slots.default?.()]
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
const ButtonGroup = component(({ props, slots }) => {
|
|
48
|
+
const getClasses = () => {
|
|
49
|
+
const classes = ["join"];
|
|
50
|
+
if (props.vertical) classes.push("join-vertical");
|
|
51
|
+
if (props.class) classes.push(props.class);
|
|
52
|
+
return classes.join(" ");
|
|
53
|
+
};
|
|
54
|
+
return () => /* @__PURE__ */ jsx("div", {
|
|
55
|
+
class: getClasses(),
|
|
56
|
+
children: slots.default?.()
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
export { Button as n, ButtonGroup as t };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=buttons-Dtj_5Uc3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons-Dtj_5Uc3.js","names":[],"sources":["../src/buttons/Button.tsx","../src/buttons/ButtonGroup.tsx"],"sourcesContent":["import { component, DefineProp, DefineSlot, DefineEvent } from 'sigx';\r\n\r\nexport type ButtonVariant = \r\n | 'primary' \r\n | 'secondary' \r\n | 'accent' \r\n | 'info' \r\n | 'success' \r\n | 'warning' \r\n | 'error' \r\n | 'ghost' \r\n | 'link'\r\n | 'neutral';\r\n\r\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';\r\n\r\nexport type ButtonProps = \r\n & DefineProp<'variant', ButtonVariant, false>\r\n & DefineProp<'size', ButtonSize, false>\r\n & DefineProp<'outline', boolean, false>\r\n & DefineProp<'disabled', boolean, false>\r\n & DefineProp<'loading', boolean, false>\r\n & DefineProp<'block', boolean, false>\r\n & DefineProp<'circle', boolean, false>\r\n & DefineProp<'square', boolean, false>\r\n & DefineProp<'active', boolean, false>\r\n & DefineProp<'class', string, false>\r\n & DefineProp<'type', 'button' | 'submit' | 'reset', false>\r\n & DefineProp<'title', string, false>\r\n & DefineSlot<'default'>\r\n & DefineEvent<'click', MouseEvent>;\r\n\r\nconst variantClasses: Record<ButtonVariant, string> = {\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 ghost: 'btn-ghost',\r\n link: 'btn-link',\r\n neutral: 'btn-neutral',\r\n};\r\n\r\nconst sizeClasses: Record<ButtonSize, string> = {\r\n xs: 'btn-xs',\r\n sm: 'btn-sm',\r\n md: '', // md is default, no class needed\r\n lg: 'btn-lg',\r\n};\r\n\r\n/**\r\n * Button component with DaisyUI styling.\r\n * \r\n * @example\r\n * ```tsx\r\n * <Button variant=\"primary\" size=\"lg\" onClick={() => console.log('clicked')}>\r\n * Click Me\r\n * </Button>\r\n * ```\r\n */\r\nexport const Button = component<ButtonProps>(({ props, slots, emit }) => {\r\n const getClasses = () => {\r\n const classes = ['btn'];\r\n \r\n if (props.variant) {\r\n classes.push(variantClasses[props.variant]);\r\n }\r\n \r\n if (props.size) {\r\n const sizeClass = sizeClasses[props.size];\r\n if (sizeClass) classes.push(sizeClass);\r\n }\r\n \r\n if (props.outline) classes.push('btn-outline');\r\n if (props.loading) classes.push('loading');\r\n if (props.block) classes.push('btn-block');\r\n if (props.circle) classes.push('btn-circle');\r\n if (props.square) classes.push('btn-square');\r\n if (props.active) classes.push('btn-active');\r\n if (props.class) classes.push(props.class);\r\n \r\n return classes.join(' ');\r\n };\r\n\r\n return () => (\r\n <button\r\n type={props.type ?? 'button'}\r\n class={getClasses()}\r\n disabled={props.disabled || props.loading}\r\n title={props.title}\r\n onClick={(e) => emit('click', e)}\r\n >\r\n {props.loading && <span class=\"loading loading-spinner\"></span>}\r\n {slots.default?.()}\r\n </button>\r\n );\r\n});\r\n","import { component, DefineProp, DefineSlot } from 'sigx';\r\n\r\nexport type ButtonGroupProps = \r\n & DefineProp<'vertical', boolean, false>\r\n & DefineProp<'class', string, false>\r\n & DefineSlot<'default'>;\r\n\r\n/**\r\n * ButtonGroup component for grouping buttons together.\r\n * \r\n * @example\r\n * ```tsx\r\n * <ButtonGroup>\r\n * <Button>Left</Button>\r\n * <Button>Center</Button>\r\n * <Button>Right</Button>\r\n * </ButtonGroup>\r\n * ```\r\n */\r\nexport const ButtonGroup = component<ButtonGroupProps>(({ props, slots }) => {\r\n const getClasses = () => {\r\n const classes = ['join'];\r\n \r\n if (props.vertical) classes.push('join-vertical');\r\n if (props.class) classes.push(props.class);\r\n \r\n return classes.join(' ');\r\n };\r\n\r\n return () => (\r\n <div class={getClasses()}>\r\n {slots.default?.()}\r\n </div>\r\n );\r\n});\r\n"],"mappings":";;AAgCA,IAAM,iBAAgD;CAClD,SAAS;CACT,WAAW;CACX,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,SAAS;CACZ;AAED,IAAM,cAA0C;CAC5C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACP;AAYD,MAAa,SAAS,WAAwB,EAAE,OAAO,OAAO,WAAW;CACrE,MAAM,mBAAmB;EACrB,MAAM,UAAU,CAAC,MAAM;AAEvB,MAAI,MAAM,QACN,SAAQ,KAAK,eAAe,MAAM,SAAS;AAG/C,MAAI,MAAM,MAAM;GACZ,MAAM,YAAY,YAAY,MAAM;AACpC,OAAI,UAAW,SAAQ,KAAK,UAAU;;AAG1C,MAAI,MAAM,QAAS,SAAQ,KAAK,cAAc;AAC9C,MAAI,MAAM,QAAS,SAAQ,KAAK,UAAU;AAC1C,MAAI,MAAM,MAAO,SAAQ,KAAK,YAAY;AAC1C,MAAI,MAAM,OAAQ,SAAQ,KAAK,aAAa;AAC5C,MAAI,MAAM,OAAQ,SAAQ,KAAK,aAAa;AAC5C,MAAI,MAAM,OAAQ,SAAQ,KAAK,aAAa;AAC5C,MAAI,MAAM,MAAO,SAAQ,KAAK,MAAM,MAAM;AAE1C,SAAO,QAAQ,KAAK,IAAI;;AAG5B,cACI,qBAAC,UAAA;EACG,MAAM,MAAM,QAAQ;EACpB,OAAO,YAAY;EACnB,UAAU,MAAM,YAAY,MAAM;EAClC,OAAO,MAAM;EACb,UAAU,MAAM,KAAK,SAAS,EAAE;aAE/B,MAAM,WAAW,oBAAC,QAAA,EAAK,OAAM,2BAAA,CAAiC,EAC9D,MAAM,WAAW,CAAA;GACb;EAEf;AC/EF,MAAa,cAAc,WAA6B,EAAE,OAAO,YAAY;CACzE,MAAM,mBAAmB;EACrB,MAAM,UAAU,CAAC,OAAO;AAExB,MAAI,MAAM,SAAU,SAAQ,KAAK,gBAAgB;AACjD,MAAI,MAAM,MAAO,SAAQ,KAAK,MAAM,MAAM;AAE1C,SAAO,QAAQ,KAAK,IAAI;;AAG5B,cACI,oBAAC,OAAA;EAAI,OAAO,YAAY;YACnB,MAAM,WAAW;GAChB;EAEZ"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DefineProp, DefineSlot } from 'sigx';
|
|
2
|
+
export type TableSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
export type TableProps = DefineProp<'zebra', boolean, false> & DefineProp<'pinRows', boolean, false> & DefineProp<'pinCols', boolean, false> & DefineProp<'size', TableSize, false> & DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
4
|
+
/**
|
|
5
|
+
* Table component with DaisyUI styling.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Table zebra>
|
|
10
|
+
* <Thead>
|
|
11
|
+
* <Tr><Th>Name</Th><Th>Age</Th></Tr>
|
|
12
|
+
* </Thead>
|
|
13
|
+
* <Tbody>
|
|
14
|
+
* <Tr><Td>John</Td><Td>25</Td></Tr>
|
|
15
|
+
* </Tbody>
|
|
16
|
+
* </Table>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const Table: import("@sigx/runtime-core").ComponentFactory<TableProps, void, {
|
|
20
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
21
|
+
}>;
|
|
22
|
+
export type TheadProps = DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
23
|
+
/**
|
|
24
|
+
* Table head component.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Thead: import("@sigx/runtime-core").ComponentFactory<TheadProps, void, {
|
|
27
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
28
|
+
}>;
|
|
29
|
+
export type TbodyProps = DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
30
|
+
/**
|
|
31
|
+
* Table body component.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Tbody: import("@sigx/runtime-core").ComponentFactory<TbodyProps, void, {
|
|
34
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
35
|
+
}>;
|
|
36
|
+
export type TrProps = DefineProp<'hover', boolean, false> & DefineProp<'active', boolean, false> & DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
37
|
+
/**
|
|
38
|
+
* Table row component.
|
|
39
|
+
*/
|
|
40
|
+
export declare const Tr: import("@sigx/runtime-core").ComponentFactory<TrProps, void, {
|
|
41
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
42
|
+
}>;
|
|
43
|
+
export type ThProps = DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
44
|
+
/**
|
|
45
|
+
* Table header cell component.
|
|
46
|
+
*/
|
|
47
|
+
export declare const Th: import("@sigx/runtime-core").ComponentFactory<ThProps, void, {
|
|
48
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
49
|
+
}>;
|
|
50
|
+
export type TdProps = DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
51
|
+
/**
|
|
52
|
+
* Table data cell component.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Td: import("@sigx/runtime-core").ComponentFactory<TdProps, void, {
|
|
55
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
56
|
+
}>;
|
|
57
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
58
|
+
export type AvatarShape = 'circle' | 'rounded' | 'square';
|
|
59
|
+
export type AvatarProps = DefineProp<'src', string, false> & DefineProp<'alt', string, false> & DefineProp<'size', AvatarSize, false> & DefineProp<'shape', AvatarShape, false> & DefineProp<'online', boolean, false> & DefineProp<'offline', boolean, false> & DefineProp<'placeholder', string, false> & DefineProp<'class', string, false>;
|
|
60
|
+
/**
|
|
61
|
+
* Avatar component with DaisyUI styling.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Avatar src="/user.jpg" size="md" shape="circle" online />
|
|
66
|
+
* <Avatar placeholder="JD" size="lg" />
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare const Avatar: import("@sigx/runtime-core").ComponentFactory<AvatarProps, void, {}>;
|
|
70
|
+
export type StatProps = DefineProp<'title', string> & DefineProp<'value', string | number> & DefineProp<'description', string, false> & DefineProp<'class', string, false> & DefineSlot<'figure'>;
|
|
71
|
+
/**
|
|
72
|
+
* Stat component for displaying statistics.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Stats>
|
|
77
|
+
* <Stat title="Total Users" value="1,200" description="↗︎ 400 (22%)" />
|
|
78
|
+
* <Stat title="Revenue" value="$2.6M" description="↘︎ 90 (14%)" />
|
|
79
|
+
* </Stats>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare const Stat: import("@sigx/runtime-core").ComponentFactory<StatProps, void, {
|
|
83
|
+
figure: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
84
|
+
}>;
|
|
85
|
+
export type StatsProps = DefineProp<'vertical', boolean, false> & DefineProp<'class', string, false> & DefineSlot<'default'>;
|
|
86
|
+
/**
|
|
87
|
+
* Stats container component.
|
|
88
|
+
*/
|
|
89
|
+
export declare const Stats: import("@sigx/runtime-core").ComponentFactory<StatsProps, void, {
|
|
90
|
+
default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
|
|
91
|
+
}>;
|
|
92
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/data/Table.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Table, Thead, Tbody, Tr, Th, Td, Avatar, Stat, Stats } from './Table';
|
|
2
|
+
export type { TableProps, TableSize, TheadProps, TbodyProps, TrProps, ThProps, TdProps, AvatarProps, AvatarSize, AvatarShape, StatProps, StatsProps } from './Table';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC/E,YAAY,EACR,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjD,WAAW,EAAE,UAAU,EAAE,WAAW,EACpC,SAAS,EAAE,UAAU,EACxB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { component } from "sigx";
|
|
2
|
+
import { jsx, jsxs } from "sigx/jsx-runtime";
|
|
3
|
+
var tableSizeClasses = {
|
|
4
|
+
xs: "table-xs",
|
|
5
|
+
sm: "table-sm",
|
|
6
|
+
md: "",
|
|
7
|
+
lg: "table-lg"
|
|
8
|
+
};
|
|
9
|
+
const Table = component(({ props, slots }) => {
|
|
10
|
+
const getClasses = () => {
|
|
11
|
+
const classes = ["table"];
|
|
12
|
+
if (props.zebra) classes.push("table-zebra");
|
|
13
|
+
if (props.pinRows) classes.push("table-pin-rows");
|
|
14
|
+
if (props.pinCols) classes.push("table-pin-cols");
|
|
15
|
+
if (props.size) {
|
|
16
|
+
const sizeClass = tableSizeClasses[props.size];
|
|
17
|
+
if (sizeClass) classes.push(sizeClass);
|
|
18
|
+
}
|
|
19
|
+
if (props.class) classes.push(props.class);
|
|
20
|
+
return classes.join(" ");
|
|
21
|
+
};
|
|
22
|
+
return () => /* @__PURE__ */ jsx("div", {
|
|
23
|
+
class: "overflow-x-auto",
|
|
24
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
25
|
+
class: getClasses(),
|
|
26
|
+
children: slots.default?.()
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const Thead = component(({ props, slots }) => {
|
|
31
|
+
return () => /* @__PURE__ */ jsx("thead", {
|
|
32
|
+
class: props.class,
|
|
33
|
+
children: slots.default?.()
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const Tbody = component(({ props, slots }) => {
|
|
37
|
+
return () => /* @__PURE__ */ jsx("tbody", {
|
|
38
|
+
class: props.class,
|
|
39
|
+
children: slots.default?.()
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
const Tr = component(({ props, slots }) => {
|
|
43
|
+
const getClasses = () => {
|
|
44
|
+
const classes = [];
|
|
45
|
+
if (props.hover) classes.push("hover");
|
|
46
|
+
if (props.active) classes.push("active");
|
|
47
|
+
if (props.class) classes.push(props.class);
|
|
48
|
+
return classes.join(" ");
|
|
49
|
+
};
|
|
50
|
+
return () => /* @__PURE__ */ jsx("tr", {
|
|
51
|
+
class: getClasses(),
|
|
52
|
+
children: slots.default?.()
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const Th = component(({ props, slots }) => {
|
|
56
|
+
return () => /* @__PURE__ */ jsx("th", {
|
|
57
|
+
class: props.class,
|
|
58
|
+
children: slots.default?.()
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
const Td = component(({ props, slots }) => {
|
|
62
|
+
return () => /* @__PURE__ */ jsx("td", {
|
|
63
|
+
class: props.class,
|
|
64
|
+
children: slots.default?.()
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
var avatarSizeClasses = {
|
|
68
|
+
xs: "w-8",
|
|
69
|
+
sm: "w-12",
|
|
70
|
+
md: "w-16",
|
|
71
|
+
lg: "w-20",
|
|
72
|
+
xl: "w-24"
|
|
73
|
+
};
|
|
74
|
+
var avatarShapeClasses = {
|
|
75
|
+
circle: "rounded-full",
|
|
76
|
+
rounded: "rounded-xl",
|
|
77
|
+
square: ""
|
|
78
|
+
};
|
|
79
|
+
const Avatar = component(({ props }) => {
|
|
80
|
+
const getContainerClasses = () => {
|
|
81
|
+
const classes = ["avatar"];
|
|
82
|
+
if (props.online) classes.push("online");
|
|
83
|
+
if (props.offline) classes.push("offline");
|
|
84
|
+
if (!props.src && props.placeholder) classes.push("placeholder");
|
|
85
|
+
if (props.class) classes.push(props.class);
|
|
86
|
+
return classes.join(" ");
|
|
87
|
+
};
|
|
88
|
+
const getImageClasses = () => {
|
|
89
|
+
const classes = [];
|
|
90
|
+
classes.push(avatarSizeClasses[props.size ?? "md"]);
|
|
91
|
+
classes.push(avatarShapeClasses[props.shape ?? "circle"]);
|
|
92
|
+
return classes.join(" ");
|
|
93
|
+
};
|
|
94
|
+
return () => /* @__PURE__ */ jsx("div", {
|
|
95
|
+
class: getContainerClasses(),
|
|
96
|
+
children: props.src ? /* @__PURE__ */ jsx("div", {
|
|
97
|
+
class: getImageClasses(),
|
|
98
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
99
|
+
src: props.src,
|
|
100
|
+
alt: props.alt ?? "Avatar"
|
|
101
|
+
})
|
|
102
|
+
}) : props.placeholder ? /* @__PURE__ */ jsx("div", {
|
|
103
|
+
class: `bg-neutral text-neutral-content ${getImageClasses()}`,
|
|
104
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
105
|
+
class: "text-xl",
|
|
106
|
+
children: props.placeholder
|
|
107
|
+
})
|
|
108
|
+
}) : null
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
const Stat = component(({ props, slots }) => {
|
|
112
|
+
const getClasses = () => {
|
|
113
|
+
const classes = ["stat"];
|
|
114
|
+
if (props.class) classes.push(props.class);
|
|
115
|
+
return classes.join(" ");
|
|
116
|
+
};
|
|
117
|
+
return () => /* @__PURE__ */ jsxs("div", {
|
|
118
|
+
class: getClasses(),
|
|
119
|
+
children: [
|
|
120
|
+
slots.figure && /* @__PURE__ */ jsx("div", {
|
|
121
|
+
class: "stat-figure",
|
|
122
|
+
children: slots.figure()
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx("div", {
|
|
125
|
+
class: "stat-title",
|
|
126
|
+
children: props.title
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsx("div", {
|
|
129
|
+
class: "stat-value",
|
|
130
|
+
children: props.value
|
|
131
|
+
}),
|
|
132
|
+
props.description && /* @__PURE__ */ jsx("div", {
|
|
133
|
+
class: "stat-desc",
|
|
134
|
+
children: props.description
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
const Stats = component(({ props, slots }) => {
|
|
140
|
+
const getClasses = () => {
|
|
141
|
+
const classes = ["stats", "shadow"];
|
|
142
|
+
if (props.vertical) classes.push("stats-vertical");
|
|
143
|
+
if (props.class) classes.push(props.class);
|
|
144
|
+
return classes.join(" ");
|
|
145
|
+
};
|
|
146
|
+
return () => /* @__PURE__ */ jsx("div", {
|
|
147
|
+
class: getClasses(),
|
|
148
|
+
children: slots.default?.()
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
export { Tbody as a, Thead as c, Table as i, Tr as l, Stat as n, Td as o, Stats as r, Th as s, Avatar as t };
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=data-wxNpnX83.js.map
|