lapikit 0.0.0-insiders.13c16e2

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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/bin/helper.js +74 -0
  4. package/bin/lapikit.js +54 -0
  5. package/bin/modules/adapter.js +52 -0
  6. package/bin/modules/preset.js +11 -0
  7. package/dist/app.d.ts +13 -0
  8. package/dist/app.html +12 -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/app/app.css +16 -0
  12. package/dist/components/app/app.svelte +23 -0
  13. package/dist/components/app/app.svelte.d.ts +7 -0
  14. package/dist/components/app/types.d.ts +4 -0
  15. package/dist/components/app/types.js +1 -0
  16. package/dist/components/button/button.css +276 -0
  17. package/dist/components/button/button.svelte +94 -0
  18. package/dist/components/button/button.svelte.d.ts +4 -0
  19. package/dist/components/button/types.d.ts +27 -0
  20. package/dist/components/button/types.js +1 -0
  21. package/dist/components/dialog/dialog.css +134 -0
  22. package/dist/components/dialog/dialog.svelte +67 -0
  23. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  24. package/dist/components/dialog/types.d.ts +21 -0
  25. package/dist/components/dialog/types.js +1 -0
  26. package/dist/components/dropdown/dropdown.css +22 -0
  27. package/dist/components/dropdown/dropdown.svelte +116 -0
  28. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  29. package/dist/components/dropdown/dropdown.svelte.js +148 -0
  30. package/dist/components/dropdown/types.d.ts +26 -0
  31. package/dist/components/dropdown/types.js +1 -0
  32. package/dist/components/icon/icon.css +76 -0
  33. package/dist/components/icon/icon.svelte +49 -0
  34. package/dist/components/icon/icon.svelte.d.ts +4 -0
  35. package/dist/components/icon/types.d.ts +16 -0
  36. package/dist/components/icon/types.js +1 -0
  37. package/dist/components/index.d.ts +9 -0
  38. package/dist/components/index.js +10 -0
  39. package/dist/components/modal/modal.css +95 -0
  40. package/dist/components/modal/modal.svelte +87 -0
  41. package/dist/components/modal/modal.svelte.d.ts +4 -0
  42. package/dist/components/modal/types.d.ts +21 -0
  43. package/dist/components/modal/types.js +1 -0
  44. package/dist/components/popover/popover.css +22 -0
  45. package/dist/components/popover/popover.svelte +73 -0
  46. package/dist/components/popover/popover.svelte.d.ts +4 -0
  47. package/dist/components/popover/popover.svelte.js +134 -0
  48. package/dist/components/popover/types.d.ts +20 -0
  49. package/dist/components/popover/types.js +1 -0
  50. package/dist/components/separator/separator.css +46 -0
  51. package/dist/components/separator/separator.svelte +37 -0
  52. package/dist/components/separator/separator.svelte.d.ts +4 -0
  53. package/dist/components/separator/types.d.ts +11 -0
  54. package/dist/components/separator/types.js +1 -0
  55. package/dist/components/tooltip/tooltip.css +124 -0
  56. package/dist/components/tooltip/tooltip.svelte +113 -0
  57. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  58. package/dist/components/tooltip/tooltip.svelte.js +131 -0
  59. package/dist/components/tooltip/types.d.ts +23 -0
  60. package/dist/components/tooltip/types.js +1 -0
  61. package/dist/index.d.ts +1 -0
  62. package/dist/index.js +4 -0
  63. package/dist/internal/ansi.d.ts +40 -0
  64. package/dist/internal/ansi.js +44 -0
  65. package/dist/internal/assets.svelte.d.ts +8 -0
  66. package/dist/internal/assets.svelte.js +52 -0
  67. package/dist/internal/clickOutside.d.ts +9 -0
  68. package/dist/internal/clickOutside.js +34 -0
  69. package/dist/internal/colors.d.ts +1 -0
  70. package/dist/internal/colors.js +50 -0
  71. package/dist/internal/index.d.ts +4 -0
  72. package/dist/internal/index.js +4 -0
  73. package/dist/internal/minify.d.ts +1 -0
  74. package/dist/internal/minify.js +10 -0
  75. package/dist/internal/scroll.d.ts +1 -0
  76. package/dist/internal/scroll.js +6 -0
  77. package/dist/internal/terminal.d.ts +1 -0
  78. package/dist/internal/terminal.js +12 -0
  79. package/dist/internal/types.d.ts +57 -0
  80. package/dist/internal/types.js +1 -0
  81. package/dist/plugin/modules/config.d.ts +2 -0
  82. package/dist/plugin/modules/config.js +54 -0
  83. package/dist/plugin/modules/importer.d.ts +1 -0
  84. package/dist/plugin/modules/importer.js +15 -0
  85. package/dist/plugin/vitejs.d.ts +6 -0
  86. package/dist/plugin/vitejs.js +26 -0
  87. package/dist/preset.d.ts +2 -0
  88. package/dist/preset.js +92 -0
  89. package/dist/stores/index.d.ts +6 -0
  90. package/dist/stores/index.js +28 -0
  91. package/dist/style/animation.css +20 -0
  92. package/dist/style/css.d.ts +2 -0
  93. package/dist/style/css.js +34 -0
  94. package/dist/style/normalize.css +123 -0
  95. package/dist/style/parser/color.d.ts +5 -0
  96. package/dist/style/parser/color.js +88 -0
  97. package/dist/style/parser/component.d.ts +2 -0
  98. package/dist/style/parser/component.js +115 -0
  99. package/dist/style/parser/device.d.ts +2 -0
  100. package/dist/style/parser/device.js +28 -0
  101. package/dist/style/parser/index.d.ts +4 -0
  102. package/dist/style/parser/index.js +4 -0
  103. package/dist/style/parser/variable.d.ts +2 -0
  104. package/dist/style/parser/variable.js +25 -0
  105. package/dist/style/variable.css +12 -0
  106. package/dist/styles.css +0 -0
  107. package/dist/utils/x11.d.ts +4 -0
  108. package/dist/utils/x11.js +151 -0
  109. package/package.json +89 -0
