lapikit 0.0.0-insiders.de81aed → 0.0.0-insiders.e7dc3e5

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 (57) hide show
  1. package/dist/actions/index.d.ts +1 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/assets/icons/arrow-down.svelte +10 -0
  4. package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
  5. package/dist/assets/icons/arrow-up.svelte +10 -0
  6. package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
  7. package/dist/assets/icons/close-fill.svelte +10 -0
  8. package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
  9. package/dist/components/accordion/accordion.css +113 -0
  10. package/dist/components/accordion/accordion.svelte +37 -0
  11. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  12. package/dist/components/accordion/accordion.svelte.js +24 -0
  13. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  14. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  15. package/dist/components/accordion/types.d.ts +33 -0
  16. package/dist/components/accordion/types.js +1 -0
  17. package/dist/components/alert/alert.css +127 -0
  18. package/dist/components/alert/alert.svelte +89 -0
  19. package/dist/components/alert/alert.svelte.d.ts +4 -0
  20. package/dist/components/alert/types.d.ts +28 -0
  21. package/dist/components/alert/types.js +1 -0
  22. package/dist/components/app/app.css +16 -0
  23. package/dist/components/app/app.svelte +12 -1
  24. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  25. package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -0
  26. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  27. package/dist/components/aspect-ratio/types.d.ts +5 -0
  28. package/dist/components/aspect-ratio/types.js +1 -0
  29. package/dist/components/avatar/avatar.css +109 -0
  30. package/dist/components/avatar/avatar.svelte +46 -0
  31. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  32. package/dist/components/avatar/types.d.ts +22 -0
  33. package/dist/components/avatar/types.js +1 -0
  34. package/dist/components/button/button.svelte +1 -1
  35. package/dist/components/chip/chip.css +200 -0
  36. package/dist/components/chip/chip.svelte +118 -0
  37. package/dist/components/chip/chip.svelte.d.ts +4 -0
  38. package/dist/components/chip/types.d.ts +30 -0
  39. package/dist/components/chip/types.js +1 -0
  40. package/dist/components/dialog/dialog.css +0 -9
  41. package/dist/components/dialog/types.d.ts +5 -2
  42. package/dist/components/index.d.ts +8 -0
  43. package/dist/components/index.js +8 -0
  44. package/dist/components/list/list.css +195 -0
  45. package/dist/components/list/list.svelte +46 -0
  46. package/dist/components/list/list.svelte.d.ts +4 -0
  47. package/dist/components/list/modules/list-item.svelte +68 -0
  48. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  49. package/dist/components/list/types.d.ts +36 -0
  50. package/dist/components/list/types.js +1 -0
  51. package/dist/components/modal/modal.css +128 -7
  52. package/dist/components/modal/modal.svelte +92 -39
  53. package/dist/components/modal/types.d.ts +6 -1
  54. package/dist/stores/index.d.ts +5 -0
  55. package/dist/stores/index.js +21 -2
  56. package/dist/style/variable.css +5 -0
  57. package/package.json +6 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ .kit-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ height: 100%;
6
+ width: 100%;
7
+ background-color: color-mix(in oklab, var(--kit-shadow) 45%, transparent);
8
+ z-index: 9000;
9
+ cursor: default;
10
+ }
11
+
12
+ .kit-overlay.kit-overlay--persistent {
13
+ /* pointer-events: none; */
14
+ user-select: none;
15
+ cursor: default;
16
+ }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { BROWSER } from 'esm-env';
3
- import { updateThemeStore } from '../../stores/index.js';
3
+ import { modalOpen, setOpenModal, updateThemeStore } from '../../stores/index.js';
4
4
  import type { Snippet } from 'svelte';
5
5
  let { children }: { children: Snippet } = $props();
6
6
 
@@ -11,4 +11,15 @@
11
11
  });
12
12
  </script>
13
13
 
14
+ {$modalOpen ? ($modalOpen === 'persistent' ? 'persistent' : 'true') : 'false'}
15
+
14
16
  {@render children?.()}
