@codeandfunction/callaloo 3.16.0 → 3.16.2

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 (62) hide show
  1. package/dist/chunks/{CLA11yButton.vue_vue_type_style_index_0_lang-COGwQtRU.js → CLA11yButton.vue_vue_type_style_index_0_lang-BPM559Fj.js} +1 -1
  2. package/dist/chunks/{CLButton.vue_vue_type_style_index_0_lang-CqgySW52.js → CLButton.vue_vue_type_style_index_0_lang-DiT4TwiW.js} +4 -4
  3. package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-DSvubJfG.js → CLCard.vue_vue_type_style_index_0_lang-vXK1HBND.js} +6 -6
  4. package/dist/chunks/{CLFormLabel.vue_vue_type_script_setup_true_lang-ORvye4vi.js → CLFormLabel.vue_vue_type_script_setup_true_lang-B9PYNMYy.js} +1 -1
  5. package/dist/chunks/{CLHeading.vue_vue_type_style_index_0_lang-CbHdHW2E.js → CLHeading.vue_vue_type_style_index_0_lang-HzXfA-v_.js} +1 -1
  6. package/dist/chunks/{CLIcon.vue_vue_type_style_index_0_lang-zZ4zGuBt.js → CLIcon.vue_vue_type_style_index_0_lang-YdXhAQ8-.js} +23 -22
  7. package/dist/chunks/{CLInputMessages.vue_vue_type_style_index_0_lang-xm2qDJGJ.js → CLInputMessages.vue_vue_type_style_index_0_lang-BNAW5shz.js} +2 -2
  8. package/dist/chunks/{CLLink.vue_vue_type_style_index_0_lang-D7BqWIqs.js → CLLink.vue_vue_type_style_index_0_lang-iHWgurk-.js} +3 -3
  9. package/dist/chunks/{CLNavLink.vue_vue_type_script_setup_true_lang-Dp3SsIfq.js → CLNavLink.vue_vue_type_script_setup_true_lang-DBu0BjSA.js} +1 -1
  10. package/dist/chunks/{CLPill.vue_vue_type_style_index_0_lang-BXGTb6A6.js → CLPill.vue_vue_type_style_index_0_lang-DZl8_301.js} +3 -3
  11. package/dist/chunks/{CLProgress.vue_vue_type_style_index_0_lang-5-cwF-oh.js → CLProgress.vue_vue_type_style_index_0_lang-B2TZA2aN.js} +2 -2
  12. package/dist/chunks/{CLSkeleton.vue_vue_type_style_index_0_lang-D7_swcoA.js → CLSkeleton.vue_vue_type_style_index_0_lang-BDGFXnrV.js} +1 -1
  13. package/dist/chunks/{CLSpinner.vue_vue_type_style_index_0_lang-CLccujHE.js → CLSpinner.vue_vue_type_style_index_0_lang-BsI680jS.js} +1 -1
  14. package/dist/chunks/{CLText.vue_vue_type_style_index_0_lang-CTc6UiQV.js → CLText.vue_vue_type_style_index_0_lang-CPdNgG4V.js} +1 -1
  15. package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-BIiSNSlg.js → CLToast.vue_vue_type_style_index_0_lang-C119uLhY.js} +27 -26
  16. package/dist/chunks/base-theme-CYXVp7iK.js +774 -0
  17. package/dist/chunks/helper--hRjZVm6.js +62 -0
  18. package/dist/chunks/{utils-D2P_fCSp.js → utils-B7dbJd6n.js} +2 -2
  19. package/dist/chunks/{utils-DaKwZixu.js → utils-CXZw87Wc.js} +2 -2
  20. package/dist/chunks/{utils-DYzsHCvl.js → utils-Dgc7kbbm.js} +2 -2
  21. package/dist/chunks/{utils-Dz_31dEE.js → utils-UApzileu.js} +1 -1
  22. package/dist/chunks/{utils-Dg9e9uLW.js → utils-aUf_lkSP.js} +2 -2
  23. package/dist/chunks/{utils-CFL9veAf.js → utils-m8fomrFl.js} +2 -2
  24. package/dist/components/Buttons/CLA11yButton/CLA11yButton.js +1 -1
  25. package/dist/components/Buttons/CLButton/CLButton.js +1 -1
  26. package/dist/components/CLIcon/CLIcon.js +1 -1
  27. package/dist/components/CLTable/CLTable.js +25 -25
  28. package/dist/components/Containers/CLCard/CLCard.js +1 -1
  29. package/dist/components/Containers/CLCarousel/CLCarousel.js +16 -16
  30. package/dist/components/Containers/CLDisclosure/CLDisclosure.js +6 -6
  31. package/dist/components/Form/CLCheckbox/CLCheckbox.js +3 -3
  32. package/dist/components/Form/CLInput/CLInput.js +5 -5
  33. package/dist/components/Form/CLRadioButton/CLRadioButton.js +2 -2
  34. package/dist/components/Form/CLSelect/CLSelect.js +3 -3
  35. package/dist/components/Form/CLTextArea/CLTextArea.js +2 -2
  36. package/dist/components/Indicators/CLBadge/CLBadge.js +1 -1
  37. package/dist/components/Indicators/CLBanner/CLBanner.js +6 -6
  38. package/dist/components/Indicators/CLPill/CLPill.js +1 -1
  39. package/dist/components/Indicators/CLProgress/CLProgress.js +1 -1
  40. package/dist/components/Loading/CLSkeleton/CLSkeleton.js +1 -1
  41. package/dist/components/Loading/CLSpinner/CLSpinner.js +1 -1
  42. package/dist/components/Modals/CLModal/CLModal.js +14 -13
  43. package/dist/components/Navigation/CLLink/CLLink.js +1 -1
  44. package/dist/components/Navigation/CLNavLink/CLNavLink.js +1 -1
  45. package/dist/components/Navigation/CLNavSection/CLNavSection.js +2 -2
  46. package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +509 -551
  47. package/dist/components/Popups/CLToast/CLToast.js +1 -1
  48. package/dist/components/Providers/CLThemeProvider/CLThemeProvider.js +10 -8
  49. package/dist/components/Providers/CLThemeProvider/base-theme.d.ts +0 -26
  50. package/dist/components/Providers/CLThemeProvider/index.d.ts +2 -0
  51. package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
  52. package/dist/components/Typography/CLHeading/CLHeading.js +1 -1
  53. package/dist/components/Typography/CLText/CLText.js +1 -1
  54. package/dist/composables/index.d.ts +2 -0
  55. package/dist/composables/useDropdown.js +49 -0
  56. package/dist/{chunks/useEsc-BGAp0d_1.js → composables/useEsc.js} +2 -2
  57. package/dist/{chunks/useHasSlotContent-DDqs5uK9.js → composables/useHasSlotContent.js} +2 -2
  58. package/dist/composables/useTheme.d.ts +26 -0
  59. package/dist/composables/useTheme.js +33 -0
  60. package/dist/composables/useToast.js +14 -0
  61. package/package.json +7 -2
  62. package/dist/chunks/base-theme-B89pbWnC.js +0 -841
