@ac-design/design-system 0.0.0-stage → 1.0.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/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +375 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, inject as o, normalizeClass as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d, useId as f } from "vue";
|
|
2
|
+
//#region src/lib/components/AcFormSection.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var p = ["aria-labelledby", "aria-describedby"], m = { class: "min-w-0 flex-1" }, h = ["id"], g = ["id"], _ = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "flex shrink-0 items-center gap-2"
|
|
6
|
+
}, v = /*@__PURE__*/ a({
|
|
7
|
+
__name: "AcFormSection",
|
|
8
|
+
props: {
|
|
9
|
+
title: { default: "" },
|
|
10
|
+
description: { default: "" },
|
|
11
|
+
layout: { default: void 0 },
|
|
12
|
+
columns: { default: 1 }
|
|
13
|
+
},
|
|
14
|
+
setup(a) {
|
|
15
|
+
let v = a, y = o("ac-form", null), b = f(), x = e(() => v.layout ?? y?.layout.value ?? "stacked");
|
|
16
|
+
return (e, o) => (c(), n("div", {
|
|
17
|
+
role: "group",
|
|
18
|
+
"aria-labelledby": a.title ? `${d(b)}-title` : void 0,
|
|
19
|
+
"aria-describedby": a.description || e.$slots.description ? `${d(b)}-desc` : void 0,
|
|
20
|
+
class: s(["border-t border-border-light py-7 first:border-t-0 first:pt-0", x.value === "aside" && "md:grid md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)] md:gap-10"]),
|
|
21
|
+
"data-ac-ds": "",
|
|
22
|
+
"data-testid": "ac-form-section"
|
|
23
|
+
}, [a.title || a.description || e.$slots.description || e.$slots.actions ? (c(), n("div", {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: s(["mb-5 flex items-start gap-4", x.value === "aside" && "md:mb-0"])
|
|
26
|
+
}, [r("div", m, [a.title ? (c(), n("h3", {
|
|
27
|
+
key: 0,
|
|
28
|
+
id: `${d(b)}-title`,
|
|
29
|
+
class: "text-xl leading-6 font-semibold tracking-[-0.01em] text-heading"
|
|
30
|
+
}, u(a.title), 9, h)) : t("", !0), a.description || e.$slots.description ? (c(), n("div", {
|
|
31
|
+
key: 1,
|
|
32
|
+
id: `${d(b)}-desc`,
|
|
33
|
+
class: "mt-1 text-base text-muted [&_a]:font-medium [&_a]:text-primary-20 [&_a]:underline [&_a]:underline-offset-2"
|
|
34
|
+
}, [l(e.$slots, "description", {}, () => [i(u(a.description), 1)])], 8, g)) : t("", !0)]), e.$slots.actions && x.value === "stacked" ? (c(), n("div", _, [l(e.$slots, "actions")])) : t("", !0)], 2)) : t("", !0), r("div", { class: s(["grid min-w-0 gap-5", [a.columns === 2 && "sm:grid-cols-2", x.value === "aside" && "md:col-start-2"]]) }, [l(e.$slots, "default")], 2)], 10, p));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { v as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Page title. */
|
|
3
|
+
title?: string;
|
|
4
|
+
/** Line under the title. */
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
/** Shows a back button that emits `back`. */
|
|
7
|
+
backButton?: boolean;
|
|
8
|
+
/** Sticks to the top while the page scrolls. */
|
|
9
|
+
sticky?: boolean;
|
|
10
|
+
/** Distance from the top when sticky, e.g. `"56px"` under an app navbar. */
|
|
11
|
+
top?: string;
|
|
12
|
+
/** `normal` suits a page's main header. `compact` has a 14px title and less padding, for dense pages and forms. */
|
|
13
|
+
size?: "normal" | "compact";
|
|
14
|
+
}
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
/** A logo or icon before the title, e.g. the database engine's logo on a resource page. Shown in a 40px tile. */
|
|
17
|
+
icon?: () => unknown;
|
|
18
|
+
/** Breadcrumb above the title. */
|
|
19
|
+
breadcrumb?: () => unknown;
|
|
20
|
+
/** Replaces the title and subtitle. */
|
|
21
|
+
title?: () => unknown;
|
|
22
|
+
/** Next to the title, e.g. a status badge. */
|
|
23
|
+
"title-extra"?: () => unknown;
|
|
24
|
+
/** Right side: the page's actions. The primary action goes last. */
|
|
25
|
+
default?: () => unknown;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
back: () => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
30
|
+
onBack?: (() => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
title: string;
|
|
33
|
+
size: "normal" | "compact";
|
|
34
|
+
top: string;
|
|
35
|
+
subtitle: string;
|
|
36
|
+
sticky: boolean;
|
|
37
|
+
backButton: boolean;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d } from "vue";
|
|
2
|
+
import { ArrowLeft as f } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcHeader.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var p = { class: "flex min-w-0 items-center gap-3.5" }, m = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "inline-flex size-11 shrink-0 items-center justify-center overflow-hidden rounded-10 border border-border-light bg-surface p-2 text-label shadow-xs ring-1 ring-black/[0.02] [&_img]:size-full [&_img]:object-contain [&_svg]:size-5",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, h = { class: "min-w-0" }, g = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "mb-1 text-xs text-muted"
|
|
11
|
+
}, _ = { class: "flex min-w-0 items-center gap-2.5" }, v = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "mt-px truncate text-sm leading-5 text-muted"
|
|
14
|
+
}, y = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "flex flex-wrap items-center gap-2"
|
|
17
|
+
}, b = /*@__PURE__*/ a({
|
|
18
|
+
__name: "AcHeader",
|
|
19
|
+
props: {
|
|
20
|
+
title: { default: "" },
|
|
21
|
+
subtitle: { default: "" },
|
|
22
|
+
backButton: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
sticky: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
top: { default: "0px" },
|
|
31
|
+
size: { default: "normal" }
|
|
32
|
+
},
|
|
33
|
+
emits: ["back"],
|
|
34
|
+
setup(a, { emit: b }) {
|
|
35
|
+
let x = a, S = e(() => x.size === "compact"), C = b;
|
|
36
|
+
return (e, b) => (c(), n("header", {
|
|
37
|
+
class: o(["z-20 border-b border-border-light bg-surface/85 shadow-[0_1px_2px_0_rgb(15_23_42/0.03)] backdrop-blur-md backdrop-saturate-150", a.sticky && "sticky"]),
|
|
38
|
+
style: s(a.sticky ? { top: a.top } : void 0),
|
|
39
|
+
"data-ac-ds": "",
|
|
40
|
+
"data-testid": "ac-header"
|
|
41
|
+
}, [r("div", { class: o(["flex flex-wrap items-center justify-between gap-x-6 gap-y-3", S.value ? "px-5 py-2.5" : "px-6 py-3.5"]) }, [r("div", p, [
|
|
42
|
+
a.backButton ? (c(), n("button", {
|
|
43
|
+
key: 0,
|
|
44
|
+
type: "button",
|
|
45
|
+
class: "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-8 border border-border bg-surface text-label shadow-xs transition hover:border-border-dark hover:bg-surface-muted hover:text-heading active:scale-95 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
46
|
+
"aria-label": "Back",
|
|
47
|
+
"data-ac-ds": "",
|
|
48
|
+
"data-testid": "ac-header-back",
|
|
49
|
+
onClick: b[0] ||= (e) => C("back")
|
|
50
|
+
}, [i(d(f), {
|
|
51
|
+
class: "size-4",
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
})])) : t("", !0),
|
|
54
|
+
e.$slots.icon ? (c(), n("span", m, [l(e.$slots, "icon")])) : t("", !0),
|
|
55
|
+
r("div", h, [e.$slots.breadcrumb ? (c(), n("div", g, [l(e.$slots, "breadcrumb")])) : t("", !0), l(e.$slots, "title", {}, () => [r("div", _, [r("h4", { class: o(["truncate font-semibold text-heading", S.value ? "text-lg leading-6 tracking-[-0.01em]" : "text-xl leading-7 tracking-tight"]) }, u(a.title), 3), l(e.$slots, "title-extra")]), a.subtitle ? (c(), n("p", v, u(a.subtitle), 1)) : t("", !0)])])
|
|
56
|
+
]), e.$slots.default ? (c(), n("div", y, [l(e.$slots, "default")])) : t("", !0)], 2)], 6));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { b as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
/** One control in a header row. */
|
|
3
|
+
default?: () => unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
|
+
//#region src/lib/components/AcHeaderItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var i = {
|
|
4
|
+
class: "flex items-center",
|
|
5
|
+
"data-ac-ds": "",
|
|
6
|
+
"data-testid": "ac-header-item"
|
|
7
|
+
}, a = /*@__PURE__*/ t({
|
|
8
|
+
__name: "AcHeaderItem",
|
|
9
|
+
setup(t) {
|
|
10
|
+
return (t, a) => (n(), e("div", i, [r(t.$slots, "default")]));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
/** `AcHeaderItem`s or controls, laid out in a row with an 8px gap. */
|
|
3
|
+
default?: () => unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
|
+
//#region src/lib/components/AcHeaderItems.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var i = {
|
|
4
|
+
class: "flex flex-wrap items-center gap-2",
|
|
5
|
+
"data-ac-ds": "",
|
|
6
|
+
"data-testid": "ac-header-items"
|
|
7
|
+
}, a = /*@__PURE__*/ t({
|
|
8
|
+
__name: "AcHeaderItems",
|
|
9
|
+
setup(t) {
|
|
10
|
+
return (t, a) => (n(), e("div", i, [r(t.$slots, "default")]));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface InfoItem {
|
|
2
|
+
/** Names the slots for this row: `#value-<key>` and `#label-<key>`. Defaults to `label`. */
|
|
3
|
+
key?: string;
|
|
4
|
+
/** Text in the label column. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The value. Empty values show a dash. */
|
|
7
|
+
value?: string | number | null;
|
|
8
|
+
/** Adds a copy-to-clipboard button after the value. */
|
|
9
|
+
copyable?: boolean;
|
|
10
|
+
/** Shows the value in the monospace font, for IDs, hashes, endpoints and resource names. */
|
|
11
|
+
mono?: boolean;
|
|
12
|
+
/** Hides the value behind dots with a show/hide button, e.g. a password. Copy still copies the real value. */
|
|
13
|
+
secret?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface Props {
|
|
16
|
+
/** The rows: `{ key?, label, value?, copyable?, mono?, secret? }`. */
|
|
17
|
+
items?: InfoItem[];
|
|
18
|
+
/** Heading above the rows. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** Lays the rows out in two columns from 768px up. */
|
|
21
|
+
columns?: 1 | 2;
|
|
22
|
+
/** `horizontal` puts the label to the left of the value; `stacked` puts it above, for narrow cards. */
|
|
23
|
+
layout?: "horizontal" | "stacked";
|
|
24
|
+
/** Draws a bordered card around the table. Turn off inside an AcCard or panel. */
|
|
25
|
+
bordered?: boolean;
|
|
26
|
+
/** Shows placeholder bars in place of the values while data loads. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** Text shown when `items` is empty. */
|
|
29
|
+
emptyText?: string;
|
|
30
|
+
}
|
|
31
|
+
type __VLS_Slots = {
|
|
32
|
+
/** Content at the right of the title, e.g. an Edit button. */
|
|
33
|
+
actions?: () => unknown;
|
|
34
|
+
/** Custom value for the row with that key, e.g. `#value-status` for a badge or `#value-cluster` for a link. */
|
|
35
|
+
[name: `value-${string}`]: (props: {
|
|
36
|
+
item: InfoItem;
|
|
37
|
+
}) => unknown;
|
|
38
|
+
/** Custom label for the row with that key, e.g. to add an icon or a tooltip. */
|
|
39
|
+
[name: `label-${string}`]: (props: {
|
|
40
|
+
item: InfoItem;
|
|
41
|
+
}) => unknown;
|
|
42
|
+
};
|
|
43
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
44
|
+
bordered: boolean;
|
|
45
|
+
title: string;
|
|
46
|
+
loading: boolean;
|
|
47
|
+
items: InfoItem[];
|
|
48
|
+
emptyText: string;
|
|
49
|
+
layout: "horizontal" | "stacked";
|
|
50
|
+
columns: 1 | 2;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeClass as c, onBeforeUnmount as l, openBlock as u, ref as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g } from "vue";
|
|
2
|
+
import { Check as _, Copy as v, Eye as y, EyeOff as b } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcInfoTable.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var x = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "text-lg leading-6 font-semibold tracking-[-0.01em] text-heading"
|
|
7
|
+
}, S = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "ml-auto flex shrink-0 items-center gap-2"
|
|
10
|
+
}, C = ["aria-busy"], w = { class: "flex h-5 items-center" }, T = { class: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 text-base text-heading" }, E = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "text-muted"
|
|
13
|
+
}, D = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "flex min-w-0 items-start gap-1.5"
|
|
16
|
+
}, O = [
|
|
17
|
+
"aria-label",
|
|
18
|
+
"aria-pressed",
|
|
19
|
+
"onClick"
|
|
20
|
+
], k = [
|
|
21
|
+
"aria-label",
|
|
22
|
+
"title",
|
|
23
|
+
"onClick"
|
|
24
|
+
], A = /*@__PURE__*/ s({
|
|
25
|
+
__name: "AcInfoTable",
|
|
26
|
+
props: {
|
|
27
|
+
items: { default: () => [] },
|
|
28
|
+
title: { default: "" },
|
|
29
|
+
columns: { default: 1 },
|
|
30
|
+
layout: { default: "horizontal" },
|
|
31
|
+
bordered: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !0
|
|
34
|
+
},
|
|
35
|
+
loading: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
emptyText: { default: "No details available" }
|
|
40
|
+
},
|
|
41
|
+
setup(s) {
|
|
42
|
+
let A = s, j = [
|
|
43
|
+
"w-40",
|
|
44
|
+
"w-28",
|
|
45
|
+
"w-52",
|
|
46
|
+
"w-32",
|
|
47
|
+
"w-44",
|
|
48
|
+
"w-24"
|
|
49
|
+
], M = d(null), N = d(/* @__PURE__ */ new Set()), P, F = t(() => A.items.map((e) => ({
|
|
50
|
+
item: e,
|
|
51
|
+
key: e.key ?? e.label
|
|
52
|
+
}))), I = t(() => [
|
|
53
|
+
"min-w-0 border-t border-border-light py-2.5 first:border-t-0",
|
|
54
|
+
A.columns === 2 && "md:[&:nth-child(2)]:border-t-0",
|
|
55
|
+
A.layout === "horizontal" ? "flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-4" : "flex flex-col gap-1"
|
|
56
|
+
]), L = t(() => ["flex items-center gap-1.5 text-base text-muted", A.layout === "horizontal" && (A.columns === 2 ? "sm:w-36 sm:shrink-0" : "sm:w-48 sm:shrink-0")]);
|
|
57
|
+
function R(e) {
|
|
58
|
+
return e == null || e === "";
|
|
59
|
+
}
|
|
60
|
+
function z(e) {
|
|
61
|
+
let t = new Set(N.value);
|
|
62
|
+
t.delete(e) || t.add(e), N.value = t;
|
|
63
|
+
}
|
|
64
|
+
async function B(e, t) {
|
|
65
|
+
try {
|
|
66
|
+
await navigator.clipboard.writeText(String(t ?? "")), M.value = e, clearTimeout(P), P = setTimeout(() => M.value = null, 1500);
|
|
67
|
+
} catch {}
|
|
68
|
+
}
|
|
69
|
+
return l(() => clearTimeout(P)), (t, l) => (u(), i("div", {
|
|
70
|
+
class: c(s.bordered && "rounded-10 border border-border bg-surface shadow-xs"),
|
|
71
|
+
"data-ac-ds": "",
|
|
72
|
+
"data-testid": "ac-info-table"
|
|
73
|
+
}, [s.title || t.$slots.actions ? (u(), i("div", {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: c(["flex items-center justify-between gap-4", s.bordered ? "border-b border-border-light px-5 py-3.5" : "mb-2"])
|
|
76
|
+
}, [s.title ? (u(), i("h3", x, h(s.title), 1)) : r("", !0), t.$slots.actions ? (u(), i("div", S, [p(t.$slots, "actions")])) : r("", !0)], 2)) : r("", !0), !s.loading && !s.items.length ? (u(), i("p", {
|
|
77
|
+
key: 1,
|
|
78
|
+
class: c(["py-6 text-center text-base text-muted", s.bordered && "px-5"])
|
|
79
|
+
}, h(s.emptyText), 3)) : (u(), i("dl", {
|
|
80
|
+
key: 2,
|
|
81
|
+
class: c(["grid", [s.columns === 2 && "md:grid-cols-2 md:gap-x-10", s.bordered ? "px-5 py-2" : ""]]),
|
|
82
|
+
"aria-busy": s.loading || void 0
|
|
83
|
+
}, [s.loading && !s.items.length ? (u(), i(e, { key: 0 }, f(j, (e, t) => a("div", {
|
|
84
|
+
key: t,
|
|
85
|
+
class: c(I.value)
|
|
86
|
+
}, [a("dt", { class: c(L.value) }, [...l[0] ||= [a("span", { class: "h-3 w-20 animate-pulse rounded-4 bg-surface-sunken" }, null, -1)]], 2), a("dd", w, [a("span", { class: c(["h-3 animate-pulse rounded-4 bg-surface-sunken", e]) }, null, 2)])], 2)), 64)) : r("", !0), (u(!0), i(e, null, f(F.value, ({ item: e, key: l }, d) => (u(), i("div", {
|
|
87
|
+
key: l,
|
|
88
|
+
class: c(I.value)
|
|
89
|
+
}, [a("dt", { class: c(L.value) }, [p(t.$slots, `label-${l}`, { item: e }, () => [o(h(e.label), 1)])], 2), a("dd", T, [s.loading ? (u(), i("span", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: c(["h-3 animate-pulse rounded-4 bg-surface-sunken", j[d % j.length]])
|
|
92
|
+
}, null, 2)) : p(t.$slots, `value-${l}`, { item: e }, () => [R(e.value) ? (u(), i("span", E, "—")) : (u(), i("span", D, [
|
|
93
|
+
a("span", { class: c(["min-w-0 [overflow-wrap:anywhere]", (e.mono || e.secret) && "font-mono text-xs leading-5"]) }, h(e.secret && !N.value.has(l) ? "••••••••••••" : e.value), 3),
|
|
94
|
+
e.secret ? (u(), i("button", {
|
|
95
|
+
key: 0,
|
|
96
|
+
type: "button",
|
|
97
|
+
class: "-my-0.5 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
98
|
+
"aria-label": N.value.has(l) ? `Hide ${e.label}` : `Show ${e.label}`,
|
|
99
|
+
"aria-pressed": N.value.has(l),
|
|
100
|
+
onClick: (e) => z(l)
|
|
101
|
+
}, [(u(), n(m(N.value.has(l) ? g(b) : g(y)), {
|
|
102
|
+
class: "size-3.5",
|
|
103
|
+
"aria-hidden": "true"
|
|
104
|
+
}))], 8, O)) : r("", !0),
|
|
105
|
+
e.copyable ? (u(), i("button", {
|
|
106
|
+
key: 1,
|
|
107
|
+
type: "button",
|
|
108
|
+
class: "-my-0.5 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
109
|
+
"aria-label": M.value === l ? `${e.label} copied` : `Copy ${e.label}`,
|
|
110
|
+
title: M.value === l ? "Copied" : "Copy",
|
|
111
|
+
onClick: (t) => B(l, e.value)
|
|
112
|
+
}, [M.value === l ? (u(), n(g(_), {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "size-3.5 text-success",
|
|
115
|
+
"aria-hidden": "true"
|
|
116
|
+
})) : (u(), n(g(v), {
|
|
117
|
+
key: 1,
|
|
118
|
+
class: "size-3.5",
|
|
119
|
+
"aria-hidden": "true"
|
|
120
|
+
}))], 8, k)) : r("", !0)
|
|
121
|
+
]))], void 0, 1)])], 2))), 128))], 10, C))], 2));
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
export { A as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Floating label. It rests inside the field and rises on focus or when filled. With a `prefix`, it always sits on the top edge. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Native `name` attribute. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Native input type. `password` adds a show/hide toggle. */
|
|
8
|
+
type?: "text" | "password" | "email" | "number" | "url" | "search";
|
|
9
|
+
/** Marks the field required and adds a red asterisk. */
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/** Disables the field. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Read-only field with a gray background. */
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
/** Error text under the field. Turns the border and label red and sets `aria-invalid`. */
|
|
16
|
+
errorMsg?: string;
|
|
17
|
+
/** Helper text under the field (hidden while `errorMsg` is set). */
|
|
18
|
+
hint?: string;
|
|
19
|
+
/** `small` 36px or `normal` 40px tall. */
|
|
20
|
+
size?: "small" | "normal";
|
|
21
|
+
/** Text of a button attached to the right edge, such as "Copy", "Generate" or "Browse". It emits `addon` when clicked. Also its accessible name when `addon-icon-only` is set. */
|
|
22
|
+
addonLabel?: string;
|
|
23
|
+
/** A Lucide icon component shown in the attached button, before `addon-label`. */
|
|
24
|
+
addonIcon?: Component;
|
|
25
|
+
/** Shows only `addon-icon` in the attached button; `addon-label` becomes its `aria-label` and tooltip. */
|
|
26
|
+
addonIconOnly?: boolean;
|
|
27
|
+
}
|
|
28
|
+
type __VLS_Props = Props;
|
|
29
|
+
type __VLS_Slots = {
|
|
30
|
+
/** Content inside the field before the value: a 16px icon or fixed text such as `https://`. */
|
|
31
|
+
prefix?: () => unknown;
|
|
32
|
+
/** Content inside the field after the value: a unit such as `Gi` or `%`, or a status icon. */
|
|
33
|
+
suffix?: () => unknown;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_ModelProps = {
|
|
36
|
+
modelValue?: string | number;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
40
|
+
/** Moves focus to the input. */
|
|
41
|
+
focus: () => void | undefined;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:modelValue": (value: string | number) => any;
|
|
44
|
+
addon: (event: MouseEvent) => any;
|
|
45
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
46
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
47
|
+
onAddon?: ((event: MouseEvent) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
type: "text" | "password" | "email" | "number" | "url" | "search";
|
|
50
|
+
required: boolean;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
name: string;
|
|
53
|
+
size: "small" | "normal";
|
|
54
|
+
hint: string;
|
|
55
|
+
readonly: boolean;
|
|
56
|
+
errorMsg: string;
|
|
57
|
+
addonLabel: string;
|
|
58
|
+
addonIcon: Component;
|
|
59
|
+
addonIconOnly: boolean;
|
|
60
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
61
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
62
|
+
declare const _default: typeof __VLS_export;
|
|
63
|
+
export default _default;
|
|
64
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
65
|
+
new (): {
|
|
66
|
+
$slots: S;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, useAttrs as _, useId as v, useModel as y, useSlots as b, vModelDynamic as x, withDirectives as S } from "vue";
|
|
2
|
+
import { CircleAlert as C, Eye as w, EyeOff as T } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var E = { class: "flex" }, D = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex h-full shrink-0 items-center pl-3 text-base whitespace-nowrap text-muted select-none [&_svg]:size-4"
|
|
7
|
+
}, O = [
|
|
8
|
+
"id",
|
|
9
|
+
"name",
|
|
10
|
+
"type",
|
|
11
|
+
"disabled",
|
|
12
|
+
"readonly",
|
|
13
|
+
"required",
|
|
14
|
+
"aria-invalid",
|
|
15
|
+
"aria-describedby"
|
|
16
|
+
], k = ["for"], A = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "text-danger",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, j = ["aria-label"], M = [
|
|
21
|
+
"disabled",
|
|
22
|
+
"aria-label",
|
|
23
|
+
"title"
|
|
24
|
+
], N = { key: 1 }, P = ["id"], F = ["id"], I = /*@__PURE__*/ s({
|
|
25
|
+
inheritAttrs: !1,
|
|
26
|
+
__name: "AcInput",
|
|
27
|
+
props: /*@__PURE__*/ c({
|
|
28
|
+
label: {},
|
|
29
|
+
name: { default: "" },
|
|
30
|
+
type: { default: "text" },
|
|
31
|
+
required: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
readonly: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
errorMsg: { default: "" },
|
|
44
|
+
hint: { default: "" },
|
|
45
|
+
size: { default: "small" },
|
|
46
|
+
addonLabel: { default: "" },
|
|
47
|
+
addonIcon: { default: void 0 },
|
|
48
|
+
addonIconOnly: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
modelValue: { default: "" },
|
|
54
|
+
modelModifiers: {}
|
|
55
|
+
}),
|
|
56
|
+
emits: /*@__PURE__*/ c(["addon"], ["update:modelValue"]),
|
|
57
|
+
setup(s, { expose: c, emit: I }) {
|
|
58
|
+
let L = s, R = y(s, "modelValue"), z = I, B = v(), V = _(), H = b(), U = e(() => ({
|
|
59
|
+
class: V.class,
|
|
60
|
+
style: V.style
|
|
61
|
+
})), W = e(() => {
|
|
62
|
+
let { class: e, style: t, ...n } = V;
|
|
63
|
+
return n;
|
|
64
|
+
}), G = f(null), K = f(!1), q = e(() => L.type === "password" && K.value ? "text" : L.type), J = e(() => L.errorMsg || L.hint ? `${B}-msg` : void 0), Y = e(() => !!L.addonLabel || !!L.addonIcon), X = e(() => !!H.suffix || L.type === "password");
|
|
65
|
+
function Z(e) {
|
|
66
|
+
L.disabled || z("addon", e);
|
|
67
|
+
}
|
|
68
|
+
return c({ focus: () => G.value?.focus() }), (e, c) => (d(), r("div", l(U.value, {
|
|
69
|
+
class: ["w-full", s.disabled && "opacity-60"],
|
|
70
|
+
"data-ac-ds": "",
|
|
71
|
+
"data-testid": "ac-input"
|
|
72
|
+
}), [i("div", E, [i("div", { class: u(["relative flex min-w-0 flex-1 items-center border shadow-xs transition-[border-color,box-shadow] duration-150", [
|
|
73
|
+
s.size === "small" ? "h-9" : "h-10",
|
|
74
|
+
Y.value ? "rounded-l-6" : "rounded-6",
|
|
75
|
+
s.disabled || s.readonly ? "bg-surface-muted" : "bg-surface",
|
|
76
|
+
s.readonly && "shadow-none",
|
|
77
|
+
s.errorMsg ? "border-red-60 focus-within:border-danger focus-within:shadow-[0_0_0_3px_var(--color-red-90)]" : "border-border hover:border-border-dark focus-within:focus-ring"
|
|
78
|
+
]]) }, [
|
|
79
|
+
e.$slots.prefix ? (d(), r("span", D, [p(e.$slots, "prefix")])) : n("", !0),
|
|
80
|
+
S(i("input", l({
|
|
81
|
+
id: g(B),
|
|
82
|
+
ref_key: "input",
|
|
83
|
+
ref: G
|
|
84
|
+
}, W.value, {
|
|
85
|
+
"onUpdate:modelValue": c[0] ||= (e) => R.value = e,
|
|
86
|
+
name: s.name,
|
|
87
|
+
type: q.value,
|
|
88
|
+
disabled: s.disabled,
|
|
89
|
+
readonly: s.readonly,
|
|
90
|
+
required: s.required,
|
|
91
|
+
"aria-invalid": !!s.errorMsg || void 0,
|
|
92
|
+
"aria-describedby": J.value,
|
|
93
|
+
placeholder: " ",
|
|
94
|
+
class: ["peer block h-full w-full min-w-0 flex-1 rounded-6 bg-transparent text-base text-heading outline-none placeholder:text-transparent disabled:cursor-not-allowed", [e.$slots.prefix ? "pl-1" : "pl-3", X.value ? "pr-1.5" : "pr-3"]]
|
|
95
|
+
}), null, 16, O), [[x, R.value]]),
|
|
96
|
+
i("label", {
|
|
97
|
+
for: g(B),
|
|
98
|
+
class: u(["pointer-events-none absolute -top-px left-2.25 max-w-[calc(100%-20px)] -translate-y-1/2 truncate rounded-2 bg-surface px-1 text-xs font-medium whitespace-nowrap text-label transition-all duration-150 ease-out peer-focus:text-primary-20 peer-read-only:bg-linear-to-b peer-read-only:from-surface peer-read-only:from-50% peer-read-only:to-surface-muted peer-read-only:to-50% peer-disabled:bg-linear-to-b peer-disabled:from-surface peer-disabled:from-50% peer-disabled:to-surface-muted peer-disabled:to-50%", [!e.$slots.prefix && "peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-base peer-placeholder-shown:font-normal peer-placeholder-shown:text-muted peer-focus:-top-px peer-focus:text-xs peer-focus:font-medium", s.errorMsg && "text-red-30! peer-focus:text-red-30!"]])
|
|
99
|
+
}, [a(h(s.label), 1), s.required ? (d(), r("span", A, " *")) : n("", !0)], 10, k),
|
|
100
|
+
e.$slots.suffix ? (d(), r("span", {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: u(["relative flex h-full shrink-0 items-center bg-inherit text-base whitespace-nowrap text-muted select-none [&_svg]:size-4", s.type === "password" ? "pr-1" : "pr-3"])
|
|
103
|
+
}, [p(e.$slots, "suffix")], 2)) : n("", !0),
|
|
104
|
+
s.type === "password" ? (d(), r("button", {
|
|
105
|
+
key: 2,
|
|
106
|
+
type: "button",
|
|
107
|
+
class: "relative mr-1.5 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition hover:bg-surface-sunken hover:text-heading",
|
|
108
|
+
"aria-label": K.value ? "Hide value" : "Show value",
|
|
109
|
+
onClick: c[1] ||= (e) => K.value = !K.value
|
|
110
|
+
}, [(d(), t(m(K.value ? g(T) : g(w)), {
|
|
111
|
+
class: "size-4",
|
|
112
|
+
"aria-hidden": "true"
|
|
113
|
+
}))], 8, j)) : n("", !0)
|
|
114
|
+
], 2), Y.value ? (d(), r("button", {
|
|
115
|
+
key: 0,
|
|
116
|
+
type: "button",
|
|
117
|
+
class: u(["relative -ml-px inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-r-6 border border-border bg-surface-muted text-base font-medium whitespace-nowrap text-heading shadow-xs transition-[background-color,border-color,box-shadow] duration-150 hover:bg-surface-sunken focus-visible:z-10 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:hover:bg-surface-muted", [s.size === "small" ? "h-9" : "h-10", s.addonIconOnly ? "w-9" : "px-3"]]),
|
|
118
|
+
disabled: s.disabled,
|
|
119
|
+
"aria-label": s.addonIconOnly ? s.addonLabel : void 0,
|
|
120
|
+
title: s.addonIconOnly ? s.addonLabel : void 0,
|
|
121
|
+
"data-ac-ds": "",
|
|
122
|
+
"data-testid": "ac-input-addon",
|
|
123
|
+
onClick: Z
|
|
124
|
+
}, [s.addonIcon ? (d(), t(m(s.addonIcon), {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "size-4 text-label",
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
})) : n("", !0), s.addonIconOnly ? n("", !0) : (d(), r("span", N, h(s.addonLabel), 1))], 10, M)) : n("", !0)]), s.errorMsg ? (d(), r("p", {
|
|
129
|
+
key: 0,
|
|
130
|
+
id: `${g(B)}-msg`,
|
|
131
|
+
class: "mt-1.5 flex items-center gap-1 text-xs text-red-30"
|
|
132
|
+
}, [o(g(C), {
|
|
133
|
+
class: "size-3.5 shrink-0",
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
}), a(" " + h(s.errorMsg), 1)], 8, P)) : s.hint ? (d(), r("p", {
|
|
136
|
+
key: 1,
|
|
137
|
+
id: `${g(B)}-msg`,
|
|
138
|
+
class: "mt-1.5 text-xs text-muted"
|
|
139
|
+
}, h(s.hint), 9, F)) : n("", !0)], 16));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
//#endregion
|
|
143
|
+
export { I as default };
|