@ngrok/mantle 0.79.3 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/accordion.d.ts +158 -19
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +5 -1
  4. package/dist/alert-dialog.d.ts +465 -32
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +116 -14
  7. package/dist/alert.js +1 -1
  8. package/dist/anchor-DfeXTpKW.js +1 -0
  9. package/dist/anchor.d.ts +2 -2
  10. package/dist/anchor.js +1 -1
  11. package/dist/area-chart.d.ts +504 -0
  12. package/dist/area-chart.js +1 -0
  13. package/dist/as-child-D23mGo4f.d.ts +49 -0
  14. package/dist/badge.d.ts +44 -5
  15. package/dist/badge.js +1 -1
  16. package/dist/bar-chart.d.ts +491 -0
  17. package/dist/bar-chart.js +1 -0
  18. package/dist/breadcrumb.d.ts +196 -14
  19. package/dist/breadcrumb.js +1 -1
  20. package/dist/button-BAno7KIU.js +1 -0
  21. package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
  22. package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
  23. package/dist/button-D9n09xUg.js +1 -0
  24. package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
  25. package/dist/button-DjpEKt2X.js +1 -0
  26. package/dist/button-DvHMWAPl.js +1 -0
  27. package/dist/button.d.ts +5 -5
  28. package/dist/button.js +1 -1
  29. package/dist/calendar.d.ts +0 -3
  30. package/dist/calendar.js +1 -1
  31. package/dist/card.d.ts +131 -9
  32. package/dist/card.js +1 -1
  33. package/dist/centered-layout.d.ts +209 -8
  34. package/dist/centered-layout.js +1 -1
  35. package/dist/chart-BROa2gqt.js +2 -0
  36. package/dist/chart-BcOC6Qj0.d.ts +275 -0
  37. package/dist/checkbox-0EoxOyMA.js +1 -0
  38. package/dist/checkbox.d.ts +13 -11
  39. package/dist/checkbox.js +1 -1
  40. package/dist/choice-BHwFSSyv.js +1 -0
  41. package/dist/choice-BNRQXszu.d.ts +254 -0
  42. package/dist/choice.d.ts +1 -252
  43. package/dist/choice.js +1 -1
  44. package/dist/code-block.d.ts +242 -52
  45. package/dist/code-block.js +6 -6
  46. package/dist/code-block_highlight-utils.d.ts +1 -1
  47. package/dist/code-block_highlight-utils.js +1 -1
  48. package/dist/code.d.ts +3 -2
  49. package/dist/code.js +1 -1
  50. package/dist/combobox.d.ts +171 -16
  51. package/dist/combobox.js +1 -1
  52. package/dist/command.d.ts +279 -81
  53. package/dist/command.js +1 -1
  54. package/dist/compose-refs-BdBMM9ga.js +1 -0
  55. package/dist/data-table.d.ts +28 -6
  56. package/dist/data-table.js +1 -1
  57. package/dist/description-list.d.ts +67 -6
  58. package/dist/description-list.js +1 -1
  59. package/dist/dialog-BM4wPCft.d.ts +24 -0
  60. package/dist/dialog-DWZWd5Jt.js +1 -0
  61. package/dist/dialog.d.ts +226 -35
  62. package/dist/dialog.js +1 -1
  63. package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
  64. package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
  65. package/dist/dropdown-menu-RyDWoKHx.js +1 -0
  66. package/dist/dropdown-menu.d.ts +2 -2
  67. package/dist/dropdown-menu.js +1 -1
  68. package/dist/empty.d.ts +7 -22
  69. package/dist/empty.js +1 -1
  70. package/dist/field-B1wqeZr4.js +1 -0
  71. package/dist/field.d.ts +568 -47
  72. package/dist/field.js +1 -1
  73. package/dist/flag.d.ts +0 -3
  74. package/dist/flag.js +1 -1
  75. package/dist/hooks.d.ts +3 -4
  76. package/dist/hooks.js +1 -1
  77. package/dist/hover-card.d.ts +48 -7
  78. package/dist/hover-card.js +1 -1
  79. package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
  80. package/dist/icon-d-nMCfAI.js +1 -0
  81. package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
  82. package/dist/icon-lZ48P8Nn.js +1 -0
  83. package/dist/icon.d.ts +3 -3
  84. package/dist/icon.js +1 -1
  85. package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
  86. package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
  87. package/dist/icons-DLCs1hLP.js +1 -0
  88. package/dist/icons.d.ts +7 -15
  89. package/dist/icons.js +1 -1
  90. package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
  91. package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
  92. package/dist/input-BnlpQF0c.js +1 -0
  93. package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
  94. package/dist/input.d.ts +5 -56
  95. package/dist/input.js +1 -1
  96. package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
  97. package/dist/label-D-D11mlp.js +1 -0
  98. package/dist/label.d.ts +1 -1
  99. package/dist/label.js +1 -1
  100. package/dist/line-chart.d.ts +490 -0
  101. package/dist/line-chart.js +1 -0
  102. package/dist/list-51KQvENW.js +1 -0
  103. package/dist/list.d.ts +135 -6
  104. package/dist/list.js +1 -1
  105. package/dist/llms.txt +5 -1
  106. package/dist/main.d.ts +20 -4
  107. package/dist/main.js +1 -1
  108. package/dist/mantle-dark-high-contrast.css +17 -0
  109. package/dist/mantle-dark.css +13 -0
  110. package/dist/mantle-light-high-contrast.css +15 -0
  111. package/dist/mantle.css +29 -0
  112. package/dist/media-object.d.ts +18 -4
  113. package/dist/media-object.js +1 -1
  114. package/dist/multi-select.d.ts +282 -24
  115. package/dist/multi-select.js +1 -1
  116. package/dist/otp-input.d.ts +118 -6
  117. package/dist/otp-input.js +1 -1
  118. package/dist/pagination.d.ts +61 -6
  119. package/dist/pagination.js +1 -1
  120. package/dist/popover-CE4OlWkd.d.ts +208 -0
  121. package/dist/popover-CQ9s7jG5.js +1 -0
  122. package/dist/popover.d.ts +1 -181
  123. package/dist/popover.js +1 -1
  124. package/dist/primitive-trJDqIXJ.js +1 -0
  125. package/dist/progress.d.ts +2 -8
  126. package/dist/progress.js +1 -1
  127. package/dist/qr-code.d.ts +101 -5
  128. package/dist/qr-code.js +1 -1
  129. package/dist/radio-group.d.ts +110 -35
  130. package/dist/radio-group.js +1 -1
  131. package/dist/sandboxed-on-click.d.ts +2 -2
  132. package/dist/sandboxed-on-click.js +1 -1
  133. package/dist/scatter-plot.d.ts +495 -0
  134. package/dist/scatter-plot.js +1 -0
  135. package/dist/select-0z7HVS6r.d.ts +579 -0
  136. package/dist/select-BCHWvmyC.js +1 -0
  137. package/dist/select.d.ts +1 -1
  138. package/dist/select.js +1 -1
  139. package/dist/selectable-list.d.ts +225 -298
  140. package/dist/selectable-list.js +1 -1
  141. package/dist/separator-B5UmkVRL.d.ts +75 -0
  142. package/dist/separator-bpE_kooz.js +1 -0
  143. package/dist/separator.d.ts +1 -52
  144. package/dist/separator.js +1 -1
  145. package/dist/sheet.d.ts +285 -38
  146. package/dist/sheet.js +1 -1
  147. package/dist/skeleton-CsbUHbBA.js +1 -0
  148. package/dist/skeleton.d.ts +4 -7
  149. package/dist/skeleton.js +1 -1
  150. package/dist/skip-to-main-link.d.ts +24 -4
  151. package/dist/skip-to-main-link.js +1 -1
  152. package/dist/slider.js +1 -1
  153. package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
  154. package/dist/slot-CDk0Bb9z.js +1 -0
  155. package/dist/slot.d.ts +1 -1
  156. package/dist/slot.js +1 -1
  157. package/dist/split-button.d.ts +14 -14
  158. package/dist/split-button.js +1 -1
  159. package/dist/switch.d.ts +10 -7
  160. package/dist/switch.js +1 -1
  161. package/dist/table-Bo0vNxIJ.d.ts +848 -0
  162. package/dist/table-CGxJwtbL.js +1 -0
  163. package/dist/table.d.ts +1 -1
  164. package/dist/table.js +1 -1
  165. package/dist/tabs.d.ts +124 -25
  166. package/dist/tabs.js +1 -1
  167. package/dist/text-area.d.ts +2 -2
  168. package/dist/text-area.js +1 -1
  169. package/dist/theme-C26-Xolp.js +1 -0
  170. package/dist/theme-switcher.d.ts +105 -33
  171. package/dist/theme-switcher.js +1 -1
  172. package/dist/theme.d.ts +54 -15
  173. package/dist/theme.js +1 -1
  174. package/dist/toast.d.ts +86 -10
  175. package/dist/toast.js +1 -1
  176. package/dist/tooltip.d.ts +50 -5
  177. package/dist/tooltip.js +1 -1
  178. package/dist/types.d.ts +2 -2
  179. package/dist/utils.d.ts +1 -1
  180. package/dist/utils.js +1 -1
  181. package/dist/well.d.ts +3 -3
  182. package/dist/well.js +1 -1
  183. package/package.json +9 -3
  184. package/dist/anchor-C_tjSVy6.js +0 -1
  185. package/dist/as-child-CYEVu1WY.d.ts +0 -23
  186. package/dist/button-5t6-JS_I.js +0 -1
  187. package/dist/button-ClC60Nzg.js +0 -1
  188. package/dist/checkbox-DJ2xl7Rc.js +0 -1
  189. package/dist/choice-DOdyNzFC.js +0 -1
  190. package/dist/compose-refs-Cjf2gfB8.js +0 -1
  191. package/dist/dialog-vxLIvB8M.js +0 -1
  192. package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
  193. package/dist/field-context-BR01g789.js +0 -1
  194. package/dist/icon-CDtYjF_H.js +0 -1
  195. package/dist/icon-button-DV2-GZHf.js +0 -1
  196. package/dist/index-g2rfwNCH.d.ts +0 -1
  197. package/dist/input-Ct1YOqSy.js +0 -1
  198. package/dist/label-BMlHW_2D.js +0 -1
  199. package/dist/popover-D5WxxnBY.js +0 -1
  200. package/dist/primitive-C64-m48O.d.ts +0 -13
  201. package/dist/primitive-IKruV2iB.js +0 -1
  202. package/dist/select-Bwt2YduR.d.ts +0 -345
  203. package/dist/select-D-5u0Blc.js +0 -1
  204. package/dist/separator-kBnnv3Cw.js +0 -1
  205. package/dist/skeleton-Bu3tgNcW.js +0 -1
  206. package/dist/slot-DmPrjM7N.js +0 -1
  207. package/dist/svg-only-DDx6FtJd.js +0 -1
  208. package/dist/table-CPH2md2-.js +0 -1
  209. package/dist/table-CwFHXC-G.d.ts +0 -414
  210. package/dist/theme-D3MDng6U.js +0 -1
  211. package/dist/theme-provider-C9zpDyJW.js +0 -1
  212. package/dist/toast-BsCjaMVS.js +0 -1
  213. package/dist/virtual-DZMBu7Ch.js +0 -1
  214. /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
  215. /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
  216. /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
  217. /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
  218. /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
  219. /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
  220. /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
  221. /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
  222. /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
