@ark-ui/vue 5.16.1 → 5.18.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 (136) hide show
  1. package/dist/components/checkbox/checkbox-group-provider.vue.cjs +33 -0
  2. package/dist/components/checkbox/checkbox-group-provider.vue.d.cts +23 -0
  3. package/dist/components/checkbox/checkbox-group-provider.vue.d.ts +23 -0
  4. package/dist/components/checkbox/checkbox-group-provider.vue.js +29 -0
  5. package/dist/components/checkbox/checkbox-group-provider.vue2.cjs +9 -0
  6. package/dist/components/checkbox/checkbox-group-provider.vue2.js +5 -0
  7. package/dist/components/checkbox/checkbox-group.vue.cjs +1 -1
  8. package/dist/components/checkbox/checkbox-group.vue.js +2 -2
  9. package/dist/components/checkbox/checkbox.cjs +2 -0
  10. package/dist/components/checkbox/checkbox.d.cts +1 -0
  11. package/dist/components/checkbox/checkbox.d.ts +1 -0
  12. package/dist/components/checkbox/checkbox.js +1 -0
  13. package/dist/components/checkbox/index.cjs +2 -0
  14. package/dist/components/checkbox/index.d.cts +1 -0
  15. package/dist/components/checkbox/index.d.ts +1 -0
  16. package/dist/components/checkbox/index.js +1 -0
  17. package/dist/components/checkbox/use-checkbox-group-context.cjs +2 -2
  18. package/dist/components/checkbox/use-checkbox-group-context.d.cts +1 -1
  19. package/dist/components/checkbox/use-checkbox-group-context.d.ts +1 -1
  20. package/dist/components/checkbox/use-checkbox-group-context.js +2 -2
  21. package/dist/components/collapsible/collapsible-trigger.vue.cjs +2 -2
  22. package/dist/components/collapsible/collapsible-trigger.vue.js +3 -3
  23. package/dist/components/collection/index.cjs +2 -0
  24. package/dist/components/collection/index.d.cts +2 -1
  25. package/dist/components/collection/index.d.ts +2 -1
  26. package/dist/components/collection/index.js +1 -0
  27. package/dist/components/collection/tree-collection.js +1 -1
  28. package/dist/components/collection/use-list-selection.cjs +115 -0
  29. package/dist/components/collection/use-list-selection.d.cts +104 -0
  30. package/dist/components/collection/use-list-selection.d.ts +104 -0
  31. package/dist/components/collection/use-list-selection.js +111 -0
  32. package/dist/components/combobox/combobox-item-group.vue.cjs +2 -1
  33. package/dist/components/combobox/combobox-item-group.vue.js +2 -1
  34. package/dist/components/date-picker/date-picker-table.vue.cjs +2 -1
  35. package/dist/components/date-picker/date-picker-table.vue.js +2 -1
  36. package/dist/components/date-picker/use-date-picker.cjs +0 -1
  37. package/dist/components/date-picker/use-date-picker.js +0 -1
  38. package/dist/components/file-upload/file-upload-root.vue.cjs +2 -1
  39. package/dist/components/file-upload/file-upload-root.vue.d.cts +2 -0
  40. package/dist/components/file-upload/file-upload-root.vue.d.ts +2 -0
  41. package/dist/components/file-upload/file-upload-root.vue.js +2 -1
  42. package/dist/components/file-upload/file-upload.d.cts +1 -1
  43. package/dist/components/file-upload/file-upload.d.ts +1 -1
  44. package/dist/components/file-upload/file-upload.types.d.cts +8 -0
  45. package/dist/components/file-upload/file-upload.types.d.ts +8 -0
  46. package/dist/components/file-upload/index.d.cts +1 -1
  47. package/dist/components/file-upload/index.d.ts +1 -1
  48. package/dist/components/file-upload/use-file-upload.cjs +1 -0
  49. package/dist/components/file-upload/use-file-upload.js +1 -0
  50. package/dist/components/index.cjs +12 -0
  51. package/dist/components/index.d.cts +1 -0
  52. package/dist/components/index.d.ts +1 -0
  53. package/dist/components/index.js +7 -0
  54. package/dist/components/json-tree-view/get-branch-value.cjs +18 -0
  55. package/dist/components/json-tree-view/get-branch-value.d.cts +3 -0
  56. package/dist/components/json-tree-view/get-branch-value.d.ts +3 -0
  57. package/dist/components/json-tree-view/get-branch-value.js +14 -0
  58. package/dist/components/json-tree-view/index.cjs +17 -0
  59. package/dist/components/json-tree-view/index.d.cts +5 -0
  60. package/dist/components/json-tree-view/index.d.ts +5 -0
  61. package/dist/components/json-tree-view/index.js +6 -0
  62. package/dist/components/json-tree-view/json-tree-view-key-node.vue.cjs +30 -0
  63. package/dist/components/json-tree-view/json-tree-view-key-node.vue.d.cts +14 -0
  64. package/dist/components/json-tree-view/json-tree-view-key-node.vue.d.ts +14 -0
  65. package/dist/components/json-tree-view/json-tree-view-key-node.vue.js +26 -0
  66. package/dist/components/json-tree-view/json-tree-view-key-node.vue2.cjs +9 -0
  67. package/dist/components/json-tree-view/json-tree-view-key-node.vue2.js +5 -0
  68. package/dist/components/json-tree-view/json-tree-view-node.vue.cjs +140 -0
  69. package/dist/components/json-tree-view/json-tree-view-node.vue.d.cts +28 -0
  70. package/dist/components/json-tree-view/json-tree-view-node.vue.d.ts +28 -0
  71. package/dist/components/json-tree-view/json-tree-view-node.vue.js +136 -0
  72. package/dist/components/json-tree-view/json-tree-view-node.vue2.cjs +9 -0
  73. package/dist/components/json-tree-view/json-tree-view-node.vue2.js +5 -0
  74. package/dist/components/json-tree-view/json-tree-view-props-context.cjs +10 -0
  75. package/dist/components/json-tree-view/json-tree-view-props-context.d.cts +9 -0
  76. package/dist/components/json-tree-view/json-tree-view-props-context.d.ts +9 -0
  77. package/dist/components/json-tree-view/json-tree-view-props-context.js +5 -0
  78. package/dist/components/json-tree-view/json-tree-view-root-provider.vue.cjs +28 -0
  79. package/dist/components/json-tree-view/json-tree-view-root-provider.vue.d.cts +22 -0
  80. package/dist/components/json-tree-view/json-tree-view-root-provider.vue.d.ts +22 -0
  81. package/dist/components/json-tree-view/json-tree-view-root-provider.vue.js +24 -0
  82. package/dist/components/json-tree-view/json-tree-view-root-provider.vue2.cjs +9 -0
  83. package/dist/components/json-tree-view/json-tree-view-root-provider.vue2.js +5 -0
  84. package/dist/components/json-tree-view/json-tree-view-root.vue.cjs +87 -0
  85. package/dist/components/json-tree-view/json-tree-view-root.vue.d.cts +37 -0
  86. package/dist/components/json-tree-view/json-tree-view-root.vue.d.ts +37 -0
  87. package/dist/components/json-tree-view/json-tree-view-root.vue.js +83 -0
  88. package/dist/components/json-tree-view/json-tree-view-root.vue2.cjs +9 -0
  89. package/dist/components/json-tree-view/json-tree-view-root.vue2.js +5 -0
  90. package/dist/components/json-tree-view/json-tree-view-tree.vue.cjs +51 -0
  91. package/dist/components/json-tree-view/json-tree-view-tree.vue.d.cts +27 -0
  92. package/dist/components/json-tree-view/json-tree-view-tree.vue.d.ts +27 -0
  93. package/dist/components/json-tree-view/json-tree-view-tree.vue.js +47 -0
  94. package/dist/components/json-tree-view/json-tree-view-tree.vue2.cjs +9 -0
  95. package/dist/components/json-tree-view/json-tree-view-tree.vue2.js +5 -0
  96. package/dist/components/json-tree-view/json-tree-view-value-node.vue.cjs +49 -0
  97. package/dist/components/json-tree-view/json-tree-view-value-node.vue.d.cts +28 -0
  98. package/dist/components/json-tree-view/json-tree-view-value-node.vue.d.ts +28 -0
  99. package/dist/components/json-tree-view/json-tree-view-value-node.vue.js +45 -0
  100. package/dist/components/json-tree-view/json-tree-view-value-node.vue2.cjs +9 -0
  101. package/dist/components/json-tree-view/json-tree-view-value-node.vue2.js +5 -0
  102. package/dist/components/json-tree-view/json-tree-view.cjs +13 -0
  103. package/dist/components/json-tree-view/json-tree-view.d.cts +3 -0
  104. package/dist/components/json-tree-view/json-tree-view.d.ts +3 -0
  105. package/dist/components/json-tree-view/json-tree-view.js +3 -0
  106. package/dist/components/json-tree-view/use-json-tree-view.cjs +30 -0
  107. package/dist/components/json-tree-view/use-json-tree-view.d.cts +10 -0
  108. package/dist/components/json-tree-view/use-json-tree-view.d.ts +10 -0
  109. package/dist/components/json-tree-view/use-json-tree-view.js +26 -0
  110. package/dist/components/listbox/listbox-item-group.vue.cjs +2 -1
  111. package/dist/components/listbox/listbox-item-group.vue.js +2 -1
  112. package/dist/components/menu/menu-item-group.vue.cjs +2 -1
  113. package/dist/components/menu/menu-item-group.vue.js +2 -1
  114. package/dist/components/menu/menu-radio-item-group.vue.cjs +2 -1
  115. package/dist/components/menu/menu-radio-item-group.vue.js +2 -1
  116. package/dist/components/password-input/password-input-context.vue.d.cts +9 -9
  117. package/dist/components/password-input/password-input-context.vue.d.ts +9 -9
  118. package/dist/components/select/select-item-group.vue.cjs +2 -1
  119. package/dist/components/select/select-item-group.vue.js +2 -1
  120. package/dist/components/signature-pad/signature-pad-root.vue.cjs +2 -1
  121. package/dist/components/signature-pad/signature-pad-root.vue.d.cts +2 -0
  122. package/dist/components/signature-pad/signature-pad-root.vue.d.ts +2 -0
  123. package/dist/components/signature-pad/signature-pad-root.vue.js +2 -1
  124. package/dist/components/signature-pad/signature-pad.types.d.cts +8 -0
  125. package/dist/components/signature-pad/signature-pad.types.d.ts +8 -0
  126. package/dist/components/signature-pad/use-signature-pad.cjs +1 -0
  127. package/dist/components/signature-pad/use-signature-pad.js +1 -0
  128. package/dist/components/tabs/tabs-root.vue.d.cts +1 -1
  129. package/dist/components/tabs/tabs-root.vue.d.ts +1 -1
  130. package/dist/components/toggle-group/toggle-group-root.vue.d.cts +1 -1
  131. package/dist/components/toggle-group/toggle-group-root.vue.d.ts +1 -1
  132. package/dist/components/tree-view/tree-view-root.vue.cjs +4 -1
  133. package/dist/components/tree-view/tree-view-root.vue.js +4 -1
  134. package/dist/index.cjs +12 -0
  135. package/dist/index.js +7 -0
  136. package/package.json +61 -60
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const vue = require('vue');
6
+ const factory = require('../factory.cjs');
7
+ const useCheckboxGroupContext = require('./use-checkbox-group-context.cjs');
8
+ const useForwardExpose = require('../../utils/use-forward-expose.cjs');
9
+ const checkbox_anatomy = require('./checkbox.anatomy.cjs');
10
+
11
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
+ __name: "checkbox-group-provider",
13
+ props: {
14
+ value: {},
15
+ asChild: { type: Boolean }
16
+ },
17
+ setup(__props) {
18
+ const props = __props;
19
+ const checkboxGroup = vue.computed(() => props.value);
20
+ useCheckboxGroupContext.CheckboxGroupContextProvider(checkboxGroup);
21
+ useForwardExpose.useForwardExpose();
22
+ return (_ctx, _cache) => {
23
+ return vue.openBlock(), vue.createBlock(vue.unref(factory.ark).div, vue.mergeProps({ role: "group" }, vue.unref(checkbox_anatomy.checkboxAnatomy).build().group.attrs, { "as-child": _ctx.asChild }), {
24
+ default: vue.withCtx(() => [
25
+ vue.renderSlot(_ctx.$slots, "default")
26
+ ]),
27
+ _: 3
28
+ }, 16, ["as-child"]);
29
+ };
30
+ }
31
+ });
32
+
33
+ exports.default = _sfc_main;
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, UnwrapRef, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { PolymorphicProps } from '../factory';
3
+ import { UseCheckboxGroupReturn } from './use-checkbox-group';
4
+ interface GroupProviderProps {
5
+ value: UnwrapRef<UseCheckboxGroupReturn>;
6
+ }
7
+ export interface CheckboxGroupProviderBaseProps extends GroupProviderProps, PolymorphicProps {
8
+ }
9
+ export interface CheckboxGroupProviderProps extends CheckboxGroupProviderBaseProps,
10
+ /**
11
+ * @vue-ignore
12
+ */
13
+ HTMLAttributes {
14
+ }
15
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<CheckboxGroupProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CheckboxGroupProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
16
+ default?(_: {}): any;
17
+ }>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, UnwrapRef, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { PolymorphicProps } from '../factory';
3
+ import { UseCheckboxGroupReturn } from './use-checkbox-group';
4
+ interface GroupProviderProps {
5
+ value: UnwrapRef<UseCheckboxGroupReturn>;
6
+ }
7
+ export interface CheckboxGroupProviderBaseProps extends GroupProviderProps, PolymorphicProps {
8
+ }
9
+ export interface CheckboxGroupProviderProps extends CheckboxGroupProviderBaseProps,
10
+ /**
11
+ * @vue-ignore
12
+ */
13
+ HTMLAttributes {
14
+ }
15
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<CheckboxGroupProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CheckboxGroupProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
16
+ default?(_: {}): any;
17
+ }>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
2
+ import { ark } from '../factory.js';
3
+ import { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';
4
+ import { useForwardExpose } from '../../utils/use-forward-expose.js';
5
+ import { checkboxAnatomy } from './checkbox.anatomy.js';
6
+
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "checkbox-group-provider",
9
+ props: {
10
+ value: {},
11
+ asChild: { type: Boolean }
12
+ },
13
+ setup(__props) {
14
+ const props = __props;
15
+ const checkboxGroup = computed(() => props.value);
16
+ CheckboxGroupContextProvider(checkboxGroup);
17
+ useForwardExpose();
18
+ return (_ctx, _cache) => {
19
+ return openBlock(), createBlock(unref(ark).div, mergeProps({ role: "group" }, unref(checkboxAnatomy).build().group.attrs, { "as-child": _ctx.asChild }), {
20
+ default: withCtx(() => [
21
+ renderSlot(_ctx.$slots, "default")
22
+ ]),
23
+ _: 3
24
+ }, 16, ["as-child"]);
25
+ };
26
+ }
27
+ });
28
+
29
+ export { _sfc_main as default };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const checkboxGroupProvider_vue_vue_type_script_setup_true_lang = require('./checkbox-group-provider.vue.cjs');
6
+
7
+
8
+
9
+ exports.default = checkboxGroupProvider_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './checkbox-group-provider.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
29
  const props = __props;
