@leavepulse/ui 0.31.1 → 0.33.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/assets/{LpDropzone-DVDC-ABU.css → LpDropzone-BBoWvi-J.css} +12 -12
- package/dist/assets/{LpImageEditor-DqP5JKCy.css → LpImageEditor-BsSwej47.css} +6 -6
- package/dist/chunks/{LpAddressInput-BDkp3-Bp.js → LpAddressInput-C35TsJXt.js} +19 -14
- package/dist/chunks/{LpAppShell-Chz8Vbtu.js → LpAppShell-lVvpENMH.js} +18 -13
- package/dist/chunks/{LpBreadcrumbs-5uvViCXi.js → LpBreadcrumbs-p4jHe_V-.js} +9 -7
- package/dist/chunks/{LpCalendar-B7ZL0ty3.js → LpCalendar-B7Ko5RdR.js} +12 -7
- package/dist/chunks/{LpCard-D0M2ZCnB.js → LpCard-1SeUYPBT.js} +36 -9
- package/dist/chunks/{LpCheckbox-BO0zuuPh.js → LpCheckbox-CVccKYaH.js} +9 -4
- package/dist/chunks/{LpCodeBlock-BWX1KZwk.js → LpCodeBlock-Bo0B4TFR.js} +37 -32
- package/dist/chunks/{LpDatePicker-dY2q4dr4.js → LpDatePicker-6JFXllj5.js} +1 -1
- package/dist/chunks/{LpDisclosure-B4kVAWfg.js → LpDisclosure-y7wDBgLa.js} +11 -6
- package/dist/chunks/{LpEmptyState-BV3q7Qyi.js → LpEmptyState-Dsdqz1Wj.js} +13 -5
- package/dist/chunks/{LpFileTree-DfFqY__1.js → LpFileTree-C-NFRT0H.js} +19 -14
- package/dist/chunks/{LpFileTreeNode-COchUMNn.js → LpFileTreeNode-DNJUJiiB.js} +13 -6
- package/dist/chunks/{LpFormField-fV_2ZdCk.js → LpFormField-CazBc2-a.js} +14 -9
- package/dist/chunks/{LpInput-Bt4J71xn.js → LpInput-9EXWUM9B.js} +1 -1
- package/dist/chunks/{LpLightbox-Ci35Y_xP.js → LpLightbox-oLqyjOln.js} +30 -7
- package/dist/chunks/{LpLink-BHZ1CLlF.js → LpLink-DCND-zyu.js} +16 -9
- package/dist/chunks/{LpLogViewer-TSRyt3t9.js → LpLogViewer-y53ZqSVq.js} +20 -10
- package/dist/chunks/{LpMapPicker-CXvoTrAe.js → LpMapPicker-ul4oYno6.js} +14 -9
- package/dist/chunks/LpMediaGallery-Cid7PGYx.js +214 -0
- package/dist/chunks/{LpNotificationBell-gdvQY89m.js → LpNotificationBell-lHePf89W.js} +1 -1
- package/dist/chunks/{LpNumberField-NPE8Bumx.js → LpNumberField-CWuX08iX.js} +12 -5
- package/dist/chunks/{LpOtpInput-DqaT0Z75.js → LpOtpInput-y2v-pmiN.js} +11 -6
- package/dist/chunks/{LpPagination-CeGuNe_q.js → LpPagination-5FxjmmB5.js} +21 -19
- package/dist/chunks/{LpPasswordInput-BqMAc5HA.js → LpPasswordInput--sjYCkLS.js} +1 -1
- package/dist/chunks/{LpPhoneInput-NXXjciJJ.js → LpPhoneInput-BDSKVl_z.js} +16 -9
- package/dist/chunks/{LpPie-BL1vTDSM.js → LpPie-c2-q4DJu.js} +14 -8
- package/dist/chunks/{LpRadio-CL-pI0_O.js → LpRadio-B5AfqTpZ.js} +13 -5
- package/dist/chunks/{LpRadioGroup-B4yDTmi6.js → LpRadioGroup-xPIuVDO_.js} +12 -5
- package/dist/chunks/{LpSegmented-BmpanyAo.js → LpSegmented-fV0Sk92p.js} +16 -6
- package/dist/chunks/{LpSidebar-BiWM_lDB.js → LpSidebar-DcYavim2.js} +2 -2
- package/dist/chunks/{LpSidebarNav-CsgeuGAu.js → LpSidebarNav-CqwvT4H8.js} +21 -16
- package/dist/chunks/{LpSlider-B1SF3pRV.js → LpSlider-BwNIBkAK.js} +12 -5
- package/dist/chunks/{LpStat-CDanpzU0.js → LpStat-CQaW8R--.js} +23 -18
- package/dist/chunks/{LpStepper-Wtl-6nUh.js → LpStepper-Bk-XaQYU.js} +15 -10
- package/dist/chunks/{LpSwitch-v6fnccSM.js → LpSwitch-xgnRU2k0.js} +12 -5
- package/dist/chunks/{LpTextarea-BMIOfw5l.js → LpTextarea-t7F6gv8E.js} +1 -1
- package/dist/chunks/{LpUptimeBar-DcQ8HikG.js → LpUptimeBar-DvAMno0S.js} +26 -21
- package/dist/component-names.d.ts +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +34 -17
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAppShell.vue.d.ts +65 -31
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpBreadcrumbs.vue.d.ts +12 -6
- package/dist/components/LpBreadcrumbs.vue.js +1 -1
- package/dist/components/LpCalendar.vue.d.ts +15 -6
- package/dist/components/LpCalendar.vue.js +1 -1
- package/dist/components/LpCard.vue.d.ts +26 -0
- package/dist/components/LpCard.vue.js +1 -1
- package/dist/components/LpChart.vue.d.ts +54 -12
- package/dist/components/LpChart.vue.js +15 -9
- package/dist/components/LpCheckbox.vue.d.ts +16 -12
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.d.ts +25 -6
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDisclosure.vue.d.ts +24 -14
- package/dist/components/LpDisclosure.vue.js +1 -1
- package/dist/components/LpDropzone.vue.d.ts +38 -14
- package/dist/components/LpDropzone.vue.js +17 -11
- package/dist/components/LpEmptyState.vue.d.ts +15 -10
- package/dist/components/LpEmptyState.vue.js +1 -1
- package/dist/components/LpFileTree.vue.d.ts +51 -31
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.d.ts +31 -16
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpFormField.vue.d.ts +14 -13
- package/dist/components/LpFormField.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.d.ts +33 -10
- package/dist/components/LpImageEditor.vue.js +13 -7
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLink.vue.d.ts +46 -11
- package/dist/components/LpLink.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.d.ts +63 -6
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.d.ts +25 -10
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.d.ts +80 -0
- package/dist/components/LpMediaGallery.vue.js +4 -0
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +12 -6
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.d.ts +18 -6
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPagination.vue.d.ts +16 -6
- package/dist/components/LpPagination.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.d.ts +18 -6
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpPie.vue.d.ts +96 -34
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpRadio.vue.d.ts +10 -10
- package/dist/components/LpRadio.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.d.ts +12 -12
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpSegmented.vue.d.ts +12 -6
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.d.ts +28 -17
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpSlider.vue.d.ts +13 -6
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpStat.vue.d.ts +35 -11
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpStepper.vue.d.ts +17 -5
- package/dist/components/LpStepper.vue.js +1 -1
- package/dist/components/LpSwitch.vue.d.ts +8 -6
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.js +1 -1
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.d.ts +21 -5
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/lightbox.d.ts +10 -0
- package/dist/composables/useMergedClass.d.ts +20 -0
- package/dist/composables/useMergedClass.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +95 -89
- package/package.json +1 -3
- package/src/component-names.ts +1 -0
- package/src/components/LpAddressInput.vue +16 -1
- package/src/components/LpAppShell.vue +16 -1
- package/src/components/LpBreadcrumbs.vue +16 -1
- package/src/components/LpCalendar.vue +15 -1
- package/src/components/LpCard.vue +50 -5
- package/src/components/LpChart.vue +16 -1
- package/src/components/LpCheckbox.vue +16 -1
- package/src/components/LpCodeBlock.vue +16 -1
- package/src/components/LpDisclosure.vue +15 -1
- package/src/components/LpDropzone.vue +21 -6
- package/src/components/LpEmptyState.vue +21 -3
- package/src/components/LpFileTree.vue +16 -1
- package/src/components/LpFileTreeNode.vue +15 -1
- package/src/components/LpFormField.vue +16 -1
- package/src/components/LpImageEditor.vue +16 -1
- package/src/components/LpLightbox.vue +68 -3
- package/src/components/LpLink.vue +25 -9
- package/src/components/LpLogViewer.vue +20 -2
- package/src/components/LpMapPicker.vue +15 -1
- package/src/components/LpMediaGallery.vue +365 -0
- package/src/components/LpNumberField.vue +15 -1
- package/src/components/LpOtpInput.vue +15 -1
- package/src/components/LpPagination.vue +16 -1
- package/src/components/LpPhoneInput.vue +23 -8
- package/src/components/LpPie.vue +16 -1
- package/src/components/LpRadio.vue +20 -3
- package/src/components/LpRadioGroup.vue +15 -1
- package/src/components/LpSegmented.vue +21 -2
- package/src/components/LpSidebarNav.vue +16 -1
- package/src/components/LpSlider.vue +15 -1
- package/src/components/LpStat.vue +16 -1
- package/src/components/LpStepper.vue +16 -1
- package/src/components/LpSwitch.vue +15 -1
- package/src/components/LpUptimeBar.vue +16 -1
- package/src/components/lightbox.ts +10 -0
- package/src/composables/useMergedClass.ts +30 -0
- package/src/index.ts +2 -0
- package/src/tokens/tokens.css +29 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, renderSlot, mergeProps, unref, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createVNode, createCommentVNode, createBlock } from "vue";
|
|
2
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
3
|
+
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
4
|
+
import { _ as _sfc_main$2 } from "./LpLightbox-oLqyjOln.js";
|
|
5
|
+
const _hoisted_1 = { key: 0 };
|
|
6
|
+
const _hoisted_2 = ["aria-label"];
|
|
7
|
+
const _hoisted_3 = ["aria-label", "onClick"];
|
|
8
|
+
const _hoisted_4 = ["src", "alt"];
|
|
9
|
+
const _hoisted_5 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "pointer-events-none absolute inset-0 flex items-center justify-center"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_6 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "pointer-events-none absolute inset-0 flex items-center justify-center text-lg font-medium text-white"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_7 = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "pointer-events-none absolute inset-0 flex items-center justify-center bg-black/0 opacity-0 transition-[background-color,opacity] duration-[var(--duration-fast)] group-hover:bg-black/25 group-hover:opacity-100 motion-reduce:transition-none",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
};
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "LpMediaGallery",
|
|
24
|
+
props: {
|
|
25
|
+
items: {},
|
|
26
|
+
columns: { default: 3 },
|
|
27
|
+
gap: { default: 2 },
|
|
28
|
+
aspect: { default: "square" },
|
|
29
|
+
max: {},
|
|
30
|
+
openable: { type: Boolean, default: true },
|
|
31
|
+
downloadable: { type: Boolean, default: true },
|
|
32
|
+
rotatable: { type: Boolean, default: true },
|
|
33
|
+
ariaLabel: { default: "Media" }
|
|
34
|
+
},
|
|
35
|
+
emits: ["select", "reveal", "update:open"],
|
|
36
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
37
|
+
const props = __props;
|
|
38
|
+
const emit = __emit;
|
|
39
|
+
const open = ref(false);
|
|
40
|
+
const index = ref(0);
|
|
41
|
+
const visible = computed(
|
|
42
|
+
() => props.max && props.items.length > props.max ? props.items.slice(0, props.max) : props.items
|
|
43
|
+
);
|
|
44
|
+
const hiddenCount = computed(() => Math.max(props.items.length - visible.value.length, 0));
|
|
45
|
+
const COLS = {
|
|
46
|
+
1: "grid-cols-1",
|
|
47
|
+
2: "grid-cols-2",
|
|
48
|
+
3: "grid-cols-3",
|
|
49
|
+
4: "grid-cols-4",
|
|
50
|
+
5: "grid-cols-5",
|
|
51
|
+
6: "grid-cols-6"
|
|
52
|
+
};
|
|
53
|
+
const COLS_SM = {
|
|
54
|
+
1: "sm:grid-cols-1",
|
|
55
|
+
2: "sm:grid-cols-2",
|
|
56
|
+
3: "sm:grid-cols-3",
|
|
57
|
+
4: "sm:grid-cols-4",
|
|
58
|
+
5: "sm:grid-cols-5",
|
|
59
|
+
6: "sm:grid-cols-6"
|
|
60
|
+
};
|
|
61
|
+
const COLS_MD = {
|
|
62
|
+
1: "md:grid-cols-1",
|
|
63
|
+
2: "md:grid-cols-2",
|
|
64
|
+
3: "md:grid-cols-3",
|
|
65
|
+
4: "md:grid-cols-4",
|
|
66
|
+
5: "md:grid-cols-5",
|
|
67
|
+
6: "md:grid-cols-6"
|
|
68
|
+
};
|
|
69
|
+
const COLS_LG = {
|
|
70
|
+
1: "lg:grid-cols-1",
|
|
71
|
+
2: "lg:grid-cols-2",
|
|
72
|
+
3: "lg:grid-cols-3",
|
|
73
|
+
4: "lg:grid-cols-4",
|
|
74
|
+
5: "lg:grid-cols-5",
|
|
75
|
+
6: "lg:grid-cols-6"
|
|
76
|
+
};
|
|
77
|
+
const COLS_XL = {
|
|
78
|
+
1: "xl:grid-cols-1",
|
|
79
|
+
2: "xl:grid-cols-2",
|
|
80
|
+
3: "xl:grid-cols-3",
|
|
81
|
+
4: "xl:grid-cols-4",
|
|
82
|
+
5: "xl:grid-cols-5",
|
|
83
|
+
6: "xl:grid-cols-6"
|
|
84
|
+
};
|
|
85
|
+
const GAPS = {
|
|
86
|
+
0: "gap-0",
|
|
87
|
+
0.5: "gap-0.5",
|
|
88
|
+
1: "gap-1",
|
|
89
|
+
1.5: "gap-1.5",
|
|
90
|
+
2: "gap-2",
|
|
91
|
+
3: "gap-3",
|
|
92
|
+
4: "gap-4"
|
|
93
|
+
};
|
|
94
|
+
const ASPECTS = {
|
|
95
|
+
square: "aspect-square",
|
|
96
|
+
video: "aspect-video",
|
|
97
|
+
auto: ""
|
|
98
|
+
};
|
|
99
|
+
const columnClass = computed(() => {
|
|
100
|
+
const c = props.columns;
|
|
101
|
+
if (typeof c === "number") return COLS[c] ?? COLS[3];
|
|
102
|
+
return [
|
|
103
|
+
COLS[c.base ?? 1] ?? COLS[1],
|
|
104
|
+
c.sm ? COLS_SM[c.sm] : "",
|
|
105
|
+
c.md ? COLS_MD[c.md] : "",
|
|
106
|
+
c.lg ? COLS_LG[c.lg] : "",
|
|
107
|
+
c.xl ? COLS_XL[c.xl] : ""
|
|
108
|
+
].filter(Boolean).join(" ");
|
|
109
|
+
});
|
|
110
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
111
|
+
() => ["grid", columnClass.value, GAPS[props.gap] ?? GAPS[2]].join(" ")
|
|
112
|
+
);
|
|
113
|
+
function activate(i) {
|
|
114
|
+
const item = props.items[i];
|
|
115
|
+
if (!item) return;
|
|
116
|
+
emit("select", item, i);
|
|
117
|
+
if (!props.openable) return;
|
|
118
|
+
const at = openIndexOf(i);
|
|
119
|
+
if (at === -1) return;
|
|
120
|
+
index.value = at;
|
|
121
|
+
open.value = true;
|
|
122
|
+
emit("update:open", true);
|
|
123
|
+
}
|
|
124
|
+
function openOverflow() {
|
|
125
|
+
activate(visible.value.length);
|
|
126
|
+
}
|
|
127
|
+
const revealed = ref(/* @__PURE__ */ new Set());
|
|
128
|
+
function isHidden(item) {
|
|
129
|
+
return Boolean(item.spoiler) && !revealed.value.has(item.src);
|
|
130
|
+
}
|
|
131
|
+
function reveal(item) {
|
|
132
|
+
revealed.value = new Set(revealed.value).add(item.src);
|
|
133
|
+
emit("reveal", item);
|
|
134
|
+
}
|
|
135
|
+
const openItems = computed(() => props.items.filter((item) => !isHidden(item)));
|
|
136
|
+
function openIndexOf(i) {
|
|
137
|
+
const item = props.items[i];
|
|
138
|
+
return item ? openItems.value.indexOf(item) : -1;
|
|
139
|
+
}
|
|
140
|
+
__expose({
|
|
141
|
+
/** Open the lightbox at an index — for a "view all" button outside the grid. */
|
|
142
|
+
openAt: (i) => activate(i),
|
|
143
|
+
/** Uncover every spoiler in the set. */
|
|
144
|
+
revealAll: () => {
|
|
145
|
+
const next = new Set(revealed.value);
|
|
146
|
+
for (const item of props.items) if (item.spoiler) next.add(item.src);
|
|
147
|
+
revealed.value = next;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return (_ctx, _cache) => {
|
|
151
|
+
return !__props.items.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
152
|
+
renderSlot(_ctx.$slots, "empty")
|
|
153
|
+
])) : (openBlock(), createElementBlock("div", mergeProps({
|
|
154
|
+
key: 1,
|
|
155
|
+
role: "group",
|
|
156
|
+
"aria-label": __props.ariaLabel,
|
|
157
|
+
class: unref(rootClass)
|
|
158
|
+
}, unref(rest)), [
|
|
159
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visible.value, (item, i) => {
|
|
160
|
+
return openBlock(), createElementBlock("button", {
|
|
161
|
+
key: item.src + i,
|
|
162
|
+
type: "button",
|
|
163
|
+
class: normalizeClass([
|
|
164
|
+
"group relative overflow-hidden rounded-card bg-surface-soft outline-none",
|
|
165
|
+
ASPECTS[__props.aspect],
|
|
166
|
+
__props.openable ? "cursor-pointer" : "cursor-default",
|
|
167
|
+
"focus-visible:ring-2 focus-visible:ring-ring"
|
|
168
|
+
]),
|
|
169
|
+
"aria-label": isHidden(item) ? "Spoiler — show image" : hiddenCount.value && i === visible.value.length - 1 ? `Show ${hiddenCount.value} more` : item.title || `Image ${i + 1} of ${__props.items.length}`,
|
|
170
|
+
onClick: ($event) => isHidden(item) ? reveal(item) : hiddenCount.value && i === visible.value.length - 1 ? openOverflow() : activate(i)
|
|
171
|
+
}, [
|
|
172
|
+
renderSlot(_ctx.$slots, "item", {
|
|
173
|
+
item,
|
|
174
|
+
index: i
|
|
175
|
+
}, () => [
|
|
176
|
+
createElementVNode("img", {
|
|
177
|
+
src: item.thumb || item.src,
|
|
178
|
+
alt: isHidden(item) ? "" : item.title || "",
|
|
179
|
+
loading: "lazy",
|
|
180
|
+
decoding: "async",
|
|
181
|
+
class: normalizeClass(["size-full object-cover transition-transform duration-[var(--duration-medium)] ease-[var(--ease-emphasized)] group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100", [
|
|
182
|
+
isHidden(item) ? "scale-[1.12] blur-[18px] brightness-[0.6] saturate-[1.1] group-hover:scale-[1.12]" : "",
|
|
183
|
+
!isHidden(item) && hiddenCount.value && i === visible.value.length - 1 ? "scale-[1.06] blur-[2px] brightness-[0.45] group-hover:scale-[1.06]" : ""
|
|
184
|
+
]])
|
|
185
|
+
}, null, 10, _hoisted_4)
|
|
186
|
+
]),
|
|
187
|
+
isHidden(item) ? (openBlock(), createElementBlock("span", _hoisted_5, [..._cache[2] || (_cache[2] = [
|
|
188
|
+
createElementVNode("span", { class: "rounded-pill bg-black/55 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-white" }, " Spoiler ", -1)
|
|
189
|
+
])])) : hiddenCount.value && i === visible.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_6, " +" + toDisplayString(hiddenCount.value), 1)) : __props.openable ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
|
190
|
+
createVNode(_sfc_main$1, {
|
|
191
|
+
name: "lucide:maximize-2",
|
|
192
|
+
size: 18,
|
|
193
|
+
class: "text-white"
|
|
194
|
+
})
|
|
195
|
+
])) : createCommentVNode("", true)
|
|
196
|
+
], 10, _hoisted_3);
|
|
197
|
+
}), 128)),
|
|
198
|
+
__props.openable ? (openBlock(), createBlock(_sfc_main$2, {
|
|
199
|
+
key: 0,
|
|
200
|
+
open: open.value,
|
|
201
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
202
|
+
index: index.value,
|
|
203
|
+
"onUpdate:index": _cache[1] || (_cache[1] = ($event) => index.value = $event),
|
|
204
|
+
items: openItems.value,
|
|
205
|
+
downloadable: __props.downloadable,
|
|
206
|
+
rotatable: __props.rotatable
|
|
207
|
+
}, null, 8, ["open", "index", "items", "downloadable", "rotatable"])) : createCommentVNode("", true)
|
|
208
|
+
], 16, _hoisted_2));
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
export {
|
|
213
|
+
_sfc_main as _
|
|
214
|
+
};
|
|
@@ -2,7 +2,7 @@ import { defineComponent, computed, useModel, getCurrentInstance, openBlock, cre
|
|
|
2
2
|
import { _ as _sfc_main$8 } from "./LpBadge-Fe0D1bYx.js";
|
|
3
3
|
import { _ as _sfc_main$7 } from "./LpButton-5VXXCjwF.js";
|
|
4
4
|
import { _ as _sfc_main$5 } from "./LpContextMenu-B6WBLleS.js";
|
|
5
|
-
import { _ as _sfc_main$3 } from "./LpEmptyState-
|
|
5
|
+
import { _ as _sfc_main$3 } from "./LpEmptyState-Dsdqz1Wj.js";
|
|
6
6
|
import { _ as _sfc_main$6 } from "./LpIcon-CCnX5_2j.js";
|
|
7
7
|
import { _ as _sfc_main$1 } from "./LpPopover-8268UmlC.js";
|
|
8
8
|
import { _ as _sfc_main$4 } from "./LpScrollArea-D8xyKXcF.js";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useId, openBlock, createBlock, unref, withCtx, createVNode, createElementBlock, toDisplayString, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, useId, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, createElementBlock, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { NumberFieldRoot, NumberFieldDecrement, NumberFieldInput, NumberFieldIncrement } from "reka-ui";
|
|
3
3
|
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
4
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
5
|
const _hoisted_1 = ["id"];
|
|
6
|
+
const __default__ = { inheritAttrs: false };
|
|
5
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...__default__,
|
|
6
9
|
__name: "LpNumberField",
|
|
7
10
|
props: {
|
|
8
11
|
modelValue: {},
|
|
@@ -15,17 +18,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
18
|
emits: ["update:modelValue"],
|
|
16
19
|
setup(__props) {
|
|
17
20
|
const unitId = useId();
|
|
21
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
22
|
+
"flex h-(--size-control-md) w-full items-center rounded-control border border-line bg-surface-soft transition-colors duration-[var(--duration-fast)] focus-within:border-brand focus-within:ring-2 focus-within:ring-ring data-[disabled]:cursor-not-allowed data-[disabled]:opacity-55"
|
|
23
|
+
);
|
|
18
24
|
return (_ctx, _cache) => {
|
|
19
|
-
return openBlock(), createBlock(unref(NumberFieldRoot), {
|
|
25
|
+
return openBlock(), createBlock(unref(NumberFieldRoot), mergeProps({
|
|
20
26
|
"model-value": __props.modelValue ?? void 0,
|
|
21
27
|
min: __props.min,
|
|
22
28
|
max: __props.max,
|
|
23
29
|
step: __props.step,
|
|
24
30
|
disabled: __props.disabled,
|
|
25
31
|
"data-lp-ring-owner": "",
|
|
26
|
-
class:
|
|
32
|
+
class: unref(rootClass)
|
|
33
|
+
}, unref(rest), {
|
|
27
34
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => _ctx.$emit("update:modelValue", v ?? null))
|
|
28
|
-
}, {
|
|
35
|
+
}), {
|
|
29
36
|
default: withCtx(() => [
|
|
30
37
|
createVNode(unref(NumberFieldDecrement), { class: "group grid h-full w-8 place-items-center text-muted transition-colors duration-[var(--duration-fast)] hover:text-ink disabled:opacity-40" }, {
|
|
31
38
|
default: withCtx(() => [
|
|
@@ -58,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
65
|
})
|
|
59
66
|
]),
|
|
60
67
|
_: 1
|
|
61
|
-
},
|
|
68
|
+
}, 16, ["model-value", "min", "max", "step", "disabled", "class"]);
|
|
62
69
|
};
|
|
63
70
|
}
|
|
64
71
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, normalizeClass } from "vue";
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementBlock, Fragment, renderList, normalizeClass } from "vue";
|
|
2
2
|
import { PinInputRoot, PinInputInput } from "reka-ui";
|
|
3
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
|
+
const __default__ = { inheritAttrs: false };
|
|
3
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...__default__,
|
|
4
7
|
__name: "LpOtpInput",
|
|
5
8
|
props: {
|
|
6
9
|
modelValue: {},
|
|
@@ -27,17 +30,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
30
|
md: "size-11 text-lg",
|
|
28
31
|
lg: "size-13 text-xl"
|
|
29
32
|
};
|
|
33
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
34
|
+
"flex items-center gap-2"
|
|
35
|
+
);
|
|
30
36
|
return (_ctx, _cache) => {
|
|
31
|
-
return openBlock(), createBlock(unref(PinInputRoot), {
|
|
37
|
+
return openBlock(), createBlock(unref(PinInputRoot), mergeProps({
|
|
32
38
|
modelValue: cells.value,
|
|
33
39
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => cells.value = $event),
|
|
34
40
|
type: __props.alphanumeric ? "text" : "number",
|
|
35
41
|
mask: __props.mask,
|
|
36
42
|
disabled: __props.disabled,
|
|
37
43
|
otp: "",
|
|
38
|
-
class:
|
|
39
|
-
|
|
40
|
-
}, {
|
|
44
|
+
class: unref(rootClass)
|
|
45
|
+
}, unref(rest), { onComplete }), {
|
|
41
46
|
default: withCtx(() => [
|
|
42
47
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.length, (i) => {
|
|
43
48
|
return openBlock(), createBlock(unref(PinInputInput), {
|
|
@@ -56,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
56
61
|
}), 128))
|
|
57
62
|
]),
|
|
58
63
|
_: 1
|
|
59
|
-
},
|
|
64
|
+
}, 16, ["modelValue", "type", "mask", "disabled", "class"]);
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
67
|
});
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { defineComponent, computed, useId, openBlock, createElementBlock, createElementVNode, normalizeClass, createVNode, Fragment, renderList, createBlock,
|
|
1
|
+
import { defineComponent, computed, useId, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, createVNode, Fragment, renderList, createBlock, createCommentVNode, toDisplayString } from "vue";
|
|
2
2
|
import { Motion } from "motion-v";
|
|
3
3
|
import { usePillTransition } from "../composables/usePillTransition.js";
|
|
4
4
|
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_2 = ["disabled"];
|
|
10
|
-
const _hoisted_3 = {
|
|
5
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
6
|
+
const _hoisted_1 = ["disabled"];
|
|
7
|
+
const _hoisted_2 = {
|
|
11
8
|
key: 0,
|
|
12
9
|
class: "flex size-(--size-control-sm) items-center justify-center text-sm text-muted select-none",
|
|
13
10
|
"aria-hidden": "true"
|
|
14
11
|
};
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const navArrow = "border border-line text-muted hover:border-line-strong hover:text-ink disabled:hover:border-line disabled:hover:text-muted";
|
|
12
|
+
const _hoisted_3 = ["disabled", "aria-current", "onClick"];
|
|
13
|
+
const _hoisted_4 = { class: "relative z-10" };
|
|
14
|
+
const _hoisted_5 = ["disabled"];
|
|
15
|
+
const __default__ = { inheritAttrs: false };
|
|
20
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
21
18
|
__name: "LpPagination",
|
|
22
19
|
props: {
|
|
23
20
|
page: { default: 1 },
|
|
@@ -69,10 +66,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
66
|
emit("update:page", next);
|
|
70
67
|
emit("change", next);
|
|
71
68
|
}
|
|
69
|
+
const navBase = "relative flex size-(--size-control-sm) items-center justify-center rounded-control text-sm outline-none transition-[color,border-color,scale] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] active:scale-95 motion-reduce:active:scale-100 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45 disabled:active:scale-100";
|
|
70
|
+
const navArrow = "border border-line text-muted hover:border-line-strong hover:text-ink disabled:hover:border-line disabled:hover:text-muted";
|
|
72
71
|
const pillId = `lp-page-indicator-${useId()}`;
|
|
73
72
|
const pillTransition = usePillTransition();
|
|
73
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
74
|
+
"flex items-center gap-1.5"
|
|
75
|
+
);
|
|
74
76
|
return (_ctx, _cache) => {
|
|
75
|
-
return openBlock(), createElementBlock("nav",
|
|
77
|
+
return openBlock(), createElementBlock("nav", mergeProps({ class: unref(rootClass) }, unref(rest), { "aria-label": "Pagination" }), [
|
|
76
78
|
createElementVNode("button", {
|
|
77
79
|
type: "button",
|
|
78
80
|
class: normalizeClass([navBase, navArrow]),
|
|
@@ -84,12 +86,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
86
|
name: "lucide:chevron-left",
|
|
85
87
|
size: 16
|
|
86
88
|
})
|
|
87
|
-
], 10,
|
|
89
|
+
], 10, _hoisted_1),
|
|
88
90
|
(openBlock(true), createElementBlock(Fragment, null, renderList(slots.value, (slot, i) => {
|
|
89
91
|
return openBlock(), createElementBlock(Fragment, {
|
|
90
92
|
key: `slot-${i}`
|
|
91
93
|
}, [
|
|
92
|
-
slot.kind === "gap" ? (openBlock(), createElementBlock("span",
|
|
94
|
+
slot.kind === "gap" ? (openBlock(), createElementBlock("span", _hoisted_2, "…")) : (openBlock(), createElementBlock("button", {
|
|
93
95
|
key: 1,
|
|
94
96
|
type: "button",
|
|
95
97
|
class: normalizeClass([
|
|
@@ -107,8 +109,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
109
|
transition: unref(pillTransition),
|
|
108
110
|
class: "absolute inset-0 z-0 rounded-control bg-brand"
|
|
109
111
|
}, null, 8, ["transition"])) : createCommentVNode("", true),
|
|
110
|
-
createElementVNode("span",
|
|
111
|
-
], 10,
|
|
112
|
+
createElementVNode("span", _hoisted_4, toDisplayString(slot.page), 1)
|
|
113
|
+
], 10, _hoisted_3))
|
|
112
114
|
], 64);
|
|
113
115
|
}), 128)),
|
|
114
116
|
createElementVNode("button", {
|
|
@@ -122,8 +124,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
124
|
name: "lucide:chevron-right",
|
|
123
125
|
size: 16
|
|
124
126
|
})
|
|
125
|
-
], 10,
|
|
126
|
-
]);
|
|
127
|
+
], 10, _hoisted_5)
|
|
128
|
+
], 16);
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
131
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, openBlock, createBlock, createSlots, withCtx, createElementVNode, createVNode, renderSlot } from "vue";
|
|
2
2
|
import { _ as _sfc_main$2 } from "./LpIcon-CCnX5_2j.js";
|
|
3
|
-
import { _ as _sfc_main$1 } from "./LpInput-
|
|
3
|
+
import { _ as _sfc_main$1 } from "./LpInput-9EXWUM9B.js";
|
|
4
4
|
const _hoisted_1 = ["aria-label"];
|
|
5
5
|
const __default__ = { inheritAttrs: false };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onMounted, openBlock, createElementBlock,
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, openBlock, createElementBlock, mergeProps, unref, createVNode, withCtx, createElementVNode, toDisplayString, normalizeClass, createTextVNode, Fragment, renderList, createBlock, withModifiers, normalizeStyle } from "vue";
|
|
2
2
|
import { ComboboxRoot, ComboboxAnchor, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxInput, ComboboxViewport, ComboboxEmpty, ComboboxItem } from "reka-ui";
|
|
3
3
|
import { useInputFilter } from "../composables/useInputFilter.js";
|
|
4
4
|
import { matchCountryByValue, loadCountries, flagEmoji } from "../components/countries.js";
|
|
5
5
|
import { POPOVER_PANEL, OPTION_ITEM } from "../components/dropdown.js";
|
|
6
6
|
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
7
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
7
8
|
const _hoisted_1 = { class: "text-base leading-none" };
|
|
8
9
|
const _hoisted_2 = { class: "border-b border-line p-2" };
|
|
9
10
|
const _hoisted_3 = { class: "text-base leading-none" };
|
|
10
11
|
const _hoisted_4 = { class: "min-w-0 flex-1 truncate" };
|
|
11
12
|
const _hoisted_5 = { class: "shrink-0 text-xs text-muted" };
|
|
12
13
|
const _hoisted_6 = ["value", "placeholder", "disabled", "aria-invalid"];
|
|
14
|
+
const __default__ = { inheritAttrs: false };
|
|
13
15
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
14
17
|
__name: "LpPhoneInput",
|
|
15
18
|
props: {
|
|
16
19
|
modelValue: {},
|
|
@@ -84,15 +87,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
87
|
md: "h-(--size-control-md) text-sm",
|
|
85
88
|
lg: "h-(--size-control-lg) text-sm"
|
|
86
89
|
};
|
|
90
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
91
|
+
() => [
|
|
92
|
+
"flex w-full items-stretch rounded-control border bg-surface-soft text-ink transition-colors duration-[var(--duration-fast)] focus-within:ring-2 focus-within:ring-ring",
|
|
93
|
+
sizeClass[props.size],
|
|
94
|
+
props.invalid ? "border-danger focus-within:border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand",
|
|
95
|
+
props.disabled ? "cursor-not-allowed opacity-55" : ""
|
|
96
|
+
].join(" ")
|
|
97
|
+
);
|
|
87
98
|
return (_ctx, _cache) => {
|
|
88
|
-
return openBlock(), createElementBlock("div", {
|
|
99
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
89
100
|
"data-lp-ring-owner": "",
|
|
90
|
-
class:
|
|
91
|
-
|
|
92
|
-
__props.invalid ? "border-danger focus-within:border-danger focus-within:ring-danger-soft" : "border-line focus-within:border-brand",
|
|
93
|
-
__props.disabled ? "cursor-not-allowed opacity-55" : ""
|
|
94
|
-
]])
|
|
95
|
-
}, [
|
|
101
|
+
class: unref(rootClass)
|
|
102
|
+
}, unref(rest)), [
|
|
96
103
|
createVNode(unref(ComboboxRoot), {
|
|
97
104
|
open: open.value,
|
|
98
105
|
"onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event),
|
|
@@ -193,7 +200,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
193
200
|
(...args) => unref(onPaste) && unref(onPaste)(...args)),
|
|
194
201
|
onInput
|
|
195
202
|
}, null, 40, _hoisted_6)
|
|
196
|
-
],
|
|
203
|
+
], 16);
|
|
197
204
|
};
|
|
198
205
|
}
|
|
199
206
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch, onBeforeUnmount, openBlock, createElementBlock, toDisplayString, createCommentVNode, normalizeStyle, createVNode, createElementVNode, createBlock, withCtx, withModifiers, Fragment, renderList, normalizeClass, renderSlot } from "vue";
|
|
1
|
+
import { defineComponent, computed, ref, watch, onBeforeUnmount, openBlock, createElementBlock, mergeProps, unref, toDisplayString, createCommentVNode, normalizeStyle, createVNode, createElementVNode, createBlock, withCtx, withModifiers, Fragment, renderList, normalizeClass, renderSlot } from "vue";
|
|
2
2
|
import { prefersReducedMotion, easeTravel } from "../composables/easing.js";
|
|
3
3
|
import { useReveal } from "../composables/useReveal.js";
|
|
4
4
|
import { resolveSlices, arcPath, calloutLabels, formatTick } from "../components/chart.js";
|
|
@@ -8,6 +8,7 @@ import { _ as _sfc_main$4 } from "./LpNumberFlow-amWYaeuA.js";
|
|
|
8
8
|
import { _ as _sfc_main$5 } from "./LpRollingText-CM5gkSeF.js";
|
|
9
9
|
import { _ as _sfc_main$6 } from "./LpShift-DXNsauQZ.js";
|
|
10
10
|
import { _ as _sfc_main$3 } from "./LpTooltip-hCLPAqMG.js";
|
|
11
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
11
12
|
const _hoisted_1 = {
|
|
12
13
|
key: 0,
|
|
13
14
|
class: "flex flex-col gap-0.5"
|
|
@@ -45,10 +46,9 @@ const _hoisted_21 = {
|
|
|
45
46
|
class: "shrink-0 text-muted"
|
|
46
47
|
};
|
|
47
48
|
const _hoisted_22 = { class: "ml-auto shrink-0 pl-2 font-mono tabular-nums text-muted" };
|
|
48
|
-
const
|
|
49
|
-
const RUN = 14;
|
|
50
|
-
const LABEL_LINE = 17;
|
|
49
|
+
const __default__ = { inheritAttrs: false };
|
|
51
50
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
51
|
+
...__default__,
|
|
52
52
|
__name: "LpPie",
|
|
53
53
|
props: {
|
|
54
54
|
slices: {},
|
|
@@ -107,6 +107,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
107
|
return { index, slice: s, start: start + gap / 2, end: angle - gap / 2, mid: start + sweep2 / 2 };
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
|
+
const ELBOW = 16;
|
|
111
|
+
const RUN = 14;
|
|
112
|
+
const LABEL_LINE = 17;
|
|
110
113
|
const canvasWidth = computed(
|
|
111
114
|
() => props.labels ? props.size + (props.labelWidth + ELBOW + RUN) * 2 : props.size
|
|
112
115
|
);
|
|
@@ -320,12 +323,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
320
323
|
if (selected.value.size > 1) return `${selected.value.size} selected`;
|
|
321
324
|
return "total";
|
|
322
325
|
});
|
|
326
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
327
|
+
"flex flex-col gap-3"
|
|
328
|
+
);
|
|
323
329
|
return (_ctx, _cache) => {
|
|
324
|
-
return openBlock(), createElementBlock("div", {
|
|
330
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
325
331
|
ref_key: "revealAnchor",
|
|
326
332
|
ref: revealAnchor,
|
|
327
|
-
class:
|
|
328
|
-
}, [
|
|
333
|
+
class: unref(rootClass)
|
|
334
|
+
}, unref(rest)), [
|
|
329
335
|
__props.title || __props.subtitle ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
330
336
|
__props.title ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
331
337
|
__props.subtitle ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.subtitle), 1)) : createCommentVNode("", true)
|
|
@@ -516,7 +522,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
516
522
|
]),
|
|
517
523
|
_: 3
|
|
518
524
|
}, 8, ["items", "always"]))
|
|
519
|
-
],
|
|
525
|
+
], 16);
|
|
520
526
|
};
|
|
521
527
|
}
|
|
522
528
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, mergeProps, unref, createVNode, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { RadioGroupItem, RadioGroupIndicator } from "reka-ui";
|
|
3
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
|
+
const __default__ = { inheritAttrs: false };
|
|
3
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...__default__,
|
|
4
7
|
__name: "LpRadio",
|
|
5
8
|
props: {
|
|
6
9
|
value: {},
|
|
@@ -8,10 +11,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
11
|
disabled: { type: Boolean }
|
|
9
12
|
},
|
|
10
13
|
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
16
|
+
() => [
|
|
17
|
+
"group inline-flex cursor-pointer items-center gap-2 text-sm text-ink",
|
|
18
|
+
props.disabled ? "cursor-not-allowed opacity-55" : ""
|
|
19
|
+
].join(" ")
|
|
20
|
+
);
|
|
11
21
|
return (_ctx, _cache) => {
|
|
12
|
-
return openBlock(), createElementBlock("label", {
|
|
13
|
-
class: normalizeClass(["group inline-flex cursor-pointer items-center gap-2 text-sm text-ink", __props.disabled && "cursor-not-allowed opacity-55"])
|
|
14
|
-
}, [
|
|
22
|
+
return openBlock(), createElementBlock("label", mergeProps({ class: unref(rootClass) }, unref(rest)), [
|
|
15
23
|
createVNode(unref(RadioGroupItem), {
|
|
16
24
|
value: __props.value,
|
|
17
25
|
disabled: __props.disabled,
|
|
@@ -30,7 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
38
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
31
39
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
32
40
|
])
|
|
33
|
-
],
|
|
41
|
+
], 16);
|
|
34
42
|
};
|
|
35
43
|
}
|
|
36
44
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createElementBlock, Fragment, renderList, createVNode, createElementVNode, createTextVNode, toDisplayString } from "vue";
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createElementBlock, Fragment, renderList, createVNode, createElementVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { RadioGroupRoot, RadioGroupItem, RadioGroupIndicator } from "reka-ui";
|
|
3
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
|
+
const __default__ = { inheritAttrs: false };
|
|
3
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...__default__,
|
|
4
7
|
__name: "LpRadioGroup",
|
|
5
8
|
props: {
|
|
6
9
|
modelValue: {},
|
|
@@ -9,13 +12,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
12
|
},
|
|
10
13
|
emits: ["update:modelValue"],
|
|
11
14
|
setup(__props) {
|
|
15
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
16
|
+
"flex flex-col gap-2"
|
|
17
|
+
);
|
|
12
18
|
return (_ctx, _cache) => {
|
|
13
|
-
return openBlock(), createBlock(unref(RadioGroupRoot), {
|
|
19
|
+
return openBlock(), createBlock(unref(RadioGroupRoot), mergeProps({
|
|
14
20
|
"model-value": __props.modelValue,
|
|
15
21
|
disabled: __props.disabled,
|
|
16
|
-
class:
|
|
22
|
+
class: unref(rootClass)
|
|
23
|
+
}, unref(rest), {
|
|
17
24
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => _ctx.$emit("update:modelValue", v))
|
|
18
|
-
}, {
|
|
25
|
+
}), {
|
|
19
26
|
default: withCtx(() => [
|
|
20
27
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
21
28
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (opt) => {
|
|
@@ -43,7 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
50
|
])
|
|
44
51
|
]),
|
|
45
52
|
_: 3
|
|
46
|
-
},
|
|
53
|
+
}, 16, ["model-value", "disabled", "class"]);
|
|
47
54
|
};
|
|
48
55
|
}
|
|
49
56
|
});
|