@iroco/ui 1.10.2 → 1.11.0
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/dist/Steps.stories.svelte +1 -0
- package/dist/svelte-steps/{Alert.svelte → StepIconAlert.svelte} +16 -2
- package/dist/svelte-steps/StepIconAlert.svelte.d.ts +6 -0
- package/dist/svelte-steps/{check.svelte → StepIconCheck.svelte} +16 -2
- package/dist/svelte-steps/StepIconCheck.svelte.d.ts +6 -0
- package/dist/svelte-steps/Steps.svelte +133 -88
- package/dist/svelte-steps/Steps.svelte.d.ts +94 -0
- package/package.json +3 -4
- package/dist/svelte-steps/Alert.svelte.d.ts +0 -26
- package/dist/svelte-steps/Check.svelte.d.ts +0 -26
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
<!--
|
|
2
|
+
|
|
3
|
+
- 2025-08-14 : Migrate to Svelte 5 syntax
|
|
4
|
+
- 2025-08-14 : Rename from Alter to StepIconAlert
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2025, Iroco. All rights reserved.
|
|
7
|
+
Use of this source code is governed by a BSD-style license that can be found
|
|
8
|
+
in the LICENSE file.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
2
12
|
Copyright (c) 2021, Jingshao Chen. All rights reserved.
|
|
3
13
|
Use of this source code is governed by a BSD-style license that can be found
|
|
4
14
|
in the LICENSE file.
|
|
5
15
|
|
|
6
16
|
https://github.com/shaozi/svelte-steps
|
|
7
17
|
-->
|
|
8
|
-
<script>
|
|
9
|
-
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
interface Props {
|
|
20
|
+
stroke?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let { stroke = 'currentColor' }: Props = $props();
|
|
10
24
|
</script>
|
|
11
25
|
|
|
12
26
|
<svg
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
<!--
|
|
2
|
+
|
|
3
|
+
- 2025-08-14 : Migrate to Svelte 5 syntax
|
|
4
|
+
- 2025-08-14 : Rename from Check to StepIconCheck
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2025, Iroco. All rights reserved.
|
|
7
|
+
Use of this source code is governed by a BSD-style license that can be found
|
|
8
|
+
in the LICENSE file.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
2
12
|
Copyright (c) 2021, Jingshao Chen. All rights reserved.
|
|
3
13
|
Use of this source code is governed by a BSD-style license that can be found
|
|
4
14
|
in the LICENSE file.
|
|
5
15
|
|
|
6
16
|
https://github.com/shaozi/svelte-steps
|
|
7
17
|
-->
|
|
8
|
-
<script>
|
|
9
|
-
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
interface Props {
|
|
20
|
+
stroke?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let { stroke = 'currentColor' }: Props = $props();
|
|
10
24
|
</script>
|
|
11
25
|
|
|
12
26
|
<svg
|
|
@@ -1,43 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
|
|
3
|
-
@component
|
|
4
|
-
|
|
5
|
-
# svelte-steps
|
|
6
|
-
|
|
7
|
-
## props
|
|
8
|
-
|
|
9
|
-
- `steps`:
|
|
10
|
-
- Array of object. Length has to be more than 1
|
|
11
|
-
- Required
|
|
12
|
-
- Each item is a step object that can have:
|
|
13
|
-
- `text`: The text displayed below each steps.
|
|
14
|
-
- `icon`: A svelte component displayed inside each steps.
|
|
15
|
-
- `iconProps`: An object that will be passed as props to the `icon` component.
|
|
16
|
-
- `current`: current step index. Number. Default `0`
|
|
17
|
-
- `size`: size of the step buttons. String. Default `"3rem"`
|
|
18
|
-
- `line`: thickness of the connecting lines between the step buttons. String. Default `"0.3rem"`
|
|
19
|
-
- `primary`: Primary color of passed and current steps. String. Default `'var(--bs-primary, #3a86ff)'`
|
|
20
|
-
- `secondary`: Secondary color of future steps. String. Default `'var(--bs-secondary, #bbbbc0)'`
|
|
21
|
-
- `light`: Primary color of text color in passed anc current steps. String. Default `'var(--bs-light, white)'`
|
|
22
|
-
- `dark`: Secondary color of text color in future steps. String. Default `'var(--bs-dark, black)'`
|
|
23
|
-
- `borderRadius`: Border radius of the step buttons. String. Default `'50%'` (circle)
|
|
24
|
-
- `fontFamily`: Font family of the component. String. Default `"'Helvetica Neue', Helvetica, Arial, sans-serif"`
|
|
25
|
-
- `vertical`: Vertical steps
|
|
26
|
-
- `reverse`: For horizontal steps, reverse the step from right to the left; for vertical steps, reverse puts text labels to the left. Default `false`
|
|
27
|
-
- `clickable`: When set to `false`, Clicking icons and labels will not change step. You have to change `current` to change step. Default `true`
|
|
28
|
-
- `checkIcon`: User defined check icon for passed steps. If not specified, use the default check mark. Set to `null` if you don't want a check icon.
|
|
29
|
-
- `alertIcon`: User defined alert icon for passed steps that has truthful `alert` property. If not specified, use the default alert icon. Set to `null` if you don't want an alert icon.
|
|
30
|
-
- `alertColor`: User defined bg color for passed steps that has truthful `alert` property. Default 'var(--bs-danger, #dc3545)'
|
|
31
|
-
|
|
32
|
-
## events
|
|
33
|
-
|
|
34
|
-
- `on:click(e)`: click event. Event detail object has two keys:
|
|
35
|
-
- `e.detail.current`: the index of current step
|
|
36
|
-
- `e.detail.last`: the index of last step
|
|
37
|
-
|
|
38
|
-
## Copyright
|
|
39
|
-
|
|
40
3
|
- 2025-08-07 : Use Iroco CSS var for steps label
|
|
4
|
+
- 2025-08-14 : Migrate to Svelte 5 syntax
|
|
5
|
+
- 2025-08-14 : Migrate to Typescript
|
|
41
6
|
|
|
42
7
|
Copyright (c) 2025, Iroco. All rights reserved.
|
|
43
8
|
Use of this source code is governed by a BSD-style license that can be found
|
|
@@ -52,47 +17,95 @@
|
|
|
52
17
|
https://github.com/shaozi/svelte-steps
|
|
53
18
|
|
|
54
19
|
-->
|
|
55
|
-
<script>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { run } from 'svelte/legacy';
|
|
22
|
+
|
|
56
23
|
// A bootstrap step component
|
|
57
24
|
import { tweened } from 'svelte/motion';
|
|
58
25
|
import { cubicOut } from 'svelte/easing';
|
|
59
26
|
|
|
60
27
|
import { createEventDispatcher } from 'svelte';
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
28
|
+
import StepIconCheck from './StepIconCheck.svelte';
|
|
29
|
+
import StepIconAlert from './StepIconAlert.svelte';
|
|
30
|
+
|
|
31
|
+
interface Props {
|
|
32
|
+
/** Accessible name for this component (it has role="progressbar") */
|
|
33
|
+
aria_label: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* - Array of object. Length has to be more than 1
|
|
37
|
+
* - Required
|
|
38
|
+
* - Each item is a step object that can have:
|
|
39
|
+
* - `text`: The text displayed below each steps.
|
|
40
|
+
* - `icon`: A svelte component displayed inside each steps.
|
|
41
|
+
* - `iconProps`: An object that will be passed as props to the `icon` component.
|
|
42
|
+
*/
|
|
43
|
+
steps: { text: string; alert?: boolean; icon?: boolean; iconProps?: any }[];
|
|
44
|
+
/** Current step index. Default `0` */
|
|
45
|
+
current: number;
|
|
46
|
+
/** When set to `false`, Clicking icons and labels will not change step. You have to change `current` to change step. Default `true` */
|
|
47
|
+
clickable: boolean;
|
|
48
|
+
|
|
49
|
+
/** Vertical steps */
|
|
50
|
+
vertical: boolean;
|
|
51
|
+
/** For horizontal steps, reverse the step from right to the left; for vertical steps, reverse puts text labels to the left. Default `false` */
|
|
52
|
+
reverse: boolean;
|
|
53
|
+
|
|
54
|
+
/** size of the step buttons. String. Default `"3rem"` */
|
|
55
|
+
size: string;
|
|
56
|
+
/** thickness of the connecting lines between the step buttons. String. Default `"0.3rem"` */
|
|
57
|
+
line: string;
|
|
58
|
+
/** Primary color of passed and current steps. String. Default `'var(--bs-primary, #3a86ff)'` */
|
|
59
|
+
primary: string;
|
|
60
|
+
/** Secondary color of future steps. String. Default `'var(--bs-secondary, #bbbbc0)'` */
|
|
61
|
+
secondary: string;
|
|
62
|
+
/** Primary color of text color in passed anc current steps. String. Default `'var(--bs-light, white)'` */
|
|
63
|
+
light: string;
|
|
64
|
+
/** Secondary color of text color in future steps. String. Default `'var(--bs-dark, black)'` */
|
|
65
|
+
dark: string;
|
|
66
|
+
/** Border radius of the step buttons. String. Default `'50%'` (circle) */
|
|
67
|
+
borderRadius: string;
|
|
68
|
+
/** Font family of the component. String. Default `"'Helvetica Neue', Helvetica, Arial, sans-serif"` */
|
|
69
|
+
fontFamily: string;
|
|
70
|
+
/** User defined check icon for passed steps. If not specified, use the default check mark. Set to `null` if you don't want a check icon. */
|
|
71
|
+
checkIcon: any;
|
|
72
|
+
/** User defined alert icon for passed steps that has truthful `alert` property. If not specified, use the default alert icon. Set to `null` if you don't want an alert icon. */
|
|
73
|
+
alertIcon: any;
|
|
74
|
+
/** User defined bg color for passed steps that has truthful `alert` property. Default 'var(--bs-danger, #dc3545)' */
|
|
75
|
+
alertColor: string;
|
|
76
|
+
/** Evaluates step test as HTML */
|
|
77
|
+
htmlMode: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** @type {Props} */
|
|
81
|
+
let {
|
|
82
|
+
steps,
|
|
83
|
+
current = $bindable(0),
|
|
84
|
+
vertical = false,
|
|
85
|
+
size = vertical ? '2rem' : '3rem',
|
|
86
|
+
line = $bindable(vertical ? '0.15rem' : '0.3rem'),
|
|
87
|
+
primary = 'var(--bs-primary, #3a86ff)',
|
|
88
|
+
secondary = 'var(--bs-secondary, #bbbbc0)',
|
|
89
|
+
light = 'var(--bs-light, white)',
|
|
90
|
+
dark = 'var(--bs-dark, black)',
|
|
91
|
+
borderRadius = '50%',
|
|
92
|
+
fontFamily = '',
|
|
93
|
+
reverse = false,
|
|
94
|
+
clickable = true,
|
|
95
|
+
checkIcon = StepIconCheck,
|
|
96
|
+
alertIcon = StepIconAlert,
|
|
97
|
+
alertColor = 'var(--bs-danger, #dc3545)',
|
|
98
|
+
htmlMode = false,
|
|
99
|
+
aria_label
|
|
100
|
+
}: Props = $props();
|
|
83
101
|
|
|
84
102
|
const minStepSize = '5rem';
|
|
85
103
|
const stepLabelSpace = '1rem';
|
|
86
104
|
|
|
87
|
-
// for backward compatible when using lineHeight instead of line
|
|
88
|
-
if (lineHeight) {
|
|
89
|
-
line = lineHeight;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
105
|
// each segment is half of the step size
|
|
93
106
|
|
|
94
107
|
// @type { height: number; width: number }[]
|
|
95
|
-
let segmentSizes = [];
|
|
108
|
+
let segmentSizes = $state([]);
|
|
96
109
|
for (let i = 0; i < steps.length; i++) {
|
|
97
110
|
segmentSizes.push({ height: 0, width: 0 });
|
|
98
111
|
}
|
|
@@ -105,7 +118,7 @@
|
|
|
105
118
|
}
|
|
106
119
|
|
|
107
120
|
let progress = tweened(current, { duration: 400, easing: cubicOut });
|
|
108
|
-
let total = 0;
|
|
121
|
+
let total = $state(0);
|
|
109
122
|
let key = vertical ? 'height' : 'width';
|
|
110
123
|
|
|
111
124
|
function f(p /*@type number*/) {
|
|
@@ -125,9 +138,9 @@
|
|
|
125
138
|
return ret;
|
|
126
139
|
}
|
|
127
140
|
|
|
128
|
-
let fill = f(current);
|
|
141
|
+
let fill = $state(f(current));
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
run(() => {
|
|
131
144
|
total = 0;
|
|
132
145
|
if (segmentSizes[0][key] > 0) {
|
|
133
146
|
for (let i = 0; i < steps.length; i++) {
|
|
@@ -136,10 +149,10 @@
|
|
|
136
149
|
total -= (segmentSizes[0][key] + segmentSizes[segmentSizes.length - 1][key]) / 2;
|
|
137
150
|
}
|
|
138
151
|
fill = f($progress);
|
|
139
|
-
}
|
|
140
|
-
|
|
152
|
+
});
|
|
153
|
+
run(() => {
|
|
141
154
|
$progress = current;
|
|
142
|
-
}
|
|
155
|
+
});
|
|
143
156
|
const dispatch = createEventDispatcher();
|
|
144
157
|
let onClick = (i /*: number*/) => {
|
|
145
158
|
if (clickable) {
|
|
@@ -151,6 +164,33 @@
|
|
|
151
164
|
};
|
|
152
165
|
</script>
|
|
153
166
|
|
|
167
|
+
<!--
|
|
168
|
+
|
|
169
|
+
@component
|
|
170
|
+
|
|
171
|
+
A customizable and accessible step component.
|
|
172
|
+
|
|
173
|
+
## Usage
|
|
174
|
+
|
|
175
|
+
```svelte
|
|
176
|
+
<Steps
|
|
177
|
+
aria_label="My steps"
|
|
178
|
+
current={0}
|
|
179
|
+
steps={[
|
|
180
|
+
{test:"Foo"},
|
|
181
|
+
{test:"Bar"},
|
|
182
|
+
{test:"Baz"},
|
|
183
|
+
]}
|
|
184
|
+
/>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Events
|
|
188
|
+
|
|
189
|
+
- `onclick(e)`: click event. Event detail object has two keys:
|
|
190
|
+
- `e.detail.current`: the index of current step
|
|
191
|
+
- `e.detail.last`: the index of last step
|
|
192
|
+
|
|
193
|
+
-->
|
|
154
194
|
<div
|
|
155
195
|
class="steps-container"
|
|
156
196
|
role="progressbar"
|
|
@@ -158,6 +198,7 @@
|
|
|
158
198
|
aria-valuemax={`${(steps?.length ?? 0) + 1}`}
|
|
159
199
|
aria-valuenow={`${(current ?? 0) + 1}`}
|
|
160
200
|
aria-valuetext={`${steps[current]?.text}`}
|
|
201
|
+
aria-label={aria_label}
|
|
161
202
|
style={`--size: ${size};
|
|
162
203
|
--line-thickness: ${line};
|
|
163
204
|
--primary: ${primary};
|
|
@@ -183,7 +224,7 @@
|
|
|
183
224
|
<div
|
|
184
225
|
style:width={vertical ? line : `${segmentSizes[0].width / 2}px`}
|
|
185
226
|
style:height={vertical ? `${segmentSizes[0].height / 2}px` : line}
|
|
186
|
-
|
|
227
|
+
></div>
|
|
187
228
|
<div
|
|
188
229
|
style:width={vertical ? line : `${total}px`}
|
|
189
230
|
style:height={vertical ? `${total}px` : line}
|
|
@@ -195,16 +236,16 @@
|
|
|
195
236
|
class="bg-primary"
|
|
196
237
|
style:width={vertical ? line : `${fill}px`}
|
|
197
238
|
style:height={vertical ? `${fill}px` : line}
|
|
198
|
-
|
|
239
|
+
></div>
|
|
199
240
|
{#if line != size}
|
|
200
241
|
<!-- the progress indicator -->
|
|
201
|
-
<div class="bg-primary" style="width:8px; height:8px; border-radius: 50%;"
|
|
242
|
+
<div class="bg-primary" style="width:8px; height:8px; border-radius: 50%;"></div>
|
|
202
243
|
{/if}
|
|
203
244
|
</div>
|
|
204
245
|
<div
|
|
205
246
|
style:width={vertical ? line : `${segmentSizes[0].width / 2}px`}
|
|
206
247
|
style:height={vertical ? `${segmentSizes[0].height / 2}px` : line}
|
|
207
|
-
|
|
248
|
+
></div>
|
|
208
249
|
</div>
|
|
209
250
|
<!-- progress line end -->
|
|
210
251
|
<div
|
|
@@ -237,7 +278,7 @@
|
|
|
237
278
|
"
|
|
238
279
|
class:hover-highlight={clickable}
|
|
239
280
|
class:shadow={i == current}
|
|
240
|
-
|
|
281
|
+
onclick={() => {
|
|
241
282
|
onClick(i);
|
|
242
283
|
}}
|
|
243
284
|
>
|
|
@@ -245,33 +286,37 @@
|
|
|
245
286
|
{#if i < $progress}
|
|
246
287
|
{#if step.alert}
|
|
247
288
|
{#if alertIcon}
|
|
248
|
-
|
|
289
|
+
{@const SvelteComponent = alertIcon}
|
|
290
|
+
<SvelteComponent />
|
|
249
291
|
{:else if step.iconProps}
|
|
250
|
-
<
|
|
292
|
+
<step.icon {...step.iconProps} />
|
|
251
293
|
{:else}
|
|
252
|
-
<
|
|
294
|
+
<step.icon />
|
|
253
295
|
{/if}
|
|
254
296
|
{:else if checkIcon}
|
|
255
|
-
|
|
297
|
+
{@const SvelteComponent_1 = checkIcon}
|
|
298
|
+
<SvelteComponent_1 />
|
|
256
299
|
{:else if step.iconProps}
|
|
257
|
-
<
|
|
300
|
+
<step.icon {...step.iconProps} />
|
|
258
301
|
{:else}
|
|
259
|
-
<
|
|
302
|
+
<step.icon />
|
|
260
303
|
{/if}
|
|
261
304
|
{:else if step.iconProps}
|
|
262
|
-
<
|
|
305
|
+
<step.icon {...step.iconProps} />
|
|
263
306
|
{:else}
|
|
264
|
-
<
|
|
307
|
+
<step.icon />
|
|
265
308
|
{/if}
|
|
266
309
|
{:else if i < $progress}
|
|
267
310
|
{#if step.alert}
|
|
268
311
|
{#if alertIcon}
|
|
269
|
-
|
|
312
|
+
{@const SvelteComponent_2 = alertIcon}
|
|
313
|
+
<SvelteComponent_2 />
|
|
270
314
|
{:else}
|
|
271
315
|
<span class="steps__number">{i + 1}</span>
|
|
272
316
|
{/if}
|
|
273
317
|
{:else if checkIcon}
|
|
274
|
-
|
|
318
|
+
{@const SvelteComponent_3 = checkIcon}
|
|
319
|
+
<SvelteComponent_3 />
|
|
275
320
|
{:else}
|
|
276
321
|
<span class="steps__number">{i + 1}</span>
|
|
277
322
|
{/if}
|
|
@@ -288,7 +333,7 @@
|
|
|
288
333
|
style:margin-right={vertical ? (reverse ? stepLabelSpace : null) : null}
|
|
289
334
|
style:margin-top={vertical ? null : stepLabelSpace}
|
|
290
335
|
style:text-align={vertical ? (reverse ? 'right' : 'left') : 'center'}
|
|
291
|
-
|
|
336
|
+
onclick={() => {
|
|
292
337
|
onClick(i);
|
|
293
338
|
}}
|
|
294
339
|
>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Accessible name for this component (it has role="progressbar") */
|
|
3
|
+
aria_label: string;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* - Array of object. Length has to be more than 1
|
|
7
|
+
* - Required
|
|
8
|
+
* - Each item is a step object that can have:
|
|
9
|
+
* - `text`: The text displayed below each steps.
|
|
10
|
+
* - `icon`: A svelte component displayed inside each steps.
|
|
11
|
+
* - `iconProps`: An object that will be passed as props to the `icon` component.
|
|
12
|
+
*/
|
|
13
|
+
steps: {
|
|
14
|
+
text: string;
|
|
15
|
+
alert?: boolean;
|
|
16
|
+
icon?: boolean;
|
|
17
|
+
iconProps?: any;
|
|
18
|
+
}[];
|
|
19
|
+
/** Current step index. Default `0` */
|
|
20
|
+
current: number;
|
|
21
|
+
/** When set to `false`, Clicking icons and labels will not change step. You have to change `current` to change step. Default `true` */
|
|
22
|
+
clickable: boolean;
|
|
23
|
+
/** Vertical steps */
|
|
24
|
+
vertical: boolean;
|
|
25
|
+
/** For horizontal steps, reverse the step from right to the left; for vertical steps, reverse puts text labels to the left. Default `false` */
|
|
26
|
+
reverse: boolean;
|
|
27
|
+
/** size of the step buttons. String. Default `"3rem"` */
|
|
28
|
+
size: string;
|
|
29
|
+
/** thickness of the connecting lines between the step buttons. String. Default `"0.3rem"` */
|
|
30
|
+
line: string;
|
|
31
|
+
/** Primary color of passed and current steps. String. Default `'var(--bs-primary, #3a86ff)'` */
|
|
32
|
+
primary: string;
|
|
33
|
+
/** Secondary color of future steps. String. Default `'var(--bs-secondary, #bbbbc0)'` */
|
|
34
|
+
secondary: string;
|
|
35
|
+
/** Primary color of text color in passed anc current steps. String. Default `'var(--bs-light, white)'` */
|
|
36
|
+
light: string;
|
|
37
|
+
/** Secondary color of text color in future steps. String. Default `'var(--bs-dark, black)'` */
|
|
38
|
+
dark: string;
|
|
39
|
+
/** Border radius of the step buttons. String. Default `'50%'` (circle) */
|
|
40
|
+
borderRadius: string;
|
|
41
|
+
/** Font family of the component. String. Default `"'Helvetica Neue', Helvetica, Arial, sans-serif"` */
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
/** User defined check icon for passed steps. If not specified, use the default check mark. Set to `null` if you don't want a check icon. */
|
|
44
|
+
checkIcon: any;
|
|
45
|
+
/** User defined alert icon for passed steps that has truthful `alert` property. If not specified, use the default alert icon. Set to `null` if you don't want an alert icon. */
|
|
46
|
+
alertIcon: any;
|
|
47
|
+
/** User defined bg color for passed steps that has truthful `alert` property. Default 'var(--bs-danger, #dc3545)' */
|
|
48
|
+
alertColor: string;
|
|
49
|
+
/** Evaluates step test as HTML */
|
|
50
|
+
htmlMode: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
53
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
54
|
+
$$bindings?: Bindings;
|
|
55
|
+
} & Exports;
|
|
56
|
+
(internal: unknown, props: Props & {
|
|
57
|
+
$$events?: Events;
|
|
58
|
+
$$slots?: Slots;
|
|
59
|
+
}): Exports & {
|
|
60
|
+
$set?: any;
|
|
61
|
+
$on?: any;
|
|
62
|
+
};
|
|
63
|
+
z_$$bindings?: Bindings;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A customizable and accessible step component.
|
|
67
|
+
*
|
|
68
|
+
* ## Usage
|
|
69
|
+
*
|
|
70
|
+
* ```svelte
|
|
71
|
+
* <Steps
|
|
72
|
+
* aria_label="My steps"
|
|
73
|
+
* current={0}
|
|
74
|
+
* steps={[
|
|
75
|
+
* {test:"Foo"},
|
|
76
|
+
* {test:"Bar"},
|
|
77
|
+
* {test:"Baz"},
|
|
78
|
+
* ]}
|
|
79
|
+
* />
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* ## Events
|
|
83
|
+
*
|
|
84
|
+
* - `onclick(e)`: click event. Event detail object has two keys:
|
|
85
|
+
* - `e.detail.current`: the index of current step
|
|
86
|
+
* - `e.detail.last`: the index of last step
|
|
87
|
+
*/
|
|
88
|
+
declare const Steps: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
89
|
+
click: CustomEvent<any>;
|
|
90
|
+
} & {
|
|
91
|
+
[evt: string]: CustomEvent<any>;
|
|
92
|
+
}, {}, {}, "line" | "current">;
|
|
93
|
+
type Steps = InstanceType<typeof Steps>;
|
|
94
|
+
export default Steps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iroco/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Iroco design system based on Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test:watch": "vitest watch --passWithNoTests",
|
|
10
10
|
"svelte:check": "svelte-check --tsconfig ./tsconfig.json",
|
|
11
11
|
"dev": "storybook dev -p 5175",
|
|
12
|
-
"build": "svelte-package",
|
|
12
|
+
"build": "svelte-package --types",
|
|
13
13
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
14
14
|
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
15
15
|
"lint": "prettier . --check . && eslint .",
|
|
@@ -276,6 +276,5 @@
|
|
|
276
276
|
"./dist/index.d.ts"
|
|
277
277
|
]
|
|
278
278
|
}
|
|
279
|
-
}
|
|
280
|
-
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
279
|
+
}
|
|
281
280
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Alert;
|
|
2
|
-
type Alert = SvelteComponent<{
|
|
3
|
-
stroke?: string | undefined;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Alert: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
stroke?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: Props & {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Check;
|
|
2
|
-
type Check = SvelteComponent<{
|
|
3
|
-
stroke?: string | undefined;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Check: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
stroke?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: Props & {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|