@hebium-ui/vue 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +7 -2
- package/dist/_virtual/_/plugin-vue/export-helper.js +8 -0
- package/dist/components/alert/alert.js +108 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/alert.types.d.ts +31 -0
- package/dist/components/alert/alert.vue.d.ts +28 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/anchor/anchor.js +106 -0
- package/dist/components/anchor/anchor.js.map +1 -0
- package/dist/components/anchor/anchor.types.d.ts +31 -0
- package/dist/components/anchor/anchor.vue.d.ts +30 -0
- package/dist/components/anchor/index.d.ts +3 -0
- package/dist/components/avatar/avatar.js +111 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.types.d.ts +17 -0
- package/dist/components/avatar/avatar.vue.d.ts +17 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/blockquote/blockquote.js +82 -0
- package/dist/components/blockquote/blockquote.js.map +1 -0
- package/dist/components/blockquote/blockquote.types.d.ts +25 -0
- package/dist/components/blockquote/blockquote.vue.d.ts +27 -0
- package/dist/components/blockquote/index.d.ts +3 -0
- package/dist/components/button/button.js +106 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.types.d.ts +31 -0
- package/dist/components/button/button.vue.d.ts +30 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/checkbox/checkbox.js +124 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.types.d.ts +27 -0
- package/dist/components/checkbox/checkbox.vue.d.ts +29 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/code/code.js +84 -0
- package/dist/components/code/code.js.map +1 -0
- package/dist/components/code/code.types.d.ts +12 -0
- package/dist/components/code/code.vue.d.ts +30 -0
- package/dist/components/code/index.d.ts +3 -0
- package/dist/components/details/details.js +76 -0
- package/dist/components/details/details.js.map +1 -0
- package/dist/components/details/details.types.d.ts +19 -0
- package/dist/components/details/details.vue.d.ts +27 -0
- package/dist/components/details/index.d.ts +3 -0
- package/dist/components/dialog/dialog-close.js +100 -0
- package/dist/components/dialog/dialog-close.js.map +1 -0
- package/dist/components/dialog/dialog-close.vue.d.ts +27 -0
- package/dist/components/dialog/dialog-content.js +180 -0
- package/dist/components/dialog/dialog-content.js.map +1 -0
- package/dist/components/dialog/dialog-content.vue.d.ts +30 -0
- package/dist/components/dialog/dialog-trigger.js +105 -0
- package/dist/components/dialog/dialog-trigger.js.map +1 -0
- package/dist/components/dialog/dialog-trigger.vue.d.ts +31 -0
- package/dist/components/dialog/dialog.context.d.ts +5 -0
- package/dist/components/dialog/dialog.context.js +15 -0
- package/dist/components/dialog/dialog.context.js.map +1 -0
- package/dist/components/dialog/dialog.js +62 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/dialog.types.d.ts +73 -0
- package/dist/components/dialog/dialog.vue.d.ts +18 -0
- package/dist/components/dialog/index.d.ts +7 -0
- package/dist/components/dl/dl-dd.js +71 -0
- package/dist/components/dl/dl-dd.js.map +1 -0
- package/dist/components/dl/dl-dd.vue.d.ts +24 -0
- package/dist/components/dl/dl-dt.js +71 -0
- package/dist/components/dl/dl-dt.js.map +1 -0
- package/dist/components/dl/dl-dt.vue.d.ts +24 -0
- package/dist/components/dl/dl.js +71 -0
- package/dist/components/dl/dl.js.map +1 -0
- package/dist/components/dl/dl.types.d.ts +19 -0
- package/dist/components/dl/dl.vue.d.ts +24 -0
- package/dist/components/dl/index.d.ts +5 -0
- package/dist/components/drawer/drawer-close.js +100 -0
- package/dist/components/drawer/drawer-close.js.map +1 -0
- package/dist/components/drawer/drawer-close.vue.d.ts +27 -0
- package/dist/components/drawer/drawer-content.js +185 -0
- package/dist/components/drawer/drawer-content.js.map +1 -0
- package/dist/components/drawer/drawer-content.vue.d.ts +30 -0
- package/dist/components/drawer/drawer-trigger.js +96 -0
- package/dist/components/drawer/drawer-trigger.js.map +1 -0
- package/dist/components/drawer/drawer-trigger.vue.d.ts +31 -0
- package/dist/components/drawer/drawer.context.d.ts +5 -0
- package/dist/components/drawer/drawer.context.js +15 -0
- package/dist/components/drawer/drawer.context.js.map +1 -0
- package/dist/components/drawer/drawer.js +43 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/drawer.types.d.ts +73 -0
- package/dist/components/drawer/drawer.vue.d.ts +16 -0
- package/dist/components/drawer/index.d.ts +7 -0
- package/dist/components/fieldset/fieldset.js +71 -0
- package/dist/components/fieldset/fieldset.js.map +1 -0
- package/dist/components/fieldset/fieldset.types.d.ts +11 -0
- package/dist/components/fieldset/fieldset.vue.d.ts +24 -0
- package/dist/components/fieldset/index.d.ts +3 -0
- package/dist/components/heading/heading.js +95 -0
- package/dist/components/heading/heading.js.map +1 -0
- package/dist/components/heading/heading.types.d.ts +25 -0
- package/dist/components/heading/heading.vue.d.ts +25 -0
- package/dist/components/heading/index.d.ts +3 -0
- package/dist/components/hr/hr.js +81 -0
- package/dist/components/hr/hr.js.map +1 -0
- package/dist/components/hr/hr.types.d.ts +12 -0
- package/dist/components/hr/hr.vue.d.ts +28 -0
- package/dist/components/hr/index.d.ts +3 -0
- package/dist/components/index.d.ts +122 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/input.js +136 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/input.types.d.ts +27 -0
- package/dist/components/input/input.vue.d.ts +28 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/label.js +142 -0
- package/dist/components/label/label.js.map +1 -0
- package/dist/components/label/label.types.d.ts +26 -0
- package/dist/components/label/label.vue.d.ts +33 -0
- package/dist/components/menu/index.d.ts +7 -0
- package/dist/components/menu/menu-content.js +128 -0
- package/dist/components/menu/menu-content.js.map +1 -0
- package/dist/components/menu/menu-content.vue.d.ts +30 -0
- package/dist/components/menu/menu-item.js +165 -0
- package/dist/components/menu/menu-item.js.map +1 -0
- package/dist/components/menu/menu-item.vue.d.ts +30 -0
- package/dist/components/menu/menu-trigger.js +103 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/menu-trigger.vue.d.ts +31 -0
- package/dist/components/menu/menu.context.d.ts +5 -0
- package/dist/components/menu/menu.context.js +15 -0
- package/dist/components/menu/menu.context.js.map +1 -0
- package/dist/components/menu/menu.js +43 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.types.d.ts +80 -0
- package/dist/components/menu/menu.vue.d.ts +16 -0
- package/dist/components/paragraph/index.d.ts +3 -0
- package/dist/components/paragraph/paragraph.js +89 -0
- package/dist/components/paragraph/paragraph.js.map +1 -0
- package/dist/components/paragraph/paragraph.types.d.ts +19 -0
- package/dist/components/paragraph/paragraph.vue.d.ts +30 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/popover/popover-content.js +120 -0
- package/dist/components/popover/popover-content.js.map +1 -0
- package/dist/components/popover/popover-content.vue.d.ts +30 -0
- package/dist/components/popover/popover-trigger.js +91 -0
- package/dist/components/popover/popover-trigger.js.map +1 -0
- package/dist/components/popover/popover-trigger.vue.d.ts +31 -0
- package/dist/components/popover/popover.context.d.ts +5 -0
- package/dist/components/popover/popover.context.js +15 -0
- package/dist/components/popover/popover.context.js.map +1 -0
- package/dist/components/popover/popover.js +43 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/popover.types.d.ts +50 -0
- package/dist/components/popover/popover.vue.d.ts +16 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/progress.js +149 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/progress/progress.types.d.ts +53 -0
- package/dist/components/progress/progress.vue.d.ts +26 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/radio.js +112 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio/radio.types.d.ts +21 -0
- package/dist/components/radio/radio.vue.d.ts +27 -0
- package/dist/components/radiogroup/index.d.ts +3 -0
- package/dist/components/radiogroup/radiogroup.js +130 -0
- package/dist/components/radiogroup/radiogroup.js.map +1 -0
- package/dist/components/radiogroup/radiogroup.types.d.ts +25 -0
- package/dist/components/radiogroup/radiogroup.vue.d.ts +34 -0
- package/dist/components/section/index.d.ts +3 -0
- package/dist/components/section/section.js +112 -0
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/section/section.types.d.ts +37 -0
- package/dist/components/section/section.vue.d.ts +30 -0
- package/dist/components/segmented-control/index.d.ts +4 -0
- package/dist/components/segmented-control/segmented-control-item.js +110 -0
- package/dist/components/segmented-control/segmented-control-item.js.map +1 -0
- package/dist/components/segmented-control/segmented-control-item.vue.d.ts +30 -0
- package/dist/components/segmented-control/segmented-control.context.js +12 -0
- package/dist/components/segmented-control/segmented-control.context.js.map +1 -0
- package/dist/components/segmented-control/segmented-control.js +112 -0
- package/dist/components/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/segmented-control/segmented-control.types.d.ts +42 -0
- package/dist/components/segmented-control/segmented-control.vue.d.ts +26 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/select.js +124 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.types.d.ts +21 -0
- package/dist/components/select/select.vue.d.ts +29 -0
- package/dist/components/table/index.d.ts +10 -0
- package/dist/components/table/table-caption.js +79 -0
- package/dist/components/table/table-caption.js.map +1 -0
- package/dist/components/table/table-caption.vue.d.ts +25 -0
- package/dist/components/table/table-tbody.js +70 -0
- package/dist/components/table/table-tbody.js.map +1 -0
- package/dist/components/table/table-tbody.vue.d.ts +24 -0
- package/dist/components/table/table-td.js +71 -0
- package/dist/components/table/table-td.js.map +1 -0
- package/dist/components/table/table-td.vue.d.ts +24 -0
- package/dist/components/table/table-tfoot.js +70 -0
- package/dist/components/table/table-tfoot.js.map +1 -0
- package/dist/components/table/table-tfoot.vue.d.ts +24 -0
- package/dist/components/table/table-th.js +71 -0
- package/dist/components/table/table-th.js.map +1 -0
- package/dist/components/table/table-th.vue.d.ts +24 -0
- package/dist/components/table/table-thead.js +70 -0
- package/dist/components/table/table-thead.js.map +1 -0
- package/dist/components/table/table-thead.vue.d.ts +24 -0
- package/dist/components/table/table-tr.js +79 -0
- package/dist/components/table/table-tr.js.map +1 -0
- package/dist/components/table/table-tr.vue.d.ts +25 -0
- package/dist/components/table/table.js +79 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/table/table.types.d.ts +59 -0
- package/dist/components/table/table.vue.d.ts +25 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/tabs-list.js +98 -0
- package/dist/components/tabs/tabs-list.js.map +1 -0
- package/dist/components/tabs/tabs-list.vue.d.ts +29 -0
- package/dist/components/tabs/tabs-panel.js +100 -0
- package/dist/components/tabs/tabs-panel.js.map +1 -0
- package/dist/components/tabs/tabs-panel.vue.d.ts +30 -0
- package/dist/components/tabs/tabs-tab.js +135 -0
- package/dist/components/tabs/tabs-tab.js.map +1 -0
- package/dist/components/tabs/tabs-tab.vue.d.ts +30 -0
- package/dist/components/tabs/tabs.context.js +12 -0
- package/dist/components/tabs/tabs.context.js.map +1 -0
- package/dist/components/tabs/tabs.js +144 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/tabs.types.d.ts +61 -0
- package/dist/components/tabs/tabs.vue.d.ts +30 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/textarea.js +137 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/textarea.types.d.ts +27 -0
- package/dist/components/textarea/textarea.vue.d.ts +28 -0
- package/dist/components/tooltip/index.d.ts +6 -0
- package/dist/components/tooltip/tooltip-content.js +128 -0
- package/dist/components/tooltip/tooltip-content.js.map +1 -0
- package/dist/components/tooltip/tooltip-content.vue.d.ts +30 -0
- package/dist/components/tooltip/tooltip-trigger.js +125 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.vue.d.ts +31 -0
- package/dist/components/tooltip/tooltip.context.d.ts +5 -0
- package/dist/components/tooltip/tooltip.context.js +15 -0
- package/dist/components/tooltip/tooltip.context.js.map +1 -0
- package/dist/components/tooltip/tooltip.js +43 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip.types.d.ts +50 -0
- package/dist/components/tooltip/tooltip.vue.d.ts +16 -0
- package/dist/components/visually-hidden/index.d.ts +3 -0
- package/dist/components/visually-hidden/visually-hidden.js +84 -0
- package/dist/components/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/components/visually-hidden/visually-hidden.types.d.ts +12 -0
- package/dist/components/visually-hidden/visually-hidden.vue.d.ts +30 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +64 -0
- package/dist/plugin.d.ts +126 -0
- package/dist/plugin.js +124 -0
- package/dist/plugin.js.map +1 -0
- package/dist/provider/hui-provider.context.d.ts +108 -0
- package/dist/provider/hui-provider.context.js +79 -0
- package/dist/provider/hui-provider.context.js.map +1 -0
- package/dist/provider/hui-provider.js +37 -0
- package/dist/provider/hui-provider.js.map +1 -0
- package/dist/provider/hui-provider.vue.d.ts +27 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/types/element.d.ts +12 -0
- package/dist/types/hui-component.d.ts +13 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/polymorphic.d.ts +19 -0
- package/dist/utils/attr-to-bool.js +8 -0
- package/dist/utils/attr-to-bool.js.map +1 -0
- package/package.json +59 -3
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { attrToBool } from "../../utils/attr-to-bool.js";
|
|
4
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, useAttrs, useId, useSlots, useTemplateRef } from "vue";
|
|
5
|
+
import { radioControl, radioRecipe, toStrbool } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/radio/radio.vue
|
|
7
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
|
+
name: "HuiRadio",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
__name: "radio",
|
|
11
|
+
props: {
|
|
12
|
+
color: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
classes: {
|
|
17
|
+
type: null,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
styles: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(__props, { expose: __expose }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const slots = useSlots();
|
|
28
|
+
const attrs = useAttrs();
|
|
29
|
+
const resolvedProps = useHuiProps("Radio", props, attrs);
|
|
30
|
+
const hasError = computed(() => Boolean(slots.error));
|
|
31
|
+
const generatedId = useId();
|
|
32
|
+
const radioState = computed(() => ({
|
|
33
|
+
id: resolvedProps.value.id ?? generatedId,
|
|
34
|
+
invalid: hasError.value,
|
|
35
|
+
disabled: attrToBool(resolvedProps.value.disabled) || attrToBool(resolvedProps.value["aria-disabled"])
|
|
36
|
+
}));
|
|
37
|
+
const recipe = computed(() => {
|
|
38
|
+
const resolved = resolvedProps.value;
|
|
39
|
+
return radioRecipe({
|
|
40
|
+
color: resolved.color,
|
|
41
|
+
error: toStrbool(radioState.value.invalid)
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const cls = useHuiClasses("Radio", recipe, computed(() => props.classes ?? {}));
|
|
45
|
+
const sls = useHuiStyles("Radio", computed(() => props.styles ?? {}));
|
|
46
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
47
|
+
"id",
|
|
48
|
+
"color",
|
|
49
|
+
"classes",
|
|
50
|
+
"styles",
|
|
51
|
+
"class",
|
|
52
|
+
"style"
|
|
53
|
+
]);
|
|
54
|
+
const inputAttrs = computed(() => ({
|
|
55
|
+
...radioControl.getControlAttributes(radioState.value),
|
|
56
|
+
...forwardedAttrs.value
|
|
57
|
+
}));
|
|
58
|
+
const labelAttrs = computed(() => radioControl.getLabelAttributes(radioState.value));
|
|
59
|
+
const errorAttrs = computed(() => radioControl.getErrorAttributes(radioState.value));
|
|
60
|
+
const inputRef = useTemplateRef("input");
|
|
61
|
+
__expose({ input: inputRef });
|
|
62
|
+
const __returned__ = {
|
|
63
|
+
props,
|
|
64
|
+
slots,
|
|
65
|
+
attrs,
|
|
66
|
+
resolvedProps,
|
|
67
|
+
hasError,
|
|
68
|
+
generatedId,
|
|
69
|
+
radioState,
|
|
70
|
+
recipe,
|
|
71
|
+
cls,
|
|
72
|
+
sls,
|
|
73
|
+
forwardedAttrs,
|
|
74
|
+
inputAttrs,
|
|
75
|
+
labelAttrs,
|
|
76
|
+
errorAttrs,
|
|
77
|
+
inputRef
|
|
78
|
+
};
|
|
79
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
80
|
+
enumerable: false,
|
|
81
|
+
value: true
|
|
82
|
+
});
|
|
83
|
+
return __returned__;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
87
|
+
return openBlock(), createElementBlock("div", {
|
|
88
|
+
class: normalizeClass($setup.cls.root),
|
|
89
|
+
style: normalizeStyle($setup.sls.root)
|
|
90
|
+
}, [createElementVNode("input", mergeProps({ ref: "input" }, $setup.inputAttrs, {
|
|
91
|
+
class: $setup.cls.radio,
|
|
92
|
+
style: $setup.sls.radio
|
|
93
|
+
}), null, 16), createElementVNode("div", null, [$setup.slots.label ? (openBlock(), createElementBlock("label", mergeProps({ key: 0 }, $setup.labelAttrs, {
|
|
94
|
+
class: $setup.cls.label,
|
|
95
|
+
style: $setup.sls.label
|
|
96
|
+
}), [renderSlot(_ctx.$slots, "label")], 16)) : createCommentVNode("v-if", true), $setup.slots.error ? (openBlock(), createElementBlock("p", mergeProps({ key: 1 }, $setup.errorAttrs, {
|
|
97
|
+
class: $setup.cls.error,
|
|
98
|
+
style: $setup.sls.error
|
|
99
|
+
}), [createElementVNode("span", {
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
class: normalizeClass($setup.cls.errorIcon),
|
|
102
|
+
style: normalizeStyle($setup.sls.errorIcon)
|
|
103
|
+
}, null, 6), createElementVNode("span", {
|
|
104
|
+
class: normalizeClass($setup.cls.errorMessage),
|
|
105
|
+
style: normalizeStyle($setup.sls.errorMessage)
|
|
106
|
+
}, [renderSlot(_ctx.$slots, "error")], 6)], 16)) : createCommentVNode("v-if", true)])], 6);
|
|
107
|
+
}
|
|
108
|
+
var radio_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/radio/radio.vue"]]);
|
|
109
|
+
//#endregion
|
|
110
|
+
export { radio_default as default };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_mergeProps","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/radio/radio.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n radioControl,\n radioRecipe,\n type RadioSlots as RadioRecipeSlots,\n toStrbool,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useId,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport { attrToBool } from \"~/utils\";\nimport type { RadioOwnProps } from \"./radio.types\";\n\ndefineOptions({\n name: \"HuiRadio\",\n inheritAttrs: false,\n});\n\ntype Props =\n & RadioOwnProps\n & {\n classes?:\n | Partial<Record<RadioRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<RadioRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"input\">,\n keyof RadioOwnProps | \"children\" | \"type\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n label?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Radio\", props, attrs);\nconst hasError = computed(() => Boolean(slots.error));\nconst generatedId = useId();\nconst radioState = computed(() => ({\n id: resolvedProps.value.id ?? generatedId,\n invalid: hasError.value,\n disabled: attrToBool(resolvedProps.value.disabled)\n || attrToBool(resolvedProps.value[\"aria-disabled\"]),\n}));\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n return radioRecipe({\n color: resolved.color,\n error: toStrbool(radioState.value.invalid),\n });\n});\nconst cls = useHuiClasses(\n \"Radio\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Radio\", RadioRecipeSlots>(\n \"Radio\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"id\",\n \"color\",\n \"classes\",\n \"styles\",\n \"class\",\n \"style\",\n]);\nconst inputAttrs = computed<Record<string, unknown>>(() => ({\n ...radioControl.getControlAttributes(radioState.value),\n ...forwardedAttrs.value,\n}));\nconst labelAttrs = computed(() =>\n radioControl.getLabelAttributes(radioState.value)\n);\nconst errorAttrs = computed(() =>\n radioControl.getErrorAttributes(radioState.value)\n);\nconst inputRef = useTemplateRef<HuiElementInstance<\"input\">>(\"input\");\n\ndefineExpose({\n input: inputRef,\n});\n</script>\n\n<template>\n <div :class=\"cls.root\" :style=\"sls.root\">\n <input\n ref=\"input\"\n v-bind=\"inputAttrs\"\n :class=\"cls.radio\"\n :style=\"sls.radio\"\n />\n <div>\n <label\n v-if=\"slots.label\"\n v-bind=\"labelAttrs\"\n :class=\"cls.label\"\n :style=\"sls.label\"\n >\n <slot name=\"label\" />\n </label>\n <p\n v-if=\"slots.error\"\n v-bind=\"errorAttrs\"\n :class=\"cls.error\"\n :style=\"sls.error\"\n >\n <span\n aria-hidden=\"true\"\n :class=\"cls.errorIcon\"\n :style=\"sls.errorIcon\"\n />\n <span :class=\"cls.errorMessage\" :style=\"sls.errorMessage\">\n <slot name=\"error\" />\n </span>\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAKd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,SAAS,OAAO,KAAK;EACvD,MAAM,WAAW,eAAe,QAAQ,MAAM,KAAK,CAAC;EACpD,MAAM,cAAc,MAAM;EAC1B,MAAM,aAAa,gBAAgB;GACjC,IAAI,cAAc,MAAM,MAAM;GAC9B,SAAS,SAAS;GAClB,UAAU,WAAW,cAAc,MAAM,QAAQ,KAC5C,WAAW,cAAc,MAAM,gBAAgB;EACtD,EAAE;EACF,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAC/B,OAAO,YAAY;IACjB,OAAO,SAAS;IAChB,OAAO,UAAU,WAAW,MAAM,OAAO;GAC3C,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,SACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,SACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,aAAa,gBAAyC;GAC1D,GAAG,aAAa,qBAAqB,WAAW,KAAK;GACrD,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,eACjB,aAAa,mBAAmB,WAAW,KAAK,CAClD;EACA,MAAM,aAAa,eACjB,aAAa,mBAAmB,WAAW,KAAK,CAClD;EACA,MAAM,WAAW,eAA4C,OAAO;EAEpE,SAAa,EACX,OAAO,SACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,UAAA,GAAAC,mBAgCM,OAAA;EAhCA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;CACrC,GAAA,CAAAC,mBAKE,SALFC,WAKE,EAJA,KAAI,QAAO,GACH,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEd,CAAA,GAAA,MAAA,EAAA,GAAAD,mBAwBM,OAAA,MAAA,CAtBI,OAAA,MAAM,SADdJ,UAAA,GAAAC,mBAOQ,SAPRI,WAOQ,EAAA,KAAA,EAAA,GALE,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,WAAqB,KAAA,QAAA,OAAA,CAAA,GAAA,EAGf,KAAAC,mBAAA,QAAA,IAAA,GAAA,OAAA,MAAM,SADdP,UAAA,GAAAC,mBAcI,KAdJI,WAcI,EAAA,KAAA,EAAA,GAZM,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAD,mBAIE,QAAA;EAHA,eAAY;EACX,OAAKF,eAAE,OAAA,IAAI,SAAS;EACpB,OAAKC,eAAE,OAAA,IAAI,SAAS;CAEvB,GAAA,MAAA,CAAA,GAAAC,mBAEO,QAAA;EAFA,OAAKF,eAAE,OAAA,IAAI,YAAY;EAAG,OAAKC,eAAE,OAAA,IAAI,YAAY;CACtD,GAAA,CAAAG,WAAqB,KAAA,QAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,QAAA,IAAA,CAAA,CAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { RadioSlots, RadioVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/radio/radio.types.d.ts
|
|
6
|
+
type HtmlInputProps = Omit<HuiElementProps<"input">, "children" | "color" | "type">;
|
|
7
|
+
export interface RadioOwnProps {
|
|
8
|
+
/**
|
|
9
|
+
* The semantic color of the radio control.
|
|
10
|
+
*
|
|
11
|
+
* @default "accent"
|
|
12
|
+
*/
|
|
13
|
+
color?: RadioVariants["color"] | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type RadioProps = HuiComponentProps<HtmlInputProps & RadioOwnProps, RadioSlots>;
|
|
16
|
+
export interface RadioExposed {
|
|
17
|
+
readonly input: HuiElementInstance<"input"> | null;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=radio.types.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { RadioOwnProps } from "./radio.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { RadioSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/radio/radio.vue.d.ts
|
|
7
|
+
type Props = RadioOwnProps & {
|
|
8
|
+
classes?: Partial<Record<RadioSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<RadioSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"input">, keyof RadioOwnProps | "children" | "type" | "class" | "style">;
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
label?: () => unknown;
|
|
13
|
+
error?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
16
|
+
input: Readonly<import("vue").ShallowRef<HTMLInputElement | null>>;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { _default as default };
|
|
27
|
+
//# sourceMappingURL=radio.vue.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { attrToBool } from "../../utils/attr-to-bool.js";
|
|
4
|
+
import label_default from "../label/label.js";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createSlots, defineComponent, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useId, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
|
+
import { radiogroupControl, radiogroupRecipe } from "@hebium-ui/core";
|
|
7
|
+
//#region src/components/radiogroup/radiogroup.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "HuiRadiogroup",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "radiogroup",
|
|
12
|
+
props: {
|
|
13
|
+
direction: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
labelProps: {
|
|
18
|
+
type: null,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
as: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
classes: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
styles: {
|
|
30
|
+
type: null,
|
|
31
|
+
required: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setup(__props, { expose: __expose }) {
|
|
35
|
+
const props = __props;
|
|
36
|
+
const slots = useSlots();
|
|
37
|
+
const attrs = useAttrs();
|
|
38
|
+
const resolvedProps = useHuiProps("Radiogroup", props, attrs);
|
|
39
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "div"));
|
|
40
|
+
const labelId = useId();
|
|
41
|
+
const hasLabel = computed(() => Boolean(slots.label || slots.description || slots.error));
|
|
42
|
+
const radiogroupState = computed(() => ({
|
|
43
|
+
labelId,
|
|
44
|
+
hasLabel: hasLabel.value,
|
|
45
|
+
invalid: Boolean(slots.error),
|
|
46
|
+
required: attrToBool(resolvedProps.value["aria-required"])
|
|
47
|
+
}));
|
|
48
|
+
const recipe = computed(() => radiogroupRecipe({ direction: resolvedProps.value.direction }));
|
|
49
|
+
const cls = useHuiClasses("Radiogroup", recipe, computed(() => props.classes ?? {}));
|
|
50
|
+
const sls = useHuiStyles("Radiogroup", computed(() => props.styles ?? {}));
|
|
51
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
52
|
+
"as",
|
|
53
|
+
"direction",
|
|
54
|
+
"labelProps",
|
|
55
|
+
"classes",
|
|
56
|
+
"styles",
|
|
57
|
+
"class",
|
|
58
|
+
"style"
|
|
59
|
+
]);
|
|
60
|
+
const rootAttrs = computed(() => ({
|
|
61
|
+
...radiogroupControl.getRootAttributes(radiogroupState.value),
|
|
62
|
+
...forwardedAttrs.value
|
|
63
|
+
}));
|
|
64
|
+
const labelAttrs = computed(() => ({
|
|
65
|
+
as: "div",
|
|
66
|
+
...radiogroupControl.getLabelAttributes(radiogroupState.value),
|
|
67
|
+
...resolvedProps.value.labelProps
|
|
68
|
+
}));
|
|
69
|
+
const rootRef = useTemplateRef("root");
|
|
70
|
+
__expose({ root: rootRef });
|
|
71
|
+
const __returned__ = {
|
|
72
|
+
props,
|
|
73
|
+
slots,
|
|
74
|
+
attrs,
|
|
75
|
+
resolvedProps,
|
|
76
|
+
component,
|
|
77
|
+
labelId,
|
|
78
|
+
hasLabel,
|
|
79
|
+
radiogroupState,
|
|
80
|
+
recipe,
|
|
81
|
+
cls,
|
|
82
|
+
sls,
|
|
83
|
+
forwardedAttrs,
|
|
84
|
+
rootAttrs,
|
|
85
|
+
labelAttrs,
|
|
86
|
+
rootRef,
|
|
87
|
+
get Label() {
|
|
88
|
+
return label_default;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
92
|
+
enumerable: false,
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
95
|
+
return __returned__;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
99
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
100
|
+
class: $setup.cls.root,
|
|
101
|
+
style: $setup.sls.root
|
|
102
|
+
}), {
|
|
103
|
+
default: withCtx(() => [$setup.hasLabel ? (openBlock(), createBlock($setup["Label"], normalizeProps(mergeProps({ key: 0 }, $setup.labelAttrs)), createSlots({ _: 2 }, [
|
|
104
|
+
$setup.slots.label ? {
|
|
105
|
+
name: "default",
|
|
106
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "label")]),
|
|
107
|
+
key: "0"
|
|
108
|
+
} : void 0,
|
|
109
|
+
$setup.slots.description ? {
|
|
110
|
+
name: "description",
|
|
111
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "description")]),
|
|
112
|
+
key: "1"
|
|
113
|
+
} : void 0,
|
|
114
|
+
$setup.slots.error ? {
|
|
115
|
+
name: "error",
|
|
116
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "error")]),
|
|
117
|
+
key: "2"
|
|
118
|
+
} : void 0
|
|
119
|
+
]), 1040)) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
120
|
+
class: normalizeClass($setup.cls.group),
|
|
121
|
+
style: normalizeStyle($setup.sls.group)
|
|
122
|
+
}, [renderSlot(_ctx.$slots, "default")], 6)]),
|
|
123
|
+
_: 3
|
|
124
|
+
}, 16, ["class", "style"]);
|
|
125
|
+
}
|
|
126
|
+
var radiogroup_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/radiogroup/radiogroup.vue"]]);
|
|
127
|
+
//#endregion
|
|
128
|
+
export { radiogroup_default as default };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=radiogroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiogroup.js","names":["_useSlots","Label","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_normalizeProps","_createSlots","_renderSlot","_createCommentVNode","_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../../src/components/radiogroup/radiogroup.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport {\n radiogroupControl,\n radiogroupRecipe,\n type RadiogroupSlots as RadiogroupRecipeSlots,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n toRaw,\n useAttrs,\n useId,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { attrToBool } from \"~/utils\";\nimport { Label } from \"../label\";\nimport type { RadiogroupOwnProps } from \"./radiogroup.types\";\n\ndefineOptions({\n name: \"HuiRadiogroup\",\n inheritAttrs: false,\n});\n\ntype Props =\n & RadiogroupOwnProps\n & { as?: E | undefined }\n & {\n classes?:\n | Partial<Record<RadiogroupRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<RadiogroupRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n | keyof RadiogroupOwnProps\n | \"as\"\n | \"classes\"\n | \"styles\"\n | \"class\"\n | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Radiogroup\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst labelId = useId();\nconst hasLabel = computed(() =>\n Boolean(slots.label || slots.description || slots.error)\n);\nconst radiogroupState = computed(() => ({\n labelId,\n hasLabel: hasLabel.value,\n invalid: Boolean(slots.error),\n required: attrToBool(resolvedProps.value[\"aria-required\"]),\n}));\nconst recipe = computed(() =>\n radiogroupRecipe({ direction: resolvedProps.value.direction })\n);\nconst cls = useHuiClasses(\n \"Radiogroup\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Radiogroup\", RadiogroupRecipeSlots>(\n \"Radiogroup\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"direction\",\n \"labelProps\",\n \"classes\",\n \"styles\",\n \"class\",\n \"style\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...radiogroupControl.getRootAttributes(radiogroupState.value),\n ...forwardedAttrs.value,\n}));\nconst labelAttrs = computed<Record<string, unknown>>(() => ({\n as: \"div\",\n ...radiogroupControl.getLabelAttributes(radiogroupState.value),\n ...resolvedProps.value.labelProps,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <Label v-if=\"hasLabel\" v-bind=\"labelAttrs\">\n <template v-if=\"slots.label\" #default>\n <slot name=\"label\" />\n </template>\n <template v-if=\"slots.description\" #description>\n <slot name=\"description\" />\n </template>\n <template v-if=\"slots.error\" #error>\n <slot name=\"error\" />\n </template>\n </Label>\n <div :class=\"cls.group\" :style=\"sls.group\">\n <slot />\n </div>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAOd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,cAAc,OAAO,KAAK;EAC5D,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,KAAK,CACvC;EACA,MAAM,UAAU,MAAM;EACtB,MAAM,WAAW,eACf,QAAQ,MAAM,SAAS,MAAM,eAAe,MAAM,KAAK,CACzD;EACA,MAAM,kBAAkB,gBAAgB;GACtC;GACA,UAAU,SAAS;GACnB,SAAS,QAAQ,MAAM,KAAK;GAC5B,UAAU,WAAW,cAAc,MAAM,gBAAgB;EAC3D,EAAE;EACF,MAAM,SAAS,eACb,iBAAiB,EAAE,WAAW,cAAc,MAAM,UAAU,CAAC,CAC/D;EACA,MAAM,MAAM,cACV,cACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,cACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,kBAAkB,kBAAkB,gBAAgB,KAAK;GAC5D,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,gBAAyC;GAC1D,IAAI;GACJ,GAAG,kBAAkB,mBAAmB,gBAAgB,KAAK;GAC7D,GAAG,cAAc,MAAM;EACzB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAE,UAAA,GAAAC,YAqBYC,wBApBL,OAAA,SAAS,GADhBC,WAqBY,EAnBV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;;EAEZ,SAAAC,cAUQ,CAVK,OAAA,YAAbJ,UAAA,GAAAC,YAUQ,OAAA,UAAAI,eAAAF,WAAA,EAAA,KAAA,EAAA,GAVuB,OAAA,UAAU,CAAA,GAAAG,YAAA,EAAA,GAAA,EAAA,GAAA;GACvB,OAAA,MAAM,QAAA;IAAQ,MAAA;IAC5B,IAAAF,cAAqB,CAArBG,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;;;GAEP,OAAA,MAAM,cAAA;IAAc,MAAA;IAClC,IAAAH,cAA2B,CAA3BG,WAA2B,KAAA,QAAA,aAAA,CAAA,CAAA;;;GAEb,OAAA,MAAM,QAAA;IAAQ,MAAA;IAC5B,IAAAH,cAAqB,CAArBG,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;;;EAGzB,CAAA,GAAA,IAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAC,mBAEM,OAAA;GAFA,OAAKC,eAAE,OAAA,IAAI,KAAK;GAAG,OAAKC,eAAE,OAAA,IAAI,KAAK;EACvC,GAAA,CAAAJ,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { LabelProps } from "../label/label.types.js";
|
|
5
|
+
import "../label/index.js";
|
|
6
|
+
import { RadiogroupSlots, RadiogroupVariants } from "@hebium-ui/core";
|
|
7
|
+
//#region src/components/radiogroup/radiogroup.types.d.ts
|
|
8
|
+
export interface RadiogroupOwnProps {
|
|
9
|
+
/**
|
|
10
|
+
* The direction in which radio options are laid out.
|
|
11
|
+
*
|
|
12
|
+
* @default "column"
|
|
13
|
+
*/
|
|
14
|
+
direction?: RadiogroupVariants["direction"] | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Additional props passed to the internal label component.
|
|
17
|
+
*/
|
|
18
|
+
labelProps?: LabelProps<"div"> | undefined;
|
|
19
|
+
}
|
|
20
|
+
export type RadiogroupProps<E extends ElementType = "div"> = HuiPolymorphicProps<E, RadiogroupOwnProps, RadiogroupSlots>;
|
|
21
|
+
export interface RadiogroupExposed<E extends ElementType = "div"> {
|
|
22
|
+
readonly root: HuiElementInstance<E> | null;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=radiogroup.types.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { RadiogroupOwnProps } from "./radiogroup.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { RadiogroupSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/radiogroup/radiogroup.vue.d.ts
|
|
7
|
+
declare const __VLS_export: <E extends ElementType = "div">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<RadiogroupOwnProps & {
|
|
9
|
+
as?: E | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
classes?: Partial<Record<RadiogroupSlots, ClassValue | undefined>> | undefined;
|
|
12
|
+
styles?: Partial<Record<RadiogroupSlots, StyleValue | undefined>> | undefined;
|
|
13
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "as" | "class" | "classes" | "styles" | keyof RadiogroupOwnProps>> & (typeof globalThis extends {
|
|
14
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
15
|
+
} ? P : {});
|
|
16
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
17
|
+
root: Readonly<import("vue").ShallowRef<HuiElementInstance<E> | null>>;
|
|
18
|
+
}>) => void;
|
|
19
|
+
attrs: any;
|
|
20
|
+
slots: {
|
|
21
|
+
default?: () => unknown;
|
|
22
|
+
label?: () => unknown;
|
|
23
|
+
description?: () => unknown;
|
|
24
|
+
error?: () => unknown;
|
|
25
|
+
};
|
|
26
|
+
emit: {};
|
|
27
|
+
}>) => import("vue").VNode & {
|
|
28
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
29
|
+
};
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { _default as default };
|
|
34
|
+
//# sourceMappingURL=radiogroup.vue.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { sectionRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/section/section.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiSection",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "section",
|
|
10
|
+
props: {
|
|
11
|
+
bg: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
radius: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
padding: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
border: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
as: {
|
|
28
|
+
type: null,
|
|
29
|
+
required: false
|
|
30
|
+
},
|
|
31
|
+
class: {
|
|
32
|
+
type: [
|
|
33
|
+
Boolean,
|
|
34
|
+
null,
|
|
35
|
+
String,
|
|
36
|
+
Object,
|
|
37
|
+
Array
|
|
38
|
+
],
|
|
39
|
+
required: false,
|
|
40
|
+
skipCheck: true
|
|
41
|
+
},
|
|
42
|
+
style: {
|
|
43
|
+
type: [
|
|
44
|
+
Boolean,
|
|
45
|
+
null,
|
|
46
|
+
String,
|
|
47
|
+
Object,
|
|
48
|
+
Array
|
|
49
|
+
],
|
|
50
|
+
required: false,
|
|
51
|
+
skipCheck: true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(__props, { expose: __expose }) {
|
|
55
|
+
const props = __props;
|
|
56
|
+
const attrs = useAttrs();
|
|
57
|
+
const resolvedProps = useHuiProps("Section", props, attrs);
|
|
58
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "section"));
|
|
59
|
+
const recipe = computed(() => {
|
|
60
|
+
const resolved = resolvedProps.value;
|
|
61
|
+
return sectionRecipe({
|
|
62
|
+
bg: resolved.bg,
|
|
63
|
+
radius: resolved.radius,
|
|
64
|
+
padding: resolved.padding,
|
|
65
|
+
border: resolved.border
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const cls = useHuiClasses("Section", recipe, computed(() => ({ root: props.class })));
|
|
69
|
+
const sls = useHuiStyles("Section", computed(() => ({ root: props.style })));
|
|
70
|
+
const rootAttrs = useHuiAttrs(resolvedProps, [
|
|
71
|
+
"as",
|
|
72
|
+
"bg",
|
|
73
|
+
"radius",
|
|
74
|
+
"padding",
|
|
75
|
+
"border",
|
|
76
|
+
"class",
|
|
77
|
+
"style"
|
|
78
|
+
]);
|
|
79
|
+
const rootRef = useTemplateRef("root");
|
|
80
|
+
__expose({ root: rootRef });
|
|
81
|
+
const __returned__ = {
|
|
82
|
+
props,
|
|
83
|
+
attrs,
|
|
84
|
+
resolvedProps,
|
|
85
|
+
component,
|
|
86
|
+
recipe,
|
|
87
|
+
cls,
|
|
88
|
+
sls,
|
|
89
|
+
rootAttrs,
|
|
90
|
+
rootRef
|
|
91
|
+
};
|
|
92
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
93
|
+
enumerable: false,
|
|
94
|
+
value: true
|
|
95
|
+
});
|
|
96
|
+
return __returned__;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
100
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
101
|
+
class: $setup.cls.root,
|
|
102
|
+
style: $setup.sls.root
|
|
103
|
+
}), {
|
|
104
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
105
|
+
_: 3
|
|
106
|
+
}, 16, ["class", "style"]);
|
|
107
|
+
}
|
|
108
|
+
var section_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/section/section.vue"]]);
|
|
109
|
+
//#endregion
|
|
110
|
+
export { section_default as default };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/section/section.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'section'\"\n>\nimport { sectionRecipe } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n toRaw,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport type { SectionOwnProps } from \"./section.types\";\n\ndefineOptions({\n name: \"HuiSection\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SectionOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SectionOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Section\", props, attrs);\nconst component = computed<E | \"section\">(() =>\n toRaw(resolvedProps.value.as ?? \"section\")\n);\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n\n return sectionRecipe({\n bg: resolved.bg,\n radius: resolved.radius,\n padding: resolved.padding,\n border: resolved.border,\n });\n});\nconst cls = useHuiClasses(\n \"Section\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Section\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"bg\",\n \"radius\",\n \"padding\",\n \"border\",\n \"class\",\n \"style\",\n]);\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,WAAW,OAAO,KAAK;EACzD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,SAAS,CAC3C;EACA,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAE/B,OAAO,cAAc;IACnB,IAAI,SAAS;IACb,QAAQ,SAAS;IACjB,SAAS,SAAS;IAClB,QAAQ,SAAS;GACnB,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,WACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,WACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe;GAC3C;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,YAQYC,wBAPL,OAAA,SAAS,GADhBC,WAQY,EANV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;;EAEZ,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { SectionSlots, SectionVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/section/section.types.d.ts
|
|
6
|
+
export interface SectionOwnProps {
|
|
7
|
+
/**
|
|
8
|
+
* The background color of the section.
|
|
9
|
+
*
|
|
10
|
+
* @default "section"
|
|
11
|
+
*/
|
|
12
|
+
bg?: SectionVariants["bg"] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The border radius of the section.
|
|
15
|
+
*
|
|
16
|
+
* @default "base"
|
|
17
|
+
*/
|
|
18
|
+
radius?: SectionVariants["radius"] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The padding size of the section.
|
|
21
|
+
*
|
|
22
|
+
* @default "sm"
|
|
23
|
+
*/
|
|
24
|
+
padding?: SectionVariants["padding"] | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The border style of the section.
|
|
27
|
+
*
|
|
28
|
+
* @default "none"
|
|
29
|
+
*/
|
|
30
|
+
border?: SectionVariants["border"] | undefined;
|
|
31
|
+
}
|
|
32
|
+
export type SectionProps<E extends ElementType = "section"> = HuiPolymorphicProps<E, SectionOwnProps, SectionSlots>;
|
|
33
|
+
export interface SectionExposed<E extends ElementType = "section"> {
|
|
34
|
+
readonly root: HuiElementInstance<E> | null;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//# sourceMappingURL=section.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { SectionOwnProps } from "./section.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
//#region src/components/section/section.vue.d.ts
|
|
6
|
+
declare const __VLS_export: <E extends ElementType = "section">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<SectionOwnProps & {
|
|
8
|
+
as?: E | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
class?: ClassValue | undefined;
|
|
11
|
+
style?: StyleValue | undefined;
|
|
12
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "as" | "class" | keyof SectionOwnProps>> & (typeof globalThis extends {
|
|
13
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
14
|
+
} ? P : {});
|
|
15
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
16
|
+
root: Readonly<import("vue").ShallowRef<HuiElementInstance<E> | null>>;
|
|
17
|
+
}>) => void;
|
|
18
|
+
attrs: any;
|
|
19
|
+
slots: {
|
|
20
|
+
default?: () => unknown;
|
|
21
|
+
};
|
|
22
|
+
emit: {};
|
|
23
|
+
}>) => import("vue").VNode & {
|
|
24
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
25
|
+
};
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { _default as default };
|
|
30
|
+
//# sourceMappingURL=section.vue.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SegmentedControlExposed, SegmentedControlItemExposed, SegmentedControlItemProps, SegmentedControlProps } from "./segmented-control.types.js";
|
|
2
|
+
import _default from "./segmented-control-item.vue.js";
|
|
3
|
+
import _default$1 from "./segmented-control.vue.js";
|
|
4
|
+
export { _default$1 as SegmentedControl, type SegmentedControlExposed, _default as SegmentedControlItem, type SegmentedControlItemExposed, type SegmentedControlItemProps, type SegmentedControlProps };
|