@ac-design/design-system 1.0.3 → 2.1.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 +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +71 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +11 -0
- package/dist/lib/charts/index.js +7 -0
- package/dist/lib/charts/shared.d.ts +53 -0
- package/dist/lib/charts/shared.js +96 -0
- package/dist/lib/charts/xy.d.ts +69 -0
- package/dist/lib/charts/xy.js +73 -0
- package/dist/lib/compat.css +2770 -1061
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +10 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +47 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
- package/dist/lib/components/AcBadge.vue.d.ts +20 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +46 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +13 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +42 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
- package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +102 -26
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +57 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +8 -8
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +139 -116
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +3 -3
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -5
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +4 -4
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +336 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +88 -64
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +22 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +19 -4
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
- package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +6 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +32 -32
- package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/lib/components/AcTag.vue.d.ts +2 -2
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +289 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +455 -0
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
- package/dist/lib/components/index.d.ts +21 -2
- package/dist/lib/components/status.d.ts +28 -0
- package/dist/lib/components/status.js +125 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +99 -75
- package/dist/lib/theme.css +377 -273
- package/package.json +20 -4
|
@@ -1,117 +1,241 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as te, defineComponent as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUpdated as ne, openBlock as m, ref as h, renderList as re, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, useId as y, useSlots as ie, vShow as b, watch as x, withCtx as S, withDirectives as C } from "vue";
|
|
2
|
+
import { CircleAlert as w, CircleCheck as ae, Info as oe, TriangleAlert as se } from "@lucide/vue";
|
|
2
3
|
//#region src/lib/components/AcTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
+
var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class: "min-w-0 flex-1" }, T = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-semibold text-on-tooltip"
|
|
7
|
+
}, de = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "ml-1 flex shrink-0 items-center gap-0.5 self-center"
|
|
10
|
+
}, E = null, D = 0, fe = 400, O = /*@__PURE__*/ c({
|
|
4
11
|
__name: "AcTooltip",
|
|
5
12
|
props: {
|
|
6
13
|
content: { default: "" },
|
|
14
|
+
title: { default: "" },
|
|
7
15
|
placement: { default: "top" },
|
|
8
|
-
|
|
16
|
+
align: { default: "center" },
|
|
17
|
+
tone: { default: "neutral" },
|
|
18
|
+
shortcut: { default: () => [] },
|
|
19
|
+
delay: { default: 100 },
|
|
9
20
|
disabled: {
|
|
10
21
|
type: Boolean,
|
|
11
22
|
default: !1
|
|
12
|
-
}
|
|
23
|
+
},
|
|
24
|
+
interactive: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
overflowOnly: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
maxWidth: { default: "280px" }
|
|
13
33
|
},
|
|
14
34
|
setup(c) {
|
|
15
|
-
let
|
|
35
|
+
let O = c, pe = ie(), k = {
|
|
16
36
|
top: "bottom",
|
|
17
37
|
bottom: "top",
|
|
18
38
|
left: "right",
|
|
19
39
|
right: "left"
|
|
20
|
-
},
|
|
40
|
+
}, me = {
|
|
41
|
+
top: "translate-y-1",
|
|
42
|
+
bottom: "-translate-y-1",
|
|
43
|
+
left: "translate-x-1",
|
|
44
|
+
right: "-translate-x-1"
|
|
45
|
+
}, A = {
|
|
46
|
+
top: "border-r border-b",
|
|
47
|
+
bottom: "border-t border-l",
|
|
48
|
+
left: "border-t border-r",
|
|
49
|
+
right: "border-b border-l"
|
|
50
|
+
}, j = {
|
|
51
|
+
info: {
|
|
52
|
+
icon: oe,
|
|
53
|
+
class: "text-info"
|
|
54
|
+
},
|
|
55
|
+
success: {
|
|
56
|
+
icon: ae,
|
|
57
|
+
class: "text-success"
|
|
58
|
+
},
|
|
59
|
+
warning: {
|
|
60
|
+
icon: se,
|
|
61
|
+
class: "text-warning"
|
|
62
|
+
},
|
|
63
|
+
danger: {
|
|
64
|
+
icon: w,
|
|
65
|
+
class: "text-danger"
|
|
66
|
+
}
|
|
67
|
+
}, M = `${y()}-tip`, N = h(null), P = h(null), F = h(!1), I = h(O.placement), L = h({
|
|
21
68
|
top: 0,
|
|
22
|
-
left: 0
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
let e =
|
|
69
|
+
left: 0,
|
|
70
|
+
arrow: 0
|
|
71
|
+
}), R, z, B = null, V = r(() => !O.disabled && !!(O.content || O.title || pe.content)), H = r(() => O.tone === "neutral" ? null : j[O.tone]), he = r(() => {
|
|
72
|
+
let { top: e, left: t, arrow: n } = L.value, r = {
|
|
73
|
+
top: `${n}px 100%`,
|
|
74
|
+
bottom: `${n}px 0`,
|
|
75
|
+
left: `100% ${n}px`,
|
|
76
|
+
right: `0 ${n}px`
|
|
77
|
+
}[I.value];
|
|
78
|
+
return {
|
|
79
|
+
top: `${e}px`,
|
|
80
|
+
left: `${t}px`,
|
|
81
|
+
maxWidth: O.maxWidth,
|
|
82
|
+
transformOrigin: r
|
|
83
|
+
};
|
|
84
|
+
}), ge = r(() => {
|
|
85
|
+
let e = `${L.value.arrow - 5}px`, t = "-6px";
|
|
86
|
+
return {
|
|
87
|
+
top: {
|
|
88
|
+
left: e,
|
|
89
|
+
bottom: t
|
|
90
|
+
},
|
|
91
|
+
bottom: {
|
|
92
|
+
left: e,
|
|
93
|
+
top: t
|
|
94
|
+
},
|
|
95
|
+
left: {
|
|
96
|
+
top: e,
|
|
97
|
+
right: t
|
|
98
|
+
},
|
|
99
|
+
right: {
|
|
100
|
+
top: e,
|
|
101
|
+
left: t
|
|
102
|
+
}
|
|
103
|
+
}[I.value];
|
|
104
|
+
});
|
|
105
|
+
function U() {
|
|
106
|
+
let e = N.value;
|
|
26
107
|
return e?.querySelector("button, a[href], input, select, textarea, [tabindex]") ?? e?.firstElementChild ?? null;
|
|
27
108
|
}
|
|
28
|
-
function
|
|
29
|
-
let e =
|
|
30
|
-
if (
|
|
31
|
-
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !==
|
|
32
|
-
|
|
109
|
+
function W() {
|
|
110
|
+
let e = U();
|
|
111
|
+
if (B && B !== e && G(B), B = e, !e) return;
|
|
112
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== M);
|
|
113
|
+
V.value && t.push(M), t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
33
114
|
}
|
|
34
|
-
function
|
|
35
|
-
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !==
|
|
115
|
+
function G(e) {
|
|
116
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== M);
|
|
36
117
|
t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
37
118
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
119
|
+
function _e() {
|
|
120
|
+
let e = N.value;
|
|
121
|
+
return e ? [e, ...e.querySelectorAll("*")].some((e) => e.scrollWidth > e.clientWidth + 1) : !1;
|
|
122
|
+
}
|
|
123
|
+
async function ve() {
|
|
124
|
+
(!O.overflowOnly || _e()) && (E && E !== q && E(), E = q, F.value = !0, await l(), ye());
|
|
125
|
+
}
|
|
126
|
+
function K(e) {
|
|
127
|
+
if (clearTimeout(z), !V.value || F.value) return;
|
|
128
|
+
clearTimeout(R);
|
|
129
|
+
let t = E !== null || Date.now() - D < fe;
|
|
130
|
+
R = setTimeout(ve, t ? 0 : e);
|
|
131
|
+
}
|
|
132
|
+
function q() {
|
|
133
|
+
clearTimeout(R), clearTimeout(z), F.value && (F.value = !1, D = Date.now(), E === q && (E = null));
|
|
134
|
+
}
|
|
135
|
+
function J(e = 0) {
|
|
136
|
+
clearTimeout(R), clearTimeout(z), e ? z = setTimeout(q, e) : q();
|
|
137
|
+
}
|
|
138
|
+
function Y(e, t, n, r) {
|
|
139
|
+
return e === "top" ? t.top - 8 - r >= 8 : e === "bottom" ? t.bottom + 8 + r <= window.innerHeight - 8 : e === "left" ? t.left - 8 - n >= 8 : t.right + 8 + n <= window.innerWidth - 8;
|
|
140
|
+
}
|
|
141
|
+
function X(e, t, n) {
|
|
142
|
+
return O.align === "start" ? e : O.align === "end" ? e + t - n : e + (t - n) / 2;
|
|
143
|
+
}
|
|
144
|
+
function Z(e, t, n) {
|
|
145
|
+
return Math.min(Math.max(e, t), Math.max(t, n));
|
|
146
|
+
}
|
|
147
|
+
function ye() {
|
|
148
|
+
let e = U() ?? N.value;
|
|
149
|
+
if (!e || !P.value) return;
|
|
150
|
+
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = P.value, i = O.placement, a = Y(i, t, n, r) || !Y(k[i], t, n, r) ? i : k[i];
|
|
151
|
+
if (I.value = a, a === "top" || a === "bottom") {
|
|
152
|
+
let e = Z(X(t.left, t.width, n), 8, window.innerWidth - 8 - n), i = Z(t.left + t.width / 2 - e, 12, n - 12);
|
|
153
|
+
L.value = {
|
|
154
|
+
top: Math.round(a === "top" ? t.top - 8 - r : t.bottom + 8),
|
|
155
|
+
left: Math.round(e),
|
|
156
|
+
arrow: i
|
|
157
|
+
};
|
|
158
|
+
} else {
|
|
159
|
+
let e = Z(X(t.top, t.height, r), 8, window.innerHeight - 8 - r), i = Z(t.top + t.height / 2 - e, 12, r - 12);
|
|
160
|
+
L.value = {
|
|
161
|
+
top: Math.round(e),
|
|
162
|
+
left: Math.round(a === "left" ? t.left - 8 - n : t.right + 8),
|
|
163
|
+
arrow: i
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function be(e) {
|
|
168
|
+
e.pointerType !== "touch" && K(O.delay);
|
|
169
|
+
}
|
|
170
|
+
function xe(e) {
|
|
171
|
+
e.target.matches(":focus-visible") && K(0);
|
|
60
172
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
173
|
+
function Se() {
|
|
174
|
+
O.interactive && clearTimeout(z);
|
|
63
175
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
176
|
+
function Ce() {
|
|
177
|
+
O.interactive && J(120);
|
|
66
178
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
179
|
+
function Q() {
|
|
180
|
+
J();
|
|
69
181
|
}
|
|
70
|
-
function
|
|
71
|
-
e.key === "Escape" &&
|
|
182
|
+
function $(e) {
|
|
183
|
+
e.key === "Escape" && F.value && J();
|
|
72
184
|
}
|
|
73
|
-
return x(
|
|
74
|
-
e ? (document.addEventListener("keydown",
|
|
75
|
-
}), x(
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
}), (
|
|
185
|
+
return x(F, (e) => {
|
|
186
|
+
e ? (document.addEventListener("keydown", $), window.addEventListener("scroll", Q, !0)) : (document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0));
|
|
187
|
+
}), x(V, (e) => {
|
|
188
|
+
W(), e || J();
|
|
189
|
+
}), p(W), ne(W), f(() => {
|
|
190
|
+
J(), E === q && (E = null), document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0), B && G(B);
|
|
191
|
+
}), (r, l) => (m(), o("span", {
|
|
80
192
|
ref_key: "root",
|
|
81
|
-
ref:
|
|
193
|
+
ref: N,
|
|
82
194
|
class: "inline-flex max-w-full",
|
|
83
195
|
"data-ac-ds": "",
|
|
84
196
|
"data-testid": "ac-tooltip",
|
|
85
|
-
onPointerenter:
|
|
86
|
-
onPointerleave: l[
|
|
87
|
-
onPointerdown: l[
|
|
88
|
-
onFocusin:
|
|
89
|
-
onFocusout: l[
|
|
90
|
-
}, [g(
|
|
91
|
-
"enter-active-class": "transition-opacity duration-
|
|
92
|
-
"enter-from-class":
|
|
93
|
-
"leave-active-class": "transition-opacity duration-
|
|
94
|
-
"leave-to-class": "opacity-0"
|
|
197
|
+
onPointerenter: be,
|
|
198
|
+
onPointerleave: l[0] ||= (e) => J(120),
|
|
199
|
+
onPointerdown: l[1] ||= (e) => J(),
|
|
200
|
+
onFocusin: xe,
|
|
201
|
+
onFocusout: l[2] ||= (e) => J()
|
|
202
|
+
}, [g(r.$slots, "default"), (m(), i(t, { to: "body" }, [te(n, {
|
|
203
|
+
"enter-active-class": "transition-[opacity,scale,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
204
|
+
"enter-from-class": `opacity-0 scale-95 ${me[I.value]}`,
|
|
205
|
+
"leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
|
|
206
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
95
207
|
}, {
|
|
96
|
-
default: S(() => [C(
|
|
97
|
-
id:
|
|
208
|
+
default: S(() => [C(s("div", {
|
|
209
|
+
id: M,
|
|
98
210
|
ref_key: "tip",
|
|
99
|
-
ref:
|
|
211
|
+
ref: P,
|
|
100
212
|
role: "tooltip",
|
|
101
|
-
class: "fixed z-[100] w-max
|
|
102
|
-
"data-side":
|
|
103
|
-
style:
|
|
104
|
-
top: `${F.value.top}px`,
|
|
105
|
-
left: `${F.value.left}px`
|
|
106
|
-
}),
|
|
213
|
+
class: u(["fixed z-[100] w-max rounded-10 border border-white/10 bg-tooltip text-xs leading-relaxed break-words whitespace-normal text-on-tooltip shadow-lg shadow-black/25", [c.title ? "px-3 py-2" : "px-2.5 py-1.5", c.interactive ? "pointer-events-auto" : "pointer-events-none"]]),
|
|
214
|
+
"data-side": I.value,
|
|
215
|
+
style: d(he.value),
|
|
107
216
|
"data-ac-ds": "",
|
|
108
217
|
"data-testid": "ac-tooltip-panel",
|
|
109
|
-
onPointerenter:
|
|
110
|
-
onPointerleave:
|
|
111
|
-
}, [
|
|
218
|
+
onPointerenter: Se,
|
|
219
|
+
onPointerleave: Ce
|
|
220
|
+
}, [s("div", le, [
|
|
221
|
+
H.value ? (m(), i(_(H.value.icon), {
|
|
222
|
+
key: 0,
|
|
223
|
+
class: u(["mt-0.5 size-3.5 shrink-0", H.value.class]),
|
|
224
|
+
"aria-hidden": "true"
|
|
225
|
+
}, null, 8, ["class"])) : a("", !0),
|
|
226
|
+
s("div", ue, [c.title ? (m(), o("p", T, v(c.title), 1)) : a("", !0), s("div", { class: u(c.title && "mt-0.5 text-on-tooltip/75") }, [g(r.$slots, "content", {}, () => [ee(v(c.content), 1)])], 2)]),
|
|
227
|
+
c.shortcut.length ? (m(), o("span", de, [(m(!0), o(e, null, re(c.shortcut, (e) => (m(), o("kbd", {
|
|
228
|
+
key: e,
|
|
229
|
+
class: "min-w-4 rounded-4 border border-white/15 bg-white/10 px-1 text-center font-mono text-xm leading-4 text-on-tooltip/75"
|
|
230
|
+
}, v(e), 1))), 128))])) : a("", !0)
|
|
231
|
+
]), s("span", {
|
|
232
|
+
"aria-hidden": "true",
|
|
233
|
+
class: u(["absolute size-2.5 rotate-45 border-white/10 bg-tooltip", A[I.value]]),
|
|
234
|
+
style: d(ge.value)
|
|
235
|
+
}, null, 6)], 46, ce), [[b, F.value]])]),
|
|
112
236
|
_: 3
|
|
113
|
-
})]))], 544));
|
|
237
|
+
}, 8, ["enter-from-class"])]))], 544));
|
|
114
238
|
}
|
|
115
239
|
});
|
|
116
240
|
//#endregion
|
|
117
|
-
export {
|
|
241
|
+
export { O as default };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./AcBadge.js";
|
|
2
2
|
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, getCurrentInstance as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useSlots as te, withCtx as ne } from "vue";
|
|
3
3
|
//#region src/lib/components/AcUsageCard.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col gap-
|
|
4
|
+
var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col gap-5 p-5" }, ae = { class: "flex min-w-0 items-start gap-3" }, oe = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-
|
|
6
|
+
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong [&_svg]:size-4",
|
|
7
7
|
"aria-hidden": "true"
|
|
8
8
|
}, se = { class: "min-w-0 flex-1" }, ce = ["id"], y = ["title"], b = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "relative z-10 flex shrink-0 flex-wrap items-center justify-end gap-2"
|
|
11
11
|
}, x = {
|
|
12
12
|
key: 0,
|
|
13
|
-
class: "text-xs text-muted"
|
|
13
|
+
class: "text-xs font-medium text-muted"
|
|
14
14
|
}, S = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "flex min-w-0 flex-col gap-2"
|
|
17
|
-
}, C = { class: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1" }, w = { class: "flex min-w-0 flex-wrap items-baseline gap-x-1.5" }, le = { class: "text-3xl font-
|
|
17
|
+
}, C = { class: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1" }, w = { class: "flex min-w-0 flex-wrap items-baseline gap-x-1.5" }, le = { class: "text-3xl font-bold tracking-tight text-heading tabular-nums" }, ue = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "text-base text-muted"
|
|
20
20
|
}, T = {
|
|
@@ -30,19 +30,19 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
30
30
|
class: "text-base text-body"
|
|
31
31
|
}, O = {
|
|
32
32
|
key: 0,
|
|
33
|
-
class: "ac-scrollbar border-t border-border
|
|
33
|
+
class: "ac-scrollbar border-t border-border"
|
|
34
34
|
}, k = { class: "w-full text-left text-base" }, A = {
|
|
35
35
|
key: 0,
|
|
36
|
-
class: "text-xs text-muted"
|
|
36
|
+
class: "bg-surface-sunken/50 text-xs text-muted"
|
|
37
37
|
}, j = {
|
|
38
38
|
scope: "row",
|
|
39
|
-
class: "px-
|
|
39
|
+
class: "px-5 py-2.5 text-left font-normal text-body"
|
|
40
40
|
}, M = { class: "flex min-w-0 items-center gap-2" }, N = { class: "truncate" }, P = {
|
|
41
41
|
key: 0,
|
|
42
|
-
class: "ac-skeleton-bone ml-auto block h-3 w-14 rounded-
|
|
42
|
+
class: "ac-skeleton-bone ml-auto block h-3 w-14 rounded-full"
|
|
43
43
|
}, F = {
|
|
44
44
|
key: 1,
|
|
45
|
-
class: "relative z-10 mt-auto flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1.5 border-t border-border
|
|
45
|
+
class: "relative z-10 mt-auto flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1.5 border-t border-border px-5 py-3 text-base text-muted"
|
|
46
46
|
}, I = /*@__PURE__*/ c({
|
|
47
47
|
__name: "AcUsageCard",
|
|
48
48
|
props: {
|
|
@@ -78,26 +78,26 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
78
78
|
let L = c, R = I, z = te(), de = {
|
|
79
79
|
ok: {
|
|
80
80
|
fill: "bg-primary",
|
|
81
|
-
track: "bg-
|
|
81
|
+
track: "bg-surface-sunken",
|
|
82
82
|
text: "text-muted",
|
|
83
83
|
badge: ""
|
|
84
84
|
},
|
|
85
85
|
warning: {
|
|
86
86
|
fill: "bg-warning",
|
|
87
|
-
track: "bg-
|
|
88
|
-
text: "text-
|
|
87
|
+
track: "bg-warning/15",
|
|
88
|
+
text: "text-warning-strong",
|
|
89
89
|
badge: "Near limit"
|
|
90
90
|
},
|
|
91
91
|
danger: {
|
|
92
92
|
fill: "bg-danger",
|
|
93
|
-
track: "bg-
|
|
94
|
-
text: "text-
|
|
93
|
+
track: "bg-danger/15",
|
|
94
|
+
text: "text-danger-strong",
|
|
95
95
|
badge: "At limit"
|
|
96
96
|
},
|
|
97
97
|
over: {
|
|
98
98
|
fill: "bg-danger",
|
|
99
|
-
track: "bg-
|
|
100
|
-
text: "text-
|
|
99
|
+
track: "bg-danger/15",
|
|
100
|
+
text: "text-danger-strong",
|
|
101
101
|
badge: "Over limit"
|
|
102
102
|
}
|
|
103
103
|
}, B = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), V = l(), H = V?.appContext.components.RouterLink, U = ee(), W = n(() => typeof L.used == "number" && Number.isFinite(L.used)), G = n(() => W.value && typeof L.limit == "number" && L.limit > 0), K = n(() => G.value ? L.used / L.limit * 100 : 0), q = n(() => G.value ? L.used > L.limit ? "over" : K.value >= L.dangerAt ? "danger" : K.value >= L.warningAt ? "warning" : "ok" : "ok"), J = n(() => de[q.value]), fe = n(() => L.showThresholds ? [L.warningAt, L.dangerAt].filter((e) => e > 0 && e < 100) : []), Y = n(() => {
|
|
@@ -133,7 +133,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
133
133
|
R("click", e);
|
|
134
134
|
}
|
|
135
135
|
return (n, l) => (p(), a("section", {
|
|
136
|
-
class: d(["relative flex min-w-0 flex-col rounded-
|
|
136
|
+
class: d(["relative flex min-w-0 flex-col rounded-14 border border-border bg-surface transition-[background-color,border-color,box-shadow,translate] duration-200 has-[[data-ac-card-link]:focus-visible]:ring-2 has-[[data-ac-card-link]:focus-visible]:ring-ring has-[[data-ac-card-link]:focus-visible]:ring-offset-2 has-[[data-ac-card-link]:focus-visible]:ring-offset-surface motion-reduce:transition-none", (X.value || $()) && "hover:-translate-y-0.5 hover:border-primary/30 hover:bg-accent-hover/60 hover:shadow-card motion-reduce:hover:translate-y-0"]),
|
|
137
137
|
"aria-labelledby": `${v(U)}-title`,
|
|
138
138
|
"aria-busy": c.loading || void 0,
|
|
139
139
|
"data-ac-ds": "",
|
|
@@ -144,20 +144,20 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
144
144
|
z.icon || c.icon ? (p(), a("span", oe, [h(n.$slots, "icon", {}, () => [(p(), r(g(c.icon)))])])) : i("", !0),
|
|
145
145
|
o("div", se, [o("h3", {
|
|
146
146
|
id: `${v(U)}-title`,
|
|
147
|
-
class: "truncate text-lg leading-6 font-semibold tracking-
|
|
147
|
+
class: "truncate font-heading text-lg leading-6 font-semibold tracking-tight text-heading"
|
|
148
148
|
}, [X.value || $() ? (p(), r(g(X.value ? X.value.is : "button"), u({ key: 0 }, X.value ? {
|
|
149
149
|
...X.value,
|
|
150
150
|
is: void 0
|
|
151
151
|
} : { type: "button" }, {
|
|
152
152
|
"data-ac-card-link": "",
|
|
153
|
-
class: "cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-
|
|
153
|
+
class: "cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-14",
|
|
154
154
|
onClick: me
|
|
155
155
|
}), {
|
|
156
156
|
default: ne(() => [s(_(c.title), 1)]),
|
|
157
157
|
_: 1
|
|
158
158
|
}, 16)) : (p(), a(t, { key: 1 }, [s(_(c.title), 1)], 64))], 8, ce), c.description ? (p(), a("p", {
|
|
159
159
|
key: 0,
|
|
160
|
-
class: "truncate text-xs text-muted",
|
|
160
|
+
class: "mt-0.5 truncate text-xs text-muted",
|
|
161
161
|
title: c.description
|
|
162
162
|
}, _(c.description), 9, y)) : i("", !0)]),
|
|
163
163
|
c.period || J.value.badge || z.actions ? (p(), a("div", b, [
|
|
@@ -173,14 +173,14 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
173
173
|
h(n.$slots, "actions")
|
|
174
174
|
])) : i("", !0)
|
|
175
175
|
]),
|
|
176
|
-
W.value || c.loading && c.breakdown.length === 0 ? (p(), a("div", S, [c.loading ? (p(), a(t, { key: 0 }, [l[0] ||= o("span", { class: "ac-skeleton-bone block h-
|
|
176
|
+
W.value || c.loading && c.breakdown.length === 0 ? (p(), a("div", S, [c.loading ? (p(), a(t, { key: 0 }, [l[0] ||= o("span", { class: "ac-skeleton-bone block h-7 w-2/5 rounded-6" }, null, -1), l[1] ||= o("span", { class: "ac-skeleton-bone block h-2 w-full rounded-full" }, null, -1)], 64)) : (p(), a(t, { key: 1 }, [
|
|
177
177
|
o("div", C, [o("p", w, [o("span", le, _(Z(c.used)), 1), G.value ? (p(), a("span", ue, "of " + _(Q(c.limit)), 1)) : (p(), a("span", T, [
|
|
178
178
|
s(_(c.unit), 1),
|
|
179
179
|
c.unit ? (p(), a(t, { key: 0 }, [s(" · ")], 64)) : i("", !0),
|
|
180
180
|
l[2] ||= s("No limit", -1)
|
|
181
181
|
]))]), G.value ? (p(), a("span", {
|
|
182
182
|
key: 0,
|
|
183
|
-
class: d(["text-base font-
|
|
183
|
+
class: d(["text-base font-semibold tabular-nums", q.value === "ok" ? "text-heading" : J.value.text])
|
|
184
184
|
}, _(Math.round(K.value)) + "% ", 3)) : i("", !0)]),
|
|
185
185
|
G.value ? (p(), a("div", {
|
|
186
186
|
key: 0,
|
|
@@ -192,7 +192,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
192
192
|
"aria-valuetext": pe.value,
|
|
193
193
|
class: d(["relative h-2 w-full overflow-hidden rounded-full", J.value.track])
|
|
194
194
|
}, [o("div", {
|
|
195
|
-
class: d(["h-full rounded-full transition-[width,background-color] duration-
|
|
195
|
+
class: d(["h-full rounded-full transition-[width,background-color] duration-700 ease-out motion-reduce:transition-none", J.value.fill]),
|
|
196
196
|
style: f({ width: `${Math.min(100, K.value)}%` })
|
|
197
197
|
}, null, 6), (p(!0), a(t, null, m(fe.value, (e) => (p(), a("span", {
|
|
198
198
|
key: e,
|
|
@@ -202,7 +202,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
202
202
|
}, null, 4))), 128))], 10, E)) : i("", !0),
|
|
203
203
|
Y.value ? (p(), a("p", {
|
|
204
204
|
key: 1,
|
|
205
|
-
class: d(["text-xs", J.value.text])
|
|
205
|
+
class: d(["text-xs font-medium", J.value.text])
|
|
206
206
|
}, _(Y.value), 3)) : i("", !0)
|
|
207
207
|
], 64))])) : i("", !0),
|
|
208
208
|
z.default ? (p(), a("div", D, [h(n.$slots, "default")])) : i("", !0)
|
|
@@ -210,17 +210,17 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
210
210
|
c.breakdown.length ? (p(), a("div", O, [o("table", k, [c.breakdownHeaders.length ? (p(), a("thead", A, [o("tr", null, [(p(!0), a(t, null, m(c.breakdownHeaders, (e, t) => (p(), a("th", {
|
|
211
211
|
key: t,
|
|
212
212
|
scope: "col",
|
|
213
|
-
class: d(["h-
|
|
213
|
+
class: d(["h-10 px-5 font-semibold whitespace-nowrap", t > 0 ? "text-right" : "text-left"])
|
|
214
214
|
}, _(e), 3))), 128))])])) : i("", !0), o("tbody", null, [(p(!0), a(t, null, m(c.breakdown, (e, n) => (p(), a("tr", {
|
|
215
215
|
key: `${e.label}${n}`,
|
|
216
|
-
class: d(["border-t border-border
|
|
216
|
+
class: d(["border-t border-border", !c.breakdownHeaders.length && n === 0 && "border-t-0"])
|
|
217
217
|
}, [o("th", j, [o("span", M, [e.icon ? (p(), r(g(e.icon), {
|
|
218
218
|
key: 0,
|
|
219
219
|
class: "size-4 shrink-0 text-muted",
|
|
220
220
|
"aria-hidden": "true"
|
|
221
221
|
})) : i("", !0), o("span", N, _(e.label), 1)])]), (p(!0), a(t, null, m(e.values, (e, n) => (p(), a("td", {
|
|
222
222
|
key: n,
|
|
223
|
-
class: "px-
|
|
223
|
+
class: "px-5 py-2.5 text-right font-medium whitespace-nowrap text-heading tabular-nums"
|
|
224
224
|
}, [c.loading ? (p(), a("span", P)) : (p(), a(t, { key: 1 }, [s(_(Z(e)), 1)], 64))]))), 128))], 2))), 128))])])])) : i("", !0),
|
|
225
225
|
z.footer ? (p(), a("div", F, [h(n.$slots, "footer")])) : i("", !0)
|
|
226
226
|
], 10, re));
|
|
@@ -11,6 +11,16 @@ export interface UserMenuItem {
|
|
|
11
11
|
/** Greys the row out. */
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
}
|
|
14
|
+
export interface UserMenuWorkspace {
|
|
15
|
+
/** Handle used in URLs, e.g. `appscode`. Identifies the workspace in `v-model:workspace`. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Name to show, e.g. "AppsCode Inc.". Defaults to `name`. */
|
|
18
|
+
displayName?: string;
|
|
19
|
+
/** Logo or profile photo. Organisations without one show a building icon. */
|
|
20
|
+
avatarUrl?: string;
|
|
21
|
+
/** `user` is the personal account: a round avatar and "(Personal)". `organization` gets a square logo. */
|
|
22
|
+
type?: "user" | "organization";
|
|
23
|
+
}
|
|
14
24
|
export interface Props {
|
|
15
25
|
/** The person's name or username. The avatar shows its initials. */
|
|
16
26
|
name: string;
|
|
@@ -26,12 +36,16 @@ export interface Props {
|
|
|
26
36
|
showThemeMode?: boolean;
|
|
27
37
|
/** Adds a text-size switch (`AcFontScale`) that scales the whole interface. */
|
|
28
38
|
showFontScale?: boolean;
|
|
29
|
-
/** Shows the name next to the avatar in the trigger (from 640px up). */
|
|
39
|
+
/** Shows the name next to the avatar in the trigger (from 768px up) and a chevron (from 640px up). */
|
|
30
40
|
showName?: boolean;
|
|
31
41
|
/** Makes Sign out a link to this URL, e.g. `${accountsDomain}/user/logout`. `logout` is emitted either way. */
|
|
32
42
|
logoutUrl?: string;
|
|
33
43
|
/** Text of the sign-out row. */
|
|
34
44
|
logoutLabel?: string;
|
|
45
|
+
/** The person's account and organisations, listed at the top of the menu like cloud-ui's workspace switcher. Choosing one updates `v-model:workspace` and emits `switch-workspace`. */
|
|
46
|
+
workspaces?: UserMenuWorkspace[];
|
|
47
|
+
/** Heading of the workspace list. */
|
|
48
|
+
workspacesLabel?: string;
|
|
35
49
|
}
|
|
36
50
|
type __VLS_Props = Props;
|
|
37
51
|
type __VLS_Slots = {
|
|
@@ -44,6 +58,8 @@ type __VLS_Slots = {
|
|
|
44
58
|
type __VLS_ModelProps = {
|
|
45
59
|
/** Whether the menu is open. Bind with `v-model:open`. */
|
|
46
60
|
"open"?: boolean;
|
|
61
|
+
/** The current workspace's `name`. Bind with `v-model:workspace`. */
|
|
62
|
+
"workspace"?: string;
|
|
47
63
|
};
|
|
48
64
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
49
65
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -51,11 +67,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
51
67
|
"update:open": (value: boolean) => any;
|
|
52
68
|
"set:theme": (theme: "light" | "dark") => any;
|
|
53
69
|
logout: () => any;
|
|
70
|
+
"switch-workspace": (workspace: UserMenuWorkspace) => any;
|
|
71
|
+
"update:workspace": (value: string) => any;
|
|
54
72
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
55
73
|
onSelect?: ((item: UserMenuItem) => any) | undefined;
|
|
56
74
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
57
75
|
"onSet:theme"?: ((theme: "light" | "dark") => any) | undefined;
|
|
58
76
|
onLogout?: (() => any) | undefined;
|
|
77
|
+
"onSwitch-workspace"?: ((workspace: UserMenuWorkspace) => any) | undefined;
|
|
78
|
+
"onUpdate:workspace"?: ((value: string) => any) | undefined;
|
|
59
79
|
}>, {
|
|
60
80
|
items: UserMenuItem[];
|
|
61
81
|
email: string;
|
|
@@ -66,6 +86,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
66
86
|
showName: boolean;
|
|
67
87
|
logoutUrl: string;
|
|
68
88
|
logoutLabel: string;
|
|
89
|
+
workspaces: UserMenuWorkspace[];
|
|
90
|
+
workspacesLabel: string;
|
|
69
91
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
70
92
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
71
93
|
declare const _default: typeof __VLS_export;
|