@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 wancup
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hebium-ui/vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Experimental Vue 3 bindings for the Hebium UI core components.
|
|
4
|
+
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> Hebium UI is under active development. Its APIs may change without notice, including breaking changes.
|
|
7
|
+
|
|
8
|
+
The source repository is currently private. Public release is planned, but no timeline has been set.
|
|
@@ -0,0 +1,108 @@
|
|
|
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, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, useAttrs, useSlots, useTemplateRef } from "vue";
|
|
4
|
+
import { alertRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/alert/alert.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiAlert",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "alert",
|
|
10
|
+
props: {
|
|
11
|
+
variant: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
padding: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
classes: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
styles: {
|
|
28
|
+
type: null,
|
|
29
|
+
required: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup(__props, { expose: __expose }) {
|
|
33
|
+
const props = __props;
|
|
34
|
+
const slots = useSlots();
|
|
35
|
+
const attrs = useAttrs();
|
|
36
|
+
const resolvedProps = useHuiProps("Alert", props, attrs);
|
|
37
|
+
const recipe = computed(() => {
|
|
38
|
+
const resolved = resolvedProps.value;
|
|
39
|
+
return alertRecipe({
|
|
40
|
+
variant: resolved.variant,
|
|
41
|
+
color: resolved.color,
|
|
42
|
+
padding: resolved.padding
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const cls = useHuiClasses("Alert", recipe, computed(() => props.classes ?? {}));
|
|
46
|
+
const sls = useHuiStyles("Alert", computed(() => props.styles ?? {}));
|
|
47
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
48
|
+
"variant",
|
|
49
|
+
"color",
|
|
50
|
+
"padding",
|
|
51
|
+
"classes",
|
|
52
|
+
"styles"
|
|
53
|
+
]);
|
|
54
|
+
const rootAttrs = computed(() => ({
|
|
55
|
+
role: "alert",
|
|
56
|
+
...forwardedAttrs.value
|
|
57
|
+
}));
|
|
58
|
+
const rootRef = useTemplateRef("root");
|
|
59
|
+
__expose({ root: rootRef });
|
|
60
|
+
const __returned__ = {
|
|
61
|
+
props,
|
|
62
|
+
slots,
|
|
63
|
+
attrs,
|
|
64
|
+
resolvedProps,
|
|
65
|
+
recipe,
|
|
66
|
+
cls,
|
|
67
|
+
sls,
|
|
68
|
+
forwardedAttrs,
|
|
69
|
+
rootAttrs,
|
|
70
|
+
rootRef
|
|
71
|
+
};
|
|
72
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
73
|
+
enumerable: false,
|
|
74
|
+
value: true
|
|
75
|
+
});
|
|
76
|
+
return __returned__;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
80
|
+
return openBlock(), createElementBlock("div", mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
81
|
+
class: $setup.cls.root,
|
|
82
|
+
style: $setup.sls.root
|
|
83
|
+
}), [createElementVNode("div", {
|
|
84
|
+
class: normalizeClass($setup.cls.icon),
|
|
85
|
+
style: normalizeStyle($setup.sls.icon)
|
|
86
|
+
}, [$setup.slots.icon ? renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 0) : (openBlock(), createElementBlock("span", {
|
|
87
|
+
key: 1,
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
class: normalizeClass($setup.cls.errorIcon),
|
|
90
|
+
style: normalizeStyle($setup.sls.errorIcon)
|
|
91
|
+
}, null, 6))], 6), createElementVNode("div", {
|
|
92
|
+
class: normalizeClass($setup.cls.content),
|
|
93
|
+
style: normalizeStyle($setup.sls.content)
|
|
94
|
+
}, [$setup.slots.message ? (openBlock(), createElementBlock("div", {
|
|
95
|
+
key: 0,
|
|
96
|
+
class: normalizeClass($setup.cls.message),
|
|
97
|
+
style: normalizeStyle($setup.sls.message)
|
|
98
|
+
}, [renderSlot(_ctx.$slots, "message")], 6)) : createCommentVNode("v-if", true), $setup.slots.description ? (openBlock(), createElementBlock("div", {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: normalizeClass($setup.cls.description),
|
|
101
|
+
style: normalizeStyle($setup.sls.description)
|
|
102
|
+
}, [renderSlot(_ctx.$slots, "description")], 6)) : createCommentVNode("v-if", true)], 6)], 16);
|
|
103
|
+
}
|
|
104
|
+
var alert_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/alert/alert.vue"]]);
|
|
105
|
+
//#endregion
|
|
106
|
+
export { alert_default as default };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","names":["_useSlots","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_normalizeClass","_normalizeStyle","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/alert/alert.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n alertRecipe,\n type AlertSlots as AlertRecipeSlots,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport type { AlertOwnProps } from \"./alert.types\";\n\ndefineOptions({\n name: \"HuiAlert\",\n inheritAttrs: false,\n});\n\ntype Props =\n & AlertOwnProps\n & {\n classes?:\n | Partial<Record<AlertRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<AlertRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"div\">,\n keyof AlertOwnProps | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n message?: () => unknown;\n description?: () => unknown;\n icon?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Alert\", props, attrs);\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n return alertRecipe({\n variant: resolved.variant,\n color: resolved.color,\n padding: resolved.padding,\n });\n});\nconst cls = useHuiClasses(\n \"Alert\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Alert\", AlertRecipeSlots>(\n \"Alert\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"variant\",\n \"color\",\n \"padding\",\n \"classes\",\n \"styles\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n role: \"alert\",\n ...forwardedAttrs.value,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<\"div\">>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <div\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <div :class=\"cls.icon\" :style=\"sls.icon\">\n <slot v-if=\"slots.icon\" name=\"icon\" />\n <span\n v-else\n aria-hidden=\"true\"\n :class=\"cls.errorIcon\"\n :style=\"sls.errorIcon\"\n />\n </div>\n <div :class=\"cls.content\" :style=\"sls.content\">\n <div v-if=\"slots.message\" :class=\"cls.message\" :style=\"sls.message\">\n <slot name=\"message\" />\n </div>\n <div\n v-if=\"slots.description\"\n :class=\"cls.description\"\n :style=\"sls.description\"\n >\n <slot name=\"description\" />\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,SAAS,OAAO,KAAK;EACvD,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAC/B,OAAO,YAAY;IACjB,SAAS,SAAS;IAClB,OAAO,SAAS;IAChB,SAAS,SAAS;GACpB,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;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,MAAM;GACN,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,UAAU,eAA0C,MAAM;EAEhE,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,UAAA,GAAAC,mBA2BM,OA3BNC,WA2BM,EA1BJ,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,mBAQM,OAAA;EARA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;CACzB,GAAA,CAAA,OAAA,MAAM,OAAlBC,WAAsC,KAAA,QAAA,QAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,KACtCN,UAAA,GAAAC,mBAKE,QAAA;;EAHA,eAAY;EACX,OAAKG,eAAE,OAAA,IAAI,SAAS;EACpB,OAAKC,eAAE,OAAA,IAAI,SAAS;CAGzB,GAAA,MAAA,CAAA,EAAA,GAAA,CAAA,GAAAF,mBAWM,OAAA;EAXA,OAAKC,eAAE,OAAA,IAAI,OAAO;EAAG,OAAKC,eAAE,OAAA,IAAI,OAAO;CAChC,GAAA,CAAA,OAAA,MAAM,WAAjBL,UAAA,GAAAC,mBAEM,OAAA;;EAFqB,OAAKG,eAAE,OAAA,IAAI,OAAO;EAAG,OAAKC,eAAE,OAAA,IAAI,OAAO;CAChE,GAAA,CAAAC,WAAuB,KAAA,QAAA,SAAA,CAAA,GAAA,CAGjB,KAAAC,mBAAA,QAAA,IAAA,GAAA,OAAA,MAAM,eADdP,UAAA,GAAAC,mBAMM,OAAA;;EAJH,OAAKG,eAAE,OAAA,IAAI,WAAW;EACtB,OAAKC,eAAE,OAAA,IAAI,WAAW;CAEvB,GAAA,CAAAC,WAA2B,KAAA,QAAA,aAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,QAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { AlertSlots, AlertVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/alert/alert.types.d.ts
|
|
6
|
+
export interface AlertOwnProps {
|
|
7
|
+
/**
|
|
8
|
+
* The visual style of the alert.
|
|
9
|
+
*
|
|
10
|
+
* @default "light"
|
|
11
|
+
*/
|
|
12
|
+
variant?: AlertVariants["variant"] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The semantic color of the alert.
|
|
15
|
+
*
|
|
16
|
+
* @default "danger"
|
|
17
|
+
*/
|
|
18
|
+
color?: AlertVariants["color"] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The padding of the alert.
|
|
21
|
+
*
|
|
22
|
+
* @default "md"
|
|
23
|
+
*/
|
|
24
|
+
padding?: AlertVariants["padding"] | undefined;
|
|
25
|
+
}
|
|
26
|
+
export type AlertProps = HuiComponentProps<HuiElementProps<"div"> & AlertOwnProps, AlertSlots>;
|
|
27
|
+
export interface AlertExposed {
|
|
28
|
+
readonly root: HuiElementInstance<"div"> | null;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=alert.types.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { AlertOwnProps } from "./alert.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { AlertSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/alert/alert.vue.d.ts
|
|
7
|
+
type Props = AlertOwnProps & {
|
|
8
|
+
classes?: Partial<Record<AlertSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<AlertSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"div">, keyof AlertOwnProps | "class" | "style">;
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
message?: () => unknown;
|
|
13
|
+
description?: () => unknown;
|
|
14
|
+
icon?: () => unknown;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
17
|
+
root: Readonly<import("vue").ShallowRef<HTMLDivElement | null>>;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { _default as default };
|
|
28
|
+
//# sourceMappingURL=alert.vue.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { anchorRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/anchor/anchor.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiAnchor",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "anchor",
|
|
10
|
+
props: {
|
|
11
|
+
color: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
marker: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
decoration: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
as: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
class: {
|
|
28
|
+
type: [
|
|
29
|
+
Boolean,
|
|
30
|
+
null,
|
|
31
|
+
String,
|
|
32
|
+
Object,
|
|
33
|
+
Array
|
|
34
|
+
],
|
|
35
|
+
required: false,
|
|
36
|
+
skipCheck: true
|
|
37
|
+
},
|
|
38
|
+
style: {
|
|
39
|
+
type: [
|
|
40
|
+
Boolean,
|
|
41
|
+
null,
|
|
42
|
+
String,
|
|
43
|
+
Object,
|
|
44
|
+
Array
|
|
45
|
+
],
|
|
46
|
+
required: false,
|
|
47
|
+
skipCheck: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
setup(__props, { expose: __expose }) {
|
|
51
|
+
const props = __props;
|
|
52
|
+
const attrs = useAttrs();
|
|
53
|
+
const resolvedProps = useHuiProps("Anchor", props, attrs);
|
|
54
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "a"));
|
|
55
|
+
const recipe = computed(() => {
|
|
56
|
+
const resolved = resolvedProps.value;
|
|
57
|
+
return anchorRecipe({
|
|
58
|
+
color: resolved.color,
|
|
59
|
+
marker: resolved.marker,
|
|
60
|
+
decoration: resolved.decoration
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const cls = useHuiClasses("Anchor", recipe, computed(() => ({ root: props.class })));
|
|
64
|
+
const sls = useHuiStyles("Anchor", computed(() => ({ root: props.style })));
|
|
65
|
+
const rootAttrs = useHuiAttrs(resolvedProps, [
|
|
66
|
+
"as",
|
|
67
|
+
"color",
|
|
68
|
+
"marker",
|
|
69
|
+
"decoration",
|
|
70
|
+
"class",
|
|
71
|
+
"style"
|
|
72
|
+
]);
|
|
73
|
+
const rootRef = useTemplateRef("root");
|
|
74
|
+
__expose({ root: rootRef });
|
|
75
|
+
const __returned__ = {
|
|
76
|
+
props,
|
|
77
|
+
attrs,
|
|
78
|
+
resolvedProps,
|
|
79
|
+
component,
|
|
80
|
+
recipe,
|
|
81
|
+
cls,
|
|
82
|
+
sls,
|
|
83
|
+
rootAttrs,
|
|
84
|
+
rootRef
|
|
85
|
+
};
|
|
86
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
87
|
+
enumerable: false,
|
|
88
|
+
value: true
|
|
89
|
+
});
|
|
90
|
+
return __returned__;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
94
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
95
|
+
class: $setup.cls.root,
|
|
96
|
+
style: $setup.sls.root
|
|
97
|
+
}), {
|
|
98
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
99
|
+
_: 3
|
|
100
|
+
}, 16, ["class", "style"]);
|
|
101
|
+
}
|
|
102
|
+
var anchor_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/anchor/anchor.vue"]]);
|
|
103
|
+
//#endregion
|
|
104
|
+
export { anchor_default as default };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=anchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/anchor/anchor.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'a'\"\n>\nimport { anchorRecipe } 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 { AnchorOwnProps } from \"./anchor.types\";\n\ndefineOptions({\n name: \"HuiAnchor\",\n inheritAttrs: false,\n});\n\ntype Props =\n & AnchorOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof AnchorOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Anchor\", props, attrs);\nconst component = computed<E | \"a\">(() => toRaw(resolvedProps.value.as ?? \"a\"));\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n\n return anchorRecipe({\n color: resolved.color,\n marker: resolved.marker,\n decoration: resolved.decoration,\n });\n});\nconst cls = useHuiClasses(\n \"Anchor\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Anchor\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"color\",\n \"marker\",\n \"decoration\",\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,UAAU,OAAO,KAAK;EACxD,MAAM,YAAY,eAAwB,MAAM,cAAc,MAAM,MAAM,GAAG,CAAC;EAC9E,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAE/B,OAAO,aAAa;IAClB,OAAO,SAAS;IAChB,QAAQ,SAAS;IACjB,YAAY,SAAS;GACvB,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,UACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,UACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe;GAC3C;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,31 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { AnchorSlots, AnchorVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/anchor/anchor.types.d.ts
|
|
6
|
+
export interface AnchorOwnProps {
|
|
7
|
+
/**
|
|
8
|
+
* The semantic color of the anchor.
|
|
9
|
+
*
|
|
10
|
+
* @default "accent"
|
|
11
|
+
*/
|
|
12
|
+
color?: AnchorVariants["color"] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The marker displayed before or after the anchor text.
|
|
15
|
+
* Override `--hui-anchor-marker` to customize the marker content.
|
|
16
|
+
* Include quotes in the CSS variable value because it is used as CSS `content`.
|
|
17
|
+
*/
|
|
18
|
+
marker?: AnchorVariants["marker"] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The text decoration style of the anchor.
|
|
21
|
+
*
|
|
22
|
+
* @default "underline"
|
|
23
|
+
*/
|
|
24
|
+
decoration?: AnchorVariants["decoration"] | undefined;
|
|
25
|
+
}
|
|
26
|
+
export type AnchorProps<E extends ElementType = "a"> = HuiPolymorphicProps<E, AnchorOwnProps, AnchorSlots>;
|
|
27
|
+
export interface AnchorExposed<E extends ElementType = "a"> {
|
|
28
|
+
readonly root: HuiElementInstance<E> | null;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=anchor.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { AnchorOwnProps } from "./anchor.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
//#region src/components/anchor/anchor.vue.d.ts
|
|
6
|
+
declare const __VLS_export: <E extends ElementType = "a">(__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<AnchorOwnProps & {
|
|
8
|
+
as?: E | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
class?: ClassValue | undefined;
|
|
11
|
+
style?: StyleValue | undefined;
|
|
12
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "as" | "class" | keyof AnchorOwnProps>> & (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=anchor.vue.d.ts.map
|
|
@@ -0,0 +1,111 @@
|
|
|
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, createElementBlock, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, ref, toDisplayString, useAttrs, useTemplateRef } from "vue";
|
|
4
|
+
import { avatartRecipe, getAvatarPlaceholder, shouldShowAvatarPlaceholder } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/avatar/avatar.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiAvatar",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "avatar",
|
|
10
|
+
props: {
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
classes: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
styles: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(__props, { expose: __expose }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const attrs = useAttrs();
|
|
27
|
+
const resolvedProps = useHuiProps("Avatar", props, attrs);
|
|
28
|
+
const failedSource = ref(null);
|
|
29
|
+
const shouldShowPlaceholder = computed(() => shouldShowAvatarPlaceholder({
|
|
30
|
+
src: resolvedProps.value.src,
|
|
31
|
+
srcSet: resolvedProps.value.srcset,
|
|
32
|
+
failedSource: failedSource.value
|
|
33
|
+
}));
|
|
34
|
+
const recipe = computed(() => avatartRecipe({ background: shouldShowPlaceholder.value ? "box" : "transparent" }));
|
|
35
|
+
const cls = useHuiClasses("Avatar", recipe, computed(() => props.classes ?? {}));
|
|
36
|
+
const sls = useHuiStyles("Avatar", computed(() => props.styles ?? {}));
|
|
37
|
+
const imageAttrs = useHuiAttrs(resolvedProps, [
|
|
38
|
+
"classes",
|
|
39
|
+
"styles",
|
|
40
|
+
"name",
|
|
41
|
+
"src",
|
|
42
|
+
"srcset",
|
|
43
|
+
"alt",
|
|
44
|
+
"onError",
|
|
45
|
+
"class",
|
|
46
|
+
"style"
|
|
47
|
+
]);
|
|
48
|
+
const placeholder = computed(() => getAvatarPlaceholder(resolvedProps.value.name));
|
|
49
|
+
const imgRef = useTemplateRef("img");
|
|
50
|
+
function handleError(event) {
|
|
51
|
+
const resolved = resolvedProps.value;
|
|
52
|
+
const source = {
|
|
53
|
+
src: resolved.src,
|
|
54
|
+
srcSet: resolved.srcset
|
|
55
|
+
};
|
|
56
|
+
const onError = resolved.onError;
|
|
57
|
+
if (typeof onError === "function") onError(event);
|
|
58
|
+
failedSource.value = source;
|
|
59
|
+
}
|
|
60
|
+
__expose({ img: imgRef });
|
|
61
|
+
const __returned__ = {
|
|
62
|
+
props,
|
|
63
|
+
attrs,
|
|
64
|
+
resolvedProps,
|
|
65
|
+
failedSource,
|
|
66
|
+
shouldShowPlaceholder,
|
|
67
|
+
recipe,
|
|
68
|
+
cls,
|
|
69
|
+
sls,
|
|
70
|
+
imageAttrs,
|
|
71
|
+
placeholder,
|
|
72
|
+
imgRef,
|
|
73
|
+
handleError
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
76
|
+
enumerable: false,
|
|
77
|
+
value: true
|
|
78
|
+
});
|
|
79
|
+
return __returned__;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const _hoisted_1 = [
|
|
83
|
+
"src",
|
|
84
|
+
"srcset",
|
|
85
|
+
"alt"
|
|
86
|
+
];
|
|
87
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
88
|
+
return openBlock(), createElementBlock("div", {
|
|
89
|
+
class: normalizeClass($setup.cls.root),
|
|
90
|
+
style: normalizeStyle($setup.sls.root)
|
|
91
|
+
}, [$setup.shouldShowPlaceholder ? (openBlock(), createElementBlock("span", {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: normalizeClass($setup.cls.placeholder),
|
|
94
|
+
style: normalizeStyle($setup.sls.placeholder)
|
|
95
|
+
}, toDisplayString($setup.placeholder), 7)) : (openBlock(), createElementBlock("img", mergeProps({
|
|
96
|
+
key: 1,
|
|
97
|
+
ref: "img"
|
|
98
|
+
}, $setup.imageAttrs, {
|
|
99
|
+
class: $setup.cls.img,
|
|
100
|
+
style: $setup.sls.img,
|
|
101
|
+
src: $setup.resolvedProps.src,
|
|
102
|
+
srcset: $setup.resolvedProps.srcset,
|
|
103
|
+
alt: $setup.resolvedProps.alt ?? $setup.resolvedProps.name,
|
|
104
|
+
onError: $setup.handleError
|
|
105
|
+
}), null, 16, _hoisted_1))], 6);
|
|
106
|
+
}
|
|
107
|
+
var avatar_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/avatar/avatar.vue"]]);
|
|
108
|
+
//#endregion
|
|
109
|
+
export { avatar_default as default };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_toDisplayString","_mergeProps"],"sources":["../../../src/components/avatar/avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n type AvatarSlots as AvatarRecipeSlots,\n type AvatarSource,\n avatartRecipe,\n getAvatarPlaceholder,\n shouldShowAvatarPlaceholder,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n ref,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport type { AvatarOwnProps } from \"./avatar.types\";\n\ndefineOptions({\n name: \"HuiAvatar\",\n inheritAttrs: false,\n});\n\ntype Props =\n & AvatarOwnProps\n & {\n classes?:\n | Partial<Record<AvatarRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<AvatarRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"img\">,\n keyof AvatarOwnProps | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Avatar\", props, attrs);\nconst failedSource = ref<AvatarSource | null>(null);\nconst shouldShowPlaceholder = computed(() =>\n shouldShowAvatarPlaceholder({\n src: resolvedProps.value.src,\n srcSet: resolvedProps.value.srcset,\n failedSource: failedSource.value,\n })\n);\nconst recipe = computed(() =>\n avatartRecipe({\n background: shouldShowPlaceholder.value ? \"box\" : \"transparent\",\n })\n);\nconst cls = useHuiClasses(\n \"Avatar\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Avatar\", AvatarRecipeSlots>(\n \"Avatar\",\n computed(() => props.styles ?? {}),\n);\nconst imageAttrs = useHuiAttrs(resolvedProps, [\n \"classes\",\n \"styles\",\n \"name\",\n \"src\",\n \"srcset\",\n \"alt\",\n \"onError\",\n \"class\",\n \"style\",\n]);\nconst placeholder = computed(() =>\n getAvatarPlaceholder(resolvedProps.value.name)\n);\nconst imgRef = useTemplateRef<HuiElementInstance<\"img\">>(\"img\");\n\nfunction handleError(event: Event): void {\n const resolved = resolvedProps.value;\n const source: AvatarSource = {\n src: resolved.src,\n srcSet: resolved.srcset,\n };\n const onError = resolved.onError;\n\n if (typeof onError === \"function\") onError(event);\n failedSource.value = source;\n}\n\ndefineExpose({\n img: imgRef,\n});\n</script>\n\n<template>\n <div :class=\"cls.root\" :style=\"sls.root\">\n <span\n v-if=\"shouldShowPlaceholder\"\n :class=\"cls.placeholder\"\n :style=\"sls.placeholder\"\n >\n {{ placeholder }}\n </span>\n <img\n v-else\n ref=\"img\"\n v-bind=\"imageAttrs\"\n :class=\"cls.img\"\n :style=\"sls.img\"\n :src=\"resolvedProps.src\"\n :srcset=\"resolvedProps.srcset\"\n :alt=\"resolvedProps.alt ?? resolvedProps.name\"\n @error=\"handleError\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAEd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,UAAU,OAAO,KAAK;EACxD,MAAM,eAAe,IAAyB,IAAI;EAClD,MAAM,wBAAwB,eAC5B,4BAA4B;GAC1B,KAAK,cAAc,MAAM;GACzB,QAAQ,cAAc,MAAM;GAC5B,cAAc,aAAa;EAC7B,CAAC,CACH;EACA,MAAM,SAAS,eACb,cAAc,EACZ,YAAY,sBAAsB,QAAQ,QAAQ,cACpD,CAAC,CACH;EACA,MAAM,MAAM,cACV,UACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,UACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,aAAa,YAAY,eAAe;GAC5C;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,cAAc,eAClB,qBAAqB,cAAc,MAAM,IAAI,CAC/C;EACA,MAAM,SAAS,eAA0C,KAAK;EAE9D,SAAS,YAAY,OAAoB;GACvC,MAAM,WAAW,cAAc;GAC/B,MAAM,SAAuB;IAC3B,KAAK,SAAS;IACd,QAAQ,SAAS;GACnB;GACA,MAAM,UAAU,SAAS;GAEzB,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK;GAChD,aAAa,QAAQ;EACvB;EAEA,SAAa,EACX,KAAK,OACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,mBAmBM,OAAA;EAnBA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;CAE7B,GAAA,CAAA,OAAA,yBADRH,UAAA,GAAAC,mBAMO,QAAA;;EAJJ,OAAKC,eAAE,OAAA,IAAI,WAAW;EACtB,OAAKC,eAAE,OAAA,IAAI,WAAW;CAEpB,GAAAC,gBAAA,OAAA,WAAW,GAAA,CAAA,MAEhBJ,UAAA,GAAAC,mBAUE,OAVFI,WAUE;;EARA,KAAI;CACI,GAAA,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;EACX,KAAK,OAAA,cAAc;EACnB,QAAQ,OAAA,cAAc;EACtB,KAAK,OAAA,cAAc,OAAO,OAAA,cAAc;EACxC,SAAO,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { AvatarSlots } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/avatar/avatar.types.d.ts
|
|
6
|
+
export interface AvatarOwnProps {
|
|
7
|
+
/**
|
|
8
|
+
* The name represented by the avatar. It is used as the default image alternative text and to generate placeholder initials.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export type AvatarProps = HuiComponentProps<HuiElementProps<"img"> & AvatarOwnProps, AvatarSlots>;
|
|
13
|
+
export interface AvatarExposed {
|
|
14
|
+
readonly img: HuiElementInstance<"img"> | null;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=avatar.types.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { AvatarOwnProps } from "./avatar.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { AvatarSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/avatar/avatar.vue.d.ts
|
|
7
|
+
type Props = AvatarOwnProps & {
|
|
8
|
+
classes?: Partial<Record<AvatarSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<AvatarSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"img">, keyof AvatarOwnProps | "class" | "style">;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {
|
|
12
|
+
img: Readonly<import("vue").ShallowRef<HTMLImageElement | null>>;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { _default as default };
|
|
17
|
+
//# sourceMappingURL=avatar.vue.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
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, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, useAttrs, useSlots, useTemplateRef } from "vue";
|
|
4
|
+
import { blockquoteRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/blockquote/blockquote.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiBlockquote",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "blockquote",
|
|
10
|
+
props: {
|
|
11
|
+
color: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
captionProps: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
classes: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
styles: {
|
|
24
|
+
type: null,
|
|
25
|
+
required: false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(__props, { expose: __expose }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const slots = useSlots();
|
|
31
|
+
const attrs = useAttrs();
|
|
32
|
+
const resolvedProps = useHuiProps("Blockquote", props, attrs);
|
|
33
|
+
const recipe = computed(() => blockquoteRecipe({ color: resolvedProps.value.color }));
|
|
34
|
+
const cls = useHuiClasses("Blockquote", recipe, computed(() => props.classes ?? {}));
|
|
35
|
+
const sls = useHuiStyles("Blockquote", computed(() => props.styles ?? {}));
|
|
36
|
+
const quoteAttrs = useHuiAttrs(resolvedProps, [
|
|
37
|
+
"color",
|
|
38
|
+
"captionProps",
|
|
39
|
+
"classes",
|
|
40
|
+
"styles",
|
|
41
|
+
"class",
|
|
42
|
+
"style"
|
|
43
|
+
]);
|
|
44
|
+
const captionAttrs = computed(() => resolvedProps.value.captionProps ?? {});
|
|
45
|
+
const blockquoteRef = useTemplateRef("blockquote");
|
|
46
|
+
__expose({ blockquote: blockquoteRef });
|
|
47
|
+
const __returned__ = {
|
|
48
|
+
props,
|
|
49
|
+
slots,
|
|
50
|
+
attrs,
|
|
51
|
+
resolvedProps,
|
|
52
|
+
recipe,
|
|
53
|
+
cls,
|
|
54
|
+
sls,
|
|
55
|
+
quoteAttrs,
|
|
56
|
+
captionAttrs,
|
|
57
|
+
blockquoteRef
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
60
|
+
enumerable: false,
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
63
|
+
return __returned__;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
67
|
+
return openBlock(), createElementBlock("figure", {
|
|
68
|
+
class: normalizeClass($setup.cls.root),
|
|
69
|
+
style: normalizeStyle($setup.sls.root)
|
|
70
|
+
}, [createElementVNode("blockquote", mergeProps({ ref: "blockquote" }, $setup.quoteAttrs, {
|
|
71
|
+
class: $setup.cls.blockquote,
|
|
72
|
+
style: $setup.sls.blockquote
|
|
73
|
+
}), [renderSlot(_ctx.$slots, "default")], 16), $setup.slots.caption ? (openBlock(), createElementBlock("figcaption", mergeProps({ key: 0 }, $setup.captionAttrs, {
|
|
74
|
+
class: $setup.cls.caption,
|
|
75
|
+
style: $setup.sls.caption
|
|
76
|
+
}), [renderSlot(_ctx.$slots, "caption")], 16)) : createCommentVNode("v-if", true)], 6);
|
|
77
|
+
}
|
|
78
|
+
var blockquote_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/blockquote/blockquote.vue"]]);
|
|
79
|
+
//#endregion
|
|
80
|
+
export { blockquote_default as default };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=blockquote.js.map
|