@ngrok/mantle 0.66.17 → 0.68.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 (165) hide show
  1. package/README.md +32 -0
  2. package/dist/accordion.d.ts +9 -9
  3. package/dist/alert-dialog.d.ts +30 -30
  4. package/dist/alert-dialog.js +1 -1
  5. package/dist/alert.d.ts +12 -12
  6. package/dist/alert.js +1 -1
  7. package/dist/alert.js.map +1 -1
  8. package/dist/anchor.d.ts +3 -3
  9. package/dist/{as-child-XMVTepJu.d.ts → as-child-CRRsxi3Y.d.ts} +1 -1
  10. package/dist/badge.d.ts +4 -4
  11. package/dist/badge.js +1 -1
  12. package/dist/badge.js.map +1 -1
  13. package/dist/booleanish-CBGdPL3Q.js.map +1 -1
  14. package/dist/button-BKykcpgJ.js +2 -0
  15. package/dist/button-BKykcpgJ.js.map +1 -0
  16. package/dist/{button-ByK1wG1b.d.ts → button-BaNwe1ud.d.ts} +12 -12
  17. package/dist/button.d.ts +3 -3
  18. package/dist/button.js +1 -1
  19. package/dist/calendar.d.ts +2 -2
  20. package/dist/calendar.js +1 -1
  21. package/dist/card.d.ts +7 -7
  22. package/dist/checkbox.d.ts +4 -4
  23. package/dist/checkbox.js +1 -1
  24. package/dist/checkbox.js.map +1 -1
  25. package/dist/code-block.d.ts +187 -260
  26. package/dist/code-block.js +2 -8
  27. package/dist/code-block.js.map +1 -1
  28. package/dist/code-block_highlight-utils.d.ts +2 -0
  29. package/dist/code-block_highlight-utils.js +1 -0
  30. package/dist/code.d.ts +2 -2
  31. package/dist/code.js +1 -1
  32. package/dist/code.js.map +1 -1
  33. package/dist/color.d.ts +1 -1
  34. package/dist/color.js +1 -1
  35. package/dist/color.js.map +1 -1
  36. package/dist/combobox.d.ts +13 -13
  37. package/dist/combobox.js +1 -1
  38. package/dist/combobox.js.map +1 -1
  39. package/dist/command.d.ts +33 -33
  40. package/dist/command.js +1 -1
  41. package/dist/command.js.map +1 -1
  42. package/dist/data-table.d.ts +14 -14
  43. package/dist/data-table.js +1 -1
  44. package/dist/data-table.js.map +1 -1
  45. package/dist/{deep-non-nullable-BLM3Gz0I.d.ts → deep-non-nullable-BBByg3-i.d.ts} +1 -1
  46. package/dist/description-list.d.ts +6 -6
  47. package/dist/description-list.js +1 -1
  48. package/dist/description-list.js.map +1 -1
  49. package/dist/{dialog-DUOIIhuN.js → dialog-DxkpMIzB.js} +2 -2
  50. package/dist/{dialog-DUOIIhuN.js.map → dialog-DxkpMIzB.js.map} +1 -1
  51. package/dist/dialog.d.ts +17 -17
  52. package/dist/dialog.js +1 -1
  53. package/dist/{direction-DfrtFTny.js → direction-Ca88oQhP.js} +1 -1
  54. package/dist/{direction-DfrtFTny.js.map → direction-Ca88oQhP.js.map} +1 -1
  55. package/dist/{direction-DYYpi-JC.d.ts → direction-MVSxfKWx.d.ts} +2 -2
  56. package/dist/{dropdown-menu-CUwyTKyu.js → dropdown-menu-9nO7ch0t.js} +2 -2
  57. package/dist/{dropdown-menu-CUwyTKyu.js.map → dropdown-menu-9nO7ch0t.js.map} +1 -1
  58. package/dist/{dropdown-menu-BEjpuGrT.d.ts → dropdown-menu-D6MiVSR-.d.ts} +24 -24
  59. package/dist/dropdown-menu.d.ts +1 -1
  60. package/dist/dropdown-menu.js +1 -1
  61. package/dist/flag.d.ts +2 -2
  62. package/dist/hooks.d.ts +8 -4
  63. package/dist/hooks.js +1 -1
  64. package/dist/hover-card.d.ts +6 -6
  65. package/dist/{icon-B1XLv02t.d.ts → icon-Dh1ONyO_.d.ts} +4 -4
  66. package/dist/icon-button-CxxVPiKp.js +2 -0
  67. package/dist/icon-button-CxxVPiKp.js.map +1 -0
  68. package/dist/{icon-button-2r6S3HVA.d.ts → icon-button-gO-7F_MZ.d.ts} +8 -8
  69. package/dist/icon.d.ts +3 -3
  70. package/dist/icons.d.ts +10 -10
  71. package/dist/icons.js +1 -1
  72. package/dist/{in-view-ca-moloX.d.ts → in-view-DS0PgFGa.d.ts} +1 -1
  73. package/dist/{in-view-bPnaWEL4.js → in-view-DiFJ28EF.js} +1 -1
  74. package/dist/{in-view-bPnaWEL4.js.map → in-view-DiFJ28EF.js.map} +1 -1
  75. package/dist/{index-s8rMcilU.d.ts → index-BerTFFEC.d.ts} +1 -1
  76. package/dist/{index-DWqhfw9n.d.ts → index-Bw97R9Kw.d.ts} +9 -9
  77. package/dist/{index-BLCvtjLi.d.ts → index-C3IiAC5H.d.ts} +3 -3
  78. package/dist/{index-ViSCOUrU.d.ts → index-Cj2NX2Dg.d.ts} +6 -6
  79. package/dist/input.d.ts +2 -2
  80. package/dist/input.js +1 -1
  81. package/dist/{is-input-BFR8yMM7.js → is-input-CC_n6EGM.js} +1 -1
  82. package/dist/{is-input-BFR8yMM7.js.map → is-input-CC_n6EGM.js.map} +1 -1
  83. package/dist/{kbd-CtTyMWXB.js → kbd-wgm9K9D5.js} +1 -1
  84. package/dist/{kbd-CtTyMWXB.js.map → kbd-wgm9K9D5.js.map} +1 -1
  85. package/dist/kbd.d.ts +2 -2
  86. package/dist/kbd.js +1 -1
  87. package/dist/label.d.ts +3 -3
  88. package/dist/mantle-dark-high-contrast.css +18 -9
  89. package/dist/mantle-dark.css +37 -43
  90. package/dist/mantle-light-high-contrast.css +15 -9
  91. package/dist/mantle.css +154 -143
  92. package/dist/media-object.d.ts +5 -5
  93. package/dist/multi-select.d.ts +18 -18
  94. package/dist/multi-select.js +1 -1
  95. package/dist/multi-select.js.map +1 -1
  96. package/dist/pagination.d.ts +9 -9
  97. package/dist/pagination.js +1 -1
  98. package/dist/popover.d.ts +7 -7
  99. package/dist/{primitive-tuHqhoRE.d.ts → primitive-BqLYh79k.d.ts} +3 -3
  100. package/dist/progress.d.ts +5 -5
  101. package/dist/radio-group.d.ts +20 -20
  102. package/dist/radio-group.js +1 -1
  103. package/dist/radio-group.js.map +1 -1
  104. package/dist/resolve-pre-rendered-props-51i50IL2.d.ts +165 -0
  105. package/dist/resolve-pre-rendered-props-Bu2cvS9A.js +11 -0
  106. package/dist/resolve-pre-rendered-props-Bu2cvS9A.js.map +1 -0
  107. package/dist/sandboxed-on-click.d.ts +4 -4
  108. package/dist/{select-BkvbNKQ7.d.ts → select-DJmjfGjt.d.ts} +16 -16
  109. package/dist/{select-BXBu1jP_.js → select-Z13w6WBS.js} +2 -2
  110. package/dist/{select-BXBu1jP_.js.map → select-Z13w6WBS.js.map} +1 -1
  111. package/dist/select.d.ts +1 -1
  112. package/dist/select.js +1 -1
  113. package/dist/{separator-fSV4z0Pq.js → separator-BuP5aENE.js} +1 -1
  114. package/dist/{separator-fSV4z0Pq.js.map → separator-BuP5aENE.js.map} +1 -1
  115. package/dist/separator.d.ts +5 -5
  116. package/dist/separator.js +1 -1
  117. package/dist/sheet.d.ts +19 -19
  118. package/dist/sheet.js +1 -1
  119. package/dist/skeleton.d.ts +5 -5
  120. package/dist/slider.d.ts +2 -2
  121. package/dist/slider.js +1 -1
  122. package/dist/slider.js.map +1 -1
  123. package/dist/slot.d.ts +3 -3
  124. package/dist/{sort-CfPsu1Gs.js → sort-mo52clyh.js} +2 -2
  125. package/dist/{sort-CfPsu1Gs.js.map → sort-mo52clyh.js.map} +1 -1
  126. package/dist/split-button.d.ts +20 -20
  127. package/dist/split-button.js +1 -1
  128. package/dist/split-button.js.map +1 -1
  129. package/dist/{svg-only-Ct2mB46K.d.ts → svg-only-Db3eUPWM.d.ts} +4 -4
  130. package/dist/switch.d.ts +4 -4
  131. package/dist/switch.js +1 -1
  132. package/dist/switch.js.map +1 -1
  133. package/dist/{table-Bs1D5Aj7.d.ts → table-C7BejaFW.d.ts} +11 -11
  134. package/dist/table-CnYWz6IT.js +2 -0
  135. package/dist/table-CnYWz6IT.js.map +1 -0
  136. package/dist/table.d.ts +1 -1
  137. package/dist/table.js +1 -1
  138. package/dist/tabs.d.ts +9 -9
  139. package/dist/tabs.js +1 -1
  140. package/dist/tabs.js.map +1 -1
  141. package/dist/text-area.d.ts +3 -3
  142. package/dist/theme.d.ts +7 -7
  143. package/dist/{themes-Dk0VkyqX.d.ts → themes-D_v8H0nY.d.ts} +1 -1
  144. package/dist/toast.d.ts +10 -10
  145. package/dist/tooltip.d.ts +6 -6
  146. package/dist/{types-DgXUgkpc.d.ts → types-Cq6RWU7Q.d.ts} +1 -1
  147. package/dist/{types-Dh4BVhXC.d.ts → types-yU-Byhue.d.ts} +1 -1
  148. package/dist/types.d.ts +5 -5
  149. package/dist/use-copy-to-clipboard-B6wH6hDd.js +2 -0
  150. package/dist/use-copy-to-clipboard-B6wH6hDd.js.map +1 -0
  151. package/dist/{use-prefers-reduced-motion-BiG6QGkf.js → use-prefers-reduced-motion-BcwST13S.js} +1 -1
  152. package/dist/{use-prefers-reduced-motion-BiG6QGkf.js.map → use-prefers-reduced-motion-BcwST13S.js.map} +1 -1
  153. package/dist/utils.d.ts +2 -2
  154. package/dist/utils.js +1 -1
  155. package/dist/{variant-props-UE-phTwh.d.ts → variant-props-Bm6Y-jfm.d.ts} +2 -2
  156. package/dist/{with-style-props-D1QFTzj6.d.ts → with-style-props-9-k1s4ov.d.ts} +1 -1
  157. package/package.json +19 -16
  158. package/dist/button-CdPMhyKg.js +0 -2
  159. package/dist/button-CdPMhyKg.js.map +0 -1
  160. package/dist/icon-button-CeeHZOhh.js +0 -2
  161. package/dist/icon-button-CeeHZOhh.js.map +0 -1
  162. package/dist/table-bSFWy29w.js +0 -2
  163. package/dist/table-bSFWy29w.js.map +0 -1
  164. package/dist/use-copy-to-clipboard-BCpEp-sO.js +0 -2
  165. package/dist/use-copy-to-clipboard-BCpEp-sO.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-BKykcpgJ.js","names":["clsx"],"sources":["../src/components/button/button.tsx"],"sourcesContent":["import { CircleNotchIcon } from \"@phosphor-icons/react/CircleNotch\";\nimport { cva } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { Children, cloneElement, forwardRef, isValidElement } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { parseBooleanish } from \"../../types/index.js\";\nimport type { VariantProps } from \"../../types/variant-props.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/index.js\";\nimport { Slot } from \"../slot/index.js\";\n\nconst buttonVariants = cva(\"\", {\n\tvariants: {\n\t\t/**\n\t\t * Defines the visual style of the Button.\n\t\t */\n\t\tappearance: {\n\t\t\tfilled:\n\t\t\t\t\"bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover h-9 border border-transparent px-3 text-sm font-medium\",\n\t\t\tghost:\n\t\t\t\t\"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border border-transparent px-3 text-sm font-medium\",\n\t\t\toutlined:\n\t\t\t\t\"border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border px-3 text-sm font-medium\",\n\t\t\tlink: \"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent\",\n\t\t},\n\t\t/**\n\t\t * Whether or not the button is in a loading state, default `false`. Setting `isLoading` will\n\t\t * replace any `icon` with a spinner, or add one if an icon wasn't given.\n\t\t * It will also disable user interaction with the button and set `disabled`.\n\t\t */\n\t\tisLoading: {\n\t\t\tfalse: \"\",\n\t\t\ttrue: \"opacity-50\",\n\t\t},\n\t\t/**\n\t\t * Indicates the importance or impact level of the button, affecting its\n\t\t * color and styling to communicate its purpose to the user\n\t\t */\n\t\tpriority: {\n\t\t\tdanger: \"\",\n\t\t\tdefault: \"\",\n\t\t\tneutral: \"\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tappearance: \"outlined\",\n\t\tisLoading: false,\n\t\tpriority: \"default\",\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tappearance: \"ghost\",\n\t\t\tpriority: \"danger\",\n\t\t\tclass:\n\t\t\t\t\"text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"outlined\",\n\t\t\tpriority: \"danger\",\n\t\t\tclass:\n\t\t\t\t\"border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"filled\",\n\t\t\tpriority: \"danger\",\n\t\t\tclass:\n\t\t\t\t\"bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"link\",\n\t\t\tpriority: \"danger\",\n\t\t\tclass: \"text-danger-600 focus-visible:ring-focus-danger\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"ghost\",\n\t\t\tpriority: \"neutral\",\n\t\t\tclass:\n\t\t\t\t\"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"outlined\",\n\t\t\tpriority: \"neutral\",\n\t\t\tclass:\n\t\t\t\t\"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"filled\",\n\t\t\tpriority: \"neutral\",\n\t\t\tclass:\n\t\t\t\t\"bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50\",\n\t\t},\n\t\t{\n\t\t\tappearance: \"link\",\n\t\t\tpriority: \"neutral\",\n\t\t\tclass: \"text-strong focus-visible:ring-focus-accent\",\n\t\t},\n\t],\n});\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>;\n\ntype ButtonAppearance = Pick<ButtonVariants, \"appearance\">[\"appearance\"];\ntype ButtonPriority = Pick<ButtonVariants, \"priority\">[\"priority\"];\n\n/**\n * The props for the `Button` component.\n */\ntype ButtonProps = ComponentProps<\"button\"> &\n\tButtonVariants & {\n\t\t/**\n\t\t * An icon to render inside the button. If the `state` is `\"pending\"`, then\n\t\t * the icon will automatically be replaced with a spinner.\n\t\t */\n\t\ticon?: ReactNode;\n\t\t/**\n\t\t * The side that the icon will render on, if one is present. If `state=\"pending\"`,\n\t\t * then the loading icon will also render on this side.\n\t\t * @default \"start\"\n\t\t */\n\t\ticonPlacement?: \"start\" | \"end\";\n\t} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Use the `asChild` prop to compose Radix's functionality onto alternative\n\t\t\t\t * element types or your own React components.\n\t\t\t\t *\n\t\t\t\t * When `asChild` is set to `true`, mantle will not render a default DOM\n\t\t\t\t * element, instead cloning the component's child and passing it the props and\n\t\t\t\t * behavior required to make it functional.\n\t\t\t\t *\n\t\t\t\t * asChild can be used as deeply as you need to. This means it is a great way\n\t\t\t\t * to compose multiple primitive's behavior together.\n\t\t\t\t *\n\t\t\t\t * @see https://www.radix-ui.com/docs/primitives/guides/composition#composition\n\t\t\t\t */\n\t\t\t\tasChild: true;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype?: ComponentProps<\"button\">[\"type\"];\n\t\t }\n\t\t| {\n\t\t\t\tasChild?: false | undefined;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype: Exclude<ComponentProps<\"button\">[\"type\"], undefined>;\n\t\t }\n\t);\n\n/**\n * Renders a button or a component that looks like a button, an interactive\n * element activated by a user with a mouse, keyboard, finger, voice command, or\n * other assistive technology. Once activated, it then performs an action, such\n * as submitting a form or opening a dialog.\n *\n * @see https://mantle.ngrok.com/components/button\n *\n * @example\n * ```tsx\n * <Button type=\"button\" appearance=\"filled\" priority=\"default\">\n * Click me\n * </Button>\n * ```\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tappearance = \"outlined\",\n\t\t\tasChild,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled: _disabled,\n\t\t\ticon: propIcon,\n\t\t\ticonPlacement = \"start\",\n\t\t\tisLoading = false,\n\t\t\tpriority = \"default\",\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst disabled = parseBooleanish(_ariaDisabled ?? _disabled ?? isLoading);\n\t\tconst icon = isLoading ? <CircleNotchIcon className=\"animate-spin\" /> : propIcon;\n\n\t\t/**\n\t\t * If the button has an icon and is not a link, add padding-start or padding-end to the button depending on the icon placement.\n\t\t */\n\t\tconst hasSpecialIconPadding = icon && appearance !== \"link\";\n\n\t\tconst buttonProps = {\n\t\t\t\"aria-disabled\": disabled,\n\t\t\tclassName: cx(\n\t\t\t\t\"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md\",\n\t\t\t\t\"focus:outline-hidden focus-visible:ring-4\",\n\t\t\t\t\"disabled:cursor-default disabled:opacity-50\",\n\t\t\t\t\"not-disabled:active:scale-97 ease-out transition-transform duration-150\",\n\t\t\t\tbuttonVariants({ appearance, priority, isLoading }),\n\t\t\t\tappearance !== \"link\" && \"font-sans\", // only enforce font-sans on non-link button appearances\n\t\t\t\thasSpecialIconPadding && iconPlacement === \"start\" && \"ps-2.5\",\n\t\t\t\thasSpecialIconPadding && iconPlacement === \"end\" && \"pe-2.5\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\t\"data-appearance\": appearance,\n\t\t\t\"data-disabled\": disabled,\n\t\t\t\"data-loading\": isLoading,\n\t\t\t\"data-priority\": priority,\n\t\t\tdisabled,\n\t\t\tref,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tinvariant(\n\t\t\t\tisValidElement<{ children?: ReactNode }>(children) && Children.only(children),\n\t\t\t\t\"When using `asChild`, Button must be passed a single child as a JSX tag.\",\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<Slot {...buttonProps}>\n\t\t\t\t\t{cloneElement(\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{icon && (\n\t\t\t\t\t\t\t\t<Icon svg={icon} className={clsx(iconPlacement === \"end\" && \"order-last\")} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children.props.children}\n\t\t\t\t\t\t</>,\n\t\t\t\t\t)}\n\t\t\t\t</Slot>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button {...buttonProps} type={type}>\n\t\t\t\t{icon && <Icon svg={icon} className={clsx(iconPlacement === \"end\" && \"order-last\")} />}\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = \"Button\";\n\nexport {\n\t//,\n\tButton,\n};\n\nexport type {\n\t//,\n\tButtonAppearance,\n\tButtonPriority,\n\tButtonProps,\n};\n"],"mappings":"udAYA,MAAM,EAAiB,EAAI,GAAI,CAC9B,SAAU,CAIT,WAAY,CACX,OACC,+JACD,MACC,gLACD,SACC,4NACD,KAAM,oHACN,CAMD,UAAW,CACV,MAAO,GACP,KAAM,aACN,CAKD,SAAU,CACT,OAAQ,GACR,QAAS,GACT,QAAS,GACT,CACD,CACD,gBAAiB,CAChB,WAAY,WACZ,UAAW,GACX,SAAU,UACV,CACD,iBAAkB,CACjB,CACC,WAAY,QACZ,SAAU,SACV,MACC,4IACD,CACD,CACC,WAAY,WACZ,SAAU,SACV,MACC,wLACD,CACD,CACC,WAAY,SACZ,SAAU,SACV,MACC,gHACD,CACD,CACC,WAAY,OACZ,SAAU,SACV,MAAO,kDACP,CACD,CACC,WAAY,QACZ,SAAU,UACV,MACC,qIACD,CACD,CACC,WAAY,WACZ,SAAU,UACV,MACC,2PACD,CACD,CACC,WAAY,SACZ,SAAU,UACV,MACC,mIACD,CACD,CACC,WAAY,OACZ,SAAU,UACV,MAAO,8CACP,CACD,CACD,CAAC,CA0FI,EAAS,GAEb,CACC,gBAAiB,EACjB,aAAa,WACb,UACA,WACA,YACA,SAAU,EACV,KAAM,EACN,gBAAgB,QAChB,YAAY,GACZ,WAAW,UACX,OACA,GAAG,GAEJ,IACI,CACJ,IAAM,EAAW,EAAgB,GAAiB,GAAa,EAAU,CACnE,EAAO,EAAY,EAAC,EAAD,CAAiB,UAAU,eAAiB,CAAA,CAAG,EAKlE,EAAwB,GAAQ,IAAe,OAE/C,EAAc,CACnB,gBAAiB,EACjB,UAAW,EACV,+EACA,4CACA,8CACA,0EACA,EAAe,CAAE,aAAY,WAAU,YAAW,CAAC,CACnD,IAAe,QAAU,YACzB,GAAyB,IAAkB,SAAW,SACtD,GAAyB,IAAkB,OAAS,SACpD,EACA,CACD,kBAAmB,EACnB,gBAAiB,EACjB,eAAgB,EAChB,gBAAiB,EACjB,WACA,MACA,GAAG,EACH,CAwBD,OAtBI,GACH,EACC,EAAyC,EAAS,EAAI,EAAS,KAAK,EAAS,CAC7E,2EACA,CAGA,EAAC,EAAD,CAAM,GAAI,WACR,EACA,EACA,EAAE,CACF,EAAA,EAAA,CAAA,SAAA,CACE,GACA,EAAC,EAAD,CAAM,IAAK,EAAM,UAAWA,EAAK,IAAkB,OAAS,aAAa,CAAI,CAAA,CAE7E,EAAS,MAAM,SACd,CAAA,CAAA,CACH,CACK,CAAA,EAKR,EAAC,SAAD,CAAQ,GAAI,EAAmB,gBAA/B,CACE,GAAQ,EAAC,EAAD,CAAM,IAAK,EAAM,UAAWA,EAAK,IAAkB,OAAS,aAAa,CAAI,CAAA,CACrF,EACO,IAGX,CACD,EAAO,YAAc"}
