@xds/vue 1.0.1 → 1.2.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.
Files changed (188) hide show
  1. package/dist/Banner.vue_vue_type_script_setup_true_lang.js +4 -2
  2. package/dist/Breadcrumb.js +4 -0
  3. package/dist/Breadcrumb.vue.d.ts +6 -0
  4. package/dist/Breadcrumb.vue_vue_type_script_setup_true_lang.js +47 -0
  5. package/dist/Button.vue.d.ts +9 -1
  6. package/dist/Button.vue_vue_type_script_setup_true_lang.js +18 -5
  7. package/dist/Checkbox.vue.d.ts +13 -10
  8. package/dist/Checkbox.vue_vue_type_script_setup_true_lang.js +42 -22
  9. package/dist/Combobox.js +4 -0
  10. package/dist/Combobox.vue.d.ts +22 -0
  11. package/dist/Combobox.vue_vue_type_script_setup_true_lang.js +140 -0
  12. package/dist/DatePicker.vue_vue_type_script_setup_true_lang.js +4 -1
  13. package/dist/DateRangePicker.vue_vue_type_script_setup_true_lang.js +5 -2
  14. package/dist/Dialog.vue.d.ts +5 -2
  15. package/dist/Dialog.vue_vue_type_script_setup_true_lang.js +6 -5
  16. package/dist/IconButton.vue.d.ts +9 -1
  17. package/dist/IconButton.vue_vue_type_script_setup_true_lang.js +18 -5
  18. package/dist/Labels.vue.d.ts +17 -0
  19. package/dist/Labels.vue_vue_type_script_setup_true_lang.js +14 -0
  20. package/dist/Labels2.js +4 -0
  21. package/dist/Link.js +4 -0
  22. package/dist/Link.vue.d.ts +27 -0
  23. package/dist/Link.vue_vue_type_script_setup_true_lang.js +62 -0
  24. package/dist/Menu.vue.d.ts +4 -1
  25. package/dist/Menu.vue_vue_type_script_setup_true_lang.js +5 -4
  26. package/dist/Pagination.js +4 -0
  27. package/dist/Pagination.vue.d.ts +9 -0
  28. package/dist/Pagination.vue_vue_type_script_setup_true_lang.js +74 -0
  29. package/dist/Popover.js +4 -0
  30. package/dist/Popover.vue.d.ts +26 -0
  31. package/dist/Popover.vue_vue_type_script_setup_true_lang.js +81 -0
  32. package/dist/RadioGroup.vue_vue_type_script_setup_true_lang.js +13 -7
  33. package/dist/SearchField.vue.d.ts +11 -8
  34. package/dist/SearchField.vue_vue_type_script_setup_true_lang.js +40 -22
  35. package/dist/SegmentedControl.vue.d.ts +3 -7
  36. package/dist/SegmentedControl.vue_vue_type_script_setup_true_lang.js +13 -14
  37. package/dist/Select.vue.d.ts +3 -1
  38. package/dist/Select.vue_vue_type_script_setup_true_lang.js +47 -18
  39. package/dist/Slider.vue.d.ts +3 -8
  40. package/dist/Slider.vue_vue_type_script_setup_true_lang.js +11 -10
  41. package/dist/Switch.vue.d.ts +13 -10
  42. package/dist/Switch.vue_vue_type_script_setup_true_lang.js +33 -21
  43. package/dist/Table.js +4 -0
  44. package/dist/Table.vue.d.ts +10 -0
  45. package/dist/Table.vue_vue_type_script_setup_true_lang.js +61 -0
  46. package/dist/Tabs.vue.d.ts +3 -5
  47. package/dist/Tabs.vue_vue_type_script_setup_true_lang.js +10 -9
  48. package/dist/TextField.vue.d.ts +11 -8
  49. package/dist/TextField.vue_vue_type_script_setup_true_lang.js +26 -13
  50. package/dist/TimePicker.js +4 -0
  51. package/dist/TimePicker.vue.d.ts +10 -0
  52. package/dist/TimePicker.vue_vue_type_script_setup_true_lang.js +168 -0
  53. package/dist/Toast.vue_vue_type_script_setup_true_lang.js +5 -11
  54. package/dist/ToastQueue.js +4 -0
  55. package/dist/ToastQueue.vue.d.ts +9 -0
  56. package/dist/ToastQueue.vue_vue_type_script_setup_true_lang.js +42 -0
  57. package/dist/TooltipOverlay.vue.d.ts +1 -0
  58. package/dist/TooltipOverlay.vue_vue_type_script_setup_true_lang.js +6 -5
  59. package/dist/base.d.ts +13 -0
  60. package/dist/base.js +14 -0
  61. package/dist/controlled.d.ts +46 -0
  62. package/dist/controlled.js +64 -2
  63. package/dist/index.d.ts +14 -3
  64. package/dist/index.js +11 -1
  65. package/dist/labels.d.ts +9 -0
  66. package/dist/labels.js +17 -0
  67. package/dist/preview.d.ts +20 -3
  68. package/dist/preview.js +37 -7
  69. package/dist/trigger.d.ts +7 -0
  70. package/dist/trigger.js +13 -1
  71. package/eject/files/Accordion.vue +89 -0
  72. package/eject/files/AccordionPanel.vue +47 -0
  73. package/eject/files/Avatar.vue +41 -0
  74. package/eject/files/AvatarStack.vue +46 -0
  75. package/eject/files/Badge.vue +29 -0
  76. package/eject/files/Banner.vue +65 -0
  77. package/eject/files/Breadcrumb.vue +43 -0
  78. package/eject/files/Button.vue +93 -0
  79. package/eject/files/Card.vue +85 -0
  80. package/eject/files/Checkbox.vue +104 -0
  81. package/eject/files/Chip.vue +32 -0
  82. package/eject/files/ChipBar.vue +25 -0
  83. package/eject/files/Combobox.vue +175 -0
  84. package/eject/files/CountBadge.vue +45 -0
  85. package/eject/files/DatePicker.vue +223 -0
  86. package/eject/files/DateRangePicker.vue +317 -0
  87. package/eject/files/Dialog.vue +105 -0
  88. package/eject/files/Divider.vue +15 -0
  89. package/eject/files/EmptyState.vue +28 -0
  90. package/eject/files/Icon.vue +34 -0
  91. package/eject/files/IconButton.vue +71 -0
  92. package/eject/files/Link.vue +48 -0
  93. package/eject/files/ListRow.vue +33 -0
  94. package/eject/files/MediaCard.vue +109 -0
  95. package/eject/files/Menu.vue +181 -0
  96. package/eject/files/Pagination.vue +88 -0
  97. package/eject/files/PlaceRow.vue +54 -0
  98. package/eject/files/Popover.vue +119 -0
  99. package/eject/files/ProgressBar.vue +34 -0
  100. package/eject/files/RadioGroup.vue +126 -0
  101. package/eject/files/SearchField.vue +129 -0
  102. package/eject/files/SectionHeader.vue +37 -0
  103. package/eject/files/SegmentedControl.vue +81 -0
  104. package/eject/files/Select.vue +269 -0
  105. package/eject/files/Sidebar.vue +101 -0
  106. package/eject/files/SidebarRailButton.vue +31 -0
  107. package/eject/files/Skeleton.vue +27 -0
  108. package/eject/files/Slider.vue +126 -0
  109. package/eject/files/Spinner.vue +36 -0
  110. package/eject/files/Switch.vue +88 -0
  111. package/eject/files/Table.vue +77 -0
  112. package/eject/files/Tabs.vue +72 -0
  113. package/eject/files/Text.vue +22 -0
  114. package/eject/files/TextField.vue +190 -0
  115. package/eject/files/Thumbnail.vue +62 -0
  116. package/eject/files/TimePicker.vue +224 -0
  117. package/eject/files/Toast.vue +83 -0
  118. package/eject/files/ToastQueue.vue +54 -0
  119. package/eject/files/Tooltip.vue +28 -0
  120. package/eject/files/TooltipOverlay.vue +86 -0
  121. package/eject/files/accordion.css +89 -0
  122. package/eject/files/accordion.ts +67 -0
  123. package/eject/files/avatar-stack.ts +57 -0
  124. package/eject/files/avatar.ts +42 -0
  125. package/eject/files/badge.ts +30 -0
  126. package/eject/files/banner.ts +71 -0
  127. package/eject/files/base.css +38 -0
  128. package/eject/files/breadcrumb.css +51 -0
  129. package/eject/files/breadcrumb.ts +42 -0
  130. package/eject/files/button.css +241 -0
  131. package/eject/files/button.ts +106 -0
  132. package/eject/files/card.ts +58 -0
  133. package/eject/files/checkbox.ts +52 -0
  134. package/eject/files/chip-bar.ts +16 -0
  135. package/eject/files/chip.ts +35 -0
  136. package/eject/files/combobox.css +269 -0
  137. package/eject/files/combobox.ts +85 -0
  138. package/eject/files/count-badge.ts +32 -0
  139. package/eject/files/date-picker.css +375 -0
  140. package/eject/files/date-picker.ts +280 -0
  141. package/eject/files/date-range-picker.ts +338 -0
  142. package/eject/files/dialog.css +139 -0
  143. package/eject/files/dialog.ts +15 -0
  144. package/eject/files/divider.ts +5 -0
  145. package/eject/files/empty-state.ts +22 -0
  146. package/eject/files/icon.ts +36 -0
  147. package/eject/files/link.css +64 -0
  148. package/eject/files/link.ts +63 -0
  149. package/eject/files/list-row.ts +66 -0
  150. package/eject/files/media-card.ts +66 -0
  151. package/eject/files/menu.css +192 -0
  152. package/eject/files/menu.ts +84 -0
  153. package/eject/files/overlay.css +40 -0
  154. package/eject/files/pagination.css +106 -0
  155. package/eject/files/pagination.ts +68 -0
  156. package/eject/files/parts.ts +17 -0
  157. package/eject/files/popover.css +101 -0
  158. package/eject/files/popover.ts +37 -0
  159. package/eject/files/progress-bar.ts +26 -0
  160. package/eject/files/radio-group.css +184 -0
  161. package/eject/files/radio-group.ts +30 -0
  162. package/eject/files/section-header.ts +32 -0
  163. package/eject/files/segmented-control.ts +33 -0
  164. package/eject/files/select.css +347 -0
  165. package/eject/files/select.ts +77 -0
  166. package/eject/files/sidebar.ts +75 -0
  167. package/eject/files/skeleton.ts +51 -0
  168. package/eject/files/slider.css +160 -0
  169. package/eject/files/slider.ts +80 -0
  170. package/eject/files/spinner.ts +22 -0
  171. package/eject/files/switch.ts +45 -0
  172. package/eject/files/table.css +107 -0
  173. package/eject/files/table.ts +84 -0
  174. package/eject/files/tabs.css +120 -0
  175. package/eject/files/tabs.ts +37 -0
  176. package/eject/files/text-field.css +225 -0
  177. package/eject/files/text-field.ts +64 -0
  178. package/eject/files/text.ts +38 -0
  179. package/eject/files/thumbnail.ts +51 -0
  180. package/eject/files/time-picker.ts +113 -0
  181. package/eject/files/toast-queue.ts +64 -0
  182. package/eject/files/toast.ts +31 -0
  183. package/eject/files/tooltip.css +111 -0
  184. package/eject/files/tooltip.ts +21 -0
  185. package/eject/manifest.json +1122 -0
  186. package/package.json +11 -4
  187. package/styles.css +1135 -167
  188. package/tailwind.css +1295 -218
