@zvndev/yable-themes 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present ZVN DEV
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/base.css CHANGED
@@ -137,11 +137,11 @@
137
137
  transition: background var(--yable-transition-fast);
138
138
  }
139
139
 
140
- .yable-th[data-sortable="true"] {
140
+ .yable-th[data-sortable='true'] {
141
141
  cursor: pointer;
142
142
  }
143
143
 
144
- .yable-th[data-sortable="true"]:hover {
144
+ .yable-th[data-sortable='true']:hover {
145
145
  background: var(--yable-bg-row-hover);
146
146
  }
147
147
 
@@ -164,22 +164,23 @@
164
164
  height: calc(var(--yable-sort-icon-size) + 2px);
165
165
  color: var(--yable-sort-icon-color);
166
166
  opacity: 0;
167
- transition: color var(--yable-transition),
168
- transform var(--yable-transition),
169
- opacity var(--yable-transition);
167
+ transition:
168
+ color var(--yable-transition),
169
+ transform var(--yable-transition),
170
+ opacity var(--yable-transition);
170
171
  }
171
172
 
172
173
  /* Show sort indicator on header hover */
173
- .yable-th[data-sortable="true"]:hover .yable-sort-indicator {
174
+ .yable-th[data-sortable='true']:hover .yable-sort-indicator {
174
175
  opacity: 0.4;
175
176
  }
176
177
 
177
- .yable-sort-indicator[data-active="true"] {
178
+ .yable-sort-indicator[data-active='true'] {
178
179
  color: var(--yable-sort-icon-color-active);
179
180
  opacity: 1;
180
181
  }
181
182
 
182
- .yable-sort-indicator[data-direction="desc"] {
183
+ .yable-sort-indicator[data-direction='desc'] {
183
184
  transform: rotate(180deg);
184
185
  }
185
186
 
@@ -219,8 +220,9 @@
219
220
  height: 0%;
220
221
  border-radius: 2px;
221
222
  background: var(--yable-resize-handle-color);
222
- transition: background var(--yable-transition),
223
- height var(--yable-transition);
223
+ transition:
224
+ background var(--yable-transition),
225
+ height var(--yable-transition);
224
226
  }
225
227
 
226
228
  .yable-resize-handle:hover::after {
@@ -228,25 +230,22 @@
228
230
  height: 50%;
229
231
  }
230
232
 
231
- .yable-resize-handle[data-resizing="true"]::after {
233
+ .yable-resize-handle[data-resizing='true']::after {
232
234
  background: var(--yable-resize-handle-color-active);
233
235
  height: 70%;
234
236
  }
235
237
 
236
238
  /* ── Column Reorder ──────────────────────────────────────────────────────── */
237
239
 
238
- .yable-th[data-reorderable="true"] {
240
+ .yable-th[data-reorderable='true'] > .yable-th-content {
239
241
  cursor: grab;
240
242
  }
241
243
 
242
- .yable-th[data-reorderable="true"]:active {
244
+ .yable-th[data-reorderable='true'] > .yable-th-content:active {
243
245
  cursor: grabbing;
244
246
  }
245
247
 
246
- /* When sortable AND reorderable, sort cursor wins on the content area so the
247
- header still feels clickable. The drag is initiated from a mousedown that
248
- moves; a click without movement still triggers the sort. */
249
- .yable-th[data-sortable="true"][data-reorderable="true"] {
248
+ .yable-th[data-sortable='true'][data-reorderable='true'] > .yable-th-content {
250
249
  cursor: pointer;
251
250
  }
252
251
 
@@ -264,16 +263,16 @@
264
263
  z-index: calc(var(--yable-z-resize) + 1);
265
264
  }
266
265
 
267
- .yable-th[data-drag-over="left"]::before {
266
+ .yable-th[data-drag-over='left']::before {
268
267
  left: -1px;
269
268
  }
270
269
 
271
- .yable-th[data-drag-over="right"]::after {
270
+ .yable-th[data-drag-over='right']::after {
272
271
  right: -1px;
273
272
  }
274
273
 
275
- .yable-th[data-drag-over="left"]::after,
276
- .yable-th[data-drag-over="right"]::before {
274
+ .yable-th[data-drag-over='left']::after,
275
+ .yable-th[data-drag-over='right']::before {
277
276
  display: none;
278
277
  }
279
278
 
@@ -299,20 +298,20 @@
299
298
  background: var(--yable-bg-row-hover);
300
299
  }
301
300
 
302
- .yable-tr[data-selected="true"] {
301
+ .yable-tr[data-selected='true'] {
303
302
  background: var(--yable-bg-row-selected);
304
303
  box-shadow: inset 2px 0 0 0 var(--yable-accent);
305
304
  }
306
305
 
307
- .yable-tr[data-selected="true"]:hover {
306
+ .yable-tr[data-selected='true']:hover {
308
307
  background: var(--yable-bg-row-selected);
309
308
  }
310
309
 
311
- .yable-tr[data-expanded="true"] {
310
+ .yable-tr[data-expanded='true'] {
312
311
  background: var(--yable-bg-row-expanded);
313
312
  }
314
313
 
315
- .yable-tr[data-clickable="true"] {
314
+ .yable-tr[data-clickable='true'] {
316
315
  cursor: pointer;
317
316
  }
318
317
 
@@ -354,20 +353,58 @@
354
353
  white-space: nowrap;
355
354
  overflow: hidden;
356
355
  text-overflow: ellipsis;
357
- transition: background var(--yable-transition-fast),
358
- box-shadow var(--yable-transition-fast);
356
+ transition:
357
+ background var(--yable-transition-fast),
358
+ box-shadow var(--yable-transition-fast);
359
359
  }
360
360
 
361
- .yable-td[data-editing="true"] {
361
+ .yable-td[data-cell-selected='true'] {
362
+ --yable-selection-top-width: 0px;
363
+ --yable-selection-right-width: 0px;
364
+ --yable-selection-bottom-width: 0px;
365
+ --yable-selection-left-width: 0px;
366
+ background: color-mix(in srgb, var(--yable-accent) 10%, transparent);
367
+ position: relative;
368
+ }
369
+
370
+ .yable-td[data-cell-selected='true']::after {
371
+ content: '';
372
+ position: absolute;
373
+ inset: 0;
374
+ pointer-events: none;
375
+ border-style: solid;
376
+ border-color: var(--yable-accent);
377
+ border-width: var(--yable-selection-top-width) var(--yable-selection-right-width)
378
+ var(--yable-selection-bottom-width) var(--yable-selection-left-width);
379
+ }
380
+
381
+ .yable-td.yable-cell--selection-top {
382
+ --yable-selection-top-width: 2px;
383
+ }
384
+
385
+ .yable-td.yable-cell--selection-right {
386
+ --yable-selection-right-width: 2px;
387
+ }
388
+
389
+ .yable-td.yable-cell--selection-bottom {
390
+ --yable-selection-bottom-width: 2px;
391
+ }
392
+
393
+ .yable-td.yable-cell--selection-left {
394
+ --yable-selection-left-width: 2px;
395
+ }
396
+
397
+ .yable-td[data-editing='true'] {
362
398
  padding: 4px 6px;
363
399
  background: var(--yable-bg-cell-editing);
364
- box-shadow: inset 0 0 0 2px var(--yable-accent),
365
- 0 0 0 3px var(--yable-accent-light);
400
+ box-shadow:
401
+ inset 0 0 0 2px var(--yable-accent),
402
+ 0 0 0 3px var(--yable-accent-light);
366
403
  z-index: 2;
367
404
  position: relative;
368
405
  }
369
406
 
370
- .yable-td.yable-cell--focused:not([data-editing="true"]) {
407
+ .yable-td.yable-cell--focused:not([data-editing='true']) {
371
408
  box-shadow: var(--yable-focus-ring);
372
409
  position: relative;
373
410
  z-index: calc(var(--yable-z-pinned) + 1);
@@ -375,16 +412,16 @@
375
412
 
376
413
  /* ── Column Pinning ──────────────────────────────────────────────────────── */
377
414
 
378
- .yable-th[data-pinned="left"],
379
- .yable-td[data-pinned="left"] {
415
+ .yable-th[data-pinned='left'],
416
+ .yable-td[data-pinned='left'] {
380
417
  position: sticky;
381
418
  left: var(--yable-pin-offset, 0px);
382
419
  z-index: var(--yable-z-pinned);
383
420
  background: var(--yable-bg-pinned);
384
421
  }
385
422
 
386
- .yable-th[data-pinned="right"],
387
- .yable-td[data-pinned="right"] {
423
+ .yable-th[data-pinned='right'],
424
+ .yable-td[data-pinned='right'] {
388
425
  position: sticky;
389
426
  right: var(--yable-pin-offset, 0px);
390
427
  z-index: var(--yable-z-pinned);
@@ -392,14 +429,14 @@
392
429
  }
393
430
 
394
431
  /* Shadow on last left-pinned and first right-pinned */
395
- .yable-th[data-pinned-edge="left"],
396
- .yable-td[data-pinned-edge="left"] {
432
+ .yable-th[data-pinned-edge='left'],
433
+ .yable-td[data-pinned-edge='left'] {
397
434
  box-shadow: var(--yable-shadow-pinned);
398
435
  clip-path: inset(0 -10px 0 0);
399
436
  }
400
437
 
401
- .yable-th[data-pinned-edge="right"],
402
- .yable-td[data-pinned-edge="right"] {
438
+ .yable-th[data-pinned-edge='right'],
439
+ .yable-td[data-pinned-edge='right'] {
403
440
  box-shadow: calc(var(--yable-shadow-pinned) * -1);
404
441
  clip-path: inset(0 0 0 -10px);
405
442
  }
@@ -420,7 +457,7 @@
420
457
 
421
458
  /* ── Row Pinning ─────────────────────────────────────────────────────────── */
422
459
 
423
- .yable-tr[data-pinned="top"] {
460
+ .yable-tr[data-pinned='top'] {
424
461
  position: sticky;
425
462
  top: 0;
426
463
  z-index: calc(var(--yable-z-pinned) - 1);
@@ -428,7 +465,7 @@
428
465
  box-shadow: 0 1px 0 var(--yable-border-color);
429
466
  }
430
467
 
431
- .yable-tr[data-pinned="bottom"] {
468
+ .yable-tr[data-pinned='bottom'] {
432
469
  position: sticky;
433
470
  bottom: 0;
434
471
  z-index: calc(var(--yable-z-pinned) - 1);
@@ -470,9 +507,10 @@
470
507
  background: none;
471
508
  cursor: pointer;
472
509
  color: var(--yable-text-secondary);
473
- transition: transform var(--yable-transition),
474
- color var(--yable-transition-fast),
475
- background var(--yable-transition-fast);
510
+ transition:
511
+ transform var(--yable-transition),
512
+ color var(--yable-transition-fast),
513
+ background var(--yable-transition-fast);
476
514
  padding: 0;
477
515
  border-radius: var(--yable-border-radius-sm);
478
516
  }
@@ -482,7 +520,7 @@
482
520
  background: var(--yable-bg-row-hover);
483
521
  }
484
522
 
485
- .yable-expand-toggle[data-expanded="true"] {
523
+ .yable-expand-toggle[data-expanded='true'] {
486
524
  transform: rotate(90deg);
487
525
  color: var(--yable-accent);
488
526
  }
@@ -500,9 +538,10 @@
500
538
  font-size: var(--yable-input-font-size);
501
539
  color: var(--yable-text-primary);
502
540
  outline: none;
503
- transition: border-color var(--yable-transition-fast),
504
- background var(--yable-transition-fast),
505
- box-shadow var(--yable-transition-fast);
541
+ transition:
542
+ border-color var(--yable-transition-fast),
543
+ background var(--yable-transition-fast),
544
+ box-shadow var(--yable-transition-fast);
506
545
  }
507
546
 
508
547
  .yable-input:hover {
@@ -557,9 +596,10 @@
557
596
  background-repeat: no-repeat;
558
597
  background-position: right 6px center;
559
598
  background-size: 12px;
560
- transition: border-color var(--yable-transition-fast),
561
- background-color var(--yable-transition-fast),
562
- box-shadow var(--yable-transition-fast);
599
+ transition:
600
+ border-color var(--yable-transition-fast),
601
+ background-color var(--yable-transition-fast),
602
+ box-shadow var(--yable-transition-fast);
563
603
  }
564
604
 
565
605
  .yable-select:hover {
@@ -582,9 +622,10 @@
582
622
  cursor: pointer;
583
623
  position: relative;
584
624
  flex-shrink: 0;
585
- transition: background var(--yable-transition-fast),
586
- border-color var(--yable-transition-fast),
587
- box-shadow var(--yable-transition-fast);
625
+ transition:
626
+ background var(--yable-transition-fast),
627
+ border-color var(--yable-transition-fast),
628
+ box-shadow var(--yable-transition-fast);
588
629
  }
589
630
 
590
631
  .yable-checkbox:checked {
@@ -710,20 +751,21 @@
710
751
  font-size: var(--yable-font-size-sm);
711
752
  font-weight: var(--yable-font-weight-medium);
712
753
  cursor: pointer;
713
- transition: background var(--yable-transition-fast),
714
- color var(--yable-transition-fast),
715
- border-color var(--yable-transition-fast),
716
- box-shadow var(--yable-transition-fast);
754
+ transition:
755
+ background var(--yable-transition-fast),
756
+ color var(--yable-transition-fast),
757
+ border-color var(--yable-transition-fast),
758
+ box-shadow var(--yable-transition-fast);
717
759
  user-select: none;
718
760
  font-variant-numeric: tabular-nums;
719
761
  }
720
762
 
721
- .yable-pagination-btn:hover:not(:disabled):not([data-active="true"]) {
763
+ .yable-pagination-btn:hover:not(:disabled):not([data-active='true']) {
722
764
  background: var(--yable-pagination-button-bg-hover);
723
765
  border-color: var(--yable-border-color);
724
766
  }
725
767
 
726
- .yable-pagination-btn[data-active="true"] {
768
+ .yable-pagination-btn[data-active='true'] {
727
769
  background: var(--yable-pagination-button-bg-active);
728
770
  color: var(--yable-pagination-button-text-active);
729
771
  border-color: var(--yable-pagination-button-bg-active);
@@ -751,8 +793,9 @@
751
793
  background-repeat: no-repeat;
752
794
  background-position: right 8px center;
753
795
  background-size: 10px;
754
- transition: border-color var(--yable-transition-fast),
755
- box-shadow var(--yable-transition-fast);
796
+ transition:
797
+ border-color var(--yable-transition-fast),
798
+ box-shadow var(--yable-transition-fast);
756
799
  }
757
800
 
758
801
  .yable-pagination-select:hover {
@@ -791,10 +834,11 @@
791
834
  font-size: var(--yable-font-size);
792
835
  color: var(--yable-text-primary);
793
836
  outline: none;
794
- transition: border-color var(--yable-transition),
795
- background var(--yable-transition),
796
- box-shadow var(--yable-transition),
797
- width var(--yable-transition-slow);
837
+ transition:
838
+ border-color var(--yable-transition),
839
+ background var(--yable-transition),
840
+ box-shadow var(--yable-transition),
841
+ width var(--yable-transition-slow);
798
842
  /* Search icon via background-image */
799
843
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E");
800
844
  background-repeat: no-repeat;
@@ -829,8 +873,9 @@
829
873
  cursor: pointer;
830
874
  border-radius: 50%;
831
875
  margin-left: -30px;
832
- transition: color var(--yable-transition-fast),
833
- background var(--yable-transition-fast);
876
+ transition:
877
+ color var(--yable-transition-fast),
878
+ background var(--yable-transition-fast);
834
879
  }
835
880
 
836
881
  .yable-global-filter-clear:hover {
@@ -897,8 +942,12 @@
897
942
  }
898
943
 
899
944
  @keyframes yable-shimmer {
900
- 0% { background-position: 200% 0; }
901
- 100% { background-position: -200% 0; }
945
+ 0% {
946
+ background-position: 200% 0;
947
+ }
948
+ 100% {
949
+ background-position: -200% 0;
950
+ }
902
951
  }
903
952
 
904
953
  /* ── Selection Column ────────────────────────────────────────────────────── */
@@ -914,7 +963,7 @@
914
963
 
915
964
  /* ── Accessibility ───────────────────────────────────────────────────────── */
916
965
 
917
- .yable [role="columnheader"][aria-sort] {
966
+ .yable [role='columnheader'][aria-sort] {
918
967
  cursor: pointer;
919
968
  }
920
969
 
@@ -955,8 +1004,9 @@
955
1004
  z-index: var(--yable-z-resize);
956
1005
  border-radius: 1px;
957
1006
  pointer-events: auto;
958
- transition: width var(--yable-transition-fast),
959
- height var(--yable-transition-fast);
1007
+ transition:
1008
+ width var(--yable-transition-fast),
1009
+ height var(--yable-transition-fast);
960
1010
  }
961
1011
 
962
1012
  .yable-fill-handle:hover {
@@ -998,8 +1048,9 @@
998
1048
  cursor: grab;
999
1049
  color: var(--yable-text-tertiary);
1000
1050
  border-radius: var(--yable-border-radius-sm);
1001
- transition: color var(--yable-transition-fast),
1002
- background var(--yable-transition-fast);
1051
+ transition:
1052
+ color var(--yable-transition-fast),
1053
+ background var(--yable-transition-fast);
1003
1054
  flex-shrink: 0;
1004
1055
  }
1005
1056
 
@@ -1058,9 +1109,10 @@
1058
1109
  cursor: pointer;
1059
1110
  color: var(--yable-text-secondary);
1060
1111
  border-radius: var(--yable-border-radius-sm);
1061
- transition: transform var(--yable-transition),
1062
- color var(--yable-transition-fast),
1063
- background var(--yable-transition-fast);
1112
+ transition:
1113
+ transform var(--yable-transition),
1114
+ color var(--yable-transition-fast),
1115
+ background var(--yable-transition-fast);
1064
1116
  flex-shrink: 0;
1065
1117
  margin-right: 4px;
1066
1118
  }
@@ -1070,7 +1122,7 @@
1070
1122
  background: var(--yable-bg-row-hover);
1071
1123
  }
1072
1124
 
1073
- .yable-tree-toggle-btn[data-expanded="true"] {
1125
+ .yable-tree-toggle-btn[data-expanded='true'] {
1074
1126
  transform: rotate(90deg);
1075
1127
  }
1076
1128
 
@@ -1087,23 +1139,23 @@
1087
1139
  }
1088
1140
 
1089
1141
  /* Tree depth visual indentation */
1090
- .yable-tr[data-tree-depth="1"] .yable-tree-toggle {
1142
+ .yable-tr[data-tree-depth='1'] .yable-tree-toggle {
1091
1143
  padding-left: 20px;
1092
1144
  }
1093
1145
 
1094
- .yable-tr[data-tree-depth="2"] .yable-tree-toggle {
1146
+ .yable-tr[data-tree-depth='2'] .yable-tree-toggle {
1095
1147
  padding-left: 40px;
1096
1148
  }
1097
1149
 
1098
- .yable-tr[data-tree-depth="3"] .yable-tree-toggle {
1150
+ .yable-tr[data-tree-depth='3'] .yable-tree-toggle {
1099
1151
  padding-left: 60px;
1100
1152
  }
1101
1153
 
1102
- .yable-tr[data-tree-depth="4"] .yable-tree-toggle {
1154
+ .yable-tr[data-tree-depth='4'] .yable-tree-toggle {
1103
1155
  padding-left: 80px;
1104
1156
  }
1105
1157
 
1106
- .yable-tr[data-tree-depth="5"] .yable-tree-toggle {
1158
+ .yable-tr[data-tree-depth='5'] .yable-tree-toggle {
1107
1159
  padding-left: 100px;
1108
1160
  }
1109
1161
 
@@ -1136,9 +1188,10 @@
1136
1188
  cursor: pointer;
1137
1189
  color: var(--yable-text-secondary);
1138
1190
  border-radius: var(--yable-border-radius-sm);
1139
- transition: transform var(--yable-transition),
1140
- color var(--yable-transition-fast),
1141
- background var(--yable-transition-fast);
1191
+ transition:
1192
+ transform var(--yable-transition),
1193
+ color var(--yable-transition-fast),
1194
+ background var(--yable-transition-fast);
1142
1195
  flex-shrink: 0;
1143
1196
  }
1144
1197
 
@@ -1171,8 +1224,9 @@
1171
1224
  border: 1px dashed var(--yable-border-color);
1172
1225
  border-radius: var(--yable-border-radius);
1173
1226
  background: var(--yable-bg);
1174
- transition: border-color var(--yable-transition-fast),
1175
- background var(--yable-transition-fast);
1227
+ transition:
1228
+ border-color var(--yable-transition-fast),
1229
+ background var(--yable-transition-fast);
1176
1230
  }
1177
1231
 
1178
1232
  .yable-pivot-zone:hover {
@@ -1217,9 +1271,10 @@
1217
1271
  color: var(--yable-text-primary);
1218
1272
  cursor: grab;
1219
1273
  user-select: none;
1220
- transition: background var(--yable-transition-fast),
1221
- box-shadow var(--yable-transition-fast),
1222
- border-color var(--yable-transition-fast);
1274
+ transition:
1275
+ background var(--yable-transition-fast),
1276
+ box-shadow var(--yable-transition-fast),
1277
+ border-color var(--yable-transition-fast);
1223
1278
  }
1224
1279
 
1225
1280
  .yable-pivot-field:hover {
@@ -1250,8 +1305,9 @@
1250
1305
  font-size: 12px;
1251
1306
  line-height: 1;
1252
1307
  border-radius: 50%;
1253
- transition: color var(--yable-transition-fast),
1254
- background var(--yable-transition-fast);
1308
+ transition:
1309
+ color var(--yable-transition-fast),
1310
+ background var(--yable-transition-fast);
1255
1311
  }
1256
1312
 
1257
1313
  .yable-pivot-field-remove:hover {
@@ -1316,8 +1372,9 @@
1316
1372
  font-size: inherit;
1317
1373
  color: var(--yable-text-primary);
1318
1374
  outline: none;
1319
- transition: border-color var(--yable-transition-fast),
1320
- box-shadow var(--yable-transition-fast);
1375
+ transition:
1376
+ border-color var(--yable-transition-fast),
1377
+ box-shadow var(--yable-transition-fast);
1321
1378
  }
1322
1379
 
1323
1380
  .yable-formula-bar-input:focus {
@@ -1374,8 +1431,12 @@
1374
1431
  }
1375
1432
 
1376
1433
  @keyframes yable-overlay-fade-in {
1377
- from { opacity: 0; }
1378
- to { opacity: 1; }
1434
+ from {
1435
+ opacity: 0;
1436
+ }
1437
+ to {
1438
+ opacity: 1;
1439
+ }
1379
1440
  }
1380
1441
 
1381
1442
  .yable-overlay-loading-content {
@@ -1397,8 +1458,12 @@
1397
1458
  }
1398
1459
 
1399
1460
  @keyframes yable-spin {
1400
- from { transform: rotate(0deg); }
1401
- to { transform: rotate(360deg); }
1461
+ from {
1462
+ transform: rotate(0deg);
1463
+ }
1464
+ to {
1465
+ transform: rotate(360deg);
1466
+ }
1402
1467
  }
1403
1468
 
1404
1469
  /* ============================================================================
@@ -1650,23 +1715,26 @@
1650
1715
  background: var(--yable-bg);
1651
1716
  border: var(--yable-border-width) solid var(--yable-border-color);
1652
1717
  border-radius: 8px;
1653
- box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
1654
- 0 2px 8px rgba(0, 0, 0, 0.06);
1718
+ box-shadow:
1719
+ 0 8px 30px rgba(0, 0, 0, 0.12),
1720
+ 0 2px 8px rgba(0, 0, 0, 0.06);
1655
1721
  font-size: var(--yable-font-size-sm);
1656
1722
  animation: yable-ctx-appear 120ms ease;
1657
1723
  overflow: hidden;
1658
1724
  }
1659
1725
 
1660
1726
  @media (prefers-color-scheme: dark) {
1661
- :root:not([data-yable-theme="light"]) .yable-ctx-menu {
1662
- box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
1663
- 0 2px 8px rgba(0, 0, 0, 0.2);
1727
+ :root:not([data-yable-theme='light']) .yable-ctx-menu {
1728
+ box-shadow:
1729
+ 0 8px 30px rgba(0, 0, 0, 0.4),
1730
+ 0 2px 8px rgba(0, 0, 0, 0.2);
1664
1731
  }
1665
1732
  }
1666
1733
 
1667
- [data-yable-theme="dark"] .yable-ctx-menu {
1668
- box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
1669
- 0 2px 8px rgba(0, 0, 0, 0.2);
1734
+ [data-yable-theme='dark'] .yable-ctx-menu {
1735
+ box-shadow:
1736
+ 0 8px 30px rgba(0, 0, 0, 0.4),
1737
+ 0 2px 8px rgba(0, 0, 0, 0.2);
1670
1738
  }
1671
1739
 
1672
1740
  @keyframes yable-ctx-appear {
@@ -1691,8 +1759,9 @@
1691
1759
  user-select: none;
1692
1760
  outline: none;
1693
1761
  color: var(--yable-text-primary);
1694
- transition: background var(--yable-transition-fast),
1695
- color var(--yable-transition-fast);
1762
+ transition:
1763
+ background var(--yable-transition-fast),
1764
+ color var(--yable-transition-fast);
1696
1765
  }
1697
1766
 
1698
1767
  .yable-ctx-item:hover,
@@ -1819,8 +1888,9 @@
1819
1888
  font-weight: var(--yable-font-weight-medium);
1820
1889
  cursor: pointer;
1821
1890
  border-radius: 6px;
1822
- transition: color var(--yable-transition-fast),
1823
- background var(--yable-transition-fast);
1891
+ transition:
1892
+ color var(--yable-transition-fast),
1893
+ background var(--yable-transition-fast);
1824
1894
  }
1825
1895
 
1826
1896
  .yable-sidebar-tab:hover {
@@ -1844,8 +1914,9 @@
1844
1914
  color: var(--yable-text-tertiary);
1845
1915
  cursor: pointer;
1846
1916
  border-radius: 6px;
1847
- transition: color var(--yable-transition-fast),
1848
- background var(--yable-transition-fast);
1917
+ transition:
1918
+ color var(--yable-transition-fast),
1919
+ background var(--yable-transition-fast);
1849
1920
  }
1850
1921
 
1851
1922
  .yable-sidebar-close:hover {
@@ -1897,9 +1968,10 @@
1897
1968
  font-size: var(--yable-font-size-sm);
1898
1969
  color: var(--yable-text-primary);
1899
1970
  outline: none;
1900
- transition: border-color var(--yable-transition-fast),
1901
- background var(--yable-transition-fast),
1902
- box-shadow var(--yable-transition-fast);
1971
+ transition:
1972
+ border-color var(--yable-transition-fast),
1973
+ background var(--yable-transition-fast),
1974
+ box-shadow var(--yable-transition-fast);
1903
1975
  }
1904
1976
 
1905
1977
  .yable-sidebar-search-input:focus {
@@ -1928,9 +2000,10 @@
1928
2000
  font-size: 11px;
1929
2001
  font-weight: var(--yable-font-weight-medium);
1930
2002
  cursor: pointer;
1931
- transition: color var(--yable-transition-fast),
1932
- background var(--yable-transition-fast),
1933
- border-color var(--yable-transition-fast);
2003
+ transition:
2004
+ color var(--yable-transition-fast),
2005
+ background var(--yable-transition-fast),
2006
+ border-color var(--yable-transition-fast);
1934
2007
  }
1935
2008
 
1936
2009
  .yable-sidebar-action-btn:hover {
@@ -2078,8 +2151,9 @@
2078
2151
  cursor: pointer;
2079
2152
  border-radius: 4px;
2080
2153
  flex-shrink: 0;
2081
- transition: color var(--yable-transition-fast),
2082
- background var(--yable-transition-fast);
2154
+ transition:
2155
+ color var(--yable-transition-fast),
2156
+ background var(--yable-transition-fast);
2083
2157
  }
2084
2158
 
2085
2159
  .yable-sidebar-filter-remove:hover {
@@ -2212,7 +2286,7 @@
2212
2286
  background: #fff !important;
2213
2287
  }
2214
2288
 
2215
- .yable-print-mode .yable-tr[data-selected="true"] {
2289
+ .yable-print-mode .yable-tr[data-selected='true'] {
2216
2290
  box-shadow: none !important;
2217
2291
  background: transparent !important;
2218
2292
  }
@@ -2232,7 +2306,7 @@
2232
2306
  left: 0;
2233
2307
  }
2234
2308
 
2235
- .yable--rtl .yable-tr[data-selected="true"] {
2309
+ .yable--rtl .yable-tr[data-selected='true'] {
2236
2310
  box-shadow: inset -2px 0 0 0 var(--yable-accent);
2237
2311
  }
2238
2312
 
@@ -2452,21 +2526,60 @@
2452
2526
  white-space: nowrap;
2453
2527
  }
2454
2528
 
2455
- .yable-cell-badge--soft.yable-cell-badge--default { background: var(--yable-bg-hover); color: var(--yable-text-secondary); }
2456
- .yable-cell-badge--soft.yable-cell-badge--accent { background: var(--yable-accent-bg, rgba(99, 102, 241, 0.1)); color: var(--yable-accent); }
2457
- .yable-cell-badge--soft.yable-cell-badge--success { background: rgba(52, 211, 153, 0.1); color: #34d399; }
2458
- .yable-cell-badge--soft.yable-cell-badge--warning { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
2459
- .yable-cell-badge--soft.yable-cell-badge--danger { background: rgba(248, 113, 113, 0.1); color: #f87171; }
2460
- .yable-cell-badge--soft.yable-cell-badge--info { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
2529
+ .yable-cell-badge--soft.yable-cell-badge--default {
2530
+ background: var(--yable-bg-hover);
2531
+ color: var(--yable-text-secondary);
2532
+ }
2533
+ .yable-cell-badge--soft.yable-cell-badge--accent {
2534
+ background: var(--yable-accent-bg, rgba(99, 102, 241, 0.1));
2535
+ color: var(--yable-accent);
2536
+ }
2537
+ .yable-cell-badge--soft.yable-cell-badge--success {
2538
+ background: rgba(52, 211, 153, 0.1);
2539
+ color: #34d399;
2540
+ }
2541
+ .yable-cell-badge--soft.yable-cell-badge--warning {
2542
+ background: rgba(251, 191, 36, 0.1);
2543
+ color: #fbbf24;
2544
+ }
2545
+ .yable-cell-badge--soft.yable-cell-badge--danger {
2546
+ background: rgba(248, 113, 113, 0.1);
2547
+ color: #f87171;
2548
+ }
2549
+ .yable-cell-badge--soft.yable-cell-badge--info {
2550
+ background: rgba(56, 189, 248, 0.1);
2551
+ color: #38bdf8;
2552
+ }
2461
2553
 
2462
- .yable-cell-badge--solid.yable-cell-badge--default { background: var(--yable-text-secondary); color: var(--yable-bg); }
2463
- .yable-cell-badge--solid.yable-cell-badge--accent { background: var(--yable-accent); color: #fff; }
2464
- .yable-cell-badge--solid.yable-cell-badge--success { background: #34d399; color: #0a2e1f; }
2465
- .yable-cell-badge--solid.yable-cell-badge--warning { background: #fbbf24; color: #422006; }
2466
- .yable-cell-badge--solid.yable-cell-badge--danger { background: #f87171; color: #2a0a0a; }
2467
- .yable-cell-badge--solid.yable-cell-badge--info { background: #38bdf8; color: #082f49; }
2554
+ .yable-cell-badge--solid.yable-cell-badge--default {
2555
+ background: var(--yable-text-secondary);
2556
+ color: var(--yable-bg);
2557
+ }
2558
+ .yable-cell-badge--solid.yable-cell-badge--accent {
2559
+ background: var(--yable-accent);
2560
+ color: #fff;
2561
+ }
2562
+ .yable-cell-badge--solid.yable-cell-badge--success {
2563
+ background: #34d399;
2564
+ color: #0a2e1f;
2565
+ }
2566
+ .yable-cell-badge--solid.yable-cell-badge--warning {
2567
+ background: #fbbf24;
2568
+ color: #422006;
2569
+ }
2570
+ .yable-cell-badge--solid.yable-cell-badge--danger {
2571
+ background: #f87171;
2572
+ color: #2a0a0a;
2573
+ }
2574
+ .yable-cell-badge--solid.yable-cell-badge--info {
2575
+ background: #38bdf8;
2576
+ color: #082f49;
2577
+ }
2468
2578
 
2469
- .yable-cell-badge--outline { background: transparent; border: 1px solid currentColor; }
2579
+ .yable-cell-badge--outline {
2580
+ background: transparent;
2581
+ border: 1px solid currentColor;
2582
+ }
2470
2583
 
2471
2584
  /* ── CellCurrency ───────────────────────────────────────────────────────── */
2472
2585
 
@@ -2477,8 +2590,12 @@
2477
2590
  white-space: nowrap;
2478
2591
  }
2479
2592
 
2480
- .yable-cell-currency--positive { color: #34d399; }
2481
- .yable-cell-currency--negative { color: #f87171; }
2593
+ .yable-cell-currency--positive {
2594
+ color: #34d399;
2595
+ }
2596
+ .yable-cell-currency--negative {
2597
+ color: #f87171;
2598
+ }
2482
2599
 
2483
2600
  /* ── CellStatus ─────────────────────────────────────────────────────────── */
2484
2601
 
@@ -2500,16 +2617,36 @@
2500
2617
  flex-shrink: 0;
2501
2618
  }
2502
2619
 
2503
- .yable-cell-status--success { color: #34d399; }
2504
- .yable-cell-status--success::before { background: #34d399; }
2505
- .yable-cell-status--warning { color: #fbbf24; }
2506
- .yable-cell-status--warning::before { background: #fbbf24; }
2507
- .yable-cell-status--danger { color: #f87171; }
2508
- .yable-cell-status--danger::before { background: #f87171; }
2509
- .yable-cell-status--info { color: #38bdf8; }
2510
- .yable-cell-status--info::before { background: #38bdf8; }
2511
- .yable-cell-status--default { color: var(--yable-text-secondary); }
2512
- .yable-cell-status--default::before { background: var(--yable-text-secondary); }
2620
+ .yable-cell-status--success {
2621
+ color: #34d399;
2622
+ }
2623
+ .yable-cell-status--success::before {
2624
+ background: #34d399;
2625
+ }
2626
+ .yable-cell-status--warning {
2627
+ color: #fbbf24;
2628
+ }
2629
+ .yable-cell-status--warning::before {
2630
+ background: #fbbf24;
2631
+ }
2632
+ .yable-cell-status--danger {
2633
+ color: #f87171;
2634
+ }
2635
+ .yable-cell-status--danger::before {
2636
+ background: #f87171;
2637
+ }
2638
+ .yable-cell-status--info {
2639
+ color: #38bdf8;
2640
+ }
2641
+ .yable-cell-status--info::before {
2642
+ background: #38bdf8;
2643
+ }
2644
+ .yable-cell-status--default {
2645
+ color: var(--yable-text-secondary);
2646
+ }
2647
+ .yable-cell-status--default::before {
2648
+ background: var(--yable-text-secondary);
2649
+ }
2513
2650
 
2514
2651
  /* ── CellNumeric ────────────────────────────────────────────────────────── */
2515
2652
 
@@ -2525,8 +2662,12 @@
2525
2662
  color: var(--yable-text-secondary);
2526
2663
  }
2527
2664
 
2528
- .yable-cell-numeric--positive { color: #34d399; }
2529
- .yable-cell-numeric--negative { color: #f87171; }
2665
+ .yable-cell-numeric--positive {
2666
+ color: #34d399;
2667
+ }
2668
+ .yable-cell-numeric--negative {
2669
+ color: #f87171;
2670
+ }
2530
2671
 
2531
2672
  /* ── CellRating ─────────────────────────────────────────────────────────── */
2532
2673
 
@@ -2565,10 +2706,18 @@
2565
2706
  flex-shrink: 0;
2566
2707
  }
2567
2708
 
2568
- .yable-cell-boolean--success { color: #34d399; }
2569
- .yable-cell-boolean--success.yable-cell-boolean--dot::before { background: #34d399; }
2570
- .yable-cell-boolean--danger { color: #f87171; }
2571
- .yable-cell-boolean--danger.yable-cell-boolean--dot::before { background: #f87171; }
2709
+ .yable-cell-boolean--success {
2710
+ color: #34d399;
2711
+ }
2712
+ .yable-cell-boolean--success.yable-cell-boolean--dot::before {
2713
+ background: #34d399;
2714
+ }
2715
+ .yable-cell-boolean--danger {
2716
+ color: #f87171;
2717
+ }
2718
+ .yable-cell-boolean--danger.yable-cell-boolean--dot::before {
2719
+ background: #f87171;
2720
+ }
2572
2721
 
2573
2722
  .yable-cell-boolean--badge {
2574
2723
  padding: 2px 8px;
@@ -2576,8 +2725,12 @@
2576
2725
  font-weight: 500;
2577
2726
  }
2578
2727
 
2579
- .yable-cell-boolean--badge.yable-cell-boolean--success { background: rgba(52, 211, 153, 0.1); }
2580
- .yable-cell-boolean--badge.yable-cell-boolean--danger { background: rgba(248, 113, 113, 0.1); }
2728
+ .yable-cell-boolean--badge.yable-cell-boolean--success {
2729
+ background: rgba(52, 211, 153, 0.1);
2730
+ }
2731
+ .yable-cell-boolean--badge.yable-cell-boolean--danger {
2732
+ background: rgba(248, 113, 113, 0.1);
2733
+ }
2581
2734
 
2582
2735
  /* ── CellProgress ───────────────────────────────────────────────────────── */
2583
2736
 
@@ -2604,11 +2757,21 @@
2604
2757
  transition: width 200ms ease;
2605
2758
  }
2606
2759
 
2607
- .yable-cell-progress--accent .yable-cell-progress__fill { background: var(--yable-accent); }
2608
- .yable-cell-progress--default .yable-cell-progress__fill { background: var(--yable-text-secondary); }
2609
- .yable-cell-progress--success .yable-cell-progress__fill { background: #34d399; }
2610
- .yable-cell-progress--warning .yable-cell-progress__fill { background: #fbbf24; }
2611
- .yable-cell-progress--danger .yable-cell-progress__fill { background: #f87171; }
2760
+ .yable-cell-progress--accent .yable-cell-progress__fill {
2761
+ background: var(--yable-accent);
2762
+ }
2763
+ .yable-cell-progress--default .yable-cell-progress__fill {
2764
+ background: var(--yable-text-secondary);
2765
+ }
2766
+ .yable-cell-progress--success .yable-cell-progress__fill {
2767
+ background: #34d399;
2768
+ }
2769
+ .yable-cell-progress--warning .yable-cell-progress__fill {
2770
+ background: #fbbf24;
2771
+ }
2772
+ .yable-cell-progress--danger .yable-cell-progress__fill {
2773
+ background: #f87171;
2774
+ }
2612
2775
 
2613
2776
  .yable-cell-progress__label {
2614
2777
  font-variant-numeric: tabular-nums;
package/package.json CHANGED
@@ -1,16 +1,23 @@
1
1
  {
2
2
  "name": "@zvndev/yable-themes",
3
- "version": "0.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "CSS design token system and themes for Yable data tables",
5
- "keywords": ["table", "themes", "css", "design-tokens", "dark-mode", "yable"],
5
+ "keywords": [
6
+ "table",
7
+ "themes",
8
+ "css",
9
+ "design-tokens",
10
+ "dark-mode",
11
+ "yable"
12
+ ],
6
13
  "license": "MIT",
7
14
  "author": "ZVN DEV",
8
15
  "repository": {
9
16
  "type": "git",
10
- "url": "https://github.com/ZVN-DEV/table.git",
17
+ "url": "https://github.com/ZVN-DEV/yable.git",
11
18
  "directory": "packages/themes"
12
19
  },
13
- "homepage": "https://github.com/ZVN-DEV/table#readme",
20
+ "homepage": "https://github.com/ZVN-DEV/yable#readme",
14
21
  "type": "module",
15
22
  "main": "./dist/index.css",
16
23
  "exports": {
@@ -25,14 +32,31 @@
25
32
  "./mono.css": "./dist/themes/mono.css",
26
33
  "./tokens.css": "./dist/tokens.css",
27
34
  "./rtl.css": "./dist/rtl.css",
28
- "./tailwind.css": "./dist/tailwind.css",
29
- "./tailwind-preset": "./src/tailwind-preset.ts",
30
- "./createTheme": "./src/createTheme.ts"
35
+ "./tailwind.css": "./dist/tailwind.css"
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "devDependencies": {
41
+ "typescript": "^5.7.0",
42
+ "vitest": "^2.1.0"
43
+ },
44
+ "sideEffects": [
45
+ "**/*.css"
46
+ ],
47
+ "bugs": {
48
+ "url": "https://github.com/ZVN-DEV/yable/issues"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
31
52
  },
32
- "files": ["dist", "src/tailwind-preset.ts"],
33
53
  "scripts": {
34
54
  "build": "node build.mjs",
35
55
  "dev": "node build.mjs --watch",
56
+ "lint": "eslint src",
57
+ "test": "vitest",
58
+ "test:ci": "vitest run --passWithNoTests",
59
+ "test:coverage": "vitest run --passWithNoTests --coverage",
36
60
  "clean": "rm -rf dist"
37
61
  }
38
- }
62
+ }
@@ -1,80 +0,0 @@
1
- // @zvndev/yable-themes — Tailwind v3 preset
2
- //
3
- // Usage:
4
- //
5
- // // tailwind.config.ts
6
- // import yablePreset from '@zvndev/yable-themes/tailwind-preset'
7
- //
8
- // export default {
9
- // presets: [yablePreset],
10
- // content: ['./src/**/*.{ts,tsx}', './node_modules/@zvndev/yable-react/dist/**/*.js'],
11
- // }
12
- //
13
- // All token utilities resolve to the live CSS variable, so they automatically
14
- // follow whatever Yable theme is active on the surrounding container.
15
-
16
- const cssVar = (name: string) => `var(--${name})`
17
-
18
- const yableTailwindPreset = {
19
- theme: {
20
- extend: {
21
- colors: {
22
- yable: {
23
- DEFAULT: cssVar('yable-bg'),
24
- bg: cssVar('yable-bg'),
25
- 'bg-header': cssVar('yable-bg-header'),
26
- 'bg-footer': cssVar('yable-bg-footer'),
27
- 'bg-row': cssVar('yable-bg-row'),
28
- 'bg-row-alt': cssVar('yable-bg-row-alt'),
29
- 'bg-row-hover': cssVar('yable-bg-row-hover'),
30
- 'bg-row-selected': cssVar('yable-bg-row-selected'),
31
- 'bg-row-expanded': cssVar('yable-bg-row-expanded'),
32
- 'bg-cell-editing': cssVar('yable-bg-cell-editing'),
33
- 'bg-pinned': cssVar('yable-bg-pinned'),
34
-
35
- text: cssVar('yable-text-primary'),
36
- 'text-secondary': cssVar('yable-text-secondary'),
37
- 'text-tertiary': cssVar('yable-text-tertiary'),
38
- 'text-header': cssVar('yable-text-header'),
39
- 'text-disabled': cssVar('yable-text-disabled'),
40
- 'text-link': cssVar('yable-text-link'),
41
- 'text-placeholder': cssVar('yable-text-placeholder'),
42
-
43
- border: cssVar('yable-border-color'),
44
- 'border-strong': cssVar('yable-border-color-strong'),
45
-
46
- accent: cssVar('yable-accent'),
47
- 'accent-hover': cssVar('yable-accent-hover'),
48
- 'accent-light': cssVar('yable-accent-light'),
49
- 'accent-text': cssVar('yable-accent-text'),
50
- 'focus-ring': cssVar('yable-focus-ring'),
51
- },
52
- },
53
- spacing: {
54
- 'yable-cell-x': cssVar('yable-cell-padding-x'),
55
- 'yable-cell-y': cssVar('yable-cell-padding-y'),
56
- 'yable-header-x': cssVar('yable-header-padding-x'),
57
- 'yable-header-y': cssVar('yable-header-padding-y'),
58
- },
59
- borderRadius: {
60
- yable: cssVar('yable-border-radius'),
61
- 'yable-sm': cssVar('yable-border-radius-sm'),
62
- 'yable-lg': cssVar('yable-border-radius-lg'),
63
- },
64
- fontFamily: {
65
- yable: [cssVar('yable-font-family')],
66
- },
67
- fontSize: {
68
- yable: [cssVar('yable-font-size'), { lineHeight: cssVar('yable-line-height') }],
69
- 'yable-sm': [cssVar('yable-font-size-sm'), { lineHeight: cssVar('yable-line-height') }],
70
- 'yable-header': [
71
- cssVar('yable-font-size-header'),
72
- { lineHeight: cssVar('yable-line-height') },
73
- ],
74
- },
75
- },
76
- },
77
- }
78
-
79
- export default yableTailwindPreset
80
- export { yableTailwindPreset }