@svelte-atoms/core 1.0.0-alpha.30 β†’ 1.0.0-alpha.31

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 (147) hide show
  1. package/README.md +853 -852
  2. package/dist/components/accordion/accordion-root.svelte +7 -3
  3. package/dist/components/accordion/accordion.stories.svelte +7 -82
  4. package/dist/components/accordion/item/accordion-item-body.svelte +44 -42
  5. package/dist/components/accordion/item/accordion-item-header.svelte +51 -50
  6. package/dist/components/accordion/item/accordion-item-indicator.svelte +51 -50
  7. package/dist/components/accordion/item/accordion-item-root.svelte +66 -65
  8. package/dist/components/accordion/item/bond.svelte.d.ts +2 -0
  9. package/dist/components/accordion/item/index.d.ts +3 -0
  10. package/dist/components/accordion/item/index.js +3 -0
  11. package/dist/components/accordion/item/motion.svelte.d.ts +15 -0
  12. package/dist/components/accordion/item/motion.svelte.js +30 -0
  13. package/dist/components/accordion/item/types.d.ts +7 -24
  14. package/dist/components/alert/alert-close-button.svelte +66 -70
  15. package/dist/components/alert/alert-description.svelte +42 -42
  16. package/dist/components/alert/alert-description.svelte.d.ts +3 -6
  17. package/dist/components/alert/alert-root.svelte +68 -103
  18. package/dist/components/alert/alert-root.svelte.d.ts +2 -2
  19. package/dist/components/alert/alert.stories.svelte +400 -400
  20. package/dist/components/alert/bond.svelte.d.ts +0 -13
  21. package/dist/components/alert/bond.svelte.js +0 -32
  22. package/dist/components/alert/types.d.ts +8 -32
  23. package/dist/components/atom/html-atom.svelte +261 -261
  24. package/dist/components/avatar/avatar.stories.svelte +22 -22
  25. package/dist/components/badge/badge.stories.svelte +12 -12
  26. package/dist/components/badge/badge.svelte +19 -19
  27. package/dist/components/breadcrumb/breadcrumb.stories.svelte +5 -5
  28. package/dist/components/button/button.stories.svelte +27 -27
  29. package/dist/components/calendar/calendar-day.svelte +101 -96
  30. package/dist/components/calendar/calendar.stories.svelte +26 -26
  31. package/dist/components/card/card-body.svelte +39 -39
  32. package/dist/components/card/card-footer.svelte +41 -41
  33. package/dist/components/card/card-root.svelte +91 -91
  34. package/dist/components/card/card.stories.svelte +133 -133
  35. package/dist/components/checkbox/checkbox.stories.svelte +22 -22
  36. package/dist/components/checkbox/checkbox.svelte +6 -2
  37. package/dist/components/collapsible/collapsible.stories.svelte +172 -172
  38. package/dist/components/combobox/atoms.d.ts +1 -1
  39. package/dist/components/combobox/atoms.js +1 -1
  40. package/dist/components/combobox/combobox-root.svelte +65 -65
  41. package/dist/components/combobox/compobox.stories.svelte +51 -51
  42. package/dist/components/combobox/index.d.ts +1 -0
  43. package/dist/components/container/container.stories.svelte +20 -20
  44. package/dist/components/container/container.svelte.d.ts +1 -1
  45. package/dist/components/datagrid/datagrid.stories.svelte +72 -72
  46. package/dist/components/datagrid/tr/bond.svelte.d.ts +4 -2
  47. package/dist/components/datagrid/tr/bond.svelte.js +9 -7
  48. package/dist/components/datagrid/tr/datagrid-tr.svelte +90 -88
  49. package/dist/components/date-picker/date-picker-calendar.svelte +67 -67
  50. package/dist/components/date-picker/date-picker-root.svelte +95 -95
  51. package/dist/components/date-picker/date-picker.stories.svelte +35 -35
  52. package/dist/components/dialog/bond.svelte.d.ts +13 -3
  53. package/dist/components/dialog/bond.svelte.js +66 -5
  54. package/dist/components/dialog/dialog-content.svelte +44 -62
  55. package/dist/components/dialog/dialog-root.svelte +91 -110
  56. package/dist/components/dialog/dialog.stories.svelte +64 -64
  57. package/dist/components/dialog/motion.svelte.d.ts +13 -0
  58. package/dist/components/dialog/motion.svelte.js +44 -0
  59. package/dist/components/drawer/attachments.svelte.d.ts +1 -1
  60. package/dist/components/drawer/attachments.svelte.js +1 -3
  61. package/dist/components/drawer/bond.svelte.d.ts +24 -5
  62. package/dist/components/drawer/bond.svelte.js +77 -11
  63. package/dist/components/drawer/drawer-content.svelte +6 -14
  64. package/dist/components/drawer/drawer.stories.svelte +27 -95
  65. package/dist/components/drawer/index.d.ts +2 -0
  66. package/dist/components/drawer/index.js +2 -0
  67. package/dist/components/drawer/motion.d.ts +15 -0
  68. package/dist/components/drawer/motion.js +28 -0
  69. package/dist/components/dropdown/atoms.d.ts +1 -1
  70. package/dist/components/dropdown/atoms.js +1 -1
  71. package/dist/components/dropdown/bond.svelte.d.ts +5 -1
  72. package/dist/components/dropdown/dropdown-root.svelte +59 -59
  73. package/dist/components/dropdown/dropdown.stories.svelte +80 -80
  74. package/dist/components/dropdown/index.d.ts +1 -0
  75. package/dist/components/form/form.stories.svelte +96 -96
  76. package/dist/components/image/image.stories.svelte +20 -20
  77. package/dist/components/input/input.stories.svelte +35 -35
  78. package/dist/components/label/label.stories.svelte +15 -15
  79. package/dist/components/lazy/lazy.stories.svelte +28 -28
  80. package/dist/components/link/link.stories.svelte +15 -15
  81. package/dist/components/list/list-item.svelte +20 -20
  82. package/dist/components/menu/atoms.d.ts +1 -0
  83. package/dist/components/menu/atoms.js +1 -0
  84. package/dist/components/menu/index.d.ts +2 -1
  85. package/dist/components/menu/index.js +1 -1
  86. package/dist/components/menu/menu-item.svelte +69 -51
  87. package/dist/components/menu/menu-item.svelte.d.ts +1 -0
  88. package/dist/components/menu/menu.stories.svelte +33 -33
  89. package/dist/components/popover/bond.svelte.d.ts +20 -7
  90. package/dist/components/popover/bond.svelte.js +80 -27
  91. package/dist/components/popover/motion.d.ts +6 -0
  92. package/dist/components/popover/motion.js +56 -0
  93. package/dist/components/popover/popover-arrow.svelte +111 -111
  94. package/dist/components/popover/popover-content.svelte +34 -72
  95. package/dist/components/popover/popover-indicator.svelte +44 -44
  96. package/dist/components/popover/popover-root.svelte +48 -48
  97. package/dist/components/popover/popover.stories.svelte +3 -3
  98. package/dist/components/popover/types.d.ts +9 -7
  99. package/dist/components/portal/active-portal.svelte +29 -22
  100. package/dist/components/portal/active-portal.svelte.d.ts +2 -9
  101. package/dist/components/portal/portal-root.svelte +76 -83
  102. package/dist/components/portal/portal-root.svelte.d.ts +4 -6
  103. package/dist/components/portal/teleport.svelte +49 -50
  104. package/dist/components/portal/teleport.svelte.d.ts +3 -4
  105. package/dist/components/qr-code/qr-code.stories.svelte +18 -18
  106. package/dist/components/radio/radio-group.stories.svelte +41 -41
  107. package/dist/components/radio/radio.stories.svelte +17 -17
  108. package/dist/components/radio/radio.svelte +1 -1
  109. package/dist/components/radio/types.d.ts +98 -0
  110. package/dist/components/radio/types.js +2 -0
  111. package/dist/components/root/root.svelte +13 -30
  112. package/dist/components/root/root.svelte.d.ts +1 -1
  113. package/dist/components/scrollable/scrollable-root.svelte.d.ts +2 -2
  114. package/dist/components/scrollable/scrollable.stories.svelte +116 -116
  115. package/dist/components/sidebar/index.d.ts +2 -0
  116. package/dist/components/sidebar/index.js +2 -0
  117. package/dist/components/sidebar/motion.svelte.d.ts +11 -0
  118. package/dist/components/sidebar/motion.svelte.js +16 -0
  119. package/dist/components/sidebar/sidebar-content.svelte +3 -13
  120. package/dist/components/sidebar/sidebar-root.svelte +39 -39
  121. package/dist/components/sidebar/sidebar.stories.svelte +43 -43
  122. package/dist/components/sidebar/types.d.ts +2 -12
  123. package/dist/components/tabs/tabs.stories.svelte +56 -56
  124. package/dist/components/textarea/atoms.d.ts +1 -0
  125. package/dist/components/textarea/atoms.js +1 -0
  126. package/dist/components/textarea/textarea-input.svelte +9 -6
  127. package/dist/components/textarea/textarea-root.svelte +9 -9
  128. package/dist/components/textarea/textarea-root.svelte.d.ts +2 -0
  129. package/dist/components/tooltip/tooltip-trigger.svelte +2 -2
  130. package/dist/components/tooltip/tooltip-trigger.svelte.d.ts +1 -0
  131. package/dist/components/tooltip/tooltip.stories.svelte +32 -32
  132. package/dist/components/tree/tree.stories.svelte +142 -142
  133. package/dist/icons/icon-copy.svelte +6 -0
  134. package/dist/{components/radio/types.svelte.d.ts β†’ icons/icon-copy.svelte.d.ts} +3 -3
  135. package/dist/utils/markdown-to-llm.d.ts +28 -0
  136. package/dist/utils/markdown-to-llm.js +76 -0
  137. package/package.json +1 -2
  138. package/dist/components/radio/types.svelte +0 -0
  139. package/llm/composition.md +0 -395
  140. package/llm/crafting.md +0 -838
  141. package/llm/motion.md +0 -970
  142. package/llm/philosophy.md +0 -23
  143. package/llm/preset-variant-integration.md +0 -516
  144. package/llm/preset.md +0 -383
  145. package/llm/styling.md +0 -216
  146. package/llm/usage.md +0 -46
  147. package/llm/variants.md +0 -1259