package/dist/alert.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
- import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
3
- import "./index-D47aqlpz.js";
4
- import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-BvQvT790.js";
5
- import { ComponentProps, HTMLAttributes, ReactNode } from "react";
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
3
+ import "./index-DA4ig3gj.js";
4
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-C7vAl6lS.js";
5
+ import { ComponentProps, ReactNode } from "react";
6
6
  //#region src/components/alert/alert.d.ts
7
7
  declare const intents: readonly ["danger", "important", "info", "success", "warning"];
8
8
  type AlertIntent = (typeof intents)[number];
@@ -23,13 +23,118 @@ type AlertProps = ComponentProps<"div"> & {
23
23
  */
24
24
  appearance?: Appearance;
25
25
  };
26
+ /**
27
+ * Displays a callout for user attention. Root container for all Alert sub-components.
28
+ *
29
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertroot
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <Alert intent="info">
34
+ * <AlertIcon />
35
+ * <AlertContent>
36
+ * <AlertTitle>Alert Title</AlertTitle>
37
+ * <AlertDismissIconButton />
38
+ * <AlertDescription>
39
+ * Alert description text.
40
+ * </AlertDescription>
41
+ * </AlertContent>
42
+ * </Alert>
43
+ *```
44
+ */
45
+ declare const Root: ({ appearance, className, intent, ref, ...props }: AlertProps) => import("react").JSX.Element;
26
46
  type AlertIconProps = Omit<SvgAttributes, "children"> & {
27
47
  /**
28
48
  * An optional icon that renders in place of the default icon for the Alert intent.
29
49
  */
30
50
  svg?: ReactNode;
31
51
  };
