@ngrok/mantle 0.19.13 → 0.19.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/assets/mantle.css +74 -40
  2. package/dist/accordion.js +1 -1
  3. package/dist/accordion.js.map +1 -1
  4. package/dist/alert-dialog.js +1 -1
  5. package/dist/alert-dialog.js.map +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/alert.js.map +1 -1
  8. package/dist/anchor.js +1 -1
  9. package/dist/anchor.js.map +1 -1
  10. package/dist/badge.js +1 -1
  11. package/dist/badge.js.map +1 -1
  12. package/dist/button.d.ts +1 -1
  13. package/dist/button.js +1 -1
  14. package/dist/calendar.js +1 -1
  15. package/dist/calendar.js.map +1 -1
  16. package/dist/card.js +1 -1
  17. package/dist/card.js.map +1 -1
  18. package/dist/checkbox.js.map +1 -1
  19. package/dist/{chunk-NYTREL5Z.js → chunk-2KOLXQ5Z.js} +2 -2
  20. package/dist/chunk-2KOLXQ5Z.js.map +1 -0
  21. package/dist/chunk-3BZ333PP.js +2 -0
  22. package/dist/chunk-3BZ333PP.js.map +1 -0
  23. package/dist/{chunk-OP6JMBKJ.js → chunk-3C5O3AQA.js} +1 -1
  24. package/dist/{chunk-OP6JMBKJ.js.map → chunk-3C5O3AQA.js.map} +1 -1
  25. package/dist/{chunk-EW5CFGXT.js → chunk-AZ56JGNY.js} +1 -1
  26. package/dist/{chunk-EW5CFGXT.js.map → chunk-AZ56JGNY.js.map} +1 -1
  27. package/dist/{chunk-273VK4KO.js → chunk-DOTYPWKO.js} +1 -1
  28. package/dist/chunk-DOTYPWKO.js.map +1 -0
  29. package/dist/{chunk-CXQLUXDJ.js → chunk-HFR5V2VT.js} +2 -2
  30. package/dist/chunk-HFR5V2VT.js.map +1 -0
  31. package/dist/{chunk-VJPVAY5J.js → chunk-IQCYQ6RC.js} +2 -2
  32. package/dist/chunk-IQCYQ6RC.js.map +1 -0
  33. package/dist/{chunk-J4X3ODX7.js → chunk-ITLSGPZ5.js} +1 -1
  34. package/dist/chunk-ITLSGPZ5.js.map +1 -0
  35. package/dist/{chunk-QZMKDGUW.js → chunk-PFLB7OM5.js} +2 -2
  36. package/dist/chunk-PFLB7OM5.js.map +1 -0
  37. package/dist/{chunk-A7ZXYP6T.js → chunk-WIYEFPO2.js} +2 -2
  38. package/dist/chunk-WIYEFPO2.js.map +1 -0
  39. package/dist/{chunk-WZQZW4OU.js → chunk-YHG55D43.js} +2 -2
  40. package/dist/{chunk-WZQZW4OU.js.map → chunk-YHG55D43.js.map} +1 -1
  41. package/dist/chunk-YZDIHCOF.js +2 -0
  42. package/dist/chunk-YZDIHCOF.js.map +1 -0
  43. package/dist/code-block.js +1 -1
  44. package/dist/code-block.js.map +1 -1
  45. package/dist/color.js.map +1 -1
  46. package/dist/cx.js +1 -1
  47. package/dist/dialog.js +1 -1
  48. package/dist/dialog.js.map +1 -1
  49. package/dist/dropdown-menu.js +1 -1
  50. package/dist/dropdown-menu.js.map +1 -1
  51. package/dist/hooks.d.ts +2 -2
  52. package/dist/hooks.js +1 -1
  53. package/dist/hooks.js.map +1 -1
  54. package/dist/hover-card.js +1 -1
  55. package/dist/hover-card.js.map +1 -1
  56. package/dist/icon.js +1 -1
  57. package/dist/inline-code.js +1 -1
  58. package/dist/inline-code.js.map +1 -1
  59. package/dist/input.js +1 -1
  60. package/dist/input.js.map +1 -1
  61. package/dist/label.js +1 -1
  62. package/dist/label.js.map +1 -1
  63. package/dist/media-object.js +1 -1
  64. package/dist/media-object.js.map +1 -1
  65. package/dist/pagination.d.ts +1 -1
  66. package/dist/pagination.js +1 -1
  67. package/dist/pagination.js.map +1 -1
  68. package/dist/popover.js +1 -1
  69. package/dist/progress.d.ts +1 -1
  70. package/dist/progress.js +1 -1
  71. package/dist/progress.js.map +1 -1
  72. package/dist/radio-group.d.ts +1 -1
  73. package/dist/radio-group.js +1 -1
  74. package/dist/radio-group.js.map +1 -1
  75. package/dist/select.d.ts +1 -1
  76. package/dist/select.js +1 -1
  77. package/dist/separator.js +1 -1
  78. package/dist/sheet.js +1 -1
  79. package/dist/sheet.js.map +1 -1
  80. package/dist/skeleton.js +1 -1
  81. package/dist/switch.js +1 -1
  82. package/dist/switch.js.map +1 -1
  83. package/dist/table.d.ts +1 -1
  84. package/dist/table.js +1 -1
  85. package/dist/table.js.map +1 -1
  86. package/dist/tabs.js +1 -1
  87. package/dist/tabs.js.map +1 -1
  88. package/dist/tailwind-preset.cjs.map +1 -1
  89. package/dist/tailwind-preset.js.map +1 -1
  90. package/dist/text-area.js +1 -1
  91. package/dist/text-area.js.map +1 -1
  92. package/dist/theme-provider.d.ts +2 -2
  93. package/dist/theme-provider.js +1 -1
  94. package/dist/toast.js +1 -1
  95. package/dist/tooltip.js +1 -1
  96. package/dist/tooltip.js.map +1 -1
  97. package/dist/types.js +1 -1
  98. package/package.json +20 -21
  99. package/dist/chunk-273VK4KO.js.map +0 -1
  100. package/dist/chunk-A7ZXYP6T.js.map +0 -1
  101. package/dist/chunk-CXQLUXDJ.js.map +0 -1
  102. package/dist/chunk-J4X3ODX7.js.map +0 -1
  103. package/dist/chunk-JIFA7MWV.js +0 -2
  104. package/dist/chunk-JIFA7MWV.js.map +0 -1
  105. package/dist/chunk-LBEYGDAN.js +0 -2
  106. package/dist/chunk-LBEYGDAN.js.map +0 -1
  107. package/dist/chunk-NYTREL5Z.js.map +0 -1
  108. package/dist/chunk-QZMKDGUW.js.map +0 -1
  109. package/dist/chunk-VJPVAY5J.js.map +0 -1
package/assets/mantle.css CHANGED
@@ -6,35 +6,40 @@
6
6
  font-family: EuclidSquare;
7
7
  font-style: normal;
8
8
  font-weight: normal;
9
- src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Regular-WebS.woff") format("woff");
9
+ src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Regular-WebS.woff")
10
+ format("woff");
10
11
  }
11
12
 
12
13
  @font-face {
13
14
  font-family: EuclidSquare;
14
15
  font-style: italic;
15
16
  font-weight: normal;
16
- src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-RegularItalic-WebS.woff") format("woff");
17
+ src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-RegularItalic-WebS.woff")
18
+ format("woff");
17
19
  }
18
20
 
19
21
  @font-face {
20
22
  font-family: EuclidSquare;
21
23
  font-style: normal;
22
24
  font-weight: 500;
23
- src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Medium-WebS.woff") format("woff");
25
+ src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Medium-WebS.woff")
26
+ format("woff");
24
27
  }
25
28
 
26
29
  @font-face {
27
30
  font-family: EuclidSquare;
28
31
  font-style: normal;
29
32
  font-weight: 600;
30
- src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Semibold-WebS.woff") format("woff");
33
+ src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-Semibold-WebS.woff")
34
+ format("woff");
31
35
  }
32
36
 
33
37
  @font-face {
34
38
  font-family: EuclidSquare;
35
39
  font-style: italic;
36
40
  font-weight: 500;
37
- src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-MediumItalic-WebS.woff") format("woff");
41
+ src: url("https://assets.ngrok.com/fonts/euclid-square/EuclidSquare-MediumItalic-WebS.woff")
42
+ format("woff");
38
43
  }
39
44
 
40
45
  /* IBM Plex Mono */
@@ -43,14 +48,16 @@
43
48
  font-family: IBMPlexMono;
44
49
  font-style: normal;
45
50
  font-weight: normal;
46
- src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-Text.woff") format("woff");
51
+ src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-Text.woff")
52
+ format("woff");
47
53
  }
48
54
 
49
55
  @font-face {
50
56
  font-family: IBMPlexMono;
51
57
  font-style: italic;
52
58
  font-weight: normal;
53
- src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-TextItalic.woff") format("woff");
59
+ src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-TextItalic.woff")
60
+ format("woff");
54
61
  }
55
62
 
56
63
  /* semibold is actually 600, but mapping it to 500 works better across AntD */
@@ -58,14 +65,16 @@
58
65
  font-family: IBMPlexMono;
59
66
  font-style: normal;
60
67
  font-weight: 500;
61
- src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.woff") format("woff");
68
+ src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.woff")
69
+ format("woff");
62
70
  }
63
71
 
64
72
  @font-face {
65
73
  font-family: IBMPlexMono;
66
74
  font-style: italic;
67
75
  font-weight: 500;
68
- src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-SemiBoldItalic.woff") format("woff");
76
+ src: url("https://assets.ngrok.com/fonts/ibm-plex-mono/IBMPlexMono-SemiBoldItalic.woff")
77
+ format("woff");
69
78
  }
70
79
 
71
80
  @tailwind base;
@@ -124,10 +133,10 @@
124
133
  --ngrok-grayple-950: 236 20% 11.5%;
125
134
 
126
135
  /**
127
- * Tailwind palette.
128
- * These are required as they are referenced by both light and dark modes.
129
- * Not to be used directly.
130
- */
136
+ * Tailwind palette.
137
+ * These are required as they are referenced by both light and dark modes.
138
+ * Not to be used directly.
139
+ */
131
140
 
132
141
  --tw-black: 0 0% 0%;
133
142
  --tw-white: 0 0% 100%;
@@ -1492,10 +1501,10 @@
1492
1501
  }
1493
1502
 
1494
1503
  /**
1495
- * prism.js default theme for JavaScript, CSS and HTML
1496
- * Based on dabblet (http://dabblet.com)
1497
- * @author Lea Verou
1498
- */
1504
+ * prism.js default theme for JavaScript, CSS and HTML
1505
+ * Based on dabblet (http://dabblet.com)
1506
+ * @author Lea Verou
1507
+ */
1499
1508
 
1500
1509
  .token.comment,
1501
1510
  .token.prolog,
@@ -1617,35 +1626,60 @@
1617
1626
  }
1618
1627
 
1619
1628
  .scroll-shadow {
1620
- background: /* Shadow Cover TOP */
1621
- linear-gradient(hsl(var(--bg-base)) 30%, hsl(var(--bg-base) / 0%)) center top,
1622
- /* Shadow Cover BOTTOM */ linear-gradient(hsl(var(--bg-base) / 0%), hsl(var(--bg-base)) 70%) center bottom,
1623
- /* Shadow TOP */ radial-gradient(farthest-side at 50% 0, var(--navigation-shadow), rgb(0 0 0 / 0%)) center top,
1624
- /* Shadow BOTTOM */ radial-gradient(farthest-side at 50% 100%, var(--navigation-shadow), rgb(0 0 0 / 0%)) center
1625
- bottom;
1629
+ /* Shadow Cover TOP */
1630
+ background: linear-gradient(
1631
+ hsl(var(--bg-base)) 30%,
1632
+ hsl(var(--bg-base) / 0%)
1633
+ )
1634
+ center top,
1635
+ /* Shadow Cover BOTTOM */ linear-gradient(
1636
+ hsl(var(--bg-base) / 0%),
1637
+ hsl(var(--bg-base)) 70%
1638
+ )
1639
+ center bottom,
1640
+ /* Shadow TOP */ radial-gradient(
1641
+ farthest-side at 50% 0,
1642
+ var(--navigation-shadow),
1643
+ rgb(0 0 0 / 0%)
1644
+ )
1645
+ center top,
1646
+ /* Shadow BOTTOM */ radial-gradient(
1647
+ farthest-side at 50% 100%,
1648
+ var(--navigation-shadow),
1649
+ rgb(0 0 0 / 0%)
1650
+ )
1651
+ center bottom;
1626
1652
  background-repeat: no-repeat;
1627
- background-size:
1628
- 100% 40px,
1629
- 100% 40px,
1630
- 100% 14px,
1631
- 100% 14px;
1653
+ background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
1632
1654
  background-attachment: local, local, scroll, scroll;
1633
1655
  }
1634
1656
 
1635
1657
  .nav-scroll-shadow {
1636
- background:
1637
- /* Shadow Cover TOP */
1638
- linear-gradient(hsl(var(--bg-popover)) 30%, hsl(var(--bg-popover) / 0%)) center top,
1639
- /* Shadow Cover BOTTOM */ linear-gradient(hsl(var(--bg-popover) / 0%), hsl(var(--bg-popover)) 70%) center bottom,
1640
- /* Shadow TOP */ radial-gradient(farthest-side at 50% 0, var(--navigation-shadow), rgb(0 0 0 / 0%)) center top,
1641
- /* Shadow BOTTOM */ radial-gradient(farthest-side at 50% 100%, var(--navigation-shadow), rgb(0 0 0 / 0%)) center
1642
- bottom;
1658
+ /* Shadow Cover TOP */
1659
+ background: linear-gradient(
1660
+ hsl(var(--bg-popover)) 30%,
1661
+ hsl(var(--bg-popover) / 0%)
1662
+ )
1663
+ center top,
1664
+ /* Shadow Cover BOTTOM */ linear-gradient(
1665
+ hsl(var(--bg-popover) / 0%),
1666
+ hsl(var(--bg-popover)) 70%
1667
+ )
1668
+ center bottom,
1669
+ /* Shadow TOP */ radial-gradient(
1670
+ farthest-side at 50% 0,
1671
+ var(--navigation-shadow),
1672
+ rgb(0 0 0 / 0%)
1673
+ )
1674
+ center top,
1675
+ /* Shadow BOTTOM */ radial-gradient(
1676
+ farthest-side at 50% 100%,
1677
+ var(--navigation-shadow),
1678
+ rgb(0 0 0 / 0%)
1679
+ )
1680
+ center bottom;
1643
1681
  background-repeat: no-repeat;
1644
- background-size:
1645
- 100% 40px,
1646
- 100% 40px,
1647
- 100% 14px,
1648
- 100% 14px;
1682
+ background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
1649
1683
  background-attachment: local, local, scroll, scroll;
1650
1684
  }