package/README.md CHANGED
@@ -1,852 +1,853 @@
1
- # βš›οΈ @svelte-atoms/core
2
-
3
- > A modern, modular, and accessible Svelte 5 UI component library built with composability at its core.
4
-
5
- **@svelte-atoms/core** is a comprehensive Svelte component library that provides fundamental building blocks ("atoms") for creating sophisticated, interactive design systems. Each component is designed with accessibility, type safety, and developer experience in mind. Built with Svelte 5 runes for optimal reactivity and performance.
6
-
7
- [![npm version](https://img.shields.io/npm/v/@svelte-atoms/core.svg)](https://www.npmjs.com/package/@svelte-atoms/core)
8
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/svelte-atoms/core)
9
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
-
11
- ---
12
-
13
- ## ✨ Features
14
-
15
- ### 🧱 **Bond Architecture**
16
-
17
- Self-contained state management classes that encapsulate component logic and DOM interactions. Bonds communicate through Svelte's context API using standardized `Bond.get()` / `Bond.set()` methods, enabling parent-child relationships without prop drilling.
18
-
19
- ### β™Ώ **Accessibility First**
20
-
21
- Every component includes proper ARIA attributes, keyboard navigation, and focus management out of the box.
22
-
23
- ### πŸ”§ **Highly Extensible**
24
-
25
- Easily extend components with custom behaviors, animations, and styling while maintaining the core functionality.
26
-
27
- ### 🎯 **Type Safety**
28
-
29
- Fully written in TypeScript with comprehensive type definitions for a robust development experience.
30
-
31
- ### ⚑ **Reactive by Design**
32
-
33
- Leverages Svelte's fine-grained reactivity system for optimal performance and smooth user interactions.
34
-
35
- ### 🎨 **Headless & Stylable**
36
-
37
- Components are headless by default, giving you complete control over styling while providing sensible defaults.
38
-
39
- ### 🧩 **Composable**
40
-
41
- Build complex UIs by combining simple, reusable components. Each component is designed to work seamlessly with others through the Bond pattern and context API. Create sophisticated features like multi-level dropdowns, nested accordions, or custom form controls by composing atomic components together.
42
-
43
- ---
44
-
45
- ## πŸ“¦ Available Components
46
-
47
- Our comprehensive collection of UI components with implementation status:
48
-
49
- ### Layout & Navigation
50
-
51
- | Component | Description | Status |
52
- | ----------------------------------------------- | ---------------------------- | ------ |
53
- | [**Accordion**](docs/components/accordion.md) | Collapsible content sections | βœ… |
54
- | [**Breadcrumb**](docs/components/breadcrumb.md) | Navigation hierarchy | βœ… |
55
- | [**Sidebar**](docs/components/sidebar.md) | Collapsible side navigation | βœ… |
56
- | [**Tabs**](docs/components/tabs.md) | Tabbed interfaces | βœ… |
57
- | [**Tree**](docs/components/tree.md) | Hierarchical data structures | βœ… |
58
- | **Stepper** | Multi-step process indicator | ❌ |
59
- | **Pagination** | Page navigation controls | ❌ |
60
-
61
- ### Forms & Input
62
-
63
- | Component | Description | Status |
64
- | ------------------------------------------- | ------------------------------------ | ------ |
65
- | [**Button**](docs/components/button.md) | Interactive buttons with variants | βœ… |
66
- | [**Checkbox**](docs/components/checkbox.md) | Multi-select inputs | βœ… |
67
- | [**Combobox**](docs/components/combobox.md) | Searchable select inputs | βœ… |
68
- | [**Input**](docs/components/input.md) | Text input fields | βœ… |
69
- | [**Radio**](docs/components/radio.md) | Single-select inputs | βœ… |
70
- | **Slider** | Range input controls | ❌ |
71
- | **Switch** | Toggle controls | ❌ |
72
- | [**Textarea**](docs/components/textarea.md) | Multi-line text inputs | βœ… |
73
- | [**Form**](docs/components/form.md) | Form validation and state management | βœ… |
74
- | **DatePicker** | Date selection component | βœ… |
75
- | **TimePicker** | Time selection component | ❌ |
76
- | **FileUpload** | File upload component | ❌ |
77
- | **ColorPicker** | Color selection component | ❌ |
78
- | **Rating** | Star rating component | ❌ |
79
-
80
- ### Data Display
81
-
82
- | Component | Description | Status |
83
- | ------------------------------------------- | --------------------------- | ------ |
84
- | [**Avatar**](docs/components/avatar.md) | User profile images | βœ… |
85
- | [**Badge**](docs/components/badge.md) | Status indicators | βœ… |
86
- | [**DataGrid**](docs/components/datagrid.md) | Advanced data tables | βœ… |
87
- | [**Divider**](docs/components/divider.md) | Content separators | βœ… |
88
- | [**Icon**](docs/components/icon.md) | Scalable icons | βœ… |
89
- | [**Label**](docs/components/label.md) | Form labels | βœ… |
90
- | [**Link**](docs/components/link.md) | Navigation links | βœ… |
91
- | [**List**](docs/components/list.md) | Structured lists | βœ… |
92
- | [**Card**](docs/components/card.md) | Content containers | βœ… |
93
- | **Table** | Simple data tables | ❌ |
94
- | **Chip** | Compact information display | ❌ |
95
- | **Progress** | Progress indicators | ❌ |
96
- | **Skeleton** | Loading placeholders | ❌ |
97
- | **Timeline** | Event timeline display | ❌ |
98
- | **Calendar** | Date display component | βœ… |
99
- | **QRCode** | QR code generator | βœ… |
100
-
101
- ### Overlays & Feedback
102
-
103
- | Component | Description | Status |
104
- | ------------------------------------------------- | ------------------------ | ------ |
105
- | [**Dialog**](docs/components/dialog.md) | Modal dialogs | βœ… |
106
- | [**Dropdown**](docs/components/dropdown.md) | Contextual menus | βœ… |
107
- | [**Popover**](docs/components/popover.md) | Contextual information | βœ… |
108
- | [**Toast**](docs/components/toast.md) | Notification messages | βœ… |
109
- | [**Tooltip**](docs/components/tooltip.md) | Contextual hints | βœ… |
110
- | [**ContextMenu**](docs/components/contextmenu.md) | Right-click menus | βœ… |
111
- | [**Drawer**](docs/components/drawer.md) | Slide-out panels | βœ… |
112
- | [**Alert**](docs/components/alert.md) | Alert messages | βœ… |
113
- | **Banner** | Full-width notifications | ❌ |
114
- | **Spotlight** | Feature highlighting | ❌ |
115
-
116
- ### Utilities & Layout
117
-
118
- | Component | Description | Status |
119
- | ------------------------------------------------- | ----------------------------------- | ------ |
120
- | [**Portal**](docs/components/portal.md) | Declare a portal anywhere in DOM | βœ… |
121
- | **Teleport** | Render content in a specific portal | βœ… |
122
- | **Root** | Application root container | βœ… |
123
- | [**Layer**](docs/components/layer.md) | Layer management utility | βœ… |
124
- | [**Collapsible**](docs/components/collapsible.md) | Generic collapsible wrapper | βœ… |
125
- | **Container** | Layout container | βœ… |
126
- | [**Scrollable**](docs/components/scrollable.md) | Custom scrollbar component | βœ… |
127
- | [**Stack**](docs/components/stack.md) | Flexible layout stacking component | βœ… |
128
- | **Spacer** | Space management utility | ❌ |
129
- | **VirtualList** | Virtual scrolling list | ❌ |
130
-
131
- ---
132
-
133
- ## πŸ—οΈ Architecture
134
-
135
- The library is organized into distinct layers for maximum maintainability and extensibility:
136
-
137
- ```
138
- src/lib/
139
- β”œβ”€β”€ components/ # 30+ Core UI components
140
- β”œβ”€β”€ shared/ # Base classes (Bond, BondState) and utilities
141
- β”œβ”€β”€ helpers/ # Helper functions and components
142
- β”œβ”€β”€ attachments/ # DOM attachment utilities
143
- β”œβ”€β”€ runes/ # Reactive utilities (Svelte 5 runes)
144
- β”œβ”€β”€ types/ # TypeScript type definitions
145
- └── utils/ # General utility functions
146
- ```
147
-
148
- ### Bond Pattern
149
-
150
- Each component follows a consistent Bond pattern:
151
-
152
- - **Bond Class**: Manages component state and DOM interactions
153
- - **BondState Class**: Holds reactive component state using Svelte 5 runes
154
- - **Context Methods**: Static `CONTEXT_KEY`, `get()`, and `set()` methods for component communication
155
- - **Component Files**: Svelte components that use the Bond for behavior
156
-
157
- ```typescript
158
- class MyComponentBond extends Bond<MyComponentBondState> {
159
- static CONTEXT_KEY = '@atoms/context/my-component';
160
-
161
- static get(): MyComponentBond | undefined {
162
- return getContext(MyComponentBond.CONTEXT_KEY);
163
- }
164
-
165
- static set(bond: MyComponentBond): MyComponentBond {
166
- return setContext(MyComponentBond.CONTEXT_KEY, bond);
167
- }
168
- }
169
- ```
170
-
171
- ---
172
-
173
- ## πŸš€ Quick Start
174
-
175
- ### Installation
176
-
177
- ```bash
178
- # npm
179
- npm install @svelte-atoms/core
180
-
181
- # yarn
182
- yarn install @svelte-atoms/core
183
-
184
- # pnpm
185
- pnpm add @svelte-atoms/core
186
-
187
- # bun
188
- bun add @svelte-atoms/core
189
- ```
190
-
191
- ### Basic Usage
192
-
193
- ```svelte
194
- <script lang="ts">
195
- import { Button, Dialog, Input } from '@svelte-atoms/core';
196
-
197
- let dialogOpen = $state(false);
198
- let inputValue = '';
199
- </script>
200
-
201
- <!-- Simple Button -->
202
- <Button onclick={() => (dialogOpen = true)}>Open Dialog</Button>
203
-
204
- <!-- Dialog with Input -->
205
- <Dialog.Root bind:open={dialogOpen}>
206
- <Dialog.Content>
207
- <Dialog.Header>
208
- <Dialog.Title>Enter your name</Dialog.Title>
209
- </Dialog.Header>
210
- <Dialog.Body>
211
- <Input.Root>
212
- <Input.Value bind:value={inputValue} placeholder="Your name...">
213
- </Input.Root>
214
- </Dialog.Body>
215
- <Dialog.Footer>
216
- <Button.Root onclick={() => (dialogOpen = false)}>Cancel</Button.Root>
217
- <Button.Root variant="primary" onclick={() => (dialogOpen = false)}>Confirm</Button.Root>
218
- </Dialog.Footer>
219
- </Dialog.Content>
220
- </Dialog.Root>
221
- ```
222
-
223
- ### Advanced Usage with Bonds
224
-
225
- For more control, you can use the Bond system directly:
226
-
227
- ```svelte
228
- <script lang="ts">
229
- import { DialogBond, DialogBondState } from '@svelte-atoms/core/dialog';
230
-
231
- const { open = false, disable = false } = $props();
232
-
233
- const bondProps = defineState(
234
- [
235
- defineProperty(
236
- 'open',
237
- () => open,
238
- (v) => (open = v)
239
- ),
240
- defineProperty('disable', () => disable)
241
- ],
242
- {
243
- // Other props
244
- }
245
- );
246
-
247
- // Create dialog state
248
- const dialogState = new DialogBondState(() => bondProps);
249
-
250
- // Create dialog bond
251
- // Make available via context
252
- const dialogBond = new DialogBond(dialogState).share();
253
- </script>
254
-
255
- <div {...dialogBond.root()}>
256
- <button {...dialogBond.trigger()} onclick={() => dialogBond.state.toggle()}>
257
- Toggle Dialog
258
- </button>
259
-
260
- {#if open}
261
- <div {...dialogBond.overlay()}>
262
- <div {...dialogBond.content()}>
263
- <h2 {...dialogBond.title()}>Dialog Title</h2>
264
- <p>Dialog content goes here...</p>
265
- <button onclick={() => dialogBond.state.close()}>Close</button>
266
- </div>
267
- </div>
268
- {/if}
269
- </div>
270
- ```
271
-
272
- ### Advanced Usage With Composition
273
-
274
- This example demonstrates the power of component composition by combining `Dropdown`, `Input`, and animation capabilities to create a searchable multi-select dropdown with smooth transitions:
275
-
276
- ```svelte
277
- <script lang="ts">
278
- import { Dropdown, Input, Root, filter } from '@svelte-atoms/core';
279
- import { flip } from 'svelte/animate';
280
-
281
- // Sample data
282
- let data = [
283
- { id: 1, value: 'apple', text: 'Apple' },
284
- { id: 2, value: 'banana', text: 'Banana' },
285
- { id: 3, value: 'cherry', text: 'Cherry' },
286
- { id: 4, value: 'date', text: 'Date' },
287
- { id: 5, value: 'elderberry', text: 'Elderberry' }
288
- ];
289
-
290
- let open = $state(false);
291
- // Filter items based on search query
292
- const dd = filter(
293
- () => data,
294
- (query, item) => item.text.toLowerCase().includes(query.toLowerCase())
295
- );
296
- </script>
297
-
298
- <Root class="items-center justify-center p-4">
299
- <!-- Multi-select dropdown with search functionality -->
300
- <Dropdown.Root
301
- bind:open
302
- multiple
303
- keys={data.map((item) => item.value)}
304
- onquerychange={(q) => (dd.query = q)}
305
- >
306
- {#snippet children({ dropdown })}
307
- <!-- Compose Dropdown.Trigger with Input.Root for a custom trigger -->
308
- <Dropdown.Trigger
309
- base={Input.Root}
310
- class="h-auto min-h-12 max-w-sm min-w-sm items-center gap-2 rounded-sm px-4 transition-colors duration-200"
311
- onclick={(ev) => {
312
- ev.preventDefault();
313
-
314
- dropdown.state.open();
315
- }}
316
- >
317
- <!-- Display selected values with animation -->
318
- {#each dropdown?.state?.selectedItems ?? [] as item (item.id)}
319
- <div animate:flip={{ duration: 200 }}>
320
- <ADropdown.Value value={item.value} class="text-foreground/80">
321
- {item.text}
322
- </ADropdown.Value>
323
- </div>
324
- {/each}
325
-
326
- <!-- Inline search input within the trigger -->
327
- <Dropdown.Query class="flex-1 px-1" placeholder="Search for fruits..." />
328
- </Dropdown.Trigger>
329
-
330
- <!-- Dropdown list with filtered items -->
331
- <Dropdown.List>
332
- {#each dd.current as item (item.id)}
333
- <div animate:flip={{ duration: 200 }}>
334
- <Dropdown.Item value={item.value}>{item.text}</Dropdown.Item>
335
- </div>
336
- {/each}
337
- </Dropdown.List>
338
- {/snippet}
339
- </Dropdown.Root>
340
- </Root>
341
- ```
342
-
343
- **Key composition features demonstrated:**
344
-
345
- - **Component Fusion**: Using `base={Input.Root}` to compose Dropdown.Trigger with Input styling and behavior
346
- - **Snippet Patterns**: Accessing internal state through snippets for custom rendering
347
- - **Reactive Filtering**: Combining search query state with reactive effects for real-time filtering
348
- - **Smooth Animations**: Using Svelte's `flip` animation for seamless list transitions
349
- - **Multi-Select State**: Managing complex selection state through the Bond pattern
350
-
351
- ### Creating Custom Variants
352
-
353
- @svelte-atoms/core provides a powerful variant system using `defineVariants()` that allows you to create type-safe, reusable component variations with support for compound variants, defaults, and bond state integration.
354
-
355
- #### Basic Variant Definition
356
-
357
- ```typescript
358
- import { defineVariants, type VariantPropsType } from '@svelte-atoms/core/utils';
359
-
360
- const buttonVariants = defineVariants({
361
- class: 'inline-flex items-center justify-center rounded-md font-medium transition-colors',
362
- variants: {
363
- variant: {
364
- primary: 'bg-blue-500 text-white hover:bg-blue-600',
365
- secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
366
- ghost: 'hover:bg-gray-100'
367
- },
368
- size: {
369
- sm: 'h-8 px-3 text-sm',
370
- md: 'h-10 px-4',
371
- lg: 'h-12 px-6 text-lg'
372
- }
373
- },
374
- compounds: [
375
- {
376
- variant: 'primary',
377
- size: 'lg',
378
- class: 'shadow-md font-semibold'
379
- }
380
- ],
381
- defaults: {
382
- variant: 'primary',
383
- size: 'md'
384
- }
385
- });
386
-
387
- // Extract type-safe props
388
- type ButtonVariantProps = VariantPropsType<typeof buttonVariants>;
389
- ```
390
-
391
- #### Local vs Global Variants
392
-
393
- **Local Variants** - Define variants directly in your component:
394
-
395
- ```svelte
396
- <script lang="ts">
397
- import { HtmlAtom } from '@svelte-atoms/core';
398
- import { defineVariants, type VariantPropsType } from '@svelte-atoms/core/utils';
399
-
400
- const buttonVariants = defineVariants({
401
- class: 'rounded-md font-medium',
402
- variants: {
403
- variant: {
404
- primary: 'bg-blue-500 text-white',
405
- secondary: 'bg-gray-500 text-white'
406
- },
407
- size: {
408
- sm: 'px-2 py-1 text-sm',
409
- md: 'px-4 py-2 text-base'
410
- }
411
- },
412
- defaults: {
413
- variant: 'primary',
414
- size: 'md'
415
- }
416
- });
417
-
418
- type ButtonProps = VariantPropsType<typeof buttonVariants> & {
419
- disabled?: boolean;
420
- class?: string;
421
- };
422
-
423
- let { variant, size, disabled = false, class: klass = '', ...props }: ButtonProps = $props();
424
-
425
- const variantProps = $derived(buttonVariants(null, { variant, size }));
426
- </script>
427
-
428
- <HtmlAtom
429
- as="button"
430
- variants={variantProps}
431
- {disabled}
432
- class={[variantProps.class, klass]}
433
- {...props}
434
- >
435
- {@render children?.()}
436
- </HtmlAtom>
437
- ```
438
-
439
- **Global Variants** - Define variants in your theme/preset configuration:
440
-
441
- ```typescript
442
- // +layout.svelte or theme configuration
443
- import { setPreset } from '@svelte-atoms/core/context';
444
-
445
- setPreset({
446
- button: () => ({
447
- class: 'inline-flex items-center justify-center rounded-md font-medium transition-colors',
448
- variants: {
449
- variant: {
450
- default: {
451
- class: 'bg-primary text-primary-foreground hover:bg-primary/90'
452
- },
453
- destructive: {
454
- class: 'bg-destructive text-destructive-foreground hover:bg-destructive/90'
455
- },
456
- outline: {
457
- class: 'border border-input bg-background hover:bg-accent'
458
- }
459
- },
460
- size: {
461
- default: 'h-10 px-4 py-2',
462
- sm: 'h-9 px-3',
463
- lg: 'h-11 px-8'
464
- }
465
- },
466
- compounds: [
467
- {
468
- variant: 'default',
469
- size: 'lg',
470
- class: 'text-base font-semibold'
471
- }
472
- ],
473
- defaults: {
474
- variant: 'default',
475
- size: 'default'
476
- }
477
- })
478
- });
479
- ```
480
-
481
- #### Extending Global Variants
482
-
483
- Combine global presets with local extensions:
484
-
485
- ```svelte
486
- <script lang="ts">
487
- import { HtmlAtom } from '@svelte-atoms/core';
488
- import { defineVariants } from '@svelte-atoms/core/utils';
489
-
490
- // Extend preset variants with local additions
491
- const extendedVariants = defineVariants({
492
- variants: {
493
- variant: {
494
- // Add new variants not in preset
495
- gradient: {
496
- class: 'bg-gradient-to-r from-purple-500 to-pink-500 text-white'
497
- },
498
- neon: {
499
- class: 'bg-black text-green-400 border-2 border-green-400'
500
- }
501
- },
502
- // Add new variant dimension
503
- animated: {
504
- true: 'animate-pulse',
505
- false: ''
506
- }
507
- },
508
- defaults: {
509
- animated: false
510
- }
511
- });
512
-
513
- let { variant, size, animated, ...props } = $props();
514
- </script>
515
-
516
- <HtmlAtom
517
- preset="button"
518
- variants={extendedVariants}
519
- as="button"
520
- {variant}
521
- {size}
522
- {animated}
523
- {...props}
524
- >
525
- {@render children?.()}
526
- </HtmlAtom>
527
- ```
528
-
529
- #### Bond-Reactive Variants
530
-
531
- Variants can react to component state through the Bond pattern:
532
-
533
- ```typescript
534
- const accordionVariants = defineVariants({
535
- class: 'border rounded-md transition-all',
536
- variants: {
537
- state: {
538
- open: (bond) => ({
539
- class: bond?.state?.isOpen ? 'bg-blue-50 border-blue-200' : 'bg-white',
540
- 'aria-expanded': bond?.state?.isOpen,
541
- 'data-state': bond?.state?.isOpen ? 'open' : 'closed'
542
- })
543
- }
544
- }
545
- });
546
-
547
- // Usage with bond
548
- const bond = AccordionBond.get();
549
- const variantProps = $derived(accordionVariants(bond, { state: 'open' }));
550
- ```
551
-
552
- **Variant Features:**
553
-
554
- - βœ… **Type Safety** - Automatic TypeScript inference
555
- - βœ… **Compound Variants** - Apply styles when multiple conditions match
556
- - βœ… **Default Values** - Specify fallback variant values
557
- - βœ… **Bond Integration** - Access component state for reactive styling
558
- - βœ… **Return Attributes** - Not just classes, any HTML attributes
559
- - βœ… **Extensible** - Combine global presets with local variants
560
-
561
- ---
562
-
563
- ## πŸ“– Documentation
564
-
565
- ### Component Examples
566
-
567
- #### Dropdown with Multiple Selection
568
-
569
- ```svelte
570
- <script lang="ts">
571
- import { Dropdown } from '@svelte-atoms/core';
572
-
573
- let selectedValues = ['option1'];
574
- const options = [
575
- { value: 'option1', label: 'Option 1' },
576
- { value: 'option2', label: 'Option 2' },
577
- { value: 'option3', label: 'Option 3' }
578
- ];
579
- </script>
580
-
581
- <Dropdown.Root multiple bind:values={selectedValues}>
582
- <!-- Access internal bond -->
583
- {#snippet children({ dropdown })}
584
- <Dropdown.Trigger>
585
- Select options ({selectedValues.length} selected)
586
- </Dropdown.Trigger>
587
-
588
- <Dropdown.Content>
589
- {#each options as option}
590
- <Dropdown.Item value={option.value}>
591
- {option.label}
592
- </Dropdown.Item>
593
- {/each}
594
- </Dropdown.Content>
595
- {/snippet}
596
- </Dropdown.Root>
597
- ```
598
-
599
- #### Form with Validation
600
-
601
- ```svelte
602
- <script lang="ts">
603
- import { Form, Input, Button } from '@svelte-atoms/core';
604
- import { z } from 'zod';
605
-
606
- const schema = z.object({
607
- email: z.string().email('Invalid email address'),
608
- password: z.string().min(8, 'Password must be at least 8 characters')
609
- });
610
-
611
- let formData = { email: '', password: '' };
612
- let errors = {};
613
- </script>
614
-
615
- <Form {schema} bind:value={formData} bind:errors>
616
- <Field name="email">
617
- <Field.Label>Email</Field.Label>
618
- <Field.Control>
619
- <Input.Root type="email" placeholder="Enter your email" bind:value={formData.email} />
620
- </Field.Control>
621
- {#if errors.email}
622
- <Form.Error>{errors.email}</Form.Error>
623
- {/if}
624
- </.Field>
625
-
626
- <Field name="password">
627
- <Field.Label>Password</Field.Label>
628
- <Field.Control>
629
- <Input.Root
630
- type="password"
631
- placeholder="Enter your password"
632
- bind:value={formData.password}
633
- />
634
- </Field.Control>
635
- {#if errors.password}
636
- <Field.Error>{errors.password}</Field.Error>
637
- {/if}
638
- </.Field>
639
-
640
- <Button type="submit">Submit</Button>
641
- </Form>
642
- ```
643
-
644
- #### Data Grid with Sorting and Selection
645
-
646
- ```svelte
647
- <script lang="ts">
648
- import { DataGrid, Checkbox } from '@svelte-atoms/core';
649
-
650
- let data = [
651
- { id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
652
- { id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User' },
653
- { id: 3, name: 'Bob Johnson', email: 'bob@example.com', role: 'Editor' }
654
- ];
655
-
656
- let selectedRows = [];
657
- </script>
658
-
659
- <DataGrid.Root {data} bind:selectedRows multiple>
660
- <DataGrid.Header>
661
- <DataGrid.Tr>
662
- <DataGrid.Th>
663
- <Checkbox />
664
- </DataGrid.Th>
665
- <DataGrid.Th sortable="name">Name</DataGrid.Th>
666
- <DataGrid.Th sortable="email">Email</DataGrid.Th>
667
- <DataGrid.Th>Role</DataGrid.Th>
668
- </DataGrid.Tr>
669
- </DataGrid.Header>
670
-
671
- <DataGrid.Body>
672
- {#each data as row}
673
- <DataGrid.Tr value={row.id}>
674
- <DataGrid.Td>
675
- <Checkbox.Root value={row.id} />
676
- </DataGrid.Td>
677
- <DataGrid.Td>{row.name}</DataGrid.Td>
678
- <DataGrid.Td>{row.email}</DataGrid.Td>
679
- <DataGrid.Td>{row.role}</DataGrid.Td>
680
- </DataGrid.Tr>
681
- {/each}
682
- </DataGrid.Body>
683
- </DataGrid.Root>
684
- ```
685
-
686
- ---
687
-
688
- ## 🎨 Styling
689
-
690
- @svelte-atoms/core is completely headless, giving you full control over styling. Here are some approaches:
691
-
692
- ### Using Vanilla CSS
693
-
694
- ```css
695
- /* Default button styles */
696
- .btn {
697
- @apply rounded-md px-4 py-2 font-medium transition-colors;
698
- }
699
-
700
- .btn-primary {
701
- @apply bg-blue-600 text-white hover:bg-blue-700;
702
- }
703
-
704
- .btn-secondary {
705
- @apply bg-gray-200 text-gray-900 hover:bg-gray-300;
706
- }
707
- ```
708
-
709
- ### Using Tailwind CSS
710
-
711
- ```svelte
712
- <Button class="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">Styled Button</Button>
713
- ```
714
-
715
- ---
716
-
717
- ## πŸ§ͺ Development
718
-
719
- ### Setup
720
-
721
- 1. **Clone the repository:**
722
-
723
- ```bash
724
- git clone https://github.com/ryu-man/svelte-atoms.git
725
- cd svelte-atoms
726
- ```
727
-
728
- 2. **Install dependencies:**
729
-
730
- ```bash
731
- bun install
732
- ```
733
-
734
- 3. **Start development server:**
735
-
736
- ```bash
737
- bun dev
738
- ```
739
-
740
- 4. **Run Storybook:**
741
- ```bash
742
- bun run storybook:dev
743
- ```
744
-
745
- ### Building
746
-
747
- ```bash
748
- # Build library
749
- bun run build
750
-
751
- # Build Storybook
752
- bun run storybook:build
753
- ```
754
-
755
- ---
756
-
757
- <!-- ## 🀝 Contributing
758
-
759
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. -->
760
-
761
- <!-- ### Development Workflow
762
-
763
- 1. Fork the repository
764
- 2. Create a feature branch: `git checkout -b feature/amazing-feature`
765
- 3. Make your changes and add tests
766
- 4. Run the test suite: `bun test`
767
- 5. Commit your changes: `git commit -m 'Add amazing feature'`
768
- 6. Push to the branch: `git push origin feature/amazing-feature`
769
- 7. Open a Pull Request -->
770
-
771
- ### Creating New Components
772
-
773
- When adding new components, follow these guidelines:
774
-
775
- 1. **Create the bond structure:**
776
-
777
- ```
778
- src/lib/atoms/my-component/
779
- β”œβ”€β”€ bond.svelte.ts # Core bond logic (Bond + BondState classes)
780
- β”œβ”€β”€ index.ts # Public exports
781
- β”œβ”€β”€ atoms.ts # Component exports
782
- β”œβ”€β”€ my-component-root.svelte # Use namespace pattern when building complex component
783
- β”œβ”€β”€ my-component-content.svelte
784
- └── README.md # Component documentation
785
- ```
786
-
787
- 2. **Implement accessibility features:**
788
- - ARIA attributes
789
- - Keyboard navigation
790
- - Focus management
791
- - Screen reader support
792
-
793
- 3. **Add comprehensive tests:**
794
- - Unit tests for bond logic
795
- - Component integration tests
796
- - Accessibility tests
797
-
798
- 4. **Create Storybook stories:**
799
- - Basic usage examples
800
- - Advanced configurations
801
- - Interactive demos
802
-
803
- ---
804
-
805
- ## πŸ“š Resources
806
-
807
- - **[Documentation](https://svelte-atoms.dev)** - Comprehensive documentation
808
- - **[Storybook](https://storybook.svelte-atoms.dev/)** - Interactive component documentation
809
- - **[GitHub](https://github.com/ryu-man/svelte-atoms)** - Source code and issues
810
- - **[@svelte-atoms/alchemist](../alchimist)** - Data visualization companion library
811
-
812
- ---
813
-
814
- ## πŸ—ΊοΈ Roadmap
815
-
816
- ### v1.0.0 (Current - Alpha)
817
-
818
- - βœ… Bond architecture with Svelte 5 runes
819
- - βœ… 35+ essential components
820
- - βœ… TypeScript support
821
- - βœ… Accessibility features
822
- - βœ… Storybook documentation
823
- - βœ… Standardized context pattern
824
-
825
- ---
826
-
827
- ## πŸ“„ License
828
-
829
- MIT License - see the [LICENSE](LICENSE) file for details.
830
-
831
- ---
832
-
833
- ## πŸ™ Acknowledgements
834
-
835
- - [Svelte](https://svelte.dev/) - The amazing framework that powers this library
836
- - [Motion](https://motion.dev/) - For handling internal default animations
837
- - [Floating UI](https://floating-ui.com/) - For advanced positioning logic
838
- - [Tailwind CSS](https://tailwindcss.com/) - For styling
839
- - [Storybook](https://storybook.js.org/) - For component documentation and testing
840
- - [Vitest](https://vitest.dev/) - For fast and reliable testing
841
- - [Playwright](https://playwright.dev/) - For end-to-end testing
842
-
843
- ---
844
-
845
- <div align="center">
846
- <p>Built with ❀️ by the Svelte Atoms team</p>
847
- <!-- <p>
848
- <a href="https://github.com/ryu-man/svelte-atoms">GitHub</a> β€’
849
- <a href="https://svelte-atoms.dev">Documentation</a> β€’
850
- <a href="https://storybook.svelte-atoms.dev">Storybook</a>
851
- </p> -->
852
- </div>
1
+ # βš›οΈ @svelte-atoms/core | Svelte 5 UI Library
2
+
3
+ > A modern, modular, and accessible Svelte 5 UI component library built with composability at its core.
4
+
5
+ Core UI is a comprehensive Svelte component library that provides fundamental building blocks ("atoms") for creating sophisticated, interactive design systems. Each component is designed with accessibility, type safety, and developer experience in mind. Built with Svelte 5 runes for optimal reactivity and performance.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@svelte-atoms/core.svg)](https://www.npmjs.com/package/@svelte-atoms/core)
8
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/svelte-atoms/core)
9
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
+
11
+ ---
12
+
13
+ ## ✨ Features
14
+
15
+ ### 🧱 **Bond Architecture**
16
+
17
+ Self-contained state management classes that encapsulate component logic and DOM interactions. Bonds communicate through Svelte's context API using standardized `Bond.get()` / `Bond.set()` methods, enabling parent-child relationships without prop drilling.
18
+
19
+ ### β™Ώ **Accessibility First**
20
+
21
+ Every component includes proper ARIA attributes, keyboard navigation, and focus management out of the box.
22
+
23
+ ### πŸ”§ **Highly Extensible**
24
+
25
+ Easily extend components with custom behaviors, animations, and styling while maintaining the core functionality.
26
+
27
+ ### 🎯 **Type Safety**
28
+
29
+ Fully written in TypeScript with comprehensive type definitions for a robust development experience.
30
+
31
+ ### ⚑ **Reactive by Design**
32
+
33
+ Leverages Svelte's fine-grained reactivity system for optimal performance and smooth user interactions.
34
+
35
+ ### 🎨 **Headless & Stylable**
36
+
37
+ Components are headless by default, giving you complete control over styling while providing sensible defaults.
38
+
39
+ ### 🧩 **Composable**
40
+
41
+ Build complex UIs by combining simple, reusable components. Each component is designed to work seamlessly with others through the Bond pattern and context API. Create sophisticated features like multi-level dropdowns, nested accordions, or custom form controls by composing atomic components together.
42
+
43
+ ---
44
+
45
+ ## πŸ“¦ Available Components
46
+
47
+ Our comprehensive collection of UI components with implementation status:
48
+
49
+ ### Layout & Navigation
50
+
51
+ | Component | Description | Status |
52
+ | ----------------------------------------------- | ---------------------------- | ------ |
53
+ | [**Accordion**](docs/components/accordion.md) | Collapsible content sections | βœ… |
54
+ | [**Breadcrumb**](docs/components/breadcrumb.md) | Navigation hierarchy | βœ… |
55
+ | [**Sidebar**](docs/components/sidebar.md) | Collapsible side navigation | βœ… |
56
+ | [**Tabs**](docs/components/tabs.md) | Tabbed interfaces | βœ… |
57
+ | [**Tree**](docs/components/tree.md) | Hierarchical data structures | βœ… |
58
+ | **Stepper** | Multi-step process indicator | ❌ |
59
+ | **Pagination** | Page navigation controls | ❌ |
60
+
61
+ ### Forms & Input
62
+
63
+ | Component | Description | Status |
64
+ | ------------------------------------------- | ------------------------------------ | ------ |
65
+ | [**Button**](docs/components/button.md) | Interactive buttons with variants | βœ… |
66
+ | [**Checkbox**](docs/components/checkbox.md) | Multi-select inputs | βœ… |
67
+ | [**Combobox**](docs/components/combobox.md) | Searchable select inputs | βœ… |
68
+ | [**Input**](docs/components/input.md) | Text input fields | βœ… |
69
+ | [**Radio**](docs/components/radio.md) | Single-select inputs | βœ… |
70
+ | **Slider** | Range input controls | ❌ |
71
+ | **Switch** | Toggle controls | ❌ |
72
+ | [**Textarea**](docs/components/textarea.md) | Multi-line text inputs | βœ… |
73
+ | [**Form**](docs/components/form.md) | Form validation and state management | βœ… |
74
+ | **DatePicker** | Date selection component | βœ… |
75
+ | **TimePicker** | Time selection component | ❌ |
76
+ | **FileUpload** | File upload component | ❌ |
77
+ | **ColorPicker** | Color selection component | ❌ |
78
+ | **Rating** | Star rating component | ❌ |
79
+
80
+ ### Data Display
81
+
82
+ | Component | Description | Status |
83
+ | ------------------------------------------- | --------------------------- | ------ |
84
+ | [**Avatar**](docs/components/avatar.md) | User profile images | βœ… |
85
+ | [**Badge**](docs/components/badge.md) | Status indicators | βœ… |
86
+ | [**DataGrid**](docs/components/datagrid.md) | Advanced data tables | βœ… |
87
+ | [**Divider**](docs/components/divider.md) | Content separators | βœ… |
88
+ | [**Icon**](docs/components/icon.md) | Scalable icons | βœ… |
89
+ | [**Label**](docs/components/label.md) | Form labels | βœ… |
90
+ | [**Link**](docs/components/link.md) | Navigation links | βœ… |
91
+ | [**List**](docs/components/list.md) | Structured lists | βœ… |
92
+ | [**Card**](docs/components/card.md) | Content containers | βœ… |
93
+ | **Table** | Simple data tables | ❌ |
94
+ | **Chip** | Compact information display | ❌ |
95
+ | **Progress** | Progress indicators | ❌ |
96
+ | **Skeleton** | Loading placeholders | ❌ |
97
+ | **Timeline** | Event timeline display | ❌ |
98
+ | **Calendar** | Date display component | βœ… |
99
+ | **QRCode** | QR code generator | βœ… |
100
+
101
+ ### Overlays & Feedback
102
+
103
+ | Component | Description | Status |
104
+ | ------------------------------------------------- | ------------------------ | ------ |
105
+ | [**Dialog**](docs/components/dialog.md) | Modal dialogs | βœ… |
106
+ | [**Dropdown**](docs/components/dropdown.md) | Contextual menus | βœ… |
107
+ | [**Popover**](docs/components/popover.md) | Contextual information | βœ… |
108
+ | [**Toast**](docs/components/toast.md) | Notification messages | βœ… |
109
+ | [**Tooltip**](docs/components/tooltip.md) | Contextual hints | βœ… |
110
+ | [**ContextMenu**](docs/components/contextmenu.md) | Right-click menus | βœ… |
111
+ | [**Drawer**](docs/components/drawer.md) | Slide-out panels | βœ… |
112
+ | [**Alert**](docs/components/alert.md) | Alert messages | βœ… |
113
+ | **Banner** | Full-width notifications | ❌ |
114
+ | **Spotlight** | Feature highlighting | ❌ |
115
+
116
+ ### Utilities & Layout
117
+
118
+ | Component | Description | Status |
119
+ | ------------------------------------------------- | ----------------------------------- | ------ |
120
+ | [**Portal**](docs/components/portal.md) | Declare a portal anywhere in DOM | βœ… |
121
+ | **Teleport** | Render content in a specific portal | βœ… |
122
+ | **Root** | Application root container | βœ… |
123
+ | [**Layer**](docs/components/layer.md) | Layer management utility | βœ… |
124
+ | [**Collapsible**](docs/components/collapsible.md) | Generic collapsible wrapper | βœ… |
125
+ | **Container** | Layout container | βœ… |
126
+ | [**Scrollable**](docs/components/scrollable.md) | Custom scrollbar component | βœ… |
127
+ | [**Stack**](docs/components/stack.md) | Flexible layout stacking component | βœ… |
128
+ | **Spacer** | Space management utility | ❌ |
129
+ | **VirtualList** | Virtual scrolling list | ❌ |
130
+
131
+ ---
132
+
133
+ ## πŸ—οΈ Architecture
134
+
135
+ The library is organized into distinct layers for maximum maintainability and extensibility:
136
+
137
+ ```
138
+ src/lib/
139
+ β”œβ”€β”€ components/ # 30+ Core UI components
140
+ β”œβ”€β”€ shared/ # Base classes (Bond, BondState) and utilities
141
+ β”œβ”€β”€ helpers/ # Helper functions and components
142
+ β”œβ”€β”€ attachments/ # DOM attachment utilities
143
+ β”œβ”€β”€ runes/ # Reactive utilities (Svelte 5 runes)
144
+ β”œβ”€β”€ types/ # TypeScript type definitions
145
+ └── utils/ # General utility functions
146
+ ```
147
+
148
+ ### Bond Pattern
149
+
150
+ Each component follows a consistent Bond pattern:
151
+
152
+ - **Bond Class**: Manages component state and DOM interactions
153
+ - **BondState Class**: Holds reactive component state using Svelte 5 runes
154
+ - **Context Methods**: Static `CONTEXT_KEY`, `get()`, and `set()` methods for component communication
155
+ - **Component Files**: Svelte components that use the Bond for behavior
156
+
157
+ ```typescript
158
+ class MyComponentBond extends Bond<MyComponentBondState> {
159
+ static CONTEXT_KEY = '@atoms/context/my-component';
160
+
161
+ static get(): MyComponentBond | undefined {
162
+ return getContext(MyComponentBond.CONTEXT_KEY);
163
+ }
164
+
165
+ static set(bond: MyComponentBond): MyComponentBond {
166
+ return setContext(MyComponentBond.CONTEXT_KEY, bond);
167
+ }
168
+ }
169
+ ```
170
+
171
+ ---
172
+
173
+ ## πŸš€ Quick Start
174
+
175
+ ### Installation
176
+
177
+ ```bash
178
+ # npm
179
+ npm install @svelte-atoms/core
180
+
181
+ # yarn
182
+ yarn install @svelte-atoms/core
183
+
184
+ # pnpm
185
+ pnpm add @svelte-atoms/core
186
+
187
+ # bun
188
+ bun add @svelte-atoms/core
189
+ ```
190
+
191
+ ### Basic Usage
192
+
193
+ ```svelte
194
+ <script lang="ts">
195
+ import { Button, Dialog, Input } from '@svelte-atoms/core';
196
+ import '@svelte-atoms/tw';
197
+
198
+ let dialogOpen = $state(false);
199
+ let inputValue = '';
200
+ </script>
201
+
202
+ <!-- Simple Button -->
203
+ <Button onclick={() => (dialogOpen = true)}>Open Dialog</Button>
204
+
205
+ <!-- Dialog with Input -->
206
+ <Dialog.Root bind:open={dialogOpen}>
207
+ <Dialog.Content>
208
+ <Dialog.Header>
209
+ <Dialog.Title>Enter your name</Dialog.Title>
210
+ </Dialog.Header>
211
+ <Dialog.Body>
212
+ <Input.Root>
213
+ <Input.Value bind:value={inputValue} placeholder="Your name...">
214
+ </Input.Root>
215
+ </Dialog.Body>
216
+ <Dialog.Footer>
217
+ <Button.Root onclick={() => (dialogOpen = false)}>Cancel</Button.Root>
218
+ <Button.Root variant="primary" onclick={() => (dialogOpen = false)}>Confirm</Button.Root>
219
+ </Dialog.Footer>
220
+ </Dialog.Content>
221
+ </Dialog.Root>
222
+ ```
223
+
224
+ ### Advanced Usage with Bonds
225
+
226
+ For more control, you can use the Bond system directly:
227
+
228
+ ```svelte
229
+ <script lang="ts">
230
+ import { DialogBond, DialogBondState } from '@svelte-atoms/core/dialog';
231
+
232
+ const { open = false, disable = false } = $props();
233
+
234
+ const bondProps = defineState(
235
+ [
236
+ defineProperty(
237
+ 'open',
238
+ () => open,
239
+ (v) => (open = v)
240
+ ),
241
+ defineProperty('disable', () => disable)
242
+ ],
243
+ {
244
+ // Other props
245
+ }
246
+ );
247
+
248
+ // Create dialog state
249
+ const dialogState = new DialogBondState(() => bondProps);
250
+
251
+ // Create dialog bond
252
+ // Make available via context
253
+ const dialogBond = new DialogBond(dialogState).share();
254
+ </script>
255
+
256
+ <div {...dialogBond.root()}>
257
+ <button {...dialogBond.trigger()} onclick={() => dialogBond.state.toggle()}>
258
+ Toggle Dialog
259
+ </button>
260
+
261
+ {#if open}
262
+ <div {...dialogBond.overlay()}>
263
+ <div {...dialogBond.content()}>
264
+ <h2 {...dialogBond.title()}>Dialog Title</h2>
265
+ <p>Dialog content goes here...</p>
266
+ <button onclick={() => dialogBond.state.close()}>Close</button>
267
+ </div>
268
+ </div>
269
+ {/if}
270
+ </div>
271
+ ```
272
+
273
+ ### Advanced Usage With Composition
274
+
275
+ This example demonstrates the power of component composition by combining `Dropdown`, `Input`, and animation capabilities to create a searchable multi-select dropdown with smooth transitions:
276
+
277
+ ```svelte
278
+ <script lang="ts">
279
+ import { Dropdown, Input, Root, filter } from '@svelte-atoms/core';
280
+ import { flip } from 'svelte/animate';
281
+
282
+ // Sample data
283
+ let data = [
284
+ { id: 1, value: 'apple', text: 'Apple' },
285
+ { id: 2, value: 'banana', text: 'Banana' },
286
+ { id: 3, value: 'cherry', text: 'Cherry' },
287
+ { id: 4, value: 'date', text: 'Date' },
288
+ { id: 5, value: 'elderberry', text: 'Elderberry' }
289
+ ];
290
+
291
+ let open = $state(false);
292
+ // Filter items based on search query
293
+ const dd = filter(
294
+ () => data,
295
+ (query, item) => item.text.toLowerCase().includes(query.toLowerCase())
296
+ );
297
+ </script>
298
+
299
+ <Root class="items-center justify-center p-4">
300
+ <!-- Multi-select dropdown with search functionality -->
301
+ <Dropdown.Root
302
+ bind:open
303
+ multiple
304
+ keys={data.map((item) => item.value)}
305
+ onquerychange={(q) => (dd.query = q)}
306
+ >
307
+ {#snippet children({ dropdown })}
308
+ <!-- Compose Dropdown.Trigger with Input.Root for a custom trigger -->
309
+ <Dropdown.Trigger
310
+ base={Input.Root}
311
+ class="h-auto min-h-12 max-w-sm min-w-sm items-center gap-2 rounded-sm px-4 transition-colors duration-200"
312
+ onclick={(ev) => {
313
+ ev.preventDefault();
314
+
315
+ dropdown.state.open();
316
+ }}
317
+ >
318
+ <!-- Display selected values with animation -->
319
+ {#each dropdown?.state?.selectedItems ?? [] as item (item.id)}
320
+ <div animate:flip={{ duration: 200 }}>
321
+ <ADropdown.Value value={item.value} class="text-foreground/80">
322
+ {item.text}
323
+ </ADropdown.Value>
324
+ </div>
325
+ {/each}
326
+
327
+ <!-- Inline search input within the trigger -->
328
+ <Dropdown.Query class="flex-1 px-1" placeholder="Search for fruits..." />
329
+ </Dropdown.Trigger>
330
+
331
+ <!-- Dropdown list with filtered items -->
332
+ <Dropdown.List>
333
+ {#each dd.current as item (item.id)}
334
+ <div animate:flip={{ duration: 200 }}>
335
+ <Dropdown.Item value={item.value}>{item.text}</Dropdown.Item>
336
+ </div>
337
+ {/each}
338
+ </Dropdown.List>
339
+ {/snippet}
340
+ </Dropdown.Root>
341
+ </Root>
342
+ ```
343
+
344
+ **Key composition features demonstrated:**
345
+
346
+ - **Component Fusion**: Using `base={Input.Root}` to compose Dropdown.Trigger with Input styling and behavior
347
+ - **Snippet Patterns**: Accessing internal state through snippets for custom rendering
348
+ - **Reactive Filtering**: Combining search query state with reactive effects for real-time filtering
349
+ - **Smooth Animations**: Using Svelte's `flip` animation for seamless list transitions
350
+ - **Multi-Select State**: Managing complex selection state through the Bond pattern
351
+
352
+ ### Creating Custom Variants
353
+
354
+ @svelte-atoms/core provides a powerful variant system using `defineVariants()` that allows you to create type-safe, reusable component variations with support for compound variants, defaults, and bond state integration.
355
+
356
+ #### Basic Variant Definition
357
+
358
+ ```typescript
359
+ import { defineVariants, type VariantPropsType } from '@svelte-atoms/core/utils';
360
+
361
+ const buttonVariants = defineVariants({
362
+ class: 'inline-flex items-center justify-center rounded-md font-medium transition-colors',
363
+ variants: {
364
+ variant: {
365
+ primary: 'bg-blue-500 text-white hover:bg-blue-600',
366
+ secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
367
+ ghost: 'hover:bg-gray-100'
368
+ },
369
+ size: {
370
+ sm: 'h-8 px-3 text-sm',
371
+ md: 'h-10 px-4',
372
+ lg: 'h-12 px-6 text-lg'
373
+ }
374
+ },
375
+ compounds: [
376
+ {
377
+ variant: 'primary',
378
+ size: 'lg',
379
+ class: 'shadow-md font-semibold'
380
+ }
381
+ ],
382
+ defaults: {
383
+ variant: 'primary',
384
+ size: 'md'
385
+ }
386
+ });
387
+
388
+ // Extract type-safe props
389
+ type ButtonVariantProps = VariantPropsType<typeof buttonVariants>;
390
+ ```
391
+
392
+ #### Local vs Global Variants
393
+
394
+ **Local Variants** - Define variants directly in your component:
395
+
396
+ ```svelte
397
+ <script lang="ts">
398
+ import { HtmlAtom } from '@svelte-atoms/core';
399
+ import { defineVariants, type VariantPropsType } from '@svelte-atoms/core/utils';
400
+
401
+ const buttonVariants = defineVariants({
402
+ class: 'rounded-md font-medium',
403
+ variants: {
404
+ variant: {
405
+ primary: 'bg-blue-500 text-white',
406
+ secondary: 'bg-gray-500 text-white'
407
+ },
408
+ size: {
409
+ sm: 'px-2 py-1 text-sm',
410
+ md: 'px-4 py-2 text-base'
411
+ }
412
+ },
413
+ defaults: {
414
+ variant: 'primary',
415
+ size: 'md'
416
+ }
417
+ });
418
+
419
+ type ButtonProps = VariantPropsType<typeof buttonVariants> & {
420
+ disabled?: boolean;
421
+ class?: string;
422
+ };
423
+
424
+ let { variant, size, disabled = false, class: klass = '', ...props }: ButtonProps = $props();
425
+
426
+ const variantProps = $derived(buttonVariants(null, { variant, size }));
427
+ </script>
428
+
429
+ <HtmlAtom
430
+ as="button"
431
+ variants={variantProps}
432
+ {disabled}
433
+ class={[variantProps.class, klass]}
434
+ {...props}
435
+ >
436
+ {@render children?.()}
437
+ </HtmlAtom>
438
+ ```
439
+
440
+ **Global Variants** - Define variants in your theme/preset configuration:
441
+
442
+ ```typescript
443
+ // +layout.svelte or theme configuration
444
+ import { setPreset } from '@svelte-atoms/core/context';
445
+
446
+ setPreset({
447
+ button: () => ({
448
+ class: 'inline-flex items-center justify-center rounded-md font-medium transition-colors',
449
+ variants: {
450
+ variant: {
451
+ default: {
452
+ class: 'bg-primary text-primary-foreground hover:bg-primary/90'
453
+ },
454
+ destructive: {
455
+ class: 'bg-destructive text-destructive-foreground hover:bg-destructive/90'
456
+ },
457
+ outline: {
458
+ class: 'border border-input bg-background hover:bg-accent'
459
+ }
460
+ },
461
+ size: {
462
+ default: 'h-10 px-4 py-2',
463
+ sm: 'h-9 px-3',
464
+ lg: 'h-11 px-8'
465
+ }
466
+ },
467
+ compounds: [
468
+ {
469
+ variant: 'default',
470
+ size: 'lg',
471
+ class: 'text-base font-semibold'
472
+ }
473
+ ],
474
+ defaults: {
475
+ variant: 'default',
476
+ size: 'default'
477
+ }
478
+ })
479
+ });
480
+ ```
481
+
482
+ #### Extending Global Variants
483
+
484
+ Combine global presets with local extensions:
485
+
486
+ ```svelte
487
+ <script lang="ts">
488
+ import { HtmlAtom } from '@svelte-atoms/core';
489
+ import { defineVariants } from '@svelte-atoms/core/utils';
490
+
491
+ // Extend preset variants with local additions
492
+ const extendedVariants = defineVariants({
493
+ variants: {
494
+ variant: {
495
+ // Add new variants not in preset
496
+ gradient: {
497
+ class: 'bg-gradient-to-r from-purple-500 to-pink-500 text-white'
498
+ },
499
+ neon: {
500
+ class: 'bg-black text-green-400 border-2 border-green-400'
501
+ }
502
+ },
503
+ // Add new variant dimension
504
+ animated: {
505
+ true: 'animate-pulse',
506
+ false: ''
507
+ }
508
+ },
509
+ defaults: {
510
+ animated: false
511
+ }
512
+ });
513
+
514
+ let { variant, size, animated, ...props } = $props();
515
+ </script>
516
+
517
+ <HtmlAtom
518
+ preset="button"
519
+ variants={extendedVariants}
520
+ as="button"
521
+ {variant}
522
+ {size}
523
+ {animated}
524
+ {...props}
525
+ >
526
+ {@render children?.()}
527
+ </HtmlAtom>
528
+ ```
529
+
530
+ #### Bond-Reactive Variants
531
+
532
+ Variants can react to component state through the Bond pattern:
533
+
534
+ ```typescript
535
+ const accordionVariants = defineVariants({
536
+ class: 'border rounded-md transition-all',
537
+ variants: {
538
+ state: {
539
+ open: (bond) => ({
540
+ class: bond?.state?.isOpen ? 'bg-blue-50 border-blue-200' : 'bg-white',
541
+ 'aria-expanded': bond?.state?.isOpen,
542
+ 'data-state': bond?.state?.isOpen ? 'open' : 'closed'
543
+ })
544
+ }
545
+ }
546
+ });
547
+
548
+ // Usage with bond
549
+ const bond = AccordionBond.get();
550
+ const variantProps = $derived(accordionVariants(bond, { state: 'open' }));
551
+ ```
552
+
553
+ **Variant Features:**
554
+
555
+ - βœ… **Type Safety** - Automatic TypeScript inference
556
+ - βœ… **Compound Variants** - Apply styles when multiple conditions match
557
+ - βœ… **Default Values** - Specify fallback variant values
558
+ - βœ… **Bond Integration** - Access component state for reactive styling
559
+ - βœ… **Return Attributes** - Not just classes, any HTML attributes
560
+ - βœ… **Extensible** - Combine global presets with local variants
561
+
562
+ ---
563
+
564
+ ## πŸ“– Documentation
565
+
566
+ ### Component Examples
567
+
568
+ #### Dropdown with Multiple Selection
569
+
570
+ ```svelte
571
+ <script lang="ts">
572
+ import { Dropdown } from '@svelte-atoms/core';
573
+
574
+ let selectedValues = ['option1'];
575
+ const options = [
576
+ { value: 'option1', label: 'Option 1' },
577
+ { value: 'option2', label: 'Option 2' },
578
+ { value: 'option3', label: 'Option 3' }
579
+ ];
580
+ </script>
581
+
582
+ <Dropdown.Root multiple bind:values={selectedValues}>
583
+ <!-- Access internal bond -->
584
+ {#snippet children({ dropdown })}
585
+ <Dropdown.Trigger>
586
+ Select options ({selectedValues.length} selected)
587
+ </Dropdown.Trigger>
588
+
589
+ <Dropdown.Content>
590
+ {#each options as option}
591
+ <Dropdown.Item value={option.value}>
592
+ {option.label}
593
+ </Dropdown.Item>
594
+ {/each}
595
+ </Dropdown.Content>
596
+ {/snippet}
597
+ </Dropdown.Root>
598
+ ```
599
+
600
+ #### Form with Validation
601
+
602
+ ```svelte
603
+ <script lang="ts">
604
+ import { Form, Input, Button } from '@svelte-atoms/core';
605
+ import { z } from 'zod';
606
+
607
+ const schema = z.object({
608
+ email: z.string().email('Invalid email address'),
609
+ password: z.string().min(8, 'Password must be at least 8 characters')
610
+ });
611
+
612
+ let formData = { email: '', password: '' };
613
+ let errors = {};
614
+ </script>
615
+
616
+ <Form {schema} bind:value={formData} bind:errors>
617
+ <Field name="email">
618
+ <Field.Label>Email</Field.Label>
619
+ <Field.Control>
620
+ <Input.Root type="email" placeholder="Enter your email" bind:value={formData.email} />
621
+ </Field.Control>
622
+ {#if errors.email}
623
+ <Form.Error>{errors.email}</Form.Error>
624
+ {/if}
625
+ </.Field>
626
+
627
+ <Field name="password">
628
+ <Field.Label>Password</Field.Label>
629
+ <Field.Control>
630
+ <Input.Root
631
+ type="password"
632
+ placeholder="Enter your password"
633
+ bind:value={formData.password}
634
+ />
635
+ </Field.Control>
636
+ {#if errors.password}
637
+ <Field.Error>{errors.password}</Field.Error>
638
+ {/if}
639
+ </.Field>
640
+
641
+ <Button type="submit">Submit</Button>
642
+ </Form>
643
+ ```
644
+
645
+ #### Data Grid with Sorting and Selection
646
+
647
+ ```svelte
648
+ <script lang="ts">
649
+ import { DataGrid, Checkbox } from '@svelte-atoms/core';
650
+
651
+ let data = [
652
+ { id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
653
+ { id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User' },
654
+ { id: 3, name: 'Bob Johnson', email: 'bob@example.com', role: 'Editor' }
655
+ ];
656
+
657
+ let selectedRows = [];
658
+ </script>
659
+
660
+ <DataGrid.Root {data} bind:selectedRows multiple>
661
+ <DataGrid.Header>
662
+ <DataGrid.Tr>
663
+ <DataGrid.Th>
664
+ <Checkbox />
665
+ </DataGrid.Th>
666
+ <DataGrid.Th sortable="name">Name</DataGrid.Th>
667
+ <DataGrid.Th sortable="email">Email</DataGrid.Th>
668
+ <DataGrid.Th>Role</DataGrid.Th>
669
+ </DataGrid.Tr>
670
+ </DataGrid.Header>
671
+
672
+ <DataGrid.Body>
673
+ {#each data as row}
674
+ <DataGrid.Tr value={row.id}>
675
+ <DataGrid.Td>
676
+ <Checkbox.Root value={row.id} />
677
+ </DataGrid.Td>
678
+ <DataGrid.Td>{row.name}</DataGrid.Td>
679
+ <DataGrid.Td>{row.email}</DataGrid.Td>
680
+ <DataGrid.Td>{row.role}</DataGrid.Td>
681
+ </DataGrid.Tr>
682
+ {/each}
683
+ </DataGrid.Body>
684
+ </DataGrid.Root>
685
+ ```
686
+
687
+ ---
688
+
689
+ ## 🎨 Styling
690
+
691
+ @svelte-atoms/core is completely headless, giving you full control over styling. Here are some approaches:
692
+
693
+ ### Using Vanilla CSS
694
+
695
+ ```css
696
+ /* Default button styles */
697
+ .btn {
698
+ @apply rounded-md px-4 py-2 font-medium transition-colors;
699
+ }
700
+
701
+ .btn-primary {
702
+ @apply bg-blue-600 text-white hover:bg-blue-700;
703
+ }
704
+
705
+ .btn-secondary {
706
+ @apply bg-gray-200 text-gray-900 hover:bg-gray-300;
707
+ }
708
+ ```
709
+
710
+ ### Using Tailwind CSS
711
+
712
+ ```svelte
713
+ <Button class="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">Styled Button</Button>
714
+ ```
715
+
716
+ ---
717
+
718
+ ## πŸ§ͺ Development
719
+
720
+ ### Setup
721
+
722
+ 1. **Clone the repository:**
723
+
724
+ ```bash
725
+ git clone https://github.com/ryu-man/svelte-atoms.git
726
+ cd svelte-atoms
727
+ ```
728
+
729
+ 2. **Install dependencies:**
730
+
731
+ ```bash
732
+ bun install
733
+ ```
734
+
735
+ 3. **Start development server:**
736
+
737
+ ```bash
738
+ bun dev
739
+ ```
740
+
741
+ 4. **Run Storybook:**
742
+ ```bash
743
+ bun run storybook:dev
744
+ ```
745
+
746
+ ### Building
747
+
748
+ ```bash
749
+ # Build library
750
+ bun run build
751
+
752
+ # Build Storybook
753
+ bun run storybook:build
754
+ ```
755
+
756
+ ---
757
+
758
+ <!-- ## 🀝 Contributing
759
+
760
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. -->
761
+
762
+ <!-- ### Development Workflow
763
+
764
+ 1. Fork the repository
765
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
766
+ 3. Make your changes and add tests
767
+ 4. Run the test suite: `bun test`
768
+ 5. Commit your changes: `git commit -m 'Add amazing feature'`
769
+ 6. Push to the branch: `git push origin feature/amazing-feature`
770
+ 7. Open a Pull Request -->
771
+
772
+ ### Creating New Components
773
+
774
+ When adding new components, follow these guidelines:
775
+
776
+ 1. **Create the bond structure:**
777
+
778
+ ```
779
+ src/lib/atoms/my-component/
780
+ β”œβ”€β”€ bond.svelte.ts # Core bond logic (Bond + BondState classes)
781
+ β”œβ”€β”€ index.ts # Public exports
782
+ β”œβ”€β”€ atoms.ts # Component exports
783
+ β”œβ”€β”€ my-component-root.svelte # Use namespace pattern when building complex component
784
+ β”œβ”€β”€ my-component-content.svelte
785
+ └── README.md # Component documentation
786
+ ```
787
+
788
+ 2. **Implement accessibility features:**
789
+ - ARIA attributes
790
+ - Keyboard navigation
791
+ - Focus management
792
+ - Screen reader support
793
+
794
+ 3. **Add comprehensive tests:**
795
+ - Unit tests for bond logic
796
+ - Component integration tests
797
+ - Accessibility tests
798
+
799
+ 4. **Create Storybook stories:**
800
+ - Basic usage examples
801
+ - Advanced configurations
802
+ - Interactive demos
803
+
804
+ ---
805
+
806
+ ## πŸ“š Resources
807
+
808
+ - **[Documentation](https://svelte-atoms.dev)** - Comprehensive documentation
809
+ - **[Storybook](https://storybook.svelte-atoms.dev/)** - Interactive component documentation
810
+ - **[GitHub](https://github.com/ryu-man/svelte-atoms)** - Source code and issues
811
+ - **[@svelte-atoms/alchemist](../alchimist)** - Data visualization companion library
812
+
813
+ ---
814
+
815
+ ## πŸ—ΊοΈ Roadmap
816
+
817
+ ### v1.0.0 (Current - Alpha)
818
+
819
+ - βœ… Bond architecture with Svelte 5 runes
820
+ - βœ… 35+ essential components
821
+ - βœ… TypeScript support
822
+ - βœ… Accessibility features
823
+ - βœ… Storybook documentation
824
+ - βœ… Standardized context pattern
825
+
826
+ ---
827
+
828
+ ## πŸ“„ License
829
+
830
+ MIT License - see the [LICENSE](LICENSE) file for details.
831
+
832
+ ---
833
+
834
+ ## πŸ™ Acknowledgements
835
+
836
+ - [Svelte](https://svelte.dev/) - The amazing framework that powers this library
837
+ - [Motion](https://motion.dev/) - For handling internal default animations
838
+ - [Floating UI](https://floating-ui.com/) - For advanced positioning logic
839
+ - [Tailwind CSS](https://tailwindcss.com/) - For styling
840
+ - [Storybook](https://storybook.js.org/) - For component documentation and testing
841
+ - [Vitest](https://vitest.dev/) - For fast and reliable testing
842
+ - [Playwright](https://playwright.dev/) - For end-to-end testing
843
+
844
+ ---
845
+
846
+ <div align="center">
847
+ <p>Built with ❀️ by the Svelte Atoms team</p>
848
+ <!-- <p>
849
+ <a href="https://github.com/ryu-man/svelte-atoms">GitHub</a> β€’
850
+ <a href="https://svelte-atoms.dev">Documentation</a> β€’
851
+ <a href="https://storybook.svelte-atoms.dev">Storybook</a>
852
+ </p> -->
853
+ </div>