basecoat-css 0.1.2 → 0.2.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/basecoat.css CHANGED
@@ -161,7 +161,6 @@
161
161
  h2 {
162
162
  @apply col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight;
163
163
  }
164
-
165
164
  section {
166
165
  @apply text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed;
167
166
 
@@ -446,39 +445,86 @@
446
445
  /* Dialog */
447
446
  @layer components {
448
447
  .dialog {
449
- [role='dialog'] {
450
- @apply fixed inset-0 z-50 bg-black/50 opacity-0 invisible transition-all;
448
+ @apply inset-y-0 opacity-0 transition-all transition-discrete;
451
449
 
452
- &:not([inert]),
453
- &[inert='false'] {
454
- @apply opacity-100 visible;
455
- > article {
456
- @apply opacity-100 scale-100 visible;
457
- }
450
+ &:is([open],:popover-open) {
451
+ @apply opacity-100;
452
+
453
+ &::backdrop {
454
+ @apply opacity-100;
458
455
  }
459
456
  > article {
460
- @apply bg-background fixed top-[50%] left-[50%] z-50 flex flex-col w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg opacity-0 scale-95 invisible transition-all max-h-[calc(100%-2rem)];
457
+ @apply scale-100;
458
+ }
461
459
 
462
- > header {
463
- @apply flex flex-col gap-2 text-center sm:text-left;
460
+ @starting-style {
461
+ @apply opacity-0;
464
462
 
465
- > h2 {
466
- @apply text-lg leading-none font-semibold;
467
- }
468
- > p {
469
- @apply text-muted-foreground text-sm;
470
- }
463
+ &::backdrop {
464
+ @apply opacity-0;
471
465
  }
472
- > section {
473
- @apply flex-1 -mx-6 px-6;
466
+ > article {
467
+ @apply scale-95;
468
+ }
469
+ }
470
+ }
471
+ &::backdrop {
472
+ @apply bg-black/50 opacity-0 transition-all transition-discrete;
473
+ }
474
+ > article {
475
+ @apply bg-background fixed top-[50%] left-[50%] z-50 flex flex-col w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg max-h-[calc(100%-2rem)];
476
+ @apply transition-all scale-95;
477
+
478
+ > header {
479
+ @apply flex flex-col gap-2 text-center sm:text-left;
480
+
481
+ > h2 {
482
+ @apply text-lg leading-none font-semibold;
474
483
  }
475
- > footer {
476
- @apply flex flex-col-reverse gap-2 sm:flex-row sm:justify-end;
484
+ > p {
485
+ @apply text-muted-foreground text-sm;
477
486
  }
487
+ }
488
+ > section {
489
+ @apply flex-1 -mx-6 px-6;
490
+ }
491
+ > footer {
492
+ @apply flex flex-col-reverse gap-2 sm:flex-row sm:justify-end;
493
+ }
494
+ > form[method='dialog'] {
495
+ @apply absolute top-4 right-4;
478
496
  > button {
479
- @apply ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4;
497
+ @apply ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4;
498
+ }
499
+ }
500
+ }
501
+ }
502
+ }
503
+
504
+ /* Dropdown Menu */
505
+ @layer components {
506
+ .dropdown-menu {
507
+ @apply relative inline-flex p-1;
508
+
509
+ [data-popover] {
510
+ @apply p-1;
511
+ min-width: anchor-size(width);
512
+
513
+ [role='menuitem'],
514
+ [role='menuitemcheckbox'],
515
+ [role='menuitemradio'] {
516
+ @apply aria-hidden:hidden [&_svg]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg]:shrink-0 [&_svg]:size-4 aria-disabled:opacity-50 aria-disabled:pointer-events-none disabled:opacity-50 disabled:pointer-events-none w-full truncate;
517
+ @apply focus-visible:bg-accent focus-visible:text-accent-foreground hover:bg-accent hover:text-accent-foreground;
518
+ &.active {
519
+ @apply bg-accent text-accent-foreground;
480
520
  }
481
521
  }
522
+ [role='menu'] [role="presentation"] {
523
+ @apply flex px-2 py-1.5 text-sm font-medium;
524
+ }
525
+ [role='separator'] {
526
+ @apply border-border -mx-1 my-1;
527
+ }
482
528
  }
483
529
  }
484
530
  }
@@ -532,121 +578,74 @@
532
578
 
533
579
  /* Popover */
534
580
  @layer components {
535
- .popover {
536
- @apply relative inline-flex;
537
-
538
- > [data-popover] {
539
- @apply absolute bg-popover text-popover-foreground overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md z-50 visible opacity-100 scale-100 min-w-full w-max transition-all;
581
+ [data-popover] {
582
+ @apply absolute bg-popover text-popover-foreground overflow-x-hidden overflow-y-auto rounded-md border shadow-md z-50 visible opacity-100 scale-100 min-w-full w-max transition-all;
540
583
 
541
- &[aria-hidden='true'] {
542
- @apply invisible opacity-0 scale-95;
543
-
544
- &:not([data-side]),
545
- &[data-side='bottom'] {
546
- @apply -translate-y-2;
547
- }
548
- &[data-side='top'] {
549
- @apply translate-y-2;
550
- }
551
- &[data-side='left'] {
552
- @apply translate-x-2;
553
- }
554
- &[data-side='right'] {
555
- @apply -translate-x-2;
556
- }
557
- }
584
+ &[aria-hidden='true'] {
585
+ @apply invisible opacity-0 scale-95;
586
+
558
587
  &:not([data-side]),
559
588
  &[data-side='bottom'] {
560
- @apply mt-1 top-full;
589
+ @apply -translate-y-2;
561
590
  }
562
591
  &[data-side='top'] {
563
- @apply mb-1 bottom-full;
592
+ @apply translate-y-2;
564
593
  }
565
594
  &[data-side='left'] {
566
- @apply mr-1 right-full;
567
- }
568
- &[data-side='right'] {
569
- @apply ml-1 left-full;
570
- }
571
- &:not([data-side]),
572
- &[data-side='bottom'],
573
- &[data-side='top'] {
574
- &:not([data-align]),
575
- &[data-align='start'] {
576
- @apply left-0;
577
- }
578
- &[data-align='end'] {
579
- @apply right-0;
580
- }
581
- &[data-align='center'] {
582
- @apply left-1/2 -translate-x-1/2;
583
- }
595
+ @apply translate-x-2;
584
596
  }
585
- &[data-side='left'],
586
597
  &[data-side='right'] {
587
- &:not([data-align]),
588
- &[data-align='start'] {
589
- @apply top-0;
590
- }
591
- &[data-align='end'] {
592
- @apply bottom-0;
593
- }
594
- &[data-align='center'] {
595
- @apply top-1/2 -translate-y-1/2;
596
- }
597
- }
598
- [role='menuitem'],
599
- [role='menuitemcheckbox'],
600
- [role='menuitemradio'],
601
- [role='option'] {
602
- @apply aria-hidden:hidden [&_svg]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg]:shrink-0 [&_svg]:size-4 aria-disabled:opacity-50 aria-disabled:pointer-events-none disabled:opacity-50 disabled:pointer-events-none w-full truncate;
603
- }
604
- [role='menuitem'],
605
- [role='menuitemcheckbox'],
606
- [role='menuitemradio'] {
607
- @apply focus-visible:bg-accent focus-visible:text-accent-foreground hover:bg-accent hover:text-accent-foreground;
608
- }
609
- [role='option'] {
610
- @apply data-[focus]:bg-accent data-[focus]:text-accent-foreground pr-7.5;
611
-
612
- &[aria-selected='true'] {
613
- @apply bg-[image:var(--check-icon)] bg-no-repeat bg-position-[center_right_0.5rem] bg-size-[0.875rem];
614
- }
615
- }
616
- [role='menu'] [role='heading'] {
617
- @apply flex px-2 py-1.5 text-sm font-medium;
618
- }
619
- [role='listbox'] [role='heading'] {
620
- @apply flex text-muted-foreground px-2 py-1.5 text-xs;
598
+ @apply -translate-x-2;
621
599
  }
622
- [role='listbox'] [role='group']:not(:has([role='option']:not([aria-hidden='true']))) {
623
- @apply hidden;
600
+ }
601
+ &:not([data-side]),
602
+ &[data-side='bottom'] {
603
+ @apply mt-1 top-full;
604
+ }
605
+ &[data-side='top'] {
606
+ @apply mb-1 bottom-full;
607
+ }
608
+ &[data-side='left'] {
609
+ @apply mr-1 right-full;
610
+ }
611
+ &[data-side='right'] {
612
+ @apply ml-1 left-full;
613
+ }
614
+ &:not([data-side]),
615
+ &[data-side='bottom'],
616
+ &[data-side='top'] {
617
+ &:not([data-align]),
618
+ &[data-align='start'] {
619
+ @apply left-0;
624
620
  }
625
- [role='separator'] {
626
- @apply border-border -mx-1 my-1;
621
+ &[data-align='end'] {
622
+ @apply right-0;
627
623
  }
628
- /* Combobox */
629
- > header {
630
- @apply flex h-9 items-center gap-2 border-b px-3 -mx-1 -mt-1 mb-1;
631
-
632
- svg {
633
- @apply size-4 shrink-0 opacity-50;
634
- }
635
- input[role='combobox'] {
636
- @apply placeholder:text-muted-foreground flex h-10 flex-1 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50 min-w-0;
637
- }
624
+ &[data-align='center'] {
625
+ @apply left-1/2 -translate-x-1/2;
638
626
  }
639
- [role='listbox']:not(:has([data-value]:not([aria-hidden='true'])))::before {
640
- @apply flex items-center justify-center p-6 text-sm truncate;
627
+ }
628
+ &[data-side='left'],
629
+ &[data-side='right'] {
630
+ &:not([data-align]),
631
+ &[data-align='start'] {
632
+ @apply top-0;
641
633
  }
642
- [role='listbox'][data-empty]:not(:has([data-value]:not([aria-hidden='true'])))::before {
643
- @apply content-[attr(data-empty)];
634
+ &[data-align='end'] {
635
+ @apply bottom-0;
644
636
  }
645
- [role='listbox']:not([data-empty]):not(:has([data-value]:not([aria-hidden='true'])))::before {
646
- @apply content-['No_results_found'];
637
+ &[data-align='center'] {
638
+ @apply top-1/2 -translate-y-1/2;
647
639
  }
648
640
  }
649
641
  }
642
+ .popover {
643
+ @apply relative inline-flex;
644
+
645
+ [data-popover] {
646
+ @apply p-4;
647
+ }
648
+ }
650
649
  }
651
650
 
652
651
  /* Radio */
@@ -713,7 +712,7 @@
713
712
  /* Select */
714
713
  @layer components {
715
714
  .form select,
716
- .select {
715
+ select.select {
717
716
  @apply appearance-none border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent pl-3 pr-9 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 h-9;
718
717
  @apply bg-[image:var(--chevron-down-icon-50)] bg-no-repeat bg-position-[center_right_0.75rem] bg-size-[1rem];
719
718
 
@@ -722,11 +721,60 @@
722
721
  @apply bg-popover text-popover-foreground;
723
722
  }
724
723
  }
724
+ *:not(select).select {
725
+ @apply relative inline-flex;
726
+
727
+ [data-popover] {
728
+ @apply p-1;
729
+
730
+ [role='option'] {
731
+ @apply aria-hidden:hidden [&_svg]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm pl-2 py-1.5 pr-7.5 text-sm outline-hidden select-none [&_svg]:shrink-0 [&_svg]:size-4 aria-disabled:opacity-50 aria-disabled:pointer-events-none disabled:opacity-50 disabled:pointer-events-none w-full truncate;
732
+
733
+ &[aria-selected='true'] {
734
+ @apply bg-[image:var(--check-icon)] bg-no-repeat bg-position-[center_right_0.5rem] bg-size-[0.875rem];
735
+ }
736
+ }
737
+ [role='listbox'] [role="presentation"] {
738
+ @apply flex text-muted-foreground px-2 py-1.5 text-xs;
739
+ }
740
+ [role='listbox'] [role='group']:not(:has([role='option']:not([aria-hidden='true']))) {
741
+ @apply hidden;
742
+ }
743
+ [role='separator'] {
744
+ @apply border-border -mx-1 my-1;
745
+ }
746
+ > header {
747
+ @apply flex h-9 items-center gap-2 border-b px-3 -mx-1 -mt-1 mb-1;
748
+
749
+ svg {
750
+ @apply size-4 shrink-0 opacity-50;
751
+ }
752
+ input[role='combobox'] {
753
+ @apply placeholder:text-muted-foreground flex h-10 flex-1 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50 min-w-0;
754
+ }
755
+ }
756
+ [role='listbox']:not(:has([data-value]:not([aria-hidden='true'])))::before {
757
+ @apply flex items-center justify-center p-6 text-sm truncate;
758
+ }
759
+ [role='listbox'][data-empty]:not(:has([data-value]:not([aria-hidden='true'])))::before {
760
+ @apply content-[attr(data-empty)];
761
+ }
762
+ [role='listbox']:not([data-empty]):not(:has([data-value]:not([aria-hidden='true'])))::before {
763
+ @apply content-['No_results_found'];
764
+ }
765
+ }
766
+
767
+ [role='option']:hover,
768
+ &[data-select-initialized] [role='option'].active,
769
+ &[data-select-initialized] [role='option']:focus-visible {
770
+ @apply bg-accent text-accent-foreground;
771
+ }
772
+ }
725
773
  }
726
774
 
727
775
  /* Sidebar */
728
776
  .sidebar {
729
- &[data-uninitialized] {
777
+ &:not([data-sidebar-initialized]) {
730
778
  @apply max-md:hidden;
731
779
  }
732
780
  &:not([aria-hidden]),
@@ -734,7 +782,10 @@
734
782
  @apply max-md:bg-black/50 max-md:fixed max-md:inset-0 max-md:z-40;
735
783
  }
736
784
  nav {
737
- @apply bg-sidebar text-sidebar-foreground flex flex-col w-(--sidebar-mobile-width) md:w-(--sidebar-width) fixed inset-y-0 transition-transform ease-in-out duration-300 z-50;
785
+ @apply bg-sidebar text-sidebar-foreground flex flex-col w-(--sidebar-mobile-width) md:w-(--sidebar-width) fixed inset-y-0 z-50 transition-transform ease-in-out duration-300;
786
+ }
787
+ & + * {
788
+ @apply transition-[margin] ease-in-out duration-300;
738
789
  }
739
790
  &:not([data-side]),
740
791
  &[data-side=left] {
@@ -742,7 +793,7 @@
742
793
  @apply left-0 border-r;
743
794
  }
744
795
  & + * {
745
- @apply relative md:ml-(--sidebar-width) transition-[margin] ease-in-out duration-300;
796
+ @apply relative md:ml-(--sidebar-width);
746
797
  }
747
798
  &[aria-hidden=true] {
748
799
  nav {
@@ -758,7 +809,7 @@
758
809
  @apply right-0 border-l;
759
810
  }
760
811
  & + * {
761
- @apply relative md:mr-(--sidebar-width) transition-[margin] ease-in-out duration-300;
812
+ @apply relative md:mr-(--sidebar-width);
762
813
  }
763
814
  &[aria-hidden=true] {
764
815
  nav {
@@ -930,7 +981,27 @@
930
981
  @apply pointer-events-auto w-full mt-4 animate-[toast-up_0.3s_ease-in-out] grid grid-rows-[1fr] transition-[grid-template-rows,opacity,margin] duration-300 ease-in-out;
931
982
 
932
983
  .toast-content {
933
- @apply text-popover-foreground text-[13px] bg-popover border shadow-lg rounded-lg overflow-hidden;
984
+ @apply text-popover-foreground text-[13px] bg-popover border shadow-lg rounded-lg overflow-hidden flex gap-2.5 p-3 items-center;
985
+
986
+ svg {
987
+ @apply size-4 shrink-0;
988
+ }
989
+ section {
990
+ h2 {
991
+ @apply font-medium tracking-tight;
992
+ }
993
+ p {
994
+ @apply text-muted-foreground;
995
+ }
996
+ }
997
+ footer {
998
+ @apply ml-auto flex flex-col gap-2;
999
+
1000
+ [data-toast-action],
1001
+ [data-toast-cancel] {
1002
+ @apply h-6 px-2.5 text-xs;
1003
+ }
1004
+ }
934
1005
  }
935
1006
  &[aria-hidden='true'] {
936
1007
  @apply grid-rows-[0fr] opacity-0 m-0 border-0 p-0 overflow-hidden;