@codeandfunction/callaloo 4.9.4 → 4.9.6

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-hEXnJ7H1.js +2 -0
  4. package/dist/chunks/CLCalendar.vue_vue_type_style_index_0_lang-BqrGuMVB.js +2 -0
  5. package/dist/chunks/CLCard.vue_vue_type_style_index_0_lang-BGKjh5vA.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-Cjt6fX90.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-C9_EwMBi.js +2 -0
  12. package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-DroQPRWC.js +2 -0
  13. package/dist/chunks/CLNavLink.vue_vue_type_script_setup_true_lang-Dqr8A_2Z.js +1 -0
  14. package/dist/chunks/CLPill.vue_vue_type_style_index_0_lang-DCtH-u0_.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-CtXJMlF9.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,141 +1,3 @@
1
1
  import '../../../assets/core.css';
2
2
  import './CLDisclosure.css';
3
- import { defineComponent as L, ref as m, computed as g, onBeforeUnmount as I, createElementBlock as T, openBlock as i, normalizeStyle as H, normalizeClass as o, unref as n, createVNode as k, createElementVNode as l, withKeys as p, withCtx as u, createBlock as r, createCommentVNode as s, renderSlot as $, createTextVNode as h, toDisplayString as y } from "vue";
4
- import { _ as E } from "../../../chunks/CLA11yButton.vue_vue_type_style_index_0_lang-zGLnnSIW.js";
5
- import { _ as N } from "../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-DH5oJc1C.js";
6
- import { _ as b } from "../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-Dhr2tI-g.js";
7
- import { _ as D } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js";
8
- import { CLColorVariants as V, CLSizes as w, CLTextTypes as A, CLIconSizes as R, CLIconNames as C, CLHeadingTypes as K, CLColors as M } from "../../../index.js";
9
- import { d as U } from "../../../chunks/utils-BjZURPWx.js";
10
- import { useEsc as j } from "../../../composables/useEsc.js";
11
- import { useHasSlotContent as q } from "../../../composables/useHasSlotContent.js";
12
- const F = ["data-testid"], G = ["id", "aria-labelledby", "aria-hidden"], te = /* @__PURE__ */ L({
13
- name: "CLDisclosure",
14
- __name: "CLDisclosure",
15
- props: {
16
- bordered: { type: Boolean, default: !0 },
17
- borderRadius: {},
18
- color: { default: M.Neutral },
19
- compact: { type: Boolean, default: !1 },
20
- contentSpacing: { type: Boolean, default: !0 },
21
- disclosureId: {},
22
- expanded: { type: Boolean, default: !1 },
23
- expandedIcon: { default: C.ChevronUp },
24
- heading: {},
25
- headingLevel: {},
26
- headingType: { default: K.Section },
27
- iconAfter: { default: C.ChevronDown },
28
- iconBefore: {},
29
- iconSize: { default: R.Medium },
30
- rounded: { type: Boolean, default: !0 },
31
- subHeading: {},
32
- subHeadingType: { default: A.Body },
33
- testId: { default: "clll-disclosure" },
34
- triggerButtonSize: { default: w.Medium },
35
- variant: { default: V.Soft }
36
- },
37
- setup(t) {
38
- const e = "clll-disclosure", a = t;
39
- let v = m();
40
- const d = m(a.expanded), S = q("trailing"), B = g(() => [
41
- e,
42
- `${e}--${a.color}--${a.variant}`,
43
- `${e}--${a.triggerButtonSize}`,
44
- a.bordered ? `${e}--bordered` : "",
45
- a.borderRadius ? `${e}--${a.borderRadius}` : "",
46
- a.contentSpacing ? `${e}--padded` : `${e}--nopadding`,
47
- a.compact ? `${e}--compact` : "",
48
- d.value ? `${e}--expanded` : `${e}--collapsed`,
49
- a.heading ? `${e}--hasheading` : "",
50
- a.subHeading || S.value ? `${e}--hassubheading` : "",
51
- a.rounded ? `${e}--rounded` : `${e}--box`,
52
- `${e}--${a.triggerButtonSize}`
53
- ]), x = g(() => [
54
- `${e}__content`,
55
- `${e}__content--${a.triggerButtonSize}`
56
- ]), c = () => {
57
- d.value ? d.value = !1 : d.value = !0;
58
- }, { clearEventListeners: z } = j({ escHandler: c, triggerElem: v });
59
- return I(() => {
60
- z();
61
- }), (f, J) => (i(), T("div", {
62
- class: o(n(B)),
63
- style: H(n(U)({ color: t.color, variant: t.variant })),
64
- "data-testid": t.testId
65
- }, [
66
- k(n(E), {
67
- id: `${e}__button--${t.disclosureId}`,
68
- "aria-controls": `${e}--${t.disclosureId}`,
69
- "aria-expanded": n(d),
70
- color: t.color,
71
- enabled: !0,
72
- fluid: !0,
73
- rounded: t.rounded,
74
- role: "button",
75
- onClick: c,
76
- onKeyup: p(c, ["enter"])
77
- }, {
78
- default: u(() => [
79
- l("div", {
80
- class: o(`${e}__trigger`)
81
- }, [
82
- l("span", {
83
- class: o(`${e}__heading`)
84
- }, [
85
- t.iconBefore ? (i(), r(n(b), {
86
- key: 0,
87
- name: t.iconBefore,
88
- size: t.iconSize
89
- }, null, 8, ["name", "size"])) : s("", !0),
90
- l("span", {
91
- class: o(`${e}__heading-text`)
92
- }, [
93
- t.heading ? (i(), r(n(N), {
94
- key: 0,
95
- class: o(`${e}__text-heading`),
96
- type: t.headingType,
97
- level: t.headingLevel
98
- }, {
99
- default: u(() => [
100
- h(y(t.heading), 1)
101
- ]),
102
- _: 1
103
- }, 8, ["class", "type", "level"])) : s("", !0),
104
- t.subHeading ? (i(), r(n(D), {
105
- key: 1,
106
- class: o(`${e}__text-subheading`),
107
- type: t.subHeadingType,
108
- truncate: ""
109
- }, {
110
- default: u(() => [
111
- h(y(t.subHeading), 1)
112
- ]),
113
- _: 1
114
- }, 8, ["class", "type"])) : s("", !0)
115
- ], 2),
116
- $(f.$slots, "trailing"),
117
- t.iconAfter ? (i(), r(n(b), {
118
- key: 1,
119
- name: n(d) ? t.expandedIcon : t.iconAfter,
120
- size: t.iconSize
121
- }, null, 8, ["name", "size"])) : s("", !0)
122
- ], 2)
123
- ], 2)
124
- ]),
125
- _: 3
126
- }, 8, ["id", "aria-controls", "aria-expanded", "color", "rounded"]),
127
- l("div", {
128
- id: `${e}--${t.disclosureId}`,
129
- "aria-labelledby": `${e}__button--${t.disclosureId}`,
130
- "aria-hidden": !n(d),
131
- class: o(n(x))
132
- }, [
133
- $(f.$slots, "default")
134
- ], 10, G)
135
- ], 14, F));
136
- }
137
- });
138
- export {
139
- te as CLDisclosure,
140
- te as default
141
- };
3
+ import{defineComponent as e,ref as a,computed as t,onBeforeUnmount as d,createElementBlock as o,openBlock as n,normalizeStyle as i,normalizeClass as s,unref as l,createVNode as r,createElementVNode as u,withKeys as c,withCtx as p,createBlock as _,createCommentVNode as g,renderSlot as $,createTextVNode as f,toDisplayString as m}from"vue";import{_ as y}from"../../../chunks/CLA11yButton.vue_vue_type_style_index_0_lang-BHF3fJsf.js";import{_ as v}from"../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-CsmrsD6c.js";import{_ as b}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-Cjt6fX90.js";import{_ as h}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-CMXJdE-D.js";import{CLColorVariants as x,CLSizes as B,CLTextTypes as S,CLIconSizes as z,CLIconNames as C,CLHeadingTypes as k,CLColors as I}from"../../../index.js";import{d as L}from"../../../chunks/utils-Dst7nzvj.js";import{useEsc as H}from"../../../composables/useEsc.js";import{useHasSlotContent as j}from"../../../composables/useHasSlotContent.js";const T=["data-testid"],A=["id","aria-labelledby","aria-hidden"],D=/* @__PURE__ */e({name:"CLDisclosure",__name:"CLDisclosure",props:{bordered:{type:Boolean,default:!0},borderRadius:{},color:{default:I.Neutral},compact:{type:Boolean,default:!1},contentSpacing:{type:Boolean,default:!0},disclosureId:{},expanded:{type:Boolean,default:!1},expandedIcon:{default:C.ChevronUp},heading:{},headingLevel:{},headingType:{default:k.Section},iconAfter:{default:C.ChevronDown},iconBefore:{},iconSize:{default:z.Medium},rounded:{type:Boolean,default:!0},subHeading:{},subHeadingType:{default:S.Body},testId:{default:"clll-disclosure"},triggerButtonSize:{default:B.Medium},variant:{default:x.Soft}},setup(e){const x="clll-disclosure",B=e;let S=a();const z=a(B.expanded),C=j("trailing"),k=t(()=>[x,`${x}--${B.color}--${B.variant}`,`${x}--${B.triggerButtonSize}`,B.bordered?`${x}--bordered`:"",B.borderRadius?`${x}--${B.borderRadius}`:"",B.contentSpacing?`${x}--padded`:`${x}--nopadding`,B.compact?`${x}--compact`:"",z.value?`${x}--expanded`:`${x}--collapsed`,B.heading?`${x}--hasheading`:"",B.subHeading||C.value?`${x}--hassubheading`:"",B.rounded?`${x}--rounded`:`${x}--box`,`${x}--${B.triggerButtonSize}`]),I=t(()=>[`${x}__content`,`${x}__content--${B.triggerButtonSize}`]),D=()=>{z.value?z.value=!1:z.value=!0},{clearEventListeners:E}=H({escHandler:D,triggerElem:S});return d(()=>{E()}),(a,t)=>(n(),o("div",{class:s(l(k)),style:i(l(L)({color:e.color,variant:e.variant})),"data-testid":e.testId},[r(l(y),{id:`${x}__button--${e.disclosureId}`,"aria-controls":`${x}--${e.disclosureId}`,"aria-expanded":l(z),color:e.color,enabled:!0,fluid:!0,rounded:e.rounded,role:"button",onClick:D,onKeyup:c(D,["enter"])},{default:p(()=>[u("div",{class:s(`${x}__trigger`)},[u("span",{class:s(`${x}__heading`)},[e.iconBefore?(n(),_(l(b),{key:0,name:e.iconBefore,size:e.iconSize},null,8,["name","size"])):g("",!0),u("span",{class:s(`${x}__heading-text`)},[e.heading?(n(),_(l(v),{key:0,class:s(`${x}__text-heading`),type:e.headingType,level:e.headingLevel},{default:p(()=>[f(m(e.heading),1)]),_:1},8,["class","type","level"])):g("",!0),e.subHeading?(n(),_(l(h),{key:1,class:s(`${x}__text-subheading`),type:e.subHeadingType,truncate:""},{default:p(()=>[f(m(e.subHeading),1)]),_:1},8,["class","type"])):g("",!0)],2),$(a.$slots,"trailing"),e.iconAfter?(n(),_(l(b),{key:1,name:l(z)?e.expandedIcon:e.iconAfter,size:e.iconSize},null,8,["name","size"])):g("",!0)],2)],2)]),_:3},8,["id","aria-controls","aria-expanded","color","rounded"]),u("div",{id:`${x}--${e.disclosureId}`,"aria-labelledby":`${x}__button--${e.disclosureId}`,"aria-hidden":!l(z),class:s(l(I))},[$(a.$slots,"default")],10,A)],14,T))}});export{D as CLDisclosure,D as default};
@@ -1,121 +1,3 @@
1
1
  import '../../../assets/core.css';