1651
1685
  }
package/dist/accordion.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-LBEYGDAN.js";import"./chunk-VJPVAY5J.js";import{a as r}from"./chunk-EW5CFGXT.js";import{CaretDown as g}from"@phosphor-icons/react/CaretDown";import*as o from"@radix-ui/react-accordion";import{forwardRef as n}from"react";import{jsx as c}from"react/jsx-runtime";var a=n(({className:e,...i},t)=>c(o.Root,{ref:t,className:r("w-full space-y-2.5",e),...i}));a.displayName="Accordion";var p=o.Item;p.displayName="AccordionItem";var s=n(({className:e,...i},t)=>c(o.Header,{ref:t,className:r("flex items-center gap-2",e),...i}));s.displayName="AccordionHeading";var f=n(({className:e,children:i,...t},d)=>c(o.Trigger,{ref:d,className:r("group flex items-center gap-1.5",e),...t,children:i}));f.displayName="AccordionTrigger";var l=({className:e,...i})=>c(m,{...i,svg:c(g,{weight:"fill"}),className:r("group-data-state-open:rotate-0 -rotate-90",e)}),A=n(({className:e,children:i,...t},d)=>c(o.Content,{ref:d,className:r("data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4",e),...t,children:i}));A.displayName="AccordionContent";export{a as Accordion,A as AccordionContent,s as AccordionHeading,p as AccordionItem,f as AccordionTrigger,l as AccordionTriggerIcon};
1
+ import{a as m}from"./chunk-3BZ333PP.js";import"./chunk-IQCYQ6RC.js";import{a as r}from"./chunk-AZ56JGNY.js";import{CaretDown as g}from"@phosphor-icons/react/CaretDown";import*as o from"@radix-ui/react-accordion";import{forwardRef as n}from"react";import{jsx as c}from"react/jsx-runtime";var a=n(({className:e,...i},t)=>c(o.Root,{ref:t,className:r("w-full space-y-2.5",e),...i}));a.displayName="Accordion";var p=o.Item;p.displayName="AccordionItem";var s=n(({className:e,...i},t)=>c(o.Header,{ref:t,className:r("flex items-center gap-2",e),...i}));s.displayName="AccordionHeading";var f=n(({className:e,children:i,...t},d)=>c(o.Trigger,{ref:d,className:r("group flex items-center gap-1.5",e),...t,children:i}));f.displayName="AccordionTrigger";var l=({className:e,...i})=>c(m,{...i,svg:c(g,{weight:"fill"}),className:r("group-data-state-open:rotate-0 -rotate-90",e)}),A=n(({className:e,children:i,...t},d)=>c(o.Content,{ref:d,className:r("data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4",e),...t,children:i}));A.displayName="AccordionContent";export{a as Accordion,A as AccordionContent,s as AccordionHeading,p as AccordionItem,f as AccordionTrigger,l as AccordionTriggerIcon};
2
2
  //# sourceMappingURL=accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon, type IconProps } from \"../icon/icon.js\";\n\nconst Accordion = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>>(\n\t({ className, ...props }, ref) => (\n\t\t<AccordionPrimitive.Root ref={ref} className={cx(\"w-full space-y-2.5\", className)} {...props} />\n\t),\n);\nAccordion.displayName = \"Accordion\";\n\nconst AccordionItem = AccordionPrimitive.Item;\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionHeading = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Header>>(\n\t({ className, ...props }, ref) => (\n\t\t<AccordionPrimitive.Header ref={ref} className={cx(\"flex items-center gap-2\", className)} {...props} />\n\t),\n);\nAccordionHeading.displayName = \"AccordionHeading\";\n\nconst AccordionTrigger = forwardRef<ElementRef<\"button\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<AccordionPrimitive.Trigger ref={ref} className={cx(\"group flex items-center gap-1.5\", className)} {...props}>\n\t\t\t{children}\n\t\t</AccordionPrimitive.Trigger>\n\t),\n);\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nconst AccordionTriggerIcon = ({ className, ...props }: Omit<IconProps, \"svg\">) => (\n\t<Icon\n\t\t{...props}\n\t\tsvg={<CaretDown weight=\"fill\" />}\n\t\tclassName={cx(\"group-data-state-open:rotate-0 -rotate-90\", className)}\n\t/>\n);\n\nconst AccordionContent = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<AccordionPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</AccordionPrimitive.Content>\n\t),\n);\nAccordionContent.displayName = \"AccordionContent\";\n\nexport {\n\t//,\n\tAccordion,\n\tAccordionItem,\n\tAccordionTrigger,\n\tAccordionContent,\n\tAccordionHeading,\n\tAccordionTriggerIcon,\n};\n"],"mappings":"4GAEA,OAAS,aAAAA,MAAiB,kCAC1B,UAAYC,MAAwB,4BACpC,OAAS,cAAAC,MAAkE,QAMzE,cAAAC,MAAA,oBAFF,IAAMC,EAAYC,EACjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACzBL,EAAoB,OAAnB,CAAwB,IAAKK,EAAK,UAAWC,EAAG,qBAAsBH,CAAS,EAAI,GAAGC,EAAO,CAEhG,EACAH,EAAU,YAAc,YAExB,IAAMM,EAAmC,OACzCA,EAAc,YAAc,gBAE5B,IAAMC,EAAmBN,EACxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACzBL,EAAoB,SAAnB,CAA0B,IAAKK,EAAK,UAAWC,EAAG,0BAA2BH,CAAS,EAAI,GAAGC,EAAO,CAEvG,EACAI,EAAiB,YAAc,mBAE/B,IAAMC,EAAmBP,EACxB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACnCL,EAAoB,UAAnB,CAA2B,IAAKK,EAAK,UAAWC,EAAG,kCAAmCH,CAAS,EAAI,GAAGC,EACrG,SAAAM,EACF,CAEF,EACAD,EAAiB,YAAc,mBAE/B,IAAME,EAAuB,CAAC,CAAE,UAAAR,EAAW,GAAGC,CAAM,IACnDJ,EAACY,EAAA,CACC,GAAGR,EACJ,IAAKJ,EAACa,EAAA,CAAU,OAAO,OAAO,EAC9B,UAAWP,EAAG,4CAA6CH,CAAS,EACrE,EAGKW,EAAmBZ,EACxB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACnCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EACV,qGACAH,CACD,EACC,GAAGC,EAEH,SAAAM,EACF,CAEF,EACAI,EAAiB,YAAc","names":["CaretDown","AccordionPrimitive","forwardRef","jsx","Accordion","forwardRef","className","props","ref","cx","AccordionItem","AccordionHeading","AccordionTrigger","children","AccordionTriggerIcon","Icon","CaretDown","AccordionContent"]}