@@ -1,16 +1,16 @@
1
- import { t as DeepNonNullable } from "./deep-non-nullable-BLM3Gz0I.js";
2
- import { t as VariantProps$1 } from "./variant-props-UE-phTwh.js";
3
- import * as react from "react";
1
+ import { t as DeepNonNullable } from "./deep-non-nullable-BBByg3-i.js";
2
+ import { t as VariantProps$1 } from "./variant-props-Bm6Y-jfm.js";
3
+ import * as _$react from "react";
4
4
  import { ComponentProps, ReactNode } from "react";
5
- import * as class_variance_authority0 from "class-variance-authority";
6
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+ import * as _$class_variance_authority0 from "class-variance-authority";
6
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
7
7
 
8
8
  //#region src/components/button/button.d.ts
9
9
  declare const buttonVariants: (props?: ({
10
10
  appearance?: "filled" | "link" | "ghost" | "outlined" | null | undefined;
11
11
  isLoading?: boolean | null | undefined;
12
12
  priority?: "default" | "danger" | "neutral" | null | undefined;
13
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
13
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
14
14
  type ButtonVariants = VariantProps$1<typeof buttonVariants>;
15
15
  /**
16
16
  * The props for the `Button` component.
@@ -90,11 +90,11 @@ type ButtonProps = ComponentProps<"button"> & ButtonVariants & {
90
90
  * </Button>
91
91
  * ```
92
92
  */
93
- declare const Button: react.ForwardRefExoticComponent<(Omit<react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & Partial<DeepNonNullable<class_variance_authority0.VariantProps<(props?: ({
93
+ declare const Button: _$react.ForwardRefExoticComponent<(Omit<_$react.ClassAttributes<HTMLButtonElement> & _$react.ButtonHTMLAttributes<HTMLButtonElement> & Partial<DeepNonNullable<_$class_variance_authority0.VariantProps<(props?: ({
94
94
  appearance?: "filled" | "link" | "ghost" | "outlined" | null | undefined;
95
95
  isLoading?: boolean | null | undefined;
96
96
  priority?: "default" | "danger" | "neutral" | null | undefined;
97
- } & class_variance_authority_types0.ClassProp) | undefined) => string>>> & {
97
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string>>> & {
98
98
  /**
99
99
  * An icon to render inside the button. If the `state` is `"pending"`, then
100
100
  * the icon will automatically be replaced with a spinner.
@@ -136,11 +136,11 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<react.ClassAttribute
136
136
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type
137
137
  */
138
138
  type?: ComponentProps<"button">["type"];
139
- }, "ref"> | Omit<react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & Partial<DeepNonNullable<class_variance_authority0.VariantProps<(props?: ({
139
+ }, "ref"> | Omit<_$react.ClassAttributes<HTMLButtonElement> & _$react.ButtonHTMLAttributes<HTMLButtonElement> & Partial<DeepNonNullable<_$class_variance_authority0.VariantProps<(props?: ({
140
140
  appearance?: "filled" | "link" | "ghost" | "outlined" | null | undefined;
141
141
  isLoading?: boolean | null | undefined;
142
142
  priority?: "default" | "danger" | "neutral" | null | undefined;
143
- } & class_variance_authority_types0.ClassProp) | undefined) => string>>> & {
143
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string>>> & {
144
144
  /**
145
145
  * An icon to render inside the button. If the `state` is `"pending"`, then
146
146
  * the icon will automatically be replaced with a spinner.
@@ -169,7 +169,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<react.ClassAttribute
169
169
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type
170
170
  */
171
171
  type: Exclude<ComponentProps<"button">["type"], undefined>;
172
- }, "ref">) & react.RefAttributes<HTMLButtonElement>>;
172
+ }, "ref">) & _$react.RefAttributes<HTMLButtonElement>>;
173
173
  //#endregion
174
174
  export { ButtonProps as n, Button as t };
175
- //# sourceMappingURL=button-ByK1wG1b.d.ts.map
175
+ //# sourceMappingURL=button-BaNwe1ud.d.ts.map
package/dist/button.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as IconButtonProps, t as IconButton } from "./icon-button-2r6S3HVA.js";
2
- import { n as ButtonProps, t as Button } from "./button-ByK1wG1b.js";
3
- import { n as ButtonGroupProps, t as ButtonGroup } from "./index-ViSCOUrU.js";
1
+ import { n as IconButtonProps, t as IconButton } from "./icon-button-gO-7F_MZ.js";
2
+ import { n as ButtonProps, t as Button } from "./button-BaNwe1ud.js";
3
+ import { n as ButtonGroupProps, t as ButtonGroup } from "./index-Cj2NX2Dg.js";
4
4
  export { Button, ButtonGroup, ButtonGroupProps, ButtonProps, IconButton, IconButtonProps };
package/dist/button.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./icon-button-CeeHZOhh.js";import{t}from"./button-CdPMhyKg.js";import{t as n}from"./button-eAPtlsYO.js";export{t as Button,n as ButtonGroup,e as IconButton};
1
+ import{t as e}from"./icon-button-CxxVPiKp.js";import{t}from"./button-BKykcpgJ.js";import{t as n}from"./button-eAPtlsYO.js";export{t as Button,n as ButtonGroup,e as IconButton};
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { DateRange, DayPicker } from "react-day-picker";
4
4
 
5
5
  //#region src/components/calendar/calendar.d.ts
@@ -34,7 +34,7 @@ declare function Calendar({
34
34
  classNames,
35
35
  showOutsideDays,
36
36
  ...props
37
- }: CalendarProps): react_jsx_runtime0.JSX.Element;
37
+ }: CalendarProps): _$react_jsx_runtime0.JSX.Element;
38
38
  declare namespace Calendar {
39
39
  var displayName: string;
40
40
  }
package/dist/calendar.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./icon-BMH0fD_b.js";import{n,r}from"./icon-button-CeeHZOhh.js";import{jsx as i}from"react/jsx-runtime";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{DayPicker as s}from"react-day-picker";function c({className:c,classNames:l,showOutsideDays:u=!1,...d}){return i(s,{animate:!1,components:{Chevron:e=>i(t,{svg:e.orientation===`left`?i(a,{}):i(o,{}),className:`size-4`})},classNames:{root:e(`isolate`,c),button_next:e(n,r({appearance:`ghost`,size:`sm`}),`absolute right-0`),button_previous:e(n,r({appearance:`ghost`,size:`sm`}),`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,d.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,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`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...l},showOutsideDays:u,...d})}c.displayName=`Calendar`;export{c as Calendar};
1
+ import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./icon-BMH0fD_b.js";import{n,r}from"./icon-button-CxxVPiKp.js";import{jsx as i}from"react/jsx-runtime";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{DayPicker as s}from"react-day-picker";function c({className:c,classNames:l,showOutsideDays:u=!1,...d}){return i(s,{animate:!1,components:{Chevron:e=>i(t,{svg:e.orientation===`left`?i(a,{}):i(o,{}),className:`size-4`})},classNames:{root:e(`isolate`,c),button_next:e(n,r({appearance:`ghost`,size:`sm`}),`absolute right-0`),button_previous:e(n,r({appearance:`ghost`,size:`sm`}),`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,d.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,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`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...l},showOutsideDays:u,...d})}c.displayName=`Calendar`;export{c as Calendar};
2
2
  //# sourceMappingURL=calendar.js.map
package/dist/card.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as WithAsChild } from "./as-child-XMVTepJu.js";
2
- import * as react from "react";
1
+ import { t as WithAsChild } from "./as-child-CRRsxi3Y.js";
2
+ import * as _$react from "react";
3
3
  import { ComponentProps, HTMLAttributes } from "react";
4
4
 
5
5
  //#region src/components/card/card.d.ts
@@ -47,7 +47,7 @@ declare const Card: {
47
47
  * </Card.Root>
48
48
  * ```
49
49
  */
50
- readonly Root: react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
50
+ readonly Root: _$react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
51
51
  /**
52
52
  * The main content of a card.
53
53
  *
@@ -62,7 +62,7 @@ declare const Card: {
62
62
  * </Card.Root>
63
63
  * ```
64
64
  */
65
- readonly Body: react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
65
+ readonly Body: _$react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
66
66
  /**
67
67
  * The footer container of a card.
68
68
  *
@@ -83,7 +83,7 @@ declare const Card: {
83
83
  * </Card.Root>
84
84
  * ```
85
85
  */
86
- readonly Footer: react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
86
+ readonly Footer: _$react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
87
87
  /**
88
88
  * The header container of a card.
89
89
  *
@@ -104,7 +104,7 @@ declare const Card: {
104
104
  * </Card.Root>
105
105
  * ```
106
106
  */
107
- readonly Header: react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
107
+ readonly Header: _$react.ForwardRefExoticComponent<Omit<CardProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
108
108
  /**
109
109
  * The title of a card.
110
110
  *
@@ -125,7 +125,7 @@ declare const Card: {
125
125
  * </Card.Root>
126
126
  * ```
127
127
  */
128
- readonly Title: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & WithAsChild & react.RefAttributes<HTMLHeadingElement>>;
128
+ readonly Title: _$react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & WithAsChild & _$react.RefAttributes<HTMLHeadingElement>>;
129
129
  };
130
130
  //#endregion
131
131
  export { Card, type CardProps, type CardTitleProps };
@@ -1,5 +1,5 @@
1
- import { o as WithValidation } from "./types-DgXUgkpc.js";
2
- import * as react from "react";
1
+ import { o as WithValidation } from "./types-Cq6RWU7Q.js";
2
+ import * as _$react from "react";
3
3
 
4
4
  //#region src/components/checkbox/checkbox.d.ts
5
5
  type CheckedState = boolean | "indeterminate";
@@ -19,7 +19,7 @@ type CheckedState = boolean | "indeterminate";
19
19
  * </form>
20
20
  * ```
21
21
  */
22
- declare const Checkbox: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "defaultChecked" | "checked"> & WithValidation & {
22
+ declare const Checkbox: _$react.ForwardRefExoticComponent<Omit<Omit<_$react.DetailedHTMLProps<_$react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "defaultChecked" | "type" | "checked"> & WithValidation & {
23
23
  /**
24
24
  * The controlled checked state of the checkbox. Must be used in conjunction with onChange.
25
25
  */
@@ -28,7 +28,7 @@ declare const Checkbox: react.ForwardRefExoticComponent<Omit<Omit<react.Detailed
28
28
  * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
29
29
  */
30
30
  defaultChecked?: CheckedState;
31
- } & react.RefAttributes<HTMLInputElement>>;
31
+ } & _$react.RefAttributes<HTMLInputElement>>;
32
32
  //#endregion
33
33
  export { Checkbox };
34
34
  //# sourceMappingURL=checkbox.d.ts.map
package/dist/checkbox.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./compose-refs-DeIsFv68.js";import{forwardRef as t,useEffect as n,useRef as r,useState as i}from"react";import a from"clsx";import{jsx as o}from"react/jsx-runtime";const s=e=>e===`indeterminate`,c=t(({"aria-invalid":t,className:c,checked:l,defaultChecked:u,defaultValue:d=`on`,onClick:f,readOnly:p,validation:m,...h},g)=>{let _=r(null),[v]=i(u),y=t!=null&&t!==`false`?`error`:typeof m==`function`?m():m,b=t??y===`error`;return n(()=>{_.current&&(_.current.indeterminate=s(l))},[l]),n(()=>{_.current&&(_.current.indeterminate=s(v))},[v]),o(`input`,{"aria-checked":s(l)?`mixed`:l,"aria-invalid":b,className:a(`border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50`,`bg-center bg-no-repeat focus:outline-hidden`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`checked:border-accent-500 checked:bg-accent-500 checked:bg-checked-icon`,`indeterminate:border-accent-500 indeterminate:bg-accent-500 indeterminate:bg-indeterminate-icon`,`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`,`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`,`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`,`where:block where:size-4 where:p-0`,c),checked:s(l)?void 0:l,"data-validation":y||void 0,defaultChecked:s(v)?void 0:v,defaultValue:d,onClick:e=>{if(p){e.preventDefault();return}f?.(e)},readOnly:p,ref:e(_,g),type:`checkbox`,...h})});c.displayName=`Checkbox`;export{c as Checkbox};
1
+ import{t as e}from"./compose-refs-DeIsFv68.js";import{forwardRef as t,useEffect as n,useRef as r,useState as i}from"react";import a from"clsx";import{jsx as o}from"react/jsx-runtime";const s=e=>e===`indeterminate`,c=t(({"aria-invalid":t,className:c,checked:l,defaultChecked:u,defaultValue:d=`on`,onClick:f,readOnly:p,validation:m,...h},g)=>{let _=r(null),[v]=i(u),y=t!=null&&t!==`false`?`error`:typeof m==`function`?m():m,b=t??y===`error`;return n(()=>{_.current&&(_.current.indeterminate=s(l))},[l]),n(()=>{_.current&&(_.current.indeterminate=s(v))},[v]),o(`input`,{"aria-checked":s(l)?`mixed`:l,"aria-invalid":b,className:a(`border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50`,`bg-center bg-no-repeat focus:outline-hidden`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`checked:border-accent-600 checked:bg-accent-600 checked:bg-checked-icon`,`indeterminate:border-accent-600 indeterminate:bg-accent-600 indeterminate:bg-indeterminate-icon`,`data-validation-success:border-success-600 data-validation-success:checked:bg-success-600 data-validation-success:indeterminate:bg-success-600 focus-visible:data-validation-success:border-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:checked:bg-warning-600 data-validation-warning:indeterminate:bg-warning-600 focus-visible:data-validation-warning:border-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:checked:bg-danger-600 data-validation-error:indeterminate:bg-danger-600 focus-visible:data-validation-error:border-danger-600 focus-visible:data-validation-error:ring-focus-danger`,`where:block where:size-4 where:p-0`,c),checked:s(l)?void 0:l,"data-validation":y||void 0,defaultChecked:s(v)?void 0:v,defaultValue:d,onClick:e=>{if(p){e.preventDefault();return}f?.(e)},readOnly:p,ref:e(_,g),type:`checkbox`,...h})});c.displayName=`Checkbox`;export{c as Checkbox};
2
2
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["clsx"],"sources":["../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport clsx from \"clsx\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } 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\" =>\n\tchecked === \"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 * Supports indeterminate state.\n *\n * @see https://mantle.ngrok.com/components/checkbox\n *\n * @example\n * ```tsx\n * <form>\n * <Label htmlFor=\"terms\" className=\"flex items-center gap-2\">\n * <Checkbox name=\"terms\" id=\"terms\" />\n * Accept terms and conditions\n * </Label>\n * </form>\n * ```\n */\nconst Checkbox = forwardRef<ComponentRef<\"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<ComponentRef<\"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-hidden\",\n\t\t\t\t\t\"focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden 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"],"mappings":"uLAUA,MAAM,EAAmB,GACxB,IAAY,gBA8BP,EAAW,GAEf,CACC,eAAgB,EAChB,YACA,QAAS,EACT,eAAgB,EAChB,eAAe,KACf,UACA,WACA,WAAY,EACZ,GAAG,GAEJ,IACI,CACJ,IAAM,EAAW,EAA8B,KAAK,CAC9C,CAAC,GAAkB,EAAS,EAAgB,CAE5C,EADY,GAAgB,MAAQ,IAAiB,QAExD,QACA,OAAO,GAAgB,WACtB,GAAa,CACb,EACE,EAAc,GAAgB,IAAe,QAcnD,OAZA,MAAgB,CACX,EAAS,UACZ,EAAS,QAAQ,cAAgB,EAAgB,EAAS,GAEzD,CAAC,EAAS,CAAC,CAEd,MAAgB,CACX,EAAS,UACZ,EAAS,QAAQ,cAAgB,EAAgB,EAAe,GAE/D,CAAC,EAAe,CAAC,CAGnB,EAAC,QAAD,CACC,eAAc,EAAgB,EAAS,CAAG,QAAU,EACpD,eAAc,EACd,UAAWA,EACV,qIACA,8CACA,oHACA,0EACA,kGACA,mQACA,mQACA,oPACA,qCACA,EACA,CACD,QAAS,EAAgB,EAAS,CAAG,IAAA,GAAY,EACjD,kBAAiB,GAAc,IAAA,GAC/B,eAAgB,EAAgB,EAAe,CAAG,IAAA,GAAY,EAChD,eACd,QAAU,GAAU,CACnB,GAAI,EAAU,CACb,EAAM,gBAAgB,CACtB,OAED,IAAU,EAAM,EAEP,WACV,IAAK,EAAY,EAAU,EAAI,CAC/B,KAAK,WACL,GAAI,EACH,CAAA,EAGJ,CACD,EAAS,YAAc"}
1
+ {"version":3,"file":"checkbox.js","names":["clsx"],"sources":["../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport clsx from \"clsx\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } 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\" =>\n\tchecked === \"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 * Supports indeterminate state.\n *\n * @see https://mantle.ngrok.com/components/checkbox\n *\n * @example\n * ```tsx\n * <form>\n * <Label htmlFor=\"terms\" className=\"flex items-center gap-2\">\n * <Checkbox name=\"terms\" id=\"terms\" />\n * Accept terms and conditions\n * </Label>\n * </form>\n * ```\n */\nconst Checkbox = forwardRef<ComponentRef<\"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<ComponentRef<\"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-hidden\",\n\t\t\t\t\t\"focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4\",\n\t\t\t\t\t\"checked:border-accent-600 checked:bg-accent-600 checked:bg-checked-icon\",\n\t\t\t\t\t\"indeterminate:border-accent-600 indeterminate:bg-accent-600 indeterminate:bg-indeterminate-icon\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:checked:bg-success-600 data-validation-success:indeterminate:bg-success-600 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-600 data-validation-warning:indeterminate:bg-warning-600 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-600 data-validation-error:indeterminate:bg-danger-600 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"],"mappings":"uLAUA,MAAM,EAAmB,GACxB,IAAY,gBA8BP,EAAW,GAEf,CACC,eAAgB,EAChB,YACA,QAAS,EACT,eAAgB,EAChB,eAAe,KACf,UACA,WACA,WAAY,EACZ,GAAG,GAEJ,IACI,CACJ,IAAM,EAAW,EAA8B,KAAK,CAC9C,CAAC,GAAkB,EAAS,EAAgB,CAE5C,EADY,GAAgB,MAAQ,IAAiB,QAExD,QACA,OAAO,GAAgB,WACtB,GAAa,CACb,EACE,EAAc,GAAgB,IAAe,QAcnD,OAZA,MAAgB,CACX,EAAS,UACZ,EAAS,QAAQ,cAAgB,EAAgB,EAAS,GAEzD,CAAC,EAAS,CAAC,CAEd,MAAgB,CACX,EAAS,UACZ,EAAS,QAAQ,cAAgB,EAAgB,EAAe,GAE/D,CAAC,EAAe,CAAC,CAGnB,EAAC,QAAD,CACC,eAAc,EAAgB,EAAS,CAAG,QAAU,EACpD,eAAc,EACd,UAAWA,EACV,qIACA,8CACA,oHACA,0EACA,kGACA,mQACA,mQACA,oPACA,qCACA,EACA,CACD,QAAS,EAAgB,EAAS,CAAG,IAAA,GAAY,EACjD,kBAAiB,GAAc,IAAA,GAC/B,eAAgB,EAAgB,EAAe,CAAG,IAAA,GAAY,EAChD,eACd,QAAU,GAAU,CACnB,GAAI,EAAU,CACb,EAAM,gBAAgB,CACtB,OAED,IAAU,EAAM,EAEP,WACV,IAAK,EAAY,EAAU,EAAI,CAC/B,KAAK,WACL,GAAI,EACH,CAAA,EAGJ,CACD,EAAS,YAAc"}