@vizejs/ui 0.443.0 → 0.457.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/README.md +31 -0
- package/dist/accordion.d.mts +1 -1
- package/dist/action-sheet.d.mts +1 -1
- package/dist/alert-dialog.d.mts +1 -1
- package/dist/{announcer-D0bFq-HV.d.mts → announcer-DunfmMGR.d.mts} +3352 -2953
- package/dist/announcer.d.mts +1 -1
- package/dist/app-bar-kKBZ3G2y.mjs +172 -0
- package/dist/app-bar-yxtiYseG.d.mts +103 -0
- package/dist/app-bar.d.mts +2 -0
- package/dist/app-bar.mjs +2 -0
- package/dist/autocomplete.d.mts +1 -1
- package/dist/avatar.d.mts +1 -1
- package/dist/badge.d.mts +1 -1
- package/dist/banner.d.mts +1 -1
- package/dist/block-ui.d.mts +1 -1
- package/dist/blockquote.d.mts +1 -1
- package/dist/{breadcrumb-DJIZ3zDG.d.mts → breadcrumb-Cdyh20z-.d.mts} +1 -1
- package/dist/breadcrumb.d.mts +1 -1
- package/dist/{calendar-C_ihbcsR.mjs → calendar-BaK_yoKC.mjs} +3 -3
- package/dist/{calendar-root-Dy3WPuNT.mjs → calendar-root-Bl1sv8qy.mjs} +2 -2
- package/dist/calendar.d.mts +1 -1
- package/dist/calendar.mjs +2 -2
- package/dist/callout.d.mts +1 -1
- package/dist/card.d.mts +1 -1
- package/dist/catalog.d.mts +69 -1
- package/dist/catalog.mjs +275 -119
- package/dist/chart.d.mts +1 -1
- package/dist/checkbox.d.mts +1 -1
- package/dist/code.d.mts +1 -1
- package/dist/collapsible.d.mts +1 -1
- package/dist/color-picker.d.mts +1 -1
- package/dist/combobox.d.mts +1 -1
- package/dist/command-palette.d.mts +1 -1
- package/dist/confirm.d.mts +1 -1
- package/dist/context-menu.d.mts +1 -1
- package/dist/copy-button.d.mts +1 -1
- package/dist/{date-picker-Bwt03r8S.mjs → date-picker-BsYXMErN.mjs} +1 -1
- package/dist/date-picker.mjs +1 -1
- package/dist/{date-range-picker-BBHrOLAU.mjs → date-range-picker-H2q9rFOA.mjs} +1 -1
- package/dist/date-range-picker.d.mts +1 -1
- package/dist/date-range-picker.mjs +1 -1
- package/dist/dialog.d.mts +1 -1
- package/dist/direction.d.mts +1 -1
- package/dist/drawer.d.mts +1 -1
- package/dist/dropdown-menu.d.mts +1 -1
- package/dist/{duration-field-BmykCKTC.mjs → duration-field-DowlJQvz.mjs} +3 -3
- package/dist/duration-field.d.mts +1 -1
- package/dist/duration-field.mjs +1 -1
- package/dist/empty-state.d.mts +1 -1
- package/dist/fieldset.d.mts +1 -1
- package/dist/file-upload.d.mts +1 -1
- package/dist/floating-action-button.d.mts +1 -1
- package/dist/focus-visible.d.mts +1 -1
- package/dist/{form-wizard-mErOrBg3.d.mts → form-wizard-D_B-Cydo.d.mts} +2 -2
- package/dist/form-wizard.d.mts +1 -1
- package/dist/fullscreen-button.d.mts +1 -1
- package/dist/heading.d.mts +1 -1
- package/dist/hover-card.d.mts +1 -1
- package/dist/icon-button.d.mts +1 -1
- package/dist/icon.d.mts +1 -1
- package/dist/{image-D9CEf8uD.d.mts → image-DCQeTHqi.d.mts} +2 -2
- package/dist/{image-cropper-BJsgLDjH.d.mts → image-cropper-BPAHa995.d.mts} +2 -2
- package/dist/image-cropper.d.mts +1 -1
- package/dist/image.d.mts +1 -1
- package/dist/index.d.mts +99 -98
- package/dist/index.mjs +15 -12
- package/dist/{input-C0fgeRnS.d.mts → input-D4Zvmf67.d.mts} +2 -2
- package/dist/input.d.mts +1 -1
- package/dist/kbd.d.mts +1 -1
- package/dist/landmark.d.mts +1 -1
- package/dist/list.d.mts +1 -1
- package/dist/listbox.d.mts +1 -1
- package/dist/locale.d.mts +1 -1
- package/dist/media-preferences.d.mts +1 -1
- package/dist/menu.d.mts +1 -1
- package/dist/menubar.d.mts +1 -1
- package/dist/{meter-ZZIKQTLX.mjs → meter-CxHgTYvs.mjs} +3 -2
- package/dist/{meter-B3m17_8g.d.mts → meter-LxMMvjjK.d.mts} +8 -1
- package/dist/meter.d.mts +1 -1
- package/dist/meter.mjs +1 -1
- package/dist/month-picker.d.mts +1 -1
- package/dist/native-select.d.mts +1 -1
- package/dist/navigation-rail-BBg5bin7.mjs +246 -0
- package/dist/navigation-rail.d.mts +2 -0
- package/dist/navigation-rail.mjs +2 -0
- package/dist/notification-center.d.mts +1 -1
- package/dist/pager.d.mts +1 -1
- package/dist/pagination.d.mts +1 -1
- package/dist/popconfirm.d.mts +1 -1
- package/dist/popover.d.mts +1 -1
- package/dist/print-button.d.mts +1 -1
- package/dist/{progress-bar-lXHO-U8x.mjs → progress-bar-DsH4Jgn2.mjs} +3 -1
- package/dist/progress-bar.d.mts +1 -1
- package/dist/progress-bar.mjs +1 -1
- package/dist/radio-group.d.mts +1 -1
- package/dist/{range-calendar-root-CEhaPJAd.mjs → range-calendar-root-D9ZoZkWc.mjs} +2 -2
- package/dist/range-calendar.mjs +1 -1
- package/dist/resolver.d.mts +25 -1
- package/dist/resolver.mjs +25 -1
- package/dist/scroll-area.d.mts +1 -1
- package/dist/{search-field-zyMCYvZ2.d.mts → search-field-DzW31UHM.d.mts} +4 -4
- package/dist/search-field.d.mts +1 -1
- package/dist/select.d.mts +1 -1
- package/dist/share-button.d.mts +1 -1
- package/dist/sidebar.d.mts +1 -1
- package/dist/split-button-Cff_lsza.mjs +339 -0
- package/dist/split-button.d.mts +2 -0
- package/dist/split-button.mjs +3 -0
- package/dist/splitter.d.mts +1 -1
- package/dist/status-light.d.mts +1 -1
- package/dist/stepper.d.mts +1 -1
- package/dist/surface.d.mts +1 -1
- package/dist/switch.d.mts +1 -1
- package/dist/tabs.d.mts +1 -1
- package/dist/tags-input.d.mts +1 -1
- package/dist/text.d.mts +1 -1
- package/dist/{textarea-4eIDNcvv.d.mts → textarea-D7V5lLPX.d.mts} +2 -2
- package/dist/textarea.d.mts +1 -1
- package/dist/toggle.d.mts +1 -1
- package/dist/tooltip.d.mts +1 -1
- package/dist/tour.d.mts +1 -1
- package/dist/tree.d.mts +1 -1
- package/dist/{week-picker-BUduCITx.mjs → week-picker-Ce2qvuBO.mjs} +2 -2
- package/dist/week-picker.d.mts +1 -1
- package/dist/week-picker.mjs +1 -1
- package/package.json +21 -5
- package/registry/files/families/actions/split-button/examples/split-button-basic.vue +35 -0
- package/registry/files/families/actions/split-button/split-button-action.vue +102 -0
- package/registry/files/families/actions/split-button/split-button-context.ts +17 -0
- package/registry/files/families/actions/split-button/split-button-root.vue +191 -0
- package/registry/files/families/actions/split-button/split-button-trigger.vue +140 -0
- package/registry/files/families/actions/split-button/split-button-types.ts +40 -0
- package/registry/files/families/actions/split-button/split-button.ts +40 -0
- package/registry/files/families/date-time/calendar/calendar-multiple-root.vue +2 -2
- package/registry/files/families/date-time/calendar/calendar-root.vue +2 -2
- package/registry/files/families/date-time/duration-field/duration-field.vue +3 -3
- package/registry/files/families/date-time/range-calendar/range-calendar-root.vue +2 -2
- package/registry/files/families/date-time/week-picker/week-picker-root.vue +2 -2
- package/registry/files/families/feedback/meter/meter-state.ts +10 -2
- package/registry/files/families/feedback/meter/meter-types.ts +4 -1
- package/registry/files/families/feedback/meter/meter.vue +2 -0
- package/registry/files/families/feedback/progress-bar/progress-bar-state.ts +11 -1
- package/registry/files/families/feedback/progress-bar/progress-bar-types.ts +6 -2
- package/registry/files/families/feedback/progress-bar/progress-bar.vue +6 -1
- package/registry/files/families/menus/menu/menu-types.ts +1 -1
- package/registry/files/families/navigation/app-bar/app-bar-types.ts +32 -0
- package/registry/files/families/navigation/app-bar/app-bar.ts +3 -0
- package/registry/files/families/navigation/app-bar/app-bar.vue +215 -0
- package/registry/files/families/navigation/app-bar/examples/app-bar-basic.vue +21 -0
- package/registry/files/families/navigation/navigation-rail/examples/navigation-rail-basic.vue +21 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail-context.ts +17 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail-item.vue +89 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail-toggle.vue +50 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail-types.ts +23 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail.ts +11 -0
- package/registry/files/families/navigation/navigation-rail/navigation-rail.vue +156 -0
- package/registry/registry.json +450 -238
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<script setup lang="ts" generic="Value extends string">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import type { ComputedRef } from "vue";
|
|
4
|
+
|
|
5
|
+
import { useControllableState } from "../../foundations/controllable-state/controllable-state.ts";
|
|
6
|
+
import { useDeterministicId } from "../../foundations/id/deterministic-id.ts";
|
|
7
|
+
import { navigationRailContext } from "./navigation-rail-context.ts";
|
|
8
|
+
import type { NavigationRailExpose, NavigationRailSlotState } from "./navigation-rail-types.ts";
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
destinations,
|
|
12
|
+
id = undefined,
|
|
13
|
+
modelValue = undefined,
|
|
14
|
+
defaultValue = undefined,
|
|
15
|
+
expanded = undefined,
|
|
16
|
+
defaultExpanded = false,
|
|
17
|
+
ariaLabel = "Primary",
|
|
18
|
+
ariaLabelledby = undefined,
|
|
19
|
+
} = defineProps<{
|
|
20
|
+
/**
|
|
21
|
+
* Destination values in order; their literal union types `v-model` and `select`.
|
|
22
|
+
*
|
|
23
|
+
* @default required
|
|
24
|
+
*/
|
|
25
|
+
readonly destinations: readonly Value[];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Consumer-owned id. `null` and `undefined` select a deterministic fallback.
|
|
29
|
+
*
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
readonly id?: string | null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Controlled active destination. `undefined` selects uncontrolled behavior.
|
|
36
|
+
*
|
|
37
|
+
* @default undefined
|
|
38
|
+
*/
|
|
39
|
+
readonly modelValue?: Value;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Initial uncontrolled destination.
|
|
43
|
+
*
|
|
44
|
+
* @default undefined
|
|
45
|
+
*/
|
|
46
|
+
readonly defaultValue?: Value;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Controlled expanded state. `undefined` selects uncontrolled behavior.
|
|
50
|
+
*
|
|
51
|
+
* @default undefined
|
|
52
|
+
*/
|
|
53
|
+
readonly expanded?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Initial expanded state for uncontrolled use.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
readonly defaultExpanded?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Accessible name of the navigation landmark.
|
|
64
|
+
*
|
|
65
|
+
* @default "Primary"
|
|
66
|
+
*/
|
|
67
|
+
readonly ariaLabel?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Ids that label the navigation landmark (overrides `ariaLabel`).
|
|
71
|
+
*
|
|
72
|
+
* @default undefined
|
|
73
|
+
*/
|
|
74
|
+
readonly ariaLabelledby?: string;
|
|
75
|
+
}>();
|
|
76
|
+
|
|
77
|
+
const emit = defineEmits<{
|
|
78
|
+
/** Fired when an item requests to become the active destination. */
|
|
79
|
+
"update:modelValue": [value: Value];
|
|
80
|
+
|
|
81
|
+
/** Fired after an item is activated, with its value and the native click. */
|
|
82
|
+
select: [value: Value, nativeEvent: MouseEvent];
|
|
83
|
+
|
|
84
|
+
/** Fired with the requested expanded value (supports `v-model:expanded`). */
|
|
85
|
+
"update:expanded": [value: boolean];
|
|
86
|
+
}>();
|
|
87
|
+
|
|
88
|
+
defineSlots<{
|
|
89
|
+
/** Toggle and NavigationRailItem destinations with the active value and expanded state. */
|
|
90
|
+
default(props: NavigationRailSlotState<Value>): unknown;
|
|
91
|
+
}>();
|
|
92
|
+
|
|
93
|
+
const railId = useDeterministicId({ id: () => id, hint: "navigation-rail" });
|
|
94
|
+
const state = useControllableState<Value | undefined>({
|
|
95
|
+
value: () => modelValue,
|
|
96
|
+
defaultValue: () => defaultValue,
|
|
97
|
+
onChange: (value) => {
|
|
98
|
+
if (value !== undefined) emit("update:modelValue", value);
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
const expandedState = useControllableState<boolean>({
|
|
102
|
+
value: () => expanded,
|
|
103
|
+
defaultValue: () => defaultExpanded,
|
|
104
|
+
onChange: (value) => emit("update:expanded", value),
|
|
105
|
+
});
|
|
106
|
+
const isExpanded = computed(() => expandedState.value.value);
|
|
107
|
+
|
|
108
|
+
function setExpanded(value: boolean): void {
|
|
109
|
+
expandedState.set(value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function toggle(): void {
|
|
113
|
+
expandedState.set(!expandedState.value.value);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
navigationRailContext.provide({
|
|
117
|
+
id: railId,
|
|
118
|
+
active: computed(() => state.value.value),
|
|
119
|
+
expanded: isExpanded,
|
|
120
|
+
select: (value: string, event: MouseEvent) => {
|
|
121
|
+
const typed = destinations.find((destination) => destination === value);
|
|
122
|
+
if (typed === undefined) return;
|
|
123
|
+
state.set(typed);
|
|
124
|
+
emit("select", typed, event);
|
|
125
|
+
},
|
|
126
|
+
setExpanded,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
defineExpose({
|
|
130
|
+
expanded: isExpanded,
|
|
131
|
+
id: railId,
|
|
132
|
+
setExpanded,
|
|
133
|
+
toggle,
|
|
134
|
+
} satisfies Omit<NavigationRailExpose, "expanded" | "id"> & {
|
|
135
|
+
readonly expanded: ComputedRef<boolean>;
|
|
136
|
+
readonly id: ComputedRef<string>;
|
|
137
|
+
});
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<template>
|
|
141
|
+
<nav
|
|
142
|
+
:id="railId"
|
|
143
|
+
:aria-label="ariaLabelledby === undefined ? ariaLabel : undefined"
|
|
144
|
+
:aria-labelledby
|
|
145
|
+
part="root"
|
|
146
|
+
data-vize-ui="navigation-rail"
|
|
147
|
+
:data-count="destinations.length"
|
|
148
|
+
:data-expanded="isExpanded ? 'true' : 'false'"
|
|
149
|
+
>
|
|
150
|
+
<slot :active="state.value.value" :expanded="isExpanded" />
|
|
151
|
+
</nav>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<style scoped>
|
|
155
|
+
/* Headless by design. Pin with position: sticky or fixed and pad with SafeArea. */
|
|
156
|
+
</style>
|