lapikit 0.0.0-insiders.dcdfb82 → 0.0.0-insiders.df219d7

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 (150) hide show
  1. package/LICENSE +21 -0
  2. package/bin/helper.js +64 -32
  3. package/bin/index.js +65 -0
  4. package/bin/lapikit.js +42 -10
  5. package/bin/modules/adapter.js +3 -3
  6. package/bin/modules/plugin.js +223 -0
  7. package/dist/actions/index.d.ts +1 -0
  8. package/dist/actions/index.js +1 -0
  9. package/dist/assets/icons/arrow-down.svelte +12 -0
  10. package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
  11. package/dist/assets/icons/arrow-up.svelte +12 -0
  12. package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
  13. package/dist/assets/icons/close-fill.svelte +12 -0
  14. package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
  15. package/dist/assets/icons/loading-fill.svelte +31 -0
  16. package/dist/assets/icons/loading-fill.svelte.d.ts +18 -0
  17. package/dist/components/accordion/accordion.css +113 -0
  18. package/dist/components/accordion/accordion.svelte +37 -0
  19. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  20. package/dist/components/accordion/accordion.svelte.js +24 -0
  21. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  22. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  23. package/dist/components/accordion/types.d.ts +33 -0
  24. package/dist/components/accordion/types.js +1 -0
  25. package/dist/components/alert/alert.css +137 -0
  26. package/dist/components/alert/alert.svelte +89 -0
  27. package/dist/components/alert/alert.svelte.d.ts +4 -0
  28. package/dist/components/alert/types.d.ts +28 -0
  29. package/dist/components/alert/types.js +1 -0
  30. package/dist/components/app/app.css +16 -0
  31. package/dist/components/app/app.svelte +43 -0
  32. package/dist/components/app/app.svelte.d.ts +7 -0
  33. package/dist/components/app/types.d.ts +4 -0
  34. package/dist/components/app/types.js +1 -0
  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 +247 -0
  51. package/dist/components/button/button.svelte +102 -0
  52. package/dist/components/button/button.svelte.d.ts +4 -0
  53. package/dist/components/button/types.d.ts +29 -0
  54. package/dist/components/button/types.js +1 -0
  55. package/dist/components/card/card.css +115 -0
  56. package/dist/components/card/card.svelte +63 -0
  57. package/dist/components/card/card.svelte.d.ts +4 -0
  58. package/dist/components/card/types.d.ts +18 -0
  59. package/dist/components/card/types.js +1 -0
  60. package/dist/components/chip/chip.css +231 -0
  61. package/dist/components/chip/chip.svelte +129 -0
  62. package/dist/components/chip/chip.svelte.d.ts +4 -0
  63. package/dist/components/chip/types.d.ts +31 -0
  64. package/dist/components/chip/types.js +1 -0
  65. package/dist/components/dialog/dialog.css +134 -0
  66. package/dist/components/dialog/dialog.svelte +67 -0
  67. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  68. package/dist/components/dialog/types.d.ts +24 -0
  69. package/dist/components/dialog/types.js +1 -0
  70. package/dist/components/dropdown/dropdown.css +22 -0
  71. package/dist/components/dropdown/dropdown.svelte +116 -0
  72. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  73. package/dist/components/dropdown/dropdown.svelte.js +148 -0
  74. package/dist/components/dropdown/types.d.ts +26 -0
  75. package/dist/components/dropdown/types.js +1 -0
  76. package/dist/components/icon/icon.css +79 -0
  77. package/dist/components/icon/icon.svelte +49 -0
  78. package/dist/components/icon/icon.svelte.d.ts +4 -0
  79. package/dist/components/icon/types.d.ts +16 -0
  80. package/dist/components/icon/types.js +1 -0
  81. package/dist/components/index.d.ts +22 -0
  82. package/dist/components/index.js +23 -0
  83. package/dist/components/list/list.css +221 -0
  84. package/dist/components/list/list.svelte +44 -0
  85. package/dist/components/list/list.svelte.d.ts +4 -0
  86. package/dist/components/list/modules/list-item.svelte +76 -0
  87. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  88. package/dist/components/list/types.d.ts +33 -0
  89. package/dist/components/list/types.js +1 -0
  90. package/dist/components/modal/modal.css +144 -0
  91. package/dist/components/modal/modal.svelte +113 -0
  92. package/dist/components/modal/modal.svelte.d.ts +4 -0
  93. package/dist/components/modal/types.d.ts +26 -0
  94. package/dist/components/modal/types.js +1 -0
  95. package/dist/components/popover/popover.css +22 -0
  96. package/dist/components/popover/popover.svelte +73 -0
  97. package/dist/components/popover/popover.svelte.d.ts +4 -0
  98. package/dist/components/popover/popover.svelte.js +134 -0
  99. package/dist/components/popover/types.d.ts +20 -0
  100. package/dist/components/popover/types.js +1 -0
  101. package/dist/components/separator/separator.css +46 -0
  102. package/dist/components/separator/separator.svelte +37 -0
  103. package/dist/components/separator/separator.svelte.d.ts +4 -0
  104. package/dist/components/separator/types.d.ts +11 -0
  105. package/dist/components/separator/types.js +1 -0
  106. package/dist/components/spacer/spacer.css +3 -0
  107. package/dist/components/spacer/spacer.svelte +7 -0
  108. package/dist/components/spacer/spacer.svelte.d.ts +4 -0
  109. package/dist/components/spacer/types.d.ts +4 -0
  110. package/dist/components/spacer/types.js +1 -0
  111. package/dist/components/textfield/textfield.css +305 -0
  112. package/dist/components/textfield/textfield.svelte +193 -0
  113. package/dist/components/textfield/textfield.svelte.d.ts +4 -0
  114. package/dist/components/textfield/types.d.ts +37 -0
  115. package/dist/components/textfield/types.js +1 -0
  116. package/dist/components/toolbar/toolbar.css +129 -0
  117. package/dist/components/toolbar/toolbar.svelte +47 -0
  118. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  119. package/dist/components/toolbar/types.d.ts +27 -0
  120. package/dist/components/toolbar/types.js +1 -0
  121. package/dist/components/tooltip/tooltip.css +124 -0
  122. package/dist/components/tooltip/tooltip.svelte +113 -0
  123. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  124. package/dist/components/tooltip/tooltip.svelte.js +131 -0
  125. package/dist/components/tooltip/types.d.ts +23 -0
  126. package/dist/components/tooltip/types.js +1 -0
  127. package/dist/internal/assets.svelte.d.ts +8 -0
  128. package/dist/internal/assets.svelte.js +54 -0
  129. package/dist/internal/clickOutside.d.ts +9 -0
  130. package/dist/internal/clickOutside.js +34 -0
  131. package/dist/internal/index.d.ts +2 -0
  132. package/dist/internal/index.js +2 -0
  133. package/dist/internal/ripple.d.ts +12 -0
  134. package/dist/internal/ripple.js +93 -0
  135. package/dist/internal/scroll.d.ts +1 -0
  136. package/dist/internal/scroll.js +6 -0
  137. package/dist/internal/types.d.ts +13 -0
  138. package/dist/internal/unit.d.ts +1 -0
  139. package/dist/internal/unit.js +11 -0
  140. package/dist/preset.js +16 -4
  141. package/dist/stores/index.d.ts +10 -0
  142. package/dist/stores/index.js +47 -0
  143. package/dist/style/animation.css +62 -0
  144. package/dist/style/css.js +6 -3
  145. package/dist/style/normalize.css +2 -0
  146. package/dist/style/parser/color.js +15 -4
  147. package/dist/style/parser/device.js +31 -19
  148. package/dist/style/variable.css +12 -0
  149. package/dist/utils/x11.d.ts +1 -1
  150. package/package.json +20 -3
