@websline/system-components 1.3.4 → 1.3.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 (162) hide show
  1. package/dist/components/atoms/checkbox/Checkbox.svelte +1 -1
  2. package/dist/components/atoms/chip/Chip.svelte +4 -3
  3. package/dist/components/atoms/chip/chip.variants.d.ts +15 -15
  4. package/dist/components/atoms/chip/chip.variants.js +48 -29
  5. package/dist/components/atoms/icon/components/AiStars.svelte +29 -0
  6. package/dist/components/atoms/icon/components/AiStars.svelte.d.ts +33 -0
  7. package/dist/components/atoms/icon/components/AlignBottom.svelte +27 -0
  8. package/dist/components/atoms/icon/components/AlignBottom.svelte.d.ts +41 -0
  9. package/dist/components/atoms/icon/components/AlignBottomOne.svelte +27 -0
  10. package/dist/components/atoms/icon/components/AlignBottomOne.svelte.d.ts +41 -0
  11. package/dist/components/atoms/icon/components/AlignCenter.svelte +27 -0
  12. package/dist/components/atoms/icon/components/AlignCenter.svelte.d.ts +41 -0
  13. package/dist/components/atoms/icon/components/AlignCenterOne.svelte +27 -0
  14. package/dist/components/atoms/icon/components/AlignCenterOne.svelte.d.ts +41 -0
  15. package/dist/components/atoms/icon/components/AlignLeft.svelte +27 -0
  16. package/dist/components/atoms/icon/components/AlignLeft.svelte.d.ts +41 -0
  17. package/dist/components/atoms/icon/components/AlignMiddle.svelte +27 -0
  18. package/dist/components/atoms/icon/components/AlignMiddle.svelte.d.ts +41 -0
  19. package/dist/components/atoms/icon/components/AlignMiddleOne.svelte +27 -0
  20. package/dist/components/atoms/icon/components/AlignMiddleOne.svelte.d.ts +41 -0
  21. package/dist/components/atoms/icon/components/AlignRight.svelte +27 -0
  22. package/dist/components/atoms/icon/components/AlignRight.svelte.d.ts +41 -0
  23. package/dist/components/atoms/icon/components/AlignRightOne.svelte +27 -0
  24. package/dist/components/atoms/icon/components/AlignRightOne.svelte.d.ts +41 -0
  25. package/dist/components/atoms/icon/components/AlignTop.svelte +27 -0
  26. package/dist/components/atoms/icon/components/AlignTop.svelte.d.ts +41 -0
  27. package/dist/components/atoms/icon/components/AlignTopOne.svelte +27 -0
  28. package/dist/components/atoms/icon/components/AlignTopOne.svelte.d.ts +41 -0
  29. package/dist/components/atoms/icon/components/ArrowDown.svelte +13 -8
  30. package/dist/components/atoms/icon/components/ArrowUp.svelte +13 -8
  31. package/dist/components/atoms/icon/components/BoxIn.svelte +27 -0
  32. package/dist/components/atoms/icon/components/{Unlink.svelte.d.ts → BoxIn.svelte.d.ts} +3 -3
  33. package/dist/components/atoms/icon/components/BoxOut.svelte +27 -0
  34. package/dist/components/atoms/icon/components/BoxOut.svelte.d.ts +41 -0
  35. package/dist/components/atoms/icon/components/ChevronDoubleLeft.svelte +27 -0
  36. package/dist/components/atoms/icon/components/ChevronDoubleLeft.svelte.d.ts +41 -0
  37. package/dist/components/atoms/icon/components/ChevronDoubleRight.svelte +27 -0
  38. package/dist/components/atoms/icon/components/ChevronDoubleRight.svelte.d.ts +41 -0
  39. package/dist/components/atoms/icon/components/Clipboard.svelte +27 -0
  40. package/dist/components/atoms/icon/components/Clipboard.svelte.d.ts +41 -0
  41. package/dist/components/atoms/icon/components/Computer.svelte +26 -0
  42. package/dist/components/atoms/icon/components/Computer.svelte.d.ts +41 -0
  43. package/dist/components/atoms/icon/components/Connect.svelte +26 -0
  44. package/dist/components/atoms/icon/components/Connect.svelte.d.ts +41 -0
  45. package/dist/components/atoms/icon/components/ConnectCrossed.svelte.d.ts +41 -0
  46. package/dist/components/atoms/icon/components/ContactCard.svelte +27 -0
  47. package/dist/components/atoms/icon/components/ContactCard.svelte.d.ts +41 -0
  48. package/dist/components/atoms/icon/components/Crop.svelte +27 -0
  49. package/dist/components/atoms/icon/components/Crop.svelte.d.ts +41 -0
  50. package/dist/components/atoms/icon/components/Envelope.svelte +27 -0
  51. package/dist/components/atoms/icon/components/Envelope.svelte.d.ts +41 -0
  52. package/dist/components/atoms/icon/components/Envelopes.svelte +27 -0
  53. package/dist/components/atoms/icon/components/Envelopes.svelte.d.ts +41 -0
  54. package/dist/components/atoms/icon/components/Expand.svelte +27 -0
  55. package/dist/components/atoms/icon/components/Expand.svelte.d.ts +41 -0
  56. package/dist/components/atoms/icon/components/Eye.svelte +31 -0
  57. package/dist/components/atoms/icon/components/Eye.svelte.d.ts +41 -0
  58. package/dist/components/atoms/icon/components/EyeCrossed.svelte +36 -0
  59. package/dist/components/atoms/icon/components/EyeCrossed.svelte.d.ts +41 -0
  60. package/dist/components/atoms/icon/components/Filter.svelte +27 -0
  61. package/dist/components/atoms/icon/components/Filter.svelte.d.ts +41 -0
  62. package/dist/components/atoms/icon/components/FocalPoint.svelte +26 -0
  63. package/dist/components/atoms/icon/components/FocalPoint.svelte.d.ts +41 -0
  64. package/dist/components/atoms/icon/components/FolderPlus.svelte +27 -0
  65. package/dist/components/atoms/icon/components/FolderPlus.svelte.d.ts +41 -0
  66. package/dist/components/atoms/icon/components/Funnel.svelte +26 -0
  67. package/dist/components/atoms/icon/components/Funnel.svelte.d.ts +41 -0
  68. package/dist/components/atoms/icon/components/Inbox.svelte +27 -0
  69. package/dist/components/atoms/icon/components/Inbox.svelte.d.ts +41 -0
  70. package/dist/components/atoms/icon/components/Intergration.svelte +27 -0
  71. package/dist/components/atoms/icon/components/Intergration.svelte.d.ts +41 -0
  72. package/dist/components/atoms/icon/components/LinkAi.svelte +33 -0
  73. package/dist/components/atoms/icon/components/LinkAi.svelte.d.ts +41 -0
  74. package/dist/components/atoms/icon/components/ListTasks.svelte +27 -0
  75. package/dist/components/atoms/icon/components/ListTasks.svelte.d.ts +41 -0
  76. package/dist/components/atoms/icon/components/Lock.svelte +27 -0
  77. package/dist/components/atoms/icon/components/Lock.svelte.d.ts +41 -0
  78. package/dist/components/atoms/icon/components/Minus.svelte +27 -0
  79. package/dist/components/atoms/icon/components/Minus.svelte.d.ts +41 -0
  80. package/dist/components/atoms/icon/components/PageEdit.svelte +27 -0
  81. package/dist/components/atoms/icon/components/PageEdit.svelte.d.ts +41 -0
  82. package/dist/components/atoms/icon/components/Pages.svelte +33 -0
  83. package/dist/components/atoms/icon/components/Pages.svelte.d.ts +41 -0
  84. package/dist/components/atoms/icon/components/Payment.svelte +27 -0
  85. package/dist/components/atoms/icon/components/Payment.svelte.d.ts +41 -0
  86. package/dist/components/atoms/icon/components/Pencil.svelte +27 -0
  87. package/dist/components/atoms/icon/components/Pencil.svelte.d.ts +41 -0
  88. package/dist/components/atoms/icon/components/Phone.svelte +26 -0
  89. package/dist/components/atoms/icon/components/Phone.svelte.d.ts +41 -0
  90. package/dist/components/atoms/icon/components/Plus.svelte +27 -0
  91. package/dist/components/atoms/icon/components/Plus.svelte.d.ts +41 -0
  92. package/dist/components/atoms/icon/components/Print.svelte +36 -0
  93. package/dist/components/atoms/icon/components/Print.svelte.d.ts +41 -0
  94. package/dist/components/atoms/icon/components/RefreshCircle.svelte +27 -0
  95. package/dist/components/atoms/icon/components/RefreshCircle.svelte.d.ts +41 -0
  96. package/dist/components/atoms/icon/components/Replace.svelte +27 -0
  97. package/dist/components/atoms/icon/components/Replace.svelte.d.ts +41 -0
  98. package/dist/components/atoms/icon/components/Report.svelte +27 -0
  99. package/dist/components/atoms/icon/components/Report.svelte.d.ts +41 -0
  100. package/dist/components/atoms/icon/components/SEO.svelte +33 -0
  101. package/dist/components/atoms/icon/components/SEO.svelte.d.ts +41 -0
  102. package/dist/components/atoms/icon/components/Shop.svelte +27 -0
  103. package/dist/components/atoms/icon/components/Shop.svelte.d.ts +41 -0
  104. package/dist/components/atoms/icon/components/Smartphone.svelte +26 -0
  105. package/dist/components/atoms/icon/components/Smartphone.svelte.d.ts +41 -0
  106. package/dist/components/atoms/icon/components/Sort.svelte +27 -0
  107. package/dist/components/atoms/icon/components/Sort.svelte.d.ts +41 -0
  108. package/dist/components/atoms/icon/components/Star.svelte +26 -0
  109. package/dist/components/atoms/icon/components/Star.svelte.d.ts +41 -0
  110. package/dist/components/atoms/icon/components/StyleGuide.svelte +38 -0
  111. package/dist/components/atoms/icon/components/StyleGuide.svelte.d.ts +41 -0
  112. package/dist/components/atoms/icon/components/Tablet.svelte +26 -0
  113. package/dist/components/atoms/icon/components/Tablet.svelte.d.ts +41 -0
  114. package/dist/components/atoms/icon/components/Translate.svelte +27 -0
  115. package/dist/components/atoms/icon/components/Translate.svelte.d.ts +41 -0
  116. package/dist/components/atoms/icon/components/TranslateCrossed.svelte +36 -0
  117. package/dist/components/atoms/icon/components/TranslateCrossed.svelte.d.ts +41 -0
  118. package/dist/components/atoms/icon/components/Width.svelte +27 -0
  119. package/dist/components/atoms/icon/components/Width.svelte.d.ts +41 -0
  120. package/dist/components/atoms/icon/index.d.ts +6 -774
  121. package/dist/components/atoms/icon/index.js +43 -87
  122. package/dist/components/atoms/radio/Radio.svelte +1 -1
  123. package/dist/components/atoms/switch/Switch.svelte +1 -1
  124. package/dist/components/atoms/tag/Tag.svelte +47 -0
  125. package/dist/components/atoms/tag/Tag.svelte.d.ts +73 -0
  126. package/dist/components/atoms/tag/tag.variants.d.ts +58 -0
  127. package/dist/components/atoms/tag/tag.variants.js +32 -0
  128. package/dist/components/molecules/richTextEditor/RichTextEditor.svelte +50 -63
  129. package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +15 -135
  130. package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte +10 -11
  131. package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte.d.ts +0 -2
  132. package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte +9 -2
  133. package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte.d.ts +2 -7
  134. package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte +7 -4
  135. package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte.d.ts +0 -2
  136. package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte +9 -2
  137. package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte.d.ts +2 -7
  138. package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte +11 -2
  139. package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte.d.ts +0 -2
  140. package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte +9 -2
  141. package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte.d.ts +2 -7
  142. package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte +9 -2
  143. package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte.d.ts +2 -7
  144. package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte +2 -1
  145. package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte.d.ts +2 -7
  146. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte +9 -2
  147. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte.d.ts +2 -7
  148. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte +2 -1
  149. package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte.d.ts +2 -7
  150. package/dist/components/molecules/selectorCard/SelectorCard.svelte +1 -1
  151. package/dist/components/molecules/tagSelector/ValueList.svelte +5 -9
  152. package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +21 -3
  153. package/dist/components/molecules/toggleGroup/ToggleGroup.svelte.d.ts +16 -0
  154. package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte +5 -3
  155. package/dist/components/molecules/toggleGroup/toggleGroup.variants.d.ts +32 -13
  156. package/dist/components/molecules/toggleGroup/toggleGroup.variants.js +12 -0
  157. package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.d.ts +9 -0
  158. package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.js +8 -5
  159. package/dist/index.d.ts +1 -0
  160. package/dist/index.js +1 -0
  161. package/package.json +1 -1
  162. /package/dist/components/atoms/icon/components/{Unlink.svelte → ConnectCrossed.svelte} +0 -0