@@ -1,6 +1,7 @@
1
1
  import Button_default from "./Button.js";
2
2
  import { useDefaults } from "./defaults.js";
3
3
  import IconButton_default from "./IconButton.js";
4
+ import { useLabels } from "./labels.js";
4
5
  import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
5
6
  import { BANNER_PARTS, bannerClass, bannerIconClass, bannerIconPath, bannerRole, classes, rootPart } from "@xds/core";
6
7
  // packages/ui-vue/src/Banner.vue?vue&type=script&setup=true&lang.ts
@@ -11,12 +12,13 @@ var Banner_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
11
12
  props: {
12
13
  tone: {},
13
14
  title: {},
14
- dismissLabel: { default: "Dismiss" },
15
+ dismissLabel: {},
15
16
  action: {},
16
17
  onDismiss: { type: Function }
17
18
  },
18
19
  setup(__props) {
19
20
  const options = useDefaults("Banner", () => ({ tone: __props.tone }));
21
+ const labels = useLabels();
20
22
  return (_ctx, _cache) => {
21
23
  return openBlock(), createElementBlock("div", {
22
24
  role: unref(bannerRole)(unref(options).tone),
@@ -53,7 +55,7 @@ var Banner_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
53
55
  class: normalizeClass(unref(BANNER_PARTS).dismiss)
54
56
  }, [createVNode(IconButton_default, {
55
57
  icon: "x",
56
- label: __props.dismissLabel,
58
+ label: __props.dismissLabel ?? unref(labels).dismiss,
57
59
  variant: "ghost",
58
60
  size: "sm",
59
61
  onPress: _cache[1] || (_cache[1] = ($event) => __props.onDismiss())
@@ -0,0 +1,4 @@
1
+ import Breadcrumb_vue_vue_type_script_setup_true_lang_default from "./Breadcrumb.vue_vue_type_script_setup_true_lang.js";
2
+ // packages/ui-vue/src/Breadcrumb.vue
3
+ var Breadcrumb_default = Breadcrumb_vue_vue_type_script_setup_true_lang_default;
4
+ export { Breadcrumb_default as default };
@@ -0,0 +1,6 @@
1
+ import { type BreadcrumbBaseProps } from "@xds/core";
2
+ export type { BreadcrumbItem } from "@xds/core";
3
+ export type BreadcrumbProps = BreadcrumbBaseProps;
4
+ declare const __VLS_export: import("vue").DefineComponent<BreadcrumbBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BreadcrumbBaseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,47 @@
1
+ import Icon_default from "./Icon.js";
2
+ import { useLabels } from "./labels.js";
3
+ import Link_default from "./Link.js";
4
+ import { Fragment, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
5
+ import { BREADCRUMB_PARTS, BREADCRUMB_SEPARATOR, rootPart } from "@xds/core";
6
+ // packages/ui-vue/src/Breadcrumb.vue?vue&type=script&setup=true&lang.ts
7
+ var _hoisted_1 = ["aria-label"];
8
+ var Breadcrumb_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
9
+ __name: "Breadcrumb",
10
+ props: {
11
+ items: {},
12
+ label: {}
13
+ },
14
+ setup(__props) {
15
+ const labels = useLabels();
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createElementBlock("nav", {
18
+ class: normalizeClass(unref(rootPart)("Breadcrumb")),
19
+ "aria-label": __props.label ?? unref(labels).breadcrumb
20
+ }, [createElementVNode("ol", { class: normalizeClass(unref(BREADCRUMB_PARTS).list) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
21
+ return openBlock(), createElementBlock("li", {
22
+ key: index,
23
+ class: normalizeClass(unref(BREADCRUMB_PARTS).item)
24
+ }, [index === __props.items.length - 1 ? (openBlock(), createElementBlock("span", {
25
+ key: 0,
26
+ "aria-current": "page",
27
+ class: normalizeClass(unref(BREADCRUMB_PARTS).current)
28
+ }, toDisplayString(item.label), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(Link_default, {
29
+ href: item.href,
30
+ onPress: ($event) => item.onPress?.()
31
+ }, {
32
+ default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
33
+ _: 2
34
+ }, 1032, ["href", "onPress"]), createVNode(Icon_default, {
35
+ name: unref(BREADCRUMB_SEPARATOR).name,
36
+ size: unref(BREADCRUMB_SEPARATOR).size,
37
+ class: normalizeClass(unref(BREADCRUMB_PARTS).separator)
38
+ }, null, 8, [
39
+ "name",
40
+ "size",
41
+ "class"
42
+ ])], 64))], 2);
43
+ }), 128))], 2)], 10, _hoisted_1);
44
+ };
45
+ }
46
+ });
47
+ export { Breadcrumb_vue_vue_type_script_setup_true_lang_default as default };
@@ -6,9 +6,17 @@ type __VLS_Slots = {
6
6
  /** Leave it out for a button that holds only an icon, and name that one with `aria-label`. */
7
7
  default?(): unknown;
8
8
  };