2
2
  import './CLDrawer.css';
3
- import { defineComponent as q, useTemplateRef as G, ref as w, computed as i, watch as J, onMounted as K, onBeforeUnmount as Q, createElementBlock as $, createCommentVNode as E, unref as u, openBlock as M, normalizeStyle as h, normalizeClass as C, createElementVNode as X, renderSlot as Y } from "vue";
4
- import { CLDrawerPosition as v } from "../../../index.js";
5
- import { a as ee } from "../../../chunks/utils-BjZURPWx.js";
6
- import { useEsc as te } from "../../../composables/useEsc.js";
7
- import { SizeDimension as O, useElementSize as ne, SizeMode as k } from "../../../composables/useElementSize.js";
8
- import { c as P, i as s, g as V, a as S } from "../../../chunks/helper-qUkciePY.js";
9
- const oe = ["data-testid"], de = /* @__PURE__ */ q({
10
- name: "CLDrawer",
11
- __name: "CLDrawer",
12
- props: {
13
- autoSize: { type: Boolean, default: !1 },
14
- dismissible: { type: Boolean, default: !0 },
15
- isOpen: { type: Boolean, default: !1 },
16
- onClose: { type: Function, default: void 0 },
17
- overlay: { type: Boolean, default: !0 },
18
- position: { default: v.Left },
19
- snapPoint: { default: 1 },
20
- testId: { default: "clll-drawer" },
21
- zIndex: { default: 100 }
22
- },
23
- emits: ["drawer-open", "drawer-close"],
24
- setup(p, { emit: H }) {
25
- const g = H, r = G("drawer-content"), d = 300, l = w(!1), t = w(), z = w(0), f = w(!1), T = i(() => e.isOpen || f.value), e = p, c = "clll-drawer", L = "clll-prevent-scroll", _ = i(() => e.position === v.Top || e.position === v.Bottom ? O.Height : O.Width), { size: R, destroy: Z } = ne({
26
- elementRef: r,
27
- dimension: _.value,
28
- mode: e.autoSize ? k.Auto : k.Percentage,
29
- snapPoint: e.snapPoint,
30
- observeChanges: !0,
31
- debounceDelay: 50,
32
- isActive: i(() => e.isOpen && l.value)
33
- }), B = () => {
34
- s && window?.document.body.classList.add(L);
35
- }, b = () => {
36
- s && window?.document.body.classList.remove(L);
37
- }, A = i(() => [
38
- c,
39
- `${c}--${e.position}`,
40
- l.value ? `${c}--mounted` : ""
41
- ]), N = i(() => [
42
- `${c}__content`,
43
- `${c}__content--${e.position}`
44
- ]), D = i(() => {
45
- if (e.zIndex === "auto") return e.zIndex;
46
- const n = P(e.zIndex) ? parseInt(e.zIndex, 10) : e.zIndex;
47
- return n > 0 ? n.toString() : z.value.toString();
48
- }), U = i(() => ((P(e.zIndex) ? parseInt(e.zIndex, 10) : e.zIndex) - 1).toString()), W = i(() => {
49
- const n = e.position === v.Top || e.position === v.Bottom, o = n ? "height" : "width", a = {
50
- zIndex: D.value,
51
- [o]: R.value
52
- };
53
- return e.autoSize && (n ? a.maxHeight = "100dvh" : a.maxWidth = "100vw"), a;
54
- }), F = (n) => {
55
- try {
56
- const o = n?.target, a = r.value;
57
- return !!(s && a && !a.contains(o));
58
- } catch (o) {
59
- return console.error(o), !1;
60
- }
61
- }, y = (n) => {
62
- try {
63
- F(n) && (s && window.removeEventListener("mousedown", y), I());
64
- } catch (o) {
65
- console.error(o);
66
- }
67
- }, x = () => {
68
- s && window.removeEventListener("mousedown", y);
69
- }, m = () => {
70
- s && (t.value && t.value.stop(), x(), b(), f.value = !1, Z());
71
- }, I = () => {
72
- e.isOpen && (f.value = !0, l.value = !1, s ? (t.value && t.value.stop(), t.value || (t.value = S()), t.value.start(d, (n) => {
73
- Math.min(n, d) === d && (t.value?.stop(), e.onClose?.(), m());
74
- })) : (e.onClose?.(), m()));
75
- };
76
- J(() => e.isOpen, (n) => {
77
- n ? (f.value = !1, g("drawer-open"), B(), s && (z.value = V() + 1, t.value || (t.value = S()), t.value.start(100, (o) => {
78
- Math.min(o, 100) === 100 && (t.value?.stop(), l.value = !0, e.dismissible && (x(), setTimeout(() => {
79
- s && window.addEventListener("mousedown", y);
80
- }, 100)));
81
- }), r.value && r.value.focus())) : (f.value = !0, r.value && r.value.blur(), b(), x(), t.value ? (l.value = !1, t.value.start(d, (o) => {
82
- Math.min(o, d) === d && (t.value?.stop(), e.onClose?.(), m());
83
- })) : (l.value = !1, e.onClose?.(), m()), g("drawer-close"));
84
- }), K(() => {
85
- e.isOpen && s && (B(), z.value = V() + 1, t.value || (t.value = S()), t.value.start(100, (n) => {
86
- Math.min(n, 100) === 100 && (t.value?.stop(), l.value = !0);
87
- }), r.value && r.value.focus());
88
- });
89
- const { clearEventListeners: j } = te({
90
- escHandler: e.dismissible ? I : void 0
91
- });
92
- return Q(() => {
93
- m(), j(), t.value && t.value.stop();
94
- }), (n, o) => u(T) ? (M(), $("div", {
95
- key: 0,
96
- class: C(u(A)),
97
- "data-testid": p.testId,
98
- style: h({ ...u(ee)(), zIndex: u(D) })
99
- }, [
100
- X("div", {
101
- ref: "drawer-content",
102
- class: C(u(N)),
103
- style: h(u(W)),
104
- role: "dialog",
105
- tabindex: -1
106
- }, [
107
- Y(n.$slots, "default")
108
- ], 6),
109
- p.overlay ? (M(), $("div", {
110
- key: 0,
111
- class: C(`${c}__overlay`),
112
- style: h({ zIndex: u(U) }),
113
- onClick: o[0] || (o[0] = (a) => p.dismissible ? I() : void 0)
114
- }, null, 6)) : E("", !0)
115
- ], 14, oe)) : E("", !0);
116
- }
117
- });
118
- export {
119
- de as CLDrawer,
120
- de as default
121
- };
3
+ import{defineComponent as e,useTemplateRef as t,ref as o,computed as a,watch as s,onMounted as n,onBeforeUnmount as l,createElementBlock as i,createCommentVNode as u,unref as r,openBlock as d,normalizeStyle as v,normalizeClass as p,createElementVNode as c,renderSlot as m}from"vue";import{CLDrawerPosition as w}from"../../../index.js";import{a as f}from"../../../chunks/utils-Dst7nzvj.js";import{useEsc as y}from"../../../composables/useEsc.js";import{SizeDimension as h,useElementSize as x,SizeMode as z}from"../../../composables/useElementSize.js";import{c as I,i as b,g,a as C}from"../../../chunks/helper-C542dSLs.js";const L=["data-testid"],$=/* @__PURE__ */e({name:"CLDrawer",__name:"CLDrawer",props:{autoSize:{type:Boolean,default:!1},dismissible:{type:Boolean,default:!0},isOpen:{type:Boolean,default:!1},onClose:{type:Function,default:void 0},overlay:{type:Boolean,default:!0},position:{default:w.Left},snapPoint:{default:1},testId:{default:"clll-drawer"},zIndex:{default:100}},emits:["drawer-open","drawer-close"],setup(e,{emit:$}){const _=$,S=t("drawer-content"),k=300,B=o(!1),E=o(),O=o(0),j=o(!1),D=a(()=>M.isOpen||j.value),M=e,P="clll-drawer",H="clll-prevent-scroll",T=a(()=>M.position===w.Top||M.position===w.Bottom?h.Height:h.Width),{size:A,destroy:W}=x({elementRef:S,dimension:T.value,mode:M.autoSize?z.Auto:z.Percentage,snapPoint:M.snapPoint,observeChanges:!0,debounceDelay:50,isActive:a(()=>M.isOpen&&B.value)}),F=()=>{b&&window?.document.body.classList.add(H)},R=()=>{b&&window?.document.body.classList.remove(H)},q=a(()=>[P,`${P}--${M.position}`,B.value?`${P}--mounted`:""]),G=a(()=>[`${P}__content`,`${P}__content--${M.position}`]),J=a(()=>{if("auto"===M.zIndex)return M.zIndex;const e=I(M.zIndex)?parseInt(M.zIndex,10):M.zIndex;return e>0?e.toString():O.value.toString()}),K=a(()=>((I(M.zIndex)?parseInt(M.zIndex,10):M.zIndex)-1).toString()),N=a(()=>{const e=M.position===w.Top||M.position===w.Bottom,t=e?"height":"width",o={zIndex:J.value,[t]:A.value};return M.autoSize&&(e?o.maxHeight="100dvh":o.maxWidth="100vw"),o}),Q=e=>{try{(e=>{try{const t=e?.target,o=S.value;return!(!b||!o||o.contains(t))}catch(t){return console.error(t),!1}})(e)&&(b&&window.removeEventListener("mousedown",Q),X())}catch(t){console.error(t)}},U=()=>{b&&window.removeEventListener("mousedown",Q)},V=()=>{b&&(E.value&&E.value.stop(),U(),R(),j.value=!1,W())},X=()=>{M.isOpen&&(j.value=!0,B.value=!1,b?(E.value&&E.value.stop(),E.value||(E.value=C()),E.value.start(k,e=>{Math.min(e,k)===k&&(E.value?.stop(),M.onClose?.(),V())})):(M.onClose?.(),V()))};s(()=>M.isOpen,e=>{e?(j.value=!1,_("drawer-open"),F(),b&&(O.value=g()+1,E.value||(E.value=C()),E.value.start(100,e=>{100===Math.min(e,100)&&(E.value?.stop(),B.value=!0,M.dismissible&&(U(),setTimeout(()=>{b&&window.addEventListener("mousedown",Q)},100)))}),S.value&&S.value.focus())):(j.value=!0,S.value&&S.value.blur(),R(),U(),E.value?(B.value=!1,E.value.start(k,e=>{Math.min(e,k)===k&&(E.value?.stop(),M.onClose?.(),V())})):(B.value=!1,M.onClose?.(),V()),_("drawer-close"))}),n(()=>{M.isOpen&&b&&(F(),O.value=g()+1,E.value||(E.value=C()),E.value.start(100,e=>{100===Math.min(e,100)&&(E.value?.stop(),B.value=!0)}),S.value&&S.value.focus())});const{clearEventListeners:Y}=y({escHandler:M.dismissible?X:void 0});return l(()=>{V(),Y(),E.value&&E.value.stop()}),(t,o)=>r(D)?(d(),i("div",{key:0,class:p(r(q)),"data-testid":e.testId,style:v({...r(f)(),zIndex:r(J)})},[c("div",{ref:"drawer-content",class:p(r(G)),style:v(r(N)),role:"dialog",tabindex:-1},[m(t.$slots,"default")],6),e.overlay?(d(),i("div",{key:0,class:p(`${P}__overlay`),style:v({zIndex:r(K)}),onClick:o[0]||(o[0]=t=>e.dismissible?X():void 0)},null,6)):u("",!0)],14,L)):u("",!0)}});export{$ as CLDrawer,$ as default};
@@ -1,7 +1,3 @@
1
1
  import '../../../assets/core.css';
