lapikit 0.0.0-insiders.e330f8d → 0.0.0-insiders.e4d0a84

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 (151) hide show
  1. package/bin/configuration.js +298 -0
  2. package/bin/helper.js +23 -0
  3. package/bin/index.js +41 -0
  4. package/bin/lapikit.js +37 -5
  5. package/bin/legacy.js +34 -0
  6. package/bin/modules/adapter.js +3 -3
  7. package/bin/modules/plugin.js +223 -0
  8. package/bin/presets.js +25 -0
  9. package/bin/prompts.js +100 -0
  10. package/dist/actions/index.d.ts +1 -0
  11. package/dist/actions/index.js +1 -0
  12. package/dist/assets/icons/arrow-down.svelte +12 -0
  13. package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
  14. package/dist/assets/icons/arrow-up.svelte +12 -0
  15. package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
  16. package/dist/assets/icons/close-fill.svelte +12 -0
  17. package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
  18. package/dist/assets/icons/loading-fill.svelte +31 -0
  19. package/dist/assets/icons/loading-fill.svelte.d.ts +18 -0
  20. package/dist/components/accordion/accordion.css +113 -0
  21. package/dist/components/accordion/accordion.svelte +37 -0
  22. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  23. package/dist/components/accordion/accordion.svelte.js +24 -0
  24. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  25. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  26. package/dist/components/accordion/types.d.ts +33 -0
  27. package/dist/components/accordion/types.js +1 -0
  28. package/dist/components/alert/alert.css +137 -0
  29. package/dist/components/alert/alert.svelte +89 -0
  30. package/dist/components/alert/alert.svelte.d.ts +4 -0
  31. package/dist/components/alert/types.d.ts +28 -0
  32. package/dist/components/alert/types.js +1 -0
  33. package/dist/components/app/app.css +16 -0
  34. package/dist/components/app/app.svelte +31 -2
  35. package/dist/components/appbar/appbar.css +48 -0
  36. package/dist/components/appbar/appbar.svelte +40 -0
  37. package/dist/components/appbar/appbar.svelte.d.ts +4 -0
  38. package/dist/components/appbar/types.d.ts +15 -0
  39. package/dist/components/appbar/types.js +1 -0
  40. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  41. package/dist/components/aspect-ratio/aspect-ratio.svelte +47 -0
  42. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  43. package/dist/components/aspect-ratio/types.d.ts +5 -0
  44. package/dist/components/aspect-ratio/types.js +1 -0
  45. package/dist/components/avatar/avatar.css +109 -0
  46. package/dist/components/avatar/avatar.svelte +46 -0
  47. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  48. package/dist/components/avatar/types.d.ts +22 -0
  49. package/dist/components/avatar/types.js +1 -0
  50. package/dist/components/button/button.css +168 -161
  51. package/dist/components/button/button.svelte +51 -30
  52. package/dist/components/button/button.svelte.d.ts +2 -2
  53. package/dist/components/button/types.d.ts +10 -5
  54. package/dist/components/card/card.css +115 -0
  55. package/dist/components/card/card.svelte +63 -0
  56. package/dist/components/card/card.svelte.d.ts +4 -0
  57. package/dist/components/card/types.d.ts +18 -0
  58. package/dist/components/card/types.js +1 -0
  59. package/dist/components/chip/chip.css +231 -0
  60. package/dist/components/chip/chip.svelte +131 -0
  61. package/dist/components/chip/chip.svelte.d.ts +4 -0
  62. package/dist/components/chip/types.d.ts +32 -0
  63. package/dist/components/chip/types.js +1 -0
  64. package/dist/components/dialog/dialog.css +136 -0
  65. package/dist/components/dialog/dialog.svelte +67 -0
  66. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  67. package/dist/components/dialog/types.d.ts +24 -0
  68. package/dist/components/dialog/types.js +1 -0
  69. package/dist/components/dropdown/dropdown.css +22 -0
  70. package/dist/components/dropdown/dropdown.svelte +116 -0
  71. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  72. package/dist/components/dropdown/dropdown.svelte.js +148 -0
  73. package/dist/components/dropdown/types.d.ts +26 -0
  74. package/dist/components/dropdown/types.js +1 -0
  75. package/dist/components/icon/icon.css +79 -0
  76. package/dist/components/icon/icon.svelte +49 -0
  77. package/dist/components/icon/icon.svelte.d.ts +4 -0
  78. package/dist/components/icon/types.d.ts +16 -0
  79. package/dist/components/icon/types.js +1 -0
  80. package/dist/components/index.d.ts +21 -1
  81. package/dist/components/index.js +21 -1
  82. package/dist/components/list/list.css +221 -0
  83. package/dist/components/list/list.svelte +44 -0
  84. package/dist/components/list/list.svelte.d.ts +4 -0
  85. package/dist/components/list/modules/list-item.svelte +76 -0
  86. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  87. package/dist/components/list/types.d.ts +33 -0
  88. package/dist/components/list/types.js +1 -0
  89. package/dist/components/modal/modal.css +145 -0
  90. package/dist/components/modal/modal.svelte +113 -0
  91. package/dist/components/modal/modal.svelte.d.ts +4 -0
  92. package/dist/components/modal/types.d.ts +26 -0
  93. package/dist/components/modal/types.js +1 -0
  94. package/dist/components/popover/popover.css +22 -0
  95. package/dist/components/popover/popover.svelte +73 -0
  96. package/dist/components/popover/popover.svelte.d.ts +4 -0
  97. package/dist/components/popover/popover.svelte.js +134 -0
  98. package/dist/components/popover/types.d.ts +20 -0
  99. package/dist/components/popover/types.js +1 -0
  100. package/dist/components/separator/separator.css +46 -0
  101. package/dist/components/separator/separator.svelte +37 -0
  102. package/dist/components/separator/separator.svelte.d.ts +4 -0
  103. package/dist/components/separator/types.d.ts +11 -0
  104. package/dist/components/separator/types.js +1 -0
  105. package/dist/components/spacer/spacer.css +3 -0
  106. package/dist/components/spacer/spacer.svelte +7 -0
  107. package/dist/components/spacer/spacer.svelte.d.ts +4 -0
  108. package/dist/components/spacer/types.d.ts +4 -0
  109. package/dist/components/spacer/types.js +1 -0
  110. package/dist/components/textfield/textfield.css +305 -0
  111. package/dist/components/textfield/textfield.svelte +193 -0
  112. package/dist/components/textfield/textfield.svelte.d.ts +4 -0
  113. package/dist/components/textfield/types.d.ts +37 -0
  114. package/dist/components/textfield/types.js +1 -0
  115. package/dist/components/toolbar/toolbar.css +129 -0
  116. package/dist/components/toolbar/toolbar.svelte +47 -0
  117. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  118. package/dist/components/toolbar/types.d.ts +27 -0
  119. package/dist/components/toolbar/types.js +1 -0
  120. package/dist/components/tooltip/tooltip.css +124 -0
  121. package/dist/components/tooltip/tooltip.svelte +113 -0
  122. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  123. package/dist/components/tooltip/tooltip.svelte.js +131 -0
  124. package/dist/components/tooltip/types.d.ts +23 -0
  125. package/dist/components/tooltip/types.js +1 -0
  126. package/dist/index.d.ts +10 -1
  127. package/dist/index.js +9 -3
  128. package/dist/internal/assets.svelte.d.ts +1 -0
  129. package/dist/internal/assets.svelte.js +13 -0
  130. package/dist/internal/clickOutside.d.ts +9 -0
  131. package/dist/internal/clickOutside.js +34 -0
  132. package/dist/internal/index.d.ts +1 -0
  133. package/dist/internal/index.js +1 -0
  134. package/dist/internal/ripple.d.ts +12 -0
  135. package/dist/internal/ripple.js +93 -0
  136. package/dist/internal/scroll.d.ts +1 -0
  137. package/dist/internal/scroll.js +6 -0
  138. package/dist/internal/unit.d.ts +1 -0
  139. package/dist/internal/unit.js +11 -0
  140. package/dist/preset.js +2 -2
  141. package/dist/stores/breakpoints.d.ts +6 -0
  142. package/dist/stores/breakpoints.js +23 -0
  143. package/dist/stores/index.d.ts +10 -3
  144. package/dist/stores/index.js +28 -3
  145. package/dist/style/animation.css +51 -0
  146. package/dist/style/css.js +3 -0
  147. package/dist/style/normalize.css +2 -0
  148. package/dist/style/parser/color.js +2 -2
  149. package/dist/style/parser/device.js +31 -19
  150. package/dist/style/variable.css +12 -0
  151. package/package.json +12 -4
