@makolabs/ripple 0.0.1-dev.7 → 0.0.1-dev.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +394 -54
  2. package/dist/adapters/storage/BaseAdapter.d.ts +20 -0
  3. package/dist/adapters/storage/BaseAdapter.js +171 -0
  4. package/dist/adapters/storage/S3Adapter.d.ts +21 -0
  5. package/dist/adapters/storage/S3Adapter.js +194 -0
  6. package/dist/adapters/storage/index.d.ts +3 -0
  7. package/dist/adapters/storage/index.js +3 -0
  8. package/dist/adapters/storage/types.d.ts +102 -0
  9. package/dist/adapters/storage/types.js +4 -0
  10. package/dist/button/Button.svelte +5 -3
  11. package/dist/button/Button.svelte.d.ts +1 -1
  12. package/dist/button/button.d.ts +40 -63
  13. package/dist/button/button.js +15 -14
  14. package/dist/charts/Chart.svelte +545 -0
  15. package/dist/charts/Chart.svelte.d.ts +4 -0
  16. package/dist/drawer/Drawer.svelte +13 -2
  17. package/dist/drawer/Drawer.svelte.d.ts +1 -1
  18. package/dist/drawer/drawer.d.ts +0 -17
  19. package/dist/drawer/drawer.js +3 -3
  20. package/dist/elements/accordion/Accordion.svelte +98 -0
  21. package/dist/elements/accordion/Accordion.svelte.d.ts +4 -0
  22. package/dist/elements/accordion/accordion.d.ts +227 -0
  23. package/dist/elements/accordion/accordion.js +138 -0
  24. package/dist/elements/alert/Alert.svelte +57 -0
  25. package/dist/elements/alert/Alert.svelte.d.ts +4 -0
  26. package/dist/elements/badge/Badge.svelte +13 -5
  27. package/dist/elements/badge/Badge.svelte.d.ts +1 -1
  28. package/dist/elements/badge/badge.d.ts +0 -12
  29. package/dist/elements/dropdown/Dropdown.svelte +100 -138
  30. package/dist/elements/dropdown/Dropdown.svelte.d.ts +1 -1
  31. package/dist/elements/dropdown/Select.svelte +169 -66
  32. package/dist/elements/dropdown/Select.svelte.d.ts +1 -1
  33. package/dist/elements/dropdown/dropdown.d.ts +34 -57
  34. package/dist/elements/dropdown/dropdown.js +11 -5
  35. package/dist/elements/dropdown/select.d.ts +34 -54
  36. package/dist/elements/dropdown/select.js +29 -21
  37. package/dist/elements/file-upload/FileUpload.svelte +135 -0
  38. package/dist/elements/file-upload/FileUpload.svelte.d.ts +4 -0
  39. package/dist/elements/file-upload/FilesPreview.svelte +93 -0
  40. package/dist/elements/file-upload/FilesPreview.svelte.d.ts +4 -0
  41. package/dist/elements/progress/Progress.svelte +145 -0
  42. package/dist/elements/progress/Progress.svelte.d.ts +4 -0
  43. package/dist/elements/timeline/Timeline.svelte +92 -0
  44. package/dist/elements/timeline/Timeline.svelte.d.ts +7 -0
  45. package/dist/file-browser/FileBrowser.svelte +823 -0
  46. package/dist/file-browser/FileBrowser.svelte.d.ts +13 -0
  47. package/dist/file-browser/index.d.ts +1 -0
  48. package/dist/file-browser/index.js +1 -0
  49. package/dist/filters/CompactFilters.svelte +157 -0
  50. package/dist/filters/CompactFilters.svelte.d.ts +5 -0
  51. package/dist/filters/index.d.ts +1 -0
  52. package/dist/filters/index.js +1 -0
  53. package/dist/forms/Checkbox.svelte +54 -0
  54. package/dist/forms/Checkbox.svelte.d.ts +4 -0
  55. package/dist/forms/DateRange.svelte +493 -0
  56. package/dist/forms/DateRange.svelte.d.ts +4 -0
  57. package/dist/forms/Form.svelte +39 -0
  58. package/dist/forms/Form.svelte.d.ts +4 -0
  59. package/dist/forms/Input.svelte +86 -0
  60. package/dist/forms/Input.svelte.d.ts +4 -0
  61. package/dist/forms/NumberInput.svelte +159 -0
  62. package/dist/forms/NumberInput.svelte.d.ts +4 -0
  63. package/dist/forms/RadioInputs.svelte +64 -0
  64. package/dist/forms/RadioInputs.svelte.d.ts +4 -0
  65. package/dist/forms/RadioPill.svelte +66 -0
  66. package/dist/forms/RadioPill.svelte.d.ts +4 -0
  67. package/dist/forms/Slider.svelte +342 -0
  68. package/dist/forms/Slider.svelte.d.ts +4 -0
  69. package/dist/forms/Tags.svelte +181 -0
  70. package/dist/forms/Tags.svelte.d.ts +4 -0
  71. package/dist/forms/Toggle.svelte +132 -0
  72. package/dist/forms/Toggle.svelte.d.ts +4 -0
  73. package/dist/forms/slider.d.ts +143 -0
  74. package/dist/forms/slider.js +62 -0
  75. package/dist/header/Breadcrumbs.svelte +2 -1
  76. package/dist/header/Breadcrumbs.svelte.d.ts +1 -1
  77. package/dist/header/PageHeader.svelte +2 -2
  78. package/dist/header/PageHeader.svelte.d.ts +1 -1
  79. package/dist/header/breadcrumbs.d.ts +20 -14
  80. package/dist/header/breadcrumbs.js +6 -0
  81. package/dist/helper/date.d.ts +7 -0
  82. package/dist/helper/date.js +15 -0
  83. package/dist/index.d.ts +846 -9
  84. package/dist/index.js +76 -16
  85. package/dist/layout/card/Card.svelte +5 -8
  86. package/dist/layout/card/Card.svelte.d.ts +1 -1
  87. package/dist/layout/card/MetricCard.svelte +59 -0
  88. package/dist/layout/card/MetricCard.svelte.d.ts +4 -0
  89. package/dist/layout/card/StatsCard.svelte +119 -89
  90. package/dist/layout/card/StatsCard.svelte.d.ts +1 -1
  91. package/dist/layout/card/card.d.ts +22 -33
  92. package/dist/layout/card/card.js +9 -8
  93. package/dist/layout/card/metric-card.d.ts +49 -0
  94. package/dist/layout/card/metric-card.js +10 -0
  95. package/dist/layout/card/stats-card.d.ts +22 -39
  96. package/dist/layout/card/stats-card.js +14 -14
  97. package/dist/layout/navbar/navbar.d.ts +0 -23
  98. package/dist/layout/sidebar/NavGroup.svelte +25 -50
  99. package/dist/layout/sidebar/NavGroup.svelte.d.ts +1 -1
  100. package/dist/layout/sidebar/NavItem.svelte +3 -3
  101. package/dist/layout/sidebar/NavItem.svelte.d.ts +1 -1
  102. package/dist/layout/sidebar/Sidebar.svelte +101 -72
  103. package/dist/layout/sidebar/Sidebar.svelte.d.ts +1 -1
  104. package/dist/layout/table/Table.svelte +464 -87
  105. package/dist/layout/table/Table.svelte.d.ts +1 -1
  106. package/dist/layout/table/table.d.ts +0 -47
  107. package/dist/layout/table/table.js +0 -8
  108. package/dist/layout/tabs/Tab.svelte +9 -6
  109. package/dist/layout/tabs/Tab.svelte.d.ts +1 -1
  110. package/dist/layout/tabs/TabContent.svelte +1 -2
  111. package/dist/layout/tabs/TabContent.svelte.d.ts +1 -1
  112. package/dist/layout/tabs/TabGroup.svelte +10 -5
  113. package/dist/layout/tabs/TabGroup.svelte.d.ts +2 -2
  114. package/dist/layout/tabs/tabs.d.ts +61 -76
  115. package/dist/layout/tabs/tabs.js +170 -28
  116. package/dist/modal/Modal.svelte +2 -1
  117. package/dist/modal/Modal.svelte.d.ts +1 -1
  118. package/dist/modal/modal.d.ts +0 -23
  119. package/dist/modal/modal.js +3 -3
  120. package/dist/sonner/sonner.svelte +13 -0
  121. package/dist/sonner/sonner.svelte.d.ts +4 -0
  122. package/dist/types/variants.d.ts +1 -21
  123. package/dist/types/variants.js +1 -19
  124. package/dist/utils/Portal.svelte +108 -0
  125. package/dist/utils/Portal.svelte.d.ts +8 -0
  126. package/dist/utils/dateUtils.d.ts +7 -0
  127. package/dist/utils/dateUtils.js +26 -0
  128. package/dist/variants.d.ts +30 -0
  129. package/dist/variants.js +36 -0
  130. package/package.json +7 -3
  131. package/dist/button/index.d.ts +0 -1
  132. package/dist/button/index.js +0 -1
  133. package/dist/drawer/index.d.ts +0 -2
  134. package/dist/drawer/index.js +0 -1
  135. package/dist/elements/badge/index.d.ts +0 -2
  136. package/dist/elements/badge/index.js +0 -2
  137. package/dist/elements/dropdown/index.d.ts +0 -3
  138. package/dist/elements/dropdown/index.js +0 -2
  139. package/dist/header/index.d.ts +0 -4
  140. package/dist/header/index.js +0 -2
  141. package/dist/header/pageheaders.d.ts +0 -10
  142. package/dist/header/pageheaders.js +0 -1
  143. package/dist/layout/card/index.d.ts +0 -4
  144. package/dist/layout/card/index.js +0 -2
  145. package/dist/layout/index.d.ts +0 -5
  146. package/dist/layout/index.js +0 -5
  147. package/dist/layout/navbar/index.d.ts +0 -2
  148. package/dist/layout/navbar/index.js +0 -2
  149. package/dist/layout/sidebar/index.d.ts +0 -2
  150. package/dist/layout/sidebar/index.js +0 -1
  151. package/dist/layout/sidebar/sidebar.d.ts +0 -46
  152. package/dist/layout/sidebar/sidebar.js +0 -1
  153. package/dist/layout/table/index.d.ts +0 -3
  154. package/dist/layout/table/index.js +0 -2
  155. package/dist/layout/tabs/index.d.ts +0 -3
  156. package/dist/layout/tabs/index.js +0 -3
  157. package/dist/modal/index.d.ts +0 -1
  158. package/dist/modal/index.js +0 -1
