ui-svelte 0.2.12 → 0.2.14

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 (98) hide show
  1. package/README.md +2 -2
  2. package/dist/charts/ArcChart.svelte +0 -1
  3. package/dist/control/Fab.svelte +103 -0
  4. package/dist/control/Fab.svelte.d.ts +25 -0
  5. package/dist/control/Record.svelte +0 -3
  6. package/dist/control/ToggleTheme.svelte +1 -1
  7. package/dist/control/Video.svelte +2 -0
  8. package/dist/control/css/btn.css +17 -17
  9. package/dist/control/css/fab.css +84 -0
  10. package/dist/control/css/media.css +7 -7
  11. package/dist/control/css/toggle-group.css +1 -17
  12. package/dist/css/decorations.css +348 -189
  13. package/dist/css/utilities.css +0 -4
  14. package/dist/display/Accordion.svelte +3 -3
  15. package/dist/display/Accordion.svelte.d.ts +1 -1
  16. package/dist/display/Card.svelte +3 -3
  17. package/dist/display/Card.svelte.d.ts +1 -1
  18. package/dist/display/Code.svelte +1 -1
  19. package/dist/display/Collapsible.svelte +3 -3
  20. package/dist/display/Collapsible.svelte.d.ts +1 -1
  21. package/dist/display/Countdown.svelte +169 -0
  22. package/dist/display/Countdown.svelte.d.ts +21 -0
  23. package/dist/display/Item.svelte +12 -0
  24. package/dist/display/Item.svelte.d.ts +2 -0
  25. package/dist/display/Marquee.svelte +0 -2
  26. package/dist/display/Section.svelte +3 -3
  27. package/dist/display/Section.svelte.d.ts +1 -1
  28. package/dist/display/css/accordion.css +14 -14
  29. package/dist/display/css/alert.css +42 -15
  30. package/dist/display/css/avatar.css +36 -36
  31. package/dist/display/css/card.css +108 -36
  32. package/dist/display/css/chip.css +16 -16
  33. package/dist/display/css/collapsible.css +32 -32
  34. package/dist/display/css/countdown.css +206 -0
  35. package/dist/display/css/item.css +24 -0
  36. package/dist/display/css/marquee.css +0 -3
  37. package/dist/display/css/section.css +88 -109
  38. package/dist/display/css/table.css +1 -16
  39. package/dist/form/ColorField.svelte +60 -2
  40. package/dist/form/DragDrop.svelte +317 -87
  41. package/dist/form/DragDrop.svelte.d.ts +1 -0
  42. package/dist/form/Dropzone.svelte +3 -3
  43. package/dist/form/Dropzone.svelte.d.ts +1 -1
  44. package/dist/form/ImageCropper.svelte +135 -4
  45. package/dist/form/RadioGroup.svelte +6 -2
  46. package/dist/form/RadioGroup.svelte.d.ts +1 -1
  47. package/dist/form/Slider.svelte +6 -2
  48. package/dist/form/Slider.svelte.d.ts +1 -1
  49. package/dist/form/TextField.svelte +13 -4
  50. package/dist/form/TextField.svelte.d.ts +3 -2
  51. package/dist/form/Toggle.svelte +6 -2
  52. package/dist/form/Toggle.svelte.d.ts +1 -1
  53. package/dist/form/css/control.css +14 -14
  54. package/dist/form/css/csv-field.css +8 -13
  55. package/dist/form/css/drag-drop.css +90 -127
  56. package/dist/form/css/dropzone.css +8 -8
  57. package/dist/form/css/editor.css +14 -14
  58. package/dist/form/css/image-cropper.css +28 -7
  59. package/dist/form/css/radio-group.css +25 -0
  60. package/dist/form/css/slider.css +36 -0
  61. package/dist/form/css/textarea.css +14 -14
  62. package/dist/form/css/toggle.css +12 -0
  63. package/dist/hooks/use-chat.svelte.js +1 -1
  64. package/dist/hooks/use-form.svelte.js +3 -3
  65. package/dist/hooks/use-search.svelte.js +0 -3
  66. package/dist/icons/index.d.ts +4 -0
  67. package/dist/icons/index.js +4 -0
  68. package/dist/index.css +28 -48
  69. package/dist/index.d.ts +4 -2
  70. package/dist/index.js +3 -1
  71. package/dist/layout/Provider.svelte +5 -5
  72. package/dist/layout/Sidebar.svelte +17 -8
  73. package/dist/layout/Sidebar.svelte.d.ts +2 -1
  74. package/dist/layout/css/app-bar.css +8 -7
  75. package/dist/layout/css/footer.css +7 -7
  76. package/dist/layout/css/sidebar.css +120 -59
  77. package/dist/navigation/BottomNav.svelte +23 -14
  78. package/dist/navigation/css/bottom-nav.css +74 -34
  79. package/dist/navigation/css/nav-menu.css +14 -15
  80. package/dist/navigation/css/side-nav.css +14 -15
  81. package/dist/overlay/AlertDialog.svelte +58 -0
  82. package/dist/overlay/AlertDialog.svelte.d.ts +14 -25
  83. package/dist/overlay/Command.svelte +177 -170
  84. package/dist/overlay/Command.svelte.d.ts +12 -3
  85. package/dist/overlay/Drawer.svelte +4 -4
  86. package/dist/overlay/Drawer.svelte.d.ts +1 -1
  87. package/dist/overlay/Modal.svelte +4 -4
  88. package/dist/overlay/Modal.svelte.d.ts +1 -1
  89. package/dist/overlay/Tooltip.svelte +0 -5
  90. package/dist/overlay/css/command.css +30 -42
  91. package/dist/overlay/css/drawer.css +10 -10
  92. package/dist/overlay/css/modal.css +70 -18
  93. package/dist/overlay/css/toast.css +42 -14
  94. package/dist/overlay/css/tooltip.css +49 -23
  95. package/dist/stores/theme.svelte.js +19 -12
  96. package/package.json +3 -2
  97. package/dist/utils/charts.d.ts +0 -27
  98. package/dist/utils/charts.js +0 -140
