lapikit 0.7.2 → 0.7.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.
Files changed (73) hide show
  1. package/dist/@types/components.d.ts +1 -7
  2. package/dist/@types/dom.d.ts +4 -3
  3. package/dist/@types/props.d.ts +3 -3
  4. package/dist/animations/ripple.js +33 -17
  5. package/dist/components/accordion/accordion.svelte +192 -228
  6. package/dist/components/accordion/accordion.types.d.ts +5 -7
  7. package/dist/components/accordion/modules/accordion-item.svelte +144 -140
  8. package/dist/components/alert/alert.svelte +246 -293
  9. package/dist/components/alert/alert.types.d.ts +5 -5
  10. package/dist/components/app/app.svelte +29 -44
  11. package/dist/components/appbar/appbar.svelte +205 -190
  12. package/dist/components/appbar/appbar.types.d.ts +6 -6
  13. package/dist/components/aspect-ratio/aspect-ratio.svelte +43 -63
  14. package/dist/components/avatar/avatar.svelte +169 -161
  15. package/dist/components/avatar/avatar.types.d.ts +3 -4
  16. package/dist/components/btn/btn.svelte +431 -465
  17. package/dist/components/btn/btn.types.d.ts +5 -6
  18. package/dist/components/card/card.svelte +214 -176
  19. package/dist/components/card/card.types.d.ts +6 -3
  20. package/dist/components/card/modules/card-actions.svelte +11 -35
  21. package/dist/components/card/modules/card-container.svelte +9 -33
  22. package/dist/components/card/modules/card-content.svelte +18 -44
  23. package/dist/components/card/modules/card-media.svelte +10 -34
  24. package/dist/components/card/modules/card-title.svelte +22 -48
  25. package/dist/components/chip/chip.svelte +416 -464
  26. package/dist/components/chip/chip.types.d.ts +5 -5
  27. package/dist/components/dialog/dialog.svelte +174 -171
  28. package/dist/components/dialog/dialog.types.d.ts +6 -6
  29. package/dist/components/dropdown/dropdown.svelte +149 -144
  30. package/dist/components/dropdown/dropdown.types.d.ts +4 -11
  31. package/dist/components/field/field.svelte +474 -0
  32. package/dist/components/field/field.svelte.d.ts +4 -0
  33. package/dist/components/field/field.types.d.ts +46 -0
  34. package/dist/components/field/field.types.js +1 -0
  35. package/dist/components/icon/icon.svelte +67 -96
  36. package/dist/components/icon/icon.types.d.ts +2 -1
  37. package/dist/components/index.d.ts +2 -0
  38. package/dist/components/index.js +1 -0
  39. package/dist/components/list/list.svelte +193 -194
  40. package/dist/components/list/list.types.d.ts +5 -7
  41. package/dist/components/list/modules/list-item.svelte +134 -147
  42. package/dist/components/modal/modal.svelte +239 -222
  43. package/dist/components/modal/modal.types.d.ts +6 -6
  44. package/dist/components/popover/popover.svelte +125 -127
  45. package/dist/components/popover/popover.types.d.ts +4 -11
  46. package/dist/components/separator/separator.svelte +56 -87
  47. package/dist/components/separator/separator.types.d.ts +1 -1
  48. package/dist/components/spacer/spacer.svelte +6 -25
  49. package/dist/components/textfield/textfield.svelte +94 -543
  50. package/dist/components/textfield/textfield.types.d.ts +13 -33
  51. package/dist/components/toolbar/toolbar.svelte +216 -211
  52. package/dist/components/toolbar/toolbar.types.d.ts +8 -9
  53. package/dist/components/tooltip/tooltip.svelte +201 -266
  54. package/dist/components/tooltip/tooltip.types.d.ts +3 -10
  55. package/dist/constants.js +1 -0
  56. package/dist/html-mapped.d.ts +1 -15
  57. package/dist/html-mapped.js +0 -19
  58. package/dist/labs/sheet/sheet.svelte +145 -19
  59. package/dist/labs/sheet/sheet.svelte.d.ts +2 -10
  60. package/dist/labs/sheet/sheet.types.d.ts +16 -0
  61. package/dist/labs/sheet/sheet.types.js +1 -0
  62. package/dist/utils/color.d.ts +2 -2
  63. package/dist/utils/color.js +2 -1
  64. package/dist/utils/components.d.ts +10 -10
  65. package/dist/utils/components.js +16 -75
  66. package/dist/utils/floating.d.ts +58 -0
  67. package/dist/utils/floating.js +131 -0
  68. package/dist/utils/index.d.ts +1 -0
  69. package/dist/utils/index.js +1 -0
  70. package/package.json +3 -3
  71. package/dist/components/dropdown/dropdown.svelte.js +0 -148
  72. package/dist/components/popover/popover.svelte.js +0 -134
  73. package/dist/components/tooltip/tooltip.svelte.js +0 -131
