lapikit 0.0.0-insiders.e877f7f → 0.0.0-insiders.e94247e
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.
- package/bin/configuration.js +304 -0
- package/bin/helper.js +23 -0
- package/bin/index.js +41 -0
- package/bin/lapikit.js +37 -5
- package/bin/legacy.js +34 -0
- package/bin/modules/adapter.js +3 -3
- package/bin/modules/plugin.js +223 -0
- package/bin/presets.js +26 -0
- package/bin/prompts.js +100 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/assets/icons/arrow-down.svelte +12 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
- package/dist/assets/icons/arrow-up.svelte +12 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
- package/dist/assets/icons/close-fill.svelte +12 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
- package/dist/assets/icons/loading-fill.svelte +2 -0
- package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
- package/dist/colors.css +0 -0
- package/dist/components/accordion/accordion.css +113 -0
- package/dist/components/accordion/accordion.svelte +155 -0
- package/dist/components/accordion/accordion.svelte.d.ts +4 -0
- package/dist/components/accordion/accordion.svelte.js +24 -0
- package/dist/components/accordion/modules/accordion-item.svelte +94 -0
- package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/alert/alert.css +137 -0
- package/dist/components/alert/alert.svelte +211 -0
- package/dist/components/alert/alert.svelte.d.ts +4 -0
- package/dist/components/alert/types.d.ts +28 -0
- package/dist/components/alert/types.js +1 -0
- package/dist/components/app/app.css +16 -0
- package/dist/components/app/app.svelte +55 -3
- package/dist/components/appbar/appbar.css +48 -0
- package/dist/components/appbar/appbar.svelte +85 -0
- package/dist/components/appbar/appbar.svelte.d.ts +4 -0
- package/dist/components/appbar/types.d.ts +15 -0
- package/dist/components/appbar/types.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +66 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
- package/dist/components/aspect-ratio/types.d.ts +5 -0
- package/dist/components/aspect-ratio/types.js +1 -0
- package/dist/components/avatar/avatar.css +109 -0
- package/dist/components/avatar/avatar.svelte +160 -0
- package/dist/components/avatar/avatar.svelte.d.ts +4 -0
- package/dist/components/avatar/types.d.ts +22 -0
- package/dist/components/avatar/types.js +1 -0
- package/dist/components/button/button.css +165 -194
- package/dist/components/button/button.svelte +269 -31
- package/dist/components/button/button.svelte.d.ts +2 -2
- package/dist/components/button/types.d.ts +7 -5
- package/dist/components/card/card.css +115 -0
- package/dist/components/card/card.svelte +171 -0
- package/dist/components/card/card.svelte.d.ts +4 -0
- package/dist/components/card/types.d.ts +18 -0
- package/dist/components/card/types.js +1 -0
- package/dist/components/chip/chip.css +231 -0
- package/dist/components/chip/chip.svelte +342 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +32 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/dialog/dialog.css +136 -0
- package/dist/components/dialog/dialog.svelte +211 -0
- package/dist/components/dialog/dialog.svelte.d.ts +4 -0
- package/dist/components/dialog/types.d.ts +24 -0
- package/dist/components/dialog/types.js +1 -0
- package/dist/components/dropdown/dropdown.css +4 -4
- package/dist/components/dropdown/dropdown.svelte +24 -0
- package/dist/components/icon/icon.css +16 -11
- package/dist/components/icon/icon.svelte +89 -0
- package/dist/components/index.d.ts +17 -1
- package/dist/components/index.js +17 -1
- package/dist/components/list/list.css +221 -0
- package/dist/components/list/list.svelte +243 -0
- package/dist/components/list/list.svelte.d.ts +4 -0
- package/dist/components/list/modules/list-item.svelte +275 -0
- package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
- package/dist/components/list/types.d.ts +33 -0
- package/dist/components/list/types.js +1 -0
- package/dist/components/modal/modal.css +145 -0
- package/dist/components/modal/modal.svelte +248 -0
- package/dist/components/modal/modal.svelte.d.ts +4 -0
- package/dist/components/modal/types.d.ts +26 -0
- package/dist/components/modal/types.js +1 -0
- package/dist/components/popover/popover.css +4 -4
- package/dist/components/popover/popover.svelte +24 -0
- package/dist/components/separator/separator.css +46 -0
- package/dist/components/separator/separator.svelte +85 -0
- package/dist/components/separator/separator.svelte.d.ts +4 -0
- package/dist/components/separator/types.d.ts +11 -0
- package/dist/components/separator/types.js +1 -0
- package/dist/components/spacer/spacer.css +3 -0
- package/dist/components/spacer/spacer.svelte +12 -0
- package/dist/components/spacer/spacer.svelte.d.ts +4 -0
- package/dist/components/spacer/types.d.ts +4 -0
- package/dist/components/spacer/types.js +1 -0
- package/dist/components/textfield/textfield.css +305 -0
- package/dist/components/textfield/textfield.svelte +463 -0
- package/dist/components/textfield/textfield.svelte.d.ts +4 -0
- package/dist/components/textfield/types.d.ts +37 -0
- package/dist/components/textfield/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +129 -0
- package/dist/components/toolbar/toolbar.svelte +182 -0
- package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +27 -0
- package/dist/components/toolbar/types.js +1 -0
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.svelte +127 -0
- package/dist/index.d.ts +27 -1
- package/dist/index.js +27 -3
- package/dist/internal/assets.svelte.d.ts +1 -0
- package/dist/internal/assets.svelte.js +13 -0
- package/dist/internal/config/presets.d.ts +136 -0
- package/dist/internal/config/presets.js +121 -0
- package/dist/internal/config/variables.d.ts +20 -0
- package/dist/internal/config/variables.js +20 -0
- package/dist/internal/core/formatter/component.d.ts +5 -0
- package/dist/internal/core/formatter/component.js +63 -0
- package/dist/internal/core/formatter/index.d.ts +6 -0
- package/dist/internal/core/formatter/index.js +30 -0
- package/dist/internal/core/formatter/styles.d.ts +4 -0
- package/dist/internal/core/formatter/styles.js +15 -0
- package/dist/internal/core/formatter/theme.d.ts +5 -0
- package/dist/internal/core/formatter/theme.js +28 -0
- package/dist/internal/core/formatter/typography.d.ts +5 -0
- package/dist/internal/core/formatter/typography.js +12 -0
- package/dist/internal/deepMerge.d.ts +44 -0
- package/dist/internal/deepMerge.js +80 -0
- package/dist/internal/helpers/parser.d.ts +10 -0
- package/dist/internal/helpers/parser.js +92 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/internal/plugins/vite.d.ts +8 -0
- package/dist/internal/plugins/vite.js +25 -0
- package/dist/internal/ripple.d.ts +12 -0
- package/dist/internal/ripple.js +93 -0
- package/dist/internal/scroll.d.ts +1 -0
- package/dist/internal/scroll.js +6 -0
- package/dist/internal/types/configuration.d.ts +40 -0
- package/dist/internal/types/configuration.js +1 -0
- package/dist/internal/types/index.d.ts +1 -0
- package/dist/internal/types/index.js +1 -0
- package/dist/internal/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/labs/index.d.ts +4 -0
- package/dist/labs/index.js +5 -0
- package/dist/labs/my-component-style-global.svelte +6 -0
- package/dist/labs/my-component-style-global.svelte.d.ts +18 -0
- package/dist/labs/my-component-style-import.svelte +15 -0
- package/dist/labs/my-component-style-import.svelte.d.ts +18 -0
- package/dist/labs/my-component-style-mixed.svelte +23 -0
- package/dist/labs/my-component-style-mixed.svelte.d.ts +18 -0
- package/dist/labs/my-component.svelte +16 -0
- package/dist/labs/my-component.svelte.d.ts +18 -0
- package/dist/labs/style-mixed.css +7 -0
- package/dist/labs/style.css +7 -0
- package/dist/labs.css +25 -0
- package/dist/plugin/css.d.ts +1 -0
- package/dist/plugin/css.js +73 -0
- package/dist/plugin/preset-v2.d.ts +108 -0
- package/dist/plugin/preset-v2.js +126 -0
- package/dist/plugin/vitejs.d.ts +5 -1
- package/dist/plugin/vitejs.js +32 -3
- package/dist/preset.js +2 -2
- package/dist/stores/breakpoints.d.ts +6 -0
- package/dist/stores/breakpoints.js +14 -0
- package/dist/stores/components.d.ts +8 -0
- package/dist/stores/components.js +26 -0
- package/dist/stores/devices.d.ts +6 -0
- package/dist/stores/devices.js +9 -0
- package/dist/stores/index.d.ts +4 -4
- package/dist/stores/index.js +4 -23
- package/dist/stores/themes.d.ts +8 -0
- package/dist/stores/themes.js +34 -0
- package/dist/style/animation.css +42 -0
- package/dist/style/css.js +3 -0
- package/dist/style/normalize.css +2 -0
- package/dist/style/parser/color.js +2 -2
- package/dist/style/parser/device.js +31 -19
- package/dist/style/variable.css +12 -0
- package/dist/utils/convert.d.ts +1 -0
- package/dist/utils/convert.js +17 -0
- package/package.json +21 -5
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { ToolbarProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
is = 'div',
|
|
9
|
+
classContent,
|
|
10
|
+
light,
|
|
11
|
+
dark,
|
|
12
|
+
variant,
|
|
13
|
+
rounded,
|
|
14
|
+
background,
|
|
15
|
+
color,
|
|
16
|
+
density = 'default',
|
|
17
|
+
orientation = 'horizontal',
|
|
18
|
+
location,
|
|
19
|
+
...rest
|
|
20
|
+
}: ToolbarProps = $props();
|
|
21
|
+
|
|
22
|
+
const assets = getAssets();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<svelte:element
|
|
26
|
+
this={is}
|
|
27
|
+
bind:this={ref}
|
|
28
|
+
{...rest}
|
|
29
|
+
role="toolbar"
|
|
30
|
+
class={[
|
|
31
|
+
'kit-toolbar',
|
|
32
|
+
light && 'light',
|
|
33
|
+
dark && 'dark',
|
|
34
|
+
variant && assets.className('toolbar', 'variant', variant),
|
|
35
|
+
density && assets.className('toolbar', 'density', density),
|
|
36
|
+
orientation && assets.className('toolbar', 'orientation', orientation),
|
|
37
|
+
location && assets.className('toolbar', 'location', location),
|
|
38
|
+
rest.class
|
|
39
|
+
]}
|
|
40
|
+
style:--base={assets.color(background)}
|
|
41
|
+
style:--on={assets.color(color)}
|
|
42
|
+
style:--shape={assets.shape(rounded)}
|
|
43
|
+
>
|
|
44
|
+
<div class={['kit-toolbar--wrapper', classContent]}>
|
|
45
|
+
{@render children?.()}
|
|
46
|
+
</div>
|
|
47
|
+
</svelte:element>
|
|
48
|
+
|
|
49
|
+
<style>.kit-toolbar {
|
|
50
|
+
--toolbar-color: var(--on, var(--kit-on-surface));
|
|
51
|
+
--toolbar-background: var(--base, var(--kit-surface));
|
|
52
|
+
--toolbar-radius: var(--shape, var(--kit-radius-md));
|
|
53
|
+
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
/* min-width: max-content; */
|
|
57
|
+
border-style: solid;
|
|
58
|
+
/* transition:
|
|
59
|
+
color 0.5s,
|
|
60
|
+
border-color 0.5s,
|
|
61
|
+
background-color 0.5s; */
|
|
62
|
+
|
|
63
|
+
border-width: 1px;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
border-radius: var(--toolbar-radius);
|
|
66
|
+
|
|
67
|
+
/* theme */
|
|
68
|
+
color: var(--toolbar-color);
|
|
69
|
+
background-color: var(--toolbar-background);
|
|
70
|
+
border-color: var(--toolbar-background);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* density */
|
|
74
|
+
|
|
75
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default {
|
|
76
|
+
border-radius: calc(var(--prism-spacing) * 2.25);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default:not([class*='toolbar--orientation-vertical']) {
|
|
80
|
+
height: 3rem;
|
|
81
|
+
padding-inline: calc(var(--prism-spacing) * 1.5);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default[class*='toolbar--orientation-vertical'] {
|
|
85
|
+
width: 3rem;
|
|
86
|
+
padding: calc(var(--prism-spacing) * 1.5) 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact {
|
|
90
|
+
border-radius: calc(var(--prism-spacing) * 1.75);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact:not([class*='toolbar--orientation-vertical']) {
|
|
94
|
+
height: 2.625rem;
|
|
95
|
+
padding-inline: calc(var(--prism-spacing) * 0.75);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact[class*='toolbar--orientation-vertical'] {
|
|
99
|
+
width: 2.625rem;
|
|
100
|
+
padding: calc(var(--prism-spacing) * 0.75) 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable {
|
|
104
|
+
border-radius: calc(var(--prism-spacing) * 3.5);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable:not(
|
|
108
|
+
[class*='toolbar--orientation-vertical']
|
|
109
|
+
) {
|
|
110
|
+
height: 3.5rem;
|
|
111
|
+
padding-inline: calc(var(--prism-spacing) * 2.25);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable[class*='toolbar--orientation-vertical'] {
|
|
115
|
+
width: 3.5rem;
|
|
116
|
+
padding: calc(var(--prism-spacing) * 2.25) 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-text,
|
|
120
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-outline,
|
|
121
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-dash {
|
|
122
|
+
--toolbar-color: var(--base, var(--kit-surface));
|
|
123
|
+
background-color: transparent;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-outline {
|
|
127
|
+
border-color: currentColor;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-dash {
|
|
131
|
+
border-style: dashed;
|
|
132
|
+
border-color: currentColor;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-horizontal {
|
|
136
|
+
flex-direction: row;
|
|
137
|
+
width: 100%;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical {
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
min-height: fit-content;
|
|
143
|
+
width: fit-content;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* wrapper */
|
|
147
|
+
|
|
148
|
+
.kit-toolbar .kit-toolbar--wrapper {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
/* margin-left: auto;
|
|
152
|
+
margin-right: auto; */
|
|
153
|
+
flex-direction: row;
|
|
154
|
+
height: auto;
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical .kit-toolbar--wrapper {
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
height: 100%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* location */
|
|
164
|
+
|
|
165
|
+
.kit-toolbar[breakpoint]kit-toolbar--location-top {
|
|
166
|
+
top: 0px;
|
|
167
|
+
z-index: 1004;
|
|
168
|
+
transform: translateY(0px);
|
|
169
|
+
position: fixed;
|
|
170
|
+
left: 0px;
|
|
171
|
+
width: calc(100% + 0px);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.kit-toolbar[breakpoint]kit-toolbar--location-bottom {
|
|
175
|
+
z-index: 1004;
|
|
176
|
+
transform: translateY(0px);
|
|
177
|
+
position: fixed;
|
|
178
|
+
left: 0px;
|
|
179
|
+
width: calc(100% + 0px);
|
|
180
|
+
bottom: 0px;
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type Variant = 'outline' | 'text' | 'dash';
|
|
3
|
+
type Density = 'compact' | 'comfortable' | 'default';
|
|
4
|
+
type Orientation = 'horizontal' | 'vertical';
|
|
5
|
+
type Location = 'top' | 'bottom';
|
|
6
|
+
export interface ToolbarProps extends Component {
|
|
7
|
+
is?: 'div' | 'header' | 'nav';
|
|
8
|
+
variant?: Variant | {
|
|
9
|
+
[key: string]: Variant;
|
|
10
|
+
};
|
|
11
|
+
rounded?: string;
|
|
12
|
+
density?: Density | {
|
|
13
|
+
[key: string]: Density;
|
|
14
|
+
};
|
|
15
|
+
dark?: boolean;
|
|
16
|
+
light?: boolean;
|
|
17
|
+
color?: string;
|
|
18
|
+
orientation?: Orientation | {
|
|
19
|
+
[key: string]: Orientation;
|
|
20
|
+
};
|
|
21
|
+
background?: string;
|
|
22
|
+
location?: Location | {
|
|
23
|
+
[key: string]: Location;
|
|
24
|
+
};
|
|
25
|
+
classContent?: string | string[] | undefined;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.kit-tooltip-content {
|
|
9
|
-
--tooltip-color: var(--on, var(--kit-on-
|
|
10
|
-
--tooltip-background: var(--base, var(--kit-
|
|
9
|
+
--tooltip-color: var(--on, var(--kit-on-surface));
|
|
10
|
+
--tooltip-background: var(--base, var(--kit-surface));
|
|
11
11
|
--tooltip-radius: var(--shape, var(--kit-radius-md));
|
|
12
12
|
|
|
13
13
|
background-color: var(--tooltip-background);
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
width: auto;
|
|
20
20
|
pointer-events: none;
|
|
21
21
|
overflow-wrap: break-word;
|
|
22
|
-
transition:
|
|
22
|
+
/* transition:
|
|
23
23
|
color 0.5s,
|
|
24
24
|
border-color 0.5s,
|
|
25
|
-
background-color 0.5s;
|
|
25
|
+
background-color 0.5s; */
|
|
26
26
|
box-shadow: 0px 16px 29px -10px color-mix(in oklab, var(--kit-scrim) 60%, transparent);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -111,3 +111,130 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
</div>
|
|
113
113
|
{/if}
|
|
114
|
+
|
|
115
|
+
<style>.kit-tooltip {
|
|
116
|
+
inset: 0px auto auto 0px;
|
|
117
|
+
margin: 0px;
|
|
118
|
+
position: fixed;
|
|
119
|
+
z-index: 2000;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.kit-tooltip-content {
|
|
123
|
+
--tooltip-color: var(--on, var(--kit-on-surface));
|
|
124
|
+
--tooltip-background: var(--base, var(--kit-surface));
|
|
125
|
+
--tooltip-radius: var(--shape, var(--kit-radius-md));
|
|
126
|
+
|
|
127
|
+
background-color: var(--tooltip-background);
|
|
128
|
+
color: var(--tooltip-color);
|
|
129
|
+
border-radius: var(--tooltip-radius);
|
|
130
|
+
border: 1px solid var(--tooltip-background);
|
|
131
|
+
font-size: 0.875rem;
|
|
132
|
+
display: inline-block;
|
|
133
|
+
width: auto;
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
overflow-wrap: break-word;
|
|
136
|
+
/* transition:
|
|
137
|
+
color 0.5s,
|
|
138
|
+
border-color 0.5s,
|
|
139
|
+
background-color 0.5s; */
|
|
140
|
+
box-shadow: 0px 16px 29px -10px color-mix(in oklab, var(--kit-scrim) 60%, transparent);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* density */
|
|
144
|
+
|
|
145
|
+
.kit-tooltip-content[breakpoint]kit-tooltip-content--density-default {
|
|
146
|
+
padding: 0.15rem 0.625rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.kit-tooltip-content[breakpoint]kit-tooltip-content--density-compact {
|
|
150
|
+
padding: 0.125rem 0.5rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.kit-tooltip-content[breakpoint]kit-tooltip-content--density-comfortable {
|
|
154
|
+
padding: 0.35rem 0.75rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.kit-tooltip-content--arrow::after {
|
|
158
|
+
content: ' ';
|
|
159
|
+
position: absolute;
|
|
160
|
+
border-style: solid;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--bottom::after,
|
|
164
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--top::after {
|
|
165
|
+
left: 50%;
|
|
166
|
+
margin-left: -0.35rem;
|
|
167
|
+
border-width: 0.35rem;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--bottom::after {
|
|
171
|
+
bottom: 100%;
|
|
172
|
+
border-color: transparent transparent var(--tooltip-background) transparent;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--top::after {
|
|
176
|
+
top: 100%;
|
|
177
|
+
border-color: var(--tooltip-background) transparent transparent transparent;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--left::after,
|
|
181
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--right::after {
|
|
182
|
+
top: 50%;
|
|
183
|
+
margin-top: -0.35rem;
|
|
184
|
+
border-width: 0.35rem;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--right::after {
|
|
188
|
+
right: 100%;
|
|
189
|
+
border-color: transparent var(--tooltip-background) transparent transparent;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.kit-tooltip-content--arrow.kit-tooltip-content--left::after {
|
|
193
|
+
left: 100%;
|
|
194
|
+
border-color: transparent transparent transparent var(--tooltip-background);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.kit-tooltip-content--top,
|
|
198
|
+
.kit-tooltip-content--bottom,
|
|
199
|
+
.kit-tooltip-content--right,
|
|
200
|
+
.kit-tooltip-content--left {
|
|
201
|
+
animation-duration: 150ms;
|
|
202
|
+
animation-name: enter;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.kit-tooltip-content--top {
|
|
206
|
+
--animate-enter-pos1: 0;
|
|
207
|
+
--animate-enter-pos2: 0.5rem;
|
|
208
|
+
--animate-enter-pos3: 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.kit-tooltip-content--bottom {
|
|
212
|
+
--animate-enter-pos1: 0;
|
|
213
|
+
--animate-enter-pos2: -0.5rem;
|
|
214
|
+
--animate-enter-pos3: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.kit-tooltip-content--right {
|
|
218
|
+
--animate-enter-pos1: -0.5rem;
|
|
219
|
+
--animate-enter-pos2: 0;
|
|
220
|
+
--animate-enter-pos3: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.kit-tooltip-content--left {
|
|
224
|
+
--animate-enter-pos1: 0.5rem;
|
|
225
|
+
--animate-enter-pos2: 0;
|
|
226
|
+
--animate-enter-pos3: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@keyframes enter {
|
|
230
|
+
0% {
|
|
231
|
+
opacity: 0;
|
|
232
|
+
transform: translate3d(
|
|
233
|
+
var(--animate-enter-pos1),
|
|
234
|
+
var(--animate-enter-pos2),
|
|
235
|
+
var(--animate-enter-pos3)
|
|
236
|
+
)
|
|
237
|
+
scale3d(0.95, 0.95, 0.95) rotate(0);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
</style>
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
interface Lapikit {
|
|
2
|
+
adapterCSS: string;
|
|
3
|
+
breakpoints: {
|
|
4
|
+
devices: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
thresholds: {
|
|
8
|
+
[key: string]: number | string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
theme: {
|
|
12
|
+
defaultTheme: string;
|
|
13
|
+
themes: {
|
|
14
|
+
[key: string]: {
|
|
15
|
+
dark: boolean;
|
|
16
|
+
colors: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
variables: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
declare function createLapikit(lapikit: Lapikit): void;
|
|
27
|
+
export default createLapikit;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { deepMerge } from './internal/deepMerge.js';
|
|
2
|
+
import { breakpoints } from './stores/breakpoints.js';
|
|
3
|
+
import { get } from 'svelte/store';
|
|
4
|
+
import { valueToPx } from './utils/convert.js';
|
|
5
|
+
import { devices } from './stores/devices.js';
|
|
6
|
+
function createLapikit(lapikit) {
|
|
7
|
+
console.log('Creating a new Lapikit instance...');
|
|
8
|
+
console.log('Options loaded:', lapikit);
|
|
9
|
+
if (lapikit?.breakpoints?.thresholds) {
|
|
10
|
+
const currentBreakpoints = get(breakpoints);
|
|
11
|
+
const breakpointMerged = deepMerge(currentBreakpoints, lapikit.breakpoints.thresholds);
|
|
12
|
+
const formattedBreakpoints = Object.fromEntries(Object.entries(breakpointMerged).map(([key, value]) => [key, valueToPx(value)]));
|
|
13
|
+
breakpoints.set(formattedBreakpoints);
|
|
14
|
+
console.log('Breakpoints found:', formattedBreakpoints);
|
|
15
|
+
}
|
|
16
|
+
if (lapikit?.breakpoints?.devices) {
|
|
17
|
+
const currentDevices = get(devices);
|
|
18
|
+
const currentBreakpoints = get(breakpoints);
|
|
19
|
+
const deviceMerged = deepMerge(currentDevices, lapikit.breakpoints.devices);
|
|
20
|
+
const formattedDevices = Object.fromEntries(Object.entries(deviceMerged).map(([key, deviceKey]) => {
|
|
21
|
+
const breakpointValue = currentBreakpoints[deviceKey];
|
|
22
|
+
return [key, valueToPx(breakpointValue)];
|
|
23
|
+
}));
|
|
24
|
+
devices.set(formattedDevices);
|
|
25
|
+
console.log('Devices found:', formattedDevices);
|
|
26
|
+
}
|
|
4
27
|
}
|
|
28
|
+
export default createLapikit;
|
|
@@ -34,8 +34,21 @@ export function getAssets() {
|
|
|
34
34
|
color.includes('oklch') ||
|
|
35
35
|
x11ColorNames.includes(color.toLowerCase()))
|
|
36
36
|
return color;
|
|
37
|
+
if (color.includes('transparent') || color.includes('inherit') || color.includes('initial'))
|
|
38
|
+
return color;
|
|
37
39
|
return `var(--kit-${color})`;
|
|
38
40
|
}
|
|
41
|
+
},
|
|
42
|
+
unit(value) {
|
|
43
|
+
if (typeof value === 'number')
|
|
44
|
+
return `${value}px`;
|
|
45
|
+
if (typeof value === 'string') {
|
|
46
|
+
const cleaned = value.trim();
|
|
47
|
+
const isOnlyNumericLike = /^[\d.,]+$/.test(cleaned);
|
|
48
|
+
if (isOnlyNumericLike)
|
|
49
|
+
return `${value}px`;
|
|
50
|
+
}
|
|
51
|
+
return value;
|
|
39
52
|
}
|
|
40
53
|
};
|
|
41
54
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export declare const preset: {
|
|
2
|
+
breakpoints: {
|
|
3
|
+
devices: {
|
|
4
|
+
desktop: number;
|
|
5
|
+
tablet: number;
|
|
6
|
+
mobile: number;
|
|
7
|
+
};
|
|
8
|
+
thresholds: {
|
|
9
|
+
base: number;
|
|
10
|
+
xs: number;
|
|
11
|
+
sm: number;
|
|
12
|
+
md: number;
|
|
13
|
+
lg: number;
|
|
14
|
+
xl: number;
|
|
15
|
+
'2xl': number;
|
|
16
|
+
'3xl': number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
theme: {
|
|
20
|
+
defaultTheme: string;
|
|
21
|
+
themes: {
|
|
22
|
+
light: {
|
|
23
|
+
dark: boolean;
|
|
24
|
+
colors: {
|
|
25
|
+
blue: string;
|
|
26
|
+
green: string;
|
|
27
|
+
red: string;
|
|
28
|
+
yellow: string;
|
|
29
|
+
orange: string;
|
|
30
|
+
purple: string;
|
|
31
|
+
pink: string;
|
|
32
|
+
indigo: string;
|
|
33
|
+
cyan: string;
|
|
34
|
+
gray: string;
|
|
35
|
+
'gray-2': string;
|
|
36
|
+
'gray-3': string;
|
|
37
|
+
'gray-4': string;
|
|
38
|
+
'gray-5': string;
|
|
39
|
+
'gray-6': string;
|
|
40
|
+
background: string;
|
|
41
|
+
'secondary-background': string;
|
|
42
|
+
'tertiary-background': string;
|
|
43
|
+
label: string;
|
|
44
|
+
'secondary-label': string;
|
|
45
|
+
};
|
|
46
|
+
variables: {
|
|
47
|
+
info: string;
|
|
48
|
+
success: string;
|
|
49
|
+
error: string;
|
|
50
|
+
warning: string;
|
|
51
|
+
dialog: {
|
|
52
|
+
xs: string;
|
|
53
|
+
sm: string;
|
|
54
|
+
md: string;
|
|
55
|
+
lg: string;
|
|
56
|
+
xl: string;
|
|
57
|
+
};
|
|
58
|
+
modal: {
|
|
59
|
+
xs: string;
|
|
60
|
+
sm: string;
|
|
61
|
+
md: string;
|
|
62
|
+
lg: string;
|
|
63
|
+
xl: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
dark: {
|
|
68
|
+
dark: boolean;
|
|
69
|
+
colors: {
|
|
70
|
+
blue: string;
|
|
71
|
+
green: string;
|
|
72
|
+
red: string;
|
|
73
|
+
yellow: string;
|
|
74
|
+
orange: string;
|
|
75
|
+
purple: string;
|
|
76
|
+
pink: string;
|
|
77
|
+
indigo: string;
|
|
78
|
+
cyan: string;
|
|
79
|
+
gray: string;
|
|
80
|
+
'gray-2': string;
|
|
81
|
+
'gray-3': string;
|
|
82
|
+
'gray-4': string;
|
|
83
|
+
'gray-5': string;
|
|
84
|
+
'gray-6': string;
|
|
85
|
+
background: string;
|
|
86
|
+
'secondary-background': string;
|
|
87
|
+
'tertiary-background': string;
|
|
88
|
+
label: string;
|
|
89
|
+
'secondary-label': string;
|
|
90
|
+
};
|
|
91
|
+
variables: {
|
|
92
|
+
info: string;
|
|
93
|
+
success: string;
|
|
94
|
+
error: string;
|
|
95
|
+
warning: string;
|
|
96
|
+
dialog: {
|
|
97
|
+
xs: string;
|
|
98
|
+
sm: string;
|
|
99
|
+
md: string;
|
|
100
|
+
lg: string;
|
|
101
|
+
xl: string;
|
|
102
|
+
};
|
|
103
|
+
modal: {
|
|
104
|
+
xs: string;
|
|
105
|
+
sm: string;
|
|
106
|
+
md: string;
|
|
107
|
+
lg: string;
|
|
108
|
+
xl: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
typography: {
|
|
115
|
+
defaultTypography: string;
|
|
116
|
+
fonts: {
|
|
117
|
+
default: {
|
|
118
|
+
sans: string[];
|
|
119
|
+
mono: string[];
|
|
120
|
+
serif: string[];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
styles: {
|
|
125
|
+
spacing: string;
|
|
126
|
+
shape: {
|
|
127
|
+
sm: string;
|
|
128
|
+
md: string;
|
|
129
|
+
lg: string;
|
|
130
|
+
xl: string;
|
|
131
|
+
'2xl': string;
|
|
132
|
+
'3xl': string;
|
|
133
|
+
full: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|