@aleph-alpha/ui-library 2.5.1 → 2.6.0
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/config.d.ts +33 -2
- package/config.js +99 -70
- package/dist/system/components/UiFileItem/index.d.ts +1 -1
- package/dist/system/components/UiFileType/UiFileType.vue.d.ts +1 -0
- package/dist/system/components/UiFileType/types.d.ts +5 -0
- package/dist/system/components/core/calendar/Calendar.vue.d.ts +247 -3
- package/dist/system/components/core/popover/PopoverContent.vue.d.ts +1 -1
- package/dist/system/components/core/range-calendar/RangeCalendar.vue.d.ts +139 -2
- package/dist/system/lib.js +3166 -3129
- package/package.json +3 -3
- package/src/components/UiCodeBlock/UiCodeBlock.vue +6 -1
- package/src/components/UiField/UiField.stories.ts +15 -9
- package/src/components/UiFileItem/UiFileItem.stories.ts +21 -14
- package/src/components/UiFileItem/UiFileItem.vue +1 -0
- package/src/components/UiFileItem/index.ts +5 -1
- package/src/components/UiFileType/UiFileType.stories.ts +59 -0
- package/src/components/UiFileType/UiFileType.vue +3 -8
- package/src/components/UiFileType/__tests__/UiFileType.test.ts +9 -0
- package/src/components/UiFileType/types.ts +5 -0
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +58 -56
- package/src/components/UiListbox/UiListbox.stories.ts +1 -1
- package/src/components/UiSelect/UiSelectTrigger.vue +8 -2
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +1 -0
- package/src/components/UiTable/UiTable.stories.ts +6 -2
- package/src/components/UiTabs/UiTabs.stories.ts +2 -2
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +12 -2
- package/src/components/core/calendar/Calendar.vue +17 -1
- package/src/components/core/checkbox/Checkbox.vue +1 -0
- package/src/components/core/listbox/ListboxContent.vue +1 -0
- package/src/components/core/native-select/NativeSelect.vue +6 -0
- package/src/components/core/range-calendar/RangeCalendar.vue +19 -0
- package/src/components/core/slider/Slider.vue +1 -0
- package/src/directives/vHover.stories.ts +16 -12
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +2 -2
- package/src/theme/Background.stories.ts +16 -0
- package/src/theme/Flex.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +3 -3
- package/tokens.json +4273 -1152
package/config.d.ts
CHANGED
|
@@ -63,6 +63,29 @@ export interface UiLibraryThemeConfig {
|
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
65
|
includeAllTokens?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Select which token theme set is used for resolving semantic token refs.
|
|
68
|
+
* - `default` reads `2-theme/AA Base`
|
|
69
|
+
* - `accessible` reads `2-theme/WCAG 2.2`
|
|
70
|
+
* @default 'default'
|
|
71
|
+
*/
|
|
72
|
+
themeMode?: 'default' | 'accessible';
|
|
73
|
+
/**
|
|
74
|
+
* Convenience alias for `themeMode: 'accessible'`.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
accessible?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Emit an additional accessible-theme CSS variable block that can be toggled
|
|
80
|
+
* at runtime by adding `accessibleSelector` to the root element.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
accessibleTheme?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Selector used for the runtime accessible-theme block.
|
|
86
|
+
* @default 'html.accessible-theme'
|
|
87
|
+
*/
|
|
88
|
+
accessibleSelector?: string;
|
|
66
89
|
}
|
|
67
90
|
|
|
68
91
|
/**
|
|
@@ -106,7 +129,11 @@ export declare const defineThemeConfig: <T extends UiLibraryThemeConfig>(
|
|
|
106
129
|
/**
|
|
107
130
|
* Returns the default theme derived from the library's `tokens.json`.
|
|
108
131
|
*/
|
|
109
|
-
export declare const getUiLibraryThemeFromTokens: (
|
|
132
|
+
export declare const getUiLibraryThemeFromTokens: (
|
|
133
|
+
options?: Pick<UiLibraryThemeConfig, 'themeMode' | 'accessible'> & {
|
|
134
|
+
referenceThemeSet?: string;
|
|
135
|
+
},
|
|
136
|
+
) => UiLibraryTheme;
|
|
110
137
|
|
|
111
138
|
/**
|
|
112
139
|
* Get all token-based CSS variables for light and dark modes.
|
|
@@ -114,7 +141,11 @@ export declare const getUiLibraryThemeFromTokens: () => UiLibraryTheme;
|
|
|
114
141
|
* - background.surface.secondary -> --background-surface-secondary
|
|
115
142
|
* - content.on-surface.primary -> --content-on-surface-primary
|
|
116
143
|
*/
|
|
117
|
-
export declare const getUiLibraryTokenVars: (
|
|
144
|
+
export declare const getUiLibraryTokenVars: (
|
|
145
|
+
options?: Pick<UiLibraryThemeConfig, 'themeMode' | 'accessible'> & {
|
|
146
|
+
referenceThemeSet?: string;
|
|
147
|
+
},
|
|
148
|
+
) => UiLibraryTheme;
|
|
118
149
|
|
|
119
150
|
/**
|
|
120
151
|
* Get UnoCSS theme colors config for all token-based colors.
|
package/config.js
CHANGED
|
@@ -179,20 +179,37 @@ const normalizeShadcnVarValue = (input) => {
|
|
|
179
179
|
return v;
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
// Token resolution —
|
|
183
|
-
//
|
|
184
|
-
// Heading scale utilities resolve `font.font-size.Heading …` via
|
|
185
|
-
|
|
182
|
+
// Token resolution — one selected `2-theme/*` set participates in `{...}` lookups;
|
|
183
|
+
// other theme sets are alternate brands/modes and must not override the selected
|
|
184
|
+
// library theme. Heading scale utilities resolve `font.font-size.Heading …` via
|
|
185
|
+
// these refs (see `getHeadingScaleTypographyShortcuts`).
|
|
186
|
+
const UI_LIBRARY_REFERENCE_THEME_SETS = Object.freeze({
|
|
187
|
+
default: '2-theme/AA Base',
|
|
188
|
+
accessible: '2-theme/WCAG 2.2',
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const getUiLibraryThemeMode = (options = {}) => {
|
|
192
|
+
if (options.referenceThemeSet) return options.referenceThemeSet;
|
|
193
|
+
if (options.accessible || options.themeMode === 'accessible') {
|
|
194
|
+
return UI_LIBRARY_REFERENCE_THEME_SETS.accessible;
|
|
195
|
+
}
|
|
196
|
+
return UI_LIBRARY_REFERENCE_THEME_SETS.default;
|
|
197
|
+
};
|
|
186
198
|
|
|
187
|
-
const getTokenSetSearchOrder = () => {
|
|
199
|
+
const getTokenSetSearchOrder = (options = {}) => {
|
|
188
200
|
const tokens = getTokens();
|
|
189
201
|
const order = tokens?.$metadata?.tokenSetOrder;
|
|
190
202
|
const raw = Array.isArray(order)
|
|
191
203
|
? order
|
|
192
204
|
: Object.keys(tokens || {}).filter((k) => !k.startsWith('$'));
|
|
205
|
+
const referenceThemeSet = getUiLibraryThemeMode(options);
|
|
206
|
+
const fallbackThemeSet = UI_LIBRARY_REFERENCE_THEME_SETS.default;
|
|
193
207
|
return raw.filter(
|
|
194
208
|
(name) =>
|
|
195
|
-
!name.startsWith('2-theme/') ||
|
|
209
|
+
!name.startsWith('2-theme/') ||
|
|
210
|
+
name === referenceThemeSet ||
|
|
211
|
+
(referenceThemeSet === UI_LIBRARY_REFERENCE_THEME_SETS.accessible &&
|
|
212
|
+
name === fallbackThemeSet),
|
|
196
213
|
);
|
|
197
214
|
};
|
|
198
215
|
|
|
@@ -209,7 +226,7 @@ const getTokenLeaf = (tokenSetName, dotPath) => {
|
|
|
209
226
|
return cur && typeof cur === 'object' && 'value' in cur ? cur : null;
|
|
210
227
|
};
|
|
211
228
|
|
|
212
|
-
const resolveReferences = (value, seen) => {
|
|
229
|
+
const resolveReferences = (value, seen, options = {}) => {
|
|
213
230
|
if (typeof value !== 'string') return value;
|
|
214
231
|
|
|
215
232
|
const refMatch = value.match(/^\{(.+)\}$/);
|
|
@@ -227,7 +244,7 @@ const resolveReferences = (value, seen) => {
|
|
|
227
244
|
seen.add(marker);
|
|
228
245
|
|
|
229
246
|
const parts = refPath.split('.');
|
|
230
|
-
const sets = getTokenSetSearchOrder().slice().reverse();
|
|
247
|
+
const sets = getTokenSetSearchOrder(options).slice().reverse();
|
|
231
248
|
|
|
232
249
|
for (const setName of sets) {
|
|
233
250
|
const set = tokens?.[setName];
|
|
@@ -243,24 +260,29 @@ const resolveReferences = (value, seen) => {
|
|
|
243
260
|
}
|
|
244
261
|
|
|
245
262
|
if (cur && typeof cur === 'object' && 'value' in cur) {
|
|
246
|
-
return resolveReferences(cur.value, seen);
|
|
263
|
+
return resolveReferences(cur.value, seen, options);
|
|
247
264
|
}
|
|
248
265
|
}
|
|
249
266
|
return value;
|
|
250
267
|
};
|
|
251
268
|
|
|
252
|
-
const resolveTokenValue = (tokenSetName, path) => {
|
|
269
|
+
const resolveTokenValue = (tokenSetName, path, options = {}) => {
|
|
253
270
|
const leaf = getTokenLeaf(tokenSetName, path);
|
|
254
271
|
if (!leaf) return null;
|
|
255
272
|
const resolved = resolveReferences(
|
|
256
273
|
leaf.value,
|
|
257
274
|
new Set([`${tokenSetName}:${path}`]),
|
|
275
|
+
options,
|
|
258
276
|
);
|
|
259
277
|
return typeof resolved === 'string' ? resolved : null;
|
|
260
278
|
};
|
|
261
279
|
|
|
262
|
-
const resolveAnyTokenValue = (path) => {
|
|
263
|
-
const resolved = resolveReferences(
|
|
280
|
+
const resolveAnyTokenValue = (path, options = {}) => {
|
|
281
|
+
const resolved = resolveReferences(
|
|
282
|
+
`{${path}}`,
|
|
283
|
+
new Set([`any:${path}`]),
|
|
284
|
+
options,
|
|
285
|
+
);
|
|
264
286
|
return typeof resolved === 'string' ? resolved : null;
|
|
265
287
|
};
|
|
266
288
|
|
|
@@ -284,7 +306,7 @@ const collectColorTokenPaths = (obj, prefix = '') => {
|
|
|
284
306
|
};
|
|
285
307
|
|
|
286
308
|
// Build all token-based CSS variables (e.g., --background-surface-secondary)
|
|
287
|
-
const buildAllTokenVarsFromModeSet = (modeSetName) => {
|
|
309
|
+
const buildAllTokenVarsFromModeSet = (modeSetName, options = {}) => {
|
|
288
310
|
const tokens = getTokens();
|
|
289
311
|
const modeSet = tokens?.[modeSetName];
|
|
290
312
|
if (!modeSet) return {};
|
|
@@ -293,7 +315,7 @@ const buildAllTokenVarsFromModeSet = (modeSetName) => {
|
|
|
293
315
|
const vars = {};
|
|
294
316
|
|
|
295
317
|
for (const path of paths) {
|
|
296
|
-
const value = resolveTokenValue(modeSetName, path);
|
|
318
|
+
const value = resolveTokenValue(modeSetName, path, options);
|
|
297
319
|
if (value) {
|
|
298
320
|
// Convert dot path to kebab-case CSS variable name
|
|
299
321
|
// e.g., "background.surface.secondary" -> "background-surface-secondary"
|
|
@@ -306,8 +328,8 @@ const buildAllTokenVarsFromModeSet = (modeSetName) => {
|
|
|
306
328
|
};
|
|
307
329
|
|
|
308
330
|
// shadcn CSS variable builders
|
|
309
|
-
const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
310
|
-
const resolve = (path) => resolveTokenValue(modeSetName, path);
|
|
331
|
+
const buildShadcnVarsFromModeSet = (modeSetName, options = {}) => {
|
|
332
|
+
const resolve = (path) => resolveTokenValue(modeSetName, path, options);
|
|
311
333
|
|
|
312
334
|
// Background/Surface tokens
|
|
313
335
|
const background = resolve('background.surface.primary');
|
|
@@ -362,7 +384,7 @@ const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
|
362
384
|
const modal = resolve('background.surface.modal') ?? background;
|
|
363
385
|
const floating =
|
|
364
386
|
resolve('background.surface.floating') ??
|
|
365
|
-
resolveAnyTokenValue('aa.colors.sand.0') ??
|
|
387
|
+
resolveAnyTokenValue('aa.colors.sand.0', options) ??
|
|
366
388
|
resolve('background.surface.secondary') ??
|
|
367
389
|
background;
|
|
368
390
|
|
|
@@ -459,34 +481,23 @@ const mergeThemes = (base, extend) => {
|
|
|
459
481
|
};
|
|
460
482
|
};
|
|
461
483
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
// classes (e.g. `bg-background-accent-pink`) resolvable so components don't
|
|
465
|
-
// need to fall back to arbitrary `bg-[var(--…,#hex)]` values. Remove an
|
|
466
|
-
// entry from this map once the matching token lands upstream.
|
|
467
|
-
//
|
|
468
|
-
// TODO Drop these entries once `background.accent.{pink,yellow}` are
|
|
469
|
-
// available in `tokens.json` so they're picked up by
|
|
470
|
-
// `buildAllTokenVarsFromModeSet`.
|
|
471
|
-
const getStaticTokenVars = () => {
|
|
472
|
-
const toOklch = (hex) => {
|
|
473
|
-
const rgba = parseHexColorToRgba(hex);
|
|
474
|
-
if (!rgba) return null;
|
|
475
|
-
return rgbToOklchComponents(rgba.r, rgba.g, rgba.b, rgba.a);
|
|
476
|
-
};
|
|
484
|
+
const isAccessibleThemeMode = (options = {}) =>
|
|
485
|
+
getUiLibraryThemeMode(options) === UI_LIBRARY_REFERENCE_THEME_SETS.accessible;
|
|
477
486
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
const yellow = toOklch('#ffe1a6');
|
|
487
|
+
const getAccessibleTokenVarOverrides = (options = {}) => {
|
|
488
|
+
if (!isAccessibleThemeMode(options)) {
|
|
489
|
+
return { light: {}, dark: {} };
|
|
490
|
+
}
|
|
483
491
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
492
|
+
return {
|
|
493
|
+
light: {
|
|
494
|
+
'background-status-warning':
|
|
495
|
+
resolveAnyTokenValue('aa.colors.amber.800', options) ?? '#974e00',
|
|
496
|
+
'content-on-surface-tertiary':
|
|
497
|
+
resolveAnyTokenValue('aa.colors.orange.700', options) ?? '#b83e16',
|
|
498
|
+
},
|
|
499
|
+
dark: {},
|
|
487
500
|
};
|
|
488
|
-
|
|
489
|
-
return { light: shared, dark: shared };
|
|
490
501
|
};
|
|
491
502
|
|
|
492
503
|
// Exported functions
|
|
@@ -503,9 +514,9 @@ export const getUiLibraryContentConfig = () => ({
|
|
|
503
514
|
},
|
|
504
515
|
});
|
|
505
516
|
|
|
506
|
-
export const getUiLibraryThemeFromTokens = () => ({
|
|
507
|
-
light: buildShadcnVarsFromModeSet('3-mode/Light'),
|
|
508
|
-
dark: buildShadcnVarsFromModeSet('3-mode/Dark'),
|
|
517
|
+
export const getUiLibraryThemeFromTokens = (options = {}) => ({
|
|
518
|
+
light: buildShadcnVarsFromModeSet('3-mode/Light', options),
|
|
519
|
+
dark: buildShadcnVarsFromModeSet('3-mode/Dark', options),
|
|
509
520
|
});
|
|
510
521
|
|
|
511
522
|
/**
|
|
@@ -514,16 +525,16 @@ export const getUiLibraryThemeFromTokens = () => ({
|
|
|
514
525
|
* - background.surface.secondary -> --background-surface-secondary
|
|
515
526
|
* - content.on-surface.primary -> --content-on-surface-primary
|
|
516
527
|
*/
|
|
517
|
-
export const getUiLibraryTokenVars = () => {
|
|
518
|
-
const
|
|
528
|
+
export const getUiLibraryTokenVars = (options = {}) => {
|
|
529
|
+
const accessibleVars = getAccessibleTokenVarOverrides(options);
|
|
519
530
|
return {
|
|
520
531
|
light: {
|
|
521
|
-
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
522
|
-
...
|
|
532
|
+
...buildAllTokenVarsFromModeSet('3-mode/Light', options),
|
|
533
|
+
...accessibleVars.light,
|
|
523
534
|
},
|
|
524
535
|
dark: {
|
|
525
|
-
...buildAllTokenVarsFromModeSet('3-mode/Dark'),
|
|
526
|
-
...
|
|
536
|
+
...buildAllTokenVarsFromModeSet('3-mode/Dark', options),
|
|
537
|
+
...accessibleVars.dark,
|
|
527
538
|
},
|
|
528
539
|
};
|
|
529
540
|
};
|
|
@@ -547,10 +558,7 @@ export const getUiLibraryTokenVars = () => {
|
|
|
547
558
|
* ```
|
|
548
559
|
*/
|
|
549
560
|
export const getUiLibraryTokenColors = () => {
|
|
550
|
-
const lightVars =
|
|
551
|
-
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
552
|
-
...getStaticTokenVars().light,
|
|
553
|
-
};
|
|
561
|
+
const lightVars = buildAllTokenVarsFromModeSet('3-mode/Light');
|
|
554
562
|
const colors = {};
|
|
555
563
|
|
|
556
564
|
for (const varName of Object.keys(lightVars)) {
|
|
@@ -667,37 +675,57 @@ export const presetUiLibraryTheme = (theme, options = {}) => {
|
|
|
667
675
|
};
|
|
668
676
|
|
|
669
677
|
export const presetUiLibraryThemeFromTokens = (options = {}) => {
|
|
670
|
-
const {
|
|
678
|
+
const {
|
|
679
|
+
theme,
|
|
680
|
+
extend,
|
|
681
|
+
includeAllTokens = true,
|
|
682
|
+
themeMode = 'default',
|
|
683
|
+
accessible = false,
|
|
684
|
+
accessibleTheme = false,
|
|
685
|
+
accessibleSelector = 'html.accessible-theme',
|
|
686
|
+
...presetOptions
|
|
687
|
+
} = options;
|
|
671
688
|
|
|
672
689
|
// If full theme override provided, use basic preset (no batteries)
|
|
673
690
|
if (theme) {
|
|
674
691
|
return presetUiLibraryTheme(theme, presetOptions);
|
|
675
692
|
}
|
|
676
693
|
|
|
677
|
-
// Get base shadcn theme from tokens
|
|
678
|
-
const baseTheme = getUiLibraryThemeFromTokens();
|
|
679
694
|
const tokenBorderRadiusVars = getUiLibraryTokenBorderRadiusVars();
|
|
695
|
+
const buildTheme = (modeOptions = {}) => {
|
|
696
|
+
const baseTheme = getUiLibraryThemeFromTokens(modeOptions);
|
|
697
|
+
let resolvedTheme = {
|
|
698
|
+
light: { ...baseTheme.light, ...tokenBorderRadiusVars },
|
|
699
|
+
dark: { ...baseTheme.dark, ...tokenBorderRadiusVars },
|
|
700
|
+
};
|
|
680
701
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
702
|
+
if (includeAllTokens) {
|
|
703
|
+
const tokenVars = getUiLibraryTokenVars(modeOptions);
|
|
704
|
+
resolvedTheme = {
|
|
705
|
+
light: { ...tokenVars.light, ...resolvedTheme.light },
|
|
706
|
+
dark: { ...tokenVars.dark, ...resolvedTheme.dark },
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return resolvedTheme;
|
|
685
711
|
};
|
|
686
712
|
|
|
687
|
-
//
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
finalTheme = {
|
|
691
|
-
light: { ...tokenVars.light, ...finalTheme.light },
|
|
692
|
-
dark: { ...tokenVars.dark, ...finalTheme.dark },
|
|
693
|
-
};
|
|
694
|
-
}
|
|
713
|
+
// Radius utilities in Wind v4 resolve through --radius-* variables.
|
|
714
|
+
const modeOptions = { themeMode, accessible };
|
|
715
|
+
let finalTheme = buildTheme(modeOptions);
|
|
695
716
|
|
|
696
717
|
// Merge with extend overrides
|
|
697
718
|
finalTheme = mergeThemes(finalTheme, extend);
|
|
698
719
|
|
|
699
720
|
// Get base preset with preflights (CSS variables)
|
|
700
721
|
const basePreset = presetUiLibraryTheme(finalTheme, presetOptions);
|
|
722
|
+
const accessiblePreset = accessibleTheme
|
|
723
|
+
? presetUiLibraryTheme(buildTheme({ themeMode: 'accessible' }), {
|
|
724
|
+
...presetOptions,
|
|
725
|
+
rootSelector: accessibleSelector,
|
|
726
|
+
darkSelector: `${accessibleSelector}.dark`,
|
|
727
|
+
})
|
|
728
|
+
: null;
|
|
701
729
|
|
|
702
730
|
// Token colors for utility classes (bg-background-surface-secondary, etc.)
|
|
703
731
|
const tokenColors = getUiLibraryTokenColors();
|
|
@@ -738,6 +766,7 @@ export const presetUiLibraryThemeFromTokens = (options = {}) => {
|
|
|
738
766
|
...basePreset,
|
|
739
767
|
preflights: [
|
|
740
768
|
...(basePreset.preflights || []),
|
|
769
|
+
...(accessiblePreset?.preflights || []),
|
|
741
770
|
{ getCSS: () => getSaansFontFaceCss() },
|
|
742
771
|
{ getCSS: () => fontVariablesCss },
|
|
743
772
|
],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as UiFileItem } from './UiFileItem.vue';
|
|
2
|
-
export type { UiFileItemProps } from './types';
|
|
2
|
+
export type { UiFileItemMediaTone, UiFileItemProps, UiFileItemSize, } from './types';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UiFileTypeProps, UiFileTypeTone } from './types';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<UiFileTypeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiFileTypeProps> & Readonly<{}>, {
|
|
3
3
|
icon: string;
|
|
4
|
+
loading: boolean;
|
|
4
5
|
error: boolean;
|
|
5
6
|
filename: string;
|
|
6
7
|
tone: UiFileTypeTone;
|
|
@@ -30,4 +30,9 @@ export interface UiFileTypeProps {
|
|
|
30
30
|
* other prop. Use to indicate an upload/validation failure.
|
|
31
31
|
*/
|
|
32
32
|
error?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Use during upload/processing — the colored tone signals "success",
|
|
35
|
+
* so it shouldn't appear until the file is fully accepted.
|
|
36
|
+
*/
|
|
37
|
+
loading?: boolean;
|
|
33
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CalendarRootProps, DateValue } from 'reka-ui';
|
|
2
|
-
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { HTMLAttributes, nextTick } from 'vue';
|
|
3
3
|
import { LayoutTypes } from '.';
|
|
4
4
|
type __VLS_Props = CalendarRootProps & {
|
|
5
5
|
class?: HTMLAttributes['class'];
|
|
@@ -21,7 +21,129 @@ declare function __VLS_template(): {
|
|
|
21
21
|
}, Record<"default", undefined>>;
|
|
22
22
|
}): any;
|
|
23
23
|
};
|
|
24
|
-
refs: {
|
|
24
|
+
refs: {
|
|
25
|
+
calendarRootRef: ({
|
|
26
|
+
$: import('vue').ComponentInternalInstance;
|
|
27
|
+
$data: {};
|
|
28
|
+
$props: {
|
|
29
|
+
readonly defaultValue?: DateValue | undefined;
|
|
30
|
+
readonly defaultPlaceholder?: DateValue | undefined;
|
|
31
|
+
readonly placeholder?: DateValue | undefined;
|
|
32
|
+
readonly pagedNavigation?: boolean | undefined;
|
|
33
|
+
readonly preventDeselect?: boolean | undefined;
|
|
34
|
+
readonly weekStartsOn?: import('reka-ui/date').WeekStartsOn | undefined;
|
|
35
|
+
readonly weekdayFormat?: import('reka-ui/date').WeekDayFormat | undefined;
|
|
36
|
+
readonly calendarLabel?: string | undefined;
|
|
37
|
+
readonly fixedWeeks?: boolean | undefined;
|
|
38
|
+
readonly maxValue?: DateValue | undefined;
|
|
39
|
+
readonly minValue?: DateValue | undefined;
|
|
40
|
+
readonly locale?: string | undefined;
|
|
41
|
+
readonly numberOfMonths?: number | undefined;
|
|
42
|
+
readonly disabled?: boolean | undefined;
|
|
43
|
+
readonly readonly?: boolean | undefined;
|
|
44
|
+
readonly initialFocus?: boolean | undefined;
|
|
45
|
+
readonly isDateDisabled?: import('reka-ui/date').Matcher | undefined;
|
|
46
|
+
readonly isDateUnavailable?: import('reka-ui/date').Matcher | undefined;
|
|
47
|
+
readonly dir?: ("ltr" | "rtl") | undefined;
|
|
48
|
+
readonly nextPage?: ((placeholder: DateValue) => DateValue) | undefined;
|
|
49
|
+
readonly prevPage?: ((placeholder: DateValue) => DateValue) | undefined;
|
|
50
|
+
readonly modelValue?: DateValue | DateValue[] | undefined;
|
|
51
|
+
readonly multiple?: boolean | undefined;
|
|
52
|
+
readonly disableDaysOutsideCurrentView?: boolean | undefined;
|
|
53
|
+
readonly asChild?: boolean | undefined;
|
|
54
|
+
readonly as?: (import('reka-ui').AsTag | import('vue').Component) | undefined;
|
|
55
|
+
readonly "onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined | undefined;
|
|
56
|
+
readonly "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined | undefined;
|
|
57
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
58
|
+
$attrs: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
$refs: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
$slots: Readonly<{
|
|
65
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
68
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
69
|
+
$host: Element | null;
|
|
70
|
+
$emit: ((event: "update:modelValue", date: DateValue | undefined) => void) & ((event: "update:placeholder", date: DateValue) => void);
|
|
71
|
+
$el: any;
|
|
72
|
+
$options: import('vue').ComponentOptionsBase<Readonly<CalendarRootProps> & Readonly<{
|
|
73
|
+
"onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
74
|
+
"onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
|
|
75
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
76
|
+
"update:modelValue": (date: DateValue | undefined) => any;
|
|
77
|
+
"update:placeholder": (date: DateValue) => any;
|
|
78
|
+
}, string, {
|
|
79
|
+
as: import('reka-ui').AsTag | import('vue').Component;
|
|
80
|
+
disabled: boolean;
|
|
81
|
+
defaultValue: DateValue;
|
|
82
|
+
multiple: boolean;
|
|
83
|
+
placeholder: DateValue;
|
|
84
|
+
readonly: boolean;
|
|
85
|
+
pagedNavigation: boolean;
|
|
86
|
+
preventDeselect: boolean;
|
|
87
|
+
weekdayFormat: import('reka-ui/date').WeekDayFormat;
|
|
88
|
+
fixedWeeks: boolean;
|
|
89
|
+
numberOfMonths: number;
|
|
90
|
+
initialFocus: boolean;
|
|
91
|
+
isDateDisabled: import('reka-ui/date').Matcher;
|
|
92
|
+
isDateUnavailable: import('reka-ui/date').Matcher;
|
|
93
|
+
disableDaysOutsideCurrentView: boolean;
|
|
94
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
95
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
96
|
+
created?: (() => void) | (() => void)[];
|
|
97
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
98
|
+
mounted?: (() => void) | (() => void)[];
|
|
99
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
100
|
+
updated?: (() => void) | (() => void)[];
|
|
101
|
+
activated?: (() => void) | (() => void)[];
|
|
102
|
+
deactivated?: (() => void) | (() => void)[];
|
|
103
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
104
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
105
|
+
destroyed?: (() => void) | (() => void)[];
|
|
106
|
+
unmounted?: (() => void) | (() => void)[];
|
|
107
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
108
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
109
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
110
|
+
};
|
|
111
|
+
$forceUpdate: () => void;
|
|
112
|
+
$nextTick: typeof nextTick;
|
|
113
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
114
|
+
} & Readonly<{
|
|
115
|
+
as: import('reka-ui').AsTag | import('vue').Component;
|
|
116
|
+
disabled: boolean;
|
|
117
|
+
defaultValue: DateValue;
|
|
118
|
+
multiple: boolean;
|
|
119
|
+
placeholder: DateValue;
|
|
120
|
+
readonly: boolean;
|
|
121
|
+
pagedNavigation: boolean;
|
|
122
|
+
preventDeselect: boolean;
|
|
123
|
+
weekdayFormat: import('reka-ui/date').WeekDayFormat;
|
|
124
|
+
fixedWeeks: boolean;
|
|
125
|
+
numberOfMonths: number;
|
|
126
|
+
initialFocus: boolean;
|
|
127
|
+
isDateDisabled: import('reka-ui/date').Matcher;
|
|
128
|
+
isDateUnavailable: import('reka-ui/date').Matcher;
|
|
129
|
+
disableDaysOutsideCurrentView: boolean;
|
|
130
|
+
}> & Omit<Readonly<CalendarRootProps> & Readonly<{
|
|
131
|
+
"onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
132
|
+
"onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
|
|
133
|
+
}>, "disabled" | "as" | "defaultValue" | "multiple" | "placeholder" | "pagedNavigation" | "preventDeselect" | "weekdayFormat" | "fixedWeeks" | "numberOfMonths" | "readonly" | "initialFocus" | "isDateDisabled" | "isDateUnavailable" | "disableDaysOutsideCurrentView"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
134
|
+
$slots: {
|
|
135
|
+
default?: (props: {
|
|
136
|
+
date: DateValue;
|
|
137
|
+
grid: import('reka-ui/date').Grid<DateValue>[];
|
|
138
|
+
weekDays: string[];
|
|
139
|
+
weekStartsOn: import('reka-ui/date').WeekStartsOn;
|
|
140
|
+
locale: string;
|
|
141
|
+
fixedWeeks: boolean;
|
|
142
|
+
modelValue: DateValue | DateValue[] | undefined;
|
|
143
|
+
}) => any;
|
|
144
|
+
};
|
|
145
|
+
}) | null;
|
|
146
|
+
};
|
|
25
147
|
rootEl: any;
|
|
26
148
|
};
|
|
27
149
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -34,7 +156,129 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
34
156
|
}>, {
|
|
35
157
|
modelValue: DateValue | DateValue[];
|
|
36
158
|
layout: "month-and-year" | "month-only" | "year-only";
|
|
37
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
159
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
160
|
+
calendarRootRef: ({
|
|
161
|
+
$: import('vue').ComponentInternalInstance;
|
|
162
|
+
$data: {};
|
|
163
|
+
$props: {
|
|
164
|
+
readonly defaultValue?: DateValue | undefined;
|
|
165
|
+
readonly defaultPlaceholder?: DateValue | undefined;
|
|
166
|
+
readonly placeholder?: DateValue | undefined;
|
|
167
|
+
readonly pagedNavigation?: boolean | undefined;
|
|
168
|
+
readonly preventDeselect?: boolean | undefined;
|
|
169
|
+
readonly weekStartsOn?: import('reka-ui/date').WeekStartsOn | undefined;
|
|
170
|
+
readonly weekdayFormat?: import('reka-ui/date').WeekDayFormat | undefined;
|
|
171
|
+
readonly calendarLabel?: string | undefined;
|
|
172
|
+
readonly fixedWeeks?: boolean | undefined;
|
|
173
|
+
readonly maxValue?: DateValue | undefined;
|
|
174
|
+
readonly minValue?: DateValue | undefined;
|
|
175
|
+
readonly locale?: string | undefined;
|
|
176
|
+
readonly numberOfMonths?: number | undefined;
|
|
177
|
+
readonly disabled?: boolean | undefined;
|
|
178
|
+
readonly readonly?: boolean | undefined;
|
|
179
|
+
readonly initialFocus?: boolean | undefined;
|
|
180
|
+
readonly isDateDisabled?: import('reka-ui/date').Matcher | undefined;
|
|
181
|
+
readonly isDateUnavailable?: import('reka-ui/date').Matcher | undefined;
|
|
182
|
+
readonly dir?: ("ltr" | "rtl") | undefined;
|
|
183
|
+
readonly nextPage?: ((placeholder: DateValue) => DateValue) | undefined;
|
|
184
|
+
readonly prevPage?: ((placeholder: DateValue) => DateValue) | undefined;
|
|
185
|
+
readonly modelValue?: DateValue | DateValue[] | undefined;
|
|
186
|
+
readonly multiple?: boolean | undefined;
|
|
187
|
+
readonly disableDaysOutsideCurrentView?: boolean | undefined;
|
|
188
|
+
readonly asChild?: boolean | undefined;
|
|
189
|
+
readonly as?: (import('reka-ui').AsTag | import('vue').Component) | undefined;
|
|
190
|
+
readonly "onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined | undefined;
|
|
191
|
+
readonly "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined | undefined;
|
|
192
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
193
|
+
$attrs: {
|
|
194
|
+
[x: string]: unknown;
|
|
195
|
+
};
|
|
196
|
+
$refs: {
|
|
197
|
+
[x: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
$slots: Readonly<{
|
|
200
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
201
|
+
}>;
|
|
202
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
203
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
204
|
+
$host: Element | null;
|
|
205
|
+
$emit: ((event: "update:modelValue", date: DateValue | undefined) => void) & ((event: "update:placeholder", date: DateValue) => void);
|
|
206
|
+
$el: any;
|
|
207
|
+
$options: import('vue').ComponentOptionsBase<Readonly<CalendarRootProps> & Readonly<{
|
|
208
|
+
"onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
209
|
+
"onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
|
|
210
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
211
|
+
"update:modelValue": (date: DateValue | undefined) => any;
|
|
212
|
+
"update:placeholder": (date: DateValue) => any;
|
|
213
|
+
}, string, {
|
|
214
|
+
as: import('reka-ui').AsTag | import('vue').Component;
|
|
215
|
+
disabled: boolean;
|
|
216
|
+
defaultValue: DateValue;
|
|
217
|
+
multiple: boolean;
|
|
218
|
+
placeholder: DateValue;
|
|
219
|
+
readonly: boolean;
|
|
220
|
+
pagedNavigation: boolean;
|
|
221
|
+
preventDeselect: boolean;
|
|
222
|
+
weekdayFormat: import('reka-ui/date').WeekDayFormat;
|
|
223
|
+
fixedWeeks: boolean;
|
|
224
|
+
numberOfMonths: number;
|
|
225
|
+
initialFocus: boolean;
|
|
226
|
+
isDateDisabled: import('reka-ui/date').Matcher;
|
|
227
|
+
isDateUnavailable: import('reka-ui/date').Matcher;
|
|
228
|
+
disableDaysOutsideCurrentView: boolean;
|
|
229
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
230
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
231
|
+
created?: (() => void) | (() => void)[];
|
|
232
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
233
|
+
mounted?: (() => void) | (() => void)[];
|
|
234
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
235
|
+
updated?: (() => void) | (() => void)[];
|
|
236
|
+
activated?: (() => void) | (() => void)[];
|
|
237
|
+
deactivated?: (() => void) | (() => void)[];
|
|
238
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
239
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
240
|
+
destroyed?: (() => void) | (() => void)[];
|
|
241
|
+
unmounted?: (() => void) | (() => void)[];
|
|
242
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
243
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
244
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
245
|
+
};
|
|
246
|
+
$forceUpdate: () => void;
|
|
247
|
+
$nextTick: typeof nextTick;
|
|
248
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
249
|
+
} & Readonly<{
|
|
250
|
+
as: import('reka-ui').AsTag | import('vue').Component;
|
|
251
|
+
disabled: boolean;
|
|
252
|
+
defaultValue: DateValue;
|
|
253
|
+
multiple: boolean;
|
|
254
|
+
placeholder: DateValue;
|
|
255
|
+
readonly: boolean;
|
|
256
|
+
pagedNavigation: boolean;
|
|
257
|
+
preventDeselect: boolean;
|
|
258
|
+
weekdayFormat: import('reka-ui/date').WeekDayFormat;
|
|
259
|
+
fixedWeeks: boolean;
|
|
260
|
+
numberOfMonths: number;
|
|
261
|
+
initialFocus: boolean;
|
|
262
|
+
isDateDisabled: import('reka-ui/date').Matcher;
|
|
263
|
+
isDateUnavailable: import('reka-ui/date').Matcher;
|
|
264
|
+
disableDaysOutsideCurrentView: boolean;
|
|
265
|
+
}> & Omit<Readonly<CalendarRootProps> & Readonly<{
|
|
266
|
+
"onUpdate:modelValue"?: ((date: DateValue | undefined) => any) | undefined;
|
|
267
|
+
"onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
|
|
268
|
+
}>, "disabled" | "as" | "defaultValue" | "multiple" | "placeholder" | "pagedNavigation" | "preventDeselect" | "weekdayFormat" | "fixedWeeks" | "numberOfMonths" | "readonly" | "initialFocus" | "isDateDisabled" | "isDateUnavailable" | "disableDaysOutsideCurrentView"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
269
|
+
$slots: {
|
|
270
|
+
default?: (props: {
|
|
271
|
+
date: DateValue;
|
|
272
|
+
grid: import('reka-ui/date').Grid<DateValue>[];
|
|
273
|
+
weekDays: string[];
|
|
274
|
+
weekStartsOn: import('reka-ui/date').WeekStartsOn;
|
|
275
|
+
locale: string;
|
|
276
|
+
fixedWeeks: boolean;
|
|
277
|
+
modelValue: DateValue | DateValue[] | undefined;
|
|
278
|
+
}) => any;
|
|
279
|
+
};
|
|
280
|
+
}) | null;
|
|
281
|
+
}, any>;
|
|
38
282
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
39
283
|
export default _default;
|
|
40
284
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -28,7 +28,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
28
28
|
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
29
29
|
}>, {
|
|
30
30
|
sideOffset: number;
|
|
31
|
-
align: "
|
|
31
|
+
align: "center" | "start" | "end";
|
|
32
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
34
|
export default _default;
|