@xds/vue 1.0.0 → 1.1.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/dist/Banner.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/Button.vue.d.ts +9 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang.js +18 -5
- package/dist/Checkbox.vue.d.ts +13 -10
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang.js +32 -20
- package/dist/DatePicker.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/DateRangePicker.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/Dialog.vue.d.ts +5 -2
- package/dist/Dialog.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/IconButton.vue.d.ts +9 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang.js +18 -5
- package/dist/Labels.vue.d.ts +17 -0
- package/dist/Labels.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/Labels2.js +4 -0
- package/dist/Menu.vue.d.ts +4 -1
- package/dist/Menu.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/RadioGroup.vue_vue_type_script_setup_true_lang.js +13 -7
- package/dist/SearchField.vue.d.ts +11 -8
- package/dist/SearchField.vue_vue_type_script_setup_true_lang.js +40 -22
- package/dist/SegmentedControl.vue.d.ts +3 -7
- package/dist/SegmentedControl.vue_vue_type_script_setup_true_lang.js +13 -14
- package/dist/Select.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/Slider.vue.d.ts +3 -8
- package/dist/Slider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/Switch.vue.d.ts +13 -10
- package/dist/Switch.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/Tabs.vue.d.ts +3 -5
- package/dist/Tabs.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/TextField.vue.d.ts +11 -8
- package/dist/TextField.vue_vue_type_script_setup_true_lang.js +26 -13
- package/dist/Toast.vue_vue_type_script_setup_true_lang.js +5 -11
- package/dist/TooltipOverlay.vue.d.ts +1 -0
- package/dist/TooltipOverlay.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/controlled.d.ts +46 -0
- package/dist/controlled.js +64 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/labels.d.ts +9 -0
- package/dist/labels.js +17 -0
- package/dist/preview.js +9 -2
- package/dist/trigger.d.ts +7 -0
- package/dist/trigger.js +13 -1
- package/package.json +3 -3
- package/styles.css +70 -0
- package/tailwind.css +1 -1
|
@@ -3,7 +3,7 @@ import { usePresence } from "./presence.js";
|
|
|
3
3
|
import { TriggerScope } from "./trigger.js";
|
|
4
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, useId, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { readCssMs, readCssPx } from "@xds/core";
|
|
6
|
-
import { normalizeProps as normalizeProps$1, useMachine } from "@zag-js/vue";
|
|
6
|
+
import { mergeProps as mergeProps$1, normalizeProps as normalizeProps$1, useMachine } from "@zag-js/vue";
|
|
7
7
|
import { motion, space } from "@xds/tokens";
|
|
8
8
|
import * as tooltip from "@zag-js/tooltip";
|
|
9
9
|
// packages/ui-vue/src/TooltipOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -17,12 +17,14 @@ var TooltipOverlay_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
17
17
|
props: {
|
|
18
18
|
label: {},
|
|
19
19
|
shortcut: {},
|
|
20
|
-
placement: {}
|
|
20
|
+
placement: {},
|
|
21
|
+
id: {}
|
|
21
22
|
},
|
|
22
23
|
setup(__props) {
|
|
23
24
|
const id = useId();
|
|
24
25
|
const service = useMachine(tooltip.machine, computed(() => ({
|
|
25
26
|
id,
|
|
27
|
+
ids: { content: __props.id },
|
|
26
28
|
openDelay: readCssMs(null, "--xds-motion-duration-tooltip-delay", motion.duration.tooltipDelay),
|
|
27
29
|
closeDelay: 0,
|
|
28
30
|
closeOnScroll: false,
|
|
@@ -41,12 +43,11 @@ var TooltipOverlay_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
41
43
|
_: 3
|
|
42
44
|
}, 8, ["trigger"]), unref(present) ? (openBlock(), createBlock(Portal_default, { key: 0 }, {
|
|
43
45
|
default: withCtx(() => [createVNode(unref(TriggerScope), { trigger: null }, {
|
|
44
|
-
default: withCtx(() => [createElementVNode("div", mergeProps(api.value.getPositionerProps(), { class: "xds-tooltip__positioner" }), [createElementVNode("div", mergeProps(api.value.getContentProps(), {
|
|
46
|
+
default: withCtx(() => [createElementVNode("div", mergeProps(api.value.getPositionerProps(), { class: "xds-tooltip__positioner" }), [createElementVNode("div", mergeProps(unref(mergeProps$1)(api.value.getContentProps(), _ctx.$attrs), {
|
|
45
47
|
ref_key: "content",
|
|
46
48
|
ref: content,
|
|
47
49
|
hidden: false,
|
|
48
|
-
class:
|
|
49
|
-
style: _ctx.$attrs.style
|
|
50
|
+
class: "xds-tooltip"
|
|
50
51
|
}), [createTextVNode(toDisplayString(__props.label), 1), __props.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_1, toDisplayString(__props.shortcut), 1)) : createCommentVNode("", true)], 16)], 16)]),
|
|
51
52
|
_: 1
|
|
52
53
|
})]),
|
package/dist/controlled.d.ts
CHANGED
|
@@ -1,4 +1,50 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
1
2
|
/** After the model's update: puts the owner's value back into a field that did not take it. */
|
|
2
3
|
export declare function keepValue(element: HTMLInputElement | HTMLTextAreaElement, value: () => string): void;
|
|
3
4
|
/** After the model's update: puts the owner's state back into a checkbox or radio. */
|
|
4
5
|
export declare function keepChecked(element: HTMLInputElement, checked: () => boolean): void;
|
|
6
|
+
/**
|
|
7
|
+
* The state of a control that the app may keep or leave to it. It is the app's while the app
|
|
8
|
+
* gives the prop `name`, even as `undefined`, and the control's own otherwise, from `initial`.
|
|
9
|
+
* Either way a change goes to `emit`, the update event of `v-model:<name>`.
|
|
10
|
+
*
|
|
11
|
+
* Not defineModel, which keeps a value of its own whenever the owner does not both give the prop
|
|
12
|
+
* and listen to its update: a control given a value and no listener would then change, where
|
|
13
|
+
* every web library shows the value it is given. Its own value starts from another prop, the
|
|
14
|
+
* default, which defineModel's default cannot read.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useControllable<T>(name: string, given: () => T | undefined, initial: () => T, emit: (value: T) => void): {
|
|
17
|
+
value: ComputedRef<T>;
|
|
18
|
+
controlled: () => boolean;
|
|
19
|
+
set: (next: T) => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Sets a control that keeps its own state back to its default when its form is reset, as the
|
|
24
|
+
* form sets the native field back. A controlled one shows what its owner gives it, whatever the
|
|
25
|
+
* form does.
|
|
26
|
+
*
|
|
27
|
+
* The form sets a field back to its `defaultValue` or `defaultChecked`, which the controls keep
|
|
28
|
+
* equal to what they show, as React does: Vue writes neither, and a field the form emptied while
|
|
29
|
+
* its state stayed the same would not be drawn again. The form's reset then leaves the field as
|
|
30
|
+
* it is, and this sets the state, and so the field, back to the component's default.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useFormReset(element: () => Element | null | undefined, controlled: () => boolean, reset: () => void): void;
|
|
33
|
+
/**
|
|
34
|
+
* A native field's default, which `useFormReset` keeps equal to its state. Vue's types for the
|
|
35
|
+
* DOM list neither property, which Vue sets as a property all the same. Bind it with `v-bind`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formDefault(attributes: {
|
|
38
|
+
defaultValue: string;
|
|
39
|
+
} | {
|
|
40
|
+
defaultChecked: boolean;
|
|
41
|
+
}): Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* What a component that is focused through a native element exposes on its instance: `focus`,
|
|
44
|
+
* `blur`, and `element`, which returns the element itself, as React's `ref` reaches it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function focusable<E extends HTMLElement>(element: () => E | null | undefined): {
|
|
47
|
+
focus: (options?: FocusOptions) => void | undefined;
|
|
48
|
+
blur: () => void | undefined;
|
|
49
|
+
element: () => E | null;
|
|
50
|
+
};
|
package/dist/controlled.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { nextTick } from "vue";
|
|
1
|
+
import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, shallowRef } from "vue";
|
|
2
|
+
import { isControlled, onFormReset } from "@xds/core";
|
|
2
3
|
// packages/ui-vue/src/controlled.ts
|
|
3
4
|
/** After the model's update: puts the owner's value back into a field that did not take it. */
|
|
4
5
|
function keepValue(element, value) {
|
|
@@ -12,4 +13,65 @@ function keepChecked(element, checked) {
|
|
|
12
13
|
if (element.checked !== checked()) element.checked = checked();
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The state of a control that the app may keep or leave to it. It is the app's while the app
|
|
18
|
+
* gives the prop `name`, even as `undefined`, and the control's own otherwise, from `initial`.
|
|
19
|
+
* Either way a change goes to `emit`, the update event of `v-model:<name>`.
|
|
20
|
+
*
|
|
21
|
+
* Not defineModel, which keeps a value of its own whenever the owner does not both give the prop
|
|
22
|
+
* and listen to its update: a control given a value and no listener would then change, where
|
|
23
|
+
* every web library shows the value it is given. Its own value starts from another prop, the
|
|
24
|
+
* default, which defineModel's default cannot read.
|
|
25
|
+
*/
|
|
26
|
+
function useControllable(name, given, initial, emit) {
|
|
27
|
+
const instance = getCurrentInstance();
|
|
28
|
+
const controlled = () => isControlled(instance?.vnode.props ?? {}, name);
|
|
29
|
+
const own = shallowRef(initial());
|
|
30
|
+
return {
|
|
31
|
+
value: computed(() => controlled() ? given() : own.value),
|
|
32
|
+
controlled,
|
|
33
|
+
set: (next) => {
|
|
34
|
+
if (!controlled()) own.value = next;
|
|
35
|
+
emit(next);
|
|
36
|
+
},
|
|
37
|
+
reset: () => {
|
|
38
|
+
own.value = initial();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sets a control that keeps its own state back to its default when its form is reset, as the
|
|
44
|
+
* form sets the native field back. A controlled one shows what its owner gives it, whatever the
|
|
45
|
+
* form does.
|
|
46
|
+
*
|
|
47
|
+
* The form sets a field back to its `defaultValue` or `defaultChecked`, which the controls keep
|
|
48
|
+
* equal to what they show, as React does: Vue writes neither, and a field the form emptied while
|
|
49
|
+
* its state stayed the same would not be drawn again. The form's reset then leaves the field as
|
|
50
|
+
* it is, and this sets the state, and so the field, back to the component's default.
|
|
51
|
+
*/
|
|
52
|
+
function useFormReset(element, controlled, reset) {
|
|
53
|
+
let stop;
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
if (!controlled()) stop = onFormReset(element(), reset);
|
|
56
|
+
});
|
|
57
|
+
onBeforeUnmount(() => stop?.());
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A native field's default, which `useFormReset` keeps equal to its state. Vue's types for the
|
|
61
|
+
* DOM list neither property, which Vue sets as a property all the same. Bind it with `v-bind`.
|
|
62
|
+
*/
|
|
63
|
+
function formDefault(attributes) {
|
|
64
|
+
return attributes;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* What a component that is focused through a native element exposes on its instance: `focus`,
|
|
68
|
+
* `blur`, and `element`, which returns the element itself, as React's `ref` reaches it.
|
|
69
|
+
*/
|
|
70
|
+
function focusable(element) {
|
|
71
|
+
return {
|
|
72
|
+
focus: (options) => element()?.focus(options),
|
|
73
|
+
blur: () => element()?.blur(),
|
|
74
|
+
element: () => element() ?? null
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export { focusable, formDefault, keepChecked, keepValue, useControllable, useFormReset };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { default as Divider, type DividerProps } from "./Divider.vue";
|
|
|
20
20
|
export { default as EmptyState, type EmptyStateProps } from "./EmptyState.vue";
|
|
21
21
|
export { default as Icon, type IconProps } from "./Icon.vue";
|
|
22
22
|
export { default as IconButton, type IconButtonProps } from "./IconButton.vue";
|
|
23
|
+
export type { ComponentLabels } from "@xds/core";
|
|
24
|
+
export { default as Labels, type LabelsProps } from "./Labels.vue";
|
|
23
25
|
export { default as ListRow, type ListRowProps } from "./ListRow.vue";
|
|
24
26
|
export { default as MediaCard, type MediaCardProps } from "./MediaCard.vue";
|
|
25
27
|
export { default as Menu, type MenuItem, type MenuProps } from "./Menu.vue";
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import Divider_default from "./Divider.js";
|
|
|
17
17
|
import EmptyState_default from "./EmptyState.js";
|
|
18
18
|
import Icon_default from "./Icon.js";
|
|
19
19
|
import IconButton_default from "./IconButton.js";
|
|
20
|
+
import Labels_default from "./Labels2.js";
|
|
20
21
|
import ListRow_default from "./ListRow.js";
|
|
21
22
|
import MediaCard_default from "./MediaCard.js";
|
|
22
23
|
import Menu_default from "./Menu.js";
|
|
@@ -37,4 +38,4 @@ import TextField_default from "./TextField.js";
|
|
|
37
38
|
import Thumbnail_default from "./Thumbnail.js";
|
|
38
39
|
import Toast_default from "./Toast.js";
|
|
39
40
|
import Tooltip_default from "./Tooltip.js";
|
|
40
|
-
export { Accordion_default as Accordion, Avatar_default as Avatar, AvatarStack_default as AvatarStack, Badge_default as Badge, Banner_default as Banner, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Chip_default as Chip, ChipBar_default as ChipBar, CountBadge_default as CountBadge, DatePicker_default as DatePicker, DateRangePicker_default as DateRangePicker, Defaults_default as Defaults, Dialog_default as Dialog, Divider_default as Divider, EmptyState_default as EmptyState, Icon_default as Icon, IconButton_default as IconButton, ListRow_default as ListRow, MediaCard_default as MediaCard, Menu_default as Menu, ProgressBar_default as ProgressBar, RadioGroup_default as RadioGroup, SearchField_default as SearchField, SectionHeader_default as SectionHeader, SegmentedControl_default as SegmentedControl, Select_default as Select, Sidebar_default as Sidebar, Skeleton_default as Skeleton, Slider_default as Slider, Spinner_default as Spinner, Switch_default as Switch, Tabs_default as Tabs, Text_default as Text, TextField_default as TextField, Thumbnail_default as Thumbnail, Toast_default as Toast, Tooltip_default as Tooltip };
|
|
41
|
+
export { Accordion_default as Accordion, Avatar_default as Avatar, AvatarStack_default as AvatarStack, Badge_default as Badge, Banner_default as Banner, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Chip_default as Chip, ChipBar_default as ChipBar, CountBadge_default as CountBadge, DatePicker_default as DatePicker, DateRangePicker_default as DateRangePicker, Defaults_default as Defaults, Dialog_default as Dialog, Divider_default as Divider, EmptyState_default as EmptyState, Icon_default as Icon, IconButton_default as IconButton, Labels_default as Labels, ListRow_default as ListRow, MediaCard_default as MediaCard, Menu_default as Menu, ProgressBar_default as ProgressBar, RadioGroup_default as RadioGroup, SearchField_default as SearchField, SectionHeader_default as SectionHeader, SegmentedControl_default as SegmentedControl, Select_default as Select, Sidebar_default as Sidebar, Skeleton_default as Skeleton, Slider_default as Slider, Spinner_default as Spinner, Switch_default as Switch, Tabs_default as Tabs, Text_default as Text, TextField_default as TextField, Thumbnail_default as Thumbnail, Toast_default as Toast, Tooltip_default as Tooltip };
|
package/dist/labels.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentLabels } from "@xds/core";
|
|
2
|
+
import { type ComputedRef } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* Gives the components under the caller `value`, over the labels of the providers around it: it
|
|
5
|
+
* replaces only the labels it names. Only for Labels: the index does not export it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function provideLabels(value: () => Partial<ComponentLabels>): void;
|
|
8
|
+
/** The labels the closest Labels gives, or the English ones. */
|
|
9
|
+
export declare function useLabels(): ComputedRef<ComponentLabels>;
|
package/dist/labels.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed, inject, provide } from "vue";
|
|
2
|
+
import { DEFAULT_LABELS, mergeLabels } from "@xds/core";
|
|
3
|
+
// packages/ui-vue/src/labels.ts
|
|
4
|
+
var LABELS = Symbol("labels");
|
|
5
|
+
/**
|
|
6
|
+
* Gives the components under the caller `value`, over the labels of the providers around it: it
|
|
7
|
+
* replaces only the labels it names. Only for Labels: the index does not export it.
|
|
8
|
+
*/
|
|
9
|
+
function provideLabels(value) {
|
|
10
|
+
const outer = inject(LABELS, null);
|
|
11
|
+
provide(LABELS, computed(() => mergeLabels(outer?.value, value())));
|
|
12
|
+
}
|
|
13
|
+
/** The labels the closest Labels gives, or the English ones. */
|
|
14
|
+
function useLabels() {
|
|
15
|
+
return inject(LABELS, computed(() => DEFAULT_LABELS), false);
|
|
16
|
+
}
|
|
17
|
+
export { provideLabels, useLabels };
|
package/dist/preview.js
CHANGED
|
@@ -18,6 +18,7 @@ import Defaults_default from "./Defaults2.js";
|
|
|
18
18
|
import Dialog_default from "./Dialog.js";
|
|
19
19
|
import Divider_default from "./Divider.js";
|
|
20
20
|
import EmptyState_default from "./EmptyState.js";
|
|
21
|
+
import Labels_default from "./Labels2.js";
|
|
21
22
|
import ListRow_default from "./ListRow.js";
|
|
22
23
|
import Thumbnail_default from "./Thumbnail.js";
|
|
23
24
|
import MediaCard_default from "./MediaCard.js";
|
|
@@ -56,6 +57,7 @@ var COMPONENTS = {
|
|
|
56
57
|
DatePicker: DatePicker_default,
|
|
57
58
|
DateRangePicker: DateRangePicker_default,
|
|
58
59
|
Defaults: Defaults_default,
|
|
60
|
+
Labels: Labels_default,
|
|
59
61
|
Dialog: Dialog_default,
|
|
60
62
|
Divider: Divider_default,
|
|
61
63
|
EmptyState: EmptyState_default,
|
|
@@ -87,7 +89,12 @@ var MODELS = [
|
|
|
87
89
|
"checked",
|
|
88
90
|
"expanded"
|
|
89
91
|
];
|
|
90
|
-
var ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
92
|
+
var ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
93
|
+
"class",
|
|
94
|
+
"style",
|
|
95
|
+
"id"
|
|
96
|
+
]);
|
|
97
|
+
var isAttribute = (key) => ATTRIBUTES.has(key) || key.startsWith("data-");
|
|
91
98
|
var HOST = Symbol("preview host");
|
|
92
99
|
/** One component of the screen, drawn again when a slot that its props read changes. */
|
|
93
100
|
var Part = defineComponent({
|
|
@@ -130,7 +137,7 @@ var Preview = defineComponent({
|
|
|
130
137
|
for (const [key, value] of Object.entries(given)) if (key === "onChange") {
|
|
131
138
|
const model = MODELS.find((name) => declared.has(name));
|
|
132
139
|
props[model ? `onUpdate:${model}` : key] = resolve(value, key, host);
|
|
133
|
-
} else if (isCallback(key) || declared.has(camelize(key)) ||
|
|
140
|
+
} else if (isCallback(key) || declared.has(camelize(key)) || isAttribute(key)) props[key] = resolve(value, key, host);
|
|
134
141
|
else slots[key] = () => host.draw(value);
|
|
135
142
|
if (children.length > 0) slots.default = () => host.draw(children);
|
|
136
143
|
return h(type, props, slots);
|
package/dist/trigger.d.ts
CHANGED
|
@@ -30,3 +30,10 @@ export declare const TriggerScope: import("vue").DefineComponent<import("vue").E
|
|
|
30
30
|
* none of its events and so do not open. Bind the result on the element.
|
|
31
31
|
*/
|
|
32
32
|
export declare function useTrigger<T extends object>(own: () => T, inert?: () => boolean): ComputedRef<T>;
|
|
33
|
+
/**
|
|
34
|
+
* A trigger's own props with the app's attributes, which a Button or IconButton binds itself
|
|
35
|
+
* rather than letting them fall through, since a fallen-through `id` would replace the one the
|
|
36
|
+
* overlay gives its trigger, which the overlay's other parts refer to. The app's class, style,
|
|
37
|
+
* listeners and `data-*` attributes reach the button as they fall through elsewhere.
|
|
38
|
+
*/
|
|
39
|
+
export declare function withAttributes(own: object, attributes: Record<string, unknown>): TriggerProps;
|
package/dist/trigger.js
CHANGED
|
@@ -34,4 +34,16 @@ function useTrigger(own, inert = () => false) {
|
|
|
34
34
|
return mergeProps$1(overlays, own());
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* A trigger's own props with the app's attributes, which a Button or IconButton binds itself
|
|
39
|
+
* rather than letting them fall through, since a fallen-through `id` would replace the one the
|
|
40
|
+
* overlay gives its trigger, which the overlay's other parts refer to. The app's class, style,
|
|
41
|
+
* listeners and `data-*` attributes reach the button as they fall through elsewhere.
|
|
42
|
+
*/
|
|
43
|
+
function withAttributes(own, attributes) {
|
|
44
|
+
const merged = mergeProps$1(own, attributes);
|
|
45
|
+
const overlay = own.id;
|
|
46
|
+
if (overlay !== void 0) merged.id = overlay;
|
|
47
|
+
return merged;
|
|
48
|
+
}
|
|
49
|
+
export { TriggerScope, useTrigger, withAttributes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xds/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The xds design system's components for Vue.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"page.css"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@xds/tokens": "1.
|
|
45
|
-
"@xds/core": "1.
|
|
44
|
+
"@xds/tokens": "1.1.0",
|
|
45
|
+
"@xds/core": "1.1.0",
|
|
46
46
|
"@internationalized/date": "3.12.4",
|
|
47
47
|
"@zag-js/accordion": "2.0.0-next.4",
|
|
48
48
|
"@zag-js/aria-hidden": "2.0.0-next.4",
|
package/styles.css
CHANGED
|
@@ -874,6 +874,10 @@
|
|
|
874
874
|
.outline-xds-avatar-ring {
|
|
875
875
|
outline-color: var(--xds-color-avatar-ring);
|
|
876
876
|
}
|
|
877
|
+
.blur {
|
|
878
|
+
--tw-blur: blur(8px);
|
|
879
|
+
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
880
|
+
}
|
|
877
881
|
.transition-\[width\] {
|
|
878
882
|
transition-property: width;
|
|
879
883
|
transition-timing-function: var(--tw-ease, cubic-bezier(0.4, 0, 0.2, 1));
|
|
@@ -3161,6 +3165,59 @@
|
|
|
3161
3165
|
inherits: false;
|
|
3162
3166
|
initial-value: solid;
|
|
3163
3167
|
}
|
|
3168
|
+
@property --tw-blur {
|
|
3169
|
+
syntax: "*";
|
|
3170
|
+
inherits: false;
|
|
3171
|
+
}
|
|
3172
|
+
@property --tw-brightness {
|
|
3173
|
+
syntax: "*";
|
|
3174
|
+
inherits: false;
|
|
3175
|
+
}
|
|
3176
|
+
@property --tw-contrast {
|
|
3177
|
+
syntax: "*";
|
|
3178
|
+
inherits: false;
|
|
3179
|
+
}
|
|
3180
|
+
@property --tw-grayscale {
|
|
3181
|
+
syntax: "*";
|
|
3182
|
+
inherits: false;
|
|
3183
|
+
}
|
|
3184
|
+
@property --tw-hue-rotate {
|
|
3185
|
+
syntax: "*";
|
|
3186
|
+
inherits: false;
|
|
3187
|
+
}
|
|
3188
|
+
@property --tw-invert {
|
|
3189
|
+
syntax: "*";
|
|
3190
|
+
inherits: false;
|
|
3191
|
+
}
|
|
3192
|
+
@property --tw-opacity {
|
|
3193
|
+
syntax: "*";
|
|
3194
|
+
inherits: false;
|
|
3195
|
+
}
|
|
3196
|
+
@property --tw-saturate {
|
|
3197
|
+
syntax: "*";
|
|
3198
|
+
inherits: false;
|
|
3199
|
+
}
|
|
3200
|
+
@property --tw-sepia {
|
|
3201
|
+
syntax: "*";
|
|
3202
|
+
inherits: false;
|
|
3203
|
+
}
|
|
3204
|
+
@property --tw-drop-shadow {
|
|
3205
|
+
syntax: "*";
|
|
3206
|
+
inherits: false;
|
|
3207
|
+
}
|
|
3208
|
+
@property --tw-drop-shadow-color {
|
|
3209
|
+
syntax: "*";
|
|
3210
|
+
inherits: false;
|
|
3211
|
+
}
|
|
3212
|
+
@property --tw-drop-shadow-alpha {
|
|
3213
|
+
syntax: "<percentage>";
|
|
3214
|
+
inherits: false;
|
|
3215
|
+
initial-value: 100%;
|
|
3216
|
+
}
|
|
3217
|
+
@property --tw-drop-shadow-size {
|
|
3218
|
+
syntax: "*";
|
|
3219
|
+
inherits: false;
|
|
3220
|
+
}
|
|
3164
3221
|
@property --tw-duration {
|
|
3165
3222
|
syntax: "*";
|
|
3166
3223
|
inherits: false;
|
|
@@ -3242,6 +3299,19 @@
|
|
|
3242
3299
|
--tw-ring-offset-color: #fff;
|
|
3243
3300
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
3244
3301
|
--tw-outline-style: solid;
|
|
3302
|
+
--tw-blur: initial;
|
|
3303
|
+
--tw-brightness: initial;
|
|
3304
|
+
--tw-contrast: initial;
|
|
3305
|
+
--tw-grayscale: initial;
|
|
3306
|
+
--tw-hue-rotate: initial;
|
|
3307
|
+
--tw-invert: initial;
|
|
3308
|
+
--tw-opacity: initial;
|
|
3309
|
+
--tw-saturate: initial;
|
|
3310
|
+
--tw-sepia: initial;
|
|
3311
|
+
--tw-drop-shadow: initial;
|
|
3312
|
+
--tw-drop-shadow-color: initial;
|
|
3313
|
+
--tw-drop-shadow-alpha: 100%;
|
|
3314
|
+
--tw-drop-shadow-size: initial;
|
|
3245
3315
|
--tw-duration: initial;
|
|
3246
3316
|
--tw-ease: initial;
|
|
3247
3317
|
--tw-translate-x: 0;
|
package/tailwind.css
CHANGED
|
@@ -2669,4 +2669,4 @@
|
|
|
2669
2669
|
|
|
2670
2670
|
}
|
|
2671
2671
|
|
|
2672
|
-
@source inline("*:opacity-0 -m-1 -me-1 -mt-4 -mx-4 -mx-6 -my-2 [&::-webkit-scrollbar]:hidden [&:popover-open]:flex [scrollbar-width:none] absolute active:bg-xds-card-background-pressed active:bg-xds-list-row-background-pressed active:bg-xds-list-row-background-selected-hover after:-inset-(--xds-border-width-thin) after:absolute after:border-(length:--xds-border-width-thick) after:border-xds-card-border-selected after:pointer-events-none after:rounded-xds-lg animate-[xds-skeleton-pulse_var(--xds-motion-duration-pulse)_var(--xds-motion-easing-standard)_infinite] animate-[xds-toast-enter_var(--xds-motion-duration-normal)_var(--xds-motion-easing-enter)] animate-spin aspect-[4/3] aspect-[9/16] aspect-square aspect-video before:-translate-y-1/2 before:absolute before:h-[max(100%,var(--xds-size-target-min))] before:inset-x-0 before:top-1/2 bg-xds-accent-default bg-xds-avatar-background bg-xds-avatar-overflow-background bg-xds-background-base bg-xds-background-surface bg-xds-badge-accent-background bg-xds-badge-count-background bg-xds-badge-danger-background bg-xds-badge-neutral-background bg-xds-badge-overlay-background bg-xds-badge-success-background bg-xds-badge-warning-background bg-xds-banner-danger-background bg-xds-banner-info-background bg-xds-banner-success-background bg-xds-banner-warning-background bg-xds-border-default bg-xds-chip-background bg-xds-chip-selected-background bg-xds-list-row-background-selected bg-xds-overlay-accent bg-xds-overlay-background bg-xds-progress-fill bg-xds-progress-track bg-xds-segmented-track bg-xds-sidebar-background bg-xds-sidebar-border bg-xds-skeleton-background bg-xds-switch-thumb bg-xds-switch-track bg-xds-thumbnail-background bg-xds-toast-background bg-current bg-transparent block border border-0 border-2 border-xds-border-default border-xds-border-strong border-xds-card-border-selected border-xds-checkbox-border border-xds-chip-selected-border border-xds-sidebar-border border-b border-e border-transparent bottom-0 bottom-2 bottom-[calc(var(--xds-space-1)+var(--xds-space-2))] break-all contents cursor-pointer disabled:bg-xds-chip-disabled-background disabled:border-transparent disabled:cursor-not-allowed disabled:hover:bg-xds-list-row-background-selected disabled:hover:bg-transparent disabled:text-xds-chip-disabled-text duration-(--xds-motion-duration-fast) duration-(--xds-motion-duration-normal) ease-(--xds-motion-easing-standard) enabled:active:bg-xds-chip-background-pressed enabled:active:bg-xds-chip-selected-background-pressed enabled:hover:bg-xds-chip-background-hover enabled:hover:bg-xds-chip-selected-background-hover end-2 end-[calc(var(--xds-size-count-badge)/-4)] fixed flex flex-1 flex-col flex-wrap focus-visible:-outline-offset-(--xds-focus-offset) focus-visible:outline-(length:--xds-focus-width) focus-visible:outline-xds-border-focus focus-visible:outline-current focus-visible:outline-offset-(--xds-focus-offset) focus-visible:outline-solid gap-0.5 gap-1 gap-1.5 gap-12 gap-2 gap-3 gap-4 gap-6 gap-8 gap-x-8 gap-y-6 grid grid-cols-2 grid-cols-[repeat(auto-fill,minmax(8rem,1fr))] group-aria-expanded:rotate-180 h-(--xds-border-width-thin) h-(--xds-space-1) h-(--xds-typography-body-size) h-24 h-28 h-[28rem] h-xds-badge h-xds-chip h-xds-control-md h-xds-count-badge h-xds-progress h-xds-switch-height h-full h-lh h-px has-disabled:cursor-not-allowed hidden hover:bg-xds-card-background-hover hover:bg-xds-control-default hover:bg-xds-list-row-background-hover hover:bg-xds-list-row-background-selected-hover hover:text-xds-field-text hover:text-xds-text-primary hover:underline inline-flex inset-0 inset-x-0 invisible items-center items-end items-start justify-between justify-center line-clamp-2 m-0 m-auto max-w-4xl max-w-xds-dialog max-w-xds-toast max-w-md max-w-none max-w-sm max-w-xs mb-2 mb-4 min-h-0 min-h-[calc(var(--xds-size-target-min)+var(--xds-space-2))] min-h-xds-list-row min-h-xds-list-row-compact min-h-xds-target-min min-w-0 min-w-xds-count-badge min-w-xds-target-min motion-reduce:animate-none motion-reduce:animate-pulse motion-reduce:transition-none ms-auto mt-0.5 mt-2 mt-4 mt-6 mx-2 mx-auto not-first:ms-[calc(var(--xds-size-avatar-lg)/-4)] not-first:ms-[calc(var(--xds-size-avatar-md)/-4)] not-first:ms-[calc(var(--xds-size-avatar-sm)/-4)] not-first:ms-[calc(var(--xds-size-avatar-xl)/-4)] object-cover outline-(length:--xds-border-width-thick) outline-xds-avatar-ring outline-solid overflow-hidden overflow-visible overflow-x-auto overflow-y-auto p-0.5 p-1 p-2 p-3 p-4 p-6 pb-1 pb-[calc(var(--xds-space-4)+env(safe-area-inset-bottom))] peer-checked:*:opacity-100 peer-checked:*:translate-x-[calc(var(--xds-size-switch-width)-var(--xds-size-switch-height))] peer-checked:bg-xds-checkbox-background-checked peer-checked:bg-xds-segmented-selected-background peer-checked:bg-xds-switch-track-on peer-checked:border-0 peer-checked:border-xds-segmented-selected-border peer-checked:shadow-xds-subtle peer-checked:text-xds-segmented-selected-text peer-disabled:*:bg-xds-switch-disabled-thumb peer-disabled:bg-xds-checkbox-disabled-background peer-disabled:bg-xds-switch-disabled-track peer-disabled:border-0 peer-disabled:text-xds-checkbox-disabled-mark peer-disabled:text-xds-text-secondary peer-focus-visible:outline-(length:--xds-focus-width) peer-focus-visible:outline-xds-border-focus peer-focus-visible:outline-offset-(--xds-focus-offset) peer-focus-visible:outline-solid pointer-events-auto pointer-events-none ps-3 px-1 px-2 px-2.5 px-3 px-4 px-6 py-1 py-2 py-3 py-8 relative rounded-[calc(var(--xds-radius-lg)-var(--xds-border-width-thin))] rounded-[calc(var(--xds-radius-md)-2px)] rounded-xds-full rounded-xds-lg rounded-xds-md rounded-xds-sm rounded-full rounded-t-[calc(var(--xds-radius-lg)-var(--xds-border-width-thin))] rtl:-scale-x-100 scroll-mt-20 select-none self-center shadow-xds-raised shadow-xds-subtle shrink-0 size-1.5 size-12 size-3/4 size-8 size-xds-avatar-lg size-xds-avatar-md size-xds-avatar-sm size-xds-avatar-xl size-xds-checkbox size-xds-icon-lg size-xds-icon-md size-xds-icon-sm size-xds-icon-xl size-xds-icon-xs size-xds-spinner-lg size-xds-spinner-md size-xds-spinner-sm size-xds-target-min size-full sm:grid-cols-2 sm:grid-cols-3 sm:grid-cols-4 sm:grid-cols-5 sr-only start-2 sticky table tabular-nums text-xds-accordion-icon text-xds-avatar-overflow-text text-xds-avatar-text text-xds-badge-accent-text text-xds-badge-count-text text-xds-badge-danger-text text-xds-badge-neutral-text text-xds-badge-overlay-text text-xds-badge-success-text text-xds-badge-warning-text text-xds-banner-danger-accent text-xds-banner-info-accent text-xds-banner-success-accent text-xds-banner-text text-xds-banner-warning-accent text-xds-body text-xds-body-strong text-xds-checkbox-mark text-xds-chip-selected-text text-xds-chip-text text-xds-detail text-xds-display text-xds-empty-state-icon text-xds-field-placeholder text-xds-footnote text-xds-heading text-xds-label text-xds-segmented-text text-xds-sidebar-section-title text-xds-status-danger text-xds-status-success text-xds-status-warning text-xds-text-accent text-xds-text-on-accent text-xds-text-primary text-xds-text-secondary text-xds-text-tertiary text-xds-thumbnail-icon text-xds-title text-xds-toast-action text-xds-toast-text text-center text-start top-0 top-2 top-[calc(var(--xds-size-count-badge)/-4)] top-auto transition-[width] transition-colors transition-transform truncate underline w-16 w-2/5 w-24 w-28 w-36 w-48 w-xds-sidebar w-xds-sidebar-rail w-xds-switch-width w-fit w-full whitespace-nowrap z-10");
|
|
2672
|
+
@source inline("*:opacity-0 -m-1 -me-1 -mt-4 -mx-4 -mx-6 -my-2 [&::-webkit-scrollbar]:hidden [&:popover-open]:flex [scrollbar-width:none] absolute active:bg-xds-card-background-pressed active:bg-xds-list-row-background-pressed active:bg-xds-list-row-background-selected-hover after:-inset-(--xds-border-width-thin) after:absolute after:border-(length:--xds-border-width-thick) after:border-xds-card-border-selected after:pointer-events-none after:rounded-xds-lg animate-[xds-skeleton-pulse_var(--xds-motion-duration-pulse)_var(--xds-motion-easing-standard)_infinite] animate-[xds-toast-enter_var(--xds-motion-duration-normal)_var(--xds-motion-easing-enter)] animate-spin aspect-[4/3] aspect-[9/16] aspect-square aspect-video before:-translate-y-1/2 before:absolute before:h-[max(100%,var(--xds-size-target-min))] before:inset-x-0 before:top-1/2 bg-xds-accent-default bg-xds-avatar-background bg-xds-avatar-overflow-background bg-xds-background-base bg-xds-background-surface bg-xds-badge-accent-background bg-xds-badge-count-background bg-xds-badge-danger-background bg-xds-badge-neutral-background bg-xds-badge-overlay-background bg-xds-badge-success-background bg-xds-badge-warning-background bg-xds-banner-danger-background bg-xds-banner-info-background bg-xds-banner-success-background bg-xds-banner-warning-background bg-xds-border-default bg-xds-chip-background bg-xds-chip-selected-background bg-xds-list-row-background-selected bg-xds-overlay-accent bg-xds-overlay-background bg-xds-progress-fill bg-xds-progress-track bg-xds-segmented-track bg-xds-sidebar-background bg-xds-sidebar-border bg-xds-skeleton-background bg-xds-switch-thumb bg-xds-switch-track bg-xds-thumbnail-background bg-xds-toast-background bg-current bg-transparent block blur border border-0 border-2 border-xds-border-default border-xds-border-strong border-xds-card-border-selected border-xds-checkbox-border border-xds-chip-selected-border border-xds-sidebar-border border-b border-e border-transparent bottom-0 bottom-2 bottom-[calc(var(--xds-space-1)+var(--xds-space-2))] break-all contents cursor-pointer disabled:bg-xds-chip-disabled-background disabled:border-transparent disabled:cursor-not-allowed disabled:hover:bg-xds-list-row-background-selected disabled:hover:bg-transparent disabled:text-xds-chip-disabled-text duration-(--xds-motion-duration-fast) duration-(--xds-motion-duration-normal) ease-(--xds-motion-easing-standard) enabled:active:bg-xds-chip-background-pressed enabled:active:bg-xds-chip-selected-background-pressed enabled:hover:bg-xds-chip-background-hover enabled:hover:bg-xds-chip-selected-background-hover end-2 end-[calc(var(--xds-size-count-badge)/-4)] fixed flex flex-1 flex-col flex-wrap focus-visible:-outline-offset-(--xds-focus-offset) focus-visible:outline-(length:--xds-focus-width) focus-visible:outline-xds-border-focus focus-visible:outline-current focus-visible:outline-offset-(--xds-focus-offset) focus-visible:outline-solid gap-0.5 gap-1 gap-1.5 gap-12 gap-2 gap-3 gap-4 gap-6 gap-8 gap-x-8 gap-y-6 grid grid-cols-2 grid-cols-[repeat(auto-fill,minmax(8rem,1fr))] group-aria-expanded:rotate-180 h-(--xds-border-width-thin) h-(--xds-space-1) h-(--xds-typography-body-size) h-24 h-28 h-[28rem] h-xds-badge h-xds-chip h-xds-control-md h-xds-count-badge h-xds-progress h-xds-switch-height h-full h-lh h-px has-disabled:cursor-not-allowed hidden hover:bg-xds-card-background-hover hover:bg-xds-control-default hover:bg-xds-list-row-background-hover hover:bg-xds-list-row-background-selected-hover hover:text-xds-field-text hover:text-xds-text-primary hover:underline inline-flex inset-0 inset-x-0 invisible items-center items-end items-start justify-between justify-center line-clamp-2 m-0 m-auto max-w-4xl max-w-xds-dialog max-w-xds-toast max-w-md max-w-none max-w-sm max-w-xs mb-2 mb-4 min-h-0 min-h-[calc(var(--xds-size-target-min)+var(--xds-space-2))] min-h-xds-list-row min-h-xds-list-row-compact min-h-xds-target-min min-w-0 min-w-xds-count-badge min-w-xds-target-min motion-reduce:animate-none motion-reduce:animate-pulse motion-reduce:transition-none ms-auto mt-0.5 mt-2 mt-4 mt-6 mx-2 mx-auto not-first:ms-[calc(var(--xds-size-avatar-lg)/-4)] not-first:ms-[calc(var(--xds-size-avatar-md)/-4)] not-first:ms-[calc(var(--xds-size-avatar-sm)/-4)] not-first:ms-[calc(var(--xds-size-avatar-xl)/-4)] object-cover outline-(length:--xds-border-width-thick) outline-xds-avatar-ring outline-solid overflow-hidden overflow-visible overflow-x-auto overflow-y-auto p-0.5 p-1 p-2 p-3 p-4 p-6 pb-1 pb-[calc(var(--xds-space-4)+env(safe-area-inset-bottom))] peer-checked:*:opacity-100 peer-checked:*:translate-x-[calc(var(--xds-size-switch-width)-var(--xds-size-switch-height))] peer-checked:bg-xds-checkbox-background-checked peer-checked:bg-xds-segmented-selected-background peer-checked:bg-xds-switch-track-on peer-checked:border-0 peer-checked:border-xds-segmented-selected-border peer-checked:shadow-xds-subtle peer-checked:text-xds-segmented-selected-text peer-disabled:*:bg-xds-switch-disabled-thumb peer-disabled:bg-xds-checkbox-disabled-background peer-disabled:bg-xds-switch-disabled-track peer-disabled:border-0 peer-disabled:text-xds-checkbox-disabled-mark peer-disabled:text-xds-text-secondary peer-focus-visible:outline-(length:--xds-focus-width) peer-focus-visible:outline-xds-border-focus peer-focus-visible:outline-offset-(--xds-focus-offset) peer-focus-visible:outline-solid pointer-events-auto pointer-events-none ps-3 px-1 px-2 px-2.5 px-3 px-4 px-6 py-1 py-2 py-3 py-8 relative rounded-[calc(var(--xds-radius-lg)-var(--xds-border-width-thin))] rounded-[calc(var(--xds-radius-md)-2px)] rounded-xds-full rounded-xds-lg rounded-xds-md rounded-xds-sm rounded-full rounded-t-[calc(var(--xds-radius-lg)-var(--xds-border-width-thin))] rtl:-scale-x-100 scroll-mt-20 select-none self-center shadow-xds-raised shadow-xds-subtle shrink-0 size-1.5 size-12 size-3/4 size-8 size-xds-avatar-lg size-xds-avatar-md size-xds-avatar-sm size-xds-avatar-xl size-xds-checkbox size-xds-icon-lg size-xds-icon-md size-xds-icon-sm size-xds-icon-xl size-xds-icon-xs size-xds-spinner-lg size-xds-spinner-md size-xds-spinner-sm size-xds-target-min size-full sm:grid-cols-2 sm:grid-cols-3 sm:grid-cols-4 sm:grid-cols-5 sr-only start-2 sticky table tabular-nums text-xds-accordion-icon text-xds-avatar-overflow-text text-xds-avatar-text text-xds-badge-accent-text text-xds-badge-count-text text-xds-badge-danger-text text-xds-badge-neutral-text text-xds-badge-overlay-text text-xds-badge-success-text text-xds-badge-warning-text text-xds-banner-danger-accent text-xds-banner-info-accent text-xds-banner-success-accent text-xds-banner-text text-xds-banner-warning-accent text-xds-body text-xds-body-strong text-xds-checkbox-mark text-xds-chip-selected-text text-xds-chip-text text-xds-detail text-xds-display text-xds-empty-state-icon text-xds-field-placeholder text-xds-footnote text-xds-heading text-xds-label text-xds-segmented-text text-xds-sidebar-section-title text-xds-status-danger text-xds-status-success text-xds-status-warning text-xds-text-accent text-xds-text-on-accent text-xds-text-primary text-xds-text-secondary text-xds-text-tertiary text-xds-thumbnail-icon text-xds-title text-xds-toast-action text-xds-toast-text text-center text-start top-0 top-2 top-[calc(var(--xds-size-count-badge)/-4)] top-auto transition-[width] transition-colors transition-transform truncate underline w-16 w-2/5 w-24 w-28 w-36 w-48 w-xds-sidebar w-xds-sidebar-rail w-xds-switch-width w-fit w-full whitespace-nowrap z-10");
|