@@ -0,0 +1,148 @@
1
+ import { innerWidth, innerHeight } from 'svelte/reactivity/window';
2
+ export function getPositions() {
3
+ // state
4
+ const axis = $state({
5
+ x: 0,
6
+ y: 0,
7
+ location: null
8
+ });
9
+ return {
10
+ get values() {
11
+ return axis;
12
+ },
13
+ update(activator, element, location, centered, avoidCollisions) {
14
+ if (!activator || !element)
15
+ return;
16
+ const elementRect = element.getBoundingClientRect();
17
+ if (!(activator instanceof HTMLElement)) {
18
+ if (activator.clientX + elementRect.width > innerWidth.current) {
19
+ axis.x = activator.clientX - elementRect.width;
20
+ }
21
+ else {
22
+ axis.x = activator.clientX;
23
+ }
24
+ if (activator.clientY + elementRect.height > innerHeight.current) {
25
+ axis.y = activator.clientY - elementRect.height;
26
+ }
27
+ else {
28
+ axis.y = activator.clientY;
29
+ }
30
+ }
31
+ else if (activator instanceof HTMLElement) {
32
+ const activatorRect = activator.getBoundingClientRect();
33
+ const spacing = 0;
34
+ const _activator = activatorRect.y + activatorRect.height;
35
+ const _element = elementRect.height + spacing;
36
+ if (location === 'top' || location === 'bottom') {
37
+ if (avoidCollisions) {
38
+ if (location === 'top') {
39
+ if (activatorRect.y - _element < 0) {
40
+ axis.y = activatorRect.bottom + spacing;
41
+ axis.location = 'bottom';
42
+ }
43
+ else {
44
+ axis.y = activatorRect.top - _element;
45
+ axis.location = 'top';
46
+ }
47
+ }
48
+ else {
49
+ if (_activator + _element > innerHeight.current) {
50
+ axis.y = activatorRect.top - _element;
51
+ axis.location = 'top';
52
+ }
53
+ else {
54
+ axis.y = activatorRect.bottom + spacing;
55
+ axis.location = 'bottom';
56
+ }
57
+ }
58
+ }
59
+ else {
60
+ if (location === 'top') {
61
+ axis.y = activatorRect.top - _element;
62
+ axis.location = 'top';
63
+ }
64
+ else {
65
+ axis.y = activatorRect.bottom + spacing;
66
+ axis.location = 'bottom';
67
+ }
68
+ }
69
+ if (centered &&
70
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
71
+ activatorRect.left + elementRect.width < innerWidth.current) {
72
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
73
+ }
74
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
75
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
76
+ }
77
+ else {
78
+ axis.x = activatorRect.left;
79
+ }
80
+ }
81
+ else if (location === 'left' || location === 'right') {
82
+ if (avoidCollisions) {
83
+ if (location === 'left' && !(activatorRect.left - elementRect.width < 0)) {
84
+ axis.x = activatorRect.left - (elementRect.width + spacing);
85
+ axis.location = 'left';
86
+ }
87
+ else {
88
+ if (activatorRect.left + activatorRect.width + elementRect.width + spacing >
89
+ innerWidth.current) {
90
+ axis.x = activatorRect.left - (elementRect.width + spacing);
91
+ axis.location = 'left';
92
+ }
93
+ else {
94
+ axis.x = activatorRect.left + activatorRect.width + spacing;
95
+ axis.location = 'right';
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ if (location === 'left') {
101
+ axis.x = activatorRect.left - (elementRect.width + spacing);
102
+ axis.location = 'left';
103
+ }
104
+ else {
105
+ axis.x = activatorRect.left + activatorRect.width + spacing;
106
+ axis.location = 'right';
107
+ }
108
+ }
109
+ if (centered &&
110
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
111
+ activatorRect.top + elementRect.height < innerHeight.current) {
112
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
113
+ }
114
+ else if (activatorRect.y + elementRect.height > innerHeight.current) {
115
+ axis.y = activatorRect.y - elementRect.height + activatorRect.height;
116
+ }
117
+ else {
118
+ axis.y = activatorRect.y;
119
+ }
120
+ }
121
+ else {
122
+ if (centered &&
123
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
124
+ activatorRect.left + elementRect.width < innerWidth.current) {
125
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
126
+ }
127
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
128
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
129
+ }
130
+ else {
131
+ axis.x = activatorRect.left;
132
+ }
133
+ if (centered &&
134
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
135
+ activatorRect.top + elementRect.height < innerHeight.current) {
136
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
137
+ }
138
+ else if (activatorRect.bottom + elementRect.height > innerHeight.current) {
139
+ axis.y = activatorRect.top - elementRect.height;
140
+ }
141
+ else {
142
+ axis.y = activatorRect.bottom;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ };
148
+ }
@@ -0,0 +1,26 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ import type { Snippet } from 'svelte';
3
+ export type PositionElement = {
4
+ x: number;
5
+ y: number;
6
+ location: string | null;
7
+ };
8
+ export interface DropdownProps extends Component {
9
+ dark?: boolean;
10
+ light?: boolean;
11
+ rounded?: string;
12
+ position?: 'top' | 'bottom' | 'left' | 'right';
13
+ openOnHover?: boolean;
14
+ closeOnClick?: boolean;
15
+ color?: string;
16
+ background?: string;
17
+ activator?: Snippet<[
18
+ ModelDropdownProps,
19
+ (state: 'open' | 'close', element: HTMLElement | PointerEvent | null) => void
20
+ ]>;
21
+ }
22
+ export type ModelDropdownProps = {
23
+ open: boolean;
24
+ close: () => void;
25
+ toggle: (element: HTMLElement | PointerEvent | null) => void;
26
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,79 @@
1
+ .kit-icon {
2
+ --icon-color: var(--base, var(--base-parent, var(--kit-on-neutral)));
3
+
4
+ display: inline-flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ /* transition: color 0.5s; */
8
+ text-indent: 0;
9
+ font-size: calc(
10
+ var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--kit-spacing)
11
+ );
12
+ }
13
+
14
+ .kit-icon:before {
15
+ color: var(--icon-color);
16
+ }
17
+
18
+ .kit-icon svg {
19
+ color: var(--icon-color);
20
+ }
21
+
22
+ .kit-icon svg,
23
+ .kit-icon img {
24
+ width: calc(var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--kit-spacing));
25
+ height: calc(
26
+ var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--kit-spacing)
27
+ );
28
+ }
29
+
30
+ /* size */
31
+ .kit-icon[breakpoint]kit-icon--size-xs {
32
+ --icon-multiplier-size: 7;
33
+ }
34
+
35
+ .kit-icon[breakpoint]kit-icon--size-sm {
36
+ --icon-multiplier-size: 8;
37
+ }
38
+
39
+ .kit-icon[breakpoint]kit-icon--size-md {
40
+ --icon-multiplier-size: 9;
41
+ }
42
+
43
+ .kit-icon[breakpoint]kit-icon--size-lg {
44
+ --icon-multiplier-size: 10;
45
+ }
46
+
47
+ .kit-icon[breakpoint]kit-icon--size-xl {
48
+ --icon-multiplier-size: 11;
49
+ }
50
+
51
+ /* state */
52
+ .kit-icon.kit-icon--info {
53
+ --base: var(--kit-info);
54
+ }
55
+ .kit-icon.kit-icon--success {
56
+ --base: var(--kit-success);
57
+ }
58
+ .kit-icon.kit-icon--warning {
59
+ --base: var(--kit-warning);
60
+ }
61
+ .kit-icon.kit-icon--error {
62
+ --base: var(--kit-error);
63
+ }
64
+
65
+ /* disabled */
66
+ .kit-icon.kit-icon--disabled {
67
+ -webkit-user-select: none;
68
+ user-select: none;
69
+ pointer-events: none;
70
+ }
71
+
72
+ .kit-icon.kit-icon--disabled img {
73
+ opacity: 0.38;
74
+ }
75
+
76
+ .kit-icon.kit-icon--disabled svg,
77
+ .kit-icon.kit-icon--disabled:before {
78
+ color: color-mix(in oklab, var(--icon-color) 40%, transparent) !important;
79
+ }
@@ -0,0 +1,49 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import type { IconProps } from './types.js';
4
+ let {
5
+ children,
6
+ ref = $bindable(),
7
+ is = 'i',
8
+ light,
9
+ dark,
10
+ icon,
11
+ size = 'md',
12
+ error,
13
+ info,
14
+ success,
15
+ warning,
16
+ disabled,
17
+ alt,
18
+ color,
19
+ ...rest
20
+ }: IconProps = $props();
21
+
22
+ const assets = getAssets();
23
+ </script>
24
+
25
+ <svelte:element
26
+ this={icon && icon.includes('/') ? 'div' : is}
27
+ bind:this={ref}
28
+ {...rest}
29
+ class={[
30
+ 'kit-icon',
31
+ icon && !icon.includes('/') && icon,
32
+ light && 'light',
33
+ dark && 'dark',
34
+ info && 'kit-icon--info',
35
+ success && 'kit-icon--success',
36
+ warning && 'kit-icon--warning',
37
+ error && 'kit-icon--error',
38
+ disabled && 'kit-icon--disabled',
39
+ size && assets.className('icon', 'size', size),
40
+ rest.class
41
+ ]}
42
+ style:--base={assets.color(color)}
43
+ >
44
+ {#if icon && icon.includes('/')}
45
+ <img src={icon} {alt} />
46
+ {:else}
47
+ {@render children?.()}
48
+ {/if}
49
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { IconProps } from './types.js';
2
+ declare const Icon: import("svelte").Component<IconProps, {}, "ref">;
3
+ type Icon = ReturnType<typeof Icon>;
4
+ export default Icon;
@@ -0,0 +1,16 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ export interface IconProps extends Component {
3
+ ref?: HTMLElement | null;
4
+ is?: 'i' | 'div';
5
+ dark?: boolean;
6
+ light?: boolean;
7
+ error?: boolean;
8
+ info?: boolean;
9
+ warning?: boolean;
10
+ success?: boolean;
11
+ disabled?: boolean;
12
+ color?: string;
13
+ size?: string | {
14
+ [key: string]: string;
15
+ };
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,22 @@
1
1
  export { default as App } from './app/app.svelte';
2
- export { default as Btn } from './button/button.svelte';
2
+ export { default as Button } from './button/button.svelte';
3
+ export { default as Icon } from './icon/icon.svelte';
4
+ export { default as Dropdown } from './dropdown/dropdown.svelte';
5
+ export { default as Popover } from './popover/popover.svelte';
6
+ export { default as Tooltip } from './tooltip/tooltip.svelte';
7
+ export { default as Dialog } from './dialog/dialog.svelte';
8
+ export { default as Separator } from './separator/separator.svelte';
9
+ export { default as Modal } from './modal/modal.svelte';
10
+ export { default as List } from './list/list.svelte';
11
+ export { default as ListItem } from './list/modules/list-item.svelte';
12
+ export { default as Avatar } from './avatar/avatar.svelte';
13
+ export { default as Accordion } from './accordion/accordion.svelte';
14
+ export { default as AccordionItem } from './accordion/modules/accordion-item.svelte';
15
+ export { default as AspectRatio } from './aspect-ratio/aspect-ratio.svelte';
16
+ export { default as Alert } from './alert/alert.svelte';
17
+ export { default as Chip } from './chip/chip.svelte';
18
+ export { default as Card } from './card/card.svelte';
19
+ export { default as Toolbar } from './toolbar/toolbar.svelte';
20
+ export { default as Appbar } from './appbar/appbar.svelte';
21
+ export { default as Spacer } from './spacer/spacer.svelte';
22
+ export { default as Textfield } from './textfield/textfield.svelte';
@@ -1,3 +1,23 @@
1
1
  // components
2
2
  export { default as App } from './app/app.svelte';
3
- export { default as Btn } from './button/button.svelte';
3
+ export { default as Button } from './button/button.svelte';
4
+ export { default as Icon } from './icon/icon.svelte';
5
+ export { default as Dropdown } from './dropdown/dropdown.svelte';
6
+ export { default as Popover } from './popover/popover.svelte';
7
+ export { default as Tooltip } from './tooltip/tooltip.svelte';
8
+ export { default as Dialog } from './dialog/dialog.svelte';
9
+ export { default as Separator } from './separator/separator.svelte';
10
+ export { default as Modal } from './modal/modal.svelte';
11
+ export { default as List } from './list/list.svelte';
12
+ export { default as ListItem } from './list/modules/list-item.svelte';
13
+ export { default as Avatar } from './avatar/avatar.svelte';
14
+ export { default as Accordion } from './accordion/accordion.svelte';
15
+ export { default as AccordionItem } from './accordion/modules/accordion-item.svelte';
16
+ export { default as AspectRatio } from './aspect-ratio/aspect-ratio.svelte';
17
+ export { default as Alert } from './alert/alert.svelte';
18
+ export { default as Chip } from './chip/chip.svelte';
19
+ export { default as Card } from './card/card.svelte';
20
+ export { default as Toolbar } from './toolbar/toolbar.svelte';
21
+ export { default as Appbar } from './appbar/appbar.svelte';
22
+ export { default as Spacer } from './spacer/spacer.svelte';
23
+ export { default as Textfield } from './textfield/textfield.svelte';
@@ -0,0 +1,221 @@
1
+ /* root */
2
+ .kit-list {
3
+ --list-color: var(--on, var(--kit-on-container));
4
+ --list-background: var(--base, var(--kit-container));
5
+ --list-radius: var(--shape, var(--kit-radius-md));
6
+ }
7
+
8
+ .kit-list {
9
+ position: relative;
10
+ flex-direction: column;
11
+ width: 100%;
12
+ display: flex;
13
+ border: none;
14
+ outline: none;
15
+ }
16
+
17
+ .kit-list-item {
18
+ --list-item-radius: var(--shape, var(--list-radius, var(--kit-radius-md)));
19
+ }
20
+
21
+ .kit-list-item {
22
+ position: relative;
23
+ border: none;
24
+ outline: none;
25
+ padding-top: var(--list-spacing-x);
26
+ padding-bottom: var(--list-spacing-x);
27
+ padding-right: var(--list-spacing-y);
28
+ padding-left: var(--list-spacing-y);
29
+ color: var(--list-item-color);
30
+ border-radius: var(--list-item-radius);
31
+ font-weight: 500;
32
+ text-decoration: none;
33
+ }
34
+
35
+ .kit-list-item:not(div) {
36
+ cursor: pointer;
37
+ }
38
+
39
+ .kit-list-item,
40
+ .kit-list-item .kit-list-item-content--content,
41
+ .kit-list-item .kit-list-item-content--append,
42
+ .kit-list-item .kit-list-item-content--prepend {
43
+ display: inline-flex;
44
+ align-items: center;
45
+ white-space: nowrap;
46
+ gap: calc(var(--kit-spacing) * var(--list-multiplier-gap));
47
+ font-size: calc(var(--kit-spacing) * var(--list-multiplier-font-size));
48
+ }
49
+
50
+ .kit-list-item.kit-list-item--append:not(.kit-list-item--prepend) {
51
+ display: grid;
52
+ grid-template-columns: auto 1fr;
53
+ }
54
+
55
+ .kit-list-item.kit-list-item--prepend:not(.kit-list-item--append) {
56
+ display: grid;
57
+ grid-template-columns: 1fr auto;
58
+ }
59
+
60
+ .kit-list-item.kit-list-item--prepend.kit-list-item--append {
61
+ display: grid;
62
+ grid-template-columns: auto 1fr auto;
63
+ }
64
+
65
+ .kit-list-item::after {
66
+ content: '';
67
+ position: absolute;
68
+ inset: 0;
69
+ background-color: currentColor;
70
+ opacity: 0;
71
+ transition: opacity 150ms ease;
72
+ pointer-events: none;
73
+ border-radius: inherit;
74
+ }
75
+ .kit-list-item:not(div):hover::after {
76
+ opacity: 0.08;
77
+ }
78
+ .kit-list-item:not(div):active::after {
79
+ opacity: 0.12;
80
+ }
81
+ .kit-list-item:not(div):focus-visible::after {
82
+ opacity: 0.12;
83
+ }
84
+
85
+ .kit-list.kit-list--nav {
86
+ padding-top: 8px;
87
+ padding-bottom: 8px;
88
+ padding-inline: 8px;
89
+ }
90
+
91
+ /* size */
92
+ .kit-list[breakpoint]kit-list--size-xs {
93
+ --list-multiplier-x: 16;
94
+ --list-multiplier-y: 4;
95
+ --list-multiplier-gap: 2;
96
+ --list-multiplier-font-size: 6;
97
+ }
98
+ .kit-list[breakpoint]kit-list--size-xs .kit-icon[class*='kit-icon--size-md'] {
99
+ --icon-multiplier-parent-size: 6;
100
+ }
101
+
102
+ .kit-list[breakpoint]kit-list--size-sm {
103
+ --list-multiplier-x: 20;
104
+ --list-multiplier-y: 5;
105
+ --list-multiplier-gap: 4;
106
+ --list-multiplier-font-size: 7;
107
+ }
108
+ .kit-list[breakpoint]kit-list--size-sm .kit-icon[class*='kit-icon--size-md'] {
109
+ --icon-multiplier-parent-size: 7;
110
+ }
111
+
112
+ .kit-list[breakpoint]kit-list--size-md {
113
+ --list-multiplier-x: 24;
114
+ --list-multiplier-y: 6;
115
+ --list-multiplier-gap: 4;
116
+ --list-multiplier-font-size: 8;
117
+ }
118
+ .kit-list[breakpoint]kit-list--size-md .kit-icon[class*='kit-icon--size-md'] {
119
+ --icon-multiplier-parent-size: 8;
120
+ }
121
+
122
+ .kit-list[breakpoint]kit-list--size-lg {
123
+ --list-multiplier-x: 28;
124
+ --list-multiplier-y: 7;
125
+ --list-multiplier-gap: 4;
126
+ --list-multiplier-font-size: 9;
127
+ }
128
+ .kit-list[breakpoint]kit-list--size-lg .kit-icon[class*='kit-icon--size-md'] {
129
+ --icon-multiplier-parent-size: 9;
130
+ }
131
+
132
+ .kit-list[breakpoint]kit-list--size-xl {
133
+ --list-multiplier-x: 32;
134
+ --list-multiplier-y: 8;
135
+ --list-multiplier-gap: 5;
136
+ --list-multiplier-font-size: 10;
137
+ }
138
+ .kit-list[breakpoint]kit-list--size-xl .kit-icon[class*='kit-icon--size-md'] {
139
+ --icon-multiplier-parent-size: 10;
140
+ }
141
+
142
+ /* density */
143
+ .kit-list[breakpoint]kit-list--density-default .kit-list-item {
144
+ height: calc(var(--kit-spacing) * var(--list-multiplier-x));
145
+ --list-spacing-x: 0;
146
+ --list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y));
147
+ }
148
+
149
+ .kit-list[breakpoint]kit-list--density-compact .kit-list-item {
150
+ height: calc(var(--kit-spacing) * var(--list-multiplier-x) - 0.25rem);
151
+ --list-spacing-x: 0;
152
+ --list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y) - 0.25rem);
153
+ }
154
+
155
+ .kit-list[breakpoint]kit-list--density-comfortable .kit-list-item {
156
+ height: calc(var(--kit-spacing) * var(--list-multiplier-x) + 0.25rem);
157
+ --list-spacing-x: 0;
158
+ --list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y) + 0.25rem);
159
+ }
160
+
161
+ /* variant */
162
+ .kit-list[breakpoint]kit-list--variant-filled .kit-list-item {
163
+ --list-item-color: var(--on, var(--list-color, var(--kit-on-container)));
164
+ --list-item-background: var(--base, var(--list-background, var(--kit-container)));
165
+ background-color: var(--list-item-background);
166
+ }
167
+
168
+ .kit-list[breakpoint]kit-list--variant-outline .kit-list-item {
169
+ --list-item-color: var(--base, var(--list-color, var(--kit-on-container)));
170
+ background-color: transparent;
171
+ }
172
+ .kit-list[breakpoint]kit-list--variant-outline .kit-list-item::before {
173
+ content: '';
174
+ position: absolute;
175
+ inset: 0;
176
+ border: 1px solid currentColor;
177
+ pointer-events: none;
178
+ border-radius: inherit;
179
+ }
180
+
181
+ .kit-list[breakpoint]kit-list--variant-text .kit-list-item {
182
+ --list-item-color: var(--base, var(--list-color, var(--kit-on-container)));
183
+ background-color: transparent;
184
+ border-color: transparent;
185
+ }
186
+
187
+ /* events */
188
+ .kit-list[class*='list--variant-filled'] .kit-list-item.kit-list-item--active:not(div),
189
+ .kit-list[class*='list--variant-filled'] .kit-list-item:active:not(div) {
190
+ background-color: color-mix(in oklab, var(--list-item-background) 90%, var(--kit-scrim));
191
+ border-color: color-mix(in oklab, var(--list-item-background) 90%, var(--kit-scrim));
192
+ }
193
+ .kit-list[class*='list--variant-']:not([class*='variant-filled'])
194
+ .kit-list-item.kit-list-item--active:not(div),
195
+ .kit-list[class*='list--variant-']:not([class*='variant-filled']) .kit-list-item:active:not(div) {
196
+ background-color: color-mix(in oklab, currentColor 15%, transparent);
197
+ border-color: color-mix(in oklab, currentColor 15%, transparent);
198
+ }
199
+
200
+ /* disabled */
201
+ .kit-list .kit-list-item.kit-list-item--disabled,
202
+ .kit-list .kit-list-item[disabled],
203
+ .kit-list.kit-list--disabled .kit-list-item {
204
+ pointer-events: none;
205
+ user-select: none;
206
+ cursor: default;
207
+ }
208
+ .kit-list[class*='list--variant-filled'] .kit-list-item.kit-list-item--disabled,
209
+ .kit-list[class*='list--variant-filled'] .kit-list-item.kit-list-item--disabled {
210
+ color: color-mix(in oklab, var(--list-item-color) 40%, transparent) !important;
211
+ background-color: color-mix(in oklab, var(--list-item-background) 70%, transparent) !important;
212
+ border-color: color-mix(in oklab, var(--list-item-background) 70%, transparent) !important;
213
+ }
214
+
215
+ .kit-list[class*='list--variant-']:not([class*='variant-filled'])
216
+ .kit-list-item.kit-list-item--disabled,
217
+ .kit-list[class*='list--variant-']:not([class*='variant-filled'])
218
+ .kit-list-item.kit-list-item--disabled
219
+ i:before {
220
+ color: color-mix(in oklab, var(--list-item-background) 40%, transparent) !important;
221
+ }
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/index.js';
3
+ import type { ListProps } from './types.js';
4
+
5
+ let {
6
+ children,
7
+ ref = $bindable(),
8
+ is = 'div',
9
+ dark,
10
+ light,
11
+ background,
12
+ color,
13
+ rounded,
14
+ size = 'md',
15
+ density = 'default',
16
+ variant = 'filled',
17
+ nav,
18
+ ...rest
19
+ }: ListProps = $props();
20
+
21
+ const assets = getAssets();
22
+ </script>
23
+
24
+ <svelte:element
25
+ this={is}
26
+ bind:this={ref}
27
+ {...rest}
28
+ class={[
29
+ 'kit-list',
30
+ light && 'light',
31
+ dark && 'dark',
32
+ size && assets.className('list', 'size', size),
33
+ variant && assets.className('list', 'variant', variant),
34
+ density && assets.className('list', 'density', density),
35
+ nav && 'kit-list--nav',
36
+ rest.class
37
+ ]}
38
+ role="listbox"
39
+ style:--base={assets.color(background)}
40
+ style:--on={assets.color(color)}
41
+ style:--shape={assets.shape(rounded)}
42
+ >
43
+ {@render children?.()}
44
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { ListProps } from './types.js';
2
+ declare const List: import("svelte").Component<ListProps, {}, "ref">;
3
+ type List = ReturnType<typeof List>;
4
+ export default List;