@itguy614/clean-ui 0.9.0 → 1.0.1
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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/clean-ui.css +1 -1
- package/dist/components/CuiAccordion.vue.js +7 -0
- package/dist/components/CuiAccordion.vue2.js +55 -0
- package/dist/components/CuiAccordionItem.vue.js +7 -0
- package/dist/components/CuiAccordionItem.vue2.js +91 -0
- package/dist/components/CuiAlert.vue.d.ts.map +1 -1
- package/dist/components/CuiAlert.vue.js +7 -0
- package/dist/components/CuiAlert.vue2.js +113 -0
- package/dist/components/CuiAvatar.vue.js +99 -0
- package/dist/components/CuiAvatar.vue3.js +5 -0
- package/dist/components/CuiAvatarGroup.vue.js +22 -0
- package/dist/components/CuiAvatarGroup.vue3.js +5 -0
- package/dist/components/CuiBackdrop.vue.js +7 -0
- package/dist/components/CuiBackdrop.vue2.js +49 -0
- package/dist/components/CuiBadge.vue.d.ts.map +1 -1
- package/dist/components/CuiBadge.vue.js +7 -0
- package/dist/components/CuiBadge.vue2.js +82 -0
- package/dist/components/CuiBanner.vue.js +81 -0
- package/dist/components/CuiBanner.vue2.js +4 -0
- package/dist/components/CuiBreadcrumb.vue.js +7 -0
- package/dist/components/CuiBreadcrumb.vue2.js +29 -0
- package/dist/components/CuiBreadcrumbItem.vue.js +7 -0
- package/dist/components/CuiBreadcrumbItem.vue2.js +46 -0
- package/dist/components/CuiButton.vue.d.ts.map +1 -1
- package/dist/components/CuiButton.vue.js +7 -0
- package/dist/components/CuiButton.vue2.js +136 -0
- package/dist/components/CuiButtonGroup.vue.js +7 -0
- package/dist/components/CuiButtonGroup.vue2.js +21 -0
- package/dist/components/CuiCard.vue.js +35 -0
- package/dist/components/CuiCard.vue2.js +4 -0
- package/dist/components/CuiCardBody.vue.js +20 -0
- package/dist/components/CuiCardBody.vue2.js +4 -0
- package/dist/components/CuiCardFooter.vue.js +32 -0
- package/dist/components/CuiCardFooter.vue2.js +4 -0
- package/dist/components/CuiCardHeader.vue.js +51 -0
- package/dist/components/CuiCardHeader.vue2.js +4 -0
- package/dist/components/CuiCardMedia.vue.js +7 -0
- package/dist/components/CuiCardMedia.vue2.js +38 -0
- package/dist/components/CuiCheckbox.vue.js +7 -0
- package/dist/components/CuiCheckbox.vue2.js +105 -0
- package/dist/components/CuiCheckboxGroup.vue.js +7 -0
- package/dist/components/CuiCheckboxGroup.vue2.js +59 -0
- package/dist/components/CuiCodeBlock.vue.js +129 -0
- package/dist/components/CuiCodeBlock.vue2.js +4 -0
- package/dist/components/CuiColorPicker.vue.js +348 -0
- package/dist/components/CuiColorPicker.vue2.js +4 -0
- package/dist/components/CuiCombobox.vue.js +332 -0
- package/dist/components/CuiCombobox.vue2.js +4 -0
- package/dist/components/CuiConfigProvider.vue.js +18 -0
- package/dist/components/CuiConfigProvider.vue2.js +4 -0
- package/dist/components/CuiConfirmDialog.vue.js +208 -0
- package/dist/components/CuiConfirmDialog.vue2.js +4 -0
- package/dist/components/CuiContainer.vue.js +35 -0
- package/dist/components/CuiContainer.vue2.js +4 -0
- package/dist/components/CuiContextMenu.vue.js +7 -0
- package/dist/components/CuiContextMenu.vue2.js +136 -0
- package/dist/components/CuiCopyButton.vue.js +63 -0
- package/dist/components/CuiCopyButton.vue2.js +4 -0
- package/dist/components/CuiDataGrid.vue.d.ts +53 -79
- package/dist/components/CuiDataGrid.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGrid.vue.js +178 -0
- package/dist/components/CuiDataGrid.vue3.js +5 -0
- package/dist/components/CuiDataGridActiveFilters.vue.js +47 -0
- package/dist/components/CuiDataGridActiveFilters.vue3.js +5 -0
- package/dist/components/CuiDataGridBulkBar.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridBulkBar.vue.js +70 -0
- package/dist/components/CuiDataGridBulkBar.vue3.js +5 -0
- package/dist/components/CuiDataGridCardView.vue.js +31 -0
- package/dist/components/CuiDataGridCardView.vue2.js +4 -0
- package/dist/components/CuiDataGridColumnManager.vue.js +86 -0
- package/dist/components/CuiDataGridColumnManager.vue2.js +4 -0
- package/dist/components/CuiDataGridFilterPanel.vue.js +181 -0
- package/dist/components/CuiDataGridFilterPanel.vue3.js +5 -0
- package/dist/components/CuiDataGridPagination.vue.js +28 -0
- package/dist/components/CuiDataGridPagination.vue2.js +4 -0
- package/dist/components/CuiDataGridSearch.vue.js +69 -0
- package/dist/components/CuiDataGridSearch.vue2.js +4 -0
- package/dist/components/CuiDataGridTable.vue.js +336 -0
- package/dist/components/CuiDataGridTable.vue2.js +4 -0
- package/dist/components/CuiDataGridToolbar.vue.js +73 -0
- package/dist/components/CuiDataGridToolbar.vue3.js +5 -0
- package/dist/components/CuiDataGridViewManager.vue.js +209 -0
- package/dist/components/CuiDataGridViewManager.vue2.js +4 -0
- package/dist/components/CuiDataGridViewToggle.vue.js +43 -0
- package/dist/components/CuiDataGridViewToggle.vue3.js +5 -0
- package/dist/components/CuiDatePicker.vue.js +382 -0
- package/dist/components/CuiDatePicker.vue2.js +4 -0
- package/dist/components/CuiDateRangePicker.vue.js +376 -0
- package/dist/components/CuiDateRangePicker.vue2.js +4 -0
- package/dist/components/CuiDivider.vue.js +124 -0
- package/dist/components/CuiDivider.vue2.js +4 -0
- package/dist/components/CuiDropdown.vue.js +7 -0
- package/dist/components/CuiDropdown.vue2.js +110 -0
- package/dist/components/CuiDropdownCheckItem.vue.js +7 -0
- package/dist/components/CuiDropdownCheckItem.vue2.js +45 -0
- package/dist/components/CuiDropdownDivider.vue.js +14 -0
- package/dist/components/CuiDropdownHeader.vue.js +16 -0
- package/dist/components/CuiDropdownItem.vue.js +7 -0
- package/dist/components/CuiDropdownItem.vue2.js +55 -0
- package/dist/components/CuiDropdownMenu.vue.js +7 -0
- package/dist/components/CuiDropdownMenu.vue2.js +79 -0
- package/dist/components/CuiDropdownRadioGroup.vue.js +23 -0
- package/dist/components/CuiDropdownRadioGroup.vue2.js +4 -0
- package/dist/components/CuiDropdownRadioItem.vue.js +7 -0
- package/dist/components/CuiDropdownRadioItem.vue2.js +43 -0
- package/dist/components/CuiDropdownSub.vue.js +7 -0
- package/dist/components/CuiDropdownSub.vue2.js +91 -0
- package/dist/components/CuiDropdownTrigger.vue.js +7 -0
- package/dist/components/CuiDropdownTrigger.vue2.js +25 -0
- package/dist/components/CuiEmptyState.vue.js +7 -0
- package/dist/components/CuiEmptyState.vue2.js +70 -0
- package/dist/components/CuiFieldset.vue.js +7 -0
- package/dist/components/CuiFieldset.vue2.js +79 -0
- package/dist/components/CuiFileUpload.vue.js +254 -0
- package/dist/components/CuiFileUpload.vue2.js +4 -0
- package/dist/components/CuiFlex.vue.js +7 -0
- package/dist/components/CuiFlex.vue2.js +72 -0
- package/dist/components/CuiFlexItem.vue.js +35 -0
- package/dist/components/CuiFlexItem.vue2.js +4 -0
- package/dist/components/CuiForm.vue.js +116 -0
- package/dist/components/CuiForm.vue2.js +4 -0
- package/dist/components/CuiFormField.vue.js +7 -0
- package/dist/components/CuiFormField.vue2.js +73 -0
- package/dist/components/CuiGrid.vue.js +7 -0
- package/dist/components/CuiGrid.vue2.js +51 -0
- package/dist/components/CuiGridItem.vue.js +30 -0
- package/dist/components/CuiGridItem.vue2.js +4 -0
- package/dist/components/CuiIcon.vue.js +7 -0
- package/dist/components/CuiIcon.vue2.js +72 -0
- package/dist/components/CuiInput.vue.d.ts +6 -6
- package/dist/components/CuiInput.vue.d.ts.map +1 -1
- package/dist/components/CuiInput.vue.js +7 -0
- package/dist/components/CuiInput.vue2.js +150 -0
- package/dist/components/CuiInputStepper.vue.js +189 -0
- package/dist/components/CuiInputStepper.vue2.js +4 -0
- package/dist/components/CuiKbd.vue.js +44 -0
- package/dist/components/CuiKbd.vue2.js +4 -0
- package/dist/components/CuiMaskedInput.vue.d.ts +8 -8
- package/dist/components/CuiMaskedInput.vue.js +256 -0
- package/dist/components/CuiMaskedInput.vue2.js +4 -0
- package/dist/components/CuiModal.vue.js +7 -0
- package/dist/components/CuiModal.vue2.js +98 -0
- package/dist/components/CuiModalBody.vue.js +50 -0
- package/dist/components/CuiModalBody.vue2.js +4 -0
- package/dist/components/CuiModalFooter.vue.js +36 -0
- package/dist/components/CuiModalFooter.vue2.js +4 -0
- package/dist/components/CuiModalHeader.vue.js +85 -0
- package/dist/components/CuiModalHeader.vue2.js +4 -0
- package/dist/components/CuiPagination.vue.js +7 -0
- package/dist/components/CuiPagination.vue2.js +136 -0
- package/dist/components/CuiPopover.vue.js +227 -0
- package/dist/components/CuiPopover.vue2.js +4 -0
- package/dist/components/CuiProgress.vue.js +7 -0
- package/dist/components/CuiProgress.vue2.js +132 -0
- package/dist/components/CuiRadio.vue.d.ts.map +1 -1
- package/dist/components/CuiRadio.vue.js +7 -0
- package/dist/components/CuiRadio.vue2.js +139 -0
- package/dist/components/CuiRadioGroup.vue.js +7 -0
- package/dist/components/CuiRadioGroup.vue2.js +78 -0
- package/dist/components/CuiRating.vue.js +129 -0
- package/dist/components/CuiRating.vue2.js +4 -0
- package/dist/components/CuiResizablePanels.vue.js +147 -0
- package/dist/components/CuiResizablePanels.vue2.js +4 -0
- package/dist/components/CuiSelect.vue.d.ts.map +1 -1
- package/dist/components/CuiSelect.vue.js +7 -0
- package/dist/components/CuiSelect.vue2.js +359 -0
- package/dist/components/CuiSkeleton.vue.js +7 -0
- package/dist/components/CuiSkeleton.vue2.js +80 -0
- package/dist/components/CuiSlideover.vue.js +109 -0
- package/dist/components/CuiSlideover.vue2.js +4 -0
- package/dist/components/CuiSlider.vue.js +156 -0
- package/dist/components/CuiSlider.vue2.js +4 -0
- package/dist/components/CuiSpacer.vue.js +32 -0
- package/dist/components/CuiSpacer.vue2.js +4 -0
- package/dist/components/CuiSpinner.vue.js +99 -0
- package/dist/components/CuiSpinner.vue3.js +5 -0
- package/dist/components/CuiStack.vue.js +30 -0
- package/dist/components/CuiStack.vue2.js +4 -0
- package/dist/components/CuiStepper.vue.js +153 -0
- package/dist/components/CuiStepper.vue2.js +4 -0
- package/dist/components/CuiTab.vue.js +7 -0
- package/dist/components/CuiTab.vue2.js +73 -0
- package/dist/components/CuiTable.vue.d.ts.map +1 -1
- package/dist/components/CuiTable.vue.js +90 -0
- package/dist/components/CuiTable.vue3.js +5 -0
- package/dist/components/CuiTableBody.vue.js +18 -0
- package/dist/components/CuiTableBody.vue2.js +4 -0
- package/dist/components/CuiTableCell.vue.js +36 -0
- package/dist/components/CuiTableCell.vue2.js +4 -0
- package/dist/components/CuiTableFoot.vue.js +18 -0
- package/dist/components/CuiTableFoot.vue2.js +4 -0
- package/dist/components/CuiTableHead.vue.js +18 -0
- package/dist/components/CuiTableHead.vue2.js +4 -0
- package/dist/components/CuiTableRow.vue.js +23 -0
- package/dist/components/CuiTableRow.vue2.js +4 -0
- package/dist/components/CuiTabs.vue.js +7 -0
- package/dist/components/CuiTabs.vue2.js +124 -0
- package/dist/components/CuiTagInput.vue.js +296 -0
- package/dist/components/CuiTagInput.vue2.js +4 -0
- package/dist/components/CuiTextarea.vue.js +7 -0
- package/dist/components/CuiTextarea.vue2.js +112 -0
- package/dist/components/CuiTimePicker.vue.js +193 -0
- package/dist/components/CuiTimePicker.vue2.js +4 -0
- package/dist/components/CuiTimeline.vue.js +25 -0
- package/dist/components/CuiTimeline.vue2.js +4 -0
- package/dist/components/CuiTimelineItem.vue.js +113 -0
- package/dist/components/CuiTimelineItem.vue2.js +4 -0
- package/dist/components/CuiToast.vue.js +7 -0
- package/dist/components/CuiToast.vue2.js +129 -0
- package/dist/components/CuiToastProvider.vue.js +7 -0
- package/dist/components/CuiToastProvider.vue2.js +87 -0
- package/dist/components/CuiToggle.vue.d.ts.map +1 -1
- package/dist/components/CuiToggle.vue.js +7 -0
- package/dist/components/CuiToggle.vue2.js +116 -0
- package/dist/components/CuiToggleGroup.vue.js +7 -0
- package/dist/components/CuiToggleGroup.vue2.js +59 -0
- package/dist/components/CuiTooltip.vue.js +7 -0
- package/dist/components/CuiTooltip.vue2.js +128 -0
- package/dist/components/CuiTransferList.vue.js +442 -0
- package/dist/components/CuiTransferList.vue2.js +4 -0
- package/dist/components/CuiTreeNode.vue.js +180 -0
- package/dist/components/CuiTreeNode.vue2.js +4 -0
- package/dist/components/CuiTreeView.vue.js +73 -0
- package/dist/components/CuiTreeView.vue2.js +4 -0
- package/dist/components/accordion-context.js +4 -0
- package/dist/components/breadcrumb-context.js +4 -0
- package/dist/components/config-context.js +4 -0
- package/dist/components/data-grid-context.js +4 -0
- package/dist/components/dropdown-context.js +30 -0
- package/dist/components/form-context.js +4 -0
- package/dist/components/multi-select-group-context.js +5 -0
- package/dist/components/radio-context.js +4 -0
- package/dist/components/table-context.js +5 -0
- package/dist/components/tabs-context.js +4 -0
- package/dist/components/toast-context.js +45 -0
- package/dist/composables/useBreakpoint.js +34 -0
- package/dist/composables/useClickOutside.js +14 -0
- package/dist/composables/useCopyToClipboard.js +25 -0
- package/dist/composables/useDataGrid.js +269 -0
- package/dist/composables/useDataGridInertia.js +35 -0
- package/dist/composables/useDataGridViews.js +67 -0
- package/dist/composables/useDensity.js +42 -0
- package/dist/composables/useLayoutContext.js +21 -0
- package/dist/composables/useMessages.js +10 -0
- package/dist/composables/useOverlay.d.ts.map +1 -1
- package/dist/composables/useOverlay.js +59 -0
- package/dist/composables/usePopover.js +53 -0
- package/dist/composables/useScrollShadows.js +56 -0
- package/dist/composables/useTheme.js +57 -0
- package/dist/composables/useToast.js +23 -0
- package/dist/composables/useVirtualScroll.js +69 -0
- package/dist/index.js +290 -0
- package/dist/messages.js +57 -0
- package/dist/ssr-theme-init.js +13 -0
- package/dist/utils/color.js +195 -0
- package/dist/utils/colorIconMap.js +11 -0
- package/dist/utils/date.js +114 -0
- package/dist/utils/devWarn.d.ts +15 -0
- package/dist/utils/devWarn.d.ts.map +1 -0
- package/dist/utils/devWarn.js +20 -0
- package/dist/utils/liveRegion.js +12 -0
- package/dist/utils/resolvers.js +28 -0
- package/dist/utils/responsive.js +68 -0
- package/dist/utils/sizing.js +39 -0
- package/package.json +8 -7
- package/dist/clean-ui.js +0 -11937
- package/dist/clean-ui.umd.cjs +0 -11
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as y, inject as _, computed as p, ref as b, onMounted as x, nextTick as H, watch as k, withDirectives as C, openBlock as E, createElementBlock as O, normalizeClass as d, createElementVNode as c, renderSlot as g, createTextVNode as $, toDisplayString as w, createVNode as B, vShow as A } from "vue";
|
|
2
|
+
import I from "./CuiIcon.vue.js";
|
|
3
|
+
import { AccordionContextKey as z } from "./accordion-context.js";
|
|
4
|
+
const D = ["aria-expanded", "aria-disabled", "tabindex"], N = { class: "cui-accordion-item__header" }, S = { class: "cui-accordion-item__content" }, R = /* @__PURE__ */ y({
|
|
5
|
+
__name: "CuiAccordionItem",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
label: {},
|
|
9
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
10
|
+
hidden: { type: Boolean, default: !1 },
|
|
11
|
+
disabled: { type: Boolean, default: !1 }
|
|
12
|
+
},
|
|
13
|
+
setup(a) {
|
|
14
|
+
const n = a, e = _(z), l = p(() => (e == null ? void 0 : e.isOpen(n.value)) ?? !1), s = p(() => (e == null ? void 0 : e.noAnimation.value) ?? !1), o = b();
|
|
15
|
+
let r = !1;
|
|
16
|
+
x(() => {
|
|
17
|
+
n.defaultOpen && e && !e.isOpen(n.value) && e.toggle(n.value), H(() => {
|
|
18
|
+
e != null && e.isOpen(n.value) && o.value && (o.value.style.maxHeight = "none"), r = !0;
|
|
19
|
+
});
|
|
20
|
+
}), k(l, (t) => {
|
|
21
|
+
if (!r) return;
|
|
22
|
+
if (s.value) {
|
|
23
|
+
o.value && (o.value.style.maxHeight = t ? "none" : "0px");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const i = o.value;
|
|
27
|
+
if (i)
|
|
28
|
+
if (t) {
|
|
29
|
+
i.style.maxHeight = "0px", i.offsetHeight, i.style.maxHeight = `${i.scrollHeight}px`;
|
|
30
|
+
const v = () => {
|
|
31
|
+
i.style.maxHeight = "none", i.removeEventListener("transitionend", v);
|
|
32
|
+
};
|
|
33
|
+
i.addEventListener("transitionend", v);
|
|
34
|
+
} else
|
|
35
|
+
i.style.maxHeight = `${i.scrollHeight}px`, i.offsetHeight, i.style.maxHeight = "0px";
|
|
36
|
+
}, { flush: "post" });
|
|
37
|
+
function u() {
|
|
38
|
+
n.disabled || e == null || e.toggle(n.value);
|
|
39
|
+
}
|
|
40
|
+
function h(t) {
|
|
41
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), u());
|
|
42
|
+
}
|
|
43
|
+
const f = `cui-accordion-panel-${n.value}`, m = `cui-accordion-trigger-${n.value}`;
|
|
44
|
+
return (t, i) => C((E(), O("div", {
|
|
45
|
+
class: d(["cui-accordion-item", { "cui-accordion-item--open": l.value, "cui-accordion-item--disabled": a.disabled }])
|
|
46
|
+
}, [
|
|
47
|
+
c("button", {
|
|
48
|
+
id: m,
|
|
49
|
+
type: "button",
|
|
50
|
+
class: "cui-accordion-item__trigger",
|
|
51
|
+
"aria-expanded": l.value,
|
|
52
|
+
"aria-controls": f,
|
|
53
|
+
"aria-disabled": a.disabled || void 0,
|
|
54
|
+
tabindex: a.disabled ? -1 : 0,
|
|
55
|
+
onClick: u,
|
|
56
|
+
onKeydown: h
|
|
57
|
+
}, [
|
|
58
|
+
c("span", N, [
|
|
59
|
+
g(t.$slots, "header", {}, () => [
|
|
60
|
+
$(w(a.label), 1)
|
|
61
|
+
], !0)
|
|
62
|
+
]),
|
|
63
|
+
B(I, {
|
|
64
|
+
name: "caret-down",
|
|
65
|
+
size: "1rem",
|
|
66
|
+
class: d(["cui-accordion-item__chevron", { "cui-accordion-item__chevron--open": l.value }])
|
|
67
|
+
}, null, 8, ["class"])
|
|
68
|
+
], 40, D),
|
|
69
|
+
c("div", {
|
|
70
|
+
id: f,
|
|
71
|
+
ref_key: "contentRef",
|
|
72
|
+
ref: o,
|
|
73
|
+
class: d(["cui-accordion-item__panel", {
|
|
74
|
+
"cui-accordion-item__panel--open": l.value,
|
|
75
|
+
"cui-accordion-item__panel--no-animation": s.value
|
|
76
|
+
}]),
|
|
77
|
+
role: "region",
|
|
78
|
+
"aria-labelledby": m
|
|
79
|
+
}, [
|
|
80
|
+
c("div", S, [
|
|
81
|
+
g(t.$slots, "default", {}, void 0, !0)
|
|
82
|
+
])
|
|
83
|
+
], 2)
|
|
84
|
+
], 2)), [
|
|
85
|
+
[A, !a.hidden]
|
|
86
|
+
]);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
R as default
|
|
91
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiAlert.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiAlert.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiAlert.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiAlert.vue"],"names":[],"mappings":"AA6SA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAelG,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,cAAc,EAAE,eAAe;IACnF,qBAAqB;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,yCAAyC;IACzC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAuND,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC9D,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA6B/C,QAAA,MAAM,eAAe;;;;;;;aAvQT,YAAY;aAcZ,UAAU;eAFR,cAAc;YARjB,OAAO;iBAEF,OAAO;cAIV,aAAa;6EAqQxB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { defineComponent as x, ref as f, onMounted as D, onUnmounted as A, computed as c, withDirectives as B, openBlock as r, createElementBlock as s, mergeProps as I, renderSlot as d, createVNode as b, createCommentVNode as a, createElementVNode as N, toDisplayString as w, unref as M, vShow as S } from "vue";
|
|
2
|
+
import $ from "./CuiIcon.vue.js";
|
|
3
|
+
import { COLOR_ICON_MAP as V } from "../utils/colorIconMap.js";
|
|
4
|
+
import { resolveLiveRegion as O } from "../utils/liveRegion.js";
|
|
5
|
+
import { warnVariantColor as R } from "../utils/devWarn.js";
|
|
6
|
+
import { useMessages as T } from "../composables/useMessages.js";
|
|
7
|
+
const z = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "cui-alert__icon"
|
|
10
|
+
}, E = { class: "cui-alert__body" }, L = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "cui-alert__title"
|
|
13
|
+
}, P = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "cui-alert__description"
|
|
16
|
+
}, q = {
|
|
17
|
+
key: 2,
|
|
18
|
+
class: "cui-alert__actions"
|
|
19
|
+
}, F = ["aria-label"], Q = /* @__PURE__ */ x({
|
|
20
|
+
__name: "CuiAlert",
|
|
21
|
+
props: {
|
|
22
|
+
variant: { default: "subtle" },
|
|
23
|
+
title: {},
|
|
24
|
+
noIcon: { type: Boolean, default: !1 },
|
|
25
|
+
dismissible: { type: Boolean, default: !1 },
|
|
26
|
+
autoDismiss: {},
|
|
27
|
+
entrance: { default: "fade" },
|
|
28
|
+
animation: { default: "none" },
|
|
29
|
+
rounded: { default: "md" },
|
|
30
|
+
hidden: { type: Boolean, default: !1 },
|
|
31
|
+
color: { default: "info" },
|
|
32
|
+
live: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["dismiss"],
|
|
35
|
+
setup(i, { emit: _ }) {
|
|
36
|
+
const y = {
|
|
37
|
+
none: "0",
|
|
38
|
+
sm: "0.25rem",
|
|
39
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
40
|
+
lg: "0.5rem",
|
|
41
|
+
full: "9999px"
|
|
42
|
+
}, o = i;
|
|
43
|
+
R("CuiAlert", { value: o.variant, allowed: ["solid", "subtle", "outline"] }, o.color);
|
|
44
|
+
const p = _, m = f(!0), l = f(!1);
|
|
45
|
+
let n = null;
|
|
46
|
+
D(() => {
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
l.value = !0;
|
|
49
|
+
}), o.autoDismiss && o.autoDismiss > 0 && (n = setTimeout(() => {
|
|
50
|
+
v();
|
|
51
|
+
}, o.autoDismiss));
|
|
52
|
+
}), A(() => {
|
|
53
|
+
n && clearTimeout(n);
|
|
54
|
+
});
|
|
55
|
+
function v() {
|
|
56
|
+
l.value = !1, setTimeout(() => {
|
|
57
|
+
m.value = !1, p("dismiss");
|
|
58
|
+
}, 300);
|
|
59
|
+
}
|
|
60
|
+
const g = c(() => {
|
|
61
|
+
const e = o.color, u = o.variant, t = {
|
|
62
|
+
borderRadius: y[o.rounded],
|
|
63
|
+
"--_alert-color": `var(--cui-${e})`,
|
|
64
|
+
"--_alert-focus-ring": `var(--cui-${e}-focus-ring)`
|
|
65
|
+
};
|
|
66
|
+
return u === "solid" ? (t.background = `var(--cui-${e}-solid, var(--cui-${e}))`, t.color = `var(--cui-${e}-text)`, t.border = "1px solid transparent", t["--_alert-icon-color"] = `var(--cui-${e}-text)`, t["--_alert-dismiss-color"] = `var(--cui-${e}-text)`) : u === "outline" ? (t.background = "transparent", t.color = `var(--cui-${e})`, t.border = `1px solid var(--cui-${e}-border)`, t["--_alert-icon-color"] = `var(--cui-${e})`, t["--_alert-dismiss-color"] = `var(--cui-${e})`) : (t.background = `var(--cui-${e}-bg)`, t.color = "var(--cui-text-body)", t.border = `1px solid var(--cui-${e}-border)`, t["--_alert-icon-color"] = `var(--cui-${e})`, t["--_alert-dismiss-color"] = "var(--cui-text-secondary)"), t;
|
|
67
|
+
}), k = c(() => V[o.color] ?? "info"), h = c(() => O(o.color, o.live)), C = T();
|
|
68
|
+
return (e, u) => m.value ? B((r(), s("div", I({
|
|
69
|
+
key: 0,
|
|
70
|
+
class: ["cui-alert", [
|
|
71
|
+
`cui-alert--entrance-${i.entrance}`,
|
|
72
|
+
{ "cui-alert--mounted": l.value },
|
|
73
|
+
i.animation !== "none" ? `cui-alert--${i.animation}` : ""
|
|
74
|
+
]],
|
|
75
|
+
style: g.value
|
|
76
|
+
}, h.value), [
|
|
77
|
+
i.noIcon ? a("", !0) : (r(), s("div", z, [
|
|
78
|
+
d(e.$slots, "icon", {}, () => [
|
|
79
|
+
b($, {
|
|
80
|
+
name: k.value,
|
|
81
|
+
size: "1.25rem"
|
|
82
|
+
}, null, 8, ["name"])
|
|
83
|
+
], !0)
|
|
84
|
+
])),
|
|
85
|
+
N("div", E, [
|
|
86
|
+
i.title ? (r(), s("div", L, w(i.title), 1)) : a("", !0),
|
|
87
|
+
e.$slots.default ? (r(), s("div", P, [
|
|
88
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
89
|
+
])) : a("", !0),
|
|
90
|
+
e.$slots.actions ? (r(), s("div", q, [
|
|
91
|
+
d(e.$slots, "actions", {}, void 0, !0)
|
|
92
|
+
])) : a("", !0)
|
|
93
|
+
]),
|
|
94
|
+
i.dismissible ? (r(), s("button", {
|
|
95
|
+
key: 1,
|
|
96
|
+
type: "button",
|
|
97
|
+
class: "cui-alert__dismiss",
|
|
98
|
+
"aria-label": M(C).dismiss,
|
|
99
|
+
onClick: v
|
|
100
|
+
}, [
|
|
101
|
+
b($, {
|
|
102
|
+
name: "x",
|
|
103
|
+
size: "0.875rem"
|
|
104
|
+
})
|
|
105
|
+
], 8, F)) : a("", !0)
|
|
106
|
+
], 16)), [
|
|
107
|
+
[S, !i.hidden]
|
|
108
|
+
]) : a("", !0);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export {
|
|
112
|
+
Q as default
|
|
113
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { defineComponent as y, ref as x, computed as i, withDirectives as D, openBlock as o, createElementBlock as n, normalizeStyle as u, toDisplayString as k, createBlock as w, createCommentVNode as p, vShow as O } from "vue";
|
|
2
|
+
import z from "./CuiIcon.vue.js";
|
|
3
|
+
import { scaleDensity as t } from "../utils/sizing.js";
|
|
4
|
+
const C = ["src", "alt"], S = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "cui-avatar__initials"
|
|
7
|
+
}, I = /* @__PURE__ */ y({
|
|
8
|
+
__name: "CuiAvatar",
|
|
9
|
+
props: {
|
|
10
|
+
src: {},
|
|
11
|
+
alt: {},
|
|
12
|
+
name: {},
|
|
13
|
+
initials: {},
|
|
14
|
+
icon: {},
|
|
15
|
+
shape: { default: "circle" },
|
|
16
|
+
statusAnimation: {},
|
|
17
|
+
status: {},
|
|
18
|
+
hidden: { type: Boolean, default: !1 },
|
|
19
|
+
color: { default: "primary" },
|
|
20
|
+
size: { default: "md" }
|
|
21
|
+
},
|
|
22
|
+
setup(s) {
|
|
23
|
+
const e = s, c = x(!1), l = i(() => e.src && !c.value), m = i(() => e.initials ? e.initials : e.name ? e.name.split(" ").filter(Boolean).slice(0, 2).map((r) => r[0].toUpperCase()).join("") : ""), b = {
|
|
24
|
+
xs: { box: t("1.5rem"), font: "0.5rem", icon: t("0.75rem"), statusDot: t("0.5rem"), statusOffset: t("-2px") },
|
|
25
|
+
sm: { box: t("2rem"), font: "0.625rem", icon: t("0.875rem"), statusDot: t("0.625rem"), statusOffset: t("-2px") },
|
|
26
|
+
md: { box: t("2.5rem"), font: "0.75rem", icon: t("1rem"), statusDot: t("0.625rem"), statusOffset: t("-1px") },
|
|
27
|
+
lg: { box: t("3.5rem"), font: "1rem", icon: t("1.25rem"), statusDot: t("0.75rem"), statusOffset: t("0px") },
|
|
28
|
+
xl: { box: t("5rem"), font: "1.375rem", icon: t("1.75rem"), statusDot: t("1rem"), statusOffset: t("2px") }
|
|
29
|
+
}, a = i(() => b[e.size]), g = i(() => ({
|
|
30
|
+
width: a.value.box,
|
|
31
|
+
height: a.value.box,
|
|
32
|
+
borderRadius: e.shape === "circle" ? "50%" : "20%",
|
|
33
|
+
fontSize: a.value.font,
|
|
34
|
+
background: l.value ? "transparent" : `var(--cui-${e.color}-bg)`,
|
|
35
|
+
color: l.value ? "transparent" : `var(--cui-${e.color})`
|
|
36
|
+
})), f = {
|
|
37
|
+
online: "var(--cui-success)",
|
|
38
|
+
offline: "var(--cui-text-tertiary, #999)",
|
|
39
|
+
away: "var(--cui-warning)",
|
|
40
|
+
busy: "var(--cui-error)"
|
|
41
|
+
}, h = i(() => {
|
|
42
|
+
if (!e.status) return {};
|
|
43
|
+
const r = {
|
|
44
|
+
width: a.value.statusDot,
|
|
45
|
+
height: a.value.statusDot,
|
|
46
|
+
background: f[e.status],
|
|
47
|
+
border: "2px solid var(--cui-surface-base, white)",
|
|
48
|
+
borderRadius: "50%",
|
|
49
|
+
position: "absolute",
|
|
50
|
+
bottom: a.value.statusOffset,
|
|
51
|
+
right: a.value.statusOffset
|
|
52
|
+
};
|
|
53
|
+
return e.statusAnimation === "pulse" && (r.animation = "cui-pulse 2s ease-in-out infinite"), r;
|
|
54
|
+
}), v = i(() => {
|
|
55
|
+
if (!(!e.status || e.statusAnimation !== "ping"))
|
|
56
|
+
return {
|
|
57
|
+
width: a.value.statusDot,
|
|
58
|
+
height: a.value.statusDot,
|
|
59
|
+
background: f[e.status],
|
|
60
|
+
borderRadius: "50%",
|
|
61
|
+
position: "absolute",
|
|
62
|
+
bottom: a.value.statusOffset,
|
|
63
|
+
right: a.value.statusOffset,
|
|
64
|
+
opacity: "0.75",
|
|
65
|
+
animation: "cui-avatar-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite"
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
return (r, d) => D((o(), n("div", {
|
|
69
|
+
class: "cui-avatar",
|
|
70
|
+
style: u(g.value)
|
|
71
|
+
}, [
|
|
72
|
+
l.value ? (o(), n("img", {
|
|
73
|
+
key: 0,
|
|
74
|
+
src: s.src,
|
|
75
|
+
alt: s.alt || s.name || "Avatar",
|
|
76
|
+
class: "cui-avatar__img",
|
|
77
|
+
style: u({ borderRadius: s.shape === "circle" ? "50%" : "20%" }),
|
|
78
|
+
onError: d[0] || (d[0] = (A) => c.value = !0)
|
|
79
|
+
}, null, 44, C)) : m.value ? (o(), n("span", S, k(m.value), 1)) : (o(), w(z, {
|
|
80
|
+
key: 2,
|
|
81
|
+
name: s.icon || "user",
|
|
82
|
+
size: a.value.icon
|
|
83
|
+
}, null, 8, ["name", "size"])),
|
|
84
|
+
v.value ? (o(), n("span", {
|
|
85
|
+
key: 3,
|
|
86
|
+
style: u(v.value)
|
|
87
|
+
}, null, 4)) : p("", !0),
|
|
88
|
+
s.status ? (o(), n("span", {
|
|
89
|
+
key: 4,
|
|
90
|
+
style: u(h.value)
|
|
91
|
+
}, null, 4)) : p("", !0)
|
|
92
|
+
], 4)), [
|
|
93
|
+
[O, !s.hidden]
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
I as default
|
|
99
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as t, withDirectives as r, openBlock as n, createElementBlock as o, normalizeStyle as i, renderSlot as l, vShow as s } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ t({
|
|
3
|
+
__name: "CuiAvatarGroup",
|
|
4
|
+
props: {
|
|
5
|
+
spacing: { default: "-0.5rem" },
|
|
6
|
+
max: {},
|
|
7
|
+
hidden: { type: Boolean, default: !1 }
|
|
8
|
+
},
|
|
9
|
+
setup(e) {
|
|
10
|
+
return (a, c) => r((n(), o("div", {
|
|
11
|
+
class: "cui-avatar-group",
|
|
12
|
+
style: i({ "--_avatar-group-spacing": e.spacing })
|
|
13
|
+
}, [
|
|
14
|
+
l(a.$slots, "default")
|
|
15
|
+
], 4)), [
|
|
16
|
+
[s, !e.hidden]
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
u as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent as m, ref as k, onMounted as f, computed as c, withDirectives as v, openBlock as g, createElementBlock as y, normalizeStyle as h, normalizeClass as B, vShow as x } from "vue";
|
|
2
|
+
import { resolveColor as C } from "../utils/color.js";
|
|
3
|
+
const w = /* @__PURE__ */ m({
|
|
4
|
+
__name: "CuiBackdrop",
|
|
5
|
+
props: {
|
|
6
|
+
opacity: { default: 0.5 },
|
|
7
|
+
blur: { default: "none" },
|
|
8
|
+
color: { default: "black" },
|
|
9
|
+
image: {},
|
|
10
|
+
gradient: {},
|
|
11
|
+
visible: { type: Boolean },
|
|
12
|
+
hidden: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["click"],
|
|
15
|
+
setup(l, { emit: s }) {
|
|
16
|
+
const e = l, u = s, d = {
|
|
17
|
+
none: "none",
|
|
18
|
+
sm: "2px",
|
|
19
|
+
md: "4px",
|
|
20
|
+
lg: "8px"
|
|
21
|
+
}, r = k(!1);
|
|
22
|
+
f(() => {
|
|
23
|
+
requestAnimationFrame(() => {
|
|
24
|
+
r.value = !0;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const b = c(() => e.visible !== void 0 ? e.visible : r.value), p = c(() => {
|
|
28
|
+
const i = d[e.blur] ?? e.blur, n = i !== "none", o = {}, t = [];
|
|
29
|
+
e.gradient && t.push(e.gradient), e.image && t.push(`url("${e.image}") repeat`);
|
|
30
|
+
const a = C(e.color, "black");
|
|
31
|
+
return n ? (t.push(`color-mix(in srgb, ${a} ${Math.round(e.opacity * 100)}%, transparent)`), o.backdropFilter = `blur(${i})`, o.webkitBackdropFilter = `blur(${i})`) : t.push(a), o.background = t.join(", "), o;
|
|
32
|
+
});
|
|
33
|
+
return (i, n) => v((g(), y("div", {
|
|
34
|
+
class: B(["cui-backdrop", { "cui-backdrop--visible": b.value }]),
|
|
35
|
+
style: h({
|
|
36
|
+
...p.value,
|
|
37
|
+
// When no blur, use element opacity for the fade-in
|
|
38
|
+
...!l.blur || l.blur === "none" ? { "--_backdrop-opacity": String(l.opacity) } : {}
|
|
39
|
+
}),
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
onClick: n[0] || (n[0] = (o) => u("click", o))
|
|
42
|
+
}, null, 6)), [
|
|
43
|
+
[x, !l.hidden]
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
w as default
|
|
49
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiBadge.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiBadge.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAMhG,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAIlE,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa;IACjF,qBAAqB;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,yCAAyC;IACzC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB;IAChB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAsKD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA0B/C,QAAA,MAAM,eAAe;;;;;;;;aA3MT,YAAY;aAQZ,UAAU;SANd,OAAO;eAED,OAAO;eAEP,cAAc;6EA6M1B,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as z, computed as s, withDirectives as c, openBlock as i, createElementBlock as l, normalizeClass as m, createElementVNode as b, normalizeStyle as d, createCommentVNode as v, vShow as f, renderSlot as C, withModifiers as h, unref as x, createVNode as B } from "vue";
|
|
2
|
+
import { clampSize as w } from "../utils/sizing.js";
|
|
3
|
+
import { warnVariantColor as E } from "../utils/devWarn.js";
|
|
4
|
+
import V from "./CuiIcon.vue.js";
|
|
5
|
+
import { useMessages as M } from "../composables/useMessages.js";
|
|
6
|
+
const N = { class: "cui-badge__content" }, D = ["aria-label"], U = /* @__PURE__ */ z({
|
|
7
|
+
__name: "CuiBadge",
|
|
8
|
+
props: {
|
|
9
|
+
variant: { default: "subtle" },
|
|
10
|
+
dot: { type: Boolean, default: !1 },
|
|
11
|
+
removable: { type: Boolean, default: !1 },
|
|
12
|
+
animation: { default: "none" },
|
|
13
|
+
rounded: { default: "full" },
|
|
14
|
+
hidden: { type: Boolean, default: !1 },
|
|
15
|
+
color: { default: "primary" },
|
|
16
|
+
size: { default: "sm" }
|
|
17
|
+
},
|
|
18
|
+
emits: ["remove"],
|
|
19
|
+
setup(a, { emit: g }) {
|
|
20
|
+
const p = ["sm", "md"], t = a;
|
|
21
|
+
E("CuiBadge", { value: t.variant, allowed: ["solid", "subtle", "outline"] }, t.color);
|
|
22
|
+
const y = {
|
|
23
|
+
none: "0",
|
|
24
|
+
sm: "0.25rem",
|
|
25
|
+
md: "var(--cui-button-radius, 0.375rem)",
|
|
26
|
+
lg: "0.5rem",
|
|
27
|
+
full: "9999px"
|
|
28
|
+
}, $ = g, k = s(() => {
|
|
29
|
+
const o = t.color, n = t.variant, e = {};
|
|
30
|
+
return n === "solid" ? (e.background = `var(--cui-${o}-solid, var(--cui-${o}))`, e.color = `var(--cui-${o}-text)`, e.border = "1px solid transparent") : n === "outline" ? (e.background = "transparent", e.color = `var(--cui-${o})`, e.border = `1px solid var(--cui-${o}-border)`) : (e.background = `var(--cui-${o}-bg)`, e.color = `var(--cui-${o})`, e.border = "1px solid transparent"), e.borderRadius = y[t.rounded], e;
|
|
31
|
+
}), u = s(() => ({
|
|
32
|
+
background: `var(--cui-${t.color})`
|
|
33
|
+
})), r = s(() => w(t.size, p)), S = M();
|
|
34
|
+
return (o, n) => a.dot ? c((i(), l("span", {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: m(["cui-badge cui-badge--dot", [
|
|
37
|
+
`cui-badge--${r.value}`,
|
|
38
|
+
a.animation !== "none" ? `cui-badge--${a.animation}` : ""
|
|
39
|
+
]])
|
|
40
|
+
}, [
|
|
41
|
+
b("span", {
|
|
42
|
+
class: "cui-badge__dot",
|
|
43
|
+
style: d(u.value)
|
|
44
|
+
}, null, 4),
|
|
45
|
+
a.animation === "ping" ? (i(), l("span", {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "cui-badge__ping",
|
|
48
|
+
style: d(u.value)
|
|
49
|
+
}, null, 4)) : v("", !0)
|
|
50
|
+
], 2)), [
|
|
51
|
+
[f, !a.hidden]
|
|
52
|
+
]) : c((i(), l("span", {
|
|
53
|
+
key: 1,
|
|
54
|
+
class: m(["cui-badge", [
|
|
55
|
+
`cui-badge--${r.value}`,
|
|
56
|
+
a.animation !== "none" ? `cui-badge--${a.animation}` : ""
|
|
57
|
+
]]),
|
|
58
|
+
style: d(k.value)
|
|
59
|
+
}, [
|
|
60
|
+
b("span", N, [
|
|
61
|
+
C(o.$slots, "default", {}, void 0, !0)
|
|
62
|
+
]),
|
|
63
|
+
a.removable ? (i(), l("button", {
|
|
64
|
+
key: 0,
|
|
65
|
+
type: "button",
|
|
66
|
+
class: "cui-badge__remove",
|
|
67
|
+
"aria-label": x(S).remove,
|
|
68
|
+
onClick: n[0] || (n[0] = h((e) => $("remove"), ["stop"]))
|
|
69
|
+
}, [
|
|
70
|
+
B(V, {
|
|
71
|
+
name: "x",
|
|
72
|
+
size: r.value === "sm" ? "0.625rem" : "0.75rem"
|
|
73
|
+
}, null, 8, ["size"])
|
|
74
|
+
], 8, D)) : v("", !0)
|
|
75
|
+
], 6)), [
|
|
76
|
+
[f, !a.hidden]
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
U as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as g, ref as h, computed as s, withDirectives as k, openBlock as i, createElementBlock as l, mergeProps as b, createBlock as a, createCommentVNode as r, createElementVNode as x, renderSlot as c, withCtx as $, createVNode as C, vShow as B } from "vue";
|
|
2
|
+
import d from "./CuiIcon.vue.js";
|
|
3
|
+
import I from "./CuiButton.vue.js";
|
|
4
|
+
import { COLOR_ICON_MAP as w } from "../utils/colorIconMap.js";
|
|
5
|
+
import { resolveLiveRegion as z } from "../utils/liveRegion.js";
|
|
6
|
+
const K = { style: { flex: "1", "font-size": "0.875rem", "font-weight": "500", "text-align": "center" } }, N = {
|
|
7
|
+
key: 1,
|
|
8
|
+
style: { "flex-shrink": "0", display: "flex", "align-items": "center", gap: "calc(0.5rem * var(--cui-density-scale, 1))" }
|
|
9
|
+
}, L = /* @__PURE__ */ g({
|
|
10
|
+
__name: "CuiBanner",
|
|
11
|
+
props: {
|
|
12
|
+
variant: { default: "subtle" },
|
|
13
|
+
position: { default: "top" },
|
|
14
|
+
dismissible: { type: Boolean, default: !0 },
|
|
15
|
+
noIcon: { type: Boolean, default: !1 },
|
|
16
|
+
storageKey: {},
|
|
17
|
+
hidden: { type: Boolean, default: !1 },
|
|
18
|
+
color: { default: "primary" },
|
|
19
|
+
live: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["dismiss"],
|
|
22
|
+
setup(t, { emit: u }) {
|
|
23
|
+
const e = t, m = u, n = h(
|
|
24
|
+
e.storageKey ? localStorage.getItem(`cui-banner-${e.storageKey}`) === "1" : !1
|
|
25
|
+
);
|
|
26
|
+
function f() {
|
|
27
|
+
n.value = !0, e.storageKey && localStorage.setItem(`cui-banner-${e.storageKey}`, "1"), m("dismiss");
|
|
28
|
+
}
|
|
29
|
+
const p = s(() => w[e.color] ?? "info"), v = s(() => z(e.color, e.live)), y = s(() => {
|
|
30
|
+
const o = {
|
|
31
|
+
position: "sticky",
|
|
32
|
+
left: "0",
|
|
33
|
+
right: "0",
|
|
34
|
+
zIndex: "50",
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
gap: "calc(0.75rem * var(--cui-density-scale, 1))",
|
|
39
|
+
padding: "calc(0.625rem * var(--cui-density-scale, 1)) calc(1rem * var(--cui-density-scale, 1))"
|
|
40
|
+
};
|
|
41
|
+
return o[e.position] = "0", e.variant === "solid" ? (o.background = `var(--cui-${e.color}-solid, var(--cui-${e.color}))`, o.color = `var(--cui-${e.color}-text, white)`) : (o.background = `var(--cui-${e.color}-bg)`, o.color = `var(--cui-${e.color})`, o.borderBottom = e.position === "top" ? `1px solid var(--cui-${e.color}-border)` : "none", o.borderTop = e.position === "bottom" ? `1px solid var(--cui-${e.color}-border)` : "none"), o;
|
|
42
|
+
});
|
|
43
|
+
return (o, S) => n.value ? r("", !0) : k((i(), l("div", b({
|
|
44
|
+
key: 0,
|
|
45
|
+
style: y.value
|
|
46
|
+
}, v.value), [
|
|
47
|
+
t.noIcon ? r("", !0) : (i(), a(d, {
|
|
48
|
+
key: 0,
|
|
49
|
+
name: p.value,
|
|
50
|
+
size: "1.125rem",
|
|
51
|
+
style: { "flex-shrink": "0" }
|
|
52
|
+
}, null, 8, ["name"])),
|
|
53
|
+
x("div", K, [
|
|
54
|
+
c(o.$slots, "default")
|
|
55
|
+
]),
|
|
56
|
+
o.$slots.actions ? (i(), l("div", N, [
|
|
57
|
+
c(o.$slots, "actions")
|
|
58
|
+
])) : r("", !0),
|
|
59
|
+
t.dismissible ? (i(), a(I, {
|
|
60
|
+
key: 2,
|
|
61
|
+
variant: "ghost",
|
|
62
|
+
size: "xs",
|
|
63
|
+
style: { "flex-shrink": "0", color: "currentColor", opacity: "0.7" },
|
|
64
|
+
onClick: f
|
|
65
|
+
}, {
|
|
66
|
+
default: $(() => [
|
|
67
|
+
C(d, {
|
|
68
|
+
name: "x",
|
|
69
|
+
size: "0.875rem"
|
|
70
|
+
})
|
|
71
|
+
]),
|
|
72
|
+
_: 1
|
|
73
|
+
})) : r("", !0)
|
|
74
|
+
], 16)), [
|
|
75
|
+
[B, !t.hidden]
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
L as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as t, provide as o, withDirectives as s, openBlock as c, createElementBlock as l, unref as n, createElementVNode as d, renderSlot as i, vShow as u } from "vue";
|
|
2
|
+
import { BreadcrumbContextKey as m } from "./breadcrumb-context.js";
|
|
3
|
+
import { useMessages as p } from "../composables/useMessages.js";
|
|
4
|
+
const b = ["aria-label"], f = { class: "cui-breadcrumb__list" }, g = /* @__PURE__ */ t({
|
|
5
|
+
__name: "CuiBreadcrumb",
|
|
6
|
+
props: {
|
|
7
|
+
separator: { default: "/" },
|
|
8
|
+
hidden: { type: Boolean, default: !1 }
|
|
9
|
+
},
|
|
10
|
+
setup(e) {
|
|
11
|
+
o(m, {
|
|
12
|
+
separator: e.separator
|
|
13
|
+
});
|
|
14
|
+
const r = p();
|
|
15
|
+
return (a, h) => s((c(), l("nav", {
|
|
16
|
+
"aria-label": n(r).breadcrumb.label,
|
|
17
|
+
class: "cui-breadcrumb"
|
|
18
|
+
}, [
|
|
19
|
+
d("ol", f, [
|
|
20
|
+
i(a.$slots, "default", {}, void 0, !0)
|
|
21
|
+
])
|
|
22
|
+
], 8, b)), [
|
|
23
|
+
[u, !e.hidden]
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
g as default
|
|
29
|
+
};
|