@auronui/vue 1.0.16 → 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 +783 -478
- 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/select/SelectContent.js.map +1 -1
- package/dist/components/select/SelectContent.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/select/SelectContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectTrigger.js.map +1 -1
- package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js +16 -2
- package/dist/components/select/SelectTrigger.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 +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTrigger.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/select/SelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { SelectTrigger, SelectIcon, injectSelectRootContext } from 'reka-ui'\nimport { useSelectInject } from './Select.context'\n\nwithDefaults(defineProps<{\n class?: string\n}>(), {\n class: undefined,\n})\n\nconst ctx = useSelectInject()\nconst rootContext = injectSelectRootContext()\n\nconst isFilled = computed(() => {\n const v = rootContext?.modelValue?.value\n if (v == null) return false\n if (Array.isArray(v)) return v.length > 0\n return v !== ''\n})\n\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n</script>\n\n<template>\n <SelectTrigger\n :id=\"ctx.triggerId.value\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"isFilled || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n data-slot=\"trigger\"\n >\n <label\n v-if=\"showInsideLabel\"\n :for=\"ctx.triggerId.value\"\n :class=\"ctx.slots.value.label()\"\n >{{ ctx.label.value }}<span\n v-if=\"ctx.isRequired.value\"\n aria-hidden=\"true\"\n > *</span></label>\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <slot />\n <SelectIcon\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"select-default-indicator\"\n >\n <slot name=\"selectorIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </SelectIcon>\n </SelectTrigger>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAWA,MAAM,MAAM,iBAAgB;EAC5B,MAAM,cAAc,yBAAwB;EAE5C,MAAM,WAAW,eAAe;GAC9B,MAAM,IAAI,aAAa,YAAY;AACnC,OAAI,KAAK,KAAM,QAAO;AACtB,OAAI,MAAM,QAAQ,EAAE,CAAE,QAAO,EAAE,SAAS;AACxC,UAAO,MAAM;IACd;EAED,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU,SAC3D;;
|
|
1
|
+
{"version":3,"file":"SelectTrigger.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/select/SelectTrigger.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport { SelectTrigger, SelectIcon, injectSelectRootContext } from 'reka-ui'\nimport { useSelectInject } from './Select.context'\n\nwithDefaults(defineProps<{\n class?: string\n}>(), {\n class: undefined,\n})\n\nconst ctx = useSelectInject()\nconst rootContext = injectSelectRootContext()\n\nconst isFilled = computed(() => {\n const v = rootContext?.modelValue?.value\n if (v == null) return false\n if (Array.isArray(v)) return v.length > 0\n return v !== ''\n})\n\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// Guard re-open when Reka returns focus to the trigger after close (value\n// selection, Escape, Tab). Set to true whenever open transitions true→false,\n// reset after a microtask once the focus-return event has been processed.\nconst skipNextFocus = ref(false)\n\n// flush:'sync' fires the moment open.value changes (synchronously, before any\n// Vue scheduling), so skipNextFocus is true before Reka's FocusScope can call\n// trigger.focus(). setTimeout defers the reset until after all pending\n// microtasks (render + focus-return) have flushed.\nwatch(() => rootContext.open.value, (open, wasOpen) => {\n if (!open && wasOpen) {\n skipNextFocus.value = true\n setTimeout(() => { skipNextFocus.value = false }, 0)\n }\n}, { flush: 'sync' })\n\nfunction handleFocus() {\n if (ctx.isDisabled.value || ctx.isReadonly.value || skipNextFocus.value || rootContext.open.value) return\n rootContext.onOpenChange(true)\n}\n</script>\n\n<template>\n <SelectTrigger\n :id=\"ctx.triggerId.value\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"isFilled || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n data-slot=\"trigger\"\n @focus=\"handleFocus\"\n >\n <label\n v-if=\"showInsideLabel\"\n :for=\"ctx.triggerId.value\"\n :class=\"ctx.slots.value.label()\"\n >{{ ctx.label.value }}<span\n v-if=\"ctx.isRequired.value\"\n aria-hidden=\"true\"\n > *</span></label>\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <slot />\n <SelectIcon\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"select-default-indicator\"\n >\n <slot name=\"selectorIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </SelectIcon>\n </SelectTrigger>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAWA,MAAM,MAAM,iBAAgB;EAC5B,MAAM,cAAc,yBAAwB;EAE5C,MAAM,WAAW,eAAe;GAC9B,MAAM,IAAI,aAAa,YAAY;AACnC,OAAI,KAAK,KAAM,QAAO;AACtB,OAAI,MAAM,QAAQ,EAAE,CAAE,QAAO,EAAE,SAAS;AACxC,UAAO,MAAM;IACd;EAED,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU,SAC3D;EAKA,MAAM,gBAAgB,IAAI,MAAK;AAM/B,cAAY,YAAY,KAAK,QAAQ,MAAM,YAAY;AACrD,OAAI,CAAC,QAAQ,SAAS;AACpB,kBAAc,QAAQ;AACtB,qBAAiB;AAAE,mBAAc,QAAQ;OAAS,EAAC;;KAEpD,EAAE,OAAO,QAAQ,CAAA;EAEpB,SAAS,cAAc;AACrB,OAAI,IAAI,WAAW,SAAS,IAAI,WAAW,SAAS,cAAc,SAAS,YAAY,KAAK,MAAO;AACnG,eAAY,aAAa,KAAI;;;uBAK7B,YAgDgB,MAAA,cAAA,EAAA;IA/Cb,IAAI,MAAA,IAAG,CAAC,UAAU;IAClB,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,SAAO,CAAA;IAC9B,eAAa,SAAA,SAAY,KAAA;IACzB,gBAAc,MAAA,IAAG,CAAC,UAAU,SAAS,KAAA;IACrC,iBAAe,MAAA,IAAG,CAAC,WAAW,SAAS,KAAA;IACvC,gBAAc,MAAA,IAAG,CAAC,UAAU,SAAS,KAAA;IACrC,oBAAkB,MAAA,IAAG,CAAC,gBAAgB;IACvC,aAAU;IACT,SAAO;;2BASU;KANV,gBAAA,SAAA,WAAA,EADR,mBAOkB,SAAA;;MALf,KAAK,MAAA,IAAG,CAAC,UAAU;MACnB,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,OAAK,CAAA;yCAC3B,MAAA,IAAG,CAAC,MAAM,MAAK,EAAA,EAAA,EACX,MAAA,IAAG,CAAC,WAAW,SAAA,WAAA,EADD,mBAGZ,QAHY,YAGrB,KAAE,IAAA,mBAAA,IAAA,KAAA,CAAA,EAAA,IAAA,WAAA,IAAA,mBAAA,IAAA,KAAA;KAEKA,KAAAA,OAAO,gBAAA,WAAA,EADf,mBAMO,QAAA;;MAJJ,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,cAAY,CAAA;MACpC,aAAU;SAEV,WAA4B,KAAA,QAAA,eAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KAE9B,WAAQ,KAAA,QAAA,UAAA;KACR,YAoBa,MAAA,WAAA,EAAA;MAnBV,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,WAAS,CAAA;MACjC,aAAU;;6BAiBH,CAfP,WAeO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAdL,mBAaM,OAAA;OAZJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA"}
|
|
@@ -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"}
|
|
@@ -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'\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}>(), {\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 <slot />\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 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,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useSwitchGroupProvide } from "./switch-group.context.js";
|
|
3
|
-
import
|
|
3
|
+
import Switch_default from "./Switch.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 { switchGroupVariants } from "@auronui/styles";
|
|
5
6
|
//#region src/components/switch/SwitchGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = ["aria-labelledby", "data-orientation"];
|
|
@@ -22,7 +23,8 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
22
23
|
orientation: { default: "vertical" },
|
|
23
24
|
label: { default: void 0 },
|
|
24
25
|
description: { default: void 0 },
|
|
25
|
-
class: {}
|
|
26
|
+
class: {},
|
|
27
|
+
items: {}
|
|
26
28
|
},
|
|
27
29
|
emits: ["update:modelValue"],
|
|
28
30
|
setup(__props, { emit: __emit }) {
|
|
@@ -56,7 +58,16 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
56
58
|
id: labelId,
|
|
57
59
|
class: "switch-group__label"
|
|
58
60
|
}, toDisplayString(props.label), 1)) : createCommentVNode("", true),
|
|
59
|
-
createElementVNode("div", { class: normalizeClass(groupSlots.value.items()) }, [
|
|
61
|
+
createElementVNode("div", { class: normalizeClass(groupSlots.value.items()) }, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
62
|
+
return openBlock(), createBlock(Switch_default, {
|
|
63
|
+
key: item.value,
|
|
64
|
+
value: item.value,
|
|
65
|
+
disabled: item.disabled
|
|
66
|
+
}, {
|
|
67
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
|
|
68
|
+
_: 2
|
|
69
|
+
}, 1032, ["value", "disabled"]);
|
|
70
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2),
|
|
60
71
|
props.description ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
61
72
|
], 10, _hoisted_1);
|
|
62
73
|
};
|
|
@@ -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'\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}>(), {\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 <slot />\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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,wBAAsB;GACpB,MAAM,MAAM,OAAO,OAAO;GAC1B,UAAU,MAAM,OAAO,WAAW;GAClC,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,mBA0BM,OAAA;IAzBJ,MAAK;IACJ,mBAAiB,MAAM,QAAQ,UAAU,KAAA;IACzC,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,eAAA,WAAA,EADd,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, watch } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst internalValue = ref<string | undefined>(props.modelValue ?? props.defaultValue)\n\nwatch(() => props.modelValue, (v) => {\n if (v !== undefined) internalValue.value = v\n})\n\nfunction changeTab(value: string) {\n internalValue.value = value\n emit('update:modelValue', value)\n}\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n currentValue: internalValue,\n changeTab,\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"internalValue\"\n :orientation=\"props.orientation\"\n :activation-mode=\"props.activationMode\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n @update:model-value=\"changeTab\"\n >\n <slot />\n </TabsRoot>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, watch } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\nimport TabList from './TabList.vue'\nimport Tab from './Tab.vue'\nimport TabPanel from './TabPanel.vue'\n\ntype TabShorthandItem = { value: string; label: string; content?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render tabs from an array instead of the compound slot API */\n items?: TabShorthandItem[]\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst internalValue = ref<string | undefined>(props.modelValue ?? props.defaultValue)\n\nwatch(() => props.modelValue, (v) => {\n if (v !== undefined) internalValue.value = v\n})\n\nwatch(\n () => props.items,\n (items) => {\n if (items && items.length > 0 && !props.modelValue && !props.defaultValue && internalValue.value === undefined) {\n internalValue.value = items[0].value\n }\n },\n { immediate: true },\n)\n\nfunction changeTab(value: string) {\n internalValue.value = value\n emit('update:modelValue', value)\n}\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n currentValue: internalValue,\n changeTab,\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"internalValue\"\n :orientation=\"props.orientation\"\n :activation-mode=\"props.activationMode\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n @update:model-value=\"changeTab\"\n >\n <template v-if=\"props.items\">\n <TabList>\n <Tab\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label }}</Tab>\n </TabList>\n <TabPanel\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n >{{ item.content }}</TabPanel>\n </template>\n <slot v-else />\n </TabsRoot>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useTabsProvide } from "./tabs.context.js";
|
|
3
|
-
import
|
|
3
|
+
import TabList_default from "./TabList.js";
|
|
4
|
+
import Tab_default from "./Tab.js";
|
|
5
|
+
import TabPanel_default from "./TabPanel.js";
|
|
6
|
+
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, watch, withCtx } from "vue";
|
|
4
7
|
import { tabsVariants } from "@auronui/styles";
|
|
5
8
|
import { TabsRoot } from "reka-ui";
|
|
6
9
|
//#region src/components/tabs/Tabs.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -19,7 +22,8 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
19
22
|
Object,
|
|
20
23
|
Array
|
|
21
24
|
] },
|
|
22
|
-
classNames: {}
|
|
25
|
+
classNames: {},
|
|
26
|
+
items: {}
|
|
23
27
|
},
|
|
24
28
|
emits: ["update:modelValue"],
|
|
25
29
|
setup(__props, { emit: __emit }) {
|
|
@@ -29,6 +33,9 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
29
33
|
watch(() => props.modelValue, (v) => {
|
|
30
34
|
if (v !== void 0) internalValue.value = v;
|
|
31
35
|
});
|
|
36
|
+
watch(() => props.items, (items) => {
|
|
37
|
+
if (items && items.length > 0 && !props.modelValue && !props.defaultValue && internalValue.value === void 0) internalValue.value = items[0].value;
|
|
38
|
+
}, { immediate: true });
|
|
32
39
|
function changeTab(value) {
|
|
33
40
|
internalValue.value = value;
|
|
34
41
|
emit("update:modelValue", value);
|
|
@@ -49,7 +56,27 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
49
56
|
"data-orientation": props.orientation,
|
|
50
57
|
"onUpdate:modelValue": changeTab
|
|
51
58
|
}, {
|
|
52
|
-
default: withCtx(() => [
|
|
59
|
+
default: withCtx(() => [props.items ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(TabList_default, null, {
|
|
60
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
61
|
+
return openBlock(), createBlock(Tab_default, {
|
|
62
|
+
key: item.value,
|
|
63
|
+
value: item.value,
|
|
64
|
+
disabled: item.disabled
|
|
65
|
+
}, {
|
|
66
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
67
|
+
_: 2
|
|
68
|
+
}, 1032, ["value", "disabled"]);
|
|
69
|
+
}), 128))]),
|
|
70
|
+
_: 1
|
|
71
|
+
}), (openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
72
|
+
return openBlock(), createBlock(TabPanel_default, {
|
|
73
|
+
key: item.value,
|
|
74
|
+
value: item.value
|
|
75
|
+
}, {
|
|
76
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.content), 1)]),
|
|
77
|
+
_: 2
|
|
78
|
+
}, 1032, ["value"]);
|
|
79
|
+
}), 128))], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
53
80
|
_: 3
|
|
54
81
|
}, 8, [
|
|
55
82
|
"model-value",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, watch } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst internalValue = ref<string | undefined>(props.modelValue ?? props.defaultValue)\n\nwatch(() => props.modelValue, (v) => {\n if (v !== undefined) internalValue.value = v\n})\n\nfunction changeTab(value: string) {\n internalValue.value = value\n emit('update:modelValue', value)\n}\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n currentValue: internalValue,\n changeTab,\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"internalValue\"\n :orientation=\"props.orientation\"\n :activation-mode=\"props.activationMode\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n @update:model-value=\"changeTab\"\n >\n <slot />\n </TabsRoot>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, watch } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\nimport TabList from './TabList.vue'\nimport Tab from './Tab.vue'\nimport TabPanel from './TabPanel.vue'\n\ntype TabShorthandItem = { value: string; label: string; content?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Shorthand API: render tabs from an array instead of the compound slot API */\n items?: TabShorthandItem[]\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst internalValue = ref<string | undefined>(props.modelValue ?? props.defaultValue)\n\nwatch(() => props.modelValue, (v) => {\n if (v !== undefined) internalValue.value = v\n})\n\nwatch(\n () => props.items,\n (items) => {\n if (items && items.length > 0 && !props.modelValue && !props.defaultValue && internalValue.value === undefined) {\n internalValue.value = items[0].value\n }\n },\n { immediate: true },\n)\n\nfunction changeTab(value: string) {\n internalValue.value = value\n emit('update:modelValue', value)\n}\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n currentValue: internalValue,\n changeTab,\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"internalValue\"\n :orientation=\"props.orientation\"\n :activation-mode=\"props.activationMode\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"props.orientation\"\n @update:model-value=\"changeTab\"\n >\n <template v-if=\"props.items\">\n <TabList>\n <Tab\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label }}</Tab>\n </TabList>\n <TabPanel\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n >{{ item.content }}</TabPanel>\n </template>\n <slot v-else />\n </TabsRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAmBd,MAAM,OAAO;EAIb,MAAM,gBAAgB,IAAwB,MAAM,cAAc,MAAM,aAAY;AAEpF,cAAY,MAAM,aAAa,MAAM;AACnC,OAAI,MAAM,KAAA,EAAW,eAAc,QAAQ;IAC5C;AAED,cACQ,MAAM,QACX,UAAU;AACT,OAAI,SAAS,MAAM,SAAS,KAAK,CAAC,MAAM,cAAc,CAAC,MAAM,gBAAgB,cAAc,UAAU,KAAA,EACnG,eAAc,QAAQ,MAAM,GAAG;KAGnC,EAAE,WAAW,MAAM,CACrB;EAEA,SAAS,UAAU,OAAe;AAChC,iBAAc,QAAQ;AACtB,QAAK,qBAAqB,MAAK;;EAGjC,MAAM,UAAU,eAAe,aAAa,EAAE,SAAS,MAAM,SAAS,CAAC,CAAA;AAEvE,iBAAe;GACb;GACA,aAAa,MAAM,OAAO,cAAc;GACxC,cAAc;GACd;GACD,CAAA;;uBAIC,YAwBW,MAAA,SAAA,EAAA;IAvBR,eAAa,cAAA;IACb,aAAa,MAAM;IACnB,mBAAiB,MAAM;IACvB,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,OAAO,MAAM,YAAY,KAAI,CAAA;IAC3E,oBAAkB,MAAM;IACxB,uBAAoB;;2BAgBV,CAdK,MAAM,SAAA,WAAA,EAAtB,mBAcW,UAAA,EAAA,KAAA,GAAA,EAAA,CAbT,YAOU,iBAAA,MAAA;4BALqB,EAAA,UAAA,KAAA,EAD7B,mBAKuB,UAAA,MAAA,WAJN,MAAM,QAAd,SAAI;0BADb,YAKuB,aAAA;OAHpB,KAAK,KAAK;OACV,OAAO,KAAK;OACZ,UAAU,KAAK;;8BACD,CAAA,gBAAA,gBAAb,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;0BAEhB,mBAI8B,UAAA,MAAA,WAHb,MAAM,QAAd,SAAI;yBADb,YAI8B,kBAAA;MAF3B,KAAK,KAAK;MACV,OAAO,KAAK;;6BACI,CAAA,gBAAA,gBAAf,KAAK,QAAO,EAAA,EAAA,CAAA,CAAA;;;uBAElB,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarToggleGroup.js","names":[],"sources":["../../../src/components/toolbar/ToolbarToggleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { ToolbarToggleGroup as RekaToolbarToggleGroup } from 'reka-ui'\nimport { toggleButtonGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useToolbarInject } from './toolbar.context'\n\ntype Single = string\ntype Multi = string[]\n\nconst props = defineProps<{\n type: 'single' | 'multiple'\n modelValue?: Single | Multi\n defaultValue?: Single | Multi\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n class?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Single | Multi]\n}>()\n\nconst ctx = useToolbarInject({ orientation: computed(() => 'horizontal' as const) })\nconst orientation = computed(() => props.orientation ?? ctx.orientation.value)\n\nconst classes = computed(() =>\n toggleButtonGroupVariants({ orientation: orientation.value, isDetached: props.isDetached ?? false }).base()\n)\n</script>\n\n<template>\n <RekaToolbarToggleGroup\n :type=\"props.type\"\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :class=\"composeClassName(classes, props.class)\"\n @update:model-value=\"(v) => emit('update:modelValue', v as Single | Multi)\"\n >\n <slot />\n </RekaToolbarToggleGroup>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ToolbarToggleGroup.js","names":[],"sources":["../../../src/components/toolbar/ToolbarToggleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { ToolbarToggleGroup as RekaToolbarToggleGroup } from 'reka-ui'\nimport { toggleButtonGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useToolbarInject } from './toolbar.context'\nimport ToolbarToggleItem from './ToolbarToggleItem.vue'\n\ntype Single = string\ntype Multi = string[]\ntype ToolbarToggleShorthandItem = { value: string; label?: string; variant?: string; size?: string; isIconOnly?: boolean; disabled?: boolean; class?: string }\n\nconst props = defineProps<{\n type: 'single' | 'multiple'\n modelValue?: Single | Multi\n defaultValue?: Single | Multi\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n class?: string\n /** Shorthand API: render toggle items from an array instead of the compound slot API */\n items?: ToolbarToggleShorthandItem[]\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Single | Multi]\n}>()\n\nconst ctx = useToolbarInject({ orientation: computed(() => 'horizontal' as const) })\nconst orientation = computed(() => props.orientation ?? ctx.orientation.value)\n\nconst classes = computed(() =>\n toggleButtonGroupVariants({ orientation: orientation.value, isDetached: props.isDetached ?? false }).base()\n)\n</script>\n\n<template>\n <RekaToolbarToggleGroup\n :type=\"props.type\"\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :class=\"composeClassName(classes, props.class)\"\n @update:model-value=\"(v) => emit('update:modelValue', v as Single | Multi)\"\n >\n <template v-if=\"props.items\">\n <ToolbarToggleItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :variant=\"item.variant\"\n :size=\"item.size\"\n :is-icon-only=\"item.isIconOnly\"\n :disabled=\"item.disabled\"\n :class=\"item.class\"\n >{{ item.label }}</ToolbarToggleItem>\n </template>\n <slot v-else />\n </RekaToolbarToggleGroup>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useToolbarInject } from "./toolbar.context.js";
|
|
3
|
-
import
|
|
3
|
+
import ToolbarToggleItem_default from "./ToolbarToggleItem.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
4
5
|
import { toggleButtonGroupVariants } from "@auronui/styles";
|
|
5
6
|
import { ToolbarToggleGroup } from "reka-ui";
|
|
6
7
|
//#region src/components/toolbar/ToolbarToggleGroup.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -13,7 +14,8 @@ var ToolbarToggleGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
13
14
|
disabled: { type: Boolean },
|
|
14
15
|
orientation: {},
|
|
15
16
|
isDetached: { type: Boolean },
|
|
16
|
-
class: {}
|
|
17
|
+
class: {},
|
|
18
|
+
items: {}
|
|
17
19
|
},
|
|
18
20
|
emits: ["update:modelValue"],
|
|
19
21
|
setup(__props, { emit: __emit }) {
|
|
@@ -34,7 +36,27 @@ var ToolbarToggleGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
34
36
|
class: normalizeClass(unref(composeClassName)(classes.value, props.class)),
|
|
35
37
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => emit("update:modelValue", v))
|
|
36
38
|
}, {
|
|
37
|
-
default: withCtx(() => [
|
|
39
|
+
default: withCtx(() => [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
40
|
+
return openBlock(), createBlock(ToolbarToggleItem_default, {
|
|
41
|
+
key: item.value,
|
|
42
|
+
value: item.value,
|
|
43
|
+
variant: item.variant,
|
|
44
|
+
size: item.size,
|
|
45
|
+
"is-icon-only": item.isIconOnly,
|
|
46
|
+
disabled: item.disabled,
|
|
47
|
+
class: normalizeClass(item.class)
|
|
48
|
+
}, {
|
|
49
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
50
|
+
_: 2
|
|
51
|
+
}, 1032, [
|
|
52
|
+
"value",
|
|
53
|
+
"variant",
|
|
54
|
+
"size",
|
|
55
|
+
"is-icon-only",
|
|
56
|
+
"disabled",
|
|
57
|
+
"class"
|
|
58
|
+
]);
|
|
59
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
|
|
38
60
|
_: 3
|
|
39
61
|
}, 8, [
|
|
40
62
|
"type",
|
package/dist/components/toolbar/ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/toolbar/ToolbarToggleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { ToolbarToggleGroup as RekaToolbarToggleGroup } from 'reka-ui'\nimport { toggleButtonGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useToolbarInject } from './toolbar.context'\n\ntype Single = string\ntype Multi = string[]\n\nconst props = defineProps<{\n type: 'single' | 'multiple'\n modelValue?: Single | Multi\n defaultValue?: Single | Multi\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n class?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Single | Multi]\n}>()\n\nconst ctx = useToolbarInject({ orientation: computed(() => 'horizontal' as const) })\nconst orientation = computed(() => props.orientation ?? ctx.orientation.value)\n\nconst classes = computed(() =>\n toggleButtonGroupVariants({ orientation: orientation.value, isDetached: props.isDetached ?? false }).base()\n)\n</script>\n\n<template>\n <RekaToolbarToggleGroup\n :type=\"props.type\"\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :class=\"composeClassName(classes, props.class)\"\n @update:model-value=\"(v) => emit('update:modelValue', v as Single | Multi)\"\n >\n <slot />\n </RekaToolbarToggleGroup>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/toolbar/ToolbarToggleGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { ToolbarToggleGroup as RekaToolbarToggleGroup } from 'reka-ui'\nimport { toggleButtonGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useToolbarInject } from './toolbar.context'\nimport ToolbarToggleItem from './ToolbarToggleItem.vue'\n\ntype Single = string\ntype Multi = string[]\ntype ToolbarToggleShorthandItem = { value: string; label?: string; variant?: string; size?: string; isIconOnly?: boolean; disabled?: boolean; class?: string }\n\nconst props = defineProps<{\n type: 'single' | 'multiple'\n modelValue?: Single | Multi\n defaultValue?: Single | Multi\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n isDetached?: boolean\n class?: string\n /** Shorthand API: render toggle items from an array instead of the compound slot API */\n items?: ToolbarToggleShorthandItem[]\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Single | Multi]\n}>()\n\nconst ctx = useToolbarInject({ orientation: computed(() => 'horizontal' as const) })\nconst orientation = computed(() => props.orientation ?? ctx.orientation.value)\n\nconst classes = computed(() =>\n toggleButtonGroupVariants({ orientation: orientation.value, isDetached: props.isDetached ?? false }).base()\n)\n</script>\n\n<template>\n <RekaToolbarToggleGroup\n :type=\"props.type\"\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :class=\"composeClassName(classes, props.class)\"\n @update:model-value=\"(v) => emit('update:modelValue', v as Single | Multi)\"\n >\n <template v-if=\"props.items\">\n <ToolbarToggleItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :variant=\"item.variant\"\n :size=\"item.size\"\n :is-icon-only=\"item.isIconOnly\"\n :disabled=\"item.disabled\"\n :class=\"item.class\"\n >{{ item.label }}</ToolbarToggleItem>\n </template>\n <slot v-else />\n </RekaToolbarToggleGroup>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAYd,MAAM,OAAO;EAIb,MAAM,MAAM,iBAAiB,EAAE,aAAa,eAAe,aAAsB,EAAE,CAAA;EACnF,MAAM,cAAc,eAAe,MAAM,eAAe,IAAI,YAAY,MAAK;EAE7E,MAAM,UAAU,eACd,0BAA0B;GAAE,aAAa,YAAY;GAAO,YAAY,MAAM,cAAc;GAAO,CAAC,CAAC,MAAK,CAC5G;;uBAIE,YAqByB,MAAA,mBAAA,EAAA;IApBtB,MAAM,MAAM;IACZ,eAAa,MAAM;IACnB,iBAAe,MAAM;IACrB,UAAU,MAAM;IAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,OAAS,MAAM,MAAK,CAAA;IAC5C,uBAAkB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAC;;2BAa5C,CAXK,MAAM,SAAA,UAAA,KAAA,EACpB,mBASqC,UAAA,EAAA,KAAA,GAAA,EAAA,WARpB,MAAM,QAAd,SAAI;yBADb,YASqC,2BAAA;MAPlC,KAAK,KAAK;MACV,OAAO,KAAK;MACZ,SAAS,KAAK;MACd,MAAM,KAAK;MACX,gBAAc,KAAK;MACnB,UAAU,KAAK;MACf,OAAK,eAAE,KAAK,MAAK;;6BACH,CAAA,gBAAA,gBAAb,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;;;;;gBAEhB,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
|