odj-svelte-ui 0.2.6 → 0.4.0

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 (145) hide show
  1. package/README.md +2 -0
  2. package/dist/_legacy/accordion/Accordion.svelte.d.ts +1 -1
  3. package/dist/_legacy/alert/Alert.svelte.d.ts +2 -2
  4. package/dist/_legacy/badge/Badge.svelte.d.ts +1 -1
  5. package/dist/_legacy/banner/Banner.svelte.d.ts +1 -1
  6. package/dist/_legacy/bottom-navigation/BottomNavHeaderItem.svelte.d.ts +1 -1
  7. package/dist/_legacy/bottom-navigation/BottomNavItem.svelte.d.ts +1 -1
  8. package/dist/_legacy/buttons/Button.svelte.d.ts +2 -2
  9. package/dist/_legacy/buttons/GradientButton.svelte.d.ts +1 -1
  10. package/dist/_legacy/cards/Card.svelte.d.ts +2 -2
  11. package/dist/_legacy/carousel/ControlButton.svelte.d.ts +1 -1
  12. package/dist/_legacy/dropdown/Dropdown.svelte.d.ts +1 -1
  13. package/dist/_legacy/dropdown/DropdownItem.svelte.d.ts +1 -1
  14. package/dist/_legacy/forms/Checkbox.svelte.d.ts +1 -1
  15. package/dist/_legacy/forms/Dropzone.svelte.d.ts +1 -1
  16. package/dist/_legacy/forms/Fileupload.svelte.d.ts +1 -1
  17. package/dist/_legacy/forms/FloatingLabelInput.svelte.d.ts +1 -1
  18. package/dist/_legacy/forms/Input.svelte.d.ts +2 -2
  19. package/dist/_legacy/forms/Label.svelte.d.ts +1 -1
  20. package/dist/_legacy/forms/MultiSelect.svelte.d.ts +1 -1
  21. package/dist/_legacy/forms/NumberInput.svelte.d.ts +2 -2
  22. package/dist/_legacy/forms/Radio.svelte.d.ts +1 -1
  23. package/dist/_legacy/forms/Range.svelte.d.ts +1 -1
  24. package/dist/_legacy/forms/Search.svelte.d.ts +1 -1
  25. package/dist/_legacy/forms/Select.svelte.d.ts +1 -1
  26. package/dist/_legacy/forms/Textarea.svelte.d.ts +2 -2
  27. package/dist/_legacy/forms/Toggle.svelte.d.ts +1 -1
  28. package/dist/_legacy/indicators/Indicator.svelte.d.ts +1 -1
  29. package/dist/_legacy/list-group/Listgroup.svelte.d.ts +1 -1
  30. package/dist/_legacy/list-group/ListgroupItem.svelte.d.ts +1 -1
  31. package/dist/_legacy/mega-menu/MegaMenu.svelte.d.ts +1 -1
  32. package/dist/_legacy/modal/Modal.svelte.d.ts +1 -1
  33. package/dist/_legacy/navbar/Menu.svelte.d.ts +1 -1
  34. package/dist/_legacy/navbar/NavHamburger.svelte.d.ts +1 -1
  35. package/dist/_legacy/navbar/NavLi.svelte.d.ts +1 -1
  36. package/dist/_legacy/navbar/NavUl.svelte.d.ts +1 -1
  37. package/dist/_legacy/navbar/Navbar.svelte.d.ts +1 -1
  38. package/dist/_legacy/pagination/Pagination.svelte.d.ts +1 -1
  39. package/dist/_legacy/pagination/PaginationItem.svelte.d.ts +1 -1
  40. package/dist/_legacy/popover/Popover.svelte.d.ts +1 -1
  41. package/dist/_legacy/rating/Heart.svelte.d.ts +1 -1
  42. package/dist/_legacy/rating/Star.svelte.d.ts +1 -1
  43. package/dist/_legacy/rating/Thumbup.svelte.d.ts +1 -1
  44. package/dist/_legacy/sidebar/SidebarDropdownItem.svelte.d.ts +1 -1
  45. package/dist/_legacy/sidebar/SidebarItem.svelte.d.ts +1 -1
  46. package/dist/_legacy/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
  47. package/dist/_legacy/table/TableBodyCell.svelte.d.ts +1 -1
  48. package/dist/_legacy/table/TableBodyRow.svelte.d.ts +2 -2
  49. package/dist/_legacy/table/TableHeadCell.svelte.d.ts +1 -1
  50. package/dist/_legacy/tabs/TabItem.svelte.d.ts +2 -2
  51. package/dist/_legacy/toast/Toast.svelte.d.ts +1 -1
  52. package/dist/_legacy/toolbar/Toolbar.svelte.d.ts +1 -1
  53. package/dist/_legacy/toolbar/ToolbarButton.svelte.d.ts +1 -1
  54. package/dist/_legacy/tooltip/Tooltip.svelte.d.ts +1 -1
  55. package/dist/_legacy/typography/A.svelte.d.ts +1 -1
  56. package/dist/_legacy/utils/CloseButton.svelte.d.ts +1 -1
  57. package/dist/_legacy/utils/Frame.svelte.d.ts +2 -2
  58. package/dist/_legacy/utils/Popper.svelte.d.ts +1 -1
  59. package/dist/_legacy/utils/createEventDispatcher.d.ts +1 -1
  60. package/dist/accordion/Accordion.svelte +3 -3
  61. package/dist/accordion/AccordionItem.svelte +22 -26
  62. package/dist/accordion/theme.d.ts +146 -90
  63. package/dist/accordion/theme.js +29 -37
  64. package/dist/accordion/type.d.ts +2 -2
  65. package/dist/alert/theme.d.ts +2 -2
  66. package/dist/avatar/theme.d.ts +4 -4
  67. package/dist/badge/theme.d.ts +2 -2
  68. package/dist/banner/theme.d.ts +2 -2
  69. package/dist/bottom-navigation/theme.d.ts +8 -8
  70. package/dist/breadcrumb/theme.d.ts +2 -2
  71. package/dist/buttongroup/theme.d.ts +2 -2
  72. package/dist/buttons/theme.d.ts +4 -4
  73. package/dist/cards/theme.d.ts +2 -2
  74. package/dist/darkmode/theme.d.ts +1 -1
  75. package/dist/device-mockups/theme.d.ts +14 -14
  76. package/dist/drawer/theme.d.ts +4 -4
  77. package/dist/dropdown/theme.d.ts +8 -8
  78. package/dist/footer/theme.d.ts +10 -10
  79. package/dist/forms/checkbox/theme.d.ts +2 -2
  80. package/dist/forms/dropzone/theme.d.ts +1 -1
  81. package/dist/forms/fileupload/theme.d.ts +2 -2
  82. package/dist/forms/floating-label-input/theme.d.ts +2 -2
  83. package/dist/forms/helper/theme.d.ts +2 -2
  84. package/dist/forms/helper/theme.js +2 -2
  85. package/dist/forms/input/theme.d.ts +2 -2
  86. package/dist/forms/input-addon/InputAddon.svelte +7 -7
  87. package/dist/forms/label/theme.d.ts +2 -2
  88. package/dist/forms/radio/Radio.svelte.d.ts +10 -3
  89. package/dist/forms/radio/theme.d.ts +2 -2
  90. package/dist/forms/radio-button/RadioButton.svelte.d.ts +10 -3
  91. package/dist/forms/radio-button/theme.d.ts +2 -2
  92. package/dist/forms/range/theme.d.ts +2 -2
  93. package/dist/forms/search/Search.svelte.d.ts +10 -3
  94. package/dist/forms/search/theme.d.ts +2 -2
  95. package/dist/forms/select/MultiSelect.svelte +31 -0
  96. package/dist/forms/select/MultiSelect.svelte.d.ts +26 -0
  97. package/dist/forms/select/Select.svelte +2 -2
  98. package/dist/forms/select/Select.svelte.d.ts +10 -3
  99. package/dist/forms/select/index.d.ts +3 -2
  100. package/dist/forms/select/index.js +3 -2
  101. package/dist/forms/select/theme.d.ts +71 -2
  102. package/dist/forms/select/theme.js +9 -0
  103. package/dist/forms/select/type.d.ts +8 -9
  104. package/dist/forms/textarea/theme.d.ts +2 -2
  105. package/dist/forms/toggle/theme.d.ts +2 -2
  106. package/dist/gallery/theme.d.ts +2 -2
  107. package/dist/indicator/theme.d.ts +2 -2
  108. package/dist/kbd/theme.d.ts +1 -1
  109. package/dist/list-group/theme.d.ts +4 -4
  110. package/dist/mega-menu/theme.d.ts +2 -2
  111. package/dist/modal/theme.d.ts +2 -2
  112. package/dist/nav/theme.d.ts +12 -12
  113. package/dist/pagination/theme.d.ts +4 -4
  114. package/dist/popover/theme.d.ts +2 -2
  115. package/dist/progress/ProgressRadial.svelte +155 -0
  116. package/dist/progress/ProgressRadial.svelte.d.ts +35 -0
  117. package/dist/progress/index.d.ts +4 -3
  118. package/dist/progress/index.js +3 -2
  119. package/dist/progress/theme.d.ts +713 -2
  120. package/dist/progress/theme.js +111 -1
  121. package/dist/progress/type.d.ts +23 -2
  122. package/dist/rating/theme.d.ts +8 -8
  123. package/dist/sidebar/theme.d.ts +10 -10
  124. package/dist/skeleton/theme.d.ts +16 -16
  125. package/dist/spinner/theme.d.ts +2 -2
  126. package/dist/table/theme.d.ts +8 -8
  127. package/dist/tabs/theme.d.ts +4 -4
  128. package/dist/timeline/theme.d.ts +11 -11
  129. package/dist/toast/theme.d.ts +2 -2
  130. package/dist/toolbar/theme.d.ts +6 -6
  131. package/dist/tooltip/theme.d.ts +2 -2
  132. package/dist/typography/anchor/theme.d.ts +2 -2
  133. package/dist/typography/blockquote/theme.d.ts +2 -2
  134. package/dist/typography/descriptionlist/theme.d.ts +2 -2
  135. package/dist/typography/heading/theme.d.ts +2 -2
  136. package/dist/typography/hr/theme.d.ts +2 -2
  137. package/dist/typography/img/theme.d.ts +2 -2
  138. package/dist/typography/layout/theme.d.ts +1 -1
  139. package/dist/typography/list/theme.d.ts +2 -2
  140. package/dist/typography/mark/theme.d.ts +1 -1
  141. package/dist/typography/paragraph/theme.d.ts +2 -2
  142. package/dist/typography/secondary/theme.d.ts +1 -1
  143. package/dist/typography/span/theme.d.ts +2 -2
  144. package/dist/utils/index.d.ts +2 -2
  145. package/package.json +642 -641
