lapikit 0.0.0-insiders.e330f8d → 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 (104) 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/assets/icons/loading-fill.svelte +29 -0
  10. package/dist/assets/icons/loading-fill.svelte.d.ts +26 -0
  11. package/dist/components/accordion/accordion.css +113 -0
  12. package/dist/components/accordion/accordion.svelte +37 -0
  13. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  14. package/dist/components/accordion/accordion.svelte.js +24 -0
  15. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  16. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  17. package/dist/components/accordion/types.d.ts +33 -0
  18. package/dist/components/accordion/types.js +1 -0
  19. package/dist/components/alert/alert.css +127 -0
  20. package/dist/components/alert/alert.svelte +89 -0
  21. package/dist/components/alert/alert.svelte.d.ts +4 -0
  22. package/dist/components/alert/types.d.ts +28 -0
  23. package/dist/components/alert/types.js +1 -0
  24. package/dist/components/app/app.css +16 -0
  25. package/dist/components/app/app.svelte +12 -1
  26. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  27. package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -0
  28. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  29. package/dist/components/aspect-ratio/types.d.ts +5 -0
  30. package/dist/components/aspect-ratio/types.js +1 -0
  31. package/dist/components/avatar/avatar.css +109 -0
  32. package/dist/components/avatar/avatar.svelte +46 -0
  33. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  34. package/dist/components/avatar/types.d.ts +22 -0
  35. package/dist/components/avatar/types.js +1 -0
  36. package/dist/components/button/button.css +44 -8
  37. package/dist/components/button/button.svelte +14 -1
  38. package/dist/components/button/types.d.ts +3 -0
  39. package/dist/components/chip/chip.css +200 -0
  40. package/dist/components/chip/chip.svelte +118 -0
  41. package/dist/components/chip/chip.svelte.d.ts +4 -0
  42. package/dist/components/chip/types.d.ts +30 -0
  43. package/dist/components/chip/types.js +1 -0
  44. package/dist/components/dialog/dialog.css +134 -0
  45. package/dist/components/dialog/dialog.svelte +67 -0
  46. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  47. package/dist/components/dialog/types.d.ts +24 -0
  48. package/dist/components/dialog/types.js +1 -0
  49. package/dist/components/dropdown/dropdown.css +22 -0
  50. package/dist/components/dropdown/dropdown.svelte +116 -0
  51. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  52. package/dist/components/dropdown/dropdown.svelte.js +148 -0
  53. package/dist/components/dropdown/types.d.ts +26 -0
  54. package/dist/components/dropdown/types.js +1 -0
  55. package/dist/components/icon/icon.css +76 -0
  56. package/dist/components/icon/icon.svelte +49 -0
  57. package/dist/components/icon/icon.svelte.d.ts +4 -0
  58. package/dist/components/icon/types.d.ts +16 -0
  59. package/dist/components/icon/types.js +1 -0
  60. package/dist/components/index.d.ts +15 -0
  61. package/dist/components/index.js +15 -0
  62. package/dist/components/list/list.css +195 -0
  63. package/dist/components/list/list.svelte +46 -0
  64. package/dist/components/list/list.svelte.d.ts +4 -0
  65. package/dist/components/list/modules/list-item.svelte +68 -0
  66. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  67. package/dist/components/list/types.d.ts +36 -0
  68. package/dist/components/list/types.js +1 -0
  69. package/dist/components/modal/modal.css +140 -0
  70. package/dist/components/modal/modal.svelte +112 -0
  71. package/dist/components/modal/modal.svelte.d.ts +4 -0
  72. package/dist/components/modal/types.d.ts +26 -0
  73. package/dist/components/modal/types.js +1 -0
  74. package/dist/components/popover/popover.css +22 -0
  75. package/dist/components/popover/popover.svelte +73 -0
  76. package/dist/components/popover/popover.svelte.d.ts +4 -0
  77. package/dist/components/popover/popover.svelte.js +134 -0
  78. package/dist/components/popover/types.d.ts +20 -0
  79. package/dist/components/popover/types.js +1 -0
  80. package/dist/components/separator/separator.css +46 -0
  81. package/dist/components/separator/separator.svelte +37 -0
  82. package/dist/components/separator/separator.svelte.d.ts +4 -0
  83. package/dist/components/separator/types.d.ts +11 -0
  84. package/dist/components/separator/types.js +1 -0
  85. package/dist/components/tooltip/tooltip.css +124 -0
  86. package/dist/components/tooltip/tooltip.svelte +113 -0
  87. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  88. package/dist/components/tooltip/tooltip.svelte.js +131 -0
  89. package/dist/components/tooltip/types.d.ts +23 -0
  90. package/dist/components/tooltip/types.js +1 -0
  91. package/dist/internal/assets.svelte.d.ts +1 -0
  92. package/dist/internal/assets.svelte.js +11 -0
  93. package/dist/internal/clickOutside.d.ts +9 -0
  94. package/dist/internal/clickOutside.js +34 -0
  95. package/dist/internal/index.d.ts +1 -0
  96. package/dist/internal/index.js +1 -0
  97. package/dist/internal/scroll.d.ts +1 -0
  98. package/dist/internal/scroll.js +6 -0
  99. package/dist/stores/index.d.ts +5 -0
  100. package/dist/stores/index.js +21 -2
  101. package/dist/style/animation.css +9 -0
  102. package/dist/style/css.js +3 -0
  103. package/dist/style/variable.css +12 -0
  104. package/package.json +6 -2