30
30
  const emits = __emit;
31
31
  const checkboxGroup = useCheckboxGroup.useCheckboxGroup(props, emits);
32
- useCheckboxGroupContext.CheckboxGroupProvider(checkboxGroup);
32
+ useCheckboxGroupContext.CheckboxGroupContextProvider(checkboxGroup);
33
33
  useForwardExpose.useForwardExpose();
34
34
  return (_ctx, _cache) => {
35
35
  return vue.openBlock(), vue.createBlock(vue.unref(factory.ark).div, vue.mergeProps({ role: "group" }, { ...vue.unref(checkbox_anatomy.checkboxAnatomy).build().group.attrs }, { "as-child": _ctx.asChild }), {
@@ -2,7 +2,7 @@ import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergePro
2
2
  import { ark } from '../factory.js';
3
3
  import { checkboxAnatomy } from './checkbox.anatomy.js';
4
4
  import { useCheckboxGroup } from './use-checkbox-group.js';
5
- import { CheckboxGroupProvider } from './use-checkbox-group-context.js';
5
+ import { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';
6
6
  import { useForwardExpose } from '../../utils/use-forward-expose.js';
7
7
 
8
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
25
  const props = __props;
26
26
  const emits = __emit;
27
27
  const checkboxGroup = useCheckboxGroup(props, emits);
28
- CheckboxGroupProvider(checkboxGroup);
28
+ CheckboxGroupContextProvider(checkboxGroup);
29
29
  useForwardExpose();
30
30
  return (_ctx, _cache) => {
31
31
  return openBlock(), createBlock(unref(ark).div, mergeProps({ role: "group" }, { ...unref(checkboxAnatomy).build().group.attrs }, { "as-child": _ctx.asChild }), {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const checkboxContext_vue_vue_type_script_setup_true_lang = require('./checkbox-context.vue.cjs');
6
6
  const checkboxControl_vue_vue_type_script_setup_true_lang = require('./checkbox-control.vue.cjs');
7
7
  const checkboxGroup_vue_vue_type_script_setup_true_lang = require('./checkbox-group.vue.cjs');
8
+ const checkboxGroupProvider_vue_vue_type_script_setup_true_lang = require('./checkbox-group-provider.vue.cjs');
8
9
  const checkboxHiddenInput_vue_vue_type_script_setup_true_lang = require('./checkbox-hidden-input.vue.cjs');
9
10
  const checkboxIndicator_vue_vue_type_script_setup_true_lang = require('./checkbox-indicator.vue.cjs');
10
11
  const checkboxLabel_vue_vue_type_script_setup_true_lang = require('./checkbox-label.vue.cjs');
@@ -16,6 +17,7 @@ const checkboxRoot_vue_vue_type_script_setup_true_lang = require('./checkbox-roo
16
17
  exports.Context = checkboxContext_vue_vue_type_script_setup_true_lang.default;
17
18
  exports.Control = checkboxControl_vue_vue_type_script_setup_true_lang.default;
18
19
  exports.Group = checkboxGroup_vue_vue_type_script_setup_true_lang.default;
20
+ exports.GroupProvider = checkboxGroupProvider_vue_vue_type_script_setup_true_lang.default;
19
21
  exports.HiddenInput = checkboxHiddenInput_vue_vue_type_script_setup_true_lang.default;
20
22
  exports.Indicator = checkboxIndicator_vue_vue_type_script_setup_true_lang.default;
21
23
  exports.Label = checkboxLabel_vue_vue_type_script_setup_true_lang.default;
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails, CheckedState } from '@zag-js/checkbox';
2
2
  export { default as Context, type CheckboxContextProps as ContextProps } from './checkbox-context.vue';
3
3
  export { default as Control, type CheckboxControlBaseProps as ControlBaseProps, type CheckboxControlProps as ControlProps, } from './checkbox-control.vue';
4
4
  export { default as Group, type CheckboxGroupBaseProps as GroupBaseProps, type CheckboxGroupProps as GroupProps, } from './checkbox-group.vue';
5
+ export { default as GroupProvider, type CheckboxGroupProviderBaseProps as GroupProviderBaseProps, type CheckboxGroupProviderProps as GroupProviderProps, } from './checkbox-group-provider.vue';
5
6
  export { default as HiddenInput, type CheckboxHiddenInputBaseProps as HiddenInputBaseProps, type CheckboxHiddenInputProps as HiddenInputProps, } from './checkbox-hidden-input.vue';
6
7
  export { default as Indicator, type CheckboxIndicatorBaseProps as IndicatorBaseProps, type CheckboxIndicatorProps as IndicatorProps, } from './checkbox-indicator.vue';
7
8
  export { default as Label, type CheckboxLabelBaseProps as LabelBaseProps, type CheckboxLabelProps as LabelProps, } from './checkbox-label.vue';
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails, CheckedState } from '@zag-js/checkbox';
2
2
  export { default as Context, type CheckboxContextProps as ContextProps } from './checkbox-context.vue';
3
3
  export { default as Control, type CheckboxControlBaseProps as ControlBaseProps, type CheckboxControlProps as ControlProps, } from './checkbox-control.vue';
4
4
  export { default as Group, type CheckboxGroupBaseProps as GroupBaseProps, type CheckboxGroupProps as GroupProps, } from './checkbox-group.vue';
5
+ export { default as GroupProvider, type CheckboxGroupProviderBaseProps as GroupProviderBaseProps, type CheckboxGroupProviderProps as GroupProviderProps, } from './checkbox-group-provider.vue';
5
6
  export { default as HiddenInput, type CheckboxHiddenInputBaseProps as HiddenInputBaseProps, type CheckboxHiddenInputProps as HiddenInputProps, } from './checkbox-hidden-input.vue';
6
7
  export { default as Indicator, type CheckboxIndicatorBaseProps as IndicatorBaseProps, type CheckboxIndicatorProps as IndicatorProps, } from './checkbox-indicator.vue';
7
8
  export { default as Label, type CheckboxLabelBaseProps as LabelBaseProps, type CheckboxLabelProps as LabelProps, } from './checkbox-label.vue';
@@ -1,6 +1,7 @@
1
1
  export { default as Context } from './checkbox-context.vue.js';
2
2
  export { default as Control } from './checkbox-control.vue.js';
3
3
  export { default as Group } from './checkbox-group.vue.js';
4
+ export { default as GroupProvider } from './checkbox-group-provider.vue.js';
4
5
  export { default as HiddenInput } from './checkbox-hidden-input.vue.js';
5
6
  export { default as Indicator } from './checkbox-indicator.vue.js';
6
7
  export { default as Label } from './checkbox-label.vue.js';
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const checkboxContext_vue_vue_type_script_setup_true_lang = require('./checkbox-context.vue.cjs');
6
6
  const checkboxControl_vue_vue_type_script_setup_true_lang = require('./checkbox-control.vue.cjs');
7
7
  const checkboxGroup_vue_vue_type_script_setup_true_lang = require('./checkbox-group.vue.cjs');
8
+ const checkboxGroupProvider_vue_vue_type_script_setup_true_lang = require('./checkbox-group-provider.vue.cjs');
8
9
  const checkboxHiddenInput_vue_vue_type_script_setup_true_lang = require('./checkbox-hidden-input.vue.cjs');
9
10
  const checkboxIndicator_vue_vue_type_script_setup_true_lang = require('./checkbox-indicator.vue.cjs');
10
11
  const checkboxLabel_vue_vue_type_script_setup_true_lang = require('./checkbox-label.vue.cjs');
@@ -22,6 +23,7 @@ const checkbox = require('./checkbox.cjs');
22
23
  exports.CheckboxContext = checkboxContext_vue_vue_type_script_setup_true_lang.default;
23
24
  exports.CheckboxControl = checkboxControl_vue_vue_type_script_setup_true_lang.default;
24
25
  exports.CheckboxGroup = checkboxGroup_vue_vue_type_script_setup_true_lang.default;
26
+ exports.CheckboxGroupProvider = checkboxGroupProvider_vue_vue_type_script_setup_true_lang.default;
25
27
  exports.CheckboxHiddenInput = checkboxHiddenInput_vue_vue_type_script_setup_true_lang.default;
26
28
  exports.CheckboxIndicator = checkboxIndicator_vue_vue_type_script_setup_true_lang.default;
27
29
  exports.CheckboxLabel = checkboxLabel_vue_vue_type_script_setup_true_lang.default;
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState
2
2
  export { default as CheckboxContext, type CheckboxContextProps } from './checkbox-context.vue';
3
3
  export { default as CheckboxControl, type CheckboxControlProps, type CheckboxControlBaseProps, } from './checkbox-control.vue';
4
4
  export { default as CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupBaseProps } from './checkbox-group.vue';
5
+ export { default as CheckboxGroupProvider, type CheckboxGroupProviderProps, type CheckboxGroupProviderBaseProps, } from './checkbox-group-provider.vue';
5
6
  export { default as CheckboxHiddenInput, type CheckboxHiddenInputProps, type CheckboxHiddenInputBaseProps, } from './checkbox-hidden-input.vue';
6
7
  export { default as CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxIndicatorBaseProps, } from './checkbox-indicator.vue';
7
8
  export { default as CheckboxLabel, type CheckboxLabelProps, type CheckboxLabelBaseProps } from './checkbox-label.vue';
@@ -2,6 +2,7 @@ export type { CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState
2
2
  export { default as CheckboxContext, type CheckboxContextProps } from './checkbox-context.vue';
3
3
  export { default as CheckboxControl, type CheckboxControlProps, type CheckboxControlBaseProps, } from './checkbox-control.vue';
4
4
  export { default as CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupBaseProps } from './checkbox-group.vue';
5
+ export { default as CheckboxGroupProvider, type CheckboxGroupProviderProps, type CheckboxGroupProviderBaseProps, } from './checkbox-group-provider.vue';
5
6
  export { default as CheckboxHiddenInput, type CheckboxHiddenInputProps, type CheckboxHiddenInputBaseProps, } from './checkbox-hidden-input.vue';
6
7
  export { default as CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxIndicatorBaseProps, } from './checkbox-indicator.vue';
7
8
  export { default as CheckboxLabel, type CheckboxLabelProps, type CheckboxLabelBaseProps } from './checkbox-label.vue';
@@ -1,6 +1,7 @@
1
1
  export { default as CheckboxContext } from './checkbox-context.vue.js';
2
2
  export { default as CheckboxControl } from './checkbox-control.vue.js';
3
3
  export { default as CheckboxGroup } from './checkbox-group.vue.js';
4
+ export { default as CheckboxGroupProvider } from './checkbox-group-provider.vue.js';
4
5
  export { default as CheckboxHiddenInput } from './checkbox-hidden-input.vue.js';
5
6
  export { default as CheckboxIndicator } from './checkbox-indicator.vue.js';
6
7
  export { default as CheckboxLabel } from './checkbox-label.vue.js';
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const createContext = require('../../utils/create-context.cjs');
6
6
 
7
- const [CheckboxGroupProvider, useCheckboxGroupContext] = createContext.createContext('CheckboxGroupContext');
7
+ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext.createContext('CheckboxGroupContext');
8
8
 
9
- exports.CheckboxGroupProvider = CheckboxGroupProvider;
9
+ exports.CheckboxGroupContextProvider = CheckboxGroupContextProvider;
10
10
  exports.useCheckboxGroupContext = useCheckboxGroupContext;
@@ -1,4 +1,4 @@
1
1
  import { UseCheckboxGroupReturn } from './use-checkbox-group';
2
2
  export interface UseCheckboxGroupContext extends UseCheckboxGroupReturn {
3
3
  }
4
- export declare const CheckboxGroupProvider: (opts: UseCheckboxGroupContext | undefined) => void, useCheckboxGroupContext: (fallback?: UseCheckboxGroupContext | undefined) => UseCheckboxGroupContext | undefined;
4
+ export declare const CheckboxGroupContextProvider: (opts: UseCheckboxGroupContext | undefined) => void, useCheckboxGroupContext: (fallback?: UseCheckboxGroupContext | undefined) => UseCheckboxGroupContext | undefined;
@@ -1,4 +1,4 @@
1
1
  import { UseCheckboxGroupReturn } from './use-checkbox-group';
2
2
  export interface UseCheckboxGroupContext extends UseCheckboxGroupReturn {
3
3
  }
4
- export declare const CheckboxGroupProvider: (opts: UseCheckboxGroupContext | undefined) => void, useCheckboxGroupContext: (fallback?: UseCheckboxGroupContext | undefined) => UseCheckboxGroupContext | undefined;
4
+ export declare const CheckboxGroupContextProvider: (opts: UseCheckboxGroupContext | undefined) => void, useCheckboxGroupContext: (fallback?: UseCheckboxGroupContext | undefined) => UseCheckboxGroupContext | undefined;
@@ -1,5 +1,5 @@
1
1
  import { createContext } from '../../utils/create-context.js';
2
2
 
3
- const [CheckboxGroupProvider, useCheckboxGroupContext] = createContext('CheckboxGroupContext');
3
+ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext('CheckboxGroupContext');
4
4
 
5
- export { CheckboxGroupProvider, useCheckboxGroupContext };
5
+ export { CheckboxGroupContextProvider, useCheckboxGroupContext };
@@ -16,12 +16,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
16
  const collapsible = useCollapsibleContext.useCollapsibleContext();
17
17
  useForwardExpose.useForwardExpose();
18
18
  return (_ctx, _cache) => {
19
- return vue.openBlock(), vue.createBlock(vue.unref(factory.ark).button, vue.normalizeProps(vue.guardReactiveProps(vue.unref(collapsible).getTriggerProps())), {
19
+ return vue.openBlock(), vue.createBlock(vue.unref(factory.ark).button, vue.mergeProps(vue.unref(collapsible).getTriggerProps(), { "as-child": _ctx.asChild }), {
20
20
  default: vue.withCtx(() => [
21
21
  vue.renderSlot(_ctx.$slots, "default")
22
22
  ]),
23
23
  _: 3
24
- }, 16);
24
+ }, 16, ["as-child"]);
25
25
  };
26
26
  }
27
27
  });
@@ -1,4 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, renderSlot } from 'vue';
1
+ import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
2
2
  import { ark } from '../factory.js';
3
3
  import { useCollapsibleContext } from './use-collapsible-context.js';
4
4
  import { useForwardExpose } from '../../utils/use-forward-expose.js';
@@ -12,12 +12,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  const collapsible = useCollapsibleContext();
13
13
  useForwardExpose();
14
14
  return (_ctx, _cache) => {
15
- return openBlock(), createBlock(unref(ark).button, normalizeProps(guardReactiveProps(unref(collapsible).getTriggerProps())), {
15
+ return openBlock(), createBlock(unref(ark).button, mergeProps(unref(collapsible).getTriggerProps(), { "as-child": _ctx.asChild }), {
16
16
  default: withCtx(() => [
17
17
  renderSlot(_ctx.$slots, "default")
18
18
  ]),
19
19
  _: 3
20
- }, 16);
20
+ }, 16, ["as-child"]);
21
21
  };
22
22
  }
23
23
  });