package/README.md CHANGED
@@ -1,6 +1,15 @@
1
- # MakoLabs Ripple UI
1
+ # Ripple UI
2
2
 
3
- This is a simplistic UI library by makolabs.
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
 
@@ -32,7 +41,7 @@ Paste the following CSS import code in `app.css`
32
41
  @source "../node_modules/@makolabs/ripple";
33
42
 
34
43
  @theme {
35
- /* Default (Gray) */
44
+ /* Default (default) */
36
45
  --color-default-50: oklch(0.984 0.003 247.858);
37
46
  --color-default-100: oklch(0.96 0.006 247.858);
38
47
  --color-default-200: oklch(0.91 0.008 247.858);
@@ -125,6 +134,43 @@ Paste the following CSS import code in `app.css`
125
134
  }
126
135
  ```
127
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
+
128
174
  ## Component Variants
129
175
 
130
176
  Most components in Ripple UI support variants to customize their appearance. Here are some examples:
@@ -135,53 +181,157 @@ Buttons come with different variants, colors, sizes, and shapes:
135
181
 
136
182
  ```svelte
137
183
  <script lang="ts">
138
- import { Button } from '@makolabs/ripple';
184
+ import { Button, Color, Size } from '@makolabs/ripple';
139
185
  </script>
140
186
 
