lapikit 0.6.2 → 0.6.4
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/dist/components/accordion/accordion.svelte +172 -42
- package/dist/components/accordion/accordion.types.d.ts +8 -3
- package/dist/components/accordion/modules/accordion-item.svelte +71 -72
- package/dist/components/alert/alert.svelte +201 -118
- package/dist/components/alert/alert.types.d.ts +8 -6
- package/dist/components/app/app.svelte +36 -27
- package/dist/components/appbar/appbar.svelte +115 -64
- package/dist/components/appbar/appbar.types.d.ts +4 -4
- package/dist/components/aspect-ratio/aspect-ratio.svelte +4 -12
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +2 -1
- package/dist/components/avatar/avatar.svelte +108 -66
- package/dist/components/avatar/avatar.types.d.ts +7 -5
- package/dist/components/btn/btn.svelte +167 -169
- package/dist/components/btn/btn.types.d.ts +5 -2
- package/dist/components/card/card.svelte +9 -10
- package/dist/components/chip/chip.svelte +162 -140
- package/dist/components/chip/chip.types.d.ts +7 -3
- package/dist/components/dialog/dialog.svelte +84 -81
- package/dist/components/dialog/dialog.types.d.ts +7 -5
- package/dist/components/dropdown/dropdown.svelte +46 -36
- package/dist/components/dropdown/dropdown.types.d.ts +4 -2
- package/dist/components/icon/icon.svelte +28 -52
- package/dist/components/list/list.svelte +126 -93
- package/dist/components/list/list.types.d.ts +4 -5
- package/dist/components/list/modules/list-item.svelte +82 -99
- package/dist/components/modal/modal.svelte +104 -98
- package/dist/components/modal/modal.types.d.ts +7 -5
- package/dist/components/popover/popover.svelte +46 -34
- package/dist/components/popover/popover.types.d.ts +3 -1
- package/dist/components/separator/separator.svelte +11 -30
- package/dist/components/separator/separator.types.d.ts +1 -2
- package/dist/components/textfield/textfield.svelte +180 -157
- package/dist/components/textfield/textfield.types.d.ts +4 -3
- package/dist/components/toolbar/toolbar.svelte +126 -108
- package/dist/components/toolbar/toolbar.types.d.ts +6 -7
- package/dist/components/tooltip/tooltip.svelte +39 -45
- package/dist/components/tooltip/tooltip.types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ripple } from '../../../animations';
|
|
3
3
|
import { makeComponentProps } from '../../../html-mapped';
|
|
4
|
-
import { useClassName, useStyles } from '../../../utils';
|
|
4
|
+
import { useClassName, useIsInteractive, useStyles } from '../../../utils';
|
|
5
5
|
import type { ListItemProps } from '../list.types.js';
|
|
6
6
|
|
|
7
7
|
let {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
href = undefined,
|
|
18
18
|
color = undefined,
|
|
19
19
|
background = undefined,
|
|
20
|
-
|
|
20
|
+
interactive = false,
|
|
21
21
|
active = false,
|
|
22
22
|
disabled = false,
|
|
23
23
|
noRipple = false,
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
let tag = $derived(href ? 'a' : is === 'div' && restProps.onclick ? 'button' : is);
|
|
32
|
-
let isInteractive = $derived(tag !== 'div' && tag !== 'li' && !disabled);
|
|
32
|
+
// let isInteractive = $derived(tag !== 'div' && tag !== 'li' && !disabled);
|
|
33
|
+
let isInteractive = $derived(useIsInteractive(rest, tag, ['a', 'button'], interactive));
|
|
33
34
|
|
|
34
35
|
let componentClass = $derived(
|
|
35
36
|
useClassName({
|
|
@@ -48,15 +49,7 @@
|
|
|
48
49
|
})
|
|
49
50
|
);
|
|
50
51
|
|
|
51
|
-
let mergedStyle = $derived(
|
|
52
|
-
[
|
|
53
|
-
componentStyle,
|
|
54
|
-
color ? `--kit-list-item-fg:${color}` : '',
|
|
55
|
-
background ? `--kit-list-item-bg:${background}` : ''
|
|
56
|
-
]
|
|
57
|
-
.filter(Boolean)
|
|
58
|
-
.join('; ')
|
|
59
|
-
);
|
|
52
|
+
let mergedStyle = $derived([componentStyle].filter(Boolean).join('; '));
|
|
60
53
|
</script>
|
|
61
54
|
|
|
62
55
|
<svelte:element
|
|
@@ -67,17 +60,22 @@
|
|
|
67
60
|
href={href && !disabled ? href : undefined}
|
|
68
61
|
data-active={active}
|
|
69
62
|
data-disabled={disabled}
|
|
70
|
-
data-rounded={rounded}
|
|
71
63
|
aria-disabled={disabled || undefined}
|
|
72
64
|
disabled={tag === 'button' ? disabled : undefined}
|
|
73
65
|
tabindex={href && disabled ? -1 : undefined}
|
|
74
66
|
role={tag === 'div' ? 'listitem' : undefined}
|
|
67
|
+
data-append={append && true}
|
|
68
|
+
data-prepend={prepend && true}
|
|
69
|
+
data-interactive={isInteractive}
|
|
70
|
+
style:--kit-list-item-fg={color && `var(--kit-color-${color})`}
|
|
71
|
+
style:--kit-list-item-bg={background && `var(--kit-color-${background})`}
|
|
75
72
|
use:ripple={{
|
|
76
73
|
component: 'list-item',
|
|
77
74
|
disabled: noRipple || !isInteractive
|
|
78
75
|
}}
|
|
79
76
|
{...restProps}
|
|
80
77
|
>
|
|
78
|
+
<span class="outline"></span>
|
|
81
79
|
{#if prepend}
|
|
82
80
|
<span class="kit-list-item__prepend">
|
|
83
81
|
{@render prepend?.()}
|
|
@@ -97,116 +95,82 @@
|
|
|
97
95
|
|
|
98
96
|
<style>
|
|
99
97
|
.kit-list-item {
|
|
100
|
-
|
|
101
|
-
--kit-list-item-
|
|
102
|
-
--kit-list-item-radius: 8px;
|
|
103
|
-
|
|
98
|
+
width: 100%;
|
|
99
|
+
min-height: calc(var(--kit-list-item-h) * var(--kit-list-density-h-scale));
|
|
104
100
|
position: relative;
|
|
105
101
|
display: grid;
|
|
106
|
-
grid-template-columns:
|
|
102
|
+
grid-template-columns: 1fr;
|
|
107
103
|
align-items: center;
|
|
108
|
-
gap: var(--kit-list-item-gap
|
|
109
|
-
min-height: calc(var(--kit-list-item-h, 2.75rem) + var(--kit-list-density-offset, 0rem));
|
|
110
|
-
padding-inline: var(--kit-list-item-px, 0.875rem);
|
|
111
|
-
border: 0;
|
|
104
|
+
gap: var(--kit-list-item-gap);
|
|
112
105
|
border-radius: var(--kit-list-item-radius);
|
|
106
|
+
border: 0;
|
|
113
107
|
background: var(--kit-list-item-bg);
|
|
114
108
|
color: var(--kit-list-item-fg);
|
|
115
109
|
text-decoration: none;
|
|
116
|
-
font:
|
|
117
|
-
font-size: var(--kit-list-item-font, 0.9375rem);
|
|
118
|
-
text-align: left;
|
|
110
|
+
font-size: var(--kit-list-item-font);
|
|
119
111
|
}
|
|
120
112
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
--kit-list-item-px
|
|
124
|
-
--kit-list-item-gap: var(--kit-list-item-gap-xs, 0.5rem);
|
|
125
|
-
--kit-list-item-font: var(--kit-list-item-font-xs, 0.75rem);
|
|
113
|
+
.kit-list-item .kit-list-item__prepend,
|
|
114
|
+
.kit-list-item:not([data-prepend='true']) .kit-list-item__content {
|
|
115
|
+
margin-left: calc(var(--kit-list-item-px) * var(--kit-list-density-scale));
|
|
126
116
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
--kit-list-item-
|
|
130
|
-
--kit-list-item-px: var(--kit-list-item-px-sm, 0.75rem);
|
|
131
|
-
--kit-list-item-gap: var(--kit-list-item-gap-sm, 0.5rem);
|
|
132
|
-
--kit-list-item-font: var(--kit-list-item-font-sm, 0.875rem);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:global(.kit-list[data-size='md']) .kit-list-item {
|
|
136
|
-
--kit-list-item-h: var(--kit-list-item-h-md, 2.75rem);
|
|
137
|
-
--kit-list-item-px: var(--kit-list-item-px-md, 0.875rem);
|
|
138
|
-
--kit-list-item-gap: var(--kit-list-item-gap-md, 0.625rem);
|
|
139
|
-
--kit-list-item-font: var(--kit-list-item-font-md, 0.9375rem);
|
|
117
|
+
.kit-list-item .kit-list-item__append,
|
|
118
|
+
.kit-list-item:not([data-append='true']) .kit-list-item__content {
|
|
119
|
+
margin-right: calc(var(--kit-list-item-px) * var(--kit-list-density-scale));
|
|
140
120
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
--kit-list-item-
|
|
144
|
-
--kit-list-item-px: var(--kit-list-item-px-lg, 1rem);
|
|
145
|
-
--kit-list-item-gap: var(--kit-list-item-gap-lg, 0.75rem);
|
|
146
|
-
--kit-list-item-font: var(--kit-list-item-font-lg, 1rem);
|
|
121
|
+
.kit-list-item:not([data-prepend='true']):not([data-append='true']) .kit-list-item__content {
|
|
122
|
+
margin-left: calc(var(--kit-list-item-px) * var(--kit-list-density-scale));
|
|
123
|
+
margin-right: calc(var(--kit-list-item-px) * var(--kit-list-density-scale));
|
|
147
124
|
}
|
|
148
125
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
--kit-list-item-px: var(--kit-list-item-px-xl, 1.125rem);
|
|
152
|
-
--kit-list-item-gap: var(--kit-list-item-gap-xl, 0.875rem);
|
|
153
|
-
--kit-list-item-font: var(--kit-list-item-font-xl, 1.0625rem);
|
|
126
|
+
.kit-list-item[data-prepend='true']:not([data-append='true']) {
|
|
127
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
154
128
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
--kit-list-item-radius: 0;
|
|
129
|
+
.kit-list-item[data-append='true']:not([data-prepend='true']) {
|
|
130
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
158
131
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
--kit-list-item-radius: 2px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.kit-list-item[data-rounded='sm'] {
|
|
165
|
-
--kit-list-item-radius: 8px;
|
|
132
|
+
.kit-list-item[data-append='true'][data-prepend='true'] {
|
|
133
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
166
134
|
}
|
|
167
135
|
|
|
168
|
-
.kit-list-item
|
|
169
|
-
|
|
136
|
+
a.kit-list-item {
|
|
137
|
+
text-decoration: none;
|
|
170
138
|
}
|
|
171
139
|
|
|
172
|
-
.kit-list-item
|
|
173
|
-
|
|
140
|
+
button.kit-list-item {
|
|
141
|
+
appearance: none;
|
|
142
|
+
border: 0;
|
|
143
|
+
font: inherit;
|
|
144
|
+
text-align: inherit;
|
|
174
145
|
}
|
|
175
146
|
|
|
176
|
-
.kit-list-item[data-
|
|
177
|
-
|
|
147
|
+
.kit-list-item[data-interactive='true'][data-disabled='false'] {
|
|
148
|
+
cursor: pointer;
|
|
178
149
|
}
|
|
179
150
|
|
|
180
|
-
|
|
181
|
-
|
|
151
|
+
.kit-list-item[data-interactive='true'][data-disabled='false']:hover {
|
|
152
|
+
translate: 0 -1px;
|
|
153
|
+
background: var(--kit-list-item-hover-bg);
|
|
182
154
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
background:
|
|
155
|
+
.kit-list-item[data-active='true'][data-disabled='false'] {
|
|
156
|
+
translate: 0 0;
|
|
157
|
+
background: var(--kit-list-item-active-bg);
|
|
186
158
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
position: absolute;
|
|
191
|
-
inset: 0;
|
|
192
|
-
border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
|
|
193
|
-
border-radius: inherit;
|
|
194
|
-
pointer-events: none;
|
|
159
|
+
.kit-list-item[data-interactive='true'][data-disabled='false']:active {
|
|
160
|
+
translate: 0 0;
|
|
161
|
+
background: var(--kit-list-item-active-bg);
|
|
195
162
|
}
|
|
196
163
|
|
|
197
|
-
.kit-list-item[data-
|
|
198
|
-
|
|
164
|
+
.kit-list-item[data-interactive='true'][data-disabled='false']:focus-visible {
|
|
165
|
+
outline: 2px solid var(--kit-focus);
|
|
166
|
+
outline-offset: 2px;
|
|
199
167
|
}
|
|
200
168
|
|
|
201
169
|
.kit-list-item[data-disabled='true'] {
|
|
202
|
-
opacity: 0.
|
|
170
|
+
opacity: var(--kit-disabled-opacity, 0.55);
|
|
203
171
|
pointer-events: none;
|
|
204
172
|
}
|
|
205
173
|
|
|
206
|
-
.kit-list-item:is(button, a) {
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
174
|
.kit-list-item__prepend,
|
|
211
175
|
.kit-list-item__append,
|
|
212
176
|
.kit-list-item__content {
|
|
@@ -221,14 +185,33 @@
|
|
|
221
185
|
white-space: nowrap;
|
|
222
186
|
}
|
|
223
187
|
|
|
224
|
-
.kit-list-item
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
188
|
+
.kit-list-item .outline {
|
|
189
|
+
--outline-color: var(--kit-list-item-bd);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* rounded
|
|
194
|
+
* @link ...
|
|
195
|
+
*/
|
|
196
|
+
.kit-list-item[data-rounded='0'] {
|
|
197
|
+
--kit-list-item-radius: var(--kit-shape-none);
|
|
198
|
+
}
|
|
199
|
+
.kit-list-item[data-rounded='xs'] {
|
|
200
|
+
--kit-list-item-radius: var(--kit-shape-xs);
|
|
201
|
+
}
|
|
202
|
+
.kit-list-item[data-rounded='sm'] {
|
|
203
|
+
--kit-list-item-radius: var(--kit-shape-sm);
|
|
204
|
+
}
|
|
205
|
+
.kit-list-item[data-rounded='md'] {
|
|
206
|
+
--kit-list-item-radius: var(--kit-shape-md);
|
|
207
|
+
}
|
|
208
|
+
.kit-list-item[data-rounded='lg'] {
|
|
209
|
+
--kit-list-item-radius: var(--kit-shape-lg);
|
|
210
|
+
}
|
|
211
|
+
.kit-list-item[data-rounded='xl'] {
|
|
212
|
+
--kit-list-item-radius: var(--kit-shape-xl);
|
|
213
|
+
}
|
|
214
|
+
.kit-list-item[data-rounded='full'] {
|
|
215
|
+
--kit-list-item-radius: var(--kit-shape-full);
|
|
233
216
|
}
|
|
234
217
|
</style>
|
|
@@ -2,30 +2,9 @@
|
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import { get } from 'svelte/store';
|
|
4
4
|
import { makeComponentProps } from '../../html-mapped';
|
|
5
|
-
import { useClassName, useStyles } from '../../utils';
|
|
5
|
+
import { useClassName, useElevation, useStyles } from '../../utils';
|
|
6
6
|
import { modalOpen, modalStack, popModal, pushModal, setOpenModal } from './modal.js';
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
function resolveSize(value: ModalSize | undefined): ModalSize {
|
|
10
|
-
return value === 'xs' ||
|
|
11
|
-
value === 'sm' ||
|
|
12
|
-
value === 'md' ||
|
|
13
|
-
value === 'lg' ||
|
|
14
|
-
value === 'xl' ||
|
|
15
|
-
value === 'full'
|
|
16
|
-
? value
|
|
17
|
-
: 'md';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function resolvePosition(value: ModalPosition | undefined): ModalPosition {
|
|
21
|
-
return value === 'top' || value === 'center' || value === 'bottom' ? value : 'center';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function resolveDensity(value: ModalDensity | undefined): ModalDensity {
|
|
25
|
-
return value === 'compact' || value === 'comfortable' || value === 'default'
|
|
26
|
-
? value
|
|
27
|
-
: 'default';
|
|
28
|
-
}
|
|
7
|
+
import type { ModalProps } from './modal.types.js';
|
|
29
8
|
|
|
30
9
|
const modalId = crypto.randomUUID();
|
|
31
10
|
let wasPushed = $state(false);
|
|
@@ -48,6 +27,8 @@
|
|
|
48
27
|
color = undefined,
|
|
49
28
|
background = undefined,
|
|
50
29
|
closeWithEsc = true,
|
|
30
|
+
space,
|
|
31
|
+
elevation = '2',
|
|
51
32
|
...rest
|
|
52
33
|
}: ModalProps = $props();
|
|
53
34
|
|
|
@@ -55,6 +36,8 @@
|
|
|
55
36
|
makeComponentProps(rest as Record<string, unknown>)
|
|
56
37
|
);
|
|
57
38
|
|
|
39
|
+
let elevationState = $derived(useElevation(elevation));
|
|
40
|
+
|
|
58
41
|
let componentClass = $derived(
|
|
59
42
|
useClassName({
|
|
60
43
|
baseClass: 'kit-modal',
|
|
@@ -78,18 +61,7 @@
|
|
|
78
61
|
: `${classContent ?? ''}`.trim()
|
|
79
62
|
);
|
|
80
63
|
|
|
81
|
-
let
|
|
82
|
-
let safePosition = $derived(resolvePosition(position));
|
|
83
|
-
let safeDensity = $derived(resolveDensity(density));
|
|
84
|
-
let mergedStyle = $derived(
|
|
85
|
-
[
|
|
86
|
-
componentStyle,
|
|
87
|
-
color ? `--kit-modal-fg:${color}` : '',
|
|
88
|
-
background ? `--kit-modal-bg:${background}` : ''
|
|
89
|
-
]
|
|
90
|
-
.filter(Boolean)
|
|
91
|
-
.join('; ')
|
|
92
|
-
);
|
|
64
|
+
let mergedStyle = $derived([componentStyle].filter(Boolean).join('; '));
|
|
93
65
|
|
|
94
66
|
$effect(() => {
|
|
95
67
|
if (open && !wasPushed) {
|
|
@@ -151,18 +123,23 @@
|
|
|
151
123
|
data-contain={contain}
|
|
152
124
|
>
|
|
153
125
|
{#if contain}
|
|
154
|
-
|
|
155
|
-
<div class="kit-modal__overlay" onclick={handleClose}></div>
|
|
126
|
+
<div class="kit-modal__overlay" role="presentation" onclick={handleClose}></div>
|
|
156
127
|
{/if}
|
|
157
128
|
|
|
158
129
|
<div
|
|
159
130
|
{...restProps}
|
|
160
131
|
class={['kit-modal__content', contentClass]}
|
|
161
|
-
data-size={
|
|
162
|
-
data-position={
|
|
163
|
-
data-density={
|
|
132
|
+
data-size={size}
|
|
133
|
+
data-position={position}
|
|
134
|
+
data-density={density}
|
|
164
135
|
data-rounded={rounded}
|
|
136
|
+
data-elevation={elevationState.base}
|
|
137
|
+
data-elevation-hover={elevationState.hover}
|
|
138
|
+
data-elevation-active={elevationState.active}
|
|
165
139
|
onclick={(event: MouseEvent) => event.stopPropagation()}
|
|
140
|
+
style:--kit-modal-fg={color && `var(--kit-color-${color})`}
|
|
141
|
+
style:--kit-modal-bg={background && `var(--kit-color-${background})`}
|
|
142
|
+
style:--kit-modal-space={space}
|
|
166
143
|
>
|
|
167
144
|
{@render children?.()}
|
|
168
145
|
</div>
|
|
@@ -171,16 +148,7 @@
|
|
|
171
148
|
|
|
172
149
|
<style>
|
|
173
150
|
.kit-modal {
|
|
174
|
-
--kit-modal-bg: var(--kit-surface-1);
|
|
175
|
-
--kit-modal-fg: var(--kit-fg);
|
|
176
|
-
--kit-modal-bd: var(--kit-border);
|
|
177
|
-
--kit-modal-radius: 12px;
|
|
178
|
-
--kit-modal-px: 1rem;
|
|
179
|
-
--kit-modal-py: 1rem;
|
|
180
151
|
--kit-modal-max: min(32rem, calc(100vw - 2rem));
|
|
181
|
-
--kit-modal-top: 50%;
|
|
182
|
-
--kit-modal-bottom: auto;
|
|
183
|
-
--kit-modal-translate-y: -50%;
|
|
184
152
|
|
|
185
153
|
position: fixed;
|
|
186
154
|
inset: 0;
|
|
@@ -195,29 +163,30 @@
|
|
|
195
163
|
.kit-modal__overlay {
|
|
196
164
|
position: absolute;
|
|
197
165
|
inset: 0;
|
|
198
|
-
background:
|
|
166
|
+
background: color-mix(in oklab, var(--kit-color-shadow), transparent 70%);
|
|
199
167
|
backdrop-filter: blur(2px);
|
|
200
168
|
pointer-events: auto;
|
|
201
169
|
}
|
|
202
170
|
|
|
203
171
|
.kit-modal__content {
|
|
172
|
+
--kit-modal-bg: var(--kit-color-surface-1);
|
|
173
|
+
--kit-modal-fg: var(--kit-color-text);
|
|
174
|
+
|
|
204
175
|
position: fixed;
|
|
205
|
-
left:
|
|
176
|
+
left: var(--kit-modal-left);
|
|
177
|
+
right: var(--kit-modal-right);
|
|
206
178
|
top: var(--kit-modal-top);
|
|
207
179
|
bottom: var(--kit-modal-bottom);
|
|
208
|
-
translate: -
|
|
180
|
+
translate: var(--kit-modal-translate-x) var(--kit-modal-translate-y);
|
|
209
181
|
box-sizing: border-box;
|
|
210
182
|
width: min(calc(100vw - 2rem), var(--kit-modal-max));
|
|
211
183
|
max-height: calc(100dvh - 2rem);
|
|
212
184
|
overflow: auto;
|
|
213
|
-
padding: var(--kit-modal-
|
|
214
|
-
border:
|
|
185
|
+
padding: calc(var(--kit-modal-px) * var(--kit-modal-density-scale));
|
|
186
|
+
border: 0;
|
|
215
187
|
border-radius: var(--kit-modal-radius);
|
|
216
188
|
background: var(--kit-modal-bg);
|
|
217
189
|
color: var(--kit-modal-fg);
|
|
218
|
-
box-shadow:
|
|
219
|
-
0 20px 50px rgb(15 23 42 / 0.18),
|
|
220
|
-
0 4px 16px rgb(15 23 42 / 0.1);
|
|
221
190
|
pointer-events: auto;
|
|
222
191
|
}
|
|
223
192
|
|
|
@@ -225,24 +194,33 @@
|
|
|
225
194
|
position: absolute;
|
|
226
195
|
}
|
|
227
196
|
|
|
197
|
+
/**
|
|
198
|
+
* size
|
|
199
|
+
* @link nothing...
|
|
200
|
+
*/
|
|
228
201
|
.kit-modal__content[data-size='xs'] {
|
|
229
|
-
--kit-modal-max:
|
|
202
|
+
--kit-modal-max: 20rem;
|
|
203
|
+
--kit-modal-px: 10px;
|
|
230
204
|
}
|
|
231
205
|
|
|
232
206
|
.kit-modal__content[data-size='sm'] {
|
|
233
|
-
--kit-modal-max:
|
|
207
|
+
--kit-modal-max: 24rem;
|
|
208
|
+
--kit-modal-px: 12px;
|
|
234
209
|
}
|
|
235
210
|
|
|
236
211
|
.kit-modal__content[data-size='md'] {
|
|
237
|
-
--kit-modal-max:
|
|
212
|
+
--kit-modal-max: 32rem;
|
|
213
|
+
--kit-modal-px: 16px;
|
|
238
214
|
}
|
|
239
215
|
|
|
240
216
|
.kit-modal__content[data-size='lg'] {
|
|
241
|
-
--kit-modal-max:
|
|
217
|
+
--kit-modal-max: 42rem;
|
|
218
|
+
--kit-modal-px: 20px;
|
|
242
219
|
}
|
|
243
220
|
|
|
244
221
|
.kit-modal__content[data-size='xl'] {
|
|
245
|
-
--kit-modal-max:
|
|
222
|
+
--kit-modal-max: 56rem;
|
|
223
|
+
--kit-modal-px: 24px;
|
|
246
224
|
}
|
|
247
225
|
|
|
248
226
|
.kit-modal__content[data-size='full'] {
|
|
@@ -258,60 +236,88 @@
|
|
|
258
236
|
border-bottom-right-radius: 0;
|
|
259
237
|
}
|
|
260
238
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
.kit-modal__content[data-position='center'] {
|
|
268
|
-
--kit-modal-top: 50%;
|
|
269
|
-
--kit-modal-bottom: auto;
|
|
270
|
-
--kit-modal-translate-y: -50%;
|
|
239
|
+
/**
|
|
240
|
+
* density
|
|
241
|
+
* @link no links
|
|
242
|
+
*/
|
|
243
|
+
.kit-modal__content[data-density='none'] {
|
|
244
|
+
--kit-modal-density-scale: 0;
|
|
271
245
|
}
|
|
272
|
-
|
|
273
|
-
.kit-modal__content[data-position='bottom'] {
|
|
274
|
-
--kit-modal-top: auto;
|
|
275
|
-
--kit-modal-bottom: 1rem;
|
|
276
|
-
--kit-modal-translate-y: 0;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
246
|
.kit-modal__content[data-density='compact'] {
|
|
280
|
-
--kit-modal-
|
|
281
|
-
--kit-modal-py: 0.75rem;
|
|
247
|
+
--kit-modal-density-scale: 0.9;
|
|
282
248
|
}
|
|
283
|
-
|
|
284
249
|
.kit-modal__content[data-density='default'] {
|
|
285
|
-
--kit-modal-
|
|
286
|
-
--kit-modal-py: 1rem;
|
|
250
|
+
--kit-modal-density-scale: 1;
|
|
287
251
|
}
|
|
288
|
-
|
|
289
252
|
.kit-modal__content[data-density='comfortable'] {
|
|
290
|
-
--kit-modal-
|
|
291
|
-
--kit-modal-py: 1.25rem;
|
|
253
|
+
--kit-modal-density-scale: 1.1;
|
|
292
254
|
}
|
|
293
255
|
|
|
256
|
+
/**
|
|
257
|
+
* rounded
|
|
258
|
+
* @link ...
|
|
259
|
+
*/
|
|
294
260
|
.kit-modal__content[data-rounded='0'] {
|
|
295
|
-
--kit-modal-radius:
|
|
261
|
+
--kit-modal-radius: var(--kit-shape-none);
|
|
296
262
|
}
|
|
297
|
-
|
|
298
263
|
.kit-modal__content[data-rounded='xs'] {
|
|
299
|
-
--kit-modal-radius:
|
|
264
|
+
--kit-modal-radius: var(--kit-shape-xs);
|
|
300
265
|
}
|
|
301
|
-
|
|
302
266
|
.kit-modal__content[data-rounded='sm'] {
|
|
303
|
-
--kit-modal-radius:
|
|
267
|
+
--kit-modal-radius: var(--kit-shape-sm);
|
|
304
268
|
}
|
|
305
|
-
|
|
306
269
|
.kit-modal__content[data-rounded='md'] {
|
|
307
|
-
--kit-modal-radius:
|
|
270
|
+
--kit-modal-radius: var(--kit-shape-md);
|
|
308
271
|
}
|
|
309
|
-
|
|
310
272
|
.kit-modal__content[data-rounded='lg'] {
|
|
311
|
-
--kit-modal-radius:
|
|
273
|
+
--kit-modal-radius: var(--kit-shape-lg);
|
|
312
274
|
}
|
|
313
|
-
|
|
314
275
|
.kit-modal__content[data-rounded='xl'] {
|
|
315
|
-
--kit-modal-radius:
|
|
276
|
+
--kit-modal-radius: var(--kit-shape-xl);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* position
|
|
281
|
+
* @link nothing...
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
.kit-modal__content[data-position='top'],
|
|
285
|
+
.kit-modal__content[data-position='center'],
|
|
286
|
+
.kit-modal__content[data-position='bottom'] {
|
|
287
|
+
--kit-modal-translate-x: -50%;
|
|
288
|
+
--kit-modal-left: 50%;
|
|
289
|
+
}
|
|
290
|
+
.kit-modal__content[data-position='top'],
|
|
291
|
+
.kit-modal__content[data-position='top-left'],
|
|
292
|
+
.kit-modal__content[data-position='top-right'] {
|
|
293
|
+
--kit-modal-top: var(--kit-modal-space, 1rem);
|
|
294
|
+
--kit-modal-bottom: auto;
|
|
295
|
+
--kit-modal-translate-y: 0;
|
|
296
|
+
}
|
|
297
|
+
.kit-modal__content[data-position='center'],
|
|
298
|
+
.kit-modal__content[data-position='center-left'],
|
|
299
|
+
.kit-modal__content[data-position='center-right'] {
|
|
300
|
+
--kit-modal-top: 50%;
|
|
301
|
+
--kit-modal-bottom: auto;
|
|
302
|
+
--kit-modal-translate-y: -50%;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.kit-modal__content[data-position='bottom'],
|
|
306
|
+
.kit-modal__content[data-position='bottom-left'],
|
|
307
|
+
.kit-modal__content[data-position='bottom-right'] {
|
|
308
|
+
--kit-modal-top: auto;
|
|
309
|
+
--kit-modal-bottom: var(--kit-modal-space, 1rem);
|
|
310
|
+
--kit-modal-translate-y: 0;
|
|
311
|
+
}
|
|
312
|
+
.kit-modal__content[data-position='top-left'],
|
|
313
|
+
.kit-modal__content[data-position='center-left'],
|
|
314
|
+
.kit-modal__content[data-position='bottom-left'] {
|
|
315
|
+
--kit-modal-left: var(--kit-modal-space, 1rem);
|
|
316
|
+
--kit-modal-translate-x: 0;
|
|
317
|
+
}
|
|
318
|
+
.kit-modal__content[data-position='top-right'],
|
|
319
|
+
.kit-modal__content[data-position='center-right'],
|
|
320
|
+
.kit-modal__content[data-position='bottom-right'] {
|
|
321
|
+
--kit-modal-right: var(--kit-modal-space, 1rem);
|
|
316
322
|
}
|
|
317
323
|
</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Component, RoundedType } from '../../@types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type ModalDensity = 'compact' | 'comfortable' | 'default';
|
|
1
|
+
import type { Component, DensityType, ElevationProps, RoundedType } from '../../@types';
|
|
2
|
+
type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
|
+
type ModalPosition = 'top' | 'center' | 'bottom' | 'top-left' | 'top-right' | 'center-left' | 'center-right' | 'bottom-left' | 'bottom-right';
|
|
5
4
|
export interface ModalProps extends Component {
|
|
6
5
|
ref?: HTMLDivElement | null;
|
|
7
6
|
open?: boolean;
|
|
@@ -10,9 +9,12 @@ export interface ModalProps extends Component {
|
|
|
10
9
|
persistent?: boolean;
|
|
11
10
|
position?: ModalPosition;
|
|
12
11
|
rounded?: RoundedType;
|
|
13
|
-
density?:
|
|
12
|
+
density?: DensityType;
|
|
14
13
|
classContent?: string | string[] | undefined;
|
|
15
14
|
color?: string;
|
|
16
15
|
background?: string;
|
|
17
16
|
closeWithEsc?: boolean;
|
|
17
|
+
space?: string;
|
|
18
|
+
elevation?: ElevationProps;
|
|
18
19
|
}
|
|
20
|
+
export {};
|