sk-clib 1.7.0 → 1.9.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/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from "./theme";
1
2
  export * from "./ui";
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from "./theme";
1
2
  export * from "./ui";
package/dist/styles.css CHANGED
@@ -310,6 +310,14 @@
310
310
  .italic {
311
311
  font-style: italic;
312
312
  }
313
+ .shadow {
314
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
315
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
316
+ }
317
+ .outline {
318
+ outline-style: var(--tw-outline-style);
319
+ outline-width: 1px;
320
+ }
313
321
  .data-\[state\=toggled\]\:bg-black {
314
322
  &[data-state="toggled"] {
315
323
  background-color: var(--color-black);
@@ -321,14 +329,803 @@
321
329
  }
322
330
  }
323
331
  }
332
+ @layer theme, base, components, utilities;
333
+ @layer theme;
334
+ @layer base {
335
+ *, ::after, ::before, ::backdrop, ::file-selector-button {
336
+ box-sizing: border-box;
337
+ margin: 0;
338
+ padding: 0;
339
+ border: 0 solid;
340
+ }
341
+ html, :host {
342
+ line-height: 1.5;
343
+ -webkit-text-size-adjust: 100%;
344
+ tab-size: 4;
345
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
346
+ font-feature-settings: var(--default-font-feature-settings, normal);
347
+ font-variation-settings: var(--default-font-variation-settings, normal);
348
+ -webkit-tap-highlight-color: transparent;
349
+ }
350
+ hr {
351
+ height: 0;
352
+ color: inherit;
353
+ border-top-width: 1px;
354
+ }
355
+ abbr:where([title]) {
356
+ -webkit-text-decoration: underline dotted;
357
+ text-decoration: underline dotted;
358
+ }
359
+ h1, h2, h3, h4, h5, h6 {
360
+ font-size: inherit;
361
+ font-weight: inherit;
362
+ }
363
+ a {
364
+ color: inherit;
365
+ -webkit-text-decoration: inherit;
366
+ text-decoration: inherit;
367
+ }
368
+ b, strong {
369
+ font-weight: bolder;
370
+ }
371
+ code, kbd, samp, pre {
372
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
373
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
374
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
375
+ font-size: 1em;
376
+ }
377
+ small {
378
+ font-size: 80%;
379
+ }
380
+ sub, sup {
381
+ font-size: 75%;
382
+ line-height: 0;
383
+ position: relative;
384
+ vertical-align: baseline;
385
+ }
386
+ sub {
387
+ bottom: -0.25em;
388
+ }
389
+ sup {
390
+ top: -0.5em;
391
+ }
392
+ table {
393
+ text-indent: 0;
394
+ border-color: inherit;
395
+ border-collapse: collapse;
396
+ }
397
+ :-moz-focusring {
398
+ outline: auto;
399
+ }
400
+ progress {
401
+ vertical-align: baseline;
402
+ }
403
+ summary {
404
+ display: list-item;
405
+ }
406
+ ol, ul, menu {
407
+ list-style: none;
408
+ }
409
+ img, svg, video, canvas, audio, iframe, embed, object {
410
+ display: block;
411
+ vertical-align: middle;
412
+ }
413
+ img, video {
414
+ max-width: 100%;
415
+ height: auto;
416
+ }
417
+ button, input, select, optgroup, textarea, ::file-selector-button {
418
+ font: inherit;
419
+ font-feature-settings: inherit;
420
+ font-variation-settings: inherit;
421
+ letter-spacing: inherit;
422
+ color: inherit;
423
+ border-radius: 0;
424
+ background-color: transparent;
425
+ opacity: 1;
426
+ }
427
+ :where(select:is([multiple], [size])) optgroup {
428
+ font-weight: bolder;
429
+ }
430
+ :where(select:is([multiple], [size])) optgroup option {
431
+ padding-inline-start: 20px;
432
+ }
433
+ ::file-selector-button {
434
+ margin-inline-end: 4px;
435
+ }
436
+ ::placeholder {
437
+ opacity: 1;
438
+ }
439
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
440
+ ::placeholder {
441
+ color: currentcolor;
442
+ @supports (color: color-mix(in lab, red, red)) {
443
+ color: color-mix(in oklab, currentcolor 50%, transparent);
444
+ }
445
+ }
446
+ }
447
+ textarea {
448
+ resize: vertical;
449
+ }
450
+ ::-webkit-search-decoration {
451
+ -webkit-appearance: none;
452
+ }
453
+ ::-webkit-date-and-time-value {
454
+ min-height: 1lh;
455
+ text-align: inherit;
456
+ }
457
+ ::-webkit-datetime-edit {
458
+ display: inline-flex;
459
+ }
460
+ ::-webkit-datetime-edit-fields-wrapper {
461
+ padding: 0;
462
+ }
463
+ ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
464
+ padding-block: 0;
465
+ }
466
+ :-moz-ui-invalid {
467
+ box-shadow: none;
468
+ }
469
+ button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
470
+ appearance: button;
471
+ }
472
+ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
473
+ height: auto;
474
+ }
475
+ [hidden]:where(:not([hidden="until-found"])) {
476
+ display: none !important;
477
+ }
478
+ }
479
+ @layer utilities;
480
+ @layer utilities {
481
+ .bg-background > * {
482
+ color: var(--color-on-background);
483
+ }
484
+ .bg-primary > * {
485
+ color: var(--color-primary);
486
+ }
487
+ .bg-primary-container > * {
488
+ color: var(--color-on-primary-container);
489
+ }
490
+ .bg-secondary > * {
491
+ color: var(--color-on-secondary);
492
+ }
493
+ .bg-secondary-container > * {
494
+ color: var(--color-on-secondary-container);
495
+ }
496
+ .bg-tertiary > * {
497
+ color: var(--color-on-tertiary);
498
+ }
499
+ .bg-tertiary-container > * {
500
+ color: var(--color-on-tertiary-container);
501
+ }
502
+ .bg-error > * {
503
+ color: var(--color-on-error);
504
+ }
505
+ .bg-surface > * {
506
+ color: var(--color-on-surface);
507
+ }
508
+ .bg-surface-variant > * {
509
+ color: var(--color-on-surface-variant);
510
+ }
511
+ .bg-outline > * {
512
+ color: var(--color-on-outline);
513
+ }
514
+ .bg-outline-variant > * {
515
+ color: var(--color-on-outline-variant);
516
+ }
517
+ .bg-shadow > * {
518
+ color: var(--color-on-shadow);
519
+ }
520
+ .bg-scrim > * {
521
+ color: var(--color-on-scrim);
522
+ }
523
+ .bg-inverse-surface > * {
524
+ color: var(--color-on-inverse-surface);
525
+ }
526
+ .bg-inverse-primary > * {
527
+ color: var(--color-on-inverse-primary);
528
+ }
529
+ }
530
+ @layer utilities {
531
+ .bg-primary {
532
+ background: var(--color-primary);
533
+ }
534
+ .text-primary {
535
+ color: var(--color-primary);
536
+ }
537
+ .border-primary {
538
+ border-color: var(--color-primary);
539
+ }
540
+ .ring-primary {
541
+ --tw-ring-color: var(--color-primary);
542
+ }
543
+ .bg-on-primary {
544
+ background: var(--color-on-primary);
545
+ }
546
+ .text-on-primary {
547
+ color: var(--color-on-primary);
548
+ }
549
+ .border-on-primary {
550
+ border-color: var(--color-on-primary);
551
+ }
552
+ .ring-on-primary {
553
+ --tw-ring-color: var(--color-on-primary);
554
+ }
555
+ .bg-primary-container {
556
+ background: var(--color-primary-container);
557
+ }
558
+ .text-primary-container {
559
+ color: var(--color-primary-container);
560
+ }
561
+ .border-primary-container {
562
+ border-color: var(--color-primary-container);
563
+ }
564
+ .ring-primary-container {
565
+ --tw-ring-color: var(--color-primary-container);
566
+ }
567
+ .bg-on-primary-container {
568
+ background: var(--color-on-primary-container);
569
+ }
570
+ .text-on-primary-container {
571
+ color: var(--color-on-primary-container);
572
+ }
573
+ .border-on-primary-container {
574
+ border-color: var(--color-on-primary-container);
575
+ }
576
+ .ring-on-primary-container {
577
+ --tw-ring-color: var(--color-on-primary-container);
578
+ }
579
+ .bg-secondary {
580
+ background: var(--color-secondary);
581
+ }
582
+ .text-secondary {
583
+ color: var(--color-secondary);
584
+ }
585
+ .border-secondary {
586
+ border-color: var(--color-secondary);
587
+ }
588
+ .ring-secondary {
589
+ --tw-ring-color: var(--color-secondary);
590
+ }
591
+ .bg-on-secondary {
592
+ background: var(--color-on-secondary);
593
+ }
594
+ .text-on-secondary {
595
+ color: var(--color-on-secondary);
596
+ }
597
+ .border-on-secondary {
598
+ border-color: var(--color-on-secondary);
599
+ }
600
+ .ring-on-secondary {
601
+ --tw-ring-color: var(--color-on-secondary);
602
+ }
603
+ .bg-secondary-container {
604
+ background: var(--color-secondary-container);
605
+ }
606
+ .text-secondary-container {
607
+ color: var(--color-secondary-container);
608
+ }
609
+ .border-secondary-container {
610
+ border-color: var(--color-secondary-container);
611
+ }
612
+ .ring-secondary-container {
613
+ --tw-ring-color: var(--color-secondary-container);
614
+ }
615
+ .bg-on-secondary-container {
616
+ background: var(--color-on-secondary-container);
617
+ }
618
+ .text-on-secondary-container {
619
+ color: var(--color-on-secondary-container);
620
+ }
621
+ .border-on-secondary-container {
622
+ border-color: var(--color-on-secondary-container);
623
+ }
624
+ .ring-on-secondary-container {
625
+ --tw-ring-color: var(--color-on-secondary-container);
626
+ }
627
+ .bg-tertiary {
628
+ background: var(--color-tertiary);
629
+ }
630
+ .text-tertiary {
631
+ color: var(--color-tertiary);
632
+ }
633
+ .border-tertiary {
634
+ border-color: var(--color-tertiary);
635
+ }
636
+ .ring-tertiary {
637
+ --tw-ring-color: var(--color-tertiary);
638
+ }
639
+ .bg-on-tertiary {
640
+ background: var(--color-on-tertiary);
641
+ }
642
+ .text-on-tertiary {
643
+ color: var(--color-on-tertiary);
644
+ }
645
+ .border-on-tertiary {
646
+ border-color: var(--color-on-tertiary);
647
+ }
648
+ .ring-on-tertiary {
649
+ --tw-ring-color: var(--color-on-tertiary);
650
+ }
651
+ .bg-tertiary-container {
652
+ background: var(--color-tertiary-container);
653
+ }
654
+ .text-tertiary-container {
655
+ color: var(--color-tertiary-container);
656
+ }
657
+ .border-tertiary-container {
658
+ border-color: var(--color-tertiary-container);
659
+ }
660
+ .ring-tertiary-container {
661
+ --tw-ring-color: var(--color-tertiary-container);
662
+ }
663
+ .bg-on-tertiary-container {
664
+ background: var(--color-on-tertiary-container);
665
+ }
666
+ .text-on-tertiary-container {
667
+ color: var(--color-on-tertiary-container);
668
+ }
669
+ .border-on-tertiary-container {
670
+ border-color: var(--color-on-tertiary-container);
671
+ }
672
+ .ring-on-tertiary-container {
673
+ --tw-ring-color: var(--color-on-tertiary-container);
674
+ }
675
+ .bg-error {
676
+ background: var(--color-error);
677
+ }
678
+ .text-error {
679
+ color: var(--color-error);
680
+ }
681
+ .border-error {
682
+ border-color: var(--color-error);
683
+ }
684
+ .ring-error {
685
+ --tw-ring-color: var(--color-error);
686
+ }
687
+ .bg-on-error {
688
+ background: var(--color-on-error);
689
+ }
690
+ .text-on-error {
691
+ color: var(--color-on-error);
692
+ }
693
+ .border-on-error {
694
+ border-color: var(--color-on-error);
695
+ }
696
+ .ring-on-error {
697
+ --tw-ring-color: var(--color-on-error);
698
+ }
699
+ .bg-error-container {
700
+ background: var(--color-error-container);
701
+ }
702
+ .text-error-container {
703
+ color: var(--color-error-container);
704
+ }
705
+ .border-error-container {
706
+ border-color: var(--color-error-container);
707
+ }
708
+ .ring-error-container {
709
+ --tw-ring-color: var(--color-error-container);
710
+ }
711
+ .bg-on-error-container {
712
+ background: var(--color-on-error-container);
713
+ }
714
+ .text-on-error-container {
715
+ color: var(--color-on-error-container);
716
+ }
717
+ .border-on-error-container {
718
+ border-color: var(--color-on-error-container);
719
+ }
720
+ .ring-on-error-container {
721
+ --tw-ring-color: var(--color-on-error-container);
722
+ }
723
+ .bg-background {
724
+ background: var(--color-background);
725
+ }
726
+ .text-background {
727
+ color: var(--color-background);
728
+ }
729
+ .border-background {
730
+ border-color: var(--color-background);
731
+ }
732
+ .ring-background {
733
+ --tw-ring-color: var(--color-background);
734
+ }
735
+ .bg-on-background {
736
+ background: var(--color-on-background);
737
+ }
738
+ .text-on-background {
739
+ color: var(--color-on-background);
740
+ }
741
+ .border-on-background {
742
+ border-color: var(--color-on-background);
743
+ }
744
+ .ring-on-background {
745
+ --tw-ring-color: var(--color-on-background);
746
+ }
747
+ .bg-surface {
748
+ background: var(--color-surface);
749
+ }
750
+ .text-surface {
751
+ color: var(--color-surface);
752
+ }
753
+ .border-surface {
754
+ border-color: var(--color-surface);
755
+ }
756
+ .ring-surface {
757
+ --tw-ring-color: var(--color-surface);
758
+ }
759
+ .bg-on-surface {
760
+ background: var(--color-on-surface);
761
+ }
762
+ .text-on-surface {
763
+ color: var(--color-on-surface);
764
+ }
765
+ .border-on-surface {
766
+ border-color: var(--color-on-surface);
767
+ }
768
+ .ring-on-surface {
769
+ --tw-ring-color: var(--color-on-surface);
770
+ }
771
+ .bg-surface-variant {
772
+ background: var(--color-surface-variant);
773
+ }
774
+ .text-surface-variant {
775
+ color: var(--color-surface-variant);
776
+ }
777
+ .border-surface-variant {
778
+ border-color: var(--color-surface-variant);
779
+ }
780
+ .ring-surface-variant {
781
+ --tw-ring-color: var(--color-surface-variant);
782
+ }
783
+ .bg-on-surface-variant {
784
+ background: var(--color-on-surface-variant);
785
+ }
786
+ .text-on-surface-variant {
787
+ color: var(--color-on-surface-variant);
788
+ }
789
+ .border-on-surface-variant {
790
+ border-color: var(--color-on-surface-variant);
791
+ }
792
+ .ring-on-surface-variant {
793
+ --tw-ring-color: var(--color-on-surface-variant);
794
+ }
795
+ .bg-outline {
796
+ background: var(--color-outline);
797
+ }
798
+ .text-outline {
799
+ color: var(--color-outline);
800
+ }
801
+ .border-outline {
802
+ border-color: var(--color-outline);
803
+ }
804
+ .ring-outline {
805
+ --tw-ring-color: var(--color-outline);
806
+ }
807
+ .bg-outline-variant {
808
+ background: var(--color-outline-variant);
809
+ }
810
+ .text-outline-variant {
811
+ color: var(--color-outline-variant);
812
+ }
813
+ .border-outline-variant {
814
+ border-color: var(--color-outline-variant);
815
+ }
816
+ .ring-outline-variant {
817
+ --tw-ring-color: var(--color-outline-variant);
818
+ }
819
+ .bg-shadow {
820
+ background: var(--color-shadow);
821
+ }
822
+ .text-shadow {
823
+ color: var(--color-shadow);
824
+ }
825
+ .border-shadow {
826
+ border-color: var(--color-shadow);
827
+ }
828
+ .ring-shadow {
829
+ --tw-ring-color: var(--color-shadow);
830
+ }
831
+ .bg-scrim {
832
+ background: var(--color-scrim);
833
+ }
834
+ .text-scrim {
835
+ color: var(--color-scrim);
836
+ }
837
+ .border-scrim {
838
+ border-color: var(--color-scrim);
839
+ }
840
+ .ring-scrim {
841
+ --tw-ring-color: var(--color-scrim);
842
+ }
843
+ .bg-inverse-surface {
844
+ background: var(--color-inverse-surface);
845
+ }
846
+ .text-inverse-surface {
847
+ color: var(--color-inverse-surface);
848
+ }
849
+ .border-inverse-surface {
850
+ border-color: var(--color-inverse-surface);
851
+ }
852
+ .ring-inverse-surface {
853
+ --tw-ring-color: var(--color-inverse-surface);
854
+ }
855
+ .bg-inverse-on-surface {
856
+ background: var(--color-inverse-on-surface);
857
+ }
858
+ .text-inverse-on-surface {
859
+ color: var(--color-inverse-on-surface);
860
+ }
861
+ .border-inverse-on-surface {
862
+ border-color: var(--color-inverse-on-surface);
863
+ }
864
+ .ring-inverse-on-surface {
865
+ --tw-ring-color: var(--color-inverse-on-surface);
866
+ }
867
+ .bg-inverse-primary {
868
+ background: var(--color-inverse-primary);
869
+ }
870
+ .text-inverse-primary {
871
+ color: var(--color-inverse-primary);
872
+ }
873
+ .border-inverse-primary {
874
+ border-color: var(--color-inverse-primary);
875
+ }
876
+ .ring-inverse-primary {
877
+ --tw-ring-color: var(--color-inverse-primary);
878
+ }
879
+ }
880
+ @layer theme, base, components, utilities;
881
+ @layer theme;
882
+ @layer base {
883
+ *, ::after, ::before, ::backdrop, ::file-selector-button {
884
+ box-sizing: border-box;
885
+ margin: 0;
886
+ padding: 0;
887
+ border: 0 solid;
888
+ }
889
+ html, :host {
890
+ line-height: 1.5;
891
+ -webkit-text-size-adjust: 100%;
892
+ tab-size: 4;
893
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
894
+ font-feature-settings: var(--default-font-feature-settings, normal);
895
+ font-variation-settings: var(--default-font-variation-settings, normal);
896
+ -webkit-tap-highlight-color: transparent;
897
+ }
898
+ hr {
899
+ height: 0;
900
+ color: inherit;
901
+ border-top-width: 1px;
902
+ }
903
+ abbr:where([title]) {
904
+ -webkit-text-decoration: underline dotted;
905
+ text-decoration: underline dotted;
906
+ }
907
+ h1, h2, h3, h4, h5, h6 {
908
+ font-size: inherit;
909
+ font-weight: inherit;
910
+ }
911
+ a {
912
+ color: inherit;
913
+ -webkit-text-decoration: inherit;
914
+ text-decoration: inherit;
915
+ }
916
+ b, strong {
917
+ font-weight: bolder;
918
+ }
919
+ code, kbd, samp, pre {
920
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
921
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
922
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
923
+ font-size: 1em;
924
+ }
925
+ small {
926
+ font-size: 80%;
927
+ }
928
+ sub, sup {
929
+ font-size: 75%;
930
+ line-height: 0;
931
+ position: relative;
932
+ vertical-align: baseline;
933
+ }
934
+ sub {
935
+ bottom: -0.25em;
936
+ }
937
+ sup {
938
+ top: -0.5em;
939
+ }
940
+ table {
941
+ text-indent: 0;
942
+ border-color: inherit;
943
+ border-collapse: collapse;
944
+ }
945
+ :-moz-focusring {
946
+ outline: auto;
947
+ }
948
+ progress {
949
+ vertical-align: baseline;
950
+ }
951
+ summary {
952
+ display: list-item;
953
+ }
954
+ ol, ul, menu {
955
+ list-style: none;
956
+ }
957
+ img, svg, video, canvas, audio, iframe, embed, object {
958
+ display: block;
959
+ vertical-align: middle;
960
+ }
961
+ img, video {
962
+ max-width: 100%;
963
+ height: auto;
964
+ }
965
+ button, input, select, optgroup, textarea, ::file-selector-button {
966
+ font: inherit;
967
+ font-feature-settings: inherit;
968
+ font-variation-settings: inherit;
969
+ letter-spacing: inherit;
970
+ color: inherit;
971
+ border-radius: 0;
972
+ background-color: transparent;
973
+ opacity: 1;
974
+ }
975
+ :where(select:is([multiple], [size])) optgroup {
976
+ font-weight: bolder;
977
+ }
978
+ :where(select:is([multiple], [size])) optgroup option {
979
+ padding-inline-start: 20px;
980
+ }
981
+ ::file-selector-button {
982
+ margin-inline-end: 4px;
983
+ }
984
+ ::placeholder {
985
+ opacity: 1;
986
+ }
987
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
988
+ ::placeholder {
989
+ color: currentcolor;
990
+ @supports (color: color-mix(in lab, red, red)) {
991
+ color: color-mix(in oklab, currentcolor 50%, transparent);
992
+ }
993
+ }
994
+ }
995
+ textarea {
996
+ resize: vertical;
997
+ }
998
+ ::-webkit-search-decoration {
999
+ -webkit-appearance: none;
1000
+ }
1001
+ ::-webkit-date-and-time-value {
1002
+ min-height: 1lh;
1003
+ text-align: inherit;
1004
+ }
1005
+ ::-webkit-datetime-edit {
1006
+ display: inline-flex;
1007
+ }
1008
+ ::-webkit-datetime-edit-fields-wrapper {
1009
+ padding: 0;
1010
+ }
1011
+ ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
1012
+ padding-block: 0;
1013
+ }
1014
+ :-moz-ui-invalid {
1015
+ box-shadow: none;
1016
+ }
1017
+ button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
1018
+ appearance: button;
1019
+ }
1020
+ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
1021
+ height: auto;
1022
+ }
1023
+ [hidden]:where(:not([hidden="until-found"])) {
1024
+ display: none !important;
1025
+ }
1026
+ }
1027
+ @layer utilities;
1028
+ @layer base {
1029
+ html, body {
1030
+ width: 100%;
1031
+ height: 100%;
1032
+ margin: 0;
1033
+ padding: 0;
1034
+ }
1035
+ }
324
1036
  @property --tw-font-weight {
325
1037
  syntax: "*";
326
1038
  inherits: false;
327
1039
  }
