do-ui-design-system 1.0.10 → 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.
Files changed (65) hide show
  1. package/dist/atoms/Badge/Badge.svelte +47 -29
  2. package/dist/atoms/Badge/Badge.svelte.d.ts +26 -40
  3. package/dist/atoms/Badge/Badge.svelte.d.ts.map +1 -1
  4. package/dist/atoms/Badge/iProps.d.ts +8 -3
  5. package/dist/atoms/Badge/iProps.d.ts.map +1 -1
  6. package/dist/atoms/Button/Button.svelte +84 -31
  7. package/dist/atoms/Button/Button.svelte.d.ts +37 -46
  8. package/dist/atoms/Button/Button.svelte.d.ts.map +1 -1
  9. package/dist/atoms/Button/iProps.d.ts +12 -6
  10. package/dist/atoms/Button/iProps.d.ts.map +1 -1
  11. package/dist/atoms/Card/Card.svelte +33 -0
  12. package/dist/atoms/Card/Card.svelte.d.ts +25 -0
  13. package/dist/atoms/Card/Card.svelte.d.ts.map +1 -0
  14. package/dist/atoms/Card/iProps.d.ts +7 -0
  15. package/dist/atoms/Card/iProps.d.ts.map +1 -0
  16. package/dist/atoms/Chip/Chip.svelte +71 -0
  17. package/dist/atoms/Chip/Chip.svelte.d.ts +35 -0
  18. package/dist/atoms/Chip/Chip.svelte.d.ts.map +1 -0
  19. package/dist/atoms/Chip/iProps.d.ts +12 -0
  20. package/dist/atoms/Chip/iProps.d.ts.map +1 -0
  21. package/dist/atoms/Chip/iProps.js +1 -0
  22. package/dist/atoms/Icons/Icon.svelte +44 -14
  23. package/dist/atoms/Icons/Icon.svelte.d.ts +29 -32
  24. package/dist/atoms/Icons/Icon.svelte.d.ts.map +1 -1
  25. package/dist/atoms/Icons/iProps.d.ts +9 -3
  26. package/dist/atoms/Icons/iProps.d.ts.map +1 -1
  27. package/dist/atoms/Icons/iProps.js +1 -1
  28. package/dist/atoms/Icons/icomoon-1.png +0 -0
  29. package/dist/atoms/Icons/icomoon-2.png +0 -0
  30. package/dist/atoms/Icons/icomoon-3.png +0 -0
  31. package/dist/atoms/index.d.ts +6 -5
  32. package/dist/atoms/index.d.ts.map +1 -1
  33. package/dist/atoms/index.js +6 -5
  34. package/dist/do-theme/badge.css +11 -42
  35. package/dist/do-theme/button.css +13 -0
  36. package/dist/do-theme/card.css +18 -0
  37. package/dist/do-theme/chip.css +67 -0
  38. package/dist/do-theme/font.css +6 -5
  39. package/dist/do-theme/icomoon/backup-icons.json +1 -1
  40. package/dist/do-theme/icomoon/fonts/icomoon.eot +0 -0
  41. package/dist/do-theme/icomoon/fonts/icomoon.svg +1 -0
  42. package/dist/do-theme/icomoon/fonts/icomoon.ttf +0 -0
  43. package/dist/do-theme/icomoon/fonts/icomoon.woff +0 -0
  44. package/dist/do-theme/icomoon/iconList.d.ts +1 -1
  45. package/dist/do-theme/icomoon/iconList.d.ts.map +1 -1
  46. package/dist/do-theme/icomoon/iconList.js +1 -0
  47. package/dist/do-theme/icomoon/icons.css +8 -5
  48. package/dist/do-theme/index.css +6 -2
  49. package/dist/do-theme/var-dark.css +49 -25
  50. package/dist/do-theme/var-light.css +49 -26
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +3 -3
  54. package/dist/molecules/ActionChip/ActionChip.svelte.d.ts +1 -1
  55. package/dist/molecules/IconButton/IconButton.svelte.d.ts +1 -1
  56. package/dist/molecules/index.d.ts +1 -2
  57. package/dist/molecules/index.d.ts.map +1 -1
  58. package/dist/molecules/index.js +1 -2
  59. package/package.json +5 -2
  60. package/dist/atoms/Counter/Counter.svelte +0 -15
  61. package/dist/atoms/Counter/Counter.svelte.d.ts +0 -29
  62. package/dist/atoms/Counter/Counter.svelte.d.ts.map +0 -1
  63. package/dist/atoms/Counter/iProps.d.ts +0 -4
  64. package/dist/atoms/Counter/iProps.d.ts.map +0 -1
  65. /package/dist/atoms/{Counter → Card}/iProps.js +0 -0