141
187
  <!-- 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>
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>
146
209
 
147
210
  <!-- 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>
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>
163
224
  ```
164
225
 
165
226
  ### Modal Variants
166
227
 
167
- Modals can be customized with different positions:
228
+ Modals with different sizes and custom content:
168
229
 
169
230
  ```svelte
170
231
  <script lang="ts">
171
- import { Modal } from '@makolabs/ripple';
232
+ import { Modal, Button, Size } from '@makolabs/ripple';
172
233
  let isOpen = false;
173
234
  </script>
174
235
 
175
- <Button on:click={() => isOpen = true}>Open Modal</Button>
236
+ <Button onclick={() => isOpen = true}>Open Modal</Button>
176
237
 
238
+ <!-- Basic modal -->
177
239
  <Modal
178
240
  open={isOpen}
179
- position="center"
180
- title="Modal Title"
241
+ title="Basic Modal"
242
+ size={Size.BASE}
181
243
  onClose={() => isOpen = false}
182
244
  >
183
245
  <p>Modal content goes here</p>
184
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>
185
335
  ```
186
336
 
187
337
  ### Card Variants
@@ -190,47 +340,238 @@ Cards can be customized with different styles:
190
340
 
191
341
  ```svelte
192
342
  <script lang="ts">
193
- import { Card, StatsCard } from '@makolabs/ripple';
343
+ import { Card, StatsCard, Color } from '@makolabs/ripple';
194
344
  </script>
195
345
 
196
- <Card title="Basic Card" color="primary">
346
+ <Card title="Basic Card" color={Color.PRIMARY}>
197
347
  <p>Card content goes here</p>
198
348
  </Card>
199
349
 
200
350
  <StatsCard
201
- title="Statistics"
202
- value="1,234"
203
- description="Total users"
204
- trend="up"
205
- percentage={12}
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
+ }
206
363
  />
207
364
  ```
208
365
 
209
366
  ### Table Component
210
367
 
211
- Tables for displaying structured data:
368
+ Tables for displaying structured data with pagination and sorting:
212
369
 
213
370
  ```svelte
214
371
  <script lang="ts">
215
- import { Table, Cell } from '@makolabs/ripple';
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' };
216
388
  </script>
217
389
 
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>
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>
443
+ ```
444
+
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>
234
575
  ```
235
576
 
236
577
  ## Latest Updates
@@ -259,4 +600,3 @@ You can still import specific component types when needed:
259
600
  </script>
260
601
 
261
602
  <Button {...myButton}>Custom Button</Button>
262
- ```
@@ -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
+ }