@softwareone/spi-sv5-library 1.14.1 → 1.14.2

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 (193) hide show
  1. package/README.md +221 -86
  2. package/dist/{Confirmation → components/confirmation}/Confirmation.svelte +1 -1
  3. package/dist/{Controls/AttachFile → components/controls/attach-file}/AttachFile.svelte +2 -2
  4. package/dist/{Controls/AttachFile → components/controls/attach-file}/AttachFile.svelte.d.ts +1 -1
  5. package/dist/{Controls/Input → components/controls/input}/Input.svelte +2 -2
  6. package/dist/{Controls/Input → components/controls/input}/Input.svelte.d.ts +1 -1
  7. package/dist/{Controls/Label → components/controls/label}/Label.svelte +1 -1
  8. package/dist/{Controls/RadioGroup → components/controls/radio-group}/RadioGroup.svelte +2 -2
  9. package/dist/{Controls/RadioGroup → components/controls/radio-group}/RadioGroup.svelte.d.ts +1 -1
  10. package/dist/{Controls/Select → components/controls/select}/Select.svelte +3 -3
  11. package/dist/{Controls/Select → components/controls/select}/Select.svelte.d.ts +2 -2
  12. package/dist/{Controls/TextArea → components/controls/textarea}/TextArea.svelte +2 -2
  13. package/dist/{Controls/TextArea → components/controls/textarea}/TextArea.svelte.d.ts +1 -1
  14. package/dist/{Controls/Toggle → components/controls/toggle}/Toggle.svelte +2 -2
  15. package/dist/{Controls/Toggle → components/controls/toggle}/Toggle.svelte.d.ts +1 -1
  16. package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte +1 -1
  17. package/dist/{ErrorPage → components/error-page}/ErrorPage.svelte +2 -2
  18. package/dist/{Form → components/form}/Form.svelte +2 -2
  19. package/dist/components/form/index.d.ts +5 -0
  20. package/dist/components/form/index.js +4 -0
  21. package/dist/{Header → components/header}/Header.svelte +5 -5
  22. package/dist/{Header → components/header}/Header.svelte.d.ts +2 -2
  23. package/dist/{Header → components/header}/HeaderAccount.svelte +1 -1
  24. package/dist/{Header → components/header}/HeaderAccount.svelte.d.ts +1 -1
  25. package/dist/{HighlightPanel → components/highlight-panel}/HighlightPanel.svelte +1 -1
  26. package/dist/{HighlightPanel → components/highlight-panel}/HighlightPanel.svelte.d.ts +1 -1
  27. package/dist/{HighlightPanel → components/highlight-panel}/types.d.ts +1 -1
  28. package/dist/{Home → components/home}/Home.svelte +1 -1
  29. package/dist/{Home → components/home}/Home.svelte.d.ts +1 -1
  30. package/dist/components/index.d.ts +50 -0
  31. package/dist/components/index.js +39 -0
  32. package/dist/{Menu → components/menu}/MenuItem.svelte +1 -1
  33. package/dist/{Modal → components/modal}/ModalFooter.svelte +1 -1
  34. package/dist/{Processing → components/processing}/Processing.svelte +1 -1
  35. package/dist/{ProgressPage → components/progress-page}/ProgressPage.svelte +1 -1
  36. package/dist/{ProgressWizard → components/progress-wizard}/ProgressWizard.svelte +1 -1
  37. package/dist/{ProgressWizard → components/progress-wizard}/ProgressWizard.svelte.d.ts +1 -1
  38. package/dist/{Switcher → components/switcher}/Switcher.svelte +1 -1
  39. package/dist/{Switcher → components/switcher}/Switcher.svelte.d.ts +1 -1
  40. package/dist/{Table → components/table}/AdvancedFilter.svelte +1 -1
  41. package/dist/{Table → components/table}/Header.svelte +1 -1
  42. package/dist/{Table → components/table}/Pagination.svelte +1 -1
  43. package/dist/{Table → components/table}/Table.svelte +1 -1
  44. package/dist/{Table → components/table}/adapter/index.d.ts +1 -1
  45. package/dist/{Table → components/table}/adapter/index.js +1 -1
  46. package/dist/{Table → components/table}/index.d.ts +5 -4
  47. package/dist/{Tabs → components/tabs}/Tabs.svelte +1 -1
  48. package/dist/{Tabs → components/tabs}/Tabs.svelte.d.ts +1 -1
  49. package/dist/{Toast → components/toast}/state.svelte.d.ts +3 -3
  50. package/dist/{Toast → components/toast}/types.d.ts +1 -1
  51. package/dist/{Waffle → components/waffle}/Waffle.svelte +1 -0
  52. package/dist/index.d.ts +1 -56
  53. package/dist/index.js +1 -53
  54. package/package.json +5 -5
  55. package/dist/Form/index.d.ts +0 -6
  56. package/dist/Form/index.js +0 -11
  57. package/dist/{Accordion → components/accordion}/Accordion.svelte +0 -0
  58. package/dist/{Accordion → components/accordion}/Accordion.svelte.d.ts +0 -0
  59. package/dist/{Announcement → components/announcement}/Announcement.svelte +0 -0
  60. package/dist/{Announcement → components/announcement}/Announcement.svelte.d.ts +0 -0
  61. package/dist/{Announcement → components/announcement}/types.d.ts +0 -0
  62. package/dist/{Announcement → components/announcement}/types.js +0 -0
  63. package/dist/{Avatar → components/avatar}/Avatar.svelte +0 -0
  64. package/dist/{Avatar → components/avatar}/Avatar.svelte.d.ts +0 -0
  65. package/dist/{Button → components/button}/Button.svelte +0 -0
  66. package/dist/{Button → components/button}/Button.svelte.d.ts +0 -0
  67. package/dist/{Card → components/card}/Card.svelte +0 -0
  68. package/dist/{Card → components/card}/Card.svelte.d.ts +0 -0
  69. package/dist/{Chips → components/chips}/Chips.svelte +0 -0
  70. package/dist/{Chips → components/chips}/Chips.svelte.d.ts +0 -0
  71. package/dist/{Chips → components/chips}/enums.d.ts +0 -0
  72. package/dist/{Chips → components/chips}/enums.js +0 -0
  73. package/dist/{Confirmation → components/confirmation}/Confirmation.svelte.d.ts +0 -0
  74. package/dist/{Controls/AttachFile → components/controls/attach-file}/FileManager.svelte +0 -0
  75. package/dist/{Controls/AttachFile → components/controls/attach-file}/FileManager.svelte.d.ts +0 -0
  76. package/dist/{Controls/AttachFile → components/controls/attach-file}/Warnings.svelte +0 -0
  77. package/dist/{Controls/AttachFile → components/controls/attach-file}/Warnings.svelte.d.ts +0 -0
  78. package/dist/{Controls/Input → components/controls/input}/InputIcon.svelte +0 -0
  79. package/dist/{Controls/Input → components/controls/input}/InputIcon.svelte.d.ts +0 -0
  80. package/dist/{Controls/Label → components/controls/label}/Label.svelte.d.ts +0 -0
  81. package/dist/{Controls/Label → components/controls/label}/types.d.ts +0 -0
  82. package/dist/{Controls/Label → components/controls/label}/types.js +0 -0
  83. package/dist/{Controls/RadioGroup → components/controls/radio-group}/types.d.ts +0 -0
  84. package/dist/{Controls/RadioGroup → components/controls/radio-group}/types.js +0 -0
  85. package/dist/{Controls/Select → components/controls/select}/types.d.ts +0 -0
  86. package/dist/{Controls/Select → components/controls/select}/types.js +0 -0
  87. package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte.d.ts +0 -0
  88. package/dist/{ErrorPage → components/error-page}/ErrorPage.svelte.d.ts +0 -0
  89. package/dist/{Footer → components/footer}/Footer.svelte +0 -0
  90. package/dist/{Footer → components/footer}/Footer.svelte.d.ts +0 -0
  91. package/dist/{Form → components/form}/Form.svelte.d.ts +0 -0
  92. package/dist/{Form → components/form}/context.d.ts +0 -0
  93. package/dist/{Form → components/form}/context.js +0 -0
  94. package/dist/{Form → components/form}/types.d.ts +0 -0
  95. package/dist/{Form → components/form}/types.js +0 -0
  96. package/dist/{Form/helper.d.ts → components/form/utils.d.ts} +0 -0
  97. package/dist/{Form/helper.js → components/form/utils.js} +0 -0
  98. package/dist/{Form → components/form}/zod-validations.d.ts +0 -0
  99. package/dist/{Form → components/form}/zod-validations.js +0 -0
  100. package/dist/{Header → components/header}/HeaderLoader.svelte +0 -0
  101. package/dist/{Header → components/header}/HeaderLoader.svelte.d.ts +0 -0
  102. package/dist/{Header → components/header}/HeaderLogo.svelte +0 -0
  103. package/dist/{Header → components/header}/HeaderLogo.svelte.d.ts +0 -0
  104. package/dist/{HighlightPanel → components/highlight-panel}/enums.d.ts +0 -0
  105. package/dist/{HighlightPanel → components/highlight-panel}/enums.js +0 -0
  106. package/dist/{HighlightPanel → components/highlight-panel}/types.js +0 -0
  107. package/dist/{Link → components/link}/Link.svelte +0 -0
  108. package/dist/{Link → components/link}/Link.svelte.d.ts +0 -0
  109. package/dist/{Menu → components/menu}/Menu.svelte +0 -0
  110. package/dist/{Menu → components/menu}/Menu.svelte.d.ts +0 -0
  111. package/dist/{Menu → components/menu}/MenuItem.svelte.d.ts +0 -0
  112. package/dist/{Menu → components/menu}/Sidebar.svelte +0 -0
  113. package/dist/{Menu → components/menu}/Sidebar.svelte.d.ts +0 -0
  114. package/dist/{Menu → components/menu}/types.d.ts +0 -0
  115. package/dist/{Menu → components/menu}/types.js +0 -0
  116. package/dist/{Menu → components/menu}/utils.d.ts +0 -0
  117. package/dist/{Menu → components/menu}/utils.js +0 -0
  118. package/dist/{Modal → components/modal}/Modal.svelte +0 -0
  119. package/dist/{Modal → components/modal}/Modal.svelte.d.ts +0 -0
  120. package/dist/{Modal → components/modal}/ModalContent.svelte +0 -0
  121. package/dist/{Modal → components/modal}/ModalContent.svelte.d.ts +0 -0
  122. package/dist/{Modal → components/modal}/ModalFooter.svelte.d.ts +0 -0
  123. package/dist/{Modal → components/modal}/ModalHeader.svelte +0 -0
  124. package/dist/{Modal → components/modal}/ModalHeader.svelte.d.ts +0 -0
  125. package/dist/{Modal → components/modal}/types.d.ts +0 -0
  126. package/dist/{Modal → components/modal}/types.js +0 -0
  127. package/dist/{Notification → components/notification}/Notification.svelte +0 -0
  128. package/dist/{Notification → components/notification}/Notification.svelte.d.ts +0 -0
  129. package/dist/{Processing → components/processing}/Processing.svelte.d.ts +0 -0
  130. package/dist/{ProgressPage → components/progress-page}/ProgressPage.svelte.d.ts +0 -0
  131. package/dist/{ProgressWizard → components/progress-wizard}/context.d.ts +0 -0
  132. package/dist/{ProgressWizard → components/progress-wizard}/context.js +0 -0
  133. package/dist/{ProgressWizard → components/progress-wizard}/types.d.ts +0 -0
  134. package/dist/{ProgressWizard → components/progress-wizard}/types.js +0 -0
  135. package/dist/{ProgressWizard → components/progress-wizard}/utils.d.ts +0 -0
  136. package/dist/{ProgressWizard → components/progress-wizard}/utils.js +0 -0
  137. package/dist/{Search → components/search}/Search.svelte +0 -0
  138. package/dist/{Search → components/search}/Search.svelte.d.ts +0 -0
  139. package/dist/{Spinner → components/spinner}/Spinner.svelte +0 -0
  140. package/dist/{Spinner → components/spinner}/Spinner.svelte.d.ts +0 -0
  141. package/dist/{Switcher → components/switcher}/types.d.ts +0 -0
  142. package/dist/{Switcher → components/switcher}/types.js +0 -0
  143. package/dist/{Table → components/table}/ActionsColumn.svelte +0 -0
  144. package/dist/{Table → components/table}/ActionsColumn.svelte.d.ts +0 -0
  145. package/dist/{Table → components/table}/AdvancedFilter.svelte.d.ts +0 -0
  146. package/dist/{Table → components/table}/Body.svelte +0 -0
  147. package/dist/{Table → components/table}/Body.svelte.d.ts +0 -0
  148. package/dist/{Table → components/table}/ColumnVisibilityDropdown.svelte +0 -0
  149. package/dist/{Table → components/table}/ColumnVisibilityDropdown.svelte.d.ts +0 -0
  150. package/dist/{Table → components/table}/Footer.svelte +0 -0
  151. package/dist/{Table → components/table}/Footer.svelte.d.ts +0 -0
  152. package/dist/{Table → components/table}/Header.svelte.d.ts +0 -0
  153. package/dist/{Table → components/table}/PageSize.svelte +0 -0
  154. package/dist/{Table → components/table}/PageSize.svelte.d.ts +0 -0
  155. package/dist/{Table → components/table}/Pagination.svelte.d.ts +0 -0
  156. package/dist/{Table → components/table}/RowCheckBox.svelte +0 -0
  157. package/dist/{Table → components/table}/RowCheckBox.svelte.d.ts +0 -0
  158. package/dist/{Table → components/table}/Skeleton.svelte +0 -0
  159. package/dist/{Table → components/table}/Skeleton.svelte.d.ts +0 -0
  160. package/dist/{Table → components/table}/Table.svelte.d.ts +0 -0
  161. package/dist/{Table → components/table}/adapter/flex-render.svelte +0 -0
  162. package/dist/{Table → components/table}/adapter/flex-render.svelte.d.ts +0 -0
  163. package/dist/{Table → components/table}/adapter/render-component.d.ts +0 -0
  164. package/dist/{Table → components/table}/adapter/render-component.js +0 -0
  165. package/dist/{Table → components/table}/adapter/table.svelte.d.ts +0 -0
  166. package/dist/{Table → components/table}/adapter/table.svelte.js +0 -0
  167. package/dist/{Table → components/table}/consts.d.ts +0 -0
  168. package/dist/{Table → components/table}/consts.js +0 -0
  169. package/dist/{Table → components/table}/context.d.ts +0 -0
  170. package/dist/{Table → components/table}/context.js +0 -0
  171. package/dist/{Table → components/table}/excel-setting.d.ts +0 -0
  172. package/dist/{Table → components/table}/excel-setting.js +0 -0
  173. package/dist/{Table → components/table}/excel.d.ts +0 -0
  174. package/dist/{Table → components/table}/excel.js +0 -0
  175. package/dist/{Table → components/table}/index.js +3 -3
  176. /package/dist/{Table → components/table}/tanstack-types.d.ts +0 -0
  177. /package/dist/{Table → components/table}/types.d.ts +0 -0
  178. /package/dist/{Table → components/table}/types.js +0 -0
  179. /package/dist/{Table → components/table}/utils.d.ts +0 -0
  180. /package/dist/{Table → components/table}/utils.js +0 -0
  181. /package/dist/{Tabs → components/tabs}/types.d.ts +0 -0
  182. /package/dist/{Tabs → components/tabs}/types.js +0 -0
  183. /package/dist/{Toast → components/toast}/Toast.svelte +0 -0
  184. /package/dist/{Toast → components/toast}/Toast.svelte.d.ts +0 -0
  185. /package/dist/{Toast → components/toast}/state.svelte.js +0 -0
  186. /package/dist/{Toast → components/toast}/types.js +0 -0
  187. /package/dist/{Tooltip → components/tooltip}/Tooltip.svelte +0 -0
  188. /package/dist/{Tooltip → components/tooltip}/Tooltip.svelte.d.ts +0 -0
  189. /package/dist/{Waffle → components/waffle}/Waffle.svelte.d.ts +0 -0
  190. /package/dist/{Waffle → components/waffle}/WaffleItems.svelte +0 -0
  191. /package/dist/{Waffle → components/waffle}/WaffleItems.svelte.d.ts +0 -0
  192. /package/dist/{Waffle → components/waffle}/types.d.ts +0 -0
  193. /package/dist/{Waffle → components/waffle}/types.js +0 -0
