@auronui/vue 1.0.23 → 1.1.1
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/ai-rules.md +884 -0
- package/bin/setup-ai.mjs +74 -0
- package/dist/cjs/index.cjs +1003 -891
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.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 +17 -2
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/checkbox/checkbox-group.context.js.map +1 -1
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-range-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/date-range-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js.map +1 -1
- package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/validation.js +1 -1
- package/dist/components/form/validation.js.map +1 -1
- package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/popover/PopoverContent.js.map +1 -1
- package/dist/components/popover/PopoverContent.vue_vue_type_script_setup_true_lang.js +46 -34
- package/dist/components/popover/PopoverContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/Radio.vue_vue_type_script_setup_true_lang.js +9 -1
- package/dist/components/radio/Radio.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 -2
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/radio/radio-group.context.js.map +1 -1
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch/Switch.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/components/switch/Switch.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 +17 -2
- package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/switch/switch-group.context.js.map +1 -1
- package/dist/components/tooltip/TooltipContent.js.map +1 -1
- package/dist/components/tooltip/TooltipContent.vue_vue_type_script_setup_true_lang.js +46 -34
- package/dist/components/tooltip/TooltipContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.d.ts +78 -20
- package/package.json +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/Radio.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { RadioGroupItem, RadioGroupIndicator } from 'reka-ui'\nimport { radioVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useRadioGroupInject } from './radio-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to RadioGroupItem\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n value: string\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n /** HTML id attribute forwarded to RadioGroupItem. */\n id?: string\n /** Whether RadioGroupItem renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupItem as. */\n as?: string\n /** HTML name attribute forwarded to RadioGroupItem. */\n name?: string\n /** Whether the radio item is required. */\n required?: boolean\n /** Whether RadioGroupIndicator should force-mount even when unselected. */\n indicatorForceMount?: boolean\n /** Whether RadioGroupIndicator renders as a child element. */\n indicatorAsChild?: boolean\n /** Element or component to render RadioGroupIndicator as. */\n indicatorAs?: string\n class?: ClassValue\n /** Override classNames for individual slots */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n indicator: ClassValue\n content: ClassValue\n }>\n}>(), {\n variant: undefined,\n disabled: false,\n id: undefined,\n asChild: false,\n as: undefined,\n name: undefined,\n required: false,\n indicatorForceMount: undefined,\n indicatorAsChild: false,\n indicatorAs: undefined,\n class: undefined,\n classNames: undefined,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject RadioGroup context with fallback defaults (standalone mode)\nconst groupCtx = useRadioGroupInject({\n variant: ref(undefined),\n disabled: ref(false),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\n\n// Child variant wins over group variant (used for data-variant attribute propagation)\nconst finalVariant = computed(() => props.variant ?? groupCtx.variant.value)\n\nconst slotFns = computed(() => radioVariants())\n</script>\n\n<template>\n <RadioGroupItem\n v-bind=\"attrs\"\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :id=\"props.id\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :name=\"props.name\"\n :required=\"props.required\"\n :data-variant=\"finalVariant\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @select=\"emit('select', $event)\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <RadioGroupIndicator\n :force-mount=\"props.indicatorForceMount\"\n :as-child=\"props.indicatorAsChild\"\n :as=\"props.indicatorAs\"\n :class=\"composeClassName(slotFns.indicator(), props.classNames?.indicator)\"\n />\n </span>\n <span :class=\"composeClassName(slotFns.content(), props.classNames?.content)\">\n <slot />\n </span>\n </RadioGroupItem>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Radio.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/Radio.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { RadioGroupItem, RadioGroupIndicator } from 'reka-ui'\nimport { radioVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useRadioGroupInject } from './radio-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to RadioGroupItem\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n value: string\n variant?: RadioGroupVariants['variant']\n disabled?: boolean\n isInvalid?: boolean\n /** HTML id attribute forwarded to RadioGroupItem. */\n id?: string\n /** Whether RadioGroupItem renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupItem as. */\n as?: string\n /** HTML name attribute forwarded to RadioGroupItem. */\n name?: string\n /** Whether the radio item is required. */\n required?: boolean\n /** Whether RadioGroupIndicator should force-mount even when unselected. */\n indicatorForceMount?: boolean\n /** Whether RadioGroupIndicator renders as a child element. */\n indicatorAsChild?: boolean\n /** Element or component to render RadioGroupIndicator as. */\n indicatorAs?: string\n class?: ClassValue\n /** Override classNames for individual slots */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n indicator: ClassValue\n content: ClassValue\n }>\n}>(), {\n variant: undefined,\n disabled: false,\n isInvalid: false,\n id: undefined,\n asChild: false,\n as: undefined,\n name: undefined,\n required: false,\n indicatorForceMount: undefined,\n indicatorAsChild: false,\n indicatorAs: undefined,\n class: undefined,\n classNames: undefined,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject RadioGroup context with fallback defaults (standalone mode)\nconst groupCtx = useRadioGroupInject({\n variant: ref(undefined),\n disabled: ref(false),\n isInvalid: ref(false),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\n// Group invalid overrides item; item prop allows standalone invalid\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child variant wins over group variant (used for data-variant attribute propagation)\nconst finalVariant = computed(() => props.variant ?? groupCtx.variant.value)\n\nconst slotFns = computed(() => radioVariants())\n</script>\n\n<template>\n <RadioGroupItem\n v-bind=\"attrs\"\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :id=\"props.id\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :name=\"props.name\"\n :required=\"props.required\"\n :data-variant=\"finalVariant\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @select=\"emit('select', $event)\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <RadioGroupIndicator\n :force-mount=\"props.indicatorForceMount\"\n :as-child=\"props.indicatorAsChild\"\n :as=\"props.indicatorAs\"\n :class=\"composeClassName(slotFns.indicator(), props.classNames?.indicator)\"\n />\n </span>\n <span :class=\"composeClassName(slotFns.content(), props.classNames?.content)\">\n <slot />\n </span>\n </RadioGroupItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EA6Cd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAS;EAGvB,MAAM,WAAW,oBAAoB;GACnC,SAAS,IAAI,KAAA,EAAU;GACvB,UAAU,IAAI,MAAM;GACpB,WAAW,IAAI,MAAM;GACtB,CAAA;EAGD,MAAM,aAAa,eAAe,SAAS,SAAS,SAAS,MAAM,SAAQ;EAE3E,MAAM,mBAAmB,eAAe,SAAS,UAAU,SAAS,MAAM,UAAS;EAGnF,MAAM,eAAe,eAAe,MAAM,WAAW,SAAS,QAAQ,MAAK;EAE3E,MAAM,UAAU,eAAe,eAAe,CAAA;;uBAI5C,YAyBiB,MAAA,eAAA,EAzBjB,WACU,MAwBO,MAxBF,EAAA;IACZ,OAAO,MAAM;IACb,UAAU,WAAA;IACV,gBAAc,iBAAA,SAAoB,KAAA;IAClC,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,gBAAc,aAAA;IACd,OAAO,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI;IAC3E,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,UAAW,OAAM;;2BASvB,CAPP,mBAOO,QAAA,EAPA,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA,EAAA,EAAA,CACzE,YAKE,MAAA,oBAAA,EAAA;KAJC,eAAa,MAAM;KACnB,YAAU,MAAM;KAChB,IAAI,MAAM;KACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,WAAS,EAAI,MAAM,YAAY,UAAS,CAAA;;;;;;aAG7E,mBAEO,QAAA,EAFA,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA,EAAA,EAAA,CACzE,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA,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'\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 /** Text direction forwarded to RadioGroupRoot. */\n dir?: 'ltr' | 'rtl'\n /** Whether keyboard navigation loops from last to first item. */\n loop?: boolean\n /** Whether RadioGroupRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupRoot as. */\n as?: string\n /** Whether the radio group is required. */\n required?: boolean\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 dir: undefined,\n loop: true,\n asChild: false,\n as: undefined,\n required: false,\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 :dir=\"props.dir\"\n :loop=\"props.loop\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\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
|
+
{"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 isInvalid?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n errorMessage?: string\n /** Text direction forwarded to RadioGroupRoot. */\n dir?: 'ltr' | 'rtl'\n /** Whether keyboard navigation loops from last to first item. */\n loop?: boolean\n /** Whether RadioGroupRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupRoot as. */\n as?: string\n /** Whether the radio group is required. */\n required?: boolean\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 isInvalid: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n errorMessage: undefined,\n dir: undefined,\n loop: true,\n asChild: false,\n as: undefined,\n required: false,\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 isInvalid: toRef(props, 'isInvalid'),\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 :aria-invalid=\"props.isInvalid || undefined\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :dir=\"props.dir\"\n :loop=\"props.loop\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\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.isInvalid && props.errorMessage\"\n class=\"radio-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":""}
|
|
@@ -8,6 +8,10 @@ import { RadioGroupRoot } from "reka-ui";
|
|
|
8
8
|
var _hoisted_1 = { class: "radio-group__wrapper" };
|
|
9
9
|
var _hoisted_2 = {
|
|
10
10
|
key: 1,
|
|
11
|
+
class: "radio-group__error-message"
|
|
12
|
+
};
|
|
13
|
+
var _hoisted_3 = {
|
|
14
|
+
key: 2,
|
|
11
15
|
class: "radio-group__description"
|
|
12
16
|
};
|
|
13
17
|
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -18,12 +22,17 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
18
22
|
type: Boolean,
|
|
19
23
|
default: false
|
|
20
24
|
},
|
|
25
|
+
isInvalid: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
21
29
|
modelValue: { default: void 0 },
|
|
22
30
|
defaultValue: { default: void 0 },
|
|
23
31
|
name: { default: void 0 },
|
|
24
32
|
orientation: { default: "vertical" },
|
|
25
33
|
label: { default: void 0 },
|
|
26
34
|
description: { default: void 0 },
|
|
35
|
+
errorMessage: { default: void 0 },
|
|
27
36
|
dir: { default: void 0 },
|
|
28
37
|
loop: {
|
|
29
38
|
type: Boolean,
|
|
@@ -47,7 +56,8 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
47
56
|
const emit = __emit;
|
|
48
57
|
useRadioGroupProvide({
|
|
49
58
|
variant: toRef(props, "variant"),
|
|
50
|
-
disabled: toRef(props, "disabled")
|
|
59
|
+
disabled: toRef(props, "disabled"),
|
|
60
|
+
isInvalid: toRef(props, "isInvalid")
|
|
51
61
|
});
|
|
52
62
|
const labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`;
|
|
53
63
|
const groupClasses = computed(() => radioGroupVariants({ variant: props.variant }));
|
|
@@ -56,6 +66,7 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
56
66
|
"model-value": props.modelValue,
|
|
57
67
|
"default-value": props.defaultValue,
|
|
58
68
|
disabled: props.disabled,
|
|
69
|
+
"aria-invalid": props.isInvalid || void 0,
|
|
59
70
|
name: props.name,
|
|
60
71
|
orientation: props.orientation,
|
|
61
72
|
dir: props.dir,
|
|
@@ -83,13 +94,14 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
83
94
|
_: 2
|
|
84
95
|
}, 1032, ["value", "disabled"]);
|
|
85
96
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
86
|
-
props.
|
|
97
|
+
props.isInvalid && props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.errorMessage), 1)) : props.description ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
87
98
|
]),
|
|
88
99
|
_: 3
|
|
89
100
|
}, 8, [
|
|
90
101
|
"model-value",
|
|
91
102
|
"default-value",
|
|
92
103
|
"disabled",
|
|
104
|
+
"aria-invalid",
|
|
93
105
|
"name",
|
|
94
106
|
"orientation",
|
|
95
107
|
"dir",
|
|
@@ -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'\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 /** Text direction forwarded to RadioGroupRoot. */\n dir?: 'ltr' | 'rtl'\n /** Whether keyboard navigation loops from last to first item. */\n loop?: boolean\n /** Whether RadioGroupRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupRoot as. */\n as?: string\n /** Whether the radio group is required. */\n required?: boolean\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 dir: undefined,\n loop: true,\n asChild: false,\n as: undefined,\n required: false,\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 :dir=\"props.dir\"\n :loop=\"props.loop\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\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
|
+
{"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 isInvalid?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n errorMessage?: string\n /** Text direction forwarded to RadioGroupRoot. */\n dir?: 'ltr' | 'rtl'\n /** Whether keyboard navigation loops from last to first item. */\n loop?: boolean\n /** Whether RadioGroupRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupRoot as. */\n as?: string\n /** Whether the radio group is required. */\n required?: boolean\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 isInvalid: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n errorMessage: undefined,\n dir: undefined,\n loop: true,\n asChild: false,\n as: undefined,\n required: false,\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 isInvalid: toRef(props, 'isInvalid'),\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 :aria-invalid=\"props.isInvalid || undefined\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :dir=\"props.dir\"\n :loop=\"props.loop\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\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.isInvalid && props.errorMessage\"\n class=\"radio-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"radio-group__description\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EA0Cd,MAAM,OAAO;AAKb,uBAAqB;GACnB,SAAS,MAAM,OAAO,UAAU;GAChC,UAAU,MAAM,OAAO,WAAW;GAClC,WAAW,MAAM,OAAO,YAAY;GACrC,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,YAwCiB,MAAA,eAAA,EAAA;IAvCd,eAAa,MAAM;IACnB,iBAAe,MAAM;IACrB,UAAU,MAAM;IAChB,gBAAc,MAAM,aAAa,KAAA;IACjC,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,YAAU,MAAM;IAChB,IAAI,MAAM;IACV,UAAU,MAAM;IAChB,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,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAGgC,QAHhC,YAGgC,gBAA5B,MAAM,aAAY,EAAA,EAAA,IAET,MAAM,eAAA,WAAA,EADnB,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.context.js","names":[],"sources":["../../../src/components/radio/radio-group.context.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport type { RadioGroupVariants } from '@auronui/styles'\nimport { createContext } from '../../utils/context'\n\n/**\n * Radio dual-context (follows CANONICAL DUAL-CONTEXT TEMPLATE\n * from components/checkbox/checkbox-group.context.ts).\n *\n * Note: selection state is owned by Reka UI's RadioGroupRoot,\n * so this context only carries variant + disabled for propagation.\n *\n * Contract:\n * - Group provides a Ref-wrapped context via `useProvide`\n * - Child unconditionally calls `useInject(fallback)` with sensible defaults\n * - Prop precedence: group.disabled wins; child.variant wins over group.variant\n */\nexport interface RadioGroupContext {\n variant: Ref<RadioGroupVariants['variant']>\n disabled: Ref<boolean>\n}\n\nexport const {\n useProvide: useRadioGroupProvide,\n useInject: useRadioGroupInject,\n key: radioGroupContextKey,\n} = createContext<RadioGroupContext>('RadioGroup')\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"radio-group.context.js","names":[],"sources":["../../../src/components/radio/radio-group.context.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport type { RadioGroupVariants } from '@auronui/styles'\nimport { createContext } from '../../utils/context'\n\n/**\n * Radio dual-context (follows CANONICAL DUAL-CONTEXT TEMPLATE\n * from components/checkbox/checkbox-group.context.ts).\n *\n * Note: selection state is owned by Reka UI's RadioGroupRoot,\n * so this context only carries variant + disabled for propagation.\n *\n * Contract:\n * - Group provides a Ref-wrapped context via `useProvide`\n * - Child unconditionally calls `useInject(fallback)` with sensible defaults\n * - Prop precedence: group.disabled wins; child.variant wins over group.variant\n */\nexport interface RadioGroupContext {\n variant: Ref<RadioGroupVariants['variant']>\n disabled: Ref<boolean>\n isInvalid: Ref<boolean>\n}\n\nexport const {\n useProvide: useRadioGroupProvide,\n useInject: useRadioGroupInject,\n key: radioGroupContextKey,\n} = createContext<RadioGroupContext>('RadioGroup')\n"],"mappings":";;AAsBA,IAAa,EACX,YAAY,sBACZ,WAAW,qBACX,KAAK,yBACH,cAAiC,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":[],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Switch.js","names":[],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":""}
|
|
@@ -9,6 +9,10 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
9
9
|
__name: "Switch",
|
|
10
10
|
props: {
|
|
11
11
|
size: { default: void 0 },
|
|
12
|
+
isInvalid: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
12
16
|
value: { default: void 0 },
|
|
13
17
|
modelValue: {
|
|
14
18
|
type: Boolean,
|
|
@@ -71,11 +75,13 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
71
75
|
const groupCtx = useSwitchGroupInject({
|
|
72
76
|
size: ref("md"),
|
|
73
77
|
disabled: ref(false),
|
|
78
|
+
isInvalid: ref(false),
|
|
74
79
|
selectedValues: ref([]),
|
|
75
80
|
toggleValue: () => {},
|
|
76
81
|
name: ref(void 0)
|
|
77
82
|
});
|
|
78
83
|
const isDisabled = computed(() => groupCtx.disabled.value || props.disabled);
|
|
84
|
+
const effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid);
|
|
79
85
|
const finalSize = computed(() => props.size ?? groupCtx.size.value);
|
|
80
86
|
const isInGroup = computed(() => props.value !== void 0);
|
|
81
87
|
const checked = computed(() => {
|
|
@@ -91,6 +97,7 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
91
97
|
return openBlock(), createBlock(unref(SwitchRoot), mergeProps(unref(attrs), {
|
|
92
98
|
"model-value": checked.value,
|
|
93
99
|
disabled: isDisabled.value,
|
|
100
|
+
"aria-invalid": effectiveInvalid.value || void 0,
|
|
94
101
|
name: props.name ?? unref(groupCtx).name.value,
|
|
95
102
|
value: props.value,
|
|
96
103
|
id: props.id,
|
|
@@ -118,6 +125,7 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
118
125
|
}, 16, [
|
|
119
126
|
"model-value",
|
|
120
127
|
"disabled",
|
|
128
|
+
"aria-invalid",
|
|
121
129
|
"name",
|
|
122
130
|
"value",
|
|
123
131
|
"id",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EAkDd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAS;EAGvB,MAAM,WAAW,qBAAqB;GACpC,MAAM,IAAI,KAAK;GACf,UAAU,IAAI,MAAM;GACpB,WAAW,IAAI,MAAM;GACrB,gBAAgB,IAAI,EAAE,CAAC;GACvB,mBAAmB;GACnB,MAAM,IAAI,KAAA,EAAU;GACrB,CAAA;EAGD,MAAM,aAAa,eAAe,SAAS,SAAS,SAAS,MAAM,SAAQ;EAC3E,MAAM,mBAAmB,eAAe,SAAS,UAAU,SAAS,MAAM,UAAS;EAGnF,MAAM,YAAY,eAAe,MAAM,QAAQ,SAAS,KAAK,MAAK;EAGlE,MAAM,YAAY,eAAe,MAAM,UAAU,KAAA,EAAS;EAG1D,MAAM,UAAU,eAAwB;AACtC,OAAI,UAAU,MACZ,QAAO,SAAS,eAAe,MAAM,SAAS,MAAM,MAAM;AAE5D,UAAO,MAAM,cAAc;IAC5B;EAGD,SAAS,aAAa,KAAgC;AACpD,OAAI,UAAU,MACZ,UAAS,YAAY,MAAM,MAAM;OAEjC,MAAK,qBAAqB,QAAQ,IAAI,CAAA;;EAI1C,MAAM,UAAU,eACd,eAAe,EAAE,MAAM,UAAU,OAAO,CAAA,CAC1C;;uBASE,YA6Ba,MAAA,WAAA,EA7Bb,WACU,MA4BG,MA5BE,EAAA;IACZ,eAAa,QAAA;IACb,UAAU,WAAA;IACV,gBAAc,iBAAA,SAAoB,KAAA;IAClC,MAAM,MAAM,QAAQ,MAAA,SAAQ,CAAC,KAAK;IAClC,OAAO,MAAM;IACb,IAAI,MAAM;IACV,cAAY,MAAM;IAClB,eAAa,MAAM;IACnB,YAAU,MAAM;IAChB,IAAI,MAAM;IACV,UAAU,MAAM;IAChB,OAAO,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI;IAC3E,uBAAoB;;2BAQd,CANP,mBAMO,QAAA,EANA,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA,EAAA,EAAA,CACzE,YAIE,MAAA,YAAA,EAAA;KAHC,YAAU,MAAM;KAChB,IAAI,MAAM;KACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,OAAK,EAAI,MAAM,YAAY,MAAK,CAAA;;;;;aAI7DA,KAAAA,OAAO,WAAA,WAAA,EADf,mBAKO,QAAA;;KAHJ,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA;QAErE,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchGroup.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\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 Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\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(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SwitchGroup.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n disabled: false,\n isInvalid: false,\n errorMessage: undefined,\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 Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -4,9 +4,17 @@ import Switch_default from "./Switch.js";
|
|
|
4
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
|
|
5
5
|
import { switchGroupVariants } from "@auronui/styles";
|
|
6
6
|
//#region src/components/switch/SwitchGroup.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var _hoisted_1 = [
|
|
7
|
+
var _hoisted_1 = [
|
|
8
|
+
"aria-labelledby",
|
|
9
|
+
"aria-invalid",
|
|
10
|
+
"data-orientation"
|
|
11
|
+
];
|
|
8
12
|
var _hoisted_2 = {
|
|
9
13
|
key: 1,
|
|
14
|
+
class: "switch-group__error-message"
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_3 = {
|
|
17
|
+
key: 2,
|
|
10
18
|
class: "switch-group__description"
|
|
11
19
|
};
|
|
12
20
|
var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -21,6 +29,11 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
21
29
|
defaultValue: { default: void 0 },
|
|
22
30
|
name: { default: void 0 },
|
|
23
31
|
orientation: { default: "vertical" },
|
|
32
|
+
isInvalid: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
errorMessage: { default: void 0 },
|
|
24
37
|
label: { default: void 0 },
|
|
25
38
|
description: { default: void 0 },
|
|
26
39
|
class: {},
|
|
@@ -40,6 +53,7 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
40
53
|
useSwitchGroupProvide({
|
|
41
54
|
size: toRef(props, "size"),
|
|
42
55
|
disabled: toRef(props, "disabled"),
|
|
56
|
+
isInvalid: toRef(props, "isInvalid"),
|
|
43
57
|
selectedValues: currentValues,
|
|
44
58
|
toggleValue,
|
|
45
59
|
name: toRef(props, "name")
|
|
@@ -50,6 +64,7 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
50
64
|
return openBlock(), createElementBlock("div", {
|
|
51
65
|
role: "group",
|
|
52
66
|
"aria-labelledby": props.label ? labelId : void 0,
|
|
67
|
+
"aria-invalid": props.isInvalid || void 0,
|
|
53
68
|
"data-orientation": props.orientation,
|
|
54
69
|
class: normalizeClass(unref(composeClassName)(groupSlots.value.base(), props.class))
|
|
55
70
|
}, [
|
|
@@ -68,7 +83,7 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
68
83
|
_: 2
|
|
69
84
|
}, 1032, ["value", "disabled"]);
|
|
70
85
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2),
|
|
71
|
-
props.
|
|
86
|
+
props.isInvalid && props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.errorMessage), 1)) : props.description ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
72
87
|
], 10, _hoisted_1);
|
|
73
88
|
};
|
|
74
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\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 Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\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(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwitchGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n disabled: false,\n isInvalid: false,\n errorMessage: undefined,\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 Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EA2Bd,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,wBAAsB;GACpB,MAAM,MAAM,OAAO,OAAO;GAC1B,UAAU,MAAM,OAAO,WAAW;GAClC,WAAW,MAAM,OAAO,YAAY;GACpC,gBAAgB;GAChB;GACA,MAAM,MAAM,OAAO,OAAO;GAC3B,CAAA;EAED,MAAM,UAAU,sBAAsB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE;EAE5E,MAAM,aAAa,eACjB,oBAAoB,EAAE,aAAa,MAAM,aAAa,CAAA,CACxD;;uBAIE,mBA+BM,OAAA;IA9BJ,MAAK;IACJ,mBAAiB,MAAM,QAAQ,UAAU,KAAA;IACzC,gBAAc,MAAM,aAAa,KAAA;IACjC,oBAAkB,MAAM;IACxB,OAAK,eAAE,MAAA,iBAAgB,CAAC,WAAA,MAAW,MAAI,EAAI,MAAM,MAAK,CAAA;;IAG/C,MAAM,SAAA,WAAA,EADd,mBAIyB,QAAA;;KAFtB,IAAI;KACL,OAAM;uBACJ,MAAM,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IACf,mBAUM,OAAA,EAVA,OAAK,eAAE,WAAA,MAAW,OAAK,CAAA,EAAA,EAAA,CACX,MAAM,SAAA,UAAA,KAAA,EACpB,mBAK6C,UAAA,EAAA,KAAA,GAAA,EAAA,WAJ5B,MAAM,QAAd,SAAI;yBADb,YAK6C,gBAAA;MAH1C,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,EAAA,EAAA;IAGT,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAGgC,QAHhC,YAGgC,gBAA5B,MAAM,aAAY,EAAA,EAAA,IAET,MAAM,eAAA,WAAA,EADnB,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-group.context.js","names":[],"sources":["../../../src/components/switch/switch-group.context.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport type { SwitchVariants } from '@auronui/styles'\nimport { createContext } from '../../utils/context'\n\n/**\n * SwitchGroup dual-context (follows CANONICAL DUAL-CONTEXT TEMPLATE\n * from components/checkbox/checkbox-group.context.ts).\n *\n * Note: Reka UI has NO SwitchGroup primitive. This is a fully custom\n * group implementation mirroring CheckboxGroup exactly, with the addition\n * of a `size` ref (Switch has size variants; Checkbox does not).\n *\n * Contract:\n * - Group provides a Ref-wrapped context via `useProvide`\n * - Child unconditionally calls `useInject(fallback)` with sensible defaults\n * - Prop precedence: group.disabled wins; child.variant/size wins over group.variant/size\n */\nexport interface SwitchGroupContext {\n size: Ref<SwitchVariants['size']>\n disabled: Ref<boolean>\n selectedValues: Ref<string[]>\n toggleValue: (value: string) => void\n name: Ref<string | undefined>\n}\n\nexport const {\n useProvide: useSwitchGroupProvide,\n useInject: useSwitchGroupInject,\n key: switchGroupContextKey,\n} = createContext<SwitchGroupContext>('SwitchGroup')\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"switch-group.context.js","names":[],"sources":["../../../src/components/switch/switch-group.context.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport type { SwitchVariants } from '@auronui/styles'\nimport { createContext } from '../../utils/context'\n\n/**\n * SwitchGroup dual-context (follows CANONICAL DUAL-CONTEXT TEMPLATE\n * from components/checkbox/checkbox-group.context.ts).\n *\n * Note: Reka UI has NO SwitchGroup primitive. This is a fully custom\n * group implementation mirroring CheckboxGroup exactly, with the addition\n * of a `size` ref (Switch has size variants; Checkbox does not).\n *\n * Contract:\n * - Group provides a Ref-wrapped context via `useProvide`\n * - Child unconditionally calls `useInject(fallback)` with sensible defaults\n * - Prop precedence: group.disabled wins; child.variant/size wins over group.variant/size\n */\nexport interface SwitchGroupContext {\n size: Ref<SwitchVariants['size']>\n disabled: Ref<boolean>\n isInvalid: Ref<boolean>\n selectedValues: Ref<string[]>\n toggleValue: (value: string) => void\n name: Ref<string | undefined>\n}\n\nexport const {\n useProvide: useSwitchGroupProvide,\n useInject: useSwitchGroupInject,\n key: switchGroupContextKey,\n} = createContext<SwitchGroupContext>('SwitchGroup')\n"],"mappings":";;AA0BA,IAAa,EACX,YAAY,uBACZ,WAAW,sBACX,KAAK,0BACH,cAAkC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.js","names":[],"sources":["../../../src/components/tooltip/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TooltipPortal, TooltipContent
|
|
1
|
+
{"version":3,"file":"TooltipContent.js","names":[],"sources":["../../../src/components/tooltip/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TooltipPortal, TooltipContent } from 'reka-ui'\nimport { tooltipVariants } from '@auronui/styles/components/tooltip'\nimport { composeClassName } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n side?: 'top' | 'right' | 'bottom' | 'left'\n sideOffset?: number\n sideFlip?: boolean\n align?: 'start' | 'center' | 'end'\n alignOffset?: number\n alignFlip?: boolean\n avoidCollisions?: boolean\n collisionBoundary?: Element | null | Array<Element | null>\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n arrowPadding?: number\n hideShiftedArrow?: boolean\n sticky?: 'partial' | 'always'\n hideWhenDetached?: boolean\n positionStrategy?: 'fixed' | 'absolute'\n updatePositionStrategy?: 'always' | 'optimized'\n disableUpdateOnLayoutShift?: boolean\n prioritizePosition?: boolean\n class?: string\n}>(), {\n side: 'top',\n sideOffset: 8,\n align: 'center',\n alignOffset: 0,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n}>()\n\nconst styles = tooltipVariants()\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n :side=\"props.side\"\n :side-offset=\"props.sideOffset\"\n :align=\"props.align\"\n :align-offset=\"props.alignOffset\"\n :side-flip=\"props.sideFlip\"\n :align-flip=\"props.alignFlip\"\n :avoid-collisions=\"props.avoidCollisions\"\n :collision-boundary=\"props.collisionBoundary\"\n :collision-padding=\"props.collisionPadding\"\n :arrow-padding=\"props.arrowPadding\"\n :hide-shifted-arrow=\"props.hideShiftedArrow\"\n :sticky=\"props.sticky\"\n :hide-when-detached=\"props.hideWhenDetached\"\n :position-strategy=\"props.positionStrategy\"\n :update-position-strategy=\"props.updatePositionStrategy\"\n :disable-update-on-layout-shift=\"props.disableUpdateOnLayoutShift\"\n :prioritize-position=\"props.prioritizePosition\"\n :class=\"composeClassName(styles.base(), props.class)\"\n v-bind=\"$attrs\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n >\n <slot />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":""}
|
|
@@ -1,75 +1,87 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
|
-
import { motion } from "../../node_modules/.pnpm/motion-v@2.2.1_@vueuse_core@14.2.1_vue@3.5.32_typescript@6.0.2___react-dom@19.2.5_react_8b28b23614a2152514812dba6ef76a55/node_modules/motion-v/dist/es/components/motion/index.js";
|
|
3
|
-
import { AnimatePresence_default } from "../../node_modules/.pnpm/motion-v@2.2.1_@vueuse_core@14.2.1_vue@3.5.32_typescript@6.0.2___react-dom@19.2.5_react_8b28b23614a2152514812dba6ef76a55/node_modules/motion-v/dist/es/components/animate-presence/AnimatePresence.js";
|
|
4
2
|
import { tooltipVariants } from "../../packages/styles/src/components/tooltip/tooltip.styles.js";
|
|
5
|
-
import { createBlock,
|
|
6
|
-
import { TooltipContent, TooltipPortal
|
|
3
|
+
import { createBlock, createVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
4
|
+
import { TooltipContent, TooltipPortal } from "reka-ui";
|
|
7
5
|
//#region src/components/tooltip/TooltipContent.vue?vue&type=script&setup=true&lang.ts
|
|
8
6
|
var TooltipContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
7
|
__name: "TooltipContent",
|
|
10
8
|
props: {
|
|
11
9
|
side: { default: "top" },
|
|
12
10
|
sideOffset: { default: 8 },
|
|
11
|
+
sideFlip: { type: Boolean },
|
|
13
12
|
align: { default: "center" },
|
|
14
13
|
alignOffset: { default: 0 },
|
|
14
|
+
alignFlip: { type: Boolean },
|
|
15
15
|
avoidCollisions: {
|
|
16
16
|
type: Boolean,
|
|
17
17
|
default: true
|
|
18
18
|
},
|
|
19
|
+
collisionBoundary: {},
|
|
20
|
+
collisionPadding: { default: 8 },
|
|
21
|
+
arrowPadding: {},
|
|
22
|
+
hideShiftedArrow: { type: Boolean },
|
|
23
|
+
sticky: {},
|
|
24
|
+
hideWhenDetached: { type: Boolean },
|
|
25
|
+
positionStrategy: {},
|
|
26
|
+
updatePositionStrategy: {},
|
|
27
|
+
disableUpdateOnLayoutShift: { type: Boolean },
|
|
28
|
+
prioritizePosition: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
19
32
|
class: {}
|
|
20
33
|
},
|
|
21
34
|
emits: ["escape-key-down", "pointer-down-outside"],
|
|
22
35
|
setup(__props, { emit: __emit }) {
|
|
23
36
|
const props = __props;
|
|
24
37
|
const emit = __emit;
|
|
25
|
-
const rootContext = injectTooltipRootContext();
|
|
26
38
|
const styles = tooltipVariants();
|
|
27
39
|
return (_ctx, _cache) => {
|
|
28
40
|
return openBlock(), createBlock(unref(TooltipPortal), null, {
|
|
29
41
|
default: withCtx(() => [createVNode(unref(TooltipContent), mergeProps({
|
|
30
|
-
"force-mount": true,
|
|
31
42
|
side: props.side,
|
|
32
43
|
"side-offset": props.sideOffset,
|
|
33
44
|
align: props.align,
|
|
34
45
|
"align-offset": props.alignOffset,
|
|
35
|
-
"
|
|
46
|
+
"side-flip": props.sideFlip,
|
|
47
|
+
"align-flip": props.alignFlip,
|
|
48
|
+
"avoid-collisions": props.avoidCollisions,
|
|
49
|
+
"collision-boundary": props.collisionBoundary,
|
|
50
|
+
"collision-padding": props.collisionPadding,
|
|
51
|
+
"arrow-padding": props.arrowPadding,
|
|
52
|
+
"hide-shifted-arrow": props.hideShiftedArrow,
|
|
53
|
+
sticky: props.sticky,
|
|
54
|
+
"hide-when-detached": props.hideWhenDetached,
|
|
55
|
+
"position-strategy": props.positionStrategy,
|
|
56
|
+
"update-position-strategy": props.updatePositionStrategy,
|
|
57
|
+
"disable-update-on-layout-shift": props.disableUpdateOnLayoutShift,
|
|
58
|
+
"prioritize-position": props.prioritizePosition,
|
|
59
|
+
class: unref(composeClassName)(unref(styles).base(), props.class)
|
|
36
60
|
}, _ctx.$attrs, {
|
|
37
61
|
onEscapeKeyDown: _cache[0] || (_cache[0] = ($event) => emit("escape-key-down", $event)),
|
|
38
62
|
onPointerDownOutside: _cache[1] || (_cache[1] = ($event) => emit("pointer-down-outside", $event))
|
|
39
63
|
}), {
|
|
40
|
-
default: withCtx(() => [
|
|
41
|
-
default: withCtx(() => [unref(rootContext).open.value ? (openBlock(), createBlock(unref(motion).div, {
|
|
42
|
-
key: "tooltip-content",
|
|
43
|
-
class: normalizeClass(unref(composeClassName)(unref(styles).base(), props.class)),
|
|
44
|
-
initial: {
|
|
45
|
-
opacity: 0,
|
|
46
|
-
scale: .9
|
|
47
|
-
},
|
|
48
|
-
animate: {
|
|
49
|
-
opacity: 1,
|
|
50
|
-
scale: 1
|
|
51
|
-
},
|
|
52
|
-
exit: {
|
|
53
|
-
opacity: 0,
|
|
54
|
-
scale: .9
|
|
55
|
-
},
|
|
56
|
-
transition: {
|
|
57
|
-
duration: .1,
|
|
58
|
-
ease: "easeOut"
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
62
|
-
_: 3
|
|
63
|
-
}, 8, ["class"])) : createCommentVNode("", true)]),
|
|
64
|
-
_: 3
|
|
65
|
-
})]),
|
|
64
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
66
65
|
_: 3
|
|
67
66
|
}, 16, [
|
|
68
67
|
"side",
|
|
69
68
|
"side-offset",
|
|
70
69
|
"align",
|
|
71
70
|
"align-offset",
|
|
72
|
-
"
|
|
71
|
+
"side-flip",
|
|
72
|
+
"align-flip",
|
|
73
|
+
"avoid-collisions",
|
|
74
|
+
"collision-boundary",
|
|
75
|
+
"collision-padding",
|
|
76
|
+
"arrow-padding",
|
|
77
|
+
"hide-shifted-arrow",
|
|
78
|
+
"sticky",
|
|
79
|
+
"hide-when-detached",
|
|
80
|
+
"position-strategy",
|
|
81
|
+
"update-position-strategy",
|
|
82
|
+
"disable-update-on-layout-shift",
|
|
83
|
+
"prioritize-position",
|
|
84
|
+
"class"
|
|
73
85
|
])]),
|
|
74
86
|
_: 3
|
|
75
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/components/tooltip/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TooltipPortal, TooltipContent
|
|
1
|
+
{"version":3,"file":"TooltipContent.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/components/tooltip/TooltipContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { TooltipPortal, TooltipContent } from 'reka-ui'\nimport { tooltipVariants } from '@auronui/styles/components/tooltip'\nimport { composeClassName } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n side?: 'top' | 'right' | 'bottom' | 'left'\n sideOffset?: number\n sideFlip?: boolean\n align?: 'start' | 'center' | 'end'\n alignOffset?: number\n alignFlip?: boolean\n avoidCollisions?: boolean\n collisionBoundary?: Element | null | Array<Element | null>\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n arrowPadding?: number\n hideShiftedArrow?: boolean\n sticky?: 'partial' | 'always'\n hideWhenDetached?: boolean\n positionStrategy?: 'fixed' | 'absolute'\n updatePositionStrategy?: 'always' | 'optimized'\n disableUpdateOnLayoutShift?: boolean\n prioritizePosition?: boolean\n class?: string\n}>(), {\n side: 'top',\n sideOffset: 8,\n align: 'center',\n alignOffset: 0,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n}>()\n\nconst styles = tooltipVariants()\n</script>\n\n<template>\n <TooltipPortal>\n <TooltipContent\n :side=\"props.side\"\n :side-offset=\"props.sideOffset\"\n :align=\"props.align\"\n :align-offset=\"props.alignOffset\"\n :side-flip=\"props.sideFlip\"\n :align-flip=\"props.alignFlip\"\n :avoid-collisions=\"props.avoidCollisions\"\n :collision-boundary=\"props.collisionBoundary\"\n :collision-padding=\"props.collisionPadding\"\n :arrow-padding=\"props.arrowPadding\"\n :hide-shifted-arrow=\"props.hideShiftedArrow\"\n :sticky=\"props.sticky\"\n :hide-when-detached=\"props.hideWhenDetached\"\n :position-strategy=\"props.positionStrategy\"\n :update-position-strategy=\"props.updatePositionStrategy\"\n :disable-update-on-layout-shift=\"props.disableUpdateOnLayoutShift\"\n :prioritize-position=\"props.prioritizePosition\"\n :class=\"composeClassName(styles.base(), props.class)\"\n v-bind=\"$attrs\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n >\n <slot />\n </TooltipContent>\n </TooltipPortal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EA6Bd,MAAM,OAAO;EAKb,MAAM,SAAS,iBAAgB;;uBAI7B,YA0BgB,MAAA,cAAA,EAAA,MAAA;2BADG,CAxBjB,YAwBiB,MAAA,eAAA,EAxBjB,WAwBiB;KAvBd,MAAM,MAAM;KACZ,eAAa,MAAM;KACnB,OAAO,MAAM;KACb,gBAAc,MAAM;KACpB,aAAW,MAAM;KACjB,cAAY,MAAM;KAClB,oBAAkB,MAAM;KACxB,sBAAoB,MAAM;KAC1B,qBAAmB,MAAM;KACzB,iBAAe,MAAM;KACrB,sBAAoB,MAAM;KAC1B,QAAQ,MAAM;KACd,sBAAoB,MAAM;KAC1B,qBAAmB,MAAM;KACzB,4BAA0B,MAAM;KAChC,kCAAgC,MAAM;KACtC,uBAAqB,MAAM;KAC3B,OAAO,MAAA,iBAAgB,CAAC,MAAA,OAAM,CAAC,MAAI,EAAI,MAAM,MAAK;OAC3CA,KAAAA,QAAM;KACb,iBAAe,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,mBAAoB,OAAM;KAC/C,sBAAoB,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,wBAAyB,OAAM;;4BAElD,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
|