@softwareone/spi-sv5-library 1.14.1 → 1.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +221 -86
- package/dist/{Confirmation → components/confirmation}/Confirmation.svelte +5 -5
- package/dist/{Confirmation → components/confirmation}/Confirmation.svelte.d.ts +2 -2
- package/dist/{Controls/AttachFile → components/controls/attach-file}/AttachFile.svelte +2 -2
- package/dist/{Controls/AttachFile → components/controls/attach-file}/AttachFile.svelte.d.ts +1 -1
- package/dist/{Controls/Input → components/controls/input}/Input.svelte +2 -2
- package/dist/{Controls/Input → components/controls/input}/Input.svelte.d.ts +1 -1
- package/dist/{Controls/Label → components/controls/label}/Label.svelte +1 -1
- package/dist/{Controls/RadioGroup → components/controls/radio-group}/RadioGroup.svelte +2 -2
- package/dist/{Controls/RadioGroup → components/controls/radio-group}/RadioGroup.svelte.d.ts +1 -1
- package/dist/{Controls/Select → components/controls/select}/Select.svelte +3 -3
- package/dist/{Controls/Select → components/controls/select}/Select.svelte.d.ts +2 -2
- package/dist/{Controls/TextArea → components/controls/textarea}/TextArea.svelte +2 -2
- package/dist/{Controls/TextArea → components/controls/textarea}/TextArea.svelte.d.ts +1 -1
- package/dist/{Controls/Toggle → components/controls/toggle}/Toggle.svelte +2 -2
- package/dist/{Controls/Toggle → components/controls/toggle}/Toggle.svelte.d.ts +1 -1
- package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte +5 -5
- package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte.d.ts +2 -2
- package/dist/{ErrorPage → components/error-page}/ErrorPage.svelte +2 -2
- package/dist/{Form → components/form}/Form.svelte +2 -2
- package/dist/components/form/index.d.ts +5 -0
- package/dist/components/form/index.js +4 -0
- package/dist/{Header → components/header}/Header.svelte +5 -5
- package/dist/{Header → components/header}/Header.svelte.d.ts +2 -2
- package/dist/{Header → components/header}/HeaderAccount.svelte +1 -1
- package/dist/{Header → components/header}/HeaderAccount.svelte.d.ts +1 -1
- package/dist/{HighlightPanel → components/highlight-panel}/HighlightPanel.svelte +1 -1
- package/dist/{HighlightPanel → components/highlight-panel}/HighlightPanel.svelte.d.ts +1 -1
- package/dist/{HighlightPanel → components/highlight-panel}/types.d.ts +1 -1
- package/dist/{Home → components/home}/Home.svelte +1 -1
- package/dist/{Home → components/home}/Home.svelte.d.ts +1 -1
- package/dist/components/index.d.ts +50 -0
- package/dist/components/index.js +39 -0
- package/dist/{Menu → components/menu}/MenuItem.svelte +1 -1
- package/dist/{Modal → components/modal}/Modal.svelte +2 -2
- package/dist/{Modal → components/modal}/Modal.svelte.d.ts +1 -1
- package/dist/{Modal → components/modal}/ModalFooter.svelte +1 -1
- package/dist/{Modal → components/modal}/types.d.ts +1 -1
- package/dist/{Processing → components/processing}/Processing.svelte +2 -2
- package/dist/{ProgressPage → components/progress-page}/ProgressPage.svelte +1 -1
- package/dist/{ProgressWizard → components/progress-wizard}/ProgressWizard.svelte +1 -1
- package/dist/{ProgressWizard → components/progress-wizard}/ProgressWizard.svelte.d.ts +1 -1
- package/dist/{Switcher → components/switcher}/Switcher.svelte +1 -1
- package/dist/{Switcher → components/switcher}/Switcher.svelte.d.ts +1 -1
- package/dist/{Table → components/table}/AdvancedFilter.svelte +1 -1
- package/dist/{Table → components/table}/Header.svelte +1 -1
- package/dist/{Table → components/table}/Pagination.svelte +1 -1
- package/dist/{Table → components/table}/Table.svelte +1 -1
- package/dist/{Table → components/table}/adapter/index.d.ts +1 -1
- package/dist/{Table → components/table}/adapter/index.js +1 -1
- package/dist/{Table → components/table}/index.d.ts +5 -4
- package/dist/{Tabs → components/tabs}/Tabs.svelte +1 -1
- package/dist/{Tabs → components/tabs}/Tabs.svelte.d.ts +1 -1
- package/dist/{Toast → components/toast}/state.svelte.d.ts +3 -3
- package/dist/{Toast → components/toast}/types.d.ts +1 -1
- package/dist/{Waffle → components/waffle}/Waffle.svelte +1 -0
- package/dist/index.d.ts +1 -56
- package/dist/index.js +1 -53
- package/package.json +5 -5
- package/dist/Form/index.d.ts +0 -6
- package/dist/Form/index.js +0 -11
- package/dist/{Accordion → components/accordion}/Accordion.svelte +0 -0
- package/dist/{Accordion → components/accordion}/Accordion.svelte.d.ts +0 -0
- package/dist/{Announcement → components/announcement}/Announcement.svelte +0 -0
- package/dist/{Announcement → components/announcement}/Announcement.svelte.d.ts +0 -0
- package/dist/{Announcement → components/announcement}/types.d.ts +0 -0
- package/dist/{Announcement → components/announcement}/types.js +0 -0
- package/dist/{Avatar → components/avatar}/Avatar.svelte +0 -0
- package/dist/{Avatar → components/avatar}/Avatar.svelte.d.ts +0 -0
- package/dist/{Button → components/button}/Button.svelte +0 -0
- package/dist/{Button → components/button}/Button.svelte.d.ts +0 -0
- package/dist/{Card → components/card}/Card.svelte +0 -0
- package/dist/{Card → components/card}/Card.svelte.d.ts +0 -0
- package/dist/{Chips → components/chips}/Chips.svelte +0 -0
- package/dist/{Chips → components/chips}/Chips.svelte.d.ts +0 -0
- package/dist/{Chips → components/chips}/enums.d.ts +0 -0
- package/dist/{Chips → components/chips}/enums.js +0 -0
- package/dist/{Controls/AttachFile → components/controls/attach-file}/FileManager.svelte +0 -0
- package/dist/{Controls/AttachFile → components/controls/attach-file}/FileManager.svelte.d.ts +0 -0
- package/dist/{Controls/AttachFile → components/controls/attach-file}/Warnings.svelte +0 -0
- package/dist/{Controls/AttachFile → components/controls/attach-file}/Warnings.svelte.d.ts +0 -0
- package/dist/{Controls/Input → components/controls/input}/InputIcon.svelte +0 -0
- package/dist/{Controls/Input → components/controls/input}/InputIcon.svelte.d.ts +0 -0
- package/dist/{Controls/Label → components/controls/label}/Label.svelte.d.ts +0 -0
- package/dist/{Controls/Label → components/controls/label}/types.d.ts +0 -0
- package/dist/{Controls/Label → components/controls/label}/types.js +0 -0
- package/dist/{Controls/RadioGroup → components/controls/radio-group}/types.d.ts +0 -0
- package/dist/{Controls/RadioGroup → components/controls/radio-group}/types.js +0 -0
- package/dist/{Controls/Select → components/controls/select}/types.d.ts +0 -0
- package/dist/{Controls/Select → components/controls/select}/types.js +0 -0
- package/dist/{ErrorPage → components/error-page}/ErrorPage.svelte.d.ts +0 -0
- package/dist/{Footer → components/footer}/Footer.svelte +0 -0
- package/dist/{Footer → components/footer}/Footer.svelte.d.ts +0 -0
- package/dist/{Form → components/form}/Form.svelte.d.ts +0 -0
- package/dist/{Form → components/form}/context.d.ts +0 -0
- package/dist/{Form → components/form}/context.js +0 -0
- package/dist/{Form → components/form}/types.d.ts +0 -0
- package/dist/{Form → components/form}/types.js +0 -0
- package/dist/{Form/helper.d.ts → components/form/utils.d.ts} +0 -0
- package/dist/{Form/helper.js → components/form/utils.js} +0 -0
- package/dist/{Form → components/form}/zod-validations.d.ts +0 -0
- package/dist/{Form → components/form}/zod-validations.js +0 -0
- package/dist/{Header → components/header}/HeaderLoader.svelte +0 -0
- package/dist/{Header → components/header}/HeaderLoader.svelte.d.ts +0 -0
- package/dist/{Header → components/header}/HeaderLogo.svelte +0 -0
- package/dist/{Header → components/header}/HeaderLogo.svelte.d.ts +0 -0
- package/dist/{HighlightPanel → components/highlight-panel}/enums.d.ts +0 -0
- package/dist/{HighlightPanel → components/highlight-panel}/enums.js +0 -0
- package/dist/{HighlightPanel → components/highlight-panel}/types.js +0 -0
- package/dist/{Link → components/link}/Link.svelte +0 -0
- package/dist/{Link → components/link}/Link.svelte.d.ts +0 -0
- package/dist/{Menu → components/menu}/Menu.svelte +0 -0
- package/dist/{Menu → components/menu}/Menu.svelte.d.ts +0 -0
- package/dist/{Menu → components/menu}/MenuItem.svelte.d.ts +0 -0
- package/dist/{Menu → components/menu}/Sidebar.svelte +0 -0
- package/dist/{Menu → components/menu}/Sidebar.svelte.d.ts +0 -0
- package/dist/{Menu → components/menu}/types.d.ts +0 -0
- package/dist/{Menu → components/menu}/types.js +0 -0
- package/dist/{Menu → components/menu}/utils.d.ts +0 -0
- package/dist/{Menu → components/menu}/utils.js +0 -0
- package/dist/{Modal → components/modal}/ModalContent.svelte +0 -0
- package/dist/{Modal → components/modal}/ModalContent.svelte.d.ts +0 -0
- package/dist/{Modal → components/modal}/ModalFooter.svelte.d.ts +0 -0
- package/dist/{Modal → components/modal}/ModalHeader.svelte +0 -0
- package/dist/{Modal → components/modal}/ModalHeader.svelte.d.ts +0 -0
- package/dist/{Modal → components/modal}/types.js +0 -0
- package/dist/{Notification → components/notification}/Notification.svelte +0 -0
- package/dist/{Notification → components/notification}/Notification.svelte.d.ts +0 -0
- package/dist/{Processing → components/processing}/Processing.svelte.d.ts +0 -0
- package/dist/{ProgressPage → components/progress-page}/ProgressPage.svelte.d.ts +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/context.d.ts +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/context.js +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/types.d.ts +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/types.js +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/utils.d.ts +0 -0
- package/dist/{ProgressWizard → components/progress-wizard}/utils.js +0 -0
- package/dist/{Search → components/search}/Search.svelte +0 -0
- package/dist/{Search → components/search}/Search.svelte.d.ts +0 -0
- package/dist/{Spinner → components/spinner}/Spinner.svelte +0 -0
- package/dist/{Spinner → components/spinner}/Spinner.svelte.d.ts +0 -0
- package/dist/{Switcher → components/switcher}/types.d.ts +0 -0
- package/dist/{Switcher → components/switcher}/types.js +0 -0
- package/dist/{Table → components/table}/ActionsColumn.svelte +0 -0
- package/dist/{Table → components/table}/ActionsColumn.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/AdvancedFilter.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Body.svelte +0 -0
- package/dist/{Table → components/table}/Body.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/ColumnVisibilityDropdown.svelte +0 -0
- package/dist/{Table → components/table}/ColumnVisibilityDropdown.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Footer.svelte +0 -0
- package/dist/{Table → components/table}/Footer.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Header.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/PageSize.svelte +0 -0
- package/dist/{Table → components/table}/PageSize.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Pagination.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/RowCheckBox.svelte +0 -0
- package/dist/{Table → components/table}/RowCheckBox.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Skeleton.svelte +0 -0
- package/dist/{Table → components/table}/Skeleton.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/Table.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/adapter/flex-render.svelte +0 -0
- package/dist/{Table → components/table}/adapter/flex-render.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/adapter/render-component.d.ts +0 -0
- package/dist/{Table → components/table}/adapter/render-component.js +0 -0
- package/dist/{Table → components/table}/adapter/table.svelte.d.ts +0 -0
- package/dist/{Table → components/table}/adapter/table.svelte.js +0 -0
- package/dist/{Table → components/table}/consts.d.ts +0 -0
- package/dist/{Table → components/table}/consts.js +0 -0
- package/dist/{Table → components/table}/context.d.ts +0 -0
- package/dist/{Table → components/table}/context.js +0 -0
- package/dist/{Table → components/table}/excel-setting.d.ts +0 -0
- package/dist/{Table → components/table}/excel-setting.js +0 -0
- package/dist/{Table → components/table}/excel.d.ts +0 -0
- package/dist/{Table → components/table}/excel.js +0 -0
- package/dist/{Table → components/table}/index.js +3 -3
- /package/dist/{Table → components/table}/tanstack-types.d.ts +0 -0
- /package/dist/{Table → components/table}/types.d.ts +0 -0
- /package/dist/{Table → components/table}/types.js +0 -0
- /package/dist/{Table → components/table}/utils.d.ts +0 -0
- /package/dist/{Table → components/table}/utils.js +0 -0
- /package/dist/{Tabs → components/tabs}/types.d.ts +0 -0
- /package/dist/{Tabs → components/tabs}/types.js +0 -0
- /package/dist/{Toast → components/toast}/Toast.svelte +0 -0
- /package/dist/{Toast → components/toast}/Toast.svelte.d.ts +0 -0
- /package/dist/{Toast → components/toast}/state.svelte.js +0 -0
- /package/dist/{Toast → components/toast}/types.js +0 -0
- /package/dist/{Tooltip → components/tooltip}/Tooltip.svelte +0 -0
- /package/dist/{Tooltip → components/tooltip}/Tooltip.svelte.d.ts +0 -0
- /package/dist/{Waffle → components/waffle}/Waffle.svelte.d.ts +0 -0
- /package/dist/{Waffle → components/waffle}/WaffleItems.svelte +0 -0
- /package/dist/{Waffle → components/waffle}/WaffleItems.svelte.d.ts +0 -0
- /package/dist/{Waffle → components/waffle}/types.d.ts +0 -0
- /package/dist/{Waffle → components/waffle}/types.js +0 -0
package/README.md
CHANGED
|
@@ -1,97 +1,232 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @softwareone/spi-sv5-library
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@softwareone/spi-sv5-library)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- **Svelte** `^5.0.0`
|
|
13
|
+
- **Node** `22+`
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
8
18
|
|
|
9
19
|
```bash
|
|
10
|
-
npm install @softwareone/
|
|
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:show={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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:show={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
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
type
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- 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,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Button, Modal, Spinner, addToast } from '
|
|
2
|
+
import { Button, Modal, Spinner, addToast } from '../../index.js';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
title: string;
|
|
6
6
|
confirmationText: string;
|
|
7
7
|
confirmButtonText?: string;
|
|
8
|
-
|
|
8
|
+
show?: boolean;
|
|
9
9
|
onconfirm: () => Promise<string | void> | string | void;
|
|
10
10
|
onclose?: VoidFunction;
|
|
11
11
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
title,
|
|
15
15
|
confirmationText,
|
|
16
16
|
confirmButtonText = 'Proceed',
|
|
17
|
-
|
|
17
|
+
show = $bindable(false),
|
|
18
18
|
onconfirm,
|
|
19
19
|
onclose
|
|
20
20
|
}: Props = $props();
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
const error = await onconfirm();
|
|
28
28
|
if (error === undefined) {
|
|
29
|
-
|
|
29
|
+
show = false;
|
|
30
30
|
} else {
|
|
31
31
|
addToast({ message: error, type: 'danger' });
|
|
32
32
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
};
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
|
-
<Modal {title} bind:
|
|
38
|
+
<Modal {title} bind:show {onclose}>
|
|
39
39
|
<Spinner show={isLoading} />
|
|
40
40
|
<p>{confirmationText}</p>
|
|
41
41
|
{#snippet footer()}
|
|
@@ -2,10 +2,10 @@ interface Props {
|
|
|
2
2
|
title: string;
|
|
3
3
|
confirmationText: string;
|
|
4
4
|
confirmButtonText?: string;
|
|
5
|
-
|
|
5
|
+
show?: boolean;
|
|
6
6
|
onconfirm: () => Promise<string | void> | string | void;
|
|
7
7
|
onclose?: VoidFunction;
|
|
8
8
|
}
|
|
9
|
-
declare const Confirmation: import("svelte").Component<Props, {}, "
|
|
9
|
+
declare const Confirmation: import("svelte").Component<Props, {}, "show">;
|
|
10
10
|
type Confirmation = ReturnType<typeof Confirmation>;
|
|
11
11
|
export default Confirmation;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Attachment } from 'svelte/attachments';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
|
|
4
|
-
import Label from '../
|
|
5
|
-
import type { LabelProps } from '../
|
|
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 '../
|
|
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,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Label from '../
|
|
3
|
-
import type { LabelProps } from '../
|
|
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 {
|
|
@@ -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 '
|
|
7
|
-
import Label from '../
|
|
8
|
-
import type { LabelProps } from '../
|
|
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 '
|
|
3
|
-
import type { LabelProps } from '../
|
|
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 '../
|
|
5
|
-
import type { LabelProps } from '../
|
|
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 '../
|
|
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 '../
|
|
3
|
-
import type { LabelProps } from '../
|
|
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;
|
package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Button, Input, Modal, Spinner, addToast } from '
|
|
2
|
+
import { Button, Input, Modal, Spinner, addToast } from '../../index.js';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
confirmationName?: string;
|
|
6
6
|
enableDoubleConfirmation?: boolean;
|
|
7
|
-
|
|
7
|
+
show?: boolean;
|
|
8
8
|
ondelete: () => Promise<string | void> | string | void;
|
|
9
9
|
onclose?: VoidFunction;
|
|
10
10
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
let {
|
|
13
13
|
confirmationName = '',
|
|
14
14
|
enableDoubleConfirmation = false,
|
|
15
|
-
|
|
15
|
+
show = $bindable(false),
|
|
16
16
|
ondelete,
|
|
17
17
|
onclose
|
|
18
18
|
}: Props = $props();
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
const error = await ondelete();
|
|
31
31
|
if (error === undefined) {
|
|
32
|
-
|
|
32
|
+
show = false;
|
|
33
33
|
} else {
|
|
34
34
|
addToast({ message: error, type: 'danger' });
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
};
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
|
-
<Modal title="Delete confirmation" bind:
|
|
41
|
+
<Modal title="Delete confirmation" bind:show {onclose}>
|
|
42
42
|
<Spinner show={isLoading} />
|
|
43
43
|
<div class="content">
|
|
44
44
|
<p>{confirmationText}</p>
|
package/dist/{DeleteConfirmation → components/delete-confirmation}/DeleteConfirmation.svelte.d.ts
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
confirmationName?: string;
|
|
3
3
|
enableDoubleConfirmation?: boolean;
|
|
4
|
-
|
|
4
|
+
show?: boolean;
|
|
5
5
|
ondelete: () => Promise<string | void> | string | void;
|
|
6
6
|
onclose?: VoidFunction;
|
|
7
7
|
}
|
|
8
|
-
declare const DeleteConfirmation: import("svelte").Component<Props, {}, "
|
|
8
|
+
declare const DeleteConfirmation: import("svelte").Component<Props, {}, "show">;
|
|
9
9
|
type DeleteConfirmation = ReturnType<typeof DeleteConfirmation>;
|
|
10
10
|
export default DeleteConfirmation;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { page } from '$app/state';
|
|
4
4
|
|
|
5
|
-
import FeedbackIcon from '
|
|
6
|
-
import { Button } from '
|
|
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 '
|
|
13
|
+
import { addToast, Spinner } from '../../index.js';
|
|
14
14
|
import { getFormContext } from './context.js';
|
|
15
|
-
import { isEqual } from './
|
|
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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { AnnouncementItem, MenuItem } from '
|
|
3
|
-
import Announcement from '../
|
|
4
|
-
import Menu from '../
|
|
5
|
-
import Waffle from '../
|
|
6
|
-
import type { WaffleItem } from '../
|
|
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 '
|
|
2
|
-
import type { WaffleItem } from '../
|
|
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,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 '
|
|
4
|
+
import { Avatar, Chips, ColumnType, ImageType, type HighlightPanelColumn } from '../../index.js';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
columns: HighlightPanelColumn[];
|