1
+ {"version":3,"sources":["../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\tforwardRef,\n} from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon, type IconProps } from \"../icon/icon.js\";\n\nconst Accordion = forwardRef<\n\tElementRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Root>\n>(({ className, ...props }, ref) => (\n\t<AccordionPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cx(\"w-full space-y-2.5\", className)}\n\t\t{...props}\n\t/>\n));\nAccordion.displayName = \"Accordion\";\n\nconst AccordionItem = AccordionPrimitive.Item;\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionHeading = forwardRef<\n\tElementRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Header>\n>(({ className, ...props }, ref) => (\n\t<AccordionPrimitive.Header\n\t\tref={ref}\n\t\tclassName={cx(\"flex items-center gap-2\", className)}\n\t\t{...props}\n\t/>\n));\nAccordionHeading.displayName = \"AccordionHeading\";\n\nconst AccordionTrigger = forwardRef<\n\tElementRef<\"button\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cx(\"group flex items-center gap-1.5\", className)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</AccordionPrimitive.Trigger>\n));\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nconst AccordionTriggerIcon = ({\n\tclassName,\n\t...props\n}: Omit<IconProps, \"svg\">) => (\n\t<Icon\n\t\t{...props}\n\t\tsvg={<CaretDown weight=\"fill\" />}\n\t\tclassName={cx(\"group-data-state-open:rotate-0 -rotate-90\", className)}\n\t/>\n);\n\nconst AccordionContent = forwardRef<\n\tElementRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Content\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</AccordionPrimitive.Content>\n));\nAccordionContent.displayName = \"AccordionContent\";\n\nexport {\n\t//,\n\tAccordion,\n\tAccordionItem,\n\tAccordionTrigger,\n\tAccordionContent,\n\tAccordionHeading,\n\tAccordionTriggerIcon,\n};\n"],"mappings":"4GAEA,OAAS,aAAAA,MAAiB,kCAC1B,UAAYC,MAAwB,4BACpC,OAGC,cAAAC,MACM,QAQN,cAAAC,MAAA,oBAJD,IAAMC,EAAYC,EAGhB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BL,EAAoB,OAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,qBAAsBH,CAAS,EAC5C,GAAGC,EACL,CACA,EACDH,EAAU,YAAc,YAExB,IAAMM,EAAmC,OACzCA,EAAc,YAAc,gBAE5B,IAAMC,EAAmBN,EAGvB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BL,EAAoB,SAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,0BAA2BH,CAAS,EACjD,GAAGC,EACL,CACA,EACDI,EAAiB,YAAc,mBAE/B,IAAMC,EAAmBP,EAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACrCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,kCAAmCH,CAAS,EACzD,GAAGC,EAEH,SAAAM,EACF,CACA,EACDD,EAAiB,YAAc,mBAE/B,IAAME,EAAuB,CAAC,CAC7B,UAAAR,EACA,GAAGC,CACJ,IACCJ,EAACY,EAAA,CACC,GAAGR,EACJ,IAAKJ,EAACa,EAAA,CAAU,OAAO,OAAO,EAC9B,UAAWP,EAAG,4CAA6CH,CAAS,EACrE,EAGKW,EAAmBZ,EAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACrCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EACV,qGACAH,CACD,EACC,GAAGC,EAEH,SAAAM,EACF,CACA,EACDI,EAAiB,YAAc","names":["CaretDown","AccordionPrimitive","forwardRef","jsx","Accordion","forwardRef","className","props","ref","cx","AccordionItem","AccordionHeading","AccordionTrigger","children","AccordionTriggerIcon","Icon","CaretDown","AccordionContent"]}
@@ -1,2 +1,2 @@
1
- import{a as c,b as d,c as f,d as D,e as A,f as y,g as u,h as P}from"./chunk-J4X3ODX7.js";import{g as p}from"./chunk-A7ZXYP6T.js";import"./chunk-273VK4KO.js";import"./chunk-D3XF6J5A.js";import{b as m}from"./chunk-JIFA7MWV.js";import"./chunk-4LSFAAZW.js";import"./chunk-OP6JMBKJ.js";import"./chunk-72TJUKMV.js";import"./chunk-LBEYGDAN.js";import{a as g}from"./chunk-VJPVAY5J.js";import{a as r}from"./chunk-EW5CFGXT.js";import{Info as W}from"@phosphor-icons/react/Info";import{Warning as F}from"@phosphor-icons/react/Warning";import{createContext as H,forwardRef as s,useContext as S}from"react";import j from"tiny-invariant";import{jsx as o,jsxs as q}from"react/jsx-runtime";var v=H(null);function x(){let t=S(v);return j(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function C({priority:t,...e}){return o(v.Provider,{value:{priority:t},children:o(c,{...e})})}C.displayName="AlertDialog";var V=d,k=f,N=s(({className:t,...e},i)=>o(A,{className:r("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...e,ref:i}));N.displayName="AlertDialogOverlay";var R=s(({className:t,onInteractOutside:e,onPointerDownOutside:i,...a},l)=>q(k,{children:[o(N,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(y,{ref:l,className:r("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),onInteractOutside:n=>{p(n),e?.(n)},onPointerDownOutside:n=>{p(n),i?.(n)},...a})})]}));R.displayName="AlertDialogContent";var b=({className:t,...e})=>o("div",{className:r("flex-1 space-y-4",t),...e});b.displayName="AlertDialogBody";var h=({className:t,...e})=>o("div",{className:r("flex flex-col space-y-2 text-center sm:text-start",t),...e});h.displayName="AlertDialogHeader";var O=({className:t,...e})=>o("div",{className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});O.displayName="AlertDialogFooter";var B=s(({className:t,...e},i)=>o(u,{ref:i,className:r("text-strong text-center text-lg font-medium sm:text-start",t),...e}));B.displayName="AlertDialogTitle";var I=s(({className:t,...e},i)=>o(P,{ref:i,className:r("text-body text-center text-sm font-normal sm:text-start",t),...e}));I.displayName="AlertDialogDescription";var T=s(({appearance:t="filled",...e},i)=>{let a=x(),l="default";return a.priority==="danger"&&(l="danger"),o(m,{appearance:t,priority:l,ref:i,...e})});T.displayName="AlertDialogAction";var w=s(({appearance:t="outlined",className:e,priority:i="neutral",...a},l)=>o(D,{asChild:!0,children:o(m,{appearance:t,className:r("mt-2 sm:mt-0",e),priority:i,ref:l,...a})}));w.displayName="AlertDialogCancel";var E=s(({className:t,svg:e,...i},a)=>{let l=x(),n=l.priority==="danger"?"text-danger-600":"text-accent-600",z=l.priority==="danger"?o(F,{}):o(W,{});return o(g,{ref:a,className:r("size-12 sm:size-7",n,t),svg:e??z,...i})});E.displayName="AlertDialogIcon";export{C as AlertDialog,T as AlertDialogAction,b as AlertDialogBody,w as AlertDialogCancel,R as AlertDialogContent,I as AlertDialogDescription,O as AlertDialogFooter,h as AlertDialogHeader,E as AlertDialogIcon,B as AlertDialogTitle,V as AlertDialogTrigger};
1
+ import{a as c,b as d,c as f,d as D,e as A,f as y,g as u,h as P}from"./chunk-ITLSGPZ5.js";import{g as p}from"./chunk-WIYEFPO2.js";import"./chunk-DOTYPWKO.js";import"./chunk-D3XF6J5A.js";import{b as m}from"./chunk-YZDIHCOF.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-3BZ333PP.js";import{a as g}from"./chunk-IQCYQ6RC.js";import{a as r}from"./chunk-AZ56JGNY.js";import{Info as W}from"@phosphor-icons/react/Info";import{Warning as F}from"@phosphor-icons/react/Warning";import{createContext as H,forwardRef as s,useContext as S}from"react";import j from"tiny-invariant";import{jsx as o,jsxs as q}from"react/jsx-runtime";var v=H(null);function x(){let t=S(v);return j(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function C({priority:t,...e}){return o(v.Provider,{value:{priority:t},children:o(c,{...e})})}C.displayName="AlertDialog";var V=d,k=f,N=s(({className:t,...e},i)=>o(A,{className:r("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...e,ref:i}));N.displayName="AlertDialogOverlay";var R=s(({className:t,onInteractOutside:e,onPointerDownOutside:i,...a},l)=>q(k,{children:[o(N,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(y,{ref:l,className:r("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),onInteractOutside:n=>{p(n),e?.(n)},onPointerDownOutside:n=>{p(n),i?.(n)},...a})})]}));R.displayName="AlertDialogContent";var b=({className:t,...e})=>o("div",{className:r("flex-1 space-y-4",t),...e});b.displayName="AlertDialogBody";var h=({className:t,...e})=>o("div",{className:r("flex flex-col space-y-2 text-center sm:text-start",t),...e});h.displayName="AlertDialogHeader";var O=({className:t,...e})=>o("div",{className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});O.displayName="AlertDialogFooter";var B=s(({className:t,...e},i)=>o(u,{ref:i,className:r("text-strong text-center text-lg font-medium sm:text-start",t),...e}));B.displayName="AlertDialogTitle";var I=s(({className:t,...e},i)=>o(P,{ref:i,className:r("text-body text-center text-sm font-normal sm:text-start",t),...e}));I.displayName="AlertDialogDescription";var T=s(({appearance:t="filled",...e},i)=>{let a=x(),l="default";return a.priority==="danger"&&(l="danger"),o(m,{appearance:t,priority:l,ref:i,...e})});T.displayName="AlertDialogAction";var w=s(({appearance:t="outlined",className:e,priority:i="neutral",...a},l)=>o(D,{asChild:!0,children:o(m,{appearance:t,className:r("mt-2 sm:mt-0",e),priority:i,ref:l,...a})}));w.displayName="AlertDialogCancel";var E=s(({className:t,svg:e,...i},a)=>{let l=x(),n=l.priority==="danger"?"text-danger-600":"text-accent-600",z=l.priority==="danger"?o(F,{}):o(W,{});return o(g,{ref:a,className:r("size-12 sm:size-7",n,t),svg:e??z,...i})});E.displayName="AlertDialogIcon";export{C as AlertDialog,T as AlertDialogAction,b as AlertDialogBody,w as AlertDialogCancel,R as AlertDialogContent,I as AlertDialogDescription,O as AlertDialogFooter,h as AlertDialogHeader,E as AlertDialogIcon,B as AlertDialogTitle,V as AlertDialogTrigger};
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport {\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Button, type ButtonPriority, type ButtonProps } from \"../button/button.js\";\nimport * as AlertDialogPrimitive from \"../dialog/primitive.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(context, \"AlertDialog child component used outside of AlertDialog parent!\");\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\nAlertDialog.displayName = \"AlertDialog\";\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = \"AlertDialogOverlay\";\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, onInteractOutside, onPointerDownOutside, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col space-y-2 text-center sm:text-start\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong text-center text-lg font-medium sm:text-start\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-center text-sm font-normal sm:text-start\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\n/**\n * A button that confirms the Alert Dialog action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n * Does not close the alert dialog by default.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t//\n\t\t\t\tappearance={appearance}\n\t\t\t\tpriority={buttonPriority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = \"AlertDialogAction\";\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Close asChild>\n\t\t\t<Button\n\t\t\t\tappearance={appearance}\n\t\t\t\tclassName={cx(\"mt-2 sm:mt-0\", className)}\n\t\t\t\tpriority={priority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPrimitive.Close>\n\t),\n);\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(({ className, svg, ...props }, ref) => {\n\tconst ctx = useAlertDialogContext();\n\tconst defaultColor = ctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\treturn (\n\t\t<SvgOnly\n\t\t\tref={ref}\n\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["Info","Warning","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","Root","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","forwardRef","className","ref","Overlay","cx","AlertDialogContent","onInteractOutside","onPointerDownOutside","jsxs","Content","event","preventCloseOnPromptInteraction","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","Close","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
1
+ {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport {\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport {\n\tButton,\n\ttype ButtonPriority,\n\ttype ButtonProps,\n} from \"../button/button.js\";\nimport * as AlertDialogPrimitive from \"../dialog/primitive.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(\n\t\tcontext,\n\t\t\"AlertDialog child component used outside of AlertDialog parent!\",\n\t);\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\nAlertDialog.displayName = \"AlertDialog\";\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = \"AlertDialogOverlay\";\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, onInteractOutside, onPointerDownOutside, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"flex flex-col space-y-2 text-center sm:text-start\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-strong text-center text-lg font-medium sm:text-start\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-body text-center text-sm font-normal sm:text-start\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\n/**\n * A button that confirms the Alert Dialog action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n * Does not close the alert dialog by default.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t//\n\t\t\t\tappearance={appearance}\n\t\t\t\tpriority={buttonPriority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = \"AlertDialogAction\";\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Close asChild>\n\t\t\t<Button\n\t\t\t\tappearance={appearance}\n\t\t\t\tclassName={cx(\"mt-2 sm:mt-0\", className)}\n\t\t\t\tpriority={priority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPrimitive.Close>\n\t),\n);\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(\n\t({ className, svg, ...props }, ref) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tconst defaultColor =\n\t\t\tctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\t\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\t\treturn (\n\t\t\t<SvgOnly\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["Info","Warning","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","Root","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","forwardRef","className","ref","Overlay","cx","AlertDialogContent","onInteractOutside","onPointerDownOutside","jsxs","Content","event","preventCloseOnPromptInteraction","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","Close","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
package/dist/alert.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-EW5CFGXT.js";import{cva as d}from"class-variance-authority";import{forwardRef as n}from"react";import{jsx as i}from"react/jsx-runtime";var p=d("relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm",{variants:{priority:{danger:"border-danger-500/50 bg-danger-500/10 text-danger-700",default:"border-neutral-500/50 bg-neutral-500/10 text-neutral-700",info:"border-accent-500/50 bg-accent-500/10 text-accent-700",success:"border-success-500/50 bg-success-500/10 text-success-700",warning:"border-warning-500/50 bg-warning-500/10 text-warning-700"}},defaultVariants:{priority:"default"}}),s=n(({className:e,priority:t="default",...r},c)=>i("div",{ref:c,className:a(p({priority:t}),e),...r}));s.displayName="Alert";var l=n(({className:e,...t},r)=>i("div",{ref:r,className:a("min-w-0 flex-1",e),...t}));l.displayName="AlertContent";var o=n(({className:e,...t},r)=>i("h5",{ref:r,className:a("font-medium",e),...t}));o.displayName="AlertTitle";var m=n(({className:e,...t},r)=>i("div",{ref:r,className:a("text-sm",e),...t}));m.displayName="AlertDescription";export{s as Alert,l as AlertContent,m as AlertDescription,o as AlertTitle};
1
+ import{a}from"./chunk-AZ56JGNY.js";import{cva as d}from"class-variance-authority";import{forwardRef as n}from"react";import{jsx as i}from"react/jsx-runtime";var p=d("relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm",{variants:{priority:{danger:"border-danger-500/50 bg-danger-500/10 text-danger-700",default:"border-neutral-500/50 bg-neutral-500/10 text-neutral-700",info:"border-accent-500/50 bg-accent-500/10 text-accent-700",success:"border-success-500/50 bg-success-500/10 text-success-700",warning:"border-warning-500/50 bg-warning-500/10 text-warning-700"}},defaultVariants:{priority:"default"}}),s=n(({className:e,priority:t="default",...r},c)=>i("div",{ref:c,className:a(p({priority:t}),e),...r}));s.displayName="Alert";var l=n(({className:e,...t},r)=>i("div",{ref:r,className:a("min-w-0 flex-1",e),...t}));l.displayName="AlertContent";var o=n(({className:e,...t},r)=>i("h5",{ref:r,className:a("font-medium",e),...t}));o.displayName="AlertTitle";var m=n(({className:e,...t},r)=>i("div",{ref:r,className:a("text-sm",e),...t}));m.displayName="AlertDescription";export{s as Alert,l as AlertContent,m as AlertDescription,o as AlertTitle};
2
2
  //# sourceMappingURL=alert.js.map
package/dist/alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/alert/alert.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport type { VariantProps } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\nconst alertVariants = cva(\"relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm\", {\n\tvariants: {\n\t\t/**\n\t\t * The priority of the Alert. Indicates the importance or impact level of the Alert,\n\t\t * affecting its color and styling to communicate its purpose to the user.\n\t\t * @default \"default\"\n\t\t */\n\t\tpriority: {\n\t\t\tdanger: \"border-danger-500/50 bg-danger-500/10 text-danger-700\",\n\t\t\tdefault: \"border-neutral-500/50 bg-neutral-500/10 text-neutral-700\",\n\t\t\tinfo: \"border-accent-500/50 bg-accent-500/10 text-accent-700\",\n\t\t\tsuccess: \"border-success-500/50 bg-success-500/10 text-success-700\",\n\t\t\twarning: \"border-warning-500/50 bg-warning-500/10 text-warning-700\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tpriority: \"default\",\n\t},\n});\n\ntype AlertVariants = VariantProps<typeof alertVariants>;\n\n/**\n * Displays a callout for user attention.\n */\nconst Alert = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement> & AlertVariants>(\n\t({ className, priority = \"default\", ...props }, ref) => (\n\t\t<div ref={ref} className={cx(alertVariants({ priority }), className)} {...props} />\n\t),\n);\nAlert.displayName = \"Alert\";\n\n/**\n * The container for the content slot of an alert. Place the title and description as direct children.\n */\nconst AlertContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (\n\t<div ref={ref} className={cx(\"min-w-0 flex-1\", className)} {...props} />\n));\nAlertContent.displayName = \"AlertContent\";\n\n/**\n * The title of an alert.\n */\nconst AlertTitle = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLHeadingElement>>(\n\t({ className, ...props }, ref) => <h5 ref={ref} className={cx(\"font-medium\", className)} {...props} />,\n);\nAlertTitle.displayName = \"AlertTitle\";\n\n/**\n * The description of an alert.\n */\nconst AlertDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n\t({ className, ...props }, ref) => <div ref={ref} className={cx(\"text-sm\", className)} {...props} />,\n);\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertContent, AlertTitle, AlertDescription };\n"],"mappings":"mCAAA,OAAS,OAAAA,MAAW,2BACpB,OAAS,cAAAC,MAAkB,QAgCzB,cAAAC,MAAA,oBA3BF,IAAMC,EAAgBC,EAAI,+DAAgE,CACzF,SAAU,CAMT,SAAU,CACT,OAAQ,wDACR,QAAS,2DACT,KAAM,wDACN,QAAS,2DACT,QAAS,0DACV,CACD,EACA,gBAAiB,CAChB,SAAU,SACX,CACD,CAAC,EAOKC,EAAQC,EACb,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAW,UAAW,GAAGC,CAAM,EAAGC,IAC/CR,EAAC,OAAI,IAAKQ,EAAK,UAAWC,EAAGR,EAAc,CAAE,SAAAK,CAAS,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAAO,CAEnF,EACAJ,EAAM,YAAc,QAKpB,IAAMO,EAAeN,EAA2D,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACzGR,EAAC,OAAI,IAAKQ,EAAK,UAAWC,EAAG,iBAAkBJ,CAAS,EAAI,GAAGE,EAAO,CACtE,EACDG,EAAa,YAAc,eAK3B,IAAMC,EAAaP,EAClB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IAAQR,EAAC,MAAG,IAAKQ,EAAK,UAAWC,EAAG,cAAeJ,CAAS,EAAI,GAAGE,EAAO,CACrG,EACAI,EAAW,YAAc,aAKzB,IAAMC,EAAmBR,EACxB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IAAQR,EAAC,OAAI,IAAKQ,EAAK,UAAWC,EAAG,UAAWJ,CAAS,EAAI,GAAGE,EAAO,CAClG,EACAK,EAAiB,YAAc","names":["cva","forwardRef","jsx","alertVariants","cva","Alert","forwardRef","className","priority","props","ref","cx","AlertContent","AlertTitle","AlertDescription"]}
1
+ {"version":3,"sources":["../src/components/alert/alert.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport type { VariantProps } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\nconst alertVariants = cva(\n\t\"relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * The priority of the Alert. Indicates the importance or impact level of the Alert,\n\t\t\t * affecting its color and styling to communicate its purpose to the user.\n\t\t\t * @default \"default\"\n\t\t\t */\n\t\t\tpriority: {\n\t\t\t\tdanger: \"border-danger-500/50 bg-danger-500/10 text-danger-700\",\n\t\t\t\tdefault: \"border-neutral-500/50 bg-neutral-500/10 text-neutral-700\",\n\t\t\t\tinfo: \"border-accent-500/50 bg-accent-500/10 text-accent-700\",\n\t\t\t\tsuccess: \"border-success-500/50 bg-success-500/10 text-success-700\",\n\t\t\t\twarning: \"border-warning-500/50 bg-warning-500/10 text-warning-700\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tpriority: \"default\",\n\t\t},\n\t},\n);\n\ntype AlertVariants = VariantProps<typeof alertVariants>;\n\n/**\n * Displays a callout for user attention.\n */\nconst Alert = forwardRef<\n\tHTMLDivElement,\n\tHTMLAttributes<HTMLDivElement> & AlertVariants\n>(({ className, priority = \"default\", ...props }, ref) => (\n\t<div\n\t\tref={ref}\n\t\tclassName={cx(alertVariants({ priority }), className)}\n\t\t{...props}\n\t/>\n));\nAlert.displayName = \"Alert\";\n\n/**\n * The container for the content slot of an alert. Place the title and description as direct children.\n */\nconst AlertContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n\t({ className, ...props }, ref) => (\n\t\t<div ref={ref} className={cx(\"min-w-0 flex-1\", className)} {...props} />\n\t),\n);\nAlertContent.displayName = \"AlertContent\";\n\n/**\n * The title of an alert.\n */\nconst AlertTitle = forwardRef<\n\tHTMLParagraphElement,\n\tHTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n\t<h5 ref={ref} className={cx(\"font-medium\", className)} {...props} />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\n/**\n * The description of an alert.\n */\nconst AlertDescription = forwardRef<\n\tHTMLParagraphElement,\n\tHTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n\t<div ref={ref} className={cx(\"text-sm\", className)} {...props} />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertContent, AlertTitle, AlertDescription };\n"],"mappings":"mCAAA,OAAS,OAAAA,MAAW,2BACpB,OAAS,cAAAC,MAAkB,QAqC1B,cAAAC,MAAA,oBAhCD,IAAMC,EAAgBC,EACrB,+DACA,CACC,SAAU,CAMT,SAAU,CACT,OAAQ,wDACR,QAAS,2DACT,KAAM,wDACN,QAAS,2DACT,QAAS,0DACV,CACD,EACA,gBAAiB,CAChB,SAAU,SACX,CACD,CACD,EAOMC,EAAQC,EAGZ,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAW,UAAW,GAAGC,CAAM,EAAGC,IACjDR,EAAC,OACA,IAAKQ,EACL,UAAWC,EAAGR,EAAc,CAAE,SAAAK,CAAS,CAAC,EAAGD,CAAS,EACnD,GAAGE,EACL,CACA,EACDJ,EAAM,YAAc,QAKpB,IAAMO,EAAeN,EACpB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACzBR,EAAC,OAAI,IAAKQ,EAAK,UAAWC,EAAG,iBAAkBJ,CAAS,EAAI,GAAGE,EAAO,CAExE,EACAG,EAAa,YAAc,eAK3B,IAAMC,EAAaP,EAGjB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IAC3BR,EAAC,MAAG,IAAKQ,EAAK,UAAWC,EAAG,cAAeJ,CAAS,EAAI,GAAGE,EAAO,CAClE,EACDI,EAAW,YAAc,aAKzB,IAAMC,EAAmBR,EAGvB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IAC3BR,EAAC,OAAI,IAAKQ,EAAK,UAAWC,EAAG,UAAWJ,CAAS,EAAI,GAAGE,EAAO,CAC/D,EACDK,EAAiB,YAAc","names":["cva","forwardRef","jsx","alertVariants","cva","Alert","forwardRef","className","priority","props","ref","cx","AlertContent","AlertTitle","AlertDescription"]}
package/dist/anchor.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-EW5CFGXT.js";import{Slot as a}from"@radix-ui/react-slot";import{forwardRef as f}from"react";import{jsx as m}from"react/jsx-runtime";var s=e=>o("cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent",e),i=f(({asChild:e,className:t,rel:n,...r},c)=>{let p=e?a:"a",u=l(n);return m(p,{className:s(t),ref:c,rel:u,...r})});i.displayName="Anchor";function l(e){return Array.isArray(e)?[...new Set(e)].map(r=>r?.trim()).filter(Boolean).sort().join(" ")||void 0:e?.trim()||void 0}export{i as Anchor,s as anchorClassNames,l as resolveRel};
1
+ import{a as o}from"./chunk-AZ56JGNY.js";import{Slot as a}from"@radix-ui/react-slot";import{forwardRef as f}from"react";import{jsx as m}from"react/jsx-runtime";var s=e=>o("cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent",e),i=f(({asChild:e,className:t,rel:n,...r},c)=>{let p=e?a:"a",u=l(n);return m(p,{className:s(t),ref:c,rel:u,...r})});i.displayName="Anchor";function l(e){return Array.isArray(e)?[...new Set(e)].map(r=>r?.trim()).filter(Boolean).sort().join(" ")||void 0:e?.trim()||void 0}export{i as Anchor,s as anchorClassNames,l as resolveRel};
2
2
  //# sourceMappingURL=anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/anchor/anchor.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { forwardRef } from \"react\";\nimport type { AnchorHTMLAttributes } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { Rel, Target } from \"./types.js\";\n\n/**\n * The class names for the `Anchor` component which define the styles for the component.\n */\nconst anchorClassNames = (className?: string) =>\n\tcx(\n\t\t\"cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent\",\n\t\tclassName,\n\t);\n\n/**\n * The props for the `Anchor` component.\n */\ntype AnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"rel\" | \"target\"> &\n\tWithAsChild & {\n\t\t/**\n\t\t * The rel attribute defines the relationship between a linked resource and the current document.\n\t\t *\n\t\t * Every keyword within a space-separated value should be unique within that value.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel\n\t\t */\n\t\trel?: Rel | (string & {}) | undefined | (Rel | (string & {}) | undefined | null)[];\n\t\t/**\n\t\t * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).\n\t\t *\n\t\t * Note: Setting `target=\"_blank\"` on <a> elements implicitly provides the same rel behavior as setting `rel=\"noopener\"` which does not set `window.opener`.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n\t\t *\n\t\t * @default \"_self\"\n\t\t */\n\t\ttarget?: Target | undefined;\n\t};\n\n/**\n * Fundamental component for rendering links to external addresses.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a\n *\n * @note If you need to link to an internal application route, prefer using the\n * [`react-router-dom` `<Link>`](https://reactrouter.com/en/main/components/link) or the\n * [`@remix-run/react` `<Link>`](https://remix.run/docs/en/main/components/link).\n */\nconst Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(({ asChild, className, rel: propRel, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"a\";\n\tconst rel = resolveRel(propRel);\n\n\treturn <Component className={anchorClassNames(className)} ref={ref} rel={rel} {...props} />;\n});\nAnchor.displayName = \"Anchor\";\n\n/**\n * Resolves the `rel` attribute to a string.\n *\n * If the value is an array, it will be filtered for empty values, ensure uniqueness, sorted, and joined with a space.\n */\nfunction resolveRel(rel: Rel | (string & {}) | undefined | null | (Rel | (string & {}) | undefined | null)[]) {\n\tif (Array.isArray(rel)) {\n\t\tconst uniqueRel = new Set(rel);\n\t\tconst result = [...uniqueRel]\n\t\t\t.map((item) => item?.trim())\n\t\t\t.filter(Boolean)\n\t\t\t.sort()\n\t\t\t.join(\" \");\n\t\treturn result || undefined;\n\t}\n\n\treturn rel?.trim() || undefined;\n}\n\nexport { Anchor, anchorClassNames, resolveRel };\nexport type { AnchorProps };\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,cAAAC,MAAkB,QAqDnB,cAAAC,MAAA,oBA5CR,IAAMC,EAAoBC,GACzBC,EACC,8IACAD,CACD,EAoCKE,EAASC,EAA2C,CAAC,CAAE,QAAAC,EAAS,UAAAJ,EAAW,IAAKK,EAAS,GAAGC,CAAM,EAAGC,IAAQ,CAClH,IAAMC,EAAYJ,EAAUK,EAAO,IAC7BC,EAAMC,EAAWN,CAAO,EAE9B,OAAOP,EAACU,EAAA,CAAU,UAAWT,EAAiBC,CAAS,EAAG,IAAKO,EAAK,IAAKG,EAAM,GAAGJ,EAAO,CAC1F,CAAC,EACDJ,EAAO,YAAc,SAOrB,SAASS,EAAWD,EAA0F,CAC7G,OAAI,MAAM,QAAQA,CAAG,EAEL,CAAC,GADE,IAAI,IAAIA,CAAG,CACD,EAC1B,IAAKE,GAASA,GAAM,KAAK,CAAC,EAC1B,OAAO,OAAO,EACd,KAAK,EACL,KAAK,GAAG,GACO,OAGXF,GAAK,KAAK,GAAK,MACvB","names":["Slot","forwardRef","jsx","anchorClassNames","className","cx","Anchor","forwardRef","asChild","propRel","props","ref","Component","Slot","rel","resolveRel","item"]}
1
+ {"version":3,"sources":["../src/components/anchor/anchor.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { forwardRef } from \"react\";\nimport type { AnchorHTMLAttributes } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { Rel, Target } from \"./types.js\";\n\n/**\n * The class names for the `Anchor` component which define the styles for the component.\n */\nconst anchorClassNames = (className?: string) =>\n\tcx(\n\t\t\"cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent\",\n\t\tclassName,\n\t);\n\n/**\n * The props for the `Anchor` component.\n */\ntype AnchorProps = Omit<\n\tAnchorHTMLAttributes<HTMLAnchorElement>,\n\t\"rel\" | \"target\"\n> &\n\tWithAsChild & {\n\t\t/**\n\t\t * The rel attribute defines the relationship between a linked resource and the current document.\n\t\t *\n\t\t * Every keyword within a space-separated value should be unique within that value.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel\n\t\t */\n\t\trel?:\n\t\t\t| Rel\n\t\t\t| (string & {})\n\t\t\t| undefined\n\t\t\t| (Rel | (string & {}) | undefined | null)[];\n\t\t/**\n\t\t * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).\n\t\t *\n\t\t * Note: Setting `target=\"_blank\"` on <a> elements implicitly provides the same rel behavior as setting `rel=\"noopener\"` which does not set `window.opener`.\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n\t\t *\n\t\t * @default \"_self\"\n\t\t */\n\t\ttarget?: Target | undefined;\n\t};\n\n/**\n * Fundamental component for rendering links to external addresses.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a\n *\n * @note If you need to link to an internal application route, prefer using the\n * [`react-router-dom` `<Link>`](https://reactrouter.com/en/main/components/link) or the\n * [`@remix-run/react` `<Link>`](https://remix.run/docs/en/main/components/link).\n */\nconst Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(\n\t({ asChild, className, rel: propRel, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"a\";\n\t\tconst rel = resolveRel(propRel);\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tclassName={anchorClassNames(className)}\n\t\t\t\tref={ref}\n\t\t\t\trel={rel}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAnchor.displayName = \"Anchor\";\n\n/**\n * Resolves the `rel` attribute to a string.\n *\n * If the value is an array, it will be filtered for empty values, ensure uniqueness, sorted, and joined with a space.\n */\nfunction resolveRel(\n\trel:\n\t\t| Rel\n\t\t| (string & {})\n\t\t| undefined\n\t\t| null\n\t\t| (Rel | (string & {}) | undefined | null)[],\n) {\n\tif (Array.isArray(rel)) {\n\t\tconst uniqueRel = new Set(rel);\n\t\tconst result = [...uniqueRel]\n\t\t\t.map((item) => item?.trim())\n\t\t\t.filter(Boolean)\n\t\t\t.sort()\n\t\t\t.join(\" \");\n\t\treturn result || undefined;\n\t}\n\n\treturn rel?.trim() || undefined;\n}\n\nexport { Anchor, anchorClassNames, resolveRel };\nexport type { AnchorProps };\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,cAAAC,MAAkB,QA8DxB,cAAAC,MAAA,oBArDH,IAAMC,EAAoBC,GACzBC,EACC,8IACAD,CACD,EA2CKE,EAASC,EACd,CAAC,CAAE,QAAAC,EAAS,UAAAJ,EAAW,IAAKK,EAAS,GAAGC,CAAM,EAAGC,IAAQ,CACxD,IAAMC,EAAYJ,EAAUK,EAAO,IAC7BC,EAAMC,EAAWN,CAAO,EAE9B,OACCP,EAACU,EAAA,CACA,UAAWT,EAAiBC,CAAS,EACrC,IAAKO,EACL,IAAKG,EACJ,GAAGJ,EACL,CAEF,CACD,EACAJ,EAAO,YAAc,SAOrB,SAASS,EACRD,EAMC,CACD,OAAI,MAAM,QAAQA,CAAG,EAEL,CAAC,GADE,IAAI,IAAIA,CAAG,CACD,EAC1B,IAAKE,GAASA,GAAM,KAAK,CAAC,EAC1B,OAAO,OAAO,EACd,KAAK,EACL,KAAK,GAAG,GACO,OAGXF,GAAK,KAAK,GAAK,MACvB","names":["Slot","forwardRef","jsx","anchorClassNames","className","cx","Anchor","forwardRef","asChild","propRel","props","ref","Component","Slot","rel","resolveRel","item"]}
package/dist/badge.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-VJPVAY5J.js";import{a as c}from"./chunk-EW5CFGXT.js";import{Slot as y}from"@radix-ui/react-slot";import{Children as f,cloneElement as h,isValidElement as C}from"react";import n from"tiny-invariant";import{Fragment as S,jsx as s,jsxs as d}from"react/jsx-runtime";var k=({appearance:t,asChild:e=!1,children:l,className:u,color:i="neutral",icon:r,...g})=>{let m=v(i,t),b=A(i,t),p=c("inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs",r&&"ps-1",m,b,u);if(e){let a=f.only(l);n(C(a),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let x=a.props?.children;return s(y,{className:p,...g,children:h(a,{},d(S,{children:[r&&s(o,{className:"size-4",svg:r}),x]}))})}return d("span",{className:p,...g,children:[r&&s(o,{className:"size-4",svg:r}),l]})};var w={amber:"bg-amber-500/20",blue:"bg-blue-500/20",cyan:"bg-cyan-500/20",emerald:"bg-emerald-500/20",fuchsia:"bg-fuchsia-500/20",gray:"bg-gray-500/20",green:"bg-green-500/20",indigo:"bg-indigo-500/20",lime:"bg-lime-500/20",orange:"bg-orange-500/20",pink:"bg-pink-500/20",purple:"bg-purple-500/20",red:"bg-red-500/20",rose:"bg-rose-500/20",sky:"bg-sky-500/20",teal:"bg-teal-500/20",violet:"bg-violet-500/20",yellow:"bg-yellow-500/20",accent:"bg-accent-500/20",danger:"bg-danger-500/20",neutral:"bg-neutral-500/20",success:"bg-success-500/20",warning:"bg-warning-500/20"};function v(t,e){switch(e){case"muted":return w[t];default:n(!1,`Invalid appearance: ${String(e)}`)}}var B={amber:"text-amber-700",blue:"text-blue-700",cyan:"text-cyan-700",emerald:"text-emerald-700",fuchsia:"text-fuchsia-700",gray:"text-gray-700",green:"text-green-700",indigo:"text-indigo-700",lime:"text-lime-700",orange:"text-orange-700",pink:"text-pink-700",purple:"text-purple-700",red:"text-red-700",rose:"text-rose-700",sky:"text-sky-700",teal:"text-teal-700",violet:"text-violet-700",yellow:"text-yellow-700",accent:"text-accent-700",danger:"text-danger-700",neutral:"text-neutral-700",success:"text-success-700",warning:"text-warning-700"};function A(t,e){switch(e){case"muted":return B[t];default:n(!1,`Invalid appearance: ${String(e)}`)}}export{k as Badge};
1
+ import{a as o}from"./chunk-IQCYQ6RC.js";import{a as c}from"./chunk-AZ56JGNY.js";import{Slot as y}from"@radix-ui/react-slot";import{Children as f,cloneElement as h,isValidElement as C}from"react";import n from"tiny-invariant";import{Fragment as S,jsx as s,jsxs as d}from"react/jsx-runtime";var k=({appearance:t,asChild:e=!1,children:l,className:u,color:i="neutral",icon:r,...g})=>{let m=v(i,t),b=A(i,t),p=c("inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs",r&&"ps-1",m,b,u);if(e){let a=f.only(l);n(C(a),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let x=a.props?.children;return s(y,{className:p,...g,children:h(a,{},d(S,{children:[r&&s(o,{className:"size-4",svg:r}),x]}))})}return d("span",{className:p,...g,children:[r&&s(o,{className:"size-4",svg:r}),l]})};var w={amber:"bg-amber-500/20",blue:"bg-blue-500/20",cyan:"bg-cyan-500/20",emerald:"bg-emerald-500/20",fuchsia:"bg-fuchsia-500/20",gray:"bg-gray-500/20",green:"bg-green-500/20",indigo:"bg-indigo-500/20",lime:"bg-lime-500/20",orange:"bg-orange-500/20",pink:"bg-pink-500/20",purple:"bg-purple-500/20",red:"bg-red-500/20",rose:"bg-rose-500/20",sky:"bg-sky-500/20",teal:"bg-teal-500/20",violet:"bg-violet-500/20",yellow:"bg-yellow-500/20",accent:"bg-accent-500/20",danger:"bg-danger-500/20",neutral:"bg-neutral-500/20",success:"bg-success-500/20",warning:"bg-warning-500/20"};function v(t,e){switch(e){case"muted":return w[t];default:n(!1,`Invalid appearance: ${String(e)}`)}}var B={amber:"text-amber-700",blue:"text-blue-700",cyan:"text-cyan-700",emerald:"text-emerald-700",fuchsia:"text-fuchsia-700",gray:"text-gray-700",green:"text-green-700",indigo:"text-indigo-700",lime:"text-lime-700",orange:"text-orange-700",pink:"text-pink-700",purple:"text-purple-700",red:"text-red-700",rose:"text-rose-700",sky:"text-sky-700",teal:"text-teal-700",violet:"text-violet-700",yellow:"text-yellow-700",accent:"text-accent-700",danger:"text-danger-700",neutral:"text-neutral-700",success:"text-success-700",warning:"text-warning-700"};function A(t,e){switch(e){case"muted":return B[t];default:n(!1,`Invalid appearance: ${String(e)}`)}}export{k as Badge};
2
2
  //# sourceMappingURL=badge.js.map
package/dist/badge.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/badge/badge.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport { Children, cloneElement, isValidElement, type HTMLAttributes, type ReactNode } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport type { Color } from \"../../utils/color/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\n\nconst appearances = [\"muted\" /*\"strong\" */] as const;\ntype Appearance = (typeof appearances)[number];\n\ntype BadgeProps = HTMLAttributes<HTMLSpanElement> &\n\tWithAsChild & {\n\t\t/**\n\t\t * The color variant of the badge. Accepts named colors and functional colors from the mantle color palette.\n\t\t */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The icon to render inside the badge.\n\t\t */\n\t\ticon?: ReactNode;\n\t\t/**\n\t\t * The visual style of the badge.\n\t\t */\n\t\tappearance: Appearance;\n\t};\n\n/**\n * A Badge is a non-interactive component used to highlight important information or to visually indicate the status of an item.\n */\nconst Badge = ({ appearance, asChild = false, children, className, color = \"neutral\", icon, ...props }: BadgeProps) => {\n\tconst bgColor = computeBgColor(color, appearance);\n\tconst textColor = computeTextColor(color, appearance);\n\n\tconst badgeClasses = cx(\n\t\t\"inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs\",\n\t\ticon && \"ps-1\",\n\t\tbgColor,\n\t\ttextColor,\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\tconst singleChild = Children.only(children);\n\t\tinvariant(\n\t\t\tisValidElement<BadgeProps>(singleChild),\n\t\t\t\"When using `asChild`, Badge must be passed a single child as a JSX tag.\",\n\t\t);\n\t\tconst grandchildren = singleChild.props?.children;\n\n\t\treturn (\n\t\t\t<Slot className={badgeClasses} {...props}>\n\t\t\t\t{cloneElement(\n\t\t\t\t\tsingleChild,\n\t\t\t\t\t{},\n\t\t\t\t\t<>\n\t\t\t\t\t\t{icon && <SvgOnly className=\"size-4\" svg={icon} />}\n\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t</>,\n\t\t\t\t)}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<span className={badgeClasses} {...props}>\n\t\t\t{icon && <SvgOnly className=\"size-4\" svg={icon} />}\n\t\t\t{children}\n\t\t</span>\n\t);\n};\n\n// MARK: - Exports\n\nexport { Badge };\n\nexport type { BadgeProps };\n\n// MARK: - Private\n\nconst mutedBgColorLookup = {\n\tamber: \"bg-amber-500/20\",\n\tblue: \"bg-blue-500/20\",\n\tcyan: \"bg-cyan-500/20\",\n\temerald: \"bg-emerald-500/20\",\n\tfuchsia: \"bg-fuchsia-500/20\",\n\tgray: \"bg-gray-500/20\",\n\tgreen: \"bg-green-500/20\",\n\tindigo: \"bg-indigo-500/20\",\n\tlime: \"bg-lime-500/20\",\n\torange: \"bg-orange-500/20\",\n\tpink: \"bg-pink-500/20\",\n\tpurple: \"bg-purple-500/20\",\n\tred: \"bg-red-500/20\",\n\trose: \"bg-rose-500/20\",\n\tsky: \"bg-sky-500/20\",\n\tteal: \"bg-teal-500/20\",\n\tviolet: \"bg-violet-500/20\",\n\tyellow: \"bg-yellow-500/20\",\n\taccent: \"bg-accent-500/20\",\n\tdanger: \"bg-danger-500/20\",\n\tneutral: \"bg-neutral-500/20\",\n\tsuccess: \"bg-success-500/20\",\n\twarning: \"bg-warning-500/20\",\n} satisfies Record<Color, string>;\n\nfunction computeBgColor(color: Color, appearance: Appearance) {\n\tswitch (appearance) {\n\t\tcase \"muted\":\n\t\t\treturn mutedBgColorLookup[color];\n\t\tdefault:\n\t\t\tinvariant(false, `Invalid appearance: ${String(appearance)}`);\n\t}\n}\n\nconst textColorMutedLookup = {\n\tamber: \"text-amber-700\",\n\tblue: \"text-blue-700\",\n\tcyan: \"text-cyan-700\",\n\temerald: \"text-emerald-700\",\n\tfuchsia: \"text-fuchsia-700\",\n\tgray: \"text-gray-700\",\n\tgreen: \"text-green-700\",\n\tindigo: \"text-indigo-700\",\n\tlime: \"text-lime-700\",\n\torange: \"text-orange-700\",\n\tpink: \"text-pink-700\",\n\tpurple: \"text-purple-700\",\n\tred: \"text-red-700\",\n\trose: \"text-rose-700\",\n\tsky: \"text-sky-700\",\n\tteal: \"text-teal-700\",\n\tviolet: \"text-violet-700\",\n\tyellow: \"text-yellow-700\",\n\taccent: \"text-accent-700\",\n\tdanger: \"text-danger-700\",\n\tneutral: \"text-neutral-700\",\n\tsuccess: \"text-success-700\",\n\twarning: \"text-warning-700\",\n} satisfies Record<Color, string>;\n\nfunction computeTextColor(color: Color, appearance: Appearance) {\n\tswitch (appearance) {\n\t\tcase \"muted\":\n\t\t\treturn textColorMutedLookup[color];\n\t\tdefault:\n\t\t\tinvariant(false, `Invalid appearance: ${String(appearance)}`);\n\t}\n}\n"],"mappings":"gFAAA,OAAS,QAAAA,MAAY,uBACrB,OAAS,YAAAC,EAAU,gBAAAC,EAAc,kBAAAC,MAA2D,QAC5F,OAAOC,MAAe,iBAqDjB,mBAAAC,EACU,OAAAC,EADV,QAAAC,MAAA,oBAzBL,IAAMC,EAAQ,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAU,GAAO,SAAAC,EAAU,UAAAC,EAAW,MAAAC,EAAQ,UAAW,KAAAC,EAAM,GAAGC,CAAM,IAAkB,CACtH,IAAMC,EAAUC,EAAeJ,EAAOJ,CAAU,EAC1CS,EAAYC,EAAiBN,EAAOJ,CAAU,EAE9CW,EAAeC,EACpB,yGACAP,GAAQ,OACRE,EACAE,EACAN,CACD,EAEA,GAAIF,EAAS,CACZ,IAAMY,EAAcC,EAAS,KAAKZ,CAAQ,EAC1Ca,EACCC,EAA2BH,CAAW,EACtC,yEACD,EACA,IAAMI,EAAgBJ,EAAY,OAAO,SAEzC,OACCK,EAACC,EAAA,CAAK,UAAWR,EAAe,GAAGL,EACjC,SAAAc,EACAP,EACA,CAAC,EACDQ,EAAAC,EAAA,CACE,UAAAjB,GAAQa,EAACK,EAAA,CAAQ,UAAU,SAAS,IAAKlB,EAAM,EAC/CY,GACF,CACD,EACD,CAEF,CAEA,OACCI,EAAC,QAAK,UAAWV,EAAe,GAAGL,EACjC,UAAAD,GAAQa,EAACK,EAAA,CAAQ,UAAU,SAAS,IAAKlB,EAAM,EAC/CH,GACF,CAEF,EAUA,IAAMsB,EAAqB,CAC1B,MAAO,kBACP,KAAM,iBACN,KAAM,iBACN,QAAS,oBACT,QAAS,oBACT,KAAM,iBACN,MAAO,kBACP,OAAQ,mBACR,KAAM,iBACN,OAAQ,mBACR,KAAM,iBACN,OAAQ,mBACR,IAAK,gBACL,KAAM,iBACN,IAAK,gBACL,KAAM,iBACN,OAAQ,mBACR,OAAQ,mBACR,OAAQ,mBACR,OAAQ,mBACR,QAAS,oBACT,QAAS,oBACT,QAAS,mBACV,EAEA,SAASC,EAAeC,EAAcC,EAAwB,CAC7D,OAAQA,EAAY,CACnB,IAAK,QACJ,OAAOH,EAAmBE,CAAK,EAChC,QACCE,EAAU,GAAO,uBAAuB,OAAOD,CAAU,CAAC,EAAE,CAC9D,CACD,CAEA,IAAME,EAAuB,CAC5B,MAAO,iBACP,KAAM,gBACN,KAAM,gBACN,QAAS,mBACT,QAAS,mBACT,KAAM,gBACN,MAAO,iBACP,OAAQ,kBACR,KAAM,gBACN,OAAQ,kBACR,KAAM,gBACN,OAAQ,kBACR,IAAK,eACL,KAAM,gBACN,IAAK,eACL,KAAM,gBACN,OAAQ,kBACR,OAAQ,kBACR,OAAQ,kBACR,OAAQ,kBACR,QAAS,mBACT,QAAS,mBACT,QAAS,kBACV,EAEA,SAASC,EAAiBJ,EAAcC,EAAwB,CAC/D,OAAQA,EAAY,CACnB,IAAK,QACJ,OAAOE,EAAqBH,CAAK,EAClC,QACCE,EAAU,GAAO,uBAAuB,OAAOD,CAAU,CAAC,EAAE,CAC9D,CACD","names":["Slot","Children","cloneElement","isValidElement","invariant","Fragment","jsx","jsxs","Badge","appearance","asChild","children","className","color","icon","props","bgColor","computeBgColor","textColor","computeTextColor","badgeClasses","cx","singleChild","Children","invariant","isValidElement","grandchildren","jsx","Slot","cloneElement","jsxs","Fragment","SvgOnly","mutedBgColorLookup","computeBgColor","color","appearance","invariant","textColorMutedLookup","computeTextColor"]}
1
+ {"version":3,"sources":["../src/components/badge/badge.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport {\n\tChildren,\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tcloneElement,\n\tisValidElement,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport type { Color } from \"../../utils/color/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\n\nconst appearances = [\"muted\" /*\"strong\" */] as const;\ntype Appearance = (typeof appearances)[number];\n\ntype BadgeProps = HTMLAttributes<HTMLSpanElement> &\n\tWithAsChild & {\n\t\t/**\n\t\t * The color variant of the badge. Accepts named colors and functional colors from the mantle color palette.\n\t\t */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The icon to render inside the badge.\n\t\t */\n\t\ticon?: ReactNode;\n\t\t/**\n\t\t * The visual style of the badge.\n\t\t */\n\t\tappearance: Appearance;\n\t};\n\n/**\n * A Badge is a non-interactive component used to highlight important information or to visually indicate the status of an item.\n */\nconst Badge = ({\n\tappearance,\n\tasChild = false,\n\tchildren,\n\tclassName,\n\tcolor = \"neutral\",\n\ticon,\n\t...props\n}: BadgeProps) => {\n\tconst bgColor = computeBgColor(color, appearance);\n\tconst textColor = computeTextColor(color, appearance);\n\n\tconst badgeClasses = cx(\n\t\t\"inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs\",\n\t\ticon && \"ps-1\",\n\t\tbgColor,\n\t\ttextColor,\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\tconst singleChild = Children.only(children);\n\t\tinvariant(\n\t\t\tisValidElement<BadgeProps>(singleChild),\n\t\t\t\"When using `asChild`, Badge must be passed a single child as a JSX tag.\",\n\t\t);\n\t\tconst grandchildren = singleChild.props?.children;\n\n\t\treturn (\n\t\t\t<Slot className={badgeClasses} {...props}>\n\t\t\t\t{cloneElement(\n\t\t\t\t\tsingleChild,\n\t\t\t\t\t{},\n\t\t\t\t\t<>\n\t\t\t\t\t\t{icon && <SvgOnly className=\"size-4\" svg={icon} />}\n\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t</>,\n\t\t\t\t)}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<span className={badgeClasses} {...props}>\n\t\t\t{icon && <SvgOnly className=\"size-4\" svg={icon} />}\n\t\t\t{children}\n\t\t</span>\n\t);\n};\n\n// MARK: - Exports\n\nexport { Badge };\n\nexport type { BadgeProps };\n\n// MARK: - Private\n\nconst mutedBgColorLookup = {\n\tamber: \"bg-amber-500/20\",\n\tblue: \"bg-blue-500/20\",\n\tcyan: \"bg-cyan-500/20\",\n\temerald: \"bg-emerald-500/20\",\n\tfuchsia: \"bg-fuchsia-500/20\",\n\tgray: \"bg-gray-500/20\",\n\tgreen: \"bg-green-500/20\",\n\tindigo: \"bg-indigo-500/20\",\n\tlime: \"bg-lime-500/20\",\n\torange: \"bg-orange-500/20\",\n\tpink: \"bg-pink-500/20\",\n\tpurple: \"bg-purple-500/20\",\n\tred: \"bg-red-500/20\",\n\trose: \"bg-rose-500/20\",\n\tsky: \"bg-sky-500/20\",\n\tteal: \"bg-teal-500/20\",\n\tviolet: \"bg-violet-500/20\",\n\tyellow: \"bg-yellow-500/20\",\n\taccent: \"bg-accent-500/20\",\n\tdanger: \"bg-danger-500/20\",\n\tneutral: \"bg-neutral-500/20\",\n\tsuccess: \"bg-success-500/20\",\n\twarning: \"bg-warning-500/20\",\n} satisfies Record<Color, string>;\n\nfunction computeBgColor(color: Color, appearance: Appearance) {\n\tswitch (appearance) {\n\t\tcase \"muted\":\n\t\t\treturn mutedBgColorLookup[color];\n\t\tdefault:\n\t\t\tinvariant(false, `Invalid appearance: ${String(appearance)}`);\n\t}\n}\n\nconst textColorMutedLookup = {\n\tamber: \"text-amber-700\",\n\tblue: \"text-blue-700\",\n\tcyan: \"text-cyan-700\",\n\temerald: \"text-emerald-700\",\n\tfuchsia: \"text-fuchsia-700\",\n\tgray: \"text-gray-700\",\n\tgreen: \"text-green-700\",\n\tindigo: \"text-indigo-700\",\n\tlime: \"text-lime-700\",\n\torange: \"text-orange-700\",\n\tpink: \"text-pink-700\",\n\tpurple: \"text-purple-700\",\n\tred: \"text-red-700\",\n\trose: \"text-rose-700\",\n\tsky: \"text-sky-700\",\n\tteal: \"text-teal-700\",\n\tviolet: \"text-violet-700\",\n\tyellow: \"text-yellow-700\",\n\taccent: \"text-accent-700\",\n\tdanger: \"text-danger-700\",\n\tneutral: \"text-neutral-700\",\n\tsuccess: \"text-success-700\",\n\twarning: \"text-warning-700\",\n} satisfies Record<Color, string>;\n\nfunction computeTextColor(color: Color, appearance: Appearance) {\n\tswitch (appearance) {\n\t\tcase \"muted\":\n\t\t\treturn textColorMutedLookup[color];\n\t\tdefault:\n\t\t\tinvariant(false, `Invalid appearance: ${String(appearance)}`);\n\t}\n}\n"],"mappings":"gFAAA,OAAS,QAAAA,MAAY,uBACrB,OACC,YAAAC,EAGA,gBAAAC,EACA,kBAAAC,MACM,QACP,OAAOC,MAAe,iBA6DjB,mBAAAC,EACU,OAAAC,EADV,QAAAC,MAAA,oBAjCL,IAAMC,EAAQ,CAAC,CACd,WAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EACA,UAAAC,EACA,MAAAC,EAAQ,UACR,KAAAC,EACA,GAAGC,CACJ,IAAkB,CACjB,IAAMC,EAAUC,EAAeJ,EAAOJ,CAAU,EAC1CS,EAAYC,EAAiBN,EAAOJ,CAAU,EAE9CW,EAAeC,EACpB,yGACAP,GAAQ,OACRE,EACAE,EACAN,CACD,EAEA,GAAIF,EAAS,CACZ,IAAMY,EAAcC,EAAS,KAAKZ,CAAQ,EAC1Ca,EACCC,EAA2BH,CAAW,EACtC,yEACD,EACA,IAAMI,EAAgBJ,EAAY,OAAO,SAEzC,OACCK,EAACC,EAAA,CAAK,UAAWR,EAAe,GAAGL,EACjC,SAAAc,EACAP,EACA,CAAC,EACDQ,EAAAC,EAAA,CACE,UAAAjB,GAAQa,EAACK,EAAA,CAAQ,UAAU,SAAS,IAAKlB,EAAM,EAC/CY,GACF,CACD,EACD,CAEF,CAEA,OACCI,EAAC,QAAK,UAAWV,EAAe,GAAGL,EACjC,UAAAD,GAAQa,EAACK,EAAA,CAAQ,UAAU,SAAS,IAAKlB,EAAM,EAC/CH,GACF,CAEF,EAUA,IAAMsB,EAAqB,CAC1B,MAAO,kBACP,KAAM,iBACN,KAAM,iBACN,QAAS,oBACT,QAAS,oBACT,KAAM,iBACN,MAAO,kBACP,OAAQ,mBACR,KAAM,iBACN,OAAQ,mBACR,KAAM,iBACN,OAAQ,mBACR,IAAK,gBACL,KAAM,iBACN,IAAK,gBACL,KAAM,iBACN,OAAQ,mBACR,OAAQ,mBACR,OAAQ,mBACR,OAAQ,mBACR,QAAS,oBACT,QAAS,oBACT,QAAS,mBACV,EAEA,SAASC,EAAeC,EAAcC,EAAwB,CAC7D,OAAQA,EAAY,CACnB,IAAK,QACJ,OAAOH,EAAmBE,CAAK,EAChC,QACCE,EAAU,GAAO,uBAAuB,OAAOD,CAAU,CAAC,EAAE,CAC9D,CACD,CAEA,IAAME,EAAuB,CAC5B,MAAO,iBACP,KAAM,gBACN,KAAM,gBACN,QAAS,mBACT,QAAS,mBACT,KAAM,gBACN,MAAO,iBACP,OAAQ,kBACR,KAAM,gBACN,OAAQ,kBACR,KAAM,gBACN,OAAQ,kBACR,IAAK,eACL,KAAM,gBACN,IAAK,eACL,KAAM,gBACN,OAAQ,kBACR,OAAQ,kBACR,OAAQ,kBACR,OAAQ,kBACR,QAAS,mBACT,QAAS,mBACT,QAAS,kBACV,EAEA,SAASC,EAAiBJ,EAAcC,EAAwB,CAC/D,OAAQA,EAAY,CACnB,IAAK,QACJ,OAAOE,EAAqBH,CAAK,EAClC,QACCE,EAAU,GAAO,uBAAuB,OAAOD,CAAU,CAAC,EAAE,CAC9D,CACD","names":["Slot","Children","cloneElement","isValidElement","invariant","Fragment","jsx","jsxs","Badge","appearance","asChild","children","className","color","icon","props","bgColor","computeBgColor","textColor","computeTextColor","badgeClasses","cx","singleChild","Children","invariant","isValidElement","grandchildren","jsx","Slot","cloneElement","jsxs","Fragment","SvgOnly","mutedBgColorLookup","computeBgColor","color","appearance","invariant","textColorMutedLookup","computeTextColor"]}
package/dist/button.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { D as DeepNonNullable } from './deep-non-nullable-SmpSvoSd.js';
2
2
  import * as class_variance_authority from 'class-variance-authority';
3
3
  import * as react from 'react';
4
- import { ComponentProps, ReactNode, ButtonHTMLAttributes } from 'react';
4
+ import { ButtonHTMLAttributes, ReactNode, ComponentProps } from 'react';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import { V as VariantProps } from './variant-props-oDo2u-We.js';
7
7
  export { I as IconButton, a as IconButtonProps } from './icon-button-CZzW1XWB.js';
package/dist/button.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-QZMKDGUW.js";import{a as b}from"./chunk-WZQZW4OU.js";import{b as a}from"./chunk-JIFA7MWV.js";import"./chunk-4LSFAAZW.js";import"./chunk-OP6JMBKJ.js";import"./chunk-72TJUKMV.js";import"./chunk-LBEYGDAN.js";import"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{a as Button,c as ButtonGroup,b as IconButton};
1
+ import{a as c}from"./chunk-PFLB7OM5.js";import{a as b}from"./chunk-YHG55D43.js";import{b as a}from"./chunk-YZDIHCOF.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-3BZ333PP.js";import"./chunk-IQCYQ6RC.js";import"./chunk-AZ56JGNY.js";export{a as Button,c as ButtonGroup,b as IconButton};
2
2
  //# sourceMappingURL=button.js.map
package/dist/calendar.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-JIFA7MWV.js";import"./chunk-4LSFAAZW.js";import"./chunk-OP6JMBKJ.js";import"./chunk-72TJUKMV.js";import"./chunk-LBEYGDAN.js";import"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"size-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
1
+ import{a as d}from"./chunk-YZDIHCOF.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-3BZ333PP.js";import"./chunk-IQCYQ6RC.js";import{a as e}from"./chunk-AZ56JGNY.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"size-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
2
2
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport type { ComponentProps } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { buttonVariants } from \"../button/button.js\";\n\ntype CalendarProps = ComponentProps<typeof DayPicker>;\n\n/**\n * A calendar component that allows users to select a date or a range of dates.\n *\n * @preview This component is in `preview` mode which means the API is not stable and may change.\n * There may also be bugs! Please file an issue if you find any! <3\n *\n * https://github.com/ngrok-oss/mantle/issues\n */\nfunction Calendar({ className, classNames, showOutsideDays = false, ...props }: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tshowOutsideDays={showOutsideDays}\n\t\t\tclassName={cx(\"\", className)}\n\t\t\tclassNames={{\n\t\t\t\tmonths: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tcaption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tcaption_label: \"text-sm font-medium\",\n\t\t\t\tnav: \"flex items-center\",\n\t\t\t\tnav_button: cx(buttonVariants({ appearance: \"ghost\", priority: \"neutral\" }), \"size-7\"),\n\t\t\t\tnav_button_previous: \"absolute left-0\",\n\t\t\t\tnav_button_next: \"absolute right-0\",\n\t\t\t\ttable: \"w-full border-collapse space-y-1\",\n\t\t\t\thead_row: \"flex\",\n\t\t\t\thead_cell: \"text-body w-7 text-[0.8rem] text-center font-normal\",\n\t\t\t\trow: \"flex w-full mt-1\",\n\t\t\t\tcell: cx(\n\t\t\t\t\t\"overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7\",\n\t\t\t\t\tprops.mode === \"range\"\n\t\t\t\t\t\t? \"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n\t\t\t\t\t\t: \"\",\n\t\t\t\t),\n\t\t\t\tday: \"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15\",\n\t\t\t\tday_range_start: \"day-range-start [&:not(.day-range-end)]:rounded-r-none\",\n\t\t\t\tday_range_end: \"day-range-end [&:not(.day-range-start)]:rounded-l-none\",\n\t\t\t\tday_selected: \"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent\",\n\t\t\t\tday_today:\n\t\t\t\t\t\"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10\",\n\t\t\t\tday_outside: \"day-outside aria-selected:text-on-filled opacity-50 text-muted\",\n\t\t\t\tday_disabled: \"text-muted opacity-50\",\n\t\t\t\tday_range_middle:\n\t\t\t\t\t\"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25\",\n\t\t\t\tday_hidden: \"invisible\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tcomponents={{\n\t\t\t\tIconLeft: () => <CaretLeft className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t\tIconRight: () => <CaretRight className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nCalendar.displayName = \"Calendar\";\n\nexport {\n\t//,\n\tCalendar,\n};\n\nexport type {\n\t//,\n\tCalendarProps,\n};\n"],"mappings":"4NAAA,OAAS,aAAAA,MAAiB,6CAC1B,OAAS,cAAAC,MAAkB,8CAE3B,OAAS,aAAAC,MAAiB,mBAoDN,cAAAC,MAAA,oBAtCpB,SAASC,EAAS,CAAE,UAAAC,EAAW,WAAAC,EAAY,gBAAAC,EAAkB,GAAO,GAAGC,CAAM,EAAkB,CAC9F,OACCL,EAACM,EAAA,CACA,gBAAiBF,EACjB,UAAWG,EAAG,GAAIL,CAAS,EAC3B,WAAY,CACX,OAAQ,gEACR,MAAO,YACP,QAAS,iDACT,cAAe,sBACf,IAAK,oBACL,WAAYK,EAAGC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAAG,QAAQ,EACrF,oBAAqB,kBACrB,gBAAiB,mBACjB,MAAO,mCACP,SAAU,OACV,UAAW,sDACX,IAAK,mBACL,KAAMD,EACL,kGACAF,EAAM,OAAS,QACZ,yFACA,EACJ,EACA,IAAK,0FACL,gBAAiB,yDACjB,cAAe,yDACf,aAAc,iGACd,UACC,4HACD,YAAa,iEACb,aAAc,wBACd,iBACC,4KACD,WAAY,YACZ,GAAGF,CACJ,EACA,WAAY,CACX,SAAU,IAAMH,EAACS,EAAA,CAAU,UAAU,mBAAmB,OAAO,OAAO,EACtE,UAAW,IAAMT,EAACU,EAAA,CAAW,UAAU,mBAAmB,OAAO,OAAO,CACzE,EACC,GAAGL,EACL,CAEF,CACAJ,EAAS,YAAc","names":["CaretLeft","CaretRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cx","buttonVariants","CaretLeft","CaretRight"]}
1
+ {"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport type { ComponentProps } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { buttonVariants } from \"../button/button.js\";\n\ntype CalendarProps = ComponentProps<typeof DayPicker>;\n\n/**\n * A calendar component that allows users to select a date or a range of dates.\n *\n * @preview This component is in `preview` mode which means the API is not stable and may change.\n * There may also be bugs! Please file an issue if you find any! <3\n *\n * https://github.com/ngrok-oss/mantle/issues\n */\nfunction Calendar({\n\tclassName,\n\tclassNames,\n\tshowOutsideDays = false,\n\t...props\n}: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tshowOutsideDays={showOutsideDays}\n\t\t\tclassName={cx(\"\", className)}\n\t\t\tclassNames={{\n\t\t\t\tmonths: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tcaption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tcaption_label: \"text-sm font-medium\",\n\t\t\t\tnav: \"flex items-center\",\n\t\t\t\tnav_button: cx(\n\t\t\t\t\tbuttonVariants({ appearance: \"ghost\", priority: \"neutral\" }),\n\t\t\t\t\t\"size-7\",\n\t\t\t\t),\n\t\t\t\tnav_button_previous: \"absolute left-0\",\n\t\t\t\tnav_button_next: \"absolute right-0\",\n\t\t\t\ttable: \"w-full border-collapse space-y-1\",\n\t\t\t\thead_row: \"flex\",\n\t\t\t\thead_cell: \"text-body w-7 text-[0.8rem] text-center font-normal\",\n\t\t\t\trow: \"flex w-full mt-1\",\n\t\t\t\tcell: cx(\n\t\t\t\t\t\"overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7\",\n\t\t\t\t\tprops.mode === \"range\"\n\t\t\t\t\t\t? \"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n\t\t\t\t\t\t: \"\",\n\t\t\t\t),\n\t\t\t\tday: \"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15\",\n\t\t\t\tday_range_start:\n\t\t\t\t\t\"day-range-start [&:not(.day-range-end)]:rounded-r-none\",\n\t\t\t\tday_range_end: \"day-range-end [&:not(.day-range-start)]:rounded-l-none\",\n\t\t\t\tday_selected:\n\t\t\t\t\t\"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent\",\n\t\t\t\tday_today:\n\t\t\t\t\t\"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10\",\n\t\t\t\tday_outside:\n\t\t\t\t\t\"day-outside aria-selected:text-on-filled opacity-50 text-muted\",\n\t\t\t\tday_disabled: \"text-muted opacity-50\",\n\t\t\t\tday_range_middle:\n\t\t\t\t\t\"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25\",\n\t\t\t\tday_hidden: \"invisible\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tcomponents={{\n\t\t\t\tIconLeft: () => (\n\t\t\t\t\t<CaretLeft className=\"h-4 w-4 shrink-0\" weight=\"bold\" />\n\t\t\t\t),\n\t\t\t\tIconRight: () => (\n\t\t\t\t\t<CaretRight className=\"h-4 w-4 shrink-0\" weight=\"bold\" />\n\t\t\t\t),\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nCalendar.displayName = \"Calendar\";\n\nexport {\n\t//,\n\tCalendar,\n};\n\nexport type {\n\t//,\n\tCalendarProps,\n};\n"],"mappings":"4NAAA,OAAS,aAAAA,MAAiB,6CAC1B,OAAS,cAAAC,MAAkB,8CAE3B,OAAS,aAAAC,MAAiB,mBAgErB,cAAAC,MAAA,oBAlDL,SAASC,EAAS,CACjB,UAAAC,EACA,WAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CACJ,EAAkB,CACjB,OACCL,EAACM,EAAA,CACA,gBAAiBF,EACjB,UAAWG,EAAG,GAAIL,CAAS,EAC3B,WAAY,CACX,OAAQ,gEACR,MAAO,YACP,QAAS,iDACT,cAAe,sBACf,IAAK,oBACL,WAAYK,EACXC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAC3D,QACD,EACA,oBAAqB,kBACrB,gBAAiB,mBACjB,MAAO,mCACP,SAAU,OACV,UAAW,sDACX,IAAK,mBACL,KAAMD,EACL,kGACAF,EAAM,OAAS,QACZ,yFACA,EACJ,EACA,IAAK,0FACL,gBACC,yDACD,cAAe,yDACf,aACC,iGACD,UACC,4HACD,YACC,iEACD,aAAc,wBACd,iBACC,4KACD,WAAY,YACZ,GAAGF,CACJ,EACA,WAAY,CACX,SAAU,IACTH,EAACS,EAAA,CAAU,UAAU,mBAAmB,OAAO,OAAO,EAEvD,UAAW,IACVT,EAACU,EAAA,CAAW,UAAU,mBAAmB,OAAO,OAAO,CAEzD,EACC,GAAGL,EACL,CAEF,CACAJ,EAAS,YAAc","names":["CaretLeft","CaretRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cx","buttonVariants","CaretLeft","CaretRight"]}
package/dist/card.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-EW5CFGXT.js";import{Slot as n}from"@radix-ui/react-slot";import{forwardRef as o}from"react";import{jsx as i}from"react/jsx-runtime";var s=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("divide-card-muted border-card bg-card relative divide-y rounded-md border",r),...d,children:e}));s.displayName="Card";var p=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("p-6",r),...d,children:e}));p.displayName="CardBody";var m=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("px-6 py-3",r),...d,children:e}));m.displayName="CardFooter";var C=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("px-6 py-3",r),...d,children:e}));C.displayName="CardHeader";var l=o(({className:r,asChild:e,...d},a)=>i(e?n:"h3",{ref:a,className:t("text-strong text-base font-medium",r),...d}));l.displayName="CardTitle";export{s as Card,p as CardBody,m as CardFooter,C as CardHeader,l as CardTitle};
1
+ import{a as t}from"./chunk-AZ56JGNY.js";import{Slot as n}from"@radix-ui/react-slot";import{forwardRef as o}from"react";import{jsx as i}from"react/jsx-runtime";var s=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("divide-card-muted border-card bg-card relative divide-y rounded-md border",r),...d,children:e}));s.displayName="Card";var p=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("p-6",r),...d,children:e}));p.displayName="CardBody";var m=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("px-6 py-3",r),...d,children:e}));m.displayName="CardFooter";var C=o(({className:r,children:e,...d},a)=>i("div",{ref:a,className:t("px-6 py-3",r),...d,children:e}));C.displayName="CardHeader";var l=o(({className:r,asChild:e,...d},a)=>i(e?n:"h3",{ref:a,className:t("text-strong text-base font-medium",r),...d}));l.displayName="CardTitle";export{s as Card,p as CardBody,m as CardFooter,C as CardHeader,l as CardTitle};
2
2
  //# sourceMappingURL=card.js.map