@@ -1,38 +1,56 @@
1
1
  <script lang="ts">
2
- export let label: string = 'Texto';
3
- export let maxLength: number | null = null;
4
- export let customClass: string = '';
5
- export let enableTooltip: boolean = false;
6
- export let tooltipContent: string = '';
2
+ import type { iProps } from './iProps.ts';
7
3
 
8
- $: displayedText =
9
- maxLength && label.length > maxLength ? label.slice(0, maxLength) + '' : label;
10
- $: isTruncated = maxLength && label.length > maxLength;
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();
11
27
  </script>
12
28
 
13
29
  <!-- @component Badge
14
30
  ```Svelte
15
- <Badge label={label} maxLength={maxLength} customClass={customClass} enableTooltip={enableTooltip} tooltipContent={tooltipContent}>
16
- <slot />
17
- </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}/>
18
32
  ```
19
- - `label?`: string
20
- - `maxLength?`: number | null - max length of the text, if exceeded it will be truncated and "…" will be added
21
- - `customClass?`: string - additional custom class for styling
22
- - `enableTooltip?`: boolean - if true, the tooltipContent content will be displayed
23
- - `tooltipContent?`: any HTML content. The display will be triggered while hovering over the component
24
-
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
25
43
  -->
26
- <div class="do-badge-wrapper">
27
- <div class={`do-badge do-badge-primary ${customClass}`} {...isTruncated ? { title: label } : {}}>
28
- <span>
29
- {displayedText}
30
- </span>
31
- <slot />
32
- {#if enableTooltip}
33
- <div class="do-badge-tooltip">
34
- {@html tooltipContent}
35
- </div>
36
- {/if}
37
- </div>
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>
38
56
  </div>
@@ -1,47 +1,33 @@
1
- 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> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
- default: any;
16
- } ? Props extends Record<string, never> ? any : {
17
- children?: any;
18
- } : {});
1
+ import type { iProps } from './iProps.ts';
2
+ type $$ComponentProps = {
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'];
13
+ };
19
14
  /**
20
15
  * Badge
21
16
  * ```Svelte
22
- * <Badge label={label} maxLength={maxLength} customClass={customClass} enableTooltip={enableTooltip} tooltipContent={tooltipContent}>
23
- * <slot />
24
- * </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}/>
25
18
  * ```
26
- * - `label?`: string
27
- * - `maxLength?`: number | null - max length of the text, if exceeded it will be truncated and "…" will be added
28
- * - `customClass?`: string - additional custom class for styling
29
- * - `enableTooltip?`: boolean - if true, the tooltipContent content will be displayed
30
- * - `tooltipContent?`: any HTML content. The display will be triggered while hovering over the component
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
31
29
  */
32
- declare const Badge: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
33
- label?: string;
34
- maxLength?: number | null;
35
- customClass?: string;
36
- enableTooltip?: boolean;
37
- tooltipContent?: string;
38
- }, {
39
- default: {};
40
- }>, {
41
- [evt: string]: CustomEvent<any>;
42
- }, {
43
- default: {};
44
- }, {}, string>;
45
- type Badge = InstanceType<typeof Badge>;
30
+ declare const Badge: import("svelte").Component<$$ComponentProps, {}, "">;
31
+ type Badge = ReturnType<typeof Badge>;
46
32
  export default Badge;
47
33
  //# sourceMappingURL=Badge.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/atoms/Badge/Badge.svelte.ts"],"names":[],"mappings":"AAgCA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,C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ot":"","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
