@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,142 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, renderList as l, toDisplayString as u } from "vue";
|
|
2
|
+
//#region src/lib/components/AcSkeleton.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var d = ["aria-busy", "aria-hidden"], f = {
|
|
4
|
+
key: 2,
|
|
5
|
+
class: "flex flex-col gap-2",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, p = {
|
|
8
|
+
key: 3,
|
|
9
|
+
class: "w-full",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, m = { class: "flex h-9 items-center gap-4 border-b border-border px-4" }, h = {
|
|
12
|
+
key: 4,
|
|
13
|
+
class: "flex size-full overflow-hidden rounded-10 border border-border bg-surface shadow-xs",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, g = { class: "flex w-11 shrink-0 flex-col items-end gap-2 border-r border-border-light bg-surface-muted px-2.5 py-3" }, _ = { class: "flex min-w-0 flex-1 flex-col gap-2 px-3 py-3" }, v = {
|
|
16
|
+
key: 5,
|
|
17
|
+
class: "rounded-10 border border-border bg-surface p-5 shadow-xs",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, y = { class: "mt-5 flex flex-col gap-2" }, b = {
|
|
20
|
+
key: 6,
|
|
21
|
+
class: "rounded-10 border border-border bg-surface p-4 shadow-xs",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, x = { class: "flex items-center gap-3" }, S = { class: "min-w-0 flex-1" }, C = { class: "mt-4 grid grid-cols-2 gap-x-4 gap-y-2.5 border-t border-border-light pt-4" }, w = {
|
|
24
|
+
key: 7,
|
|
25
|
+
class: "sr-only"
|
|
26
|
+
}, T = "ac-skeleton-bone block rounded-4", E = /*@__PURE__*/ a({
|
|
27
|
+
__name: "AcSkeleton",
|
|
28
|
+
props: {
|
|
29
|
+
shape: { default: "text" },
|
|
30
|
+
lines: { default: 1 },
|
|
31
|
+
rows: { default: 5 },
|
|
32
|
+
cols: { default: 4 },
|
|
33
|
+
width: { default: "" },
|
|
34
|
+
height: { default: "" },
|
|
35
|
+
label: { default: "Loading" }
|
|
36
|
+
},
|
|
37
|
+
setup(a) {
|
|
38
|
+
let E = a, D = [
|
|
39
|
+
"70%",
|
|
40
|
+
"45%",
|
|
41
|
+
"60%",
|
|
42
|
+
"35%",
|
|
43
|
+
"55%",
|
|
44
|
+
"40%"
|
|
45
|
+
], O = [
|
|
46
|
+
[0, 30],
|
|
47
|
+
[1, 40],
|
|
48
|
+
[1, 25],
|
|
49
|
+
[2, 45],
|
|
50
|
+
[2, 35],
|
|
51
|
+
[1, 30],
|
|
52
|
+
[0, 20],
|
|
53
|
+
[1, 50],
|
|
54
|
+
[1, 35],
|
|
55
|
+
[2, 40],
|
|
56
|
+
[2, 30],
|
|
57
|
+
[0, 25],
|
|
58
|
+
[1, 45],
|
|
59
|
+
[1, 30],
|
|
60
|
+
[2, 50],
|
|
61
|
+
[0, 35]
|
|
62
|
+
], k = t(() => {
|
|
63
|
+
if (E.shape === "circle") {
|
|
64
|
+
let e = E.height || E.width || "40px";
|
|
65
|
+
return {
|
|
66
|
+
width: e,
|
|
67
|
+
height: e
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return E.shape === "rect" ? {
|
|
71
|
+
width: E.width || "100%",
|
|
72
|
+
height: E.height || "80px"
|
|
73
|
+
} : E.shape === "editor" ? {
|
|
74
|
+
width: E.width || void 0,
|
|
75
|
+
height: E.height || "320px"
|
|
76
|
+
} : E.width ? { width: E.width } : void 0;
|
|
77
|
+
}), A = t(() => E.height || "12px"), j = t(() => {
|
|
78
|
+
let e = Math.max(1, E.lines);
|
|
79
|
+
return Array.from({ length: e }, (t, n) => e > 1 && n === e - 1 ? "60%" : "100%");
|
|
80
|
+
});
|
|
81
|
+
return (t, E) => (c(), r("div", {
|
|
82
|
+
"aria-busy": a.label ? "true" : void 0,
|
|
83
|
+
"aria-hidden": !a.label || void 0,
|
|
84
|
+
class: o(["max-w-full", a.shape === "circle" ? "shrink-0" : !k.value?.width && "w-full"]),
|
|
85
|
+
style: s(k.value),
|
|
86
|
+
"data-ac-ds": "",
|
|
87
|
+
"data-testid": "ac-skeleton"
|
|
88
|
+
}, [a.shape === "circle" ? (c(), r("span", {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: o([T, "size-full rounded-full"]),
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
})) : a.shape === "rect" ? (c(), r("span", {
|
|
93
|
+
key: 1,
|
|
94
|
+
class: o([T, "size-full rounded-6"]),
|
|
95
|
+
"aria-hidden": "true"
|
|
96
|
+
})) : a.shape === "text" ? (c(), r("div", f, [(c(!0), r(e, null, l(j.value, (e, t) => (c(), r("span", {
|
|
97
|
+
key: t,
|
|
98
|
+
class: o(T),
|
|
99
|
+
style: s({
|
|
100
|
+
width: e,
|
|
101
|
+
height: A.value
|
|
102
|
+
})
|
|
103
|
+
}, null, 4))), 128))])) : a.shape === "table" ? (c(), r("div", p, [i("div", m, [(c(!0), r(e, null, l(a.cols, (e) => (c(), r("span", {
|
|
104
|
+
key: e,
|
|
105
|
+
class: "flex-1"
|
|
106
|
+
}, [i("span", { class: o([T, "h-2.5 w-1/2 opacity-70"]) })]))), 128))]), (c(!0), r(e, null, l(a.rows, (t) => (c(), r("div", {
|
|
107
|
+
key: t,
|
|
108
|
+
class: "flex h-12 items-center gap-4 border-b border-border-light px-4 last:border-0"
|
|
109
|
+
}, [(c(!0), r(e, null, l(a.cols, (e) => (c(), r("span", {
|
|
110
|
+
key: e,
|
|
111
|
+
class: "flex-1"
|
|
112
|
+
}, [i("span", {
|
|
113
|
+
class: o([T, "h-3"]),
|
|
114
|
+
style: s({ width: D[(t + e) % D.length] })
|
|
115
|
+
}, null, 4)]))), 128))]))), 128))])) : a.shape === "editor" ? (c(), r("div", h, [i("div", g, [(c(), r(e, null, l(O, (e, t) => i("span", {
|
|
116
|
+
key: t,
|
|
117
|
+
class: o([T, "h-2 w-3 shrink-0 opacity-60"])
|
|
118
|
+
})), 64))]), i("div", _, [(c(), r(e, null, l(O, ([e, t], n) => i("span", {
|
|
119
|
+
key: n,
|
|
120
|
+
class: o([T, "h-2 shrink-0"]),
|
|
121
|
+
style: s({
|
|
122
|
+
marginLeft: `${e * 16}px`,
|
|
123
|
+
width: `${t}%`
|
|
124
|
+
})
|
|
125
|
+
}, null, 4)), 64))])])) : a.shape === "card" ? (c(), r("div", v, [
|
|
126
|
+
i("span", { class: o([T, "h-4 w-2/5"]) }),
|
|
127
|
+
i("span", { class: o([T, "mt-2 h-3 w-1/4"]) }),
|
|
128
|
+
i("div", y, [
|
|
129
|
+
i("span", { class: o([T, "h-3 w-full"]) }),
|
|
130
|
+
i("span", { class: o([T, "h-3 w-full"]) }),
|
|
131
|
+
i("span", { class: o([T, "h-3 w-3/5"]) })
|
|
132
|
+
])
|
|
133
|
+
])) : (c(), r("div", b, [i("div", x, [i("span", { class: o([T, "size-10 shrink-0 rounded-8"]) }), i("div", S, [i("span", { class: o([T, "h-3.5 w-1/2"]) }), i("span", { class: o([T, "mt-2 h-2.5 w-1/3"]) })])]), i("div", C, [
|
|
134
|
+
i("span", { class: o([T, "h-2.5 w-3/5"]) }),
|
|
135
|
+
i("span", { class: o([T, "h-2.5 w-2/5 justify-self-end"]) }),
|
|
136
|
+
i("span", { class: o([T, "h-2.5 w-1/2"]) }),
|
|
137
|
+
i("span", { class: o([T, "h-2.5 w-1/3 justify-self-end"]) })
|
|
138
|
+
])])), a.label ? (c(), r("span", w, u(a.label), 1)) : n("", !0)], 14, d));
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
//#endregion
|
|
142
|
+
export { E as default };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface SliderMark {
|
|
2
|
+
/** Where the mark sits, between `min` and `max`. */
|
|
3
|
+
value: number;
|
|
4
|
+
/** Text under the mark. Defaults to the value with its unit. */
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Props {
|
|
8
|
+
/** Label above the slider. It also names the thumbs for screen readers, so set it even when the context seems obvious. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** A second line under the label, like the old `subtitle`: what the value controls. */
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Smallest value. */
|
|
13
|
+
min?: number;
|
|
14
|
+
/** Largest value. */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Distance between allowed values. Decimals such as `0.5` work. */
|
|
17
|
+
step?: number;
|
|
18
|
+
/** Two thumbs; `v-model` becomes `[from, to]`. The thumbs can meet but not cross. */
|
|
19
|
+
range?: boolean;
|
|
20
|
+
/** Ticks with labels under the track. Pass numbers, or `{ value, label }` for custom text. Clicking a label jumps there. */
|
|
21
|
+
marks?: (number | SliderMark)[];
|
|
22
|
+
/** Unit shown after every value, e.g. `%` or `GiB`. Words get a space before them; symbols don't. */
|
|
23
|
+
unit?: string;
|
|
24
|
+
/** Formats a value for the bubble, marks, header and `aria-valuetext`. Overrides `unit`. */
|
|
25
|
+
formatValue?: (value: number) => string;
|
|
26
|
+
/** Adds a number input for typing an exact value (two for `range`). */
|
|
27
|
+
showInput?: boolean;
|
|
28
|
+
/** Value bubble over the thumb: `auto` on hover, focus and drag; `always`; or `never`. */
|
|
29
|
+
tooltip?: "auto" | "always" | "never";
|
|
30
|
+
/** Disables the slider and its inputs. */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Adds a red asterisk to the label. */
|
|
33
|
+
required?: boolean;
|
|
34
|
+
/** Error text under the slider. Turns the track red and sets `aria-invalid`. */
|
|
35
|
+
errorMsg?: string;
|
|
36
|
+
/** Helper text under the slider (hidden while `errorMsg` is set). */
|
|
37
|
+
hint?: string;
|
|
38
|
+
}
|
|
39
|
+
type __VLS_Props = Props;
|
|
40
|
+
type __VLS_ModelProps = {
|
|
41
|
+
/** The value: a number, or `[from, to]` with `range`. Out-of-range values are shown clamped. */
|
|
42
|
+
modelValue?: number | [number, number] | null;
|
|
43
|
+
};
|
|
44
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
45
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
46
|
+
/** Moves focus to the first thumb. */
|
|
47
|
+
focus: () => void;
|
|
48
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
49
|
+
"update:modelValue": (value: number | [number, number] | null) => any;
|
|
50
|
+
change: (value: number | [number, number]) => any;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
52
|
+
"onUpdate:modelValue"?: ((value: number | [number, number] | null) => any) | undefined;
|
|
53
|
+
onChange?: ((value: number | [number, number]) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
required: boolean;
|
|
56
|
+
label: string;
|
|
57
|
+
description: string;
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
max: number;
|
|
60
|
+
min: number;
|
|
61
|
+
step: number;
|
|
62
|
+
tooltip: "auto" | "always" | "never";
|
|
63
|
+
hint: string;
|
|
64
|
+
range: boolean;
|
|
65
|
+
errorMsg: string;
|
|
66
|
+
unit: string;
|
|
67
|
+
marks: (number | SliderMark)[];
|
|
68
|
+
formatValue: (value: number) => string;
|
|
69
|
+
showInput: boolean;
|
|
70
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
71
|
+
declare const _default: typeof __VLS_export;
|
|
72
|
+
export default _default;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, normalizeStyle as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, useId as g, useModel as ee } from "vue";
|
|
2
|
+
import { CircleAlert as te } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcSlider.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var ne = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "mb-2 flex items-start justify-between gap-3"
|
|
7
|
+
}, _ = { class: "min-w-0" }, v = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "text-danger",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, y = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "mt-0.5 text-xs text-muted"
|
|
14
|
+
}, b = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "shrink-0 text-base font-medium text-heading tabular-nums",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, x = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "mb-2 text-right text-base font-medium text-heading tabular-nums",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}, re = [
|
|
23
|
+
"value",
|
|
24
|
+
"min",
|
|
25
|
+
"max",
|
|
26
|
+
"step",
|
|
27
|
+
"disabled",
|
|
28
|
+
"aria-label",
|
|
29
|
+
"aria-invalid"
|
|
30
|
+
], ie = { class: "relative min-w-0 flex-1" }, ae = [
|
|
31
|
+
"tabindex",
|
|
32
|
+
"aria-valuemin",
|
|
33
|
+
"aria-valuemax",
|
|
34
|
+
"aria-valuenow",
|
|
35
|
+
"aria-valuetext",
|
|
36
|
+
"aria-labelledby",
|
|
37
|
+
"aria-label",
|
|
38
|
+
"aria-describedby",
|
|
39
|
+
"aria-disabled",
|
|
40
|
+
"aria-invalid",
|
|
41
|
+
"aria-required",
|
|
42
|
+
"onKeydown"
|
|
43
|
+
], oe = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "absolute inset-x-0 top-full mt-1 h-4",
|
|
46
|
+
"aria-hidden": "true"
|
|
47
|
+
}, se = ["onClick"], ce = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "relative shrink-0"
|
|
50
|
+
}, S = [
|
|
51
|
+
"value",
|
|
52
|
+
"min",
|
|
53
|
+
"max",
|
|
54
|
+
"step",
|
|
55
|
+
"disabled",
|
|
56
|
+
"aria-label",
|
|
57
|
+
"aria-invalid",
|
|
58
|
+
"aria-describedby"
|
|
59
|
+
], C = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-xs text-muted",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}, w = "h-9 rounded-6 border bg-surface px-2.5 text-base text-heading tabular-nums shadow-xs transition-[border-color,box-shadow] outline-none [appearance:textfield] disabled:cursor-not-allowed disabled:bg-surface-muted [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", T = /*@__PURE__*/ s({
|
|
64
|
+
__name: "AcSlider",
|
|
65
|
+
props: /*@__PURE__*/ c({
|
|
66
|
+
label: { default: "" },
|
|
67
|
+
description: { default: "" },
|
|
68
|
+
min: { default: 0 },
|
|
69
|
+
max: { default: 100 },
|
|
70
|
+
step: { default: 1 },
|
|
71
|
+
range: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
74
|
+
},
|
|
75
|
+
marks: { default: () => [] },
|
|
76
|
+
unit: { default: "" },
|
|
77
|
+
formatValue: {
|
|
78
|
+
type: Function,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
showInput: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
84
|
+
},
|
|
85
|
+
tooltip: { default: "auto" },
|
|
86
|
+
disabled: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !1
|
|
89
|
+
},
|
|
90
|
+
required: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
errorMsg: { default: "" },
|
|
95
|
+
hint: { default: "" }
|
|
96
|
+
}, {
|
|
97
|
+
modelValue: { default: null },
|
|
98
|
+
modelModifiers: {}
|
|
99
|
+
}),
|
|
100
|
+
emits: /*@__PURE__*/ c(["change"], ["update:modelValue"]),
|
|
101
|
+
setup(s, { expose: c, emit: T }) {
|
|
102
|
+
let E = s, D = ee(s, "modelValue"), O = T, k = g(), A = `${k}-label`, j = `${k}-msg`, M = f(null), N = f([]), P = f(null), F = t(() => Math.max(E.max - E.min, 2 ** -52)), I = t(() => Math.max(H(E.step), H(E.min))), L = t(() => Math.max(E.step, Math.round(F.value / 10 / E.step) * E.step)), R = t(() => {
|
|
103
|
+
let e = D.value;
|
|
104
|
+
if (E.range) {
|
|
105
|
+
let [t, n] = Array.isArray(e) ? e : [E.min, E.max];
|
|
106
|
+
return [U(Math.min(t, n)), U(Math.max(t, n))];
|
|
107
|
+
}
|
|
108
|
+
return [U(typeof e == "number" ? e : Array.isArray(e) ? e[0] : E.min)];
|
|
109
|
+
}), z = t(() => E.range ? {
|
|
110
|
+
left: `${G(R.value[0])}%`,
|
|
111
|
+
width: `${G(R.value[1]) - G(R.value[0])}%`
|
|
112
|
+
} : {
|
|
113
|
+
left: "0%",
|
|
114
|
+
width: `${G(R.value[0])}%`
|
|
115
|
+
}), B = t(() => E.marks.map((e) => typeof e == "number" ? {
|
|
116
|
+
value: e,
|
|
117
|
+
label: K(e)
|
|
118
|
+
} : {
|
|
119
|
+
value: e.value,
|
|
120
|
+
label: e.label ?? K(e.value)
|
|
121
|
+
}).filter((e) => e.value >= E.min && e.value <= E.max)), V = t(() => E.errorMsg || E.hint ? j : void 0);
|
|
122
|
+
function H(e) {
|
|
123
|
+
let t = String(e);
|
|
124
|
+
return t.includes(".") ? t.split(".")[1].length : 0;
|
|
125
|
+
}
|
|
126
|
+
function U(e) {
|
|
127
|
+
return Math.min(E.max, Math.max(E.min, Number.isFinite(e) ? e : E.min));
|
|
128
|
+
}
|
|
129
|
+
function W(e) {
|
|
130
|
+
let t = Math.round((U(e) - E.min) / E.step) * E.step + E.min;
|
|
131
|
+
return U(Number(t.toFixed(I.value)));
|
|
132
|
+
}
|
|
133
|
+
function G(e) {
|
|
134
|
+
return (e - E.min) / F.value * 100;
|
|
135
|
+
}
|
|
136
|
+
function K(e) {
|
|
137
|
+
return E.formatValue ? E.formatValue(e) : E.unit ? /^[a-z]/i.test(E.unit) ? `${e} ${E.unit}` : `${e}${E.unit}` : String(e);
|
|
138
|
+
}
|
|
139
|
+
function q() {
|
|
140
|
+
return E.range ? [R.value[0], R.value[1]] : R.value[0];
|
|
141
|
+
}
|
|
142
|
+
function J(e) {
|
|
143
|
+
return E.range ? e === 0 ? {
|
|
144
|
+
lo: E.min,
|
|
145
|
+
hi: R.value[1]
|
|
146
|
+
} : {
|
|
147
|
+
lo: R.value[0],
|
|
148
|
+
hi: E.max
|
|
149
|
+
} : {
|
|
150
|
+
lo: E.min,
|
|
151
|
+
hi: E.max
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function Y(e, t) {
|
|
155
|
+
let { lo: n, hi: r } = J(e), i = Math.min(r, Math.max(n, W(t)));
|
|
156
|
+
if (!E.range) {
|
|
157
|
+
i !== R.value[0] && (D.value = i);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let a = [R.value[0], R.value[1]];
|
|
161
|
+
a[e] = i, (a[0] !== R.value[0] || a[1] !== R.value[1] || !Array.isArray(D.value)) && (D.value = a);
|
|
162
|
+
}
|
|
163
|
+
function X(e) {
|
|
164
|
+
let t = M.value.getBoundingClientRect(), n = t.width ? (e - t.left) / t.width : 0;
|
|
165
|
+
return E.min + Math.min(1, Math.max(0, n)) * F.value;
|
|
166
|
+
}
|
|
167
|
+
function Z(e) {
|
|
168
|
+
if (!E.range) return 0;
|
|
169
|
+
let [t, n] = R.value;
|
|
170
|
+
return t === n ? e < t ? 0 : 1 : Math.abs(e - t) <= Math.abs(e - n) ? 0 : 1;
|
|
171
|
+
}
|
|
172
|
+
function le(e) {
|
|
173
|
+
if (E.disabled || e.button !== 0 || !M.value) return;
|
|
174
|
+
e.preventDefault();
|
|
175
|
+
let t = X(e.clientX), n = Z(t);
|
|
176
|
+
P.value = n, Y(n, t), M.value.setPointerCapture(e.pointerId), N.value[n]?.focus({ preventScroll: !0 });
|
|
177
|
+
}
|
|
178
|
+
function ue(e) {
|
|
179
|
+
P.value !== null && Y(P.value, X(e.clientX));
|
|
180
|
+
}
|
|
181
|
+
function Q(e) {
|
|
182
|
+
P.value !== null && (P.value = null, M.value?.hasPointerCapture(e.pointerId) && M.value.releasePointerCapture(e.pointerId), O("change", q()));
|
|
183
|
+
}
|
|
184
|
+
function de(e, t) {
|
|
185
|
+
if (E.disabled) return;
|
|
186
|
+
let n = R.value[t], { lo: r, hi: i } = J(t), a = {
|
|
187
|
+
ArrowRight: n + E.step,
|
|
188
|
+
ArrowUp: n + E.step,
|
|
189
|
+
ArrowLeft: n - E.step,
|
|
190
|
+
ArrowDown: n - E.step,
|
|
191
|
+
PageUp: n + L.value,
|
|
192
|
+
PageDown: n - L.value,
|
|
193
|
+
Home: r,
|
|
194
|
+
End: i
|
|
195
|
+
};
|
|
196
|
+
e.key in a && (e.preventDefault(), Y(t, a[e.key]), O("change", q()));
|
|
197
|
+
}
|
|
198
|
+
function fe(e) {
|
|
199
|
+
if (E.disabled) return;
|
|
200
|
+
let t = Z(e);
|
|
201
|
+
Y(t, e), N.value[t]?.focus(), O("change", q());
|
|
202
|
+
}
|
|
203
|
+
function $(e, t) {
|
|
204
|
+
let n = e.target, r = n.valueAsNumber;
|
|
205
|
+
Number.isFinite(r) && (Y(t, r), O("change", q())), n.value = String(R.value[t]);
|
|
206
|
+
}
|
|
207
|
+
function pe(e) {
|
|
208
|
+
let t = E.label || "Value";
|
|
209
|
+
return E.range ? `${t}, ${e === 0 ? "minimum" : "maximum"}` : E.label ? void 0 : t;
|
|
210
|
+
}
|
|
211
|
+
function me(e, t) {
|
|
212
|
+
e && (N.value[t] = e);
|
|
213
|
+
}
|
|
214
|
+
return c({ focus: () => N.value[0]?.focus() }), (t, c) => (d(), r("div", {
|
|
215
|
+
class: l(["w-full", s.disabled && "opacity-60"]),
|
|
216
|
+
"data-ac-ds": "",
|
|
217
|
+
"data-testid": "ac-slider"
|
|
218
|
+
}, [
|
|
219
|
+
s.label || s.description || !s.showInput && !s.range ? (d(), r("div", ne, [i("div", _, [s.label ? (d(), r("p", {
|
|
220
|
+
key: 0,
|
|
221
|
+
id: A,
|
|
222
|
+
class: "text-base font-medium text-heading"
|
|
223
|
+
}, [a(m(s.label), 1), s.required ? (d(), r("span", v, " *")) : n("", !0)])) : n("", !0), s.description ? (d(), r("p", y, m(s.description), 1)) : n("", !0)]), s.showInput ? n("", !0) : (d(), r("span", b, m(s.range ? `${K(R.value[0])} – ${K(R.value[1])}` : K(R.value[0])), 1))])) : !s.showInput && s.range ? (d(), r("div", x, m(K(R.value[0])) + " – " + m(K(R.value[1])), 1)) : n("", !0),
|
|
224
|
+
i("div", { class: l(["flex items-center gap-3", B.value.length > 0 && "pb-5"]) }, [
|
|
225
|
+
s.showInput && s.range ? (d(), r("input", {
|
|
226
|
+
key: 0,
|
|
227
|
+
type: "number",
|
|
228
|
+
value: R.value[0],
|
|
229
|
+
min: s.min,
|
|
230
|
+
max: R.value[1],
|
|
231
|
+
step: s.step,
|
|
232
|
+
disabled: s.disabled,
|
|
233
|
+
"aria-label": `${s.label || "Value"}, minimum`,
|
|
234
|
+
"aria-invalid": !!s.errorMsg || void 0,
|
|
235
|
+
class: l(["shrink-0", [
|
|
236
|
+
w,
|
|
237
|
+
"w-16",
|
|
238
|
+
s.errorMsg ? "border-red-60" : "border-border hover:border-border-dark focus:focus-ring"
|
|
239
|
+
]]),
|
|
240
|
+
onChange: c[0] ||= (e) => $(e, 0)
|
|
241
|
+
}, null, 42, re)) : n("", !0),
|
|
242
|
+
i("div", ie, [i("div", { class: l(s.tooltip === "always" && "pt-8") }, [i("div", {
|
|
243
|
+
ref_key: "track",
|
|
244
|
+
ref: M,
|
|
245
|
+
class: l(["relative flex h-5 touch-none items-center select-none", s.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
246
|
+
onPointerdown: le,
|
|
247
|
+
onPointermove: ue,
|
|
248
|
+
onPointerup: Q,
|
|
249
|
+
onPointercancel: Q
|
|
250
|
+
}, [i("div", { class: l(["relative h-1.5 w-full rounded-full", s.errorMsg ? "bg-red-90" : "bg-slate-90"]) }, [i("div", {
|
|
251
|
+
class: l(["absolute inset-y-0 rounded-full", s.errorMsg ? "bg-danger" : "bg-primary"]),
|
|
252
|
+
style: u(z.value)
|
|
253
|
+
}, null, 6), (d(!0), r(e, null, p(B.value, (e) => (d(), r("span", {
|
|
254
|
+
key: e.value,
|
|
255
|
+
class: l(["absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full", (s.range ? e.value >= R.value[0] && e.value <= R.value[1] : e.value <= R.value[0]) ? "bg-primary-90" : "bg-slate-70"]),
|
|
256
|
+
style: u({ left: `${G(e.value)}%` }),
|
|
257
|
+
"aria-hidden": "true"
|
|
258
|
+
}, null, 6))), 128))], 2), (d(!0), r(e, null, p(R.value, (e, t) => (d(), r("div", {
|
|
259
|
+
key: t,
|
|
260
|
+
ref_for: !0,
|
|
261
|
+
ref: (e) => me(e, t),
|
|
262
|
+
role: "slider",
|
|
263
|
+
tabindex: s.disabled ? -1 : 0,
|
|
264
|
+
"aria-valuemin": J(t).lo,
|
|
265
|
+
"aria-valuemax": J(t).hi,
|
|
266
|
+
"aria-valuenow": e,
|
|
267
|
+
"aria-valuetext": K(e),
|
|
268
|
+
"aria-orientation": "horizontal",
|
|
269
|
+
"aria-labelledby": !s.range && s.label ? A : void 0,
|
|
270
|
+
"aria-label": pe(t),
|
|
271
|
+
"aria-describedby": V.value,
|
|
272
|
+
"aria-disabled": s.disabled || void 0,
|
|
273
|
+
"aria-invalid": !!s.errorMsg || void 0,
|
|
274
|
+
"aria-required": s.required || void 0,
|
|
275
|
+
class: l(["group/thumb absolute top-1/2 size-4.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 bg-surface shadow-sm transition-[box-shadow,scale] duration-150 outline-none focus-visible:ring-[3px] focus-visible:ring-ring motion-safe:hover:scale-110", [
|
|
276
|
+
s.errorMsg ? "border-danger" : "border-primary",
|
|
277
|
+
P.value === t && "ring-[3px] ring-ring motion-safe:scale-110",
|
|
278
|
+
s.range && R.value[0] === R.value[1] && t === 1 && "z-10"
|
|
279
|
+
]]),
|
|
280
|
+
style: u({ left: `${G(e)}%` }),
|
|
281
|
+
onKeydown: (e) => de(e, t)
|
|
282
|
+
}, [s.tooltip === "never" ? n("", !0) : (d(), r("span", {
|
|
283
|
+
key: 0,
|
|
284
|
+
class: l(["pointer-events-none absolute bottom-full left-1/2 mb-2 -translate-x-1/2 rounded-6 bg-slate-10 px-2 py-1 text-xs font-medium whitespace-nowrap text-slate-95 tabular-nums shadow-md transition-opacity duration-100 dark:bg-slate-80 dark:text-slate-10 dark:ring-1 dark:ring-slate-70", s.tooltip === "always" || P.value === t ? "opacity-100" : "opacity-0 group-hover/thumb:opacity-100 group-focus-visible/thumb:opacity-100"]),
|
|
285
|
+
"aria-hidden": "true"
|
|
286
|
+
}, m(K(e)), 3))], 46, ae))), 128))], 34)], 2), B.value.length ? (d(), r("div", oe, [(d(!0), r(e, null, p(B.value, (e, t) => (d(), r("span", {
|
|
287
|
+
key: e.value,
|
|
288
|
+
class: l(["absolute top-0 text-xs whitespace-nowrap text-muted tabular-nums transition-colors", [t === 0 && G(e.value) < 5 ? "" : t === B.value.length - 1 && G(e.value) > 95 ? "-translate-x-full" : "-translate-x-1/2", !s.disabled && "cursor-pointer hover:text-heading"]]),
|
|
289
|
+
style: u({ left: `${G(e.value)}%` }),
|
|
290
|
+
onClick: (t) => fe(e.value)
|
|
291
|
+
}, m(e.label), 15, se))), 128))])) : n("", !0)]),
|
|
292
|
+
s.showInput ? (d(), r("div", ce, [i("input", {
|
|
293
|
+
type: "number",
|
|
294
|
+
value: R.value[+!!s.range],
|
|
295
|
+
min: s.range ? R.value[0] : s.min,
|
|
296
|
+
max: s.max,
|
|
297
|
+
step: s.step,
|
|
298
|
+
disabled: s.disabled,
|
|
299
|
+
"aria-label": s.range ? `${s.label || "Value"}, maximum` : s.label || "Value",
|
|
300
|
+
"aria-invalid": !!s.errorMsg || void 0,
|
|
301
|
+
"aria-describedby": V.value,
|
|
302
|
+
class: l([
|
|
303
|
+
w,
|
|
304
|
+
s.range ? "w-16" : "w-20",
|
|
305
|
+
s.errorMsg ? "border-red-60" : "border-border hover:border-border-dark focus:focus-ring",
|
|
306
|
+
s.unit && !s.formatValue && !s.range && "pr-8"
|
|
307
|
+
]),
|
|
308
|
+
onChange: c[1] ||= (e) => $(e, +!!s.range)
|
|
309
|
+
}, null, 42, S), s.unit && !s.formatValue && !s.range ? (d(), r("span", C, m(s.unit.trim()), 1)) : n("", !0)])) : n("", !0)
|
|
310
|
+
], 2),
|
|
311
|
+
s.errorMsg ? (d(), r("p", {
|
|
312
|
+
key: 2,
|
|
313
|
+
id: j,
|
|
314
|
+
class: "mt-1.5 flex items-center gap-1 text-xs text-red-30"
|
|
315
|
+
}, [o(h(te), {
|
|
316
|
+
class: "size-3.5 shrink-0",
|
|
317
|
+
"aria-hidden": "true"
|
|
318
|
+
}), a(" " + m(s.errorMsg), 1)])) : s.hint ? (d(), r("p", {
|
|
319
|
+
key: 3,
|
|
320
|
+
id: j,
|
|
321
|
+
class: "mt-1.5 text-xs text-muted"
|
|
322
|
+
}, m(s.hint), 1)) : n("", !0)
|
|
323
|
+
], 2));
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
//#endregion
|
|
327
|
+
export { T as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Diameter: `xs` 12px, `small` 16px, `normal` 20px, `large` 32px. */
|
|
3
|
+
size?: "xs" | "small" | "normal" | "large";
|
|
4
|
+
/** Read by screen readers. Pass an empty string when a visible label sits next to it. */
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
8
|
+
label: string;
|
|
9
|
+
size: "xs" | "small" | "normal" | "large";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createElementBlock as e, createElementVNode as t, defineComponent as n, normalizeClass as r, openBlock as i } from "vue";
|
|
2
|
+
//#region src/lib/components/AcSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var a = [
|
|
4
|
+
"role",
|
|
5
|
+
"aria-label",
|
|
6
|
+
"aria-hidden"
|
|
7
|
+
], o = /*@__PURE__*/ n({
|
|
8
|
+
__name: "AcSpinner",
|
|
9
|
+
props: {
|
|
10
|
+
size: { default: "small" },
|
|
11
|
+
label: { default: "Loading" }
|
|
12
|
+
},
|
|
13
|
+
setup(n) {
|
|
14
|
+
let o = {
|
|
15
|
+
xs: "size-3",
|
|
16
|
+
small: "size-4",
|
|
17
|
+
normal: "size-5",
|
|
18
|
+
large: "size-8"
|
|
19
|
+
};
|
|
20
|
+
return (s, c) => (i(), e("svg", {
|
|
21
|
+
class: r(["inline-block shrink-0 animate-spin", o[n.size]]),
|
|
22
|
+
viewBox: "0 0 16 16",
|
|
23
|
+
fill: "none",
|
|
24
|
+
role: n.label ? "status" : void 0,
|
|
25
|
+
"aria-label": n.label || void 0,
|
|
26
|
+
"aria-hidden": !n.label || void 0,
|
|
27
|
+
"data-ac-ds": "",
|
|
28
|
+
"data-testid": "ac-spinner"
|
|
29
|
+
}, [...c[0] ||= [t("circle", {
|
|
30
|
+
cx: "8",
|
|
31
|
+
cy: "8",
|
|
32
|
+
r: "6",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
"stroke-opacity": "0.2",
|
|
35
|
+
"stroke-width": "2"
|
|
36
|
+
}, null, -1), t("path", {
|
|
37
|
+
d: "M14 8a6 6 0 0 0-6-6",
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
"stroke-width": "2",
|
|
40
|
+
"stroke-linecap": "round"
|
|
41
|
+
}, null, -1)]], 10, a));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { o as default };
|