9
- declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {
10
+ focus: (options?: FocusOptions) => void | undefined;
11
+ blur: () => void | undefined;
12
+ element: () => HTMLButtonElement | null;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ blur: (event: FocusEvent) => any;
15
+ focus: (event: FocusEvent) => any;
10
16
  press: () => any;
11
17
  }, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{
18
+ onBlur?: ((event: FocusEvent) => any) | undefined;
19
+ onFocus?: ((event: FocusEvent) => any) | undefined;
12
20
  onPress?: (() => any) | undefined;
13
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,11 +1,13 @@
1
+ import { focusable } from "./controlled.js";
1
2
  import { useDefaults } from "./defaults.js";
2
3
  import Icon_default from "./Icon.js";
3
4
  import Spinner_default from "./Spinner.js";
4
- import { useTrigger } from "./trigger.js";
5
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, guardReactiveProps, normalizeClass, normalizeProps, openBlock, renderSlot, unref, useSlots } from "vue";
5
+ import { useTrigger, withAttributes } from "./trigger.js";
6
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, unref, useSlots, useTemplateRef } from "vue";
6
7
  import { BUTTON_ICON, buttonClass, isHeld } from "@xds/core";
7
8
  // packages/ui-vue/src/Button.vue?vue&type=script&setup=true&lang.ts