package/dist/card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/card/card.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A container that can be used to display content in a box resembling a playing\n * card.\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div\n\t\tref={ref}\n\t\tclassName={cx(\"divide-card-muted border-card bg-card relative divide-y rounded-md border\", className)}\n\t\t{...rest}\n\t>\n\t\t{children}\n\t</div>\n));\nCard.displayName = \"Card\";\n\n/**\n * The main content of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardBody = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"p-6\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardBody.displayName = \"CardBody\";\n\n/**\n * The footer container of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardFooter = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardFooter.displayName = \"CardFooter\";\n\n/**\n * The header container of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardHeader = forwardRef<HTMLDivElement, CardProps>(({ className, children, ...rest }, ref) => (\n\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t{children}\n\t</div>\n));\nCardHeader.displayName = \"CardHeader\";\n\nexport type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of a card. Usually composed as a direct child of a `CardHeader` component.\n */\nconst CardTitle = forwardRef<HTMLParagraphElement, CardTitleProps>(({ className, asChild, ...props }, ref) => {\n\tconst Comp = asChild ? Slot : \"h3\";\n\treturn <Comp ref={ref} className={cx(\"text-strong text-base font-medium\", className)} {...props} />;\n});\nCardTitle.displayName = \"CardTitle\";\n\nexport {\n\t//,\n\tCard,\n\tCardBody,\n\tCardFooter,\n\tCardHeader,\n\tCardTitle,\n};\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAW1B,cAAAC,MAAA,oBADD,IAAMC,EAAOC,EAAsC,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IACrFN,EAAC,OACA,IAAKM,EACL,UAAWC,EAAG,4EAA6EJ,CAAS,EACnG,GAAGE,EAEH,SAAAD,EACF,CACA,EACDH,EAAK,YAAc,OAKnB,IAAMO,EAAWN,EAAsC,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IACzFN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,MAAOJ,CAAS,EAAI,GAAGE,EAClD,SAAAD,EACF,CACA,EACDI,EAAS,YAAc,WAKvB,IAAMC,EAAaP,EAAsC,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAC3FN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CACA,EACDK,EAAW,YAAc,aAKzB,IAAMC,EAAaR,EAAsC,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAC3FN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CACA,EACDM,EAAW,YAAc,aAOzB,IAAMC,EAAYT,EAAiD,CAAC,CAAE,UAAAC,EAAW,QAAAS,EAAS,GAAGC,CAAM,EAAGP,IAE9FN,EADMY,EAAUE,EAAO,KACtB,CAAK,IAAKR,EAAK,UAAWC,EAAG,oCAAqCJ,CAAS,EAAI,GAAGU,EAAO,CACjG,EACDF,EAAU,YAAc","names":["Slot","forwardRef","jsx","Card","forwardRef","className","children","rest","ref","cx","CardBody","CardFooter","CardHeader","CardTitle","asChild","props","Slot"]}
1
+ {"version":3,"sources":["../src/components/card/card.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A container that can be used to display content in a box resembling a playing\n * card.\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n\t({ className, children, ...rest }, ref) => (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"divide-card-muted border-card bg-card relative divide-y rounded-md border\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nCard.displayName = \"Card\";\n\n/**\n * The main content of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardBody = forwardRef<HTMLDivElement, CardProps>(\n\t({ className, children, ...rest }, ref) => (\n\t\t<div ref={ref} className={cx(\"p-6\", className)} {...rest}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nCardBody.displayName = \"CardBody\";\n\n/**\n * The footer container of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardFooter = forwardRef<HTMLDivElement, CardProps>(\n\t({ className, children, ...rest }, ref) => (\n\t\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nCardFooter.displayName = \"CardFooter\";\n\n/**\n * The header container of a card. Usually composed as a direct child of a `Card` component.\n */\nconst CardHeader = forwardRef<HTMLDivElement, CardProps>(\n\t({ className, children, ...rest }, ref) => (\n\t\t<div ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nCardHeader.displayName = \"CardHeader\";\n\nexport type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of a card. Usually composed as a direct child of a `CardHeader` component.\n */\nconst CardTitle = forwardRef<HTMLParagraphElement, CardTitleProps>(\n\t({ className, asChild, ...props }, ref) => {\n\t\tconst Comp = asChild ? Slot : \"h3\";\n\t\treturn (\n\t\t\t<Comp\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"text-strong text-base font-medium\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nCardTitle.displayName = \"CardTitle\";\n\nexport {\n\t//,\n\tCard,\n\tCardBody,\n\tCardFooter,\n\tCardHeader,\n\tCardTitle,\n};\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAYzB,cAAAC,MAAA,oBAFF,IAAMC,EAAOC,EACZ,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClCN,EAAC,OACA,IAAKM,EACL,UAAWC,EACV,4EACAJ,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAEF,EACAH,EAAK,YAAc,OAKnB,IAAMO,EAAWN,EAChB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClCN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,MAAOJ,CAAS,EAAI,GAAGE,EAClD,SAAAD,EACF,CAEF,EACAI,EAAS,YAAc,WAKvB,IAAMC,EAAaP,EAClB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClCN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CAEF,EACAK,EAAW,YAAc,aAKzB,IAAMC,EAAaR,EAClB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAClCN,EAAC,OAAI,IAAKM,EAAK,UAAWC,EAAG,YAAaJ,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CAEF,EACAM,EAAW,YAAc,aAOzB,IAAMC,EAAYT,EACjB,CAAC,CAAE,UAAAC,EAAW,QAAAS,EAAS,GAAGC,CAAM,EAAGP,IAGjCN,EAFYY,EAAUE,EAAO,KAE5B,CACA,IAAKR,EACL,UAAWC,EAAG,oCAAqCJ,CAAS,EAC3D,GAAGU,EACL,CAGH,EACAF,EAAU,YAAc","names":["Slot","forwardRef","jsx","Card","forwardRef","className","children","rest","ref","cx","CardBody","CardFooter","CardHeader","CardTitle","asChild","props","Slot"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/checkbox/checkbox.tsx","../src/components/checkbox/zod.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/index.js\";\nimport type { WithValidation } from \"../input/index.js\";\n\ntype CheckedState = boolean | \"indeterminate\";\n\nconst isIndeterminate = (checked: CheckedState | undefined): checked is \"indeterminate\" => checked === \"indeterminate\";\n\ntype Props = Omit<ComponentPropsWithoutRef<\"input\">, \"type\" | \"checked\" | \"defaultChecked\"> &\n\tWithValidation & {\n\t\t/**\n\t\t * The controlled checked state of the checkbox. Must be used in conjunction with onChange.\n\t\t */\n\t\tchecked?: CheckedState;\n\t\t/**\n\t\t * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.\n\t\t */\n\t\tdefaultChecked?: CheckedState;\n\t};\n\n/**\n * A form control that allows the user to toggle between checked and not checked.\n */\nconst Checkbox = forwardRef<ElementRef<\"input\">, Props>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tclassName,\n\t\t\tchecked: _checked,\n\t\t\tdefaultChecked: _defaultChecked,\n\t\t\tdefaultValue = \"on\",\n\t\t\tonClick,\n\t\t\treadOnly,\n\t\t\tvalidation: _validation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst innerRef = useRef<ElementRef<\"input\">>(null);\n\t\tconst [defaultChecked] = useState(_defaultChecked);\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst validation = isInvalid ? \"error\" : typeof _validation === \"function\" ? _validation() : _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\n\t\tuseEffect(() => {\n\t\t\tif (innerRef.current) {\n\t\t\t\tinnerRef.current.indeterminate = isIndeterminate(_checked);\n\t\t\t}\n\t\t}, [_checked]);\n\n\t\tuseEffect(() => {\n\t\t\tif (innerRef.current) {\n\t\t\t\tinnerRef.current.indeterminate = isIndeterminate(defaultChecked);\n\t\t\t}\n\t\t}, [defaultChecked]);\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\taria-checked={isIndeterminate(_checked) ? \"mixed\" : _checked}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={clsx(\n\t\t\t\t\t\"border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50\",\n\t\t\t\t\t\"bg-center bg-no-repeat focus:outline-none\",\n\t\t\t\t\t\"focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-none focus-visible:ring-4\",\n\t\t\t\t\t\"checked:border-accent-500 checked:bg-accent-500 checked:bg-checked-icon\",\n\t\t\t\t\t\"indeterminate:border-accent-500 indeterminate:bg-accent-500 indeterminate:bg-indeterminate-icon\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:checked:bg-success-500 data-validation-success:indeterminate:bg-success-500 focus-visible:data-validation-success:border-success-600 focus-visible:data-validation-success:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:checked:bg-warning-500 data-validation-warning:indeterminate:bg-warning-500 focus-visible:data-validation-warning:border-warning-600 focus-visible:data-validation-warning:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:checked:bg-danger-500 data-validation-error:indeterminate:bg-danger-500 focus-visible:data-validation-error:border-danger-600 focus-visible:data-validation-error:ring-focus-danger\",\n\t\t\t\t\t\"where:block where:size-4 where:p-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tchecked={isIndeterminate(_checked) ? undefined : _checked}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tdefaultChecked={isIndeterminate(defaultChecked) ? undefined : defaultChecked}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (readOnly) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tref={composeRefs(innerRef, ref)}\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nCheckbox.displayName = \"Checkbox\";\n\nexport {\n\t//,\n\tCheckbox,\n};\n","import { z } from \"zod\";\n\ntype Options = {\n\t/**\n\t * The value to use when the checkbox is checked.\n\t * @default \"on\"\n\t */\n\ttrueValue?: string;\n};\n\n/**\n * Turns the value from a checkbox field into a boolean,\n * but does not require the checkbox to be checked.\n * For checkboxes with a `value` attribute, you can pass that as the `trueValue` option.\n *\n * @example\n * ```ts\n * z.object({\n * defaultCheckbox: zodCheckbox(),\n * checkboxWithValue: zodCheckbox({ trueValue: \"true\" }),\n * mustBeChecked: zodCheckbox().refine((v) => v, \"Please check this box\"),\n * });\n * ```\n */\nfunction zodCheckbox(options?: Options) {\n\tconst { trueValue = \"on\" } = options ?? {};\n\n\treturn z.union([\n\t\tz.literal(trueValue).transform(() => true),\n\t\tz.literal(false).transform(() => false),\n\t\tz.literal(undefined).transform(() => false),\n\t]);\n}\n\nexport {\n\t//\n\tzodCheckbox,\n};\n"],"mappings":"oEAAA,OAAOA,MAAU,OACjB,OAAS,cAAAC,EAAY,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QA0DrD,cAAAC,MAAA,oBAnDH,IAAMC,EAAmBC,GAAkEA,IAAY,gBAiBjGC,EAAWC,EAChB,CACC,CACC,eAAgBC,EAChB,UAAAC,EACA,QAASC,EACT,eAAgBC,EAChB,aAAAC,EAAe,KACf,QAAAC,EACA,SAAAC,EACA,WAAYC,EACZ,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAWC,EAA4B,IAAI,EAC3C,CAACC,CAAc,EAAIC,EAASV,CAAe,EAE3CW,EADYd,GAAgB,MAAQA,IAAiB,QAC5B,QAAU,OAAOO,GAAgB,WAAaA,EAAY,EAAIA,EACvFQ,EAAcf,GAAgBc,IAAe,QAEnD,OAAAE,EAAU,IAAM,CACXN,EAAS,UACZA,EAAS,QAAQ,cAAgBd,EAAgBM,CAAQ,EAE3D,EAAG,CAACA,CAAQ,CAAC,EAEbc,EAAU,IAAM,CACXN,EAAS,UACZA,EAAS,QAAQ,cAAgBd,EAAgBgB,CAAc,EAEjE,EAAG,CAACA,CAAc,CAAC,EAGlBjB,EAAC,SACA,eAAcC,EAAgBM,CAAQ,EAAI,QAAUA,EACpD,eAAca,EACd,UAAWE,EACV,qIACA,4CACA,kHACA,0EACA,kGACA,mQACA,mQACA,oPACA,qCACAhB,CACD,EACA,QAASL,EAAgBM,CAAQ,EAAI,OAAYA,EACjD,kBAAiBY,GAAc,OAC/B,eAAgBlB,EAAgBgB,CAAc,EAAI,OAAYA,EAC9D,aAAcR,EACd,QAAUc,GAAU,CACnB,GAAIZ,EAAU,CACbY,EAAM,eAAe,EACrB,MACD,CACAb,IAAUa,CAAK,CAChB,EACA,SAAUZ,EACV,IAAKa,EAAYT,EAAUD,CAAG,EAC9B,KAAK,WACJ,GAAGD,EACL,CAEF,CACD,EACAV,EAAS,YAAc,WC7FvB,OAAS,KAAAsB,MAAS,MAwBlB,SAASC,EAAYC,EAAmB,CACvC,GAAM,CAAE,UAAAC,EAAY,IAAK,EAAID,GAAW,CAAC,EAEzC,OAAOF,EAAE,MAAM,CACdA,EAAE,QAAQG,CAAS,EAAE,UAAU,IAAM,EAAI,EACzCH,EAAE,QAAQ,EAAK,EAAE,UAAU,IAAM,EAAK,EACtCA,EAAE,QAAQ,MAAS,EAAE,UAAU,IAAM,EAAK,CAC3C,CAAC,CACF","names":["clsx","forwardRef","useEffect","useRef","useState","jsx","isIndeterminate","checked","Checkbox","forwardRef","_ariaInvalid","className","_checked","_defaultChecked","defaultValue","onClick","readOnly","_validation","props","ref","innerRef","useRef","defaultChecked","useState","validation","ariaInvalid","useEffect","clsx","event","composeRefs","z","zodCheckbox","options","trueValue"]}
1
+ {"version":3,"sources":["../src/components/checkbox/checkbox.tsx","../src/components/checkbox/zod.ts"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/index.js\";\nimport type { WithValidation } from \"../input/index.js\";\n\ntype CheckedState = boolean | \"indeterminate\";\n\nconst isIndeterminate = (\n\tchecked: CheckedState | undefined,\n): checked is \"indeterminate\" => checked === \"indeterminate\";\n\ntype Props = Omit<\n\tComponentPropsWithoutRef<\"input\">,\n\t\"type\" | \"checked\" | \"defaultChecked\"\n> &\n\tWithValidation & {\n\t\t/**\n\t\t * The controlled checked state of the checkbox. Must be used in conjunction with onChange.\n\t\t */\n\t\tchecked?: CheckedState;\n\t\t/**\n\t\t * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.\n\t\t */\n\t\tdefaultChecked?: CheckedState;\n\t};\n\n/**\n * A form control that allows the user to toggle between checked and not checked.\n */\nconst Checkbox = forwardRef<ElementRef<\"input\">, Props>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tclassName,\n\t\t\tchecked: _checked,\n\t\t\tdefaultChecked: _defaultChecked,\n\t\t\tdefaultValue = \"on\",\n\t\t\tonClick,\n\t\t\treadOnly,\n\t\t\tvalidation: _validation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst innerRef = useRef<ElementRef<\"input\">>(null);\n\t\tconst [defaultChecked] = useState(_defaultChecked);\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\n\t\tuseEffect(() => {\n\t\t\tif (innerRef.current) {\n\t\t\t\tinnerRef.current.indeterminate = isIndeterminate(_checked);\n\t\t\t}\n\t\t}, [_checked]);\n\n\t\tuseEffect(() => {\n\t\t\tif (innerRef.current) {\n\t\t\t\tinnerRef.current.indeterminate = isIndeterminate(defaultChecked);\n\t\t\t}\n\t\t}, [defaultChecked]);\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\taria-checked={isIndeterminate(_checked) ? \"mixed\" : _checked}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={clsx(\n\t\t\t\t\t\"border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50\",\n\t\t\t\t\t\"bg-center bg-no-repeat focus:outline-none\",\n\t\t\t\t\t\"focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-none focus-visible:ring-4\",\n\t\t\t\t\t\"checked:border-accent-500 checked:bg-accent-500 checked:bg-checked-icon\",\n\t\t\t\t\t\"indeterminate:border-accent-500 indeterminate:bg-accent-500 indeterminate:bg-indeterminate-icon\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:checked:bg-success-500 data-validation-success:indeterminate:bg-success-500 focus-visible:data-validation-success:border-success-600 focus-visible:data-validation-success:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:checked:bg-warning-500 data-validation-warning:indeterminate:bg-warning-500 focus-visible:data-validation-warning:border-warning-600 focus-visible:data-validation-warning:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:checked:bg-danger-500 data-validation-error:indeterminate:bg-danger-500 focus-visible:data-validation-error:border-danger-600 focus-visible:data-validation-error:ring-focus-danger\",\n\t\t\t\t\t\"where:block where:size-4 where:p-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tchecked={isIndeterminate(_checked) ? undefined : _checked}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tdefaultChecked={\n\t\t\t\t\tisIndeterminate(defaultChecked) ? undefined : defaultChecked\n\t\t\t\t}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (readOnly) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tref={composeRefs(innerRef, ref)}\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nCheckbox.displayName = \"Checkbox\";\n\nexport {\n\t//,\n\tCheckbox,\n};\n","import { z } from \"zod\";\n\ntype Options = {\n\t/**\n\t * The value to use when the checkbox is checked.\n\t * @default \"on\"\n\t */\n\ttrueValue?: string;\n};\n\n/**\n * Turns the value from a checkbox field into a boolean,\n * but does not require the checkbox to be checked.\n * For checkboxes with a `value` attribute, you can pass that as the `trueValue` option.\n *\n * @example\n * ```ts\n * z.object({\n * defaultCheckbox: zodCheckbox(),\n * checkboxWithValue: zodCheckbox({ trueValue: \"true\" }),\n * mustBeChecked: zodCheckbox().refine((v) => v, \"Please check this box\"),\n * });\n * ```\n */\nfunction zodCheckbox(options?: Options) {\n\tconst { trueValue = \"on\" } = options ?? {};\n\n\treturn z.union([\n\t\tz.literal(trueValue).transform(() => true),\n\t\tz.literal(false).transform(() => false),\n\t\tz.literal(undefined).transform(() => false),\n\t]);\n}\n\nexport {\n\t//\n\tzodCheckbox,\n};\n"],"mappings":"oEAAA,OAAOA,MAAU,OACjB,OAAS,cAAAC,EAAY,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAmErD,cAAAC,MAAA,oBA5DH,IAAMC,EACLC,GACgCA,IAAY,gBAoBvCC,EAAWC,EAChB,CACC,CACC,eAAgBC,EAChB,UAAAC,EACA,QAASC,EACT,eAAgBC,EAChB,aAAAC,EAAe,KACf,QAAAC,EACA,SAAAC,EACA,WAAYC,EACZ,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAWC,EAA4B,IAAI,EAC3C,CAACC,CAAc,EAAIC,EAASV,CAAe,EAE3CW,EADYd,GAAgB,MAAQA,IAAiB,QAExD,QACA,OAAOO,GAAgB,WACtBA,EAAY,EACZA,EACEQ,EAAcf,GAAgBc,IAAe,QAEnD,OAAAE,EAAU,IAAM,CACXN,EAAS,UACZA,EAAS,QAAQ,cAAgBd,EAAgBM,CAAQ,EAE3D,EAAG,CAACA,CAAQ,CAAC,EAEbc,EAAU,IAAM,CACXN,EAAS,UACZA,EAAS,QAAQ,cAAgBd,EAAgBgB,CAAc,EAEjE,EAAG,CAACA,CAAc,CAAC,EAGlBjB,EAAC,SACA,eAAcC,EAAgBM,CAAQ,EAAI,QAAUA,EACpD,eAAca,EACd,UAAWE,EACV,qIACA,4CACA,kHACA,0EACA,kGACA,mQACA,mQACA,oPACA,qCACAhB,CACD,EACA,QAASL,EAAgBM,CAAQ,EAAI,OAAYA,EACjD,kBAAiBY,GAAc,OAC/B,eACClB,EAAgBgB,CAAc,EAAI,OAAYA,EAE/C,aAAcR,EACd,QAAUc,GAAU,CACnB,GAAIZ,EAAU,CACbY,EAAM,eAAe,EACrB,MACD,CACAb,IAAUa,CAAK,CAChB,EACA,SAAUZ,EACV,IAAKa,EAAYT,EAAUD,CAAG,EAC9B,KAAK,WACJ,GAAGD,EACL,CAEF,CACD,EACAV,EAAS,YAAc,WCxGvB,OAAS,KAAAsB,MAAS,MAwBlB,SAASC,EAAYC,EAAmB,CACvC,GAAM,CAAE,UAAAC,EAAY,IAAK,EAAID,GAAW,CAAC,EAEzC,OAAOF,EAAE,MAAM,CACdA,EAAE,QAAQG,CAAS,EAAE,UAAU,IAAM,EAAI,EACzCH,EAAE,QAAQ,EAAK,EAAE,UAAU,IAAM,EAAK,EACtCA,EAAE,QAAQ,MAAS,EAAE,UAAU,IAAM,EAAK,CAC3C,CAAC,CACF","names":["clsx","forwardRef","useEffect","useRef","useState","jsx","isIndeterminate","checked","Checkbox","forwardRef","_ariaInvalid","className","_checked","_defaultChecked","defaultValue","onClick","readOnly","_validation","props","ref","innerRef","useRef","defaultChecked","useState","validation","ariaInvalid","useEffect","clsx","event","composeRefs","z","zodCheckbox","options","trueValue"]}