@ac-design/design-system 2.0.0 → 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/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- 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 +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- 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 +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- 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.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- 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 +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- 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 +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- 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 +17 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- 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.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- 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 +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -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 +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- 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 +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- 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/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export type CostSummaryDot = Tone | "pending" | "muted" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8";
|
|
4
|
+
export interface CostSummarySpec {
|
|
5
|
+
/** Short name, e.g. "vCPU" or "SLA". */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Its value, e.g. "4" or "99.95%". */
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CostSummaryItem {
|
|
11
|
+
/** Unique key for the row. */
|
|
12
|
+
key: string | number;
|
|
13
|
+
/** What the cost is for, e.g. "Primary node", "Storage" or a node pool's name. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** A line of muted text under the label, e.g. "General purpose / 2 vCPU / 4 GB RAM". */
|
|
16
|
+
detail?: string;
|
|
17
|
+
/** The cost. A number is formatted with the card's currency; a string is shown as is, e.g. "Free". */
|
|
18
|
+
price: string | number;
|
|
19
|
+
/** Unit after the price. Defaults to the card's `total-period`. */
|
|
20
|
+
period?: string;
|
|
21
|
+
/** A Lucide icon in a 32px tile before the label. Rows with an icon get dashed dividers, as on cloud-ui's Create Kubernetes page. */
|
|
22
|
+
icon?: Component;
|
|
23
|
+
/** A 10px coloured dot before the label, as on cloud-ui's Create database page. */
|
|
24
|
+
dot?: CostSummaryDot;
|
|
25
|
+
/** A small grey tag under the label, e.g. the machine tier "General purpose". */
|
|
26
|
+
badge?: string;
|
|
27
|
+
/** Label and value pairs in a two-column grid under the label, e.g. vCPU, RAM, Nodes or SLA. */
|
|
28
|
+
specs?: CostSummarySpec[];
|
|
29
|
+
/** Greys the row out, for included or free lines such as the control plane. */
|
|
30
|
+
muted?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface Props {
|
|
33
|
+
/** Card title. */
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Line under the title, e.g. "Review before creation". */
|
|
36
|
+
subtitle?: string;
|
|
37
|
+
/** A Lucide icon in a tinted 32px tile before the title, with a primary wash and the icon as a watermark, like the other create-page cards. */
|
|
38
|
+
icon?: Component;
|
|
39
|
+
/** The cost lines. */
|
|
40
|
+
items?: CostSummaryItem[];
|
|
41
|
+
/** The total. A number is formatted with the currency; a string is shown as is. Defaults to the sum of the rows' number prices. */
|
|
42
|
+
total?: string | number;
|
|
43
|
+
/** Unit after the total, and after each row's price unless the row sets `period`, e.g. `/mo` or `/month`. */
|
|
44
|
+
totalPeriod?: string;
|
|
45
|
+
/** A line under the total, e.g. "$0.06/hour". */
|
|
46
|
+
totalDetail?: string;
|
|
47
|
+
/** Label before the total. */
|
|
48
|
+
totalLabel?: string;
|
|
49
|
+
/** ISO 4217 currency code for number prices, e.g. `USD` or `EUR`. */
|
|
50
|
+
currency?: string;
|
|
51
|
+
/** Locale for number prices. Defaults to `en-US`, so prices read "$40.00" as in cloud-ui. */
|
|
52
|
+
locale?: string;
|
|
53
|
+
/** Formats every number price and the total. Overrides `currency` and `locale`. */
|
|
54
|
+
formatter?: (value: number) => string;
|
|
55
|
+
/** A note at the bottom with an info icon, e.g. what the cost leaves out. Or use the `note` slot. */
|
|
56
|
+
note?: string;
|
|
57
|
+
/** Text shown when there are no rows. Say what to pick to see a cost. */
|
|
58
|
+
emptyText?: string;
|
|
59
|
+
/** Sticks to the top while the page scrolls, and caps the rows at 416px (46% of the window on short screens) so the total and actions stay in view. */
|
|
60
|
+
sticky?: boolean;
|
|
61
|
+
/** Distance from the top when sticky, e.g. `"80px"` under an app navbar. */
|
|
62
|
+
top?: string;
|
|
63
|
+
/** Shows placeholder rows and a placeholder total while prices load. */
|
|
64
|
+
loading?: boolean;
|
|
65
|
+
}
|
|
66
|
+
type __VLS_Slots = {
|
|
67
|
+
/** Under the total, e.g. the full-width Create button. */
|
|
68
|
+
actions?: () => unknown;
|
|
69
|
+
/** A note at the bottom, after an info icon. Replaces the `note` prop. */
|
|
70
|
+
note?: () => unknown;
|
|
71
|
+
/** Replaces a row's content. Gets the `item` and its formatted `price`, period included. */
|
|
72
|
+
item?: (props: {
|
|
73
|
+
item: CostSummaryItem;
|
|
74
|
+
price: string;
|
|
75
|
+
}) => unknown;
|
|
76
|
+
};
|
|
77
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
78
|
+
title: string;
|
|
79
|
+
icon: Component;
|
|
80
|
+
loading: boolean;
|
|
81
|
+
top: string;
|
|
82
|
+
items: CostSummaryItem[];
|
|
83
|
+
subtitle: string;
|
|
84
|
+
emptyText: string;
|
|
85
|
+
total: string | number;
|
|
86
|
+
totalPeriod: string;
|
|
87
|
+
totalDetail: string;
|
|
88
|
+
totalLabel: string;
|
|
89
|
+
currency: string;
|
|
90
|
+
locale: string;
|
|
91
|
+
formatter: (value: number) => string;
|
|
92
|
+
note: string;
|
|
93
|
+
sticky: boolean;
|
|
94
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
95
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
96
|
+
declare const _default: typeof __VLS_export;
|
|
97
|
+
export default _default;
|
|
98
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
99
|
+
new (): {
|
|
100
|
+
$slots: S;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createStaticVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useId as v, useSlots as y } from "vue";
|
|
2
|
+
import { Info as b } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcCostSummary.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var ee = ["aria-labelledby", "aria-busy"], x = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, te = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, S = { class: "min-w-0 flex-1" }, C = ["id"], w = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "mt-0.5 text-xs leading-4 text-muted"
|
|
15
|
+
}, T = {
|
|
16
|
+
key: 0,
|
|
17
|
+
role: "list",
|
|
18
|
+
class: "m-0 list-none divide-y divide-dashed divide-border/70 px-5",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
"data-testid": "ac-cost-summary-loading"
|
|
21
|
+
}, E = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "px-5 py-6 text-center text-base text-muted",
|
|
24
|
+
"data-testid": "ac-cost-summary-empty"
|
|
25
|
+
}, D = { class: "min-w-0 flex-1" }, O = { class: "flex min-w-0 items-center gap-2" }, k = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "mt-1.5 inline-block rounded-8 bg-surface-sunken/50 px-2 py-0.5 text-xs font-medium text-muted"
|
|
28
|
+
}, A = {
|
|
29
|
+
key: 2,
|
|
30
|
+
class: "m-0 mt-2 grid grid-cols-2 gap-x-3 gap-y-1.5"
|
|
31
|
+
}, j = { class: "shrink-0 text-base text-muted" }, M = { class: "m-0 truncate text-base font-medium text-heading" }, N = { class: "flex flex-col gap-3 border-t border-border/60 px-5 py-3.5" }, P = {
|
|
32
|
+
class: "flex items-baseline justify-between gap-2",
|
|
33
|
+
"aria-live": "polite",
|
|
34
|
+
"aria-atomic": "true",
|
|
35
|
+
"data-testid": "ac-cost-summary-total"
|
|
36
|
+
}, F = { class: "text-lg font-semibold text-heading" }, I = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "flex flex-col items-end gap-1.5 self-center",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, ne = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "ac-skeleton-bone block h-3 w-16 rounded-4"
|
|
43
|
+
}, L = {
|
|
44
|
+
key: 1,
|
|
45
|
+
class: "min-w-0 text-right"
|
|
46
|
+
}, R = { class: "text-3xl leading-tight font-bold break-words text-primary-strong tabular-nums" }, z = { class: "text-base font-medium tracking-normal text-muted" }, B = {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "text-base leading-tight text-muted"
|
|
49
|
+
}, V = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "sr-only"
|
|
52
|
+
}, H = {
|
|
53
|
+
key: 1,
|
|
54
|
+
class: "flex flex-col gap-2 [&>*]:w-full"
|
|
55
|
+
}, U = {
|
|
56
|
+
key: 2,
|
|
57
|
+
class: "flex items-start gap-1.5 text-xs leading-snug text-muted"
|
|
58
|
+
}, W = { class: "min-w-0" }, G = 3, K = /*@__PURE__*/ l({
|
|
59
|
+
__name: "AcCostSummary",
|
|
60
|
+
props: {
|
|
61
|
+
title: { default: "Cost summary" },
|
|
62
|
+
subtitle: { default: "" },
|
|
63
|
+
icon: { default: void 0 },
|
|
64
|
+
items: { default: () => [] },
|
|
65
|
+
total: { default: void 0 },
|
|
66
|
+
totalPeriod: { default: "/mo" },
|
|
67
|
+
totalDetail: { default: "" },
|
|
68
|
+
totalLabel: { default: "Total cost" },
|
|
69
|
+
currency: { default: "USD" },
|
|
70
|
+
locale: { default: "en-US" },
|
|
71
|
+
formatter: {
|
|
72
|
+
type: Function,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
note: { default: "" },
|
|
76
|
+
emptyText: { default: "Pick a plan to see the estimated cost." },
|
|
77
|
+
sticky: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
top: { default: "80px" },
|
|
82
|
+
loading: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !1
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
setup(l) {
|
|
88
|
+
let K = l, q = y(), J = {
|
|
89
|
+
primary: "bg-primary",
|
|
90
|
+
info: "bg-info",
|
|
91
|
+
success: "bg-success",
|
|
92
|
+
warning: "bg-warning",
|
|
93
|
+
danger: "bg-danger",
|
|
94
|
+
pending: "bg-pending",
|
|
95
|
+
muted: "bg-muted",
|
|
96
|
+
"chart-1": "bg-chart-1",
|
|
97
|
+
"chart-2": "bg-chart-2",
|
|
98
|
+
"chart-3": "bg-chart-3",
|
|
99
|
+
"chart-4": "bg-chart-4",
|
|
100
|
+
"chart-5": "bg-chart-5",
|
|
101
|
+
"chart-6": "bg-chart-6",
|
|
102
|
+
"chart-7": "bg-chart-7",
|
|
103
|
+
"chart-8": "bg-chart-8"
|
|
104
|
+
}, Y = v(), X = t(() => new Intl.NumberFormat(K.locale, {
|
|
105
|
+
style: "currency",
|
|
106
|
+
currency: K.currency
|
|
107
|
+
})), Z = t(() => K.items.some((e) => e.icon)), re = t(() => K.total === void 0 ? Q(K.items.reduce((e, t) => e + (typeof t.price == "number" ? t.price : 0), 0)) : Q(K.total));
|
|
108
|
+
function Q(e) {
|
|
109
|
+
return typeof e == "string" ? e : K.formatter ? K.formatter(e) : X.value.format(e);
|
|
110
|
+
}
|
|
111
|
+
function ie() {
|
|
112
|
+
return !!(K.note || q.note);
|
|
113
|
+
}
|
|
114
|
+
function $(e) {
|
|
115
|
+
return typeof e.price == "number" ? e.period ?? K.totalPeriod : e.period ?? "";
|
|
116
|
+
}
|
|
117
|
+
return (t, v) => (f(), i("section", {
|
|
118
|
+
class: u(["flex flex-col rounded-14 border border-border bg-surface text-body shadow-xs transition-shadow duration-200 hover:shadow-card motion-reduce:transition-none", l.sticky && "sticky"]),
|
|
119
|
+
style: d(l.sticky ? { top: l.top } : void 0),
|
|
120
|
+
"aria-labelledby": `${_(Y)}-title`,
|
|
121
|
+
"aria-busy": l.loading || void 0,
|
|
122
|
+
"data-ac-ds": "",
|
|
123
|
+
"data-testid": "ac-cost-summary"
|
|
124
|
+
}, [
|
|
125
|
+
a("header", { class: u(["relative isolate flex items-center gap-3 rounded-t-[calc(var(--radius-14)-1px)] px-5 pt-5 pb-3", l.icon && "border-b border-border/60 bg-linear-to-br from-primary/10 via-primary/3 to-transparent"]) }, [
|
|
126
|
+
l.icon ? (f(), i("div", x, [(f(), n(h(l.icon), { class: "absolute -top-4 -right-4 size-24 text-primary/5" }))])) : r("", !0),
|
|
127
|
+
l.icon ? (f(), i("span", te, [(f(), n(h(l.icon), { class: "size-4" }))])) : r("", !0),
|
|
128
|
+
a("div", S, [a("h3", {
|
|
129
|
+
id: `${_(Y)}-title`,
|
|
130
|
+
class: "truncate font-heading text-lg leading-tight font-semibold tracking-tight text-heading"
|
|
131
|
+
}, g(l.title), 9, C), l.subtitle ? (f(), i("p", w, g(l.subtitle), 1)) : r("", !0)])
|
|
132
|
+
], 2),
|
|
133
|
+
l.loading ? (f(), i("ul", T, [(f(), i(e, null, p(G, (e) => a("li", {
|
|
134
|
+
key: e,
|
|
135
|
+
class: "flex items-center gap-3 py-3.5"
|
|
136
|
+
}, [...v[0] ||= [o("<span class=\"ac-skeleton-bone block size-8 shrink-0 rounded-10\"></span><span class=\"min-w-0 flex-1\"><span class=\"ac-skeleton-bone block h-3.5 w-1/2 rounded-4\"></span><span class=\"ac-skeleton-bone mt-2 block h-3 w-1/3 rounded-4\"></span></span><span class=\"ac-skeleton-bone block h-3.5 w-16 shrink-0 rounded-4\"></span>", 3)]])), 64))])) : l.items.length ? (f(), i("ul", {
|
|
137
|
+
key: 2,
|
|
138
|
+
role: "list",
|
|
139
|
+
class: u(["m-0 list-none px-5", [Z.value ? "divide-y divide-dashed divide-border/70" : "flex flex-col gap-2.5 pb-3", l.sticky && "ac-scrollbar max-h-[min(46vh,416px)] overflow-y-auto"]])
|
|
140
|
+
}, [(f(!0), i(e, null, p(l.items, (o) => (f(), i("li", {
|
|
141
|
+
key: o.key,
|
|
142
|
+
class: u(["min-w-0", Z.value && "py-3.5"])
|
|
143
|
+
}, [m(t.$slots, "item", {
|
|
144
|
+
item: o,
|
|
145
|
+
price: `${Q(o.price)}${$(o)}`
|
|
146
|
+
}, () => [a("div", { class: u(["flex gap-3", Z.value ? "items-start" : "items-center"]) }, [Z.value && o.icon ? (f(), i("span", {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: u(["flex size-8 shrink-0 items-center justify-center rounded-10 bg-surface-sunken/40", o.muted && "opacity-60"]),
|
|
149
|
+
"aria-hidden": "true"
|
|
150
|
+
}, [(f(), n(h(o.icon), { class: "size-4 text-muted" }))], 2)) : r("", !0), a("div", D, [
|
|
151
|
+
a("div", { class: u(["flex justify-between gap-2", Z.value ? "items-baseline" : "items-center"]) }, [a("span", O, [o.dot ? (f(), i("span", {
|
|
152
|
+
key: 0,
|
|
153
|
+
class: u(["size-2.5 shrink-0 rounded-full", [J[o.dot], o.muted && "opacity-60"]]),
|
|
154
|
+
"aria-hidden": "true"
|
|
155
|
+
}, null, 2)) : r("", !0), a("span", { class: u(["truncate", [Z.value ? "text-lg font-semibold" : "text-base", o.muted ? "text-muted" : "text-heading"]]) }, g(o.label), 3)]), a("span", { class: u(["whitespace-nowrap tabular-nums", [Z.value ? "text-lg font-semibold" : "text-base font-medium", o.muted ? "text-muted" : "text-heading"]]) }, [s(g(Q(o.price)), 1), a("span", { class: u(Z.value && "text-base font-normal text-muted") }, g($(o)), 3)], 2)], 2),
|
|
156
|
+
o.detail ? (f(), i("p", {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: u(["text-muted", Z.value ? "mt-0.5 text-base" : ["mt-2.5 text-xs leading-relaxed", o.dot && "ml-[18px]"]])
|
|
159
|
+
}, g(o.detail), 3)) : r("", !0),
|
|
160
|
+
o.badge ? (f(), i("span", k, g(o.badge), 1)) : r("", !0),
|
|
161
|
+
o.specs?.length ? (f(), i("dl", A, [(f(!0), i(e, null, p(o.specs, (e) => (f(), i("div", {
|
|
162
|
+
key: e.label,
|
|
163
|
+
class: "flex min-w-0 items-baseline gap-1.5"
|
|
164
|
+
}, [a("dt", j, g(e.label), 1), a("dd", M, g(e.value), 1)]))), 128))])) : r("", !0)
|
|
165
|
+
])], 2)])], 2))), 128))], 2)) : (f(), i("p", E, g(l.emptyText), 1)),
|
|
166
|
+
a("div", N, [
|
|
167
|
+
a("div", P, [a("span", F, g(l.totalLabel), 1), l.loading ? (f(), i("div", I, [v[1] ||= a("span", { class: "ac-skeleton-bone block h-6 w-24 rounded-6" }, null, -1), l.totalDetail ? (f(), i("span", ne)) : r("", !0)])) : (f(), i("div", L, [a("div", R, [s(g(re.value), 1), a("span", z, g(l.totalPeriod), 1)]), l.totalDetail ? (f(), i("div", B, g(l.totalDetail), 1)) : r("", !0)]))]),
|
|
168
|
+
l.loading ? (f(), i("span", V, "Loading prices")) : r("", !0),
|
|
169
|
+
t.$slots.actions ? (f(), i("div", H, [m(t.$slots, "actions")])) : r("", !0),
|
|
170
|
+
ie() ? (f(), i("p", U, [c(_(b), {
|
|
171
|
+
class: "mt-px size-4 shrink-0",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}), a("span", W, [m(t.$slots, "note", {}, () => [s(g(l.note), 1)])])])) : r("", !0)
|
|
174
|
+
])
|
|
175
|
+
], 14, ee));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
//#endregion
|
|
179
|
+
export { K as default };
|
|
@@ -29,7 +29,7 @@ export interface Props {
|
|
|
29
29
|
locale?: string;
|
|
30
30
|
/** First column of the calendar, 0 = Sunday … 6 = Saturday. Defaults to the locale's. */
|
|
31
31
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
32
|
-
/** Adds a seconds
|
|
32
|
+
/** Adds a seconds column to the Time tab in `datetime` mode. */
|
|
33
33
|
showSeconds?: boolean;
|
|
34
34
|
/** Shows a clear button when there is a value. */
|
|
35
35
|
clearable?: boolean;
|
|
@@ -41,7 +41,7 @@ export interface Props {
|
|
|
41
41
|
errorMsg?: string;
|
|
42
42
|
/** Help text between the label and the field. */
|
|
43
43
|
hint?: string;
|
|
44
|
-
/** `small` 36px or `normal`
|
|
44
|
+
/** `small` 36px or `normal` 42px tall, the same as `AcInput`. */
|
|
45
45
|
size?: "small" | "normal";
|
|
46
46
|
/** Adds a hidden input with this name so plain form posts include the value. A range posts as `start/end`. */
|
|
47
47
|
name?: string;
|
|
@@ -76,11 +76,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
76
76
|
clearable: boolean;
|
|
77
77
|
errorMsg: string;
|
|
78
78
|
presets: DatePickerPreset[];
|
|
79
|
+
locale: string;
|
|
79
80
|
minDate: string;
|
|
80
81
|
maxDate: string;
|
|
81
82
|
isDateDisabled: (day: string) => boolean;
|
|
82
83
|
timeZone: string;
|
|
83
|
-
locale: string;
|
|
84
84
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
85
85
|
showSeconds: boolean;
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|