2
2
  import './CLCalendar.css';
3
- import { _ as r } from "../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-Bz1JdT1A.js";
4
- export {
5
- r as CLCalendar,
6
- r as default
7
- };
3
+ import{_ as a}from"../../../chunks/CLCalendar.vue_vue_type_style_index_0_lang-BqrGuMVB.js";export{a as CLCalendar,a as default};
@@ -1,153 +1,4 @@
1
1
  import '../../../assets/core.css';
2
2
  import './CLCheckbox.css';
3
3
  import '../../../assets/shared/form-utilities.css';
4
- import { defineComponent as h, mergeModels as T, useTemplateRef as z, useModel as B, computed as y, createBlock as m, openBlock as f, withCtx as X, createElementVNode as u, createCommentVNode as L, normalizeStyle as S, normalizeClass as n, unref as c, withDirectives as M, vModelCheckbox as V, createVNode as q, createTextVNode as F, toDisplayString as N } from "vue";
5
- import { _ as I, c as R, a as D } from "../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-DTWvAACK.js";
6
- import { _ as w } from "../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-Dhr2tI-g.js";
7
- import { _ as E } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js";
8
- import { CLSizes as l, CLIconSizes as d, CLTextTypes as s, CLIconNames as H, CLColorVariants as O, CLColors as U } from "../../../index.js";
9
- const j = ["data-testid"], A = ["for", "disabled"], G = ["id", "aria-label", "disabled", "form", "name", "required", "value"], Z = /* @__PURE__ */ h({
10
- name: "CLCheckbox",
11
- __name: "CLCheckbox",
12
- props: /* @__PURE__ */ T({
13
- ariaLabel: { default: void 0 },
14
- borderRadius: { default: void 0 },
15
- busy: { type: Boolean, default: !1 },
16
- color: { default: U.Neutral },
17
- disabled: { type: Boolean, default: !1 },
18
- form: { default: void 0 },
19
- id: {},
20
- label: { default: void 0 },
21
- messages: { default: () => [] },
22
- messageType: { default: void 0 },
23
- name: {},
24
- onBlur: { type: Function, default: void 0 },
25
- onChange: { type: Function, default: void 0 },
26
- onFocus: { type: Function, default: void 0 },
27
- required: { type: Boolean, default: !1 },
28
- rounded: { type: Boolean, default: !0 },
29
- size: { default: l.Small },
30
- testId: { default: "clll-checkbox" },
31
- value: { type: [String, Number, Boolean], default: void 0 },
32
- variant: { default: O.Outline }
33
- }, {
34
- modelValue: { type: Boolean },
35
- modelModifiers: {}
36
- }),
37
- emits: ["update:modelValue"],
38
- setup(e, { expose: $ }) {
39
- const C = {
40
- [l.Tiny]: d.Tiny,
41
- [l.Small]: d.Tiny,
42
- [l.Medium]: d.Small,
43
- [l.Large]: d.Medium,
44
- [l.XL]: d.Medium,
45
- [l.XXL]: d.Large,
46
- [l.XXXL]: d.Large,
47
- [l.XXXXL]: d.XL
48
- }, v = {
49
- [l.Tiny]: s.Small,
50
- [l.Small]: s.Medium,
51
- [l.Medium]: s.Medium,
52
- [l.Large]: s.Large,
53
- [l.XL]: s.XL,
54
- [l.XXL]: s.XXL,
55
- [l.XXXL]: s.XXXL,
56
- [l.XXXXL]: s.XXXXL
57
- }, o = e, r = z("checkbox-ref"), b = B(e, "modelValue"), a = "clll-checkbox", x = y(() => [
58
- a,
59
- o.borderRadius ? `${a}--${o.borderRadius}` : "",
60
- o.busy ? `${a}--busy` : `${a}--ready`,
61
- o.disabled ? `${a}--disabled` : `${a}--active`,
62
- o.label ? `${a}--haslabel` : "",
63
- `${a}--${o.color}`,
64
- `${a}--${o.size}`,
65
- o.messageType ? `${a}--${o.messageType}` : "",
66
- o.rounded ? `${a}--rounded` : `${a}--box`,
67
- o.required ? `${a}--required` : `${a}--optional`
68
- ]), g = y(() => [
69
- `${a}__checkbox-container`,
70
- `${a}--${o.variant}`
71
- ]), k = () => {
72
- r.value && r.value.focus();
73
- };
74
- return $({
75
- checkboxRef: r
76
- }), (J, t) => (f(), m(I, null, {
77
- default: X(() => [
78
- u("span", {
79
- class: n(c(x)),
80
- style: S(c(R)({ color: e.color, variant: e.variant })),
81
- "data-testid": e.testId
82
- }, [
83
- u("span", {
84
- class: n(c(g)),
85
- onClick: k
86
- }, [
87
- u("label", {
88
- for: e.id,
89
- class: n(`${a}__label`),
90
- disabled: e.disabled
91
- }, [
92
- u("span", {
93
- class: n([`${a}__checkbox-frame`, "form-control-flex"])
94
- }, [
95
- M(u("input", {
96
- id: e.id,
97
- ref: "checkbox-ref",
98
- "onUpdate:modelValue": t[0] || (t[0] = (i) => b.value = i),
99
- "aria-label": e.ariaLabel,
100
- class: n(`${a}__checkbox`),
101
- disabled: e.disabled || e.busy,
102
- form: e.form,
103
- name: e.name,
104
- required: e.required,
105
- type: "checkbox",
106
- value: e.value,
107
- onBlur: t[1] || (t[1] = //@ts-ignore
108
- (...i) => e.onBlur && e.onBlur(...i)),
109
- onChange: t[2] || (t[2] = //@ts-ignore
110
- (...i) => e.onChange && e.onChange(...i)),
111
- onFocus: t[3] || (t[3] = //@ts-ignore
112
- (...i) => e.onFocus && e.onFocus(...i))
113
- }, null, 42, G), [
114
- [V, b.value]
115
- ]),
116
- u("span", {
117
- class: n(`${a}__icon`)
118
- }, [
119
- q(c(w), {
120
- name: c(H).Check,
121
- size: C[e.size]
122
- }, null, 8, ["name", "size"])
123
- ], 2)
124
- ], 2),
125
- e.label ? (f(), m(c(E), {
126
- key: 0,
127
- as: "span",
128
- type: v[e.size],
129
- class: n(e.required ? `${a}__label--required` : "")
130
- }, {
131
- default: X(() => [
132
- F(N(e.label), 1)
133
- ]),
134
- _: 1
135
- }, 8, ["type", "class"])) : L("", !0)
136
- ], 10, A)
137
- ], 2)
138
- ], 14, j),
139
- e.id ? (f(), m(D, {
140
- key: 0,
141
- id: e.id,
142
- messages: e.messages,
143
- "message-type": e.messageType
144
- }, null, 8, ["id", "messages", "message-type"])) : L("", !0)
145
- ]),
146
- _: 1
147
- }));
148
- }
149
- });
150
- export {
151
- Z as CLCheckbox,
152
- Z as default
153
- };
4
+ import{defineComponent as e,mergeModels as a,useTemplateRef as l,useModel as s,computed as o,createBlock as d,openBlock as u,withCtx as i,createElementVNode as t,createCommentVNode as n,normalizeStyle as r,normalizeClass as c,unref as m,withDirectives as b,vModelCheckbox as f,createVNode as p,createTextVNode as _,toDisplayString as y}from"vue";import{_ as X,c as v,a as L}from"../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-DCByJ7MB.js";import{_ as $}from"../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-Cjt6fX90.js";import{_ as g}from"../../../chunks/CLText.vue_vue_type_style_index_0_lang-CMXJdE-D.js";import{CLSizes as h,CLIconSizes as x,CLTextTypes as k,CLIconNames as C,CLColorVariants as B,CLColors as T}from"../../../index.js";const q=["data-testid"],M=["for","disabled"],F=["id","aria-label","disabled","form","name","required","value"],z=/* @__PURE__ */e({name:"CLCheckbox",__name:"CLCheckbox",props:/* @__PURE__ */a({ariaLabel:{default:void 0},borderRadius:{default:void 0},busy:{type:Boolean,default:!1},color:{default:T.Neutral},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{},label:{default:void 0},messages:{default:()=>[]},messageType:{default:void 0},name:{},onBlur:{type:Function,default:void 0},onChange:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},required:{type:Boolean,default:!1},rounded:{type:Boolean,default:!0},size:{default:h.Small},testId:{default:"clll-checkbox"},value:{type:[String,Number,Boolean],default:void 0},variant:{default:B.Outline}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e,{expose:a}){const B={[h.Tiny]:x.Tiny,[h.Small]:x.Tiny,[h.Medium]:x.Small,[h.Large]:x.Medium,[h.XL]:x.Medium,[h.XXL]:x.Large,[h.XXXL]:x.Large,[h.XXXXL]:x.XL},T={[h.Tiny]:k.Small,[h.Small]:k.Medium,[h.Medium]:k.Medium,[h.Large]:k.Large,[h.XL]:k.XL,[h.XXL]:k.XXL,[h.XXXL]:k.XXXL,[h.XXXXL]:k.XXXXL},z=e,S=l("checkbox-ref"),j=s(e,"modelValue"),I="clll-checkbox",R=o(()=>[I,z.borderRadius?`${I}--${z.borderRadius}`:"",z.busy?`${I}--busy`:`${I}--ready`,z.disabled?`${I}--disabled`:`${I}--active`,z.label?`${I}--haslabel`:"",`${I}--${z.color}`,`${I}--${z.size}`,z.messageType?`${I}--${z.messageType}`:"",z.rounded?`${I}--rounded`:`${I}--box`,z.required?`${I}--required`:`${I}--optional`]),V=o(()=>[`${I}__checkbox-container`,`${I}--${z.variant}`]),N=()=>{S.value&&S.value.focus()};return a({checkboxRef:S}),(a,l)=>(u(),d(X,null,{default:i(()=>[t("span",{class:c(m(R)),style:r(m(v)({color:e.color,variant:e.variant})),"data-testid":e.testId},[t("span",{class:c(m(V)),onClick:N},[t("label",{for:e.id,class:c(`${I}__label`),disabled:e.disabled},[t("span",{class:c([`${I}__checkbox-frame`,"form-control-flex"])},[b(t("input",{id:e.id,ref:"checkbox-ref","onUpdate:modelValue":l[0]||(l[0]=e=>j.value=e),"aria-label":e.ariaLabel,class:c(`${I}__checkbox`),disabled:e.disabled||e.busy,form:e.form,name:e.name,required:e.required,type:"checkbox",value:e.value,onBlur:l[1]||(l[1]=(...a)=>e.onBlur&&e.onBlur(...a)),onChange:l[2]||(l[2]=(...a)=>e.onChange&&e.onChange(...a)),onFocus:l[3]||(l[3]=(...a)=>e.onFocus&&e.onFocus(...a))},null,42,F),[[f,j.value]]),t("span",{class:c(`${I}__icon`)},[p(m($),{name:m(C).Check,size:B[e.size]},null,8,["name","size"])],2)],2),e.label?(u(),d(m(g),{key:0,as:"span",type:T[e.size],class:c(e.required?`${I}__label--required`:"")},{default:i(()=>[_(y(e.label),1)]),_:1},8,["type","class"])):n("",!0)],10,M)],2)],14,q),e.id?(u(),d(L,{key:0,id:e.id,messages:e.messages,"message-type":e.messageType},null,8,["id","messages","message-type"])):n("",!0)]),_:1}))}});export{z as CLCheckbox,z as default};