8
9
  var Button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
10
+ inheritAttrs: false,
9
11
  __name: "Button",
10
12
  props: {
11
13
  variant: {},
@@ -31,9 +33,15 @@ var Button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
31
33
  type: { default: "button" },
32
34
  ariaLabel: {}
33
35
  },
34
- emits: ["press"],
35
- setup(__props, { emit: __emit }) {
36
+ emits: [
37
+ "press",
38
+ "focus",
39
+ "blur"
40
+ ],
41
+ setup(__props, { expose: __expose, emit: __emit }) {
36
42
  const emit = __emit;
43
+ const button = useTemplateRef("button");
44
+ __expose(focusable(() => button.value));
37
45
  const slots = useSlots();
38
46
  const options = useDefaults("Button", () => ({
39
47
  variant: __props.variant,
@@ -61,6 +69,8 @@ var Button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
61
69
  "data-pending": __props.loading ? "" : void 0,
62
70
  "aria-pressed": __props.selected === void 0 ? void 0 : __props.selected ? "true" : "false",
63
71
  "aria-label": __props.ariaLabel,
72
+ onFocus: (event) => emit("focus", event),
73
+ onBlur: (event) => emit("blur", event),
64
74
  onClick: (event) => {
65
75
  if (__props.loading) {
66
76
  event.preventDefault();
@@ -70,7 +80,10 @@ var Button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
70
80
  }
71
81
  }), () => __props.loading);
72
82
  return (_ctx, _cache) => {
73
- return openBlock(), createElementBlock("button", normalizeProps(guardReactiveProps(unref(attributes))), [
83
+ return openBlock(), createElementBlock("button", mergeProps({
84
+ ref_key: "button",
85
+ ref: button
86
+ }, unref(withAttributes)(unref(attributes), _ctx.$attrs)), [
74
87
  __props.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.iconStart ? (openBlock(), createElementBlock("span", {
75
88
  key: 0,
76
89
  class: normalizeClass(icon.value.box)
@@ -1,16 +1,19 @@
1
1
  import { type CheckboxBaseProps } from "@xds/core";
2
- export type CheckboxProps = Omit<CheckboxBaseProps, "checked" | "aria-label"> & {
2
+ export type CheckboxProps = Omit<CheckboxBaseProps, "aria-label"> & {
3
3
  ariaLabel?: string;
4
4
  };
5
- type __VLS_Props = CheckboxProps;
6
- type __VLS_ModelProps = {
7
- "checked": boolean;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- "update:checked": (value: boolean) => any;
12
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- "onUpdate:checked"?: ((value: boolean) => any) | undefined;
5
+ declare const __VLS_export: import("vue").DefineComponent<CheckboxProps, {
6
+ focus: (options?: FocusOptions) => void | undefined;
7
+ blur: () => void | undefined;
8
+ element: () => HTMLInputElement | null;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ blur: (event: FocusEvent) => any;
11
+ focus: (event: FocusEvent) => any;
12
+ "update:checked": (checked: boolean) => any;
13
+ }, string, import("vue").PublicProps, Readonly<CheckboxProps> & Readonly<{
14
+ onBlur?: ((event: FocusEvent) => any) | undefined;
15
+ onFocus?: ((event: FocusEvent) => any) | undefined;
16
+ "onUpdate:checked"?: ((checked: boolean) => any) | undefined;
14
17
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
18
  declare const _default: typeof __VLS_export;
16
19
  export default _default;
@@ -1,6 +1,6 @@
1
- import { keepChecked } from "./controlled.js";
2
- import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeModels, normalizeClass, openBlock, toDisplayString, unref, useModel } from "vue";
3
- import { CHECKBOX_MARK, checkboxBoxClass, checkboxClass, checkboxLabelClass, checkboxMarkClass, classes, rootPart } from "@xds/core";
1
+ import { focusable, formDefault, keepChecked, useControllable, useFormReset } from "./controlled.js";
2
+ import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, openBlock, toDisplayString, unref, useTemplateRef, watchEffect } from "vue";
3
+ import { checkboxBoxClass, checkboxClass, checkboxLabelClass, checkboxMark, checkboxMarkClass, classes, rootPart } from "@xds/core";
4
4
  // packages/ui-vue/src/Checkbox.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = [
6
6
  "aria-label",
@@ -11,7 +11,16 @@ var _hoisted_1 = [
11
11
  var _hoisted_2 = ["d"];
12
12
  var Checkbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
13
13
  __name: "Checkbox",
14
- props: /*@__PURE__*/ mergeModels({
14
+ props: {
15
+ checked: { type: Boolean },
16
+ defaultChecked: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ indeterminate: {
21
+ type: Boolean,
22
+ default: false
23
+ },
15
24
  label: {},
16
25
  name: {},
17
26
  disabled: {
@@ -19,39 +28,50 @@ var Checkbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
19
28
  default: false
20
29
  },
21
30
  ariaLabel: {}
22
- }, {
23
- "checked": {
24
- type: Boolean,
25
- required: true
26
- },
27
- "checkedModifiers": {}
28
- }),
29
- emits: ["update:checked"],
30
- setup(__props) {
31
- const checked = useModel(__props, "checked");
31
+ },
32
+ emits: [
33
+ "update:checked",
34
+ "focus",
35
+ "blur"
36
+ ],
37
+ setup(__props, { expose: __expose, emit: __emit }) {
38
+ const emit = __emit;
39
+ const input = useTemplateRef("input");
40
+ const { value: checked, set, controlled, reset } = useControllable("checked", () => __props.checked, () => __props.defaultChecked, (next) => emit("update:checked", next));
41
+ useFormReset(() => input.value, controlled, reset);
42
+ __expose(focusable(() => input.value));
43
+ watchEffect(() => {
44
+ if (input.value) input.value.indeterminate = __props.indeterminate;
45
+ });
32
46
  function change(event) {
33
- const input = event.currentTarget;
34
- checked.value = input.checked;
35
- keepChecked(input, () => checked.value);
47
+ const element = event.currentTarget;
48
+ element.indeterminate = __props.indeterminate;
49
+ set(element.checked);
50
+ keepChecked(element, () => checked.value);
36
51
  }
37
52
  return (_ctx, _cache) => {
38
53
  return openBlock(), createElementBlock("label", { class: normalizeClass(unref(classes)(unref(rootPart)("Checkbox"), unref(checkboxClass))) }, [
39
- createElementVNode("input", {
54
+ createElementVNode("input", mergeProps({
55
+ ref_key: "input",
56
+ ref: input,
40
57
  type: "checkbox",
41
58
  "aria-label": __props.ariaLabel,
42
59
  class: "peer sr-only",
43
- checked: checked.value,
60
+ checked: unref(checked)
61
+ }, unref(formDefault)({ defaultChecked: unref(checked) }), {
44
62
  disabled: __props.disabled,
45
63
  name: __props.name || void 0,
46
- onChange: change
47
- }, null, 40, _hoisted_1),
64
+ onChange: change,
65
+ onFocus: _cache[0] || (_cache[0] = ($event) => emit("focus", $event)),
66
+ onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event))
67
+ }), null, 16, _hoisted_1),
48
68
  createElementVNode("span", { class: normalizeClass(unref(checkboxBoxClass)) }, [(openBlock(), createElementBlock("svg", {
49
69
  viewBox: "0 0 16 16",
50
70
  fill: "none",
51
71
  "aria-hidden": "true",
52
72
  class: normalizeClass(unref(checkboxMarkClass))
53
73
  }, [createElementVNode("path", {
54
- d: unref(CHECKBOX_MARK),
74
+ d: unref(checkboxMark)(__props.indeterminate),
55
75
  stroke: "currentColor",
56
76
  "stroke-width": "2",
57
77
  "stroke-linecap": "round",
@@ -0,0 +1,4 @@
1
+ import Combobox_vue_vue_type_script_setup_true_lang_default from "./Combobox.vue_vue_type_script_setup_true_lang.js";
2
+ // packages/ui-vue/src/Combobox.vue
3
+ var Combobox_default = Combobox_vue_vue_type_script_setup_true_lang_default;
4
+ export { Combobox_default as default };
@@ -0,0 +1,22 @@
1
+ import { type ComboboxBaseProps } from "@xds/core";
2
+ export type ComboboxProps<Value extends string = string> = ComboboxBaseProps<Value>;
3
+ declare const __VLS_export: <Value extends string = string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
4
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<ComboboxProps<Value> & {
5
+ "onUpdate:value"?: ((value: Value) => any) | undefined;
6
+ }> & (typeof globalThis extends {
7
+ __VLS_PROPS_FALLBACK: infer P;
8
+ } ? P : {});
9
+ expose: (exposed: {}) => void;
10
+ attrs: any;
11
+ slots: {};
12
+ emit: (evt: "update:value", value: Value) => void;
13
+ }>) => import('vue').VNode & {
14
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
15
+ };
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
19
+ [K in keyof T]: T[K];
20
+ } : {
21
+ [K in keyof T as K]: T[K];
22
+ }) & {};
@@ -0,0 +1,140 @@
1
+ import { useControllable, useFormReset } from "./controlled.js";
2
+ import Icon_default from "./Icon.js";
3
+ import { useLabels } from "./labels.js";
4
+ import Portal_default from "./Portal.js";
5
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, shallowRef, toDisplayString, unref, useId, useTemplateRef, withCtx } from "vue";
6
+ import { COMBOBOX_PARTS, matchOptions, readCssPx, selectOptionIds } from "@xds/core";
7
+ import { mergeProps as mergeProps$1, normalizeProps as normalizeProps$1, useMachine } from "@zag-js/vue";
8
+ import { space } from "@xds/tokens";
9
+ import * as combobox from "@zag-js/combobox";
10
+ // packages/ui-vue/src/Combobox.vue?vue&type=script&setup=true&lang.ts
11
+ var _hoisted_1 = ["aria-describedby"];
12
+ var _hoisted_2 = ["name", "value"];
13
+ var _hoisted_3 = ["aria-labelledby", "aria-describedby"];
14
+ var _hoisted_4 = ["id"];
15
+ var _hoisted_5 = ["id"];
16
+ var Combobox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
17
+ __name: "Combobox",
18
+ props: {
19
+ label: {},
20
+ options: {},
21
+ value: {},
22
+ defaultValue: {},
23
+ placeholder: {},
24
+ description: {},
25
+ error: {},
26
+ name: {},
27
+ disabled: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ emptyLabel: {}
32
+ },
33
+ emits: ["update:value"],
34
+ setup(__props, { emit: __emit }) {
35
+ const emit = __emit;
36
+ const labels = useLabels();
37
+ const { value, set, controlled, reset } = useControllable("value", () => __props.value, () => __props.defaultValue, (next) => {
38
+ if (next !== void 0) emit("update:value", next);
39
+ });
40
+ const root = useTemplateRef("root");
41
+ useFormReset(() => root.value, controlled, reset);
42
+ const id = useId();
43
+ const descriptionId = `${id}-description`;
44
+ const errorId = `${id}-error`;
45
+ const invalid = computed(() => __props.error !== void 0);
46
+ const query = shallowRef("");
47
+ const shown = computed(() => matchOptions(__props.options, query.value));
48
+ const collection = computed(() => combobox.collection({
49
+ items: shown.value,
50
+ itemToValue: (option) => option.value,
51
+ itemToString: (option) => option.label
52
+ }));
53
+ const service = useMachine(combobox.machine, computed(() => ({
54
+ id,
55
+ collection: collection.value,
56
+ value: value.value === void 0 ? [] : [value.value],
57
+ onValueChange: (details) => {
58
+ const next = details.value[0];
59
+ if (next !== void 0) set(next);
60
+ },
61
+ onInputValueChange: (details) => {
62
+ if (details.reason === "input-change") query.value = details.inputValue;
63
+ },
64
+ onOpenChange: (details) => {
65
+ if (!details.open) query.value = "";
66
+ },
67
+ inputBehavior: "autohighlight",
68
+ selectionBehavior: "replace",
69
+ openOnClick: true,
70
+ disabled: __props.disabled,
71
+ invalid: invalid.value,
72
+ placeholder: __props.placeholder,
73
+ positioning: {
74
+ placement: "bottom-start",
75
+ gutter: readCssPx(null, "--xds-space-1", space[1]),
76
+ sameWidth: true,
77
+ overflowPadding: readCssPx(null, "--xds-space-3", space[3])
78
+ }
79
+ })));
80
+ const api = computed(() => combobox.connect(service, normalizeProps$1));
81
+ const input = computed(() => mergeProps$1(api.value.getInputProps(), { onBlur: () => {
82
+ const chosen = __props.options.find((option) => option.value === value.value)?.label ?? "";
83
+ const now = combobox.connect(service, normalizeProps$1);
84
+ if (now.inputValue !== chosen) now.setInputValue(chosen, "script");
85
+ } }));
86
+ return (_ctx, _cache) => {
87
+ return openBlock(), createElementBlock("div", mergeProps({
88
+ ref_key: "root",
89
+ ref: root
90
+ }, api.value.getRootProps(), { class: "xds-combobox" }), [
91
+ createElementVNode("label", mergeProps(api.value.getLabelProps(), { class: unref(COMBOBOX_PARTS).label }), toDisplayString(__props.label), 17),
92
+ createElementVNode("div", mergeProps(api.value.getControlProps(), { class: unref(COMBOBOX_PARTS).control }), [createElementVNode("input", mergeProps(input.value, {
93
+ "aria-describedby": invalid.value ? errorId : __props.description ? descriptionId : void 0,
94
+ class: unref(COMBOBOX_PARTS).input
95
+ }), null, 16, _hoisted_1), createVNode(Icon_default, {
96
+ name: "chevrons-up-down",
97
+ size: "sm",
98
+ class: normalizeClass(unref(COMBOBOX_PARTS).icon)
99
+ }, null, 8, ["class"])], 16),
100
+ createElementVNode("div", { class: normalizeClass(unref(COMBOBOX_PARTS).footer) }, [!invalid.value && __props.description ? (openBlock(), createElementBlock("span", {
101
+ key: 0,
102
+ id: descriptionId,
103
+ class: normalizeClass(unref(COMBOBOX_PARTS).description)
104
+ }, toDisplayString(__props.description), 3)) : createCommentVNode("", true), createElementVNode("span", {
105
+ id: errorId,
106
+ class: normalizeClass(unref(COMBOBOX_PARTS).error),
107
+ "aria-live": "polite"
108
+ }, toDisplayString(__props.error), 3)], 2),
109
+ __props.name !== void 0 ? (openBlock(), createElementBlock("input", {
110
+ key: 0,
111
+ type: "hidden",
112
+ name: __props.name,
113
+ value: unref(value) ?? ""
114
+ }, null, 8, _hoisted_2)) : createCommentVNode("", true),
115
+ createVNode(Portal_default, null, {
116
+ default: withCtx(() => [createElementVNode("div", mergeProps(api.value.getPositionerProps(), { class: unref(COMBOBOX_PARTS).positioner }), [createElementVNode("div", mergeProps(api.value.getContentProps(), { class: unref(COMBOBOX_PARTS).content }), [shown.value.length === 0 ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, api.value.getEmptyProps(), { class: unref(COMBOBOX_PARTS).empty }), toDisplayString(__props.emptyLabel ?? unref(labels).noMatches), 17)) : (openBlock(), createElementBlock("div", mergeProps({ key: 1 }, api.value.getListProps(), { class: unref(COMBOBOX_PARTS).list }), [(openBlock(true), createElementBlock(Fragment, null, renderList(shown.value, (option, index) => {
117
+ return openBlock(), createElementBlock("div", mergeProps({ key: option.value }, { ref_for: true }, api.value.getItemProps({ item: option }), {
118
+ "aria-labelledby": unref(selectOptionIds)(unref(id), index).label,
119
+ "aria-describedby": option.description ? unref(selectOptionIds)(unref(id), index).description : void 0,
120
+ class: unref(COMBOBOX_PARTS).item
121
+ }), [createElementVNode("span", { class: normalizeClass(unref(COMBOBOX_PARTS).itemWords) }, [createElementVNode("span", mergeProps({ ref_for: true }, api.value.getItemTextProps({ item: option }), {
122
+ id: unref(selectOptionIds)(unref(id), index).label,
123
+ class: unref(COMBOBOX_PARTS).itemLabel
124
+ }), toDisplayString(option.label), 17, _hoisted_4), option.description ? (openBlock(), createElementBlock("span", {
125
+ key: 0,
126
+ id: unref(selectOptionIds)(unref(id), index).description,
127
+ class: normalizeClass(unref(COMBOBOX_PARTS).itemDescription)
128
+ }, toDisplayString(option.description), 11, _hoisted_5)) : createCommentVNode("", true)], 2), api.value.getItemState({ item: option }).selected ? (openBlock(), createBlock(Icon_default, {
129
+ key: 0,
130
+ name: "check",
131
+ size: "sm"
132
+ })) : createCommentVNode("", true)], 16, _hoisted_3);
133
+ }), 128))], 16))], 16)], 16)]),
134
+ _: 1
135
+ })
136
+ ], 16);
137
+ };
138
+ }
139
+ });
140
+ export { Combobox_vue_vue_type_script_setup_true_lang_default as default };
@@ -1,4 +1,5 @@
1
1
  import Icon_default from "./Icon.js";
2
+ import { useLabels } from "./labels.js";
2
3
  import { useModalPopover } from "./modal-popover.js";
3
4
  import Portal_default from "./Portal.js";
4
5
  import { usePresence } from "./presence.js";
@@ -39,11 +40,13 @@ var DatePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
39
40
  const id = useId();
40
41
  const ids = datePickerIds(id);
41
42
  const locale = computed(() => datePickerLocale(props.locale));
43
+ const labels = useLabels();
42
44
  const service = useMachine(datePicker.machine, computed(() => datePickerMachineProps(props, {
43
45
  id,
44
46
  locale: locale.value,
45
47
  onChange: (value) => emit("update:value", value),
46
- gutter: readCssPx(null, "--xds-space-1", space[1])
48
+ gutter: readCssPx(null, "--xds-space-1", space[1]),
49
+ labels: labels.value
47
50
  })));
48
51
  const api = computed(() => datePicker.connect(service, normalizeProps$1));
49
52
  const invalid = computed(() => props.error !== void 0);
@@ -1,4 +1,5 @@
1
1
  import Icon_default from "./Icon.js";
2
+ import { useLabels } from "./labels.js";
2
3
  import { useModalPopover } from "./modal-popover.js";
3
4
  import Portal_default from "./Portal.js";
4
5
  import { usePresence } from "./presence.js";
@@ -58,6 +59,7 @@ var DateRangePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
58
59
  const id = useId();
59
60
  const ids = datePickerIds(id);
60
61
  const locale = computed(() => datePickerLocale(props.locale));
62
+ const labels = useLabels();
61
63
  const draft = shallowRef(null);
62
64
  const months = ref(1);
63
65
  const shown = computed(() => shownRange(props.value, draft.value));
@@ -67,11 +69,12 @@ var DateRangePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
67
69
  months: months.value,
68
70
  onDraft: (next) => draft.value = next,
69
71
  onChange: (value) => emit("update:value", value),
70
- gutter: readCssPx(null, "--xds-space-1", space[1])
72
+ gutter: readCssPx(null, "--xds-space-1", space[1]),
73
+ labels: labels.value
71
74
  })));
72
75
  const api = computed(() => datePicker.connect(service, normalizeProps$1));
73
76
  const invalid = computed(() => props.error !== void 0);
74
- const summary = computed(() => rangeSummary(shown.value, props, locale.value));
77
+ const summary = computed(() => rangeSummary(shown.value, props, locale.value, labels.value));
75
78
  const views = computed(() => rangeMonthViews(api.value, months.value));
76
79
  const trigger = computed(() => {
77
80
  const zag = api.value.getTriggerProps();
@@ -1,14 +1,17 @@
1
1
  import { type DialogBaseProps } from "@xds/core";
2
2
  export type DialogProps = DialogBaseProps;
3
+ type __VLS_Props = DialogProps & {
4
+ id?: string;
5
+ };
3
6
  type __VLS_Slots = {
4
7
  /** The body, between the description and the actions. It scrolls when it is too tall. */
5
8
  default?(): unknown;
6
9
  /** Buttons, in a row at the end edge. Put the main action last. */
7
10
  actions?(): unknown;
8
11
  };
9
- declare const __VLS_base: import("vue").DefineComponent<DialogBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
13
  close: () => any;
11
- }, string, import("vue").PublicProps, Readonly<DialogBaseProps> & Readonly<{
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
15
  onClose?: (() => any) | undefined;
13
16
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
17
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -3,7 +3,7 @@ import { usePresence } from "./presence.js";
3
3
  import { TriggerScope } from "./trigger.js";
4
4
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, useId, useSlots, useTemplateRef, withCtx, withModifiers } from "vue";
5
5
  import { leaveEscapeToFields } 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 * as dialog from "@zag-js/dialog";
8
8
  // packages/ui-vue/src/Dialog.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = {
@@ -24,7 +24,8 @@ var Dialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
24
24
  dismissible: {
25
25
  type: Boolean,
26
26
  default: true
27
- }
27
+ },
28
+ id: {}
28
29
  },
29
30
  emits: ["close"],
30
31
  setup(__props, { emit: __emit }) {
@@ -36,6 +37,7 @@ var Dialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
36
37
  const content = useTemplateRef("content");
37
38
  const service = useMachine(dialog.machine, computed(() => ({
38
39
  id,
40
+ ids: { content: __props.id },
39
41
  open: __props.open,
40
42
  onOpenChange: (details) => {
41
43
  if (!details.open) emit("close");
@@ -60,12 +62,11 @@ var Dialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
60
62
  ref_key: "positioner",
61
63
  ref: positioner,
62
64
  class: "xds-dialog__positioner"
63
- }), [createElementVNode("section", mergeProps(api.value.getContentProps(), {
65
+ }), [createElementVNode("section", mergeProps(unref(mergeProps$1)(api.value.getContentProps(), _ctx.$attrs), {
64
66
  ref_key: "content",
65
67
  ref: content,
66
68
  hidden: false,
67
- class: ["xds-dialog", _ctx.$attrs.class],
68
- style: _ctx.$attrs.style
69
+ class: "xds-dialog"
69
70
  }), [
70
71
  createElementVNode("h2", mergeProps(api.value.getTitleProps(), { class: "xds-dialog__title" }), toDisplayString(__props.title), 17),
71
72
  __props.description ? (openBlock(), createElementBlock("p", mergeProps({ key: 0 }, api.value.getDescriptionProps(), { class: "xds-dialog__description" }), toDisplayString(__props.description), 17)) : createCommentVNode("", true),
@@ -1,8 +1,16 @@
1
1
  import { type IconButtonBaseProps } from "@xds/core";
2
2
  export type IconButtonProps = IconButtonBaseProps;
3
- declare const __VLS_export: import("vue").DefineComponent<IconButtonBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ declare const __VLS_export: import("vue").DefineComponent<IconButtonBaseProps, {
4
+ focus: (options?: FocusOptions) => void | undefined;
5
+ blur: () => void | undefined;
6
+ element: () => HTMLButtonElement | null;
7
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ blur: (event: FocusEvent) => any;
9
+ focus: (event: FocusEvent) => any;
4
10
  press: () => any;
5
11
  }, string, import("vue").PublicProps, Readonly<IconButtonBaseProps> & Readonly<{
12
+ onBlur?: ((event: FocusEvent) => any) | undefined;
13
+ onFocus?: ((event: FocusEvent) => any) | undefined;
6
14
  onPress?: (() => any) | undefined;
7
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
16
  declare const _default: typeof __VLS_export;