@makolabs/ripple 0.0.1 → 0.0.4
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 +575 -8
- package/dist/adapters/storage/BaseAdapter.d.ts +20 -0
- package/dist/adapters/storage/BaseAdapter.js +171 -0
- package/dist/adapters/storage/S3Adapter.d.ts +21 -0
- package/dist/adapters/storage/S3Adapter.js +194 -0
- package/dist/adapters/storage/index.d.ts +3 -0
- package/dist/adapters/storage/index.js +3 -0
- package/dist/adapters/storage/types.d.ts +102 -0
- package/dist/adapters/storage/types.js +4 -0
- package/dist/button/Button.svelte +48 -0
- package/dist/button/Button.svelte.d.ts +4 -0
- package/dist/button/button.d.ts +113 -0
- package/dist/button/button.js +168 -0
- package/dist/charts/Chart.svelte +545 -0
- package/dist/charts/Chart.svelte.d.ts +4 -0
- package/dist/drawer/Drawer.svelte +224 -0
- package/dist/drawer/Drawer.svelte.d.ts +4 -0
- package/dist/drawer/drawer.d.ts +160 -0
- package/dist/drawer/drawer.js +80 -0
- package/dist/elements/accordion/Accordion.svelte +98 -0
- package/dist/elements/accordion/Accordion.svelte.d.ts +4 -0
- package/dist/elements/accordion/accordion.d.ts +227 -0
- package/dist/elements/accordion/accordion.js +138 -0
- package/dist/elements/alert/Alert.svelte +57 -0
- package/dist/elements/alert/Alert.svelte.d.ts +4 -0
- package/dist/elements/badge/Badge.svelte +43 -0
- package/dist/elements/badge/Badge.svelte.d.ts +4 -0
- package/dist/elements/badge/badge.d.ts +181 -0
- package/dist/elements/badge/badge.js +65 -0
- package/dist/elements/dropdown/Dropdown.svelte +234 -0
- package/dist/elements/dropdown/Dropdown.svelte.d.ts +4 -0
- package/dist/elements/dropdown/Select.svelte +333 -0
- package/dist/elements/dropdown/Select.svelte.d.ts +4 -0
- package/dist/elements/dropdown/dropdown.d.ts +251 -0
- package/dist/elements/dropdown/dropdown.js +95 -0
- package/dist/elements/dropdown/select.d.ts +200 -0
- package/dist/elements/dropdown/select.js +82 -0
- package/dist/elements/file-upload/FileUpload.svelte +135 -0
- package/dist/elements/file-upload/FileUpload.svelte.d.ts +4 -0
- package/dist/elements/file-upload/FilesPreview.svelte +93 -0
- package/dist/elements/file-upload/FilesPreview.svelte.d.ts +4 -0
- package/dist/elements/progress/Progress.svelte +145 -0
- package/dist/elements/progress/Progress.svelte.d.ts +4 -0
- package/dist/elements/timeline/Timeline.svelte +92 -0
- package/dist/elements/timeline/Timeline.svelte.d.ts +7 -0
- package/dist/file-browser/FileBrowser.svelte +877 -0
- package/dist/file-browser/FileBrowser.svelte.d.ts +14 -0
- package/dist/file-browser/index.d.ts +1 -0
- package/dist/file-browser/index.js +1 -0
- package/dist/filters/CompactFilters.svelte +147 -0
- package/dist/filters/CompactFilters.svelte.d.ts +4 -0
- package/dist/filters/index.d.ts +1 -0
- package/dist/filters/index.js +1 -0
- package/dist/forms/Checkbox.svelte +54 -0
- package/dist/forms/Checkbox.svelte.d.ts +4 -0
- package/dist/forms/DateRange.svelte +493 -0
- package/dist/forms/DateRange.svelte.d.ts +4 -0
- package/dist/forms/Form.svelte +39 -0
- package/dist/forms/Form.svelte.d.ts +4 -0
- package/dist/forms/Input.svelte +86 -0
- package/dist/forms/Input.svelte.d.ts +4 -0
- package/dist/forms/NumberInput.svelte +159 -0
- package/dist/forms/NumberInput.svelte.d.ts +4 -0
- package/dist/forms/RadioInputs.svelte +64 -0
- package/dist/forms/RadioInputs.svelte.d.ts +4 -0
- package/dist/forms/RadioPill.svelte +66 -0
- package/dist/forms/RadioPill.svelte.d.ts +4 -0
- package/dist/forms/Slider.svelte +342 -0
- package/dist/forms/Slider.svelte.d.ts +4 -0
- package/dist/forms/Tags.svelte +181 -0
- package/dist/forms/Tags.svelte.d.ts +4 -0
- package/dist/forms/Toggle.svelte +132 -0
- package/dist/forms/Toggle.svelte.d.ts +4 -0
- package/dist/forms/slider.d.ts +143 -0
- package/dist/forms/slider.js +62 -0
- package/dist/header/Breadcrumbs.svelte +73 -0
- package/dist/header/Breadcrumbs.svelte.d.ts +4 -0
- package/dist/header/PageHeader.svelte +68 -0
- package/dist/header/PageHeader.svelte.d.ts +4 -0
- package/dist/header/breadcrumbs.d.ts +226 -0
- package/dist/header/breadcrumbs.js +87 -0
- package/dist/helper/cls.d.ts +1 -0
- package/dist/helper/cls.js +4 -0
- package/dist/helper/date.d.ts +7 -0
- package/dist/helper/date.js +15 -0
- package/dist/helper/nav.svelte.d.ts +6 -0
- package/dist/helper/nav.svelte.js +23 -0
- package/dist/index.d.ts +856 -1
- package/dist/index.js +78 -1
- package/dist/layout/card/Card.svelte +41 -0
- package/dist/layout/card/Card.svelte.d.ts +4 -0
- package/dist/layout/card/MetricCard.svelte +64 -0
- package/dist/layout/card/MetricCard.svelte.d.ts +4 -0
- package/dist/layout/card/StatsCard.svelte +266 -0
- package/dist/layout/card/StatsCard.svelte.d.ts +4 -0
- package/dist/layout/card/card.d.ts +128 -0
- package/dist/layout/card/card.js +51 -0
- package/dist/layout/card/metric-card.d.ts +49 -0
- package/dist/layout/card/metric-card.js +10 -0
- package/dist/layout/card/stats-card.d.ts +191 -0
- package/dist/layout/card/stats-card.js +73 -0
- package/dist/layout/navbar/Navbar.svelte +206 -0
- package/dist/layout/navbar/Navbar.svelte.d.ts +4 -0
- package/dist/layout/navbar/navbar.d.ts +205 -0
- package/dist/layout/navbar/navbar.js +98 -0
- package/dist/layout/sidebar/NavGroup.svelte +91 -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 +193 -0
- package/dist/layout/sidebar/Sidebar.svelte.d.ts +4 -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 +790 -0
- package/dist/layout/table/Table.svelte.d.ts +4 -0
- package/dist/layout/table/table.d.ts +256 -0
- package/dist/layout/table/table.js +141 -0
- package/dist/layout/tabs/Tab.svelte +60 -0
- package/dist/layout/tabs/Tab.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabContent.svelte +30 -0
- package/dist/layout/tabs/TabContent.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabGroup.svelte +62 -0
- package/dist/layout/tabs/TabGroup.svelte.d.ts +4 -0
- package/dist/layout/tabs/tabs.d.ts +140 -0
- package/dist/layout/tabs/tabs.js +298 -0
- package/dist/modal/Modal.svelte +207 -0
- package/dist/modal/Modal.svelte.d.ts +4 -0
- package/dist/modal/modal.d.ts +211 -0
- package/dist/modal/modal.js +81 -0
- package/dist/sonner/sonner.svelte +13 -0
- package/dist/sonner/sonner.svelte.d.ts +4 -0
- package/dist/types/variants.d.ts +1 -0
- package/dist/types/variants.js +1 -0
- package/dist/utils/Portal.svelte +108 -0
- package/dist/utils/Portal.svelte.d.ts +8 -0
- package/dist/utils/dateUtils.d.ts +7 -0
- package/dist/utils/dateUtils.js +26 -0
- package/dist/variants.d.ts +30 -0
- package/dist/variants.js +36 -0
- package/package.json +39 -6
- package/dist/layout/Card.svelte +0 -179
- package/dist/layout/Card.svelte.d.ts +0 -208
- package/dist/layout/index.d.ts +0 -1
- package/dist/layout/index.js +0 -1
package/README.md
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ripple UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modern, standardized Svelte 5 component library designed for simplicity, consistency, and AI-friendly usage patterns.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
- **Standardized API** with consistent prop naming and patterns across components
|
|
8
|
+
- **Enum-based properties** for predictable component customization
|
|
9
|
+
- **Strong TypeScript support** with comprehensive type definitions
|
|
10
|
+
- **Utility-first approach** built with TailwindCSS
|
|
11
|
+
- **Accessible components** adhering to modern web standards
|
|
12
|
+
- **Simplified component consumption** ideal for both human and AI developers
|
|
4
13
|
|
|
5
14
|
## Getting started
|
|
6
15
|
|
|
7
16
|
Install the project
|
|
8
|
-
|
|
17
|
+
|
|
18
|
+
```shell
|
|
9
19
|
npm i @makolabs/ripple
|
|
10
20
|
```
|
|
11
21
|
|
|
12
22
|
## Usage
|
|
13
23
|
|
|
14
|
-
Import ripple UI
|
|
24
|
+
Import ripple UI components
|
|
15
25
|
|
|
16
26
|
```svelte
|
|
17
27
|
<script lang="ts">
|
|
18
|
-
import {Card} from '@makolabs/ripple
|
|
28
|
+
import { Button, Card, Modal } from '@makolabs/ripple';
|
|
19
29
|
</script>
|
|
20
30
|
|
|
21
31
|
<div class="px-12 pt-12">
|
|
@@ -25,11 +35,568 @@ Import ripple UI
|
|
|
25
35
|
</div>
|
|
26
36
|
```
|
|
27
37
|
|
|
28
|
-
|
|
29
38
|
Paste the following CSS import code in `app.css`
|
|
30
39
|
|
|
31
|
-
```
|
|
40
|
+
```css
|
|
32
41
|
@source "../node_modules/@makolabs/ripple";
|
|
42
|
+
|
|
43
|
+
@theme {
|
|
44
|
+
/* Default (default) */
|
|
45
|
+
--color-default-50: oklch(0.984 0.003 247.858);
|
|
46
|
+
--color-default-100: oklch(0.96 0.006 247.858);
|
|
47
|
+
--color-default-200: oklch(0.91 0.008 247.858);
|
|
48
|
+
--color-default-300: oklch(0.85 0.01 247.858);
|
|
49
|
+
--color-default-400: oklch(0.76 0.012 247.858);
|
|
50
|
+
--color-default-500: oklch(0.65 0.015 247.858);
|
|
51
|
+
--color-default-600: oklch(0.54 0.018 247.858);
|
|
52
|
+
--color-default-700: oklch(0.45 0.015 247.858);
|
|
53
|
+
--color-default-800: oklch(0.35 0.012 247.858);
|
|
54
|
+
--color-default-900: oklch(0.25 0.01 247.858);
|
|
55
|
+
--color-default-950: oklch(0.15 0.008 247.858);
|
|
56
|
+
|
|
57
|
+
/* Primary (Blue) */
|
|
58
|
+
--color-primary-50: oklch(0.97 0.025 250);
|
|
59
|
+
--color-primary-100: oklch(0.94 0.035 250);
|
|
60
|
+
--color-primary-200: oklch(0.89 0.055 250);
|
|
61
|
+
--color-primary-300: oklch(0.82 0.075 250);
|
|
62
|
+
--color-primary-400: oklch(0.74 0.095 250);
|
|
63
|
+
--color-primary-500: oklch(0.65 0.115 250);
|
|
64
|
+
--color-primary-600: oklch(0.55 0.125 250);
|
|
65
|
+
--color-primary-700: oklch(0.45 0.115 250);
|
|
66
|
+
--color-primary-800: oklch(0.35 0.095 250);
|
|
67
|
+
--color-primary-900: oklch(0.25 0.075 250);
|
|
68
|
+
--color-primary-950: oklch(0.15 0.055 250);
|
|
69
|
+
|
|
70
|
+
/* Secondary (Slate) */
|
|
71
|
+
--color-secondary-50: oklch(0.97 0.02 255);
|
|
72
|
+
--color-secondary-100: oklch(0.94 0.03 255);
|
|
73
|
+
--color-secondary-200: oklch(0.89 0.04 255);
|
|
74
|
+
--color-secondary-300: oklch(0.82 0.05 255);
|
|
75
|
+
--color-secondary-400: oklch(0.74 0.06 255);
|
|
76
|
+
--color-secondary-500: oklch(0.65 0.07 255);
|
|
77
|
+
--color-secondary-600: oklch(0.55 0.065 255);
|
|
78
|
+
--color-secondary-700: oklch(0.45 0.055 255);
|
|
79
|
+
--color-secondary-800: oklch(0.35 0.045 255);
|
|
80
|
+
--color-secondary-900: oklch(0.25 0.035 255);
|
|
81
|
+
--color-secondary-950: oklch(0.15 0.025 255);
|
|
82
|
+
|
|
83
|
+
/* Info (Sky) */
|
|
84
|
+
--color-info-50: oklch(0.97 0.025 220);
|
|
85
|
+
--color-info-100: oklch(0.94 0.04 220);
|
|
86
|
+
--color-info-200: oklch(0.89 0.06 220);
|
|
87
|
+
--color-info-300: oklch(0.82 0.085 220);
|
|
88
|
+
--color-info-400: oklch(0.74 0.105 220);
|
|
89
|
+
--color-info-500: oklch(0.65 0.125 220);
|
|
90
|
+
--color-info-600: oklch(0.55 0.115 220);
|
|
91
|
+
--color-info-700: oklch(0.45 0.105 220);
|
|
92
|
+
--color-info-800: oklch(0.35 0.085 220);
|
|
93
|
+
--color-info-900: oklch(0.25 0.065 220);
|
|
94
|
+
--color-info-950: oklch(0.15 0.045 220);
|
|
95
|
+
|
|
96
|
+
/* Success (Green) */
|
|
97
|
+
--color-success-50: oklch(0.97 0.025 145);
|
|
98
|
+
--color-success-100: oklch(0.94 0.04 145);
|
|
99
|
+
--color-success-200: oklch(0.89 0.06 145);
|
|
100
|
+
--color-success-300: oklch(0.82 0.08 145);
|
|
101
|
+
--color-success-400: oklch(0.74 0.1 145);
|
|
102
|
+
--color-success-500: oklch(0.65 0.12 145);
|
|
103
|
+
--color-success-600: oklch(0.55 0.11 145);
|
|
104
|
+
--color-success-700: oklch(0.45 0.1 145);
|
|
105
|
+
--color-success-800: oklch(0.35 0.08 145);
|
|
106
|
+
--color-success-900: oklch(0.25 0.06 145);
|
|
107
|
+
--color-success-950: oklch(0.15 0.04 145);
|
|
108
|
+
|
|
109
|
+
/* Warning (Yellow) */
|
|
110
|
+
--color-warning-50: oklch(0.97 0.025 90);
|
|
111
|
+
--color-warning-100: oklch(0.94 0.045 90);
|
|
112
|
+
--color-warning-200: oklch(0.89 0.065 90);
|
|
113
|
+
--color-warning-300: oklch(0.82 0.085 90);
|
|
114
|
+
--color-warning-400: oklch(0.74 0.105 90);
|
|
115
|
+
--color-warning-500: oklch(0.65 0.125 90);
|
|
116
|
+
--color-warning-600: oklch(0.55 0.115 90);
|
|
117
|
+
--color-warning-700: oklch(0.45 0.105 90);
|
|
118
|
+
--color-warning-800: oklch(0.35 0.085 90);
|
|
119
|
+
--color-warning-900: oklch(0.25 0.065 90);
|
|
120
|
+
--color-warning-950: oklch(0.15 0.045 90);
|
|
121
|
+
|
|
122
|
+
/* Danger (Red) */
|
|
123
|
+
--color-danger-50: oklch(0.97 0.025 25);
|
|
124
|
+
--color-danger-100: oklch(0.94 0.045 25);
|
|
125
|
+
--color-danger-200: oklch(0.89 0.065 25);
|
|
126
|
+
--color-danger-300: oklch(0.82 0.085 25);
|
|
127
|
+
--color-danger-400: oklch(0.74 0.105 25);
|
|
128
|
+
--color-danger-500: oklch(0.65 0.125 25);
|
|
129
|
+
--color-danger-600: oklch(0.55 0.115 25);
|
|
130
|
+
--color-danger-700: oklch(0.45 0.105 25);
|
|
131
|
+
--color-danger-800: oklch(0.35 0.085 25);
|
|
132
|
+
--color-danger-900: oklch(0.25 0.065 25);
|
|
133
|
+
--color-danger-950: oklch(0.15 0.045 25);
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Design Philosophy
|
|
138
|
+
|
|
139
|
+
Ripple UI was built with a focus on consistency and standardization. Every component follows the same patterns for customization:
|
|
140
|
+
|
|
141
|
+
### Standardized Enums
|
|
142
|
+
|
|
143
|
+
Components use standardized enums for colors, sizes, and variants:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
// Colors available for most components
|
|
147
|
+
Color.DEFAULT // 'default'
|
|
148
|
+
Color.PRIMARY // 'primary'
|
|
149
|
+
Color.SECONDARY // 'secondary'
|
|
150
|
+
Color.INFO // 'info'
|
|
151
|
+
Color.SUCCESS // 'success'
|
|
152
|
+
Color.WARNING // 'warning'
|
|
153
|
+
Color.DANGER // 'danger'
|
|
154
|
+
|
|
155
|
+
// Sizes available for most components
|
|
156
|
+
Size.XS // 'xs'
|
|
157
|
+
Size.SM // 'sm'
|
|
158
|
+
Size.BASE // 'base'
|
|
159
|
+
Size.LG // 'lg'
|
|
160
|
+
Size.XL // 'xl'
|
|
161
|
+
Size.XXL // '2xl'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Consistent Props Pattern
|
|
165
|
+
|
|
166
|
+
All components follow a consistent props pattern with predictable naming:
|
|
167
|
+
|
|
168
|
+
- `color`: Component color theme (using the Color enum)
|
|
169
|
+
- `size`: Component size (using the Size enum)
|
|
170
|
+
- `class`: Custom CSS classes for the component
|
|
171
|
+
- Event handlers with `on` prefix (e.g., `onclick`, `onchange`)
|
|
172
|
+
- Element-specific class props named with component + 'class' (e.g., `titleclass`, `bodyclass`)
|
|
173
|
+
|
|
174
|
+
## Component Variants
|
|
175
|
+
|
|
176
|
+
Most components in Ripple UI support variants to customize their appearance. Here are some examples:
|
|
177
|
+
|
|
178
|
+
### Button Variants
|
|
179
|
+
|
|
180
|
+
Buttons come with different variants, colors, sizes, and shapes:
|
|
181
|
+
|
|
182
|
+
```svelte
|
|
183
|
+
<script lang="ts">
|
|
184
|
+
import { Button, Color, Size } from '@makolabs/ripple';
|
|
185
|
+
</script>
|
|
186
|
+
|
|
187
|
+
<!-- Different button variants -->
|
|
188
|
+
<Button variant="solid" color={Color.PRIMARY}>Solid Button</Button>
|
|
189
|
+
<Button variant="outline" color={Color.SECONDARY}>Outline Button</Button>
|
|
190
|
+
<Button variant="ghost" color={Color.DANGER}>Ghost Button</Button>
|
|
191
|
+
<Button variant="link" color={Color.INFO}>Link Button</Button>
|
|
192
|
+
|
|
193
|
+
<!-- Button with onclick handler -->
|
|
194
|
+
<Button
|
|
195
|
+
color={Color.SUCCESS}
|
|
196
|
+
onclick={() => console.log('Button clicked')}
|
|
197
|
+
>
|
|
198
|
+
Click Me
|
|
199
|
+
</Button>
|
|
200
|
+
|
|
201
|
+
<!-- Button as link -->
|
|
202
|
+
<Button
|
|
203
|
+
href="https://example.com"
|
|
204
|
+
target="_blank"
|
|
205
|
+
color={Color.PRIMARY}
|
|
206
|
+
>
|
|
207
|
+
Visit Website
|
|
208
|
+
</Button>
|
|
209
|
+
|
|
210
|
+
<!-- Button sizes -->
|
|
211
|
+
<Button size={Size.XS}>Extra Small</Button>
|
|
212
|
+
<Button size={Size.SM}>Small</Button>
|
|
213
|
+
<Button size={Size.BASE}>Base</Button>
|
|
214
|
+
<Button size={Size.LG}>Large</Button>
|
|
215
|
+
<Button size={Size.XL}>Extra Large</Button>
|
|
216
|
+
<Button size={Size.XXL}>2X Large</Button>
|
|
217
|
+
|
|
218
|
+
<!-- Button variants with different colors -->
|
|
219
|
+
<Button variant="solid" color={Color.PRIMARY}>Primary Solid</Button>
|
|
220
|
+
<Button variant="solid" color={Color.DANGER}>Danger Solid</Button>
|
|
221
|
+
<Button variant="outline" color={Color.SUCCESS}>Success Outline</Button>
|
|
222
|
+
<Button variant="ghost" color={Color.WARNING}>Warning Ghost</Button>
|
|
223
|
+
<Button variant="link" color={Color.INFO}>Info Link</Button>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Modal Variants
|
|
227
|
+
|
|
228
|
+
Modals with different sizes and custom content:
|
|
229
|
+
|
|
230
|
+
```svelte
|
|
231
|
+
<script lang="ts">
|
|
232
|
+
import { Modal, Button, Size } from '@makolabs/ripple';
|
|
233
|
+
let isOpen = false;
|
|
234
|
+
</script>
|
|
235
|
+
|
|
236
|
+
<Button onclick={() => isOpen = true}>Open Modal</Button>
|
|
237
|
+
|
|
238
|
+
<!-- Basic modal -->
|
|
239
|
+
<Modal
|
|
240
|
+
open={isOpen}
|
|
241
|
+
title="Basic Modal"
|
|
242
|
+
size={Size.BASE}
|
|
243
|
+
onClose={() => isOpen = false}
|
|
244
|
+
>
|
|
245
|
+
<p>Modal content goes here</p>
|
|
246
|
+
</Modal>
|
|
247
|
+
|
|
248
|
+
<!-- Modal with different size -->
|
|
249
|
+
<Modal
|
|
250
|
+
open={isOpen}
|
|
251
|
+
title="Large Modal"
|
|
252
|
+
size={Size.XL}
|
|
253
|
+
onClose={() => isOpen = false}
|
|
254
|
+
>
|
|
255
|
+
<p>This modal is larger and provides more content space</p>
|
|
256
|
+
</Modal>
|
|
257
|
+
|
|
258
|
+
<!-- Modal with custom header and footer -->
|
|
259
|
+
<Modal
|
|
260
|
+
open={isOpen}
|
|
261
|
+
onClose={() => isOpen = false}
|
|
262
|
+
size={Size.BASE}
|
|
263
|
+
>
|
|
264
|
+
<svelte:fragment slot="header">
|
|
265
|
+
<div class="flex items-center">
|
|
266
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 16 16">
|
|
267
|
+
<path d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
268
|
+
</svg>
|
|
269
|
+
<h3 class="text-lg font-medium">Custom Header</h3>
|
|
270
|
+
</div>
|
|
271
|
+
</svelte:fragment>
|
|
272
|
+
|
|
273
|
+
<p>Modal with custom header and footer</p>
|
|
274
|
+
|
|
275
|
+
<svelte:fragment slot="footer">
|
|
276
|
+
<div class="flex justify-end space-x-2">
|
|
277
|
+
<Button variant="outline" onclick={() => isOpen = false}>Cancel</Button>
|
|
278
|
+
<Button color={Color.PRIMARY}>Save Changes</Button>
|
|
279
|
+
</div>
|
|
280
|
+
</svelte:fragment>
|
|
281
|
+
</Modal>
|
|
282
|
+
|
|
283
|
+
<!-- TODO: Remove position prop from Modal component in future versions -->
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Drawer Component
|
|
287
|
+
|
|
288
|
+
Drawers can slide in from different edges of the screen:
|
|
289
|
+
|
|
290
|
+
```svelte
|
|
291
|
+
<script lang="ts">
|
|
292
|
+
import { Drawer, Button } from '@makolabs/ripple';
|
|
293
|
+
let isDrawerOpen = false;
|
|
294
|
+
</script>
|
|
295
|
+
|
|
296
|
+
<Button onclick={() => isDrawerOpen = true}>Open Drawer</Button>
|
|
297
|
+
|
|
298
|
+
<Drawer
|
|
299
|
+
open={isDrawerOpen}
|
|
300
|
+
position="right"
|
|
301
|
+
onClose={() => isDrawerOpen = false}
|
|
302
|
+
>
|
|
303
|
+
<div class="p-4">
|
|
304
|
+
<h3 class="text-lg font-medium mb-4">Drawer Title</h3>
|
|
305
|
+
<p class="mb-4">This is a drawer that slides in from the side of the screen.</p>
|
|
306
|
+
<Button onclick={() => isDrawerOpen = false}>Close Drawer</Button>
|
|
307
|
+
</div>
|
|
308
|
+
</Drawer>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### PageHeader Component
|
|
312
|
+
|
|
313
|
+
A component for consistent page headers:
|
|
314
|
+
|
|
315
|
+
```svelte
|
|
316
|
+
<script lang="ts">
|
|
317
|
+
import { PageHeader, Button, Color } from '@makolabs/ripple';
|
|
318
|
+
|
|
319
|
+
const breadcrumbs = [
|
|
320
|
+
{ label: 'Dashboard', href: '#' },
|
|
321
|
+
{ label: 'Projects', href: '#' },
|
|
322
|
+
{ label: 'Current Project' }
|
|
323
|
+
];
|
|
324
|
+
</script>
|
|
325
|
+
|
|
326
|
+
<PageHeader
|
|
327
|
+
title="Project Dashboard"
|
|
328
|
+
description="View and manage your project details"
|
|
329
|
+
breadcrumbs={breadcrumbs}
|
|
330
|
+
>
|
|
331
|
+
<svelte:fragment slot="actions">
|
|
332
|
+
<Button color={Color.PRIMARY}>New Project</Button>
|
|
333
|
+
</svelte:fragment>
|
|
334
|
+
</PageHeader>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Card Variants
|
|
338
|
+
|
|
339
|
+
Cards can be customized with different styles:
|
|
340
|
+
|
|
341
|
+
```svelte
|
|
342
|
+
<script lang="ts">
|
|
343
|
+
import { Card, StatsCard, Color } from '@makolabs/ripple';
|
|
344
|
+
</script>
|
|
345
|
+
|
|
346
|
+
<Card title="Basic Card" color={Color.PRIMARY}>
|
|
347
|
+
<p>Card content goes here</p>
|
|
348
|
+
</Card>
|
|
349
|
+
|
|
350
|
+
<StatsCard
|
|
351
|
+
label="Monthly Sales"
|
|
352
|
+
value="$865,000"
|
|
353
|
+
previousValue="$750,000"
|
|
354
|
+
previousValuePrefix="vs"
|
|
355
|
+
trend={15.3}
|
|
356
|
+
color={Color.SUCCESS}
|
|
357
|
+
chartData={[20, 25, 30, 22, 35, 40, 38, 45, 50]}
|
|
358
|
+
icon={
|
|
359
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 16 16">
|
|
360
|
+
<path d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
361
|
+
</svg>
|
|
362
|
+
}
|
|
363
|
+
/>
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Table Component
|
|
367
|
+
|
|
368
|
+
Tables for displaying structured data with pagination and sorting:
|
|
369
|
+
|
|
370
|
+
```svelte
|
|
371
|
+
<script lang="ts">
|
|
372
|
+
import { Table, Color, Size } from '@makolabs/ripple';
|
|
373
|
+
|
|
374
|
+
let data = [
|
|
375
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
|
|
376
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Inactive' },
|
|
377
|
+
{ id: 3, name: 'Robert Johnson', email: 'robert@example.com', status: 'Active' }
|
|
378
|
+
];
|
|
379
|
+
|
|
380
|
+
const columns = [
|
|
381
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
382
|
+
{ key: 'email', label: 'Email', sortable: true },
|
|
383
|
+
{ key: 'status', label: 'Status' }
|
|
384
|
+
];
|
|
385
|
+
|
|
386
|
+
let selected = [];
|
|
387
|
+
let sort = { column: 'name', direction: 'asc' };
|
|
388
|
+
</script>
|
|
389
|
+
|
|
390
|
+
<Table
|
|
391
|
+
data={data}
|
|
392
|
+
{columns}
|
|
393
|
+
color={Color.PRIMARY}
|
|
394
|
+
size={Size.BASE}
|
|
395
|
+
pageSize={10}
|
|
396
|
+
selectable={true}
|
|
397
|
+
bind:selected={selected}
|
|
398
|
+
bind:sort={sort}
|
|
399
|
+
striped={true}
|
|
400
|
+
/>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Tab Component
|
|
404
|
+
|
|
405
|
+
Tabs for organizing content into different views:
|
|
406
|
+
|
|
407
|
+
```svelte
|
|
408
|
+
<script lang="ts">
|
|
409
|
+
import { TabGroup, TabContent, Color, Size } from '@makolabs/ripple';
|
|
410
|
+
|
|
411
|
+
const tabs = [
|
|
412
|
+
{ value: 'overview', label: 'Overview' },
|
|
413
|
+
{ value: 'details', label: 'Details' },
|
|
414
|
+
{ value: 'settings', label: 'Settings' }
|
|
415
|
+
];
|
|
416
|
+
|
|
417
|
+
let activeTab = 'overview';
|
|
418
|
+
|
|
419
|
+
function handleTabChange(value) {
|
|
420
|
+
console.log(`Tab changed to ${value}`);
|
|
421
|
+
}
|
|
422
|
+
</script>
|
|
423
|
+
|
|
424
|
+
<TabGroup
|
|
425
|
+
tabs={tabs}
|
|
426
|
+
bind:selected={activeTab}
|
|
427
|
+
onchange={handleTabChange}
|
|
428
|
+
color={Color.PRIMARY}
|
|
429
|
+
size={Size.BASE}
|
|
430
|
+
>
|
|
431
|
+
<TabContent value="overview" persisted>
|
|
432
|
+
<p>Overview content here</p>
|
|
433
|
+
</TabContent>
|
|
434
|
+
|
|
435
|
+
<TabContent value="details" persisted>
|
|
436
|
+
<p>Details content here</p>
|
|
437
|
+
</TabContent>
|
|
438
|
+
|
|
439
|
+
<TabContent value="settings" persisted>
|
|
440
|
+
<p>Settings content here</p>
|
|
441
|
+
</TabContent>
|
|
442
|
+
</TabGroup>
|
|
33
443
|
```
|
|
34
444
|
|
|
35
|
-
|
|
445
|
+
### Badge Component
|
|
446
|
+
|
|
447
|
+
Badges for displaying statuses and counts:
|
|
448
|
+
|
|
449
|
+
```svelte
|
|
450
|
+
<script lang="ts">
|
|
451
|
+
import { Badge, Color, Size } from '@makolabs/ripple';
|
|
452
|
+
</script>
|
|
453
|
+
|
|
454
|
+
<Badge color={Color.PRIMARY} size={Size.BASE}>New</Badge>
|
|
455
|
+
<Badge color={Color.SUCCESS}>Success</Badge>
|
|
456
|
+
<Badge color={Color.WARNING}>Warning</Badge>
|
|
457
|
+
<Badge color={Color.DANGER}>43</Badge>
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### Select Component
|
|
461
|
+
|
|
462
|
+
Dropdown selector for choosing from a list of options:
|
|
463
|
+
|
|
464
|
+
```svelte
|
|
465
|
+
<script lang="ts">
|
|
466
|
+
import { Select, Size } from '@makolabs/ripple';
|
|
467
|
+
|
|
468
|
+
const items = [
|
|
469
|
+
{ label: 'Option 1', value: 'option1' },
|
|
470
|
+
{ label: 'Option 2', value: 'option2' },
|
|
471
|
+
{ label: 'Option 3', value: 'option3', disabled: true },
|
|
472
|
+
{ label: 'Option 4', value: 'option4' }
|
|
473
|
+
];
|
|
474
|
+
|
|
475
|
+
let selected = 'option1';
|
|
476
|
+
|
|
477
|
+
function handleSelect(event) {
|
|
478
|
+
console.log('Selected:', event.value);
|
|
479
|
+
}
|
|
480
|
+
</script>
|
|
481
|
+
|
|
482
|
+
<Select
|
|
483
|
+
{items}
|
|
484
|
+
bind:value={selected}
|
|
485
|
+
class="w-64"
|
|
486
|
+
size={Size.BASE}
|
|
487
|
+
onselect={handleSelect}
|
|
488
|
+
/>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Dropdown Component
|
|
492
|
+
|
|
493
|
+
Menu dropdown for actions and navigation:
|
|
494
|
+
|
|
495
|
+
```svelte
|
|
496
|
+
<script lang="ts">
|
|
497
|
+
import { Dropdown, Size } from '@makolabs/ripple';
|
|
498
|
+
import FluentChevronDown16Filled from '$icons/FluentChevronDown16Filled.svelte';
|
|
499
|
+
|
|
500
|
+
const sections = [
|
|
501
|
+
{
|
|
502
|
+
items: [
|
|
503
|
+
{
|
|
504
|
+
label: 'Edit',
|
|
505
|
+
icon: FluentPen16Filled,
|
|
506
|
+
onclick: () => console.log('Edit clicked')
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
label: 'Duplicate',
|
|
510
|
+
icon: FluentPenSparkle24Filled,
|
|
511
|
+
onclick: () => console.log('Duplicate clicked')
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
items: [
|
|
517
|
+
{
|
|
518
|
+
label: 'Delete',
|
|
519
|
+
icon: FluentDelete24Filled,
|
|
520
|
+
onclick: () => console.log('Delete clicked')
|
|
521
|
+
}
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
];
|
|
525
|
+
</script>
|
|
526
|
+
|
|
527
|
+
<Dropdown
|
|
528
|
+
sections={sections}
|
|
529
|
+
label="Actions"
|
|
530
|
+
size={Size.BASE}
|
|
531
|
+
icon={FluentChevronDown16Filled}
|
|
532
|
+
/>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
## Component Composition
|
|
536
|
+
|
|
537
|
+
Ripple UI components are designed to work together seamlessly:
|
|
538
|
+
|
|
539
|
+
```svelte
|
|
540
|
+
<script lang="ts">
|
|
541
|
+
import { Card, TabGroup, TabContent, Button, Color, Size } from '@makolabs/ripple';
|
|
542
|
+
|
|
543
|
+
const tabs = [
|
|
544
|
+
{ value: 'overview', label: 'Overview' },
|
|
545
|
+
{ value: 'details', label: 'Details' },
|
|
546
|
+
{ value: 'settings', label: 'Settings' }
|
|
547
|
+
];
|
|
548
|
+
|
|
549
|
+
let activeTab = 'overview';
|
|
550
|
+
</script>
|
|
551
|
+
|
|
552
|
+
<Card title="Project Information" color={Color.PRIMARY}>
|
|
553
|
+
<TabGroup
|
|
554
|
+
tabs={tabs}
|
|
555
|
+
bind:selected={activeTab}
|
|
556
|
+
color={Color.INFO}
|
|
557
|
+
size={Size.BASE}
|
|
558
|
+
>
|
|
559
|
+
<TabContent value="overview">
|
|
560
|
+
<p>Project overview content here...</p>
|
|
561
|
+
<Button variant="solid" color={Color.SUCCESS} size={Size.SM}>
|
|
562
|
+
Take Action
|
|
563
|
+
</Button>
|
|
564
|
+
</TabContent>
|
|
565
|
+
|
|
566
|
+
<TabContent value="details">
|
|
567
|
+
<p>Project details content here...</p>
|
|
568
|
+
</TabContent>
|
|
569
|
+
|
|
570
|
+
<TabContent value="settings">
|
|
571
|
+
<p>Project settings content here...</p>
|
|
572
|
+
</TabContent>
|
|
573
|
+
</TabGroup>
|
|
574
|
+
</Card>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
## Latest Updates
|
|
578
|
+
|
|
579
|
+
Ripple UI now exports all components from a central entry point, making it easier to import components:
|
|
580
|
+
|
|
581
|
+
```svelte
|
|
582
|
+
<script lang="ts">
|
|
583
|
+
import { Button, Modal, Card, Table, Select, Dropdown } from '@makolabs/ripple';
|
|
584
|
+
</script>
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
You can still import specific component types when needed:
|
|
588
|
+
|
|
589
|
+
```svelte
|
|
590
|
+
<script lang="ts">
|
|
591
|
+
import { Button, type ButtonProps } from '@makolabs/ripple';
|
|
592
|
+
|
|
593
|
+
// Create a custom button with specific props
|
|
594
|
+
const myButton: ButtonProps = {
|
|
595
|
+
variant: 'outline',
|
|
596
|
+
color: 'primary',
|
|
597
|
+
size: 'lg',
|
|
598
|
+
rounded: 'xl'
|
|
599
|
+
};
|
|
600
|
+
</script>
|
|
601
|
+
|
|
602
|
+
<Button {...myButton}>Custom Button</Button>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StorageAdapter, FileItem, FileListResult, ImportOptions, ImportResult, ImportStatus, BatchImportResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Base storage adapter with common functionality
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class BaseAdapter implements StorageAdapter {
|
|
6
|
+
abstract getName(): string;
|
|
7
|
+
abstract list(path: string, searchQuery?: string): Promise<FileListResult>;
|
|
8
|
+
abstract download(file: FileItem): Promise<string>;
|
|
9
|
+
abstract isConfigured(): Promise<boolean>;
|
|
10
|
+
abstract authenticate?(): Promise<boolean>;
|
|
11
|
+
import(file: FileItem, options: ImportOptions): Promise<ImportResult>;
|
|
12
|
+
getImportStatus(importId: string, fileKey: string): Promise<ImportStatus>;
|
|
13
|
+
batchImport(files: FileItem[], options: ImportOptions): Promise<BatchImportResult>;
|
|
14
|
+
protected abstract getApiPath(): string;
|
|
15
|
+
setReopenFlag(): void;
|
|
16
|
+
shouldReopenBrowser(): boolean;
|
|
17
|
+
clearReopenFlag(): void;
|
|
18
|
+
protected getDetailedStatus(status: string): string;
|
|
19
|
+
protected calculateProgress(status: string, processedRows?: number, totalRows?: number): number;
|
|
20
|
+
}
|