@@ -1,5 +1,5 @@
1
1
  import './CLToast.css';
2
- import { _ as s } from "../../../chunks/CLToast.vue_vue_type_style_index_0_lang-BIiSNSlg.js";
2
+ import { _ as s } from "../../../chunks/CLToast.vue_vue_type_style_index_0_lang-C119uLhY.js";
3
3
  export {
4
4
  s as CLToast,
5
5
  s as default
@@ -1,13 +1,14 @@
1
- import { defineComponent as r, watch as o, createBlock as s, openBlock as i, resolveDynamicComponent as n, withCtx as m, renderSlot as d } from "vue";
2
- import { s as f, a as l, b as c, c as h, d as C } from "../../../chunks/base-theme-B89pbWnC.js";
3
- const v = /* @__PURE__ */ r({
1
+ import { defineComponent as a, watch as o, createBlock as s, openBlock as i, resolveDynamicComponent as m, withCtx as n, renderSlot as d } from "vue";
2
+ import { s as f, a as l, b as c, c as h, d as p } from "../../../chunks/base-theme-CYXVp7iK.js";
3
+ import { D as k } from "../../../chunks/base-theme-CYXVp7iK.js";
4
+ const v = /* @__PURE__ */ a({
4
5
  __name: "CLThemeProvider",
5
6
  props: {
6
7
  tag: { default: "div" },
7
8
  themeConfig: {}
8
9
  },
9
- setup(a) {
10
- const t = a;
10
+ setup(r) {
11
+ const t = r;
11
12
  return f(t.themeConfig), o(
12
13
  () => t.themeConfig?.borderRadius,
13
14
  (e) => {
@@ -26,10 +27,10 @@ const v = /* @__PURE__ */ r({
26
27
  ), o(
27
28
  () => t.themeConfig?.fontFamily,
28
29
  (e) => {
29
- C(e);
30
+ p(e);
30
31
  }
31
- ), (e, p) => (i(), s(n(a.tag), { class: "clll-theme-provider" }, {
32
- default: m(() => [
32
+ ), (e, C) => (i(), s(m(r.tag), { class: "clll-theme-provider" }, {
33
+ default: n(() => [
33
34
  d(e.$slots, "default")
34
35
  ]),
35
36
  _: 3
@@ -38,5 +39,6 @@ const v = /* @__PURE__ */ r({
38
39
  });
39
40
  export {
40
41
  v as CLThemeProvider,
42
+ k as DEFAULT_THEME,
41
43
  v as default
42
44
  };
@@ -19,30 +19,4 @@ export declare const setColors: (colors: CLPalette) => void;
19
19
  export declare const setDarkMode: (enabled: boolean) => void;
20
20
  export declare const setFontFamily: (font?: string) => void;
21
21
  export declare const setupTheme: (config?: CLThemeConfig) => void;
22
- export declare const useTheme: () => {
23
- borderRadius: globalThis.Ref<CLBorderRadius | undefined, CLBorderRadius | undefined>;
24
- colors: globalThis.Ref<{
25
- primary?: import('../../../index.ts').CLShades | undefined;
26
- secondary?: import('../../../index.ts').CLShades | undefined;
27
- neutral?: import('../../../index.ts').CLShades | undefined;
28
- danger?: import('../../../index.ts').CLShades | undefined;
29
- warning?: import('../../../index.ts').CLShades | undefined;
30
- success?: import('../../../index.ts').CLShades | undefined;
31
- info?: import('../../../index.ts').CLShades | undefined;
32
- }, CLPalette | {
33
- primary?: import('../../../index.ts').CLShades | undefined;
34
- secondary?: import('../../../index.ts').CLShades | undefined;
35
- neutral?: import('../../../index.ts').CLShades | undefined;
36
- danger?: import('../../../index.ts').CLShades | undefined;
37
- warning?: import('../../../index.ts').CLShades | undefined;
38
- success?: import('../../../index.ts').CLShades | undefined;
39
- info?: import('../../../index.ts').CLShades | undefined;
40
- }>;
41
- darkMode: globalThis.Ref<boolean | undefined, boolean | undefined>;
42
- fontFamily: globalThis.Ref<string | undefined, string | undefined>;
43
- setBorderRadius: (radius?: CLBorderRadius) => void;
44
- setColors: (colors: CLPalette) => void;
45
- setDarkMode: (enabled: boolean) => void;
46
- setFontFamily: (font?: string) => void;
47
- };
48
22
  export {};
@@ -1,4 +1,6 @@
1
1
  import { default as CLThemeProviderComponent } from './CLThemeProvider.vue';
2
+ import { DEFAULT_THEME } from './base-theme';
2
3
  export { CLThemeProviderComponent as CLThemeProvider };
4
+ export { DEFAULT_THEME };
3
5
  export default CLThemeProviderComponent;
4
6
  export type CLThemeProvider = InstanceType<typeof CLThemeProviderComponent>;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as L, ref as i, provide as g, createElementBlock as k, openBlock as p, createBlock as z, createCommentVNode as B, renderSlot as S, unref as A } from "vue";
2
- import { _ as $ } from "../../../chunks/CLToast.vue_vue_type_style_index_0_lang-BIiSNSlg.js";
2
+ import { _ as $ } from "../../../chunks/CLToast.vue_vue_type_style_index_0_lang-C119uLhY.js";
3
3
  const x = { class: "clll-toast-provider" }, N = /* @__PURE__ */ L({
4
4
  name: "CLToastProvider",
5
5
  __name: "CLToastProvider",
@@ -1,5 +1,5 @@
1
1
  import './CLHeading.css';
2
- import { _ as s } from "../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-CbHdHW2E.js";
2
+ import { _ as s } from "../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-HzXfA-v_.js";
3
3
  export {
4
4
  s as CLHeading,
5
5
  s as default
@@ -1,5 +1,5 @@
1
1
  import './CLText.css';
2
- import { _ as s } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-CTc6UiQV.js";
2
+ import { _ as s } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-CPdNgG4V.js";
3
3
  export {
4
4
  s as CLText,
5
5
  s as default
@@ -0,0 +1,2 @@
1
+ export { useTheme } from './useTheme';
2
+ export { useToast } from './useToast';
@@ -0,0 +1,49 @@
1
+ import { ref as v } from "vue";
2
+ import { i as n } from "../chunks/helper--hRjZVm6.js";
3
+ const E = ({
4
+ triggerElem: a,
5
+ dropdownRef: w,
6
+ openDropdownHandler: u,
7
+ closeDropdownHandler: s
8
+ }) => {
9
+ const t = v(!1), i = v(), d = () => {
10
+ try {
11
+ t.value = !t.value, t.value && n && (i.value = window.setTimeout(() => {
12
+ window.removeEventListener("click", e), window.removeEventListener("keyup", e), window.addEventListener("click", e), window.addEventListener("keyup", e);
13
+ }, 100)), u?.();
14
+ } catch (r) {
15
+ console.error(r);
16
+ }
17
+ }, m = (r) => {
18
+ try {
19
+ const o = r?.target, c = a?.value, l = w?.value;
20
+ return n && c && l && !c.contains(o) && !l.contains(o) ? !0 : void 0;
21
+ } catch (o) {
22
+ console.error(o);
23
+ return;
24
+ }
25
+ }, e = (r) => {
26
+ try {
27
+ m(r) && (n && (window.removeEventListener("click", e), window.removeEventListener("keyup", e)), t.value = !1, s?.());
28
+ } catch (o) {
29
+ console.error(o);
30
+ }
31
+ };
32
+ return {
33
+ open: t,
34
+ toggleDropdown: d,
35
+ closeDropdown: () => {
36
+ try {
37
+ n && (window.removeEventListener("click", e), window.removeEventListener("keyup", e)), t.value = !1, s?.();
38
+ } catch (r) {
39
+ console.error(r);
40
+ }
41
+ },
42
+ clearEventListeners: () => {
43
+ n && (i.value && window.clearTimeout(i.value), window.removeEventListener("click", e), window.removeEventListener("keyup", e));
44
+ }
45
+ };
46
+ };
47
+ export {
48
+ E as useDropdown
49
+ };
@@ -1,4 +1,4 @@
1
- import { i as n } from "./base-theme-B89pbWnC.js";
1
+ import { i as n } from "../chunks/helper--hRjZVm6.js";
2
2
  const v = ({ escHandler: t, triggerElem: e }) => {
3
3
  const s = (a) => {
4
4
  if (n)
@@ -15,5 +15,5 @@ const v = ({ escHandler: t, triggerElem: e }) => {
15
15
  };
16
16
  };
17
17
  export {
18
- v as u
18
+ v as useEsc
19
19
  };
@@ -1,5 +1,5 @@
1
1
  import { useSlots as i, computed as l } from "vue";
2
- const c = (e = "default") => {
2
+ const o = (e = "default") => {
3
3
  const n = i(), t = (s) => {
4
4
  try {
5
5
  return !!s?.[e]?.().some((r) => Array.isArray(r.children) ? !0 : typeof r.children == "string" && r.children.trim() ? !(r.children === "v-if" || r.children === "v-show") : typeof r.children == "object" ? t(r.children) : !1);
@@ -10,5 +10,5 @@ const c = (e = "default") => {
10
10
  return l(() => t(n));
11
11
  };
12
12
  export {
13
- c as u
13
+ o as useHasSlotContent
14
14
  };
@@ -0,0 +1,26 @@
1
+ import { Ref } from 'vue';
2
+ import { CLBorderRadius, CLPalette } from '../index.ts';
3
+ export interface ThemeState {
4
+ borderRadius: Ref<CLBorderRadius | undefined>;
5
+ colors: Ref<CLPalette>;
6
+ darkMode: Ref<boolean | undefined>;
7
+ fontFamily: Ref<string | undefined>;
8
+ setBorderRadius: (radius?: CLBorderRadius) => void;
9
+ setColors: (colors: CLPalette) => void;
10
+ setDarkMode: (enabled: boolean) => void;
11
+ setFontFamily: (font?: string) => void;
12
+ }
13
+ /**
14
+ * Composable to access the theme state from anywhere in the application.
15
+ * Must be used within a CLThemeProvider component.
16
+ *
17
+ * @returns Theme state object with refs and setter functions
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const theme = useTheme()
22
+ * console.log(theme.darkMode.value)
23
+ * theme.setDarkMode(true)
24
+ * ```
25
+ */
26
+ export declare const useTheme: () => ThemeState;
@@ -0,0 +1,33 @@
1
+ import { ref as t, inject as a } from "vue";
2
+ const s = t(), r = t(), n = t(), o = t({
3
+ primary: {},
4
+ secondary: {},
5
+ neutral: {},
6
+ danger: {},
7
+ warning: {},
8
+ success: {},
9
+ info: {}
10
+ }), l = (e) => {
11
+ s.value = e;
12
+ }, c = (e) => {
13
+ o.value = { ...o.value, ...e };
14
+ }, u = (e) => {
15
+ r.value = e;
16
+ }, d = (e) => {
17
+ n.value = e, typeof window < "u" && e && window?.document.documentElement.style.setProperty(
18
+ "--clll-font-family",
19
+ e
20
+ );
21
+ }, f = () => a("clll-theme", {
22
+ borderRadius: s,
23
+ colors: o,
24
+ darkMode: r,
25
+ fontFamily: n,
26
+ setBorderRadius: l,
27
+ setColors: c,
28
+ setDarkMode: u,
29
+ setFontFamily: d
30
+ });
31
+ export {
32
+ f as useTheme
33
+ };
@@ -0,0 +1,14 @@
1
+ import { inject as e } from "vue";
2
+ const a = () => {
3
+ const o = e("clll-toast"), s = (t) => {
4
+ o?.showToast?.(t);
5
+ };
6
+ return {
7
+ visible: o?.visible?.value,
8
+ showToast: s,
9
+ hideToast: o?.hideToast
10
+ };
11
+ };
12
+ export {
13
+ a as useToast
14
+ };
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "ui components",
18
18
  "vuejs"
19
19
  ],
20
- "version": "3.16.0",
20
+ "version": "3.16.2",
21
21
  "license": "MIT",
22
22
  "type": "module",
23
23
  "scripts": {
@@ -164,8 +164,13 @@
164
164
  "types": "./dist/components/Typography/CLText/CLText.vue.d.ts",
165
165
  "import": "./dist/components/Typography/CLText/CLText.js"
166
166
  },
167
+ "./composables/useTheme": {
168
+ "types": "./dist/composables/useTheme.d.ts",
169
+ "import": "./dist/composables/useTheme.js"
170
+ },
167
171
  "./composables/useToast": {
168
- "types": "./dist/composables/useToast.d.ts"
172
+ "types": "./dist/composables/useToast.d.ts",
173
+ "import": "./dist/composables/useToast.js"
169
174
  }
170
175
  },
171
176
  "devDependencies": {