@auronui/vue 1.0.17 → 1.0.18
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/cjs/index.cjs +769 -482
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +26 -3
- package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatar/AvatarGroup.js.map +1 -1
- package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js +23 -4
- package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js +26 -4
- package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js +53 -2
- package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/button/ButtonGroup.js.map +1 -1
- package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +28 -4
- package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/button/ToggleButtonGroup.js.map +1 -1
- package/dist/components/button/ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js +21 -3
- package/dist/components/button/ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/button/button-group.context.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +14 -3
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/collapsible/CollapsibleGroup.js.map +1 -1
- package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js +22 -3
- package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/list-box/ListBox.js.map +1 -1
- package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js +19 -3
- package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/modal/ModalContent.js.map +1 -1
- package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/radio/RadioGroup.js.map +1 -1
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js +14 -3
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js +37 -5
- package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/switch/SwitchGroup.js.map +1 -1
- package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js +14 -3
- package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +30 -3
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/components/toolbar/ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js +25 -3
- package/dist/components/toolbar/ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.d.ts +128 -2
- package/dist/index.js +7 -7
- package/package.json +4 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useToggleButtonGroupProvide } from "./toggle-button-group.context.js";
|
|
3
|
-
import
|
|
3
|
+
import ToggleButton_default from "./ToggleButton.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, watch, withCtx } from "vue";
|
|
4
5
|
import { toggleButtonGroupVariants } from "@auronui/styles";
|
|
5
6
|
//#region src/components/button/ToggleButtonGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = ["data-orientation"];
|
|
@@ -32,7 +33,8 @@ var ToggleButtonGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
32
33
|
Object,
|
|
33
34
|
Array
|
|
34
35
|
] },
|
|
35
|
-
classNames: {}
|
|
36
|
+
classNames: {},
|
|
37
|
+
buttons: {}
|
|
36
38
|
},
|
|
37
39
|
emits: ["update:modelValue"],
|
|
38
40
|
setup(__props, { emit: __emit }) {
|
|
@@ -75,7 +77,23 @@ var ToggleButtonGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
75
77
|
class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class, props.classNames?.base)),
|
|
76
78
|
"data-orientation": props.orientation,
|
|
77
79
|
role: "group"
|
|
78
|
-
}, [
|
|
80
|
+
}, [props.buttons ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.buttons, (btn) => {
|
|
81
|
+
return openBlock(), createBlock(ToggleButton_default, {
|
|
82
|
+
key: btn.value,
|
|
83
|
+
value: btn.value,
|
|
84
|
+
"is-icon-only": btn.isIconOnly,
|
|
85
|
+
disabled: btn.disabled,
|
|
86
|
+
class: normalizeClass(btn.class)
|
|
87
|
+
}, {
|
|
88
|
+
default: withCtx(() => [createTextVNode(toDisplayString(btn.label), 1)]),
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1032, [
|
|
91
|
+
"value",
|
|
92
|
+
"is-icon-only",
|
|
93
|
+
"disabled",
|
|
94
|
+
"class"
|
|
95
|
+
]);
|
|
96
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 10, _hoisted_1);
|
|
79
97
|
};
|
|
80
98
|
}
|
|
81
99
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/button/ToggleButtonGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { toggleButtonGroupVariants, type ToggleButtonVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useToggleButtonGroupProvide } from './toggle-button-group.context'\n\nconst props = withDefaults(defineProps<{\n variant?: ToggleButtonVariants['variant']\n size?: ToggleButtonVariants['size']\n disabled?: boolean\n fullWidth?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n selectionMode?: 'single' | 'multiple'\n modelValue?: string | string[]\n defaultValue?: string | string[]\n class?: ClassValue\n /** Additional class names to apply to component slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n variant: 'default',\n size: 'md',\n disabled: false,\n fullWidth: false,\n orientation: 'horizontal',\n isDetached: false,\n selectionMode: 'multiple',\n modelValue: undefined,\n defaultValue: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[]]\n}>()\n\n// Normalize modelValue / defaultValue to string[] for internal use\nconst internalSelected = ref<string[]>(\n props.modelValue !== undefined\n ? (Array.isArray(props.modelValue) ? [...props.modelValue] : [props.modelValue])\n : props.defaultValue !== undefined\n ? (Array.isArray(props.defaultValue) ? [...props.defaultValue] : [props.defaultValue])\n : []\n)\n\n// Keep internalSelected in sync when modelValue changes from outside (controlled mode)\nimport { watch } from 'vue'\nwatch(\n () => props.modelValue,\n (val) => {\n if (val === undefined) return\n internalSelected.value = Array.isArray(val) ? [...val] : [val]\n },\n)\n\n// The selectedValues exposed to children (always string[])\nconst selectedValues = computed(() => internalSelected.value)\n\nfunction toggleValue(value: string) {\n if (props.selectionMode === 'single') {\n const next = internalSelected.value.includes(value) ? [] : [value]\n internalSelected.value = next\n emit('update:modelValue', next[0] ?? '')\n } else {\n // multiple\n const idx = internalSelected.value.indexOf(value)\n const next = idx === -1\n ? [...internalSelected.value, value]\n : internalSelected.value.filter((v) => v !== value)\n internalSelected.value = next\n emit('update:modelValue', next)\n }\n}\n\n// Provide context to child ToggleButtons via toRef() for live reactivity\nuseToggleButtonGroupProvide({\n variant: toRef(props, 'variant'),\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n fullWidth: toRef(props, 'fullWidth'),\n orientation: toRef(props, 'orientation'),\n selectionMode: toRef(props, 'selectionMode'),\n selectedValues,\n toggleValue,\n})\n\nconst slotFns = computed(() =>\n toggleButtonGroupVariants({\n fullWidth: props.fullWidth,\n orientation: props.orientation,\n isDetached: props.isDetached,\n })\n)\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n role=\"group\"\n >\n <slot />\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/button/ToggleButtonGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { toggleButtonGroupVariants, type ToggleButtonVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useToggleButtonGroupProvide } from './toggle-button-group.context'\nimport ToggleButton from './ToggleButton.vue'\n\ntype ToggleButtonShorthandItem = { value: string; label?: string; isIconOnly?: boolean; disabled?: boolean; class?: string }\n\nconst props = withDefaults(defineProps<{\n variant?: ToggleButtonVariants['variant']\n size?: ToggleButtonVariants['size']\n disabled?: boolean\n fullWidth?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n selectionMode?: 'single' | 'multiple'\n modelValue?: string | string[]\n defaultValue?: string | string[]\n class?: ClassValue\n /** Additional class names to apply to component slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render toggle buttons from an array instead of the compound slot API */\n buttons?: ToggleButtonShorthandItem[]\n}>(), {\n variant: 'default',\n size: 'md',\n disabled: false,\n fullWidth: false,\n orientation: 'horizontal',\n isDetached: false,\n selectionMode: 'multiple',\n modelValue: undefined,\n defaultValue: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[]]\n}>()\n\n// Normalize modelValue / defaultValue to string[] for internal use\nconst internalSelected = ref<string[]>(\n props.modelValue !== undefined\n ? (Array.isArray(props.modelValue) ? [...props.modelValue] : [props.modelValue])\n : props.defaultValue !== undefined\n ? (Array.isArray(props.defaultValue) ? [...props.defaultValue] : [props.defaultValue])\n : []\n)\n\n// Keep internalSelected in sync when modelValue changes from outside (controlled mode)\nimport { watch } from 'vue'\nwatch(\n () => props.modelValue,\n (val) => {\n if (val === undefined) return\n internalSelected.value = Array.isArray(val) ? [...val] : [val]\n },\n)\n\n// The selectedValues exposed to children (always string[])\nconst selectedValues = computed(() => internalSelected.value)\n\nfunction toggleValue(value: string) {\n if (props.selectionMode === 'single') {\n const next = internalSelected.value.includes(value) ? [] : [value]\n internalSelected.value = next\n emit('update:modelValue', next[0] ?? '')\n } else {\n // multiple\n const idx = internalSelected.value.indexOf(value)\n const next = idx === -1\n ? [...internalSelected.value, value]\n : internalSelected.value.filter((v) => v !== value)\n internalSelected.value = next\n emit('update:modelValue', next)\n }\n}\n\n// Provide context to child ToggleButtons via toRef() for live reactivity\nuseToggleButtonGroupProvide({\n variant: toRef(props, 'variant'),\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n fullWidth: toRef(props, 'fullWidth'),\n orientation: toRef(props, 'orientation'),\n selectionMode: toRef(props, 'selectionMode'),\n selectedValues,\n toggleValue,\n})\n\nconst slotFns = computed(() =>\n toggleButtonGroupVariants({\n fullWidth: props.fullWidth,\n orientation: props.orientation,\n isDetached: props.isDetached,\n })\n)\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n role=\"group\"\n >\n <template v-if=\"props.buttons\">\n <ToggleButton\n v-for=\"btn in props.buttons\"\n :key=\"btn.value\"\n :value=\"btn.value\"\n :is-icon-only=\"btn.isIconOnly\"\n :disabled=\"btn.disabled\"\n :class=\"btn.class\"\n >{{ btn.label }}</ToggleButton>\n </template>\n <slot v-else />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EA6Bd,MAAM,OAAO;EAKb,MAAM,mBAAmB,IACvB,MAAM,eAAe,KAAA,IAChB,MAAM,QAAQ,MAAM,WAAW,GAAG,CAAC,GAAG,MAAM,WAAW,GAAG,CAAC,MAAM,WAAW,GAC7E,MAAM,iBAAiB,KAAA,IACpB,MAAM,QAAQ,MAAM,aAAa,GAAG,CAAC,GAAG,MAAM,aAAa,GAAG,CAAC,MAAM,aAAa,GACnF,EAAC,CACT;AAIA,cACQ,MAAM,aACX,QAAQ;AACP,OAAI,QAAQ,KAAA,EAAW;AACvB,oBAAiB,QAAQ,MAAM,QAAQ,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAG;IAEjE;EAGA,MAAM,iBAAiB,eAAe,iBAAiB,MAAK;EAE5D,SAAS,YAAY,OAAe;AAClC,OAAI,MAAM,kBAAkB,UAAU;IACpC,MAAM,OAAO,iBAAiB,MAAM,SAAS,MAAM,GAAG,EAAE,GAAG,CAAC,MAAK;AACjE,qBAAiB,QAAQ;AACzB,SAAK,qBAAqB,KAAK,MAAM,GAAE;UAClC;IAGL,MAAM,OADM,iBAAiB,MAAM,QAAQ,MAAK,KAC3B,KACjB,CAAC,GAAG,iBAAiB,OAAO,MAAK,GACjC,iBAAiB,MAAM,QAAQ,MAAM,MAAM,MAAK;AACpD,qBAAiB,QAAQ;AACzB,SAAK,qBAAqB,KAAI;;;AAKlC,8BAA4B;GAC1B,SAAS,MAAM,OAAO,UAAU;GAChC,MAAM,MAAM,OAAO,OAAO;GAC1B,UAAU,MAAM,OAAO,WAAW;GAClC,WAAW,MAAM,OAAO,YAAY;GACpC,aAAa,MAAM,OAAO,cAAc;GACxC,eAAe,MAAM,OAAO,gBAAgB;GAC5C;GACA;GACD,CAAA;EAED,MAAM,UAAU,eACd,0BAA0B;GACxB,WAAW,MAAM;GACjB,aAAa,MAAM;GACnB,YAAY,MAAM;GACnB,CAAA,CACH;;uBAIE,mBAgBM,OAAA;IAfH,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI,CAAA;IAC3E,oBAAkB,MAAM;IACzB,MAAK;OAEW,MAAM,WAAA,UAAA,KAAA,EACpB,mBAO+B,UAAA,EAAA,KAAA,GAAA,EAAA,WANf,MAAM,UAAb,QAAG;wBADZ,YAO+B,sBAAA;KAL5B,KAAK,IAAI;KACT,OAAO,IAAI;KACX,gBAAc,IAAI;KAClB,UAAU,IAAI;KACd,OAAK,eAAE,IAAI,MAAK;;4BACH,CAAA,gBAAA,gBAAZ,IAAI,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;;;eAEf,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,IAAA,WAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.context.js","names":[],"sources":["../../../src/components/button/button-group.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { Ref } from 'vue'\nimport type { ButtonVariants } from '@auronui/styles'\n\nexport type ButtonGroupSelectionMode = 'single' | 'multiple'\nexport type ButtonGroupValue = string | number | null | Array<string | number>\n\nexport interface ButtonGroupContext {\n variant: Ref<ButtonVariants['variant']>\n size: Ref<ButtonVariants['size']>\n disabled: Ref<boolean>\n fullWidth: Ref<boolean>\n orientation: Ref<'horizontal' | 'vertical'>\n selectionMode: Ref<ButtonGroupSelectionMode>\n selectedValue: Ref<ButtonGroupValue>\n isValueSelected: (value: string | number | undefined) => boolean\n selectValue: (value: string | number) => void\n}\n\nexport const {\n useProvide: useButtonGroupProvide,\n useInject: useButtonGroupInject,\n key: buttonGroupContextKey,\n} = createContext<ButtonGroupContext>('ButtonGroup')\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"button-group.context.js","names":[],"sources":["../../../src/components/button/button-group.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { Ref } from 'vue'\nimport type { ButtonVariants } from '@auronui/styles'\n\nexport type ButtonGroupSelectionMode = 'single' | 'multiple'\nexport type ButtonGroupValue = string | number | null | Array<string | number>\n\nexport interface ButtonGroupContext {\n variant: Ref<ButtonVariants['variant']>\n color: Ref<ButtonVariants['color']>\n size: Ref<ButtonVariants['size']>\n disabled: Ref<boolean>\n fullWidth: Ref<boolean>\n orientation: Ref<'horizontal' | 'vertical'>\n selectionMode: Ref<ButtonGroupSelectionMode>\n selectedValue: Ref<ButtonGroupValue>\n isValueSelected: (value: string | number | undefined) => boolean\n selectValue: (value: string | number) => void\n}\n\nexport const {\n useProvide: useButtonGroupProvide,\n useInject: useButtonGroupInject,\n key: buttonGroupContextKey,\n} = createContext<ButtonGroupContext>('ButtonGroup')\n"],"mappings":";;AAoBA,IAAa,EACX,YAAY,uBACZ,WAAW,sBACX,KAAK,0BACH,cAAkC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","names":[],"sources":["../../../src/components/checkbox/CheckboxGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { checkboxGroupVariants, type CheckboxGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useCheckboxGroupProvide } from './checkbox-group.context'\n\nconst props = withDefaults(defineProps<{\n variant?: CheckboxGroupVariants['variant']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Checkboxes\nuseCheckboxGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `checkbox-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n checkboxGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupClasses, props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"checkbox-group__label\"\n >{{ props.label }}</span>\n <div class=\"checkbox-group__wrapper\">\n <slot />\n </div>\n <span\n v-if=\"props.description\"\n class=\"checkbox-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.js","names":[],"sources":["../../../src/components/checkbox/CheckboxGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { checkboxGroupVariants, type CheckboxGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useCheckboxGroupProvide } from './checkbox-group.context'\nimport Checkbox from './Checkbox.vue'\n\ntype CheckboxShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n variant?: CheckboxGroupVariants['variant']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render checkboxes from an array instead of the compound slot API */\n items?: CheckboxShorthandItem[]\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Checkboxes\nuseCheckboxGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `checkbox-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n checkboxGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupClasses, props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"checkbox-group__label\"\n >{{ props.label }}</span>\n <div class=\"checkbox-group__wrapper\">\n <template v-if=\"props.items\">\n <Checkbox\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</Checkbox>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"checkbox-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useCheckboxGroupProvide } from "./checkbox-group.context.js";
|
|
3
|
-
import
|
|
3
|
+
import Checkbox_default from "./Checkbox.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
|
|
4
5
|
import { checkboxGroupVariants } from "@auronui/styles";
|
|
5
6
|
//#region src/components/checkbox/CheckboxGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = ["aria-labelledby", "data-orientation"];
|
|
@@ -23,7 +24,8 @@ var CheckboxGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
23
24
|
orientation: { default: "vertical" },
|
|
24
25
|
label: { default: void 0 },
|
|
25
26
|
description: { default: void 0 },
|
|
26
|
-
class: {}
|
|
27
|
+
class: {},
|
|
28
|
+
items: {}
|
|
27
29
|
},
|
|
28
30
|
emits: ["update:modelValue"],
|
|
29
31
|
setup(__props, { emit: __emit }) {
|
|
@@ -57,7 +59,16 @@ var CheckboxGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
57
59
|
id: labelId,
|
|
58
60
|
class: "checkbox-group__label"
|
|
59
61
|
}, toDisplayString(props.label), 1)) : createCommentVNode("", true),
|
|
60
|
-
createElementVNode("div", _hoisted_2, [
|
|
62
|
+
createElementVNode("div", _hoisted_2, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
63
|
+
return openBlock(), createBlock(Checkbox_default, {
|
|
64
|
+
key: item.value,
|
|
65
|
+
value: item.value,
|
|
66
|
+
disabled: item.disabled
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1032, ["value", "disabled"]);
|
|
71
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
61
72
|
props.description ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
62
73
|
], 10, _hoisted_1);
|
|
63
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/checkbox/CheckboxGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { checkboxGroupVariants, type CheckboxGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useCheckboxGroupProvide } from './checkbox-group.context'\n\nconst props = withDefaults(defineProps<{\n variant?: CheckboxGroupVariants['variant']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Checkboxes\nuseCheckboxGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `checkbox-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n checkboxGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupClasses, props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"checkbox-group__label\"\n >{{ props.label }}</span>\n <div class=\"checkbox-group__wrapper\">\n <slot />\n </div>\n <span\n v-if=\"props.description\"\n class=\"checkbox-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/checkbox/CheckboxGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { checkboxGroupVariants, type CheckboxGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useCheckboxGroupProvide } from './checkbox-group.context'\nimport Checkbox from './Checkbox.vue'\n\ntype CheckboxShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n variant?: CheckboxGroupVariants['variant']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render checkboxes from an array instead of the compound slot API */\n items?: CheckboxShorthandItem[]\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Checkboxes\nuseCheckboxGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `checkbox-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n checkboxGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupClasses, props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"checkbox-group__label\"\n >{{ props.label }}</span>\n <div class=\"checkbox-group__wrapper\">\n <template v-if=\"props.items\">\n <Checkbox\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</Checkbox>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"checkbox-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAuBd,MAAM,OAAO;EAKb,MAAM,iBAAiB,IAAc,MAAM,gBAAgB,EAAE,CAAA;EAG7D,MAAM,gBAAgB,eAAe,MAAM,cAAc,eAAe,MAAK;EAG7E,SAAS,YAAY,OAAe;GAClC,MAAM,OAAO,cAAc,MAAM,SAAS,MAAK,GAC3C,cAAc,MAAM,QAAO,MAAK,MAAM,MAAK,GAC3C,CAAC,GAAG,cAAc,OAAO,MAAK;AAClC,kBAAe,QAAQ;AACvB,QAAK,qBAAqB,KAAI;;AAIhC,0BAAwB;GACtB,SAAS,MAAM,OAAO,UAAU;GAChC,UAAU,MAAM,OAAO,WAAW;GAClC,gBAAgB;GAChB;GACA,MAAM,MAAM,OAAO,OAAO;GAC3B,CAAA;EAED,MAAM,UAAU,wBAAwB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE;EAE9E,MAAM,eAAe,eACnB,sBAAsB,EAAE,SAAS,MAAM,SAAS,CAAA,CAClD;;uBAIE,mBA0BM,OAAA;IAzBJ,MAAK;IACJ,mBAAiB,MAAM,QAAQ,UAAU,KAAA;IACzC,oBAAkB,MAAM;IACxB,OAAK,eAAE,MAAA,iBAAgB,CAAC,aAAA,OAAc,MAAM,MAAK,CAAA;;IAG1C,MAAM,SAAA,WAAA,EADd,mBAIyB,QAAA;;KAFtB,IAAI;KACL,OAAM;uBACJ,MAAM,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IACf,mBAUM,OAVN,YAUM,CATY,MAAM,SAAA,UAAA,KAAA,EACpB,mBAK0C,UAAA,EAAA,KAAA,GAAA,EAAA,WAJzB,MAAM,QAAd,SAAI;yBADb,YAK0C,kBAAA;MAHvC,KAAK,KAAK;MACV,OAAO,KAAK;MACZ,UAAU,KAAK;;6BACa,CAAA,gBAAA,gBAA3B,KAAK,SAAS,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;gBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA;IAGT,MAAM,eAAA,WAAA,EADd,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleGroup.js","names":[],"sources":["../../../src/components/collapsible/CollapsibleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { collapsibleGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport {\n provideCollapsibleGroup,\n type CollapsibleGroupRegistryEntry,\n} from './collapsible-group.context'\n\nconst props = withDefaults(defineProps<{\n // single-open = true means only one child open at a time\n singleOpen?: boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n singleOpen: false,\n})\n\nconst registry = new Map<string, CollapsibleGroupRegistryEntry>()\n\nprovideCollapsibleGroup({\n allowMultiple: toRef(() => !props.singleOpen),\n register(entry) {\n registry.set(entry.id, entry)\n },\n unregister(id) {\n registry.delete(id)\n },\n notifyOpen(openingId: string) {\n if (props.singleOpen) {\n for (const [id, entry] of registry) {\n if (id !== openingId && entry.open.value) {\n entry.open.value = false\n }\n }\n }\n },\n})\n\nconst slotFns = computed(() => collapsibleGroupVariants({}))\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\">\n <slot />\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"CollapsibleGroup.js","names":[],"sources":["../../../src/components/collapsible/CollapsibleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { collapsibleGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport {\n provideCollapsibleGroup,\n type CollapsibleGroupRegistryEntry,\n} from './collapsible-group.context'\nimport Collapsible from './Collapsible.vue'\nimport CollapsibleTrigger from './CollapsibleTrigger.vue'\nimport CollapsibleContent from './CollapsibleContent.vue'\n\ntype CollapsibleShorthandItem = { title: string; content?: string; defaultOpen?: boolean; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n // single-open = true means only one child open at a time\n singleOpen?: boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render collapsibles from an array instead of the compound slot API */\n items?: CollapsibleShorthandItem[]\n}>(), {\n singleOpen: false,\n})\n\nconst registry = new Map<string, CollapsibleGroupRegistryEntry>()\n\nprovideCollapsibleGroup({\n allowMultiple: toRef(() => !props.singleOpen),\n register(entry) {\n registry.set(entry.id, entry)\n },\n unregister(id) {\n registry.delete(id)\n },\n notifyOpen(openingId: string) {\n if (props.singleOpen) {\n for (const [id, entry] of registry) {\n if (id !== openingId && entry.open.value) {\n entry.open.value = false\n }\n }\n }\n },\n})\n\nconst slotFns = computed(() => collapsibleGroupVariants({}))\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\">\n <template v-if=\"props.items\">\n <Collapsible\n v-for=\"(item, idx) in props.items\"\n :key=\"idx\"\n :default-open=\"item.defaultOpen\"\n :disabled=\"item.disabled\"\n >\n <CollapsibleTrigger>{{ item.title }}</CollapsibleTrigger>\n <CollapsibleContent>{{ item.content }}</CollapsibleContent>\n </Collapsible>\n </template>\n <slot v-else />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { provideCollapsibleGroup } from "./collapsible-group.context.js";
|
|
3
|
-
import
|
|
3
|
+
import Collapsible_default from "./Collapsible.js";
|
|
4
|
+
import CollapsibleTrigger_default from "./CollapsibleTrigger.js";
|
|
5
|
+
import CollapsibleContent_default from "./CollapsibleContent.js";
|
|
6
|
+
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
|
|
4
7
|
import { collapsibleGroupVariants } from "@auronui/styles";
|
|
5
8
|
//#region src/components/collapsible/CollapsibleGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
9
|
var CollapsibleGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -17,7 +20,8 @@ var CollapsibleGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
17
20
|
Object,
|
|
18
21
|
Array
|
|
19
22
|
] },
|
|
20
|
-
classNames: {}
|
|
23
|
+
classNames: {},
|
|
24
|
+
items: {}
|
|
21
25
|
},
|
|
22
26
|
setup(__props) {
|
|
23
27
|
const props = __props;
|
|
@@ -38,7 +42,22 @@ var CollapsibleGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
38
42
|
});
|
|
39
43
|
const slotFns = computed(() => collapsibleGroupVariants({}));
|
|
40
44
|
return (_ctx, _cache) => {
|
|
41
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class, props.classNames?.base)) }, [
|
|
45
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class, props.classNames?.base)) }, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item, idx) => {
|
|
46
|
+
return openBlock(), createBlock(Collapsible_default, {
|
|
47
|
+
key: idx,
|
|
48
|
+
"default-open": item.defaultOpen,
|
|
49
|
+
disabled: item.disabled
|
|
50
|
+
}, {
|
|
51
|
+
default: withCtx(() => [createVNode(CollapsibleTrigger_default, null, {
|
|
52
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.title), 1)]),
|
|
53
|
+
_: 2
|
|
54
|
+
}, 1024), createVNode(CollapsibleContent_default, null, {
|
|
55
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.content), 1)]),
|
|
56
|
+
_: 2
|
|
57
|
+
}, 1024)]),
|
|
58
|
+
_: 2
|
|
59
|
+
}, 1032, ["default-open", "disabled"]);
|
|
60
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2);
|
|
42
61
|
};
|
|
43
62
|
}
|
|
44
63
|
});
|
package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/collapsible/CollapsibleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { collapsibleGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport {\n provideCollapsibleGroup,\n type CollapsibleGroupRegistryEntry,\n} from './collapsible-group.context'\n\nconst props = withDefaults(defineProps<{\n // single-open = true means only one child open at a time\n singleOpen?: boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n singleOpen: false,\n})\n\nconst registry = new Map<string, CollapsibleGroupRegistryEntry>()\n\nprovideCollapsibleGroup({\n allowMultiple: toRef(() => !props.singleOpen),\n register(entry) {\n registry.set(entry.id, entry)\n },\n unregister(id) {\n registry.delete(id)\n },\n notifyOpen(openingId: string) {\n if (props.singleOpen) {\n for (const [id, entry] of registry) {\n if (id !== openingId && entry.open.value) {\n entry.open.value = false\n }\n }\n }\n },\n})\n\nconst slotFns = computed(() => collapsibleGroupVariants({}))\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\">\n <slot />\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollapsibleGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/collapsible/CollapsibleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { collapsibleGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport {\n provideCollapsibleGroup,\n type CollapsibleGroupRegistryEntry,\n} from './collapsible-group.context'\nimport Collapsible from './Collapsible.vue'\nimport CollapsibleTrigger from './CollapsibleTrigger.vue'\nimport CollapsibleContent from './CollapsibleContent.vue'\n\ntype CollapsibleShorthandItem = { title: string; content?: string; defaultOpen?: boolean; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n // single-open = true means only one child open at a time\n singleOpen?: boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render collapsibles from an array instead of the compound slot API */\n items?: CollapsibleShorthandItem[]\n}>(), {\n singleOpen: false,\n})\n\nconst registry = new Map<string, CollapsibleGroupRegistryEntry>()\n\nprovideCollapsibleGroup({\n allowMultiple: toRef(() => !props.singleOpen),\n register(entry) {\n registry.set(entry.id, entry)\n },\n unregister(id) {\n registry.delete(id)\n },\n notifyOpen(openingId: string) {\n if (props.singleOpen) {\n for (const [id, entry] of registry) {\n if (id !== openingId && entry.open.value) {\n entry.open.value = false\n }\n }\n }\n },\n})\n\nconst slotFns = computed(() => collapsibleGroupVariants({}))\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\">\n <template v-if=\"props.items\">\n <Collapsible\n v-for=\"(item, idx) in props.items\"\n :key=\"idx\"\n :default-open=\"item.defaultOpen\"\n :disabled=\"item.disabled\"\n >\n <CollapsibleTrigger>{{ item.title }}</CollapsibleTrigger>\n <CollapsibleContent>{{ item.content }}</CollapsibleContent>\n </Collapsible>\n </template>\n <slot v-else />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAcd,MAAM,2BAAW,IAAI,KAA2C;AAEhE,0BAAwB;GACtB,eAAe,YAAY,CAAC,MAAM,WAAW;GAC7C,SAAS,OAAO;AACd,aAAS,IAAI,MAAM,IAAI,MAAK;;GAE9B,WAAW,IAAI;AACb,aAAS,OAAO,GAAE;;GAEpB,WAAW,WAAmB;AAC5B,QAAI,MAAM;UACH,MAAM,CAAC,IAAI,UAAU,SACxB,KAAI,OAAO,aAAa,MAAM,KAAK,MACjC,OAAM,KAAK,QAAQ;;;GAK5B,CAAA;EAED,MAAM,UAAU,eAAe,yBAAyB,EAAE,CAAC,CAAA;;uBAIzD,mBAaM,OAAA,EAbA,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI,CAAA,EAAA,EAAA,CAC/D,MAAM,SAAA,UAAA,KAAA,EACpB,mBAQc,UAAA,EAAA,KAAA,GAAA,EAAA,WAPU,MAAM,QAApB,MAAM,QAAG;wBADnB,YAQc,qBAAA;KANX,KAAK;KACL,gBAAc,KAAK;KACnB,UAAU,KAAK;;4BAEyC,CAAzD,YAAyD,4BAAA,MAAA;6BAArB,CAAA,gBAAA,gBAAb,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;eACjC,YAA2D,4BAAA,MAAA;6BAArB,CAAA,gBAAA,gBAAf,KAAK,QAAO,EAAA,EAAA,CAAA,CAAA;;;;;eAGvC,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.js","names":[],"sources":["../../../src/components/list-box/ListBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef, useAttrs } from 'vue'\nimport { ListboxRoot, ListboxContent } from 'reka-ui'\nimport { listboxVariants, type ListBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useListBoxProvide } from './ListBox.context'\n\n// Disable Vue attribute fallthrough — we manually forward ARIA attrs to ListboxContent\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n modelValue?: string | string[]\n defaultValue?: string | string[]\n selectionMode?: 'single' | 'multiple'\n variant?: ListBoxVariants['variant']\n isDisabled?: boolean\n class?: ClassValue\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n selectionMode: 'single',\n variant: 'default',\n isDisabled: false,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[] | undefined]\n}>()\n\nconst attrs = useAttrs()\n\n// Provide context for ListBoxItem and ListBoxSection children\nuseListBoxProvide({\n variant: toRef(props, 'variant'),\n itemVariant: toRef(props, 'variant'),\n isDisabled: toRef(props, 'isDisabled'),\n})\n\nconst slotFns = computed(() =>\n listboxVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <!-- ListboxRoot is an invisible wrapper that manages state; ListboxContent carries role=\"listbox\" -->\n <!-- We forward attrs (aria-label, aria-labelledby, etc.) to ListboxContent, not the root -->\n <ListboxRoot\n :model-value=\"props.modelValue == null ? undefined : ([] as string[]).concat(props.modelValue)\"\n :default-value=\"props.defaultValue == null ? undefined : ([] as string[]).concat(props.defaultValue)\"\n :multiple=\"props.selectionMode === 'multiple'\"\n :selection-behavior=\"props.selectionMode === 'multiple' ? 'toggle' : 'replace'\"\n :disabled=\"props.isDisabled\"\n @update:model-value=\"emit('update:modelValue', props.selectionMode === 'single' ? (Array.isArray($event) ? ($event as string[])[0] : $event as string) : $event as string[])\"\n >\n <ListboxContent\n v-bind=\"attrs\"\n :class=\"composeClassName(slotFns, props.class, props.classNames?.base)\"\n >\n <slot />\n </ListboxContent>\n </ListboxRoot>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ListBox.js","names":[],"sources":["../../../src/components/list-box/ListBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef, useAttrs } from 'vue'\nimport { ListboxRoot, ListboxContent } from 'reka-ui'\nimport { listboxVariants, type ListBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useListBoxProvide } from './ListBox.context'\nimport ListBoxItem from './ListBoxItem.vue'\n\n// Disable Vue attribute fallthrough — we manually forward ARIA attrs to ListboxContent\ndefineOptions({ inheritAttrs: false })\n\ntype ListBoxShorthandItem = { value: string; label?: string; disabled?: boolean; textValue?: string }\n\nconst props = withDefaults(defineProps<{\n modelValue?: string | string[]\n defaultValue?: string | string[]\n selectionMode?: 'single' | 'multiple'\n variant?: ListBoxVariants['variant']\n isDisabled?: boolean\n class?: ClassValue\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render list items from an array instead of the compound slot API */\n items?: ListBoxShorthandItem[]\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n selectionMode: 'single',\n variant: 'default',\n isDisabled: false,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[] | undefined]\n}>()\n\nconst attrs = useAttrs()\n\n// Provide context for ListBoxItem and ListBoxSection children\nuseListBoxProvide({\n variant: toRef(props, 'variant'),\n itemVariant: toRef(props, 'variant'),\n isDisabled: toRef(props, 'isDisabled'),\n})\n\nconst slotFns = computed(() =>\n listboxVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <!-- ListboxRoot is an invisible wrapper that manages state; ListboxContent carries role=\"listbox\" -->\n <!-- We forward attrs (aria-label, aria-labelledby, etc.) to ListboxContent, not the root -->\n <ListboxRoot\n :model-value=\"props.modelValue == null ? undefined : ([] as string[]).concat(props.modelValue)\"\n :default-value=\"props.defaultValue == null ? undefined : ([] as string[]).concat(props.defaultValue)\"\n :multiple=\"props.selectionMode === 'multiple'\"\n :selection-behavior=\"props.selectionMode === 'multiple' ? 'toggle' : 'replace'\"\n :disabled=\"props.isDisabled\"\n @update:model-value=\"emit('update:modelValue', props.selectionMode === 'single' ? (Array.isArray($event) ? ($event as string[])[0] : $event as string) : $event as string[])\"\n >\n <ListboxContent\n v-bind=\"attrs\"\n :class=\"composeClassName(slotFns, props.class, props.classNames?.base)\"\n >\n <template v-if=\"props.items\">\n <ListBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.disabled\"\n :text-value=\"item.textValue\"\n >{{ item.label ?? item.value }}</ListBoxItem>\n </template>\n <slot v-else />\n </ListboxContent>\n </ListboxRoot>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useListBoxProvide } from "./ListBox.context.js";
|
|
3
|
-
import
|
|
3
|
+
import ListBoxItem_default from "./ListBoxItem.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, renderList, renderSlot, toDisplayString, toRef, unref, useAttrs, withCtx } from "vue";
|
|
4
5
|
import { listboxVariants } from "@auronui/styles";
|
|
5
6
|
import { ListboxContent, ListboxRoot } from "reka-ui";
|
|
6
7
|
//#region src/components/list-box/ListBox.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -26,7 +27,8 @@ var ListBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
26
27
|
],
|
|
27
28
|
default: void 0
|
|
28
29
|
},
|
|
29
|
-
classNames: {}
|
|
30
|
+
classNames: {},
|
|
31
|
+
items: {}
|
|
30
32
|
},
|
|
31
33
|
emits: ["update:modelValue"],
|
|
32
34
|
setup(__props, { emit: __emit }) {
|
|
@@ -49,7 +51,21 @@ var ListBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
49
51
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", props.selectionMode === "single" ? Array.isArray($event) ? $event[0] : $event : $event))
|
|
50
52
|
}, {
|
|
51
53
|
default: withCtx(() => [createVNode(unref(ListboxContent), mergeProps(unref(attrs), { class: unref(composeClassName)(slotFns.value, props.class, props.classNames?.base) }), {
|
|
52
|
-
default: withCtx(() => [
|
|
54
|
+
default: withCtx(() => [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
55
|
+
return openBlock(), createBlock(ListBoxItem_default, {
|
|
56
|
+
key: item.value,
|
|
57
|
+
value: item.value,
|
|
58
|
+
"is-disabled": item.disabled,
|
|
59
|
+
"text-value": item.textValue
|
|
60
|
+
}, {
|
|
61
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
|
|
62
|
+
_: 2
|
|
63
|
+
}, 1032, [
|
|
64
|
+
"value",
|
|
65
|
+
"is-disabled",
|
|
66
|
+
"text-value"
|
|
67
|
+
]);
|
|
68
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
53
69
|
_: 3
|
|
54
70
|
}, 16, ["class"])]),
|
|
55
71
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/list-box/ListBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef, useAttrs } from 'vue'\nimport { ListboxRoot, ListboxContent } from 'reka-ui'\nimport { listboxVariants, type ListBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useListBoxProvide } from './ListBox.context'\n\n// Disable Vue attribute fallthrough — we manually forward ARIA attrs to ListboxContent\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n modelValue?: string | string[]\n defaultValue?: string | string[]\n selectionMode?: 'single' | 'multiple'\n variant?: ListBoxVariants['variant']\n isDisabled?: boolean\n class?: ClassValue\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n selectionMode: 'single',\n variant: 'default',\n isDisabled: false,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[] | undefined]\n}>()\n\nconst attrs = useAttrs()\n\n// Provide context for ListBoxItem and ListBoxSection children\nuseListBoxProvide({\n variant: toRef(props, 'variant'),\n itemVariant: toRef(props, 'variant'),\n isDisabled: toRef(props, 'isDisabled'),\n})\n\nconst slotFns = computed(() =>\n listboxVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <!-- ListboxRoot is an invisible wrapper that manages state; ListboxContent carries role=\"listbox\" -->\n <!-- We forward attrs (aria-label, aria-labelledby, etc.) to ListboxContent, not the root -->\n <ListboxRoot\n :model-value=\"props.modelValue == null ? undefined : ([] as string[]).concat(props.modelValue)\"\n :default-value=\"props.defaultValue == null ? undefined : ([] as string[]).concat(props.defaultValue)\"\n :multiple=\"props.selectionMode === 'multiple'\"\n :selection-behavior=\"props.selectionMode === 'multiple' ? 'toggle' : 'replace'\"\n :disabled=\"props.isDisabled\"\n @update:model-value=\"emit('update:modelValue', props.selectionMode === 'single' ? (Array.isArray($event) ? ($event as string[])[0] : $event as string) : $event as string[])\"\n >\n <ListboxContent\n v-bind=\"attrs\"\n :class=\"composeClassName(slotFns, props.class, props.classNames?.base)\"\n >\n <slot />\n </ListboxContent>\n </ListboxRoot>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/list-box/ListBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef, useAttrs } from 'vue'\nimport { ListboxRoot, ListboxContent } from 'reka-ui'\nimport { listboxVariants, type ListBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useListBoxProvide } from './ListBox.context'\nimport ListBoxItem from './ListBoxItem.vue'\n\n// Disable Vue attribute fallthrough — we manually forward ARIA attrs to ListboxContent\ndefineOptions({ inheritAttrs: false })\n\ntype ListBoxShorthandItem = { value: string; label?: string; disabled?: boolean; textValue?: string }\n\nconst props = withDefaults(defineProps<{\n modelValue?: string | string[]\n defaultValue?: string | string[]\n selectionMode?: 'single' | 'multiple'\n variant?: ListBoxVariants['variant']\n isDisabled?: boolean\n class?: ClassValue\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render list items from an array instead of the compound slot API */\n items?: ListBoxShorthandItem[]\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n selectionMode: 'single',\n variant: 'default',\n isDisabled: false,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | string[] | undefined]\n}>()\n\nconst attrs = useAttrs()\n\n// Provide context for ListBoxItem and ListBoxSection children\nuseListBoxProvide({\n variant: toRef(props, 'variant'),\n itemVariant: toRef(props, 'variant'),\n isDisabled: toRef(props, 'isDisabled'),\n})\n\nconst slotFns = computed(() =>\n listboxVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <!-- ListboxRoot is an invisible wrapper that manages state; ListboxContent carries role=\"listbox\" -->\n <!-- We forward attrs (aria-label, aria-labelledby, etc.) to ListboxContent, not the root -->\n <ListboxRoot\n :model-value=\"props.modelValue == null ? undefined : ([] as string[]).concat(props.modelValue)\"\n :default-value=\"props.defaultValue == null ? undefined : ([] as string[]).concat(props.defaultValue)\"\n :multiple=\"props.selectionMode === 'multiple'\"\n :selection-behavior=\"props.selectionMode === 'multiple' ? 'toggle' : 'replace'\"\n :disabled=\"props.isDisabled\"\n @update:model-value=\"emit('update:modelValue', props.selectionMode === 'single' ? (Array.isArray($event) ? ($event as string[])[0] : $event as string) : $event as string[])\"\n >\n <ListboxContent\n v-bind=\"attrs\"\n :class=\"composeClassName(slotFns, props.class, props.classNames?.base)\"\n >\n <template v-if=\"props.items\">\n <ListBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.disabled\"\n :text-value=\"item.textValue\"\n >{{ item.label ?? item.value }}</ListBoxItem>\n </template>\n <slot v-else />\n </ListboxContent>\n </ListboxRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAyBd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAS;AAGvB,oBAAkB;GAChB,SAAS,MAAM,OAAO,UAAU;GAChC,aAAa,MAAM,OAAO,UAAU;GACpC,YAAY,MAAM,OAAO,aAAa;GACvC,CAAA;EAED,MAAM,UAAU,eACd,gBAAgB,EAAE,SAAS,MAAM,SAAS,CAAA,CAC5C;;uBAME,YAuBc,MAAA,YAAA,EAAA;IAtBX,eAAa,MAAM,cAAU,OAAW,KAAA,IAAS,EAAA,CAAoB,OAAO,MAAM,WAAU;IAC5F,iBAAe,MAAM,gBAAY,OAAW,KAAA,IAAS,EAAA,CAAoB,OAAO,MAAM,aAAY;IAClG,UAAU,MAAM,kBAAa;IAC7B,sBAAoB,MAAM,kBAAa,aAAA,WAAA;IACvC,UAAU,MAAM;IAChB,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAsB,MAAM,kBAAa,WAAiB,MAAM,QAAQ,OAAM,GAAK,OAAM,KAAmB,SAAoB,OAAM;;2BAgB9I,CAdjB,YAciB,MAAA,eAAA,EAdjB,WACU,MAaO,MAbF,EAAA,EACZ,OAAO,MAAA,iBAAgB,CAAC,QAAA,OAAS,MAAM,OAAO,MAAM,YAAY,KAAI,EAAA,CAAA,EAAA;4BAU1D,CARK,MAAM,SAAA,UAAA,KAAA,EACpB,mBAM6C,UAAA,EAAA,KAAA,GAAA,EAAA,WAL5B,MAAM,QAAd,SAAI;0BADb,YAM6C,qBAAA;OAJ1C,KAAK,KAAK;OACV,OAAO,KAAK;OACZ,eAAa,KAAK;OAClB,cAAY,KAAK;;8BACW,CAAA,gBAAA,gBAA3B,KAAK,SAAS,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;;iBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.js","names":[],"sources":["../../../src/components/modal/ModalContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { DialogPortal, DialogContent, injectDialogRootContext } from 'reka-ui'\nimport { motion, AnimatePresence } from 'motion-v'\nimport { modalVariants } from '@auronui/styles/components/modal'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useModalInject } from './Modal.vue'\nimport ModalOverlay from './ModalOverlay.vue'\n\nconst props = withDefaults(defineProps<{\n class?: string\n}>(), {})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\n// Inject context from Modal root\nconst ctx = useModalInject({ size: 'md', scroll: 'inside', variant: 'opaque', placement: 'auto' })\n\n// Inject Reka's dialog root context to read open state for AnimatePresence\nconst dialogRootContext = injectDialogRootContext()\n\nconst styles = modalVariants()\n</script>\n\n<template>\n <DialogPortal>\n <ModalOverlay />\n <DialogContent\n :class=\"composeClassName(styles.container({ scroll: ctx.scroll }), props.class)\"\n :data-placement=\"ctx.placement\"\n :aria-hidden=\"!dialogRootContext.open.value || undefined\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <AnimatePresence>\n <motion.div\n v-if=\"dialogRootContext.open.value\"\n :class=\"composeClassName(styles.dialog({ size: ctx.size, scroll: ctx.scroll }), 'modal-content-inner')\"\n :data-placement=\"ctx.placement\"\n :initial=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :animate=\"{ opacity: 1, scale: 1, y: 0 }\"\n :exit=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :transition=\"{ duration: 0.2, ease: 'easeOut' }\"\n >\n <slot />\n </motion.div>\n </AnimatePresence>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ModalContent.js","names":[],"sources":["../../../src/components/modal/ModalContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { DialogPortal, DialogContent, injectDialogRootContext } from 'reka-ui'\nimport { motion, AnimatePresence } from 'motion-v'\nimport { modalVariants } from '@auronui/styles/components/modal'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useModalInject } from './Modal.vue'\nimport ModalOverlay from './ModalOverlay.vue'\n\nconst props = withDefaults(defineProps<{\n class?: string\n}>(), {})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\n// Inject context from Modal root\nconst ctx = useModalInject({ size: 'md', scroll: 'inside', variant: 'opaque', placement: 'auto' })\n\n// Inject Reka's dialog root context to read open state for AnimatePresence\nconst dialogRootContext = injectDialogRootContext()\n\nconst styles = modalVariants()\n</script>\n\n<template>\n <DialogPortal>\n <div class=\"modal__portal\">\n <ModalOverlay />\n <DialogContent\n :class=\"composeClassName(styles.container({ scroll: ctx.scroll }), props.class)\"\n :data-placement=\"ctx.placement\"\n :aria-hidden=\"!dialogRootContext.open.value || undefined\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <AnimatePresence>\n <motion.div\n v-if=\"dialogRootContext.open.value\"\n :class=\"composeClassName(styles.dialog({ size: ctx.size, scroll: ctx.scroll }), 'modal-content-inner')\"\n :data-placement=\"ctx.placement\"\n :initial=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :animate=\"{ opacity: 1, scale: 1, y: 0 }\"\n :exit=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :transition=\"{ duration: 0.2, ease: 'easeOut' }\"\n >\n <slot />\n </motion.div>\n </AnimatePresence>\n </DialogContent>\n </div>\n </DialogPortal>\n</template>\n"],"mappings":""}
|
|
@@ -4,9 +4,10 @@ import { AnimatePresence_default } from "../../node_modules/.pnpm/motion-v@2.2.1
|
|
|
4
4
|
import { useModalInject } from "./Modal.vue_vue_type_script_lang.js";
|
|
5
5
|
import { modalVariants } from "../../packages/styles/src/components/modal/modal.styles.js";
|
|
6
6
|
import ModalOverlay_default from "./ModalOverlay.js";
|
|
7
|
-
import { createBlock, createCommentVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
7
|
+
import { createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
8
8
|
import { DialogContent, DialogPortal, injectDialogRootContext } from "reka-ui";
|
|
9
9
|
//#region src/components/modal/ModalContent.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var _hoisted_1 = { class: "modal__portal" };
|
|
10
11
|
var ModalContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
11
12
|
__name: "ModalContent",
|
|
12
13
|
props: { class: {} },
|
|
@@ -30,7 +31,7 @@ var ModalContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
30
31
|
const styles = modalVariants();
|
|
31
32
|
return (_ctx, _cache) => {
|
|
32
33
|
return openBlock(), createBlock(unref(DialogPortal), null, {
|
|
33
|
-
default: withCtx(() => [createVNode(ModalOverlay_default), createVNode(unref(DialogContent), {
|
|
34
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(ModalOverlay_default), createVNode(unref(DialogContent), {
|
|
34
35
|
class: normalizeClass(unref(composeClassName)(unref(styles).container({ scroll: unref(ctx).scroll }), props.class)),
|
|
35
36
|
"data-placement": unref(ctx).placement,
|
|
36
37
|
"aria-hidden": !unref(dialogRootContext).open.value || void 0,
|
|
@@ -78,7 +79,7 @@ var ModalContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
78
79
|
"class",
|
|
79
80
|
"data-placement",
|
|
80
81
|
"aria-hidden"
|
|
81
|
-
])]),
|
|
82
|
+
])])]),
|
|
82
83
|
_: 3
|
|
83
84
|
});
|
|
84
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/modal/ModalContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { DialogPortal, DialogContent, injectDialogRootContext } from 'reka-ui'\nimport { motion, AnimatePresence } from 'motion-v'\nimport { modalVariants } from '@auronui/styles/components/modal'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useModalInject } from './Modal.vue'\nimport ModalOverlay from './ModalOverlay.vue'\n\nconst props = withDefaults(defineProps<{\n class?: string\n}>(), {})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\n// Inject context from Modal root\nconst ctx = useModalInject({ size: 'md', scroll: 'inside', variant: 'opaque', placement: 'auto' })\n\n// Inject Reka's dialog root context to read open state for AnimatePresence\nconst dialogRootContext = injectDialogRootContext()\n\nconst styles = modalVariants()\n</script>\n\n<template>\n <DialogPortal>\n <ModalOverlay />\n <DialogContent\n :class=\"composeClassName(styles.container({ scroll: ctx.scroll }), props.class)\"\n :data-placement=\"ctx.placement\"\n :aria-hidden=\"!dialogRootContext.open.value || undefined\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <AnimatePresence>\n <motion.div\n v-if=\"dialogRootContext.open.value\"\n :class=\"composeClassName(styles.dialog({ size: ctx.size, scroll: ctx.scroll }), 'modal-content-inner')\"\n :data-placement=\"ctx.placement\"\n :initial=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :animate=\"{ opacity: 1, scale: 1, y: 0 }\"\n :exit=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :transition=\"{ duration: 0.2, ease: 'easeOut' }\"\n >\n <slot />\n </motion.div>\n </AnimatePresence>\n </DialogContent>\n </DialogPortal>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalContent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/modal/ModalContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { DialogPortal, DialogContent, injectDialogRootContext } from 'reka-ui'\nimport { motion, AnimatePresence } from 'motion-v'\nimport { modalVariants } from '@auronui/styles/components/modal'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useModalInject } from './Modal.vue'\nimport ModalOverlay from './ModalOverlay.vue'\n\nconst props = withDefaults(defineProps<{\n class?: string\n}>(), {})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\n// Inject context from Modal root\nconst ctx = useModalInject({ size: 'md', scroll: 'inside', variant: 'opaque', placement: 'auto' })\n\n// Inject Reka's dialog root context to read open state for AnimatePresence\nconst dialogRootContext = injectDialogRootContext()\n\nconst styles = modalVariants()\n</script>\n\n<template>\n <DialogPortal>\n <div class=\"modal__portal\">\n <ModalOverlay />\n <DialogContent\n :class=\"composeClassName(styles.container({ scroll: ctx.scroll }), props.class)\"\n :data-placement=\"ctx.placement\"\n :aria-hidden=\"!dialogRootContext.open.value || undefined\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <AnimatePresence>\n <motion.div\n v-if=\"dialogRootContext.open.value\"\n :class=\"composeClassName(styles.dialog({ size: ctx.size, scroll: ctx.scroll }), 'modal-content-inner')\"\n :data-placement=\"ctx.placement\"\n :initial=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :animate=\"{ opacity: 1, scale: 1, y: 0 }\"\n :exit=\"{ opacity: 0, scale: 0.95, y: -10 }\"\n :transition=\"{ duration: 0.2, ease: 'easeOut' }\"\n >\n <slot />\n </motion.div>\n </AnimatePresence>\n </DialogContent>\n </div>\n </DialogPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EAId,MAAM,OAAO;EASb,MAAM,MAAM,eAAe;GAAE,MAAM;GAAM,QAAQ;GAAU,SAAS;GAAU,WAAW;GAAQ,CAAA;EAGjG,MAAM,oBAAoB,yBAAwB;EAElD,MAAM,SAAS,eAAc;;uBAI3B,YA4Be,MAAA,aAAA,EAAA,MAAA;2BADP,CA1BN,mBA0BM,OA1BN,YA0BM,CAzBN,YAAgB,qBAAA,EAChB,YAuBgB,MAAA,cAAA,EAAA;KAtBb,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,OAAM,CAAC,UAAS,EAAA,QAAW,MAAA,IAAG,CAAC,QAAM,CAAA,EAAK,MAAM,MAAK,CAAA;KAC7E,kBAAgB,MAAA,IAAG,CAAC;KACpB,eAAW,CAAG,MAAA,kBAAiB,CAAC,KAAK,SAAS,KAAA;KAC9C,iBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAoB,OAAM;KAC/C,sBAAoB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,wBAAyB,OAAM;KACzD,mBAAgB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,oBAAqB,OAAM;KACjD,iBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAoB,OAAM;KAC/C,kBAAgB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,oBAAqB,OAAM;;4BAchC,CAZlB,YAYkB,MAAA,wBAAA,EAAA,MAAA;6BADH,CATL,MAAA,kBAAiB,CAAC,KAAK,SAAA,WAAA,EAD/B,YAUa,MAAA,OAAA,CAAA,KAAA;;OARV,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,OAAM,CAAC,OAAM;QAAA,MAAS,MAAA,IAAG,CAAC;QAAI,QAAU,MAAA,IAAG,CAAC;QAAM,CAAA,EAAA,sBAAA,CAAA;OAC1E,kBAAgB,MAAA,IAAG,CAAC;OACpB,SAAS;QAAA,SAAA;QAAA,OAAA;QAAA,GAAA;QAAmC;OAC5C,SAAS;QAAA,SAAA;QAAA,OAAA;QAAA,GAAA;QAA8B;OACvC,MAAM;QAAA,SAAA;QAAA,OAAA;QAAA,GAAA;QAAmC;OACzC,YAAY;QAAA,UAAA;QAAA,MAAA;QAAkC;;8BAEvC,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\n\nconst props = withDefaults(defineProps<{\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\n// Provide context to child Radio components\nuseRadioGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n})\n\nconst labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n radioGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <RadioGroupRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :class=\"composeClassName(groupClasses, props.class)\"\n @update:model-value=\"$event != null && emit('update:modelValue', String($event))\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"radio-group__label\"\n >{{ props.label }}</span>\n <div class=\"radio-group__wrapper\">\n <slot />\n </div>\n <span\n v-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\nimport Radio from './Radio.vue'\n\ntype RadioShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render radio options from an array instead of the compound slot API */\n items?: RadioShorthandItem[]\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\n// Provide context to child Radio components\nuseRadioGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n})\n\nconst labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n radioGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <RadioGroupRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :class=\"composeClassName(groupClasses, props.class)\"\n @update:model-value=\"$event != null && emit('update:modelValue', String($event))\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"radio-group__label\"\n >{{ props.label }}</span>\n <div class=\"radio-group__wrapper\">\n <template v-if=\"props.items\">\n <Radio\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</Radio>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useRadioGroupProvide } from "./radio-group.context.js";
|
|
3
|
-
import
|
|
3
|
+
import Radio_default from "./Radio.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
|
|
4
5
|
import { radioGroupVariants } from "@auronui/styles";
|
|
5
6
|
import { RadioGroupRoot } from "reka-ui";
|
|
6
7
|
//#region src/components/radio/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -23,7 +24,8 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
23
24
|
orientation: { default: "vertical" },
|
|
24
25
|
label: { default: void 0 },
|
|
25
26
|
description: { default: void 0 },
|
|
26
|
-
class: {}
|
|
27
|
+
class: {},
|
|
28
|
+
items: {}
|
|
27
29
|
},
|
|
28
30
|
emits: ["update:modelValue"],
|
|
29
31
|
setup(__props, { emit: __emit }) {
|
|
@@ -52,7 +54,16 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
52
54
|
id: labelId,
|
|
53
55
|
class: "radio-group__label"
|
|
54
56
|
}, toDisplayString(props.label), 1)) : createCommentVNode("", true),
|
|
55
|
-
createElementVNode("div", _hoisted_1, [
|
|
57
|
+
createElementVNode("div", _hoisted_1, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
58
|
+
return openBlock(), createBlock(Radio_default, {
|
|
59
|
+
key: item.value,
|
|
60
|
+
value: item.value,
|
|
61
|
+
disabled: item.disabled
|
|
62
|
+
}, {
|
|
63
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
|
|
64
|
+
_: 2
|
|
65
|
+
}, 1032, ["value", "disabled"]);
|
|
66
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
56
67
|
props.description ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
57
68
|
]),
|
|
58
69
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\n\nconst props = withDefaults(defineProps<{\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\n// Provide context to child Radio components\nuseRadioGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n})\n\nconst labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n radioGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <RadioGroupRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :class=\"composeClassName(groupClasses, props.class)\"\n @update:model-value=\"$event != null && emit('update:modelValue', String($event))\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"radio-group__label\"\n >{{ props.label }}</span>\n <div class=\"radio-group__wrapper\">\n <slot />\n </div>\n <span\n v-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\nimport Radio from './Radio.vue'\n\ntype RadioShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render radio options from an array instead of the compound slot API */\n items?: RadioShorthandItem[]\n}>(), {\n variant: 'primary',\n disabled: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\n// Provide context to child Radio components\nuseRadioGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: toRef(props, 'disabled'),\n})\n\nconst labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupClasses = computed(() =>\n radioGroupVariants({ variant: props.variant })\n)\n</script>\n\n<template>\n <RadioGroupRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :class=\"composeClassName(groupClasses, props.class)\"\n @update:model-value=\"$event != null && emit('update:modelValue', String($event))\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"radio-group__label\"\n >{{ props.label }}</span>\n <div class=\"radio-group__wrapper\">\n <template v-if=\"props.items\">\n <Radio\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</Radio>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EAuBd,MAAM,OAAO;AAKb,uBAAqB;GACnB,SAAS,MAAM,OAAO,UAAU;GAChC,UAAU,MAAM,OAAO,WAAW;GACnC,CAAA;EAED,MAAM,UAAU,qBAAqB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE;EAE3E,MAAM,eAAe,eACnB,mBAAmB,EAAE,SAAS,MAAM,SAAS,CAAA,CAC/C;;uBAIE,YA8BiB,MAAA,eAAA,EAAA;IA7Bd,eAAa,MAAM;IACnB,iBAAe,MAAM;IACrB,UAAU,MAAM;IAChB,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,mBAAiB,MAAM,QAAQ,UAAU,KAAA;IACzC,OAAK,eAAE,MAAA,iBAAgB,CAAC,aAAA,OAAc,MAAM,MAAK,CAAA;IACjD,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAE,UAAM,QAAY,KAAI,qBAAsB,OAAO,OAAM,CAAA;;2BAMrD;KAHjB,MAAM,SAAA,WAAA,EADd,mBAIyB,QAAA;;MAFtB,IAAI;MACL,OAAM;wBACJ,MAAM,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KACf,mBAUM,OAVN,YAUM,CATY,MAAM,SAAA,UAAA,KAAA,EACpB,mBAKuC,UAAA,EAAA,KAAA,GAAA,EAAA,WAJtB,MAAM,QAAd,SAAI;0BADb,YAKuC,eAAA;OAHpC,KAAK,KAAK;OACV,OAAO,KAAK;OACZ,UAAU,KAAK;;8BACa,CAAA,gBAAA,gBAA3B,KAAK,SAAS,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;iBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA;KAGT,MAAM,eAAA,WAAA,EADd,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","names":[],"sources":["../../../src/components/stepper/Stepper.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, provide, ref } from 'vue'\nimport { stepperVariants, type StepperVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { stepperContextKey, type StepStatus } from './Stepper.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: number\n defaultValue?: number\n totalSteps?: number\n orientation?: StepperVariants['orientation']\n size?: StepperVariants['size']\n color?: StepperVariants['color']\n class?: ClassValue\n /** Per-slot class name overrides. */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n modelValue: undefined,\n defaultValue: 1,\n totalSteps: 0,\n orientation: 'horizontal',\n size: 'md',\n color: 'accent',\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [step: number]\n}>()\n\nconst internalStep = ref(props.defaultValue ?? 1)\nconst currentStep = computed({\n get: () => props.modelValue ?? internalStep.value,\n set: (val) => {\n internalStep.value = val\n emit('update:modelValue', val)\n },\n})\n\nconst slotFns = computed(() =>\n stepperVariants({\n orientation: props.orientation,\n size: props.size,\n color: props.color,\n }),\n)\n\nfunction getStepStatus(step: number): StepStatus {\n const curr = currentStep.value\n if (step < curr) return 'completed'\n if (step === curr) return 'current'\n return 'pending'\n}\n\nprovide(stepperContextKey, {\n currentStep: computed(() => currentStep.value),\n orientation: computed(() => props.orientation ?? 'horizontal'),\n size: computed(() => props.size ?? 'md'),\n color: computed(() => props.color ?? 'accent'),\n totalSteps:
|
|
1
|
+
{"version":3,"file":"Stepper.js","names":[],"sources":["../../../src/components/stepper/Stepper.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, provide, ref } from 'vue'\nimport { stepperVariants, type StepperVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { stepperContextKey, type StepStatus } from './Stepper.context'\nimport StepperItem from './StepperItem.vue'\nimport StepperIndicator from './StepperIndicator.vue'\nimport StepperTitle from './StepperTitle.vue'\nimport StepperDescription from './StepperDescription.vue'\nimport StepperSeparator from './StepperSeparator.vue'\nimport StepperContent from './StepperContent.vue'\n\ntype StepperShorthandItem = { title?: string; description?: string }\n\nconst props = withDefaults(defineProps<{\n modelValue?: number\n defaultValue?: number\n totalSteps?: number\n orientation?: StepperVariants['orientation']\n size?: StepperVariants['size']\n color?: StepperVariants['color']\n class?: ClassValue\n /** Per-slot class name overrides. */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render steps from an array instead of the compound slot API */\n items?: StepperShorthandItem[]\n}>(), {\n modelValue: undefined,\n defaultValue: 1,\n totalSteps: 0,\n orientation: 'horizontal',\n size: 'md',\n color: 'accent',\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [step: number]\n}>()\n\nconst internalStep = ref(props.defaultValue ?? 1)\nconst currentStep = computed({\n get: () => props.modelValue ?? internalStep.value,\n set: (val) => {\n internalStep.value = val\n emit('update:modelValue', val)\n },\n})\n\nconst slotFns = computed(() =>\n stepperVariants({\n orientation: props.orientation,\n size: props.size,\n color: props.color,\n }),\n)\n\nfunction getStepStatus(step: number): StepStatus {\n const curr = currentStep.value\n if (step < curr) return 'completed'\n if (step === curr) return 'current'\n return 'pending'\n}\n\nconst resolvedTotalSteps = computed(() => props.items ? props.items.length : props.totalSteps)\n\nprovide(stepperContextKey, {\n currentStep: computed(() => currentStep.value),\n orientation: computed(() => props.orientation ?? 'horizontal'),\n size: computed(() => props.size ?? 'md'),\n color: computed(() => props.color ?? 'accent'),\n totalSteps: resolvedTotalSteps,\n getStepStatus,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :aria-label=\"`Step ${currentStep} of ${resolvedTotalSteps}`\"\n data-slot=\"stepper\"\n >\n <template v-if=\"props.items\">\n <StepperItem\n v-for=\"(item, idx) in props.items\"\n :key=\"idx + 1\"\n :step=\"idx + 1\"\n >\n <StepperIndicator>{{ idx + 1 }}</StepperIndicator>\n <StepperSeparator v-if=\"idx < props.items.length - 1\" />\n <StepperContent>\n <StepperTitle v-if=\"item.title\">{{ item.title }}</StepperTitle>\n <StepperDescription v-if=\"item.description\">{{ item.description }}</StepperDescription>\n </StepperContent>\n </StepperItem>\n </template>\n <slot v-else />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { stepperContextKey } from "./Stepper.context.js";
|
|
3
|
-
import
|
|
3
|
+
import StepperItem_default from "./StepperItem.js";
|
|
4
|
+
import StepperIndicator_default from "./StepperIndicator.js";
|
|
5
|
+
import StepperTitle_default from "./StepperTitle.js";
|
|
6
|
+
import StepperDescription_default from "./StepperDescription.js";
|
|
7
|
+
import StepperSeparator_default from "./StepperSeparator.js";
|
|
8
|
+
import StepperContent_default from "./StepperContent.js";
|
|
9
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
10
|
import { stepperVariants } from "@auronui/styles";
|
|
5
11
|
//#region src/components/stepper/Stepper.vue?vue&type=script&setup=true&lang.ts
|
|
6
12
|
var _hoisted_1 = ["aria-label"];
|
|
@@ -23,7 +29,8 @@ var Stepper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
23
29
|
],
|
|
24
30
|
default: void 0
|
|
25
31
|
},
|
|
26
|
-
classNames: {}
|
|
32
|
+
classNames: {},
|
|
33
|
+
items: {}
|
|
27
34
|
},
|
|
28
35
|
emits: ["update:modelValue"],
|
|
29
36
|
setup(__props, { emit: __emit }) {
|
|
@@ -48,20 +55,45 @@ var Stepper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
48
55
|
if (step === curr) return "current";
|
|
49
56
|
return "pending";
|
|
50
57
|
}
|
|
58
|
+
const resolvedTotalSteps = computed(() => props.items ? props.items.length : props.totalSteps);
|
|
51
59
|
provide(stepperContextKey, {
|
|
52
60
|
currentStep: computed(() => currentStep.value),
|
|
53
61
|
orientation: computed(() => props.orientation ?? "horizontal"),
|
|
54
62
|
size: computed(() => props.size ?? "md"),
|
|
55
63
|
color: computed(() => props.color ?? "accent"),
|
|
56
|
-
totalSteps:
|
|
64
|
+
totalSteps: resolvedTotalSteps,
|
|
57
65
|
getStepStatus
|
|
58
66
|
});
|
|
59
67
|
return (_ctx, _cache) => {
|
|
60
68
|
return openBlock(), createElementBlock("div", {
|
|
61
69
|
class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class, props.classNames?.base)),
|
|
62
|
-
"aria-label": `Step ${currentStep.value} of ${
|
|
70
|
+
"aria-label": `Step ${currentStep.value} of ${resolvedTotalSteps.value}`,
|
|
63
71
|
"data-slot": "stepper"
|
|
64
|
-
}, [
|
|
72
|
+
}, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item, idx) => {
|
|
73
|
+
return openBlock(), createBlock(StepperItem_default, {
|
|
74
|
+
key: idx + 1,
|
|
75
|
+
step: idx + 1
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createVNode(StepperIndicator_default, null, {
|
|
79
|
+
default: withCtx(() => [createTextVNode(toDisplayString(idx + 1), 1)]),
|
|
80
|
+
_: 2
|
|
81
|
+
}, 1024),
|
|
82
|
+
idx < props.items.length - 1 ? (openBlock(), createBlock(StepperSeparator_default, { key: 0 })) : createCommentVNode("", true),
|
|
83
|
+
createVNode(StepperContent_default, null, {
|
|
84
|
+
default: withCtx(() => [item.title ? (openBlock(), createBlock(StepperTitle_default, { key: 0 }, {
|
|
85
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.title), 1)]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1024)) : createCommentVNode("", true), item.description ? (openBlock(), createBlock(StepperDescription_default, { key: 1 }, {
|
|
88
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.description), 1)]),
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1024)) : createCommentVNode("", true)]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1024)
|
|
93
|
+
]),
|
|
94
|
+
_: 2
|
|
95
|
+
}, 1032, ["step"]);
|
|
96
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 10, _hoisted_1);
|
|
65
97
|
};
|
|
66
98
|
}
|
|
67
99
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/stepper/Stepper.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, provide, ref } from 'vue'\nimport { stepperVariants, type StepperVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { stepperContextKey, type StepStatus } from './Stepper.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: number\n defaultValue?: number\n totalSteps?: number\n orientation?: StepperVariants['orientation']\n size?: StepperVariants['size']\n color?: StepperVariants['color']\n class?: ClassValue\n /** Per-slot class name overrides. */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n modelValue: undefined,\n defaultValue: 1,\n totalSteps: 0,\n orientation: 'horizontal',\n size: 'md',\n color: 'accent',\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [step: number]\n}>()\n\nconst internalStep = ref(props.defaultValue ?? 1)\nconst currentStep = computed({\n get: () => props.modelValue ?? internalStep.value,\n set: (val) => {\n internalStep.value = val\n emit('update:modelValue', val)\n },\n})\n\nconst slotFns = computed(() =>\n stepperVariants({\n orientation: props.orientation,\n size: props.size,\n color: props.color,\n }),\n)\n\nfunction getStepStatus(step: number): StepStatus {\n const curr = currentStep.value\n if (step < curr) return 'completed'\n if (step === curr) return 'current'\n return 'pending'\n}\n\nprovide(stepperContextKey, {\n currentStep: computed(() => currentStep.value),\n orientation: computed(() => props.orientation ?? 'horizontal'),\n size: computed(() => props.size ?? 'md'),\n color: computed(() => props.color ?? 'accent'),\n totalSteps:
|
|
1
|
+
{"version":3,"file":"Stepper.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/stepper/Stepper.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, provide, ref } from 'vue'\nimport { stepperVariants, type StepperVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { stepperContextKey, type StepStatus } from './Stepper.context'\nimport StepperItem from './StepperItem.vue'\nimport StepperIndicator from './StepperIndicator.vue'\nimport StepperTitle from './StepperTitle.vue'\nimport StepperDescription from './StepperDescription.vue'\nimport StepperSeparator from './StepperSeparator.vue'\nimport StepperContent from './StepperContent.vue'\n\ntype StepperShorthandItem = { title?: string; description?: string }\n\nconst props = withDefaults(defineProps<{\n modelValue?: number\n defaultValue?: number\n totalSteps?: number\n orientation?: StepperVariants['orientation']\n size?: StepperVariants['size']\n color?: StepperVariants['color']\n class?: ClassValue\n /** Per-slot class name overrides. */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render steps from an array instead of the compound slot API */\n items?: StepperShorthandItem[]\n}>(), {\n modelValue: undefined,\n defaultValue: 1,\n totalSteps: 0,\n orientation: 'horizontal',\n size: 'md',\n color: 'accent',\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [step: number]\n}>()\n\nconst internalStep = ref(props.defaultValue ?? 1)\nconst currentStep = computed({\n get: () => props.modelValue ?? internalStep.value,\n set: (val) => {\n internalStep.value = val\n emit('update:modelValue', val)\n },\n})\n\nconst slotFns = computed(() =>\n stepperVariants({\n orientation: props.orientation,\n size: props.size,\n color: props.color,\n }),\n)\n\nfunction getStepStatus(step: number): StepStatus {\n const curr = currentStep.value\n if (step < curr) return 'completed'\n if (step === curr) return 'current'\n return 'pending'\n}\n\nconst resolvedTotalSteps = computed(() => props.items ? props.items.length : props.totalSteps)\n\nprovide(stepperContextKey, {\n currentStep: computed(() => currentStep.value),\n orientation: computed(() => props.orientation ?? 'horizontal'),\n size: computed(() => props.size ?? 'md'),\n color: computed(() => props.color ?? 'accent'),\n totalSteps: resolvedTotalSteps,\n getStepStatus,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :aria-label=\"`Step ${currentStep} of ${resolvedTotalSteps}`\"\n data-slot=\"stepper\"\n >\n <template v-if=\"props.items\">\n <StepperItem\n v-for=\"(item, idx) in props.items\"\n :key=\"idx + 1\"\n :step=\"idx + 1\"\n >\n <StepperIndicator>{{ idx + 1 }}</StepperIndicator>\n <StepperSeparator v-if=\"idx < props.items.length - 1\" />\n <StepperContent>\n <StepperTitle v-if=\"item.title\">{{ item.title }}</StepperTitle>\n <StepperDescription v-if=\"item.description\">{{ item.description }}</StepperDescription>\n </StepperContent>\n </StepperItem>\n </template>\n <slot v-else />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAwBd,MAAM,OAAO;EAIb,MAAM,eAAe,IAAI,MAAM,gBAAgB,EAAC;EAChD,MAAM,cAAc,SAAS;GAC3B,WAAW,MAAM,cAAc,aAAa;GAC5C,MAAM,QAAQ;AACZ,iBAAa,QAAQ;AACrB,SAAK,qBAAqB,IAAG;;GAEhC,CAAA;EAED,MAAM,UAAU,eACd,gBAAgB;GACd,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,OAAO,MAAM;GACd,CAAC,CACJ;EAEA,SAAS,cAAc,MAA0B;GAC/C,MAAM,OAAO,YAAY;AACzB,OAAI,OAAO,KAAM,QAAO;AACxB,OAAI,SAAS,KAAM,QAAO;AAC1B,UAAO;;EAGT,MAAM,qBAAqB,eAAe,MAAM,QAAQ,MAAM,MAAM,SAAS,MAAM,WAAU;AAE7F,UAAQ,mBAAmB;GACzB,aAAa,eAAe,YAAY,MAAM;GAC9C,aAAa,eAAe,MAAM,eAAe,aAAa;GAC9D,MAAM,eAAe,MAAM,QAAQ,KAAK;GACxC,OAAO,eAAe,MAAM,SAAS,SAAS;GAC9C,YAAY;GACZ;GACD,CAAA;;uBAIC,mBAoBM,OAAA;IAnBH,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI,CAAA;IAC3E,cAAU,QAAU,YAAA,MAAW,MAAO,mBAAA;IACvC,aAAU;OAEM,MAAM,SAAA,UAAA,KAAA,EACpB,mBAWc,UAAA,EAAA,KAAA,GAAA,EAAA,WAVU,MAAM,QAApB,MAAM,QAAG;wBADnB,YAWc,qBAAA;KATX,KAAK,MAAG;KACR,MAAM,MAAG;;4BAEwC;MAAlD,YAAkD,0BAAA,MAAA;8BAAnB,CAAA,gBAAA,gBAAV,MAAG,EAAA,EAAA,EAAA,CAAA,CAAA;;;MACA,MAAM,MAAM,MAAM,SAAM,KAAA,WAAA,EAAhD,YAAwD,0BAAA,EAAA,KAAA,GAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;MACxD,YAGiB,wBAAA,MAAA;8BAFgD,CAA3C,KAAK,SAAA,WAAA,EAAzB,YAA+D,sBAAA,EAAA,KAAA,GAAA,EAAA;+BAAf,CAAA,gBAAA,gBAAb,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;iDACnB,KAAK,eAAA,WAAA,EAA/B,YAAuF,4BAAA,EAAA,KAAA,GAAA,EAAA;+BAArB,CAAA,gBAAA,gBAAnB,KAAK,YAAW,EAAA,EAAA,CAAA,CAAA;;;;;;;;eAIrE,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,IAAA,WAAA"}
|