- maxLength: number | null | undefined;
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
- enableTooltip?: boolean;
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,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
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
- export let variant: iProps['variant'] = 'do-btn-primary';
5
- export let size: iProps['size'] = 'do-btn-md';
6
- export let rounded: iProps['rounded'] = false;
7
- export let label: iProps['label'] = '';
8
- export let disabled: iProps['disabled'] = false;
9
- export let loading: iProps['loading'] = false;
10
- export let type: iProps['type'] = 'button';
11
- export let circle: iProps['circle'] = false;
12
- export let customStyles: iProps['customStyles'] = '';
13
- export let customClass: iProps['class'] = '';
14
- export let square: iProps['square'] = false;
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
- $: borderRadius = circle
17
- ? 'border-radius:24px; padding: 6px; border: none;'
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
- $: mergedStyles = `${borderRadius} ${customStyles}`.trim();
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
- style={mergedStyles}
48
- class={['do-btn', `${variant}`, `${size}`, `${customClass}`].join(' ')}
94
+ aria-label={ariaLabel}
95
+ onclick={onClick}
49
96
  {disabled}
50
- on:click
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
- <slot />
105
+ {@render children?.()}
53
106
  {#if label}
54
107
  <span>{label}</span>
55
108
  {/if}
56
- <i class="icon-loading do-loader" style="{loading ? 'display:inline-block;' : 'display:none;'}"></i>
57
- </button>
109
+ <i class="icon-loading do-loader" style={loading ? 'display:inline-block;' : 'display:none;'}></i>
110
+ </button>
@@ -1,59 +1,50 @@
1
- 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> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
- default: any;
16
- } ? Props extends Record<string, never> ? any : {
17
- children?: any;
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: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
36
- [x: string]: any;
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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,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
- import type { HTMLButtonAttributes } from 'svelte/elements';
2
- export interface iProps extends HTMLButtonAttributes {
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,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,MAAO,SAAQ,oBAAoB;IACnD,OAAO,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa,G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jB,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"}
@@ -0,0 +1,33 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { iProps } from './iProps.ts';
4
+
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();
18
+ </script>
19
+
20
+ <!-- @component Card
21
+ ```Svelte
22
+ <Card variant={variant} customClass={customClass}>
23
+ {@render children()} // render custom content inside Card tags
24
+ </Card>
25
+ ```
26
+ - `variant`: 'do-card-primary' | 'do-card-secondary'
27
+ - `customClass?`: string - additional custom class for styling
28
+ - `ariaLabel?`: string
29
+ - `dataTestId?`: string
30
+ -->
31
+ <div class="do-card {variant} {customClass}" aria-label={ariaLabel} data-testid={dataTestId}>
32
+ {@render children?.()}
33
+ </div>
@@ -0,0 +1,25 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { iProps } from './iProps.ts';
3
+ type $$ComponentProps = {
4
+ children: Snippet;
5
+ variant: iProps['variant'];
6
+ customClass?: iProps['customClass'];
7
+ ariaLabel?: iProps['ariaLabel'];
8
+ dataTestId?: iProps['dataTestId'];
9
+ };
10
+ /**
11
+ * Card
12
+ * ```Svelte
13
+ * <Card variant={variant} customClass={customClass}>
14
+ * {@render children()} // render custom content inside Card tags
15
+ * </Card>
16
+ * ```
17
+ * - `variant`: 'do-card-primary' | 'do-card-secondary'
18
+ * - `customClass?`: string - additional custom class for styling
19
+ * - `ariaLabel?`: string
20
+ * - `dataTestId?`: string
21
+ */
22
+ declare const Card: import("svelte").Component<$$ComponentProps, {}, "">;
23
+ type Card = ReturnType<typeof Card>;
24
+ export default Card;
25
+ //# sourceMappingURL=Card.svelte.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,7 @@
1
+ export interface iProps {
2
+ variant: 'do-card-primary' | 'do-card-secondary';
3
+ customClass?: string;
4
+ ariaLabel: string;
5
+ dataTestId?: string;
6
+ }
7
+ //# sourceMappingURL=iProps.d.ts.map
@@ -0,0 +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;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>