@@ -0,0 +1,113 @@
1
+ <script lang="ts">
2
+ // import { disabledScroll } from '../../internal/index.js';
3
+ import { getAssets } from '../../internal/index.js';
4
+ import { modalOpen, modalStack, popModal, pushModal, setOpenModal } from '../../stores/index.js';
5
+ import { onDestroy } from 'svelte';
6
+ import type { ModalProps } from './types.js';
7
+ import { get } from 'svelte/store';
8
+
9
+ const modalId = crypto.randomUUID();
10
+ let wasPushed = $state(false);
11
+
12
+ let {
13
+ children,
14
+ ref = $bindable(),
15
+ open = $bindable(),
16
+ contain,
17
+ size = 'md',
18
+ persistent,
19
+ dark,
20
+ light,
21
+ classContent,
22
+ color,
23
+ background,
24
+ position = 'center',
25
+ rounded,
26
+ density = 'default',
27
+ closeWithEsc,
28
+ ...rest
29
+ }: ModalProps = $props();
30
+
31
+ const assets = getAssets();
32
+
33
+ $effect(() => {
34
+ if (open && !wasPushed) {
35
+ pushModal(modalId);
36
+ wasPushed = true;
37
+ } else if (!open && wasPushed) {
38
+ popModal(modalId);
39
+ wasPushed = false;
40
+ }
41
+ });
42
+
43
+ onDestroy(() => {
44
+ if (wasPushed) popModal(modalId);
45
+ });
46
+
47
+ $effect(() => {
48
+ if (open !== undefined && !contain)
49
+ setOpenModal(open ? (persistent ? 'persistent' : open) : open);
50
+ });
51
+
52
+ $effect(() => {
53
+ if ($modalOpen === false && !contain) open = false;
54
+ });
55
+
56
+ $effect(() => {
57
+ if (!closeWithEsc || persistent || !open) return;
58
+
59
+ const onKeyDown = (event: KeyboardEvent) => {
60
+ const stack = get(modalStack);
61
+ const isTop = stack[stack.length - 1] === modalId;
62
+
63
+ if (event.key === 'Escape' && isTop) {
64
+ event.preventDefault();
65
+ open = false;
66
+ }
67
+ };
68
+
69
+ document.addEventListener('keydown', onKeyDown);
70
+ return () => {
71
+ document.removeEventListener('keydown', onKeyDown);
72
+ };
73
+ });
74
+
75
+ const handleClose = () => {
76
+ if (!persistent) open = false;
77
+ };
78
+ </script>
79
+
80
+ {#if open}
81
+ <div
82
+ bind:this={ref}
83
+ {...rest}
84
+ class={['kit-modal', contain && 'kit-modal--contain', rest.class]}
85
+ role="dialog"
86
+ >
87
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
88
+ {#if contain}
89
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
90
+ <div
91
+ class={['kit-overlay', persistent && 'kit-overlay--persistent']}
92
+ onclick={() => handleClose()}
93
+ ></div>
94
+ {/if}
95
+
96
+ <div
97
+ class={[
98
+ 'kit-modal-container',
99
+ classContent,
100
+ light && 'light',
101
+ dark && 'dark',
102
+ size && assets.className('modal-container', 'size', size),
103
+ density && assets.className('modal-container', 'density', density),
104
+ position && assets.className('modal-container', 'position', position)
105
+ ]}
106
+ style:--base={assets.color(background)}
107
+ style:--on={assets.color(color)}
108
+ style:--shape={assets.shape(rounded)}
109
+ >
110
+ {@render children?.()}
111
+ </div>
112
+ </div>
113
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { ModalProps } from './types.js';
2
+ declare const Modal: import("svelte").Component<ModalProps, {}, "ref" | "open">;
3
+ type Modal = ReturnType<typeof Modal>;
4
+ export default Modal;
@@ -0,0 +1,26 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ type ModalPosition = 'bottom' | 'center' | 'top';
4
+ type ModalDensity = 'compact' | 'comfortable' | 'default';
5
+ export interface ModalProps extends Component {
6
+ ref?: HTMLDivElement;
7
+ open?: boolean;
8
+ classContent?: string | string[] | undefined;
9
+ size?: ModalSize | {
10
+ [key: string]: ModalSize;
11
+ };
12
+ persistent?: boolean;
13
+ position?: ModalPosition | {
14
+ [key: string]: ModalPosition;
15
+ };
16
+ dark?: boolean;
17
+ light?: boolean;
18
+ color?: string;
19
+ background?: string;
20
+ density?: ModalDensity | {
21
+ [key: string]: ModalDensity;
22
+ };
23
+ contain?: boolean;
24
+ closeWithEsc?: boolean;
25
+ }
26
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ .kit-popover-content {
2
+ --popover-color: var(--on, var(--kit-on-container));
3
+ --popover-background: var(--base, var(--kit-container));
4
+ --popover-radius: var(--shape, var(--kit-radius-md));
5
+
6
+ inset: 0px auto auto 0px;
7
+ margin: 0px;
8
+ position: fixed;
9
+ z-index: 9999;
10
+ display: inline-block;
11
+ width: auto;
12
+ opacity: 1;
13
+ transition-property: opacity, transform;
14
+ /* transition:
15
+ color 0.5s,
16
+ background-color 0.5s; */
17
+
18
+ /* theme */
19
+ background-color: var(--popover-background);
20
+ color: var(--popover-color);
21
+ border-radius: var(--popover-radius);
22
+ }
@@ -0,0 +1,73 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import { clickOutside } from '../../internal/clickOutside.js';
4
+ import { getPositions } from './popover.svelte.js';
5
+ import type { PopoverProps, ModelPopoverProps } from './types.js';
6
+
7
+ let {
8
+ open = $bindable(),
9
+ children,
10
+ activator,
11
+ dark,
12
+ light,
13
+ rounded,
14
+ position,
15
+ color,
16
+ background,
17
+ ...rest
18
+ }: PopoverProps = $props();
19
+
20
+ const positionAxis = getPositions();
21
+ const assets = getAssets();
22
+
23
+ let ref: HTMLElement | null = $state(null);
24
+ let refActivator: HTMLElement | null = $state(null);
25
+ let axis = $state({ x: 0, y: 0 });
26
+ let innerHeight = $state(0);
27
+ let innerWidth = $state(0);
28
+ let scrollX = $state(0);
29
+ let scrollY = $state(0);
30
+
31
+ axis = positionAxis?.values;
32
+
33
+ let model: ModelPopoverProps = {
34
+ toggle: (element) => handleToggle(element)
35
+ };
36
+
37
+ const handleToggle = (element: HTMLElement | null) => {
38
+ if (element === null) return;
39
+ refActivator = element;
40
+ open = !open;
41
+ };
42
+
43
+ $effect(() => {
44
+ if (
45
+ open &&
46
+ ref &&
47
+ refActivator &&
48
+ (scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
49
+ ) {
50
+ positionAxis.update(refActivator, ref, position);
51
+ }
52
+ });
53
+ </script>
54
+
55
+ <svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
56
+
57
+ {@render activator?.(model)}
58
+
59
+ {#if open}
60
+ <div
61
+ bind:this={ref}
62
+ {...rest}
63
+ role="menu"
64
+ class={['kit-popover-content', light && 'light', dark && 'dark', rest.class]}
65
+ style={`transform: translate(${axis.x}px, ${axis.y}px);`}
66
+ style:--base={assets.color(background)}
67
+ style:--on={assets.color(color)}
68
+ style:--shape={assets.shape(rounded)}
69
+ use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
70
+ >
71
+ {@render children?.()}
72
+ </div>
73
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { PopoverProps } from './types.js';
2
+ declare const Popover: import("svelte").Component<PopoverProps, {}, "open">;
3
+ type Popover = ReturnType<typeof Popover>;
4
+ export default Popover;
@@ -0,0 +1,134 @@
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
+ const activatorRect = activator.getBoundingClientRect();
19
+ const spacing = 6;
20
+ const _activator = activatorRect.y + activatorRect.height;
21
+ const _element = elementRect.height + spacing;
22
+ if (location === 'top' || location === 'bottom') {
23
+ if (avoidCollisions) {
24
+ if (location === 'top') {
25
+ if (activatorRect.y - _element < 0) {
26
+ axis.y = activatorRect.bottom + spacing;
27
+ axis.location = 'bottom';
28
+ }
29
+ else {
30
+ axis.y = activatorRect.top - _element;
31
+ axis.location = 'top';
32
+ }
33
+ }
34
+ else {
35
+ if (_activator + _element > innerHeight.current) {
36
+ axis.y = activatorRect.top - _element;
37
+ axis.location = 'top';
38
+ }
39
+ else {
40
+ axis.y = activatorRect.bottom + spacing;
41
+ axis.location = 'bottom';
42
+ }
43
+ }
44
+ }
45
+ else {
46
+ if (location === 'top') {
47
+ axis.y = activatorRect.top - _element;
48
+ axis.location = 'top';
49
+ }
50
+ else {
51
+ axis.y = activatorRect.bottom + spacing;
52
+ axis.location = 'bottom';
53
+ }
54
+ }
55
+ if (centered &&
56
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
57
+ activatorRect.left + elementRect.width < innerWidth.current) {
58
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
59
+ }
60
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
61
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
62
+ }
63
+ else {
64
+ axis.x = activatorRect.left;
65
+ }
66
+ }
67
+ else if (location === 'left' || location === 'right') {
68
+ if (avoidCollisions) {
69
+ if (location === 'left' && !(activatorRect.left - elementRect.width < 0)) {
70
+ axis.x = activatorRect.left - (elementRect.width + spacing);
71
+ axis.location = 'left';
72
+ }
73
+ else {
74
+ if (activatorRect.left + activatorRect.width + elementRect.width + spacing >
75
+ innerWidth.current) {
76
+ axis.x = activatorRect.left - (elementRect.width + spacing);
77
+ axis.location = 'left';
78
+ }
79
+ else {
80
+ axis.x = activatorRect.left + activatorRect.width + spacing;
81
+ axis.location = 'right';
82
+ }
83
+ }
84
+ }
85
+ else {
86
+ if (location === 'left') {
87
+ axis.x = activatorRect.left - (elementRect.width + spacing);
88
+ axis.location = 'left';
89
+ }
90
+ else {
91
+ axis.x = activatorRect.left + activatorRect.width + spacing;
92
+ axis.location = 'right';
93
+ }
94
+ }
95
+ if (centered &&
96
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
97
+ activatorRect.top + elementRect.height < innerHeight.current) {
98
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
99
+ }
100
+ else if (activatorRect.y + elementRect.height > innerHeight.current) {
101
+ axis.y = activatorRect.y - elementRect.height + activatorRect.height;
102
+ }
103
+ else {
104
+ axis.y = activatorRect.y;
105
+ }
106
+ }
107
+ else {
108
+ if (centered &&
109
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
110
+ activatorRect.left + elementRect.width < innerWidth.current) {
111
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
112
+ }
113
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
114
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
115
+ }
116
+ else {
117
+ axis.x = activatorRect.left;
118
+ }
119
+ if (centered &&
120
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
121
+ activatorRect.top + elementRect.height < innerHeight.current) {
122
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
123
+ }
124
+ else if (activatorRect.bottom + elementRect.height > innerHeight.current) {
125
+ axis.y = activatorRect.top - elementRect.height;
126
+ }
127
+ else {
128
+ axis.y = activatorRect.bottom;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ };
134
+ }
@@ -0,0 +1,20 @@
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 PopoverProps extends Component {
9
+ open?: boolean;
10
+ dark?: boolean;
11
+ light?: boolean;
12
+ rounded?: string;
13
+ position?: 'top' | 'bottom' | 'left' | 'right';
14
+ color?: string;
15
+ background?: string;
16
+ activator?: Snippet<[ModelPopoverProps]>;
17
+ }
18
+ export type ModelPopoverProps = {
19
+ toggle: (element: HTMLElement | null) => void;
20
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ .kit-separator {
2
+ --separator-opacity: var(--opacity, 0.12);
3
+ --separator-color: var(--base, var(--kit-scrim));
4
+
5
+ display: block;
6
+ flex: 1 1 100%;
7
+ height: 0px;
8
+ max-height: 0px;
9
+ opacity: var(--separator-opacity);
10
+ transition: inherit;
11
+ border-color: var(--separator-color);
12
+ /* transition: border-color 0.5s; */
13
+ border-style: solid;
14
+ }
15
+
16
+ .kit-separator:not(.kit-separator--orientation-vertical) {
17
+ border-width: var(--border-top-width, thin) 0 0 0;
18
+ }
19
+
20
+ .kit-separator--orientation-vertical {
21
+ align-self: stretch;
22
+ border-width: 0 thin 0 0;
23
+ display: inline-flex;
24
+ height: auto;
25
+ margin-left: 0px;
26
+ max-height: 100%;
27
+ max-width: 0px;
28
+ vertical-align: text-bottom;
29
+ width: 0px;
30
+ border-width: 0 var(--border-right-width, thin) 0 0;
31
+ }
32
+
33
+ .kit-separator--inset:not(.kit-separator--orientation-vertical) {
34
+ max-width: calc(100% - 4.5rem);
35
+ margin-inline-start: 4.5rem;
36
+ }
37
+
38
+ .kit-separator--inset.kit-separator--orientation-vertical {
39
+ margin-bottom: 0.5rem;
40
+ margin-top: 0.5rem;
41
+ max-height: calc(100% - 1rem);
42
+ }
43
+
44
+ .kit-separator:not(.kit-separator--orientation-vertical) {
45
+ width: 100%;
46
+ }
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/index.js';
3
+ import type { SeparatorProps } from './types.js';
4
+
5
+ let {
6
+ is = 'hr',
7
+ light,
8
+ dark,
9
+ inset,
10
+ thickness,
11
+ orientation = 'horizontal',
12
+ opacity,
13
+ color,
14
+ ...rest
15
+ }: SeparatorProps = $props();
16
+
17
+ const assets = getAssets();
18
+ </script>
19
+
20
+ <svelte:element
21
+ this={is}
22
+ {...rest}
23
+ class={[
24
+ 'kit-separator',
25
+ light && 'light',
26
+ dark && 'dark',
27
+ inset && 'kit-separator--inset',
28
+ orientation && assets.className('separator', 'orientation', orientation),
29
+ rest.class
30
+ ]}
31
+ aria-orientation={orientation}
32
+ role="separator"
33
+ style:--base={assets.color(color)}
34
+ style:--opacity={opacity}
35
+ style:--border-top-width={orientation === 'horizontal' ? assets.unit(thickness) : undefined}
36
+ style:--border-right-width={orientation === 'vertical' ? assets.unit(thickness) : undefined}
37
+ />
@@ -0,0 +1,4 @@
1
+ import type { SeparatorProps } from './types.js';
2
+ declare const Separator: import("svelte").Component<SeparatorProps, {}, "">;
3
+ type Separator = ReturnType<typeof Separator>;
4
+ export default Separator;
@@ -0,0 +1,11 @@
1
+ import type { Base } from '../../internal/types.js';
2
+ export interface SeparatorProps extends Base {
3
+ is?: 'div' | 'hr';
4
+ light?: boolean;
5
+ dark?: boolean;
6
+ inset?: boolean;
7
+ thickness?: string;
8
+ opacity?: string | number;
9
+ color?: string;
10
+ orientation?: 'horizontal' | 'vertical';
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ .kit-spacer {
2
+ flex-grow: 1;
3
+ }
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { SpacerProps } from './types.js';
3
+
4
+ let { is = 'div', ...rest }: SpacerProps = $props();
5
+ </script>
6
+
7
+ <svelte:element this={is} {...rest} class={['kit-spacer', rest.class]}> </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { SpacerProps } from './types.js';
2
+ declare const Spacer: import("svelte").Component<SpacerProps, {}, "">;
3
+ type Spacer = ReturnType<typeof Spacer>;
4
+ export default Spacer;
@@ -0,0 +1,4 @@
1
+ import type { Base } from '../../internal/types.js';
2
+ export interface SpacerProps extends Base {
3
+ is?: 'div';
4
+ }
@@ -0,0 +1 @@
1
+ export {};