@codeandfunction/callaloo 4.9.4 → 4.9.5

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.
Files changed (106) hide show
  1. package/dist/callaloo.global.js +1 -1
  2. package/dist/chunks/CLA11yButton.vue_vue_type_style_index_0_lang-BHF3fJsf.js +2 -0
  3. package/dist/chunks/CLButton.vue_vue_type_style_index_0_lang-3vGTMU-k.js +2 -0
  4. package/dist/chunks/CLCalendar.vue_vue_type_style_index_0_lang-BAfGE35e.js +2 -0
  5. package/dist/chunks/CLCard.vue_vue_type_style_index_0_lang-DPQxSLkQ.js +2 -0
  6. package/dist/chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-BYHbqaf0.js +2 -0
  7. package/dist/chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-BPwFZq94.js +1 -0
  8. package/dist/chunks/CLHeading.vue_vue_type_style_index_0_lang-CsmrsD6c.js +2 -0
  9. package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-yF4CdZbV.js +2 -0
  10. package/dist/chunks/CLInputMessages.vue_vue_type_style_index_0_lang-DCByJ7MB.js +2 -0
  11. package/dist/chunks/CLLink.vue_vue_type_style_index_0_lang-CCyY39MJ.js +2 -0
  12. package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-CwdYGfO9.js +2 -0
  13. package/dist/chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Ds2aJNK9.js +1 -0
  14. package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-BVsLNnfE.js +2 -0
  15. package/dist/chunks/CLSkeleton.vue_vue_type_style_index_0_lang-BmjT9fQ_.js +2 -0
  16. package/dist/chunks/CLSpinner.vue_vue_type_style_index_0_lang-DgZLt9T1.js +2 -0
  17. package/dist/chunks/CLText.vue_vue_type_style_index_0_lang-CMXJdE-D.js +2 -0
  18. package/dist/chunks/CLToast.vue_vue_type_style_index_0_lang-BIehrtqC.js +2 -0
  19. package/dist/chunks/context-CRxE5KWX.js +1 -0
  20. package/dist/chunks/context-JmPivI9V.js +1 -0
  21. package/dist/chunks/floating-ui.vue-C0JWy0Dz.js +1 -0
  22. package/dist/chunks/helper-C542dSLs.js +1 -0
  23. package/dist/chunks/icons-6SVrmx7c.js +1 -0
  24. package/dist/chunks/utils-C1iUBPIL.js +1 -0
  25. package/dist/chunks/utils-CCWSWRuR.js +1 -0
  26. package/dist/chunks/utils-CYywa195.js +1 -0
  27. package/dist/chunks/utils-DVxwAjJ4.js +1 -0
  28. package/dist/chunks/utils-Dst7nzvj.js +1 -0
  29. package/dist/chunks/utils-MElq6rY3.js +1 -0
  30. package/dist/components/Buttons/CLA11yButton/CLA11yButton.js +1 -5
  31. package/dist/components/Buttons/CLButton/CLButton.js +1 -5
  32. package/dist/components/CLIcon/CLIcon.js +1 -5
  33. package/dist/components/CLTable/CLTable.js +1 -192
  34. package/dist/components/Containers/CLCard/CLCard.js +1 -5
  35. package/dist/components/Containers/CLCarousel/CLCarousel.js +1 -544
  36. package/dist/components/Containers/CLDisclosure/CLDisclosure.js +1 -139
  37. package/dist/components/Containers/CLDrawer/CLDrawer.js +1 -119
  38. package/dist/components/Form/CLCalendar/CLCalendar.js +1 -5
  39. package/dist/components/Form/CLCheckbox/CLCheckbox.js +1 -150
  40. package/dist/components/Form/CLInput/CLInput.js +1 -450
  41. package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.js +1 -178
  42. package/dist/components/Form/CLRadioButton/CLRadioButton.js +1 -135
  43. package/dist/components/Form/CLSelect/CLSelect.js +1 -140
  44. package/dist/components/Form/CLTextArea/CLTextArea.js +1 -149
  45. package/dist/components/Indicators/CLBadge/CLBadge.js +1 -40
  46. package/dist/components/Indicators/CLBanner/CLBanner.js +1 -145
  47. package/dist/components/Indicators/CLPill/CLPill.js +1 -5
  48. package/dist/components/Indicators/CLProgress/CLProgress.js +1 -64
  49. package/dist/components/Loading/CLSkeleton/CLSkeleton.js +1 -5
  50. package/dist/components/Loading/CLSpinner/CLSpinner.js +1 -5
  51. package/dist/components/Modals/CLModal/CLModal.js +1 -5
  52. package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.js +1 -182
  53. package/dist/components/Navigation/CLLink/CLLink.js +1 -5
  54. package/dist/components/Navigation/CLNavLink/CLNavLink.js +1 -5
  55. package/dist/components/Navigation/CLNavSection/CLNavSection.js +1 -54
  56. package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +1 -150
  57. package/dist/components/Popups/CLToast/CLToast.js +1 -5
  58. package/dist/components/Providers/CLThemeProvider/CLThemeProvider.js +1 -8
  59. package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -7
  60. package/dist/components/Typography/CLHeading/CLHeading.js +1 -5
  61. package/dist/components/Typography/CLText/CLText.js +1 -5
  62. package/dist/composables/useDateInputMask.js +1 -38
  63. package/dist/composables/useDatePicker.js +1 -140
  64. package/dist/composables/useDropdown.js +1 -49
  65. package/dist/composables/useElementSize.js +1 -73
  66. package/dist/composables/useEsc.js +1 -19
  67. package/dist/composables/useHasSlotContent.js +1 -14
  68. package/dist/composables/useTheme.js +1 -40
  69. package/dist/composables/useToast.js +1 -17
  70. package/dist/index.js +1 -30
  71. package/package.json +20 -20
  72. package/dist/chunks/CLA11yButton.vue_vue_type_style_index_0_lang-zGLnnSIW.js +0 -47
  73. package/dist/chunks/CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js +0 -136
  74. package/dist/chunks/CLCalendar.vue_vue_type_style_index_0_lang-Bz1JdT1A.js +0 -163
  75. package/dist/chunks/CLCard.vue_vue_type_style_index_0_lang-Sre7UYZd.js +0 -263
  76. package/dist/chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-CJ4VrvmR.js +0 -39
  77. package/dist/chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-CIQxM6aH.js +0 -46
  78. package/dist/chunks/CLHeading.vue_vue_type_style_index_0_lang-DH5oJc1C.js +0 -52
  79. package/dist/chunks/CLIcon.vue_vue_type_style_index_0_lang-Dhr2tI-g.js +0 -113
  80. package/dist/chunks/CLInputMessages.vue_vue_type_style_index_0_lang-DTWvAACK.js +0 -149
  81. package/dist/chunks/CLLink.vue_vue_type_style_index_0_lang-BXysZqLn.js +0 -69
  82. package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-BDyONfaQ.js +0 -176
  83. package/dist/chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Dhnmfa9W.js +0 -44
  84. package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-BQim03ge.js +0 -94
  85. package/dist/chunks/CLSkeleton.vue_vue_type_style_index_0_lang-DduoX6Cu.js +0 -31
  86. package/dist/chunks/CLSpinner.vue_vue_type_style_index_0_lang-DlXqnsi8.js +0 -55
  87. package/dist/chunks/CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js +0 -48
  88. package/dist/chunks/CLThemeProvider.vue_vue_type_script_setup_true_lang-jaJYKZL8.js +0 -59
  89. package/dist/chunks/CLToast.vue_vue_type_style_index_0_lang-CzSDeL_X.js +0 -202
  90. package/dist/chunks/CLToastProvider.vue_vue_type_script_setup_true_lang-DkGK0H4Z.js +0 -35
  91. package/dist/chunks/context-CEvx70FY.js +0 -264
  92. package/dist/chunks/context-dkA4VoF7.js +0 -4
  93. package/dist/chunks/floating-ui.vue-Fx4CxKut.js +0 -1057
  94. package/dist/chunks/helper-qUkciePY.js +0 -81
  95. package/dist/chunks/icons-DllZKtC2.js +0 -4
  96. package/dist/chunks/magic-string.es-uPKorP4O.js +0 -663
  97. package/dist/chunks/utils-BfOa9ckr.js +0 -24
  98. package/dist/chunks/utils-BjZURPWx.js +0 -51
  99. package/dist/chunks/utils-C1xiySYN.js +0 -41
  100. package/dist/chunks/utils-D00IXMTR.js +0 -25
  101. package/dist/chunks/utils-eBt2zUZl.js +0 -17
  102. package/dist/chunks/utils-nD3K7jh9.js +0 -85
  103. package/dist/chunks/vue-test-utils.esm-bundler-BeQTU4qG.js +0 -18679
  104. package/dist/composables/useDatePicker.spec.js +0 -232
  105. package/dist/composables/useTheme.spec.js +0 -88
  106. package/dist/composables/useToast.spec.js +0 -45