@@ -9,41 +9,40 @@
9
9
  import ToolbarRedo from "./ToolbarRedo.svelte";
10
10
  import ToolbarColor from "./ToolbarColor.svelte";
11
11
 
12
- let { editor, toolbarConfig } = $props();
12
+ let { toolbarConfig } = $props();
13
13
  </script>
14
14
 
15
15
  {#if toolbarConfig && toolbarConfig.bold && toolbarConfig.bold.enabled}
16
- <ToolbarBold {editor} />
16
+ <ToolbarBold />
17
17
  {/if}
18
18
 
19
19
  {#if toolbarConfig && toolbarConfig.italic && toolbarConfig.italic.enabled}
20
- <ToolbarItalic {editor} />
20
+ <ToolbarItalic />
21
21
  {/if}
22
22
 
23
23
  {#if toolbarConfig && toolbarConfig.underline && toolbarConfig.underline.enabled}
24
- <ToolbarUnderline {editor} />
24
+ <ToolbarUnderline />
25
25
  {/if}
26
26
 
27
27
  {#if toolbarConfig && toolbarConfig.link && toolbarConfig.link.enabled}
28
- <ToolbarLink {editor} onOpenLink={toolbarConfig.link.onOpenLink} />
28
+ <ToolbarLink onOpenLink={toolbarConfig.link.onOpenLink} />
29
29
  {/if}
30
30
 
31
31
  {#if toolbarConfig && toolbarConfig.color && toolbarConfig.color.enabled && toolbarConfig.color.colors.length > 0}
32
32
  <ToolbarColor
33
33
  colors={toolbarConfig.color.colors}
34
- defaultColor={toolbarConfig.color.defaultColor}
35
- {editor} />
34
+ defaultColor={toolbarConfig.color.defaultColor} />
36
35
  {/if}
37
36
 
38
37
  {#if toolbarConfig && toolbarConfig.list && toolbarConfig.list.enabled}
39
- <ToolbarList {editor} />
38
+ <ToolbarList />
40
39
  {/if}
41
40
 
42
41
  {#if toolbarConfig && toolbarConfig.listOrdered && toolbarConfig.listOrdered.enabled}
43
- <ToolbarListOrdered {editor} />
42
+ <ToolbarListOrdered />
44
43
  {/if}
45
44
 
46
45
  {#if toolbarConfig && toolbarConfig.history && toolbarConfig.history.enabled}
47
- <ToolbarUndo {editor} />
48
- <ToolbarRedo {editor} />
46
+ <ToolbarUndo />
47
+ <ToolbarRedo />
49
48
  {/if}
@@ -4,10 +4,8 @@ type RichTextEditorToolbar = {
4
4
  $set?(props: Partial<$$ComponentProps>): void;
5
5
  };
6
6
  declare const RichTextEditorToolbar: import("svelte").Component<{
7
- editor: any;
8
7
  toolbarConfig: any;
9
8
  }, {}, "">;
10
9
  type $$ComponentProps = {
11
- editor: any;
12
10
  toolbarConfig: any;
13
11
  };
@@ -1,12 +1,19 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let active = $state(false);
6
+ let editor = $derived(getContext("richt-text-editor")());
7
+
8
+ $effect(() => {
9
+ if (!editor) return;
10
+ return editor.on("transaction", () => (active = editor.isActive("bold")));
11
+ });
5
12
  </script>
6
13
 
7
14
  {#if editor}
8
15
  <IconButton
9
- color={editor.isActive("bold") ? "default" : "transparent"}
16
+ color={active ? "default" : "transparent"}
10
17
  icon="bold"
11
18
  onclick={() => editor.chain().focus().toggleBold().run()}
12
19
  shape="square" />
@@ -1,11 +1,6 @@
1
1
  export default ToolbarBold;
2
2
  type ToolbarBold = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarBold: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarBold: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,9 +1,11 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { ColorSwatch } from "../../../../index.js";
3
4
 
4
- let { colors = [], defaultColor = "#121110", editor } = $props();
5
+ let { colors = [], defaultColor = "#121110" } = $props();
5
6
 
6
7
  let isOpen = $state(false);
8
+ let editor = $derived(getContext("richt-text-editor")());
7
9
  let selectedColor = $derived(defaultColor);
8
10
 
9
11
  const handleColorSelect = (color) => {
@@ -15,9 +17,10 @@
15
17
 
16
18
  $effect(() => {
17
19
  if (!editor) return;
18
-
19
- const attrs = editor.getAttributes("textStyle");
20
- selectedColor = attrs.color || defaultColor;
20
+ return editor.on("transaction", () => {
21
+ const attrs = editor.getAttributes("textStyle");
22
+ selectedColor = attrs.color || defaultColor;
23
+ });
21
24
  });
22
25
  </script>
23
26
 
@@ -6,10 +6,8 @@ type ToolbarColor = {
6
6
  declare const ToolbarColor: import("svelte").Component<{
7
7
  colors?: any[];
8
8
  defaultColor?: string;
9
- editor: any;
10
9
  }, {}, "">;
11
10
  type $$ComponentProps = {
12
11
  colors?: any[];
13
12
  defaultColor?: string;
14
- editor: any;
15
13
  };
@@ -1,12 +1,19 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let active = $state(false);
6
+ let editor = $derived(getContext("richt-text-editor")());
7
+
8
+ $effect(() => {
9
+ if (!editor) return;
10
+ return editor.on("transaction", () => (active = editor.isActive("italic")));
11
+ });
5
12
  </script>
6
13
 
7
14
  {#if editor}
8
15
  <IconButton
9
- color={editor.isActive("italic") ? "default" : "transparent"}
16
+ color={active ? "default" : "transparent"}
10
17
  icon="italic"
11
18
  onclick={() => editor.chain().focus().toggleItalic().run()}
12
19
  shape="square" />
@@ -1,11 +1,6 @@
1
1
  export default ToolbarItalic;
2
2
  type ToolbarItalic = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarItalic: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarItalic: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,7 +1,16 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor, onOpenLink } = $props();
5
+ let { onOpenLink } = $props();
6
+
7
+ let active = $state(false);
8
+ let editor = $derived(getContext("richt-text-editor")());
9
+
10
+ $effect(() => {
11
+ if (!editor) return;
12
+ return editor.on("transaction", () => (active = editor.isActive("link")));
13
+ });
5
14
 
6
15
  const setLink = () => {
7
16
  const focus = () => editor.chain().focus();
@@ -27,7 +36,7 @@
27
36
 
28
37
  {#if editor}
29
38
  <IconButton
30
- color={editor.isActive("link") ? "default" : "transparent"}
39
+ color={active ? "default" : "transparent"}
31
40
  icon="link"
32
41
  onclick={handleOpenLinkModal}
33
42
  shape="square" />
@@ -4,10 +4,8 @@ type ToolbarLink = {
4
4
  $set?(props: Partial<$$ComponentProps>): void;
5
5
  };
6
6
  declare const ToolbarLink: import("svelte").Component<{
7
- editor: any;
8
7
  onOpenLink: any;
9
8
  }, {}, "">;
10
9
  type $$ComponentProps = {
11
- editor: any;
12
10
  onOpenLink: any;
13
11
  };
@@ -1,12 +1,19 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let active = $state(false);
6
+ let editor = $derived(getContext("richt-text-editor")());
7
+
8
+ $effect(() => {
9
+ if (!editor) return;
10
+ return editor.on("transaction", () => (active = editor.isActive("bulletList")));
11
+ });
5
12
  </script>
6
13
 
7
14
  {#if editor}
8
15
  <IconButton
9
- color={editor.isActive("bulletList") ? "default" : "transparent"}
16
+ color={active ? "default" : "transparent"}
10
17
  icon="listUnordered"
11
18
  onclick={() => editor.chain().focus().toggleBulletList().run()}
12
19
  shape="square" />
@@ -1,11 +1,6 @@
1
1
  export default ToolbarList;
2
2
  type ToolbarList = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarList: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarList: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,12 +1,19 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let active = $state(false);
6
+ let editor = $derived(getContext("richt-text-editor")());
7
+
8
+ $effect(() => {
9
+ if (!editor) return;
10
+ return editor.on("transaction", () => (active = editor.isActive("orderedList")));
11
+ });
5
12
  </script>
6
13
 
7
14
  {#if editor}
8
15
  <IconButton
9
- color={editor.isActive("orderedList") ? "default" : "transparent"}
16
+ color={active ? "default" : "transparent"}
10
17
  icon="listOrdered"
11
18
  onclick={() => editor.chain().focus().toggleOrderedList().run()}
12
19
  shape="square" />
@@ -1,11 +1,6 @@
1
1
  export default ToolbarListOrdered;
2
2
  type ToolbarListOrdered = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarListOrdered: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarListOrdered: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,7 +1,8 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let editor = $derived(getContext("richt-text-editor")());
5
6
  </script>
6
7
 
7
8
  {#if editor}
@@ -1,11 +1,6 @@
1
1
  export default ToolbarRedo;
2
2
  type ToolbarRedo = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarRedo: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarRedo: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,12 +1,19 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let active = $state(false);
6
+ let editor = $derived(getContext("richt-text-editor")());
7
+
8
+ $effect(() => {
9
+ if (!editor) return;
10
+ return editor.on("transaction", () => (active = editor.isActive("underline")));
11
+ });
5
12
  </script>
6
13
 
7
14
  {#if editor}
8
15
  <IconButton
9
- color={editor.isActive("underline") ? "default" : "transparent"}
16
+ color={active ? "default" : "transparent"}
10
17
  icon="underline"
11
18
  onclick={() => editor.chain().focus().toggleUnderline().run()}
12
19
  shape="square" />
@@ -1,11 +1,6 @@
1
1
  export default ToolbarUnderline;
2
2
  type ToolbarUnderline = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarUnderline: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarUnderline: import("svelte").Component<Record<string, never>, {}, "">;
@@ -1,7 +1,8 @@
1
1
  <script>
2
+ import { getContext } from "svelte";
2
3
  import { IconButton } from "../../../../index.js";
3
4
 
4
- let { editor } = $props();
5
+ let editor = $derived(getContext("richt-text-editor")());
5
6
  </script>
6
7
 
7
8
  {#if editor}
@@ -1,11 +1,6 @@
1
1
  export default ToolbarUndo;
2
2
  type ToolbarUndo = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
6
- declare const ToolbarUndo: import("svelte").Component<{
7
- editor: any;
8
- }, {}, "">;
9
- type $$ComponentProps = {
10
- editor: any;
4
+ $set?(props: Partial<Record<string, never>>): void;
11
5
  };
6
+ declare const ToolbarUndo: import("svelte").Component<Record<string, never>, {}, "">;
@@ -31,7 +31,7 @@
31
31
  name,
32
32
  required = false,
33
33
  type = "radio",
34
- value = "",
34
+ value = "on",
35
35
  ...rest
36
36
  } = $props();
37
37
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { Chip } from "../../../index.js";
2
+ import { Tag } from "../../../index.js";
3
3
  import { tagSelectorVariants } from "./tagSelector.variants.js";
4
4
 
5
5
  let {
@@ -21,17 +21,13 @@
21
21
  <div class={styles.valueList()}>
22
22
  {#each value as s (s)}
23
23
  {@const opt = options.find((i) => i.id === s)}
24
- <Chip
25
- class={styles.item()}
26
- clickable
27
- icon="closeSmall"
28
- onclick={() => onRemoveItem(s)}>
24
+ <Tag class={styles.item()} icon="closeSmall" onclick={() => onRemoveItem(s)}>
29
25
  {opt?.label ?? s}
30
- </Chip>
26
+ </Tag>
31
27
  {/each}
32
28
 
33
29
  {#if !localValues.disabled}
34
- <Chip class={styles.searchField()} icon="add" variant="outline">
30
+ <Tag class={styles.searchField()} icon="add" variant="outline">
35
31
  <input
36
32
  bind:this={inputRef}
37
33
  bind:value={query}
@@ -47,6 +43,6 @@
47
43
  : {}}
48
44
  {placeholder}
49
45
  role="searchbox" />
50
- </Chip>
46
+ </Tag>
51
47
  {/if}
52
48
  </div>
@@ -13,6 +13,8 @@
13
13
  * @property {"default" | "raised"} [appearance="default"] The appearance variant of the component
14
14
  * @property {import('svelte').Snippet} [children] Children content – can be text, HTML, or other Svelte components
15
15
  * @property {string} [class=""] Additional CSS classes to apply to the component
16
+ * @property {boolean} [disabled=false] Whether the toggle group is disabled
17
+ * @property {string} [name] The name of the toggle group, used for form submission
16
18
  * @property {"small" | "medium"} [size="medium"] The size variant of the component
17
19
  * @property {string} [value=""] The value of the toggle group
18
20
  * @property {"default" | "tabs"} [variant="default"] The variant of the toggle group
@@ -28,6 +30,8 @@
28
30
  appearance = "default",
29
31
  children,
30
32
  class: className = "",
33
+ disabled = false,
34
+ name,
31
35
  size = "medium",
32
36
  value = $bindable(),
33
37
  variant = "default",
@@ -50,17 +54,31 @@
50
54
  };
51
55
  });
52
56
 
57
+ let inputProps = $derived({
58
+ disabled,
59
+ name,
60
+ value,
61
+ });
62
+
53
63
  let styles = $derived.by(() => {
54
64
  if (variant === "tabs") {
55
- return toggleGroupTabVariants();
65
+ return toggleGroupTabVariants({ disabled });
56
66
  }
57
67
 
58
- return toggleGroupVariants({ appearance, size, variant });
68
+ return toggleGroupVariants({ appearance, disabled, size, variant });
59
69
  });
60
70
  </script>
61
71
 
62
72
  <XScroll class={styles.base({ class: className })}>
63
- <div bind:this={toggleGroupEl} class={styles.tabs()} role="tablist" {...rest}>
73
+ <div
74
+ bind:this={toggleGroupEl}
75
+ class={styles.tabs()}
76
+ inert={disabled}
77
+ role="tablist"
78
+ {...rest}>
79
+ {#if name}
80
+ <input type="hidden" {...inputProps} />
81
+ {/if}
64
82
  {@render children?.()}
65
83
  </div>
66
84
  </XScroll>
@@ -16,6 +16,14 @@ declare const ToggleGroup: import("svelte").Component<{
16
16
  * Additional CSS classes to apply to the component
17
17
  */
18
18
  class?: string;
19
+ /**
20
+ * Whether the toggle group is disabled
21
+ */
22
+ disabled?: boolean;
23
+ /**
24
+ * The name of the toggle group, used for form submission
25
+ */
26
+ name?: string;
19
27
  /**
20
28
  * The size variant of the component
21
29
  */
@@ -42,6 +50,14 @@ type Props = {
42
50
  * Additional CSS classes to apply to the component
43
51
  */
44
52
  class?: string;
53
+ /**
54
+ * Whether the toggle group is disabled
55
+ */
56
+ disabled?: boolean;
57
+ /**
58
+ * The name of the toggle group, used for form submission
59
+ */
60
+ name?: string;
45
61
  /**
46
62
  * The size variant of the component
47
63
  */
@@ -45,15 +45,17 @@
45
45
  store.update(localeValue);
46
46
  }}
47
47
  type="button">
48
- <span class={stylesByVariant.span()}>
48
+ <div class={stylesByVariant.content()}>
49
49
  {#if icon}
50
50
  <Icon
51
51
  class={stylesByVariant.icon()}
52
52
  name={icon}
53
53
  size={variant === "tabs" || size === "small" ? 16 : 24} />
54
54
  {/if}
55
- {@render children?.()}
56
- </span>
55
+ <span class={stylesByVariant.span()}>
56
+ {@render children?.()}
57
+ </span>
58
+ </div>
57
59
  {#if isActive}
58
60
  <div
59
61
  class={stylesByVariant.trigger({ appearance })}
@@ -3,6 +3,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
3
3
  default: string;
4
4
  raised: string;
5
5
  };
6
+ disabled: {
7
+ true: {
8
+ base: string;
9
+ };
10
+ };
6
11
  size: {
7
12
  small: {
8
13
  tabs: string;
@@ -19,6 +24,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
19
24
  default: string;
20
25
  raised: string;
21
26
  };
27
+ disabled: {
28
+ true: {
29
+ base: string;
30
+ };
31
+ };
22
32
  size: {
23
33
  small: {
24
34
  tabs: string;
@@ -35,6 +45,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
35
45
  default: string;
36
46
  raised: string;
37
47
  };
48
+ disabled: {
49
+ true: {
50
+ base: string;
51
+ };
52
+ };
38
53
  size: {
39
54
  small: {
40
55
  tabs: string;
@@ -48,26 +63,30 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
48
63
  tabs: string;
49
64
  }, undefined, unknown, unknown, undefined>>;
50
65
  export const toggleGroupTabVariants: import("tailwind-variants").TVReturnType<{
51
- [key: string]: {
52
- [key: string]: import("tailwind-variants").ClassValue | {
53
- base?: import("tailwind-variants").ClassValue;
54
- tabs?: import("tailwind-variants").ClassValue;
55
- };
56
- };
57
- } | {
58
- [x: string]: {
59
- [x: string]: import("tailwind-variants").ClassValue | {
60
- base?: import("tailwind-variants").ClassValue;
61
- tabs?: import("tailwind-variants").ClassValue;
66
+ disabled: {
67
+ true: {
68
+ base: string;
62
69
  };
63
70
  };
64
71
  }, {
65
72
  base: string;
66
73
  tabs: string;
67
- }, undefined, any, {
74
+ }, undefined, {
75
+ disabled: {
76
+ true: {
77
+ base: string;
78
+ };
79
+ };
80
+ }, {
68
81
  base: string;
69
82
  tabs: string;
70
- }, import("tailwind-variants").TVReturnType<any, {
83
+ }, import("tailwind-variants").TVReturnType<{
84
+ disabled: {
85
+ true: {
86
+ base: string;
87
+ };
88
+ };
89
+ }, {
71
90
  base: string;
72
91
  tabs: string;
73
92
  }, undefined, unknown, unknown, undefined>>;
@@ -10,6 +10,11 @@ const toggleGroupVariants = tv({
10
10
  default: "text-neutral-100 dark:text-neutral-900",
11
11
  raised: "text-neutral-300 dark:text-neutral-700",
12
12
  },
13
+ disabled: {
14
+ true: {
15
+ base: "opacity-40",
16
+ },
17
+ },
13
18
  size: {
14
19
  small: {
15
20
  tabs: "h-9 p-1",
@@ -26,6 +31,13 @@ const toggleGroupTabVariants = tv({
26
31
  base: "",
27
32
  tabs: "flex h-9 gap-4 border-b border-neutral-300 dark:border-neutral-700",
28
33
  },
34
+ variants: {
35
+ disabled: {
36
+ true: {
37
+ base: "opacity-40",
38
+ },
39
+ },
40
+ },
29
41
  });
30
42
 
31
43
  export { toggleGroupVariants, toggleGroupTabVariants };