@@ -0,0 +1,206 @@
1
+ @layer components {
2
+ .countdown {
3
+ @apply flex items-center justify-center gap-2;
4
+ @apply font-bold tabular-nums;
5
+ }
6
+
7
+ .countdown-unit {
8
+ @apply flex flex-col items-center gap-1;
9
+ }
10
+
11
+ .countdown-box {
12
+ @apply flex items-center justify-center rounded-ui;
13
+ @apply transition-all duration-300;
14
+ }
15
+
16
+ .countdown-digit {
17
+ @apply font-bold tracking-tight;
18
+ }
19
+
20
+ .countdown-label {
21
+ @apply text-xs font-medium uppercase tracking-wider opacity-70;
22
+ }
23
+
24
+ .countdown-separator {
25
+ @apply font-bold opacity-50;
26
+ @apply self-start;
27
+ }
28
+
29
+ .countdown {
30
+ &.is-sm {
31
+ @apply gap-1;
32
+
33
+ .countdown-box {
34
+ @apply h-10 w-12 text-xl;
35
+ }
36
+
37
+ .countdown-separator {
38
+ @apply text-xl mt-2;
39
+ }
40
+
41
+ .countdown-label {
42
+ @apply text-[10px];
43
+ }
44
+ }
45
+
46
+ &.is-md {
47
+ @apply gap-2;
48
+
49
+ .countdown-box {
50
+ @apply h-14 w-16 text-3xl;
51
+ }
52
+
53
+ .countdown-separator {
54
+ @apply text-3xl mt-3;
55
+ }
56
+
57
+ .countdown-label {
58
+ @apply text-xs;
59
+ }
60
+ }
61
+
62
+ &.is-lg {
63
+ @apply gap-3;
64
+
65
+ .countdown-box {
66
+ @apply h-20 w-24 text-5xl;
67
+ }
68
+
69
+ .countdown-separator {
70
+ @apply text-5xl mt-5;
71
+ }
72
+
73
+ .countdown-label {
74
+ @apply text-sm;
75
+ }
76
+ }
77
+
78
+ &.is-xl {
79
+ @apply gap-4;
80
+
81
+ .countdown-box {
82
+ @apply h-28 w-32 text-7xl;
83
+ }
84
+
85
+ .countdown-separator {
86
+ @apply text-7xl mt-7;
87
+ }
88
+
89
+ .countdown-label {
90
+ @apply text-base;
91
+ }
92
+ }
93
+ }
94
+
95
+ .countdown.is-solid {
96
+ &.is-primary .countdown-box {
97
+ @apply bg-primary text-on-primary;
98
+ }
99
+ &.is-secondary .countdown-box {
100
+ @apply bg-secondary text-on-secondary;
101
+ }
102
+ &.is-muted .countdown-box {
103
+ @apply bg-muted text-on-muted;
104
+ }
105
+ &.is-surface .countdown-box {
106
+ @apply bg-surface text-on-surface;
107
+ }
108
+ &.is-success .countdown-box {
109
+ @apply bg-success text-on-success;
110
+ }
111
+ &.is-info .countdown-box {
112
+ @apply bg-info text-on-info;
113
+ }
114
+ &.is-warning .countdown-box {
115
+ @apply bg-warning text-on-warning;
116
+ }
117
+ &.is-danger .countdown-box {
118
+ @apply bg-danger text-on-danger;
119
+ }
120
+ }
121
+
122
+ .countdown.is-soft {
123
+ &.is-primary .countdown-box {
124
+ @apply bg-soft-primary text-primary;
125
+ }
126
+ &.is-secondary .countdown-box {
127
+ @apply bg-soft-secondary text-secondary;
128
+ }
129
+ &.is-muted .countdown-box {
130
+ @apply bg-soft-muted text-on-muted;
131
+ }
132
+ &.is-surface .countdown-box {
133
+ @apply bg-surface text-on-surface;
134
+ }
135
+ &.is-success .countdown-box {
136
+ @apply bg-soft-success text-success;
137
+ }
138
+ &.is-info .countdown-box {
139
+ @apply bg-soft-info text-info;
140
+ }
141
+ &.is-warning .countdown-box {
142
+ @apply bg-soft-warning text-warning;
143
+ }
144
+ &.is-danger .countdown-box {
145
+ @apply bg-soft-danger text-danger;
146
+ }
147
+ }
148
+
149
+ .countdown.is-outlined {
150
+ .countdown-box {
151
+ @apply border-2;
152
+ }
153
+
154
+ &.is-primary .countdown-box {
155
+ @apply border-primary text-primary;
156
+ }
157
+ &.is-secondary .countdown-box {
158
+ @apply border-secondary text-secondary;
159
+ }
160
+ &.is-muted .countdown-box {
161
+ @apply border-muted text-on-muted;
162
+ }
163
+ &.is-surface .countdown-box {
164
+ @apply border-on-surface text-on-surface;
165
+ }
166
+ &.is-success .countdown-box {
167
+ @apply border-success text-success;
168
+ }
169
+ &.is-info .countdown-box {
170
+ @apply border-info text-info;
171
+ }
172
+ &.is-warning .countdown-box {
173
+ @apply border-warning text-warning;
174
+ }
175
+ &.is-danger .countdown-box {
176
+ @apply border-danger text-danger;
177
+ }
178
+ }
179
+
180
+ .countdown.is-ghost {
181
+ &.is-primary .countdown-box {
182
+ @apply text-primary;
183
+ }
184
+ &.is-secondary .countdown-box {
185
+ @apply text-secondary;
186
+ }
187
+ &.is-muted .countdown-box {
188
+ @apply text-on-muted;
189
+ }
190
+ &.is-surface .countdown-box {
191
+ @apply text-on-surface;
192
+ }
193
+ &.is-success .countdown-box {
194
+ @apply text-success;
195
+ }
196
+ &.is-info .countdown-box {
197
+ @apply text-info;
198
+ }
199
+ &.is-warning .countdown-box {
200
+ @apply text-warning;
201
+ }
202
+ &.is-danger .countdown-box {
203
+ @apply text-danger;
204
+ }
205
+ }
206
+ }
@@ -352,6 +352,30 @@
352
352
  @apply shrink-0;
