@makolabs/ripple 0.0.1-dev.3 → 0.0.1-dev.5
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 +229 -96
- package/dist/button/Button.svelte +46 -0
- package/dist/button/Button.svelte.d.ts +4 -0
- package/dist/button/button.d.ts +136 -0
- package/dist/button/button.js +167 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/drawer/Drawer.svelte +213 -0
- package/dist/drawer/Drawer.svelte.d.ts +4 -0
- package/dist/drawer/drawer.d.ts +177 -0
- package/dist/drawer/drawer.js +80 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +1 -0
- package/dist/elements/badge/Badge.svelte +35 -0
- package/dist/elements/badge/Badge.svelte.d.ts +4 -0
- package/dist/elements/badge/badge.d.ts +193 -0
- package/dist/elements/badge/badge.js +65 -0
- package/dist/elements/badge/index.d.ts +2 -0
- package/dist/elements/badge/index.js +2 -0
- package/dist/elements/dropdown/Dropdown.svelte +272 -0
- package/dist/elements/dropdown/Dropdown.svelte.d.ts +4 -0
- package/dist/elements/dropdown/Select.svelte +230 -0
- package/dist/elements/dropdown/Select.svelte.d.ts +4 -0
- package/dist/elements/dropdown/dropdown.d.ts +274 -0
- package/dist/elements/dropdown/dropdown.js +89 -0
- package/dist/elements/dropdown/index.d.ts +3 -0
- package/dist/elements/dropdown/index.js +2 -0
- package/dist/elements/dropdown/select.d.ts +220 -0
- package/dist/elements/dropdown/select.js +74 -0
- package/dist/header/Breadcrumbs.svelte +72 -0
- package/dist/header/Breadcrumbs.svelte.d.ts +4 -0
- package/dist/header/PageHeader.svelte +30 -0
- package/dist/header/PageHeader.svelte.d.ts +4 -0
- package/dist/header/breadcrumbs.d.ts +220 -0
- package/dist/header/breadcrumbs.js +81 -0
- package/dist/header/index.d.ts +4 -0
- package/dist/header/index.js +2 -0
- package/dist/header/pageheaders.d.ts +10 -0
- package/dist/header/pageheaders.js +1 -0
- package/dist/helper/cls.d.ts +1 -0
- package/dist/helper/cls.js +4 -0
- package/dist/helper/nav.svelte.d.ts +6 -0
- package/dist/helper/nav.svelte.js +23 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +18 -1
- package/dist/layout/card/Card.svelte +44 -0
- package/dist/layout/card/Card.svelte.d.ts +4 -0
- package/dist/layout/card/StatsCard.svelte +236 -0
- package/dist/layout/card/StatsCard.svelte.d.ts +4 -0
- package/dist/layout/card/card.d.ts +139 -0
- package/dist/layout/card/card.js +50 -0
- package/dist/layout/card/index.d.ts +4 -0
- package/dist/layout/card/index.js +2 -0
- package/dist/layout/card/stats-card.d.ts +208 -0
- package/dist/layout/card/stats-card.js +73 -0
- package/dist/layout/index.d.ts +5 -1
- package/dist/layout/index.js +5 -1
- package/dist/layout/navbar/Navbar.svelte +206 -0
- package/dist/layout/navbar/Navbar.svelte.d.ts +4 -0
- package/dist/layout/navbar/index.d.ts +2 -0
- package/dist/layout/navbar/index.js +2 -0
- package/dist/layout/navbar/navbar.d.ts +228 -0
- package/dist/layout/navbar/navbar.js +98 -0
- package/dist/layout/sidebar/NavGroup.svelte +101 -0
- package/dist/layout/sidebar/NavGroup.svelte.d.ts +4 -0
- package/dist/layout/sidebar/NavItem.svelte +29 -0
- package/dist/layout/sidebar/NavItem.svelte.d.ts +4 -0
- package/dist/layout/sidebar/Sidebar.svelte +145 -0
- package/dist/layout/sidebar/Sidebar.svelte.d.ts +4 -0
- package/dist/layout/sidebar/index.d.ts +2 -0
- package/dist/layout/sidebar/index.js +1 -0
- package/dist/layout/sidebar/sidebar.d.ts +46 -0
- package/dist/layout/sidebar/sidebar.js +1 -0
- package/dist/layout/table/Cells.svelte +111 -0
- package/dist/layout/table/Cells.svelte.d.ts +27 -0
- package/dist/layout/table/Table.svelte +413 -0
- package/dist/layout/table/Table.svelte.d.ts +4 -0
- package/dist/layout/table/index.d.ts +3 -0
- package/dist/layout/table/index.js +2 -0
- package/dist/layout/table/table.d.ts +303 -0
- package/dist/layout/table/table.js +149 -0
- package/dist/layout/tabs/Tab.svelte +57 -0
- package/dist/layout/tabs/Tab.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabContent.svelte +31 -0
- package/dist/layout/tabs/TabContent.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabGroup.svelte +57 -0
- package/dist/layout/tabs/TabGroup.svelte.d.ts +4 -0
- package/dist/layout/tabs/index.d.ts +3 -0
- package/dist/layout/tabs/index.js +3 -0
- package/dist/layout/tabs/tabs.d.ts +155 -0
- package/dist/layout/tabs/tabs.js +156 -0
- package/dist/modal/Modal.svelte +206 -0
- package/dist/modal/Modal.svelte.d.ts +4 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/index.js +1 -0
- package/dist/modal/modal.d.ts +234 -0
- package/dist/modal/modal.js +81 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types/variants.js +19 -0
- package/package.json +100 -102
- package/dist/layout/Card.svelte +0 -179
- package/dist/layout/Card.svelte.d.ts +0 -208
package/README.md
CHANGED
|
@@ -12,118 +12,251 @@ npm i @makolabs/ripple
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
Import ripple UI
|
|
15
|
+
Import ripple UI components
|
|
16
16
|
|
|
17
17
|
```svelte
|
|
18
18
|
<script lang="ts">
|
|
19
|
-
import {Card} from '@makolabs/ripple
|
|
19
|
+
import { Button, Card, Modal } from '@makolabs/ripple';
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<div class="px-12 pt-12">
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
<Card title="Hello World" color="warning">
|
|
24
|
+
<p>This is a card component</p>
|
|
25
25
|
</Card>
|
|
26
26
|
</div>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
29
|
Paste the following CSS import code in `app.css`
|
|
31
30
|
|
|
32
31
|
```css
|
|
33
32
|
@source "../node_modules/@makolabs/ripple";
|
|
34
33
|
|
|
35
34
|
@theme {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
35
|
+
/* Default (Gray) */
|
|
36
|
+
--color-default-50: oklch(0.984 0.003 247.858);
|
|
37
|
+
--color-default-100: oklch(0.96 0.006 247.858);
|
|
38
|
+
--color-default-200: oklch(0.91 0.008 247.858);
|
|
39
|
+
--color-default-300: oklch(0.85 0.01 247.858);
|
|
40
|
+
--color-default-400: oklch(0.76 0.012 247.858);
|
|
41
|
+
--color-default-500: oklch(0.65 0.015 247.858);
|
|
42
|
+
--color-default-600: oklch(0.54 0.018 247.858);
|
|
43
|
+
--color-default-700: oklch(0.45 0.015 247.858);
|
|
44
|
+
--color-default-800: oklch(0.35 0.012 247.858);
|
|
45
|
+
--color-default-900: oklch(0.25 0.01 247.858);
|
|
46
|
+
--color-default-950: oklch(0.15 0.008 247.858);
|
|
47
|
+
|
|
48
|
+
/* Primary (Blue) */
|
|
49
|
+
--color-primary-50: oklch(0.97 0.025 250);
|
|
50
|
+
--color-primary-100: oklch(0.94 0.035 250);
|
|
51
|
+
--color-primary-200: oklch(0.89 0.055 250);
|
|
52
|
+
--color-primary-300: oklch(0.82 0.075 250);
|
|
53
|
+
--color-primary-400: oklch(0.74 0.095 250);
|
|
54
|
+
--color-primary-500: oklch(0.65 0.115 250);
|
|
55
|
+
--color-primary-600: oklch(0.55 0.125 250);
|
|
56
|
+
--color-primary-700: oklch(0.45 0.115 250);
|
|
57
|
+
--color-primary-800: oklch(0.35 0.095 250);
|
|
58
|
+
--color-primary-900: oklch(0.25 0.075 250);
|
|
59
|
+
--color-primary-950: oklch(0.15 0.055 250);
|
|
60
|
+
|
|
61
|
+
/* Secondary (Slate) */
|
|
62
|
+
--color-secondary-50: oklch(0.97 0.02 255);
|
|
63
|
+
--color-secondary-100: oklch(0.94 0.03 255);
|
|
64
|
+
--color-secondary-200: oklch(0.89 0.04 255);
|
|
65
|
+
--color-secondary-300: oklch(0.82 0.05 255);
|
|
66
|
+
--color-secondary-400: oklch(0.74 0.06 255);
|
|
67
|
+
--color-secondary-500: oklch(0.65 0.07 255);
|
|
68
|
+
--color-secondary-600: oklch(0.55 0.065 255);
|
|
69
|
+
--color-secondary-700: oklch(0.45 0.055 255);
|
|
70
|
+
--color-secondary-800: oklch(0.35 0.045 255);
|
|
71
|
+
--color-secondary-900: oklch(0.25 0.035 255);
|
|
72
|
+
--color-secondary-950: oklch(0.15 0.025 255);
|
|
73
|
+
|
|
74
|
+
/* Info (Sky) */
|
|
75
|
+
--color-info-50: oklch(0.97 0.025 220);
|
|
76
|
+
--color-info-100: oklch(0.94 0.04 220);
|
|
77
|
+
--color-info-200: oklch(0.89 0.06 220);
|
|
78
|
+
--color-info-300: oklch(0.82 0.085 220);
|
|
79
|
+
--color-info-400: oklch(0.74 0.105 220);
|
|
80
|
+
--color-info-500: oklch(0.65 0.125 220);
|
|
81
|
+
--color-info-600: oklch(0.55 0.115 220);
|
|
82
|
+
--color-info-700: oklch(0.45 0.105 220);
|
|
83
|
+
--color-info-800: oklch(0.35 0.085 220);
|
|
84
|
+
--color-info-900: oklch(0.25 0.065 220);
|
|
85
|
+
--color-info-950: oklch(0.15 0.045 220);
|
|
86
|
+
|
|
87
|
+
/* Success (Green) */
|
|
88
|
+
--color-success-50: oklch(0.97 0.025 145);
|
|
89
|
+
--color-success-100: oklch(0.94 0.04 145);
|
|
90
|
+
--color-success-200: oklch(0.89 0.06 145);
|
|
91
|
+
--color-success-300: oklch(0.82 0.08 145);
|
|
92
|
+
--color-success-400: oklch(0.74 0.1 145);
|
|
93
|
+
--color-success-500: oklch(0.65 0.12 145);
|
|
94
|
+
--color-success-600: oklch(0.55 0.11 145);
|
|
95
|
+
--color-success-700: oklch(0.45 0.1 145);
|
|
96
|
+
--color-success-800: oklch(0.35 0.08 145);
|
|
97
|
+
--color-success-900: oklch(0.25 0.06 145);
|
|
98
|
+
--color-success-950: oklch(0.15 0.04 145);
|
|
99
|
+
|
|
100
|
+
/* Warning (Yellow) */
|
|
101
|
+
--color-warning-50: oklch(0.97 0.025 90);
|
|
102
|
+
--color-warning-100: oklch(0.94 0.045 90);
|
|
103
|
+
--color-warning-200: oklch(0.89 0.065 90);
|
|
104
|
+
--color-warning-300: oklch(0.82 0.085 90);
|
|
105
|
+
--color-warning-400: oklch(0.74 0.105 90);
|
|
106
|
+
--color-warning-500: oklch(0.65 0.125 90);
|
|
107
|
+
--color-warning-600: oklch(0.55 0.115 90);
|
|
108
|
+
--color-warning-700: oklch(0.45 0.105 90);
|
|
109
|
+
--color-warning-800: oklch(0.35 0.085 90);
|
|
110
|
+
--color-warning-900: oklch(0.25 0.065 90);
|
|
111
|
+
--color-warning-950: oklch(0.15 0.045 90);
|
|
112
|
+
|
|
113
|
+
/* Danger (Red) */
|
|
114
|
+
--color-danger-50: oklch(0.97 0.025 25);
|
|
115
|
+
--color-danger-100: oklch(0.94 0.045 25);
|
|
116
|
+
--color-danger-200: oklch(0.89 0.065 25);
|
|
117
|
+
--color-danger-300: oklch(0.82 0.085 25);
|
|
118
|
+
--color-danger-400: oklch(0.74 0.105 25);
|
|
119
|
+
--color-danger-500: oklch(0.65 0.125 25);
|
|
120
|
+
--color-danger-600: oklch(0.55 0.115 25);
|
|
121
|
+
--color-danger-700: oklch(0.45 0.105 25);
|
|
122
|
+
--color-danger-800: oklch(0.35 0.085 25);
|
|
123
|
+
--color-danger-900: oklch(0.25 0.065 25);
|
|
124
|
+
--color-danger-950: oklch(0.15 0.045 25);
|
|
126
125
|
}
|
|
127
126
|
```
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
## Component Variants
|
|
129
|
+
|
|
130
|
+
Most components in Ripple UI support variants to customize their appearance. Here are some examples:
|
|
131
|
+
|
|
132
|
+
### Button Variants
|
|
133
|
+
|
|
134
|
+
Buttons come with different variants, colors, sizes, and shapes:
|
|
135
|
+
|
|
136
|
+
```svelte
|
|
137
|
+
<script lang="ts">
|
|
138
|
+
import { Button } from '@makolabs/ripple';
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<!-- Different button variants -->
|
|
142
|
+
<Button variant="solid" color="primary">Solid Button</Button>
|
|
143
|
+
<Button variant="outline" color="secondary">Outline Button</Button>
|
|
144
|
+
<Button variant="ghost" color="danger">Ghost Button</Button>
|
|
145
|
+
<Button variant="link" color="info">Link Button</Button>
|
|
146
|
+
|
|
147
|
+
<!-- Button sizes -->
|
|
148
|
+
<Button size="xs">Extra Small</Button>
|
|
149
|
+
<Button size="sm">Small</Button>
|
|
150
|
+
<Button size="base">Base</Button>
|
|
151
|
+
<Button size="lg">Large</Button>
|
|
152
|
+
<Button size="xl">Extra Large</Button>
|
|
153
|
+
<Button size="2xl">2X Large</Button>
|
|
154
|
+
|
|
155
|
+
<!-- Button corner radius -->
|
|
156
|
+
<Button rounded="none">Sharp Corners</Button>
|
|
157
|
+
<Button rounded="sm">Small Radius</Button>
|
|
158
|
+
<Button rounded="base">Base Radius</Button>
|
|
159
|
+
<Button rounded="full">Pill Button</Button>
|
|
160
|
+
|
|
161
|
+
<!-- Loading state -->
|
|
162
|
+
<Button isLoading={true} color="primary">Loading...</Button>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Modal Variants
|
|
166
|
+
|
|
167
|
+
Modals can be customized with different positions:
|
|
168
|
+
|
|
169
|
+
```svelte
|
|
170
|
+
<script lang="ts">
|
|
171
|
+
import { Modal } from '@makolabs/ripple';
|
|
172
|
+
let isOpen = false;
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<Button on:click={() => isOpen = true}>Open Modal</Button>
|
|
176
|
+
|
|
177
|
+
<Modal
|
|
178
|
+
open={isOpen}
|
|
179
|
+
position="center"
|
|
180
|
+
title="Modal Title"
|
|
181
|
+
onClose={() => isOpen = false}
|
|
182
|
+
>
|
|
183
|
+
<p>Modal content goes here</p>
|
|
184
|
+
</Modal>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Card Variants
|
|
188
|
+
|
|
189
|
+
Cards can be customized with different styles:
|
|
190
|
+
|
|
191
|
+
```svelte
|
|
192
|
+
<script lang="ts">
|
|
193
|
+
import { Card, StatsCard } from '@makolabs/ripple';
|
|
194
|
+
</script>
|
|
195
|
+
|
|
196
|
+
<Card title="Basic Card" color="primary">
|
|
197
|
+
<p>Card content goes here</p>
|
|
198
|
+
</Card>
|
|
199
|
+
|
|
200
|
+
<StatsCard
|
|
201
|
+
title="Statistics"
|
|
202
|
+
value="1,234"
|
|
203
|
+
description="Total users"
|
|
204
|
+
trend="up"
|
|
205
|
+
percentage={12}
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Table Component
|
|
210
|
+
|
|
211
|
+
Tables for displaying structured data:
|
|
212
|
+
|
|
213
|
+
```svelte
|
|
214
|
+
<script lang="ts">
|
|
215
|
+
import { Table, Cell } from '@makolabs/ripple';
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<Table>
|
|
219
|
+
<thead>
|
|
220
|
+
<tr>
|
|
221
|
+
<Cell as="th">Name</Cell>
|
|
222
|
+
<Cell as="th">Email</Cell>
|
|
223
|
+
<Cell as="th">Status</Cell>
|
|
224
|
+
</tr>
|
|
225
|
+
</thead>
|
|
226
|
+
<tbody>
|
|
227
|
+
<tr>
|
|
228
|
+
<Cell>John Doe</Cell>
|
|
229
|
+
<Cell>john@example.com</Cell>
|
|
230
|
+
<Cell>Active</Cell>
|
|
231
|
+
</tr>
|
|
232
|
+
</tbody>
|
|
233
|
+
</Table>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Latest Updates
|
|
237
|
+
|
|
238
|
+
Ripple UI now exports all components from a central entry point, making it easier to import components:
|
|
239
|
+
|
|
240
|
+
```svelte
|
|
241
|
+
<script lang="ts">
|
|
242
|
+
import { Button, Modal, Card, Table, Select, Dropdown } from '@makolabs/ripple';
|
|
243
|
+
</script>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
You can still import specific component types when needed:
|
|
247
|
+
|
|
248
|
+
```svelte
|
|
249
|
+
<script lang="ts">
|
|
250
|
+
import { Button, type ButtonProps } from '@makolabs/ripple';
|
|
251
|
+
|
|
252
|
+
// Create a custom button with specific props
|
|
253
|
+
const myButton: ButtonProps = {
|
|
254
|
+
variant: 'outline',
|
|
255
|
+
color: 'primary',
|
|
256
|
+
size: 'lg',
|
|
257
|
+
rounded: 'xl'
|
|
258
|
+
};
|
|
259
|
+
</script>
|
|
260
|
+
|
|
261
|
+
<Button {...myButton}>Custom Button</Button>
|
|
262
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../helper/cls.js';
|
|
3
|
+
import { type ButtonProps, buttonVariants } from './button.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
variant = 'solid',
|
|
7
|
+
color = 'default',
|
|
8
|
+
size = 'base',
|
|
9
|
+
rounded = 'base',
|
|
10
|
+
disabled = false,
|
|
11
|
+
isLoading = false,
|
|
12
|
+
class: className = '',
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
}: ButtonProps = $props();
|
|
16
|
+
|
|
17
|
+
const buttonClasses = $derived(
|
|
18
|
+
cn(
|
|
19
|
+
buttonVariants({
|
|
20
|
+
variant,
|
|
21
|
+
color,
|
|
22
|
+
size,
|
|
23
|
+
rounded,
|
|
24
|
+
isLoading
|
|
25
|
+
}),
|
|
26
|
+
{
|
|
27
|
+
'opacity-50 pointer-events-none cursor-not-allowed': disabled
|
|
28
|
+
},
|
|
29
|
+
className
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
{#if restProps['href']}
|
|
35
|
+
<a class={buttonClasses} {...restProps}>
|
|
36
|
+
{#if children}
|
|
37
|
+
{@render children()}
|
|
38
|
+
{/if}
|
|
39
|
+
</a>
|
|
40
|
+
{:else}
|
|
41
|
+
<button class={buttonClasses} disabled={disabled || isLoading} {...restProps}>
|
|
42
|
+
{#if children}
|
|
43
|
+
{@render children()}
|
|
44
|
+
{/if}
|
|
45
|
+
</button>
|
|
46
|
+
{/if}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { HTMLAttributeAnchorTarget, HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
solid: string;
|
|
7
|
+
outline: string;
|
|
8
|
+
ghost: string;
|
|
9
|
+
link: string;
|
|
10
|
+
};
|
|
11
|
+
color: {
|
|
12
|
+
default: string;
|
|
13
|
+
primary: string;
|
|
14
|
+
secondary: string;
|
|
15
|
+
info: string;
|
|
16
|
+
success: string;
|
|
17
|
+
warning: string;
|
|
18
|
+
danger: string;
|
|
19
|
+
};
|
|
20
|
+
size: {
|
|
21
|
+
xs: string;
|
|
22
|
+
sm: string;
|
|
23
|
+
base: string;
|
|
24
|
+
lg: string;
|
|
25
|
+
xl: string;
|
|
26
|
+
'2xl': string;
|
|
27
|
+
};
|
|
28
|
+
rounded: {
|
|
29
|
+
none: string;
|
|
30
|
+
xs: string;
|
|
31
|
+
sm: string;
|
|
32
|
+
base: string;
|
|
33
|
+
lg: string;
|
|
34
|
+
xl: string;
|
|
35
|
+
'2xl': string;
|
|
36
|
+
full: string;
|
|
37
|
+
};
|
|
38
|
+
isLoading: {
|
|
39
|
+
true: string;
|
|
40
|
+
};
|
|
41
|
+
}, undefined, "\n\t\tinline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none\n\t\tfocus-visible:ring-2 focus-visible:ring-offset-2 cursor-pointer\n\t\t", {
|
|
42
|
+
variant: {
|
|
43
|
+
solid: string;
|
|
44
|
+
outline: string;
|
|
45
|
+
ghost: string;
|
|
46
|
+
link: string;
|
|
47
|
+
};
|
|
48
|
+
color: {
|
|
49
|
+
default: string;
|
|
50
|
+
primary: string;
|
|
51
|
+
secondary: string;
|
|
52
|
+
info: string;
|
|
53
|
+
success: string;
|
|
54
|
+
warning: string;
|
|
55
|
+
danger: string;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
xs: string;
|
|
59
|
+
sm: string;
|
|
60
|
+
base: string;
|
|
61
|
+
lg: string;
|
|
62
|
+
xl: string;
|
|
63
|
+
'2xl': string;
|
|
64
|
+
};
|
|
65
|
+
rounded: {
|
|
66
|
+
none: string;
|
|
67
|
+
xs: string;
|
|
68
|
+
sm: string;
|
|
69
|
+
base: string;
|
|
70
|
+
lg: string;
|
|
71
|
+
xl: string;
|
|
72
|
+
'2xl': string;
|
|
73
|
+
full: string;
|
|
74
|
+
};
|
|
75
|
+
isLoading: {
|
|
76
|
+
true: string;
|
|
77
|
+
};
|
|
78
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
79
|
+
variant: {
|
|
80
|
+
solid: string;
|
|
81
|
+
outline: string;
|
|
82
|
+
ghost: string;
|
|
83
|
+
link: string;
|
|
84
|
+
};
|
|
85
|
+
color: {
|
|
86
|
+
default: string;
|
|
87
|
+
primary: string;
|
|
88
|
+
secondary: string;
|
|
89
|
+
info: string;
|
|
90
|
+
success: string;
|
|
91
|
+
warning: string;
|
|
92
|
+
danger: string;
|
|
93
|
+
};
|
|
94
|
+
size: {
|
|
95
|
+
xs: string;
|
|
96
|
+
sm: string;
|
|
97
|
+
base: string;
|
|
98
|
+
lg: string;
|
|
99
|
+
xl: string;
|
|
100
|
+
'2xl': string;
|
|
101
|
+
};
|
|
102
|
+
rounded: {
|
|
103
|
+
none: string;
|
|
104
|
+
xs: string;
|
|
105
|
+
sm: string;
|
|
106
|
+
base: string;
|
|
107
|
+
lg: string;
|
|
108
|
+
xl: string;
|
|
109
|
+
'2xl': string;
|
|
110
|
+
full: string;
|
|
111
|
+
};
|
|
112
|
+
isLoading: {
|
|
113
|
+
true: string;
|
|
114
|
+
};
|
|
115
|
+
}, undefined, "\n\t\tinline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none\n\t\tfocus-visible:ring-2 focus-visible:ring-offset-2 cursor-pointer\n\t\t", unknown, unknown, undefined>>;
|
|
116
|
+
type ButtonHTMLProps = {
|
|
117
|
+
href?: never;
|
|
118
|
+
} & HTMLButtonAttributes;
|
|
119
|
+
type AnchorHTMLProps = {
|
|
120
|
+
rel?: string | undefined | null;
|
|
121
|
+
target?: HTMLAttributeAnchorTarget | undefined | null;
|
|
122
|
+
referrerpolicy?: ReferrerPolicy | undefined | null;
|
|
123
|
+
href: string;
|
|
124
|
+
} & Record<string, unknown>;
|
|
125
|
+
export type BaseButtonProps = {
|
|
126
|
+
class?: ClassValue;
|
|
127
|
+
variant?: 'solid' | 'outline' | 'ghost' | 'link';
|
|
128
|
+
color?: keyof typeof buttonVariants.variants.color;
|
|
129
|
+
size?: keyof typeof buttonVariants.variants.size;
|
|
130
|
+
rounded?: keyof typeof buttonVariants.variants.rounded;
|
|
131
|
+
disabled?: boolean | undefined | null;
|
|
132
|
+
isLoading?: boolean;
|
|
133
|
+
children?: Snippet;
|
|
134
|
+
};
|
|
135
|
+
export type ButtonProps = BaseButtonProps & (ButtonHTMLProps | AnchorHTMLProps);
|
|
136
|
+
export {};
|