@marigold/theme-rui 0.3.0 → 0.3.2

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.mjs CHANGED
@@ -82,7 +82,7 @@ var Accordion = {
82
82
  }),
83
83
  header: cva(
84
84
  [
85
- "flex flex-1 w-full items-center justify-between gap-4 rounded-md py-2",
85
+ "flex flex-1 w-full items-center justify-between gap-4 rounded-md py-2 cursor-pointer",
86
86
  "text-left text-sm font-semibold leading-6 transition-all",
87
87
  "hover:no-underline",
88
88
  "disabled:cursor-not-allowed disabled:text-disabled-foreground"
@@ -109,7 +109,7 @@ var Accordion = {
109
109
 
110
110
  // src/components/Badge.styles.ts
111
111
  import { cva as cva2 } from "@marigold/system";
112
- var circle = "before:size-1.5 before:rounded-full";
112
+ var circle = "before:size-1.5 before:rounded-full pr-2";
113
113
  var Badge = cva2(
114
114
  [
115
115
  "inline-flex items-center justify-center rounded-full border px-1.5 text-xs font-medium leading-normal transition-colors",
@@ -161,8 +161,8 @@ var Button = cva4(
161
161
  {
162
162
  variants: {
163
163
  variant: {
164
- default: "border border-input bg-background shadow-sm shadow-black/5 hover:bg-hover hover:text-foreground",
165
164
  primary: "bg-brand text-brand-foreground shadow-sm shadow-black/5 hover:bg-brand/90",
165
+ secondary: "border border-input bg-background shadow-sm shadow-black/5 hover:bg-hover hover:text-foreground",
166
166
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
167
167
  ghost: "hover:bg-hover hover:text-foreground",
168
168
  // only used for calendar in MonthListBox and YearListBox to have a hover over other options
@@ -177,7 +177,7 @@ var Button = cva4(
177
177
  }
178
178
  },
179
179
  defaultVariants: {
180
- variant: "default",
180
+ variant: "secondary",
181
181
  size: "default"
182
182
  }
183
183
  }
@@ -186,7 +186,7 @@ var Button = cva4(
186
186
  // src/components/Card.styles.ts
187
187
  import { cva as cva5 } from "@marigold/system";
188
188
  var Card = cva5([
189
- "border border-input rounded-lg",
189
+ "border border-input rounded-md",
190
190
  "bg-surface-overlay",
191
191
  "p-4",
192
192
  "shadow-sm shadow-black/5"
@@ -198,12 +198,12 @@ var Checkbox = {
198
198
  checkbox: cva6([
199
199
  "grid size-4 shrink-0 place-content-center rounded",
200
200
  "border border-input shadow-sm shadow-black/5",
201
- "group-disabled/checkbox:border-disabled",
202
201
  "mixin-ring-focus-visible-checkbox",
202
+ "group-disabled/checkbox:bg-disabled! group-disabled/checkbox:border-disabled! group-disabled/checkbox:text-disabled-foreground group-disabled/checkbox:cursor-not-allowed",
203
203
  "group-selected/checkbox:border-brand group-selected/checkbox:bg-brand group-selected/checkbox:text-brand-foreground",
204
204
  "group-[indeterminate]/checkbox:border-brand group-[indeterminate]/checkbox:bg-brand group-[indeterminate]/checkbox:text-brand-foreground"
205
205
  ]),
206
- container: cva6(),
206
+ container: cva6("cursor-pointer read-only:cursor-default"),
207
207
  label: cva6(
208
208
  'text-sm leading-4 group-[group="checkbox"]/checkboxgroup:font-normal font-medium text-foreground group-disabled/checkbox:text-disabled-foreground'
209
209
  ),
@@ -214,7 +214,7 @@ var Checkbox = {
214
214
  import { cva as cva7 } from "@marigold/system";
215
215
  var Calendar = {
216
216
  calendar: cva7(
217
- "rounded-lg border group-[[data-trigger]]/popover:border-0 border-border p-2"
217
+ "rounded-md border group-[[data-trigger]]/popover:border-0 border-border p-2"
218
218
  ),
219
219
  calendarCell: cva7([
220
220
  "relative flex size-9 items-center justify-center whitespace-nowrap rounded-lg",
@@ -247,7 +247,7 @@ import { cva as cva10 } from "@marigold/system";
247
247
 
248
248
  // src/components/Input.styles.ts
249
249
  import { cva as cva9 } from "@marigold/system";
250
- var inputContainer = "flex w-full px-3 py-2 rounded-lg shadow-sm shadow-black/5 border border-input bg-background text-sm text-foreground transition-shadow";
250
+ var inputContainer = "flex w-full px-3 py-2 rounded-lg shadow-sm shadow-black/5 border border-input bg-background text-sm text-foreground transition-shadow group-read-only/field:bg-muted";
251
251
  var inputDisabled = "disabled:cursor-not-allowed disabled:text-disabled-foreground disabled:bg-disabled";
252
252
  var inputInvalid = "group-invalid/field:border-destructive group-invalid/field:focus:border-destructive group-invalid/field:focus:ring-destructive/20";
253
253
  var inputReadOnly = "group-read-only/field:bg-muted";
@@ -260,7 +260,8 @@ var Input = {
260
260
  inputReadOnly,
261
261
  "h-input",
262
262
  "placeholder:text-placeholder",
263
- "[&[type=file]]:border-solid [&[type=file]]:bg-background [&[type=file]]:p-0 [&[type=file]]:pr-3 [&[type=file]]:italic [&[type=file]]:text-muted-foreground/70 file:me-3 file:h-full file:border-0 file:border-r file:border-solid file:border-input file:bg-transparent file:px-3 file:text-sm file:font-medium file:not-italic file:text-foreground",
263
+ "[&[type=file]]:cursor-pointer [&[type=file]]:border-solid [&[type=file]]:bg-background [&[type=file]]:p-0 [&[type=file]]:pr-3 [&[type=file]]:italic [&[type=file]]:text-muted-foreground/70",
264
+ "file:cursor-pointer file:me-3 file:h-full file:border-0 file:border-r file:border-solid file:border-input file:bg-transparent file:px-3 file:text-sm file:font-medium file:not-italic file:text-foreground",
264
265
  "group-[[data-icon]]/input:pl-8",
265
266
  "group-[[data-action]]/input:pr-7"
266
267
  ]),
@@ -277,7 +278,7 @@ var DateField = {
277
278
  "h-input",
278
279
  inputContainer,
279
280
  inputDisabled,
280
- "mixin-ring-focus-within",
281
+ "mixin-ring-has-focus-visible",
281
282
  inputInvalid,
282
283
  inputReadOnly,
283
284
  "invalid:focus-within:border-destructive invalid:focus-within:ring-destructive/20"
@@ -306,19 +307,23 @@ var DatePicker = cva11([
306
307
  // src/components/Dialog.styles.ts
307
308
  import { cva as cva12 } from "@marigold/system";
308
309
  var Dialog = {
309
- closeButton: cva12(""),
310
+ closeButton: cva12([
311
+ "absolute top-3 right-3",
312
+ "flex size-7 items-center justify-center rounded transition-[color,box-shadow]",
313
+ "mixin-ring-focus-visible",
314
+ "[&_svg]:size-4 [&_svg]:opacity-60 [&_svg]:transition-opacity hover:[&_svg]:opacity-100"
315
+ ]),
310
316
  container: cva12(
311
317
  [
312
- "bg-background fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl",
313
- " border p-6 shadow-lg duration-200 sm:max-w-100 border-border"
318
+ "flex flex-col gap-0 p-0",
319
+ "bg-background rounded-xl border p-6 shadow-lg overflow-y-auto",
320
+ "w-full max-w-[calc(100%-2rem)]",
321
+ "sm:max-h-[min(640px,80vh)] max-h-[calc(100%-2rem)]"
314
322
  ],
315
323
  {
316
324
  variants: {
317
325
  size: {
318
- default: "",
319
- small: "w-[min(100%,640px)]",
320
- medium: "w-[min(100%,768px)]",
321
- large: "w-[min(100%,1024px)]"
326
+ default: "sm:max-w-100"
322
327
  }
323
328
  },
324
329
  defaultVariants: {
@@ -434,16 +439,15 @@ var List = {
434
439
  import { cva as cva24 } from "@marigold/system";
435
440
  var ListBox = {
436
441
  container: cva24([
437
- "overflow-hidden rounded-lg border border-input group-[trigger]/popover:border-0"
442
+ "overflow-hidden rounded-md border border-input group-[trigger]/popover:border-0"
438
443
  ]),
439
444
  list: cva24(["space-y-1 bg-background p-1 text-sm outline-0"]),
440
445
  option: cva24([
441
- "disabled:cursor-not-allowed disabled:text-disabled-foreground",
442
- "relative flex flex-col rounded-md px-2 py-1.5 text-sm text-foreground",
446
+ "relative flex flex-col rounded-md px-2 py-1.5 text-sm text-foreground cursor-pointer",
443
447
  "selected:bg-selected",
444
- // TODO: can not use "ouline-none" because it overrides the focus visible things -.-
445
- // TODO: try it after RAC is updated!
446
- "data-[focused]:outline-none data-[focus-visible]:outline-2 data-[focus-visible]:outline-ring/70"
448
+ "hover:bg-hover hover:text-hover-foreground",
449
+ "disabled:cursor-not-allowed disabled:text-disabled-foreground",
450
+ "mixin-ring-focus-visible"
447
451
  ]),
448
452
  section: cva24(""),
449
453
  header: cva24(
@@ -469,7 +473,7 @@ var Menu = {
469
473
  import { cva as cva26 } from "@marigold/system";
470
474
  var NumberField = {
471
475
  group: cva26([
472
- "mixin-ring-focus-within",
476
+ "mixin-ring-has-focus-visible",
473
477
  inputInvalid,
474
478
  "relative inline-flex w-full -mb-0.5 items-center overflow-hidden whitespace-nowrap rounded-lg h-input grow text-center tabular-nums text-foreground",
475
479
  "border border-input text-sm shadow-sm shadow-black/5 transition-shadow",
@@ -478,8 +482,8 @@ var NumberField = {
478
482
  stepper: cva26([
479
483
  "w-7 h-full",
480
484
  "disabled:text-disabled-foreground disabled:bg-disabled",
481
- "border-input border-solid first-of-type:border-r",
482
- "border-input border-solid last-of-type:border-l "
485
+ // Make sure focus ring is only around the component and not the stepper buttons
486
+ "border-input! first-of-type:border-r! last-of-type:border-l!"
483
487
  ]),
484
488
  input: cva26(
485
489
  "border-none shadow-none rounded-none outline-offset-0 text-center focus-visible:ring-0"
@@ -490,14 +494,13 @@ var NumberField = {
490
494
  import { cva as cva27 } from "@marigold/system";
491
495
  var Popover = cva27([
492
496
  "group/popover",
493
- "z-50 overflow-y-auto overflow-x-hidden rounded-lg outline-0",
494
- "border border-border",
497
+ "z-50 overflow-y-auto overflow-x-hidden rounded-md outline-0 border-input",
495
498
  /** animate stuff missing */
496
- "bg-surface-overlay text-foreground shadow-lg shadow-black/5 ",
497
- "placement-t:mb-1",
498
- "placement-b:mt-1",
499
- "placement-r:ml-1",
500
- "placement-l:mr-1"
499
+ "bg-surface-overlay text-foreground shadow-md",
500
+ "placement-top:mb-1",
501
+ "placement-bottom:mt-1",
502
+ "placement-right:ml-1",
503
+ "placement-left:mr-1"
501
504
  ]);
502
505
 
503
506
  // src/components/Radio.styles.ts
@@ -505,13 +508,13 @@ import { cva as cva28 } from "@marigold/system";
505
508
  var Radio = {
506
509
  container: cva28("group-disabled/radio:cursor-not-allowed"),
507
510
  label: cva28([
508
- "group-disabled/radio:text-disabled-foreground",
509
- "text-sm font-normal"
511
+ "text-sm font-normal cursor-pointer",
512
+ "group-disabled/radio:text-disabled-foreground group-disabled/radio:cursor-not-allowed"
510
513
  ]),
511
514
  radio: cva28([
512
515
  "aspect-square size-4 rounded-full",
513
516
  "border border-input shadow-sm shadow-black/5",
514
- "outline-offset-2 group-[focus-visible]/radio:outline-2 group-[focus-visible]/radio:outline-ring/70",
517
+ "mixin-ring-focus-visible-radio",
515
518
  "group-disabled/radio:border-disabled",
516
519
  "group-selected/radio:border-brand group-selected/radio:bg-brand group-selected/radio:text-brand-foreground"
517
520
  ]),
@@ -521,11 +524,19 @@ var Radio = {
521
524
  // src/components/Pagination.styles.ts
522
525
  import { cva as cva29 } from "@marigold/system";
523
526
  var Pagination = {
524
- navigationButton: cva29(
525
- "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors outline-offset-2 focus-visible:outline-2 outline-ring/30 disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-hover hover:text-hover-foreground h-9 py-2 gap-1 px-2.5"
526
- ),
527
+ navigationButton: cva29([
528
+ "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors",
529
+ "mixin-ring-focus-visible",
530
+ "disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground",
531
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
532
+ "hover:bg-hover hover:text-hover-foreground",
533
+ "h-9 py-2 gap-1 px-2.5"
534
+ ]),
527
535
  pageButton: cva29([
528
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors outline-offset-2 focus-visible:outline-2 outline-ring/30 disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 bg-background size-9",
536
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors bg-background size-9",
537
+ "mixin-ring-focus-visible",
538
+ "disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground",
539
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
529
540
  "data-[selected=true]:border data-[selected=true]:border-input data-[selected=true]:shadow-xs",
530
541
  "hover:bg-hover hover:text-hover-foreground"
531
542
  ]),
@@ -535,7 +546,7 @@ var Pagination = {
535
546
  // src/components/ProgressCycle.styles.ts
536
547
  import { cva as cva30 } from "@marigold/system";
537
548
  var ProgressCycle = cva30([
538
- "stroke-background"
549
+ "stroke-foreground"
539
550
  ]);
540
551
 
541
552
  // src/components/SectionMessage.styles.ts
@@ -543,8 +554,8 @@ import { cva as cva31 } from "@marigold/system";
543
554
  var SectionMessage = {
544
555
  container: cva31(
545
556
  [
546
- 'grid-cols-[min-content_auto_min-content] gap-x-4 gap-y-2 [grid-template-areas:"icon_title_close""icon_content_content"]',
547
- "bg-background z-50 max-w-[601px] rounded-sm border p-4"
557
+ 'grid-cols-[min-content_auto_min-content] gap-x-3 gap-y-1 [grid-template-areas:"icon_title_close""icon_content_content"]',
558
+ "bg-background rounded-md border px-3 py-4"
548
559
  ],
549
560
  {
550
561
  variants: {
@@ -560,7 +571,7 @@ var SectionMessage = {
560
571
  }
561
572
  }
562
573
  ),
563
- title: cva31("text-base leading-5 font-bold"),
574
+ title: cva31("text-sm font-medium"),
564
575
  content: cva31("text-muted-foreground text-sm leading-5 font-normal", {
565
576
  variants: {
566
577
  variant: {
@@ -587,9 +598,15 @@ var SectionMessage = {
587
598
  variant: "info"
588
599
  }
589
600
  }),
590
- close: cva31(
591
- "h-[9.98px] w-[9.98px] cursor-pointer border-none p-0 leading-normal outline-0"
592
- )
601
+ close: cva31([
602
+ "flex items-center justify-center",
603
+ "rounded-md transition-color size-8 shrink-0 p-0 text-foreground cursor-pointer",
604
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
605
+ "-my-1.5 -me-2",
606
+ // align button with title
607
+ "mixin-ring-focus-visible",
608
+ "[&_svg]:opacity-60 [&_svg]:transition-opacity hover:[&_svg]:opacity-100"
609
+ ])
593
610
  };
594
611
 
595
612
  // src/components/Select.styles.ts
@@ -618,7 +635,9 @@ var Slider = {
618
635
  "absolute bg-black data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full rounded-lg"
619
636
  ]),
620
637
  thumb: cva33([
621
- "block h-5 w-5 rounded-full border-2 border-primary bg-background transition-colors focus-visible:outline-[3px] focus-visible:outline-ring/40 data-[disabled]:cursor-not-allowed"
638
+ "block h-5 w-5 rounded-full border-2 border-primary bg-background transition-colors",
639
+ "mixin-ring-focus-visible-borderless",
640
+ "data-[disabled]:cursor-not-allowed"
622
641
  ]),
623
642
  output: cva33("text-text-base text-sm")
624
643
  };
@@ -634,7 +653,7 @@ var Switch = {
634
653
  "border-2 border-transparent",
635
654
  "group-disabled/switch:bg-disabled group-disabled/switch:text-disabled-foreground group-selected/switch:group-disabled/switch:bg-disabled group-selected/switch:group-disabled/switch:text-disabled-foreground",
636
655
  "group-selected/switch:bg-brand bg-input",
637
- "outline-offset-2 group-[focus-visible]/switch:outline-2 group-[focus-visible]/switch:outline-ring/70"
656
+ "mixin-ring-focus-visible-switch"
638
657
  ]),
639
658
  thumb: cva34([
640
659
  "pointer-events-none block size-5 rounded-full",
@@ -647,15 +666,30 @@ var Switch = {
647
666
  // src/components/Table.styles.ts
648
667
  import { cva as cva35 } from "@marigold/system";
649
668
  var Table = {
650
- table: cva35("text-sm", {
651
- variants: {
652
- variant: {
653
- default: "",
654
- grid: ""
669
+ table: cva35(
670
+ "text-sm [&_td]:border-border [&_th]:border-border border-separate border-spacing-0 [&_th]:border-b [&_tr]:border-none [&_tr:not(:last-child)_td]:border-b",
671
+ {
672
+ variants: {
673
+ variant: {
674
+ default: "",
675
+ grid: ""
676
+ }
655
677
  }
656
678
  }
657
- }),
658
- headerRow: cva35("border-border border-b", {
679
+ ),
680
+ thead: cva35(
681
+ // for sticky header
682
+ "bg-background/90 top-0 z-10 backdrop-blur-xs ",
683
+ {
684
+ variants: {
685
+ variant: {
686
+ default: "",
687
+ grid: ""
688
+ }
689
+ }
690
+ }
691
+ ),
692
+ headerRow: cva35(["border-border border-b"], {
659
693
  variants: {
660
694
  variant: {
661
695
  default: "",
@@ -669,9 +703,7 @@ var Table = {
669
703
  header: cva35(
670
704
  [
671
705
  "h-12 px-3 align-middle font-medium text-muted-foreground last:text-right",
672
- "focus-visible:outline-2 outline-offset-2 outline-ring/70",
673
- // for sticky header
674
- "bg-background/90 top-0 z-10 backdrop-blur-xs"
706
+ "focus-visible:outline-2 outline-offset-2 outline-ring/70"
675
707
  ],
676
708
  {
677
709
  variants: {
@@ -734,16 +766,13 @@ var Tabs = {
734
766
  tab: cva36([
735
767
  "relative inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors",
736
768
  "[&_svg]:shrink-0",
737
- "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
769
+ "mixin-ring-focus-visible",
738
770
  "hover:bg-hover hover:text-foreground",
739
771
  "disabled:pointer-events-none disabled:opacity-50",
740
772
  "data-selected:text-foreground data-selected:hover:bg-hover",
741
773
  "data-[selected=true]:after:bg-foreground after:absolute after:inset-x-0 after:bottom-0 after:-mb-1 after:h-0.5"
742
774
  ]),
743
- tabpanel: cva36([
744
- "py-4 rounded-sm",
745
- "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"
746
- ])
775
+ tabpanel: cva36(["py-4 rounded-sm", "mixin-ring-focus-visible"])
747
776
  };
748
777
 
749
778
  // src/components/Tag.styles.ts
@@ -757,7 +786,7 @@ var Tag = {
757
786
  "bg-background",
758
787
  "data-selected:text-white data-selected:bg-brand",
759
788
  "data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled-foreground data-[disabled]:bg-disabled",
760
- "focus:outline-0 focus-visible:outline-2 focus-visible:outline-ring/70"
789
+ "mixin-ring-focus-visible"
761
790
  ]),
762
791
  closeButton: cva37([
763
792
  "size-4 flex items-center justify-end whitespace-nowrap",
@@ -812,10 +841,10 @@ var Tooltip = {
812
841
  container: cva40(
813
842
  [
814
843
  "text-brand-foreground bg-brand relative z-50 max-w-70 rounded-md border border-brand px-3 py-1.5 text-sm ",
815
- "placement-t:mb-2",
816
- "placement-b:mt-2",
817
- "placement-r:ml-2",
818
- "placement-l:mr-2"
844
+ "placement-top:mb-2",
845
+ "placement-bottom:mt-2",
846
+ "placement-right:ml-2",
847
+ "placement-left:mr-2"
819
848
  ],
820
849
  {
821
850
  variants: {
@@ -858,7 +887,7 @@ import { cva as cva41 } from "@marigold/system";
858
887
  var Underlay = cva41("", {
859
888
  variants: {
860
889
  variant: {
861
- modal: " bg-black/25 backdrop-blur-sm"
890
+ modal: " bg-black/80 backdrop-blur-sm"
862
891
  }
863
892
  }
864
893
  });