353
353
  }
354
354
 
355
+ .item-bullet {
356
+ @apply w-1.5 h-1.5 rounded-full bg-current opacity-30;
357
+ @apply shrink-0 transition-all duration-200;
358
+ }
359
+
360
+ .item.is-interactive:hover .item-bullet,
361
+ .item.is-focused .item-bullet {
362
+ @apply opacity-60 scale-110;
363
+ }
364
+
365
+ .item-indicator {
366
+ @apply shrink-0 opacity-0 -translate-x-1;
367
+ @apply transition-all duration-200;
368
+
369
+ svg {
370
+ @apply w-3.5 h-3.5;
371
+ }
372
+ }
373
+
374
+ .item.is-interactive:hover .item-indicator,
375
+ .item.is-focused .item-indicator {
376
+ @apply opacity-50 translate-x-0;
377
+ }
378
+
355
379
  .item {
356
380
  &.has-divider {
357
381
  @apply border-b border-muted rounded-none;
@@ -61,7 +61,6 @@
61
61
  }
62
62
  }
63
63
 
64
- /* Animaciones */
65
64
  @keyframes marquee-scroll {
66
65
  0% {
67
66
  transform: translateX(0);
@@ -80,7 +79,6 @@
80
79
  }
81
80
  }
82
81
 
