@rkosafo/cai.components 0.0.5 → 0.0.7

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 (63) hide show
  1. package/README.md +8 -8
  2. package/dist/baseEditor/index.svelte +32 -32
  3. package/dist/builders/filters/FilterBuilder.svelte +638 -638
  4. package/dist/forms/FormCheckbox/FormCheckbox.svelte +53 -53
  5. package/dist/forms/FormDatepicker/FormDatepicker.svelte +159 -159
  6. package/dist/forms/FormInput/FormInput.svelte +87 -87
  7. package/dist/forms/FormRadio/FormRadio.svelte +53 -53
  8. package/dist/forms/FormSelect/FormSelect.svelte +86 -86
  9. package/dist/forms/FormTextarea/FormTextarea.svelte +77 -77
  10. package/dist/forms/checkbox/Checkbox.svelte +82 -82
  11. package/dist/forms/checkbox/CheckboxButton.svelte +92 -92
  12. package/dist/forms/datepicker/Datepicker.svelte +706 -706
  13. package/dist/forms/form/Form.svelte +69 -69
  14. package/dist/forms/input/Input.svelte +363 -363
  15. package/dist/forms/label/Label.svelte +38 -38
  16. package/dist/forms/radio/Radio.svelte +48 -48
  17. package/dist/forms/radio/RadioButton.svelte +22 -22
  18. package/dist/forms/select/Select.svelte +50 -50
  19. package/dist/forms/textarea/Textarea.svelte +165 -165
  20. package/dist/layout/TF/Content/Content.svelte +28 -28
  21. package/dist/layout/TF/Header/Header.svelte +159 -159
  22. package/dist/layout/TF/Sidebar/Sidebar.svelte +52 -74
  23. package/dist/layout/TF/Sidebar/Sidebar.svelte.d.ts +1 -20
  24. package/dist/layout/TF/Wrapper/Wrapper.svelte +17 -17
  25. package/dist/themes/ThemeProvider.svelte +20 -20
  26. package/dist/types/index.d.ts +19 -0
  27. package/dist/typography/heading/Heading.svelte +35 -35
  28. package/dist/ui/accordion/Accordion.svelte +49 -49
  29. package/dist/ui/accordion/AccordionItem.svelte +173 -173
  30. package/dist/ui/alert/Alert.svelte +83 -83
  31. package/dist/ui/alertDialog/AlertDialog.svelte +40 -40
  32. package/dist/ui/avatar/Avatar.svelte +77 -77
  33. package/dist/ui/buttons/Button.svelte +102 -102
  34. package/dist/ui/buttons/GradientButton.svelte +59 -59
  35. package/dist/ui/datatable/Datatable.svelte +516 -516
  36. package/dist/ui/drawer/Drawer.svelte +280 -280
  37. package/dist/ui/dropdown/Dropdown.svelte +36 -36
  38. package/dist/ui/dropdown/DropdownDivider.svelte +11 -11
  39. package/dist/ui/dropdown/DropdownGroup.svelte +14 -14
  40. package/dist/ui/dropdown/DropdownHeader.svelte +14 -14
  41. package/dist/ui/dropdown/DropdownItem.svelte +52 -52
  42. package/dist/ui/footer/Footer.svelte +15 -15
  43. package/dist/ui/footer/FooterBrand.svelte +37 -37
  44. package/dist/ui/footer/FooterCopyright.svelte +45 -45
  45. package/dist/ui/footer/FooterIcon.svelte +22 -22
  46. package/dist/ui/footer/FooterLink.svelte +33 -33
  47. package/dist/ui/footer/FooterLinkGroup.svelte +13 -13
  48. package/dist/ui/indicator/Indicator.svelte +42 -42
  49. package/dist/ui/modal/Modal.svelte +265 -265
  50. package/dist/ui/notificationList/NotificationList.svelte +123 -123
  51. package/dist/ui/pageLoader/PageLoader.svelte +10 -10
  52. package/dist/ui/paginate/Paginate.svelte +96 -96
  53. package/dist/ui/tab/Tab.svelte +65 -65
  54. package/dist/ui/table/Table.svelte +385 -385
  55. package/dist/ui/tableLoader/TableLoader.svelte +24 -24
  56. package/dist/ui/toolbar/Toolbar.svelte +59 -59
  57. package/dist/ui/toolbar/ToolbarButton.svelte +56 -56
  58. package/dist/ui/toolbar/ToolbarGroup.svelte +43 -43
  59. package/dist/utils/Popper.svelte +257 -257
  60. package/dist/utils/closeButton/CloseButton.svelte +88 -88
  61. package/dist/utils/singleSelection.svelte.js +48 -48
  62. package/dist/youtube/index.svelte +12 -12
  63. package/package.json +2 -2