@@ -1,94 +0,0 @@
1
- import '../components/Indicators/CLPill/CLPill.css';
2
- import { defineComponent as y, computed as s, createElementBlock as i, openBlock as a, Fragment as h, createCommentVNode as o, createBlock as r, normalizeStyle as m, normalizeClass as c, unref as t, createElementVNode as u, toDisplayString as d, withCtx as z } from "vue";
3
- import { _ as B } from "./CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
4
- import { _ as f } from "./CLIcon.vue_vue_type_style_index_0_lang-Dhr2tI-g.js";
5
- import { CLColorVariants as b, CLColors as L, CLIconSizes as $ } from "../index.js";
6
- import { p as C } from "./utils-nD3K7jh9.js";
7
- const x = ["data-testid"], E = /* @__PURE__ */ y({
8
- name: "CLPill",
9
- __name: "CLPill",
10
- props: {
11
- color: { default: L.Neutral },
12
- count: {},
13
- elevated: { type: Boolean, default: !1 },
14
- icon: {},
15
- iconFilled: { type: Boolean, default: !1 },
16
- label: {},
17
- onClick: {},
18
- rounded: { type: Boolean, default: !0 },
19
- testId: { default: "clll-pill" },
20
- variant: { default: b.Soft }
21
- },
22
- setup(e) {
23
- const n = e, l = "clll-pill", k = s(() => [
24
- l,
25
- `${l}--${n.color}--${n.variant}`,
26
- n.count ? `${l}--has-count` : "",
27
- n.elevated ? `${l}--elevated` : "",
28
- n.icon ? `${l}--has-icon` : `${l}--has-noicon`,
29
- n.rounded ? `${l}--rounded` : ""
30
- ]), v = s(() => [
31
- l,
32
- `${l}--clickable`,
33
- `${l}--${n.color}--${n.variant}`,
34
- n.count ? `${l}--has-count` : "",
35
- n.icon ? `${l}--has-icon` : `${l}--has-noicon`,
36
- n.rounded ? `${l}--rounded` : ""
37
- ]);
38
- return (F, S) => (a(), i(h, null, [
39
- e.onClick ? o("", !0) : (a(), i("div", {
40
- key: 0,
41
- class: c(t(k)),
42
- "data-testid": e.testId,
43
- style: m(t(C)({ color: e.color, variant: e.variant }))
44
- }, [
45
- e.icon ? (a(), r(t(f), {
46
- key: 0,
47
- filled: e.iconFilled,
48
- name: e.icon,
49
- size: t($).Tiny
50
- }, null, 8, ["filled", "name", "size"])) : o("", !0),
51
- u("span", {
52
- class: c(`${l}__label`)
53
- }, d(e.label), 3),
54
- e.count ? (a(), i("span", {
55
- key: 1,
56
- class: c(`${l}__count`)
57
- }, d(e.count), 3)) : o("", !0)
58
- ], 14, x)),
59
- e.onClick ? (a(), r(t(B), {
60
- key: 1,
61
- color: e.color,
62
- "on-click": e.onClick,
63
- variant: e.variant,
64
- pill: "",
65
- rounded: e.rounded
66
- }, {
67
- default: z(() => [
68
- u("div", {
69
- class: c(t(v)),
70
- style: m(t(C)({ color: e.color, variant: e.variant }))
71
- }, [
72
- e.icon ? (a(), r(t(f), {
73
- key: 0,
74
- filled: e.iconFilled,
75
- name: e.icon,
76
- size: t($).Tiny
77
- }, null, 8, ["filled", "name", "size"])) : o("", !0),
78
- u("span", {
79
- class: c(`${l}__label`)
80
- }, d(e.label), 3),
81
- e.count ? (a(), i("span", {
82
- key: 1,
83
- class: c(`${l}__count`)
84
- }, d(e.count), 3)) : o("", !0)
85
- ], 6)
86
- ]),
87
- _: 1
88
- }, 8, ["color", "on-click", "variant", "rounded"])) : o("", !0)
89
- ], 64));
90
- }
91
- });
92
- export {
93
- E as _
94
- };
@@ -1,31 +0,0 @@
1
- import '../components/Loading/CLSkeleton/CLSkeleton.css';
2
- import { defineComponent as d, computed as a, createElementBlock as r, openBlock as i, normalizeStyle as u, normalizeClass as c, unref as n, createElementVNode as m } from "vue";
3
- import { s as f } from "./utils-BfOa9ckr.js";
4
- const h = ["data-testid"], $ = /* @__PURE__ */ d({
5
- name: "CLSkeleton",
6
- __name: "CLSkeleton",
7
- props: {
8
- borderRadius: {},
9
- height: { default: "100%" },
10
- rounded: { type: Boolean, default: !0 },
11
- testId: { default: "clll-skeleton" },
12
- width: { default: "100%" }
13
- },
14
- setup(e) {
15
- const l = e, t = "clll-skeleton", s = a(() => [
16
- t,
17
- l.borderRadius ? `${t}--${l.borderRadius}` : "",
18
- l.rounded ? `${t}--rounded` : `${t}--square`
19
- ]);
20
- return (k, o) => (i(), r("div", {
21
- class: c(n(s)),
22
- "data-testid": e.testId,
23
- style: u({ ...n(f)(), width: e.width, height: e.height })
24
- }, [...o[0] || (o[0] = [
25
- m("div", { class: "clll-skeleton__animation" }, null, -1)
26
- ])], 14, h));
27
- }
28
- });
29
- export {
30
- $ as _
31
- };
@@ -1,55 +0,0 @@
1
- import '../components/Loading/CLSpinner/CLSpinner.css';
2
- import { defineComponent as d, computed as n, createElementBlock as r, openBlock as i, normalizeStyle as u, normalizeClass as c, unref as o, createElementVNode as a } from "vue";
3
- import { CLSizes as f, CLPosition as C, CLColors as $, CLAlign as z } from "../index.js";
4
- import { a as L } from "./utils-BfOa9ckr.js";
5
- const _ = ["data-testid"], h = /* @__PURE__ */ d({
6
- name: "CLSpinner",
7
- __name: "CLSpinner",
8
- props: {
9
- align: { default: z.Left },
10
- color: { default: $.Primary },
11
- position: { default: C.Absolute },
12
- size: { default: f.Medium },
13
- testId: { default: "clll-spinner" }
14
- },
15
- setup(l) {
16
- const t = l, e = "clll-spinner", m = n(() => [
17
- e,
18
- `${e}--${t.position}`,
19
- `${e}--${t.color}`,
20
- `${e}--${t.size}`,
21
- `${e}--${t.align}`
22
- ]), p = n(() => [
23
- `${e}__circle`,
24
- `${e}__circle--${t.size}`
25
- ]);
26
- return (g, s) => (i(), r("div", {
27
- class: c(o(m)),
28
- "data-testid": l.testId,
29
- style: u(o(L)({ color: l.color }))
30
- }, [
31
- (i(), r("svg", {
32
- class: c(o(p)),
33
- xmlns: "http://www.w3.org/2000/svg",
34
- fill: "none",
35
- viewBox: "0 0 24 24"
36
- }, [...s[0] || (s[0] = [
37
- a("circle", {
38
- style: { opacity: "0.25" },
39
- cx: "12",
40
- cy: "12",
41
- r: "10",
42
- stroke: "currentColor",
43
- "stroke-width": "4"
44
- }, null, -1),
45
- a("path", {
46
- fill: "currentColor",
47
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
48
- }, null, -1)
49
- ])], 2))
50
- ], 14, _));
51
- }
52
- });
53
- export {
54
- h as _
55
- };
@@ -1,48 +0,0 @@
1
- import '../components/Typography/CLText/CLText.css';
2
- import { defineComponent as d, computed as n, createBlock as r, openBlock as f, resolveDynamicComponent as c, normalizeStyle as m, normalizeClass as u, unref as o, withCtx as i, renderSlot as p } from "vue";
3
- import { CLTextTypes as y, CLColors as $, CLAlign as C } from "../index.js";
4
- import { t as x } from "./utils-eBt2zUZl.js";
5
- const L = /* @__PURE__ */ d({
6
- name: "CLText",
7
- __name: "CLText",
8
- props: {
9
- align: { default: C.Left },
10
- as: { default: "p" },
11
- bold: { type: Boolean, default: !1 },
12
- bolder: { type: Boolean, default: !1 },
13
- color: { default: $.Secondary },
14
- light: { type: Boolean, default: !1 },
15
- medium: { type: Boolean, default: !1 },
16
- testId: { default: "clll-text" },
17
- truncate: { type: Boolean, default: !1 },
18
- type: { default: y.Body }
19
- },
20
- setup(l) {
21
- const t = l, e = "clll-text", a = n(() => [
22
- e,
23
- `${e}--${t.align}`,
24
- `${e}--${t.color}`,
25
- `${e}--${t.truncate ? "wrap" : "nowrap"}`,
26
- `${e}--${t.type}`,
27
- {
28
- [`${e}--mediumbold`]: t.medium,
29
- [`${e}--light`]: t.light,
30
- [`${e}--bold`]: t.bold,
31
- [`${e}--bolder`]: t.bolder
32
- }
33
- ]);
34
- return (s, B) => (f(), r(c(l.as), {
35
- class: u(o(a)),
36
- "data-testid": l.testId,
37
- style: m(o(x)({ color: l.color }))
38
- }, {
39
- default: i(() => [
40
- p(s.$slots, "default")
41
- ]),
42
- _: 3
43
- }, 8, ["class", "data-testid", "style"]));
44
- }
45
- });
46
- export {
47
- L as _
48
- };
@@ -1,59 +0,0 @@
1
- import { defineComponent as c, provide as u, onMounted as h, onBeforeUnmount as D, watch as a, createBlock as C, openBlock as M, resolveDynamicComponent as g, normalizeStyle as k, unref as y, withCtx as v, renderSlot as p } from "vue";
2
- import { s as w, T as B, D as F } from "./context-CEvx70FY.js";
3
- import { i, b as T } from "./helper-qUkciePY.js";
4
- const S = /* @__PURE__ */ c({
5
- __name: "CLThemeProvider",
6
- props: {
7
- tag: { default: "div" },
8
- themeConfig: {},
9
- autoDetectDarkMode: { type: Boolean, default: !0 }
10
- },
11
- setup(o) {
12
- const t = o, d = w(t.themeConfig);
13
- u(B, d);
14
- const { setBorderRadius: l, setColors: m, setDarkMode: s, setFontFamily: f } = d;
15
- let r = null;
16
- const n = () => {
17
- if (t.autoDetectDarkMode && i) {
18
- const e = T();
19
- s(e);
20
- }
21
- };
22
- return h(() => {
23
- t.autoDetectDarkMode && i && (n(), r = window.matchMedia("(prefers-color-scheme: dark)"), r.addEventListener("change", n));
24
- }), D(() => {
25
- r && i && r.removeEventListener("change", n);
26
- }), a(
27
- () => t.themeConfig?.borderRadius,
28
- (e) => {
29
- l(e);
30
- }
31
- ), a(
32
- () => t.themeConfig?.colors,
33
- (e) => {
34
- e && m(e);
35
- }
36
- ), a(
37
- () => t.themeConfig?.darkMode,
38
- (e) => {
39
- e !== void 0 && !t.autoDetectDarkMode && s(e);
40
- }
41
- ), a(
42
- () => t.themeConfig?.fontFamily,
43
- (e) => {
44
- f(e);
45
- }
46
- ), (e, E) => (M(), C(g(o.tag), {
47
- class: "clll-theme-provider",
48
- style: k({ "--clll-font-family": o.themeConfig?.fontFamily || y(F).fontFamily, "--clll-default-radius": o.themeConfig?.borderRadius ? `var(--clll-${o.themeConfig.borderRadius})` : void 0 })
49
- }, {
50
- default: v(() => [
51
- p(e.$slots, "default")
52
- ]),
53
- _: 3
54
- }, 8, ["style"]));
55
- }
56
- });
57
- export {
58
- S as _
59
- };
@@ -1,202 +0,0 @@
1
- import '../components/Popups/CLToast/CLToast.css';
2
- import { defineComponent as q, ref as n, computed as G, watch as J, onMounted as K, onUnmounted as O, onBeforeUnmount as Q, createElementBlock as D, openBlock as h, normalizeStyle as W, normalizeClass as c, unref as a, createElementVNode as y, createCommentVNode as $, createVNode as M, createBlock as A, withCtx as B, createTextVNode as S, toDisplayString as N } from "vue";
3
- import { _ } from "./CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
4
- import { _ as X } from "./CLIcon.vue_vue_type_style_index_0_lang-Dhr2tI-g.js";
5
- import { _ as H } from "./CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js";
6
- import { CLColorVariants as x, CLMode as C, CLColors as g, CLToastPosition as Y, CLIconSizes as P, CLTextTypes as I, CLSizes as ee, CLIconNames as te } from "../index.js";
7
- import { i as U, g as oe, a as ae } from "./helper-qUkciePY.js";
8
- import { useEsc as se } from "../composables/useEsc.js";
9
- import { g as Z } from "./utils-D00IXMTR.js";
10
- import { useTheme as ie } from "../composables/useTheme.js";
11
- const le = ({ color: t }) => {
12
- const { colors: e, darkMode: m } = ie(), i = Z({
13
- color: t,
14
- colors: e.value,
15
- mode: m.value ? C.Light : C.Light,
16
- variant: x.Soft
17
- }), s = Z({
18
- color: g.Neutral,
19
- colors: e.value,
20
- mode: m.value ? C.Light : C.Dark,
21
- variant: x.Text
22
- });
23
- return {
24
- "--clll-toast-bg-color": m.value ? "white" : "#322F35",
25
- // Text override variables
26
- "--clll-toast-text-color": s?.textBody,
27
- // Action button override variables
28
- "--clll-toast-action-button-text-color": i?.text,
29
- "--clll-toast-action-button-bg-color": i?.bg,
30
- "--clll-toast-action-button-hover-color": i?.hover,
31
- // Dismiss button override variables
32
- "--clll-toast-dismiss-button-text-color": s?.text,
33
- "--clll-toast-dismiss-button-bg-color": s?.bg,
34
- "--clll-toast-dismiss-button-hover-color": s?.hover,
35
- // Icon colors
36
- "--clll-toast-icon-bg": i?.bg,
37
- "--clll-toast-icon-color": i?.text,
38
- "--clll-toast-theme-radius": "var(--clll-default-radius)"
39
- };
40
- }, ne = ["data-testid"], d = 300, o = "clll-toast", Te = /* @__PURE__ */ q({
41
- name: "CLToast",
42
- __name: "CLToast",
43
- props: {
44
- actionLabel: {},
45
- borderRadius: {},
46
- color: { default: g.Secondary },
47
- dismissTimer: { default: 5 },
48
- icon: {},
49
- iconSize: { default: P.Small },
50
- iconFilled: { type: Boolean, default: !1 },
51
- message: {},
52
- onAction: {},
53
- onDismiss: {},
54
- position: { default: Y.TopRight },
55
- rounded: { type: Boolean, default: !0 },
56
- testId: { default: "clll-toast" },
57
- title: {},
58
- width: { default: "24rem" }
59
- },
60
- setup(t) {
61
- const e = t, m = n(), i = n(!1), s = n(), L = n(0), l = n(!1), v = n(null), k = n(0), f = n(0), r = n(!1), j = G(() => [
62
- o,
63
- e.borderRadius ? `${o}--${e.borderRadius}` : "",
64
- e.dismissTimer ? `${o}--has-timer` : "",
65
- e.icon ? `${o}--has-icon` : "",
66
- e.message && !e.title ? `${o}--has-messageonly` : "",
67
- i.value ? `${o}--mounted` : "",
68
- e.onAction && e.actionLabel ? `${o}--has-action` : "",
69
- e.rounded ? `${o}--rounded` : `${o}--box`,
70
- e.title && !e.message ? `${o}--has-titleonly` : "",
71
- e.title && e.message ? `${o}--has-titleandmessage` : "",
72
- `${o}--${e.position}`
73
- ]), b = () => {
74
- v.value !== null && (clearTimeout(v.value), v.value = null), s.value?.stop();
75
- }, V = () => {
76
- !e.dismissTimer || l.value || (b(), k.value = Date.now(), f.value = e.dismissTimer * 1e3, r.value = !1, v.value = setTimeout(() => {
77
- !r.value && !l.value && T();
78
- }, f.value));
79
- }, z = () => {
80
- if (!e.dismissTimer || r.value || l.value) return;
81
- r.value = !0;
82
- const u = Date.now() - k.value;
83
- f.value = Math.max(0, f.value - u), b();
84
- }, w = () => {
85
- !e.dismissTimer || !r.value || l.value || (r.value = !1, k.value = Date.now(), v.value = setTimeout(() => {
86
- !r.value && !l.value && T();
87
- }, f.value));
88
- }, E = () => {
89
- document.hidden ? z() : w();
90
- }, T = () => {
91
- l.value || (l.value = !0, i.value = !1, b(), s.value && s.value.start(d, (u) => {
92
- Math.min(u, d) === d && (s.value?.stop(), e.onDismiss?.());
93
- }), R());
94
- };
95
- J(() => e.dismissTimer, () => {
96
- b(), l.value = !1, e.dismissTimer && e.dismissTimer > 0 && V();
97
- }), K(() => {
98
- U && (L.value = oe() + 1, s.value || (s.value = ae(), s.value.start(100, (u) => {
99
- Math.min(u, 100) === 100 && (s.value?.stop(), i.value = !0, e.dismissTimer && s.value?.start(d, (p) => {
100
- Math.min(p, d) === d && (s.value?.stop(), V());
101
- }));
102
- })), document.addEventListener("visibilitychange", E));
103
- }), O(() => {
104
- U && (b(), s.value = void 0, document.removeEventListener("visibilitychange", E)), i.value = !1, l.value || (l.value = !0, e.onDismiss?.());
105
- });
106
- const { clearEventListeners: R } = se({ escHandler: T });
107
- return Q(() => {
108
- R();
109
- }), (u, F) => (h(), D("output", {
110
- ref_key: "elem",
111
- ref: m,
112
- class: c(a(j)),
113
- "data-testid": t.testId,
114
- style: W({ zIndex: a(L), "--clll-toast-width": t.width, ...a(le)({ color: t.color }) }),
115
- onMouseenter: z,
116
- onMouseleave: w,
117
- onFocusin: z,
118
- onFocusout: w
119
- }, [
120
- y("div", {
121
- class: c(`${o}__body`)
122
- }, [
123
- y("div", {
124
- class: c(`${o}__content`)
125
- }, [
126
- t.icon ? (h(), D("div", {
127
- key: 0,
128
- class: c(`${o}__icon`)
129
- }, [
130
- M(a(X), {
131
- filled: t.iconFilled,
132
- name: t.icon,
133
- size: t.iconSize
134
- }, null, 8, ["filled", "name", "size"])
135
- ], 2)) : $("", !0),
136
- y("div", {
137
- class: c(`${o}__text`)
138
- }, [
139
- t.title ? (h(), A(a(H), {
140
- key: 0,
141
- color: a(g).Neutral,
142
- "test-id": `${o}__title`,
143
- type: a(I).Body,
144
- bold: ""
145
- }, {
146
- default: B(() => [
147
- S(N(t.title), 1)
148
- ]),
149
- _: 1
150
- }, 8, ["color", "test-id", "type"])) : $("", !0),
151
- t.message ? (h(), A(a(H), {
152
- key: 1,
153
- color: a(g).Neutral,
154
- "test-id": `${o}__message`,
155
- type: t.title ? a(I).Medium : a(I).Body
156
- }, {
157
- default: B(() => [
158
- S(N(t.message), 1)
159
- ]),
160
- _: 1
161
- }, 8, ["color", "test-id", "type"])) : $("", !0)
162
- ], 2),
163
- t.onAction && t.actionLabel ? (h(), D("div", {
164
- key: 1,
165
- class: c(`${o}__action-button`)
166
- }, [
167
- M(a(_), {
168
- color: t.color,
169
- "border-radius": t.borderRadius,
170
- "on-click": t.onAction,
171
- "test-id": `${o}__action-button`,
172
- variant: a(x).Soft
173
- }, {
174
- default: B(() => [
175
- S(N(t.actionLabel), 1)
176
- ]),
177
- _: 1
178
- }, 8, ["color", "border-radius", "on-click", "test-id", "variant"])
179
- ], 2)) : $("", !0)
180
- ], 2),
181
- y("div", {
182
- class: c(`${o}__dismiss-button`)
183
- }, [
184
- M(a(_), {
185
- "aria-label": "Dismiss toast",
186
- color: a(g).Neutral,
187
- "border-radius": t.borderRadius,
188
- "icon-before": a(te).Delete,
189
- "icon-size": a(P).Tiny,
190
- "on-click": T,
191
- size: a(ee).Tiny,
192
- "test-id": `${o}__dismiss-button`,
193
- variant: a(x).Text
194
- }, null, 8, ["color", "border-radius", "icon-before", "icon-size", "size", "test-id", "variant"])
195
- ], 2)
196
- ], 2)
197
- ], 46, ne));
198
- }
199
- });
200
- export {
201
- Te as _
202
- };
@@ -1,35 +0,0 @@
1
- import { defineComponent as m, ref as t, provide as l, createElementBlock as c, openBlock as a, createBlock as u, createCommentVNode as p, renderSlot as v, unref as f, mergeProps as _ } from "vue";
2
- import { _ as T } from "./CLToast.vue_vue_type_style_index_0_lang-CzSDeL_X.js";
3
- import { T as b } from "./context-dkA4VoF7.js";
4
- const h = { class: "clll-toast-provider" }, y = /* @__PURE__ */ m({
5
- name: "CLToastProvider",
6
- __name: "CLToastProvider",
7
- props: {
8
- borderRadius: {},
9
- dismissTimer: {},
10
- position: {}
11
- },
12
- setup(n) {
13
- const o = n, i = t({}), s = t(!1), d = (e) => {
14
- i.value = {
15
- ...e,
16
- borderRadius: e.borderRadius ?? o.borderRadius,
17
- dismissTimer: e.dismissTimer ?? o.dismissTimer,
18
- position: e.position ?? o.position
19
- }, s.value = !0;
20
- }, r = () => {
21
- s.value = !1, i.value = {};
22
- };
23
- return l(b, {
24
- visible: s,
25
- showToast: d,
26
- hideToast: r
27
- }), (e, k) => (a(), c("div", h, [
28
- s.value ? (a(), u(f(T), _({ key: 0 }, i.value, { "on-dismiss": r }), null, 16)) : p("", !0),
29
- v(e.$slots, "default")
30
- ]));
31
- }
32
- });
33
- export {
34
- y as _
35
- };