lapikit 0.0.0-insiders.d9491fb → 0.0.0-insiders.db064a9
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/README.md +117 -1
- package/bin/configuration.js +303 -0
- package/bin/helper.js +0 -15
- package/bin/index.js +33 -0
- package/bin/presets.js +26 -0
- package/bin/prompts.js +67 -0
- package/dist/actions/accordion.svelte.d.ts +9 -0
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.js +2 -1
- package/dist/actions/use-theme.d.ts +1 -0
- package/dist/actions/use-theme.js +18 -0
- package/dist/assets/icons/arrow-down.svelte +2 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +6 -14
- package/dist/assets/icons/arrow-up.svelte +2 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +6 -14
- package/dist/assets/icons/close-fill.svelte +2 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +6 -14
- package/dist/assets/icons/loading-fill.svelte +2 -0
- package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
- package/dist/components/accordion/accordion.css +0 -77
- package/dist/components/accordion/accordion.svelte +5 -3
- package/dist/components/accordion/modules/accordion-item.css +68 -0
- package/dist/components/accordion/modules/accordion-item.svelte +4 -4
- package/dist/components/accordion/types.d.ts +1 -1
- package/dist/components/alert/alert.css +25 -22
- package/dist/components/alert/alert.svelte +4 -4
- package/dist/components/alert/types.d.ts +1 -1
- package/dist/components/app/app.css +12 -2
- package/dist/components/app/app.svelte +71 -15
- package/dist/components/app/app.svelte.d.ts +2 -5
- package/dist/components/app/types.d.ts +7 -1
- package/dist/components/appbar/appbar.css +8 -19
- package/dist/components/appbar/appbar.svelte +4 -5
- package/dist/components/appbar/types.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -23
- package/dist/components/aspect-ratio/types.d.ts +1 -1
- package/dist/components/avatar/avatar.css +7 -14
- package/dist/components/avatar/avatar.svelte +4 -4
- package/dist/components/avatar/types.d.ts +1 -1
- package/dist/components/button/button.css +167 -203
- package/dist/components/button/button.svelte +43 -35
- package/dist/components/button/button.svelte.d.ts +2 -2
- package/dist/components/button/types.d.ts +8 -6
- package/dist/components/card/card.css +57 -61
- package/dist/components/card/card.svelte +22 -5
- package/dist/components/card/types.d.ts +4 -2
- package/dist/components/chip/chip.css +127 -102
- package/dist/components/chip/chip.svelte +25 -12
- package/dist/components/chip/types.d.ts +4 -2
- package/dist/components/dialog/dialog.css +15 -20
- package/dist/components/dialog/dialog.svelte +5 -5
- package/dist/components/dialog/types.d.ts +1 -1
- package/dist/components/dropdown/dropdown.css +3 -12
- package/dist/components/dropdown/dropdown.svelte +6 -7
- package/dist/components/dropdown/types.d.ts +1 -1
- package/dist/components/icon/icon.css +20 -18
- package/dist/components/icon/icon.svelte +2 -2
- package/dist/components/icon/types.d.ts +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/list/list.css +83 -129
- package/dist/components/list/list.svelte +5 -7
- package/dist/components/list/modules/list-item.css +67 -0
- package/dist/components/list/modules/list-item.svelte +13 -5
- package/dist/components/list/types.d.ts +3 -6
- package/dist/components/modal/modal.css +25 -28
- package/dist/components/modal/modal.svelte +5 -5
- package/dist/components/modal/types.d.ts +1 -1
- package/dist/components/popover/popover.css +3 -12
- package/dist/components/popover/popover.svelte +6 -6
- package/dist/components/popover/types.d.ts +1 -1
- package/dist/components/separator/separator.css +19 -23
- package/dist/components/separator/separator.svelte +6 -6
- package/dist/components/separator/types.d.ts +6 -2
- package/dist/components/spacer/types.d.ts +1 -1
- package/dist/components/textfield/textfield.css +298 -0
- package/dist/components/textfield/textfield.svelte +193 -0
- package/dist/components/textfield/textfield.svelte.d.ts +4 -0
- package/dist/components/textfield/types.d.ts +37 -0
- package/dist/components/toolbar/toolbar.css +11 -34
- package/dist/components/toolbar/toolbar.svelte +4 -4
- package/dist/components/toolbar/types.d.ts +1 -1
- package/dist/components/tooltip/tooltip.css +5 -13
- package/dist/components/tooltip/tooltip.svelte +5 -5
- package/dist/components/tooltip/types.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +23 -3
- package/dist/internal/config/presets.d.ts +149 -0
- package/dist/internal/config/presets.js +169 -0
- package/dist/internal/config/variables.d.ts +3 -0
- package/dist/internal/config/variables.js +3 -0
- package/dist/internal/{assets.svelte.js → core/actions/assets.svelte.js} +6 -4
- package/dist/internal/core/actions/dropdown.svelte.d.ts +7 -0
- package/dist/internal/core/actions/popover.svelte.d.ts +7 -0
- package/dist/internal/core/actions/tooltip.svelte.d.ts +7 -0
- package/dist/internal/core/animations/ripple.d.ts +12 -0
- package/dist/internal/core/animations/ripple.js +93 -0
- package/dist/internal/core/css.d.ts +1 -0
- package/dist/internal/core/css.js +16 -0
- package/dist/internal/core/formatter/component.d.ts +5 -0
- package/dist/internal/core/formatter/component.js +60 -0
- package/dist/internal/core/formatter/device.d.ts +5 -0
- package/dist/internal/core/formatter/device.js +66 -0
- package/dist/internal/core/formatter/index.d.ts +7 -0
- package/dist/internal/core/formatter/index.js +35 -0
- package/dist/internal/core/formatter/style.d.ts +4 -0
- package/dist/internal/core/formatter/style.js +15 -0
- package/dist/internal/core/formatter/theme.d.ts +5 -0
- package/dist/internal/core/formatter/theme.js +44 -0
- package/dist/internal/core/formatter/typography.d.ts +5 -0
- package/dist/internal/core/formatter/typography.js +12 -0
- package/dist/internal/core/standard-colors.d.ts +75 -0
- package/dist/internal/core/standard-colors.js +75 -0
- package/dist/internal/helpers/colors.d.ts +1 -0
- package/dist/internal/{colors.js → helpers/colors.js} +2 -2
- package/dist/internal/helpers/convert.d.ts +1 -0
- package/dist/internal/helpers/convert.js +17 -0
- package/dist/internal/helpers/deep-merge.d.ts +44 -0
- package/dist/internal/helpers/deep-merge.js +80 -0
- package/dist/internal/helpers/parser.d.ts +10 -0
- package/dist/internal/helpers/parser.js +93 -0
- package/dist/internal/{scroll.js → helpers/scroll.js} +1 -2
- package/dist/internal/plugins/vite.d.ts +8 -0
- package/dist/internal/plugins/vite.js +33 -0
- package/dist/internal/types/components.d.ts +14 -0
- package/dist/internal/types/components.js +1 -0
- package/dist/internal/types/configuration.d.ts +63 -0
- package/dist/internal/types/configuration.js +1 -0
- package/dist/internal/types/index.d.ts +2 -0
- package/dist/internal/types/index.js +2 -0
- 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 +5 -9
- package/dist/stores/index.js +5 -46
- package/dist/stores/themes.d.ts +2 -0
- package/dist/stores/themes.js +4 -0
- package/dist/stores/viewport.d.ts +7 -0
- package/dist/stores/viewport.js +7 -0
- package/dist/styles/animation.css +33 -0
- package/dist/{style/animation.css → styles/keyframes.css} +10 -0
- package/dist/{style/normalize.css → styles/reset.css} +15 -5
- package/dist/styles.css.d.ts +4 -0
- package/dist/themes.css +0 -0
- package/dist/themes.css.d.ts +4 -0
- package/package.json +128 -91
- package/bin/lapikit.js +0 -54
- package/bin/modules/adapter.js +0 -52
- package/bin/modules/preset.js +0 -11
- package/dist/app.d.ts +0 -13
- package/dist/app.html +0 -12
- package/dist/internal/colors.d.ts +0 -1
- package/dist/internal/index.d.ts +0 -4
- package/dist/internal/index.js +0 -4
- package/dist/internal/types.d.ts +0 -57
- package/dist/internal/unit.d.ts +0 -1
- package/dist/internal/unit.js +0 -11
- package/dist/plugin/modules/config.d.ts +0 -2
- package/dist/plugin/modules/config.js +0 -54
- package/dist/plugin/modules/importer.d.ts +0 -1
- package/dist/plugin/modules/importer.js +0 -15
- package/dist/plugin/vitejs.d.ts +0 -6
- package/dist/plugin/vitejs.js +0 -26
- package/dist/preset.d.ts +0 -2
- package/dist/preset.js +0 -92
- package/dist/style/css.d.ts +0 -2
- package/dist/style/css.js +0 -34
- package/dist/style/parser/color.d.ts +0 -5
- package/dist/style/parser/color.js +0 -88
- package/dist/style/parser/component.d.ts +0 -2
- package/dist/style/parser/component.js +0 -115
- package/dist/style/parser/device.d.ts +0 -2
- package/dist/style/parser/device.js +0 -40
- package/dist/style/parser/index.d.ts +0 -4
- package/dist/style/parser/index.js +0 -4
- package/dist/style/parser/variable.d.ts +0 -2
- package/dist/style/parser/variable.js +0 -25
- package/dist/style/variable.css +0 -12
- /package/dist/{components/accordion → actions}/accordion.svelte.js +0 -0
- /package/dist/{internal → components/textfield}/types.js +0 -0
- /package/dist/internal/{assets.svelte.d.ts → core/actions/assets.svelte.d.ts} +0 -0
- /package/dist/{components/dropdown → internal/core/actions}/dropdown.svelte.js +0 -0
- /package/dist/{components/popover → internal/core/actions}/popover.svelte.js +0 -0
- /package/dist/{components/tooltip → internal/core/actions}/tooltip.svelte.js +0 -0
- /package/dist/internal/{ansi.d.ts → core/bin/ansi.d.ts} +0 -0
- /package/dist/internal/{ansi.js → core/bin/ansi.js} +0 -0
- /package/dist/internal/{terminal.d.ts → core/bin/terminal.d.ts} +0 -0
- /package/dist/internal/{terminal.js → core/bin/terminal.js} +0 -0
- /package/dist/internal/{minify.d.ts → core/minify.d.ts} +0 -0
- /package/dist/internal/{minify.js → core/minify.js} +0 -0
- /package/dist/{utils/x11.d.ts → internal/core/x11-colors.d.ts} +0 -0
- /package/dist/{utils/x11.js → internal/core/x11-colors.js} +0 -0
- /package/dist/internal/{clickOutside.d.ts → helpers/outside.d.ts} +0 -0
- /package/dist/internal/{clickOutside.js → helpers/outside.js} +0 -0
- /package/dist/internal/{scroll.d.ts → helpers/scroll.d.ts} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import { Icon } from '../index.js';
|
|
4
4
|
import type { ChipProps } from './types.js';
|
|
5
5
|
|
|
6
6
|
// external
|
|
7
7
|
import LoadingFill from '../../assets/icons/loading-fill.svelte';
|
|
8
8
|
import Close from '../../assets/icons/close-fill.svelte';
|
|
9
|
+
import { ripple } from '../../internal/core/animations/ripple.js';
|
|
9
10
|
|
|
10
11
|
let {
|
|
11
12
|
children,
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
dark,
|
|
21
22
|
light,
|
|
22
23
|
active,
|
|
23
|
-
variant,
|
|
24
|
+
variant = 'filled',
|
|
24
25
|
error,
|
|
25
26
|
info,
|
|
26
27
|
success,
|
|
@@ -35,10 +36,17 @@
|
|
|
35
36
|
loading,
|
|
36
37
|
rounded,
|
|
37
38
|
closable,
|
|
39
|
+
noRipple,
|
|
40
|
+
readonly = false,
|
|
38
41
|
...rest
|
|
39
42
|
}: ChipProps = $props();
|
|
40
43
|
|
|
41
44
|
const assets = getAssets();
|
|
45
|
+
|
|
46
|
+
$effect(() => {
|
|
47
|
+
const refProps = { ...rest };
|
|
48
|
+
if (refProps?.onclick && !readonly) is = 'button';
|
|
49
|
+
});
|
|
42
50
|
</script>
|
|
43
51
|
|
|
44
52
|
{#if !closable || (open && closable)}
|
|
@@ -61,6 +69,7 @@
|
|
|
61
69
|
disabled && 'kit-chip--disabled',
|
|
62
70
|
active && 'kit-chip--active',
|
|
63
71
|
loading && 'kit-chip--loading',
|
|
72
|
+
readonly && 'kit-chip--readonly',
|
|
64
73
|
rest.class
|
|
65
74
|
]}
|
|
66
75
|
tabindex={href && disabled ? -1 : 0}
|
|
@@ -68,9 +77,13 @@
|
|
|
68
77
|
aria-label={type !== 'button' ? label : undefined}
|
|
69
78
|
disabled={href ? undefined : disabled}
|
|
70
79
|
type={href ? undefined : type}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
use:ripple={{
|
|
81
|
+
component: 'chip',
|
|
82
|
+
disabled: noRipple || readonly || disabled || is === 'div' || is === 'span'
|
|
83
|
+
}}
|
|
84
|
+
style:--chip-background={assets.color(background)}
|
|
85
|
+
style:--chip-color={assets.color(color)}
|
|
86
|
+
style:--chip-shape={assets.shape(rounded)}
|
|
74
87
|
>
|
|
75
88
|
{#if loading}
|
|
76
89
|
<div class="kit-chip-loading">
|
|
@@ -85,20 +98,20 @@
|
|
|
85
98
|
{/if}
|
|
86
99
|
|
|
87
100
|
{#if prepend}
|
|
88
|
-
<
|
|
101
|
+
<div class="kit-chip-prepend">
|
|
89
102
|
{@render prepend?.()}
|
|
90
|
-
</
|
|
103
|
+
</div>
|
|
91
104
|
{/if}
|
|
92
|
-
<
|
|
105
|
+
<div class="kit-chip-content">
|
|
93
106
|
{@render children?.()}
|
|
94
|
-
</
|
|
107
|
+
</div>
|
|
95
108
|
{#if append}
|
|
96
|
-
<
|
|
109
|
+
<div class="kit-chip-append">
|
|
97
110
|
{@render append?.()}
|
|
98
|
-
</
|
|
111
|
+
</div>
|
|
99
112
|
{/if}
|
|
100
113
|
|
|
101
|
-
{#if closable}
|
|
114
|
+
{#if closable && !readonly}
|
|
102
115
|
<button
|
|
103
116
|
class="kit-chip--close"
|
|
104
117
|
type="button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '../../internal/types.js';
|
|
1
|
+
import type { Component } from '../../internal/types/index.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
export interface ChipProps extends Component {
|
|
4
4
|
load?: Snippet;
|
|
@@ -10,7 +10,7 @@ export interface ChipProps extends Component {
|
|
|
10
10
|
dark?: boolean;
|
|
11
11
|
light?: boolean;
|
|
12
12
|
href?: string;
|
|
13
|
-
variant?: 'outline';
|
|
13
|
+
variant?: 'outline' | 'filled';
|
|
14
14
|
density?: 'compact' | 'comfortable' | 'default';
|
|
15
15
|
active?: boolean;
|
|
16
16
|
loading?: boolean;
|
|
@@ -27,4 +27,6 @@ export interface ChipProps extends Component {
|
|
|
27
27
|
type?: 'button';
|
|
28
28
|
label?: string;
|
|
29
29
|
closable?: boolean;
|
|
30
|
+
noRipple?: boolean;
|
|
31
|
+
readonly?: boolean;
|
|
30
32
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.kit-dialog::backdrop {
|
|
18
|
-
background-color: color-mix(in oklab, var(--kit-shadow) 30%, transparent);
|
|
18
|
+
background-color: color-mix(in oklab, var(--kit-state-shadow) 30%, transparent);
|
|
19
19
|
animation: fade 0.2s ease-out;
|
|
20
20
|
}
|
|
21
21
|
.kit-dialog[open]::backdrop {
|
|
@@ -23,23 +23,17 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.kit-dialog .kit-dialog-container {
|
|
26
|
-
|
|
27
|
-
--dialog-background: var(--base, var(--kit-neutral));
|
|
28
|
-
--dialog-radius: var(--shape, var(--kit-radius-md));
|
|
29
|
-
|
|
30
|
-
border-radius: var(--dialog-radius);
|
|
31
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
32
|
-
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
33
|
-
transition-duration: 0.2s;
|
|
26
|
+
border-radius: var(--dialog-shape, var(--system-shape-md));
|
|
34
27
|
padding-top: var(--dialog-spacing-x);
|
|
35
28
|
padding-bottom: var(--dialog-spacing-x);
|
|
36
29
|
padding-right: var(--dialog-spacing-y);
|
|
37
30
|
padding-left: var(--dialog-spacing-y);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
color: var(--dialog-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
color: var(--dialog-color, var(--kit-label-primary));
|
|
32
|
+
background-color: var(--dialog-background, var(--kit-background-grouped-primary));
|
|
33
|
+
border-color: var(--dialog-background, var(--kit-background-grouped-primary));
|
|
34
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
35
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
36
|
+
transition-duration: 0.2s;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
.kit-dialog .close-dialog {
|
|
@@ -60,30 +54,31 @@
|
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
.kit-dialog[breakpoint]kit-dialog--position-center {
|
|
63
|
-
margin: auto;
|
|
57
|
+
margin-top: auto;
|
|
58
|
+
margin-bottom: auto;
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
.kit-dialog[breakpoint]kit-dialog--size-xs {
|
|
67
|
-
max-width: var(--
|
|
62
|
+
max-width: var(--system-dialog-xs);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
.kit-dialog[breakpoint]kit-dialog--size-sm {
|
|
71
|
-
max-width: var(--
|
|
66
|
+
max-width: var(--system-dialog-sm);
|
|
72
67
|
height: fit-content;
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
.kit-dialog[breakpoint]kit-dialog--size-md {
|
|
76
|
-
max-width: var(--
|
|
71
|
+
max-width: var(--system-dialog-md);
|
|
77
72
|
height: fit-content;
|
|
78
73
|
}
|
|
79
74
|
|
|
80
75
|
.kit-dialog[breakpoint]kit-dialog--size-lg {
|
|
81
|
-
max-width: var(--
|
|
76
|
+
max-width: var(--system-dialog-lg);
|
|
82
77
|
height: fit-content;
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
.kit-dialog[breakpoint]kit-dialog--size-xl {
|
|
86
|
-
max-width: var(--
|
|
81
|
+
max-width: var(--system-dialog-xl);
|
|
87
82
|
height: fit-content;
|
|
88
83
|
}
|
|
89
84
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { disabledScroll } from '../../internal/
|
|
3
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { disabledScroll } from '../../internal/helpers/scroll.js';
|
|
3
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
4
4
|
import type { DialogProps } from './types.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
rest.class
|
|
59
59
|
]}
|
|
60
60
|
onclick={(event: MouseEvent) => event.stopPropagation()}
|
|
61
|
-
style:--
|
|
62
|
-
style:--
|
|
63
|
-
style:--shape={assets.shape(rounded)}
|
|
61
|
+
style:--dialog-background={assets.color(background)}
|
|
62
|
+
style:--dialog-color={assets.color(color)}
|
|
63
|
+
style:--dialog-shape={assets.shape(rounded)}
|
|
64
64
|
>
|
|
65
65
|
{@render children?.()}
|
|
66
66
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '../../internal/types.js';
|
|
1
|
+
import type { Component } from '../../internal/types/index.js';
|
|
2
2
|
type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
type DialogPosition = 'bottom' | 'center' | 'top';
|
|
4
4
|
type DialogDensity = 'compact' | 'comfortable' | 'default';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
.kit-dropdown-content {
|
|
2
|
-
--dropdown-color: var(--on, var(--kit-on-neutral));
|
|
3
|
-
--dropdown-background: var(--base, var(--kit-neutral));
|
|
4
|
-
--dropdown-radius: var(--shape, var(--kit-radius-md));
|
|
5
|
-
|
|
6
2
|
inset: 0px auto auto 0px;
|
|
7
3
|
margin: 0px;
|
|
8
4
|
position: fixed;
|
|
@@ -11,12 +7,7 @@
|
|
|
11
7
|
width: auto;
|
|
12
8
|
opacity: 1;
|
|
13
9
|
transition-property: opacity, transform;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* theme */
|
|
19
|
-
background-color: var(--dropdown-background);
|
|
20
|
-
color: var(--dropdown-color);
|
|
21
|
-
border-radius: var(--dropdown-radius);
|
|
10
|
+
background-color: var(--dropdown-background, var(--kit-background-grouped-primary));
|
|
11
|
+
color: var(--dropdown-color, var(--kit-label-primary));
|
|
12
|
+
border-radius: var(--dropdown-shape, var(--system-shape-md));
|
|
22
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/assets.svelte.js';
|
|
3
|
-
import { clickOutside } from '../../internal/
|
|
4
|
-
import { getPositions } from '
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
|
+
import { clickOutside } from '../../internal/helpers/outside.js';
|
|
4
|
+
import { getPositions } from '../../internal/core/actions/dropdown.svelte.js';
|
|
5
5
|
import type { DropdownProps, ModelDropdownProps } from './types.js';
|
|
6
6
|
|
|
7
7
|
let {
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
state: 'open' | 'close',
|
|
56
56
|
element: HTMLElement | PointerEvent | null
|
|
57
57
|
) => {
|
|
58
|
-
console.log();
|
|
59
58
|
if (openOnHover && state === 'open') {
|
|
60
59
|
if (timeoutId) {
|
|
61
60
|
clearTimeout(timeoutId);
|
|
@@ -106,9 +105,9 @@
|
|
|
106
105
|
e.stopPropagation();
|
|
107
106
|
handleClose();
|
|
108
107
|
}}
|
|
109
|
-
style:--
|
|
110
|
-
style:--
|
|
111
|
-
style:--shape={assets.shape(rounded)}
|
|
108
|
+
style:--dropdown-background={assets.color(background)}
|
|
109
|
+
style:--dropdown-color={assets.color(color)}
|
|
110
|
+
style:--dropdown-shape={assets.shape(rounded)}
|
|
112
111
|
use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
|
|
113
112
|
>
|
|
114
113
|
{@render children?.()}
|
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
.kit-icon {
|
|
2
|
-
--icon-size: 1rem;
|
|
3
|
-
--icon-color: var(--base, var(--kit-on-neutral));
|
|
4
|
-
|
|
5
2
|
display: inline-flex;
|
|
6
3
|
align-items: center;
|
|
7
4
|
justify-content: center;
|
|
8
|
-
transition: color 0.5s;
|
|
9
5
|
text-indent: 0;
|
|
6
|
+
font-size: calc(
|
|
7
|
+
var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--system-spacing)
|
|
8
|
+
);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.kit-icon:before {
|
|
13
|
-
|
|
14
|
-
color: var(--icon-color);
|
|
12
|
+
color: var(--icon-color-state, var(--icon-color, currentColor)) !important;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
.kit-icon svg {
|
|
18
|
-
color: var(--icon-color);
|
|
16
|
+
color: var(--icon-color-state, var(--icon-color, currentColor)) !important;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.kit-icon svg,
|
|
22
20
|
.kit-icon img {
|
|
23
|
-
width: calc(
|
|
24
|
-
|
|
21
|
+
width: calc(
|
|
22
|
+
var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--system-spacing)
|
|
23
|
+
);
|
|
24
|
+
height: calc(
|
|
25
|
+
var(--icon-multiplier-parent-size, var(--icon-multiplier-size)) * var(--system-spacing)
|
|
26
|
+
);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/* size */
|
|
28
30
|
.kit-icon[breakpoint]kit-icon--size-xs {
|
|
29
|
-
--icon-size
|
|
31
|
+
--icon-multiplier-size: 7;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
.kit-icon[breakpoint]kit-icon--size-sm {
|
|
33
|
-
--icon-size
|
|
35
|
+
--icon-multiplier-size: 8;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.kit-icon[breakpoint]kit-icon--size-md {
|
|
37
|
-
--icon-size
|
|
39
|
+
--icon-multiplier-size: 9;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.kit-icon[breakpoint]kit-icon--size-lg {
|
|
41
|
-
--icon-size
|
|
43
|
+
--icon-multiplier-size: 10;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
.kit-icon[breakpoint]kit-icon--size-xl {
|
|
45
|
-
--icon-size
|
|
47
|
+
--icon-multiplier-size: 11;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
/* state */
|
|
49
51
|
.kit-icon.kit-icon--info {
|
|
50
|
-
--
|
|
52
|
+
--icon-color-state: var(--kit-accent-info);
|
|
51
53
|
}
|
|
52
54
|
.kit-icon.kit-icon--success {
|
|
53
|
-
--
|
|
55
|
+
--icon-color-state: var(--kit-accent-success);
|
|
54
56
|
}
|
|
55
57
|
.kit-icon.kit-icon--warning {
|
|
56
|
-
--
|
|
58
|
+
--icon-color-state: var(--kit-accent-warning);
|
|
57
59
|
}
|
|
58
60
|
.kit-icon.kit-icon--error {
|
|
59
|
-
--
|
|
61
|
+
--icon-color-state: var(--kit-accent-destructive);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
/* disabled */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/assets.svelte.js';
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { IconProps } from './types.js';
|
|
4
4
|
let {
|
|
5
5
|
children,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
size && assets.className('icon', 'size', size),
|
|
40
40
|
rest.class
|
|
41
41
|
]}
|
|
42
|
-
style:--
|
|
42
|
+
style:--icon-color={assets.color(color)}
|
|
43
43
|
>
|
|
44
44
|
{#if icon && icon.includes('/')}
|
|
45
45
|
<img src={icon} {alt} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as App } from './app/app.svelte';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as Button } from './button/button.svelte';
|
|
3
3
|
export { default as Icon } from './icon/icon.svelte';
|
|
4
4
|
export { default as Dropdown } from './dropdown/dropdown.svelte';
|
|
5
5
|
export { default as Popover } from './popover/popover.svelte';
|
|
@@ -19,3 +19,4 @@ export { default as Card } from './card/card.svelte';
|
|
|
19
19
|
export { default as Toolbar } from './toolbar/toolbar.svelte';
|
|
20
20
|
export { default as Appbar } from './appbar/appbar.svelte';
|
|
21
21
|
export { default as Spacer } from './spacer/spacer.svelte';
|
|
22
|
+
export { default as Textfield } from './textfield/textfield.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// components
|
|
2
2
|
export { default as App } from './app/app.svelte';
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as Button } from './button/button.svelte';
|
|
4
4
|
export { default as Icon } from './icon/icon.svelte';
|
|
5
5
|
export { default as Dropdown } from './dropdown/dropdown.svelte';
|
|
6
6
|
export { default as Popover } from './popover/popover.svelte';
|
|
@@ -20,3 +20,4 @@ export { default as Card } from './card/card.svelte';
|
|
|
20
20
|
export { default as Toolbar } from './toolbar/toolbar.svelte';
|
|
21
21
|
export { default as Appbar } from './appbar/appbar.svelte';
|
|
22
22
|
export { default as Spacer } from './spacer/spacer.svelte';
|
|
23
|
+
export { default as Textfield } from './textfield/textfield.svelte';
|