83
- /* Variantes de velocidad */
84
82
  .marquee-container {
85
83
  &.is-slow {
86
84
  --marquee-duration: 40s;
@@ -95,7 +93,6 @@
95
93
  }
96
94
  }
97
95
 
98
- /* Efecto de fade en los bordes */
99
96
  .marquee {
100
97
  &.has-fade {
101
98
  &::before,
@@ -17,118 +17,97 @@
17
17
  .section-body {
18
18
  @apply column gap-4 md:gap-6 w-full p-4 md:p-6;
19
19
  }
20
-
21
- }
22
-
23
- .section.is-soft.is-primary {
24
- @apply bg-on-primary text-primary;
25
- }
26
-
27
- .section.is-soft.is-secondary {
28
- @apply bg-on-secondary text-secondary;
29
- }
30
-
31
- .section.is-soft.is-muted {
32
- @apply bg-muted text-on-muted;
33
- }
34
-
35
- .section.is-soft.is-success {
36
- @apply bg-on-success text-success;
37
- }
38
-
39
- .section.is-soft.is-info {
40
- @apply bg-on-info text-info;
41
- }
42
-
43
- .section.is-soft.is-warning {
44
- @apply bg-on-warning text-warning;
45
- }
46
-
47
- .section.is-soft.is-danger {
48
- @apply bg-on-danger text-danger;
49
20
  }
50
21
 
51
- .section.is-soft.is-default {
52
- @apply bg-background text-on-background;
53
- }
54
-
55
- .section.is-soft.is-surface {
56
- @apply bg-surface text-on-surface;
57
- }
58
-
59
- .section.is-solid.is-primary {
60
- @apply bg-primary text-on-primary;
61
- }
62
-
63
-
64
- .section.is-solid.is-secondary {
65
- @apply bg-secondary text-on-secondary;
66
- }
67
-
68
- .section.is-solid.is-muted {
69
- @apply bg-on-muted text-muted;
70
- }
71
-
72
- .section.is-solid.is-success {
73
- @apply bg-success text-on-success;
74
- }
75
-
76
-
77
- .section.is-solid.is-info {
78
- @apply bg-info text-on-info;
79
- }
80
-
81
-
82
- .section.is-solid.is-warning {
83
- @apply bg-warning text-on-warning;
84
- }
85
-
86
-
87
- .section.is-solid.is-danger {
88
- @apply bg-danger text-on-danger;
89
- }
90
-
91
- .section.is-solid.is-default {
92
- @apply bg-background text-on-background;
93
- }
94
-
95
- .section.is-solid.is-surface {
96
- @apply bg-surface text-on-surface;
97
- }
98
-
99
- .section.is-ghost.is-primary {
100
- @apply bg-transparent text-primary;
101
- }
102
-
103
- .section.is-ghost.is-secondary {
104
- @apply bg-transparent text-secondary;
105
- }
106
-
107
- .section.is-ghost.is-muted {
108
- @apply bg-transparent text-on-muted;
109
- }
110
-
111
- .section.is-ghost.is-success {
112
- @apply bg-transparent text-success;
113
- }
114
-
115
- .section.is-ghost.is-info {
116
- @apply bg-transparent text-info;
117
- }
118
-
119
- .section.is-ghost.is-warning {
120
- @apply bg-transparent text-warning;
121
- }
122
-
123
- .section.is-ghost.is-danger {
124
- @apply bg-transparent text-danger;
125
- }
22
+ .section {
23
+ &.is-soft {
24
+ &.is-primary {
25
+ @apply bg-soft-primary text-primary;
26
+ }
27
+ &.is-secondary {
28
+ @apply bg-soft-secondary text-secondary;
29
+ }
30
+ &.is-muted {
31
+ @apply bg-soft-muted text-on-muted;
32
+ }
33
+ &.is-background {
34
+ @apply bg-background text-on-background;
35
+ }
36
+ &.is-surface {
37
+ @apply bg-surface text-on-surface;
38
+ }
39
+ &.is-success {
40
+ @apply bg-soft-success text-success;
41
+ }
42
+ &.is-info {
43
+ @apply bg-soft-info text-info;
44
+ }
45
+ &.is-warning {
46
+ @apply bg-soft-warning text-warning;
47
+ }
48
+ &.is-danger {
49
+ @apply bg-soft-danger text-danger;
50
+ }
51
+ }
126
52
 
127
- .section.is-ghost.is-default {
128
- @apply bg-transparent text-on-background;
129
- }
53
+ &.is-solid {
54
+ &.is-primary {
55
+ @apply bg-primary text-on-primary;
56
+ }
57
+ &.is-secondary {
58
+ @apply bg-secondary text-on-secondary;
59
+ }
60
+ &.is-muted {
61
+ @apply bg-muted text-on-muted;
62
+ }
63
+ &.is-background {
64
+ @apply bg-background text-on-background;
65
+ }
66
+ &.is-surface {
67
+ @apply bg-surface text-on-surface;
68
+ }
69
+ &.is-success {
70
+ @apply bg-success text-on-success;
71
+ }
72
+ &.is-info {
73
+ @apply bg-info text-on-info;
74
+ }
75
+ &.is-warning {
76
+ @apply bg-warning text-on-warning;
77
+ }
78
+ &.is-danger {
79
+ @apply bg-danger text-on-danger;
80
+ }
81
+ }
130
82
 
131
- .section.is-ghost.is-surface {
132
- @apply bg-transparent text-on-surface;
83
+ &.is-ghost {
84
+ &.is-primary {
85
+ @apply bg-transparent text-primary;
86
+ }
87
+ &.is-secondary {
88
+ @apply bg-transparent text-secondary;
89
+ }
90
+ &.is-muted {
91
+ @apply bg-transparent text-on-muted;
92
+ }
93
+ &.is-background {
94
+ @apply bg-transparent text-on-background;
95
+ }
96
+ &.is-surface {
97
+ @apply bg-transparent text-on-surface;
98
+ }
99
+ &.is-success {
100
+ @apply bg-transparent text-success;
101
+ }
102
+ &.is-info {
103
+ @apply bg-transparent text-info;
104
+ }
105
+ &.is-warning {
106
+ @apply bg-transparent text-warning;
107
+ }
108
+ &.is-danger {
109
+ @apply bg-transparent text-danger;
110
+ }
111
+ }
133
112
  }
134
113
  }
@@ -7,7 +7,7 @@
7
7
  @apply relative w-full overflow-x-auto;
8
8
  }