1040
+ @property --tw-shadow {
1041
+ syntax: "*";
1042
+ inherits: false;
1043
+ initial-value: 0 0 #0000;
1044
+ }
1045
+ @property --tw-shadow-color {
1046
+ syntax: "*";
1047
+ inherits: false;
1048
+ }
1049
+ @property --tw-shadow-alpha {
1050
+ syntax: "<percentage>";
1051
+ inherits: false;
1052
+ initial-value: 100%;
1053
+ }
1054
+ @property --tw-inset-shadow {
1055
+ syntax: "*";
1056
+ inherits: false;
1057
+ initial-value: 0 0 #0000;
1058
+ }
1059
+ @property --tw-inset-shadow-color {
1060
+ syntax: "*";
1061
+ inherits: false;
1062
+ }
1063
+ @property --tw-inset-shadow-alpha {
1064
+ syntax: "<percentage>";
1065
+ inherits: false;
1066
+ initial-value: 100%;
1067
+ }
1068
+ @property --tw-ring-color {
1069
+ syntax: "*";
1070
+ inherits: false;
1071
+ }
1072
+ @property --tw-ring-shadow {
1073
+ syntax: "*";
1074
+ inherits: false;
1075
+ initial-value: 0 0 #0000;
1076
+ }
1077
+ @property --tw-inset-ring-color {
1078
+ syntax: "*";
1079
+ inherits: false;
1080
+ }
1081
+ @property --tw-inset-ring-shadow {
1082
+ syntax: "*";
1083
+ inherits: false;
1084
+ initial-value: 0 0 #0000;
1085
+ }
1086
+ @property --tw-ring-inset {
1087
+ syntax: "*";
1088
+ inherits: false;
1089
+ }
1090
+ @property --tw-ring-offset-width {
1091
+ syntax: "<length>";
1092
+ inherits: false;
1093
+ initial-value: 0px;
1094
+ }
1095
+ @property --tw-ring-offset-color {
1096
+ syntax: "*";
1097
+ inherits: false;
1098
+ initial-value: #fff;
1099
+ }
1100
+ @property --tw-ring-offset-shadow {
1101
+ syntax: "*";
1102
+ inherits: false;
1103
+ initial-value: 0 0 #0000;
1104
+ }
1105
+ @property --tw-outline-style {
1106
+ syntax: "*";
1107
+ inherits: false;
1108
+ initial-value: solid;
1109
+ }
328
1110
  @layer properties {
329
1111
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
330
1112
  *, ::before, ::after, ::backdrop {
331
1113
  --tw-font-weight: initial;
1114
+ --tw-shadow: 0 0 #0000;
1115
+ --tw-shadow-color: initial;
1116
+ --tw-shadow-alpha: 100%;
1117
+ --tw-inset-shadow: 0 0 #0000;
1118
+ --tw-inset-shadow-color: initial;
1119
+ --tw-inset-shadow-alpha: 100%;
1120
+ --tw-ring-color: initial;
1121
+ --tw-ring-shadow: 0 0 #0000;
1122
+ --tw-inset-ring-color: initial;
1123
+ --tw-inset-ring-shadow: 0 0 #0000;
1124
+ --tw-ring-inset: initial;
1125
+ --tw-ring-offset-width: 0px;
1126
+ --tw-ring-offset-color: #fff;
1127
+ --tw-ring-offset-shadow: 0 0 #0000;
1128
+ --tw-outline-style: solid;
332
1129
  }
333
1130
  }