52
+ /**
53
+ * An optional icon that visually represents the intent of the Alert.
54
+ *
55
+ * The default rendered icon be overridden with a custom icon using the `svg` prop.
56
+ *
57
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * <Alert intent="info">
62
+ * <AlertIcon />
63
+ * <AlertContent>
64
+ * <AlertTitle>Alert Title</AlertTitle>
65
+ * <AlertDismissIconButton />
66
+ * <AlertDescription>
67
+ * Alert description text.
68
+ * </AlertDescription>
69
+ * </AlertContent>
70
+ * </Alert>
71
+ * ```
72
+ */
73
+ declare const Icon: ({ className, ref, svg, ...props }: AlertIconProps) => import("react").JSX.Element;
74
+ /**
75
+ * The container for the content slot of an alert. Place the title and description as direct children.
76
+ *
77
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertcontent
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * <Alert intent="info">
82
+ * <AlertIcon />
83
+ * <AlertContent>
84
+ * <AlertTitle>Alert Title</AlertTitle>
85
+ * <AlertDismissIconButton />
86
+ * <AlertDescription>
87
+ * Alert description text.
88
+ * </AlertDescription>
89
+ * </AlertContent>
90
+ * </Alert>
91
+ *```
92
+ */
93
+ declare const Content: ({ className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
94
+ type AlertTitleProps = ComponentProps<"h5"> & WithAsChild;
95
+ /**
96
+ * The title of an alert. Default renders as an h5 element, use asChild to render something else.
97
+ *
98
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerttitle
99
+ *
100
+ * @example
101
+ * ```tsx
102
+ * <Alert intent="info">
103
+ * <AlertIcon />
104
+ * <AlertContent>
105
+ * <AlertTitle>Alert Title</AlertTitle>
106
+ * <AlertDismissIconButton />
107
+ * <AlertDescription>
108
+ * Alert description text.
109
+ * </AlertDescription>
110
+ * </AlertContent>
111
+ * </Alert>
112
+ *```
113
+ */
114
+ declare const Title: ({ asChild, className, ref, ...props }: AlertTitleProps) => import("react").JSX.Element;
32
115
  type AlertDescriptionProps = ComponentProps<"div"> & WithAsChild;
116
+ /**
117
+ * The optional description of an alert.
118
+ * Renders as a `div` by default, but can be changed to any other element using
119
+ * the `asChild` prop.
120
+ *
121
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdescription
122
+ *
123
+ * @example
124
+ * ```tsx
125
+ * <Alert intent="info">
126
+ * <AlertIcon />
127
+ * <AlertContent>
128
+ * <AlertTitle>Alert Title</AlertTitle>
129
+ * <AlertDismissIconButton />
130
+ * <AlertDescription>
131
+ * Alert description text.
132
+ * </AlertDescription>
133
+ * </AlertContent>
134
+ * </Alert>
135
+ * ```
136
+ */
137
+ declare const Description: ({ asChild, className, ref, ...props }: AlertDescriptionProps) => import("react").JSX.Element;
33
138
  type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
34
139
  /**
35
140
  * The visual style of the dismiss button. Optional here —
@@ -44,10 +149,7 @@ type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "appearance" |
44
149
  */
45
150
  icon?: ReactNode;
46
151
  };
47
- declare const DismissIconButton: {
48
- ({ size, type, label, appearance, className, icon, style, ...props }: AlertDismissIconButtonProps): import("react").JSX.Element;
49
- displayName: string;
50
- };
152
+ declare const DismissIconButton: ({ size, type, label, appearance, className, icon, style, ...props }: AlertDismissIconButtonProps) => import("react").JSX.Element;
51
153
  /**
52
154
  * Displays a callout for user attention.
53
155
  *
@@ -95,7 +197,7 @@ declare const Alert: {
95
197
  * </Alert.Root>
96
198
  * ```
97
199
  */
98
- readonly Root: import("react").ForwardRefExoticComponent<Omit<AlertProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
200
+ readonly Root: typeof Root;
99
201
  /**
100
202
  * The container for the content slot of an alert.
101
203
  *
@@ -112,7 +214,7 @@ declare const Alert: {
112
214
  * </Alert.Root>
113
215
  * ```
114
216
  */
115
- readonly Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
217
+ readonly Content: typeof Content;
116
218
  /**
117
219
  * The optional description of an alert.
118
220
  *
@@ -129,7 +231,7 @@ declare const Alert: {
129
231
  * </Alert.Root>
130
232
  * ```
131
233
  */
132
- readonly Description: import("react").ForwardRefExoticComponent<Omit<AlertDescriptionProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
234
+ readonly Description: typeof Description;
133
235
  /**
134
236
  * An optional dismiss button that can be used to close the alert.
135
237
  *
@@ -164,7 +266,7 @@ declare const Alert: {
164
266
  * </Alert.Root>
165
267
  * ```
166
268
  */
167
- readonly Icon: import("react").ForwardRefExoticComponent<Omit<AlertIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
269
+ readonly Icon: typeof Icon;
168
270
  /**
169
271
  * The title of an alert.
170
272
  *
@@ -181,7 +283,7 @@ declare const Alert: {
181
283
  * </Alert.Root>
182
284
  * ```
183
285
  */
184
- readonly Title: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & WithAsChild & import("react").RefAttributes<HTMLHeadingElement>>;
286
+ readonly Title: typeof Title;
185
287
  };
