odj-svelte-ui 0.3.0 → 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.
@@ -22,7 +22,7 @@ export declare const helper: import("tailwind-variants").TVReturnType<{
22
22
  pink: string;
23
23
  rose: string;
24
24
  };
25
- }, undefined, "text-xs font-normal text-gray-500 dark:text-gray-300", import("tailwind-variants/dist/config.js").TVConfig<{
25
+ }, undefined, "text-xs font-normal text-light-surface-500 dark:text-dark-surface-300", import("tailwind-variants/dist/config.js").TVConfig<{
26
26
  color: {
27
27
  disabled: string;
28
28
  primary: string;
@@ -118,7 +118,7 @@ export declare const helper: import("tailwind-variants").TVReturnType<{
118
118
  pink: string;
119
119
  rose: string;
120
120
  };
121
- }, undefined, "text-xs font-normal text-gray-500 dark:text-gray-300", import("tailwind-variants/dist/config.js").TVConfig<{
121
+ }, undefined, "text-xs font-normal text-light-surface-500 dark:text-dark-surface-300", import("tailwind-variants/dist/config.js").TVConfig<{
122
122
  color: {
123
123
  disabled: string;
124
124
  primary: string;
@@ -1,9 +1,9 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const helper = tv({
3
- base: "text-xs font-normal text-gray-500 dark:text-gray-300",
3
+ base: "text-xs font-normal text-light-surface-500 dark:text-dark-surface-300",
4
4
  variants: {
5
5
  color: {
6
- disabled: "text-gray-400 dark:text-gray-500",
6
+ disabled: "text-light-surface-400 dark:text-dark-surface-500",
7
7
  primary: "text-primary-500 dark:text-primary-400",
8
8
  secondary: "text-secondary-500 dark:text-secondary-400",
9
9
  green: "text-green-500 dark:text-green-400",
@@ -8,12 +8,12 @@
8
8
 
9
9
  <select {...restProps} bind:value class={selectStyle}>
10
10
  {#if placeholder}
11
- <option disabled selected value="">{placeholder}</option>
11
+ <option disabled selected value={undefined}>{placeholder}</option>
12
12
  {/if}
13
13
 
14
14
  {#if items}
15
15
  {#each items as { value, name }}
16
- <option {value} class="text-dark-surface-950 dark:text-white required:invalid:text-dark-surface-400">{name}</option>
16
+ <option {value} class="text-dark-surface-950 required:invalid:text-dark-surface-400 dark:text-white">{name}</option>
17
17
  {/each}
18
18
  {/if}
19
19
 
@@ -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 };
@@ -4,6 +4,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
4
4
  labelInsideDiv: string;
5
5
  insideDiv: string;
6
6
  };
7
+ secondary: {
8
+ labelInsideDiv: string;
9
+ insideDiv: string;
10
+ };
11
+ surface: {
12
+ labelInsideDiv: string;
13
+ insideDiv: string;
14
+ };
7
15
  gray: {
8
16
  labelInsideDiv: string;
9
17
  insideDiv: string;
@@ -94,6 +102,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
94
102
  labelInsideDiv: string;
95
103
  insideDiv: string;
96
104
  };
105
+ secondary: {
106
+ labelInsideDiv: string;
107
+ insideDiv: string;
108
+ };
109
+ surface: {
110
+ labelInsideDiv: string;
111
+ insideDiv: string;
112
+ };
97
113
  gray: {
98
114
  labelInsideDiv: string;
99
115
  insideDiv: string;
@@ -177,6 +193,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
177
193
  labelInsideDiv: string;
178
194
  insideDiv: string;
179
195
  };
196
+ secondary: {
197
+ labelInsideDiv: string;
198
+ insideDiv: string;
199
+ };
200
+ surface: {
201
+ labelInsideDiv: string;
202
+ insideDiv: string;
203
+ };
180
204
  gray: {
181
205
  labelInsideDiv: string;
182
206
  insideDiv: string;
@@ -260,6 +284,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
260
284
  labelInsideDiv: string;
261
285
  insideDiv: string;
262
286
  };
287
+ secondary: {
288
+ labelInsideDiv: string;
289
+ insideDiv: string;
290
+ };
291
+ surface: {
292
+ labelInsideDiv: string;
293
+ insideDiv: string;
294
+ };
263
295
  gray: {
264
296
  labelInsideDiv: string;
265
297
  insideDiv: string;
@@ -350,6 +382,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
350
382
  labelInsideDiv: string;
351
383
  insideDiv: string;
352
384
  };
385
+ secondary: {
386
+ labelInsideDiv: string;
387
+ insideDiv: string;
388
+ };
389
+ surface: {
390
+ labelInsideDiv: string;
391
+ insideDiv: string;
392
+ };
353
393
  gray: {
354
394
  labelInsideDiv: string;
355
395
  insideDiv: string;
@@ -440,6 +480,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
440
480
  labelInsideDiv: string;
441
481
  insideDiv: string;
442
482
  };
483
+ secondary: {
484
+ labelInsideDiv: string;
485
+ insideDiv: string;
486
+ };
487
+ surface: {
488
+ labelInsideDiv: string;
489
+ insideDiv: string;
490
+ };
443
491
  gray: {
444
492
  labelInsideDiv: string;
445
493
  insideDiv: string;
@@ -523,6 +571,14 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
523
571
  labelInsideDiv: string;
524
572
  insideDiv: string;
525
573
  };
574
+ secondary: {
575
+ labelInsideDiv: string;
576
+ insideDiv: string;
577
+ };
578
+ surface: {
579
+ labelInsideDiv: string;
580
+ insideDiv: string;
581
+ };
526
582
  gray: {
527
583
  labelInsideDiv: string;
528
584
  insideDiv: string;
@@ -601,3 +657,658 @@ export declare const progressbar: import("tailwind-variants").TVReturnType<{
601
657
  false: string;
602
658
  };
603
659
  }>, unknown, unknown, undefined>>;
660
+ export declare const progressRadial: import("tailwind-variants").TVReturnType<{
661
+ color: {
662
+ primary: {
663
+ background: string;
664
+ foreground: string;
665
+ };
666
+ secondary: {
667
+ background: string;
668
+ foreground: string;
669
+ };
670
+ surface: {
671
+ background: string;
672
+ foreground: string;
673
+ };
674
+ gray: {
675
+ background: string;
676
+ foreground: string;
677
+ };
678
+ red: {
679
+ background: string;
680
+ foreground: string;
681
+ };
682
+ orange: {
683
+ background: string;
684
+ foreground: string;
685
+ };
686
+ amber: {
687
+ background: string;
688
+ foreground: string;
689
+ };
690
+ yellow: {
691
+ background: string;
692
+ foreground: string;
693
+ };
694
+ lime: {
695
+ background: string;
696
+ foreground: string;
697
+ };
698
+ green: {
699
+ background: string;
700
+ foreground: string;
701
+ };
702
+ emerald: {
703
+ background: string;
704
+ foreground: string;
705
+ };
706
+ teal: {
707
+ background: string;
708
+ foreground: string;
709
+ };
710
+ cyan: {
711
+ background: string;
712
+ foreground: string;
713
+ };
714
+ sky: {
715
+ background: string;
716
+ foreground: string;
717
+ };
718
+ blue: {
719
+ background: string;
720
+ foreground: string;
721
+ };
722
+ indigo: {
723
+ background: string;
724
+ foreground: string;
725
+ };
726
+ violet: {
727
+ background: string;
728
+ foreground: string;
729
+ };
730
+ purple: {
731
+ background: string;
732
+ foreground: string;
733
+ };
734
+ fuchsia: {
735
+ background: string;
736
+ foreground: string;
737
+ };
738
+ pink: {
739
+ background: string;
740
+ foreground: string;
741
+ };
742
+ rose: {
743
+ background: string;
744
+ foreground: string;
745
+ };
746
+ };
747
+ labelInside: {
748
+ true: {};
749
+ };
750
+ }, {
751
+ base: string;
752
+ label: string;
753
+ background: string;
754
+ foreground: string;
755
+ outside: string;
756
+ span: string;
757
+ progressCls: string;
758
+ }, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
759
+ color: {
760
+ primary: {
761
+ background: string;
762
+ foreground: string;
763
+ };
764
+ secondary: {
765
+ background: string;
766
+ foreground: string;
767
+ };
768
+ surface: {
769
+ background: string;
770
+ foreground: string;
771
+ };
772
+ gray: {
773
+ background: string;
774
+ foreground: string;
775
+ };
776
+ red: {
777
+ background: string;
778
+ foreground: string;
779
+ };
780
+ orange: {
781
+ background: string;
782
+ foreground: string;
783
+ };
784
+ amber: {
785
+ background: string;
786
+ foreground: string;
787
+ };
788
+ yellow: {
789
+ background: string;
790
+ foreground: string;
791
+ };
792
+ lime: {
793
+ background: string;
794
+ foreground: string;
795
+ };
796
+ green: {
797
+ background: string;
798
+ foreground: string;
799
+ };
800
+ emerald: {
801
+ background: string;
802
+ foreground: string;
803
+ };
804
+ teal: {
805
+ background: string;
806
+ foreground: string;
807
+ };
808
+ cyan: {
809
+ background: string;
810
+ foreground: string;
811
+ };
812
+ sky: {
813
+ background: string;
814
+ foreground: string;
815
+ };
816
+ blue: {
817
+ background: string;
818
+ foreground: string;
819
+ };
820
+ indigo: {
821
+ background: string;
822
+ foreground: string;
823
+ };
824
+ violet: {
825
+ background: string;
826
+ foreground: string;
827
+ };
828
+ purple: {
829
+ background: string;
830
+ foreground: string;
831
+ };
832
+ fuchsia: {
833
+ background: string;
834
+ foreground: string;
835
+ };
836
+ pink: {
837
+ background: string;
838
+ foreground: string;
839
+ };
840
+ rose: {
841
+ background: string;
842
+ foreground: string;
843
+ };
844
+ };
845
+ labelInside: {
846
+ true: {};
847
+ };
848
+ }, {
849
+ color: {
850
+ primary: {
851
+ background: string;
852
+ foreground: string;
853
+ };
854
+ secondary: {
855
+ background: string;
856
+ foreground: string;
857
+ };
858
+ surface: {
859
+ background: string;
860
+ foreground: string;
861
+ };
862
+ gray: {
863
+ background: string;
864
+ foreground: string;
865
+ };
866
+ red: {
867
+ background: string;
868
+ foreground: string;
869
+ };
870
+ orange: {
871
+ background: string;
872
+ foreground: string;
873
+ };
874
+ amber: {
875
+ background: string;
876
+ foreground: string;
877
+ };
878
+ yellow: {
879
+ background: string;
880
+ foreground: string;
881
+ };
882
+ lime: {
883
+ background: string;
884
+ foreground: string;
885
+ };
886
+ green: {
887
+ background: string;
888
+ foreground: string;
889
+ };
890
+ emerald: {
891
+ background: string;
892
+ foreground: string;
893
+ };
894
+ teal: {
895
+ background: string;
896
+ foreground: string;
897
+ };
898
+ cyan: {
899
+ background: string;
900
+ foreground: string;
901
+ };
902
+ sky: {
903
+ background: string;
904
+ foreground: string;
905
+ };
906
+ blue: {
907
+ background: string;
908
+ foreground: string;
909
+ };
910
+ indigo: {
911
+ background: string;
912
+ foreground: string;
913
+ };
914
+ violet: {
915
+ background: string;
916
+ foreground: string;
917
+ };
918
+ purple: {
919
+ background: string;
920
+ foreground: string;
921
+ };
922
+ fuchsia: {
923
+ background: string;
924
+ foreground: string;
925
+ };
926
+ pink: {
927
+ background: string;
928
+ foreground: string;
929
+ };
930
+ rose: {
931
+ background: string;
932
+ foreground: string;
933
+ };
934
+ };
935
+ labelInside: {
936
+ true: {};
937
+ };
938
+ }>, {
939
+ color: {
940
+ primary: {
941
+ background: string;
942
+ foreground: string;
943
+ };
944
+ secondary: {
945
+ background: string;
946
+ foreground: string;
947
+ };
948
+ surface: {
949
+ background: string;
950
+ foreground: string;
951
+ };
952
+ gray: {
953
+ background: string;
954
+ foreground: string;
955
+ };
956
+ red: {
957
+ background: string;
958
+ foreground: string;
959
+ };
960
+ orange: {
961
+ background: string;
962
+ foreground: string;
963
+ };
964
+ amber: {
965
+ background: string;
966
+ foreground: string;
967
+ };
968
+ yellow: {
969
+ background: string;
970
+ foreground: string;
971
+ };
972
+ lime: {
973
+ background: string;
974
+ foreground: string;
975
+ };
976
+ green: {
977
+ background: string;
978
+ foreground: string;
979
+ };
980
+ emerald: {
981
+ background: string;
982
+ foreground: string;
983
+ };
984
+ teal: {
985
+ background: string;
986
+ foreground: string;
987
+ };
988
+ cyan: {
989
+ background: string;
990
+ foreground: string;
991
+ };
992
+ sky: {
993
+ background: string;
994
+ foreground: string;
995
+ };
996
+ blue: {
997
+ background: string;
998
+ foreground: string;
999
+ };
1000
+ indigo: {
1001
+ background: string;
1002
+ foreground: string;
1003
+ };
1004
+ violet: {
1005
+ background: string;
1006
+ foreground: string;
1007
+ };
1008
+ purple: {
1009
+ background: string;
1010
+ foreground: string;
1011
+ };
1012
+ fuchsia: {
1013
+ background: string;
1014
+ foreground: string;
1015
+ };
1016
+ pink: {
1017
+ background: string;
1018
+ foreground: string;
1019
+ };
1020
+ rose: {
1021
+ background: string;
1022
+ foreground: string;
1023
+ };
1024
+ };
1025
+ labelInside: {
1026
+ true: {};
1027
+ };
1028
+ }, {
1029
+ base: string;
1030
+ label: string;
1031
+ background: string;
1032
+ foreground: string;
1033
+ outside: string;
1034
+ span: string;
1035
+ progressCls: string;
1036
+ }, import("tailwind-variants").TVReturnType<{
1037
+ color: {
1038
+ primary: {
1039
+ background: string;
1040
+ foreground: string;
1041
+ };
1042
+ secondary: {
1043
+ background: string;
1044
+ foreground: string;
1045
+ };
1046
+ surface: {
1047
+ background: string;
1048
+ foreground: string;
1049
+ };
1050
+ gray: {
1051
+ background: string;
1052
+ foreground: string;
1053
+ };
1054
+ red: {
1055
+ background: string;
1056
+ foreground: string;
1057
+ };
1058
+ orange: {
1059
+ background: string;
1060
+ foreground: string;
1061
+ };
1062
+ amber: {
1063
+ background: string;
1064
+ foreground: string;
1065
+ };
1066
+ yellow: {
1067
+ background: string;
1068
+ foreground: string;
1069
+ };
1070
+ lime: {
1071
+ background: string;
1072
+ foreground: string;
1073
+ };
1074
+ green: {
1075
+ background: string;
1076
+ foreground: string;
1077
+ };
1078
+ emerald: {
1079
+ background: string;
1080
+ foreground: string;
1081
+ };
1082
+ teal: {
1083
+ background: string;
1084
+ foreground: string;
1085
+ };
1086
+ cyan: {
1087
+ background: string;
1088
+ foreground: string;
1089
+ };
1090
+ sky: {
1091
+ background: string;
1092
+ foreground: string;
1093
+ };
1094
+ blue: {
1095
+ background: string;
1096
+ foreground: string;
1097
+ };
1098
+ indigo: {
1099
+ background: string;
1100
+ foreground: string;
1101
+ };
1102
+ violet: {
1103
+ background: string;
1104
+ foreground: string;
1105
+ };
1106
+ purple: {
1107
+ background: string;
1108
+ foreground: string;
1109
+ };
1110
+ fuchsia: {
1111
+ background: string;
1112
+ foreground: string;
1113
+ };
1114
+ pink: {
1115
+ background: string;
1116
+ foreground: string;
1117
+ };
1118
+ rose: {
1119
+ background: string;
1120
+ foreground: string;
1121
+ };
1122
+ };
1123
+ labelInside: {
1124
+ true: {};
1125
+ };
1126
+ }, {
1127
+ base: string;
1128
+ label: string;
1129
+ background: string;
1130
+ foreground: string;
1131
+ outside: string;
1132
+ span: string;
1133
+ progressCls: string;
1134
+ }, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
1135
+ color: {
1136
+ primary: {
1137
+ background: string;
1138
+ foreground: string;
1139
+ };
1140
+ secondary: {
1141
+ background: string;
1142
+ foreground: string;
1143
+ };
1144
+ surface: {
1145
+ background: string;
1146
+ foreground: string;
1147
+ };
1148
+ gray: {
1149
+ background: string;
1150
+ foreground: string;
1151
+ };
1152
+ red: {
1153
+ background: string;
1154
+ foreground: string;
1155
+ };
1156
+ orange: {
1157
+ background: string;
1158
+ foreground: string;
1159
+ };
1160
+ amber: {
1161
+ background: string;
1162
+ foreground: string;
1163
+ };
1164
+ yellow: {
1165
+ background: string;
1166
+ foreground: string;
1167
+ };
1168
+ lime: {
1169
+ background: string;
1170
+ foreground: string;
1171
+ };
1172
+ green: {
1173
+ background: string;
1174
+ foreground: string;
1175
+ };
1176
+ emerald: {
1177
+ background: string;
1178
+ foreground: string;
1179
+ };
1180
+ teal: {
1181
+ background: string;
1182
+ foreground: string;
1183
+ };
1184
+ cyan: {
1185
+ background: string;
1186
+ foreground: string;
1187
+ };
1188
+ sky: {
1189
+ background: string;
1190
+ foreground: string;
1191
+ };
1192
+ blue: {
1193
+ background: string;
1194
+ foreground: string;
1195
+ };
1196
+ indigo: {
1197
+ background: string;
1198
+ foreground: string;
1199
+ };
1200
+ violet: {
1201
+ background: string;
1202
+ foreground: string;
1203
+ };
1204
+ purple: {
1205
+ background: string;
1206
+ foreground: string;
1207
+ };
1208
+ fuchsia: {
1209
+ background: string;
1210
+ foreground: string;
1211
+ };
1212
+ pink: {
1213
+ background: string;
1214
+ foreground: string;
1215
+ };
1216
+ rose: {
1217
+ background: string;
1218
+ foreground: string;
1219
+ };
1220
+ };
1221
+ labelInside: {
1222
+ true: {};
1223
+ };
1224
+ }, {
1225
+ color: {
1226
+ primary: {
1227
+ background: string;
1228
+ foreground: string;
1229
+ };
1230
+ secondary: {
1231
+ background: string;
1232
+ foreground: string;
1233
+ };
1234
+ surface: {
1235
+ background: string;
1236
+ foreground: string;
1237
+ };
1238
+ gray: {
1239
+ background: string;
1240
+ foreground: string;
1241
+ };
1242
+ red: {
1243
+ background: string;
1244
+ foreground: string;
1245
+ };
1246
+ orange: {
1247
+ background: string;
1248
+ foreground: string;
1249
+ };
1250
+ amber: {
1251
+ background: string;
1252
+ foreground: string;
1253
+ };
1254
+ yellow: {
1255
+ background: string;
1256
+ foreground: string;
1257
+ };
1258
+ lime: {
1259
+ background: string;
1260
+ foreground: string;
1261
+ };
1262
+ green: {
1263
+ background: string;
1264
+ foreground: string;
1265
+ };
1266
+ emerald: {
1267
+ background: string;
1268
+ foreground: string;
1269
+ };
1270
+ teal: {
1271
+ background: string;
1272
+ foreground: string;
1273
+ };
1274
+ cyan: {
1275
+ background: string;
1276
+ foreground: string;
1277
+ };
1278
+ sky: {
1279
+ background: string;
1280
+ foreground: string;
1281
+ };
1282
+ blue: {
1283
+ background: string;
1284
+ foreground: string;
1285
+ };
1286
+ indigo: {
1287
+ background: string;
1288
+ foreground: string;
1289
+ };
1290
+ violet: {
1291
+ background: string;
1292
+ foreground: string;
1293
+ };
1294
+ purple: {
1295
+ background: string;
1296
+ foreground: string;
1297
+ };
1298
+ fuchsia: {
1299
+ background: string;
1300
+ foreground: string;
1301
+ };
1302
+ pink: {
1303
+ background: string;
1304
+ foreground: string;
1305
+ };
1306
+ rose: {
1307
+ background: string;
1308
+ foreground: string;
1309
+ };
1310
+ };
1311
+ labelInside: {
1312
+ true: {};
1313
+ };
1314
+ }>, unknown, unknown, undefined>>;
@@ -1,7 +1,7 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const progressbar = tv({
3
3
  slots: {
4
- base: "w-full bg-gray-200 rounded-full dark:bg-gray-700",
4
+ base: "w-full bg-light-surface-200 rounded-full dark:bg-dark-surface-700",
5
5
  labelInsideDiv: "text-primary-100 text-xs font-medium text-center leading-none rounded-full",
6
6
  insideDiv: "rounded-full",
7
7
  outsideDiv: "mb-1 flex justify-between",
@@ -15,6 +15,14 @@ export const progressbar = tv({
15
15
  labelInsideDiv: "bg-primary-600",
16
16
  insideDiv: "bg-primary-600"
17
17
  },
18
+ secondary: {
19
+ labelInsideDiv: "bg-secondary-600",
20
+ insideDiv: "bg-secondary-600"
21
+ },
22
+ surface: {
23
+ labelInsideDiv: "bg-light-surface-600 dark:bg-dark-surface-300",
24
+ insideDiv: "bg-light-surface-600 dark:bg-dark-surface-300"
25
+ },
18
26
  gray: {
19
27
  labelInsideDiv: "bg-gray-600 dark:bg-gray-300",
20
28
  insideDiv: "bg-gray-600 dark:bg-gray-300"
@@ -111,3 +119,105 @@ export const progressbar = tv({
111
119
  labelInside: false
112
120
  }
113
121
  });
122
+ export const progressRadial = tv({
123
+ slots: {
124
+ base: "relative inline-flex",
125
+ label: "absolute inset-0 flex items-center justify-center text-sm font-medium",
126
+ background: "opacity-25",
127
+ foreground: "transition-all",
128
+ outside: "flex flex-col items-center mb-2 text-center",
129
+ span: "text-base font-medium",
130
+ progressCls: "text-sm font-medium ml-1"
131
+ },
132
+ variants: {
133
+ color: {
134
+ primary: {
135
+ background: "stroke-primary-600",
136
+ foreground: "stroke-primary-600"
137
+ },
138
+ secondary: {
139
+ background: "stroke-secondary-600",
140
+ foreground: "stroke-secondary-600"
141
+ },
142
+ surface: {
143
+ background: "stroke-light-surface-600 dark:stroke-dark-surface-300",
144
+ foreground: "stroke-light-surface-600 dark:stroke-dark-surface-300"
145
+ },
146
+ gray: {
147
+ background: "stroke-gray-600 dark:stroke-gray-300",
148
+ foreground: "stroke-gray-600 dark:stroke-gray-300"
149
+ },
150
+ red: {
151
+ background: "stroke-red-600 dark:stroke-red-500",
152
+ foreground: "stroke-red-600 dark:stroke-red-500"
153
+ },
154
+ orange: {
155
+ background: "stroke-orange-600 dark:stroke-orange-500",
156
+ foreground: "stroke-orange-600 dark:stroke-orange-500"
157
+ },
158
+ amber: {
159
+ background: "stroke-amber-600 dark:stroke-amber-500",
160
+ foreground: "stroke-amber-600 dark:stroke-amber-500"
161
+ },
162
+ yellow: {
163
+ background: "stroke-yellow-400",
164
+ foreground: "stroke-yellow-400"
165
+ },
166
+ lime: {
167
+ background: "stroke-lime-600 dark:stroke-lime-500",
168
+ foreground: "stroke-lime-600 dark:stroke-lime-500"
169
+ },
170
+ green: {
171
+ background: "stroke-green-600 dark:stroke-green-500",
172
+ foreground: "stroke-green-600 dark:stroke-green-500"
173
+ },
174
+ emerald: {
175
+ background: "stroke-emerald-600 dark:stroke-emerald-500",
176
+ foreground: "stroke-emerald-600 dark:stroke-emerald-500"
177
+ },
178
+ teal: {
179
+ background: "stroke-teal-600 dark:stroke-teal-500",
180
+ foreground: "stroke-teal-600 dark:stroke-teal-500"
181
+ },
182
+ cyan: {
183
+ background: "stroke-cyan-600 dark:stroke-cyan-500",
184
+ foreground: "stroke-cyan-600 dark:stroke-cyan-500"
185
+ },
186
+ sky: {
187
+ background: "stroke-sky-600 dark:stroke-sky-500",
188
+ foreground: "stroke-sky-600 dark:stroke-sky-500"
189
+ },
190
+ blue: {
191
+ background: "stroke-blue-600",
192
+ foreground: "stroke-blue-600"
193
+ },
194
+ indigo: {
195
+ background: "stroke-indigo-600 dark:stroke-indigo-500",
196
+ foreground: "stroke-indigo-600 dark:stroke-indigo-500"
197
+ },
198
+ violet: {
199
+ background: "stroke-violet-600 dark:stroke-violet-500",
200
+ foreground: "stroke-violet-600 dark:stroke-violet-500"
201
+ },
202
+ purple: {
203
+ background: "stroke-purple-600 dark:stroke-purple-500",
204
+ foreground: "stroke-purple-600 dark:stroke-purple-500"
205
+ },
206
+ fuchsia: {
207
+ background: "stroke-fuchsia-600 dark:stroke-fuchsia-500",
208
+ foreground: "stroke-fuchsia-600 dark:stroke-fuchsia-500"
209
+ },
210
+ pink: {
211
+ background: "stroke-pink-600 dark:stroke-pink-500",
212
+ foreground: "stroke-pink-600 dark:stroke-pink-500"
213
+ },
214
+ rose: {
215
+ background: "stroke-rose-600 dark:stroke-rose-500",
216
+ foreground: "stroke-rose-600 dark:stroke-rose-500"
217
+ }
218
+ },
219
+ labelInside: {
220
+ true: {}
221
+ }
222
+ }
223
+ });
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
2
  import type { EasingFunction } from "svelte/transition";
3
- type ColorType = "primary" | "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined;
3
+ type ColorType = "primary" | "secondary" | "surface" | "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined;
4
4
  interface ProgressbarProps extends HTMLAttributes<HTMLDivElement> {
5
5
  progress?: string | number;
6
6
  precision?: number;
@@ -17,4 +17,25 @@ interface ProgressbarProps extends HTMLAttributes<HTMLDivElement> {
17
17
  labeloutsidedivClass?: string;
18
18
  divClass?: string;
19
19
  }
20
- export { type ProgressbarProps };
20
+ interface ProgressRadialProps extends HTMLAttributes<HTMLDivElement> {
21
+ progress?: string | number;
22
+ precision?: number;
23
+ tweenDuration?: number;
24
+ animate?: boolean;
25
+ size?: string;
26
+ radius?: number;
27
+ thickness?: number;
28
+ startingPosition?: "top" | "right" | "bottom" | "left";
29
+ labelInside?: boolean;
30
+ labelOutside?: string;
31
+ easing?: EasingFunction;
32
+ color?: ColorType;
33
+ baseClass?: string;
34
+ labelClass?: string;
35
+ backgroundClass?: string;
36
+ foregroundClass?: string;
37
+ outsideClass?: string;
38
+ spanClass?: string;
39
+ progressClass?: string;
40
+ }
41
+ export { type ProgressbarProps, type ProgressRadialProps };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "odj-svelte-ui",
3
3
  "author": "orbitadajogatina",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "This is a fork from Flowbite Svelte 5 with Runes. I just made some changes that fits better my taste.",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",