@aleph-alpha/ui-library 2.0.0 → 2.3.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 +0 -19
- package/config.js +65 -81
- package/dist/system/components/UiSnackbar/UiSnackbar.vue.d.ts +5 -0
- package/dist/system/components/UiSnackbar/index.d.ts +3 -0
- package/dist/system/components/UiSnackbar/types.d.ts +96 -0
- package/dist/system/components/UiToggle/UiToggle.vue.d.ts +5 -0
- package/dist/system/components/UiToggle/types.d.ts +13 -0
- package/dist/system/components/core/sonner/Sonner.vue.d.ts +3 -0
- package/dist/system/components/core/sonner/index.d.ts +1 -0
- package/dist/system/components/index.d.ts +1 -1
- package/dist/system/index.d.ts +3 -4
- package/dist/system/lib/heightTransition.d.ts +5 -0
- package/dist/system/lib/useDrag.d.ts +52 -0
- package/dist/system/lib.js +22130 -20210
- package/dist/system/patterns/UiDataTable/UiDataTable.vue.d.ts +22 -3
- package/dist/system/patterns/UiDataTable/UiDataTableColumnFilter.vue.d.ts +14 -0
- package/dist/system/patterns/UiDataTable/constants.d.ts +13 -0
- package/dist/system/patterns/UiDataTable/index.d.ts +2 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +32 -1
- package/dist/system/patterns/UiSidebar/UiSidebarGroupLabel.vue.d.ts +6 -6
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -2
- package/dist/system/patterns/UiSidebar/index.d.ts +1 -3
- package/dist/system/patterns/UiSidebar/types.d.ts +1 -95
- package/docs/public-docs/foundations.md +48 -38
- package/hover-mix.d.ts +8 -11
- package/hover-mix.js +7 -15
- package/package.json +6 -4
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAlert/UiAlert.stories.ts +4 -4
- package/src/components/UiAvatar/UiAvatar.stories.ts +2 -2
- package/src/components/UiButton/UiButton.stories.ts +1 -1
- package/src/components/UiCalendar/UiCalendar.stories.ts +1 -24
- package/src/components/UiCalendar/UiCalendar.vue +16 -0
- package/src/components/UiCard/UiCard.stories.ts +4 -4
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +6 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +70 -3
- package/src/components/UiEmpty/UiEmpty.stories.ts +1 -0
- package/src/components/UiFileItem/UiFileItem.vue +1 -1
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +4 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiIcon/UiIcon.stories.ts +90 -18
- package/src/components/UiInput/UiInput.stories.ts +2 -2
- package/src/components/UiKbd/UiKbd.stories.ts +10 -10
- package/src/components/UiLabel/UiLabel.stories.ts +2 -2
- package/src/components/UiListbox/UiListbox.stories.ts +14 -14
- package/src/components/UiListbox/UiListbox.vue +16 -0
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +24 -13
- package/src/components/UiPopover/UiPopover.stories.ts +6 -6
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +22 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +11 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.vue +16 -0
- package/src/components/UiSelect/UiSelectItem.vue +1 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +8 -8
- package/src/components/UiSheet/UiSheet.stories.ts +12 -12
- package/src/components/UiSkeleton/UiSkeleton.stories.ts +20 -20
- package/src/components/UiSlider/UiSlider.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +508 -0
- package/src/components/UiSnackbar/UiSnackbar.vue +286 -0
- package/src/components/UiSnackbar/__tests__/UiSnackbar.test.ts +17 -0
- package/src/components/UiSnackbar/index.ts +4 -0
- package/src/components/UiSnackbar/types.ts +97 -0
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiSwitch/__tests__/UiSwitch.test.ts +9 -2
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +23 -4
- package/src/components/UiTabs/UiTabs.stories.ts +2 -2
- package/src/components/UiTabs/__tests__/UiTabs.test.ts +25 -0
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +2 -0
- package/src/components/UiToggle/UiToggle.vue +18 -1
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +42 -3
- package/src/components/UiToggle/types.ts +13 -0
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +18 -0
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- package/src/components/core/accordion/AccordionContent.vue +36 -1
- package/src/components/core/alert/index.ts +3 -2
- package/src/components/core/button/index.ts +5 -6
- package/src/components/core/calendar/CalendarGrid.vue +1 -1
- package/src/components/core/card/Card.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +14 -13
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +23 -13
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/popover/PopoverContent.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarGrid.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/SidebarTrigger.vue +4 -4
- package/src/components/core/sidebar/index.ts +4 -3
- package/src/components/core/sonner/Sonner.vue +43 -0
- package/src/components/core/sonner/index.ts +1 -0
- package/src/components/core/switch/Switch.vue +2 -2
- package/src/components/core/table/TableRow.vue +1 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/toggle/index.ts +3 -3
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/directives/vHover.stories.ts +1 -1
- package/src/index.ts +3 -0
- package/src/lib/heightTransition.ts +27 -0
- package/src/lib/useDrag.stories.ts +295 -0
- package/src/lib/useDrag.ts +212 -0
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +363 -15
- package/src/patterns/UiDataTable/UiDataTable.vue +558 -22
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +83 -0
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +4 -13
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +343 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +194 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnHeader.test.ts +11 -0
- package/src/patterns/UiDataTable/constants.ts +15 -0
- package/src/patterns/UiDataTable/index.ts +2 -0
- package/src/patterns/UiDataTable/types.ts +33 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +4 -4
- package/src/patterns/UiDatePicker/UiDatePicker.vue +2 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +27 -258
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +13 -36
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +15 -10
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +20 -7
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +0 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +29 -40
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +9 -6
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +11 -13
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +8 -5
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +6 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +9 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +3 -3
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +11 -12
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +1 -1
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -2
- package/src/patterns/UiSidebar/index.ts +0 -5
- package/src/patterns/UiSidebar/types.ts +1 -111
- package/src/theme/Background.stories.ts +5 -5
- package/src/theme/Border.stories.ts +3 -3
- package/src/theme/Extended.stories.ts +6 -6
- package/src/theme/Flex.stories.ts +10 -10
- package/src/theme/Grid.stories.ts +10 -10
- package/src/theme/HoverLayer.stories.ts +215 -0
- package/src/theme/Overlay.stories.ts +2 -2
- package/src/theme/Shadow.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +4 -4
- package/src/theme/Typography.stories.ts +21 -21
- package/tokens.json +4835 -1369
- package/dist/system/components/UiIconButton/UiIconButton.vue.d.ts +0 -25
- package/dist/system/components/UiIconButton/index.d.ts +0 -7
- package/dist/system/components/UiIconButton/types.d.ts +0 -67
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistory.vue.d.ts +0 -20
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistoryItem.vue.d.ts +0 -34
- package/src/components/UiIconButton/UiIconButton.stories.ts +0 -470
- package/src/components/UiIconButton/UiIconButton.vue +0 -76
- package/src/components/UiIconButton/__tests__/UiIconButton.test.ts +0 -105
- package/src/components/UiIconButton/index.ts +0 -13
- package/src/components/UiIconButton/types.ts +0 -87
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +0 -104
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +0 -43
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +0 -204
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +0 -269
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistory.test.ts +0 -35
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistoryItem.test.ts +0 -49
- package/src/theme/BackgroundHover.stories.ts +0 -182
- package/src/theme/ContentHover.stories.ts +0 -171
package/config.d.ts
CHANGED
|
@@ -130,25 +130,6 @@ export declare const getUiLibraryTokenVars: () => UiLibraryTheme;
|
|
|
130
130
|
*/
|
|
131
131
|
export declare const getUiLibraryTokenColors: () => UiLibraryTokenColors;
|
|
132
132
|
|
|
133
|
-
/**
|
|
134
|
-
* Returns the full list of hover-mix utility class names — one `bg-`, `text-`,
|
|
135
|
-
* and `border-` class per `background.*` or `content.*` base token crossed
|
|
136
|
-
* with the three hover tiers (e.g. `bg-background-surface-primary-hover-subtle`,
|
|
137
|
-
* `text-content-on-surface-primary-hover-default`). Because these classes are
|
|
138
|
-
* usually composed at runtime (`${baseClass}-hover-${variant}`), they can't be
|
|
139
|
-
* discovered by UnoCSS's content scanner — use this helper to build a
|
|
140
|
-
* safelist.
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```ts
|
|
144
|
-
* import { getUiLibraryHoverMixUtilityClasses } from '@aleph-alpha/ui-library/config';
|
|
145
|
-
* export default defineConfig({
|
|
146
|
-
* safelist: [...getUiLibraryHoverMixUtilityClasses()],
|
|
147
|
-
* });
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
export declare const getUiLibraryHoverMixUtilityClasses: () => string[];
|
|
151
|
-
|
|
152
133
|
/**
|
|
153
134
|
* Creates an UnoCSS preset with custom theme variables.
|
|
154
135
|
* Use this when you want full control over the theme.
|
package/config.js
CHANGED
|
@@ -3,11 +3,7 @@ import { defineConfig, definePreset } from 'unocss';
|
|
|
3
3
|
import presetWind from '@unocss/preset-wind4';
|
|
4
4
|
import presetAnimations from 'unocss-preset-animations';
|
|
5
5
|
import presetShadcn from 'unocss-preset-shadcn';
|
|
6
|
-
import {
|
|
7
|
-
HOVER_VARIANTS,
|
|
8
|
-
HOVER_MIX_TOKEN_PREFIXES,
|
|
9
|
-
buildHoverMixVars,
|
|
10
|
-
} from './hover-mix.js';
|
|
6
|
+
import { tokenPreset as sparkTokenPreset } from '@aleph-alpha/config-css';
|
|
11
7
|
|
|
12
8
|
let tokensCache;
|
|
13
9
|
|
|
@@ -309,43 +305,6 @@ const buildAllTokenVarsFromModeSet = (modeSetName) => {
|
|
|
309
305
|
return vars;
|
|
310
306
|
};
|
|
311
307
|
|
|
312
|
-
/**
|
|
313
|
-
* Resolve every `background.*` and `content.*` color token and composite it
|
|
314
|
-
* with each `overlay.hover.{subtle|default|strong}` token to produce flat hex
|
|
315
|
-
* colors. The formula lives in `./hover-mix.js`; this function only handles
|
|
316
|
-
* token resolution for a given mode set (Light/Dark).
|
|
317
|
-
*/
|
|
318
|
-
const buildHoverMixVarsFromModeSet = (modeSetName) => {
|
|
319
|
-
const tokens = getTokens();
|
|
320
|
-
const modeSet = tokens?.[modeSetName];
|
|
321
|
-
if (!modeSet) return {};
|
|
322
|
-
|
|
323
|
-
const baseColors = {};
|
|
324
|
-
for (const path of collectColorTokenPaths(modeSet)) {
|
|
325
|
-
if (!HOVER_MIX_TOKEN_PREFIXES.some((p) => path.startsWith(p))) continue;
|
|
326
|
-
const value = resolveTokenValue(modeSetName, path);
|
|
327
|
-
if (!value) continue;
|
|
328
|
-
baseColors[path.replace(/\./g, '-')] = value;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const overlays = {};
|
|
332
|
-
for (const variant of HOVER_VARIANTS) {
|
|
333
|
-
const value = resolveTokenValue(modeSetName, `overlay.hover.${variant}`);
|
|
334
|
-
if (value) overlays[variant] = value;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// Semi-transparent base tokens (e.g. `background.button.secondary-button`
|
|
338
|
-
// uses `alpha.sand.30`) are rendered against the page's primary surface, so
|
|
339
|
-
// we flatten them onto it before applying the overlay blend — otherwise
|
|
340
|
-
// the hover color comes out significantly too dark.
|
|
341
|
-
const parentSurface = resolveTokenValue(
|
|
342
|
-
modeSetName,
|
|
343
|
-
'background.surface.primary',
|
|
344
|
-
);
|
|
345
|
-
|
|
346
|
-
return buildHoverMixVars({ baseColors, overlays, parentSurface });
|
|
347
|
-
};
|
|
348
|
-
|
|
349
308
|
// shadcn CSS variable builders
|
|
350
309
|
const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
351
310
|
const resolve = (path) => resolveTokenValue(modeSetName, path);
|
|
@@ -528,11 +487,9 @@ export const getUiLibraryThemeFromTokens = () => ({
|
|
|
528
487
|
export const getUiLibraryTokenVars = () => ({
|
|
529
488
|
light: {
|
|
530
489
|
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
531
|
-
...buildHoverMixVarsFromModeSet('3-mode/Light'),
|
|
532
490
|
},
|
|
533
491
|
dark: {
|
|
534
492
|
...buildAllTokenVarsFromModeSet('3-mode/Dark'),
|
|
535
|
-
...buildHoverMixVarsFromModeSet('3-mode/Dark'),
|
|
536
493
|
},
|
|
537
494
|
});
|
|
538
495
|
|
|
@@ -557,7 +514,6 @@ export const getUiLibraryTokenVars = () => ({
|
|
|
557
514
|
export const getUiLibraryTokenColors = () => {
|
|
558
515
|
const lightVars = {
|
|
559
516
|
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
560
|
-
...buildHoverMixVarsFromModeSet('3-mode/Light'),
|
|
561
517
|
};
|
|
562
518
|
const colors = {};
|
|
563
519
|
|
|
@@ -569,36 +525,6 @@ export const getUiLibraryTokenColors = () => {
|
|
|
569
525
|
return colors;
|
|
570
526
|
};
|
|
571
527
|
|
|
572
|
-
/**
|
|
573
|
-
* Generated hover-mix utility class names — one `bg-`, `text-`, and `border-`
|
|
574
|
-
* class per `background.*` or `content.*` base token × `{subtle|default|strong}`
|
|
575
|
-
* hover tier. Classes are composed dynamically by consumers
|
|
576
|
-
* (e.g. `${baseClass}-hover-${variant}`) and therefore can't be discovered by
|
|
577
|
-
* UnoCSS's content scanner, so we expose the full list for use as a safelist.
|
|
578
|
-
*
|
|
579
|
-
* @returns {string[]} Flat array of fully-qualified utility class names.
|
|
580
|
-
*
|
|
581
|
-
* @example
|
|
582
|
-
* ```ts
|
|
583
|
-
* // uno.config.ts
|
|
584
|
-
* import { getUiLibraryHoverMixUtilityClasses } from '@aleph-alpha/ui-library/config';
|
|
585
|
-
* export default defineConfig({
|
|
586
|
-
* safelist: [...getUiLibraryHoverMixUtilityClasses()],
|
|
587
|
-
* // ...
|
|
588
|
-
* });
|
|
589
|
-
* ```
|
|
590
|
-
*/
|
|
591
|
-
export const getUiLibraryHoverMixUtilityClasses = () => {
|
|
592
|
-
const varNames = Object.keys(buildHoverMixVarsFromModeSet('3-mode/Light'));
|
|
593
|
-
const classes = [];
|
|
594
|
-
for (const varName of varNames) {
|
|
595
|
-
classes.push(`bg-${varName}`);
|
|
596
|
-
classes.push(`text-${varName}`);
|
|
597
|
-
classes.push(`border-${varName}`);
|
|
598
|
-
}
|
|
599
|
-
return classes;
|
|
600
|
-
};
|
|
601
|
-
|
|
602
528
|
export const defineThemeConfig = (config) => config;
|
|
603
529
|
|
|
604
530
|
export const presetUiLibraryTheme = (theme, options = {}) => {
|
|
@@ -747,7 +673,6 @@ const vHoverOverlayCSS = `
|
|
|
747
673
|
border-radius: inherit;
|
|
748
674
|
pointer-events: none;
|
|
749
675
|
opacity: 0;
|
|
750
|
-
mix-blend-mode: overlay;
|
|
751
676
|
transition: opacity 0.2s ease;
|
|
752
677
|
}
|
|
753
678
|
.v-hover-root > :not(.v-hover-overlay) {
|
|
@@ -777,8 +702,53 @@ const vHoverOverlayCSS = `
|
|
|
777
702
|
.v-hover-root:active .v-hover-overlay {
|
|
778
703
|
opacity: 1;
|
|
779
704
|
}
|
|
705
|
+
.hover-layer {
|
|
706
|
+
position: relative;
|
|
707
|
+
isolation: isolate;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
}
|
|
710
|
+
.hover-layer::after {
|
|
711
|
+
content: "";
|
|
712
|
+
position: absolute;
|
|
713
|
+
inset: 0;
|
|
714
|
+
z-index: 0;
|
|
715
|
+
border-radius: inherit;
|
|
716
|
+
pointer-events: none;
|
|
717
|
+
opacity: 0;
|
|
718
|
+
background-color: var(--hover-layer-background, oklch(var(--overlay-hover-default)));
|
|
719
|
+
transition: opacity 0.2s ease;
|
|
720
|
+
}
|
|
721
|
+
.hover-layer > :not(.v-hover-overlay) {
|
|
722
|
+
position: relative;
|
|
723
|
+
z-index: 1;
|
|
724
|
+
}
|
|
725
|
+
.hover-layer-subtle {
|
|
726
|
+
--hover-layer-background: oklch(var(--overlay-hover-subtle));
|
|
727
|
+
}
|
|
728
|
+
.hover-layer-default {
|
|
729
|
+
--hover-layer-background: oklch(var(--overlay-hover-default));
|
|
730
|
+
}
|
|
731
|
+
.hover-layer-strong {
|
|
732
|
+
--hover-layer-background: oklch(var(--overlay-hover-strong));
|
|
733
|
+
}
|
|
734
|
+
@media (hover: hover) {
|
|
735
|
+
.hover-layer:hover::after {
|
|
736
|
+
opacity: 1;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
.hover-layer:focus::after,
|
|
740
|
+
.hover-layer:focus-visible::after,
|
|
741
|
+
.hover-layer:has(:focus-visible)::after,
|
|
742
|
+
.hover-layer:active::after,
|
|
743
|
+
.hover-layer-active::after,
|
|
744
|
+
.hover-layer[data-highlighted]::after,
|
|
745
|
+
.hover-layer[data-state="open"]::after,
|
|
746
|
+
.hover-layer[data-active="true"]::after {
|
|
747
|
+
opacity: 1;
|
|
748
|
+
}
|
|
780
749
|
@media (prefers-reduced-motion: reduce) {
|
|
781
|
-
.v-hover-overlay
|
|
750
|
+
.v-hover-overlay,
|
|
751
|
+
.hover-layer::after {
|
|
782
752
|
transition: none;
|
|
783
753
|
}
|
|
784
754
|
}
|
|
@@ -826,6 +796,18 @@ export const presetUiLibraryUtils = () =>
|
|
|
826
796
|
/^origin-\(--(.+)\)$/,
|
|
827
797
|
([, name]) => ({ 'transform-origin': `var(--${name})` }),
|
|
828
798
|
],
|
|
799
|
+
[
|
|
800
|
+
/^bg-overlay-hover-(subtle|default|strong)$/,
|
|
801
|
+
([, overlayVariant]) => ({
|
|
802
|
+
'background-color': `oklch(var(--overlay-hover-${overlayVariant}))`,
|
|
803
|
+
}),
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
/^bg-background-surface-muted-subtle$/,
|
|
807
|
+
() => ({
|
|
808
|
+
'background-color': 'oklch(var(--background-surface-muted-subtle))',
|
|
809
|
+
}),
|
|
810
|
+
],
|
|
829
811
|
],
|
|
830
812
|
}))();
|
|
831
813
|
|
|
@@ -871,10 +853,7 @@ export const defineUiLibraryConfig = (options = {}) => {
|
|
|
871
853
|
|
|
872
854
|
return defineConfig({
|
|
873
855
|
...getUiLibraryContentConfig(),
|
|
874
|
-
safelist: [
|
|
875
|
-
'overlay-link-hover-subtle',
|
|
876
|
-
...getUiLibraryHoverMixUtilityClasses(),
|
|
877
|
-
],
|
|
856
|
+
safelist: ['overlay-link-hover-subtle'],
|
|
878
857
|
presets: [
|
|
879
858
|
presetWind(),
|
|
880
859
|
presetAnimations(),
|
|
@@ -884,6 +863,11 @@ export const defineUiLibraryConfig = (options = {}) => {
|
|
|
884
863
|
}),
|
|
885
864
|
presetUiLibraryThemeFromTokens(themeOptions),
|
|
886
865
|
presetUiLibraryUtils(),
|
|
866
|
+
// Spark Colors / Spacings / Box-shadow tokens. Disjoint namespace from
|
|
867
|
+
// AA-Base; pulled in for components designed against the Spark layer of
|
|
868
|
+
// the Figma file (currently UiSnackbar). Consumers of
|
|
869
|
+
// defineUiLibraryConfig get this transparently.
|
|
870
|
+
sparkTokenPreset,
|
|
887
871
|
...extraPresets,
|
|
888
872
|
],
|
|
889
873
|
rules: [...extraRules],
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UiSnackbarProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<UiSnackbarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSnackbarProps> & Readonly<{}>, {
|
|
3
|
+
containerAriaLabel: string;
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ToasterProps } from 'vue-sonner';
|
|
2
|
+
/**
|
|
3
|
+
* Toast notification container (Sonner). Place once near the app root,
|
|
4
|
+
* then call `toast()` (or `toast.success()`, `toast.error()`, etc.) from
|
|
5
|
+
* anywhere to display a non-blocking notification.
|
|
6
|
+
* @category Feedback
|
|
7
|
+
* @useCases success confirmation, error notice, undo action, async progress, background updates
|
|
8
|
+
* @keywords snackbar, toast, sonner, notification, alert, message, banner, undo
|
|
9
|
+
* @related UiAlert, UiAlertDialog
|
|
10
|
+
*/
|
|
11
|
+
export type UiSnackbarProps = {
|
|
12
|
+
/**
|
|
13
|
+
* Where toasts appear on screen.
|
|
14
|
+
* @default 'bottom-right'
|
|
15
|
+
*/
|
|
16
|
+
position?: ToasterProps['position'];
|
|
17
|
+
/**
|
|
18
|
+
* Color theme for toasts.
|
|
19
|
+
* @default 'light'
|
|
20
|
+
*/
|
|
21
|
+
theme?: ToasterProps['theme'];
|
|
22
|
+
/** Mirror the body color scheme so toasts contrast against it. */
|
|
23
|
+
invert?: ToasterProps['invert'];
|
|
24
|
+
/**
|
|
25
|
+
* Apply colored backgrounds for `success`, `error`, `info`, and `warning` toasts.
|
|
26
|
+
*
|
|
27
|
+
* Accessibility: color must not be the only signal of toast type
|
|
28
|
+
* (WCAG 1.4.1 Use of Color). Always pair with a descriptive message
|
|
29
|
+
* and/or icon so the meaning is conveyed to users who cannot perceive
|
|
30
|
+
* the color difference.
|
|
31
|
+
*/
|
|
32
|
+
richColors?: ToasterProps['richColors'];
|
|
33
|
+
/** Show all stacked toasts expanded by default instead of collapsed. */
|
|
34
|
+
expand?: ToasterProps['expand'];
|
|
35
|
+
/**
|
|
36
|
+
* Show a close (X) button on every toast.
|
|
37
|
+
*
|
|
38
|
+
* Accessibility: recommended whenever toasts have non-trivial
|
|
39
|
+
* `duration` values or contain actions, so keyboard and screen
|
|
40
|
+
* reader users can dismiss them on their own terms. The close
|
|
41
|
+
* button has an accessible name of `'Close toast'` by default;
|
|
42
|
+
* customise via `toastOptions.closeButtonAriaLabel`.
|
|
43
|
+
*/
|
|
44
|
+
closeButton?: ToasterProps['closeButton'];
|
|
45
|
+
/** Position of the close button within each toast. */
|
|
46
|
+
closeButtonPosition?: ToasterProps['closeButtonPosition'];
|
|
47
|
+
/**
|
|
48
|
+
* Default duration in milliseconds before a toast auto-dismisses.
|
|
49
|
+
* Pass `Infinity` to keep toasts open until dismissed.
|
|
50
|
+
*
|
|
51
|
+
* Accessibility: very short durations can violate WCAG 2.2.1
|
|
52
|
+
* (Timing Adjustable). For toasts that carry critical information
|
|
53
|
+
* or actions (e.g. an Undo button), prefer longer durations or
|
|
54
|
+
* `Infinity` combined with `closeButton: true` so users with
|
|
55
|
+
* cognitive or motor impairments have time to read and respond.
|
|
56
|
+
*/
|
|
57
|
+
duration?: ToasterProps['duration'];
|
|
58
|
+
/** Pixel gap between stacked toasts. */
|
|
59
|
+
gap?: ToasterProps['gap'];
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of toasts visible at the same time.
|
|
62
|
+
* @default 3
|
|
63
|
+
*/
|
|
64
|
+
visibleToasts?: ToasterProps['visibleToasts'];
|
|
65
|
+
/** Offset from the viewport edges. Accepts a string, number, or per-side object. */
|
|
66
|
+
offset?: ToasterProps['offset'];
|
|
67
|
+
/** Offset used on mobile viewports. */
|
|
68
|
+
mobileOffset?: ToasterProps['mobileOffset'];
|
|
69
|
+
/** Document writing direction. */
|
|
70
|
+
dir?: ToasterProps['dir'];
|
|
71
|
+
/**
|
|
72
|
+
* Keyboard combination that focuses the toast region.
|
|
73
|
+
* Provides a keyboard escape hatch (WCAG 2.1.1 Keyboard) so users
|
|
74
|
+
* can reach toasts without a pointing device. Document the chosen
|
|
75
|
+
* combination in your app's keyboard-shortcuts help.
|
|
76
|
+
* @default ['altKey', 'KeyT']
|
|
77
|
+
*/
|
|
78
|
+
hotkey?: ToasterProps['hotkey'];
|
|
79
|
+
/** Directions in which a toast can be dismissed by swipe. */
|
|
80
|
+
swipeDirections?: ToasterProps['swipeDirections'];
|
|
81
|
+
/** Custom icons used for each toast type. */
|
|
82
|
+
icons?: ToasterProps['icons'];
|
|
83
|
+
/** Default options applied to every toast. */
|
|
84
|
+
toastOptions?: ToasterProps['toastOptions'];
|
|
85
|
+
/**
|
|
86
|
+
* Accessible label announced to screen readers for the live region wrapping all toasts.
|
|
87
|
+
*
|
|
88
|
+
* The default `'Notifications'` is sufficient for most apps. Override only
|
|
89
|
+
* when you need a localized label or when multiple Toaster instances exist
|
|
90
|
+
* on the same page and need to be distinguishable to assistive technology.
|
|
91
|
+
* @default 'Notifications'
|
|
92
|
+
*/
|
|
93
|
+
containerAriaLabel?: ToasterProps['containerAriaLabel'];
|
|
94
|
+
/** Identifier when rendering more than one Toaster instance. */
|
|
95
|
+
id?: ToasterProps['id'];
|
|
96
|
+
};
|
|
@@ -6,7 +6,9 @@ type __VLS_PublicProps = {
|
|
|
6
6
|
declare function __VLS_template(): {
|
|
7
7
|
attrs: Partial<{}>;
|
|
8
8
|
slots: {
|
|
9
|
+
'left-icon'?(_: {}): any;
|
|
9
10
|
default?(_: {}): any;
|
|
11
|
+
'right-icon'?(_: {}): any;
|
|
10
12
|
};
|
|
11
13
|
refs: {};
|
|
12
14
|
rootEl: any;
|
|
@@ -20,6 +22,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
20
22
|
disabled: boolean;
|
|
21
23
|
size: "default" | "sm" | "lg";
|
|
22
24
|
variant: "default" | "outline" | "soft";
|
|
25
|
+
active: boolean;
|
|
26
|
+
leftIcon: string;
|
|
27
|
+
rightIcon: string;
|
|
23
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
30
|
export default _default;
|
|
@@ -16,6 +16,11 @@ export interface UiToggleProps {
|
|
|
16
16
|
* Use when you do not need to control its state.
|
|
17
17
|
*/
|
|
18
18
|
defaultValue?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Controlled visual active state. Useful when another component, such as a dropdown,
|
|
21
|
+
* owns the active/open state.
|
|
22
|
+
*/
|
|
23
|
+
active?: boolean;
|
|
19
24
|
/**
|
|
20
25
|
* Whether the toggle is disabled.
|
|
21
26
|
* @default false
|
|
@@ -31,4 +36,12 @@ export interface UiToggleProps {
|
|
|
31
36
|
* @default 'default'
|
|
32
37
|
*/
|
|
33
38
|
size?: 'default' | 'sm' | 'lg';
|
|
39
|
+
/**
|
|
40
|
+
* Optional icon rendered before the default slot.
|
|
41
|
+
*/
|
|
42
|
+
leftIcon?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional icon rendered after the default slot.
|
|
45
|
+
*/
|
|
46
|
+
rightIcon?: string;
|
|
34
47
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ToasterProps } from 'vue-sonner';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToasterProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toaster } from './Sonner.vue';
|
|
@@ -21,7 +21,6 @@ export * from './UiField';
|
|
|
21
21
|
export * from './UiFileItem';
|
|
22
22
|
export * from './UiFileUploadBox';
|
|
23
23
|
export * from './UiIcon';
|
|
24
|
-
export * from './UiIconButton';
|
|
25
24
|
export * from './UiInput';
|
|
26
25
|
export * from './UiItem';
|
|
27
26
|
export * from './UiKbd';
|
|
@@ -37,6 +36,7 @@ export * from './UiSeparator';
|
|
|
37
36
|
export * from './UiSheet';
|
|
38
37
|
export * from './UiSkeleton';
|
|
39
38
|
export * from './UiSlider';
|
|
39
|
+
export * from './UiSnackbar';
|
|
40
40
|
export * from './UiSpinner';
|
|
41
41
|
export * from './UiStepper';
|
|
42
42
|
export * from './UiSwitch';
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by prepare-build.js script
|
|
3
|
-
* Do not edit this file manually
|
|
4
|
-
*/
|
|
1
|
+
import { PrimitiveProps as RekaPrimitiveProps } from 'reka-ui';
|
|
5
2
|
export * from './components';
|
|
6
3
|
export * from './patterns';
|
|
7
4
|
export * from './templates';
|
|
8
5
|
export * from './directives';
|
|
6
|
+
export { Primitive } from 'reka-ui';
|
|
7
|
+
export type PrimitiveProps = RekaPrimitiveProps;
|
|
9
8
|
declare const _default: {
|
|
10
9
|
install(app: any, options: any): void;
|
|
11
10
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const heightTransitionClass = "transition-[height] duration-200 ease-linear overflow-hidden";
|
|
2
|
+
export declare function onHeightTransitionEnter(el: Element): void;
|
|
3
|
+
export declare function onHeightTransitionAfterEnter(el: Element): void;
|
|
4
|
+
export declare function onHeightTransitionBeforeLeave(el: Element): void;
|
|
5
|
+
export declare function onHeightTransitionLeave(el: Element): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
type UseDragOptionsBase = {
|
|
3
|
+
/** DataTransfer MIME type used by setDragData/getDragData. */
|
|
4
|
+
dataType?: string;
|
|
5
|
+
};
|
|
6
|
+
type UseDragOptionsWithItems<TItem> = UseDragOptionsBase & {
|
|
7
|
+
/** Optional sortable item model. When provided, `onDrop` reorders it. */
|
|
8
|
+
items: Ref<TItem[]>;
|
|
9
|
+
/** Returns the stable drag ID for an item in `items`. */
|
|
10
|
+
getItemId: (item: TItem) => string;
|
|
11
|
+
};
|
|
12
|
+
type UseDragOptionsWithoutItems = UseDragOptionsBase & {
|
|
13
|
+
/** Disallow sortable item state unless `getItemId` is also supplied. */
|
|
14
|
+
items?: never;
|
|
15
|
+
/** Disallow item ID resolution without sortable item state. */
|
|
16
|
+
getItemId?: never;
|
|
17
|
+
};
|
|
18
|
+
export type UseDragOptions<TItem = unknown> = UseDragOptionsWithItems<TItem> | UseDragOptionsWithoutItems;
|
|
19
|
+
export type DragGhostOptions = {
|
|
20
|
+
/** Width of the generated drag preview in pixels. */
|
|
21
|
+
width: number;
|
|
22
|
+
/** Height of the generated drag preview in pixels. */
|
|
23
|
+
height: number;
|
|
24
|
+
/** Classes applied to the generated preview element. */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Horizontal cursor offset inside the preview. */
|
|
27
|
+
offsetX?: number;
|
|
28
|
+
/** Vertical cursor offset inside the preview. */
|
|
29
|
+
offsetY?: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function reorderItems<T>(items: T[], draggedItem: T, targetItem: T): T[];
|
|
32
|
+
export declare function setDragData(event: DragEvent, value: string, dataType?: string): void;
|
|
33
|
+
export declare function getDragData(event: DragEvent, dataType?: string): string | undefined;
|
|
34
|
+
export declare function setDragGhost(event: DragEvent, options: DragGhostOptions): (() => void) | undefined;
|
|
35
|
+
export declare function useDrag<TItem = unknown>(options?: UseDragOptions<TItem>): {
|
|
36
|
+
activeItemId: Ref<string | undefined, string | undefined>;
|
|
37
|
+
activeItem: import('vue').ComputedRef<TItem | undefined>;
|
|
38
|
+
draggedItemId: Ref<string | undefined, string | undefined>;
|
|
39
|
+
draggedItem: import('vue').ComputedRef<TItem | undefined>;
|
|
40
|
+
originalItems: Ref<TItem[] | undefined, TItem[] | undefined>;
|
|
41
|
+
reorderItems: typeof reorderItems;
|
|
42
|
+
setDragData: (event: DragEvent, value: string) => void;
|
|
43
|
+
getDragData: (event: DragEvent) => string | undefined;
|
|
44
|
+
setDragGhost: (event: DragEvent, ghostOptions: DragGhostOptions) => (() => void) | undefined;
|
|
45
|
+
cleanupDragGhost: () => void;
|
|
46
|
+
startDrag: (event: DragEvent, itemId: string, ghostOptions?: DragGhostOptions) => void;
|
|
47
|
+
dragOver: (event: DragEvent, itemId: string) => void;
|
|
48
|
+
getDropData: (event: DragEvent) => string | undefined;
|
|
49
|
+
onDrop: (event: DragEvent, targetItemId: string) => void;
|
|
50
|
+
resetDragState: () => void;
|
|
51
|
+
};
|
|
52
|
+
export {};
|