186
288
  //#endregion
187
289
  export { Alert };
package/dist/alert.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./icon-button-DV2-GZHf.js";import{createContext as a,forwardRef as o,useContext as s,useMemo as c}from"react";import l from"tiny-invariant";import{jsx as u}from"react/jsx-runtime";import{CheckCircleIcon as d}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as f}from"@phosphor-icons/react/Info";import{MegaphoneIcon as p}from"@phosphor-icons/react/Megaphone";import{WarningIcon as m}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";import{XIcon as g}from"@phosphor-icons/react/X";import{cva as _}from"class-variance-authority";const v=a(null),y=u(g,{});function b(){let e=s(v);return l(e,`useAlertContext hook used outside of Alert parent!`),e}const x=_(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),S=o(({appearance:t=`default`,className:n,intent:r,...i},a)=>{let o=c(()=>({intent:r}),[r]);return u(v.Provider,{value:o,children:u(`div`,{ref:a,"data-slot":`alert`,className:e(x({appearance:t,intent:r}),n),...i})})});S.displayName=`Alert`;const C={danger:u(m,{}),important:u(p,{mirrored:!0}),info:u(f,{}),success:u(d,{}),warning:u(h,{})},w=o(({className:n,svg:r,...i},a)=>{let o=b(),s=C[o.intent];return u(t,{ref:a,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:r??s,...i})});w.displayName=`AlertIcon`;const T=o(({className:t,...n},r)=>u(`div`,{ref:r,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...n}));T.displayName=`AlertContent`;const E=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`h5`,{ref:a,"data-slot":`alert-title`,className:e(`font-medium`,r),...i}));E.displayName=`AlertTitle`;const D=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`div`,{ref:a,"data-slot":`alert-description`,className:e(`text-sm`,r),...i}));D.displayName=`AlertDescription`;const O=e=>`var(--color-${e}-700)`,k=e=>`var(--color-${e}-800)`,A=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,j=({size:t=`sm`,type:n=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=y,style:l,...d})=>{let f=b();return u(i,{appearance:o,icon:c,intent:`neutral`,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:n,style:r({...l,"--alert-dismiss-icon-color":O(f.intent),"--alert-dismiss-icon-hover-color":k(f.intent),"--alert-dismiss-hover-bg":A(f.intent)}),...d})};j.displayName=`AlertDismissIconButton`;const M={Root:S,Content:T,Description:D,DismissIconButton:j,Icon:w,Title:E};export{M as Alert};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-d-nMCfAI.js";import{t as n}from"./slot-CDk0Bb9z.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./button-BAno7KIU.js";import{createContext as a,useContext as o,useMemo as s}from"react";import c from"tiny-invariant";import{jsx as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{MegaphoneIcon as f}from"@phosphor-icons/react/Megaphone";import{WarningIcon as p}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as m}from"@phosphor-icons/react/WarningDiamond";import{XIcon as h}from"@phosphor-icons/react/X";import{cva as g}from"class-variance-authority";const _=a(null),v=l(h,{});function y(){let e=o(_);return c(e,`useAlertContext hook used outside of Alert parent!`),e}const b=g(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),x=({appearance:t=`default`,className:n,intent:r,ref:i,...a})=>{let o=s(()=>({intent:r}),[r]);return l(_.Provider,{value:o,children:l(`div`,{ref:i,"data-slot":`alert`,className:e(b({appearance:t,intent:r}),n),...a})})},S={danger:l(p,{}),important:l(f,{mirrored:!0}),info:l(d,{}),success:l(u,{}),warning:l(m,{})},C=({className:n,ref:r,svg:i,...a})=>{let o=y(),s=S[o.intent];return l(t,{ref:r,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:i??s,...a})},w=({className:t,ref:n,...r})=>l(`div`,{ref:n,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...r}),T=({asChild:t=!1,className:r,ref:i,...a})=>l(t?n:`h5`,{ref:i,"data-slot":`alert-title`,className:e(`font-medium`,r),...a}),E=({asChild:t=!1,className:r,ref:i,...a})=>l(t?n:`div`,{ref:i,"data-slot":`alert-description`,className:e(`text-sm`,r),...a}),D=e=>`var(--color-${e}-700)`,O=e=>`var(--color-${e}-800)`,k=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,A={Root:x,Content:w,Description:E,DismissIconButton:({size:t=`sm`,type:n=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=v,style:u,...d})=>{let f=y();return l(i,{appearance:o,icon:c,intent:`neutral`,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:n,style:r({...u,"--alert-dismiss-icon-color":D(f.intent),"--alert-dismiss-icon-hover-color":O(f.intent),"--alert-dismiss-hover-bg":k(f.intent)}),...d})},Icon:C,Title:T};export{A as Alert};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-CDk0Bb9z.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),d=({asChild:e,children:d,className:p,rel:m,icon:h,iconPlacement:g=`start`,ref:_,...v})=>{let y=f(m),b={"data-slot":`anchor`,className:u(p),ref:_,rel:y,...v};if(e){let e=r.only(d);o(a(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{...b,children:i(e,{},l(s,{children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),u,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return l(`a`,{...b,children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]})};function f(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{u as n,f as r,d as t};
package/dist/anchor.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
2
  import { ComponentProps, ReactNode } from "react";
3
3
  //#region src/components/anchor/types.d.ts
4
4
  /**
@@ -95,7 +95,7 @@ type AnchorProps = Omit<ComponentProps<"a">, "rel"> & WithAsChild & {
95
95
  * </Anchor>
96
96
  * ```
97
97
  */
98
- declare const Anchor: import("react").ForwardRefExoticComponent<Omit<AnchorProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
98
+ declare const Anchor: ({ asChild, children, className, rel: propRel, icon, iconPlacement, ref, ...props }: AnchorProps) => import("react").JSX.Element;
99
99
  /**
100
100
  * Resolves the `rel` attribute to a string.
101
101
  *
package/dist/anchor.js CHANGED
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./anchor-C_tjSVy6.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};
1
+ import{n as e,r as t,t as n}from"./anchor-DfeXTpKW.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};