@ngrok/mantle 0.76.11 → 0.78.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 (194) hide show
  1. package/dist/accordion.d.ts +63 -21
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +7 -1
  4. package/dist/alert-dialog.d.ts +19 -26
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +16 -24
  7. package/dist/alert.js +1 -1
  8. package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
  9. package/dist/anchor.d.ts +3 -4
  10. package/dist/anchor.js +1 -1
  11. package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
  12. package/dist/badge.d.ts +5 -56
  13. package/dist/badge.js +1 -1
  14. package/dist/breadcrumb.d.ts +212 -0
  15. package/dist/breadcrumb.js +1 -0
  16. package/dist/browser-only-CPH56Xw_.js +1 -0
  17. package/dist/browser-only.d.ts +2 -6
  18. package/dist/browser-only.js +1 -1
  19. package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
  20. package/dist/button-AS5Ir3DE.js +1 -0
  21. package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
  22. package/dist/button.d.ts +5 -4
  23. package/dist/button.js +1 -1
  24. package/dist/calendar.d.ts +2 -8
  25. package/dist/calendar.js +1 -1
  26. package/dist/card.d.ts +8 -8
  27. package/dist/card.js +1 -1
  28. package/dist/centered-layout.d.ts +147 -0
  29. package/dist/centered-layout.js +1 -0
  30. package/dist/checkbox-DJ2xl7Rc.js +1 -0
  31. package/dist/checkbox.d.ts +11 -9
  32. package/dist/checkbox.js +1 -1
  33. package/dist/choice-DOdyNzFC.js +1 -0
  34. package/dist/choice.d.ts +253 -0
  35. package/dist/choice.js +1 -0
  36. package/dist/code-block.d.ts +5 -17
  37. package/dist/code-block.js +1 -1
  38. package/dist/code-block_highlight-utils.d.ts +1 -1
  39. package/dist/code-block_highlight-utils.js +1 -1
  40. package/dist/code.d.ts +4 -5
  41. package/dist/code.js +1 -1
  42. package/dist/combobox.d.ts +40 -19
  43. package/dist/combobox.js +1 -1
  44. package/dist/command.d.ts +60 -38
  45. package/dist/command.js +1 -1
  46. package/dist/{copy-to-clipboard-Baw30q9O.js → copy-to-clipboard-BsCQ9m6K.js} +1 -1
  47. package/dist/cx-IiQEAKf5.js +1 -0
  48. package/dist/cx.js +1 -1
  49. package/dist/data-slot-CChfb_cv.d.ts +17 -0
  50. package/dist/data-table.d.ts +45 -131
  51. package/dist/data-table.js +1 -1
  52. package/dist/description-list.d.ts +7 -7
  53. package/dist/description-list.js +1 -1
  54. package/dist/{dialog-Cp0S2jsG.js → dialog-DVDFVT_-.js} +1 -1
  55. package/dist/dialog.d.ts +155 -48
  56. package/dist/dialog.js +1 -1
  57. package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
  58. package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
  59. package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
  60. package/dist/dropdown-menu.d.ts +2 -1
  61. package/dist/dropdown-menu.js +1 -1
  62. package/dist/empty.d.ts +133 -53
  63. package/dist/empty.js +1 -1
  64. package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
  65. package/dist/field.d.ts +24 -36
  66. package/dist/field.js +1 -1
  67. package/dist/flag.d.ts +2 -9
  68. package/dist/flag.js +1 -1
  69. package/dist/hooks.d.ts +139 -81
  70. package/dist/hooks.js +1 -1
  71. package/dist/hover-card.d.ts +34 -14
  72. package/dist/hover-card.js +1 -1
  73. package/dist/icon-CDtYjF_H.js +1 -0
  74. package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
  75. package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
  76. package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
  77. package/dist/icon.d.ts +3 -3
  78. package/dist/icon.js +1 -1
  79. package/dist/icons.d.ts +7 -19
  80. package/dist/icons.js +1 -1
  81. package/dist/{in-view-BC3wmz-a.d.ts → in-view-nkSOdED2.d.ts} +21 -10
  82. package/dist/index-BnI3OppC.d.ts +1 -0
  83. package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
  84. package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
  85. package/dist/index-Rv8RL7xy.d.ts +25 -0
  86. package/dist/input-Ct1YOqSy.js +1 -0
  87. package/dist/input.d.ts +10 -56
  88. package/dist/input.js +1 -1
  89. package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
  90. package/dist/kbd.d.ts +3 -8
  91. package/dist/kbd.js +1 -1
  92. package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
  93. package/dist/label-v2-bv98k.d.ts +69 -0
  94. package/dist/label.d.ts +1 -68
  95. package/dist/label.js +1 -1
  96. package/dist/list.d.ts +295 -0
  97. package/dist/list.js +1 -0
  98. package/dist/llms.txt +7 -1
  99. package/dist/main.d.ts +4 -27
  100. package/dist/main.js +1 -1
  101. package/dist/mantle.css +6 -6
  102. package/dist/media-object.d.ts +6 -7
  103. package/dist/media-object.js +1 -1
  104. package/dist/multi-select.d.ts +80 -33
  105. package/dist/multi-select.js +1 -1
  106. package/dist/otp-input.d.ts +7 -8
  107. package/dist/otp-input.js +1 -1
  108. package/dist/pagination.d.ts +11 -22
  109. package/dist/pagination.js +1 -1
  110. package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
  111. package/dist/popover.d.ts +6 -7
  112. package/dist/popover.js +1 -1
  113. package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
  114. package/dist/{primitive-BFUir4UB.js → primitive-wm7Wk-gy.js} +1 -1
  115. package/dist/progress.d.ts +55 -46
  116. package/dist/progress.js +1 -1
  117. package/dist/qr-code.d.ts +10 -9
  118. package/dist/qr-code.js +1 -1
  119. package/dist/radio-group.d.ts +71 -60
  120. package/dist/radio-group.js +1 -1
  121. package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
  122. package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
  123. package/dist/sandboxed-on-click.d.ts +4 -8
  124. package/dist/sandboxed-on-click.js +1 -1
  125. package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
  126. package/dist/{select-xfyY5Vt1.js → select-D-5u0Blc.js} +1 -1
  127. package/dist/select.d.ts +1 -1
  128. package/dist/select.js +1 -1
  129. package/dist/selectable-list.d.ts +725 -0
  130. package/dist/selectable-list.js +1 -0
  131. package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
  132. package/dist/separator.d.ts +6 -37
  133. package/dist/separator.js +1 -1
  134. package/dist/sheet.d.ts +231 -47
  135. package/dist/sheet.js +1 -1
  136. package/dist/sizes-Dje_rwKc.d.ts +29 -0
  137. package/dist/skeleton-Bu3tgNcW.js +1 -0
  138. package/dist/skeleton.d.ts +2 -2
  139. package/dist/skeleton.js +1 -1
  140. package/dist/skip-to-main-link.d.ts +4 -34
  141. package/dist/skip-to-main-link.js +1 -1
  142. package/dist/slider.d.ts +2 -21
  143. package/dist/slider.js +1 -1
  144. package/dist/slot-DmPrjM7N.js +1 -0
  145. package/dist/slot.d.ts +1 -1
  146. package/dist/slot.js +1 -1
  147. package/dist/split-button.d.ts +20 -12
  148. package/dist/split-button.js +1 -1
  149. package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
  150. package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
  151. package/dist/switch.d.ts +6 -3
  152. package/dist/switch.js +1 -1
  153. package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
  154. package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
  155. package/dist/table.d.ts +1 -1
  156. package/dist/table.js +1 -1
  157. package/dist/tabs.d.ts +29 -15
  158. package/dist/tabs.js +1 -1
  159. package/dist/text-area.d.ts +2 -3
  160. package/dist/text-area.js +1 -1
  161. package/dist/theme-D8kZCOzM.js +1 -0
  162. package/dist/theme-provider-Djj_jBo6.js +1 -0
  163. package/dist/theme-switcher.d.ts +45 -0
  164. package/dist/theme-switcher.js +1 -0
  165. package/dist/theme.d.ts +15 -101
  166. package/dist/theme.js +1 -1
  167. package/dist/{toast-Bwno5LUs.js → toast-RkhbliFh.js} +1 -1
  168. package/dist/toast.d.ts +13 -37
  169. package/dist/toast.js +1 -1
  170. package/dist/tooltip.d.ts +10 -44
  171. package/dist/tooltip.js +1 -1
  172. package/dist/types-C19IR7jf.d.ts +48 -0
  173. package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
  174. package/dist/types.d.ts +3 -3
  175. package/dist/use-copy-to-clipboard-DqQ0_N3E.js +1 -0
  176. package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
  177. package/dist/utils.d.ts +2 -3
  178. package/dist/utils.js +1 -1
  179. package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
  180. package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
  181. package/dist/virtual-DZMBu7Ch.js +1 -0
  182. package/dist/well.d.ts +3 -3
  183. package/dist/well.js +1 -1
  184. package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
  185. package/package.json +79 -344
  186. package/dist/browser-only-BSl_hruR.js +0 -1
  187. package/dist/button-C9GW9nAr.js +0 -1
  188. package/dist/cx-C1UYP5We.js +0 -1
  189. package/dist/icon-SUx16Sl3.js +0 -1
  190. package/dist/index-CJbKEKr2.d.ts +0 -20
  191. package/dist/slot-DT_E5BQx.js +0 -1
  192. package/dist/theme-provider-BNFS3Acf.js +0 -1
  193. package/dist/use-copy-to-clipboard-BLpquU9d.js +0 -1
  194. package/dist/use-prefers-reduced-motion-CWIoFA6W.js +0 -1
