@codeandfunction/callaloo 3.15.2 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/assets/CLFormCharCounter.css +1 -0
- package/dist/assets/CLInputMessages.css +1 -0
- package/dist/chunks/CLA11yButton.vue_vue_type_style_index_0_lang-COGwQtRU.js +45 -0
- package/dist/chunks/CLButton.vue_vue_type_style_index_0_lang-CqgySW52.js +128 -0
- package/dist/chunks/CLCard.vue_vue_type_style_index_0_lang-DSvubJfG.js +252 -0
- package/dist/chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-CJ4VrvmR.js +38 -0
- package/dist/chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-ORvye4vi.js +43 -0
- package/dist/chunks/CLHeading.vue_vue_type_style_index_0_lang-CbHdHW2E.js +50 -0
- package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-zZ4zGuBt.js +83 -0
- package/dist/chunks/CLInputMessages.vue_vue_type_style_index_0_lang-xm2qDJGJ.js +121 -0
- package/dist/chunks/CLLink.vue_vue_type_style_index_0_lang-D7BqWIqs.js +60 -0
- package/dist/chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Dp3SsIfq.js +44 -0
- package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-BXGTb6A6.js +88 -0
- package/dist/chunks/CLProgress.vue_vue_type_style_index_0_lang-5-cwF-oh.js +65 -0
- package/dist/chunks/CLSkeleton.vue_vue_type_style_index_0_lang-D7_swcoA.js +33 -0
- package/dist/chunks/CLSpinner.vue_vue_type_style_index_0_lang-CLccujHE.js +53 -0
- package/dist/chunks/CLText.vue_vue_type_style_index_0_lang-CTc6UiQV.js +46 -0
- package/dist/chunks/CLToast.vue_vue_type_style_index_0_lang-BIiSNSlg.js +178 -0
- package/dist/chunks/base-theme-B89pbWnC.js +841 -0
- package/dist/chunks/useEsc-BGAp0d_1.js +19 -0
- package/dist/chunks/useHasSlotContent-DDqs5uK9.js +14 -0
- package/dist/chunks/utils-CFL9veAf.js +30 -0
- package/dist/chunks/utils-D2P_fCSp.js +73 -0
- package/dist/chunks/utils-DYzsHCvl.js +15 -0
- package/dist/chunks/utils-DaKwZixu.js +26 -0
- package/dist/chunks/utils-Dg9e9uLW.js +29 -0
- package/dist/chunks/utils-Dz_31dEE.js +387 -0
- package/dist/components/Buttons/CLA11yButton/CLA11yButton.css +1 -0
- package/dist/components/Buttons/CLA11yButton/CLA11yButton.js +6 -0
- package/dist/components/Buttons/CLA11yButton/CLA11yButton.vue.d.ts +2 -2
- package/dist/components/Buttons/CLButton/CLButton.css +1 -0
- package/dist/components/Buttons/CLButton/CLButton.js +6 -0
- package/dist/components/Buttons/CLButton/CLButton.vue.d.ts +7 -7
- package/dist/components/CLIcon/CLIcon.css +1 -0
- package/dist/components/CLIcon/CLIcon.js +6 -0
- package/dist/components/{Assets/CLIcon → CLIcon}/CLIcon.vue.d.ts +1 -1
- package/dist/components/CLTable/CLTable.css +1 -0
- package/dist/components/CLTable/CLTable.js +197 -0
- package/dist/components/{Table → CLTable}/index.d.ts +0 -7
- package/dist/components/Containers/CLCard/CLCard.css +1 -0
- package/dist/components/Containers/CLCard/CLCard.js +6 -0
- package/dist/components/Containers/CLCard/CLCard.vue.d.ts +6 -6
- package/dist/components/Containers/CLCarousel/CLCarousel.css +1 -0
- package/dist/components/Containers/CLCarousel/CLCarousel.js +436 -0
- package/dist/components/Containers/CLCarousel/CLCarousel.vue.d.ts +2 -2
- package/dist/components/Containers/CLCarousel/CLCarouselNavigation.vue.d.ts +1 -1
- package/dist/components/Containers/CLDisclosure/CLDisclosure.css +1 -0
- package/dist/components/Containers/CLDisclosure/CLDisclosure.js +137 -0
- package/dist/components/Containers/CLDisclosure/CLDisclosure.vue.d.ts +3 -3
- package/dist/components/Form/CLCheckbox/CLCheckbox.css +1 -0
- package/dist/components/Form/CLCheckbox/CLCheckbox.js +147 -0
- package/dist/components/Form/CLCheckbox/CLCheckbox.vue.d.ts +4 -4
- package/dist/components/Form/CLFormCharCounter/CLFormCharCounter.vue.d.ts +24 -0
- package/dist/components/Form/CLFormLabel/CLFormLabel.vue.d.ts +22 -0
- package/dist/components/Form/CLInput/CLInput.css +1 -0
- package/dist/components/Form/CLInput/CLInput.js +378 -0
- package/dist/components/Form/CLInput/CLInput.vue.d.ts +8 -8
- package/dist/components/Form/CLInput/CLInputColorTools.vue.d.ts +29 -0
- package/dist/components/Form/CLInput/CLInputPill.vue.d.ts +14 -0
- package/dist/components/Form/CLInput/CLInputPrefix.vue.d.ts +20 -0
- package/dist/components/Form/CLInput/CLInputSuffix.vue.d.ts +20 -0
- package/dist/components/Form/CLInput/index.d.ts +18 -3
- package/dist/components/Form/CLRadioButton/CLRadioButton.css +1 -0
- package/dist/components/Form/CLRadioButton/CLRadioButton.js +132 -0
- package/dist/components/Form/CLRadioButton/CLRadioButton.vue.d.ts +1 -1
- package/dist/components/Form/CLSelect/CLSelect.css +1 -0
- package/dist/components/Form/CLSelect/CLSelect.js +137 -0
- package/dist/components/Form/CLSelect/CLSelect.vue.d.ts +9 -9
- package/dist/components/Form/CLTextArea/CLTextArea.css +1 -0
- package/dist/components/Form/CLTextArea/CLTextArea.js +149 -0
- package/dist/components/Form/CLTextArea/CLTextArea.vue.d.ts +2 -2
- package/dist/components/Form/index.d.ts +5 -6
- package/dist/components/Indicators/CLBadge/CLBadge.css +1 -0
- package/dist/components/Indicators/CLBadge/CLBadge.js +40 -0
- package/dist/components/Indicators/CLBadge/CLBadge.vue.d.ts +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.css +1 -0
- package/dist/components/Indicators/CLBanner/CLBanner.js +147 -0
- package/dist/components/Indicators/CLBanner/CLBanner.vue.d.ts +3 -3
- package/dist/components/Indicators/CLPill/CLPill.css +1 -0
- package/dist/components/Indicators/CLPill/CLPill.js +6 -0
- package/dist/components/Indicators/CLPill/CLPill.vue.d.ts +3 -3
- package/dist/components/Indicators/CLProgress/CLProgress.css +1 -0
- package/dist/components/Indicators/CLProgress/CLProgress.js +6 -0
- package/dist/components/Indicators/CLProgress/CLProgress.vue.d.ts +2 -2
- package/dist/components/Loading/CLSkeleton/CLSkeleton.css +1 -0
- package/dist/components/Loading/CLSkeleton/CLSkeleton.js +6 -0
- package/dist/components/Loading/CLSkeleton/CLSkeleton.vue.d.ts +1 -1
- package/dist/components/Loading/CLSpinner/CLSpinner.css +1 -0
- package/dist/components/Loading/CLSpinner/CLSpinner.js +6 -0
- package/dist/components/Loading/CLSpinner/CLSpinner.vue.d.ts +1 -1
- package/dist/components/Modals/CLModal/CLModal.css +1 -0
- package/dist/components/Modals/CLModal/CLModal.js +175 -0
- package/dist/components/Modals/CLModal/CLModal.vue.d.ts +2 -2
- package/dist/components/Navigation/CLLink/CLLink.css +1 -0
- package/dist/components/Navigation/CLLink/CLLink.js +6 -0
- package/dist/components/Navigation/CLLink/CLLink.vue.d.ts +2 -2
- package/dist/components/Navigation/CLNavLink/CLNavLink.js +5 -0
- package/dist/components/Navigation/CLNavLink/CLNavLink.vue.d.ts +1 -1
- package/dist/components/Navigation/CLNavSection/CLNavSection.css +1 -0
- package/dist/components/Navigation/CLNavSection/CLNavSection.js +55 -0
- package/dist/components/Navigation/CLNavSection/CLNavSection.vue.d.ts +1 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.css +1 -0
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +1233 -0
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +29 -29
- package/dist/components/Popups/CLToast/CLToast.css +1 -0
- package/dist/components/Popups/CLToast/CLToast.js +6 -0
- package/dist/components/Popups/CLToast/CLToast.vue.d.ts +2 -2
- package/dist/components/Providers/CLThemeProvider/CLThemeProvider.js +42 -0
- package/dist/components/Providers/CLThemeProvider/CLThemeProvider.vue.d.ts +27 -0
- package/dist/components/Providers/CLThemeProvider/index.d.ts +4 -0
- package/dist/components/Providers/CLToastProvider/CLToastProvider.js +45 -0
- package/dist/components/Providers/{Toast → CLToastProvider}/CLToastProvider.vue.d.ts +1 -7
- package/dist/components/Providers/CLToastProvider/index.d.ts +4 -0
- package/dist/components/Providers/index.d.ts +2 -6
- package/dist/components/Typography/CLHeading/CLHeading.css +1 -0
- package/dist/components/Typography/CLHeading/CLHeading.js +6 -0
- package/dist/components/Typography/CLText/CLText.css +1 -0
- package/dist/components/Typography/CLText/CLText.js +6 -0
- package/dist/index.d.ts +1 -16
- package/dist/index.js +27 -5769
- package/dist/types.d.ts +4 -0
- package/dist/utils/helper.d.ts +1 -0
- package/package.json +133 -10
- package/dist/assets/styles.css +0 -1
- package/dist/components/Assets/index.d.ts +0 -2
- package/dist/components/Providers/Theme/CLThemeProvider.vue.d.ts +0 -26
- package/dist/constants.d.ts +0 -22
- package/dist/stats.json +0 -41
- package/dist/chunks/{icons.QRYZHNAf.js → icons-QRYZHNAf.js} +0 -0
- package/dist/components/{Assets/CLIcon → CLIcon}/index.d.ts +0 -0
- package/dist/components/{Assets → CLIcon}/utils.d.ts +0 -0
- package/dist/components/{Table → CLTable}/CLTable.vue.d.ts +1 -1
- /package/dist/components/{Table → CLTable}/CLTableBody.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/CLTableCell.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/CLTableFooter.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/CLTableHeader.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/CLTableNestedCell.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/CLTableRow.vue.d.ts +0 -0
- /package/dist/components/{Table → CLTable}/utils.d.ts +0 -0
- /package/dist/components/Providers/{Theme → CLThemeProvider}/base-theme.d.ts +0 -0
- /package/dist/components/Providers/{Theme → CLThemeProvider}/utils.d.ts +0 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import './CLCarousel.css';
|
|
2
|
+
import { defineComponent as re, computed as u, createElementBlock as c, openBlock as s, Fragment as j, createCommentVNode as C, unref as e, normalizeClass as l, renderList as me, createBlock as he, createElementVNode as y, createVNode as x, withCtx as X, createTextVNode as Y, toDisplayString as q, useCssVars as be, ref as r, onMounted as we, onUnmounted as pe, watch as Ce, renderSlot as Z, nextTick as se } from "vue";
|
|
3
|
+
import { _ as E } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-CqgySW52.js";
|
|
4
|
+
import { _ as ce } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-CTc6UiQV.js";
|
|
5
|
+
import { CLPaginationType as $, CLColorVariants as B, CLSizes as W, CLIconSizes as D, CLIconNames as O, CLTextTypes as xe, CLAlign as A, CLOrder as R, CLColors as ye } from "../../../index.js";
|
|
6
|
+
import { i as H, h as Pe, j as $e } from "../../../chunks/base-theme-B89pbWnC.js";
|
|
7
|
+
import { u as Te } from "../../../chunks/useHasSlotContent-DDqs5uK9.js";
|
|
8
|
+
const Q = /* @__PURE__ */ re({
|
|
9
|
+
name: "CLCarouselNavigation",
|
|
10
|
+
__name: "CLCarouselNavigation",
|
|
11
|
+
props: {
|
|
12
|
+
color: {},
|
|
13
|
+
currentPage: {},
|
|
14
|
+
enabled: { type: Boolean },
|
|
15
|
+
gotoPage: {},
|
|
16
|
+
moreAriaLabel: { default: "Navigate to page to see more results" },
|
|
17
|
+
moreLabel: {},
|
|
18
|
+
nextPageEnabled: { type: Boolean },
|
|
19
|
+
paginationType: {},
|
|
20
|
+
prefix: {},
|
|
21
|
+
prevPageEnabled: { type: Boolean },
|
|
22
|
+
showMore: {},
|
|
23
|
+
showNextItems: {},
|
|
24
|
+
showPrevItems: {},
|
|
25
|
+
totalPages: {},
|
|
26
|
+
variant: {}
|
|
27
|
+
},
|
|
28
|
+
setup(a) {
|
|
29
|
+
const o = a, i = u(() => [
|
|
30
|
+
`${o.prefix}__dots-container`
|
|
31
|
+
]), I = u(() => [
|
|
32
|
+
`${o.prefix}__numbered-container`
|
|
33
|
+
]), T = u(() => [
|
|
34
|
+
`${o.prefix}__inline-container`
|
|
35
|
+
]), f = u(() => [
|
|
36
|
+
`${o.prefix}__prev-page`
|
|
37
|
+
]), g = u(() => [
|
|
38
|
+
`${o.prefix}__next-page`
|
|
39
|
+
]), N = u(() => [
|
|
40
|
+
`${o.prefix}__page-indicator`
|
|
41
|
+
]), k = u(() => [
|
|
42
|
+
`${o.prefix}__show-more`
|
|
43
|
+
]), L = (m) => o.currentPage === m, v = u(() => !o.enabled || !o.prevPageEnabled), w = u(() => !o.enabled || !o.nextPageEnabled);
|
|
44
|
+
return (m, h) => (s(), c(j, null, [
|
|
45
|
+
a.paginationType === e($).Dots ? (s(), c("div", {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: l(e(i))
|
|
48
|
+
}, [
|
|
49
|
+
(s(!0), c(j, null, me(a.totalPages, (b) => (s(), he(e(E), {
|
|
50
|
+
key: `dot-${b}`,
|
|
51
|
+
"aria-label": `Show page ${b}`,
|
|
52
|
+
color: a.color,
|
|
53
|
+
disabled: L(b),
|
|
54
|
+
height: "0.75rem",
|
|
55
|
+
"on-click": () => a.gotoPage(b),
|
|
56
|
+
width: "0.75rem",
|
|
57
|
+
variant: L(b) ? e(B).Outline : a.variant,
|
|
58
|
+
wrap: ""
|
|
59
|
+
}, null, 8, ["aria-label", "color", "disabled", "on-click", "variant"]))), 128))
|
|
60
|
+
], 2)) : C("", !0),
|
|
61
|
+
a.paginationType === e($).Numbered ? (s(), c("div", {
|
|
62
|
+
key: 1,
|
|
63
|
+
class: l(e(I))
|
|
64
|
+
}, [
|
|
65
|
+
y("div", {
|
|
66
|
+
class: l(e(f))
|
|
67
|
+
}, [
|
|
68
|
+
x(e(E), {
|
|
69
|
+
"aria-label": "Show previous page of slides",
|
|
70
|
+
color: a.color,
|
|
71
|
+
disabled: e(v),
|
|
72
|
+
"icon-before": e(O).ChevronLeft,
|
|
73
|
+
"icon-size": e(D).Tiny,
|
|
74
|
+
size: e(W).Tiny,
|
|
75
|
+
"on-click": a.showPrevItems,
|
|
76
|
+
variant: e(v) ? e(B).Text : a.variant
|
|
77
|
+
}, null, 8, ["color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
|
|
78
|
+
], 2),
|
|
79
|
+
y("div", {
|
|
80
|
+
class: l(e(N))
|
|
81
|
+
}, [
|
|
82
|
+
x(e(ce), {
|
|
83
|
+
type: e(xe).Small
|
|
84
|
+
}, {
|
|
85
|
+
default: X(() => [
|
|
86
|
+
Y(q(a.currentPage) + " / " + q(a.totalPages), 1)
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
}, 8, ["type"])
|
|
90
|
+
], 2),
|
|
91
|
+
y("div", {
|
|
92
|
+
class: l(e(g))
|
|
93
|
+
}, [
|
|
94
|
+
x(e(E), {
|
|
95
|
+
"aria-label": "Show next page of slides",
|
|
96
|
+
color: a.color,
|
|
97
|
+
disabled: e(w),
|
|
98
|
+
"icon-before": e(O).ChevronRight,
|
|
99
|
+
"icon-size": e(D).Tiny,
|
|
100
|
+
size: e(W).Tiny,
|
|
101
|
+
"on-click": a.showNextItems,
|
|
102
|
+
variant: e(w) ? e(B).Text : a.variant
|
|
103
|
+
}, null, 8, ["color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
|
|
104
|
+
], 2),
|
|
105
|
+
a.showMore ? (s(), c("div", {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: l(e(k))
|
|
108
|
+
}, [
|
|
109
|
+
x(e(E), {
|
|
110
|
+
"aria-label": a.moreAriaLabel,
|
|
111
|
+
color: a.color,
|
|
112
|
+
size: e(W).Small,
|
|
113
|
+
"on-click": a.showMore,
|
|
114
|
+
variant: a.variant
|
|
115
|
+
}, {
|
|
116
|
+
default: X(() => [
|
|
117
|
+
Y(q(a.moreLabel), 1)
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["aria-label", "color", "size", "on-click", "variant"])
|
|
121
|
+
], 2)) : C("", !0)
|
|
122
|
+
], 2)) : C("", !0),
|
|
123
|
+
a.paginationType === e($).Inline ? (s(), c("div", {
|
|
124
|
+
key: 2,
|
|
125
|
+
class: l(e(T))
|
|
126
|
+
}, [
|
|
127
|
+
y("div", {
|
|
128
|
+
class: l(e(f))
|
|
129
|
+
}, [
|
|
130
|
+
x(e(E), {
|
|
131
|
+
"aria-label": "Show previous page of slides",
|
|
132
|
+
"align-content": e(A).Center,
|
|
133
|
+
color: a.color,
|
|
134
|
+
disabled: e(v),
|
|
135
|
+
"icon-before": e(O).ChevronLeft,
|
|
136
|
+
"icon-size": e(D).Small,
|
|
137
|
+
size: e(W).Tiny,
|
|
138
|
+
"on-click": a.showPrevItems,
|
|
139
|
+
variant: e(v) ? e(B).Text : a.variant,
|
|
140
|
+
width: "30px",
|
|
141
|
+
height: "30px",
|
|
142
|
+
wrap: ""
|
|
143
|
+
}, null, 8, ["align-content", "color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
|
|
144
|
+
], 2),
|
|
145
|
+
y("div", {
|
|
146
|
+
class: l(e(g))
|
|
147
|
+
}, [
|
|
148
|
+
x(e(E), {
|
|
149
|
+
"aria-label": "Show next page of slides",
|
|
150
|
+
"align-content": e(A).Center,
|
|
151
|
+
color: a.color,
|
|
152
|
+
disabled: e(w),
|
|
153
|
+
"icon-before": e(O).ChevronRight,
|
|
154
|
+
"icon-size": e(D).Small,
|
|
155
|
+
size: e(W).Tiny,
|
|
156
|
+
"on-click": a.showNextItems,
|
|
157
|
+
variant: e(w) ? e(B).Text : a.variant,
|
|
158
|
+
width: "30px",
|
|
159
|
+
height: "30px",
|
|
160
|
+
wrap: ""
|
|
161
|
+
}, null, 8, ["align-content", "color", "disabled", "icon-before", "icon-size", "size", "on-click", "variant"])
|
|
162
|
+
], 2)
|
|
163
|
+
], 2)) : C("", !0)
|
|
164
|
+
], 64));
|
|
165
|
+
}
|
|
166
|
+
}), ke = ["data-testid"], Le = ["hidden"], Se = /* @__PURE__ */ re({
|
|
167
|
+
name: "CLCarousel",
|
|
168
|
+
__name: "CLCarousel",
|
|
169
|
+
props: {
|
|
170
|
+
color: { default: ye.Neutral },
|
|
171
|
+
controlAlign: { default: A.Right },
|
|
172
|
+
controlPosition: { default: R.Before },
|
|
173
|
+
enabled: { type: Boolean, default: !0 },
|
|
174
|
+
moreLabel: { default: "More" },
|
|
175
|
+
onShowMore: {},
|
|
176
|
+
paginationType: { default: $.Numbered },
|
|
177
|
+
perPage: { default: 3 },
|
|
178
|
+
perPageByBreakpoints: {},
|
|
179
|
+
testId: { default: "clll-carousel" },
|
|
180
|
+
title: {},
|
|
181
|
+
variant: { default: B.Soft },
|
|
182
|
+
width: { default: "100%" }
|
|
183
|
+
},
|
|
184
|
+
setup(a) {
|
|
185
|
+
be((t) => ({
|
|
186
|
+
v512ef87c: t.width,
|
|
187
|
+
v34e944c2: e(F)
|
|
188
|
+
}));
|
|
189
|
+
const o = "clll-carousel", i = a, I = r(), T = r(!1), f = r(1), g = r(i.perPage), N = Te("title"), k = r(!1), L = r(!1), v = r(!1), w = r(), m = r(!1), h = r(), b = r(), F = r("100%"), P = r(0), S = r(0), _ = () => {
|
|
190
|
+
if (i.perPageByBreakpoints?.length) {
|
|
191
|
+
g.value = i.perPage;
|
|
192
|
+
for (const [t, n] of i.perPageByBreakpoints)
|
|
193
|
+
window.matchMedia(`(min-width: ${t}px)`).matches && (g.value = n);
|
|
194
|
+
}
|
|
195
|
+
}, ee = () => {
|
|
196
|
+
if (h?.value && S.value) {
|
|
197
|
+
const n = Math.ceil(S.value / g.value);
|
|
198
|
+
P.value = n, n > 1 && (k.value = !0);
|
|
199
|
+
}
|
|
200
|
+
}, de = () => {
|
|
201
|
+
se(() => {
|
|
202
|
+
let t, n;
|
|
203
|
+
const d = h?.value;
|
|
204
|
+
if (d) {
|
|
205
|
+
const p = d?.querySelectorAll(
|
|
206
|
+
`div[class="${o}__slides"] > *`
|
|
207
|
+
) ?? [], z = S.value - 1;
|
|
208
|
+
for (let M = 0; M < P.value; M++) {
|
|
209
|
+
const V = g.value * (M + 1) - 1, ge = V < z ? p[V] : p[z], ie = V < z ? V : z;
|
|
210
|
+
$e({ parent: d, child: ge, leftOffset: 40, rightOffset: 40, threshold: 0.5 }) && (ie === z ? (n = z, t = M + 1) : (n = ie, t = M + 1));
|
|
211
|
+
}
|
|
212
|
+
n !== void 0 && n > -1 && t && (f.value = t, t > 1 && (L.value = !0), t === 1 && (L.value = !1), t < P.value && (k.value = !0), t === P.value && (k.value = !1));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}, ae = (t) => {
|
|
216
|
+
I.value && se(() => {
|
|
217
|
+
const n = Pe(I.value) && !N.value;
|
|
218
|
+
!n && (t.title || t.controlPosition === R.Before) ? T.value = !1 : T.value = n;
|
|
219
|
+
});
|
|
220
|
+
}, U = (t) => {
|
|
221
|
+
const n = h?.value, d = n.offsetWidth;
|
|
222
|
+
if (n && d) {
|
|
223
|
+
const p = t - 1, z = d * p;
|
|
224
|
+
n.scrollTo({ left: z, behavior: "smooth" });
|
|
225
|
+
}
|
|
226
|
+
}, te = () => {
|
|
227
|
+
v.value = !0, f.value = 1, _(), ne(), ee();
|
|
228
|
+
const t = h?.value, n = t.offsetWidth;
|
|
229
|
+
if (t) {
|
|
230
|
+
const d = f.value - 1, p = n * d;
|
|
231
|
+
t.scrollLeft = p;
|
|
232
|
+
}
|
|
233
|
+
H && v.value && (window.clearTimeout(w.value), w.value = window.setTimeout(() => {
|
|
234
|
+
v.value && (v.value = !1), window.clearTimeout(w.value);
|
|
235
|
+
}, 300));
|
|
236
|
+
}, oe = () => {
|
|
237
|
+
v.value || (m.value = !0, H && m.value && (window.clearTimeout(b.value), b.value = window.setTimeout(() => {
|
|
238
|
+
m.value && G(), window.clearTimeout(b.value);
|
|
239
|
+
}, 200)));
|
|
240
|
+
}, G = () => {
|
|
241
|
+
v.value || (m.value = !1, de());
|
|
242
|
+
}, ne = () => {
|
|
243
|
+
const t = h?.value;
|
|
244
|
+
if (t) {
|
|
245
|
+
const n = t.offsetWidth;
|
|
246
|
+
S.value >= g.value ? F.value = `${n / g.value}px` : F.value = `${n / S.value}px`;
|
|
247
|
+
}
|
|
248
|
+
}, J = () => {
|
|
249
|
+
const t = h?.value, n = t.offsetWidth;
|
|
250
|
+
if (t && n) {
|
|
251
|
+
const d = f.value, p = n * d;
|
|
252
|
+
t.scrollTo({ left: p, behavior: "smooth" });
|
|
253
|
+
}
|
|
254
|
+
}, K = () => {
|
|
255
|
+
const t = h?.value, n = t.offsetWidth;
|
|
256
|
+
if (t && n) {
|
|
257
|
+
const d = f.value - 1, p = n * (d - 1);
|
|
258
|
+
t.scrollTo({ left: p, behavior: "smooth" });
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
we(() => {
|
|
262
|
+
if (H) {
|
|
263
|
+
window.addEventListener("resize", te);
|
|
264
|
+
const t = h?.value;
|
|
265
|
+
if (t) {
|
|
266
|
+
const n = t?.querySelectorAll(
|
|
267
|
+
`div[class="${o}__slides"] > *`
|
|
268
|
+
) ?? [];
|
|
269
|
+
S.value = n.length, t.addEventListener("scroll", oe), t.addEventListener("scrollend", G);
|
|
270
|
+
}
|
|
271
|
+
ae(i), _(), ne(), ee();
|
|
272
|
+
}
|
|
273
|
+
}), pe(() => {
|
|
274
|
+
if (H) {
|
|
275
|
+
window.removeEventListener("resize", te), w.value && window.clearTimeout(w.value), b.value && window.clearTimeout(b.value);
|
|
276
|
+
const t = h?.value;
|
|
277
|
+
t && (t.removeEventListener("scroll", oe), t.removeEventListener("scrollend", G));
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
const ue = u(() => [
|
|
281
|
+
o,
|
|
282
|
+
`${o}--${i.controlAlign}`,
|
|
283
|
+
`${o}--${i.controlPosition}`,
|
|
284
|
+
`${o}--${i.paginationType}`,
|
|
285
|
+
i.enabled ? `${o}--enabled` : `${o}--disabled`,
|
|
286
|
+
T.value ? "" : `${o}--hastitle`,
|
|
287
|
+
i.onShowMore ? `${o}--has-more` : ""
|
|
288
|
+
]), ve = u(() => [
|
|
289
|
+
`${o}__slide-controls`,
|
|
290
|
+
N.value ? `${o}__slide-controls--hascustomtitle` : ""
|
|
291
|
+
]), fe = u(() => [
|
|
292
|
+
`${o}__slides`,
|
|
293
|
+
v.value ? `${o}__slides--resizing` : "",
|
|
294
|
+
m.value ? `${o}__slides--scrolling` : ""
|
|
295
|
+
]), le = u(() => [
|
|
296
|
+
`${o}__navigation`,
|
|
297
|
+
`${o}__navigation--${i.controlAlign}`,
|
|
298
|
+
`${o}__navigation--${i.controlPosition}`
|
|
299
|
+
]);
|
|
300
|
+
return Ce(i, (t) => {
|
|
301
|
+
ae(t);
|
|
302
|
+
}), (t, n) => (s(), c("div", {
|
|
303
|
+
class: l(e(ue)),
|
|
304
|
+
"data-testid": a.testId
|
|
305
|
+
}, [
|
|
306
|
+
y("div", {
|
|
307
|
+
ref_key: "beforeControls",
|
|
308
|
+
ref: I,
|
|
309
|
+
class: l(e(ve)),
|
|
310
|
+
hidden: e(T)
|
|
311
|
+
}, [
|
|
312
|
+
y("div", {
|
|
313
|
+
class: l(`${o}__custom-title`)
|
|
314
|
+
}, [
|
|
315
|
+
Z(t.$slots, "title")
|
|
316
|
+
], 2),
|
|
317
|
+
a.title ? (s(), c("div", {
|
|
318
|
+
key: 0,
|
|
319
|
+
class: l(`${o}__title`)
|
|
320
|
+
}, [
|
|
321
|
+
x(e(ce), {
|
|
322
|
+
align: e(N) ? e(A).Center : e(A).Left,
|
|
323
|
+
label: "",
|
|
324
|
+
truncate: ""
|
|
325
|
+
}, {
|
|
326
|
+
default: X(() => [
|
|
327
|
+
Y(q(a.title), 1)
|
|
328
|
+
]),
|
|
329
|
+
_: 1
|
|
330
|
+
}, 8, ["align"])
|
|
331
|
+
], 2)) : C("", !0),
|
|
332
|
+
a.controlPosition === e(R).Before && ![e($).Inline, e($).Hidden].includes(a.paginationType) ? (s(), c(j, { key: 1 }, [
|
|
333
|
+
e(P) && e(S) > e(g) ? (s(), c("div", {
|
|
334
|
+
key: 0,
|
|
335
|
+
class: l(e(le))
|
|
336
|
+
}, [
|
|
337
|
+
x(Q, {
|
|
338
|
+
color: a.color,
|
|
339
|
+
"current-page": e(f),
|
|
340
|
+
enabled: !e(m),
|
|
341
|
+
"goto-page": U,
|
|
342
|
+
"more-label": a.moreLabel,
|
|
343
|
+
"next-page-enabled": e(k),
|
|
344
|
+
"pagination-type": a.paginationType,
|
|
345
|
+
"prev-page-enabled": e(L),
|
|
346
|
+
prefix: o,
|
|
347
|
+
"show-more": a.onShowMore,
|
|
348
|
+
"show-next-items": J,
|
|
349
|
+
"show-prev-items": K,
|
|
350
|
+
"total-pages": e(P),
|
|
351
|
+
variant: a.variant
|
|
352
|
+
}, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
|
|
353
|
+
], 2)) : C("", !0)
|
|
354
|
+
], 64)) : C("", !0)
|
|
355
|
+
], 10, Le),
|
|
356
|
+
y("div", {
|
|
357
|
+
ref_key: "scrollContainer",
|
|
358
|
+
ref: h,
|
|
359
|
+
class: l(e(fe)),
|
|
360
|
+
tabindex: "0"
|
|
361
|
+
}, [
|
|
362
|
+
Z(t.$slots, "default")
|
|
363
|
+
], 2),
|
|
364
|
+
a.controlPosition === e(R).After && ![e($).Inline, e($).Hidden].includes(a.paginationType) ? (s(), c(j, { key: 0 }, [
|
|
365
|
+
e(P) && e(S) > e(g) ? (s(), c("div", {
|
|
366
|
+
key: 0,
|
|
367
|
+
class: l(`${o}__slide-controls`)
|
|
368
|
+
}, [
|
|
369
|
+
y("div", {
|
|
370
|
+
class: l(e(le))
|
|
371
|
+
}, [
|
|
372
|
+
x(Q, {
|
|
373
|
+
color: a.color,
|
|
374
|
+
"current-page": e(f),
|
|
375
|
+
enabled: !e(m),
|
|
376
|
+
"goto-page": U,
|
|
377
|
+
"more-label": a.moreLabel,
|
|
378
|
+
"next-page-enabled": e(k),
|
|
379
|
+
"pagination-type": a.paginationType,
|
|
380
|
+
prefix: o,
|
|
381
|
+
"prev-page-enabled": e(L),
|
|
382
|
+
"show-more": a.onShowMore,
|
|
383
|
+
"show-next-items": J,
|
|
384
|
+
"show-prev-items": K,
|
|
385
|
+
"total-pages": e(P),
|
|
386
|
+
variant: a.variant
|
|
387
|
+
}, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
|
|
388
|
+
], 2)
|
|
389
|
+
], 2)) : C("", !0)
|
|
390
|
+
], 64)) : C("", !0),
|
|
391
|
+
a.paginationType === e($).Inline ? (s(), c("div", {
|
|
392
|
+
key: 1,
|
|
393
|
+
class: l(`${o}__slide-controls ${o}__slide-controls--inline`)
|
|
394
|
+
}, [
|
|
395
|
+
y("div", {
|
|
396
|
+
class: l(`${o}__navigation`)
|
|
397
|
+
}, [
|
|
398
|
+
x(Q, {
|
|
399
|
+
color: a.color,
|
|
400
|
+
"current-page": e(f),
|
|
401
|
+
enabled: !e(m),
|
|
402
|
+
"goto-page": U,
|
|
403
|
+
"more-label": a.moreLabel,
|
|
404
|
+
"next-page-enabled": e(k),
|
|
405
|
+
"pagination-type": a.paginationType,
|
|
406
|
+
prefix: o,
|
|
407
|
+
"prev-page-enabled": e(L),
|
|
408
|
+
"show-more": a.onShowMore,
|
|
409
|
+
"show-next-items": J,
|
|
410
|
+
"show-prev-items": K,
|
|
411
|
+
"total-pages": e(P),
|
|
412
|
+
variant: a.variant
|
|
413
|
+
}, null, 8, ["color", "current-page", "enabled", "more-label", "next-page-enabled", "pagination-type", "prev-page-enabled", "show-more", "total-pages", "variant"])
|
|
414
|
+
], 2)
|
|
415
|
+
], 2)) : C("", !0)
|
|
416
|
+
], 10, ke));
|
|
417
|
+
}
|
|
418
|
+
}), ze = (a, o) => {
|
|
419
|
+
const i = a.__vccOpts || a;
|
|
420
|
+
for (const [I, T] of o)
|
|
421
|
+
i[I] = T;
|
|
422
|
+
return i;
|
|
423
|
+
}, Ie = {}, Ee = {
|
|
424
|
+
class: /* @__PURE__ */ l(["clll-carousel__slide"])
|
|
425
|
+
};
|
|
426
|
+
function Be(a, o) {
|
|
427
|
+
return s(), c("div", Ee, [
|
|
428
|
+
Z(a.$slots, "default")
|
|
429
|
+
]);
|
|
430
|
+
}
|
|
431
|
+
const Ne = /* @__PURE__ */ ze(Ie, [["render", Be]]), Me = Se;
|
|
432
|
+
Me.Slide = Ne;
|
|
433
|
+
export {
|
|
434
|
+
Me as CLCarousel,
|
|
435
|
+
Me as default
|
|
436
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLAlign, CLColors, CLColorVariants, CLPaginationType, CLOrder } from '../../../
|
|
1
|
+
import { CLAlign, CLColors, CLColorVariants, CLPaginationType, CLOrder } from '../../../types';
|
|
2
2
|
export interface CLCarouselProps {
|
|
3
3
|
/** Sets the color of the carousel navigation components. The property can be one of `CLColors`, e.g. `CLColors.Primary`. */
|
|
4
4
|
color?: CLColors;
|
|
@@ -31,8 +31,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CL
|
|
|
31
31
|
color: CLColors;
|
|
32
32
|
width: string;
|
|
33
33
|
variant: CLColorVariants;
|
|
34
|
-
testId: string;
|
|
35
34
|
enabled: boolean;
|
|
35
|
+
testId: string;
|
|
36
36
|
moreLabel: string;
|
|
37
37
|
paginationType: CLPaginationType;
|
|
38
38
|
controlAlign: CLAlign;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLColors, CLColorVariants, CLGenericFunction, CLPaginationType } from '../../../
|
|
1
|
+
import { CLColors, CLColorVariants, CLGenericFunction, CLPaginationType } from '../../../types';
|
|
2
2
|
export interface CLCarouselNavigationProps {
|
|
3
3
|
/** Sets the color of the navigation components. */
|
|
4
4
|
color: CLColors;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--clll-unit-0: 0;--clll-unit-0_5: .125rem;--clll-unit-1: .25rem;--clll-unit-1_5: .375rem;--clll-unit-2: .5rem;--clll-unit-2_5: .625rem;--clll-unit-3: .75rem;--clll-unit-3_5: .875rem;--clll-unit-4: 1rem;--clll-unit-4_5: 1.125rem;--clll-unit-5: 1.25rem;--clll-unit-5_5: 1.375rem;--clll-unit-6: 1.5rem;--clll-unit-6_5: 1.625rem;--clll-unit-7: 1.75rem;--clll-unit-7_5: 1.875rem;--clll-unit-8: 2rem;--clll-unit-8_5: 2.125rem;--clll-unit-9_5: 2.375rem;--clll-unit-10: 2.5rem;--clll-unit-10_5: 2.625rem;--clll-unit-12: 3rem;--clll-unit-14: 3.5rem;--clll-unit-14_5: 3.625rem;--clll-unit-18: 4.5rem}.form-addon-flex{display:flex;align-items:center;justify-content:center;pointer-events:none;user-select:none}.form-addon-flex--left{left:0}.form-addon-flex--right{right:0}.form-addon-flex--icon{z-index:10;box-sizing:border-box}.form-addon-flex--string{position:relative}.form-addon-radius--left-full{border-top-left-radius:var(--clll-rounded-full);border-bottom-left-radius:var(--clll-rounded-full)}.form-addon-radius--right-full{border-top-right-radius:var(--clll-rounded-full);border-bottom-right-radius:var(--clll-rounded-full)}.form-addon-radius--left-lg{border-top-left-radius:var(--clll-rounded-lg);border-bottom-left-radius:var(--clll-rounded-lg)}.form-addon-radius--right-lg{border-top-right-radius:var(--clll-rounded-lg);border-bottom-right-radius:var(--clll-rounded-lg)}.form-addon-radius--left-md{border-top-left-radius:var(--clll-rounded-md);border-bottom-left-radius:var(--clll-rounded-md)}.form-addon-radius--right-md{border-top-right-radius:var(--clll-rounded-md);border-bottom-right-radius:var(--clll-rounded-md)}.form-addon-radius--left-sm{border-top-left-radius:var(--clll-rounded-sm);border-bottom-left-radius:var(--clll-rounded-sm)}.form-addon-radius--right-sm{border-top-right-radius:var(--clll-rounded-sm);border-bottom-right-radius:var(--clll-rounded-sm)}.form-addon-radius--left-xs{border-top-left-radius:var(--clll-rounded-xs);border-bottom-left-radius:var(--clll-rounded-xs)}.form-addon-radius--right-xs{border-top-right-radius:var(--clll-rounded-xs);border-bottom-right-radius:var(--clll-rounded-xs)}.form-addon-radius--left-xl{border-top-left-radius:var(--clll-rounded-xl);border-bottom-left-radius:var(--clll-rounded-xl)}.form-addon-radius--right-xl{border-top-right-radius:var(--clll-rounded-xl);border-bottom-right-radius:var(--clll-rounded-xl)}.form-addon-radius--left-2xl{border-top-left-radius:var(--clll-rounded-2xl);border-bottom-left-radius:var(--clll-rounded-2xl)}.form-addon-radius--right-2xl{border-top-right-radius:var(--clll-rounded-2xl);border-bottom-right-radius:var(--clll-rounded-2xl)}.form-addon-radius--left-3xl{border-top-left-radius:var(--clll-rounded-3xl);border-bottom-left-radius:var(--clll-rounded-3xl)}.form-addon-radius--right-3xl{border-top-right-radius:var(--clll-rounded-3xl);border-bottom-right-radius:var(--clll-rounded-3xl)}.form-addon-radius--left-none{border-top-left-radius:0;border-bottom-left-radius:0}.form-addon-radius--right-none{border-top-right-radius:0;border-bottom-right-radius:0}.form-control-flex{display:inline-flex;align-items:center;justify-content:center;position:relative}.form-counter-flex{display:flex;align-items:center;justify-content:flex-end;max-width:100px;box-sizing:border-box;flex:1;position:relative;pointer-events:none;user-select:none}.form-select-icon-flex{position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;pointer-events:none}:root{--clll-rounded-full: 9999px;--clll-rounded-none: 0;--clll-rounded-xs: var(--clll-unit-1);--clll-rounded-sm: var(--clll-unit-2);--clll-rounded-md: var(--clll-unit-3);--clll-rounded-lg: var(--clll-unit-4);--clll-rounded-xl: var(--clll-unit-5);--clll-rounded-2xl: var(--clll-unit-6);--clll-rounded-3xl: var(--clll-unit-7);--clll-px-xs: var(--clll-unit-1_5);--clll-px-sm: var(--clll-unit-2);--clll-px-md: var(--clll-unit-2_5);--clll-px-lg: var(--clll-unit-3);--clll-px-xl: var(--clll-unit-3_5);--clll-px-2xl: var(--clll-unit-4);--clll-px-3xl: var(--clll-unit-4_5);--clll-px-s-xs: calc(var(--clll-px-xs) * .5);--clll-px-s-sm: calc(var(--clll-px-sm) * .5);--clll-py-xs: calc(var(--clll-unit-1) - 1px);--clll-py-sm: calc(var(--clll-unit-1_5) - 1px);--clll-py-md: calc(var(--clll-unit-2) - 1px);--clll-py-lg: var(--clll-unit-2);--clll-py-xl: var(--clll-unit-2_5);--clll-py-2xl: var(--clll-unit-3);--clll-py-3xl: var(--clll-unit-3_5);--clll-py-4xl: var(--clll-unit-4);--clll-py-s-xs: calc(var(--clll-py-xs) * .5);--clll-z-index-10: 10}.clll-disclosure .clll-disclosure__trigger .clll-button{display:block}.clll-disclosure.clll-disclosure--tiny .clll-disclosure__heading>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-2)}.clll-disclosure.clll-disclosure--small .clll-disclosure__heading>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-2_5)}.clll-disclosure.clll-disclosure--medium .clll-disclosure__heading>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-3)}.clll-disclosure.clll-disclosure--large .clll-disclosure__heading>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-3_5)}.clll-disclosure.clll-disclosure--xlarge .clll-disclosure__heading>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-4_5)}.clll-disclosure.clll-disclosure--padded .clll-disclosure__content.clll-disclosure__content--tiny{padding:var(--clll-py-sm) var(--clll-unit-2)}.clll-disclosure.clll-disclosure--padded .clll-disclosure__content.clll-disclosure__content--small{padding:var(--clll-py-md) var(--clll-unit-2_5)}.clll-disclosure.clll-disclosure--padded .clll-disclosure__content.clll-disclosure__content--medium{padding:var(--clll-py-lg) var(--clll-unit-3)}.clll-disclosure.clll-disclosure--padded .clll-disclosure__content.clll-disclosure__content--large{padding:var(--clll-py-xl) var(--clll-unit-3_5)}.clll-disclosure.clll-disclosure--padded .clll-disclosure__content.clll-disclosure__content--xlarge{padding:var(--clll-py-2xl) var(--clll-unit-4_5)}.clll-disclosure.clll-disclosure--expanded .clll-disclosure__trigger .clll-button.clll-button--rounded{border-bottom-left-radius:0;border-bottom-right-radius:0}.clll-disclosure.clll-disclosure--expanded .clll-disclosure__content{display:block}.clll-disclosure.clll-disclosure--collapsed .clll-disclosure__content{display:none}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-full,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-full .clll-{border-radius:var(--clll-rounded-full)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-lg,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-lg .clll-{border-radius:var(--clll-rounded-lg)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-md,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-md .clll-{border-radius:var(--clll-rounded-md)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-sm,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-sm .clll-{border-radius:var(--clll-rounded-sm)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-xs,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-xs .clll-{border-radius:var(--clll-rounded-xs)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-xl,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-xl .clll-{border-radius:var(--clll-rounded-xl)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-2xl,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-2xl .clll-{border-radius:var(--clll-rounded-2xl)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-3xl,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-3xl .clll-{border-radius:var(--clll-rounded-3xl)}.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-none,.clll-disclosure.clll-disclosure--rounded.clll-disclosure--rounded-none .clll-{border-radius:0}.clll-disclosure.clll-disclosure--compact .clll-disclosure__trigger{padding:0}.clll-disclosure.clll-disclosure--compact .clll-disclosure__trigger .clll-button,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content.clll-disclosure__content--tiny,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content.clll-disclosure__content--small,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content.clll-disclosure__content--medium,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content.clll-disclosure__content--large,.clll-disclosure.clll-disclosure--compact .clll-disclosure__content.clll-disclosure__content--xlarge{padding:var(--clll-unit-1) 0}.clll-disclosure:not(.clll-disclosure--bordered){border:0}.clll-disclosure:not(.clll-disclosure--bordered) .clll-disclosure__trigger .clll-button{border:0}.clll-disclosure:not(.clll-disclosure--bordered) .clll-disclosure__content{border:0}.clll-disclosure .clll-disclosure__heading{display:flex;flex-direction:row;align-items:center}.clll-disclosure .clll-disclosure__heading .clll-heading{flex:1}.clll-disclosure:not(.clll-disclosure--hasheading) .clll-disclosure__text-subheading{flex:1 1 0%}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import './CLDisclosure.css';
|
|
2
|
+
import { defineComponent as S, ref as g, computed as $, onBeforeUnmount as L, createElementBlock as I, openBlock as i, normalizeClass as o, unref as d, createElementVNode as c, createVNode as T, withCtx as u, createBlock as l, createCommentVNode as s, createTextVNode as b, toDisplayString as y, renderSlot as H } from "vue";
|
|
3
|
+
import { _ as k } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-CqgySW52.js";
|
|
4
|
+
import { _ as E } from "../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-CbHdHW2E.js";
|
|
5
|
+
import { _ as h } from "../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-zZ4zGuBt.js";
|
|
6
|
+
import { _ as N } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-CTc6UiQV.js";
|
|
7
|
+
import { CLColorVariants as R, CLSizes as w, CLTextTypes as A, CLIconSizes as D, CLIconNames as C, CLHeadingTypes as V, CLColors as p, CLBorderRadius as M, CLButtonTypes as U } from "../../../index.js";
|
|
8
|
+
import { d as F } from "../../../chunks/utils-CFL9veAf.js";
|
|
9
|
+
import { u as j } from "../../../chunks/useEsc-BGAp0d_1.js";
|
|
10
|
+
const q = ["data-testid"], G = ["id", "aria-labelledby", "aria-hidden"], _ = /* @__PURE__ */ S({
|
|
11
|
+
name: "CLDisclosure",
|
|
12
|
+
__name: "CLDisclosure",
|
|
13
|
+
props: {
|
|
14
|
+
bordered: { type: Boolean, default: !0 },
|
|
15
|
+
borderRadius: { default: M.Medium },
|
|
16
|
+
color: { default: p.Neutral },
|
|
17
|
+
compact: { type: Boolean, default: !1 },
|
|
18
|
+
contentSpacing: { type: Boolean, default: !0 },
|
|
19
|
+
disclosureId: {},
|
|
20
|
+
expanded: { type: Boolean, default: !1 },
|
|
21
|
+
expandedIcon: { default: C.ChevronUp },
|
|
22
|
+
heading: {},
|
|
23
|
+
headingLevel: {},
|
|
24
|
+
headingType: { default: V.Section },
|
|
25
|
+
iconAfter: { default: C.ChevronDown },
|
|
26
|
+
iconAfterSize: { default: D.Medium },
|
|
27
|
+
iconBefore: {},
|
|
28
|
+
iconBeforeSize: {},
|
|
29
|
+
rounded: { type: Boolean, default: !0 },
|
|
30
|
+
subHeading: {},
|
|
31
|
+
subHeadingType: { default: A.Body },
|
|
32
|
+
testId: { default: "clll-disclosure" },
|
|
33
|
+
triggerButtonSize: { default: w.Medium },
|
|
34
|
+
variant: { default: R.Soft }
|
|
35
|
+
},
|
|
36
|
+
setup(e) {
|
|
37
|
+
const a = "clll-disclosure", t = e;
|
|
38
|
+
let f = g();
|
|
39
|
+
const n = g(t.expanded), v = $(() => [
|
|
40
|
+
a,
|
|
41
|
+
`${a}--${t.color}--${t.variant}`,
|
|
42
|
+
`${a}--${t.triggerButtonSize}`,
|
|
43
|
+
t.bordered ? `${a}--bordered` : "",
|
|
44
|
+
t.borderRadius ? `${a}--${t.borderRadius}` : "",
|
|
45
|
+
t.contentSpacing ? `${a}--padded` : `${a}--nopadding`,
|
|
46
|
+
t.compact ? `${a}--compact` : "",
|
|
47
|
+
n.value ? `${a}--expanded` : `${a}--collapsed`,
|
|
48
|
+
t.heading ? `${a}--hasheading` : "",
|
|
49
|
+
t.subHeading ? `${a}--hassubheading` : "",
|
|
50
|
+
t.rounded ? `${a}--rounded` : `${a}--box`
|
|
51
|
+
]), B = $(() => [
|
|
52
|
+
`${a}__content`,
|
|
53
|
+
`${a}__content--${t.triggerButtonSize}`
|
|
54
|
+
]), z = (r) => {
|
|
55
|
+
r && (f.value = r);
|
|
56
|
+
}, m = () => {
|
|
57
|
+
n.value ? n.value = !1 : n.value = !0;
|
|
58
|
+
}, { clearEventListeners: x } = j({ escHandler: m, triggerElem: f });
|
|
59
|
+
return L(() => {
|
|
60
|
+
x();
|
|
61
|
+
}), (r, J) => (i(), I("div", {
|
|
62
|
+
class: o([d(v), d(F)({ color: e.color, variant: e.variant })]),
|
|
63
|
+
"data-testid": e.testId
|
|
64
|
+
}, [
|
|
65
|
+
c("div", {
|
|
66
|
+
class: o(`${a}__trigger`)
|
|
67
|
+
}, [
|
|
68
|
+
T(d(k), {
|
|
69
|
+
id: `${a}__button--${e.disclosureId}`,
|
|
70
|
+
"aria-controls": `${a}--${e.disclosureId}`,
|
|
71
|
+
"aria-expanded": d(n),
|
|
72
|
+
"border-radius": e.borderRadius,
|
|
73
|
+
color: e.color,
|
|
74
|
+
"forward-ref": z,
|
|
75
|
+
"on-click": m,
|
|
76
|
+
size: e.triggerButtonSize,
|
|
77
|
+
type: d(U).Button,
|
|
78
|
+
rounded: e.rounded,
|
|
79
|
+
width: "100%",
|
|
80
|
+
variant: e.variant
|
|
81
|
+
}, {
|
|
82
|
+
default: u(() => [
|
|
83
|
+
c("span", {
|
|
84
|
+
class: o(`${a}__heading`)
|
|
85
|
+
}, [
|
|
86
|
+
e.iconBefore ? (i(), l(d(h), {
|
|
87
|
+
key: 0,
|
|
88
|
+
name: e.iconBefore,
|
|
89
|
+
size: e.iconBeforeSize
|
|
90
|
+
}, null, 8, ["name", "size"])) : s("", !0),
|
|
91
|
+
e.heading ? (i(), l(d(E), {
|
|
92
|
+
key: 1,
|
|
93
|
+
class: o(`${a}__text-heading`),
|
|
94
|
+
type: e.headingType,
|
|
95
|
+
level: e.headingLevel
|
|
96
|
+
}, {
|
|
97
|
+
default: u(() => [
|
|
98
|
+
b(y(e.heading), 1)
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["class", "type", "level"])) : s("", !0),
|
|
102
|
+
e.subHeading ? (i(), l(d(N), {
|
|
103
|
+
key: 2,
|
|
104
|
+
class: o(`${a}__text-subheading`),
|
|
105
|
+
type: e.subHeadingType,
|
|
106
|
+
truncate: ""
|
|
107
|
+
}, {
|
|
108
|
+
default: u(() => [
|
|
109
|
+
b(y(e.subHeading), 1)
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["class", "type"])) : s("", !0),
|
|
113
|
+
e.iconAfter ? (i(), l(d(h), {
|
|
114
|
+
key: 3,
|
|
115
|
+
name: d(n) ? e.expandedIcon : e.iconAfter,
|
|
116
|
+
size: e.iconAfterSize
|
|
117
|
+
}, null, 8, ["name", "size"])) : s("", !0)
|
|
118
|
+
], 2)
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["id", "aria-controls", "aria-expanded", "border-radius", "color", "size", "type", "rounded", "variant"])
|
|
122
|
+
], 2),
|
|
123
|
+
c("div", {
|
|
124
|
+
id: `${a}--${e.disclosureId}`,
|
|
125
|
+
"aria-labelledby": `${a}__button--${e.disclosureId}`,
|
|
126
|
+
"aria-hidden": !d(n),
|
|
127
|
+
class: o(d(B))
|
|
128
|
+
}, [
|
|
129
|
+
H(r.$slots, "default")
|
|
130
|
+
], 10, G)
|
|
131
|
+
], 10, q));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export {
|
|
135
|
+
_ as CLDisclosure,
|
|
136
|
+
_ as default
|
|
137
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLBorderRadius, CLColors, CLColorVariants, CLHeadingLevels, CLHeadingTypes, CLIconNames, CLIconSizes, CLSizes, CLTextTypes } from '../../../
|
|
1
|
+
import { CLBorderRadius, CLColors, CLColorVariants, CLHeadingLevels, CLHeadingTypes, CLIconNames, CLIconSizes, CLSizes, CLTextTypes } from '../../../types';
|
|
2
2
|
export interface CLDisclosureProps {
|
|
3
3
|
/** When set to `true` adds borders to the disclosure's trigger container and content */
|
|
4
4
|
bordered?: boolean;
|
|
@@ -47,11 +47,11 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CL
|
|
|
47
47
|
color: CLColors;
|
|
48
48
|
variant: CLColorVariants;
|
|
49
49
|
borderRadius: CLBorderRadius;
|
|
50
|
-
testId: string;
|
|
51
|
-
bordered: boolean;
|
|
52
50
|
rounded: boolean;
|
|
51
|
+
testId: string;
|
|
53
52
|
iconAfter: CLIconNames;
|
|
54
53
|
iconAfterSize: CLIconSizes;
|
|
54
|
+
bordered: boolean;
|
|
55
55
|
compact: boolean;
|
|
56
56
|
contentSpacing: boolean;
|
|
57
57
|
expanded: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--clll-unit-0: 0;--clll-unit-0_5: .125rem;--clll-unit-1: .25rem;--clll-unit-1_5: .375rem;--clll-unit-2: .5rem;--clll-unit-2_5: .625rem;--clll-unit-3: .75rem;--clll-unit-3_5: .875rem;--clll-unit-4: 1rem;--clll-unit-4_5: 1.125rem;--clll-unit-5: 1.25rem;--clll-unit-5_5: 1.375rem;--clll-unit-6: 1.5rem;--clll-unit-6_5: 1.625rem;--clll-unit-7: 1.75rem;--clll-unit-7_5: 1.875rem;--clll-unit-8: 2rem;--clll-unit-8_5: 2.125rem;--clll-unit-9_5: 2.375rem;--clll-unit-10: 2.5rem;--clll-unit-10_5: 2.625rem;--clll-unit-12: 3rem;--clll-unit-14: 3.5rem;--clll-unit-14_5: 3.625rem;--clll-unit-18: 4.5rem}.form-addon-flex{display:flex;align-items:center;justify-content:center;pointer-events:none;user-select:none}.form-addon-flex--left{left:0}.form-addon-flex--right{right:0}.form-addon-flex--icon{z-index:10;box-sizing:border-box}.form-addon-flex--string{position:relative}.form-addon-radius--left-full{border-top-left-radius:var(--clll-rounded-full);border-bottom-left-radius:var(--clll-rounded-full)}.form-addon-radius--right-full{border-top-right-radius:var(--clll-rounded-full);border-bottom-right-radius:var(--clll-rounded-full)}.form-addon-radius--left-lg{border-top-left-radius:var(--clll-rounded-lg);border-bottom-left-radius:var(--clll-rounded-lg)}.form-addon-radius--right-lg{border-top-right-radius:var(--clll-rounded-lg);border-bottom-right-radius:var(--clll-rounded-lg)}.form-addon-radius--left-md{border-top-left-radius:var(--clll-rounded-md);border-bottom-left-radius:var(--clll-rounded-md)}.form-addon-radius--right-md{border-top-right-radius:var(--clll-rounded-md);border-bottom-right-radius:var(--clll-rounded-md)}.form-addon-radius--left-sm{border-top-left-radius:var(--clll-rounded-sm);border-bottom-left-radius:var(--clll-rounded-sm)}.form-addon-radius--right-sm{border-top-right-radius:var(--clll-rounded-sm);border-bottom-right-radius:var(--clll-rounded-sm)}.form-addon-radius--left-xs{border-top-left-radius:var(--clll-rounded-xs);border-bottom-left-radius:var(--clll-rounded-xs)}.form-addon-radius--right-xs{border-top-right-radius:var(--clll-rounded-xs);border-bottom-right-radius:var(--clll-rounded-xs)}.form-addon-radius--left-xl{border-top-left-radius:var(--clll-rounded-xl);border-bottom-left-radius:var(--clll-rounded-xl)}.form-addon-radius--right-xl{border-top-right-radius:var(--clll-rounded-xl);border-bottom-right-radius:var(--clll-rounded-xl)}.form-addon-radius--left-2xl{border-top-left-radius:var(--clll-rounded-2xl);border-bottom-left-radius:var(--clll-rounded-2xl)}.form-addon-radius--right-2xl{border-top-right-radius:var(--clll-rounded-2xl);border-bottom-right-radius:var(--clll-rounded-2xl)}.form-addon-radius--left-3xl{border-top-left-radius:var(--clll-rounded-3xl);border-bottom-left-radius:var(--clll-rounded-3xl)}.form-addon-radius--right-3xl{border-top-right-radius:var(--clll-rounded-3xl);border-bottom-right-radius:var(--clll-rounded-3xl)}.form-addon-radius--left-none{border-top-left-radius:0;border-bottom-left-radius:0}.form-addon-radius--right-none{border-top-right-radius:0;border-bottom-right-radius:0}.form-control-flex{display:inline-flex;align-items:center;justify-content:center;position:relative}.form-counter-flex{display:flex;align-items:center;justify-content:flex-end;max-width:100px;box-sizing:border-box;flex:1;position:relative;pointer-events:none;user-select:none}.form-select-icon-flex{position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;pointer-events:none}:root{--clll-rounded-full: 9999px;--clll-rounded-none: 0;--clll-rounded-xs: var(--clll-unit-1);--clll-rounded-sm: var(--clll-unit-2);--clll-rounded-md: var(--clll-unit-3);--clll-rounded-lg: var(--clll-unit-4);--clll-rounded-xl: var(--clll-unit-5);--clll-rounded-2xl: var(--clll-unit-6);--clll-rounded-3xl: var(--clll-unit-7);--clll-px-xs: var(--clll-unit-1_5);--clll-px-sm: var(--clll-unit-2);--clll-px-md: var(--clll-unit-2_5);--clll-px-lg: var(--clll-unit-3);--clll-px-xl: var(--clll-unit-3_5);--clll-px-2xl: var(--clll-unit-4);--clll-px-3xl: var(--clll-unit-4_5);--clll-px-s-xs: calc(var(--clll-px-xs) * .5);--clll-px-s-sm: calc(var(--clll-px-sm) * .5);--clll-py-xs: calc(var(--clll-unit-1) - 1px);--clll-py-sm: calc(var(--clll-unit-1_5) - 1px);--clll-py-md: calc(var(--clll-unit-2) - 1px);--clll-py-lg: var(--clll-unit-2);--clll-py-xl: var(--clll-unit-2_5);--clll-py-2xl: var(--clll-unit-3);--clll-py-3xl: var(--clll-unit-3_5);--clll-py-4xl: var(--clll-unit-4);--clll-py-s-xs: calc(var(--clll-py-xs) * .5);--clll-z-index-10: 10}.clll-checkbox{position:relative;overflow:hidden;border-radius:0;flex:none;display:inline-flex;align-items:center;box-sizing:border-box;align-items:flex-start;flex-direction:column;overflow:visible}.clll-checkbox .clll-checkbox__label{position:relative;overflow:hidden;border-radius:0;flex:none;display:inline-flex;align-items:center;box-sizing:border-box;overflow:visible;text-align:left;user-select:none;cursor:pointer}.clll-checkbox .clll-checkbox__label.clll-checkbox--haslabel>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-2)}.clll-checkbox .clll-checkbox__checkbox-container{position:relative;overflow:hidden;border-radius:0;flex:none;display:inline-flex;align-items:center;box-sizing:border-box;overflow:visible}.clll-checkbox .clll-checkbox__checkbox-container .clll-checkbox__checkbox-frame .clll-checkbox__checkbox:not(:checked)+.clll-checkbox__icon{display:none}.clll-checkbox .clll-checkbox__icon{position:absolute;display:inline-flex}.clll-checkbox .clll-checkbox__checkbox{display:inline-block;appearance:none;cursor:pointer}.clll-checkbox.clll-checkbox--rounded .clll-checkbox__checkbox{border-radius:var(--clll-rounded-xs)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-full .clll-checkbox__checkbox{border-radius:var(--clll-rounded-full)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-lg .clll-checkbox__checkbox{border-radius:var(--clll-rounded-lg)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-md .clll-checkbox__checkbox{border-radius:var(--clll-rounded-md)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-sm .clll-checkbox__checkbox{border-radius:var(--clll-rounded-sm)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-xs .clll-checkbox__checkbox{border-radius:var(--clll-rounded-xs)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-xl .clll-checkbox__checkbox{border-radius:var(--clll-rounded-xl)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-2xl .clll-checkbox__checkbox{border-radius:var(--clll-rounded-2xl)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-3xl .clll-checkbox__checkbox{border-radius:var(--clll-rounded-3xl)}.clll-checkbox.clll-checkbox--rounded.clll-checkbox--rounded-none .clll-checkbox__checkbox{border-radius:0}.clll-checkbox.clll-checkbox--tiny .clll-checkbox__checkbox-container .clll-checkbox__label>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-1_5)}.clll-checkbox.clll-checkbox--tiny .clll-checkbox__checkbox-container .clll-checkbox__label .clll-checkbox__checkbox,.clll-checkbox.clll-checkbox--tiny .clll-checkbox__checkbox-container .clll-checkbox__label .clll-radiobutton__radiobutton{width:var(--clll-unit-4);height:var(--clll-unit-4)}.clll-checkbox.clll-checkbox--small .clll-checkbox__checkbox-container .clll-checkbox__label>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-2)}.clll-checkbox.clll-checkbox--small .clll-checkbox__checkbox-container .clll-checkbox__label .clll-checkbox__checkbox,.clll-checkbox.clll-checkbox--small .clll-checkbox__checkbox-container .clll-checkbox__label .clll-radiobutton__radiobutton{width:var(--clll-unit-5);height:var(--clll-unit-5)}.clll-checkbox.clll-checkbox--medium .clll-checkbox__checkbox-container .clll-checkbox__label>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-2_5)}.clll-checkbox.clll-checkbox--medium .clll-checkbox__checkbox-container .clll-checkbox__label .clll-checkbox__checkbox,.clll-checkbox.clll-checkbox--medium .clll-checkbox__checkbox-container .clll-checkbox__label .clll-radiobutton__radiobutton{width:var(--clll-unit-6);height:var(--clll-unit-6)}.clll-checkbox.clll-checkbox--large .clll-checkbox__checkbox-container .clll-checkbox__label>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-3)}.clll-checkbox.clll-checkbox--large .clll-checkbox__checkbox-container .clll-checkbox__label .clll-checkbox__checkbox,.clll-checkbox.clll-checkbox--large .clll-checkbox__checkbox-container .clll-checkbox__label .clll-radiobutton__radiobutton{width:var(--clll-unit-7);height:var(--clll-unit-7)}.clll-checkbox.clll-checkbox--xlarge .clll-checkbox__checkbox-container .clll-checkbox__label>:not([hidden])~:not([hidden]){margin-left:var(--clll-unit-3)}.clll-checkbox.clll-checkbox--xlarge .clll-checkbox__checkbox-container .clll-checkbox__label .clll-checkbox__checkbox,.clll-checkbox.clll-checkbox--xlarge .clll-checkbox__checkbox-container .clll-checkbox__label .clll-radiobutton__radiobutton{width:var(--clll-unit-8);height:var(--clll-unit-8)}
|