@hebium-ui/vue 0.0.0-stage → 0.1.0-alpha.0
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 @@
|
|
|
1
|
+
{"version":3,"file":"blockquote.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_mergeProps","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/blockquote/blockquote.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n blockquoteRecipe,\n type BlockquoteSlots as BlockquoteRecipeSlots,\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 { BlockquoteOwnProps } from \"./blockquote.types\";\n\ndefineOptions({\n name: \"HuiBlockquote\",\n inheritAttrs: false,\n});\n\ntype Props =\n & BlockquoteOwnProps\n & {\n classes?:\n | Partial<Record<BlockquoteRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<BlockquoteRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"blockquote\">,\n keyof BlockquoteOwnProps | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n caption?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Blockquote\", props, attrs);\nconst recipe = computed(() =>\n blockquoteRecipe({ color: resolvedProps.value.color })\n);\nconst cls = useHuiClasses(\n \"Blockquote\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Blockquote\", BlockquoteRecipeSlots>(\n \"Blockquote\",\n computed(() => props.styles ?? {}),\n);\nconst quoteAttrs = useHuiAttrs(resolvedProps, [\n \"color\",\n \"captionProps\",\n \"classes\",\n \"styles\",\n \"class\",\n \"style\",\n]);\nconst captionAttrs = computed(() => resolvedProps.value.captionProps ?? {});\nconst blockquoteRef = useTemplateRef<HuiElementInstance<\"blockquote\">>(\n \"blockquote\",\n);\n\ndefineExpose({\n blockquote: blockquoteRef,\n});\n</script>\n\n<template>\n <figure :class=\"cls.root\" :style=\"sls.root\">\n <blockquote\n ref=\"blockquote\"\n v-bind=\"quoteAttrs\"\n :class=\"cls.blockquote\"\n :style=\"sls.blockquote\"\n >\n <slot />\n </blockquote>\n <figcaption\n v-if=\"slots.caption\"\n v-bind=\"captionAttrs\"\n :class=\"cls.caption\"\n :style=\"sls.caption\"\n >\n <slot name=\"caption\" />\n </figcaption>\n </figure>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAKd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,cAAc,OAAO,KAAK;EAC5D,MAAM,SAAS,eACb,iBAAiB,EAAE,OAAO,cAAc,MAAM,MAAM,CAAC,CACvD;EACA,MAAM,MAAM,cACV,cACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,cACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,aAAa,YAAY,eAAe;GAC5C;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,eAAe,eAAe,cAAc,MAAM,gBAAgB,CAAC,CAAC;EAC1E,MAAM,gBAAgB,eACpB,YACF;EAEA,SAAa,EACX,YAAY,cACd,CAAC;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,UAAA,GAAAC,mBAiBS,UAAA;EAjBA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;CACxC,GAAA,CAAAC,mBAOa,cAPbC,WAOa,EANX,KAAI,aAAY,GACR,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAGF,GAAA,OAAA,MAAM,WADdN,UAAA,GAAAC,mBAOa,cAPbI,WAOa,EAAA,KAAA,EAAA,GALH,OAAA,cAAY;EACnB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,WAAuB,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,QAAA,IAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { BlockquoteSlots, BlockquoteVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/blockquote/blockquote.types.d.ts
|
|
6
|
+
type HtmlFigcaptionProps = Omit<HuiElementProps<"figcaption">, "class" | "style">;
|
|
7
|
+
export interface BlockquoteOwnProps {
|
|
8
|
+
/**
|
|
9
|
+
* The semantic color of the blockquote accent.
|
|
10
|
+
*
|
|
11
|
+
* @default "neutral"
|
|
12
|
+
*/
|
|
13
|
+
color?: BlockquoteVariants["color"] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Additional props passed to the caption element.
|
|
16
|
+
*/
|
|
17
|
+
captionProps?: HtmlFigcaptionProps | undefined;
|
|
18
|
+
}
|
|
19
|
+
export type BlockquoteProps = HuiComponentProps<Omit<HuiElementProps<"blockquote">, "color"> & BlockquoteOwnProps, BlockquoteSlots>;
|
|
20
|
+
export interface BlockquoteExposed {
|
|
21
|
+
readonly blockquote: HuiElementInstance<"blockquote"> | null;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=blockquote.types.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { BlockquoteOwnProps } from "./blockquote.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { BlockquoteSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/blockquote/blockquote.vue.d.ts
|
|
7
|
+
type Props = BlockquoteOwnProps & {
|
|
8
|
+
classes?: Partial<Record<BlockquoteSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<BlockquoteSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"blockquote">, keyof BlockquoteOwnProps | "class" | "style">;
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
caption?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
16
|
+
blockquote: Readonly<import("vue").ShallowRef<HTMLQuoteElement | 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=blockquote.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, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { buttonRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/button/button.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiButton",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "button",
|
|
10
|
+
props: {
|
|
11
|
+
variant: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
shape: {
|
|
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("Button", props, attrs);
|
|
54
|
+
const component = computed(() => resolvedProps.value.as ?? "button");
|
|
55
|
+
const recipe = computed(() => {
|
|
56
|
+
const resolved = resolvedProps.value;
|
|
57
|
+
return buttonRecipe({
|
|
58
|
+
variant: resolved.variant,
|
|
59
|
+
color: resolved.color,
|
|
60
|
+
shape: resolved.shape
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
const cls = useHuiClasses("Button", recipe, computed(() => ({ root: props.class })));
|
|
64
|
+
const sls = useHuiStyles("Button", computed(() => ({ root: props.style })));
|
|
65
|
+
const rootAttrs = useHuiAttrs(resolvedProps, [
|
|
66
|
+
"as",
|
|
67
|
+
"variant",
|
|
68
|
+
"color",
|
|
69
|
+
"shape",
|
|
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 button_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/Users/dawn/Desktop/dev/hebium-ui/packages/vue/src/components/button/button.vue"]]);
|
|
103
|
+
//#endregion
|
|
104
|
+
export { button_default as default };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/button/button.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'button'\"\n>\nimport { buttonRecipe } 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 type { ButtonOwnProps } from \"./button.types\";\n\ndefineOptions({\n name: \"HuiButton\",\n inheritAttrs: false,\n});\n\ntype Props =\n & ButtonOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof ButtonOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Button\", props, attrs);\nconst component = computed<E | \"button\">(() =>\n resolvedProps.value.as ?? \"button\"\n);\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n return buttonRecipe({\n variant: resolved.variant,\n color: resolved.color,\n shape: resolved.shape,\n });\n});\nconst cls = useHuiClasses(\n \"Button\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Button\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"variant\",\n \"color\",\n \"shape\",\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,UAAU,OAAO,KAAK;EACxD,MAAM,YAAY,eAChB,cAAc,MAAM,MAAM,QAC5B;EACA,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAC/B,OAAO,aAAa;IAClB,SAAS,SAAS;IAClB,OAAO,SAAS;IAChB,OAAO,SAAS;GAClB,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 { ButtonSlots, ButtonVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/button/button.types.d.ts
|
|
6
|
+
export interface ButtonOwnProps {
|
|
7
|
+
/**
|
|
8
|
+
* The visual style of the button.
|
|
9
|
+
*
|
|
10
|
+
* @default "solid"
|
|
11
|
+
*/
|
|
12
|
+
variant?: ButtonVariants["variant"] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The semantic color of the button.
|
|
15
|
+
*
|
|
16
|
+
* @default "accent"
|
|
17
|
+
*/
|
|
18
|
+
color?: ButtonVariants["color"] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* The shape of the button.
|
|
21
|
+
*
|
|
22
|
+
* @default "rectangle"
|
|
23
|
+
*/
|
|
24
|
+
shape?: ButtonVariants["shape"] | undefined;
|
|
25
|
+
}
|
|
26
|
+
export type ButtonProps<E extends ElementType = "button"> = HuiPolymorphicProps<E, ButtonOwnProps, ButtonSlots>;
|
|
27
|
+
export interface ButtonExposed<E extends ElementType = "button"> {
|
|
28
|
+
readonly root: HuiElementInstance<E> | null;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=button.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { ButtonOwnProps } from "./button.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
//#region src/components/button/button.vue.d.ts
|
|
6
|
+
declare const __VLS_export: <E extends ElementType = "button">(__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<ButtonOwnProps & {
|
|
8
|
+
as?: E | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
class?: ClassValue | undefined;
|
|
11
|
+
style?: StyleValue | undefined;
|
|
12
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "class" | "as" | keyof ButtonOwnProps>> & (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=button.vue.d.ts.map
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { attrToBool } from "../../utils/attr-to-bool.js";
|
|
4
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, useAttrs, useId, useSlots, useTemplateRef, watchEffect } from "vue";
|
|
5
|
+
import { checkboxControl, checkboxRecipe, toStrbool } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/checkbox/checkbox.vue
|
|
7
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
|
+
name: "HuiCheckbox",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
__name: "checkbox",
|
|
11
|
+
props: {
|
|
12
|
+
color: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
indeterminate: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: false,
|
|
19
|
+
skipCheck: true,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
classes: {
|
|
23
|
+
type: null,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
styles: {
|
|
27
|
+
type: null,
|
|
28
|
+
required: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(__props, { expose: __expose }) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
const slots = useSlots();
|
|
34
|
+
const attrs = useAttrs();
|
|
35
|
+
const resolvedProps = useHuiProps("Checkbox", props, attrs);
|
|
36
|
+
const hasError = computed(() => Boolean(slots.error));
|
|
37
|
+
const generatedId = useId();
|
|
38
|
+
const checkboxState = computed(() => ({
|
|
39
|
+
id: resolvedProps.value.id ?? generatedId,
|
|
40
|
+
invalid: hasError.value,
|
|
41
|
+
indeterminate: Boolean(resolvedProps.value.indeterminate),
|
|
42
|
+
disabled: attrToBool(resolvedProps.value.disabled) || attrToBool(resolvedProps.value["aria-disabled"])
|
|
43
|
+
}));
|
|
44
|
+
const recipe = computed(() => {
|
|
45
|
+
const resolved = resolvedProps.value;
|
|
46
|
+
return checkboxRecipe({
|
|
47
|
+
color: resolved.color,
|
|
48
|
+
icon: resolved.indeterminate ? "indeterminate" : "check",
|
|
49
|
+
error: toStrbool(checkboxState.value.invalid)
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const cls = useHuiClasses("Checkbox", recipe, computed(() => props.classes ?? {}));
|
|
53
|
+
const sls = useHuiStyles("Checkbox", computed(() => props.styles ?? {}));
|
|
54
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
55
|
+
"id",
|
|
56
|
+
"color",
|
|
57
|
+
"indeterminate",
|
|
58
|
+
"classes",
|
|
59
|
+
"styles",
|
|
60
|
+
"class",
|
|
61
|
+
"style"
|
|
62
|
+
]);
|
|
63
|
+
const inputAttrs = computed(() => ({
|
|
64
|
+
...checkboxControl.getControlAttributes(checkboxState.value),
|
|
65
|
+
...forwardedAttrs.value
|
|
66
|
+
}));
|
|
67
|
+
const labelAttrs = computed(() => checkboxControl.getLabelAttributes(checkboxState.value));
|
|
68
|
+
const errorAttrs = computed(() => checkboxControl.getErrorAttributes(checkboxState.value));
|
|
69
|
+
const inputRef = useTemplateRef("input");
|
|
70
|
+
watchEffect(() => {
|
|
71
|
+
if (inputRef.value) inputRef.value.indeterminate = Boolean(resolvedProps.value.indeterminate);
|
|
72
|
+
});
|
|
73
|
+
__expose({ input: inputRef });
|
|
74
|
+
const __returned__ = {
|
|
75
|
+
props,
|
|
76
|
+
slots,
|
|
77
|
+
attrs,
|
|
78
|
+
resolvedProps,
|
|
79
|
+
hasError,
|
|
80
|
+
generatedId,
|
|
81
|
+
checkboxState,
|
|
82
|
+
recipe,
|
|
83
|
+
cls,
|
|
84
|
+
sls,
|
|
85
|
+
forwardedAttrs,
|
|
86
|
+
inputAttrs,
|
|
87
|
+
labelAttrs,
|
|
88
|
+
errorAttrs,
|
|
89
|
+
inputRef
|
|
90
|
+
};
|
|
91
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
92
|
+
enumerable: false,
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
95
|
+
return __returned__;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
99
|
+
return openBlock(), createElementBlock("div", {
|
|
100
|
+
class: normalizeClass($setup.cls.root),
|
|
101
|
+
style: normalizeStyle($setup.sls.root)
|
|
102
|
+
}, [createElementVNode("input", mergeProps({ ref: "input" }, $setup.inputAttrs, {
|
|
103
|
+
class: $setup.cls.checkbox,
|
|
104
|
+
style: $setup.sls.checkbox
|
|
105
|
+
}), null, 16), createElementVNode("div", null, [$setup.slots.label ? (openBlock(), createElementBlock("label", mergeProps({ key: 0 }, $setup.labelAttrs, {
|
|
106
|
+
class: $setup.cls.label,
|
|
107
|
+
style: $setup.sls.label
|
|
108
|
+
}), [renderSlot(_ctx.$slots, "label")], 16)) : createCommentVNode("v-if", true), $setup.slots.error ? (openBlock(), createElementBlock("p", mergeProps({ key: 1 }, $setup.errorAttrs, {
|
|
109
|
+
class: $setup.cls.error,
|
|
110
|
+
style: $setup.sls.error
|
|
111
|
+
}), [createElementVNode("span", {
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
class: normalizeClass($setup.cls.errorIcon),
|
|
114
|
+
style: normalizeStyle($setup.sls.errorIcon)
|
|
115
|
+
}, null, 6), createElementVNode("span", {
|
|
116
|
+
class: normalizeClass($setup.cls.errorMessage),
|
|
117
|
+
style: normalizeStyle($setup.sls.errorMessage)
|
|
118
|
+
}, [renderSlot(_ctx.$slots, "error")], 6)], 16)) : createCommentVNode("v-if", true)])], 6);
|
|
119
|
+
}
|
|
120
|
+
var checkbox_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/Users/dawn/Desktop/dev/hebium-ui/packages/vue/src/components/checkbox/checkbox.vue"]]);
|
|
121
|
+
//#endregion
|
|
122
|
+
export { checkbox_default as default };
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["_useSlots","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createElementVNode","_mergeProps","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/checkbox/checkbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n checkboxControl,\n checkboxRecipe,\n type CheckboxSlots as CheckboxRecipeSlots,\n toStrbool,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useId,\n useTemplateRef,\n watchEffect,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport { attrToBool } from \"~/utils\";\nimport type { CheckboxOwnProps } from \"./checkbox.types\";\n\ndefineOptions({\n name: \"HuiCheckbox\",\n inheritAttrs: false,\n});\n\ntype Props =\n & CheckboxOwnProps\n & {\n classes?:\n | Partial<Record<CheckboxRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<CheckboxRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"input\">,\n keyof CheckboxOwnProps | \"children\" | \"type\" | \"class\" | \"style\"\n >;\n\nconst props = withDefaults(defineProps<Props>(), {\n indeterminate: undefined,\n});\n\nconst slots = defineSlots<{\n label?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Checkbox\", props, attrs);\nconst hasError = computed(() => Boolean(slots.error));\nconst generatedId = useId();\nconst checkboxState = computed(() => ({\n id: resolvedProps.value.id ?? generatedId,\n invalid: hasError.value,\n indeterminate: Boolean(resolvedProps.value.indeterminate),\n disabled: attrToBool(resolvedProps.value.disabled)\n || attrToBool(resolvedProps.value[\"aria-disabled\"]),\n}));\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n\n return checkboxRecipe({\n color: resolved.color,\n icon: resolved.indeterminate ? \"indeterminate\" : \"check\",\n error: toStrbool(checkboxState.value.invalid),\n });\n});\nconst cls = useHuiClasses(\n \"Checkbox\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Checkbox\", CheckboxRecipeSlots>(\n \"Checkbox\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"id\",\n \"color\",\n \"indeterminate\",\n \"classes\",\n \"styles\",\n \"class\",\n \"style\",\n]);\nconst inputAttrs = computed<Record<string, unknown>>(() => ({\n ...checkboxControl.getControlAttributes(checkboxState.value),\n ...forwardedAttrs.value,\n}));\nconst labelAttrs = computed(() =>\n checkboxControl.getLabelAttributes(checkboxState.value)\n);\nconst errorAttrs = computed(() =>\n checkboxControl.getErrorAttributes(checkboxState.value)\n);\nconst inputRef = useTemplateRef<HuiElementInstance<\"input\">>(\"input\");\n\nwatchEffect(() => {\n if (inputRef.value) {\n inputRef.value.indeterminate = Boolean(\n resolvedProps.value.indeterminate,\n );\n }\n});\n\ndefineExpose({\n input: inputRef,\n});\n</script>\n\n<template>\n <div :class=\"cls.root\" :style=\"sls.root\">\n <input\n ref=\"input\"\n v-bind=\"inputAttrs\"\n :class=\"cls.checkbox\"\n :style=\"sls.checkbox\"\n />\n <div>\n <label\n v-if=\"slots.label\"\n v-bind=\"labelAttrs\"\n :class=\"cls.label\"\n :style=\"sls.label\"\n >\n <slot name=\"label\" />\n </label>\n <p\n v-if=\"slots.error\"\n v-bind=\"errorAttrs\"\n :class=\"cls.error\"\n :style=\"sls.error\"\n >\n <span\n aria-hidden=\"true\"\n :class=\"cls.errorIcon\"\n :style=\"sls.errorIcon\"\n />\n <span :class=\"cls.errorMessage\" :style=\"sls.errorMessage\">\n <slot name=\"error\" />\n </span>\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CA,MAAM,QAAQ;EAId,MAAM,QAAQA,SAAA;EAKd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,YAAY,OAAO,KAAK;EAC1D,MAAM,WAAW,eAAe,QAAQ,MAAM,KAAK,CAAC;EACpD,MAAM,cAAc,MAAM;EAC1B,MAAM,gBAAgB,gBAAgB;GACpC,IAAI,cAAc,MAAM,MAAM;GAC9B,SAAS,SAAS;GAClB,eAAe,QAAQ,cAAc,MAAM,aAAa;GACxD,UAAU,WAAW,cAAc,MAAM,QAAQ,KAC5C,WAAW,cAAc,MAAM,gBAAgB;EACtD,EAAE;EACF,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAE/B,OAAO,eAAe;IACpB,OAAO,SAAS;IAChB,MAAM,SAAS,gBAAgB,kBAAkB;IACjD,OAAO,UAAU,cAAc,MAAM,OAAO;GAC9C,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,YACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,YACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,aAAa,gBAAyC;GAC1D,GAAG,gBAAgB,qBAAqB,cAAc,KAAK;GAC3D,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,eACjB,gBAAgB,mBAAmB,cAAc,KAAK,CACxD;EACA,MAAM,aAAa,eACjB,gBAAgB,mBAAmB,cAAc,KAAK,CACxD;EACA,MAAM,WAAW,eAA4C,OAAO;EAEpE,kBAAkB;GAChB,IAAI,SAAS,OACX,SAAS,MAAM,gBAAgB,QAC7B,cAAc,MAAM,aACtB;EAEJ,CAAC;EAED,SAAa,EACX,OAAO,SACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,UAAA,GAAAC,mBAgCM,OAAA;EAhCA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;CACrC,GAAA,CAAAC,mBAKE,SALFC,WAKE,EAJA,KAAI,QAAO,GACH,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEd,CAAA,GAAA,MAAA,EAAA,GAAAD,mBAwBM,OAAA,MAAA,CAtBI,OAAA,MAAM,SADdJ,UAAA,GAAAC,mBAOQ,SAPRI,WAOQ,EAAA,KAAA,EAAA,GALE,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAC,WAAqB,KAAA,QAAA,OAAA,CAAA,GAAA,EAGf,KAAAC,mBAAA,QAAA,IAAA,GAAA,OAAA,MAAM,SADdP,UAAA,GAAAC,mBAcI,KAdJI,WAcI,EAAA,KAAA,EAAA,GAZM,OAAA,YAAU;EACjB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;CAEZ,CAAA,GAAA,CAAAD,mBAIE,QAAA;EAHA,eAAY;EACX,OAAKF,eAAE,OAAA,IAAI,SAAS;EACpB,OAAKC,eAAE,OAAA,IAAI,SAAS;CAEvB,GAAA,MAAA,CAAA,GAAAC,mBAEO,QAAA;EAFA,OAAKF,eAAE,OAAA,IAAI,YAAY;EAAG,OAAKC,eAAE,OAAA,IAAI,YAAY;CACtD,GAAA,CAAAG,WAAqB,KAAA,QAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,QAAA,IAAA,CAAA,CAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HuiElementInstance, HuiElementProps } from "../../types/element.js";
|
|
2
|
+
import { HuiComponentProps } from "../../types/hui-component.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { CheckboxSlots, CheckboxVariants } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/checkbox/checkbox.types.d.ts
|
|
6
|
+
type HtmlInputProps = Omit<HuiElementProps<"input">, "children" | "color" | "type">;
|
|
7
|
+
export interface CheckboxOwnProps {
|
|
8
|
+
/**
|
|
9
|
+
* The semantic color of the checkbox control.
|
|
10
|
+
*
|
|
11
|
+
* @default "accent"
|
|
12
|
+
*/
|
|
13
|
+
color?: CheckboxVariants["color"] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the checkbox is displayed in an indeterminate state.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
indeterminate?: boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
export type CheckboxProps = HuiComponentProps<HtmlInputProps & CheckboxOwnProps, CheckboxSlots>;
|
|
22
|
+
export interface CheckboxExposed {
|
|
23
|
+
readonly input: HuiElementInstance<"input"> | null;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=checkbox.types.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { CheckboxOwnProps } from "./checkbox.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
import { CheckboxSlots } from "@hebium-ui/core";
|
|
6
|
+
//#region src/components/checkbox/checkbox.vue.d.ts
|
|
7
|
+
type Props = CheckboxOwnProps & {
|
|
8
|
+
classes?: Partial<Record<CheckboxSlots, ClassValue | undefined>> | undefined;
|
|
9
|
+
styles?: Partial<Record<CheckboxSlots, StyleValue | undefined>> | undefined;
|
|
10
|
+
} & /* @vue-ignore */ Omit<HuiElementPropsNoInfer<"input">, keyof CheckboxOwnProps | "children" | "type" | "class" | "style">;
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
label?: () => unknown;
|
|
13
|
+
error?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
16
|
+
input: Readonly<import("vue").ShallowRef<HTMLInputElement | null>>;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
indeterminate: boolean | undefined;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { _default as default };
|
|
29
|
+
//# sourceMappingURL=checkbox.vue.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { codeRecipe } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/code/code.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiCode",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "code",
|
|
10
|
+
props: {
|
|
11
|
+
as: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
class: {
|
|
16
|
+
type: [
|
|
17
|
+
Boolean,
|
|
18
|
+
null,
|
|
19
|
+
String,
|
|
20
|
+
Object,
|
|
21
|
+
Array
|
|
22
|
+
],
|
|
23
|
+
required: false,
|
|
24
|
+
skipCheck: true
|
|
25
|
+
},
|
|
26
|
+
style: {
|
|
27
|
+
type: [
|
|
28
|
+
Boolean,
|
|
29
|
+
null,
|
|
30
|
+
String,
|
|
31
|
+
Object,
|
|
32
|
+
Array
|
|
33
|
+
],
|
|
34
|
+
required: false,
|
|
35
|
+
skipCheck: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(__props, { expose: __expose }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const attrs = useAttrs();
|
|
41
|
+
const resolvedProps = useHuiProps("Code", props, attrs);
|
|
42
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "code"));
|
|
43
|
+
const recipe = computed(() => codeRecipe());
|
|
44
|
+
const cls = useHuiClasses("Code", recipe, computed(() => ({ root: props.class })));
|
|
45
|
+
const sls = useHuiStyles("Code", computed(() => ({ root: props.style })));
|
|
46
|
+
const rootAttrs = useHuiAttrs(resolvedProps, [
|
|
47
|
+
"as",
|
|
48
|
+
"class",
|
|
49
|
+
"style"
|
|
50
|
+
]);
|
|
51
|
+
const rootRef = useTemplateRef("root");
|
|
52
|
+
__expose({ root: rootRef });
|
|
53
|
+
const __returned__ = {
|
|
54
|
+
props,
|
|
55
|
+
attrs,
|
|
56
|
+
resolvedProps,
|
|
57
|
+
component,
|
|
58
|
+
recipe,
|
|
59
|
+
cls,
|
|
60
|
+
sls,
|
|
61
|
+
rootAttrs,
|
|
62
|
+
rootRef
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
65
|
+
enumerable: false,
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
68
|
+
return __returned__;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
72
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
73
|
+
class: $setup.cls.root,
|
|
74
|
+
style: $setup.sls.root
|
|
75
|
+
}), {
|
|
76
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 16, ["class", "style"]);
|
|
79
|
+
}
|
|
80
|
+
var code_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/Users/dawn/Desktop/dev/hebium-ui/packages/vue/src/components/code/code.vue"]]);
|
|
81
|
+
//#endregion
|
|
82
|
+
export { code_default as default };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/code/code.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'code'\"\n>\nimport { codeRecipe } 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 { CodeOwnProps } from \"./code.types\";\n\ndefineOptions({\n name: \"HuiCode\",\n inheritAttrs: false,\n});\n\ntype Props =\n & CodeOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof CodeOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Code\", props, attrs);\nconst component = computed<E | \"code\">(() =>\n toRaw(resolvedProps.value.as ?? \"code\")\n);\nconst recipe = computed(() => codeRecipe());\nconst cls = useHuiClasses(\n \"Code\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Code\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\"as\", \"class\", \"style\"]);\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,QAAQ,OAAO,KAAK;EACtD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,MAAM,CACxC;EACA,MAAM,SAAS,eAAe,WAAW,CAAC;EAC1C,MAAM,MAAM,cACV,QACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe;GAAC;GAAM;GAAS;EAAO,CAAC;EACrE,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,12 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { CodeSlots } from "@hebium-ui/core";
|
|
5
|
+
//#region src/components/code/code.types.d.ts
|
|
6
|
+
export interface CodeOwnProps {}
|
|
7
|
+
export type CodeProps<E extends ElementType = "code"> = HuiPolymorphicProps<E, CodeOwnProps, CodeSlots>;
|
|
8
|
+
export interface CodeExposed<E extends ElementType = "code"> {
|
|
9
|
+
readonly root: HuiElementInstance<E> | null;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=code.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { CodeOwnProps } from "./code.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
//#region src/components/code/code.vue.d.ts
|
|
6
|
+
declare const __VLS_export: <E extends ElementType = "code">(__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<CodeOwnProps & {
|
|
8
|
+
as?: E | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
class?: ClassValue | undefined;
|
|
11
|
+
style?: StyleValue | undefined;
|
|
12
|
+
} & Omit<HuiElementPropsNoInfer<E>, "style" | "class" | "as">> & (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=code.vue.d.ts.map
|