@@ -1,6 +1,7 @@
1
+ import "./as-child-CYEVu1WY.js";
2
+ import "./with-style-props-Dq5Vntqy.js";
1
3
  import { CSSProperties } from "react";
2
4
  import { VariantProps } from "class-variance-authority";
3
-
4
5
  //#region src/types/booleanish.d.ts
5
6
  type Booleanish = boolean | "true" | "false";
6
7
  /**
@@ -13,7 +14,7 @@ declare function parseBooleanish(value: Booleanish | (string & {}) | undefined |
13
14
  /**
14
15
  * Makes all properties in an object non-nullable, recursively.
15
16
  */
16
- type DeepNonNullable<Type> = { [Property in keyof Type]-?: Type[Property] & {} };
17
+ type DeepNonNullable<Type> = { [Property in keyof Type]-?: Type[Property] & {}; };
17
18
  //#endregion
18
19
  //#region src/types/variant-props.d.ts
19
20
  /**
@@ -0,0 +1,25 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
2
+ import { ComponentProps } from "react";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ //#region src/components/slot/slot.d.ts
5
+ type Props = ComponentProps<typeof Slot> & WithDataSlot;
6
+ /**
7
+ * Merges its props onto its immediate child. This is useful for creating
8
+ * components that can be rendered as different elements. Automatically merges
9
+ * className props using `cx` for proper Tailwind class handling, and
10
+ * concatenates `data-slot` values in DOM order (the composing parent's slot
11
+ * chain first, then the child's own) so `asChild` composition accumulates the
12
+ * whole slot chain instead of one side clobbering the other.
13
+ *
14
+ * @see https://mantle.ngrok.com/components/primitives/slot
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <Slot className="custom-class">
19
+ * <a href="/">Home</a>
20
+ * </Slot>
21
+ * ```
22
+ */
23
+ declare const Slot$1: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLElement>>;
24
+ //#endregion
25
+ export { Slot$1 as t };
@@ -0,0 +1 @@
1
+ import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CDtYjF_H.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{a as i,r as a}from"./validation-Bpptk_9t.js";import{createContext as o,forwardRef as s,useContext as c,useMemo as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CheckCircleIcon as p}from"@phosphor-icons/react/CheckCircle";import{WarningIcon as m}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";const g=s(({children:e,className:t,...n},r)=>{let i=!!e,a=u(null);return i?d(y,{className:t,forwardedRef:r,innerRef:a,...n,children:e}):d(y,{...n,className:t,forwardedRef:r,innerRef:a,children:d(_,{...n})})});g.displayName=`Input`;const _=s(({"aria-invalid":n,className:r,validation:o,...s},l)=>{let{"aria-invalid":u,forwardedRef:f,innerRef:p,validation:m,...h}=c(v),g=i(),{ariaInvalid:_,validation:y}=a({"aria-invalid":u??n,validation:m??o??g}),b={...h,...s,type:s.type??h.type??`text`};return d(`input`,{"aria-invalid":_,"data-slot":`input-capture`,"data-validation":y,className:t(`placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] focus:outline-hidden`,r),ref:e(l,f,p),...b})});_.displayName=`InputCapture`;const v=o({validation:void 0,innerRef:{current:null}}),y=({"aria-invalid":e,"aria-disabled":n,"data-slot":r=`input`,children:o,className:s,disabled:c,forwardedRef:u,innerRef:p,style:m,type:h,validation:g,..._})=>{let y=i(),{validation:x}=a({"aria-invalid":e,validation:g??y}),S=l(()=>({"aria-invalid":e,"aria-disabled":n,disabled:c,type:h,validation:g,..._,forwardedRef:u,innerRef:p}),[e,n,c,h,g,_,u,p]);return d(v.Provider,{value:S,children:f(`div`,{role:`none`,"data-slot":r,"data-disabled":(c??n)||void 0,"data-validation":x||void 0,className:t(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-hidden focus-within:ring-4`,`data-disabled:opacity-50`,`has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-5`,`border-form text-strong focus-within:border-accent-600 focus-within:ring-focus-accent`,`data-validation-success:border-success-600 focus-within:data-validation-success:border-success-600 focus-within:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 focus-within:data-validation-warning:border-warning-600 focus-within:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 focus-within:data-validation-error:border-danger-600 focus-within:data-validation-error:ring-focus-danger`,`autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] has-autofill:bg-blue-50 has-autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,s),onMouseDown:e=>{e.target!==p?.current&&e.preventDefault()},onClick:()=>{p?.current?.focus()},onKeyDown:()=>{p?.current!==document.activeElement&&p?.current?.focus()},style:m,children:[o,d(b,{name:_.name,validation:x})]})})};y.displayName=`InputContainer`;const b=({name:e,validation:t})=>{switch(t){case`error`:return f(`div`,{className:`text-danger-600 order-last select-none`,children:[d(`span`,{className:`sr-only`,children:r(`The value entered for the`,e,`input has failed validation.`)}),d(n,{svg:d(m,{"aria-hidden":!0,weight:`fill`})})]});case`success`:return d(`div`,{className:`text-success-600 order-last select-none`,children:d(n,{svg:d(p,{weight:`fill`})})});case`warning`:return d(`div`,{className:`text-warning-600 order-last select-none`,children:d(n,{svg:d(h,{weight:`fill`})})});default:return null}};b.displayName=`ValidationFeedback`;export{_ as n,g as t};
package/dist/input.d.ts CHANGED
@@ -1,52 +1,6 @@
1
- import { o as WithValidation, r as Validation } from "./validation-xyX_6kph.js";
1
+ import { o as WithValidation, r as Validation } from "./validation-7QeiTFwl.js";
2
+ import { i as WithInputType, n as InputType, r as WithAutoComplete, t as AutoComplete } from "./types-C19IR7jf.js";
2
3
  import { InputHTMLAttributes, PropsWithChildren } from "react";
