@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,27 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { ButtonExposed, ButtonOwnProps } from "../button/button.types.js";
|
|
4
|
+
import "../button/index.js";
|
|
5
|
+
import { DrawerCloseOwnProps } from "./drawer.types.js";
|
|
6
|
+
import { ClassValue, StyleValue } from "vue";
|
|
7
|
+
//#region src/components/drawer/drawer-close.vue.d.ts
|
|
8
|
+
type Props = ButtonOwnProps & DrawerCloseOwnProps & {
|
|
9
|
+
class?: ClassValue | undefined;
|
|
10
|
+
style?: StyleValue | undefined;
|
|
11
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"button">, keyof ButtonOwnProps | keyof DrawerCloseOwnProps | "class" | "style">;
|
|
12
|
+
type __VLS_Slots = {
|
|
13
|
+
default?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
16
|
+
root: Readonly<import("vue").ShallowRef<ButtonExposed<"button"> | 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=drawer-close.vue.d.ts.map
|
|
@@ -0,0 +1,185 @@
|
|
|
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 { useDrawerId } from "./drawer.context.js";
|
|
4
|
+
import drawer_close_default from "./drawer-close.js";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, useAttrs, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
|
+
import { dialogControl, drawerRecipe, headingRecipe } from "@hebium-ui/core";
|
|
7
|
+
//#region src/components/drawer/drawer-content.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "HuiDrawerContent",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "drawer-content",
|
|
12
|
+
props: {
|
|
13
|
+
placement: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
headingProps: {
|
|
18
|
+
type: null,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
closeButton: {
|
|
22
|
+
type: [Boolean, null],
|
|
23
|
+
required: false,
|
|
24
|
+
skipCheck: true,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
closeButtonProps: {
|
|
28
|
+
type: null,
|
|
29
|
+
required: false
|
|
30
|
+
},
|
|
31
|
+
classes: {
|
|
32
|
+
type: null,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
styles: {
|
|
36
|
+
type: null,
|
|
37
|
+
required: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(__props, { expose: __expose }) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const slots = useSlots();
|
|
43
|
+
const HEADING_ELEMENTS = {
|
|
44
|
+
1: "h1",
|
|
45
|
+
2: "h2",
|
|
46
|
+
3: "h3",
|
|
47
|
+
4: "h4",
|
|
48
|
+
5: "h5",
|
|
49
|
+
6: "h6"
|
|
50
|
+
};
|
|
51
|
+
const HEADING_RECIPE_LEVELS = {
|
|
52
|
+
1: "1",
|
|
53
|
+
2: "2",
|
|
54
|
+
3: "3",
|
|
55
|
+
4: "4",
|
|
56
|
+
5: "5",
|
|
57
|
+
6: "6"
|
|
58
|
+
};
|
|
59
|
+
const attrs = useAttrs();
|
|
60
|
+
const resolvedProps = useHuiProps("DrawerContent", props, attrs);
|
|
61
|
+
const drawerId = useDrawerId();
|
|
62
|
+
const recipe = computed(() => drawerRecipe({ placement: resolvedProps.value.placement }));
|
|
63
|
+
const cls = useHuiClasses("DrawerContent", recipe, computed(() => props.classes ?? {}));
|
|
64
|
+
const sls = useHuiStyles("DrawerContent", computed(() => props.styles ?? {}));
|
|
65
|
+
const derivedHeadingAttrs = computed(() => dialogControl.getHeadingAttributes({ id: drawerId.value }));
|
|
66
|
+
const headingId = computed(() => slots.heading ? derivedHeadingAttrs.value.id : void 0);
|
|
67
|
+
const headingLevel = computed(() => resolvedProps.value.headingProps?.level ?? 2);
|
|
68
|
+
const headingComponent = computed(() => HEADING_ELEMENTS[headingLevel.value]);
|
|
69
|
+
const headingRecipeClass = computed(() => headingRecipe({
|
|
70
|
+
level: HEADING_RECIPE_LEVELS[headingLevel.value],
|
|
71
|
+
margin: resolvedProps.value.headingProps?.margin ?? "none"
|
|
72
|
+
}).root);
|
|
73
|
+
const headingAttrs = useHuiAttrs(computed(() => resolvedProps.value.headingProps ?? {}), [
|
|
74
|
+
"level",
|
|
75
|
+
"margin",
|
|
76
|
+
"id",
|
|
77
|
+
"class",
|
|
78
|
+
"style"
|
|
79
|
+
]);
|
|
80
|
+
const rootHeadingAttrs = computed(() => ({
|
|
81
|
+
...headingAttrs.value,
|
|
82
|
+
...derivedHeadingAttrs.value
|
|
83
|
+
}));
|
|
84
|
+
const shouldRenderCloseButton = computed(() => {
|
|
85
|
+
const closeButton = resolvedProps.value.closeButton;
|
|
86
|
+
return closeButton !== false && closeButton !== null;
|
|
87
|
+
});
|
|
88
|
+
const shouldRenderHeader = computed(() => headingId.value !== void 0 || shouldRenderCloseButton.value);
|
|
89
|
+
const closeButtonAttrs = computed(() => ({
|
|
90
|
+
"aria-label": "Close Drawer",
|
|
91
|
+
variant: "ghost",
|
|
92
|
+
color: "neutral",
|
|
93
|
+
shape: "square",
|
|
94
|
+
...resolvedProps.value.closeButtonProps
|
|
95
|
+
}));
|
|
96
|
+
const forwardedRootAttrs = useHuiAttrs(resolvedProps, [
|
|
97
|
+
"placement",
|
|
98
|
+
"classes",
|
|
99
|
+
"styles",
|
|
100
|
+
"headingProps",
|
|
101
|
+
"closeButton",
|
|
102
|
+
"closeButtonProps",
|
|
103
|
+
"class",
|
|
104
|
+
"style",
|
|
105
|
+
"aria-label",
|
|
106
|
+
"aria-labelledby"
|
|
107
|
+
]);
|
|
108
|
+
const rootAttrs = computed(() => {
|
|
109
|
+
const resolved = resolvedProps.value;
|
|
110
|
+
return {
|
|
111
|
+
...dialogControl.getContentAttributes({ id: drawerId.value }, {
|
|
112
|
+
hasHeading: slots.heading !== void 0,
|
|
113
|
+
ariaLabel: resolved["aria-label"],
|
|
114
|
+
ariaLabelledBy: resolved["aria-labelledby"]
|
|
115
|
+
}),
|
|
116
|
+
...forwardedRootAttrs.value
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
const rootRef = useTemplateRef("root");
|
|
120
|
+
__expose({ root: rootRef });
|
|
121
|
+
const __returned__ = {
|
|
122
|
+
props,
|
|
123
|
+
slots,
|
|
124
|
+
HEADING_ELEMENTS,
|
|
125
|
+
HEADING_RECIPE_LEVELS,
|
|
126
|
+
attrs,
|
|
127
|
+
resolvedProps,
|
|
128
|
+
drawerId,
|
|
129
|
+
recipe,
|
|
130
|
+
cls,
|
|
131
|
+
sls,
|
|
132
|
+
derivedHeadingAttrs,
|
|
133
|
+
headingId,
|
|
134
|
+
headingLevel,
|
|
135
|
+
headingComponent,
|
|
136
|
+
headingRecipeClass,
|
|
137
|
+
headingAttrs,
|
|
138
|
+
rootHeadingAttrs,
|
|
139
|
+
shouldRenderCloseButton,
|
|
140
|
+
shouldRenderHeader,
|
|
141
|
+
closeButtonAttrs,
|
|
142
|
+
forwardedRootAttrs,
|
|
143
|
+
rootAttrs,
|
|
144
|
+
rootRef,
|
|
145
|
+
DrawerClose: drawer_close_default
|
|
146
|
+
};
|
|
147
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
148
|
+
enumerable: false,
|
|
149
|
+
value: true
|
|
150
|
+
});
|
|
151
|
+
return __returned__;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
155
|
+
return openBlock(), createElementBlock("dialog", mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
156
|
+
class: $setup.cls.root,
|
|
157
|
+
style: $setup.sls.root
|
|
158
|
+
}), [$setup.shouldRenderHeader ? (openBlock(), createElementBlock("div", {
|
|
159
|
+
key: 0,
|
|
160
|
+
class: normalizeClass($setup.cls.header),
|
|
161
|
+
style: normalizeStyle($setup.sls.header)
|
|
162
|
+
}, [$setup.headingId ? (openBlock(), createBlock(resolveDynamicComponent($setup.headingComponent), mergeProps({ key: 0 }, $setup.rootHeadingAttrs, {
|
|
163
|
+
class: [$setup.headingRecipeClass, $setup.cls.heading],
|
|
164
|
+
style: $setup.sls.heading
|
|
165
|
+
}), {
|
|
166
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "heading")]),
|
|
167
|
+
_: 3
|
|
168
|
+
}, 16, ["class", "style"])) : createCommentVNode("v-if", true), $setup.shouldRenderCloseButton ? (openBlock(), createBlock($setup["DrawerClose"], mergeProps({ key: 1 }, $setup.closeButtonAttrs, {
|
|
169
|
+
class: $setup.cls.closeButton,
|
|
170
|
+
style: $setup.sls.closeButton
|
|
171
|
+
}), {
|
|
172
|
+
default: withCtx(() => [$setup.slots.closeButton ? renderSlot(_ctx.$slots, "closeButton", {}, void 0, void 0, 0) : (openBlock(), createElementBlock("span", {
|
|
173
|
+
key: 1,
|
|
174
|
+
"aria-hidden": "true",
|
|
175
|
+
class: normalizeClass($setup.cls.closeButtonIcon),
|
|
176
|
+
style: normalizeStyle($setup.sls.closeButtonIcon)
|
|
177
|
+
}, null, 6))]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 16, ["class", "style"])) : createCommentVNode("v-if", true)], 6)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 16);
|
|
180
|
+
}
|
|
181
|
+
var drawer_content_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/drawer/drawer-content.vue"]]);
|
|
182
|
+
//#endregion
|
|
183
|
+
export { drawer_content_default as default };
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=drawer-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-content.js","names":["_useSlots","_openBlock","_createElementBlock","_mergeProps","_normalizeClass","_normalizeStyle","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/drawer/drawer-content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n dialogControl,\n drawerRecipe,\n type DrawerSlots as DrawerRecipeSlots,\n headingRecipe,\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 DrawerClose from \"./drawer-close.vue\";\nimport { useDrawerId } from \"./drawer.context\";\nimport type { DrawerContentOwnProps } from \"./drawer.types\";\n\ndefineOptions({\n name: \"HuiDrawerContent\",\n inheritAttrs: false,\n});\n\ntype Props =\n & DrawerContentOwnProps\n & {\n classes?:\n | Partial<Record<DrawerRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<DrawerRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"dialog\">,\n | keyof DrawerContentOwnProps\n | \"id\"\n | \"open\"\n | \"class\"\n | \"style\"\n >;\n\nconst props = withDefaults(defineProps<Props>(), {\n closeButton: undefined,\n});\n\nconst slots = defineSlots<{\n default?: () => unknown;\n heading?: () => unknown;\n closeButton?: () => unknown;\n}>();\n\nconst HEADING_ELEMENTS = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\",\n} as const;\nconst HEADING_RECIPE_LEVELS = {\n 1: \"1\",\n 2: \"2\",\n 3: \"3\",\n 4: \"4\",\n 5: \"5\",\n 6: \"6\",\n} as const;\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"DrawerContent\", props, attrs);\nconst drawerId = useDrawerId();\nconst recipe = computed(() =>\n drawerRecipe({ placement: resolvedProps.value.placement })\n);\nconst cls = useHuiClasses(\n \"DrawerContent\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"DrawerContent\", DrawerRecipeSlots>(\n \"DrawerContent\",\n computed(() => props.styles ?? {}),\n);\nconst derivedHeadingAttrs = computed(() =>\n dialogControl.getHeadingAttributes({ id: drawerId.value })\n);\nconst headingId = computed(() =>\n slots.heading ? derivedHeadingAttrs.value.id : undefined\n);\nconst headingLevel = computed(() =>\n resolvedProps.value.headingProps?.level ?? 2\n);\nconst headingComponent = computed(() => HEADING_ELEMENTS[headingLevel.value]);\nconst headingRecipeClass = computed(() =>\n headingRecipe({\n level: HEADING_RECIPE_LEVELS[headingLevel.value],\n margin: resolvedProps.value.headingProps?.margin ?? \"none\",\n }).root\n);\nconst headingAttrs = useHuiAttrs(\n computed(() => resolvedProps.value.headingProps ?? {}),\n [\"level\", \"margin\", \"id\", \"class\", \"style\"],\n);\nconst rootHeadingAttrs = computed<Record<string, unknown>>(() => ({\n ...headingAttrs.value,\n ...derivedHeadingAttrs.value,\n}));\nconst shouldRenderCloseButton = computed(() => {\n const closeButton = resolvedProps.value.closeButton;\n return closeButton !== false && closeButton !== null;\n});\nconst shouldRenderHeader = computed(() =>\n headingId.value !== undefined || shouldRenderCloseButton.value\n);\nconst closeButtonAttrs = computed<Record<string, unknown>>(() => ({\n \"aria-label\": \"Close Drawer\",\n variant: \"ghost\",\n color: \"neutral\",\n shape: \"square\",\n ...resolvedProps.value.closeButtonProps,\n}));\nconst forwardedRootAttrs = useHuiAttrs(resolvedProps, [\n \"placement\",\n \"classes\",\n \"styles\",\n \"headingProps\",\n \"closeButton\",\n \"closeButtonProps\",\n \"class\",\n \"style\",\n \"aria-label\",\n \"aria-labelledby\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => {\n const resolved = resolvedProps.value;\n return {\n ...dialogControl.getContentAttributes(\n { id: drawerId.value },\n {\n hasHeading: slots.heading !== undefined,\n ariaLabel: resolved[\"aria-label\"],\n ariaLabelledBy: resolved[\"aria-labelledby\"],\n },\n ),\n ...forwardedRootAttrs.value,\n };\n});\nconst rootRef = useTemplateRef<HuiElementInstance<\"dialog\">>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <dialog\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <div v-if=\"shouldRenderHeader\" :class=\"cls.header\" :style=\"sls.header\">\n <component\n :is=\"headingComponent\"\n v-if=\"headingId\"\n v-bind=\"rootHeadingAttrs\"\n :class=\"[headingRecipeClass, cls.heading]\"\n :style=\"sls.heading\"\n >\n <slot name=\"heading\" />\n </component>\n <DrawerClose\n v-if=\"shouldRenderCloseButton\"\n v-bind=\"closeButtonAttrs\"\n :class=\"cls.closeButton\"\n :style=\"sls.closeButton\"\n >\n <slot v-if=\"slots.closeButton\" name=\"closeButton\" />\n <span\n v-else\n aria-hidden=\"true\"\n :class=\"cls.closeButtonIcon\"\n :style=\"sls.closeButtonIcon\"\n />\n </DrawerClose>\n </div>\n <slot />\n </dialog>\n</template>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { DrawerContentOwnProps } from "./drawer.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { DrawerSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/drawer/drawer-content.vue.d.ts
|
|
7
|
+
type Props = DrawerContentOwnProps & {
|
|
8
|
+
classes?: Partial<Record<DrawerSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<DrawerSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"dialog">, keyof DrawerContentOwnProps | "id" | "open" | "class" | "style">;
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
heading?: () => unknown;
|
|
14
|
+
closeButton?: () => unknown;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
17
|
+
root: Readonly<import("vue").ShallowRef<HTMLDialogElement | null>>;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
19
|
+
closeButton: boolean | null | undefined;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { _default as default };
|
|
30
|
+
//# sourceMappingURL=drawer-content.vue.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
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 button_default from "../button/button.js";
|
|
4
|
+
import { useDrawerId } from "./drawer.context.js";
|
|
5
|
+
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
6
|
+
import { dialogControl } from "@hebium-ui/core";
|
|
7
|
+
//#region src/components/drawer/drawer-trigger.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "HuiDrawerTrigger",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "drawer-trigger",
|
|
12
|
+
props: {
|
|
13
|
+
as: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
class: {
|
|
18
|
+
type: [
|
|
19
|
+
Boolean,
|
|
20
|
+
null,
|
|
21
|
+
String,
|
|
22
|
+
Object,
|
|
23
|
+
Array
|
|
24
|
+
],
|
|
25
|
+
required: false,
|
|
26
|
+
skipCheck: true
|
|
27
|
+
},
|
|
28
|
+
style: {
|
|
29
|
+
type: [
|
|
30
|
+
Boolean,
|
|
31
|
+
null,
|
|
32
|
+
String,
|
|
33
|
+
Object,
|
|
34
|
+
Array
|
|
35
|
+
],
|
|
36
|
+
required: false,
|
|
37
|
+
skipCheck: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(__props, { expose: __expose }) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const attrs = useAttrs();
|
|
43
|
+
const resolvedProps = useHuiProps("DrawerTrigger", props, attrs);
|
|
44
|
+
const component = computed(() => resolvedProps.value.as ?? button_default);
|
|
45
|
+
const drawerId = useDrawerId();
|
|
46
|
+
const cls = useHuiClasses("DrawerTrigger", computed(() => ({ root: "" })), computed(() => ({ root: props.class })));
|
|
47
|
+
const sls = useHuiStyles("DrawerTrigger", computed(() => ({ root: props.style })));
|
|
48
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
49
|
+
"as",
|
|
50
|
+
"class",
|
|
51
|
+
"style"
|
|
52
|
+
]);
|
|
53
|
+
const rootAttrs = computed(() => {
|
|
54
|
+
return {
|
|
55
|
+
...dialogControl.getTriggerAttributes({ id: drawerId.value }, {
|
|
56
|
+
modal: true,
|
|
57
|
+
isButtonElement: resolvedProps.value.as === void 0
|
|
58
|
+
}),
|
|
59
|
+
...forwardedAttrs.value
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const rootRef = useTemplateRef("root");
|
|
63
|
+
__expose({ root: rootRef });
|
|
64
|
+
const __returned__ = {
|
|
65
|
+
props,
|
|
66
|
+
attrs,
|
|
67
|
+
resolvedProps,
|
|
68
|
+
component,
|
|
69
|
+
drawerId,
|
|
70
|
+
cls,
|
|
71
|
+
sls,
|
|
72
|
+
forwardedAttrs,
|
|
73
|
+
rootAttrs,
|
|
74
|
+
rootRef
|
|
75
|
+
};
|
|
76
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
77
|
+
enumerable: false,
|
|
78
|
+
value: true
|
|
79
|
+
});
|
|
80
|
+
return __returned__;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
84
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
85
|
+
class: $setup.cls.root,
|
|
86
|
+
style: $setup.sls.root
|
|
87
|
+
}), {
|
|
88
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
89
|
+
_: 3
|
|
90
|
+
}, 16, ["class", "style"]);
|
|
91
|
+
}
|
|
92
|
+
var drawer_trigger_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/drawer/drawer-trigger.vue"]]);
|
|
93
|
+
//#endregion
|
|
94
|
+
export { drawer_trigger_default as default };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=drawer-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-trigger.js","names":["Button","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/drawer/drawer-trigger.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = typeof Button\"\n>\nimport { dialogControl } 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 {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { Button } from \"../button\";\nimport { useDrawerId } from \"./drawer.context\";\n\ndefineOptions({\n name: \"HuiDrawerTrigger\",\n inheritAttrs: false,\n});\n\ntype Props =\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"DrawerTrigger\", props, attrs);\nconst component = computed<E | typeof Button>(() =>\n resolvedProps.value.as ?? Button\n);\nconst drawerId = useDrawerId();\nconst cls = useHuiClasses<\"DrawerTrigger\", \"root\">(\n \"DrawerTrigger\",\n computed(() => ({ root: \"\" })),\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles<\"DrawerTrigger\", \"root\">(\n \"DrawerTrigger\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"class\",\n \"style\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => {\n return {\n ...dialogControl.getTriggerAttributes(\n { id: drawerId.value },\n {\n modal: true,\n isButtonElement: resolvedProps.value.as === undefined,\n },\n ),\n ...forwardedAttrs.value,\n };\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,iBAAiB,OAAO,KAAK;EAC/D,MAAM,YAAY,eAChB,cAAc,MAAM,MAAMA,cAC5B;EACA,MAAM,WAAW,YAAY;EAC7B,MAAM,MAAM,cACV,iBACA,gBAAgB,EAAE,MAAM,GAAG,EAAE,GAC7B,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,iBACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,eAAwC;GACxD,OAAO;IACL,GAAG,cAAc,qBACf,EAAE,IAAI,SAAS,MAAM,GACrB;KACE,OAAO;KACP,iBAAiB,cAAc,MAAM,OAAO,KAAA;IAC9C,CACF;IACA,GAAG,eAAe;GACpB;EACF,CAAC;EACD,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,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, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import _default$1 from "../button/button.vue.js";
|
|
4
|
+
import "../button/index.js";
|
|
5
|
+
import { ClassValue, StyleValue } from "vue";
|
|
6
|
+
//#region src/components/drawer/drawer-trigger.vue.d.ts
|
|
7
|
+
declare const __VLS_export: <E extends ElementType = typeof _default$1>(__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<{
|
|
9
|
+
as?: E | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
class?: ClassValue | undefined;
|
|
12
|
+
style?: StyleValue | undefined;
|
|
13
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "as" | "class">> & (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
|
+
};
|
|
23
|
+
emit: {};
|
|
24
|
+
}>) => import("vue").VNode & {
|
|
25
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
26
|
+
};
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { _default as default };
|
|
31
|
+
//# sourceMappingURL=drawer-trigger.vue.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
//#region src/components/drawer/drawer.context.ts
|
|
3
|
+
const DrawerContext = Symbol("Drawer");
|
|
4
|
+
function useDrawerContext() {
|
|
5
|
+
const context = inject(DrawerContext);
|
|
6
|
+
if (!context) throw new Error("[Hebium UI] Drawer compound components must be used within <Drawer>");
|
|
7
|
+
return context;
|
|
8
|
+
}
|
|
9
|
+
function useDrawerId() {
|
|
10
|
+
return useDrawerContext().drawerId;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { DrawerContext, useDrawerContext, useDrawerId };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=drawer.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.context.js","names":[],"sources":["../../../src/components/drawer/drawer.context.ts"],"sourcesContent":["import { type ComputedRef, inject, type InjectionKey } from \"vue\";\n\nexport interface DrawerContextValue {\n readonly drawerId: ComputedRef<string>;\n}\n\nexport const DrawerContext: InjectionKey<DrawerContextValue> = Symbol(\"Drawer\");\n\nexport function useDrawerContext(): DrawerContextValue {\n const context = inject(DrawerContext);\n if (!context) {\n throw new Error(\n \"[Hebium UI] Drawer compound components must be used within <Drawer>\",\n );\n }\n return context;\n}\n\nexport function useDrawerId(): ComputedRef<string> {\n return useDrawerContext().drawerId;\n}\n"],"mappings":";;AAMA,MAAa,gBAAkD,OAAO,QAAQ;AAE9E,SAAgB,mBAAuC;CACrD,MAAM,UAAU,OAAO,aAAa;CACpC,IAAI,CAAC,SACH,MAAM,IAAI,MACR,qEACF;CAEF,OAAO;AACT;AAEA,SAAgB,cAAmC;CACjD,OAAO,iBAAiB,CAAC,CAAC;AAC5B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useHuiProps } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { DrawerContext } from "./drawer.context.js";
|
|
4
|
+
import { computed, defineComponent, provide, renderSlot, useAttrs, useId } from "vue";
|
|
5
|
+
//#region src/components/drawer/drawer.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiDrawer",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "drawer",
|
|
10
|
+
props: { id: {
|
|
11
|
+
type: null,
|
|
12
|
+
required: false
|
|
13
|
+
} },
|
|
14
|
+
setup(__props, { expose: __expose }) {
|
|
15
|
+
__expose();
|
|
16
|
+
const props = __props;
|
|
17
|
+
const attrs = useAttrs();
|
|
18
|
+
const resolvedProps = useHuiProps("Drawer", props, attrs);
|
|
19
|
+
const generatedId = useId();
|
|
20
|
+
const drawerId = computed(() => resolvedProps.value.id || generatedId);
|
|
21
|
+
provide(DrawerContext, { drawerId });
|
|
22
|
+
const __returned__ = {
|
|
23
|
+
props,
|
|
24
|
+
attrs,
|
|
25
|
+
resolvedProps,
|
|
26
|
+
generatedId,
|
|
27
|
+
drawerId
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
30
|
+
enumerable: false,
|
|
31
|
+
value: true
|
|
32
|
+
});
|
|
33
|
+
return __returned__;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
37
|
+
return renderSlot(_ctx.$slots, "default");
|
|
38
|
+
}
|
|
39
|
+
var drawer_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/drawer/drawer.vue"]]);
|
|
40
|
+
//#endregion
|
|
41
|
+
export { drawer_default as default };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["_renderSlot"],"sources":["../../../src/components/drawer/drawer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, provide, useAttrs, useId } from \"vue\";\nimport { useHuiProps } from \"~/provider\";\nimport { DrawerContext } from \"./drawer.context\";\nimport type { DrawerProps } from \"./drawer.types\";\n\ndefineOptions({\n name: \"HuiDrawer\",\n inheritAttrs: false,\n});\n\nconst props = defineProps<DrawerProps>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Drawer\", props, attrs);\nconst generatedId = useId();\nconst drawerId = computed(() => resolvedProps.value.id || generatedId);\n\nprovide(DrawerContext, { drawerId });\n</script>\n\n<template>\n <slot />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,UAAU,OAAO,KAAK;EACxD,MAAM,cAAc,MAAM;EAC1B,MAAM,WAAW,eAAe,cAAc,MAAM,MAAM,WAAW;EAErE,QAAQ,eAAe,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;CAIjC,OAAAA,WAAQ,KAAA,QAAA,SAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
4
|
+
import "../../types/index.js";
|
|
5
|
+
import { ButtonExposed, ButtonProps } from "../button/button.types.js";
|
|
6
|
+
import _default from "../button/button.vue.js";
|
|
7
|
+
import "../button/index.js";
|
|
8
|
+
import { ButtonSlots, DrawerSlots, DrawerVariants, HeadingVariants } from "@hebium-ui/core";
|
|
9
|
+
//#region src/components/drawer/drawer.types.d.ts
|
|
10
|
+
export interface DrawerProps {
|
|
11
|
+
/**
|
|
12
|
+
* The id of the drawer content element.
|
|
13
|
+
*/
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export type DrawerTriggerProps<E extends ElementType = typeof _default> = HuiPolymorphicProps<E, object, ButtonSlots>;
|
|
17
|
+
export interface DrawerTriggerExposed<E extends ElementType = typeof _default> {
|
|
18
|
+
readonly root: HuiElementInstance<E> | null;
|
|
19
|
+
}
|
|
20
|
+
export interface DrawerHeadingOptions extends Omit<HuiElementProps<"h2">, "id" | "class" | "style"> {
|
|
21
|
+
/**
|
|
22
|
+
* The heading level used to choose the rendered heading element.
|
|
23
|
+
*
|
|
24
|
+
* @default 2
|
|
25
|
+
*/
|
|
26
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The block margin applied to the heading.
|
|
29
|
+
*
|
|
30
|
+
* @default "block"
|
|
31
|
+
*/
|
|
32
|
+
margin?: HeadingVariants["margin"] | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface DrawerContentOwnProps {
|
|
35
|
+
/**
|
|
36
|
+
* The edge from which the drawer enters.
|
|
37
|
+
*
|
|
38
|
+
* @default "inline-end"
|
|
39
|
+
*/
|
|
40
|
+
placement?: DrawerVariants["placement"] | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Additional props passed to the internal heading element.
|
|
43
|
+
*/
|
|
44
|
+
headingProps?: DrawerHeadingOptions | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the internal close button is rendered.
|
|
47
|
+
*
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
closeButton?: boolean | null | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Additional props passed to the internal close button.
|
|
53
|
+
*/
|
|
54
|
+
closeButtonProps?: Omit<DrawerCloseProps, "class" | "style"> | undefined;
|
|
55
|
+
}
|
|
56
|
+
export type DrawerContentProps = HuiComponentProps<Omit<HuiElementProps<"dialog">, "id" | "open"> & DrawerContentOwnProps, DrawerSlots>;
|
|
57
|
+
export interface DrawerContentExposed {
|
|
58
|
+
readonly root: HuiElementInstance<"dialog"> | null;
|
|
59
|
+
}
|
|
60
|
+
export interface DrawerCloseOwnProps {
|
|
61
|
+
/**
|
|
62
|
+
* The command used to close the drawer.
|
|
63
|
+
*
|
|
64
|
+
* @default "request-close"
|
|
65
|
+
*/
|
|
66
|
+
command?: "close" | "request-close" | undefined;
|
|
67
|
+
}
|
|
68
|
+
export type DrawerCloseProps = Omit<ButtonProps, "as" | "command"> & DrawerCloseOwnProps;
|
|
69
|
+
export interface DrawerCloseExposed {
|
|
70
|
+
readonly root: ButtonExposed | null;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//# sourceMappingURL=drawer.types.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DrawerProps } from "./drawer.types.js";
|
|
2
|
+
//#region src/components/drawer/drawer.vue.d.ts
|
|
3
|
+
type __VLS_Slots = {
|
|
4
|
+
default?: () => unknown;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DrawerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { _default as default };
|
|
16
|
+
//# sourceMappingURL=drawer.vue.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DrawerCloseExposed, DrawerCloseProps, DrawerContentExposed, DrawerContentProps, DrawerHeadingOptions, DrawerProps, DrawerTriggerExposed, DrawerTriggerProps } from "./drawer.types.js";
|
|
2
|
+
import _default from "./drawer-close.vue.js";
|
|
3
|
+
import _default$1 from "./drawer-content.vue.js";
|
|
4
|
+
import _default$2 from "./drawer-trigger.vue.js";
|
|
5
|
+
import { useDrawerId } from "./drawer.context.js";
|
|
6
|
+
import _default$3 from "./drawer.vue.js";
|
|
7
|
+
export { _default$3 as Drawer, _default as DrawerClose, type DrawerCloseExposed, type DrawerCloseProps, _default$1 as DrawerContent, type DrawerContentExposed, type DrawerContentProps, type DrawerHeadingOptions, type DrawerProps, _default$2 as DrawerTrigger, type DrawerTriggerExposed, type DrawerTriggerProps, useDrawerId };
|
|
@@ -0,0 +1,71 @@
|
|
|
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, openBlock, renderSlot, useAttrs, useTemplateRef } from "vue";
|
|
4
|
+
import { fieldsetRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/fieldset/fieldset.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiFieldset",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "fieldset",
|
|
10
|
+
props: {
|
|
11
|
+
class: {
|
|
12
|
+
type: [
|
|
13
|
+
Boolean,
|
|
14
|
+
null,
|
|
15
|
+
String,
|
|
16
|
+
Object,
|
|
17
|
+
Array
|
|
18
|
+
],
|
|
19
|
+
required: false,
|
|
20
|
+
skipCheck: true
|
|
21
|
+
},
|
|
22
|
+
style: {
|
|
23
|
+
type: [
|
|
24
|
+
Boolean,
|
|
25
|
+
null,
|
|
26
|
+
String,
|
|
27
|
+
Object,
|
|
28
|
+
Array
|
|
29
|
+
],
|
|
30
|
+
required: false,
|
|
31
|
+
skipCheck: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setup(__props, { expose: __expose }) {
|
|
35
|
+
const props = __props;
|
|
36
|
+
const attrs = useAttrs();
|
|
37
|
+
const resolvedProps = useHuiProps("Fieldset", props, attrs);
|
|
38
|
+
const recipe = computed(() => fieldsetRecipe({}));
|
|
39
|
+
const cls = useHuiClasses("Fieldset", recipe, computed(() => ({ root: props.class })));
|
|
40
|
+
const sls = useHuiStyles("Fieldset", computed(() => ({ root: props.style })));
|
|
41
|
+
const rootAttrs = useHuiAttrs(resolvedProps, ["class", "style"]);
|
|
42
|
+
const rootRef = useTemplateRef("root");
|
|
43
|
+
__expose({ root: rootRef });
|
|
44
|
+
const __returned__ = {
|
|
45
|
+
props,
|
|
46
|
+
attrs,
|
|
47
|
+
resolvedProps,
|
|
48
|
+
recipe,
|
|
49
|
+
cls,
|
|
50
|
+
sls,
|
|
51
|
+
rootAttrs,
|
|
52
|
+
rootRef
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
55
|
+
enumerable: false,
|
|
56
|
+
value: true
|
|
57
|
+
});
|
|
58
|
+
return __returned__;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
62
|
+
return openBlock(), createElementBlock("fieldset", mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
63
|
+
class: $setup.cls.root,
|
|
64
|
+
style: $setup.sls.root
|
|
65
|
+
}), [renderSlot(_ctx.$slots, "default")], 16);
|
|
66
|
+
}
|
|
67
|
+
var fieldset_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/fieldset/fieldset.vue"]]);
|
|
68
|
+
//#endregion
|
|
69
|
+
export { fieldset_default as default };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=fieldset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.js","names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot"],"sources":["../../../src/components/fieldset/fieldset.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { fieldsetRecipe } 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\";\n\ndefineOptions({\n name: \"HuiFieldset\",\n inheritAttrs: false,\n});\n\ntype Props =\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"fieldset\">,\n \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Fieldset\", props, attrs);\nconst recipe = computed(() => fieldsetRecipe({}));\nconst cls = useHuiClasses(\n \"Fieldset\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Fieldset\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\"class\", \"style\"]);\nconst rootRef = useTemplateRef<HuiElementInstance<\"fieldset\">>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <fieldset\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <slot />\n </fieldset>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,YAAY,OAAO,KAAK;EAC1D,MAAM,SAAS,eAAe,eAAe,CAAC,CAAC,CAAC;EAChD,MAAM,MAAM,cACV,YACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,YACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe,CAAC,SAAS,OAAO,CAAC;EAC/D,MAAM,UAAU,eAA+C,MAAM;EAErE,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,mBAOW,YAPXC,WAOW,EANT,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA"}
|