package/README.md CHANGED
@@ -1,97 +1,232 @@
1
- # SoftwareOne SPI Component Library for Svelte
1
+ # @softwareone/spi-sv5-library
2
2
 
3
- This library provides a set of reusable components to help you build modern web applications with Svelte 5 (Runes) and SvelteKit 2. Each component is designed to be easily customizable and integrate seamlessly with your Svelte projects.
3
+ SoftwareOne's Svelte 5 UI component library a collection of accessible, composable components for building modern web applications with Svelte 5 (runes) and SvelteKit 2.
4
4
 
5
- ## Installation
5
+ [![npm version](https://img.shields.io/npm/v/@softwareone/spi-sv5-library)](https://www.npmjs.com/package/@softwareone/spi-sv5-library)
6
+ [![license](https://img.shields.io/npm/l/@softwareone/spi-sv5-library)](LICENSE)
7
+
8
+ ---
9
+
10
+ ## Requirements
11
+
12
+ - **Svelte** `^5.0.0`
13
+ - **Node** `22+`
6
14
 
7
- To install the library, use the following command:
15
+ ---
16
+
17
+ ## Installation
8
18
 
9
19
  ```bash
10
- npm install @softwareone/swo-spi-svelte5-library
20
+ npm install @softwareone/spi-sv5-library
21
+ ```
22
+
23
+ ### Optional peer dependencies
24
+
25
+ Install only what you use:
26
+
27
+ | Peer dependency | Required for |
28
+ | ------------------------------------------------- | ------------------------------------ |
29
+ | `material-icons` + `material-icons-outlined` | Icon rendering across all components |
30
+ | `sveltekit-superforms` + `zod` | `@softwareone/spi-sv5-library/form` |
31
+ | `@tanstack/table-core` + `exceljs` + `file-saver` | `@softwareone/spi-sv5-library/table` |
32
+
33
+ ---
34
+
35
+ ## Quick start
36
+
37
+ ```svelte
38
+ <script lang="ts">
39
+ import { Button, Modal } from '@softwareone/spi-sv5-library';
40
+
41
+ let showModal = $state(false);
42
+ </script>
43
+
44
+ <Button onclick={() => (showModal = true)}>Open modal</Button>
45
+
46
+ <Modal bind:showModal title="Hello">
47
+ <p>Modal content goes here.</p>
48
+ </Modal>
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Components
54
+
55
+ ### Layout & Navigation
56
+
57
+ | Component | Description |
58
+ | ---------- | ----------------------------------------------------------------------------------- |
59
+ | `Header` | Full application bar with built-in menu, account, loader, waffle, and announcements |
60
+ | `Footer` | Application footer |
61
+ | `Sidebar` | Collapsible navigation sidebar |
62
+ | `Tabs` | Tabbed content navigation |
63
+ | `Switcher` | Segmented option switcher |
64
+
65
+ ### Feedback & Overlays
66
+
67
+ | Component | Description |
68
+ | ------------------------- | ----------------------------------------------- |
69
+ | `Modal` | Dialog overlay with header, content, and footer |
70
+ | `ConfirmationModal` | Pre-built confirmation dialog |
71
+ | `DeleteConfirmationModal` | Pre-built delete confirmation dialog |
72
+ | `Toast` | Toast notification system |
73
+ | `Notification` | Inline alert/notification banner |
74
+ | `Spinner` | Loading spinner |
75
+ | `Processing` | Full-screen processing overlay |
76
+ | `Tooltip` | Hover tooltip |
77
+
78
+ ### Data Display
79
+
80
+ | Component | Description |
81
+ | ---------------- | --------------------------------------------- |
82
+ | `Card` | Content container with optional header/footer |
83
+ | `Accordion` | Collapsible content sections |
84
+ | `HighlightPanel` | Key-value panel with configurable columns |
85
+ | `Chips` | Tag / badge chips |
86
+ | `Avatar` | User avatar — image or initials fallback |
87
+ | `ProgressWizard` | Multi-step wizard with step validation |
88
+ | `ProgressPage` | Linear step-by-step progress page |
89
+
90
+ ### Forms & Controls
91
+
92
+ | Component | Description |
93
+ | ------------ | -------------------------- |
94
+ | `Input` | Text input |
95
+ | `TextArea` | Multi-line text input |
96
+ | `Select` | Dropdown select |
97
+ | `RadioGroup` | Radio button group |
98
+ | `Toggle` | On/off toggle switch |
99
+ | `AttachFile` | File attachment picker |
100
+ | `Label` | Form label |
101
+ | `Search` | Search input with debounce |
102
+
103
+ ### General
104
+
105
+ | Component | Description |
106
+ | ----------- | ----------------------- |
107
+ | `Button` | Action button |
108
+ | `Link` | Styled anchor |
109
+ | `Home` | Application home layout |
110
+ | `ErrorPage` | Error state page |
111
+
112
+ ---
113
+
114
+ ## Sub-packages
115
+
116
+ ### Form components
117
+
118
+ Integrates with [`sveltekit-superforms`](https://superforms.rocks/) and [`zod`](https://zod.dev/).
119
+
120
+ ```ts
121
+ import { ... } from '@softwareone/spi-sv5-library/form';
122
+ ```
123
+
124
+ ### Table component
125
+
126
+ Advanced data table built on [`@tanstack/table-core`](https://tanstack.com/table) with sorting, filtering, pagination, column visibility, and Excel export.
127
+
128
+ ```ts
129
+ import { ... } from '@softwareone/spi-sv5-library/table';
130
+ ```
131
+
132
+ ---
133
+
134
+ ## API reference
135
+
136
+ ### Header
137
+
138
+ ```svelte
139
+ <Header
140
+ title="My App"
141
+ homeUrl="/"
142
+ accountName="Contoso"
143
+ accountDescription="Microsoft Partner"
144
+ userName="John Doe"
145
+ {menuItems}
146
+ {waffleItems}
147
+ {profileMenuItems}
148
+ {announcementItems}
149
+ onreadannouncementitems={() => {}}
150
+ />
151
+ ```
152
+
153
+ ### Button
154
+
155
+ ```svelte
156
+ <Button
157
+ variant="primary" <!-- 'primary' | 'secondary' | 'outline' | 'outline-none' -->
158
+ variantColor="primary" <!-- 'primary' | 'danger' -->
159
+ >
160
+ Label
161
+ </Button>
11
162
  ```
12
163
 
13
- ## Usage
14
-
15
- Import the components you need into your Svelte application:
16
-
17
- ```javascript
18
- import {
19
- Avatar,
20
- Button,
21
- Card,
22
- Chips,
23
- ErrorPage,
24
- Footer,
25
- Header,
26
- HeaderAccount,
27
- HeaderLoader,
28
- HeaderLogo,
29
- HighlightPanel,
30
- Input,
31
- Menu,
32
- Modal,
33
- ProgressWizard,
34
- Sidebar,
35
- Tabs,
36
- TextArea,
37
- Toaster,
38
- Toggle,
39
- Tooltip
40
- } from '@softwareone/swo-spi-svelte5-library';
164
+ ### Modal
165
+
166
+ ```svelte
167
+ <script lang="ts">
168
+ let showModal = $state(false);
169
+ </script>
170
+
171
+ <Modal
172
+ bind:showModal
173
+ title="Confirm action"
174
+ width="xs" <!-- 'xs' | 'md' | 'lg' | 'xl' -->
175
+ >
176
+ <p>Body content.</p>
177
+
178
+ {#snippet footer()}
179
+ <Button onclick={() => (showModal = false)}>Close</Button>
180
+ {/snippet}
181
+ </Modal>
41
182
  ```
42
183
 
43
- Import the types you need into your Svelte application:
44
-
45
- ```javascript
46
- import {
47
- type HighlightPanelColumn,
48
- type MenuItem,
49
- type ModalProps,
50
- type ProgressWizardStep,
51
- type Tab,
52
- type Toast
53
- } from '@softwareone/swo-spi-svelte5-library';
184
+ ### Tabs
185
+
186
+ ```svelte
187
+ <script lang="ts">
188
+ import type { Tab } from '@softwareone/spi-sv5-library';
189
+ const tabs: Tab[] = [
190
+ { index: 0, label: 'Overview' },
191
+ { index: 1, label: 'Settings' }
192
+ ];
193
+ let active = $state(0);
194
+ </script>
195
+
196
+ <Tabs {tabs} bind:activeTab={active} onchange={(i) => console.log(i)} />
54
197
  ```
55
198
 
56
- # List of components
57
-
58
- - Avatar
59
- - Button
60
- - Card
61
- - Chips
62
- - ErrorPage
63
- - Footer
64
- - Form
65
- - Input
66
- - TextArea
67
- - Toggle
68
- - Header (including a loader)
69
- - HeaderAccount
70
- - HeaderLoader
71
- - HeaderLogo
72
- - HighlightPanel
73
- - Menu
74
- - Sidebar
75
- - Modal
76
- - ProgressWizard
77
- - Spinner
78
- - Tabs
79
- - Toaster
80
- - Tooltip
81
-
82
- # List of types per component
83
-
84
- - Chips
85
- - ChipType
86
- - HighlightPanel
87
- - ColumnType
88
- - HighlightPanelColumn
89
- - ImageType
90
- - Menu
91
- - MenuItem
92
- - Modal
93
- - ModalProps
94
- - ProgressWizard
95
- - ProgressWizardStep
96
- - Tab
97
- - Toast
199
+ ---
200
+
201
+ ## Exported types
202
+
203
+ ```ts
204
+ import type {
205
+ AnnouncementItem,
206
+ HighlightPanelColumn,
207
+ HomeItem,
208
+ MainMenu,
209
+ MenuItem,
210
+ SubMenuItem,
211
+ ModalProps,
212
+ ProgressWizardStep,
213
+ RadioOption,
214
+ SelectOption,
215
+ SwitcherOption,
216
+ Tab,
217
+ ToastNotification,
218
+ WaffleItem
219
+ } from '@softwareone/spi-sv5-library';
220
+ ```
221
+
222
+ ## Exported enums
223
+
224
+ ```ts
225
+ import { ChipType, ColumnType, ImageType } from '@softwareone/spi-sv5-library';
226
+ ```
227
+
228
+ ---
229
+
230
+ ## License
231
+
232
+ MIT © SoftwareOne
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Button, Modal, Spinner, addToast } from '../index.js';
2
+ import { Button, Modal, Spinner, addToast } from '../../index.js';
3
3
 
4
4
  interface Props {
5
5
  title: string;
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
2
  import type { Attachment } from 'svelte/attachments';
3
3
 
4
- import type { LabelProps } from '../Label/types.js';
5
- import { Label, Notification } from '../../index.js';
4
+ import { Label, Notification } from '../../../index.js';
5
+ import type { LabelProps } from '../label/types.js';
6
6
  import FileManager from './FileManager.svelte';
7
7
  import Warnings from './Warnings.svelte';
8
8
 
@@ -1,4 +1,4 @@
1
- import type { LabelProps } from '../Label/types.js';
1
+ import type { LabelProps } from '../label/types.js';
2
2
  interface Props extends LabelProps {
3
3
  accept?: string;
4
4
  multiple?: boolean;
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLInputAttributes } from 'svelte/elements';
3
3
 
4
- import Label from '../Label/Label.svelte';
5
- import type { LabelProps } from '../Label/types.js';
4
+ import Label from '../label/Label.svelte';
5
+ import type { LabelProps } from '../label/types.js';
6
6
  import InputIcon from './InputIcon.svelte';
7
7
 
8
8
  type InputType = 'text' | 'password' | 'number' | 'date' | 'money';
@@ -1,5 +1,5 @@
1
1
  import type { HTMLInputAttributes } from 'svelte/elements';
2
- import type { LabelProps } from '../Label/types.js';
2
+ import type { LabelProps } from '../label/types.js';
3
3
  type InputType = 'text' | 'password' | 'number' | 'date' | 'money';
4
4
  interface Props extends Omit<HTMLInputAttributes, 'type' | 'value'>, LabelProps {
5
5
  type?: InputType;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Tooltip } from '../../index.js';
2
+ import { Tooltip } from '../../../index.js';
3
3
  import type { LabelProps } from './types.js';
4
4
 
5
5
  let { label, id, required, optional, infoTooltip }: LabelProps = $props();
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import Label from '../Label/Label.svelte';
3
- import type { LabelProps } from '../Label/types.js';
2
+ import Label from '../label/Label.svelte';
3
+ import type { LabelProps } from '../label/types.js';
4
4
  import type { OptionValueType, RadioOption } from './types.js';
5
5
 
6
6
  interface Props extends LabelProps {
@@ -1,4 +1,4 @@
1
- import type { LabelProps } from '../Label/types.js';
1
+ import type { LabelProps } from '../label/types.js';
2
2
  import type { OptionValueType, RadioOption } from './types.js';
3
3
  interface Props extends LabelProps {
4
4
  options: string[] | RadioOption[];
@@ -3,9 +3,9 @@
3
3
  import type { Action } from 'svelte/action';
4
4
  import type { Attachment } from 'svelte/attachments';
5
5
 
6
- import { Search, type SelectOption } from '../../index.js';
7
- import Label from '../Label/Label.svelte';
8
- import type { LabelProps } from '../Label/types.js';
6
+ import { Search, type SelectOption } from '../../../index.js';
7
+ import Label from '../label/Label.svelte';
8
+ import type { LabelProps } from '../label/types.js';
9
9
 
10
10
  interface Props extends LabelProps {
11
11
  options: string[] | SelectOption[];
@@ -1,6 +1,6 @@
1
1
  import { type Snippet } from 'svelte';
2
- import { type SelectOption } from '../../index.js';
3
- import type { LabelProps } from '../Label/types.js';
2
+ import { type SelectOption } from '../../../index.js';
3
+ import type { LabelProps } from '../label/types.js';
4
4
  interface Props extends LabelProps {
5
5
  options: string[] | SelectOption[];
6
6
  placeholder?: string;
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLTextareaAttributes } from 'svelte/elements';
3
3
 
4
- import Label from '../Label/Label.svelte';
5
- import type { LabelProps } from '../Label/types.js';
4
+ import Label from '../label/Label.svelte';
5
+ import type { LabelProps } from '../label/types.js';
6
6
 
7
7
  interface Props extends Omit<HTMLTextareaAttributes, 'value'>, LabelProps {
8
8
  value?: string | null;
@@ -1,5 +1,5 @@
1
1
  import type { HTMLTextareaAttributes } from 'svelte/elements';
2
- import type { LabelProps } from '../Label/types.js';
2
+ import type { LabelProps } from '../label/types.js';
3
3
  interface Props extends Omit<HTMLTextareaAttributes, 'value'>, LabelProps {
4
4
  value?: string | null;
5
5
  error?: string | string[];
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import Label from '../Label/Label.svelte';
3
- import type { LabelProps } from '../Label/types.js';
2
+ import Label from '../label/Label.svelte';
3
+ import type { LabelProps } from '../label/types.js';
4
4
 
5
5
  interface Props extends Pick<LabelProps, 'id' | 'label' | 'infoTooltip'> {
6
6
  checked?: boolean;
@@ -1,4 +1,4 @@
1
- import type { LabelProps } from '../Label/types.js';
1
+ import type { LabelProps } from '../label/types.js';
2
2
  interface Props extends Pick<LabelProps, 'id' | 'label' | 'infoTooltip'> {
3
3
  checked?: boolean;
4
4
  disabled?: boolean;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Button, Input, Modal, Spinner, addToast } from '../index.js';
2
+ import { Button, Input, Modal, Spinner, addToast } from '../../index.js';
3
3
 
4
4
  interface Props {
5
5
  confirmationName?: string;
@@ -2,8 +2,8 @@
2
2
  import { goto } from '$app/navigation';
3
3
  import { page } from '$app/state';
4
4
 
5
- import FeedbackIcon from '../assets/icons/feedback.svg';
6
- import { Button } from '../index.js';
5
+ import FeedbackIcon from '../../assets/icons/feedback.svg';
6
+ import { Button } from '../../index.js';
7
7
 
8
8
  interface Props {
9
9
  status: number;
@@ -10,9 +10,9 @@
10
10
  } from 'sveltekit-superforms/client';
11
11
  import { z } from 'zod';
12
12
 
13
- import { addToast, Spinner } from '../index.js';
13
+ import { addToast, Spinner } from '../../index.js';
14
14
  import { getFormContext } from './context.js';
15
- import { isEqual } from './helper.js';
15
+ import { isEqual } from './utils.js';
16
16
  import type { FormError } from './types.js';
17
17
 
18
18
  type Schema = z.infer<typeof schema>;
@@ -0,0 +1,5 @@
1
+ export { default as Form } from './Form.svelte';
2
+ export { getFormContext, setFormContext } from './context.js';
3
+ export { validateSchema } from './utils.js';
4
+ export { createZodString } from './zod-validations.js';
5
+ export type { FormContext, FormError } from './types.js';
@@ -0,0 +1,4 @@
1
+ export { default as Form } from './Form.svelte';
2
+ export { getFormContext, setFormContext } from './context.js';
3
+ export { validateSchema } from './utils.js';
4
+ export { createZodString } from './zod-validations.js';
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
- import type { AnnouncementItem, MenuItem } from '../index.js';
3
- import Announcement from '../Announcement/Announcement.svelte';
4
- import Menu from '../Menu/Menu.svelte';
5
- import Waffle from '../Waffle/Waffle.svelte';
6
- import type { WaffleItem } from '../Waffle/types.js';
2
+ import type { AnnouncementItem, MenuItem } from '../../index.js';
3
+ import Announcement from '../announcement/Announcement.svelte';
4
+ import Menu from '../menu/Menu.svelte';
5
+ import Waffle from '../waffle/Waffle.svelte';
6
+ import type { WaffleItem } from '../waffle/types.js';
7
7
  import HeaderAccount from './HeaderAccount.svelte';
8
8
  import HeaderLoader from './HeaderLoader.svelte';
9
9
  import HeaderLogo from './HeaderLogo.svelte';
@@ -1,5 +1,5 @@
1
- import type { AnnouncementItem, MenuItem } from '../index.js';
2
- import type { WaffleItem } from '../Waffle/types.js';
1
+ import type { AnnouncementItem, MenuItem } from '../../index.js';
2
+ import type { WaffleItem } from '../waffle/types.js';
3
3
  interface Props {
4
4
  title?: string;
5
5
  homeUrl?: string;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { goto } from '$app/navigation';
3
- import { Avatar, type MenuItem } from '../index.js';
3
+ import { Avatar, type MenuItem } from '../../index.js';
4
4
  import { fade } from 'svelte/transition';
5
5
 
6
6
  interface Props {
@@ -1,4 +1,4 @@
1
- import { type MenuItem } from '../index.js';
1
+ import { type MenuItem } from '../../index.js';
2
2
  interface Props {
3
3
  userName: string;
4
4
  accountName?: string;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
- import { Avatar, Chips, ColumnType, ImageType, type HighlightPanelColumn } from '../index.js';
4
+ import { Avatar, Chips, ColumnType, ImageType, type HighlightPanelColumn } from '../../index.js';
5
5
 
6
6
  interface Props {
7
7
  columns: HighlightPanelColumn[];
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from 'svelte';
2
- import { type HighlightPanelColumn } from '../index.js';
2
+ import { type HighlightPanelColumn } from '../../index.js';
3
3
  interface Props {
4
4
  columns: HighlightPanelColumn[];
5
5
  buttonSection?: Snippet;
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { ChipType } from '../index.js';
2
+ import type { ChipType } from '../../index.js';
3
3
  import type { ColumnType, ImageType } from './enums.js';
4
4
  type BaseColumn = {
5
5
  label: string;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { HomeItem } from '../index.js';
2
+ import type { HomeItem } from '../../index.js';
3
3
 
4
4
  interface Props {
5
5
  title: string;
@@ -1,4 +1,4 @@
1
- import type { HomeItem } from '../index.js';
1
+ import type { HomeItem } from '../../index.js';
2
2
  interface Props {
3
3
  title: string;
4
4
  homeItems: HomeItem[];
@@ -0,0 +1,50 @@
1
+ export { default as Accordion } from './accordion/Accordion.svelte';
2
+ export { default as Avatar } from './avatar/Avatar.svelte';
3
+ export { default as Button } from './button/Button.svelte';
4
+ export { default as Card } from './card/Card.svelte';
5
+ export { default as Chips } from './chips/Chips.svelte';
6
+ export { default as ConfirmationModal } from './confirmation/Confirmation.svelte';
7
+ export { default as AttachFile } from './controls/attach-file/AttachFile.svelte';
8
+ export { default as Input } from './controls/input/Input.svelte';
9
+ export { default as Label } from './controls/label/Label.svelte';
10
+ export { default as RadioGroup } from './controls/radio-group/RadioGroup.svelte';
11
+ export { default as Select } from './controls/select/Select.svelte';
12
+ export { default as TextArea } from './controls/textarea/TextArea.svelte';
13
+ export { default as Toggle } from './controls/toggle/Toggle.svelte';
14
+ export { default as DeleteConfirmationModal } from './delete-confirmation/DeleteConfirmation.svelte';
15
+ export { default as ErrorPage } from './error-page/ErrorPage.svelte';
16
+ export { default as Footer } from './footer/Footer.svelte';
17
+ export { default as Header } from './header/Header.svelte';
18
+ export { default as HighlightPanel } from './highlight-panel/HighlightPanel.svelte';
19
+ export { default as Home } from './home/Home.svelte';
20
+ export { default as Link } from './link/Link.svelte';
21
+ export { default as Sidebar } from './menu/Sidebar.svelte';
22
+ export { default as Modal } from './modal/Modal.svelte';
23
+ export { default as Notification } from './notification/Notification.svelte';
24
+ export { default as Processing } from './processing/Processing.svelte';
25
+ export { default as ProgressPage } from './progress-page/ProgressPage.svelte';
26
+ export { default as ProgressWizard } from './progress-wizard/ProgressWizard.svelte';
27
+ export { default as Search } from './search/Search.svelte';
28
+ export { default as Spinner } from './spinner/Spinner.svelte';
29
+ export { default as Switcher } from './switcher/Switcher.svelte';
30
+ export { default as Tabs } from './tabs/Tabs.svelte';
31
+ export { default as Toast } from './toast/Toast.svelte';
32
+ export { default as Tooltip } from './tooltip/Tooltip.svelte';
33
+ export { ChipType } from './chips/enums.js';
34
+ export { ColumnType, ImageType } from './highlight-panel/enums.js';
35
+ export { getSubMenuItemsFromMenu } from './menu/utils.js';
36
+ export { getProgressWizardContext, setProgressWizardStepsContext } from './progress-wizard/context.js';
37
+ export { setStepValidity } from './progress-wizard/utils.js';
38
+ export { createTabComponent } from './tabs/types.js';
39
+ export { addToast } from './toast/state.svelte.js';
40
+ export type { AnnouncementItem } from './announcement/types.js';
41
+ export type { RadioOption } from './controls/radio-group/types.js';
42
+ export type { SelectOption } from './controls/select/types.js';
43
+ export type { HighlightPanelColumn } from './highlight-panel/types.js';
44
+ export type { HomeItem, MainMenu, MenuItem, SubMenuItem } from './menu/types.js';
45
+ export type { ModalProps } from './modal/types.js';
46
+ export type { ProgressWizardStep } from './progress-wizard/types.js';
47
+ export type { SwitcherOption } from './switcher/types.js';
48
+ export type { Tab } from './tabs/types.js';
49
+ export type { ToastNotification } from './toast/types.js';
50
+ export type { WaffleItem } from './waffle/types.js';