@@ -6,6 +6,7 @@ const gridCollection = require('./grid-collection.cjs');
6
6
  const listCollection = require('./list-collection.cjs');
7
7
  const treeCollection = require('./tree-collection.cjs');
8
8
  const useListCollection = require('./use-list-collection.cjs');
9
+ const useListSelection = require('./use-list-selection.cjs');
9
10
 
10
11
 
11
12
 
@@ -14,3 +15,4 @@ exports.createListCollection = listCollection.createListCollection;
14
15
  exports.createFileTreeCollection = treeCollection.createFileTreeCollection;
15
16
  exports.createTreeCollection = treeCollection.createTreeCollection;
16
17
  exports.useListCollection = useListCollection.useListCollection;
18
+ exports.useListSelection = useListSelection.useListSelection;
@@ -1,4 +1,5 @@
1
1
  export { createGridCollection, type GridCollection, type GridCollectionOptions } from './grid-collection';
2
2
  export { createListCollection, type CollectionItem, type CollectionOptions, type ListCollection, } from './list-collection';
3
3
  export { createFileTreeCollection, createTreeCollection, type FilePathTreeNode, type FlatTreeNode, type TreeCollection, type TreeCollectionOptions, type TreeNode, } from './tree-collection';
4
- export { useListCollection, type UseListCollectionProps } from './use-list-collection';
4
+ export { useListCollection, type UseListCollectionProps, type UseListCollectionReturn } from './use-list-collection';
5
+ export { useListSelection, type UseListSelectionProps, type UseListSelectionReturn } from './use-list-selection';
@@ -1,4 +1,5 @@
1
1
  export { createGridCollection, type GridCollection, type GridCollectionOptions } from './grid-collection';
