do-ui-design-system 1.0.11 → 1.0.12
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/atoms/Badge/Badge.svelte +47 -36
- package/dist/atoms/Badge/Badge.svelte.d.ts +22 -16
- package/dist/atoms/Badge/Badge.svelte.d.ts.map +1 -1
- package/dist/atoms/Badge/iProps.d.ts +8 -3
- package/dist/atoms/Badge/iProps.d.ts.map +1 -1
- package/dist/atoms/Button/Button.svelte +84 -31
- package/dist/atoms/Button/Button.svelte.d.ts +37 -46
- package/dist/atoms/Button/Button.svelte.d.ts.map +1 -1
- package/dist/atoms/Button/iProps.d.ts +12 -6
- package/dist/atoms/Button/iProps.d.ts.map +1 -1
- package/dist/atoms/Card/Card.svelte +18 -5
- package/dist/atoms/Card/Card.svelte.d.ts +5 -2
- package/dist/atoms/Card/Card.svelte.d.ts.map +1 -1
- package/dist/atoms/Card/iProps.d.ts +1 -0
- package/dist/atoms/Card/iProps.d.ts.map +1 -1
- package/dist/atoms/Chip/Chip.svelte +71 -0
- package/dist/atoms/Chip/Chip.svelte.d.ts +35 -0
- package/dist/atoms/Chip/Chip.svelte.d.ts.map +1 -0
- package/dist/atoms/Chip/iProps.d.ts +12 -0
- package/dist/atoms/Chip/iProps.d.ts.map +1 -0
- package/dist/atoms/Icons/Icon.svelte +44 -14
- package/dist/atoms/Icons/Icon.svelte.d.ts +29 -32
- package/dist/atoms/Icons/Icon.svelte.d.ts.map +1 -1
- package/dist/atoms/Icons/iProps.d.ts +9 -3
- package/dist/atoms/Icons/iProps.d.ts.map +1 -1
- package/dist/atoms/Icons/iProps.js +1 -1
- package/dist/atoms/index.d.ts +6 -5
- package/dist/atoms/index.d.ts.map +1 -1
- package/dist/atoms/index.js +6 -5
- package/dist/do-theme/badge.css +8 -52
- package/dist/do-theme/button.css +13 -0
- package/dist/do-theme/chip.css +67 -0
- package/dist/do-theme/index.css +1 -1
- package/dist/do-theme/var-dark.css +19 -17
- package/dist/do-theme/var-light.css +22 -20
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/molecules/ActionChip/ActionChip.svelte.d.ts +1 -1
- package/dist/molecules/IconButton/IconButton.svelte.d.ts +1 -1
- package/dist/molecules/index.d.ts +1 -2
- package/dist/molecules/index.d.ts.map +1 -1
- package/dist/molecules/index.js +1 -2
- package/package.json +1 -1
- package/dist/atoms/Counter/Counter.svelte +0 -15
- package/dist/atoms/Counter/Counter.svelte.d.ts +0 -29
- package/dist/atoms/Counter/Counter.svelte.d.ts.map +0 -1
- package/dist/atoms/Counter/iProps.d.ts +0 -4
- package/dist/atoms/Counter/iProps.d.ts.map +0 -1
- /package/dist/atoms/{Counter → Chip}/iProps.js +0 -0
|
@@ -1,45 +1,56 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { iProps } from './iProps.ts';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
let {
|
|
5
|
+
label = '10',
|
|
6
|
+
variant = 'do-badge-primary',
|
|
7
|
+
role,
|
|
8
|
+
ariaLabel,
|
|
9
|
+
title,
|
|
10
|
+
tabIndex,
|
|
11
|
+
ariaHidden,
|
|
12
|
+
dataTestId,
|
|
13
|
+
customClass,
|
|
14
|
+
customStyles
|
|
15
|
+
}: {
|
|
16
|
+
label: iProps['label'];
|
|
17
|
+
variant?: iProps['variant'];
|
|
18
|
+
role?: iProps['role'];
|
|
19
|
+
ariaLabel?: iProps['ariaLabel'];
|
|
20
|
+
title?: iProps['title'];
|
|
21
|
+
tabIndex?: iProps['tabIndex'];
|
|
22
|
+
ariaHidden?: iProps['ariaHidden'];
|
|
23
|
+
dataTestId?: iProps['dataTestId'];
|
|
24
|
+
customClass?: iProps['customClass'];
|
|
25
|
+
customStyles?: iProps['customStyles'];
|
|
26
|
+
} = $props();
|
|
18
27
|
</script>
|
|
19
28
|
|
|
20
29
|
<!-- @component Badge
|
|
21
30
|
```Svelte
|
|
22
|
-
<Badge label={label}
|
|
23
|
-
{@render children()} // render custom content inside Badge tags
|
|
24
|
-
</Badge>
|
|
31
|
+
<Badge label={label} variant={variant} role={role} aria-label={ariaLabel} title={title} tabindex={tabIndex} aria-hidden={ariaHidden} data-testid={dataTestId} style={customStyles} class={customClass}/>
|
|
25
32
|
```
|
|
26
|
-
- `label
|
|
27
|
-
- `
|
|
28
|
-
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
31
|
-
|
|
33
|
+
- `label`: string - the text to display in the counter
|
|
34
|
+
- `variant?`: 'do-badge-primary' | 'do-badge-accent'
|
|
35
|
+
- `role?`: 'status' | 'alert' | 'tooltip'
|
|
36
|
+
- `ariaLabel?`: string
|
|
37
|
+
- `title?`: string
|
|
38
|
+
- `tabIndex?`: -1 | 0 | number
|
|
39
|
+
- `ariaHidden?`: boolean
|
|
40
|
+
- `dataTestId?`: string
|
|
41
|
+
- `customClass?`: string
|
|
42
|
+
- `customStyles?`: any CSS style
|
|
32
43
|
-->
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
class={['do-badge', `${variant}`, `${customClass}`].join(' ')}
|
|
47
|
+
style={customStyles}
|
|
48
|
+
{role}
|
|
49
|
+
aria-label={ariaLabel}
|
|
50
|
+
{title}
|
|
51
|
+
{...tabIndex === 0 ? { tabindex: 0 } : {}}
|
|
52
|
+
aria-hidden={ariaHidden}
|
|
53
|
+
data-testid={dataTestId}
|
|
54
|
+
>
|
|
55
|
+
<span>{label}</span>
|
|
45
56
|
</div>
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { iProps } from './iProps.ts';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
label: iProps['label'];
|
|
4
|
+
variant?: iProps['variant'];
|
|
5
|
+
role?: iProps['role'];
|
|
6
|
+
ariaLabel?: iProps['ariaLabel'];
|
|
7
|
+
title?: iProps['title'];
|
|
8
|
+
tabIndex?: iProps['tabIndex'];
|
|
9
|
+
ariaHidden?: iProps['ariaHidden'];
|
|
10
|
+
dataTestId?: iProps['dataTestId'];
|
|
11
|
+
customClass?: iProps['customClass'];
|
|
12
|
+
customStyles?: iProps['customStyles'];
|
|
10
13
|
};
|
|
11
14
|
/**
|
|
12
15
|
* Badge
|
|
13
16
|
* ```Svelte
|
|
14
|
-
* <Badge label={label}
|
|
15
|
-
* {@render children()} // render custom content inside Badge tags
|
|
16
|
-
* </Badge>
|
|
17
|
+
* <Badge label={label} variant={variant} role={role} aria-label={ariaLabel} title={title} tabindex={tabIndex} aria-hidden={ariaHidden} data-testid={dataTestId} style={customStyles} class={customClass}/>
|
|
17
18
|
* ```
|
|
18
|
-
* - `label
|
|
19
|
-
* - `
|
|
20
|
-
*
|
|
21
|
-
* - `
|
|
22
|
-
* - `
|
|
19
|
+
* - `label`: string - the text to display in the counter
|
|
20
|
+
* - `variant?`: 'do-badge-primary' | 'do-badge-accent'
|
|
21
|
+
* - `role?`: 'status' | 'alert' | 'tooltip'
|
|
22
|
+
* - `ariaLabel?`: string
|
|
23
|
+
* - `title?`: string
|
|
24
|
+
* - `tabIndex?`: -1 | 0 | number
|
|
25
|
+
* - `ariaHidden?`: boolean
|
|
26
|
+
* - `dataTestId?`: string
|
|
27
|
+
* - `customClass?`: string
|
|
28
|
+
* - `customStyles?`: any CSS style
|
|
23
29
|
*/
|
|
24
30
|
declare const Badge: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
25
31
|
type Badge = ReturnType<typeof Badge>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Badge/Badge.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Badge/Badge.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,gBAAgB,GAAI;IACxB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;CACtC,CAAC;AA0BH;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,KAAK,sDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export interface iProps {
|
|
2
2
|
label: string;
|
|
3
|
-
|
|
3
|
+
variant?: 'do-badge-primary' | 'do-badge-accent';
|
|
4
|
+
role?: 'status' | 'alert' | 'tooltip';
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
tabIndex?: -1 | 0 | number;
|
|
8
|
+
ariaHidden?: boolean;
|
|
9
|
+
dataTestId?: string;
|
|
4
10
|
customClass?: string;
|
|
5
|
-
|
|
6
|
-
tooltipContent?: string;
|
|
11
|
+
customStyles?: string;
|
|
7
12
|
}
|
|
8
13
|
//# sourceMappingURL=iProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Badge/iProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Badge/iProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1,57 +1,110 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { iProps } from './iProps.ts';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
let {
|
|
6
|
+
label = 'Label',
|
|
7
|
+
type = 'button',
|
|
8
|
+
ariaLabel,
|
|
9
|
+
onClick,
|
|
10
|
+
disabled,
|
|
11
|
+
title,
|
|
12
|
+
ariaDisabled,
|
|
13
|
+
name,
|
|
14
|
+
id,
|
|
15
|
+
variant = 'do-btn-primary',
|
|
16
|
+
size,
|
|
17
|
+
rounded,
|
|
18
|
+
loading,
|
|
19
|
+
circle,
|
|
20
|
+
customStyles,
|
|
21
|
+
customClass,
|
|
22
|
+
square,
|
|
23
|
+
noBorder,
|
|
24
|
+
dataTestId,
|
|
25
|
+
children
|
|
26
|
+
}: {
|
|
27
|
+
label?: iProps['label'];
|
|
28
|
+
type?: iProps['type'];
|
|
29
|
+
ariaLabel: iProps['ariaLabel'];
|
|
30
|
+
onClick: iProps['onClick'];
|
|
31
|
+
disabled?: iProps['disabled'];
|
|
32
|
+
title?: iProps['title'];
|
|
33
|
+
ariaDisabled?: iProps['ariaDisabled'];
|
|
34
|
+
name?: iProps['name'];
|
|
35
|
+
id?: iProps['id'];
|
|
36
|
+
variant?: iProps['variant'];
|
|
37
|
+
size?: iProps['size'];
|
|
38
|
+
rounded?: iProps['rounded'];
|
|
39
|
+
loading?: iProps['loading'];
|
|
40
|
+
circle?: iProps['circle'];
|
|
41
|
+
customStyles?: iProps['customStyles'];
|
|
42
|
+
customClass?: iProps['customClass'];
|
|
43
|
+
square?: iProps['square'];
|
|
44
|
+
noBorder?: iProps['noBorder'];
|
|
45
|
+
dataTestId?: iProps['dataTestId'];
|
|
46
|
+
children?: Snippet;
|
|
47
|
+
} = $props();
|
|
15
48
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
: rounded
|
|
19
|
-
? 'border-radius:3rem;'
|
|
20
|
-
: square
|
|
21
|
-
? 'border-radius:4px; padding: 8px;'
|
|
22
|
-
: '';
|
|
49
|
+
let borderRadius = $state('');
|
|
50
|
+
let mergedStyles = $state('');
|
|
23
51
|
|
|
24
|
-
|
|
52
|
+
$effect(() => {
|
|
53
|
+
borderRadius = circle
|
|
54
|
+
? 'border-radius:24px; padding: 6px; border: none;'
|
|
55
|
+
: rounded
|
|
56
|
+
? 'border-radius:3rem;'
|
|
57
|
+
: square
|
|
58
|
+
? 'border-radius:4px; padding: 8px;'
|
|
59
|
+
: noBorder
|
|
60
|
+
? 'border:none; padding: 8px;'
|
|
61
|
+
: '';
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
$effect(() => {
|
|
65
|
+
mergedStyles = `${borderRadius} ${customStyles}`.trim();
|
|
66
|
+
});
|
|
25
67
|
</script>
|
|
26
68
|
|
|
27
69
|
<!-- @component
|
|
28
70
|
```Svelte
|
|
29
71
|
<Button variant?={variant} size?={size} label?={label} disabled?={disabled} loading?={loading} type?={type}/>
|
|
30
72
|
```
|
|
31
|
-
- `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-link' | 'do-btn-link-accent'
|
|
32
|
-
- `size?`: 'do-btn-sm' | 'do-btn-md' | 'do-btn-lg'
|
|
33
73
|
- `label?`: string
|
|
74
|
+
- `type?`: 'button' | 'submit' | 'reset'
|
|
75
|
+
- `ariaLabel`: string
|
|
76
|
+
- `onClick`: () => void
|
|
34
77
|
- `disabled?`: boolean
|
|
78
|
+
- `title`?: string
|
|
79
|
+
- `ariaDisabled`?: boolean
|
|
80
|
+
- `name`?: string
|
|
81
|
+
- `id`?: string
|
|
82
|
+
- `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-link' | 'do-btn-link-accent' | 'do-btn-ghost'
|
|
83
|
+
- `size?`: 'do-btn-sm' | 'do-btn-md' | 'do-btn-lg'
|
|
35
84
|
- `rounded?`: boolean
|
|
36
85
|
- `loading?`: boolean
|
|
37
|
-
- `type?`: 'button' | 'submit' | 'reset'
|
|
38
|
-
- `circle?`: boolean
|
|
39
|
-
- `type?`: any CSS style
|
|
40
86
|
- `customClass?`: string
|
|
41
87
|
- `customStyles?`: any CSS style
|
|
88
|
+
- `noBorder`?: boolean
|
|
89
|
+
- `dataTestId?`: string
|
|
42
90
|
-->
|
|
43
91
|
|
|
44
92
|
<button
|
|
45
|
-
{...$$restProps}
|
|
46
93
|
{type}
|
|
47
|
-
|
|
48
|
-
|
|
94
|
+
aria-label={ariaLabel}
|
|
95
|
+
onclick={onClick}
|
|
49
96
|
{disabled}
|
|
50
|
-
|
|
97
|
+
{title}
|
|
98
|
+
aria-disabled={ariaDisabled}
|
|
99
|
+
{name}
|
|
100
|
+
{id}
|
|
101
|
+
class={['do-btn', `${variant}`, `${size}`, `${customClass}`].join(' ')}
|
|
102
|
+
style={mergedStyles}
|
|
103
|
+
data-testid={dataTestId}
|
|
51
104
|
>
|
|
52
|
-
|
|
105
|
+
{@render children?.()}
|
|
53
106
|
{#if label}
|
|
54
107
|
<span>{label}</span>
|
|
55
108
|
{/if}
|
|
56
|
-
<i class="icon-loading do-loader" style=
|
|
57
|
-
</button>
|
|
109
|
+
<i class="icon-loading do-loader" style={loading ? 'display:inline-block;' : 'display:none;'}></i>
|
|
110
|
+
</button>
|
|
@@ -1,59 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { iProps } from './iProps.ts';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
label?: iProps['label'];
|
|
5
|
+
type?: iProps['type'];
|
|
6
|
+
ariaLabel: iProps['ariaLabel'];
|
|
7
|
+
onClick: iProps['onClick'];
|
|
8
|
+
disabled?: iProps['disabled'];
|
|
9
|
+
title?: iProps['title'];
|
|
10
|
+
ariaDisabled?: iProps['ariaDisabled'];
|
|
11
|
+
name?: iProps['name'];
|
|
12
|
+
id?: iProps['id'];
|
|
13
|
+
variant?: iProps['variant'];
|
|
14
|
+
size?: iProps['size'];
|
|
15
|
+
rounded?: iProps['rounded'];
|
|
16
|
+
loading?: iProps['loading'];
|
|
17
|
+
circle?: iProps['circle'];
|
|
18
|
+
customStyles?: iProps['customStyles'];
|
|
19
|
+
customClass?: iProps['customClass'];
|
|
20
|
+
square?: iProps['square'];
|
|
21
|
+
noBorder?: iProps['noBorder'];
|
|
22
|
+
dataTestId?: iProps['dataTestId'];
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
};
|
|
19
25
|
/**
|
|
20
26
|
* ```Svelte
|
|
21
27
|
* <Button variant?={variant} size?={size} label?={label} disabled?={disabled} loading?={loading} type?={type}/>
|
|
22
28
|
* ```
|
|
23
|
-
* - `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-link' | 'do-btn-link-accent'
|
|
24
|
-
* - `size?`: 'do-btn-sm' | 'do-btn-md' | 'do-btn-lg'
|
|
25
29
|
* - `label?`: string
|
|
30
|
+
* - `type?`: 'button' | 'submit' | 'reset'
|
|
31
|
+
* - `ariaLabel`: string
|
|
32
|
+
* - `onClick`: () => void
|
|
26
33
|
* - `disabled?`: boolean
|
|
34
|
+
* - `title`?: string
|
|
35
|
+
* - `ariaDisabled`?: boolean
|
|
36
|
+
* - `name`?: string
|
|
37
|
+
* - `id`?: string
|
|
38
|
+
* - `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-link' | 'do-btn-link-accent' | 'do-btn-ghost'
|
|
39
|
+
* - `size?`: 'do-btn-sm' | 'do-btn-md' | 'do-btn-lg'
|
|
27
40
|
* - `rounded?`: boolean
|
|
28
41
|
* - `loading?`: boolean
|
|
29
|
-
* - `type?`: 'button' | 'submit' | 'reset'
|
|
30
|
-
* - `circle?`: boolean
|
|
31
|
-
* - `type?`: any CSS style
|
|
32
42
|
* - `customClass?`: string
|
|
33
43
|
* - `customStyles?`: any CSS style
|
|
44
|
+
* - `noBorder`?: boolean
|
|
45
|
+
* - `dataTestId?`: string
|
|
34
46
|
*/
|
|
35
|
-
declare const Button:
|
|
36
|
-
|
|
37
|
-
variant?: "do-btn-primary" | "do-btn-secondary" | "do-btn-tertiary" | "do-btn-link" | "do-btn-accent" | "do-btn-link-accent" | undefined;
|
|
38
|
-
size?: "do-btn-sm" | "do-btn-md" | "do-btn-lg" | undefined;
|
|
39
|
-
rounded?: boolean | undefined;
|
|
40
|
-
label?: string | undefined;
|
|
41
|
-
disabled?: boolean | undefined;
|
|
42
|
-
loading?: boolean | undefined;
|
|
43
|
-
type?: "submit" | "reset" | "button" | undefined;
|
|
44
|
-
circle?: boolean | undefined;
|
|
45
|
-
customStyles?: string | undefined;
|
|
46
|
-
customClass?: import("svelte/elements").ClassValue | null | undefined;
|
|
47
|
-
square?: boolean | undefined;
|
|
48
|
-
}, {
|
|
49
|
-
default: {};
|
|
50
|
-
}>, {
|
|
51
|
-
click: MouseEvent;
|
|
52
|
-
} & {
|
|
53
|
-
[evt: string]: CustomEvent<any>;
|
|
54
|
-
}, {
|
|
55
|
-
default: {};
|
|
56
|
-
}, {}, string>;
|
|
57
|
-
type Button = InstanceType<typeof Button>;
|
|
47
|
+
declare const Button: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
48
|
+
type Button = ReturnType<typeof Button>;
|
|
58
49
|
export default Button;
|
|
59
50
|
//# sourceMappingURL=Button.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Button/Button.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Button/Button.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,gBAAgB,GAAI;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA4DH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,MAAM,sDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
variant?: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-link' | 'do-btn-accent' | 'do-btn-link-accent';
|
|
1
|
+
export interface iProps {
|
|
2
|
+
label?: string;
|
|
4
3
|
type?: 'button' | 'submit' | 'reset';
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
ariaDisabled?: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
variant?: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-link' | 'do-btn-accent' | 'do-btn-link-accent' | 'do-btn-ghost';
|
|
5
12
|
size?: 'do-btn-sm' | 'do-btn-md' | 'do-btn-lg';
|
|
6
13
|
rounded?: boolean;
|
|
7
|
-
label?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
14
|
loading?: boolean;
|
|
10
|
-
loadingIcon?: undefined;
|
|
11
15
|
circle?: boolean;
|
|
12
16
|
customStyles?: string;
|
|
13
17
|
customClass?: string;
|
|
14
18
|
square?: boolean;
|
|
19
|
+
noBorder?: boolean;
|
|
20
|
+
dataTestId?: string;
|
|
15
21
|
}
|
|
16
22
|
//# sourceMappingURL=iProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Button/iProps.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Button/iProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa,GAAG,eAAe,GAAG,oBAAoB,GAAG,cAAc,CAAC;IAC9I,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { Snippet } from
|
|
3
|
-
import type { iProps } from
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { iProps } from './iProps.ts';
|
|
4
4
|
|
|
5
|
-
let {
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
variant,
|
|
8
|
+
customClass,
|
|
9
|
+
ariaLabel,
|
|
10
|
+
dataTestId
|
|
11
|
+
}: {
|
|
12
|
+
children: Snippet;
|
|
13
|
+
variant: iProps['variant'];
|
|
14
|
+
customClass?: iProps['customClass'];
|
|
15
|
+
ariaLabel?: iProps['ariaLabel'];
|
|
16
|
+
dataTestId?: iProps['dataTestId'];
|
|
17
|
+
} = $props();
|
|
6
18
|
</script>
|
|
7
19
|
|
|
8
20
|
<!-- @component Card
|
|
@@ -13,8 +25,9 @@
|
|
|
13
25
|
```
|
|
14
26
|
- `variant`: 'do-card-primary' | 'do-card-secondary'
|
|
15
27
|
- `customClass?`: string - additional custom class for styling
|
|
28
|
+
- `ariaLabel?`: string
|
|
29
|
+
- `dataTestId?`: string
|
|
16
30
|
-->
|
|
17
|
-
<div
|
|
18
|
-
class="do-card {variant} {customClass}" aria-label={ariaLabel}>
|
|
31
|
+
<div class="do-card {variant} {customClass}" aria-label={ariaLabel} data-testid={dataTestId}>
|
|
19
32
|
{@render children?.()}
|
|
20
33
|
</div>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { iProps } from
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { iProps } from './iProps.ts';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
children: Snippet;
|
|
5
5
|
variant: iProps['variant'];
|
|
6
6
|
customClass?: iProps['customClass'];
|
|
7
7
|
ariaLabel?: iProps['ariaLabel'];
|
|
8
|
+
dataTestId?: iProps['dataTestId'];
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* Card
|
|
@@ -15,6 +16,8 @@ type $$ComponentProps = {
|
|
|
15
16
|
* ```
|
|
16
17
|
* - `variant`: 'do-card-primary' | 'do-card-secondary'
|
|
17
18
|
* - `customClass?`: string - additional custom class for styling
|
|
19
|
+
* - `ariaLabel?`: string
|
|
20
|
+
* - `dataTestId?`: string
|
|
18
21
|
*/
|
|
19
22
|
declare const Card: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
20
23
|
type Card = ReturnType<typeof Card>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Card/Card.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,gBAAgB,GAAI;
|
|
1
|
+
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Card/Card.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;CAClC,CAAC;AAqBH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Card/iProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Card/iProps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { iProps } from './iProps.ts';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
label = 'Label',
|
|
7
|
+
ariaLabel,
|
|
8
|
+
role,
|
|
9
|
+
tabIndex,
|
|
10
|
+
id,
|
|
11
|
+
maxLength = null,
|
|
12
|
+
variant = 'do-chip-primary',
|
|
13
|
+
customClass = '',
|
|
14
|
+
dataTestId,
|
|
15
|
+
children
|
|
16
|
+
}: {
|
|
17
|
+
label?: iProps['label'];
|
|
18
|
+
ariaLabel?: iProps['ariaLabel'];
|
|
19
|
+
role?: iProps['role'];
|
|
20
|
+
tabIndex?: iProps['tabIndex'];
|
|
21
|
+
id?: iProps['id'];
|
|
22
|
+
maxLength?: iProps['maxLength'];
|
|
23
|
+
variant?: iProps['variant'];
|
|
24
|
+
customClass?: iProps['customClass'];
|
|
25
|
+
dataTestId?: iProps['dataTestId'];
|
|
26
|
+
children?: Snippet;
|
|
27
|
+
} = $props();
|
|
28
|
+
|
|
29
|
+
let displayedText: string = $state('');
|
|
30
|
+
let isTruncated: boolean = $state(false);
|
|
31
|
+
|
|
32
|
+
$effect(() => {
|
|
33
|
+
displayedText = maxLength && label.length > maxLength ? label.slice(0, maxLength) + '…' : label;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
$effect(() => {
|
|
37
|
+
isTruncated = (maxLength && label.length > maxLength) || false;
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<!-- @component Chip
|
|
42
|
+
```Svelte
|
|
43
|
+
<Chip label={label} aria-label={ariaLabel} role={role} tabindex={tabIndex} id={id} maxLength={maxLength} variant={variant} customClass={customClass} data-testid={dataTestId}>
|
|
44
|
+
{@render children()} // render custom content inside Chip tags
|
|
45
|
+
</Chip>
|
|
46
|
+
```
|
|
47
|
+
- `label?`: string
|
|
48
|
+
- `ariaLabel?`: string
|
|
49
|
+
- `role?`: 'status' | 'note' | 'button'
|
|
50
|
+
- `tabIndex?`: -1 | 0 | number
|
|
51
|
+
- `id?`: string
|
|
52
|
+
- `maxLength?`: number | null - max length of the text, if exceeded it will be truncated and "…" will be added
|
|
53
|
+
- `variant?`: 'do-chip-primary' | 'do-chip-secondary' | 'do-chip-accent'
|
|
54
|
+
- `customClass?`: string - additional custom class for styling
|
|
55
|
+
- `dataTestId?`: string
|
|
56
|
+
|
|
57
|
+
-->
|
|
58
|
+
<div
|
|
59
|
+
class={`do-chip ${variant} ${customClass}`}
|
|
60
|
+
{...isTruncated ? { title: label } : {}}
|
|
61
|
+
aria-label={ariaLabel}
|
|
62
|
+
{role}
|
|
63
|
+
{...tabIndex === 0 ? { tabindex: 0 } : {}}
|
|
64
|
+
{id}
|
|
65
|
+
data-testid={dataTestId}
|
|
66
|
+
>
|
|
67
|
+
<span>
|
|
68
|
+
{displayedText}
|
|
69
|
+
</span>
|
|
70
|
+
{@render children?.()}
|
|
71
|
+
</div>
|