@@ -15,7 +15,7 @@ export declare const paginationItem: import("tailwind-variants").TVReturnType<{
15
15
  true: string;
16
16
  false: string;
17
17
  };
18
- }, undefined, "flex items-center font-medium w-full justify-center", import("tailwind-variants/dist/config").TVConfig<{
18
+ }, undefined, "flex items-center font-medium w-full justify-center", import("tailwind-variants/dist/config.js").TVConfig<{
19
19
  size: {
20
20
  default: string;
21
21
  large: string;
@@ -83,7 +83,7 @@ export declare const paginationItem: import("tailwind-variants").TVReturnType<{
83
83
  true: string;
84
84
  false: string;
85
85
  };
86
- }, undefined, "flex items-center font-medium w-full justify-center", import("tailwind-variants/dist/config").TVConfig<{
86
+ }, undefined, "flex items-center font-medium w-full justify-center", import("tailwind-variants/dist/config.js").TVConfig<{
87
87
  size: {
88
88
  default: string;
89
89
  large: string;
@@ -127,7 +127,7 @@ export declare const pagination: import("tailwind-variants").TVReturnType<{
127
127
  default: string;
128
128
  large: string;
129
129
  };
130
- }, undefined, "flex flex-row items-start -space-x-px rtl:space-x-reverse", import("tailwind-variants/dist/config").TVConfig<{
130
+ }, undefined, "flex flex-row items-start -space-x-px rtl:space-x-reverse", import("tailwind-variants/dist/config.js").TVConfig<{
131
131
  table: {
132
132
  true: string;
133
133
  false: string;
@@ -163,7 +163,7 @@ export declare const pagination: import("tailwind-variants").TVReturnType<{
163
163
  default: string;
164
164
  large: string;
165
165
  };
166
- }, undefined, "flex flex-row items-start -space-x-px rtl:space-x-reverse", import("tailwind-variants/dist/config").TVConfig<{
166
+ }, undefined, "flex flex-row items-start -space-x-px rtl:space-x-reverse", import("tailwind-variants/dist/config.js").TVConfig<{
167
167
  table: {
168
168
  true: string;
169
169
  false: string;
@@ -129,7 +129,7 @@ export declare const popover: import("tailwind-variants").TVReturnType<{
129
129
  title: string;
130
130
  h3: string;
131
131
  arrowBase: string;
132
- }, undefined, import("tailwind-variants/dist/config").TVConfig<{
132
+ }, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
133
133
  color: {
134
134
  default: {
135
135
  base: string;
@@ -643,7 +643,7 @@ export declare const popover: import("tailwind-variants").TVReturnType<{
643
643
  title: string;
644
644
  h3: string;
645
645
  arrowBase: string;
646
- }, undefined, import("tailwind-variants/dist/config").TVConfig<{
646
+ }, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
647
647
  color: {
648
648
  default: {
649
649
  base: string;
@@ -0,0 +1,155 @@
1
+ <script lang="ts">
2
+ import { cubicOut } from "svelte/easing";
3
+ import { Tween } from "svelte/motion";
4
+ import { twMerge } from "tailwind-merge";
5
+ import { progressRadial } from ".";
6
+ import type { ProgressRadialProps as Props } from ".";
7
+
8
+ let {
9
+ progress = 45,
10
+ radius = 42,
11
+ startingPosition = "top",
12
+ precision = 0,
13
+ tweenDuration = 400,
14
+ animate = false,
15
+ size = "h-24 w-24",
16
+ thickness = 4,
17
+ labelInside = false,
18
+ labelOutside = "",
19
+ easing = cubicOut,
20
+ color = "primary",
21
+
22
+ baseClass,
23
+ labelClass,
24
+ backgroundClass,
25
+ foregroundClass,
26
+ outsideClass,
27
+ spanClass,
28
+ progressClass,
29
+
30
+ class: className,
31
+ ...restProps
32
+ }: Props = $props();
33
+
34
+ const _progress = new Tween(0, {
35
+ duration: animate ? tweenDuration : 0,
36
+ easing
37
+ });
38
+
39
+ const { base, label, background, foreground, outside, span, progressCls } = $derived(
40
+ progressRadial({
41
+ color,
42
+ labelInside
43
+ })
44
+ );
45
+
46
+ $effect(() => {
47
+ _progress.set(Number(progress));
48
+ });
49
+
50
+ const circumference = $derived(2 * Math.PI * radius);
51
+
52
+ const strokeDashoffset = $derived(circumference - (_progress.current / 100) * circumference);
53
+
54
+ const rotationAngle = $derived(startingPosition === "top" ? -90 : startingPosition === "right" ? 0 : startingPosition === "bottom" ? 90 : startingPosition === "left" ? 180 : -90);
55
+
56
+ const formattedProgress = $derived(_progress.current.toFixed(precision));
57
+ </script>
58
+
59
+ <div class="flex flex-col items-center">
60
+ {#if labelOutside}
61
+ <div
62
+ class={outside({
63
+ class: outsideClass
64
+ })}
65
+ >
66
+ <span
67
+ class={span({
68
+ class: spanClass
69
+ })}
70
+ >
71
+ {labelOutside}
72
+ </span>
73
+
74
+ <span
75
+ class={progressCls({
76
+ class: progressClass
77
+ })}
78
+ >
79
+ {formattedProgress}%
80
+ </span>
81
+ </div>
82
+ {/if}
83
+
84
+ <div {...restProps} class={twMerge(base({ class: baseClass }), size, className?.toString())}>
85
+ <svg viewBox="0 0 100 100" class="h-full w-full" style="transform: rotate({rotationAngle}deg)">
86
+ <circle
87
+ cx="50"
88
+ cy="50"
89
+ r={radius}
90
+ fill="none"
91
+ stroke-width={thickness}
92
+ class={background({
93
+ class: backgroundClass
94
+ })}
95
+ />
96
+
97
+ <circle
98
+ cx="50"
99
+ cy="50"
100
+ r={radius}
101
+ fill="none"
102
+ stroke-width={thickness}
103
+ stroke-dasharray={circumference}
104
+ stroke-dashoffset={strokeDashoffset}
105
+ stroke-linecap="round"
106
+ class={foreground({
107
+ class: foregroundClass
108
+ })}
109
+ />
110
+ </svg>
111
+
112
+ {#if labelInside}
113
+ <div
114
+ class={label({
115
+ class: labelClass
116
+ })}
117
+ >
118
+ {formattedProgress}%
119
+ </div>
120
+ {/if}
121
+ </div>
122
+ </div>
123
+
124
+ <!--
125
+ @component
126
+ [Go to docs](https://svelte-5-ui-lib.codewithshin.com/)
127
+ ## Type
128
+ ProgressRadialProps
129
+
130
+ ## Props
131
+ @prop progress = 45
132
+ @prop radius = 42
133
+ @prop startingPosition = "top"
134
+ @prop precision = 0
135
+ @prop tweenDuration = 400
136
+ @prop animate = false
137
+ @prop size = "h-24 w-24"
138
+ @prop thickness = 4
139
+ @prop labelInside = false
140
+ @prop labelOutside = ""
141
+ @prop easing = cubicOut
142
+ @prop color = "primary"
143
+
144
+ ## Class overrides
145
+ @prop baseClass
146
+ @prop labelClass
147
+ @prop backgroundClass
148
+ @prop foregroundClass
149
+ @prop outsideClass
150
+ @prop spanClass
151
+ @prop progressClass
152
+
153
+ @prop class: className
154
+ @prop ...restProps
155
+ -->
@@ -0,0 +1,35 @@
1
+ import type { ProgressRadialProps as Props } from ".";
2
+ /**
3
+ * [Go to docs](https://svelte-5-ui-lib.codewithshin.com/)
4
+ * ## Type
5
+ * ProgressRadialProps
6
+ *
7
+ * ## Props
8
+ * @prop progress = 45
9
+ * @prop radius = 42
10
+ * @prop startingPosition = "top"
11
+ * @prop precision = 0
12
+ * @prop tweenDuration = 400
13
+ * @prop animate = false
14
+ * @prop size = "h-24 w-24"
15
+ * @prop thickness = 4
16
+ * @prop labelInside = false
17
+ * @prop labelOutside = ""
18
+ * @prop easing = cubicOut
19
+ * @prop color = "primary"
20
+ *
21
+ * ## Class overrides
22
+ * @prop baseClass
23
+ * @prop labelClass
24
+ * @prop backgroundClass
25
+ * @prop foregroundClass
26
+ * @prop outsideClass
27
+ * @prop spanClass
28
+ * @prop progressClass
29
+ *
30
+ * @prop class: className
31
+ * @prop ...restProps
32
+ */
33
+ declare const ProgressRadial: import("svelte").Component<Props, {}, "">;
34
+ type ProgressRadial = ReturnType<typeof ProgressRadial>;
35
+ export default ProgressRadial;
@@ -1,4 +1,5 @@
1
- import type { ProgressbarProps } from "./type";
1
+ import type { ProgressbarProps, ProgressRadialProps } from "./type";
2
2
  import Progressbar from "./Progressbar.svelte";
3
- import { progressbar } from "./theme";
4
- export { Progressbar, progressbar, type ProgressbarProps };
3
+ import ProgressRadial from "./ProgressRadial.svelte";
4
+ import { progressbar, progressRadial } from "./theme";
5
+ export { Progressbar, progressbar, ProgressRadial, progressRadial, type ProgressRadialProps, type ProgressbarProps };
@@ -1,3 +1,4 @@
1
1
  import Progressbar from "./Progressbar.svelte";
2
- import { progressbar } from "./theme";
3
- export { Progressbar, progressbar };
2
+ import ProgressRadial from "./ProgressRadial.svelte";
3
+ import { progressbar, progressRadial } from "./theme";
4
+ export { Progressbar, progressbar, ProgressRadial, progressRadial };