lapikit 0.6.3 → 0.6.5
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 +173 -35
- package/dist/components/accordion/accordion.types.d.ts +8 -3
- package/dist/components/accordion/modules/accordion-item.svelte +79 -74
- package/dist/components/alert/alert.svelte +204 -115
- package/dist/components/alert/alert.types.d.ts +8 -6
- package/dist/components/app/app.svelte +76 -37
- package/dist/components/appbar/appbar.svelte +116 -59
- package/dist/components/appbar/appbar.types.d.ts +5 -4
- package/dist/components/aspect-ratio/aspect-ratio.svelte +4 -13
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +2 -1
- package/dist/components/avatar/avatar.svelte +117 -67
- package/dist/components/avatar/avatar.types.d.ts +7 -5
- package/dist/components/btn/btn.svelte +175 -171
- package/dist/components/btn/btn.types.d.ts +5 -2
- package/dist/components/card/card.svelte +11 -3
- package/dist/components/card/modules/card-actions.svelte +1 -1
- package/dist/components/chip/chip.svelte +172 -142
- package/dist/components/chip/chip.types.d.ts +7 -3
- package/dist/components/dialog/dialog.svelte +94 -83
- package/dist/components/dialog/dialog.types.d.ts +7 -5
- package/dist/components/dropdown/dropdown.svelte +47 -31
- package/dist/components/dropdown/dropdown.types.d.ts +4 -2
- package/dist/components/icon/icon.svelte +34 -51
- package/dist/components/list/list.svelte +10 -4
- package/dist/components/list/modules/list-item.svelte +10 -59
- package/dist/components/modal/modal.svelte +114 -102
- package/dist/components/modal/modal.types.d.ts +7 -5
- package/dist/components/popover/popover.svelte +54 -36
- package/dist/components/popover/popover.types.d.ts +4 -2
- package/dist/components/separator/separator.svelte +15 -23
- package/dist/components/separator/separator.types.d.ts +1 -2
- package/dist/components/textfield/textfield.svelte +181 -152
- package/dist/components/textfield/textfield.types.d.ts +4 -3
- package/dist/components/toolbar/toolbar.svelte +127 -103
- package/dist/components/toolbar/toolbar.types.d.ts +6 -7
- package/dist/components/tooltip/tooltip.svelte +40 -40
- package/dist/components/tooltip/tooltip.types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
ref = $bindable(),
|
|
8
8
|
is = 'hr',
|
|
9
9
|
inset = false,
|
|
10
|
-
thickness,
|
|
10
|
+
thickness = 'thin',
|
|
11
11
|
orientation = 'horizontal',
|
|
12
|
-
opacity,
|
|
13
12
|
color,
|
|
14
13
|
class: className = '',
|
|
15
14
|
style: styleAttr = '',
|
|
@@ -18,12 +17,6 @@
|
|
|
18
17
|
...rest
|
|
19
18
|
}: SeparatorProps = $props();
|
|
20
19
|
|
|
21
|
-
let safeOrientation = $derived(
|
|
22
|
-
typeof orientation === 'string' && (orientation === 'horizontal' || orientation === 'vertical')
|
|
23
|
-
? orientation
|
|
24
|
-
: 'horizontal'
|
|
25
|
-
);
|
|
26
|
-
|
|
27
20
|
let { classProps, styleProps, restProps } = $derived(
|
|
28
21
|
makeComponentProps(rest as Record<string, unknown>)
|
|
29
22
|
);
|
|
@@ -45,16 +38,18 @@
|
|
|
45
38
|
})
|
|
46
39
|
);
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
const formatThickness = (value?: number | string) =>
|
|
42
|
+
typeof thickness === 'number' ? `${value}px` : value;
|
|
43
|
+
|
|
44
|
+
let resolvedStyle = $derived(
|
|
49
45
|
[
|
|
50
46
|
componentStyle,
|
|
51
|
-
color ? `--kit-separator-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
? `--kit-separator-top-width:${typeof thickness === 'number' ? `${thickness}px` : thickness}`
|
|
47
|
+
color ? `--kit-separator-fg:${color && `var(--kit-color-${color})`}` : '',
|
|
48
|
+
thickness && orientation === 'horizontal'
|
|
49
|
+
? `--kit-separator-top-width:${formatThickness(thickness)}`
|
|
55
50
|
: '',
|
|
56
|
-
thickness
|
|
57
|
-
? `--kit-separator-right-width:${
|
|
51
|
+
thickness && orientation === 'vertical'
|
|
52
|
+
? `--kit-separator-right-width:${formatThickness(thickness)}`
|
|
58
53
|
: ''
|
|
59
54
|
]
|
|
60
55
|
.filter(Boolean)
|
|
@@ -67,26 +62,23 @@
|
|
|
67
62
|
bind:this={ref}
|
|
68
63
|
{...restProps}
|
|
69
64
|
class={componentClass}
|
|
70
|
-
style={
|
|
65
|
+
style={resolvedStyle}
|
|
71
66
|
role="separator"
|
|
72
|
-
aria-orientation={
|
|
67
|
+
aria-orientation={orientation || 'horizontal'}
|
|
73
68
|
data-inset={inset || undefined}
|
|
74
|
-
data-orientation={
|
|
69
|
+
data-orientation={orientation}
|
|
70
|
+
style:--kit-separator-color={color && `var(--kit-color-${color})`}
|
|
75
71
|
/>
|
|
76
72
|
|
|
77
73
|
<style>
|
|
78
74
|
.kit-separator {
|
|
79
|
-
--kit-separator-color: var(--kit-
|
|
80
|
-
--kit-separator-opacity: 0.12;
|
|
81
|
-
--kit-separator-top-width: thin;
|
|
82
|
-
--kit-separator-right-width: thin;
|
|
75
|
+
--kit-separator-color: var(--kit-color-border);
|
|
83
76
|
--kit-separator-vertical-min-size: 1.5rem;
|
|
84
77
|
|
|
85
78
|
display: block;
|
|
86
79
|
flex: 1 1 100%;
|
|
87
80
|
height: 0;
|
|
88
81
|
max-height: 0;
|
|
89
|
-
opacity: var(--kit-separator-opacity);
|
|
90
82
|
border-color: var(--kit-separator-color);
|
|
91
83
|
border-style: solid;
|
|
92
84
|
transition: inherit;
|
|
@@ -5,8 +5,7 @@ export interface SeparatorProps extends Base {
|
|
|
5
5
|
is?: 'div' | 'hr';
|
|
6
6
|
inset?: boolean;
|
|
7
7
|
thickness?: string | number;
|
|
8
|
-
opacity?: string | number;
|
|
9
8
|
color?: string;
|
|
10
|
-
orientation?: Orientation
|
|
9
|
+
orientation?: Orientation;
|
|
11
10
|
}
|
|
12
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { useClassName, useStyles } from '../../utils';
|
|
2
|
+
import { useClassName, useElevation, useStyles } from '../../utils';
|
|
3
3
|
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import Icon from '../icon/icon.svelte';
|
|
5
5
|
import type { TextfieldProps } from './textfield.types.js';
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
readonly = false,
|
|
35
35
|
color,
|
|
36
36
|
background,
|
|
37
|
-
rounded,
|
|
37
|
+
rounded = 'md',
|
|
38
38
|
class: className = '',
|
|
39
39
|
style: styleAttr = '',
|
|
40
40
|
's-class': sClass,
|
|
@@ -43,29 +43,16 @@
|
|
|
43
43
|
id,
|
|
44
44
|
autocomplete,
|
|
45
45
|
inputmode,
|
|
46
|
+
elevation,
|
|
46
47
|
...rest
|
|
47
48
|
}: TextfieldProps = $props();
|
|
48
49
|
|
|
49
|
-
let safeVariant = $derived(
|
|
50
|
-
variant === 'filled' || variant === 'outline' || variant === 'text' ? variant : 'filled'
|
|
51
|
-
);
|
|
52
|
-
let safeSize = $derived(
|
|
53
|
-
size === 'default'
|
|
54
|
-
? 'md'
|
|
55
|
-
: size === 'xs' || size === 'sm' || size === 'md' || size === 'lg' || size === 'xl'
|
|
56
|
-
? size
|
|
57
|
-
: 'md'
|
|
58
|
-
);
|
|
59
|
-
let safeDensity = $derived(
|
|
60
|
-
density === 'compact' || density === 'comfortable' || density === 'default'
|
|
61
|
-
? density
|
|
62
|
-
: 'default'
|
|
63
|
-
);
|
|
64
|
-
|
|
65
50
|
let { classProps, styleProps, restProps } = $derived(
|
|
66
51
|
makeComponentProps(rest as Record<string, unknown>)
|
|
67
52
|
);
|
|
68
53
|
|
|
54
|
+
let elevationState = $derived(useElevation(elevation));
|
|
55
|
+
|
|
69
56
|
let componentClass = $derived(
|
|
70
57
|
useClassName({
|
|
71
58
|
baseClass: 'kit-textfield',
|
|
@@ -83,14 +70,11 @@
|
|
|
83
70
|
})
|
|
84
71
|
);
|
|
85
72
|
|
|
86
|
-
let
|
|
73
|
+
let resolvedStyle = $derived(
|
|
87
74
|
[
|
|
88
75
|
componentStyle,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
typeof rounded === 'string' && rounded.includes('px')
|
|
92
|
-
? `--kit-textfield-radius:${rounded}`
|
|
93
|
-
: ''
|
|
76
|
+
color ? `--kit-textfield-fg:${color && `var(--kit-color-${color})`}` : '',
|
|
77
|
+
background ? `--kit-textfield-bg:${background && `var(--kit-color-${background})`}` : ''
|
|
94
78
|
]
|
|
95
79
|
.filter(Boolean)
|
|
96
80
|
.join('; ')
|
|
@@ -146,16 +130,17 @@
|
|
|
146
130
|
<div
|
|
147
131
|
bind:this={ref}
|
|
148
132
|
class={componentClass}
|
|
149
|
-
style={
|
|
133
|
+
style={resolvedStyle}
|
|
150
134
|
{...restProps}
|
|
151
|
-
data-size={
|
|
152
|
-
data-variant={
|
|
153
|
-
data-density={
|
|
135
|
+
data-size={size}
|
|
136
|
+
data-variant={variant}
|
|
137
|
+
data-density={density}
|
|
154
138
|
data-disabled={disabled}
|
|
155
139
|
data-readonly={readonly}
|
|
156
140
|
data-error={error}
|
|
157
141
|
data-hide-spin-buttons={type === 'number' && hideSpinButtons}
|
|
158
142
|
data-rounded={rounded}
|
|
143
|
+
data-with-message={(messageValue || messagePrefix || messageSuffix || counter) && true}
|
|
159
144
|
>
|
|
160
145
|
{#if prepend}
|
|
161
146
|
<div class="kit-textfield__prepend">
|
|
@@ -164,11 +149,16 @@
|
|
|
164
149
|
{/if}
|
|
165
150
|
|
|
166
151
|
<div class="kit-textfield__control">
|
|
167
|
-
<div
|
|
168
|
-
|
|
152
|
+
<div
|
|
153
|
+
class="kit-textfield__field"
|
|
154
|
+
data-elevation={elevationState.base}
|
|
155
|
+
data-elevation-hover={elevationState.hover}
|
|
156
|
+
data-elevation-active={elevationState.active}
|
|
157
|
+
>
|
|
158
|
+
{#if variant === 'outline' || variant === 'filled'}
|
|
169
159
|
<span class="outline"></span>
|
|
170
160
|
{/if}
|
|
171
|
-
{#if
|
|
161
|
+
{#if variant === 'text'}
|
|
172
162
|
<span class="line"></span>
|
|
173
163
|
{/if}
|
|
174
164
|
|
|
@@ -234,29 +224,31 @@
|
|
|
234
224
|
</div>
|
|
235
225
|
{/if}
|
|
236
226
|
|
|
237
|
-
|
|
238
|
-
<div
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
{messageSuffix}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
227
|
+
{#if messageValue || messagePrefix || messageSuffix || counter}
|
|
228
|
+
<div class="kit-textfield__message" data-visible={displayMessage}>
|
|
229
|
+
<div
|
|
230
|
+
class="kit-textfield__message-inner"
|
|
231
|
+
data-error={error || undefined}
|
|
232
|
+
id={messageValue ? `${id ?? name ?? 'textfield'}-message` : undefined}
|
|
233
|
+
>
|
|
234
|
+
{#if messagePrefix}
|
|
235
|
+
<div class="kit-textfield__message-prefix">{messagePrefix}</div>
|
|
236
|
+
{/if}
|
|
237
|
+
{#if messageValue}
|
|
238
|
+
<div class="kit-textfield__message-text">{messageValue}</div>
|
|
239
|
+
{/if}
|
|
240
|
+
{#if counter || messageSuffix}
|
|
241
|
+
<div class="kit-textfield__message-suffix">
|
|
242
|
+
{#if counter}
|
|
243
|
+
{counterValue}{max ? `/${max}` : ''}
|
|
244
|
+
{:else if messageSuffix}
|
|
245
|
+
{messageSuffix}
|
|
246
|
+
{/if}
|
|
247
|
+
</div>
|
|
248
|
+
{/if}
|
|
249
|
+
</div>
|
|
258
250
|
</div>
|
|
259
|
-
|
|
251
|
+
{/if}
|
|
260
252
|
</div>
|
|
261
253
|
|
|
262
254
|
<style>
|
|
@@ -284,151 +276,181 @@
|
|
|
284
276
|
}
|
|
285
277
|
|
|
286
278
|
.kit-textfield {
|
|
287
|
-
--kit-textfield-bg: var(--kit-surface-2);
|
|
288
|
-
--kit-textfield-fg: var(--kit-fg);
|
|
289
|
-
--kit-textfield-bd: color-mix(in oklab, var(--kit-textfield-fg), transparent 84%);
|
|
290
|
-
--kit-textfield-radius: 8px;
|
|
291
|
-
--kit-textfield-font-size: 14px;
|
|
292
|
-
--kit-textfield-gap-base: 8px;
|
|
293
|
-
--kit-textfield-px-base: 14px;
|
|
294
|
-
--kit-textfield-py-base: 12px;
|
|
295
|
-
--kit-textfield-message-offset-base: 8px;
|
|
296
|
-
--kit-textfield-density-gap-adjust: 0px;
|
|
297
|
-
--kit-textfield-density-px-adjust: 0px;
|
|
298
|
-
--kit-textfield-density-py-adjust: 0px;
|
|
299
|
-
--kit-textfield-density-message-adjust: 0px;
|
|
300
|
-
--kit-textfield-gap: calc(
|
|
301
|
-
var(--kit-textfield-gap-base) + var(--kit-textfield-density-gap-adjust)
|
|
302
|
-
);
|
|
303
|
-
--kit-textfield-px: calc(var(--kit-textfield-px-base) + var(--kit-textfield-density-px-adjust));
|
|
304
|
-
--kit-textfield-py: calc(var(--kit-textfield-py-base) + var(--kit-textfield-density-py-adjust));
|
|
305
|
-
--kit-textfield-message-offset: calc(
|
|
306
|
-
var(--kit-textfield-message-offset-base) + var(--kit-textfield-density-message-adjust)
|
|
307
|
-
);
|
|
308
|
-
|
|
309
279
|
display: grid;
|
|
280
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
281
|
+
align-items: start;
|
|
282
|
+
column-gap: var(--kit-textfield-gap);
|
|
283
|
+
width: 100%;
|
|
284
|
+
font-size: var(--kit-textfield-font);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.kit-textfield:not([data-with-message='true']) {
|
|
288
|
+
grid-template-areas: 'prepend control append';
|
|
289
|
+
grid-template-rows: auto;
|
|
290
|
+
}
|
|
291
|
+
.kit-textfield[data-with-message='true'] {
|
|
310
292
|
grid-template-areas:
|
|
311
293
|
'prepend control append'
|
|
312
294
|
'. message .';
|
|
313
|
-
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
314
295
|
grid-template-rows: auto auto;
|
|
315
|
-
align-items: start;
|
|
316
|
-
column-gap: 16px;
|
|
317
|
-
width: 100%;
|
|
318
|
-
font-size: var(--kit-textfield-font-size);
|
|
319
296
|
}
|
|
320
297
|
|
|
321
|
-
.kit-textfield[data-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
298
|
+
.kit-textfield[data-disabled='true'] {
|
|
299
|
+
opacity: 0.55;
|
|
300
|
+
pointer-events: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.kit-textfield[data-readonly='true'] input {
|
|
304
|
+
cursor: default;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.kit-textfield[data-hide-spin-buttons='true'] input[type='number'] {
|
|
308
|
+
appearance: textfield;
|
|
309
|
+
-moz-appearance: textfield;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.kit-textfield[data-hide-spin-buttons='true'] input[type='number']::-webkit-inner-spin-button,
|
|
313
|
+
.kit-textfield[data-hide-spin-buttons='true'] input[type='number']::-webkit-outer-spin-button {
|
|
314
|
+
appearance: none;
|
|
315
|
+
-webkit-appearance: none;
|
|
316
|
+
margin: 0;
|
|
326
317
|
}
|
|
327
318
|
|
|
319
|
+
/**
|
|
320
|
+
* size
|
|
321
|
+
* @link nothing...
|
|
322
|
+
*/
|
|
323
|
+
.kit-textfield[data-size='xs'] {
|
|
324
|
+
--kit-textfield-h: 28px;
|
|
325
|
+
--kit-textfield-px: 6px;
|
|
326
|
+
--kit-textfield-py: 10px;
|
|
327
|
+
--kit-textfield-gap: 8px;
|
|
328
|
+
--kit-textfield-font: 12px;
|
|
329
|
+
}
|
|
330
|
+
.kit-textfield[data-size='xs'] :global(.kit-icon[data-size='default']) {
|
|
331
|
+
--kit-icon-current-size: 0.875rem;
|
|
332
|
+
}
|
|
328
333
|
.kit-textfield[data-size='sm'] {
|
|
329
|
-
--kit-textfield-
|
|
330
|
-
--kit-textfield-
|
|
331
|
-
--kit-textfield-
|
|
332
|
-
--kit-textfield-
|
|
334
|
+
--kit-textfield-h: 32px;
|
|
335
|
+
--kit-textfield-px: 14px;
|
|
336
|
+
--kit-textfield-py: 12px;
|
|
337
|
+
--kit-textfield-gap: 6px;
|
|
338
|
+
--kit-textfield-font: 13px;
|
|
339
|
+
}
|
|
340
|
+
.kit-textfield[data-size='sm'] :global(.kit-icon[data-size='default']) {
|
|
341
|
+
--kit-icon-current-size: 1rem;
|
|
333
342
|
}
|
|
334
343
|
|
|
335
344
|
.kit-textfield[data-size='md'] {
|
|
336
|
-
--kit-textfield-
|
|
337
|
-
--kit-textfield-
|
|
338
|
-
--kit-textfield-
|
|
339
|
-
--kit-textfield-
|
|
345
|
+
--kit-textfield-h: 40px;
|
|
346
|
+
--kit-textfield-px: 14px;
|
|
347
|
+
--kit-textfield-py: 12px;
|
|
348
|
+
--kit-textfield-gap: 8px;
|
|
349
|
+
--kit-textfield-font: 14px;
|
|
350
|
+
}
|
|
351
|
+
.kit-textfield[data-size='md'] :global(.kit-icon[data-size='default']) {
|
|
352
|
+
--kit-icon-current-size: 1.125rem;
|
|
340
353
|
}
|
|
341
354
|
|
|
342
355
|
.kit-textfield[data-size='lg'] {
|
|
343
|
-
--kit-textfield-
|
|
344
|
-
--kit-textfield-
|
|
345
|
-
--kit-textfield-
|
|
346
|
-
--kit-textfield-
|
|
356
|
+
--kit-textfield-h: 48px;
|
|
357
|
+
--kit-textfield-px: 16px;
|
|
358
|
+
--kit-textfield-py: 14px;
|
|
359
|
+
--kit-textfield-gap: 10px;
|
|
360
|
+
--kit-textfield-font: 15px;
|
|
361
|
+
}
|
|
362
|
+
.kit-textfield[data-size='lg'] :global(.kit-icon[data-size='default']) {
|
|
363
|
+
--kit-icon-current-size: 1.25rem;
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
.kit-textfield[data-size='xl'] {
|
|
350
|
-
--kit-textfield-
|
|
351
|
-
--kit-textfield-
|
|
352
|
-
--kit-textfield-
|
|
353
|
-
--kit-textfield-
|
|
367
|
+
--kit-textfield-h: 56px;
|
|
368
|
+
--kit-textfield-px: 18px;
|
|
369
|
+
--kit-textfield-py: 16px;
|
|
370
|
+
--kit-textfield-gap: 12px;
|
|
371
|
+
--kit-textfield-font: 16px;
|
|
354
372
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
--kit-textfield-density-gap-adjust: -1px;
|
|
358
|
-
--kit-textfield-density-px-adjust: -2px;
|
|
359
|
-
--kit-textfield-density-py-adjust: -2px;
|
|
360
|
-
--kit-textfield-density-message-adjust: -2px;
|
|
373
|
+
.kit-textfield[data-size='xl'] :global(.kit-icon[data-size='default']) {
|
|
374
|
+
--kit-icon-current-size: 1.375rem;
|
|
361
375
|
}
|
|
362
376
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
377
|
+
/**
|
|
378
|
+
* variant
|
|
379
|
+
* @link no link
|
|
380
|
+
*/
|
|
381
|
+
.kit-textfield[data-variant='filled'] {
|
|
382
|
+
--kit-textfield-bg: var(--kit-color-surface-2);
|
|
383
|
+
--kit-textfield-fg: var(--kit-color-text);
|
|
369
384
|
|
|
370
|
-
|
|
371
|
-
|
|
385
|
+
--kit-textfield-hover-bg: color-mix(in oklab, var(---kit-textfield-bg), black 10%);
|
|
386
|
+
--kit-textfield-active-bg: color-mix(in oklab, var(--kit-textfield-bg), black 16%);
|
|
372
387
|
}
|
|
388
|
+
.kit-textfield[data-variant='outline'] {
|
|
389
|
+
--kit-textfield-bg: transparent;
|
|
390
|
+
--kit-textfield-fg: var(--kit-color-text);
|
|
391
|
+
--kit-textfield-bd: var(--kit-textfield-fg);
|
|
373
392
|
|
|
374
|
-
|
|
375
|
-
|
|
393
|
+
--kit-textfield-hover-bg: color-mix(in oklab, var(--kit-textfield-fg), transparent 80%);
|
|
394
|
+
--kit-textfield-active-bg: color-mix(in oklab, var(--kit-textfield-fg), transparent 92%);
|
|
376
395
|
}
|
|
396
|
+
.kit-textfield[data-variant='text'] {
|
|
397
|
+
--kit-textfield-bg: transparent;
|
|
398
|
+
--kit-textfield-fg: var(--kit-color-text);
|
|
399
|
+
--kit-textfield-bd: var(--kit-textfield-fg);
|
|
377
400
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
border-radius: 0;
|
|
401
|
+
--kit-textfield-hover-bg: color-mix(in oklab, var(--kit-textfield-fg), transparent 80%);
|
|
402
|
+
--kit-textfield-active-bg: color-mix(in oklab, var(--kit-textfield-fg), transparent 92%);
|
|
381
403
|
}
|
|
382
404
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
405
|
+
/**
|
|
406
|
+
* density
|
|
407
|
+
* @link ...
|
|
408
|
+
*/
|
|
409
|
+
.kit-textfield[data-density='none'] {
|
|
410
|
+
--kit-textfield-density-scale: 0;
|
|
411
|
+
--kit-textfield-density-h-scale: 0;
|
|
386
412
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
413
|
+
.kit-textfield[data-density='compact'] {
|
|
414
|
+
--kit-textfield-density-scale: 0.9;
|
|
415
|
+
--kit-textfield-density-h-scale: 0.92;
|
|
390
416
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
-moz-appearance: textfield;
|
|
417
|
+
.kit-textfield[data-density='default'] {
|
|
418
|
+
--kit-textfield-density-scale: 1;
|
|
419
|
+
--kit-textfield-density-h-scale: 1;
|
|
395
420
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
appearance: none;
|
|
400
|
-
-webkit-appearance: none;
|
|
401
|
-
margin: 0;
|
|
421
|
+
.kit-textfield[data-density='comfortable'] {
|
|
422
|
+
--kit-textfield-density-scale: 1.1;
|
|
423
|
+
--kit-textfield-density-h-scale: 1.15;
|
|
402
424
|
}
|
|
403
425
|
|
|
426
|
+
/**
|
|
427
|
+
* rounded
|
|
428
|
+
* @link ...
|
|
429
|
+
*/
|
|
404
430
|
.kit-textfield[data-rounded='0'] {
|
|
405
|
-
--kit-textfield-radius:
|
|
431
|
+
--kit-textfield-radius: var(--kit-shape-none);
|
|
406
432
|
}
|
|
407
|
-
|
|
408
433
|
.kit-textfield[data-rounded='xs'] {
|
|
409
|
-
--kit-textfield-radius:
|
|
434
|
+
--kit-textfield-radius: var(--kit-shape-xs);
|
|
410
435
|
}
|
|
411
|
-
|
|
412
436
|
.kit-textfield[data-rounded='sm'] {
|
|
413
|
-
--kit-textfield-radius:
|
|
437
|
+
--kit-textfield-radius: var(--kit-shape-sm);
|
|
414
438
|
}
|
|
415
|
-
|
|
416
439
|
.kit-textfield[data-rounded='md'] {
|
|
417
|
-
--kit-textfield-radius:
|
|
440
|
+
--kit-textfield-radius: var(--kit-shape-md);
|
|
418
441
|
}
|
|
419
|
-
|
|
420
442
|
.kit-textfield[data-rounded='lg'] {
|
|
421
|
-
--kit-textfield-radius:
|
|
443
|
+
--kit-textfield-radius: var(--kit-shape-lg);
|
|
422
444
|
}
|
|
423
|
-
|
|
424
445
|
.kit-textfield[data-rounded='xl'] {
|
|
425
|
-
--kit-textfield-radius:
|
|
446
|
+
--kit-textfield-radius: var(--kit-shape-xl);
|
|
426
447
|
}
|
|
427
448
|
|
|
428
449
|
.kit-textfield__prepend,
|
|
429
450
|
.kit-textfield__append {
|
|
430
451
|
display: flex;
|
|
431
452
|
align-items: center;
|
|
453
|
+
height: 100%;
|
|
432
454
|
}
|
|
433
455
|
|
|
434
456
|
.kit-textfield__prepend {
|
|
@@ -452,9 +474,12 @@
|
|
|
452
474
|
gap: var(--kit-textfield-gap);
|
|
453
475
|
width: 100%;
|
|
454
476
|
min-width: 0;
|
|
455
|
-
|
|
477
|
+
min-height: calc(var(--kit-textfield-h) * var(--kit-textfield-density-h-scale));
|
|
478
|
+
padding: 0 calc(var(--kit-textfield-px) * var(--kit-textfield-density-scale));
|
|
456
479
|
border-radius: var(--kit-textfield-radius);
|
|
480
|
+
background: var(--kit-textfield-bg);
|
|
457
481
|
color: var(--kit-textfield-fg);
|
|
482
|
+
font-size: var(--kit-textfield-font);
|
|
458
483
|
}
|
|
459
484
|
|
|
460
485
|
.kit-textfield__prepend-inner,
|
|
@@ -529,16 +554,15 @@
|
|
|
529
554
|
}
|
|
530
555
|
|
|
531
556
|
.kit-textfield[data-error='true'] .outline {
|
|
532
|
-
--outline-color: var(--kit-
|
|
557
|
+
--outline-color: var(--kit-color-error);
|
|
533
558
|
}
|
|
534
559
|
|
|
535
560
|
.kit-textfield[data-error='true'] .line {
|
|
536
|
-
|
|
561
|
+
--kit-textfield-bd: var(--kit-color-error);
|
|
537
562
|
}
|
|
538
563
|
|
|
539
564
|
.kit-textfield__message {
|
|
540
565
|
grid-area: message;
|
|
541
|
-
padding-top: var(--kit-textfield-message-offset);
|
|
542
566
|
padding-inline: var(--kit-textfield-px);
|
|
543
567
|
font-size: 12px;
|
|
544
568
|
opacity: 0;
|
|
@@ -557,7 +581,7 @@
|
|
|
557
581
|
}
|
|
558
582
|
|
|
559
583
|
.kit-textfield__message-inner[data-error='true'] {
|
|
560
|
-
color: var(--kit-
|
|
584
|
+
color: var(--kit-color-error);
|
|
561
585
|
}
|
|
562
586
|
|
|
563
587
|
.kit-textfield__message-prefix,
|
|
@@ -565,6 +589,11 @@
|
|
|
565
589
|
line-height: 1.2;
|
|
566
590
|
}
|
|
567
591
|
|
|
592
|
+
.kit-textfield__message-suffix {
|
|
593
|
+
align-items: end;
|
|
594
|
+
text-align: end;
|
|
595
|
+
}
|
|
596
|
+
|
|
568
597
|
.kit-textfield__message-text {
|
|
569
598
|
line-height: 1.2;
|
|
570
599
|
word-break: break-word;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, RoundedType, SizeType } from '../../@types';
|
|
1
|
+
import type { Component, DensityType, ElevationProps, RoundedType, SizeType } from '../../@types';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
4
4
|
export interface TextfieldProps extends Component {
|
|
@@ -10,14 +10,14 @@ export interface TextfieldProps extends Component {
|
|
|
10
10
|
min?: number;
|
|
11
11
|
max?: number;
|
|
12
12
|
variant?: 'outline' | 'text' | 'filled';
|
|
13
|
-
density?:
|
|
13
|
+
density?: DensityType;
|
|
14
14
|
error?: boolean;
|
|
15
15
|
errorMessage?: string;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
color?: string;
|
|
18
18
|
background?: string;
|
|
19
19
|
size?: SizeType;
|
|
20
|
-
rounded?: RoundedType
|
|
20
|
+
rounded?: RoundedType;
|
|
21
21
|
readonly?: boolean;
|
|
22
22
|
hideSpinButtons?: boolean;
|
|
23
23
|
persistentMessage?: boolean;
|
|
@@ -36,4 +36,5 @@ export interface TextfieldProps extends Component {
|
|
|
36
36
|
id?: string;
|
|
37
37
|
autocomplete?: HTMLInputAttributes['autocomplete'];
|
|
38
38
|
inputmode?: HTMLInputAttributes['inputmode'];
|
|
39
|
+
elevation?: ElevationProps;
|
|
39
40
|
}
|