lapikit 0.0.0-insiders.fbbc9f6 → 0.0.0-insiders.fbd9b54
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 +22 -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/prompts.js +101 -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/components/accordion/accordion.css +113 -0
- package/dist/components/accordion/accordion.svelte +37 -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 +89 -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 +31 -2
- package/dist/components/appbar/appbar.css +48 -0
- package/dist/components/appbar/appbar.svelte +40 -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 +47 -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 +46 -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 +39 -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 +63 -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 +129 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +31 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/dialog/dialog.css +134 -0
- package/dist/components/dialog/dialog.svelte +67 -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 +22 -0
- package/dist/components/dropdown/dropdown.svelte +116 -0
- package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
- package/dist/components/dropdown/dropdown.svelte.js +148 -0
- package/dist/components/dropdown/types.d.ts +26 -0
- package/dist/components/dropdown/types.js +1 -0
- package/dist/components/icon/icon.css +14 -11
- package/dist/components/index.d.ts +20 -1
- package/dist/components/index.js +20 -1
- package/dist/components/list/list.css +221 -0
- package/dist/components/list/list.svelte +44 -0
- package/dist/components/list/list.svelte.d.ts +4 -0
- package/dist/components/list/modules/list-item.svelte +76 -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 +144 -0
- package/dist/components/modal/modal.svelte +113 -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 +22 -0
- package/dist/components/popover/popover.svelte +73 -0
- package/dist/components/popover/popover.svelte.d.ts +4 -0
- package/dist/components/popover/popover.svelte.js +134 -0
- package/dist/components/popover/types.d.ts +20 -0
- package/dist/components/popover/types.js +1 -0
- package/dist/components/separator/separator.css +46 -0
- package/dist/components/separator/separator.svelte +37 -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 +7 -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 +193 -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 +47 -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 +124 -0
- package/dist/components/tooltip/tooltip.svelte +113 -0
- package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
- package/dist/components/tooltip/tooltip.svelte.js +131 -0
- package/dist/components/tooltip/types.d.ts +23 -0
- package/dist/components/tooltip/types.js +1 -0
- package/dist/internal/assets.svelte.d.ts +1 -0
- package/dist/internal/assets.svelte.js +13 -0
- package/dist/internal/clickOutside.d.ts +9 -0
- package/dist/internal/clickOutside.js +34 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -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/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/preset.js +2 -2
- package/dist/stores/index.d.ts +9 -3
- package/dist/stores/index.js +27 -3
- 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/package.json +12 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/assets.svelte.js';
|
|
3
|
+
import { clickOutside } from '../../internal/clickOutside.js';
|
|
4
|
+
import { getPositions } from './popover.svelte.js';
|
|
5
|
+
import type { PopoverProps, ModelPopoverProps } from './types.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
open = $bindable(),
|
|
9
|
+
children,
|
|
10
|
+
activator,
|
|
11
|
+
dark,
|
|
12
|
+
light,
|
|
13
|
+
rounded,
|
|
14
|
+
position,
|
|
15
|
+
color,
|
|
16
|
+
background,
|
|
17
|
+
...rest
|
|
18
|
+
}: PopoverProps = $props();
|
|
19
|
+
|
|
20
|
+
const positionAxis = getPositions();
|
|
21
|
+
const assets = getAssets();
|
|
22
|
+
|
|
23
|
+
let ref: HTMLElement | null = $state(null);
|
|
24
|
+
let refActivator: HTMLElement | null = $state(null);
|
|
25
|
+
let axis = $state({ x: 0, y: 0 });
|
|
26
|
+
let innerHeight = $state(0);
|
|
27
|
+
let innerWidth = $state(0);
|
|
28
|
+
let scrollX = $state(0);
|
|
29
|
+
let scrollY = $state(0);
|
|
30
|
+
|
|
31
|
+
axis = positionAxis?.values;
|
|
32
|
+
|
|
33
|
+
let model: ModelPopoverProps = {
|
|
34
|
+
toggle: (element) => handleToggle(element)
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleToggle = (element: HTMLElement | null) => {
|
|
38
|
+
if (element === null) return;
|
|
39
|
+
refActivator = element;
|
|
40
|
+
open = !open;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
$effect(() => {
|
|
44
|
+
if (
|
|
45
|
+
open &&
|
|
46
|
+
ref &&
|
|
47
|
+
refActivator &&
|
|
48
|
+
(scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
|
|
49
|
+
) {
|
|
50
|
+
positionAxis.update(refActivator, ref, position);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
|
|
56
|
+
|
|
57
|
+
{@render activator?.(model)}
|
|
58
|
+
|
|
59
|
+
{#if open}
|
|
60
|
+
<div
|
|
61
|
+
bind:this={ref}
|
|
62
|
+
{...rest}
|
|
63
|
+
role="menu"
|
|
64
|
+
class={['kit-popover-content', light && 'light', dark && 'dark', rest.class]}
|
|
65
|
+
style={`transform: translate(${axis.x}px, ${axis.y}px);`}
|
|
66
|
+
style:--base={assets.color(background)}
|
|
67
|
+
style:--on={assets.color(color)}
|
|
68
|
+
style:--shape={assets.shape(rounded)}
|
|
69
|
+
use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
|
|
70
|
+
>
|
|
71
|
+
{@render children?.()}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { innerWidth, innerHeight } from 'svelte/reactivity/window';
|
|
2
|
+
export function getPositions() {
|
|
3
|
+
// state
|
|
4
|
+
const axis = $state({
|
|
5
|
+
x: 0,
|
|
6
|
+
y: 0,
|
|
7
|
+
location: null
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
get values() {
|
|
11
|
+
return axis;
|
|
12
|
+
},
|
|
13
|
+
update(activator, element, location, centered, avoidCollisions) {
|
|
14
|
+
if (!activator || !element)
|
|
15
|
+
return;
|
|
16
|
+
const elementRect = element.getBoundingClientRect();
|
|
17
|
+
if (activator instanceof HTMLElement) {
|
|
18
|
+
const activatorRect = activator.getBoundingClientRect();
|
|
19
|
+
const spacing = 6;
|
|
20
|
+
const _activator = activatorRect.y + activatorRect.height;
|
|
21
|
+
const _element = elementRect.height + spacing;
|
|
22
|
+
if (location === 'top' || location === 'bottom') {
|
|
23
|
+
if (avoidCollisions) {
|
|
24
|
+
if (location === 'top') {
|
|
25
|
+
if (activatorRect.y - _element < 0) {
|
|
26
|
+
axis.y = activatorRect.bottom + spacing;
|
|
27
|
+
axis.location = 'bottom';
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
axis.y = activatorRect.top - _element;
|
|
31
|
+
axis.location = 'top';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (_activator + _element > innerHeight.current) {
|
|
36
|
+
axis.y = activatorRect.top - _element;
|
|
37
|
+
axis.location = 'top';
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
axis.y = activatorRect.bottom + spacing;
|
|
41
|
+
axis.location = 'bottom';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
if (location === 'top') {
|
|
47
|
+
axis.y = activatorRect.top - _element;
|
|
48
|
+
axis.location = 'top';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
axis.y = activatorRect.bottom + spacing;
|
|
52
|
+
axis.location = 'bottom';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (centered &&
|
|
56
|
+
activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
|
|
57
|
+
activatorRect.left + elementRect.width < innerWidth.current) {
|
|
58
|
+
axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
|
|
59
|
+
}
|
|
60
|
+
else if (activatorRect.left + elementRect.width > innerWidth.current) {
|
|
61
|
+
axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
axis.x = activatorRect.left;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (location === 'left' || location === 'right') {
|
|
68
|
+
if (avoidCollisions) {
|
|
69
|
+
if (location === 'left' && !(activatorRect.left - elementRect.width < 0)) {
|
|
70
|
+
axis.x = activatorRect.left - (elementRect.width + spacing);
|
|
71
|
+
axis.location = 'left';
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (activatorRect.left + activatorRect.width + elementRect.width + spacing >
|
|
75
|
+
innerWidth.current) {
|
|
76
|
+
axis.x = activatorRect.left - (elementRect.width + spacing);
|
|
77
|
+
axis.location = 'left';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
axis.x = activatorRect.left + activatorRect.width + spacing;
|
|
81
|
+
axis.location = 'right';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
if (location === 'left') {
|
|
87
|
+
axis.x = activatorRect.left - (elementRect.width + spacing);
|
|
88
|
+
axis.location = 'left';
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
axis.x = activatorRect.left + activatorRect.width + spacing;
|
|
92
|
+
axis.location = 'right';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (centered &&
|
|
96
|
+
activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
|
|
97
|
+
activatorRect.top + elementRect.height < innerHeight.current) {
|
|
98
|
+
axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
|
|
99
|
+
}
|
|
100
|
+
else if (activatorRect.y + elementRect.height > innerHeight.current) {
|
|
101
|
+
axis.y = activatorRect.y - elementRect.height + activatorRect.height;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
axis.y = activatorRect.y;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if (centered &&
|
|
109
|
+
activatorRect.left - (elementRect.width - activatorRect.width) / 2 > 0 &&
|
|
110
|
+
activatorRect.left + elementRect.width < innerWidth.current) {
|
|
111
|
+
axis.x = activatorRect.left - (elementRect.width - activatorRect.width) / 2;
|
|
112
|
+
}
|
|
113
|
+
else if (activatorRect.left + elementRect.width > innerWidth.current) {
|
|
114
|
+
axis.x = activatorRect.left - (elementRect.width - activatorRect.width);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
axis.x = activatorRect.left;
|
|
118
|
+
}
|
|
119
|
+
if (centered &&
|
|
120
|
+
activatorRect.top - (elementRect.height - activatorRect.height) / 2 > 0 &&
|
|
121
|
+
activatorRect.top + elementRect.height < innerHeight.current) {
|
|
122
|
+
axis.y = activatorRect.top - (elementRect.height - activatorRect.height) / 2;
|
|
123
|
+
}
|
|
124
|
+
else if (activatorRect.bottom + elementRect.height > innerHeight.current) {
|
|
125
|
+
axis.y = activatorRect.top - elementRect.height;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
axis.y = activatorRect.bottom;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export type PositionElement = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
location: string | null;
|
|
7
|
+
};
|
|
8
|
+
export interface PopoverProps extends Component {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
dark?: boolean;
|
|
11
|
+
light?: boolean;
|
|
12
|
+
rounded?: string;
|
|
13
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
14
|
+
color?: string;
|
|
15
|
+
background?: string;
|
|
16
|
+
activator?: Snippet<[ModelPopoverProps]>;
|
|
17
|
+
}
|
|
18
|
+
export type ModelPopoverProps = {
|
|
19
|
+
toggle: (element: HTMLElement | null) => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.kit-separator {
|
|
2
|
+
--separator-opacity: var(--opacity, 0.12);
|
|
3
|
+
--separator-color: var(--base, var(--kit-scrim));
|
|
4
|
+
|
|
5
|
+
display: block;
|
|
6
|
+
flex: 1 1 100%;
|
|
7
|
+
height: 0px;
|
|
8
|
+
max-height: 0px;
|
|
9
|
+
opacity: var(--separator-opacity);
|
|
10
|
+
transition: inherit;
|
|
11
|
+
border-color: var(--separator-color);
|
|
12
|
+
/* transition: border-color 0.5s; */
|
|
13
|
+
border-style: solid;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.kit-separator:not(.kit-separator--orientation-vertical) {
|
|
17
|
+
border-width: var(--border-top-width, thin) 0 0 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.kit-separator--orientation-vertical {
|
|
21
|
+
align-self: stretch;
|
|
22
|
+
border-width: 0 thin 0 0;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
height: auto;
|
|
25
|
+
margin-left: 0px;
|
|
26
|
+
max-height: 100%;
|
|
27
|
+
max-width: 0px;
|
|
28
|
+
vertical-align: text-bottom;
|
|
29
|
+
width: 0px;
|
|
30
|
+
border-width: 0 var(--border-right-width, thin) 0 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.kit-separator--inset:not(.kit-separator--orientation-vertical) {
|
|
34
|
+
max-width: calc(100% - 4.5rem);
|
|
35
|
+
margin-inline-start: 4.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.kit-separator--inset.kit-separator--orientation-vertical {
|
|
39
|
+
margin-bottom: 0.5rem;
|
|
40
|
+
margin-top: 0.5rem;
|
|
41
|
+
max-height: calc(100% - 1rem);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.kit-separator:not(.kit-separator--orientation-vertical) {
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { SeparatorProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
is = 'hr',
|
|
7
|
+
light,
|
|
8
|
+
dark,
|
|
9
|
+
inset,
|
|
10
|
+
thickness,
|
|
11
|
+
orientation = 'horizontal',
|
|
12
|
+
opacity,
|
|
13
|
+
color,
|
|
14
|
+
...rest
|
|
15
|
+
}: SeparatorProps = $props();
|
|
16
|
+
|
|
17
|
+
const assets = getAssets();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<svelte:element
|
|
21
|
+
this={is}
|
|
22
|
+
{...rest}
|
|
23
|
+
class={[
|
|
24
|
+
'kit-separator',
|
|
25
|
+
light && 'light',
|
|
26
|
+
dark && 'dark',
|
|
27
|
+
inset && 'kit-separator--inset',
|
|
28
|
+
orientation && assets.className('separator', 'orientation', orientation),
|
|
29
|
+
rest.class
|
|
30
|
+
]}
|
|
31
|
+
aria-orientation={orientation}
|
|
32
|
+
role="separator"
|
|
33
|
+
style:--base={assets.color(color)}
|
|
34
|
+
style:--opacity={opacity}
|
|
35
|
+
style:--border-top-width={orientation === 'horizontal' ? assets.unit(thickness) : undefined}
|
|
36
|
+
style:--border-right-width={orientation === 'vertical' ? assets.unit(thickness) : undefined}
|
|
37
|
+
/>
|
|
@@ -0,0 +1,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/* root */
|
|
2
|
+
.kit-textfield {
|
|
3
|
+
--textfield-color: var(--on, var(--kit-on-container));
|
|
4
|
+
--textfield-background: var(--base, var(--kit-container));
|
|
5
|
+
--textfield-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.kit-textfield {
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
font-size: 1rem;
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-areas:
|
|
13
|
+
'prepend control append'
|
|
14
|
+
'a messages b';
|
|
15
|
+
grid-template-columns: max-content minmax(0, 1fr) max-content;
|
|
16
|
+
grid-template-rows: 1fr auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* variant */
|
|
20
|
+
.kit-textfield[breakpoint]kit-textfield--variant-filled .kit-field {
|
|
21
|
+
--textfield-border-color: var(--textfield-background);
|
|
22
|
+
background-color: var(--textfield-background);
|
|
23
|
+
border-radius: var(--textfield-radius);
|
|
24
|
+
color: var(--textfield-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.kit-textfield[breakpoint]kit-textfield--variant-outline .kit-field {
|
|
28
|
+
--textfield-border-color: var(--textfield-color);
|
|
29
|
+
background-color: var(--textfield-background);
|
|
30
|
+
border-radius: var(--textfield-radius);
|
|
31
|
+
color: var(--textfield-color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.kit-textfield[breakpoint]kit-textfield--variant-filled .kit-textfield-outline,
|
|
35
|
+
.kit-textfield[breakpoint]kit-textfield--variant-outline .kit-textfield-outline {
|
|
36
|
+
border-bottom: 1px solid var(--textfield-border-color);
|
|
37
|
+
border-top: 1px solid var(--textfield-border-color);
|
|
38
|
+
border-right: 1px solid var(--textfield-border-color);
|
|
39
|
+
border-left: 1px solid var(--textfield-border-color);
|
|
40
|
+
border-radius: var(--textfield-radius);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.kit-textfield[breakpoint]kit-textfield--variant-text .kit-field {
|
|
44
|
+
--textfield-border-color: var(--textfield-color);
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
border-radius: 0;
|
|
47
|
+
color: var(--textfield-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.kit-textfield[breakpoint]kit-textfield--variant-text .kit-textfield-outline {
|
|
51
|
+
border-bottom: 1px solid var(--textfield-border-color);
|
|
52
|
+
border-top: 0;
|
|
53
|
+
border-right: 0;
|
|
54
|
+
border-left: 0;
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.kit-textfield--hide-spin-buttons input[type='number'] {
|
|
59
|
+
-moz-appearance: textfield;
|
|
60
|
+
appearance: textfield;
|
|
61
|
+
}
|
|
62
|
+
.kit-textfield--hide-spin-buttons input[type='number']::-webkit-inner-spin-button,
|
|
63
|
+
.kit-textfield--hide-spin-buttons input[type='number']::-webkit-outer-spin-button {
|
|
64
|
+
display: none;
|
|
65
|
+
-webkit-appearance: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.kit-textfield--disabled {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.kit-textfield--readonly {
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.kit-textfield--error .kit-textfield-outline {
|
|
78
|
+
border: 1px solid var(--kit-error);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.kit-textfield-outline {
|
|
82
|
+
align-items: stretch;
|
|
83
|
+
contain: layout;
|
|
84
|
+
display: flex;
|
|
85
|
+
height: 100%;
|
|
86
|
+
left: 0;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
position: absolute;
|
|
89
|
+
right: 0;
|
|
90
|
+
width: 100%;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.kit-textfield .kit-textfield-prepend {
|
|
94
|
+
display: flex;
|
|
95
|
+
grid-area: prepend;
|
|
96
|
+
margin-inline-end: 16px;
|
|
97
|
+
align-items: center;
|
|
98
|
+
padding-top: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.kit-textfield .kit-textfield-append {
|
|
102
|
+
display: flex;
|
|
103
|
+
grid-area: append;
|
|
104
|
+
margin-inline-start: 16px;
|
|
105
|
+
align-items: center;
|
|
106
|
+
padding-top: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* control */
|
|
110
|
+
.kit-textfield-control {
|
|
111
|
+
display: flex;
|
|
112
|
+
grid-area: control;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.kit-textfield-control .kit-textfield-prepend-inner {
|
|
116
|
+
grid-area: prepend-inner;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
padding-top: 0;
|
|
120
|
+
}
|
|
121
|
+
.kit-textfield-control .kit-textfield-clearable {
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
padding-top: 0;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
margin-inline: 4px;
|
|
128
|
+
grid-area: clear;
|
|
129
|
+
opacity: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.kit-textfield-clearable.kit-textfield-clearable--visible {
|
|
133
|
+
opacity: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.kit-textfield-control .kit-textfield-append-inner {
|
|
137
|
+
grid-area: append-inner;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
padding-top: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* field prefix suffix */
|
|
144
|
+
.kit-field .kit-field--field .kit-field--field-prefix,
|
|
145
|
+
.kit-field .kit-field--field .kit-field--field-suffix {
|
|
146
|
+
align-items: center;
|
|
147
|
+
cursor: default;
|
|
148
|
+
display: flex;
|
|
149
|
+
transition: inherit;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* field */
|
|
154
|
+
.kit-textfield-control .kit-field {
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-template-areas: 'prepend-inner field clear append-inner';
|
|
157
|
+
grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
|
|
158
|
+
font-size: calc(var(--kit-spacing) * var(--textfield-multiplier-font-size));
|
|
159
|
+
max-width: 100%;
|
|
160
|
+
contain: layout;
|
|
161
|
+
flex: 1 0;
|
|
162
|
+
grid-area: control;
|
|
163
|
+
position: relative;
|
|
164
|
+
padding: calc(var(--kit-spacing) * var(--textfield-multiplier-x))
|
|
165
|
+
calc(var(--kit-spacing) * var(--textfield-multiplier-y));
|
|
166
|
+
gap: calc(var(--kit-spacing) * var(--textfield-multiplier-gap));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.kit-textfield-control .kit-field .kit-field--field {
|
|
170
|
+
flex: 1 0;
|
|
171
|
+
grid-area: field;
|
|
172
|
+
position: relative;
|
|
173
|
+
align-items: flex-start;
|
|
174
|
+
display: flex;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.kit-field .kit-field--field input {
|
|
178
|
+
font: inherit;
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
color: inherit;
|
|
181
|
+
flex: 1;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
align-items: center;
|
|
184
|
+
color: inherit;
|
|
185
|
+
column-gap: 2px;
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-wrap: wrap;
|
|
188
|
+
position: relative;
|
|
189
|
+
width: 100%;
|
|
190
|
+
row-gap: 8px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.kit-field .kit-field--field input:focus,
|
|
194
|
+
.kit-field .kit-field--field input:focus-visible,
|
|
195
|
+
.kit-field .kit-field--field input:active {
|
|
196
|
+
outline: none;
|
|
197
|
+
box-shadow: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* message */
|
|
201
|
+
.kit-textfield-message {
|
|
202
|
+
padding-inline: var(--textfield-spacing-y);
|
|
203
|
+
align-items: flex-end;
|
|
204
|
+
display: flex;
|
|
205
|
+
font-size: 0.75rem;
|
|
206
|
+
grid-area: messages;
|
|
207
|
+
min-height: 22px;
|
|
208
|
+
padding-top: var(--textfield-spacing-x);
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
justify-content: space-between;
|
|
211
|
+
opacity: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.kit-textfield-message.kit-textfield-message--visible {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.kit-message {
|
|
219
|
+
flex: 1 1 auto;
|
|
220
|
+
font-size: 12px;
|
|
221
|
+
min-height: 14px;
|
|
222
|
+
min-width: 1px;
|
|
223
|
+
position: relative;
|
|
224
|
+
display: grid;
|
|
225
|
+
gap: calc(var(--kit-spacing) * var(--textfield-multiplier-gap));
|
|
226
|
+
grid-template-areas: 'message-prepend message message-append ';
|
|
227
|
+
grid-template-columns: max-content minmax(0, 1fr) max-content;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.kit-message.kit-message--message-error {
|
|
231
|
+
color: var(--kit-error);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.kit-message .kit-message--message {
|
|
235
|
+
line-height: 12px;
|
|
236
|
+
word-break: break-word;
|
|
237
|
+
overflow-wrap: break-word;
|
|
238
|
+
word-wrap: break-word;
|
|
239
|
+
hyphens: auto;
|
|
240
|
+
grid-area: message;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.kit-message .kit-message--prepend,
|
|
244
|
+
.kit-message .kit-message--append {
|
|
245
|
+
line-height: 12px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.kit-message .kit-message--prepend {
|
|
249
|
+
grid-area: message-prepend;
|
|
250
|
+
}
|
|
251
|
+
.kit-message .kit-message--append {
|
|
252
|
+
grid-area: message-append;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* size */
|
|
256
|
+
.kit-textfield[breakpoint]kit-textfield--size-xs {
|
|
257
|
+
--textfield-multiplier-x: 2;
|
|
258
|
+
--textfield-multiplier-y: 2;
|
|
259
|
+
--textfield-multiplier-gap: 1;
|
|
260
|
+
--textfield-multiplier-font-size: 6;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.kit-textfield[breakpoint]kit-textfield--size-sm {
|
|
264
|
+
--textfield-multiplier-x: 3;
|
|
265
|
+
--textfield-multiplier-y: 4;
|
|
266
|
+
--textfield-multiplier-gap: 2;
|
|
267
|
+
--textfield-multiplier-font-size: 7;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.kit-textfield[breakpoint]kit-textfield--size-md {
|
|
271
|
+
--textfield-multiplier-x: 4;
|
|
272
|
+
--textfield-multiplier-y: 6;
|
|
273
|
+
--textfield-multiplier-gap: 2;
|
|
274
|
+
--textfield-multiplier-font-size: 8;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.kit-textfield[breakpoint]kit-textfield--size-lg {
|
|
278
|
+
--textfield-multiplier-x: 5;
|
|
279
|
+
--textfield-multiplier-y: 6;
|
|
280
|
+
--textfield-multiplier-gap: 2;
|
|
281
|
+
--textfield-multiplier-font-size: 9;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.kit-textfield[breakpoint]kit-textfield--size-xl {
|
|
285
|
+
--textfield-multiplier-x: 6;
|
|
286
|
+
--textfield-multiplier-y: 8;
|
|
287
|
+
--textfield-multiplier-gap: 3;
|
|
288
|
+
--textfield-multiplier-font-size: 10;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/*density */
|
|
292
|
+
.kit-textfield[breakpoint]kit-textfield--density-default {
|
|
293
|
+
--textfield-spacing-x: 0;
|
|
294
|
+
--textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.kit-textfield[breakpoint]kit-textfield--density-compact {
|
|
298
|
+
--textfield-spacing-x: calc(0 - 0.5rem);
|
|
299
|
+
--textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y) - 0.5rem);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.kit-textfield[breakpoint]kit-textfield--density-comfortable {
|
|
303
|
+
--textfield-spacing-x: calc(0 + 0.5rem);
|
|
304
|
+
--textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y) + 0.5rem);
|
|
305
|
+
}
|