9
9
 
10
- .table {
10
+ .table {
11
11
  @apply relative w-full text-left rtl:text-right;
12
12
 
13
13
  .table-header {
@@ -276,17 +276,12 @@
276
276
  }
277
277
  }
278
278
 
279
- /* ==========================================
280
- Selection Bar Color Variants
281
- ========================================== */
282
-
283
279
  .table-selection-bar {
284
280
  &.is-primary {
285
281
  @apply bg-primary/10 border-primary/20;
286
282
  .table-selection-count {
287
283
  @apply text-primary;
288
284
  }
289
-
290
285
  }
291
286
 
292
287
  &.is-secondary {
@@ -294,7 +289,6 @@
294
289
  .table-selection-count {
295
290
  @apply text-secondary;
296
291
  }
297
-
298
292
  }
299
293
 
300
294
  &.is-muted {
@@ -302,7 +296,6 @@
302
296
  .table-selection-count {
303
297
  @apply text-on-muted;
304
298
  }
305
-
306
299
  }
307
300
 
308
301
  &.is-success {
@@ -310,7 +303,6 @@
310
303
  .table-selection-count {
311
304
  @apply text-success;
312
305
  }
313
-
314
306
  }
315
307
 
316
308
  &.is-info {
@@ -318,7 +310,6 @@
318
310
  .table-selection-count {
319
311
  @apply text-info;
320
312
  }
321
-
322
313
  }
323
314
 
324
315
  &.is-danger {
@@ -326,7 +317,6 @@
326
317
  .table-selection-count {
327
318
  @apply text-danger;
328
319
  }
329
-
330
320
  }
331
321
 
332
322
  &.is-warning {
@@ -334,7 +324,6 @@
334
324
  .table-selection-count {
335
325
  @apply text-warning;
336
326
  }
337
-
338
327
  }
339
328
  }
340
329
 
@@ -346,7 +335,6 @@
346
335
  }