@@ -1,14 +1,14 @@
1
- <script lang="ts">
2
- import { dropdownHeader } from './index.js';
3
- import clsx from 'clsx';
4
- import { getTheme } from '../../themes/themeUtils.js';
5
- import type { DropdownHeaderProps } from '../../index.js';
6
-
7
- let { children, class: className, ...restProps }: DropdownHeaderProps = $props();
8
-
9
- const theme = getTheme('dropdownHeader');
10
- </script>
11
-
12
- <div {...restProps} class={dropdownHeader({ class: clsx(theme, className) })}>
13
- {@render children()}
14
- </div>
1
+ <script lang="ts">
2
+ import { dropdownHeader } from './index.js';
3
+ import clsx from 'clsx';
4
+ import { getTheme } from '../../themes/themeUtils.js';
5
+ import type { DropdownHeaderProps } from '../../index.js';
6
+
7
+ let { children, class: className, ...restProps }: DropdownHeaderProps = $props();
8
+
9
+ const theme = getTheme('dropdownHeader');
10
+ </script>
11
+
12
+ <div {...restProps} class={dropdownHeader({ class: clsx(theme, className) })}>
13
+ {@render children()}
14
+ </div>
@@ -1,52 +1,52 @@
1
- <script lang="ts">
2
- import { dropdownItem } from './index.js';
3
- import clsx from 'clsx';
4
- import { getContext } from 'svelte';
5
- import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
6
- import type { DropdownItemProps } from '../../index.js';
7
-
8
- let {
9
- aClass,
10
- children,
11
- activeClass,
12
- liClass,
13
- classes,
14
- class: className,
15
- ...restProps
16
- }: DropdownItemProps = $props();
17
-
18
- warnThemeDeprecation(
19
- 'DropdownItem',
20
- { aClass, activeClass, liClass },
21
- { aClass: 'class', activeClass: 'active', liClass: 'li' }
22
- );
23
- const theme = getTheme('dropdownItem');
24
- const styling = $derived(classes ?? { active: activeClass, li: liClass });
25
-
26
- const activeUrl: { value: string } = getContext('activeUrl');
27
-
28
- let isActive = $derived(activeUrl?.value ? restProps.href === activeUrl.value : false);
29
-
30
- const { base, active, li } = dropdownItem();
31
- let finalClass = $derived([
32
- isActive
33
- ? active({ class: clsx(theme?.active, styling.active) })
34
- : base({ class: clsx(theme?.base, className) })
35
- ]);
36
- </script>
37
-
38
- <li class={li({ class: clsx(styling.li) })}>
39
- {#if restProps.href === undefined && restProps.onclick === undefined}
40
- <div {...restProps} class={finalClass}>
41
- {@render children()}
42
- </div>
43
- {:else if restProps.href === undefined}
44
- <button type="button" {...restProps} class={finalClass}>
45
- {@render children()}
46
- </button>
47
- {:else}
48
- <a {...restProps} class={finalClass}>
49
- {@render children()}
50
- </a>
51
- {/if}
52
- </li>
1
+ <script lang="ts">
2
+ import { dropdownItem } from './index.js';
3
+ import clsx from 'clsx';
4
+ import { getContext } from 'svelte';
5
+ import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
6
+ import type { DropdownItemProps } from '../../index.js';
7
+
8
+ let {
9
+ aClass,
10
+ children,
11
+ activeClass,
12
+ liClass,
13
+ classes,
14
+ class: className,
15
+ ...restProps
16
+ }: DropdownItemProps = $props();
17
+
18
+ warnThemeDeprecation(
19
+ 'DropdownItem',
20
+ { aClass, activeClass, liClass },
21
+ { aClass: 'class', activeClass: 'active', liClass: 'li' }
22
+ );
23
+ const theme = getTheme('dropdownItem');
24
+ const styling = $derived(classes ?? { active: activeClass, li: liClass });
25
+
26
+ const activeUrl: { value: string } = getContext('activeUrl');
27
+
28
+ let isActive = $derived(activeUrl?.value ? restProps.href === activeUrl.value : false);
29
+
30
+ const { base, active, li } = dropdownItem();
31
+ let finalClass = $derived([
32
+ isActive
33
+ ? active({ class: clsx(theme?.active, styling.active) })
34
+ : base({ class: clsx(theme?.base, className) })
35
+ ]);
36
+ </script>
37
+
38
+ <li class={li({ class: clsx(styling.li) })}>
39
+ {#if restProps.href === undefined && restProps.onclick === undefined}
40
+ <div {...restProps} class={finalClass}>
41
+ {@render children()}
42
+ </div>
43
+ {:else if restProps.href === undefined}
44
+ <button type="button" {...restProps} class={finalClass}>
45
+ {@render children()}
46
+ </button>
47
+ {:else}
48
+ <a {...restProps} class={finalClass}>
49
+ {@render children()}
50
+ </a>
51
+ {/if}
52
+ </li>
@@ -1,15 +1,15 @@
1
- <script lang="ts">
2
- import { getTheme, type FooterProps } from '../../index.js';
3
- import clsx from 'clsx';
4
- import { footer } from './index.js';
5
-
6
- let { children, footerType = 'default', class: className, ...restProps }: FooterProps = $props();
7
-
8
- const theme = getTheme('footer');
9
-
10
- const footerCls = $derived(footer({ footerType, class: clsx(theme, className) }));
11
- </script>
12
-
13
- <footer {...restProps} class={footerCls}>
14
- {@render children()}
15
- </footer>
1
+ <script lang="ts">
2
+ import { getTheme, type FooterProps } from '../../index.js';
3
+ import clsx from 'clsx';
4
+ import { footer } from './index.js';
5
+
6
+ let { children, footerType = 'default', class: className, ...restProps }: FooterProps = $props();
7
+
8
+ const theme = getTheme('footer');
9
+
10
+ const footerCls = $derived(footer({ footerType, class: clsx(theme, className) }));
11
+ </script>
12
+
13
+ <footer {...restProps} class={footerCls}>
14
+ {@render children()}
15
+ </footer>
@@ -1,37 +1,37 @@
1
- <script lang="ts">
2
- import { getTheme, type FooterBrandProps } from '../../index.js';
3
- import clsx, { type ClassValue } from 'clsx';
4
- import { footerBrand } from './index.js';
5
-
6
- let {
7
- children,
8
- aClass,
9
- spanClass,
10
- imgClass,
11
- href,
12
- src,
13
- alt,
14
- name,
15
- ...restProps
16
- }: FooterBrandProps = $props();
17
-
18
- const theme = getTheme('footerBrand');
19
-
20
- const { base, span, img } = $derived(footerBrand());
21
- </script>
22
-
23
- {#if href}
24
- <a {...restProps} {href} class={base({ class: clsx(theme?.base, aClass) })}>
25
- {#if src}
26
- <img {src} class={img({ class: clsx(theme?.img, imgClass) })} {alt} />
27
- {/if}
28
- {#if name}
29
- <span class={span({ class: clsx(theme?.span, spanClass) })}>{name}</span>
30
- {/if}
31
- {#if children}
32
- {@render children()}
33
- {/if}
34
- </a>
35
- {:else}
36
- <img {src} class={img({ class: clsx(imgClass) })} {alt} />
37
- {/if}
1
+ <script lang="ts">
2
+ import { getTheme, type FooterBrandProps } from '../../index.js';
3
+ import clsx, { type ClassValue } from 'clsx';
4
+ import { footerBrand } from './index.js';
5
+
6
+ let {
7
+ children,
8
+ aClass,
9
+ spanClass,
10
+ imgClass,
11
+ href,
12
+ src,
13
+ alt,
14
+ name,
15
+ ...restProps
16
+ }: FooterBrandProps = $props();
17
+
18
+ const theme = getTheme('footerBrand');
19
+
20
+ const { base, span, img } = $derived(footerBrand());
21
+ </script>
22
+
23
+ {#if href}
24
+ <a {...restProps} {href} class={base({ class: clsx(theme?.base, aClass) })}>
25
+ {#if src}
26
+ <img {src} class={img({ class: clsx(theme?.img, imgClass) })} {alt} />
27
+ {/if}
28
+ {#if name}
29
+ <span class={span({ class: clsx(theme?.span, spanClass) })}>{name}</span>
30
+ {/if}
31
+ {#if children}
32
+ {@render children()}
33
+ {/if}
34
+ </a>
35
+ {:else}
36
+ <img {src} class={img({ class: clsx(imgClass) })} {alt} />
37
+ {/if}
@@ -1,45 +1,45 @@
1
- <script lang="ts">
2
- import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
3
- import clsx, { type ClassValue } from 'clsx';
4
- import { footerCopyright } from './index.js';
5
- import type { FooterCopyrightProps } from '../../index.js';
6
-
7
- let {
8
- spanClass,
9
- aClass,
10
- href,
11
- by,
12
- copyrightMessage = 'All Rights Reserved.',
13
- year,
14
- bySpanClass,
15
- classes,
16
- class: className,
17
- ...restProps
18
- }: FooterCopyrightProps = $props();
19
-
20
- warnThemeDeprecation(
21
- 'FooterCopyright',
22
- { aClass, spanClass, bySpanClass },
23
- { aClass: 'link', spanClass: 'class', bySpanClass: 'bySpan' }
24
- );
25
- // link, bySpan
26
- const styling = $derived(classes ?? { bySpan: bySpanClass, link: aClass });
27
-
28
- if (!year) year = new Date().getFullYear();
29
-
30
- const { base, link, bySpan } = footerCopyright();
31
-
32
- const theme = getTheme('footerCopyright');
33
- </script>
34
-
35
- <span class={base({ class: clsx(theme?.base, className ?? spanClass) })}>
36
- &copy; {year}
37
- {#if href}
38
- <a {...restProps} {href} class={link({ class: clsx(theme?.link, styling.link) })}>
39
- {by}
40
- </a>
41
- {:else}
42
- <span class={bySpan({ class: clsx(theme?.bySpan, styling.bySpan) })}>{by}</span>
43
- {/if}
44
- {copyrightMessage}
45
- </span>
1
+ <script lang="ts">
2
+ import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
3
+ import clsx, { type ClassValue } from 'clsx';
4
+ import { footerCopyright } from './index.js';
5
+ import type { FooterCopyrightProps } from '../../index.js';
6
+
7
+ let {
8
+ spanClass,
9
+ aClass,
10
+ href,
11
+ by,
12
+ copyrightMessage = 'All Rights Reserved.',
13
+ year,
14
+ bySpanClass,
15
+ classes,
16
+ class: className,
17
+ ...restProps
18
+ }: FooterCopyrightProps = $props();
19
+
20
+ warnThemeDeprecation(
21
+ 'FooterCopyright',
22
+ { aClass, spanClass, bySpanClass },
23
+ { aClass: 'link', spanClass: 'class', bySpanClass: 'bySpan' }
24
+ );
25
+ // link, bySpan
26
+ const styling = $derived(classes ?? { bySpan: bySpanClass, link: aClass });
27
+
28
+ if (!year) year = new Date().getFullYear();
29
+
30
+ const { base, link, bySpan } = footerCopyright();
31
+
32
+ const theme = getTheme('footerCopyright');
33
+ </script>
34
+
35
+ <span class={base({ class: clsx(theme?.base, className ?? spanClass) })}>
36
+ &copy; {year}
37
+ {#if href}
38
+ <a {...restProps} {href} class={link({ class: clsx(theme?.link, styling.link) })}>
39
+ {by}
40
+ </a>
41
+ {:else}
42
+ <span class={bySpan({ class: clsx(theme?.bySpan, styling.bySpan) })}>{by}</span>
43
+ {/if}
44
+ {copyrightMessage}
45
+ </span>
@@ -1,22 +1,22 @@
1
- <script lang="ts">
2
- import { getTheme, type FooterIconProps } from '../../index.js';
3
- import clsx from 'clsx';
4
- import { footerIcon } from './index.js';
5
-
6
- let { children, href, ariaLabel, class: className, ...restProps }: FooterIconProps = $props();
7
-
8
- const theme = getTheme('footerIcon');
9
- </script>
10
-
11
- {#if href}
12
- <a
13
- {...restProps}
14
- {href}
15
- aria-label={ariaLabel}
16
- class={footerIcon({ class: clsx(theme, className) })}
17
- >
18
- {@render children()}
19
- </a>
20
- {:else}
21
- {@render children()}
22
- {/if}
1
+ <script lang="ts">
2
+ import { getTheme, type FooterIconProps } from '../../index.js';
3
+ import clsx from 'clsx';
4
+ import { footerIcon } from './index.js';
5
+
6
+ let { children, href, ariaLabel, class: className, ...restProps }: FooterIconProps = $props();
7
+
8
+ const theme = getTheme('footerIcon');
9
+ </script>
10
+
11
+ {#if href}
12
+ <a
13
+ {...restProps}
14
+ {href}
15
+ aria-label={ariaLabel}
16
+ class={footerIcon({ class: clsx(theme, className) })}
17
+ >
18
+ {@render children()}
19
+ </a>
20
+ {:else}
21
+ {@render children()}
22
+ {/if}
@@ -1,33 +1,33 @@
1
- <script lang="ts" module>
2
- </script>
3
-
4
- <script lang="ts">
5
- import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
6
- import clsx, { type ClassValue } from 'clsx';
7
- import { footerLink } from './index.js';
8
- import type { FooterLinkProps } from '../../index.js';
9
-
10
- let {
11
- children,
12
- liClass,
13
- aClass,
14
- href,
15
- classes,
16
- class: className,
17
- ...restProps
18
- }: FooterLinkProps = $props();
19
-
20
- warnThemeDeprecation('FooterLink', { liClass, aClass }, { liClass: 'class', aClass: 'link' });
21
- // link, bySpan
22
- const styling = $derived(classes ?? { link: aClass });
23
-
24
- const theme = getTheme('footerLink');
25
-
26
- const { base, link } = footerLink();
27
- </script>
28
-
29
- <li class={base({ class: clsx(theme?.base, className ?? liClass) })}>
30
- <a {...restProps} {href} class={link({ class: clsx(theme?.link, styling.link) })}>
31
- {@render children()}
32
- </a>
33
- </li>
1
+ <script lang="ts" module>
2
+ </script>
3
+
4
+ <script lang="ts">
5
+ import { getTheme, warnThemeDeprecation } from '../../themes/themeUtils.js';
6
+ import clsx, { type ClassValue } from 'clsx';
7
+ import { footerLink } from './index.js';
8
+ import type { FooterLinkProps } from '../../index.js';
9
+
10
+ let {
11
+ children,
12
+ liClass,
13
+ aClass,
14
+ href,
15
+ classes,
16
+ class: className,
17
+ ...restProps
18
+ }: FooterLinkProps = $props();
19
+
20
+ warnThemeDeprecation('FooterLink', { liClass, aClass }, { liClass: 'class', aClass: 'link' });
21
+ // link, bySpan
22
+ const styling = $derived(classes ?? { link: aClass });
23
+
24
+ const theme = getTheme('footerLink');
25
+
26
+ const { base, link } = footerLink();
27
+ </script>
28
+
29
+ <li class={base({ class: clsx(theme?.base, className ?? liClass) })}>
30
+ <a {...restProps} {href} class={link({ class: clsx(theme?.link, styling.link) })}>
31
+ {@render children()}
32
+ </a>
33
+ </li>
@@ -1,13 +1,13 @@
1
- <script lang="ts">
2
- import { getTheme, type FooterLinkGroupProps } from '../../index.js';
3
- import clsx from 'clsx';
4
- import { footerLinkGroup } from './index.js';
5
-
6
- let { class: className, children, ...restProps }: FooterLinkGroupProps = $props();
7
-
8
- const theme = getTheme('footerLinkGroup');
9
- </script>
10
-
11
- <ul {...restProps} class={footerLinkGroup({ class: clsx(theme, className) })}>
12
- {@render children()}
13
- </ul>
1
+ <script lang="ts">
2
+ import { getTheme, type FooterLinkGroupProps } from '../../index.js';
3
+ import clsx from 'clsx';
4
+ import { footerLinkGroup } from './index.js';
5
+
6
+ let { class: className, children, ...restProps }: FooterLinkGroupProps = $props();
7
+
8
+ const theme = getTheme('footerLinkGroup');
9
+ </script>
10
+
11
+ <ul {...restProps} class={footerLinkGroup({ class: clsx(theme, className) })}>
12
+ {@render children()}
13
+ </ul>
@@ -1,42 +1,42 @@
1
-
2
-
3
- <script lang="ts">
4
- import { indicator } from './index.js';
5
- import clsx from 'clsx';
6
-
7
- import { getTheme } from '../../themes/themeUtils.js';
8
- import type { IndicatorProps } from '../../index.js';
9
-
10
- let {
11
- children,
12
- color = 'primary',
13
- cornerStyle = 'circular',
14
- size = 'md',
15
- border = false,
16
- placement,
17
- offset = true,
18
- class: className,
19
- ...restProps
20
- }: IndicatorProps = $props();
21
- const theme = getTheme('indicator');
22
-
23
- let hasChildren = !!children;
24
- const base = $derived(
25
- indicator({
26
- color,
27
- size,
28
- cornerStyle,
29
- border,
30
- placement,
31
- offset,
32
- hasChildren,
33
- class: clsx(theme, className)
34
- })
35
- );
36
- </script>
37
-
38
- <div {...restProps} class={base}>
39
- {#if children}
40
- {@render children()}
41
- {/if}
42
- </div>
1
+
2
+
3
+ <script lang="ts">
4
+ import { indicator } from './index.js';
5
+ import clsx from 'clsx';
6
+
7
+ import { getTheme } from '../../themes/themeUtils.js';
8
+ import type { IndicatorProps } from '../../index.js';
9
+
10
+ let {
11
+ children,
12
+ color = 'primary',
13
+ cornerStyle = 'circular',
14
+ size = 'md',
15
+ border = false,
16
+ placement,
17
+ offset = true,
18
+ class: className,
19
+ ...restProps
20
+ }: IndicatorProps = $props();
21
+ const theme = getTheme('indicator');
22
+
23
+ let hasChildren = !!children;
24
+ const base = $derived(
25
+ indicator({
26
+ color,
27
+ size,
28
+ cornerStyle,
29
+ border,
30
+ placement,
31
+ offset,
32
+ hasChildren,
33
+ class: clsx(theme, className)
34
+ })
35
+ );
36
+ </script>
37
+
38
+ <div {...restProps} class={base}>
39
+ {#if children}
40
+ {@render children()}
41
+ {/if}
42
+ </div>