2
2
  export { createListCollection, type CollectionItem, type CollectionOptions, type ListCollection, } from './list-collection';
3
3
  export { createFileTreeCollection, createTreeCollection, type FilePathTreeNode, type FlatTreeNode, type TreeCollection, type TreeCollectionOptions, type TreeNode, } from './tree-collection';
4
- export { useListCollection, type UseListCollectionProps } from './use-list-collection';
4
+ export { useListCollection, type UseListCollectionProps, type UseListCollectionReturn } from './use-list-collection';
5
+ export { useListSelection, type UseListSelectionProps, type UseListSelectionReturn } from './use-list-selection';
@@ -2,3 +2,4 @@ export { createGridCollection } from './grid-collection.js';
2
2
  export { createListCollection } from './list-collection.js';
3
3
  export { createFileTreeCollection, createTreeCollection } from './tree-collection.js';
4
4
  export { useListCollection } from './use-list-collection.js';
5
+ export { useListSelection } from './use-list-selection.js';
@@ -1,4 +1,4 @@
1
- import { filePathToTree, TreeCollection } from '@zag-js/collection';
1
+ import { TreeCollection, filePathToTree } from '@zag-js/collection';
2
2
 
3
3
  const createTreeCollection = (options) => new TreeCollection(options);
4
4
  const createFileTreeCollection = (paths) => filePathToTree(paths);