347
336
  }
348
337
 
349
-
350
338
  .table-loading-row {
351
339
  @apply animate-pulse;
352
340
  }
@@ -427,8 +415,6 @@
427
415
  @apply text-sm font-medium text-primary;
428
416
  }
429
417
 
430
-
431
-
432
418
  .table-selection-actions {
433
419
  @apply flex items-center gap-2;
434
420
 
@@ -471,7 +457,6 @@
471
457
 
472
458
  .table-footer-info {
473
459
  @apply flex items-center justify-between gap-4 px-2 py-3;
474
-
475
460
  }
476
461
 
477
462
  .table-total {
@@ -232,6 +232,59 @@
232
232
  return [parseFloat(L.toFixed(2)), parseFloat(C.toFixed(2)), Math.round(H)];
233
233
  }
234
234
 
235
+ function oklchToRgb(l: number, c: number, h: number): [number, number, number] {
236
+ const hRad = (h * Math.PI) / 180;
237
+ const a = c * Math.cos(hRad);
238
+ const b = c * Math.sin(hRad);
239
+
240
+ const l_ = l + 0.3963377774 * a + 0.2158037573 * b;
241
+ const m_ = l - 0.1055613458 * a - 0.0638541728 * b;
242
+ const s_ = l - 0.0894841775 * a - 1.291485548 * b;
243
+
244
+ const l3 = l_ * l_ * l_;
245
+ const m3 = m_ * m_ * m_;
246
+ const s3 = s_ * s_ * s_;
247
+
248
+ const lr = 4.0767416621 * l3 - 3.3077115913 * m3 + 0.2309699292 * s3;
249
+ const lg = -1.2684380046 * l3 + 2.6097574011 * m3 - 0.3413193965 * s3;
250
+ const lb = -0.0041960863 * l3 - 0.7034186147 * m3 + 1.707614701 * s3;
251
+
252
+ const gammaCorrect = (c: number) => {
253
+ if (c <= 0.0031308) return c * 12.92;
254
+ return 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
255
+ };
256
+
257
+ const r = Math.max(0, Math.min(255, Math.round(gammaCorrect(lr) * 255)));
258
+ const g = Math.max(0, Math.min(255, Math.round(gammaCorrect(lg) * 255)));
259
+ const bVal = Math.max(0, Math.min(255, Math.round(gammaCorrect(lb) * 255)));
260
+
261
+ return [r, g, bVal];
262
+ }
263
+
264
+ function parseOklchString(oklchStr: string): [number, number, number] | null {
265
+ const match = oklchStr.match(/oklch\(([\d.]+)%?\s+([\d.]+)\s+([\d.]+)\)/);
266
+ if (!match) return null;
267
+ let l = parseFloat(match[1]);
268
+ if (l > 1) l = l / 100;
269
+ const c = parseFloat(match[2]);
270
+ const h = parseFloat(match[3]);
271
+ return [l, c, h];
272
+ }
273
+
274
+ function parseOklchAndUpdateHsv(oklchStr: string) {
275
+ const parsed = parseOklchString(oklchStr);
276
+ if (parsed) {
277
+ const [l, c, h] = parsed;
278
+ const [r, g, b] = oklchToRgb(l, c, h);
279
+ const [hsvH, hsvS, hsvV] = rgbToHsv(r, g, b);
280
+ hue = hsvH;
281
+ saturation = hsvS;
282
+ brightness = hsvV;
283
+ return true;
284
+ }
285
+ return false;
286
+ }
287
+
235
288
  function getContrastColor(hexColor: string): string {
236
289
  const rgbValues = hexToRgb(hexColor);
237
290
  if (!rgbValues) return '#000000';
@@ -424,8 +477,13 @@
424
477
  });
425
478
 
426
479
  onMount(() => {
427
- parseHexAndUpdateHsv(hex);
428
- updateAllFormats();
480
+ if (oklch && oklch.startsWith('oklch(')) {
481
+ parseOklchAndUpdateHsv(oklch);
482
+ updateAllFormats();
483
+ } else if (hex && hex.startsWith('#')) {
484
+ parseHexAndUpdateHsv(hex);
485
+ updateAllFormats();
486
+ }
429
487
  return () => stopEventListeners();
430
488
  });
431
489