@@ -1,40 +1,20 @@
1
- import type { Component, DensityType, ElevationProps, RoundedType, SizeType } from '../../@types';
2
- import type { Snippet } from 'svelte';
3
1
  import type { HTMLInputAttributes } from 'svelte/elements';
4
- export interface TextfieldProps extends Component {
2
+ import type { ClassNameType, KitClassNameType, KitStylePropertiesType, StylePropertiesType } from '../../@types';
3
+ import type { FieldBaseProps } from '../field/field.types';
4
+ type FieldOwnedAttributes = keyof FieldBaseProps | 'size' | 'type' | 'value' | 'min' | 'max';
5
+ export interface TextfieldProps extends FieldBaseProps, Omit<HTMLInputAttributes, FieldOwnedAttributes | 'class' | 'style' | 'children'> {
5
6
  ref?: HTMLElement | null;
7
+ class?: ClassNameType;
8
+ style?: StylePropertiesType;
9
+ 's-class'?: KitClassNameType;
10
+ 's-style'?: KitStylePropertiesType;
6
11
  value?: string | number;
7
- type?: 'text' | 'email' | 'password' | 'number';
8
- placeholder?: string;
9
- counter?: boolean;
12
+ type?: 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';
13
+ /** minimal length of the value */
10
14
  min?: number;
15
+ /** maximal length of the value, also used by the counter */
11
16
  max?: number;
12
- variant?: 'outline' | 'text' | 'filled';
13
- density?: DensityType;
14
- error?: boolean;
15
- errorMessage?: string;
16
- disabled?: boolean;
17
- color?: string;
18
- background?: string;
19
- size?: SizeType;
20
- rounded?: RoundedType;
21
- readonly?: boolean;
17
+ counter?: boolean;
22
18
  hideSpinButtons?: boolean;
23
- persistentMessage?: boolean;
24
- persistentClear?: boolean;
25
- clearable?: boolean;
26
- message?: string;
27
- messagePrefix?: string;
28
- messageSuffix?: string;
29
- append?: Snippet;
30
- prepend?: Snippet;
31
- prependInner?: Snippet;
32
- appendInner?: Snippet;
33
- prefix?: string;
34
- suffix?: string;
35
- name?: string;
36
- id?: string;
37
- autocomplete?: HTMLInputAttributes['autocomplete'];
38
- inputmode?: HTMLInputAttributes['inputmode'];
39
- elevation?: ElevationProps;
40
19
  }
20
+ export {};
@@ -1,21 +1,19 @@
1
1
  <script lang="ts">
2
- import { useClassName, useElevation, useStyles } from '../../utils/index';
3
- import { makeComponentProps } from '../../html-mapped';
2
+ import { useComponentAttrs, useElevation } from '../../utils';
4
3
  import type { ToolbarProps } from './toolbar.types.js';
5
4
 
6
5
  let {
7
6
  ref = $bindable(),
8
7
  is = 'div',
9
8
  children,
10
- class: className = '',
11
- style: styleAttr = '',
9
+ class: className,
10
+ style: styleAttr,
12
11
  's-class': sClass,
13
12
  's-style': sStyle,
14
13
  classContent,
15
14
  variant = 'filled',
16
15
  rounded = 'md',
17
16
  size = 'md',
18
- background,
19
17
  color,
20
18
  density = 'default',
21
19
  orientation = 'horizontal',
@@ -23,58 +21,20 @@
23
21
  ...rest
24
22
  }: ToolbarProps = $props();
25
23
 
26
- let { classProps, styleProps, restProps } = $derived(
27
- makeComponentProps(rest as Record<string, unknown>)
24
+ let attrs = $derived(
25
+ useComponentAttrs('kit-toolbar', { className, sClass, styleAttr, sStyle, color }, rest)
28
26
  );
29
-
30
27
  let elevationState = $derived(useElevation(elevation));
31
-
32
- let componentClass = $derived(
33
- useClassName({
34
- baseClass: 'kit-toolbar',
35
- className: `${className ?? ''}`.trim(),
36
- sClass,
37
- classProps
38
- })
39
- );
40
-
41
- let normalizedClassContent = $derived(
42
- Array.isArray(classContent) ? classContent.filter(Boolean).join(' ') : classContent
43
- );
44
-
45
- let wrapperClass = $derived(
46
- useClassName({
47
- baseClass: 'kit-toolbar__wrapper',
48
- className: normalizedClassContent
49
- })
50
- );
51
-
52
- let componentStyle = $derived(
53
- useStyles({
54
- styleAttr,
55
- sStyle,
56
- styleProps
57
- })
58
- );
59
-
60
- let resolvedStyle = $derived(
61
- [
62
- componentStyle,
63
- color ? `--kit-toolbar-fg:${color && `var(--kit-color-${color})`}` : '',
64
- background ? `--kit-toolbar-bg:${background && `var(--kit-color-${background})`}` : ''
65
- ]
66
- .filter(Boolean)
67
- .join('; ')
68
- );
28
+ let hasOutline = $derived(variant === 'outline' || variant === 'surface');
69
29
  </script>
70
30
 
71
31
  <svelte:element
72
32
  this={is}
73
33
  bind:this={ref}
74
- class={componentClass}
75
- style={resolvedStyle}
76
- {...restProps}
34
+ class={attrs.class}
35
+ style={attrs.style}
77
36
  role="toolbar"
37
+ aria-orientation={orientation}
78
38
  data-variant={variant}
79
39
  data-density={density}
80
40
  data-orientation={orientation}
@@ -83,173 +43,218 @@
83
43
  data-elevation={elevationState.base}
84
44
  data-elevation-hover={elevationState.hover}
85
45
  data-elevation-active={elevationState.active}
46
+ {...attrs.rest}
86
47
  >
87
- {#if variant === 'outline'}
48
+ {#if hasOutline}
88
49
  <span class="outline"></span>
89
50
  {/if}
90
51
 
91
- <div class={wrapperClass}>
52
+ <div class={['kit-toolbar__wrapper', classContent]}>
92
53
  {@render children?.()}
93
54
  </div>
94
55
  </svelte:element>
95
56
 
96
- <style>
97
- .kit-toolbar {
98
- position: relative;
99
- display: inline-flex;
100
- max-width: 100%;
101
- box-sizing: border-box;
102
- border-radius: var(--kit-toolbar-radius);
103
- background: var(--kit-toolbar-bg);
104
- color: var(--kit-toolbar-fg);
105
- border: 0;
106
- font-size: var(--kit-toolbar-font);
107
- transition:
108
- background 140ms ease,
109
- color 140ms ease,
110
- box-shadow 140ms ease,
111
- translate 140ms ease;
112
- }
113
-
114
- /**
115
- * rounded
116
- * @link ...
117
- */
118
- .kit-toolbar[data-rounded='0'] {
119
- --kit-toolbar-radius: var(--kit-shape-none);
120
- }
121
- .kit-toolbar[data-rounded='xs'] {
122
- --kit-toolbar-radius: var(--kit-shape-xs);
123
- }
124
- .kit-toolbar[data-rounded='sm'] {
125
- --kit-toolbar-radius: var(--kit-shape-sm);
126
- }
127
- .kit-toolbar[data-rounded='md'] {
128
- --kit-toolbar-radius: var(--kit-shape-md);
129
- }
130
- .kit-toolbar[data-rounded='lg'] {
131
- --kit-toolbar-radius: var(--kit-shape-lg);
132
- }
133
- .kit-toolbar[data-rounded='xl'] {
134
- --kit-toolbar-radius: var(--kit-shape-xl);
135
- }
136
- .kit-toolbar[data-rounded='full'] {
137
- --kit-toolbar-radius: var(--kit-shape-full);
138
- }
139
-
140
- /**
141
- * density
142
- * @link no links
143
- */
144
- .kit-toolbar[data-density='compact'] {
145
- --kit-toolbar-density-offset: var(--kit-density-compact);
146
- }
147
- .kit-toolbar[data-density='default'] {
148
- --kit-toolbar-density-offset: var(--kit-density-default);
149
- }
150
- .kit-toolbar[data-density='comfortable'] {
151
- --kit-toolbar-density-offset: var(--kit-density-comfortable);
152
- }
153
-
154
- /**
155
- * variant
156
- * @link no links...
157
- */
158
- .kit-toolbar[data-variant='filled'] {
159
- --kit-toolbar-bg: var(--kit-color-surface-1);
160
- --kit-toolbar-fg: var(--kit-color-text);
161
-
162
- --kit-toolbar-hover-bg: color-mix(in oklab, var(--kit-toolbar-bg), black 10%);
163
- --kit-toolbar-active-bg: color-mix(in oklab, var(--kit-toolbar-bg), black 16%);
164
- }
165
- .kit-toolbar[data-variant='outline'] {
166
- --kit-toolbar-bg: transparent;
167
- --kit-toolbar-fg: var(--kit-color-text);
168
- --kit-toolbar-bd: var(--kit-toolbar-fg);
169
-
170
- --kit-toolbar-hover-bg: color-mix(in oklab, var(--kit-toolbar-fg), transparent 80%);
171
- --kit-toolbar-active-bg: color-mix(in oklab, var(--kit-toolbar-fg), transparent 92%);
172
- }
173
- .kit-toolbar[data-variant='text'] {
174
- --kit-toolbar-bg: transparent;
175
- --kit-toolbar-fg: var(--kit-color-text);
176
-
177
- --kit-toolbar-hover-bg: color-mix(in oklab, var(--kit-toolbar-fg), transparent 80%);
178
- --kit-toolbar-active-bg: color-mix(in oklab, var(--kit-toolbar-fg), transparent 92%);
179
- }
180
-
181
- /**
182
- * size
183
- * @link nothing...
184
- */
185
- .kit-toolbar[data-size='xs'] {
186
- --kit-toolbar-h: 32px;
187
- --kit-toolbar-p: 8px;
188
- --kit-toolbar-gap: var(--kit-space-compact);
189
- --kit-toolbar-font: var(--kit-font-xs);
190
- }
191
- .kit-toolbar[data-size='sm'] {
192
- --kit-toolbar-h: 40px;
193
- --kit-toolbar-p: 10px;
194
- --kit-toolbar-gap: var(--kit-space-default);
195
- --kit-toolbar-font: var(--kit-font-sm);
196
- }
197
- .kit-toolbar[data-size='md'] {
198
- --kit-toolbar-h: 48px;
199
- --kit-toolbar-p: 12px;
200
- --kit-toolbar-gap: var(--kit-space-default);
201
- --kit-toolbar-font: var(--kit-font-md);
202
- }
203
- .kit-toolbar[data-size='lg'] {
204
- --kit-toolbar-h: 56px;
205
- --kit-toolbar-p: 16px;
206
- --kit-toolbar-gap: var(--kit-space-default);
207
- --kit-toolbar-font: var(--kit-font-lg);
208
- }
209
- .kit-toolbar[data-size='xl'] {
210
- --kit-toolbar-h: 64px;
211
- --kit-toolbar-p: 20px;
212
- --kit-toolbar-gap: var(--kit-space-comfortable);
213
- --kit-toolbar-font: var(--kit-font-xl);
214
- }
215
-
216
- .kit-toolbar .outline {
217
- position: absolute;
218
- inset: 0;
219
- border: 1px solid var(--kit-toolbar-bd);
220
- border-radius: inherit;
221
- pointer-events: none;
222
- }
223
-
224
- .kit-toolbar__wrapper {
225
- position: relative;
226
- z-index: 1;
227
- display: inline-flex;
228
- align-items: center;
229
- justify-content: flex-start;
230
- min-height: calc(var(--kit-toolbar-h) + var(--kit-toolbar-density-offset) / 2);
231
- padding: calc(var(--kit-toolbar-p) + var(--kit-toolbar-density-offset) / 2);
232
- gap: var(--kit-toolbar-gap);
233
- width: 100%;
234
- border-radius: inherit;
235
- }
236
-
237
- .kit-toolbar[data-orientation='horizontal'] {
238
- width: 100%;
239
- min-height: auto;
240
- }
241
-
242
- .kit-toolbar[data-orientation='vertical'] .kit-toolbar__wrapper {
243
- flex-direction: column;
244
- align-items: stretch;
245
- }
246
-
247
- .kit-toolbar[data-orientation='vertical'] {
248
- width: fit-content;
249
- min-height: fit-content;
250
- }
251
-
252
- .kit-toolbar[data-orientation='horizontal'] .kit-toolbar__wrapper {
253
- flex-direction: row;
254
- }
255
- </style>
57
+ <style>:where(.kit-toolbar) {
58
+ --kit-toolbar-color: initial;
59
+ --kit-toolbar-on-color: initial;
60
+ --kit-toolbar-active-fg: initial;
61
+ --kit-toolbar-active-shade: initial;
62
+ --kit-toolbar-hover-fg: initial;
63
+ --kit-toolbar-pressed-fg: initial;
64
+ --kit-toolbar-bg: var(--kit-toolbar-color, var(--kit-color-surface-1));
65
+ --kit-toolbar-fg: var(--kit-toolbar-on-color, var(--kit-toolbar-contrast, var(--kit-color-text)));
66
+ --kit-toolbar-ink: var(--kit-toolbar-color, var(--kit-color-text));
67
+ --kit-toolbar-hover: color-mix(in oklab, var(--kit-toolbar-bg), var(--kit-toolbar-fg) 8%);
68
+ --kit-toolbar-pressed: color-mix(in oklab, var(--kit-toolbar-bg), var(--kit-toolbar-fg) 14%);
69
+ --kit-toolbar-soft: color-mix(in oklab, var(--kit-toolbar-bg) 16%, transparent);
70
+ --kit-toolbar-border: color-mix(in oklab, var(--kit-toolbar-bg), var(--kit-toolbar-fg) 20%);
71
+ --kit-toolbar-active: color-mix(
72
+ in oklab,
73
+ var(--kit-toolbar-color),
74
+ var(--kit-toolbar-fg) var(--kit-toolbar-active-shade, 14%)
75
+ );
76
+ }
77
+ @supports (color: color(from red srgb-linear r g b)) {
78
+ :where(.kit-toolbar) {
79
+ --kit-toolbar-contrast: color(from var(--kit-toolbar-color) srgb-linear clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1) clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1) clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1)/1);
80
+ }
81
+ }
82
+
83
+ .kit-toolbar {
84
+ position: relative;
85
+ display: inline-flex;
86
+ box-sizing: border-box;
87
+ max-width: 100%;
88
+ border: 0;
89
+ border-radius: var(--kit-toolbar-radius);
90
+ background-color: var(--kit-toolbar-bg);
91
+ color: var(--kit-toolbar-fg);
92
+ font-size: var(--kit-toolbar-font);
93
+ transition-property: background-color, color, border-color, box-shadow;
94
+ transition-duration: var(--kit-animation-component);
95
+ transition-timing-function: ease;
96
+ }
97
+ @media (prefers-reduced-motion: reduce) {
98
+ .kit-toolbar {
99
+ transition: none;
100
+ }
101
+ }
102
+ .kit-toolbar__wrapper {
103
+ position: relative;
104
+ z-index: 1;
105
+ display: inline-flex;
106
+ align-items: center;
107
+ justify-content: flex-start;
108
+ gap: var(--kit-toolbar-gap);
109
+ box-sizing: border-box;
110
+ width: 100%;
111
+ min-height: calc(var(--kit-toolbar-h) + var(--kit-toolbar-density-offset) / 2);
112
+ padding: calc(var(--kit-toolbar-p) + var(--kit-toolbar-density-offset) / 2);
113
+ border-radius: inherit;
114
+ }
115
+ .kit-toolbar[data-orientation=horizontal] {
116
+ width: 100%;
117
+ }
118
+ .kit-toolbar[data-orientation=vertical] {
119
+ width: fit-content;
120
+ min-height: fit-content;
121
+ }
122
+ .kit-toolbar[data-orientation=vertical] .kit-toolbar__wrapper {
123
+ flex-direction: column;
124
+ align-items: stretch;
125
+ }
126
+
127
+ /**
128
+ * size
129
+ * @link https://lapikit.dev/docs/components/toolbar#size
130
+ */
131
+ :where(.kit-toolbar[data-size=xs]) {
132
+ --kit-toolbar-h: 2rem;
133
+ --kit-toolbar-p: 0.5rem;
134
+ --kit-toolbar-gap: 0.125rem;
135
+ --kit-toolbar-font: var(--kit-font-xs);
136
+ }
137
+
138
+ :where(.kit-toolbar[data-size=sm]) {
139
+ --kit-toolbar-h: 2.5rem;
140
+ --kit-toolbar-p: 0.625rem;
141
+ --kit-toolbar-gap: 0.25rem;
142
+ --kit-toolbar-font: var(--kit-font-sm);
143
+ }
144
+
145
+ :where(.kit-toolbar[data-size=md]) {
146
+ --kit-toolbar-h: 3rem;
147
+ --kit-toolbar-p: 0.75rem;
148
+ --kit-toolbar-gap: 0.25rem;
149
+ --kit-toolbar-font: var(--kit-font-md);
150
+ }
151
+
152
+ :where(.kit-toolbar[data-size=lg]) {
153
+ --kit-toolbar-h: 3.5rem;
154
+ --kit-toolbar-p: 1rem;
155
+ --kit-toolbar-gap: 0.25rem;
156
+ --kit-toolbar-font: var(--kit-font-lg);
157
+ }
158
+
159
+ :where(.kit-toolbar[data-size=xl]) {
160
+ --kit-toolbar-h: 4rem;
161
+ --kit-toolbar-p: 1.25rem;
162
+ --kit-toolbar-gap: 0.375rem;
163
+ --kit-toolbar-font: var(--kit-font-xl);
164
+ }
165
+
166
+ /**
167
+ * variant
168
+ * @link https://lapikit.dev/docs/components/toolbar#variants
169
+ */
170
+ :where(.kit-toolbar[data-variant=tonal]) {
171
+ --kit-toolbar-bg: color-mix(in oklab, var(--kit-toolbar-ink) 16%, transparent);
172
+ --kit-toolbar-fg: var(--kit-toolbar-ink);
173
+ --kit-toolbar-border: transparent;
174
+ --kit-toolbar-active: color-mix(in oklab, var(--kit-toolbar-ink) 28%, transparent);
175
+ --kit-toolbar-active-fg: var(--kit-toolbar-ink);
176
+ }
177
+
178
+ :where(.kit-toolbar[data-variant=outline]) {
179
+ --kit-toolbar-bg: transparent;
180
+ --kit-toolbar-fg: var(--kit-toolbar-ink);
181
+ --kit-toolbar-border: var(--kit-toolbar-color, var(--kit-color-border));
182
+ --kit-toolbar-active: color-mix(in oklab, var(--kit-toolbar-ink) 14%, transparent);
183
+ --kit-toolbar-active-fg: var(--kit-toolbar-ink);
184
+ }
185
+
186
+ :where(.kit-toolbar[data-variant=surface]) {
187
+ --kit-toolbar-bg: color-mix(in oklab, var(--kit-toolbar-ink) 8%, transparent);
188
+ --kit-toolbar-fg: var(--kit-toolbar-ink);
189
+ --kit-toolbar-border: color-mix(in oklab, var(--kit-toolbar-ink) 35%, transparent);
190
+ --kit-toolbar-active: color-mix(in oklab, var(--kit-toolbar-ink) 18%, transparent);
191
+ --kit-toolbar-active-fg: var(--kit-toolbar-ink);
192
+ }
193
+
194
+ :where(.kit-toolbar[data-variant=text]) {
195
+ --kit-toolbar-bg: transparent;
196
+ --kit-toolbar-fg: var(--kit-toolbar-ink);
197
+ --kit-toolbar-border: transparent;
198
+ --kit-toolbar-active: color-mix(in oklab, var(--kit-toolbar-ink) 14%, transparent);
199
+ --kit-toolbar-active-fg: var(--kit-toolbar-ink);
200
+ }
201
+
202
+ :where(.kit-toolbar .outline) {
203
+ --outline-color: var(--kit-toolbar-border);
204
+ }
205
+
206
+ /**
207
+ * rounded
208
+ * @link https://lapikit.dev/docs/customize
209
+ */
210
+ :where(.kit-toolbar[data-rounded="0"]) {
211
+ --kit-toolbar-radius: var(--kit-shape-none);
212
+ }
213
+
214
+ :where(.kit-toolbar[data-rounded=xs]) {
215
+ --kit-toolbar-radius: var(--kit-shape-xs);
216
+ }
217
+
218
+ :where(.kit-toolbar[data-rounded=sm]) {
219
+ --kit-toolbar-radius: var(--kit-shape-sm);
220
+ }
221
+
222
+ :where(.kit-toolbar[data-rounded=md]) {
223
+ --kit-toolbar-radius: var(--kit-shape-md);
224
+ }
225
+
226
+ :where(.kit-toolbar[data-rounded=lg]) {
227
+ --kit-toolbar-radius: var(--kit-shape-lg);
228
+ }
229
+
230
+ :where(.kit-toolbar[data-rounded=xl]) {
231
+ --kit-toolbar-radius: var(--kit-shape-xl);
232
+ }
233
+
234
+ :where(.kit-toolbar[data-rounded=full]) {
235
+ --kit-toolbar-radius: var(--kit-shape-full);
236
+ }
237
+
238
+ /**
239
+ * density
240
+ * @link https://lapikit.dev/docs/components/toolbar#density
241
+ */
242
+ :where(.kit-toolbar[data-density=dense]) {
243
+ --kit-toolbar-density-offset: var(--kit-density-dense);
244
+ }
245
+
246
+ :where(.kit-toolbar[data-density=compact]) {
247
+ --kit-toolbar-density-offset: var(--kit-density-compact);
248
+ }
249
+
250
+ :where(.kit-toolbar[data-density=default]) {
251
+ --kit-toolbar-density-offset: var(--kit-density-default);
252
+ }
253
+
254
+ :where(.kit-toolbar[data-density=comfortable]) {
255
+ --kit-toolbar-density-offset: var(--kit-density-comfortable);
256
+ }
257
+
258
+ :where(.kit-toolbar[data-density=spacious]) {
259
+ --kit-toolbar-density-offset: var(--kit-density-spacious);
260
+ }</style>
@@ -1,18 +1,17 @@
1
- import type { Component, DensityType, ElevationProps, PropValue, RoundedType, SizeType } from '../../@types';
2
- type Variant = 'filled' | 'outline' | 'text';
1
+ import type { ClassValue } from 'svelte/elements';
2
+ import type { ColorProps, Component, ElevationProps, RoundedType, SizeType } from '../../@types';
3
+ type Variant = 'filled' | 'tonal' | 'outline' | 'surface' | 'text';
3
4
  type Orientation = 'horizontal' | 'vertical';
4
5
  export interface ToolbarProps extends Component {
5
6
  ref?: HTMLElement | null;
6
7
  is?: 'div' | 'header' | 'nav';
7
- variant?: Variant | Record<string, Variant>;
8
+ variant?: Variant;
8
9
  rounded?: RoundedType | 'full';
9
- density?: DensityType;
10
- color?: string;
11
- orientation?: Orientation | Record<string, Orientation>;
12
- background?: string;
13
- classContent?: string | string[] | undefined;
10
+ density?: 'dense' | 'compact' | 'default' | 'comfortable' | 'spacious';
11
+ color?: ColorProps;
12
+ orientation?: Orientation;
13
+ classContent?: ClassValue;
14
14
  elevation?: ElevationProps;
15
15
  size?: SizeType;
16
- [key: string]: PropValue | Record<string, PropValue> | unknown;
17
16
  }
18
17
  export {};