3
-
4
- //#region src/components/input/types.d.ts
5
- /**
6
- * (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
7
- * if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
8
- * previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
9
- * browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
10
- *
11
- * The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
12
- * number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
13
- * data, being valid for all input types except checkbox, radio, file, or any of the button types.
14
- *
15
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
16
- */
17
- type AutoComplete = "off" | "on" | "name" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo";
18
- type WithAutoComplete = {
19
- /**
20
- * (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
21
- * if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
22
- * previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
23
- * browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
24
- *
25
- * The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
26
- * number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
27
- * data, being valid for all input types except checkbox, radio, file, or any of the button types.
28
- *
29
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
30
- */
31
- autoComplete?: AutoComplete;
32
- };
33
- /**
34
- * A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
35
- * If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
36
- *
37
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
38
- */
39
- type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
40
- type WithInputType = {
41
- /**
42
- * A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
43
- * If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
44
- *
45
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
46
- */
47
- type?: InputType;
48
- };
49
- //#endregion
50
4
  //#region src/components/input/input.d.ts
51
5
  type BaseProps = WithAutoComplete & WithInputType & WithValidation;
52
6
  /**
@@ -57,7 +11,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "
57
11
  * Used to create interactive controls for web-based forms in order to accept data from the user.
58
12
  * A versatile input element that supports various types, validation states, and can be composed with other elements.
59
13
  *
60
- * @see https://mantle.ngrok.com/components/input
14
+ * @see https://mantle.ngrok.com/components/forms/input
61
15
  *
62
16
  * @example
63
17
  * ```tsx
@@ -68,7 +22,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "
68
22
  * />
69
23
  * ```
70
24
  */
