@ac-design/design-system 2.2.1 → 2.3.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/compat.css +210 -0
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +432 -369
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +190 -174
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +206 -174
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./AcSpinner.js";
|
|
2
2
|
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, toDisplayString as u, withCtx as d } from "vue";
|
|
3
3
|
//#region src/lib/components/AcButton.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var f = /*@__PURE__*/ a({
|
|
4
|
+
var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
|
|
5
5
|
__name: "AcButton",
|
|
6
6
|
props: {
|
|
7
7
|
title: { default: "" },
|
|
@@ -25,45 +25,68 @@ var f = /*@__PURE__*/ a({
|
|
|
25
25
|
rounded: {
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: !1
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
boxed: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
hint: { default: void 0 }
|
|
29
34
|
},
|
|
30
35
|
emits: ["click"],
|
|
31
|
-
setup(a, { emit:
|
|
32
|
-
let
|
|
36
|
+
setup(a, { emit: p }) {
|
|
37
|
+
let m = a, h = p, g = {
|
|
33
38
|
primary: {
|
|
34
39
|
solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-sm",
|
|
35
40
|
light: "border-transparent bg-primary/12 text-primary-strong hover:bg-primary/18",
|
|
36
|
-
|
|
41
|
+
subtle: "border-transparent bg-primary/6 text-primary-strong hover:bg-primary/12",
|
|
42
|
+
outlined: "border-primary/35 bg-background text-primary-strong hover:bg-primary/10",
|
|
43
|
+
ghost: "border-transparent bg-transparent text-primary-strong hover:bg-primary/10"
|
|
37
44
|
},
|
|
38
45
|
info: {
|
|
39
46
|
solid: "border-transparent bg-info text-white shadow-button hover:bg-info-hover hover:shadow-sm",
|
|
40
47
|
light: "border-transparent bg-info/12 text-info-strong hover:bg-info/18",
|
|
41
|
-
|
|
48
|
+
subtle: "border-transparent bg-info/6 text-info-strong hover:bg-info/12",
|
|
49
|
+
outlined: "border-info/40 bg-background text-info-strong hover:bg-info/10",
|
|
50
|
+
ghost: "border-transparent bg-transparent text-info-strong hover:bg-info/10"
|
|
42
51
|
},
|
|
43
52
|
success: {
|
|
44
53
|
solid: "border-transparent bg-success text-white shadow-button hover:bg-success-hover hover:shadow-sm",
|
|
45
54
|
light: "border-transparent bg-success/12 text-success-strong hover:bg-success/18",
|
|
46
|
-
|
|
55
|
+
subtle: "border-transparent bg-success/6 text-success-strong hover:bg-success/12",
|
|
56
|
+
outlined: "border-success/40 bg-background text-success-strong hover:bg-success/10",
|
|
57
|
+
ghost: "border-transparent bg-transparent text-success-strong hover:bg-success/10"
|
|
47
58
|
},
|
|
48
59
|
warning: {
|
|
49
60
|
solid: "border-transparent bg-warning text-on-warning shadow-button hover:bg-warning-hover hover:shadow-sm",
|
|
50
61
|
light: "border-transparent bg-warning/12 text-warning-strong hover:bg-warning/18",
|
|
51
|
-
|
|
62
|
+
subtle: "border-transparent bg-warning/6 text-warning-strong hover:bg-warning/12",
|
|
63
|
+
outlined: "border-warning/45 bg-background text-warning-strong hover:bg-warning/10",
|
|
64
|
+
ghost: "border-transparent bg-transparent text-warning-strong hover:bg-warning/10"
|
|
52
65
|
},
|
|
53
66
|
danger: {
|
|
54
67
|
solid: "border-transparent bg-red-50 text-white shadow-button hover:bg-red-40 hover:shadow-sm",
|
|
55
68
|
light: "border-transparent bg-danger/12 text-danger-strong hover:bg-danger/18",
|
|
56
|
-
|
|
69
|
+
subtle: "border-transparent bg-danger/6 text-danger-strong hover:bg-danger/12",
|
|
70
|
+
outlined: "border-danger/40 bg-background text-danger-strong hover:bg-danger/10",
|
|
71
|
+
ghost: "border-transparent bg-transparent text-danger-strong hover:bg-danger/10"
|
|
72
|
+
},
|
|
73
|
+
neutral: {
|
|
74
|
+
solid: "border-transparent bg-body text-background shadow-button hover:bg-body/90 hover:shadow-sm",
|
|
75
|
+
light: "border-transparent bg-surface-sunken text-heading hover:bg-accent-hover",
|
|
76
|
+
subtle: "border-transparent bg-surface-sunken/70 text-heading hover:bg-surface-sunken",
|
|
77
|
+
outlined: "border-border bg-background text-heading hover:bg-surface-sunken/70",
|
|
78
|
+
ghost: "border-transparent bg-transparent text-heading hover:bg-surface-sunken"
|
|
57
79
|
}
|
|
58
|
-
},
|
|
80
|
+
}, _ = {
|
|
59
81
|
primary: "text-primary-strong",
|
|
60
82
|
info: "text-info-strong",
|
|
61
83
|
success: "text-success-strong",
|
|
62
84
|
warning: "text-warning-strong",
|
|
63
85
|
danger: "text-danger-strong",
|
|
86
|
+
neutral: "text-muted hover:text-heading",
|
|
64
87
|
white: "text-muted hover:text-heading",
|
|
65
88
|
ghost: "text-muted hover:text-heading"
|
|
66
|
-
},
|
|
89
|
+
}, v = t(() => m.variant === "link"), y = t(() => v.value && !m.boxed), b = t(() => m.variant === "link" ? _[m.color] : m.color === "white" ? g.neutral.outlined : m.color === "ghost" ? g.neutral.ghost : g[m.color][m.variant]), x = {
|
|
67
90
|
xs: {
|
|
68
91
|
base: "h-7 gap-1.5 px-2 text-xs",
|
|
69
92
|
icon: "size-7 text-xs"
|
|
@@ -79,22 +102,27 @@ var f = /*@__PURE__*/ a({
|
|
|
79
102
|
medium: {
|
|
80
103
|
base: "h-10.5 gap-2 px-5 text-base md:h-11 md:text-lg",
|
|
81
104
|
icon: "size-11 text-lg"
|
|
105
|
+
},
|
|
106
|
+
xlarge: {
|
|
107
|
+
base: "h-12 gap-2 px-6 text-lg md:h-13 md:text-xl",
|
|
108
|
+
icon: "size-14 text-xl"
|
|
82
109
|
}
|
|
83
|
-
},
|
|
84
|
-
xs: "gap-1 text-xs [&_svg]:size-3.5",
|
|
85
|
-
small:
|
|
86
|
-
normal:
|
|
87
|
-
medium:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
110
|
+
}, S = {
|
|
111
|
+
xs: "gap-1 text-xs [:where(&)_svg]:size-3.5",
|
|
112
|
+
small: `gap-1 text-base ${f}`,
|
|
113
|
+
normal: `gap-1 text-base ${f}`,
|
|
114
|
+
medium: `gap-1 text-base md:text-lg ${f}`,
|
|
115
|
+
xlarge: `gap-1 text-lg md:text-xl ${f}`
|
|
116
|
+
}, C = t(() => {
|
|
117
|
+
if (y.value) return [S[m.size], m.rounded ? "rounded-full" : "rounded-4"];
|
|
118
|
+
let e = x[m.size];
|
|
119
|
+
return m.iconOnly ? [`${e.icon} rounded-full`, f] : [
|
|
92
120
|
e.base,
|
|
93
|
-
|
|
94
|
-
|
|
121
|
+
m.rounded ? "rounded-full" : "rounded-10",
|
|
122
|
+
f
|
|
95
123
|
];
|
|
96
|
-
}),
|
|
97
|
-
!
|
|
124
|
+
}), w = t(() => y.value ? "group/ac-button underline-offset-4 hover:underline" : v.value ? "group/ac-button justify-center border border-transparent underline-offset-4 hover:underline" : "justify-center border active:translate-y-px disabled:shadow-none disabled:active:translate-y-0 motion-reduce:active:translate-y-0"), T = (e) => {
|
|
125
|
+
!m.disabled && !m.loading && h("click", e);
|
|
98
126
|
};
|
|
99
127
|
return (t, f) => (s(), n(l(a.href ? "a" : "button"), {
|
|
100
128
|
href: a.href && !a.disabled ? a.href : void 0,
|
|
@@ -102,25 +130,26 @@ var f = /*@__PURE__*/ a({
|
|
|
102
130
|
disabled: !a.href && a.disabled || void 0,
|
|
103
131
|
"aria-disabled": a.href && a.disabled || void 0,
|
|
104
132
|
"aria-busy": a.loading || void 0,
|
|
133
|
+
title: a.hint || void 0,
|
|
105
134
|
class: o(["relative inline-flex cursor-pointer items-center font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] duration-200 select-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50", [
|
|
106
|
-
|
|
107
|
-
|
|
135
|
+
w.value,
|
|
136
|
+
b.value,
|
|
108
137
|
"focus-visible:ring-ring",
|
|
109
|
-
|
|
138
|
+
C.value,
|
|
110
139
|
a.loading && "pointer-events-none"
|
|
111
140
|
]]),
|
|
112
141
|
"data-ac-ds": "",
|
|
113
142
|
"data-testid": "ac-button",
|
|
114
|
-
onClick:
|
|
143
|
+
onClick: T
|
|
115
144
|
}, {
|
|
116
145
|
default: d(() => [
|
|
117
146
|
a.loading ? (s(), n(e, {
|
|
118
147
|
key: 0,
|
|
119
|
-
class: o(!a.iconOnly && !
|
|
148
|
+
class: o(!a.iconOnly && !y.value && "-ml-0.5"),
|
|
120
149
|
label: ""
|
|
121
150
|
}, null, 8, ["class"])) : t.$slots.icon ? (s(), i("span", {
|
|
122
151
|
key: 1,
|
|
123
|
-
class: o([!a.iconOnly && !
|
|
152
|
+
class: o([!a.iconOnly && !y.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
|
|
124
153
|
"aria-hidden": "true"
|
|
125
154
|
}, [c(t.$slots, "icon")], 2)) : r("", !0),
|
|
126
155
|
a.title ? (s(), i("span", {
|
|
@@ -130,7 +159,7 @@ var f = /*@__PURE__*/ a({
|
|
|
130
159
|
a.iconOnly && a.loading ? r("", !0) : c(t.$slots, "default", {}, void 0, void 0, 3),
|
|
131
160
|
t.$slots["icon-right"] ? (s(), i("span", {
|
|
132
161
|
key: 4,
|
|
133
|
-
class: o(["inline-flex shrink-0 items-center justify-center",
|
|
162
|
+
class: o(["inline-flex shrink-0 items-center justify-center", v.value ? "transition-transform duration-200 group-hover/ac-button:translate-x-0.5 motion-reduce:transition-none motion-reduce:group-hover/ac-button:translate-x-0" : "-mr-0.5"]),
|
|
134
163
|
"aria-hidden": "true"
|
|
135
164
|
}, [c(t.$slots, "icon-right")], 2)) : r("", !0)
|
|
136
165
|
]),
|
|
@@ -141,9 +170,10 @@ var f = /*@__PURE__*/ a({
|
|
|
141
170
|
"disabled",
|
|
142
171
|
"aria-disabled",
|
|
143
172
|
"aria-busy",
|
|
173
|
+
"title",
|
|
144
174
|
"class"
|
|
145
175
|
]));
|
|
146
176
|
}
|
|
147
177
|
});
|
|
148
178
|
//#endregion
|
|
149
|
-
export {
|
|
179
|
+
export { p as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component } from "vue";
|
|
2
2
|
export interface Props {
|
|
3
|
-
/** Header title. The header renders with a title, an `icon`, or the `actions` or `
|
|
3
|
+
/** Header title. The header renders with a title, a description, an `icon`, or the `actions`, `badges` or `description` slot. */
|
|
4
4
|
title?: string;
|
|
5
5
|
/** Small line under the title. */
|
|
6
6
|
subtitle?: string;
|
|
@@ -16,8 +16,12 @@ export interface Props {
|
|
|
16
16
|
variant?: "default" | "muted" | "dashed" | "danger";
|
|
17
17
|
/** Tints the header icon tile, the `accent` wash and the watermark: `primary` (green), `blue`, `violet`, `red` or `amber`. */
|
|
18
18
|
color?: "primary" | "blue" | "violet" | "red" | "amber";
|
|
19
|
-
/** `normal` header with a 16px title and a divider; `small` a compact header with a 28px icon tile, a 14px title and no divider, like cloud-ui's section cards. */
|
|
20
|
-
headerSize?: "normal" | "small";
|
|
19
|
+
/** `normal` header with a 16px title and a divider; `small` a compact header with a 28px icon tile, a 14px title and no divider, like cloud-ui's section cards; `bar` a compact single-line bar (10px top and bottom, centred) with a divider over the body, for dense detail pages (cloud-ui's `headerSize="sm"`). */
|
|
20
|
+
headerSize?: "normal" | "small" | "bar";
|
|
21
|
+
/** Heading level of the title, so the card fits the page outline, e.g. `h2` for a top-level section. */
|
|
22
|
+
titleTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
23
|
+
/** A plain card: no header or footer, the padding on the card itself, and the default slot straight inside it, so classes on the card such as `flex items-center`, `grid`, `space-y-4` or `divide-y` lay out your content. Padding comes from `padding` (24px by default; `padded=false` removes it); a background class on the card replaces the variant's fill. */
|
|
24
|
+
bare?: boolean;
|
|
21
25
|
/** Hover look for a card that acts as a link or button: a pointer, a primary-tinted edge and a light wash. */
|
|
22
26
|
hoverable?: boolean;
|
|
23
27
|
/** Rests the card on a faint shadow that deepens on hover; with `hoverable` the card also lifts 2px. */
|
|
@@ -32,7 +36,7 @@ type __VLS_Slots = {
|
|
|
32
36
|
default?: () => unknown;
|
|
33
37
|
/** Buttons on the right of the header. */
|
|
34
38
|
actions?: () => unknown;
|
|
35
|
-
/** Replaces the `icon` tile's content, e.g. a logo image. */
|
|
39
|
+
/** Replaces the `icon` tile's content, e.g. a logo image. An unsized SVG icon here is 16px (14px with `header-size="small"`), and with `accent` it's also the watermark. */
|
|
36
40
|
icon?: () => unknown;
|
|
37
41
|
/** Replaces the line under the title, e.g. text with a link. */
|
|
38
42
|
description?: () => unknown;
|
|
@@ -50,7 +54,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
50
54
|
subtitle: string;
|
|
51
55
|
padded: boolean;
|
|
52
56
|
padding: "none" | "xs" | "sm" | "md" | "lg";
|
|
53
|
-
headerSize: "normal" | "small";
|
|
57
|
+
headerSize: "normal" | "small" | "bar";
|
|
58
|
+
titleTag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
59
|
+
bare: boolean;
|
|
54
60
|
hoverable: boolean;
|
|
55
61
|
shadow: boolean;
|
|
56
62
|
accent: boolean;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o,
|
|
1
|
+
import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, useSlots as m, withCtx as h } from "vue";
|
|
2
2
|
//#region src/lib/components/AcCard.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]",
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
7
|
+
}, _ = { class: "min-w-0 flex-1" }, v = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "mt-0.5 text-xs leading-4 text-muted"
|
|
10
|
-
},
|
|
10
|
+
}, y = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "mt-0.5 text-xs leading-4 text-muted"
|
|
13
|
-
},
|
|
13
|
+
}, b = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "flex shrink-0 flex-wrap items-center gap-2"
|
|
16
|
-
},
|
|
16
|
+
}, x = /*@__PURE__*/ c({
|
|
17
17
|
__name: "AcCard",
|
|
18
18
|
props: {
|
|
19
19
|
title: { default: "" },
|
|
@@ -28,6 +28,11 @@ var h = {
|
|
|
28
28
|
variant: { default: "default" },
|
|
29
29
|
color: { default: "primary" },
|
|
30
30
|
headerSize: { default: "normal" },
|
|
31
|
+
titleTag: { default: "h3" },
|
|
32
|
+
bare: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
31
36
|
hoverable: {
|
|
32
37
|
type: Boolean,
|
|
33
38
|
default: !1
|
|
@@ -42,12 +47,17 @@ var h = {
|
|
|
42
47
|
},
|
|
43
48
|
as: { default: "section" }
|
|
44
49
|
},
|
|
45
|
-
setup(
|
|
46
|
-
let
|
|
50
|
+
setup(c) {
|
|
51
|
+
let x = c, S = m(), C = {
|
|
47
52
|
default: "border-border bg-surface",
|
|
48
53
|
muted: "border-border bg-surface-sunken/40",
|
|
49
54
|
dashed: "border-dashed border-border bg-transparent",
|
|
50
55
|
danger: "border-danger/30 bg-danger/5"
|
|
56
|
+
}, w = {
|
|
57
|
+
default: "border-border [:where(&)]:bg-surface",
|
|
58
|
+
muted: "border-border [:where(&)]:bg-surface-sunken/40",
|
|
59
|
+
dashed: "border-dashed border-border [:where(&)]:bg-transparent",
|
|
60
|
+
danger: "border-danger/30 [:where(&)]:bg-danger/5"
|
|
51
61
|
}, T = {
|
|
52
62
|
none: "",
|
|
53
63
|
xs: "p-3",
|
|
@@ -113,77 +123,115 @@ var h = {
|
|
|
113
123
|
washSm: "from-warning/[0.07]",
|
|
114
124
|
watermark: "text-warning/5"
|
|
115
125
|
}
|
|
116
|
-
}, A = n(() =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
}, A = n(() => x.headerSize === "bar"), j = n(() => x.headerSize === "small" || A.value), M = n(() => k[x.color]), N = n(() => x.description || x.subtitle), P = n(() => [
|
|
127
|
+
C[x.variant],
|
|
128
|
+
x.as !== "section" && "w-full text-left no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
129
|
+
x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
|
|
130
|
+
x.shadow && "shadow-xs hover:shadow-card",
|
|
131
|
+
x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
|
|
122
132
|
]);
|
|
123
|
-
function
|
|
124
|
-
return !!(
|
|
125
|
-
}
|
|
126
|
-
function F(n) {
|
|
127
|
-
return n.some((n) => n.type === e ? !1 : n.type !== t || F(n.children));
|
|
133
|
+
function F() {
|
|
134
|
+
return !!(x.title || N.value || x.icon || S.icon || S.actions || S.badges || S.description);
|
|
128
135
|
}
|
|
129
136
|
function I() {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
function L() {
|
|
133
|
-
let e = I(), t = S.padding;
|
|
137
|
+
let e = x.padding ?? (x.padded ? "md" : "none"), t = x.as !== "section" && x.as !== "div";
|
|
134
138
|
return [
|
|
139
|
+
w[x.variant],
|
|
140
|
+
T[e],
|
|
141
|
+
t && "block no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
142
|
+
x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
|
|
143
|
+
x.shadow && "shadow-xs hover:shadow-card",
|
|
144
|
+
x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
function L(n) {
|
|
148
|
+
return n.some((n) => n.type === e ? !1 : n.type !== t || L(n.children));
|
|
149
|
+
}
|
|
150
|
+
function R() {
|
|
151
|
+
return L(S.default?.() ?? []);
|
|
152
|
+
}
|
|
153
|
+
function z() {
|
|
154
|
+
let e = R(), t = x.padding;
|
|
155
|
+
return A.value ? [
|
|
156
|
+
"items-center gap-2.5 px-4 py-2.5",
|
|
157
|
+
e && "border-b border-border",
|
|
158
|
+
!e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
|
|
159
|
+
x.accent && ["bg-linear-to-r to-transparent", M.value.washSm]
|
|
160
|
+
] : [
|
|
135
161
|
t ? [
|
|
136
162
|
"items-start gap-3",
|
|
137
163
|
E[t],
|
|
138
164
|
D[t],
|
|
139
|
-
!
|
|
140
|
-
] :
|
|
165
|
+
!j.value && "border-border/60"
|
|
166
|
+
] : j.value ? "items-start gap-3 px-5 pt-5" : "items-start gap-3 border-border/60 px-6 pt-5",
|
|
141
167
|
!e && (t ? O[t] : "pb-5"),
|
|
142
|
-
e && !
|
|
143
|
-
!e && !
|
|
144
|
-
|
|
168
|
+
e && !j.value && "border-b pb-3",
|
|
169
|
+
!e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
|
|
170
|
+
x.accent && (j.value ? ["bg-linear-to-r to-transparent", M.value.washSm] : ["bg-linear-to-br to-transparent", M.value.wash])
|
|
145
171
|
];
|
|
146
172
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
173
|
+
function B() {
|
|
174
|
+
return x.padding && x.padding !== "none" ? T[x.padding] : x.padded && x.padding !== "none" ? j.value ? "p-5" : "p-6" : [
|
|
149
175
|
"overflow-hidden",
|
|
150
|
-
!
|
|
151
|
-
!
|
|
176
|
+
!S.footer && "rounded-b-14",
|
|
177
|
+
!F() && "rounded-t-14"
|
|
152
178
|
];
|
|
153
179
|
}
|
|
154
|
-
return (e, t) => (
|
|
155
|
-
|
|
180
|
+
return (e, t) => c.bare ? (u(), r(f(c.as), {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: l(["rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", I()]),
|
|
156
183
|
"data-ac-ds": "",
|
|
157
184
|
"data-testid": "ac-card"
|
|
158
185
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
|
|
186
|
+
default: h(() => [d(e.$slots, "default")]),
|
|
187
|
+
_: 3
|
|
188
|
+
}, 8, ["class"])) : (u(), r(f(c.as), {
|
|
189
|
+
key: 1,
|
|
190
|
+
class: l(["flex flex-col rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", P.value]),
|
|
191
|
+
"data-ac-ds": "",
|
|
192
|
+
"data-testid": "ac-card"
|
|
193
|
+
}, {
|
|
194
|
+
default: h(() => [
|
|
195
|
+
F() ? (u(), a("header", {
|
|
161
196
|
key: 0,
|
|
162
|
-
class:
|
|
197
|
+
class: l(["relative isolate flex flex-wrap justify-between rounded-t-[calc(var(--radius-14)-1px)]", z()])
|
|
163
198
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
199
|
+
c.accent && (c.icon || e.$slots.icon) && !j.value ? (u(), a("div", g, [c.icon ? (u(), r(f(c.icon), {
|
|
200
|
+
key: 0,
|
|
201
|
+
class: l(["absolute -top-4 -right-4 size-24", M.value.watermark])
|
|
202
|
+
}, null, 8, ["class"])) : (u(), a("span", {
|
|
203
|
+
key: 1,
|
|
204
|
+
class: l(["absolute -top-4 -right-4 [&_svg]:size-24!", M.value.watermark])
|
|
205
|
+
}, [d(e.$slots, "icon")], 2))])) : i("", !0),
|
|
206
|
+
o("div", { class: l(["flex min-w-0 flex-1 items-center", A.value ? "gap-2.5" : "gap-3"]) }, [c.icon || e.$slots.icon ? (u(), a("span", {
|
|
166
207
|
key: 0,
|
|
167
|
-
class:
|
|
208
|
+
class: l(["flex shrink-0 items-center justify-center", [
|
|
209
|
+
M.value.tile,
|
|
210
|
+
j.value ? ["size-7 rounded-8 ring-1 ring-inset", M.value.ring] : ["size-8 rounded-10 border", M.value.border],
|
|
211
|
+
c.headerSize === "small" ? "[:where(&)_svg]:size-3.5" : "[:where(&)_svg]:size-4"
|
|
212
|
+
]]),
|
|
168
213
|
"aria-hidden": "true"
|
|
169
|
-
}, [
|
|
214
|
+
}, [d(e.$slots, "icon", {}, () => [(u(), r(f(c.icon), { class: l(c.headerSize === "small" ? "size-3.5" : "size-4") }, null, 8, ["class"]))])], 2)) : i("", !0), o("div", _, [o("div", { class: l(["flex flex-wrap items-center", A.value ? "gap-2.5" : "gap-2"]) }, [c.title ? (u(), r(f(c.titleTag), {
|
|
170
215
|
key: 0,
|
|
171
|
-
class:
|
|
172
|
-
},
|
|
173
|
-
|
|
216
|
+
class: l(["truncate font-heading font-semibold tracking-tight text-heading", j.value ? "text-base" : "text-lg leading-tight"])
|
|
217
|
+
}, {
|
|
218
|
+
default: h(() => [s(p(c.title), 1)]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["class"])) : i("", !0), d(e.$slots, "badges")], 2), e.$slots.description ? (u(), a("div", v, [d(e.$slots, "description")])) : N.value ? (u(), a("p", y, p(N.value), 1)) : i("", !0)])], 2),
|
|
221
|
+
e.$slots.actions ? (u(), a("div", b, [d(e.$slots, "actions")])) : i("", !0)
|
|
174
222
|
], 2)) : i("", !0),
|
|
175
|
-
|
|
223
|
+
R() ? (u(), a("div", {
|
|
176
224
|
key: 1,
|
|
177
|
-
class:
|
|
178
|
-
}, [
|
|
179
|
-
e.$slots.footer ? (
|
|
225
|
+
class: l(["flex-1", B()])
|
|
226
|
+
}, [d(e.$slots, "default")], 2)) : i("", !0),
|
|
227
|
+
e.$slots.footer ? (u(), a("footer", {
|
|
180
228
|
key: 2,
|
|
181
|
-
class:
|
|
182
|
-
}, [
|
|
229
|
+
class: l(["flex flex-wrap items-center gap-3 border-t border-border py-3 text-base text-muted", c.padding ? E[c.padding] : j.value ? "px-5" : "px-6"])
|
|
230
|
+
}, [d(e.$slots, "footer")], 2)) : i("", !0)
|
|
183
231
|
]),
|
|
184
232
|
_: 3
|
|
185
233
|
}, 8, ["class"]));
|
|
186
234
|
}
|
|
187
235
|
});
|
|
188
236
|
//#endregion
|
|
189
|
-
export {
|
|
237
|
+
export { x as default };
|
|
@@ -47,8 +47,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
47
47
|
disabled: boolean;
|
|
48
48
|
name: string;
|
|
49
49
|
size: "small" | "normal";
|
|
50
|
-
readonly: boolean;
|
|
51
50
|
hint: string;
|
|
51
|
+
readonly: boolean;
|
|
52
52
|
errorMsg: string;
|
|
53
53
|
presets: (string | ColorPreset)[];
|
|
54
54
|
swatchOnly: boolean;
|
|
@@ -45,8 +45,22 @@ export interface Props {
|
|
|
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;
|
|
48
|
+
/** Draws the calendar in place, with no field, popover or border. In `date` mode each click updates `v-model` at once, and there's no Today button. */
|
|
49
|
+
inline?: boolean;
|
|
50
|
+
/** Saves each pick in `datetime` mode at once, with no Apply or Cancel; the popover stays open so the time can be set too. An empty value starts at the current time. */
|
|
51
|
+
autoApply?: boolean;
|
|
52
|
+
/** `24` shows 00–23 on the Time tab; `12` shows 1–12 with an AM/PM column, and the field reads `07:30 PM`. `v-model` is unchanged. Cloud `hour12`. */
|
|
53
|
+
hourCycle?: 12 | 24;
|
|
54
|
+
/** Shows the time-zone name in the field text and under the Time tab, e.g. `GMT+6`. */
|
|
55
|
+
showTimeZone?: boolean;
|
|
48
56
|
}
|
|
49
57
|
type __VLS_Props = Props;
|
|
58
|
+
type __VLS_Slots = {
|
|
59
|
+
/** Content before the label text, such as a 14px icon. */
|
|
60
|
+
"label-icon"?: () => unknown;
|
|
61
|
+
/** Content after the label text, such as "(Optional)" or an info tooltip. */
|
|
62
|
+
"label-extra"?: () => unknown;
|
|
63
|
+
};
|
|
50
64
|
type __VLS_ModelProps = {
|
|
51
65
|
/** `date`: `"2026-09-30"`. `datetime`: `"2026-09-30T14:05:00Z"` (UTC). `duration`: `"26h30m"`. With `range`: `[start, end]`. `null` when empty. */
|
|
52
66
|
modelValue?: string | [string, string] | null;
|
|
@@ -54,9 +68,9 @@ type __VLS_ModelProps = {
|
|
|
54
68
|
"open"?: boolean;
|
|
55
69
|
};
|
|
56
70
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
57
|
-
declare const
|
|
58
|
-
/** Moves focus to the field
|
|
59
|
-
focus: () => void
|
|
71
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
72
|
+
/** Moves focus to the field, or to the calendar's current day when `inline`. */
|
|
73
|
+
focus: () => void;
|
|
60
74
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
75
|
"update:modelValue": (value: string | [string, string] | null) => any;
|
|
62
76
|
"update:open": (value: boolean) => any;
|
|
@@ -71,6 +85,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
71
85
|
mode: "date" | "datetime" | "duration";
|
|
72
86
|
size: "small" | "normal";
|
|
73
87
|
hint: string;
|
|
88
|
+
inline: boolean;
|
|
74
89
|
placeholder: string;
|
|
75
90
|
range: boolean;
|
|
76
91
|
clearable: boolean;
|
|
@@ -83,6 +98,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
83
98
|
timeZone: string;
|
|
84
99
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
85
100
|
showSeconds: boolean;
|
|
101
|
+
autoApply: boolean;
|
|
102
|
+
hourCycle: 12 | 24;
|
|
103
|
+
showTimeZone: boolean;
|
|
86
104
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
105
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
87
106
|
declare const _default: typeof __VLS_export;
|
|
88
107
|
export default _default;
|
|
108
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|