@@ -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,124 @@
1
+ .kit-tooltip {
2
+ inset: 0px auto auto 0px;
3
+ margin: 0px;
4
+ position: fixed;
5
+ z-index: 2000;
6
+ }
7
+
8
+ .kit-tooltip-content {
9
+ --tooltip-color: var(--on, var(--kit-on-neutral));
10
+ --tooltip-background: var(--base, var(--kit-neutral));
11
+ --tooltip-radius: var(--shape, var(--kit-radius-md));
12
+
13
+ background-color: var(--tooltip-background);
14
+ color: var(--tooltip-color);
15
+ border-radius: var(--tooltip-radius);
16
+ border: 1px solid var(--tooltip-background);
17
+ font-size: 0.875rem;
18
+ display: inline-block;
19
+ width: auto;
20
+ pointer-events: none;
21
+ overflow-wrap: break-word;
22
+ transition:
23
+ color 0.5s,
24
+ border-color 0.5s,
25
+ background-color 0.5s;
26
+ box-shadow: 0px 16px 29px -10px color-mix(in oklab, var(--kit-scrim) 60%, transparent);
27
+ }
28
+
29
+ /* density */
30
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-default {
31
+ padding: 0.15rem 0.625rem;
32
+ }
33
+
34
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-compact {
35
+ padding: 0.125rem 0.5rem;
36
+ }
37
+
38
+ .kit-tooltip-content[breakpoint]kit-tooltip-content--density-comfortable {
39
+ padding: 0.35rem 0.75rem;
40
+ }
41
+
42
+ .kit-tooltip-content--arrow::after {
43
+ content: ' ';
44
+ position: absolute;
45
+ border-style: solid;
46
+ }
47
+
48
+ .kit-tooltip-content--arrow.kit-tooltip-content--bottom::after,
49
+ .kit-tooltip-content--arrow.kit-tooltip-content--top::after {
50
+ left: 50%;
51
+ margin-left: -0.35rem;
52
+ border-width: 0.35rem;
53
+ }
54
+
55
+ .kit-tooltip-content--arrow.kit-tooltip-content--bottom::after {
56
+ bottom: 100%;
57
+ border-color: transparent transparent var(--tooltip-background) transparent;
58
+ }
59
+
60
+ .kit-tooltip-content--arrow.kit-tooltip-content--top::after {
61
+ top: 100%;
62
+ border-color: var(--tooltip-background) transparent transparent transparent;
63
+ }
64
+
65
+ .kit-tooltip-content--arrow.kit-tooltip-content--left::after,
66
+ .kit-tooltip-content--arrow.kit-tooltip-content--right::after {
67
+ top: 50%;
68
+ margin-top: -0.35rem;
69
+ border-width: 0.35rem;
70
+ }
71
+
72
+ .kit-tooltip-content--arrow.kit-tooltip-content--right::after {
73
+ right: 100%;
74
+ border-color: transparent var(--tooltip-background) transparent transparent;
75
+ }
76
+
77
+ .kit-tooltip-content--arrow.kit-tooltip-content--left::after {
78
+ left: 100%;
79
+ border-color: transparent transparent transparent var(--tooltip-background);
80
+ }
81
+
82
+ .kit-tooltip-content--top,
83
+ .kit-tooltip-content--bottom,
84
+ .kit-tooltip-content--right,
85
+ .kit-tooltip-content--left {
86
+ animation-duration: 150ms;
87
+ animation-name: enter;
88
+ }
89
+
90
+ .kit-tooltip-content--top {
91
+ --animate-enter-pos1: 0;
92
+ --animate-enter-pos2: 0.5rem;
93
+ --animate-enter-pos3: 0;
94
+ }
95
+
96
+ .kit-tooltip-content--bottom {
97
+ --animate-enter-pos1: 0;
98
+ --animate-enter-pos2: -0.5rem;
99
+ --animate-enter-pos3: 0;
100
+ }
101
+
102
+ .kit-tooltip-content--right {
103
+ --animate-enter-pos1: -0.5rem;
104
+ --animate-enter-pos2: 0;
105
+ --animate-enter-pos3: 0;
106
+ }
107
+
108
+ .kit-tooltip-content--left {
109
+ --animate-enter-pos1: 0.5rem;
110
+ --animate-enter-pos2: 0;
111
+ --animate-enter-pos3: 0;
112
+ }
113
+
114
+ @keyframes enter {
115
+ 0% {
116
+ opacity: 0;
117
+ transform: translate3d(
118
+ var(--animate-enter-pos1),
119
+ var(--animate-enter-pos2),
120
+ var(--animate-enter-pos3)
121
+ )
122
+ scale3d(0.95, 0.95, 0.95) rotate(0);
123
+ }
124
+ }
@@ -0,0 +1,113 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import { getPositionsTooltip } from './tooltip.svelte.js';
4
+ import type { PositionElement, TooltipProps } from './types.js';
5
+
6
+ let {
7
+ children,
8
+ tooltip,
9
+ open = $bindable(),
10
+ label,
11
+ dark,
12
+ light,
13
+ rounded,
14
+ color,
15
+ background,
16
+ location = 'bottom',
17
+ delayDuration = 850,
18
+ density = 'default',
19
+ variant,
20
+ disabled,
21
+ avoidCollisions = true,
22
+ forceMount,
23
+ ...rest
24
+ }: TooltipProps = $props();
25
+
26
+ const positionAxis = getPositionsTooltip();
27
+ const assets = getAssets();
28
+
29
+ let ref: HTMLElement | null = $state(null);
30
+ let refTooltip: HTMLElement | null = $state(null);
31
+ let timer: ReturnType<typeof setTimeout> | null = $state(null);
32
+ let axis: PositionElement = $state({ x: 0, y: 0, location: null });
33
+ let innerHeight = $state(0);
34
+ let innerWidth = $state(0);
35
+ let scrollX = $state(0);
36
+ let scrollY = $state(0);
37
+
38
+ axis = positionAxis?.values;
39
+
40
+ $effect(() => {
41
+ if (
42
+ open &&
43
+ ref &&
44
+ refTooltip &&
45
+ (scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
46
+ ) {
47
+ positionAxis.update(ref, refTooltip, location, true, avoidCollisions);
48
+ }
49
+ });
50
+
51
+ $effect(() => {
52
+ if (tooltip) forceMount = true;
53
+ });
54
+
55
+ const handleMouse = (state: string) => {
56
+ if (disabled) return (open = false);
57
+ if (state === 'enter') {
58
+ timer = setTimeout(() => {
59
+ open = true;
60
+ }, delayDuration);
61
+ } else if (state === 'leave') {
62
+ if (timer) {
63
+ clearTimeout(timer);
64
+ timer = null;
65
+ }
66
+ open = false;
67
+ }
68
+ };
69
+ </script>
70
+
71
+ <svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
72
+
73
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
74
+ <span
75
+ bind:this={ref}
76
+ onmouseenter={() => handleMouse('enter')}
77
+ onmouseleave={() => handleMouse('leave')}
78
+ style:display="inline-flex"
79
+ >
80
+ {@render children?.()}
81
+ </span>
82
+
83
+ {#if open || forceMount}
84
+ <div
85
+ bind:this={refTooltip}
86
+ class={['kit-tooltip']}
87
+ role="tooltip"
88
+ aria-label={label}
89
+ style={`transform: translate(${axis.x}px, ${axis.y}px);display: ${open ? 'initial' : 'none'}`}
90
+ >
91
+ <div
92
+ class={[
93
+ 'kit-tooltip-content animate-in',
94
+ light && 'light',
95
+ dark && 'dark',
96
+ rounded && assets.shape(rounded),
97
+ axis?.location && `kit-tooltip-content--${axis?.location}`,
98
+ variant && `kit-tooltip-content--${variant}`,
99
+ density && assets.className('tooltip-content', 'density', density),
100
+ rest.class
101
+ ]}
102
+ style:--base={assets.color(background)}
103
+ style:--on={assets.color(color)}
104
+ style:--shape={assets.shape(rounded)}
105
+ >
106
+ {#if tooltip}
107
+ {@render tooltip?.()}
108
+ {:else}
109
+ {label}
110
+ {/if}
111
+ </div>
112
+ </div>
113
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { TooltipProps } from './types.js';
2
+ declare const Tooltip: import("svelte").Component<TooltipProps, {}, "open">;
3
+ type Tooltip = ReturnType<typeof Tooltip>;
4
+ export default Tooltip;
@@ -0,0 +1,131 @@
1
+ import { innerWidth, innerHeight } from 'svelte/reactivity/window';
2
+ export function getPositionsTooltip() {
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
+ const activatorRect = activator.getBoundingClientRect();
18
+ const spacing = 6;
19
+ if (location === 'top' || location === 'bottom') {
20
+ if (avoidCollisions) {
21
+ if (location === 'top') {
22
+ if (activatorRect.y - (elementRect.height + spacing) < 0) {
23
+ axis.y = activatorRect.bottom + spacing;
24
+ axis.location = 'bottom';
25
+ }
26
+ else {
27
+ axis.y = activatorRect.top - (elementRect.height + spacing);
28
+ axis.location = 'top';
29
+ }
30
+ }
31
+ else {
32
+ if (activatorRect.y + activatorRect.height + (elementRect.height + spacing) >
33
+ innerHeight.current) {
34
+ axis.y = activatorRect.top - (elementRect.height + spacing);
35
+ axis.location = 'top';
36
+ }
37
+ else {
38
+ axis.y = activatorRect.bottom + spacing;
39
+ axis.location = 'bottom';
40
+ }
41
+ }
42
+ }
43
+ else {
44
+ if (location === 'top') {
45
+ axis.y = activatorRect.top - (elementRect.height + spacing);
46
+ axis.location = 'top';
47
+ }
48
+ else {
49
+ axis.y = activatorRect.bottom + spacing;
50
+ axis.location = 'bottom';
51
+ }
52
+ }
53
+ if (centered &&
54
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
55
+ activatorRect.left + elementRect.width < innerWidth.current) {
56
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
57
+ }
58
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
59
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
60
+ }
61
+ else {
62
+ axis.x = activatorRect.left;
63
+ }
64
+ }
65
+ else if (location === 'left' || location === 'right') {
66
+ if (avoidCollisions) {
67
+ if (location === 'left' && !(activatorRect.left - elementRect.width < 0)) {
68
+ axis.x = activatorRect.left - (elementRect.width + spacing);
69
+ axis.location = 'left';
70
+ }
71
+ else {
72
+ if (activatorRect.left + activatorRect.width + elementRect.width + spacing >
73
+ innerWidth.current) {
74
+ axis.x = activatorRect.left - (elementRect.width + spacing);
75
+ axis.location = 'left';
76
+ }
77
+ else {
78
+ axis.x = activatorRect.left + activatorRect.width + spacing;
79
+ axis.location = 'right';
80
+ }
81
+ }
82
+ }
83
+ else {
84
+ if (location === 'left') {
85
+ axis.x = activatorRect.left - (elementRect.width + spacing);
86
+ axis.location = 'left';
87
+ }
88
+ else {
89
+ axis.x = activatorRect.left + activatorRect.width + spacing;
90
+ axis.location = 'right';
91
+ }
92
+ }
93
+ if (centered &&
94
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
95
+ activatorRect.top + elementRect.height < innerHeight.current) {
96
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
97
+ }
98
+ else if (activatorRect.y + elementRect.height > innerHeight.current) {
99
+ axis.y = activatorRect.y - elementRect.height + activatorRect.height;
100
+ }
101
+ else {
102
+ axis.y = activatorRect.y;
103
+ }
104
+ }
105
+ else {
106
+ if (centered &&
107
+ activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
108
+ activatorRect.left + elementRect.width < innerWidth.current) {
109
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
110
+ }
111
+ else if (activatorRect.left + elementRect.width > innerWidth.current) {
112
+ axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
113
+ }
114
+ else {
115
+ axis.x = activatorRect.left;
116
+ }
117
+ if (centered &&
118
+ activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
119
+ activatorRect.top + elementRect.height < innerHeight.current) {
120
+ axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
121
+ }
122
+ else if (activatorRect.bottom + elementRect.height > innerHeight.current) {
123
+ axis.y = activatorRect.top - elementRect.height;
124
+ }
125
+ else {
126
+ axis.y = activatorRect.bottom;
127
+ }
128
+ }
129
+ }
130
+ };
131
+ }
@@ -0,0 +1,23 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ import type { Snippet } from 'svelte';
3
+ export interface TooltipProps extends Component {
4
+ open?: boolean;
5
+ dark?: boolean;
6
+ light?: boolean;
7
+ rounded?: string;
8
+ label?: string;
9
+ location?: 'top' | 'bottom' | 'left' | 'right';
10
+ color?: string;
11
+ background?: string;
12
+ delayDuration?: number;
13
+ variant?: 'arrow';
14
+ density?: 'compact' | 'comfortable' | 'default';
15
+ disabled?: boolean;
16
+ avoidCollisions?: boolean;
17
+ tooltip?: Snippet;
18
+ }
19
+ export type PositionElement = {
20
+ x: number;
21
+ y: number;
22
+ location: string | null;
23
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function helloWorld(): void;
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // Reexport your entry components here
2
+ export function helloWorld() {
3
+ console.log('Hello world, this is lapikit!');
4
+ }
@@ -0,0 +1,40 @@
1
+ export declare const ansi: {
2
+ color: {
3
+ red: (text: string) => string;
4
+ green: (text: string) => string;
5
+ yellow: (text: string) => string;
6
+ blue: (text: string) => string;
7
+ purple: (text: string) => string;
8
+ cyan: (text: string) => string;
9
+ };
10
+ variant: {
11
+ bold: (text: string) => string;
12
+ underline: (text: string) => string;
13
+ inverse: (text: string) => string;
14
+ };
15
+ bold: {
16
+ red: (text: string) => string;
17
+ green: (text: string) => string;
18
+ yellow: (text: string) => string;
19
+ blue: (text: string) => string;
20
+ purple: (text: string) => string;
21
+ cyan: (text: string) => string;
22
+ };
23
+ inverse: {
24
+ red: (text: string) => string;
25
+ green: (text: string) => string;
26
+ yellow: (text: string) => string;
27
+ blue: (text: string) => string;
28
+ purple: (text: string) => string;
29
+ cyan: (text: string) => string;
30
+ };
31
+ underline: {
32
+ red: (text: string) => string;
33
+ green: (text: string) => string;
34
+ yellow: (text: string) => string;
35
+ blue: (text: string) => string;
36
+ purple: (text: string) => string;
37
+ cyan: (text: string) => string;
38
+ };
39
+ };
40
+ export type Ansi = typeof ansi;
@@ -0,0 +1,44 @@
1
+ const color = {
2
+ red: (text) => `\x1b[31m${text}\x1b[0m`,
3
+ green: (text) => `\x1b[32m${text}\x1b[0m`,
4
+ yellow: (text) => `\x1b[33m${text}\x1b[0m`,
5
+ blue: (text) => `\x1b[34m${text}\x1b[0m`,
6
+ purple: (text) => `\x1b[35m${text}\x1b[0m`,
7
+ cyan: (text) => `\x1b[36m${text}\x1b[0m`
8
+ };
9
+ const variant = {
10
+ bold: (text) => `\x1b[1m${text}\x1b[0m`,
11
+ underline: (text) => `\x1b[4m${text}\x1b[0m`,
12
+ inverse: (text) => `\x1b[7m${text}\x1b[0m`
13
+ };
14
+ const bold = {
15
+ red: (text) => `\x1b[1m\x1b[31m${text}\x1b[0m`,
16
+ green: (text) => `\x1b[1m\x1b[32m${text}\x1b[0m`,
17
+ yellow: (text) => `\x1b[1m\x1b[33m${text}\x1b[0m`,
18
+ blue: (text) => `\x1b[1m\x1b[34m${text}\x1b[0m`,
19
+ purple: (text) => `\x1b[1m\x1b[35m${text}\x1b[0m`,
20
+ cyan: (text) => `\x1b[1m\x1b[36m${text}\x1b[0m`
21
+ };
22
+ const inverse = {
23
+ red: (text) => `\x1b[7m\x1b[31m${text}\x1b[0m`,
24
+ green: (text) => `\x1b[7m\x1b[32m${text}\x1b[0m`,
25
+ yellow: (text) => `\x1b[7m\x1b[33m${text}\x1b[0m`,
26
+ blue: (text) => `\x1b[7m\x1b[34m${text}\x1b[0m`,
27
+ purple: (text) => `\x1b[7m\x1b[35m${text}\x1b[0m`,
28
+ cyan: (text) => `\x1b[7m\x1b[36m${text}\x1b[0m`
29
+ };
30
+ const underline = {
31
+ red: (text) => `\x1b[4m\x1b[31m${text}\x1b[0m`,
32
+ green: (text) => `\x1b[4m\x1b[32m${text}\x1b[0m`,
33
+ yellow: (text) => `\x1b[4m\x1b[33m${text}\x1b[0m`,
34
+ blue: (text) => `\x1b[4m\x1b[34m${text}\x1b[0m`,
35
+ purple: (text) => `\x1b[4m\x1b[35m${text}\x1b[0m`,
36
+ cyan: (text) => `\x1b[4m\x1b[36m${text}\x1b[0m`
37
+ };
38
+ export const ansi = {
39
+ color,
40
+ variant,
41
+ bold,
42
+ inverse,
43
+ underline
44
+ };
@@ -0,0 +1,8 @@
1
+ export declare function getAssets(): {
2
+ shape(params?: string): string | undefined;
3
+ className(key: string, type: string, value: string | boolean | Array<string> | {
4
+ [key: string]: string;
5
+ }): string | undefined;
6
+ color(color?: string): string | undefined;
7
+ unit(value?: string | number): string | undefined;
8
+ };
@@ -0,0 +1,52 @@
1
+ import { x11ColorNames } from '../utils/x11.js';
2
+ export function getAssets() {
3
+ return {
4
+ shape(params) {
5
+ if (params) {
6
+ if (params === 'none' || params == '0')
7
+ return '0';
8
+ return `var(--kit-radius-${params})`;
9
+ }
10
+ },
11
+ className(key, type, value) {
12
+ if (typeof value === 'string')
13
+ return `kit-${key}--${type}-${value}`;
14
+ else if (typeof value === 'boolean' && value)
15
+ return `kit-${key}--${type}`;
16
+ else if (typeof value === 'object') {
17
+ if (Array.isArray(value)) {
18
+ return value
19
+ .map((media) => `${media === '_default' ? '' : `${media}:`}kit--${type}`)
20
+ .join(' ');
21
+ }
22
+ else {
23
+ return Object.entries(value)
24
+ .map(([media, value]) => `${media === '_default' ? '' : `${media}:`}kit-${key}--${type}-${value}`)
25
+ .join(' ');
26
+ }
27
+ }
28
+ },
29
+ color(color) {
30
+ if (color) {
31
+ if (color.includes('#') ||
32
+ color.includes('rgb') ||
33
+ color.includes('rgba') ||
34
+ color.includes('oklch') ||
35
+ x11ColorNames.includes(color.toLowerCase()))
36
+ return color;
37
+ return `var(--kit-${color})`;
38
+ }
39
+ },
40
+ unit(value) {
41
+ if (typeof value === 'number')
42
+ return `${value}px`;
43
+ if (typeof value === 'string') {
44
+ const cleaned = value.trim();
45
+ const isOnlyNumericLike = /^[\d.,]+$/.test(cleaned);
46
+ if (isOnlyNumericLike)
47
+ return `${value}px`;
48
+ }
49
+ return value;
50
+ }
51
+ };
52
+ }
@@ -0,0 +1,9 @@
1
+ type ClickOutsideOptions = {
2
+ exclude?: (HTMLElement | PointerEvent | null)[];
3
+ onClose: () => void;
4
+ };
5
+ export declare function clickOutside(node: HTMLElement, options: ClickOutsideOptions): {
6
+ update(newOptions: ClickOutsideOptions): void;
7
+ destroy(): void;
8
+ };
9
+ export {};