@@ -0,0 +1,115 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const collection = require('@zag-js/collection');
6
+ const vue = require('vue');
7
+
8
+ function useListSelection(props) {
9
+ const resolvedProps = vue.computed(() => {
10
+ const {
11
+ collection,
12
+ selectionMode = "single",
13
+ deselectable = true,
14
+ initialSelectedValues = [],
15
+ resetOnCollectionChange = false
16
+ } = vue.toValue(props);
17
+ return { collection, selectionMode, deselectable, initialSelectedValues, resetOnCollectionChange };
18
+ });
19
+ const createSelection = (values = []) => {
20
+ const { selectionMode, deselectable } = resolvedProps.value;
21
+ const selection2 = new collection.Selection(values);
22
+ selection2.selectionMode = selectionMode;
23
+ selection2.deselectable = deselectable;
24
+ return selection2;
25
+ };
26
+ const init = () => {
27
+ const { initialSelectedValues } = resolvedProps.value;
28
+ return createSelection(initialSelectedValues);
29
+ };
30
+ const selection = vue.shallowRef(init());
31
+ vue.watch(
32
+ [() => resolvedProps.value.collection.getValues(), () => resolvedProps.value.resetOnCollectionChange],
33
+ ([, resetOnCollectionChange]) => {
34
+ if (resetOnCollectionChange) {
35
+ selection.value = createSelection();
36
+ }
37
+ }
38
+ );
39
+ const selectedValues = vue.computed(() => Array.from(selection.value));
40
+ const isEmpty = vue.computed(() => selection.value.isEmpty());
41
+ const firstSelectedValue = vue.computed(() => {
42
+ const { collection } = resolvedProps.value;
43
+ return selection.value.firstSelectedValue(collection);
44
+ });
45
+ const lastSelectedValue = vue.computed(() => {
46
+ const { collection } = resolvedProps.value;
47
+ return selection.value.lastSelectedValue(collection);
48
+ });
49
+ return {
50
+ selectedValues,
51
+ isEmpty,
52
+ firstSelectedValue,
53
+ lastSelectedValue,
54
+ isSelected: (value) => {
55
+ return selection.value.isSelected(value);
56
+ },
57
+ isAllSelected: () => {
58
+ const { collection } = resolvedProps.value;
59
+ const allValues = collection.getValues();
60
+ return allValues.length > 0 && allValues.every((value) => selection.value.isSelected(value));
61
+ },
62
+ isSomeSelected: () => {
63
+ const { collection } = resolvedProps.value;
64
+ const allValues = collection.getValues();
65
+ return allValues.some((value) => selection.value.isSelected(value));
66
+ },
67
+ canSelect: (value) => {
68
+ const { collection } = resolvedProps.value;
69
+ return selection.value.canSelect(collection, value);
70
+ },
71
+ select: (value, forceToggle) => {
72
+ const { collection } = resolvedProps.value;
73
+ selection.value = selection.value.select(collection, value, forceToggle);
74
+ },
75
+ deselect: (value) => {
76
+ selection.value = selection.value.deselect(value);
77
+ },
78
+ toggle: (value) => {
79
+ const { collection } = resolvedProps.value;
80
+ selection.value = selection.value.toggleSelection(collection, value);
81
+ },
82
+ replace: (value) => {
83
+ const { collection } = resolvedProps.value;
84
+ selection.value = selection.value.replaceSelection(collection, value);
85
+ },
86
+ extend: (anchorValue, targetValue) => {
87
+ const { collection } = resolvedProps.value;
88
+ selection.value = selection.value.extendSelection(collection, anchorValue, targetValue);
89
+ },
90
+ setSelectedValues: (values) => {
91
+ selection.value = selection.value.setSelection(values);
92
+ },
93
+ clear: () => {
94
+ selection.value = selection.value.clearSelection();
95
+ },
96
+ resetSelection: () => {
97
+ selection.value = createSelection();
98
+ },
99
+ setSelection: (newSelection) => {
100
+ selection.value = selection.value.setSelection(newSelection);
101
+ },
102
+ setSelectionMode: (mode) => {
103
+ const newSelection = selection.value.copy();
104
+ newSelection.selectionMode = mode;
105
+ selection.value = newSelection;
106
+ },
107
+ setDeselectable: (deselectable) => {
108
+ const newSelection = selection.value.copy();
109
+ newSelection.deselectable = deselectable;
110
+ selection.value = newSelection;
111
+ }
112
+ };
113
+ }
114
+
115
+ exports.useListSelection = useListSelection;
@@ -0,0 +1,104 @@
1
+ import { SelectionMode } from '@zag-js/collection';
2
+ import { MaybeRef, Ref } from 'vue';
3
+ import { CollectionItem, ListCollection } from './list-collection';
4
+ export interface UseListSelectionProps<T extends CollectionItem> {
5
+ /**
6
+ * The selection mode.
7
+ */
8
+ selectionMode?: SelectionMode;
9
+ /**
10
+ * Whether the selection is deselectable.
11
+ */
12
+ deselectable?: boolean;
13
+ /**
14
+ * The initial selected values.
15
+ */
16
+ initialSelectedValues?: string[];
17
+ /**
18
+ * Whether to reset the selection when the collection changes.
19
+ */
20
+ resetOnCollectionChange?: boolean;
21
+ /**
22
+ * The collection to use.
23
+ */
24
+ collection: ListCollection<T>;
25
+ }
26
+ export declare function useListSelection<T extends CollectionItem>(props: MaybeRef<UseListSelectionProps<T>>): UseListSelectionReturn;
27
+ export interface UseListSelectionReturn {
28
+ /**
29
+ * The selected values as an array.
30
+ */
31
+ selectedValues: Ref<string[]>;
32
+ /**
33
+ * Whether the selection is empty.
34
+ */
35
+ isEmpty: Ref<boolean>;
36
+ /**
37
+ * The first selected value.
38
+ */
39
+ firstSelectedValue: Ref<string | null>;
40
+ /**
41
+ * The last selected value.
42
+ */
43
+ lastSelectedValue: Ref<string | null>;
44
+ /**
45
+ * Check if a value is selected.
46
+ */
47
+ isSelected: (value: string | null) => boolean;
48
+ /**
49
+ * Check if a value can be selected.
50
+ */
51
+ canSelect: (value: string) => boolean;
52
+ /**
53
+ * Select a value.
54
+ */
55
+ select: (value: string, forceToggle?: boolean) => void;
56
+ /**
57
+ * Deselect a value.
58
+ */
59
+ deselect: (value: string) => void;
60
+ /**
61
+ * Toggle selection of a value.
62
+ */
63
+ toggle: (value: string) => void;
64
+ /**
65
+ * Replace the selection with a single value.
66
+ */
67
+ replace: (value: string | null) => void;
68
+ /**
69
+ * Extend the selection from anchor to target.
70
+ */
71
+ extend: (anchorValue: string, targetValue: string) => void;
72
+ /**
73
+ * Set the selected values.
74
+ */
75
+ setSelectedValues: (values: string[]) => void;
76
+ /**
77
+ * Clear the selection.
78
+ */
79
+ clear: () => void;
80
+ /**
81
+ * Clear all selections.
82
+ */
83
+ resetSelection: () => void;
84
+ /**
85
+ * Returns true if all items from the collection are selected.
86
+ */
87
+ isAllSelected: () => boolean;
88
+ /**
89
+ * Returns true if at least one item from the collection is selected.
90
+ */
91
+ isSomeSelected: () => boolean;
92
+ /**
93
+ * Set the selection to a specific array of items.
94
+ */
95
+ setSelection: (selection: string[]) => void;
96
+ /**
97
+ * Set the selection mode.
98
+ */
99
+ setSelectionMode: (mode: SelectionMode) => void;
100
+ /**
101
+ * Set whether the selection is deselectable.
102
+ */
103
+ setDeselectable: (deselectable: boolean) => void;
104
+ }