334
1131
  }
@@ -0,0 +1,4 @@
1
+ export { theme_state as theme } from './stores.svelte';
2
+ export { default as ThemeInit } from './theme-init/components/theme-init.svelte';
3
+ export type { tThemeInitProps } from './theme-init/types';
4
+ export * from "./logic";
@@ -0,0 +1,6 @@
1
+ // Stores
2
+ export { theme_state as theme } from './stores.svelte';
3
+ // Component
4
+ export { default as ThemeInit } from './theme-init/components/theme-init.svelte';
5
+ // Logic
6
+ export * from "./logic";
@@ -0,0 +1,4 @@
1
+ import { Mode, Variant } from "./types";
2
+ export declare function saveTheme(theme: object): void;
3
+ export declare function build(seedHex: string, mode?: Mode, variant?: Variant, contrast?: number): any;
4
+ export declare function applyScheme(scheme: any): any;
@@ -0,0 +1,71 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { argbFromHex, SchemeTonalSpot, Hct, hexFromArgb, SchemeContent, SchemeExpressive, SchemeFidelity, SchemeFruitSalad, SchemeMonochrome, SchemeNeutral, SchemeRainbow, SchemeVibrant } from '@material/material-color-utilities';
3
+ export function saveTheme(theme) {
4
+ var expires = new Date();
5
+ expires.setFullYear(expires.getFullYear() + 10);
6
+ document.cookie = "md-theme=".concat(JSON.stringify(theme), "; expires=").concat(expires.toUTCString(), "; path=/");
7
+ }
8
+ export function build(seedHex, mode, variant, contrast) {
9
+ if (mode === void 0) { mode = "dark"; }
10
+ if (variant === void 0) { variant = "vibrant"; }
11
+ if (contrast === void 0) { contrast = 0; }
12
+ var variant_map = {
13
+ "content": SchemeContent,
14
+ "expressive": SchemeExpressive,
15
+ "fidelity": SchemeFidelity,
16
+ "fruit-salad": SchemeFruitSalad,
17
+ "monochrome": SchemeMonochrome,
18
+ "neutral": SchemeNeutral,
19
+ "rainbow": SchemeRainbow,
20
+ "tonal-spot": SchemeTonalSpot,
21
+ "vibrant": SchemeVibrant
22
+ };
23
+ if (!(variant in variant_map)) {
24
+ variant = "content";
25
+ }
26
+ var source = Hct.fromInt(argbFromHex(seedHex));
27
+ var isDark = mode === "dark";
28
+ var scheme = new variant_map[variant](source, isDark, contrast);
29
+ return scheme;
30
+ }
31
+ export function applyScheme(scheme) {
32
+ var map = {
33
+ "--color-primary": scheme.primary,
34
+ "--color-on-primary": scheme.onPrimary,
35
+ "--color-primary-container": scheme.primaryContainer,
36
+ "--color-on-primary-container": scheme.onPrimaryContainer,
37
+ "--color-secondary": scheme.secondary,
38
+ "--color-on-secondary": scheme.onSecondary,
39
+ "--color-secondary-container": scheme.secondaryContainer,
40
+ "--color-on-secondary-container": scheme.onSecondaryContainer,
41
+ "--color-tertiary": scheme.tertiary,
42
+ "--color-on-tertiary": scheme.onTertiary,
43
+ "--color-tertiary-container": scheme.tertiaryContainer,
44
+ "--color-on-tertiary-container": scheme.onTertiaryContainer,
45
+ "--color-error": scheme.error,
46
+ "--color-on-error": scheme.onError,
47
+ "--color-error-container": scheme.errorContainer,
48
+ "--color-on-error-container": scheme.onErrorContainer,
49
+ "--color-background": scheme.background,
50
+ "--color-on-background": scheme.onBackground,
51
+ "--color-surface": scheme.surface,
52
+ "--color-on-surface": scheme.onSurface,
53
+ "--color-surface-variant": scheme.surfaceVariant,
54
+ "--color-on-surface-variant": scheme.onSurfaceVariant,
55
+ "--color-outline": scheme.outline,
56
+ "--color-outline-variant": scheme.outlineVariant,
57
+ "--color-shadow": scheme.shadow,
58
+ "--color-scrim": scheme.scrim,
59
+ "--color-inverse-surface": scheme.inverseSurface,
60
+ "--color-inverse-on-surface": scheme.inverseOnSurface,
61
+ "--color-inverse-primary": scheme.inversePrimary
62
+ };
63
+ var out = {};
64
+ var root = document.documentElement;
65
+ for (var _i = 0, _a = Object.entries(map); _i < _a.length; _i++) {
66
+ var _b = _a[_i], name = _b[0], argb = _b[1];
67
+ out[name] = hexFromArgb(argb);
68
+ root.style.setProperty(name, hexFromArgb(argb));
69
+ }
70
+ return out;
71
+ }
@@ -0,0 +1,24 @@
1
+ export const theme_state: ThemeState;
2
+ /**
3
+ * Class representing the current state of the theme
4
+ *
5
+ * If either `mode`, `variant` or `seedColor` are updated, the whole theme will refresh
6
+ */
7
+ declare class ThemeState {
8
+ /**
9
+ * Current mode of the theme, either light or dark
10
+ * @type {"dark"|"light"|undefined}
11
+ */
12
+ mode: "dark" | "light" | undefined;
13
+ /**
14
+ * Variant of the theme, Changes the look and feel of the used colors
15
+ * @type {"content"|"expressive"|"fidelity"|"fruit-salad"|"monochrome"|"neutral"|"rainbow"|"tonal-spot"|"vibrant"|undefined}
16
+ */
17
+ variant: "content" | "expressive" | "fidelity" | "fruit-salad" | "monochrome" | "neutral" | "rainbow" | "tonal-spot" | "vibrant" | undefined;
18
+ /**
19
+ * Main color used to generate the theme.
20
+ * @type {string|undefined}
21
+ */
22
+ seedColor: string | undefined;
23
+ }
24
+ export {};
@@ -0,0 +1,33 @@
1
+
2
+
3
+
4
+ /**
5
+ * Class representing the current state of the theme
6
+ *
7
+ * If either `mode`, `variant` or `seedColor` are updated, the whole theme will refresh
8
+ */
9
+ class ThemeState {
10
+
11
+ /**
12
+ * Current mode of the theme, either light or dark
13
+ * @type {"dark"|"light"|undefined}
14
+ */
15
+ mode = $state(undefined)
16
+
17
+ /**
18
+ * Variant of the theme, Changes the look and feel of the used colors
19
+ * @type {"content"|"expressive"|"fidelity"|"fruit-salad"|"monochrome"|"neutral"|"rainbow"|"tonal-spot"|"vibrant"|undefined}
20
+ */
21
+ variant = $state(undefined)
22
+
23
+ /**
24
+ * Main color used to generate the theme.
25
+ * @type {string|undefined}
26
+ */
27
+ seedColor = $state(undefined)
28
+ }
29
+
30
+ const theme_state = new ThemeState();
31
+
32
+ export { theme_state }
33
+
@@ -0,0 +1,93 @@
1
+ <script lang="ts">
2
+ // --- Logic ---
3
+ import { cn } from '../../../utils';
4
+ import type { Props } from '..';
5
+ import { onMount } from 'svelte';
6
+
7
+ // === State ===
8
+ import { theme, build, applyScheme, saveTheme } from '../..';
9
+
10
+ const {
11
+ defaults = {
12
+ defaultMode: 'dark',
13
+ defaultVariant: 'vibrant',
14
+ defaultSeedColor: '#f8b518'
15
+ }
16
+ }: Props = $props();
17
+
18
+ /**
19
+ * Checks if the user already has a set md-theme
20
+ */
21
+ function hasTheme() {
22
+ const match = document.cookie.match(/(?:^|;\s*)md-theme=([^;]*)/);
23
+ return match ? true : false;
24
+ }
25
+
26
+ /**
27
+ * Returns a fallback value if designated value is undefined
28
+ * @param value Value to return normally
29
+ * @param _default default if value is undefined
30
+ */
31
+ function fallback(value: any, _default: any) {
32
+ return value === undefined ? _default : value;
33
+ }
34
+
35
+ // Whenever any state changes, refresh theme
36
+ $effect(() => {
37
+ // Get fallback values
38
+ theme.mode = fallback(theme.mode, defaults.defaultMode);
39
+ theme.variant = fallback(theme.variant, defaults.defaultVariant);
40
+ theme.seedColor = fallback(theme.seedColor, defaults.defaultSeedColor);
41
+
42
+ // Build the theme with material utilities
43
+ const built = build(theme.seedColor, theme.mode, theme.variant);
44
+
45
+ // Create css variables object and save to body
46
+ const applied = applyScheme(built);
47
+
48
+ // Save the theme to the user's cookies
49
+ saveTheme(applied);
50
+ });
51
+ </script>
52
+
53
+ <svelte:head>
54
+ <!-- ============== Theme Script ============== -->
55
+ <script>
56
+ /**
57
+ * Attempts to get the current theme stored in the user's cookies, returns it, otherwise undefined
58
+ * @return {Object|undefined} The theme or undefined
59
+ */
60
+ function getTheme() {
61
+ const match = document.cookie.match(/(?:^|;\s*)md-theme=([^;]*)/);
62
+ return match ? JSON.parse(decodeURIComponent(match[1])) : undefined;
63
+ }
64
+
65
+ /**
66
+ * Attempts to apply a given theme
67
+ * @param {Object|undefined} theme - The theme to be applied, if undefined, this method does nothing
68
+ */
69
+ function applyTheme(theme) {
70
+ if (theme === undefined) {
71
+ console.warn('No theme specified, defaulting to doing nothing');
72
+ return;
73
+ }
74
+
75
+ for (const [name, hex] of Object.entries(theme)) {
76
+ console.info(`Setting ${name} to ${hex}`);
77
+ document.documentElement.style.setProperty(name, hex);
78
+ }
79
+ }
80
+
81
+ applyTheme(getTheme());
82
+ </script>
83
+ </svelte:head>
84
+
85
+ <!--@component
86
+ ---
87
+ name: ThemeInit
88
+ props:
89
+ defaultSeed (undefined|string) = undefine Default color seed for the theme.
90
+ ---
91
+
92
+ Used to initialize the theme within your projects
93
+ -->
@@ -0,0 +1,13 @@
1
+ import type { Props } from '..';
2
+ /**
3
+ * ---
4
+ * name: ThemeInit
5
+ * props:
6
+ * defaultSeed (undefined|string) = undefine Default color seed for the theme.
7
+ * ---
8
+ *
9
+ * Used to initialize the theme within your projects
10
+ */
11
+ declare const ThemeInit: import("svelte").Component<Props, {}, "">;
12
+ type ThemeInit = ReturnType<typeof ThemeInit>;
13
+ export default ThemeInit;
@@ -0,0 +1,2 @@
1
+ export { default as _, default as Root } from "./components/theme-init.svelte";
2
+ export type { tThemeInitProps as Props, } from "./types";
@@ -0,0 +1 @@
1
+ export { default as _, default as Root } from "./components/theme-init.svelte";
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ /**
3
+ * Possible default types, object contains
4
+ * `defaultMode`,
5
+ * `defaultVariant`,
6
+ * `defaultSeedColor`
7
+ */
8
+ export type tDefaults = {
9
+ defaultMode: 'dark' | 'light' | undefined;
10
+ defaultVariant: 'content' | 'expressive' | 'fidelity' | 'fruit-salad' | 'monochrome' | 'neutral' | 'rainbow' | 'tonal-spot' | 'vibrant' | undefined;
11
+ defaultSeedColor: string | undefined;
12
+ };
13
+ export type tThemeInitProps = HTMLAttributes<HTMLDivElement> & {
14
+ defaults?: tDefaults;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type Mode = string | "light" | "dark";
2
+ export type Variant = string | "content" | "expressive" | "fidelity" | "fruit-salad" | "monochrome" | "neutral" | "rainbow" | "tonal-spot" | "vibrant";
@@ -0,0 +1 @@
1
+ export {};
@@ -6,20 +6,51 @@
6
6
  let {
7
7
  children,
8
8
  class: className,
9
+
10
+ // Flex Box
9
11
  flex = $bindable(undefined),
10
12
  row = $bindable(undefined),
11
13
  col = $bindable(undefined),
14
+
15
+ // Positioning
12
16
  center = $bindable(undefined),
13
17
  centerx = $bindable(undefined),
14
18
  centery = $bindable(undefined),
19
+
20
+ // Size Fillings
15
21
  fill = $bindable(undefined),
16
22
  fillw = $bindable(undefined),
17
23
  fillh = $bindable(undefined),
24
+
25
+ // Flex Config
18
26
  noshrink = $bindable(undefined),
27
+
28
+ // Aspect Ratios
19
29
  aspectSquare = $bindable(undefined),
30
+
31
+ // Cursor options
20
32
  cursorAuto = $bindable(undefined),
21
33
  cursorDefault = $bindable(undefined),
22
34
  cursorPointer = $bindable(undefined),
35
+
36
+ // Theme Colors
37
+ background = $bindable(undefined),
38
+ primary = $bindable(undefined),
39
+ primaryContainer = $bindable(undefined),
40
+ secondary = $bindable(undefined),
41
+ secondaryContainer = $bindable(undefined),
42
+ tertiary = $bindable(undefined),
43
+ tertiaryContainer = $bindable(undefined),
44
+ error = $bindable(undefined),
45
+ surface = $bindable(undefined),
46
+ surfaceVariant = $bindable(undefined),
47
+ outline = $bindable(undefined),
48
+ outlineVariant = $bindable(undefined),
49
+ shadow = $bindable(undefined),
50
+ scrim = $bindable(undefined),
51
+ inverseSurface = $bindable(undefined),
52
+ inversePrimary = $bindable(undefined),
53
+
23
54
  ...rest
24
55
  }: Props = $props();
25
56
 
@@ -57,6 +88,25 @@
57
88
  tokenInstance.addTokenIf(cursorAuto, 'cursor-auto');
58
89
  tokenInstance.addTokenIf(cursorDefault, 'cursor-default');
59
90
  tokenInstance.addTokenIf(cursorPointer, 'cursor-pointer');
91
+
92
+ // Background Options
93
+ tokenInstance.addTokenIf(background, 'bg-background');
94
+ tokenInstance.addTokenIf(primary, 'bg-primary');
95
+ tokenInstance.addTokenIf(primaryContainer, 'bg-primary-container');
96
+ tokenInstance.addTokenIf(secondary, 'bg-secondary');
97
+ tokenInstance.addTokenIf(secondaryContainer, 'bg-secondary-container');
98
+ tokenInstance.addTokenIf(tertiary, 'bg-tertiary');
99
+ tokenInstance.addTokenIf(tertiaryContainer, 'bg-tertiary-container');
100
+ tokenInstance.addTokenIf(error, 'bg-error');
101
+ tokenInstance.addTokenIf(surface, 'bg-surface');
102
+ tokenInstance.addTokenIf(surfaceVariant, 'bg-surface-variant');
103
+ tokenInstance.addTokenIf(outline, 'bg-outline');
104
+ tokenInstance.addTokenIf(outlineVariant, 'bg-outline-variant');
105
+ tokenInstance.addTokenIf(shadow, 'bg-shadow');
106
+ tokenInstance.addTokenIf(scrim, 'bg-scrim');
107
+ tokenInstance.addTokenIf(inverseSurface, 'bg-inverse-surface');
108
+ tokenInstance.addTokenIf(inversePrimary, 'bg-inverse-primary');
109
+
60
110
  </script>
61
111
 
62
112
  <div class={cn(tokenInstance.className)} {...rest}>
@@ -17,6 +17,6 @@ import type { Props } from '..';
17
17
  * This will create a flex container that is a row, centered, and fills the available space.
18
18
  * The `class` prop can be used to add additional classes to the frame, and the `children` prop can be used to pass in child components.
19
19
  */
20
- declare const Frame: import("svelte").Component<Props, {}, "flex" | "row" | "col" | "centerx" | "centery" | "center" | "fill" | "fillw" | "fillh" | "noshrink" | "aspectSquare" | "cursorAuto" | "cursorDefault" | "cursorPointer">;
20
+ declare const Frame: import("svelte").Component<Props, {}, "flex" | "row" | "col" | "centerx" | "centery" | "center" | "fill" | "fillw" | "fillh" | "noshrink" | "aspectSquare" | "cursorAuto" | "cursorDefault" | "cursorPointer" | "background" | "primary" | "primaryContainer" | "secondary" | "secondaryContainer" | "tertiary" | "tertiaryContainer" | "error" | "surface" | "surfaceVariant" | "outline" | "outlineVariant" | "shadow" | "scrim" | "inverseSurface" | "inversePrimary">;
21
21
  type Frame = ReturnType<typeof Frame>;
22
22
  export default Frame;
@@ -14,4 +14,20 @@ export type tFrameProps = HTMLAttributes<HTMLDivElement> & {
14
14
  cursorAuto?: boolean;
15
15
  cursorDefault?: boolean;
16
16
  cursorPointer?: boolean;
17
+ background?: boolean;
18
+ primary?: boolean;
19
+ primaryContainer?: boolean;
20
+ secondary?: boolean;
21
+ secondaryContainer?: boolean;
22
+ tertiary?: boolean;
23
+ tertiaryContainer?: boolean;
24
+ error?: boolean;
25
+ surface?: boolean;
26
+ surfaceVariant?: boolean;
27
+ outline?: boolean;
28
+ outlineVariant?: boolean;
29
+ shadow?: boolean;
30
+ scrim?: boolean;
31
+ inverseSurface?: boolean;
32
+ inversePrimary?: boolean;
17
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sk-clib",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -19,6 +19,11 @@
19
19
  },
20
20
  "./style": {
21
21
  "default": "./dist/styles.css"
22
+ },
23
+ "./theme": {
24
+ "types": "./dist/theme/index.d.ts",
25
+ "svelte": "./dist/theme/index.js",
26
+ "default": "./dist/theme/index.js"
22
27
  }
23
28
  },
24
29
  "svelte": "./dist/index.js",
@@ -38,7 +43,8 @@
38
43
  },
39
44
  "peerDependencies": {
40
45
  "@sveltejs/kit": "^2.0.0",
41
- "svelte": "^5.0.0"
46
+ "svelte": "^5.0.0",
47
+ "@material/material-color-utilities": "^0.3.0"
42
48
  },
43
49
  "devDependencies": {
44
50
  "@iconify-json/mdi": "^1.2.3",
@@ -73,6 +79,7 @@
73
79
  "@tailwindcss/vite": "^4.1.7",
74
80
  "mdsvex": "^0.12.6",
75
81
  "semantic-release": "^24.2.4",
76
- "tailwind-merge": "^3.2.0"
82
+ "tailwind-merge": "^3.2.0",
83
+ "@material/material-color-utilities": "^0.3.0"
77
84
  }
78
85
  }