lapikit 0.0.0-insiders.df219d7 → 0.0.0-insiders.e3186bc
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 +303 -0
- package/bin/helper.js +0 -38
- package/bin/index.js +17 -49
- 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/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 +11 -18
- 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 +68 -32
- 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 -18
- package/dist/components/appbar/appbar.svelte +4 -4
- package/dist/components/appbar/types.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -22
- 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 +29 -36
- package/dist/components/button/button.svelte +5 -5
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/card/card.css +10 -20
- package/dist/components/card/card.svelte +9 -5
- package/dist/components/card/types.d.ts +3 -1
- package/dist/components/chip/chip.css +30 -37
- package/dist/components/chip/chip.svelte +10 -8
- package/dist/components/chip/types.d.ts +2 -1
- 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 +11 -12
- package/dist/components/icon/icon.svelte +2 -2
- package/dist/components/icon/types.d.ts +1 -1
- package/dist/components/list/list.css +19 -91
- package/dist/components/list/list.svelte +4 -4
- package/dist/components/list/modules/list-item.css +67 -0
- package/dist/components/list/modules/list-item.svelte +5 -5
- package/dist/components/list/types.d.ts +1 -1
- package/dist/components/modal/modal.css +22 -29
- package/dist/components/modal/modal.svelte +4 -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 +16 -23
- package/dist/components/textfield/textfield.svelte +4 -4
- package/dist/components/textfield/types.d.ts +1 -1
- 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} +4 -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/{ripple.js → core/animations/ripple.js} +3 -3
- 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/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 -10
- package/dist/stores/index.js +5 -47
- 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/styles/keyframes.css +30 -0
- package/dist/{style/normalize.css → styles/reset.css} +15 -7
- 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 +105 -95
- package/bin/lapikit.js +0 -86
- package/bin/modules/adapter.js +0 -52
- package/bin/modules/plugin.js +0 -223
- package/bin/modules/preset.js +0 -11
- 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/animation.css +0 -62
- 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/{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/{ripple.d.ts → core/animations/ripple.d.ts} +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
- /package/dist/internal/{types.js → types/components.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.kit-accordion-item {
|
|
2
|
+
flex: 1 0 100%;
|
|
3
|
+
max-width: 100%;
|
|
4
|
+
position: relative;
|
|
5
|
+
transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
|
|
6
|
+
transition-property: margin-top, border-radius, border, max-width;
|
|
7
|
+
border-radius: var(--accordion-shape, var(--system-shape-md));
|
|
8
|
+
color: var(--accordion-color, var(--kit-label-primary));
|
|
9
|
+
background-color: var(--accordion-background, var(--kit-background-grouped-primary));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.kit-accordion-item > button,
|
|
13
|
+
.kit-accordion-item > [type='button'] {
|
|
14
|
+
font: inherit;
|
|
15
|
+
overflow: visible;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
border-style: none;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
color: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.kit-accordion-item .kit-accordion-item--title {
|
|
23
|
+
align-items: center;
|
|
24
|
+
text-align: start;
|
|
25
|
+
border-radius: inherit;
|
|
26
|
+
display: flex;
|
|
27
|
+
font-size: 0.9375rem;
|
|
28
|
+
min-height: 3rem;
|
|
29
|
+
outline: none;
|
|
30
|
+
padding: 1rem 1.5rem;
|
|
31
|
+
position: relative;
|
|
32
|
+
transition: 0.3s min-height margin-bottom margin-top border-radius cubic-bezier(0.4, 0, 0.2, 1);
|
|
33
|
+
width: 100%;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.kit-accordion-item .kit-accordion-item--text {
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.kit-accordion-item .kit-accordion-item--text .kit-accordion-item--text-wrapper {
|
|
42
|
+
padding: 0.5rem 1.5rem 1rem;
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.kit-accordion-item .kit-accordion-item--icon {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
margin-bottom: -0.25rem;
|
|
50
|
+
margin-top: -0.25rem;
|
|
51
|
+
-webkit-user-select: none;
|
|
52
|
+
user-select: none;
|
|
53
|
+
margin-inline-start: auto;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* disabled */
|
|
57
|
+
.kit-accordion-item .kit-accordion-item--title.kit-accordion-item--disabled,
|
|
58
|
+
.kit-accordion-item .kit-accordion-item--title[disabled],
|
|
59
|
+
.kit-accordion-item .kit-accordion-item--title:disabled {
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
user-select: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.kit-accordion-item .kit-accordion-item--title.kit-accordion-item--disabled > *,
|
|
65
|
+
.kit-accordion-item .kit-accordion-item--title[disabled] > *,
|
|
66
|
+
.kit-accordion-item .kit-accordion-item--title:disabled > * {
|
|
67
|
+
opacity: 0.6;
|
|
68
|
+
}
|
|
@@ -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 { AccordionItemProps, ModelAccordionItemProps } from '../types.js';
|
|
4
4
|
|
|
5
5
|
// components
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
open && 'kit-accordion-item--active',
|
|
50
50
|
rest.class
|
|
51
51
|
]}
|
|
52
|
-
style:--
|
|
53
|
-
style:--
|
|
54
|
-
style:--
|
|
52
|
+
style:--accordion--item-shape={assets.shape(rounded)}
|
|
53
|
+
style:--accordion--item-background={assets.color(background)}
|
|
54
|
+
style:--accordion--item-color={assets.color(color)}
|
|
55
55
|
>
|
|
56
56
|
<button
|
|
57
57
|
class={[
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/* root */
|
|
2
|
-
.kit-alert {
|
|
3
|
-
--alert-color: var(--on, var(--kit-on-container));
|
|
4
|
-
--alert-background: var(--base, var(--kit-container));
|
|
5
|
-
--alert-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
.kit-alert {
|
|
9
2
|
display: grid;
|
|
10
3
|
flex: 1 1;
|
|
@@ -15,9 +8,9 @@
|
|
|
15
8
|
position: relative;
|
|
16
9
|
padding: 1rem;
|
|
17
10
|
overflow: hidden;
|
|
18
|
-
color: var(--alert-color);
|
|
19
|
-
background-color: var(--alert-background);
|
|
20
|
-
border-radius: var(--alert-
|
|
11
|
+
color: var(--alert-color, var(--kit-label-primary));
|
|
12
|
+
background-color: var(--alert-background, var(--kit-background-grouped-tertiary));
|
|
13
|
+
border-radius: var(--alert-shape, var(--system-shape-md));
|
|
21
14
|
line-height: 0;
|
|
22
15
|
}
|
|
23
16
|
|
|
@@ -87,34 +80,34 @@
|
|
|
87
80
|
/* state */
|
|
88
81
|
.kit-alert.kit-alert--info:not([class*='alert--variant-']) {
|
|
89
82
|
--on: var(--kit-on-info);
|
|
90
|
-
--base: var(--kit-info);
|
|
83
|
+
--base: var(--kit-accent-info);
|
|
91
84
|
}
|
|
92
85
|
.kit-alert.kit-alert--info[class*='alert--variant-'] {
|
|
93
|
-
--base: var(--kit-info);
|
|
86
|
+
--base: var(--kit-accent-info);
|
|
94
87
|
}
|
|
95
88
|
|
|
96
89
|
.kit-alert.kit-alert--success:not([class*='alert--variant-']) {
|
|
97
90
|
--on: var(--kit-on-success);
|
|
98
|
-
--base: var(--kit-
|
|
91
|
+
--base: var(--kit-accent-successs);
|
|
99
92
|
}
|
|
100
93
|
.kit-alert.kit-alert--success[class*='alert--variant-'] {
|
|
101
|
-
--base: var(--kit-
|
|
94
|
+
--base: var(--kit-accent-successs);
|
|
102
95
|
}
|
|
103
96
|
|
|
104
97
|
.kit-alert.kit-alert--warning:not([class*='alert--variant-']) {
|
|
105
98
|
--on: var(--kit-on-warning);
|
|
106
|
-
--base: var(--kit-warning);
|
|
99
|
+
--base: var(--kit-accent-warning);
|
|
107
100
|
}
|
|
108
101
|
.kit-alert.kit-alert--warning[class*='alert--variant-'] {
|
|
109
|
-
--base: var(--kit-warning);
|
|
102
|
+
--base: var(--kit-accent-warning);
|
|
110
103
|
}
|
|
111
104
|
|
|
112
105
|
.kit-alert.kit-alert--error:not([class*='alert--variant-']) {
|
|
113
106
|
--on: var(--kit-on-error);
|
|
114
|
-
--base: var(--kit-
|
|
107
|
+
--base: var(--kit-accent-destructive);
|
|
115
108
|
}
|
|
116
109
|
.kit-alert.kit-alert--error[class*='alert--variant-'] {
|
|
117
|
-
--base: var(--kit-
|
|
110
|
+
--base: var(--kit-accent-destructive);
|
|
118
111
|
}
|
|
119
112
|
|
|
120
113
|
/* variant */
|
|
@@ -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 { AlertProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
// components
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
rest.class
|
|
52
52
|
]}
|
|
53
53
|
role="alert"
|
|
54
|
-
style:--
|
|
55
|
-
style:--
|
|
56
|
-
style:--shape={assets.shape(rounded)}
|
|
54
|
+
style:--alert-background={assets.color(background)}
|
|
55
|
+
style:--alert-color={assets.color(color)}
|
|
56
|
+
style:--alert-shape={assets.shape(rounded)}
|
|
57
57
|
>
|
|
58
58
|
{#if prepend}
|
|
59
59
|
<div class="kit-alert--prepend">
|
|
@@ -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
|
type AlertDensity = 'compact' | 'comfortable' | 'default';
|
|
4
4
|
type AlertVariant = 'outline' | 'dash' | 'text';
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
+
#kit-app,
|
|
2
|
+
.kit-application {
|
|
3
|
+
-webkit-text-size-adjust: 100%;
|
|
4
|
+
tab-size: 4;
|
|
5
|
+
line-height: 1.5;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
font-family: var(--kit-font-sans);
|
|
8
|
+
background-color: var(--kit-background-primary);
|
|
9
|
+
color: var(--kit-label-primary);
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
.kit-overlay {
|
|
2
13
|
position: fixed;
|
|
3
14
|
top: 0;
|
|
4
15
|
left: 0;
|
|
5
16
|
height: 100%;
|
|
6
17
|
width: 100%;
|
|
7
|
-
background-color: color-mix(in oklab,
|
|
18
|
+
background-color: color-mix(in oklab, black 70%, transparent);
|
|
8
19
|
z-index: 9000;
|
|
9
20
|
cursor: default;
|
|
10
21
|
}
|
|
11
22
|
|
|
12
23
|
.kit-overlay.kit-overlay--persistent {
|
|
13
|
-
/* pointer-events: none; */
|
|
14
24
|
user-select: none;
|
|
15
25
|
cursor: default;
|
|
16
26
|
}
|
|
@@ -1,43 +1,79 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
const BROWSER = typeof window !== 'undefined';
|
|
3
|
+
import { useTheme } from '../../actions/use-theme.js';
|
|
4
|
+
import { modalOpen, setOpenModal } from '../../stores/components.js';
|
|
5
|
+
|
|
6
|
+
import { viewport } from '../../stores/viewport.js';
|
|
7
|
+
import type { AppProps } from './types.js';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
ref = $bindable(),
|
|
11
|
+
children,
|
|
12
|
+
themes,
|
|
13
|
+
storageKey = '@lapikit/theme',
|
|
14
|
+
light,
|
|
15
|
+
dark,
|
|
16
|
+
...rest
|
|
17
|
+
}: AppProps = $props();
|
|
11
18
|
|
|
12
19
|
$effect.pre(() => {
|
|
13
20
|
if (!BROWSER) return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
const colorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
22
|
+
? 'dark'
|
|
23
|
+
: 'light';
|
|
24
|
+
const localTheme = localStorage.getItem(storageKey);
|
|
25
|
+
|
|
26
|
+
if (localTheme) {
|
|
27
|
+
useTheme(localTheme);
|
|
28
|
+
} else if (colorScheme) {
|
|
29
|
+
if (typeof themes === 'string') {
|
|
30
|
+
useTheme(themes);
|
|
31
|
+
} else if (typeof themes === 'object' && Array.isArray(themes)) {
|
|
32
|
+
if (colorScheme === 'dark') useTheme(themes[1] ?? themes[0]);
|
|
33
|
+
else useTheme(themes[0]);
|
|
34
|
+
} else {
|
|
35
|
+
useTheme(colorScheme);
|
|
36
|
+
}
|
|
19
37
|
}
|
|
20
38
|
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
// Met à jour le store viewport à l'init et sur resize
|
|
40
|
+
function updateViewport() {
|
|
41
|
+
viewport.set({
|
|
42
|
+
innerWidth: window.innerWidth,
|
|
43
|
+
outerWidth: window.outerWidth,
|
|
44
|
+
innerHeight: window.innerHeight,
|
|
45
|
+
outerHeight: window.outerHeight
|
|
26
46
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
47
|
+
}
|
|
48
|
+
updateViewport();
|
|
49
|
+
window.addEventListener('resize', updateViewport);
|
|
50
|
+
return () => {
|
|
51
|
+
window.removeEventListener('resize', updateViewport);
|
|
52
|
+
};
|
|
31
53
|
});
|
|
32
54
|
</script>
|
|
33
55
|
|
|
34
|
-
|
|
56
|
+
<div
|
|
57
|
+
id="kit-app"
|
|
58
|
+
bind:this={ref}
|
|
59
|
+
{...rest}
|
|
60
|
+
class={[
|
|
61
|
+
'kit-application',
|
|
62
|
+
light && 'light',
|
|
63
|
+
dark && 'dark',
|
|
64
|
+
light && 'kit-theme--light',
|
|
65
|
+
dark && 'kit-theme--dark',
|
|
66
|
+
rest.class
|
|
67
|
+
]}
|
|
68
|
+
>
|
|
69
|
+
{@render children?.()}
|
|
35
70
|
|
|
36
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
37
|
-
{#if $modalOpen}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{/if}
|
|
71
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
72
|
+
{#if $modalOpen}
|
|
73
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
74
|
+
<div
|
|
75
|
+
class={['kit-overlay', $modalOpen === 'persistent' && 'kit-overlay--persistent']}
|
|
76
|
+
onclick={() => $modalOpen !== 'persistent' && setOpenModal(false)}
|
|
77
|
+
></div>
|
|
78
|
+
{/if}
|
|
79
|
+
</div>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
children: Snippet;
|
|
4
|
-
};
|
|
5
|
-
declare const App: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
1
|
+
import type { AppProps } from './types.js';
|
|
2
|
+
declare const App: import("svelte").Component<AppProps, {}, "ref">;
|
|
6
3
|
type App = ReturnType<typeof App>;
|
|
7
4
|
export default App;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
export interface AppProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
ref?: HTMLDivElement;
|
|
3
5
|
children?: Snippet;
|
|
6
|
+
themes?: string | string[];
|
|
7
|
+
storageKey?: string;
|
|
8
|
+
light?: boolean;
|
|
9
|
+
dark?: boolean;
|
|
4
10
|
}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
/* root default*/
|
|
2
1
|
.kit-appbar {
|
|
3
|
-
--appbar-
|
|
4
|
-
--appbar-background: var(--base, var(--kit-surface));
|
|
5
|
-
--appbar-radius: var(--shape, 0);
|
|
6
|
-
--appbar-padding-wrapper: var(--kit-spacing) * 4;
|
|
7
|
-
}
|
|
2
|
+
--appbar-padding-wrapper: var(--system-spacing) * 4;
|
|
8
3
|
|
|
9
|
-
.kit-appbar {
|
|
10
4
|
display: flex;
|
|
11
5
|
align-items: center;
|
|
12
6
|
border-style: solid;
|
|
13
7
|
border-width: 1px;
|
|
14
|
-
border-radius: var(--appbar-
|
|
15
|
-
color: var(--appbar-color);
|
|
16
|
-
background-color: var(--appbar-background);
|
|
17
|
-
border-color: var(--appbar-background);
|
|
18
|
-
/* transition:
|
|
19
|
-
color 0.5s,
|
|
20
|
-
border-color 0.5s,
|
|
21
|
-
background-color 0.5s; */
|
|
8
|
+
border-radius: var(--appbar-shape);
|
|
9
|
+
color: var(--appbar-color, var(--kit-label-primary));
|
|
10
|
+
background-color: var(--appbar-background, var(--kit-background-grouped-tertiary));
|
|
11
|
+
border-color: var(--appbar-background, var(--kit-background-grouped-tertiary));
|
|
22
12
|
}
|
|
23
13
|
|
|
24
14
|
/* wrapper */
|
|
@@ -34,15 +24,15 @@
|
|
|
34
24
|
/* density */
|
|
35
25
|
.kit-appbar[breakpoint]kit-appbar--density-default {
|
|
36
26
|
height: 4rem;
|
|
37
|
-
padding-inline: calc(var(--
|
|
27
|
+
padding-inline: calc(var(--system-spacing) * 1.5);
|
|
38
28
|
}
|
|
39
29
|
|
|
40
30
|
.kit-appbar[breakpoint]kit-appbar--density-compact {
|
|
41
31
|
height: 3.5rem;
|
|
42
|
-
padding-inline: calc(var(--
|
|
32
|
+
padding-inline: calc(var(--system-spacing) * 0.75);
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
.kit-appbar[breakpoint]kit-appbar--density-comfortable {
|
|
46
36
|
height: 4.5rem;
|
|
47
|
-
padding-inline: calc(var(--
|
|
37
|
+
padding-inline: calc(var(--system-spacing) * 2.25);
|
|
48
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { AppbarProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
let {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
density && assets.className('appbar', 'density', density),
|
|
31
31
|
rest.class
|
|
32
32
|
]}
|
|
33
|
-
style:--
|
|
34
|
-
style:--
|
|
35
|
-
style:--shape={assets.shape(rounded)}
|
|
33
|
+
style:--appbar-background={assets.color(background)}
|
|
34
|
+
style:--appbar-color={assets.color(color)}
|
|
35
|
+
style:--appbar-shape={assets.shape(rounded)}
|
|
36
36
|
>
|
|
37
37
|
<div class={['kit-appbar--wrapper', classContent]}>
|
|
38
38
|
{@render children?.()}
|
|
@@ -23,25 +23,3 @@
|
|
|
23
23
|
<div class="kit-aspect-ratio--sizer" style={`padding-bottom: ${paddingBottom}%;`}></div>
|
|
24
24
|
{@render children?.()}
|
|
25
25
|
</div>
|
|
26
|
-
|
|
27
|
-
<style>
|
|
28
|
-
.kit-aspect-ratio {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex: 1 0 auto;
|
|
31
|
-
max-height: 100%;
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
position: relative;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.kit-aspect-ratio--inline {
|
|
38
|
-
display: inline-flex;
|
|
39
|
-
flex: 0 0 auto;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.kit-aspect-ratio--sizer {
|
|
43
|
-
flex: 1 0 0px;
|
|
44
|
-
transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
.kit-avatar {
|
|
2
|
-
--avatar-color: var(--on, var(--kit-on-container));
|
|
3
|
-
--avatar-background: var(--base, var(--kit-container));
|
|
4
|
-
--avatar-radius: var(--shape, var(--kit-radius-full));
|
|
5
|
-
|
|
6
2
|
display: flex;
|
|
7
3
|
align-items: center;
|
|
8
4
|
justify-content: center;
|
|
@@ -11,15 +7,12 @@
|
|
|
11
7
|
padding-bottom: var(--avatar-spacing-x);
|
|
12
8
|
padding-right: var(--avatar-spacing-y);
|
|
13
9
|
padding-left: var(--avatar-spacing-y);
|
|
14
|
-
|
|
15
10
|
border-width: 1px;
|
|
16
11
|
border-style: solid;
|
|
17
|
-
border-radius: var(--avatar-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: var(--avatar-
|
|
21
|
-
background-color: var(--avatar-background);
|
|
22
|
-
border-color: var(--avatar-background);
|
|
12
|
+
border-radius: var(--avatar-shape, var(--system-shape-full));
|
|
13
|
+
color: var(--avatar-color, var(--kit-label-primary));
|
|
14
|
+
background-color: var(--avatar-background, var(--kit-background-secondary));
|
|
15
|
+
border-color: var(--avatar-background, var(--kit-background-secondary));
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
.kit-avatar.kit-avatar--image {
|
|
@@ -91,19 +84,19 @@
|
|
|
91
84
|
|
|
92
85
|
/* variant */
|
|
93
86
|
.kit-avatar[breakpoint]kit-avatar--variant-outline {
|
|
94
|
-
--avatar-color: var(--base, var(--kit-
|
|
87
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
95
88
|
background-color: transparent;
|
|
96
89
|
border: 1px solid currentColor;
|
|
97
90
|
}
|
|
98
91
|
|
|
99
92
|
.kit-avatar[breakpoint]kit-avatar--variant-text {
|
|
100
|
-
--avatar-color: var(--base, var(--kit-
|
|
93
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
101
94
|
background-color: transparent;
|
|
102
95
|
border-color: transparent;
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
.kit-avatar[breakpoint]kit-avatar--variant-dash {
|
|
106
|
-
--avatar-color: var(--base, var(--kit-
|
|
99
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
107
100
|
background-color: transparent;
|
|
108
101
|
border: 1px dashed currentColor;
|
|
109
102
|
}
|
|
@@ -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 { AvatarProps } from './types.js';
|
|
4
4
|
let {
|
|
5
5
|
children,
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
density && assets.className('avatar', 'density', density),
|
|
35
35
|
rest.class
|
|
36
36
|
]}
|
|
37
|
-
style:--
|
|
38
|
-
style:--
|
|
39
|
-
style:--shape={assets.shape(rounded)}
|
|
37
|
+
style:--avatar-background={assets.color(background)}
|
|
38
|
+
style:--avatar-color={assets.color(color)}
|
|
39
|
+
style:--avatar-shape={assets.shape(rounded)}
|
|
40
40
|
>
|
|
41
41
|
{#if src}
|
|
42
42
|
<img {src} {alt} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '../../internal/types.js';
|
|
1
|
+
import type { Component } from '../../internal/types/index.js';
|
|
2
2
|
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
3
|
type AvatarDensity = 'compact' | 'comfortable' | 'default';
|
|
4
4
|
type AvatarVariant = 'outline' | 'text' | 'dash';
|