17
+
18
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
19
+ {#if $modalOpen}
20
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
21
+ <div
22
+ class={['kit-overlay', $modalOpen === 'persistent' && 'kit-overlay--persistent']}
23
+ onclick={() => $modalOpen !== 'persistent' && setOpenModal(false)}
24
+ ></div>
25
+ {/if}
@@ -0,0 +1,19 @@
1
+ .kit-aspect-ratio {
2
+ display: flex;
3
+ flex: 1 0 auto;
4
+ max-height: 100%;
5
+ max-width: 100%;
6
+ overflow: hidden;
7
+ position: relative;
8
+ }
9
+
10
+ .kit-aspect-ratio--inline {
11
+ display: inline-flex;
12
+ flex: 0 0 auto;
13
+ }
14
+
15
+ .kit-aspect-ratio--sizer {
16
+ flex: 1 0 0px;
17
+ transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
18
+ pointer-events: none;
19
+ }
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { AspectRationProps } from './types.js';
3
+ let { children, aspectRatio, inline, ...rest }: AspectRationProps = $props();
4
+
5
+ let paddingBottom = $state(0);
6
+
7
+ $effect.pre(() => {
8
+ if (aspectRatio) {
9
+ const [width, height] = aspectRatio.split('/').map(Number);
10
+ paddingBottom = (height / width) * 100;
11
+ }
12
+ });
13
+
14
+ $effect(() => {
15
+ if (aspectRatio) {
16
+ const [width, height] = aspectRatio.split('/').map(Number);
17
+ paddingBottom = (height / width) * 100;
18
+ }
19
+ });
20
+ </script>
21
+
22
+ <div {...rest} class={['kit-aspect-ratio', inline && 'kit-aspect-ratio--inline', rest.class]}>
23
+ <div class="kit-aspect-ratio--sizer" style={`padding-bottom: ${paddingBottom}%;`}></div>
24
+ {@render children?.()}
25
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { AspectRationProps } from './types.js';
2
+ declare const AspectRatio: import("svelte").Component<AspectRationProps, {}, "">;
3
+ type AspectRatio = ReturnType<typeof AspectRatio>;
4
+ export default AspectRatio;
@@ -0,0 +1,5 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ export interface AspectRationProps extends Component {
3
+ aspectRatio?: string;
4
+ inline?: boolean;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,109 @@
1
+ .kit-avatar {
2
+ --avatar-color: var(--on, var(--kit-on-neutral));
3
+ --avatar-background: var(--base, var(--kit-neutral));
4
+ --avatar-radius: var(--shape, var(--kit-radius-full));
5
+
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ white-space: nowrap;
10
+ padding-top: var(--avatar-spacing-x);
11
+ padding-bottom: var(--avatar-spacing-x);
12
+ padding-right: var(--avatar-spacing-y);
13
+ padding-left: var(--avatar-spacing-y);
14
+
15
+ border-width: 1px;
16
+ border-style: solid;
17
+ border-radius: var(--avatar-radius);
18
+
19
+ /* theme */
20
+ color: var(--avatar-color);
21
+ background-color: var(--avatar-background);
22
+ border-color: var(--avatar-background);
23
+ }
24
+
25
+ .kit-avatar.kit-avatar--image {
26
+ position: relative;
27
+ overflow: hidden;
28
+ }
29
+
30
+ .kit-avatar.kit-avatar--image img {
31
+ position: relative;
32
+ top: 0;
33
+ left: 0;
34
+ width: 100%;
35
+ height: 100%;
36
+ object-fit: cover;
37
+ }
38
+
39
+ /* size */
40
+ .kit-avatar[breakpoint]kit-avatar--size-xs {
41
+ --avatar-height: 1.75rem;
42
+ --avatar-multiplier-y: 2;
43
+ font-size: 0.75rem;
44
+ }
45
+
46
+ .kit-avatar[breakpoint]kit-avatar--size-sm {
47
+ --avatar-height: 2rem;
48
+ --avatar-multiplier-y: 3;
49
+ font-size: 0.875rem;
50
+ }
51
+
52
+ .kit-avatar[breakpoint]kit-avatar--size-md {
53
+ --avatar-height: 2.25rem;
54
+ --avatar-multiplier-y: 4;
55
+ font-size: 0.875rem;
56
+ }
57
+
58
+ .kit-avatar[breakpoint]kit-avatar--size-lg {
59
+ --avatar-height: 2.5rem;
60
+ --avatar-multiplier-y: 5;
61
+ font-size: 1rem;
62
+ }
63
+
64
+ .kit-avatar[breakpoint]kit-avatar--size-xl {
65
+ --avatar-height: 2.75rem;
66
+ --avatar-multiplier-y: 6;
67
+ font-size: 1.125rem;
68
+ }
69
+
70
+ /* density */
71
+ .kit-avatar[breakpoint]kit-avatar--density-default {
72
+ height: calc(var(--avatar-height));
73
+ width: calc(var(--avatar-height));
74
+ --avatar-spacing-x: 0;
75
+ --avatar-spacing-y: 0;
76
+ }
77
+
78
+ .kit-avatar[breakpoint]kit-avatar--density-compact {
79
+ height: calc(var(--avatar-height) - 0.25rem);
80
+ width: calc(var(--avatar-height) - 0.25rem);
81
+ --avatar-spacing-x: 0;
82
+ --avatar-spacing-y: 0;
83
+ }
84
+
85
+ .kit-avatar[breakpoint]kit-avatar--density-comfortable {
86
+ height: calc(var(--avatar-height) + 0.25rem);
87
+ width: calc(var(--avatar-height) + 0.25rem);
88
+ --avatar-spacing-x: 0;
89
+ --avatar-spacing-y: 0;
90
+ }
91
+
92
+ /* variant */
93
+ .kit-avatar[breakpoint]kit-avatar--variant-outline {
94
+ --avatar-color: var(--base, var(--kit-neutral));
95
+ background-color: transparent;
96
+ border: 1px solid currentColor;
97
+ }
98
+
99
+ .kit-avatar[breakpoint]kit-avatar--variant-text {
100
+ --avatar-color: var(--base, var(--kit-neutral));
101
+ background-color: transparent;
102
+ border-color: transparent;
103
+ }
104
+
105
+ .kit-avatar[breakpoint]kit-avatar--variant-dash {
106
+ --avatar-color: var(--base, var(--kit-neutral));
107
+ background-color: transparent;
108
+ border: 1px dashed currentColor;
109
+ }
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import type { AvatarProps } from './types.js';
4
+ let {
5
+ children,
6
+ ref = $bindable(),
7
+ light,
8
+ dark,
9
+ size = 'md',
10
+ rounded,
11
+ alt,
12
+ background,
13
+ color,
14
+ image,
15
+ variant,
16
+ density = 'default',
17
+ ...rest
18
+ }: AvatarProps = $props();
19
+
20
+ const assets = getAssets();
21
+ </script>
22
+
23
+ <svelte:element
24
+ this={'div'}
25
+ bind:this={ref}
26
+ {...rest}
27
+ class={[
28
+ 'kit-avatar',
29
+ light && 'light',
30
+ dark && 'dark',
31
+ image && 'kit-avatar--image',
32
+ size && assets.className('avatar', 'size', size),
33
+ variant && assets.className('avatar', 'variant', variant),
34
+ density && assets.className('avatar', 'density', density),
35
+ rest.class
36
+ ]}
37
+ style:--base={assets.color(background)}
38
+ style:--on={assets.color(color)}
39
+ style:--shape={assets.shape(rounded)}
40
+ >
41
+ {#if image}
42
+ <img src={image} {alt} />
43
+ {:else}
44
+ {@render children?.()}
45
+ {/if}
46
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { AvatarProps } from './types.js';
2
+ declare const Avatar: import("svelte").Component<AvatarProps, {}, "ref">;
3
+ type Avatar = ReturnType<typeof Avatar>;
4
+ export default Avatar;
@@ -0,0 +1,22 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ type AvatarDensity = 'compact' | 'comfortable' | 'default';
4
+ type AvatarVariant = 'outline' | 'text' | 'dash';
5
+ export interface AvatarProps extends Component {
6
+ ref?: HTMLElement | null;
7
+ dark?: boolean;
8
+ light?: boolean;
9
+ color?: string;
10
+ background?: string;
11
+ image?: string;
12
+ size?: AvatarSize | {
13
+ [key: string]: AvatarSize;
14
+ };
15
+ variant?: AvatarVariant | {
16
+ [key: string]: AvatarVariant;
17
+ };
18
+ density?: AvatarDensity | {
19
+ [key: string]: AvatarDensity;
20
+ };
21
+ }
22
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { getAssets } from '../../internal/index.js';
3
- import Icon from '../icon/icon.svelte';
3
+ import { Icon } from '../index.js';
4
4
  import type { BtnProps } from './types.js';
5
5
 
6
6
  // external
@@ -0,0 +1,200 @@
1
+ .kit-chip {
2
+ --chip-color: var(--on, var(--kit-on-neutral));
3
+ --chip-background: var(--base, var(--kit-neutral));
4
+ --chip-radius: var(--shape, var(--kit-radius-full));
5
+
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ white-space: nowrap;
10
+ padding-top: var(--chip-spacing-x);
11
+ padding-bottom: var(--chip-spacing-x);
12
+ padding-right: var(--chip-spacing-y);
13
+ padding-left: var(--chip-spacing-y);
14
+
15
+ border-width: 1px;
16
+ border-style: solid;
17
+ border-radius: var(--chip-radius);
18
+
19
+ /* theme */
20
+ color: var(--chip-color);
21
+ background-color: var(--chip-background);
22
+ border-color: var(--chip-background);
23
+ }
24
+
25
+ a.kit-chip,
26
+ button.kit-chip {
27
+ cursor: pointer;
28
+ }
29
+
30
+ .kit-chip .kit-chip-content,
31
+ .kit-chip .kit-chip-loading {
32
+ display: inline-flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ white-space: nowrap;
36
+ gap: var(--chip-gap);
37
+ }
38
+
39
+ /* size */
40
+ .kit-chip[breakpoint]kit-chip--size-xs {
41
+ --chip-height: 1.25rem;
42
+ --chip-multiplier-y: 2;
43
+ --chip-gap: 0.25rem;
44
+ font-size: 0.625rem;
45
+ gap: var(--chip-gap);
46
+ }
47
+
48
+ .kit-chip[breakpoint]kit-chip--size-sm {
49
+ --chip-height: 1.625rem;
50
+ --chip-multiplier-y: 3;
51
+ --chip-gap: 0.5rem;
52
+ font-size: 0.75rem;
53
+ gap: var(--chip-gap);
54
+ }
55
+
56
+ .kit-chip[breakpoint]kit-chip--size-md {
57
+ --chip-height: 2rem;
58
+ --chip-multiplier-y: 4;
59
+ --chip-gap: 0.5rem;
60
+ font-size: 0.875rem;
61
+ gap: var(--chip-gap);
62
+ }
63
+
64
+ .kit-chip[breakpoint]kit-chip--size-lg {
65
+ --chip-height: 2.375rem;
66
+ --chip-multiplier-y: 5;
67
+ --chip-gap: 0.5rem;
68
+ font-size: 1rem;
69
+ gap: var(--chip-gap);
70
+ }
71
+
72
+ .kit-chip[breakpoint]kit-chip--size-xl {
73
+ --chip-height: 2.75rem;
74
+ --chip-multiplier-y: 6;
75
+ --chip-gap: 0.675rem;
76
+ font-size: 1.125rem;
77
+ gap: var(--chip-gap);
78
+ }
79
+
80
+ /* variant */
81
+ .kit-chip[breakpoint]kit-chip--variant-outline {
82
+ --chip-color: var(--base, var(--kit-neutral));
83
+ background-color: transparent;
84
+ border: 1px solid currentColor;
85
+ }
86
+
87
+ .kit-chip[breakpoint]kit-chip--variant-label {
88
+ border-radius: var(--kit-radius-md);
89
+ }
90
+
91
+ /* density */
92
+ .kit-chip[breakpoint]kit-chip--density-default {
93
+ height: calc(var(--chip-height));
94
+ min-width: calc(var(--chip-height));
95
+ --chip-spacing-x: 0;
96
+ --chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y));
97
+ }
98
+
99
+ .kit-chip[breakpoint]kit-chip--density-compact {
100
+ height: calc(var(--chip-height) - 0.25rem);
101
+ min-width: calc(var(--chip-height - 0.25rem));
102
+ --chip-spacing-x: 0;
103
+ --chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y) - 0.25rem);
104
+ }
105
+
106
+ .kit-chip[breakpoint]kit-chip--density-comfortable {
107
+ height: calc(var(--chip-height) + 0.25rem);
108
+ min-width: calc(var(--chip-height) + 0.25rem);
109
+ --chip-spacing-x: 0;
110
+ --chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y) + 0.25rem);
111
+ }
112
+
113
+ /* state */
114
+ .kit-chip.kit-chip--info:not([class*='chip--variant-']) {
115
+ --on: var(--kit-on-info);
116
+ --base: var(--kit-info);
117
+ }
118
+ .kit-chip.kit-chip--info[class*='chip--variant-'] {
119
+ --base: var(--kit-info);
120
+ }
121
+
122
+ .kit-chip.kit-chip--success:not([class*='chip--variant-']) {
123
+ --on: var(--kit-on-success);
124
+ --base: var(--kit-success);
125
+ }
126
+ .kit-chip.kit-chip--success[class*='chip--variant-'] {
127
+ --base: var(--kit-success);
128
+ }
129
+
130
+ .kit-chip.kit-chip--warning:not([class*='chip--variant-']) {
131
+ --on: var(--kit-on-warning);
132
+ --base: var(--kit-warning);
133
+ }
134
+ .kit-chip.kit-chip--warning[class*='chip--variant-'] {
135
+ --base: var(--kit-warning);
136
+ }
137
+
138
+ .kit-chip.kit-chip--error:not([class*='chip--variant-']) {
139
+ --on: var(--kit-on-error);
140
+ --base: var(--kit-error);
141
+ }
142
+ .kit-chip.kit-chip--error[class*='chip--variant-'] {
143
+ --base: var(--kit-error);
144
+ }
145
+
146
+ /* events */
147
+ .kit-chip.kit-chip--active:not([class*='chip--variant-']) {
148
+ background-color: color-mix(in oklab, var(--chip-background) 90%, var(--kit-scrim));
149
+ border-color: color-mix(in oklab, var(--chip-background) 90%, var(--kit-scrim));
150
+ }
151
+ .kit-chip.kit-chip--active[class*='chip--variant-'] {
152
+ background-color: color-mix(in oklab, currentColor 15%, transparent);
153
+ border-color: color-mix(in oklab, currentColor 15%, transparent);
154
+ }
155
+
156
+ .kit-chip:hover:not([class*='chip--variant-']) {
157
+ background-color: color-mix(in oklab, var(--chip-background) 85%, var(--kit-scrim));
158
+ border-color: color-mix(in oklab, var(--chip-background) 85%, var(--kit-scrim));
159
+ }
160
+ .kit-chip:hover[class*='chip--variant-'] {
161
+ background-color: color-mix(in oklab, currentColor 25%, transparent);
162
+ }
163
+
164
+ /* disabled */
165
+ .kit-chip.kit-chip--disabled,
166
+ .kit-chip[disabled] {
167
+ pointer-events: none;
168
+ user-select: none;
169
+ cursor: default;
170
+ }
171
+ .kit-chip:not([class*='chip--variant-']).kit-chip--disabled {
172
+ color: color-mix(in oklab, var(--chip-color) 40%, transparent) !important;
173
+ background-color: color-mix(in oklab, var(--chip-background) 70%, transparent) !important;
174
+ border-color: color-mix(in oklab, var(--chip-background) 70%, transparent) !important;
175
+ }
176
+ .kit-chip:not([class*='chip--variant-']).kit-chip--disabled i:before {
177
+ color: color-mix(in oklab, var(--chip-color) 40%, transparent) !important;
178
+ }
179
+ .kit-chip[class*='chip--variant-'].kit-chip--disabled,
180
+ .kit-chip[class*='chip--variant-'].kit-chip--disabled i:before {
181
+ color: color-mix(in oklab, var(--chip-background) 40%, transparent) !important;
182
+ }
183
+
184
+ /* loading */
185
+ .kit-chip.kit-chip--loading {
186
+ pointer-events: none;
187
+ user-select: none;
188
+ cursor: default;
189
+ }
190
+ .kit-chip.kit-chip--loading > .kit-chip-content {
191
+ color: transparent;
192
+ opacity: 0;
193
+ }
194
+ .kit-chip.kit-chip--loading > .kit-chip-loading {
195
+ position: absolute;
196
+ min-width: fit-content;
197
+ }
198
+ .kit-chip.kit-chip--loading > .kit-chip-loading .kit-icon-load {
199
+ animation: icon-rotate 1s ease-out infinite;
200
+ }
@@ -0,0 +1,118 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/index.js';
3
+ import { Icon } from '../index.js';
4
+ import type { ChipProps } from './types.js';
5
+
6
+ // external
7
+ import LoadingFill from '../../assets/icons/loading-fill.svelte';
8
+ import Close from '../../assets/icons/close-fill.svelte';
9
+
10
+ let {
11
+ children,
12
+ load,
13
+ close,
14
+ append,
15
+ prepend,
16
+ ref = $bindable(),
17
+ open = $bindable(true),
18
+ is = 'span',
19
+ href,
20
+ dark,
21
+ light,
22
+ active,
23
+ variant,
24
+ error,
25
+ info,
26
+ success,
27
+ warning,
28
+ density = 'default',
29
+ disabled,
30
+ size = 'md',
31
+ type,
32
+ background,
33
+ color,
34
+ label,
35
+ loading,
36
+ rounded,
37
+ closable,
38
+ ...rest
39
+ }: ChipProps = $props();
40
+
41
+ const assets = getAssets();
42
+ </script>
43
+
44
+ {#if !closable || (open && closable)}
45
+ <svelte:element
46
+ this={href ? 'a' : is}
47
+ bind:this={ref}
48
+ {...rest}
49
+ href={href && !disabled ? href : undefined}
50
+ class={[
51
+ 'kit-chip',
52
+ light && 'light',
53
+ dark && 'dark',
54
+ size && assets.className('chip', 'size', size),
55
+ variant && assets.className('chip', 'variant', variant),
56
+ density && assets.className('chip', 'density', density),
57
+ error && 'kit-chip--error',
58
+ info && 'kit-chip--info',
59
+ success && 'kit-chip--success',
60
+ warning && 'kit-chip--warning',
61
+ disabled && 'kit-chip--disabled',
62
+ active && 'kit-chip--active',
63
+ loading && 'kit-chip--loading',
64
+ rest.class
65
+ ]}
66
+ tabindex={href && disabled ? -1 : 0}
67
+ aria-disabled={href ? disabled : undefined}
68
+ aria-label={type !== 'button' ? label : undefined}
69
+ disabled={href ? undefined : disabled}
70
+ type={href ? undefined : type}
71
+ style:--base={assets.color(background)}
72
+ style:--on={assets.color(color)}
73
+ style:--shape={assets.shape(rounded)}
74
+ >
75
+ {#if loading}
76
+ <div class="kit-chip-loading">
77
+ {#if load}
78
+ {@render load?.()}
79
+ {:else}
80
+ <Icon class="kit-icon-load">
81
+ <LoadingFill />
82
+ </Icon>
83
+ {/if}
84
+ </div>
85
+ {/if}
86
+
87
+ {#if prepend}
88
+ <div class="kit-chip-prepend">
89
+ {@render prepend?.()}
90
+ </div>
91
+ {/if}
92
+ <span class="kit-chip-content">
93
+ {@render children?.()}
94
+ </span>
95
+ {#if append}
96
+ <div class="kit-chip-append">
97
+ {@render append?.()}
98
+ </div>
99
+ {/if}
100
+
101
+ {#if closable}
102
+ <button
103
+ class="kit-chip--close"
104
+ type="button"
105
+ aria-label="close"
106
+ onclick={() => (open = false)}
107
+ >
108
+ {#if close}
109
+ {@render close?.()}
110
+ {:else}
111
+ <Icon>
112
+ <Close />
113
+ </Icon>
114
+ {/if}
115
+ </button>
116
+ {/if}
117
+ </svelte:element>
118
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { ChipProps } from './types.js';
2
+ declare const Chip: import("svelte").Component<ChipProps, {}, "ref" | "open">;
3
+ type Chip = ReturnType<typeof Chip>;
4
+ export default Chip;
@@ -0,0 +1,30 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ import type { Snippet } from 'svelte';
3
+ export interface ChipProps extends Component {
4
+ load?: Snippet;
5
+ close?: Snippet;
6
+ append?: Snippet;
7
+ prepend?: Snippet;
8
+ ref?: HTMLElement | null;
9
+ is?: 'button' | 'a' | 'span' | 'div';
10
+ dark?: boolean;
11
+ light?: boolean;
12
+ href?: string;
13
+ variant?: 'outline' | 'label';
14
+ density?: 'compact' | 'comfortable' | 'default';
15
+ active?: boolean;
16
+ loading?: boolean;
17
+ error?: boolean;
18
+ info?: boolean;
19
+ warning?: boolean;
20
+ success?: boolean;
21
+ disabled?: boolean;
22
+ color?: string;
23
+ background?: string;
24
+ size?: string | {
25
+ [key: string]: string;
26
+ };
27
+ type?: 'button';
28
+ label?: string;
29
+ closable?: boolean;
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -42,10 +42,6 @@
42
42
  border-color: var(--dialog-background);
43
43
  }
44
44
 
45
- .kit-dialog[class*='kit-dialog--size-full'] .kit-dialog-container {
46
- height: 100%;
47
- }
48
-
49
45
  .kit-dialog .close-dialog {
50
46
  opacity: 0;
51
47
  position: fixed;
@@ -91,11 +87,6 @@
91
87
  height: fit-content;
92
88
  }
93
89
 
94
- .kit-dialog[breakpoint]kit-dialog--size-full {
95
- height: 100%;
96
- max-height: 100%;
97
- }
98
-
99
90
  .kit-dialog[breakpoint]kit-dialog--size-xs .kit-dialog-container {
100
91
  max-height: calc(100% - 3rem);
101
92
  margin: 0 auto;