@sewadah/selaras 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -1
- package/dist/runtime/components/Autocomplete.vue +3 -1
- package/dist/runtime/components/Calendar.d.vue.ts +69 -0
- package/dist/runtime/components/Calendar.vue +163 -0
- package/dist/runtime/components/Calendar.vue.d.ts +69 -0
- package/dist/runtime/components/Callout.vue +12 -1
- package/dist/runtime/components/CodeGroup.vue +13 -3
- package/dist/runtime/components/CodeTree.d.vue.ts +2 -0
- package/dist/runtime/components/CodeTree.vue +52 -1
- package/dist/runtime/components/CodeTree.vue.d.ts +2 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +8 -0
- package/dist/runtime/components/ColorPicker.vue +66 -45
- package/dist/runtime/components/ColorPicker.vue.d.ts +8 -0
- package/dist/runtime/components/Column.js +1 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +3 -1
- package/dist/runtime/components/CommandPalette.vue +5 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -1
- package/dist/runtime/components/ContentNavigation.d.vue.ts +8 -1
- package/dist/runtime/components/ContentNavigation.vue +9 -2
- package/dist/runtime/components/ContentNavigation.vue.d.ts +8 -1
- package/dist/runtime/components/ContextMenu.d.vue.ts +8 -1
- package/dist/runtime/components/ContextMenu.vue +16 -4
- package/dist/runtime/components/ContextMenu.vue.d.ts +8 -1
- package/dist/runtime/components/DatePicker.d.vue.ts +10 -3
- package/dist/runtime/components/DatePicker.vue +24 -16
- package/dist/runtime/components/DatePicker.vue.d.ts +10 -3
- package/dist/runtime/components/Dropdown.d.vue.ts +33 -6
- package/dist/runtime/components/Dropdown.vue +143 -11
- package/dist/runtime/components/Dropdown.vue.d.ts +33 -6
- package/dist/runtime/components/FileTree.d.vue.ts +2 -0
- package/dist/runtime/components/FileTree.vue +8 -4
- package/dist/runtime/components/FileTree.vue.d.ts +2 -0
- package/dist/runtime/components/FormField.d.vue.ts +4 -0
- package/dist/runtime/components/FormField.vue +19 -4
- package/dist/runtime/components/FormField.vue.d.ts +4 -0
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Kbd.vue +12 -2
- package/dist/runtime/components/NavigationMenu.d.vue.ts +10 -10
- package/dist/runtime/components/NavigationMenu.vue +13 -9
- package/dist/runtime/components/NavigationMenu.vue.d.ts +10 -10
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -1
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
- package/dist/runtime/components/Popover.d.vue.ts +8 -2
- package/dist/runtime/components/Popover.vue +9 -4
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/ProsePre.d.vue.ts +2 -0
- package/dist/runtime/components/ProsePre.vue +2 -1
- package/dist/runtime/components/ProsePre.vue.d.ts +2 -0
- package/dist/runtime/components/Select.vue +3 -1
- package/dist/runtime/components/SplitterPanel.d.vue.ts +2 -2
- package/dist/runtime/components/SplitterPanel.vue.d.ts +2 -2
- package/dist/runtime/components/Table.vue +95 -26
- package/dist/runtime/components/Tabs.d.vue.ts +44 -4
- package/dist/runtime/components/Tabs.vue +171 -18
- package/dist/runtime/components/Tabs.vue.d.ts +44 -4
- package/dist/runtime/components/Textarea.vue +3 -2
- package/dist/runtime/components/Timeline.d.vue.ts +19 -0
- package/dist/runtime/components/Timeline.vue +99 -0
- package/dist/runtime/components/Timeline.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +10 -1
- package/dist/runtime/components/Toast.vue +94 -8
- package/dist/runtime/components/Toast.vue.d.ts +10 -1
- package/dist/runtime/components/Tooltip.d.vue.ts +8 -2
- package/dist/runtime/components/Tooltip.vue +9 -4
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/composables/use-form-field.d.ts +1 -0
- package/dist/runtime/composables/use-table.d.ts +3 -0
- package/dist/runtime/composables/use-table.js +10 -4
- package/dist/runtime/composables/use-toast.js +5 -1
- package/dist/runtime/directives/hotkey.d.ts +13 -0
- package/dist/runtime/directives/hotkey.js +107 -0
- package/dist/runtime/directives/index.d.ts +2 -0
- package/dist/runtime/directives/index.js +2 -0
- package/dist/runtime/directives/mask.d.ts +30 -0
- package/dist/runtime/directives/mask.js +165 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +29 -25
- package/dist/runtime/internal/ComboboxSelectBase.vue +103 -19
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +29 -25
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +16 -11
- package/dist/runtime/internal/ComboboxSelectBody.vue +49 -10
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +16 -11
- package/dist/runtime/internal/DatePickerCalendarBody.vue +1 -1
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
- package/dist/runtime/internal/ShortcutHint.d.vue.ts +6 -0
- package/dist/runtime/internal/ShortcutHint.vue +13 -0
- package/dist/runtime/internal/ShortcutHint.vue.d.ts +6 -0
- package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +9 -1
- package/dist/runtime/internal/ToastItemRenderer.vue +55 -8
- package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +9 -1
- package/dist/runtime/internal/combobox-select.js +2 -1
- package/dist/runtime/internal/programmatic-services.d.ts +2 -0
- package/dist/runtime/internal/programmatic-services.js +8 -0
- package/dist/runtime/internal/toast-stack.d.ts +36 -0
- package/dist/runtime/internal/toast-stack.js +36 -0
- package/dist/runtime/structural.css +1 -1
- package/dist/runtime/table.d.ts +1 -1
- package/dist/runtime/theme/alert-dialog.js +1 -1
- package/dist/runtime/theme/calendar.d.ts +86 -0
- package/dist/runtime/theme/calendar.js +19 -0
- package/dist/runtime/theme/callout.d.ts +0 -12
- package/dist/runtime/theme/callout.js +8 -8
- package/dist/runtime/theme/code-tree.js +1 -1
- package/dist/runtime/theme/command-palette.js +1 -1
- package/dist/runtime/theme/content-navigation.d.ts +3 -0
- package/dist/runtime/theme/content-navigation.js +1 -0
- package/dist/runtime/theme/drawer.js +1 -1
- package/dist/runtime/theme/dropdown.d.ts +21 -0
- package/dist/runtime/theme/dropdown.js +15 -2
- package/dist/runtime/theme/file-tree.js +1 -1
- package/dist/runtime/theme/form-field.d.ts +18 -0
- package/dist/runtime/theme/form-field.js +6 -1
- package/dist/runtime/theme/modal.js +1 -1
- package/dist/runtime/theme/slideover.js +1 -1
- package/dist/runtime/theme/table.d.ts +27 -0
- package/dist/runtime/theme/table.js +11 -2
- package/dist/runtime/theme/tabs.d.ts +87 -3
- package/dist/runtime/theme/tabs.js +46 -22
- package/dist/runtime/theme/timeline.d.ts +251 -0
- package/dist/runtime/theme/timeline.js +84 -0
- package/dist/runtime/theme/toast.d.ts +92 -0
- package/dist/runtime/theme/toast.js +29 -7
- package/dist/runtime/theme-config.d.ts +12 -1
- package/dist/runtime/types/index.d.ts +6 -1
- package/dist/runtime/utils/arrow.d.ts +21 -0
- package/dist/runtime/utils/arrow.js +10 -0
- package/dist/runtime/utils/file-icons.js +2 -0
- package/dist/runtime/utils/icons.d.ts +2 -0
- package/dist/runtime/utils/icons.js +2 -0
- package/dist/runtime/utils/messages.d.ts +6 -0
- package/dist/runtime/utils/messages.js +6 -0
- package/dist/runtime/utils/navigation-menu.d.ts +7 -0
- package/dist/runtime/utils/navigation-menu.js +3 -0
- package/dist/runtime/utils/overlay.d.ts +17 -0
- package/dist/runtime/utils/overlay.js +7 -0
- package/dist/runtime/utils/select-contracts.d.ts +7 -1
- package/dist/runtime/utils/table-columns.js +1 -1
- package/dist/runtime/utils/table-contracts.d.ts +9 -1
- package/dist/runtime/utils/timeline-contracts.d.ts +42 -0
- package/dist/runtime/utils/timeline-contracts.js +0 -0
- package/package.json +2 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import type { ToastThemeSlots } from '../theme/toast.js';
|
|
1
|
+
import type { ToastPosition, ToastThemeSlots } from '../theme/toast.js';
|
|
2
2
|
import type { UiProp } from '../utils/ui.js';
|
|
3
3
|
import type { ToastItem } from './programmatic-services.js';
|
|
4
|
+
import type { ToastStackItem } from './toast-stack.js';
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
toast: ToastItem;
|
|
6
7
|
ui?: UiProp<ToastThemeSlots>;
|
|
8
|
+
duration: number;
|
|
9
|
+
expand: boolean;
|
|
10
|
+
position: ToastPosition;
|
|
11
|
+
placement: ToastStackItem | undefined;
|
|
12
|
+
leaving: boolean;
|
|
7
13
|
};
|
|
8
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
15
|
remove: (id: number) => any;
|
|
16
|
+
resize: (height: number) => any;
|
|
10
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
18
|
onRemove?: ((id: number) => any) | undefined;
|
|
19
|
+
onResize?: ((height: number) => any) | undefined;
|
|
12
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
21
|
declare const _default: typeof __VLS_export;
|
|
14
22
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ToastClose, ToastDescription, ToastRoot, ToastTitle } from "reka-ui";
|
|
3
|
-
import { computed } from "vue";
|
|
3
|
+
import { computed, ref, watch } from "vue";
|
|
4
4
|
import Button from "../components/Button.vue";
|
|
5
5
|
import Icon from "../components/Icon.vue";
|
|
6
6
|
import { useIcons } from "../composables/use-icons";
|
|
@@ -11,16 +11,62 @@ import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
|
11
11
|
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
12
12
|
const props = defineProps({
|
|
13
13
|
toast: { type: Object, required: true },
|
|
14
|
-
ui: { type: Object, required: false }
|
|
14
|
+
ui: { type: Object, required: false },
|
|
15
|
+
duration: { type: Number, required: true },
|
|
16
|
+
expand: { type: Boolean, required: true },
|
|
17
|
+
position: { type: null, required: true },
|
|
18
|
+
placement: { type: null, required: true },
|
|
19
|
+
leaving: { type: Boolean, required: true }
|
|
15
20
|
});
|
|
16
|
-
const emit = defineEmits(["remove"]);
|
|
21
|
+
const emit = defineEmits(["remove", "resize"]);
|
|
22
|
+
const rootElement = ref(null);
|
|
23
|
+
function setRootElement(instance) {
|
|
24
|
+
if (typeof HTMLElement === "undefined")
|
|
25
|
+
return;
|
|
26
|
+
const element = instance instanceof HTMLElement ? instance : instance?.$el;
|
|
27
|
+
if (element instanceof HTMLElement)
|
|
28
|
+
rootElement.value = element;
|
|
29
|
+
}
|
|
30
|
+
const placement = ref(props.placement);
|
|
31
|
+
watch(() => [props.placement, props.leaving], ([next, leaving]) => {
|
|
32
|
+
if (!leaving && next)
|
|
33
|
+
placement.value = next;
|
|
34
|
+
});
|
|
35
|
+
const clamped = computed(() => placement.value?.height !== void 0);
|
|
36
|
+
watch(rootElement, (element, _previous, onCleanup) => {
|
|
37
|
+
if (!element)
|
|
38
|
+
return;
|
|
39
|
+
const updateHeight = () => {
|
|
40
|
+
if (!clamped.value && !props.leaving)
|
|
41
|
+
emit("resize", element.offsetHeight);
|
|
42
|
+
};
|
|
43
|
+
updateHeight();
|
|
44
|
+
if (typeof ResizeObserver === "undefined")
|
|
45
|
+
return;
|
|
46
|
+
const observer = new ResizeObserver(updateHeight);
|
|
47
|
+
observer.observe(element);
|
|
48
|
+
onCleanup(() => observer.disconnect());
|
|
49
|
+
}, { flush: "post" });
|
|
17
50
|
const icons = useIcons();
|
|
18
51
|
const messages = useMessages();
|
|
19
52
|
const theme = useComponentTheme("toast", toastTheme);
|
|
20
53
|
const themeBindings = useThemeBindings();
|
|
21
54
|
const effectiveColor = computed(() => props.toast.color ? resolveRegisteredColorRole(props.toast.color, "info") : void 0);
|
|
22
|
-
const itemUi = computed(() => theme.value({
|
|
55
|
+
const itemUi = computed(() => theme.value({
|
|
56
|
+
color: effectiveColor.value,
|
|
57
|
+
expand: props.expand,
|
|
58
|
+
position: props.position
|
|
59
|
+
}));
|
|
23
60
|
const rootProps = computed(() => resolveSlot(itemUi.value.root, props.ui?.root));
|
|
61
|
+
const rootBindings = computed(() => ({
|
|
62
|
+
...rootProps.value,
|
|
63
|
+
"data-stack": placement.value?.state,
|
|
64
|
+
"style": [
|
|
65
|
+
themeBindings.value.style,
|
|
66
|
+
placement.value && { transform: placement.value.transform, height: placement.value.height, zIndex: placement.value.zIndex },
|
|
67
|
+
rootProps.value.style
|
|
68
|
+
]
|
|
69
|
+
}));
|
|
24
70
|
const iconProps = computed(() => resolveSlot(itemUi.value.icon, props.ui?.icon));
|
|
25
71
|
const titleProps = computed(() => resolveSlot(itemUi.value.title, props.ui?.title));
|
|
26
72
|
const descriptionProps = computed(() => resolveSlot(itemUi.value.description, props.ui?.description));
|
|
@@ -30,12 +76,13 @@ const iconName = computed(() => props.toast.icon ?? (effectiveColor.value && isF
|
|
|
30
76
|
|
|
31
77
|
<template>
|
|
32
78
|
<ToastRoot
|
|
33
|
-
:
|
|
79
|
+
:ref="setRootElement"
|
|
80
|
+
:duration="toast.duration ?? duration"
|
|
34
81
|
:data-selaras-theme="themeBindings['data-selaras-theme']"
|
|
35
82
|
:data-selaras-mode="themeBindings['data-selaras-mode']"
|
|
36
83
|
:data-selaras-color="effectiveColor"
|
|
37
|
-
:
|
|
38
|
-
v-bind="
|
|
84
|
+
:open="!leaving"
|
|
85
|
+
v-bind="rootBindings"
|
|
39
86
|
@update:open="(open) => !open && emit('remove', toast.id)"
|
|
40
87
|
>
|
|
41
88
|
<Icon v-if="iconName" :name="iconName" v-bind="iconProps" />
|
|
@@ -48,7 +95,7 @@ const iconName = computed(() => props.toast.icon ?? (effectiveColor.value && isF
|
|
|
48
95
|
</ToastDescription>
|
|
49
96
|
</div>
|
|
50
97
|
<ToastClose as-child>
|
|
51
|
-
<Button size="sm" variant="ghost" color="neutral" :icon="icons.close" :aria-label="messages.close" v-bind="closeProps" />
|
|
98
|
+
<Button size="sm" variant="ghost" :color="effectiveColor ?? 'neutral'" :icon="icons.close" :aria-label="messages.close" v-bind="closeProps" />
|
|
52
99
|
</ToastClose>
|
|
53
100
|
</ToastRoot>
|
|
54
101
|
</template>
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import type { ToastThemeSlots } from '../theme/toast.js';
|
|
1
|
+
import type { ToastPosition, ToastThemeSlots } from '../theme/toast.js';
|
|
2
2
|
import type { UiProp } from '../utils/ui.js';
|
|
3
3
|
import type { ToastItem } from './programmatic-services.js';
|
|
4
|
+
import type { ToastStackItem } from './toast-stack.js';
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
toast: ToastItem;
|
|
6
7
|
ui?: UiProp<ToastThemeSlots>;
|
|
8
|
+
duration: number;
|
|
9
|
+
expand: boolean;
|
|
10
|
+
position: ToastPosition;
|
|
11
|
+
placement: ToastStackItem | undefined;
|
|
12
|
+
leaving: boolean;
|
|
7
13
|
};
|
|
8
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
15
|
remove: (id: number) => any;
|
|
16
|
+
resize: (height: number) => any;
|
|
10
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
18
|
onRemove?: ((id: number) => any) | undefined;
|
|
19
|
+
onResize?: ((height: number) => any) | undefined;
|
|
12
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
21
|
declare const _default: typeof __VLS_export;
|
|
14
22
|
export default _default;
|
|
@@ -67,7 +67,8 @@ export function useComboboxSelect(props, emit, { creatable = false } = {}) {
|
|
|
67
67
|
}
|
|
68
68
|
function commitCreatableText(rawText) {
|
|
69
69
|
const text = rawText.trim();
|
|
70
|
-
|
|
70
|
+
const lower = text.toLowerCase();
|
|
71
|
+
if (!creatable || !text || flatOptions.value.some((o) => String(o.value).toLowerCase() === lower || o.label.toLowerCase() === lower))
|
|
71
72
|
return false;
|
|
72
73
|
if (props.multiple) {
|
|
73
74
|
if (selectedValues.value.some((v) => typeof v === "string" && v.toLowerCase() === text.toLowerCase()))
|
|
@@ -60,7 +60,9 @@ export interface ProgrammaticOverlayService<T extends ProgrammaticOverlayInstanc
|
|
|
60
60
|
}
|
|
61
61
|
export interface ToastService {
|
|
62
62
|
toasts: Ref<ToastItem[]>;
|
|
63
|
+
max: Ref<number>;
|
|
63
64
|
nextId: () => number;
|
|
65
|
+
setMax: (max: number) => void;
|
|
64
66
|
remove: (id: number) => void;
|
|
65
67
|
dispose: () => void;
|
|
66
68
|
}
|
|
@@ -42,13 +42,20 @@ export const useDrawerService = createOverlayService();
|
|
|
42
42
|
export const useSlideoverService = createOverlayService();
|
|
43
43
|
const useToastState = createAppScopedState(() => ({
|
|
44
44
|
toasts: ref([]),
|
|
45
|
+
max: ref(5),
|
|
45
46
|
counter: 0
|
|
46
47
|
}));
|
|
47
48
|
export function useToastService() {
|
|
48
49
|
const state = useToastState();
|
|
49
50
|
return {
|
|
50
51
|
toasts: state.toasts,
|
|
52
|
+
max: state.max,
|
|
51
53
|
nextId: () => state.counter++,
|
|
54
|
+
setMax(max) {
|
|
55
|
+
const limit = Number.isFinite(max) ? Math.max(0, Math.floor(max)) : 5;
|
|
56
|
+
state.max.value = limit;
|
|
57
|
+
state.toasts.value = limit > 0 ? state.toasts.value.slice(-limit) : [];
|
|
58
|
+
},
|
|
52
59
|
remove(id) {
|
|
53
60
|
const index = state.toasts.value.findIndex((toast) => toast.id === id);
|
|
54
61
|
if (index !== -1)
|
|
@@ -56,6 +63,7 @@ export function useToastService() {
|
|
|
56
63
|
},
|
|
57
64
|
dispose() {
|
|
58
65
|
state.toasts.value = [];
|
|
66
|
+
state.max.value = 5;
|
|
59
67
|
}
|
|
60
68
|
};
|
|
61
69
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Space between toasts when the stack is expanded. */
|
|
2
|
+
export declare const TOAST_GAP = 12;
|
|
3
|
+
/** How far each stacked toast shows behind the one in front of it. */
|
|
4
|
+
export declare const TOAST_PEEK = 14;
|
|
5
|
+
/** How much smaller each step back in the collapsed stack is drawn. */
|
|
6
|
+
export declare const TOAST_SCALE_STEP = 0.05;
|
|
7
|
+
/** Toasts visible in the collapsed stack, including the front one. */
|
|
8
|
+
export declare const TOAST_VISIBLE_STACKED = 3;
|
|
9
|
+
/** How long a dismissed toast stays mounted so it can animate out. */
|
|
10
|
+
export declare const TOAST_EXIT_DURATION = 300;
|
|
11
|
+
/** Used until a toast has been measured. */
|
|
12
|
+
export declare const FALLBACK_TOAST_HEIGHT = 64;
|
|
13
|
+
export interface ToastStackLayout {
|
|
14
|
+
/** Distance of each toast from the anchored edge when expanded, front toast first. */
|
|
15
|
+
offsets: number[];
|
|
16
|
+
frontHeight: number;
|
|
17
|
+
/** Height the viewport needs to contain the stack. */
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
/** Lays out a stack from each toast's natural height, front (newest) toast first. */
|
|
21
|
+
export declare function layoutToastStack(heights: number[], expanded: boolean): ToastStackLayout;
|
|
22
|
+
/** Where a toast sits in the stack: the newest card, a card peeking behind it, one tucked away, or fanned out. */
|
|
23
|
+
export type ToastStackState = 'front' | 'behind' | 'hidden' | 'expanded';
|
|
24
|
+
export interface ToastStackItem {
|
|
25
|
+
state: ToastStackState;
|
|
26
|
+
transform: string;
|
|
27
|
+
/** Cards behind the front one borrow its height so the stack reads as a neat pile. */
|
|
28
|
+
height: string | undefined;
|
|
29
|
+
zIndex: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Places one toast in the stack. `index` counts from the front (newest)
|
|
33
|
+
* toast; `lift` is -1 when the stack grows upward from the bottom edge and
|
|
34
|
+
* 1 when it grows downward from the top edge.
|
|
35
|
+
*/
|
|
36
|
+
export declare function placeToast(index: number, layout: ToastStackLayout, expanded: boolean, lift: 1 | -1): ToastStackItem;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const TOAST_GAP = 12;
|
|
2
|
+
export const TOAST_PEEK = 14;
|
|
3
|
+
export const TOAST_SCALE_STEP = 0.05;
|
|
4
|
+
export const TOAST_VISIBLE_STACKED = 3;
|
|
5
|
+
export const TOAST_EXIT_DURATION = 300;
|
|
6
|
+
export const FALLBACK_TOAST_HEIGHT = 64;
|
|
7
|
+
export function layoutToastStack(heights, expanded) {
|
|
8
|
+
const offsets = [];
|
|
9
|
+
let offset = 0;
|
|
10
|
+
for (const height2 of heights) {
|
|
11
|
+
offsets.push(offset);
|
|
12
|
+
offset += height2 + TOAST_GAP;
|
|
13
|
+
}
|
|
14
|
+
const frontHeight = heights[0] ?? 0;
|
|
15
|
+
const shown = Math.min(heights.length, TOAST_VISIBLE_STACKED);
|
|
16
|
+
const height = heights.length === 0 ? 0 : expanded ? offset - TOAST_GAP : frontHeight + (shown - 1) * TOAST_PEEK;
|
|
17
|
+
return { offsets, frontHeight, height };
|
|
18
|
+
}
|
|
19
|
+
export function placeToast(index, layout, expanded, lift) {
|
|
20
|
+
const zIndex = layout.offsets.length - index;
|
|
21
|
+
if (expanded) {
|
|
22
|
+
return {
|
|
23
|
+
state: "expanded",
|
|
24
|
+
transform: `translateY(${lift * (layout.offsets[index] ?? 0)}px) scale(1)`,
|
|
25
|
+
height: void 0,
|
|
26
|
+
zIndex
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const depth = Math.min(index, TOAST_VISIBLE_STACKED - 1);
|
|
30
|
+
return {
|
|
31
|
+
state: index === 0 ? "front" : index < TOAST_VISIBLE_STACKED ? "behind" : "hidden",
|
|
32
|
+
transform: `translateY(${lift * depth * TOAST_PEEK}px) scale(${1 - depth * TOAST_SCALE_STEP})`,
|
|
33
|
+
height: index === 0 ? void 0 : `${layout.frontHeight}px`,
|
|
34
|
+
zIndex
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tw-animate-css";@source "./components";@source "./internal";@source "./theme";@source "./utils";@custom-variant dark (&:where(.dark, .dark *));@layer base{a:focus-visible{outline-offset:0}}@keyframes selaras-ripple{to{opacity:0;transform:scale(1)}}@keyframes selaras-accordion-down{0%{height:0}to{height:var(--reka-accordion-content-height)}}@keyframes selaras-accordion-up{0%{height:var(--reka-accordion-content-height)}to{height:0}}@keyframes selaras-collapsible-down{0%{height:0}to{height:var(--reka-collapsible-content-height)}}@keyframes selaras-collapsible-up{0%{height:var(--reka-collapsible-content-height)}to{height:0}}@keyframes selaras-skeleton-shimmer{0%{background-position:150% 0}to{background-position:-50% 0}}@keyframes selaras-progress-indeterminate{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}.selaras-nav-elbow{position:relative}.selaras-nav-elbow:before{inset-inline-start:-16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;width:16px}.selaras-nav-elbow:after,.selaras-nav-elbow:before{background-color:var(--selaras-resolved-border-default);content:"";position:absolute;top:0}.selaras-nav-elbow:after{inset-inline-start:-15px;width:1.5px}.selaras-nav-elbow--content-navigation:before{height:40px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 40'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 14a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 40'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 14a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--content-navigation:after{bottom:-2px}.selaras-nav-elbow--content-navigation:last-child:after{bottom:auto;height:14px}.selaras-nav-elbow--navigation-menu:before{height:32px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 32'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 10a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 32'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 10a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--navigation-menu:after{bottom:-4px}.selaras-nav-elbow--navigation-menu:last-child:after{bottom:auto;height:10px}.selaras-nav-elbow--file-tree:before{height:28px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 28'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 8a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 28'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 8a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--file-tree:after{bottom:-2px}.selaras-nav-elbow--file-tree:last-child:after{bottom:auto;height:8px}@layer theme{:root,[data-selaras-theme]{--selaras-resolved-surface-canvas:var(--selaras-surface-canvas,var(--_selaras-default-surface-canvas));--selaras-resolved-surface-default:var(--selaras-surface-default,var(--_selaras-default-surface-default));--selaras-resolved-surface-elevated:var(--selaras-surface-elevated,var(--_selaras-default-surface-elevated));--selaras-resolved-surface-inverted:var(--selaras-surface-inverted,var(--_selaras-default-surface-inverted));--selaras-resolved-text-default:var(--selaras-text-default,var(--_selaras-default-text-default));--selaras-resolved-text-muted:var(--selaras-text-muted,var(--_selaras-default-text-muted));--selaras-resolved-text-inverted:var(--selaras-text-inverted,var(--_selaras-default-text-inverted));--selaras-resolved-border-default:var(--selaras-border-default,var(--_selaras-default-border-default));--selaras-resolved-border-muted:var(--selaras-border-muted,var(--_selaras-default-border-muted));--selaras-resolved-border-hover:var(--selaras-border-hover,var(--_selaras-default-border-hover));--selaras-resolved-scrim:var(--selaras-scrim,rgba(0,0,0,.5));--selaras-resolved-radius-base:var(--selaras-radius-base,8px);--selaras-resolved-radius-sm:var(--selaras-radius-sm,calc(var(--selaras-resolved-radius-base)*0.75));--selaras-resolved-radius-md:var(--selaras-radius-md,var(--selaras-resolved-radius-base));--selaras-resolved-radius-lg:var(--selaras-radius-lg,calc(var(--selaras-resolved-radius-base)*2));--selaras-resolved-radius-full:var(--selaras-radius-full,9999px);--selaras-resolved-shadow-sm:var(--selaras-shadow-sm,0 1px 2px 0 rgba(0,0,0,.06));--selaras-resolved-shadow-md:var(--selaras-shadow-md,0 4px 16px -2px rgba(0,0,0,.12));--selaras-resolved-shadow-lg:var(--selaras-shadow-lg,0 12px 32px -4px rgba(0,0,0,.16));--selaras-resolved-z-modal-overlay:var(--selaras-z-modal-overlay,40);--selaras-resolved-z-modal:var(--selaras-z-modal,50);--selaras-resolved-z-dropdown:var(--selaras-z-dropdown,60);--selaras-resolved-z-tooltip:var(--selaras-z-tooltip,70);--selaras-resolved-z-toast:var(--selaras-z-toast,80)}:root.dark,:root.dark [data-selaras-theme]:where(:not([data-selaras-mode]),[data-selaras-mode=root]),[data-selaras-theme]:where([data-selaras-mode=dark]){--selaras-resolved-surface-canvas:var(--selaras-surface-canvas,var(--_selaras-default-surface-canvas));--selaras-resolved-surface-default:var(--selaras-surface-default,var(--_selaras-default-surface-default));--selaras-resolved-surface-elevated:var(--selaras-surface-elevated,var(--_selaras-default-surface-elevated));--selaras-resolved-surface-inverted:var(--selaras-surface-inverted,var(--_selaras-default-surface-inverted));--selaras-resolved-text-default:var(--selaras-text-default,var(--_selaras-default-text-default));--selaras-resolved-text-muted:var(--selaras-text-muted,var(--_selaras-default-text-muted));--selaras-resolved-text-inverted:var(--selaras-text-inverted,var(--_selaras-default-text-inverted));--selaras-resolved-border-default:var(--selaras-border-default,var(--_selaras-default-border-default));--selaras-resolved-border-muted:var(--selaras-border-muted,var(--_selaras-default-border-muted));--selaras-resolved-border-hover:var(--selaras-border-hover,var(--_selaras-default-border-hover))}}
|
|
1
|
+
@import "tw-animate-css";@source "./components";@source "./internal";@source "./theme";@source "./utils";@custom-variant dark (&:where(.dark, .dark *));@layer base{a:focus-visible{outline-offset:0}}@keyframes selaras-ripple{to{opacity:0;transform:scale(1)}}@keyframes selaras-accordion-down{0%{height:0}to{height:var(--reka-accordion-content-height)}}@keyframes selaras-accordion-up{0%{height:var(--reka-accordion-content-height)}to{height:0}}@keyframes selaras-collapsible-down{0%{height:0}to{height:var(--reka-collapsible-content-height)}}@keyframes selaras-collapsible-up{0%{height:var(--reka-collapsible-content-height)}to{height:0}}@keyframes selaras-toast-in{0%{opacity:0;translate:0 calc(var(--_selaras-toast-lift, -1)*-100%)}}@keyframes selaras-toast-out{to{opacity:0;translate:0 calc(var(--_selaras-toast-lift, -1)*var(--_selaras-toast-exit, -100%))}}@keyframes selaras-skeleton-shimmer{0%{background-position:150% 0}to{background-position:-50% 0}}@keyframes selaras-progress-indeterminate{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}.selaras-nav-elbow{position:relative}.selaras-nav-elbow:before{inset-inline-start:-16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;width:16px}.selaras-nav-elbow:after,.selaras-nav-elbow:before{background-color:var(--selaras-resolved-border-default);content:"";position:absolute;top:0}.selaras-nav-elbow:after{inset-inline-start:-15px;width:1.5px}.selaras-nav-elbow--content-navigation:before{height:40px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 40'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 14a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 40'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 14a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--content-navigation:after{bottom:-2px}.selaras-nav-elbow--content-navigation:last-child:after{bottom:auto;height:14px}.selaras-nav-elbow--navigation-menu:before{height:32px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 32'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 10a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 32'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 10a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--navigation-menu:after{bottom:-4px}.selaras-nav-elbow--navigation-menu:last-child:after{bottom:auto;height:10px}.selaras-nav-elbow--file-tree:before{height:28px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 28'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 8a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 28'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M1 8a6 6 0 0 0 6 6h7'/%3E%3C/svg%3E")}.selaras-nav-elbow--file-tree:after{bottom:-2px}.selaras-nav-elbow--file-tree:last-child:after{bottom:auto;height:8px}@layer theme{:root,[data-selaras-theme]{--selaras-resolved-surface-canvas:var(--selaras-surface-canvas,var(--_selaras-default-surface-canvas));--selaras-resolved-surface-default:var(--selaras-surface-default,var(--_selaras-default-surface-default));--selaras-resolved-surface-elevated:var(--selaras-surface-elevated,var(--_selaras-default-surface-elevated));--selaras-resolved-surface-inverted:var(--selaras-surface-inverted,var(--_selaras-default-surface-inverted));--selaras-resolved-text-default:var(--selaras-text-default,var(--_selaras-default-text-default));--selaras-resolved-text-muted:var(--selaras-text-muted,var(--_selaras-default-text-muted));--selaras-resolved-text-inverted:var(--selaras-text-inverted,var(--_selaras-default-text-inverted));--selaras-resolved-border-default:var(--selaras-border-default,var(--_selaras-default-border-default));--selaras-resolved-border-muted:var(--selaras-border-muted,var(--_selaras-default-border-muted));--selaras-resolved-border-hover:var(--selaras-border-hover,var(--_selaras-default-border-hover));--selaras-resolved-scrim:var(--selaras-scrim,rgba(0,0,0,.5));--selaras-resolved-radius-base:var(--selaras-radius-base,8px);--selaras-resolved-radius-sm:var(--selaras-radius-sm,calc(var(--selaras-resolved-radius-base)*0.75));--selaras-resolved-radius-md:var(--selaras-radius-md,var(--selaras-resolved-radius-base));--selaras-resolved-radius-lg:var(--selaras-radius-lg,calc(var(--selaras-resolved-radius-base)*2));--selaras-resolved-radius-full:var(--selaras-radius-full,9999px);--selaras-resolved-shadow-sm:var(--selaras-shadow-sm,0 1px 2px 0 rgba(0,0,0,.06));--selaras-resolved-shadow-md:var(--selaras-shadow-md,0 4px 16px -2px rgba(0,0,0,.12));--selaras-resolved-shadow-lg:var(--selaras-shadow-lg,0 12px 32px -4px rgba(0,0,0,.16));--selaras-resolved-z-modal-overlay:var(--selaras-z-modal-overlay,40);--selaras-resolved-z-modal:var(--selaras-z-modal,50);--selaras-resolved-z-dropdown:var(--selaras-z-dropdown,60);--selaras-resolved-z-tooltip:var(--selaras-z-tooltip,70);--selaras-resolved-z-toast:var(--selaras-z-toast,80)}:root.dark,:root.dark [data-selaras-theme]:where(:not([data-selaras-mode]),[data-selaras-mode=root]),[data-selaras-theme]:where([data-selaras-mode=dark]){--selaras-resolved-scrim:var(--selaras-scrim,hsla(0,0%,100%,.05));--selaras-resolved-surface-canvas:var(--selaras-surface-canvas,var(--_selaras-default-surface-canvas));--selaras-resolved-surface-default:var(--selaras-surface-default,var(--_selaras-default-surface-default));--selaras-resolved-surface-elevated:var(--selaras-surface-elevated,var(--_selaras-default-surface-elevated));--selaras-resolved-surface-inverted:var(--selaras-surface-inverted,var(--_selaras-default-surface-inverted));--selaras-resolved-text-default:var(--selaras-text-default,var(--_selaras-default-text-default));--selaras-resolved-text-muted:var(--selaras-text-muted,var(--_selaras-default-text-muted));--selaras-resolved-text-inverted:var(--selaras-text-inverted,var(--_selaras-default-text-inverted));--selaras-resolved-border-default:var(--selaras-border-default,var(--_selaras-default-border-default));--selaras-resolved-border-muted:var(--selaras-border-muted,var(--_selaras-default-border-muted));--selaras-resolved-border-hover:var(--selaras-border-hover,var(--_selaras-default-border-hover))}}.selaras-code-tree-code span{color:var(--shiki-light)}.selaras-code-tree-code:where([data-selaras-code-mode=dark]) span,:root.dark .selaras-code-tree-code:where([data-selaras-code-mode=root]) span{color:var(--shiki-dark)}
|
package/dist/runtime/table.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { TableColumnDef, TableColumnVisibilityState, TableExpandedState, TableGetRowId, TableRowSelectionState, TableSortingState } from './composables/use-table.js';
|
|
1
|
+
export type { TableColumnDef, TableColumnVisibilityState, TableExpandedState, TableGetRowId, TableGetSubRows, TableRowSelectionState, TableSortingState } from './composables/use-table.js';
|
|
2
2
|
export { createTableColumnHelper } from './composables/use-table.js';
|
|
3
3
|
export type { TableEmits, TableProps, TableSlots } from './utils/table-contracts.js';
|
|
@@ -5,7 +5,7 @@ export const alertDialogTheme = tv({
|
|
|
5
5
|
// same kind of centered, blocking surface, just a distinct semantic
|
|
6
6
|
// (Reka's AlertDialogContent unconditionally blocks outside-click
|
|
7
7
|
// dismissal itself, so there's no need for a second z-index tier).
|
|
8
|
-
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)]",
|
|
8
|
+
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)] backdrop-blur-[2px]",
|
|
9
9
|
content: "fixed left-1/2 top-1/2 z-[var(--selaras-resolved-z-modal)] flex max-h-[calc(100vh-2rem)] w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-[var(--selaras-resolved-radius-lg)] bg-[var(--selaras-resolved-surface-default)] p-6 shadow-[var(--selaras-resolved-shadow-lg)] focus:outline-none",
|
|
10
10
|
header: "flex flex-col gap-1",
|
|
11
11
|
title: "text-base font-semibold text-[var(--selaras-resolved-text-default)]",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const calendarTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
[key: string]: {
|
|
3
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
4
|
+
root?: import("tailwind-variants").ClassValue;
|
|
5
|
+
header?: import("tailwind-variants").ClassValue;
|
|
6
|
+
footer?: import("tailwind-variants").ClassValue;
|
|
7
|
+
heading?: import("tailwind-variants").ClassValue;
|
|
8
|
+
grids?: import("tailwind-variants").ClassValue;
|
|
9
|
+
grid?: import("tailwind-variants").ClassValue;
|
|
10
|
+
gridHead?: import("tailwind-variants").ClassValue;
|
|
11
|
+
headCell?: import("tailwind-variants").ClassValue;
|
|
12
|
+
cell?: import("tailwind-variants").ClassValue;
|
|
13
|
+
dayButton?: import("tailwind-variants").ClassValue;
|
|
14
|
+
dayDetails?: import("tailwind-variants").ClassValue;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: {
|
|
19
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
20
|
+
root?: import("tailwind-variants").ClassValue;
|
|
21
|
+
header?: import("tailwind-variants").ClassValue;
|
|
22
|
+
footer?: import("tailwind-variants").ClassValue;
|
|
23
|
+
heading?: import("tailwind-variants").ClassValue;
|
|
24
|
+
grids?: import("tailwind-variants").ClassValue;
|
|
25
|
+
grid?: import("tailwind-variants").ClassValue;
|
|
26
|
+
gridHead?: import("tailwind-variants").ClassValue;
|
|
27
|
+
headCell?: import("tailwind-variants").ClassValue;
|
|
28
|
+
cell?: import("tailwind-variants").ClassValue;
|
|
29
|
+
dayButton?: import("tailwind-variants").ClassValue;
|
|
30
|
+
dayDetails?: import("tailwind-variants").ClassValue;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} | {}, {
|
|
34
|
+
root: string;
|
|
35
|
+
header: string;
|
|
36
|
+
heading: string;
|
|
37
|
+
grids: string;
|
|
38
|
+
grid: string;
|
|
39
|
+
gridHead: string;
|
|
40
|
+
headCell: string;
|
|
41
|
+
cell: string;
|
|
42
|
+
dayButton: string;
|
|
43
|
+
dayDetails: string;
|
|
44
|
+
footer: string;
|
|
45
|
+
}, undefined, {
|
|
46
|
+
[key: string]: {
|
|
47
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
48
|
+
root?: import("tailwind-variants").ClassValue;
|
|
49
|
+
header?: import("tailwind-variants").ClassValue;
|
|
50
|
+
footer?: import("tailwind-variants").ClassValue;
|
|
51
|
+
heading?: import("tailwind-variants").ClassValue;
|
|
52
|
+
grids?: import("tailwind-variants").ClassValue;
|
|
53
|
+
grid?: import("tailwind-variants").ClassValue;
|
|
54
|
+
gridHead?: import("tailwind-variants").ClassValue;
|
|
55
|
+
headCell?: import("tailwind-variants").ClassValue;
|
|
56
|
+
cell?: import("tailwind-variants").ClassValue;
|
|
57
|
+
dayButton?: import("tailwind-variants").ClassValue;
|
|
58
|
+
dayDetails?: import("tailwind-variants").ClassValue;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
} | {}, {
|
|
62
|
+
root: string;
|
|
63
|
+
header: string;
|
|
64
|
+
heading: string;
|
|
65
|
+
grids: string;
|
|
66
|
+
grid: string;
|
|
67
|
+
gridHead: string;
|
|
68
|
+
headCell: string;
|
|
69
|
+
cell: string;
|
|
70
|
+
dayButton: string;
|
|
71
|
+
dayDetails: string;
|
|
72
|
+
footer: string;
|
|
73
|
+
}, import("tailwind-variants").TVReturnTypeLike<unknown, {
|
|
74
|
+
root: string;
|
|
75
|
+
header: string;
|
|
76
|
+
heading: string;
|
|
77
|
+
grids: string;
|
|
78
|
+
grid: string;
|
|
79
|
+
gridHead: string;
|
|
80
|
+
headCell: string;
|
|
81
|
+
cell: string;
|
|
82
|
+
dayButton: string;
|
|
83
|
+
dayDetails: string;
|
|
84
|
+
footer: string;
|
|
85
|
+
}>>;
|
|
86
|
+
export type CalendarThemeSlots = keyof (typeof calendarTheme)['slots'];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const calendarTheme = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: "inline-block",
|
|
5
|
+
header: "mb-2 flex items-center justify-between gap-2",
|
|
6
|
+
heading: "text-sm font-medium text-[var(--selaras-resolved-text-default)]",
|
|
7
|
+
grids: "flex flex-col gap-4 sm:flex-row",
|
|
8
|
+
// Give each month an intrinsic compact width. A percentage width here
|
|
9
|
+
// expands the inline-block root to its entire container. The fixed table
|
|
10
|
+
// layout keeps all seven columns equal even with day-details content.
|
|
11
|
+
grid: "w-72 table-fixed border-collapse",
|
|
12
|
+
gridHead: "",
|
|
13
|
+
headCell: "w-[14.285714%] h-8 text-xs font-medium text-[var(--selaras-resolved-text-muted)]",
|
|
14
|
+
cell: "p-0.5 text-center align-top",
|
|
15
|
+
dayButton: "relative data-[today]:font-semibold data-[today]:after:absolute data-[today]:after:bottom-1 data-[today]:after:left-1/2 data-[today]:after:size-1 data-[today]:after:-translate-x-1/2 data-[today]:after:rounded-full data-[today]:after:bg-[var(--_selaras-color-fill)] data-[outside-view]:opacity-40 data-[unavailable]:opacity-40 data-[unavailable]:line-through",
|
|
16
|
+
dayDetails: "min-w-0",
|
|
17
|
+
footer: "mt-3"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
export declare const calloutTheme: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
type: {
|
|
3
3
|
note: {
|
|
4
|
-
root: string;
|
|
5
4
|
icon: string;
|
|
6
5
|
};
|
|
7
6
|
tip: {
|
|
8
|
-
root: string;
|
|
9
7
|
icon: string;
|
|
10
8
|
};
|
|
11
9
|
warning: {
|
|
12
|
-
root: string;
|
|
13
10
|
icon: string;
|
|
14
11
|
};
|
|
15
12
|
danger: {
|
|
16
|
-
root: string;
|
|
17
13
|
icon: string;
|
|
18
14
|
};
|
|
19
15
|
};
|
|
@@ -25,19 +21,15 @@ export declare const calloutTheme: import("tailwind-variants").TVReturnType<{
|
|
|
25
21
|
}, undefined, {
|
|
26
22
|
type: {
|
|
27
23
|
note: {
|
|
28
|
-
root: string;
|
|
29
24
|
icon: string;
|
|
30
25
|
};
|
|
31
26
|
tip: {
|
|
32
|
-
root: string;
|
|
33
27
|
icon: string;
|
|
34
28
|
};
|
|
35
29
|
warning: {
|
|
36
|
-
root: string;
|
|
37
30
|
icon: string;
|
|
38
31
|
};
|
|
39
32
|
danger: {
|
|
40
|
-
root: string;
|
|
41
33
|
icon: string;
|
|
42
34
|
};
|
|
43
35
|
};
|
|
@@ -49,19 +41,15 @@ export declare const calloutTheme: import("tailwind-variants").TVReturnType<{
|
|
|
49
41
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
50
42
|
type: {
|
|
51
43
|
note: {
|
|
52
|
-
root: string;
|
|
53
44
|
icon: string;
|
|
54
45
|
};
|
|
55
46
|
tip: {
|
|
56
|
-
root: string;
|
|
57
47
|
icon: string;
|
|
58
48
|
};
|
|
59
49
|
warning: {
|
|
60
|
-
root: string;
|
|
61
50
|
icon: string;
|
|
62
51
|
};
|
|
63
52
|
danger: {
|
|
64
|
-
root: string;
|
|
65
53
|
icon: string;
|
|
66
54
|
};
|
|
67
55
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const calloutTheme = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
root: "flex gap-3 rounded-[var(--selaras-resolved-radius-md)]
|
|
4
|
+
// Match Alert's soft surface by default. A masked pseudo-element draws
|
|
5
|
+
// the striped accent over the edge on hover or focus within without
|
|
6
|
+
// changing the box's size or the content's padding.
|
|
7
|
+
root: "relative flex items-start gap-3 rounded-[var(--selaras-resolved-radius-md)] bg-[var(--_selaras-color-subtle)] p-4 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-[repeating-linear-gradient(135deg,var(--_selaras-color-border)_0_2px,transparent_2px_4px)] before:p-0.5 before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-100 focus-within:before:opacity-100",
|
|
8
8
|
icon: "mt-0.5 size-5 shrink-0",
|
|
9
9
|
content: "min-w-0 flex-1 text-sm text-[var(--selaras-resolved-text-muted)] [&>:first-child]:mt-0 [&>:last-child]:mb-0",
|
|
10
10
|
title: "font-medium text-[var(--selaras-resolved-text-default)]"
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
type: {
|
|
14
|
-
note: {
|
|
15
|
-
tip: {
|
|
16
|
-
warning: {
|
|
17
|
-
danger: {
|
|
14
|
+
note: { icon: "text-[var(--_selaras-color-text)]" },
|
|
15
|
+
tip: { icon: "text-[var(--_selaras-color-text)]" },
|
|
16
|
+
warning: { icon: "text-[var(--_selaras-color-text)]" },
|
|
17
|
+
danger: { icon: "text-[var(--_selaras-color-text)]" }
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
@@ -5,7 +5,7 @@ export const codeTreeTheme = tv({
|
|
|
5
5
|
// FileTree's own root box (border/bg/padding) is stripped via its :ui
|
|
6
6
|
// override below - this wrapper provides that framing instead, so the
|
|
7
7
|
// two panels read as one split view rather than a box inside a box.
|
|
8
|
-
tree: "w-56 shrink-0 overflow-auto border-e border-[var(--selaras-resolved-border-default)] p-2",
|
|
8
|
+
tree: "w-56 shrink-0 overflow-auto border-e border-[var(--selaras-resolved-border-default)] bg-[var(--selaras-resolved-surface-elevated)] p-2",
|
|
9
9
|
content: "min-w-0 flex-1 overflow-auto p-4",
|
|
10
10
|
pre: "whitespace-pre font-mono text-sm text-[var(--selaras-resolved-text-default)]",
|
|
11
11
|
empty: "flex flex-1 items-center justify-center p-4 text-center text-sm text-[var(--selaras-resolved-text-muted)]"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const commandPaletteTheme = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
4
|
+
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)] backdrop-blur-[2px] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
5
5
|
// Top-anchored (not vertically centered like Modal) - the conventional
|
|
6
6
|
// command-palette position, and it means the dialog doesn't visibly
|
|
7
7
|
// jump up and down as the result list grows/shrinks while typing.
|
|
@@ -20,6 +20,7 @@ export declare const contentNavigationTheme: import("tailwind-variants").TVRetur
|
|
|
20
20
|
linkActive: string;
|
|
21
21
|
trigger: string;
|
|
22
22
|
icon: string;
|
|
23
|
+
badge: string;
|
|
23
24
|
chevron: string;
|
|
24
25
|
content: string;
|
|
25
26
|
}, undefined, {
|
|
@@ -44,6 +45,7 @@ export declare const contentNavigationTheme: import("tailwind-variants").TVRetur
|
|
|
44
45
|
linkActive: string;
|
|
45
46
|
trigger: string;
|
|
46
47
|
icon: string;
|
|
48
|
+
badge: string;
|
|
47
49
|
chevron: string;
|
|
48
50
|
content: string;
|
|
49
51
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
@@ -68,6 +70,7 @@ export declare const contentNavigationTheme: import("tailwind-variants").TVRetur
|
|
|
68
70
|
linkActive: string;
|
|
69
71
|
trigger: string;
|
|
70
72
|
icon: string;
|
|
73
|
+
badge: string;
|
|
71
74
|
chevron: string;
|
|
72
75
|
content: string;
|
|
73
76
|
}>>;
|
|
@@ -12,6 +12,7 @@ export const contentNavigationTheme = tv({
|
|
|
12
12
|
// A separate slot from label - this styles the icon a link/group-header
|
|
13
13
|
// shows before its title, not the title text itself.
|
|
14
14
|
icon: "size-4 shrink-0 text-[var(--selaras-resolved-text-muted)]",
|
|
15
|
+
badge: "ms-auto inline-flex shrink-0 items-center rounded-full bg-[var(--selaras-resolved-surface-elevated)] px-2 py-0.5 text-xs font-medium text-[var(--selaras-resolved-text-muted)]",
|
|
15
16
|
chevron: "size-4 shrink-0 text-[var(--selaras-resolved-text-muted)] transition-transform group-data-[state=open]:rotate-180",
|
|
16
17
|
// `ps-4` (16px) reserves the gutter each child's own trunk segment
|
|
17
18
|
// and elbow (on the `item` slot above) reach back into - the trunk
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const drawerTheme = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)]",
|
|
4
|
+
overlay: "fixed inset-0 z-[var(--selaras-resolved-z-modal-overlay)] bg-[var(--selaras-resolved-scrim)] backdrop-blur-[2px]",
|
|
5
5
|
content: "fixed z-[var(--selaras-resolved-z-modal)] flex flex-col bg-[var(--selaras-resolved-surface-default)] shadow-[var(--selaras-resolved-shadow-lg)] focus:outline-none",
|
|
6
6
|
// A small rounded grip bar - purely visual, signals "draggable" the
|
|
7
7
|
// same way a real bottom sheet's handle does. Centered via the
|
|
@@ -5,12 +5,19 @@ export declare const dropdownTheme: import("tailwind-variants").TVReturnType<{
|
|
|
5
5
|
icon: string;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
+
mobile: {
|
|
9
|
+
true: {
|
|
10
|
+
item: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
8
13
|
}, {
|
|
9
14
|
content: string;
|
|
10
15
|
item: string;
|
|
11
16
|
icon: string;
|
|
12
17
|
separator: string;
|
|
13
18
|
arrow: string;
|
|
19
|
+
mobileList: string;
|
|
20
|
+
mobileGroup: string;
|
|
14
21
|
}, undefined, {
|
|
15
22
|
destructive: {
|
|
16
23
|
true: {
|
|
@@ -18,12 +25,19 @@ export declare const dropdownTheme: import("tailwind-variants").TVReturnType<{
|
|
|
18
25
|
icon: string;
|
|
19
26
|
};
|
|
20
27
|
};
|
|
28
|
+
mobile: {
|
|
29
|
+
true: {
|
|
30
|
+
item: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
21
33
|
}, {
|
|
22
34
|
content: string;
|
|
23
35
|
item: string;
|
|
24
36
|
icon: string;
|
|
25
37
|
separator: string;
|
|
26
38
|
arrow: string;
|
|
39
|
+
mobileList: string;
|
|
40
|
+
mobileGroup: string;
|
|
27
41
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
28
42
|
destructive: {
|
|
29
43
|
true: {
|
|
@@ -31,11 +45,18 @@ export declare const dropdownTheme: import("tailwind-variants").TVReturnType<{
|
|
|
31
45
|
icon: string;
|
|
32
46
|
};
|
|
33
47
|
};
|
|
48
|
+
mobile: {
|
|
49
|
+
true: {
|
|
50
|
+
item: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
34
53
|
}, {
|
|
35
54
|
content: string;
|
|
36
55
|
item: string;
|
|
37
56
|
icon: string;
|
|
38
57
|
separator: string;
|
|
39
58
|
arrow: string;
|
|
59
|
+
mobileList: string;
|
|
60
|
+
mobileGroup: string;
|
|
40
61
|
}>>;
|
|
41
62
|
export type DropdownThemeSlots = keyof (typeof dropdownTheme)['slots'];
|