71
- declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithAutoComplete & WithInputType & WithValidation & {
25
+ declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithValidation & {
72
26
  children?: import("react").ReactNode | undefined;
73
27
  } & import("react").RefAttributes<HTMLInputElement>>;
74
28
  type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & BaseProps;
@@ -76,7 +30,7 @@ type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComple
76
30
  * The actual <input /> element that captures user input.
77
31
  * Used internally by Input component or when you need direct control over the input element.
78
32
  *
79
- * @see https://mantle.ngrok.com/components/input
33
+ * @see https://mantle.ngrok.com/components/forms/input
80
34
  *
81
35
  * @example
82
36
  * ```tsx
@@ -86,7 +40,7 @@ type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComple
86
40
  * </Input>
87
41
  * ```
88
42
  */
89
- declare const InputCapture: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithAutoComplete & WithInputType & WithValidation & import("react").RefAttributes<HTMLInputElement>>;
43
+ declare const InputCapture: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithValidation & import("react").RefAttributes<HTMLInputElement>>;
90
44
  //#endregion
91
45
  //#region src/components/input/password-input.d.ts
92
46
  type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithValidation & WithAutoComplete & {
@@ -111,7 +65,7 @@ type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoCompl
111
65
  * accurately and may want to verify visually before submitting.
112
66
  *
113
67
  * **When not to use**
114
- * - For values that are never sensitive — use a plain {@link https://mantle.ngrok.com/components/input Input}.
68
+ * - For values that are never sensitive — use a plain {@link https://mantle.ngrok.com/components/forms/input Input}.
115
69
  * - For controls where the toggle would be confusing (e.g. masked input
116
70
  * formatting like phone numbers).
117
71
  *
@@ -120,7 +74,7 @@ type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoCompl
120
74
  * UI control toggles multiple password fields), and `onValueVisibilityChange`
121
75
  * to be notified when the user toggles via the built-in button.
122
76
  *
123
- * **Accessibility.** Always pair with a {@link https://mantle.ngrok.com/components/label Label}.
77
+ * **Accessibility.** Always pair with a {@link https://mantle.ngrok.com/components/forms/label Label}.
124
78
  * The toggle button has its own accessible name announcing the current
125
79
  * state. The input keeps `autocomplete="current-password"` /
126
80
  * `"new-password"` semantics — set `autoComplete` explicitly per flow.
@@ -129,7 +83,7 @@ type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoCompl
129
83
  * `type="text"` — some password managers may pause autofill in this state,
130
84
  * which is the intended security tradeoff.
131
85
  *
132
- * @see https://mantle.ngrok.com/components/password-input
86
+ * @see https://mantle.ngrok.com/components/forms/password-input
133
87
  *
134
88
  * @example
135
89
  * ```tsx
@@ -158,7 +112,7 @@ type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoCompl
158
112
  * }
159
113
  * ```
160
114
  */
161
- declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithValidation & WithAutoComplete & {
115
+ declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithValidation & WithAutoComplete & {
162
116
  /**
163
117
  * Callback for when the visibility of the password value changes.
164
118
  */
package/dist/input.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-C1UYP5We.js";import{t as n}from"./icon-SUx16Sl3.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{a as i,r as a}from"./validation-DCyx-ceH.js";import{t as o}from"./use-prefers-reduced-motion-CWIoFA6W.js";import{t as s}from"./is-input-CXmS0OFN.js";import{createContext as c,forwardRef as l,useContext as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{CheckCircleIcon as _}from"@phosphor-icons/react/CheckCircle";import{WarningIcon as v}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as y}from"@phosphor-icons/react/WarningDiamond";import{EyeIcon as b}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as x}from"@phosphor-icons/react/EyeClosed";import{flushSync as S}from"react-dom";const C=l(({children:e,className:t,...n},r)=>{let i=!!e,a=p(null);return i?h(E,{className:t,forwardedRef:r,innerRef:a,...n,children:e}):h(E,{...n,className:t,forwardedRef:r,innerRef:a,children:h(w,{...n})})});C.displayName=`Input`;const w=l(({"aria-invalid":n,className:r,validation:o,...s},c)=>{let{"aria-invalid":l,forwardedRef:d,innerRef:f,validation:p,...m}=u(T),g=i(),{ariaInvalid:_,validation:v}=a({"aria-invalid":l??n,validation:p??o??g}),y={...m,...s,type:s.type??m.type??`text`};return h(`input`,{"aria-invalid":_,"data-slot":`input-capture`,"data-validation":v,className:t(`placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] focus:outline-hidden`,r),ref:e(c,d,f),...y})});w.displayName=`InputCapture`;const T=c({validation:void 0,innerRef:{current:null}}),E=({"aria-invalid":e,"aria-disabled":n,"data-slot":r=`input`,children:o,className:s,disabled:c,forwardedRef:l,innerRef:u,style:d,type:p,validation:m,..._})=>{let v=i(),{validation:y}=a({"aria-invalid":e,validation:m??v}),b=f(()=>({"aria-invalid":e,"aria-disabled":n,disabled:c,type:p,validation:m,..._,forwardedRef:l,innerRef:u}),[e,n,c,p,m,_,l,u]);return h(T.Provider,{value:b,children:g(`div`,{role:`none`,"data-slot":r,"data-disabled":(c??n)||void 0,"data-validation":y||void 0,className:t(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-hidden focus-within:ring-4`,`data-disabled:opacity-50`,`has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-5`,`border-form text-strong focus-within:border-accent-600 focus-within:ring-focus-accent`,`data-validation-success:border-success-600 focus-within:data-validation-success:border-success-600 focus-within:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 focus-within:data-validation-warning:border-warning-600 focus-within:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 focus-within:data-validation-error:border-danger-600 focus-within:data-validation-error:ring-focus-danger`,`autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] has-autofill:bg-blue-50 has-autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,s),onMouseDown:e=>{e.target!==u?.current&&e.preventDefault()},onClick:()=>{u?.current?.focus()},onKeyDown:()=>{u?.current!==document.activeElement&&u?.current?.focus()},style:d,children:[o,h(D,{name:_.name,validation:y})]})})};E.displayName=`InputContainer`;const D=({name:e,validation:t})=>{switch(t){case`error`:return g(`div`,{className:`text-danger-600 order-last select-none`,children:[h(`span`,{className:`sr-only`,children:r(`The value entered for the`,e,`input has failed validation.`)}),h(n,{svg:h(v,{"aria-hidden":!0,weight:`fill`})})]});case`success`:return h(`div`,{className:`text-success-600 order-last select-none`,children:h(n,{svg:h(_,{weight:`fill`})})});case`warning`:return h(`div`,{className:`text-warning-600 order-last select-none`,children:h(n,{svg:h(y,{weight:`fill`})})});default:return null}};D.displayName=`ValidationFeedback`;const O=l(({onValueVisibilityChange:e,showValue:t=!1,...r},i)=>{let[a,s]=m(t),c=a?`text`:`password`,l=a?b:x,u=p(null),f=p(null);return d(()=>{s(t)},[t]),g(C,{"data-slot":`password-input`,type:c,ref:i,...r,children:[h(w,{}),g(`button`,{type:`button`,tabIndex:-1,className:`text-body hover:text-strong ml-1 cursor-pointer bg-inherit p-0`,onClick:()=>{f.current&&=(f.current.cancel(),null);let t=!a;S(()=>{s(t)}),e?.(t);let n=u.current;n&&!o()&&(f.current=n.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`}),f.current.onfinish=()=>{f.current=null})},children:[g(`span`,{className:`sr-only`,children:[`Turn password visibility `,a?`off`:`on`]}),h(n,{ref:u,svg:h(l,{"aria-hidden":!0})})]})]})});O.displayName=`PasswordInput`;export{C as Input,w as InputCapture,O as PasswordInput,s as isInput};
1
+ import{t as e}from"./icon-CDtYjF_H.js";import{n as t,t as n}from"./input-Ct1YOqSy.js";import{t as r}from"./use-prefers-reduced-motion-CagaNRgm.js";import{t as i}from"./is-input-CXmS0OFN.js";import{forwardRef as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{EyeIcon as d}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as f}from"@phosphor-icons/react/EyeClosed";import{flushSync as p}from"react-dom";const m=a(({onValueVisibilityChange:i,showValue:a=!1,...m},h)=>{let[g,_]=c(a),v=g?`text`:`password`,y=g?d:f,b=s(null),x=s(null);return o(()=>{_(a)},[a]),u(n,{"data-slot":`password-input`,type:v,ref:h,...m,children:[l(t,{}),u(`button`,{type:`button`,tabIndex:-1,className:`text-body hover:text-strong ml-1 cursor-pointer bg-inherit p-0`,onClick:()=>{x.current&&=(x.current.cancel(),null);let e=!g;p(()=>{_(e)}),i?.(e);let t=b.current;t&&!r()&&(x.current=t.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`}),x.current.onfinish=()=>{x.current=null})},children:[u(`span`,{className:`sr-only`,children:[`Turn password visibility `,g?`off`:`on`]}),l(e,{ref:b,svg:l(y,{"aria-hidden":!0})})]})]})});m.displayName=`PasswordInput`;export{n as Input,t as InputCapture,m as PasswordInput,i as isInput};
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{jsx as t}from"react/jsx-runtime";function n({children:n,className:r,...i}){return t(`kbd`,{"data-slot":`kbd`,className:e(`[font-kerning:normal] [font-variant-ligatures:common-ligatures_contextual]`,`appearance-none tabular-nums inline-grid place-items-center size-5 bg-neutral-500/15 px-1 rounded text-mono leading-none font-mono`,r),...i,children:n})}export{n as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{jsx as t}from"react/jsx-runtime";function n({children:n,className:r,...i}){return t(`kbd`,{"data-slot":`kbd`,className:e(`[font-kerning:normal] [font-variant-ligatures:common-ligatures_contextual]`,`appearance-none tabular-nums inline-grid place-items-center size-5 bg-neutral-500/15 px-1 rounded text-mono leading-none font-mono`,r),...i,children:n})}export{n as t};
package/dist/kbd.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
-
3
2
  //#region src/components/kbd/kbd.d.ts
4
3
  /**
5
4
  * A square, centered keyboard "key" chip for rendering shortcut hints —
@@ -13,7 +12,7 @@ import { ComponentProps } from "react";
13
12
  * - Inline with prose: "Press `Kbd K` to open search."
14
13
  *
15
14
  * **When not to use**
16
- * - For arbitrary monospace text — use {@link https://mantle.ngrok.com/components/code Code}.
15
+ * - For arbitrary monospace text — use {@link https://mantle.ngrok.com/components/data-display/code Code}.
17
16
  * - For chord-style multi-key shortcuts as a single chip — render multiple
18
17
  * `<Kbd>` elements separated by `+` text instead.
19
18
  *
@@ -22,7 +21,7 @@ import { ComponentProps } from "react";
22
21
  * `aria-label` on the `<Kbd>` or include a visually-hidden label inside,
23
22
  * and mark the visible glyph `aria-hidden`.
24
23
  *
25
- * @see https://mantle.ngrok.com/components/kbd
24
+ * @see https://mantle.ngrok.com/components/data-display/kbd
26
25
  *
27
26
  * @example
28
27
  * ```tsx
@@ -43,10 +42,6 @@ import { ComponentProps } from "react";
43
42
  * </Kbd>
44
43
  * ```
45
44
  */
46
- declare function Kbd({
47
- children,
48
- className,
49
- ...props
50
- }: ComponentProps<"kbd">): import("react").JSX.Element;
45
+ declare function Kbd({ children, className, ...props }: ComponentProps<"kbd">): import("react").JSX.Element;
51
46
  //#endregion
52
47
  export { Kbd };
package/dist/kbd.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./kbd-D6k4Dnrf.js";export{e as Kbd};
1
+ import{t as e}from"./kbd-K8iaZ-Ti.js";export{e as Kbd};
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=t(({"aria-disabled":t,children:r,className:i,disabled:a,onMouseDown:o,...s},c)=>n(`label`,{"aria-disabled":a??t,"data-slot":`label`,className:e(`text-strong cursor-pointer text-sm peer-disabled:cursor-default has-disabled:cursor-default aria-disabled:cursor-default font-sans`,`[:where(&:not(:has(input,textarea,select,button,[contenteditable])))]:font-medium`,i),onMouseDown:e=>{e.target.closest(`button, input, select, textarea`)||(o?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())},ref:c,...s,children:r}));r.displayName=`Label`;export{r as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=t(({"aria-disabled":t,children:r,className:i,disabled:a,onMouseDown:o,...s},c)=>n(`label`,{"aria-disabled":a??t,"data-slot":`label`,className:e(`text-strong cursor-pointer text-sm peer-disabled:cursor-default has-disabled:cursor-default aria-disabled:cursor-default font-sans`,`[:where(&:not(:has(input,textarea,select,button,[contenteditable])))]:font-medium`,i),onMouseDown:e=>{e.target.closest(`button, input, select, textarea`)||(o?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())},ref:c,...s,children:r}));r.displayName=`Label`;export{r as t};
@@ -0,0 +1,69 @@
1
+ //#region src/components/label/label.d.ts
2
+ /**
3
+ * A caption for a form control — input, checkbox, radio, switch, select.
4
+ * Renders a native `<label>`. Pair every form control with a `Label` so the
5
+ * control has an accessible name, clicks on the label focus the control, and
6
+ * screen readers announce the field correctly.
7
+ *
8
+ * **When to use**
9
+ * - Every visible form control. Always.
10
+ * - Above or beside an input to describe it ("Email", "API key").
11
+ * - Wrapping a checkbox or radio next to its descriptive text.
12
+ *
13
+ * **When not to use**
14
+ * - For static UI text that isn't labeling a control — use a heading or
15
+ * plain `<p>`/`<span>`.
16
+ * - As a substitute for `aria-label` on non-`<input>` widgets that don't
17
+ * support `<label for>` association.
18
+ *
19
+ * **Two ways to associate.** Either wrap the control inside the `<Label>`
20
+ * (implicit association — simplest) or set `htmlFor` to the control's `id`
21
+ * (explicit — required when the control isn't a child).
22
+ *
23
+ * **Disabled state.** Pass `disabled` to render the label in a disabled
24
+ * style. Typically you'll want this to mirror the underlying control's
25
+ * disabled state so the visual treatment stays consistent.
26
+ *
27
+ * **Font weight.** A `Label` automatically gets `font-medium` when it does
28
+ * **not** contain a nested form control (`<input>`, `<textarea>`, `<select>`,
29
+ * `<button>`, or `[contenteditable]`). When the label *does* wrap a control,
30
+ * the auto default is intentionally skipped so the control's own typography
31
+ * isn't bolded — apply `font-medium` to your own caption element (e.g. a
32
+ * `<span>` or `<p>`) inside the label. Override the default at any time by
33
+ * passing a font-weight utility on the `Label` itself, e.g.
34
+ * `<Label className="font-bold">`.
35
+ *
36
+ * @see https://mantle.ngrok.com/components/forms/label
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * import { Label } from "@ngrok/mantle/label";
41
+ * import { Input } from "@ngrok/mantle/input";
42
+ *
43
+ * // Implicit — control nested inside the label.
44
+ * <Label className="grid gap-1">
45
+ * <span>Email</span>
46
+ * <Input type="email" name="email" />
47
+ * </Label>
48
+ *
49
+ * // Explicit — htmlFor matches the control's id.
50
+ * <div className="grid gap-1">
51
+ * <Label htmlFor="api-key">API key</Label>
52
+ * <Input id="api-key" name="apiKey" />
53
+ * </div>
54
+ *
55
+ * // Inline label for a checkbox.
56
+ * <Label className="flex items-center gap-2">
57
+ * <Checkbox name="terms" />
58
+ * <span>I agree to the terms</span>
59
+ * </Label>
60
+ * ```
61
+ */
62
+ declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
63
+ /**
64
+ * If set, the label will appear disabled.
65
+ */
66
+ disabled?: boolean;
67
+ } & import("react").RefAttributes<HTMLLabelElement>>;
68
+ //#endregion
69
+ export { Label as t };
package/dist/label.d.ts CHANGED
@@ -1,69 +1,2 @@
1
- //#region src/components/label/label.d.ts
2
- /**
3
- * A caption for a form control — input, checkbox, radio, switch, select.
4
- * Renders a native `<label>`. Pair every form control with a `Label` so the
5
- * control has an accessible name, clicks on the label focus the control, and
6
- * screen readers announce the field correctly.
7
- *
8
- * **When to use**
9
- * - Every visible form control. Always.
10
- * - Above or beside an input to describe it ("Email", "API key").
11
- * - Wrapping a checkbox or radio next to its descriptive text.
12
- *
13
- * **When not to use**
14
- * - For static UI text that isn't labeling a control — use a heading or
15
- * plain `<p>`/`<span>`.
16
- * - As a substitute for `aria-label` on non-`<input>` widgets that don't
17
- * support `<label for>` association.
18
- *
19
- * **Two ways to associate.** Either wrap the control inside the `<Label>`
20
- * (implicit association — simplest) or set `htmlFor` to the control's `id`
21
- * (explicit — required when the control isn't a child).
22
- *
23
- * **Disabled state.** Pass `disabled` to render the label in a disabled
24
- * style. Typically you'll want this to mirror the underlying control's
25
- * disabled state so the visual treatment stays consistent.
26
- *
27
- * **Font weight.** A `Label` automatically gets `font-medium` when it does
28
- * **not** contain a nested form control (`<input>`, `<textarea>`, `<select>`,
29
- * `<button>`, or `[contenteditable]`). When the label *does* wrap a control,
30
- * the auto default is intentionally skipped so the control's own typography
31
- * isn't bolded — apply `font-medium` to your own caption element (e.g. a
32
- * `<span>` or `<p>`) inside the label. Override the default at any time by
33
- * passing a font-weight utility on the `Label` itself, e.g.
34
- * `<Label className="font-bold">`.
35
- *
36
- * @see https://mantle.ngrok.com/components/label
37
- *
38
- * @example
39
- * ```tsx
40
- * import { Label } from "@ngrok/mantle/label";
41
- * import { Input } from "@ngrok/mantle/input";
42
- *
43
- * // Implicit — control nested inside the label.
44
- * <Label className="grid gap-1">
45
- * <span>Email</span>
46
- * <Input type="email" name="email" />
47
- * </Label>
48
- *
49
- * // Explicit — htmlFor matches the control's id.
50
- * <div className="grid gap-1">
51
- * <Label htmlFor="api-key">API key</Label>
52
- * <Input id="api-key" name="apiKey" />
53
- * </div>
54
- *
55
- * // Inline label for a checkbox.
56
- * <Label className="flex items-center gap-2">
57
- * <Checkbox name="terms" />
58
- * <span>I agree to the terms</span>
59
- * </Label>
60
- * ```
61
- */
62
- declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
63
- /**
64
- * If set, the label will appear disabled.
65
- */
66
- disabled?: boolean;
67
- } & import("react").RefAttributes<HTMLLabelElement>>;
68
- //#endregion
1
+ import { t as Label } from "./label-v2-bv98k.js";
69
2
  export { Label };
package/dist/label.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./label-BLXfnQmn.js";export{e as Label};
1
+ import{t as e}from"./label-BMlHW_2D.js";export{e as Label};