@@ -0,0 +1,116 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import { clickOutside } from '../../internal/clickOutside.js';
4
+ import { getPositions } from './dropdown.svelte.js';
5
+ import type { DropdownProps, ModelDropdownProps } from './types.js';
6
+
7
+ let {
8
+ children,
9
+ activator,
10
+ dark,
11
+ light,
12
+ rounded,
13
+ position,
14
+ closeOnClick,
15
+ openOnHover,
16
+ color,
17
+ background,
18
+ ...rest
19
+ }: DropdownProps = $props();
20
+
21
+ const positionAxis = getPositions();
22
+ const assets = getAssets();
23
+
24
+ let ref: HTMLElement | null = $state(null);
25
+ let refActivator: HTMLElement | PointerEvent | null = $state(null);
26
+ let open = $state(false);
27
+ let axis = $state({ x: 0, y: 0 });
28
+ let innerHeight = $state(0);
29
+ let innerWidth = $state(0);
30
+ let scrollX = $state(0);
31
+ let scrollY = $state(0);
32
+ let timeoutId: ReturnType<typeof setTimeout> | null = $state(null);
33
+
34
+ axis = positionAxis?.values;
35
+
36
+ let model: ModelDropdownProps = {
37
+ get open() {
38
+ return open;
39
+ },
40
+ close: () => (open = false),
41
+ toggle: (element) => handleToggle(element)
42
+ };
43
+
44
+ const handleToggle = (element: HTMLElement | PointerEvent | null) => {
45
+ if (element === null) return;
46
+ refActivator = element;
47
+ open = !open;
48
+ };
49
+
50
+ const handleClose = () => {
51
+ if (closeOnClick && open) open = false;
52
+ };
53
+
54
+ const handleMouseEvent = (
55
+ state: 'open' | 'close',
56
+ element: HTMLElement | PointerEvent | null
57
+ ) => {
58
+ console.log();
59
+ if (openOnHover && state === 'open') {
60
+ if (timeoutId) {
61
+ clearTimeout(timeoutId);
62
+ timeoutId = null;
63
+ }
64
+ refActivator = element;
65
+ open = true;
66
+ }
67
+
68
+ if (openOnHover && state === 'close') {
69
+ timeoutId = setTimeout(() => {
70
+ open = false;
71
+ timeoutId = null;
72
+ }, 150);
73
+ }
74
+ };
75
+
76
+ $effect(() => {
77
+ if (
78
+ open &&
79
+ ref &&
80
+ refActivator &&
81
+ (scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
82
+ ) {
83
+ positionAxis.update(refActivator, ref, position);
84
+ }
85
+ });
86
+
87
+ $effect(() => {
88
+ if (scrollX || scrollY) open = false;
89
+ });
90
+ </script>
91
+
92
+ <svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
93
+
94
+ {@render activator?.(model, (state, element) => handleMouseEvent(state, element))}
95
+
96
+ {#if open}
97
+ <div
98
+ bind:this={ref}
99
+ {...rest}
100
+ role="menu"
101
+ class={['kit-dropdown-content', light && 'light', dark && 'dark', rest.class]}
102
+ style={`transform: translate(${axis.x}px, ${axis.y}px);`}
103
+ onmouseover={() => handleMouseEvent('open', refActivator)}
104
+ onmouseleave={() => handleMouseEvent('close', refActivator)}
105
+ onclick={(e) => {
106
+ e.stopPropagation();
107
+ handleClose();
108
+ }}
109
+ style:--base={assets.color(background)}
110
+ style:--on={assets.color(color)}
111
+ style:--shape={assets.shape(rounded)}
112
+ use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
113
+ >
114
+ {@render children?.()}
115
+ </div>
116
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { DropdownProps } from './types.js';
2
+ declare const Dropdown: import("svelte").Component<DropdownProps, {}, "">;
3
+ type Dropdown = ReturnType<typeof Dropdown>;
4
+ export default Dropdown;
@@ -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,76 @@
1
+ .kit-icon {
2
+ --icon-size: 1rem;
3
+ --icon-color: var(--base, var(--kit-on-neutral));
4
+
5
+ display: inline-flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ transition: color 0.5s;
9
+ text-indent: 0;
10
+ }
11
+
12
+ .kit-icon:before {
13
+ font-size: calc(var(--icon-size-multiplier) * var(--icon-size));
14
+ color: var(--icon-color);
15
+ }
16
+
17
+ .kit-icon svg {
18
+ color: var(--icon-color);
19
+ }
20
+
21
+ .kit-icon svg,
22
+ .kit-icon img {
23
+ width: calc(var(--icon-size-multiplier) * var(--icon-size));
24
+ height: calc(var(--icon-size-multiplier) * var(--icon-size));
25
+ }
26
+
27
+ /* size */
28
+ .kit-icon[breakpoint]kit-icon--size-xs {
29
+ --icon-size-multiplier: 0.875;
30
+ }
31
+
32
+ .kit-icon[breakpoint]kit-icon--size-sm {
33
+ --icon-size-multiplier: 1;
34
+ }
35
+
36
+ .kit-icon[breakpoint]kit-icon--size-md {
37
+ --icon-size-multiplier: 1.125;
38
+ }
39
+
40
+ .kit-icon[breakpoint]kit-icon--size-lg {
41
+ --icon-size-multiplier: 1.25;
42
+ }
43
+
44
+ .kit-icon[breakpoint]kit-icon--size-xl {
45
+ --icon-size-multiplier: 1.5;
46
+ }
47
+
48
+ /* state */
49
+ .kit-icon.kit-icon--info {
50
+ --base: var(--kit-info);
51
+ }
52
+ .kit-icon.kit-icon--success {
53
+ --base: var(--kit-success);
54
+ }
55
+ .kit-icon.kit-icon--warning {
56
+ --base: var(--kit-warning);
57
+ }
58
+ .kit-icon.kit-icon--error {
59
+ --base: var(--kit-error);
60
+ }
61
+
62
+ /* disabled */
63
+ .kit-icon.kit-icon--disabled {
64
+ -webkit-user-select: none;
65
+ user-select: none;
66
+ pointer-events: none;
67
+ }
68
+
69
+ .kit-icon.kit-icon--disabled img {
70
+ opacity: 0.38;
71
+ }
72
+
73
+ .kit-icon.kit-icon--disabled svg,
74
+ .kit-icon.kit-icon--disabled:before {
75
+ color: color-mix(in oklab, var(--icon-color) 40%, transparent) !important;
76
+ }
@@ -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,17 @@
1
1
  export { default as App } from './app/app.svelte';
2
2
  export { default as Btn } 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';
@@ -1,3 +1,18 @@
1
1
  // components
2
2
  export { default as App } from './app/app.svelte';
3
3
  export { default as Btn } 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';
@@ -0,0 +1,195 @@
1
+ .kit-list {
2
+ --list-color: var(--on, var(--kit-on-neutral));
3
+ --list-background: var(--base, var(--kit-neutral));
4
+ --list-radius: var(--shape, var(--kit-radius-md));
5
+
6
+ display: flex;
7
+ width: 100%;
8
+ }
9
+
10
+ .kit-list.kit-list--nav {
11
+ padding-top: 8px;
12
+ padding-bottom: 8px;
13
+ padding-inline: 8px;
14
+ }
15
+
16
+ /* orientation */
17
+ .kit-list[breakpoint]kit-list--orientation-vertical {
18
+ flex-direction: column;
19
+ }
20
+ .kit-list[breakpoint]kit-list--orientation-horizontal {
21
+ flex-direction: row;
22
+ }
23
+ .kit-list[breakpoint]kit-list--orientation-horizontal .kit-list-item {
24
+ justify-content: center;
25
+ }
26
+
27
+ /* size */
28
+ .kit-list[breakpoint]kit-list--size-xs {
29
+ --list-height: 1.75rem;
30
+ --list-multiplier-y: 2;
31
+ --list-gap: 0.25rem;
32
+ font-size: 0.75rem;
33
+ }
34
+
35
+ .kit-list[breakpoint]kit-list--size-sm {
36
+ --list-height: 2rem;
37
+ --list-multiplier-y: 3;
38
+ --list-gap: 0.5rem;
39
+ font-size: 0.875rem;
40
+ }
41
+
42
+ .kit-list[breakpoint]kit-list--size-md {
43
+ --list-height: 2.25rem;
44
+ --list-multiplier-y: 4;
45
+ --list-gap: 0.5rem;
46
+ font-size: 0.875rem;
47
+ }
48
+
49
+ .kit-list[breakpoint]kit-list--size-lg {
50
+ --list-height: 2.5rem;
51
+ --list-multiplier-y: 5;
52
+ --list-gap: 0.5rem;
53
+ font-size: 1rem;
54
+ }
55
+
56
+ .kit-list[breakpoint]kit-list--size-xl {
57
+ --list-height: 2.75rem;
58
+ --list-multiplier-y: 6;
59
+ --list-gap: 0.675rem;
60
+ font-size: 1.125rem;
61
+ }
62
+
63
+ /* density */
64
+ .kit-list[breakpoint]kit-list--density-default .kit-list-item {
65
+ height: calc(var(--list-height));
66
+ min-width: calc(var(--list-height));
67
+ --list-spacing-x: 0;
68
+ --list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y));
69
+ }
70
+
71
+ .kit-list[breakpoint]kit-list--density-compact .kit-list-item {
72
+ height: calc(var(--list-height) - 0.25rem);
73
+ min-width: calc(var(--list-height - 0.25rem));
74
+ --list-spacing-x: 0;
75
+ --list-spacing-y: calc(var(--list-spacing) * var(--list-multiplier-y) - 0.25rem);
76
+ }
77
+
78
+ .kit-list[breakpoint]kit-list--density-comfortable .kit-list-item {
79
+ height: calc(var(--list-height) + 0.25rem);
80
+ min-width: calc(var(--list-height + 0.25rem));
81
+ --list-spacing-x: 0;
82
+ --list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y) + 0.25rem);
83
+ }
84
+
85
+ /* variant */
86
+ .kit-list[breakpoint]kit-list--variant-outline .kit-list-item {
87
+ --list-item-color: var(--base, var(--list-background, var(--kit-neutral)));
88
+ background-color: transparent;
89
+ border: 1px solid currentColor;
90
+ }
91
+
92
+ .kit-list[breakpoint]kit-list--variant-text .kit-list-item {
93
+ --list-item-color: var(--base, var(--list-background, var(--kit-neutral)));
94
+ background-color: transparent;
95
+ border-color: transparent;
96
+ }
97
+
98
+ .kit-list[breakpoint]kit-list--variant-dash .kit-list-item {
99
+ --list-item-color: var(--base, var(--list-background, var(--kit-neutral)));
100
+ background-color: transparent;
101
+ border: 1px dashed currentColor;
102
+ }
103
+
104
+ .kit-list[breakpoint]kit-list--variant-link .kit-list-item {
105
+ --list-item-color: var(--base, var(--list-background, var(--kit-neutral)));
106
+ background-color: transparent;
107
+ border-color: transparent;
108
+ }
109
+
110
+ /* events */
111
+ .kit-list:not([class*='list--variant-']) .kit-list-item.kit-list-item--active {
112
+ background-color: color-mix(in oklab, var(--list-item-background) 90%, var(--kit-scrim));
113
+ border-color: color-mix(in oklab, var(--list-item-background) 90%, var(--kit-scrim));
114
+ }
115
+ .kit-list[class*='list--variant-'] .kit-list-item.kit-list-item--active {
116
+ background-color: color-mix(in oklab, currentColor 15%, transparent);
117
+ border-color: color-mix(in oklab, currentColor 15%, transparent);
118
+ }
119
+
120
+ .kit-list:not([class*='list--variant-']) .kit-list-item:not(div):hover {
121
+ background-color: color-mix(in oklab, var(--list-item-background) 85%, var(--kit-scrim));
122
+ border-color: color-mix(in oklab, var(--list-item-background) 85%, var(--kit-scrim));
123
+ }
124
+ .kit-list[class*='list--variant-'] .kit-list-item:not(div):hover {
125
+ background-color: color-mix(in oklab, currentColor 25%, transparent);
126
+ }
127
+
128
+ /* disabled */
129
+ .kit-list .kit-list-item.kit-list-item--disabled,
130
+ .kit-list .kit-list-item[disabled],
131
+ .kit-list.kit-list--disabled .kit-list-item {
132
+ pointer-events: none;
133
+ user-select: none;
134
+ cursor: default;
135
+ }
136
+ .kit-list:not([class*='list--variant-']) .kit-list-item.kit-list-item--disabled {
137
+ color: color-mix(in oklab, var(--list-item-color) 40%, transparent) !important;
138
+ background-color: color-mix(in oklab, var(--list-item-background) 70%, transparent) !important;
139
+ border-color: color-mix(in oklab, var(--list-item-background) 70%, transparent) !important;
140
+ }
141
+ .kit-list:not([class*='list--variant-']) .kit-list-item.kit-list-item--disabled i:before {
142
+ color: color-mix(in oklab, var(--list-item-color) 40%, transparent) !important;
143
+ }
144
+ .kit-list[class*='list--variant-'] .kit-list-item.kit-list-item--disabled,
145
+ .kit-list[class*='list--variant-'] .kit-list-item.kit-list-item--disabled i:before {
146
+ color: color-mix(in oklab, var(--list-item-background) 40%, transparent) !important;
147
+ }
148
+
149
+ /* list item */
150
+ .kit-list .kit-list-item {
151
+ --list-item-color: var(--on, var(--list-color, var(--kit-on-neutral)));
152
+ --list-item-background: var(--base, var(--list-background, var(--kit-neutral)));
153
+ --list-item-radius: var(--shape, var(--list-radius, var(--kit-radius-md)));
154
+
155
+ display: inline-flex;
156
+ padding-top: var(--list-spacing-x);
157
+ padding-bottom: var(--list-spacing-x);
158
+ padding-right: var(--list-spacing-y);
159
+ padding-left: var(--list-spacing-y);
160
+ align-items: center;
161
+ white-space: nowrap;
162
+ gap: var(--list-gap);
163
+
164
+ border-width: 1px;
165
+ border-style: solid;
166
+ border-radius: var(--list-item-radius);
167
+
168
+ /* theme */
169
+ color: var(--list-item-color);
170
+ background-color: var(--list-item-background);
171
+ border-color: var(--list-item-background);
172
+ }
173
+
174
+ .kit-list .kit-list-item:not(div) {
175
+ cursor: pointer;
176
+ }
177
+
178
+ .kit-list .kit-list-item > .kit-list-item-content {
179
+ display: flex;
180
+ }
181
+
182
+ .kit-list .kit-list-item.kit-list-item--append:not(.kit-list-item--prepend) {
183
+ display: grid;
184
+ grid-template-columns: auto 1fr;
185
+ }
186
+
187
+ .kit-list .kit-list-item.kit-list-item--prepend:not(.kit-list-item--append) {
188
+ display: grid;
189
+ grid-template-columns: 1fr auto;
190
+ }
191
+
192
+ .kit-list .kit-list-item.kit-list-item--prepend.kit-list-item--append {
193
+ display: grid;
194
+ grid-template-columns: auto 1fr auto;
195
+ }