@cerberus-design/react 0.18.3 → 0.18.4

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 (160) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +87 -25
  2. package/build/legacy/components/FileStatus.cjs +34 -26
  3. package/build/legacy/components/FileStatus.cjs.map +1 -1
  4. package/build/legacy/components/Text.cjs +17 -23
  5. package/build/legacy/components/Text.cjs.map +1 -1
  6. package/build/legacy/components/checkbox/checkbox.cjs +17 -23
  7. package/build/legacy/components/checkbox/checkbox.cjs.map +1 -1
  8. package/build/legacy/components/checkbox/index.cjs +17 -23
  9. package/build/legacy/components/checkbox/index.cjs.map +1 -1
  10. package/build/legacy/components/cta-dialog/index.cjs +44 -35
  11. package/build/legacy/components/cta-dialog/index.cjs.map +1 -1
  12. package/build/legacy/components/cta-dialog/provider.cjs +44 -35
  13. package/build/legacy/components/cta-dialog/provider.cjs.map +1 -1
  14. package/build/legacy/components/date-picker/date-picker.cjs.map +1 -1
  15. package/build/legacy/components/date-picker/day-view.d.cts +1 -1
  16. package/build/legacy/components/date-picker/index.cjs +29 -21
  17. package/build/legacy/components/date-picker/index.cjs.map +1 -1
  18. package/build/legacy/components/date-picker/index.d.cts +6 -0
  19. package/build/legacy/components/date-picker/input.cjs +2 -2
  20. package/build/legacy/components/date-picker/input.cjs.map +1 -1
  21. package/build/legacy/components/date-picker/range-input.cjs +2 -9
  22. package/build/legacy/components/date-picker/range-input.cjs.map +1 -1
  23. package/build/legacy/components/deprecated/Label.cjs.map +1 -1
  24. package/build/legacy/components/dialog/close-icon-trigger.cjs.map +1 -1
  25. package/build/legacy/components/dialog/dialog.cjs +2 -2
  26. package/build/legacy/components/dialog/dialog.cjs.map +1 -1
  27. package/build/legacy/components/dialog/index.cjs +2 -2
  28. package/build/legacy/components/dialog/index.cjs.map +1 -1
  29. package/build/legacy/components/dialog/index.d.cts +1 -0
  30. package/build/legacy/components/dialog/parts.cjs +2 -2
  31. package/build/legacy/components/dialog/parts.cjs.map +1 -1
  32. package/build/legacy/components/dialog/primitives.cjs +2 -2
  33. package/build/legacy/components/dialog/primitives.cjs.map +1 -1
  34. package/build/legacy/components/field/field.cjs +15 -9
  35. package/build/legacy/components/field/field.cjs.map +1 -1
  36. package/build/legacy/components/field/helper-text.cjs +53 -0
  37. package/build/legacy/components/field/helper-text.cjs.map +1 -0
  38. package/build/legacy/components/field/helper-text.d.cts +1 -0
  39. package/build/legacy/components/field/index.cjs +15 -9
  40. package/build/legacy/components/field/index.cjs.map +1 -1
  41. package/build/legacy/components/field/parts.cjs +0 -1
  42. package/build/legacy/components/field/parts.cjs.map +1 -1
  43. package/build/legacy/components/field/primitives.cjs +0 -1
  44. package/build/legacy/components/field/primitives.cjs.map +1 -1
  45. package/build/legacy/context/confirm-modal.cjs +85 -58
  46. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  47. package/build/legacy/context/field.cjs.map +1 -1
  48. package/build/legacy/context/prompt-modal.cjs +120 -118
  49. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  50. package/build/legacy/index.cjs +767 -715
  51. package/build/legacy/index.cjs.map +1 -1
  52. package/build/legacy/index.d.cts +11 -0
  53. package/build/legacy/types.cjs.map +1 -1
  54. package/build/legacy/types.d.cts +1 -0
  55. package/build/modern/_tsup-dts-rollup.d.ts +87 -25
  56. package/build/modern/chunk-2U2JYN3D.js +15 -0
  57. package/build/modern/chunk-2U2JYN3D.js.map +1 -0
  58. package/build/modern/chunk-ADI4DOEW.js +17 -0
  59. package/build/modern/chunk-ADI4DOEW.js.map +1 -0
  60. package/build/modern/{chunk-GBCF6DOS.js → chunk-AN65HXHS.js} +2 -2
  61. package/build/modern/{chunk-Z2KBUTCO.js → chunk-BMDNCJUB.js} +2 -2
  62. package/build/modern/chunk-BMDNCJUB.js.map +1 -0
  63. package/build/modern/{chunk-F3XFJHGR.js → chunk-D7PY357P.js} +2 -2
  64. package/build/modern/{chunk-ILROS7ST.js → chunk-DVCTN3GN.js} +2 -2
  65. package/build/modern/{chunk-NP73HOHI.js → chunk-GJBUGESH.js} +3 -3
  66. package/build/modern/{chunk-NP73HOHI.js.map → chunk-GJBUGESH.js.map} +1 -1
  67. package/build/modern/{chunk-KABRV6TB.js → chunk-JXWNDJJW.js} +3 -3
  68. package/build/modern/{chunk-SSR3CWJZ.js → chunk-LUGOJGMO.js} +4 -4
  69. package/build/modern/chunk-LUGOJGMO.js.map +1 -0
  70. package/build/modern/{chunk-3IT3V3YA.js → chunk-M3TZCQ7J.js} +4 -4
  71. package/build/modern/{chunk-WEL43I6Y.js → chunk-OK3VJFQL.js} +1 -2
  72. package/build/modern/{chunk-WEL43I6Y.js.map → chunk-OK3VJFQL.js.map} +1 -1
  73. package/build/modern/{chunk-ADZRQNW3.js → chunk-P7FPAUWN.js} +3 -9
  74. package/build/modern/chunk-P7FPAUWN.js.map +1 -0
  75. package/build/modern/{chunk-OY7BOKWW.js → chunk-QBA6KLL7.js} +2 -2
  76. package/build/modern/chunk-RMSM3XPV.js +218 -0
  77. package/build/modern/chunk-RMSM3XPV.js.map +1 -0
  78. package/build/modern/{chunk-LEBDLXJE.js → chunk-RTLS6K4E.js} +9 -6
  79. package/build/modern/chunk-RTLS6K4E.js.map +1 -0
  80. package/build/modern/{chunk-A5UXCB4L.js → chunk-SHBKM6EW.js} +43 -34
  81. package/build/modern/chunk-SHBKM6EW.js.map +1 -0
  82. package/build/modern/{chunk-CEJIKL6N.js → chunk-T44C3KQO.js} +1 -1
  83. package/build/modern/chunk-T44C3KQO.js.map +1 -0
  84. package/build/modern/{chunk-V6EAWUCQ.js → chunk-TRT6OCHJ.js} +2 -2
  85. package/build/modern/chunk-WSOITM7D.js +182 -0
  86. package/build/modern/chunk-WSOITM7D.js.map +1 -0
  87. package/build/modern/chunk-ZPHPCKAG.js +41 -0
  88. package/build/modern/chunk-ZPHPCKAG.js.map +1 -0
  89. package/build/modern/components/FileStatus.js +5 -4
  90. package/build/modern/components/Text.js +1 -1
  91. package/build/modern/components/admonition/admonition.js +2 -2
  92. package/build/modern/components/admonition/index.js +2 -2
  93. package/build/modern/components/checkbox/checkbox.js +2 -2
  94. package/build/modern/components/checkbox/index.js +2 -2
  95. package/build/modern/components/cta-dialog/index.js +5 -5
  96. package/build/modern/components/cta-dialog/provider.js +5 -5
  97. package/build/modern/components/date-picker/date-picker.js +1 -1
  98. package/build/modern/components/date-picker/day-view.d.ts +1 -1
  99. package/build/modern/components/date-picker/index.d.ts +6 -0
  100. package/build/modern/components/date-picker/index.js +16 -5
  101. package/build/modern/components/date-picker/input.js +1 -1
  102. package/build/modern/components/date-picker/range-input.js +1 -2
  103. package/build/modern/components/deprecated/Label.js +5 -4
  104. package/build/modern/components/dialog/close-icon-trigger.js +2 -2
  105. package/build/modern/components/dialog/dialog.js +2 -2
  106. package/build/modern/components/dialog/index.d.ts +1 -0
  107. package/build/modern/components/dialog/index.js +4 -4
  108. package/build/modern/components/dialog/parts.js +2 -2
  109. package/build/modern/components/dialog/primitives.js +1 -1
  110. package/build/modern/components/field/field.js +3 -2
  111. package/build/modern/components/field/helper-text.d.ts +1 -0
  112. package/build/modern/components/field/helper-text.js +11 -0
  113. package/build/modern/components/field/index.js +4 -3
  114. package/build/modern/components/field/parts.js +2 -2
  115. package/build/modern/components/field/primitives.js +1 -1
  116. package/build/modern/components/notifications/index.js +1 -1
  117. package/build/modern/context/confirm-modal.js +5 -5
  118. package/build/modern/context/field.js +1 -1
  119. package/build/modern/context/prompt-modal.js +10 -9
  120. package/build/modern/index.d.ts +11 -0
  121. package/build/modern/index.js +52 -40
  122. package/build/modern/index.js.map +1 -1
  123. package/build/modern/types.d.ts +1 -0
  124. package/package.json +10 -9
  125. package/src/components/Text.tsx +20 -23
  126. package/src/components/cta-dialog/provider.tsx +6 -1
  127. package/src/components/date-picker/date-picker.tsx +8 -5
  128. package/src/components/date-picker/index.ts +10 -0
  129. package/src/components/date-picker/input.tsx +1 -1
  130. package/src/components/date-picker/range-input.tsx +9 -24
  131. package/src/components/dialog/dialog.tsx +4 -2
  132. package/src/components/dialog/index.ts +4 -0
  133. package/src/components/dialog/primitives.tsx +7 -4
  134. package/src/components/field/field.tsx +11 -9
  135. package/src/components/field/helper-text.tsx +20 -0
  136. package/src/components/field/primitives.tsx +0 -3
  137. package/src/context/confirm-modal.tsx +52 -30
  138. package/src/context/prompt-modal.tsx +36 -31
  139. package/src/types.ts +21 -0
  140. package/build/modern/chunk-A5UXCB4L.js.map +0 -1
  141. package/build/modern/chunk-ADZRQNW3.js.map +0 -1
  142. package/build/modern/chunk-CEJIKL6N.js.map +0 -1
  143. package/build/modern/chunk-DHKSNGQX.js +0 -156
  144. package/build/modern/chunk-DHKSNGQX.js.map +0 -1
  145. package/build/modern/chunk-L64HQGLQ.js +0 -47
  146. package/build/modern/chunk-L64HQGLQ.js.map +0 -1
  147. package/build/modern/chunk-LEBDLXJE.js.map +0 -1
  148. package/build/modern/chunk-P7DWMM56.js +0 -210
  149. package/build/modern/chunk-P7DWMM56.js.map +0 -1
  150. package/build/modern/chunk-SSR3CWJZ.js.map +0 -1
  151. package/build/modern/chunk-U3ISYEUF.js +0 -1
  152. package/build/modern/chunk-Z2KBUTCO.js.map +0 -1
  153. /package/build/modern/{chunk-GBCF6DOS.js.map → chunk-AN65HXHS.js.map} +0 -0
  154. /package/build/modern/{chunk-F3XFJHGR.js.map → chunk-D7PY357P.js.map} +0 -0
  155. /package/build/modern/{chunk-ILROS7ST.js.map → chunk-DVCTN3GN.js.map} +0 -0
  156. /package/build/modern/{chunk-KABRV6TB.js.map → chunk-JXWNDJJW.js.map} +0 -0
  157. /package/build/modern/{chunk-3IT3V3YA.js.map → chunk-M3TZCQ7J.js.map} +0 -0
  158. /package/build/modern/{chunk-OY7BOKWW.js.map → chunk-QBA6KLL7.js.map} +0 -0
  159. /package/build/modern/{chunk-V6EAWUCQ.js.map → chunk-TRT6OCHJ.js.map} +0 -0
  160. /package/build/modern/{chunk-U3ISYEUF.js.map → components/field/helper-text.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/dialog/dialog.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from 'styled-system/recipes'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n","import { Portal as ArkPortal, type PortalProps } from '@ark-ui/react'\nimport type { PropsWithChildren } from 'react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type { PortalProps }\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n return <ArkPortal {...props} />\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;;;ACAA,mBAAsD;AA6B7C;AADF,SAAS,OAAO,OAAuC;AAC5D,SAAO,4CAAC,aAAAC,QAAA,EAAW,GAAG,OAAO;AAC/B;;;AC9BA,oBASO;AACP,iBAAmB;AACnB,qBAAgD;AAWvC,IAAAC,sBAAA;AAmBF,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;;;AF3CI,IAAAC,sBAAA;AAFG,SAASC,QAAO,OAAoB;AACzC,SACE,8CAAC,UACC;AAAA,iDAAC,kBAAe;AAAA,IAChB,6CAAC,oBACC,uDAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":["Dialog","ArkPortal","import_jsx_runtime","import_jsx_runtime","Dialog"]}
1
+ {"version":3,"sources":["../../../../src/components/dialog/dialog.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size' | 'style'>,\n DialogVariantProps,\n WithCss {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n","import { Portal as ArkPortal, type PortalProps } from '@ark-ui/react'\nimport type { PropsWithChildren } from 'react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type { PortalProps }\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n return <ArkPortal {...props} />\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { css, cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(\n props: DialogContentProps & DialogVariantProps & WithCss,\n) {\n const { size, css: customStyles, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, css(customStyles), contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;;;ACAA,mBAAsD;AA6B7C;AADF,SAAS,OAAO,OAAuC;AAC5D,SAAO,4CAAC,aAAAC,QAAA,EAAW,GAAG,OAAO;AAC/B;;;AC9BA,oBASO;AACP,iBAAwB;AACxB,qBAAgD;AAYvC,IAAAC,sBAAA;AAmBF,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cACd,OACA;AACA,QAAM,EAAE,MAAM,KAAK,cAAc,GAAG,aAAa,IAAI;AACrD,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,aAAS,gBAAI,YAAY,GAAG,aAAa,SAAS;AAAA;AAAA,EACzE;AAEJ;;;AF5CI,IAAAC,sBAAA;AAFG,SAASC,QAAO,OAAoB;AACzC,SACE,8CAAC,UACC;AAAA,iDAAC,kBAAe;AAAA,IAChB,6CAAC,oBACC,uDAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":["Dialog","ArkPortal","import_jsx_runtime","import_jsx_runtime","Dialog"]}
@@ -74,13 +74,13 @@ function DialogPositioner(props) {
74
74
  );
75
75
  }
76
76
  function DialogContent(props) {
77
- const { size, ...contentProps } = props;
77
+ const { size, css: customStyles, ...contentProps } = props;
78
78
  const styles = (0, import_recipes.dialog)({ size });
79
79
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
80
  import_dialog.Dialog.Content,
81
81
  {
82
82
  ...contentProps,
83
- className: (0, import_css.cx)(styles.content, contentProps.className)
83
+ className: (0, import_css.cx)(styles.content, (0, import_css.css)(customStyles), contentProps.className)
84
84
  }
85
85
  );
86
86
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/dialog/index.ts","../../../../src/components/dialog/primitives.tsx","../../../../src/components/dialog/parts.ts","../../../../src/context/cerberus.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/dialog/close-icon-trigger.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/dialog.tsx"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './close-icon-trigger'\nexport * from './dialog'\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n","import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import { ark, type HTMLArkProps } from '@ark-ui/react/factory'\nimport { cx } from 'styled-system/css'\nimport { iconButton, type IconButtonVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps extends HTMLArkProps<'button'> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps) {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <ark.button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport { type DialogCloseTriggerProps } from '@ark-ui/react/dialog'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { IconButton } from '../IconButton'\nimport { DialogCloseTrigger } from './primitives'\nimport { dialog } from 'styled-system/recipes'\nimport { cx } from 'styled-system/css'\n\n/**\n * This module contains the close trigger for the dialog.\n * @module react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const styles = dialog()\n\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n return (\n <DialogCloseTrigger\n {...props}\n className={cx(styles.closeTrigger, props.className)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </DialogCloseTrigger>\n )\n}\n","import { Portal as ArkPortal, type PortalProps } from '@ark-ui/react'\nimport type { PropsWithChildren } from 'react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type { PortalProps }\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n return <ArkPortal {...props} />\n}\n","import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from 'styled-system/recipes'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBASO;AACP,iBAAmB;AACnB,qBAAgD;AAWvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,4CAAC,qBAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AA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AW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;;;AC/BA,IAAAC,kBAAuB;AACvB,IAAAC,cAAmB;AAyBX,IAAAC,sBAAA;AAlBD,SAAS,uBAAuB,OAAgC;AACrE,QAAM,aAAS,wBAAO;AAEtB,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,gBAAG,OAAO,cAAc,MAAM,SAAS;AAAA,MAClD,SAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,uDAAC,aAAU;AAAA;AAAA,MACb;AAAA;AAAA,EACF;AAEJ;;;ACpCA,IAAAC,gBAAsD;AA6B7C,IAAAC,sBAAA;AADF,SAAS,OAAO,OAAuC;AAC5D,SAAO,6CAAC,cAAAC,QAAA,EAAW,GAAG,OAAO;AAC/B;;;ACGI,IAAAC,sBAAA;AAFG,SAASC,QAAO,OAAoB;AACzC,SACE,8CAAC,UACC;AAAA,iDAAC,kBAAe;AAAA,IAChB,6CAAC,oBACC,uDAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":["Dialog","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_recipes","import_css","import_jsx_runtime","import_react","import_jsx_runtime","ArkPortal","import_jsx_runtime","Dialog"]}
1
+ {"version":3,"sources":["../../../../src/components/dialog/index.ts","../../../../src/components/dialog/primitives.tsx","../../../../src/components/dialog/parts.ts","../../../../src/context/cerberus.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/dialog/close-icon-trigger.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/dialog.tsx"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './close-icon-trigger'\nexport * from './dialog'\n\nexport interface OpenChangeDetails {\n open: boolean\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { css, cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(\n props: DialogContentProps & DialogVariantProps & WithCss,\n) {\n const { size, css: customStyles, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, css(customStyles), contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n","import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import { ark, type HTMLArkProps } from '@ark-ui/react/factory'\nimport { cx } from 'styled-system/css'\nimport { iconButton, type IconButtonVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps extends HTMLArkProps<'button'> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps) {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <ark.button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport { type DialogCloseTriggerProps } from '@ark-ui/react/dialog'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { IconButton } from '../IconButton'\nimport { DialogCloseTrigger } from './primitives'\nimport { dialog } from 'styled-system/recipes'\nimport { cx } from 'styled-system/css'\n\n/**\n * This module contains the close trigger for the dialog.\n * @module react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const styles = dialog()\n\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n return (\n <DialogCloseTrigger\n {...props}\n className={cx(styles.closeTrigger, props.className)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </DialogCloseTrigger>\n )\n}\n","import { Portal as ArkPortal, type PortalProps } from '@ark-ui/react'\nimport type { PropsWithChildren } from 'react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type { PortalProps }\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n return <ArkPortal {...props} />\n}\n","import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size' | 'style'>,\n DialogVariantProps,\n WithCss {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;A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;AAAA,MACJ,eAAW,gBAAG,OAAO,cAAc,MAAM,SAAS;AAAA,MAClD,SAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,uDAAC,aAAU;AAAA;AAAA,MACb;AAAA;AAAA,EACF;AAEJ;;;ACpCA,IAAAC,gBAAsD;AA6B7C,IAAAC,sBAAA;AADF,SAAS,OAAO,OAAuC;AAC5D,SAAO,6CAAC,cAAAC,QAAA,EAAW,GAAG,OAAO;AAC/B;;;ACKI,IAAAC,sBAAA;AAFG,SAASC,QAAO,OAAoB;AACzC,SACE,8CAAC,UACC;AAAA,iDAAC,kBAAe;AAAA,IAChB,6CAAC,oBACC,uDAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":["Dialog","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_recipes","import_css","import_jsx_runtime","import_react","import_jsx_runtime","ArkPortal","import_jsx_runtime","Dialog"]}
@@ -1,3 +1,4 @@
1
+ export { OpenChangeDetails_alias_1 as OpenChangeDetails } from '../../_tsup-dts-rollup.cjs';
1
2
  export { DialogParts_alias_1 as DialogParts } from '../../_tsup-dts-rollup.cjs';
2
3
  export { DialogRoot_alias_1 as DialogRoot } from '../../_tsup-dts-rollup.cjs';
3
4
  export { DialogTrigger_alias_1 as DialogTrigger } from '../../_tsup-dts-rollup.cjs';
@@ -63,13 +63,13 @@ function DialogPositioner(props) {
63
63
  );
64
64
  }
65
65
  function DialogContent(props) {
66
- const { size, ...contentProps } = props;
66
+ const { size, css: customStyles, ...contentProps } = props;
67
67
  const styles = (0, import_recipes.dialog)({ size });
68
68
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
69
  import_dialog.Dialog.Content,
70
70
  {
71
71
  ...contentProps,
72
- className: (0, import_css.cx)(styles.content, contentProps.className)
72
+ className: (0, import_css.cx)(styles.content, (0, import_css.css)(customStyles), contentProps.className)
73
73
  }
74
74
  );
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/dialog/parts.ts","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBASO;AACP,iBAAmB;AACnB,qBAAgD;AAWvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,4CAAC,qBAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,q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,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,cAAc;AAChB;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/dialog/parts.ts","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { css, cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(\n props: DialogContentProps & DialogVariantProps & WithCss,\n) {\n const { size, css: customStyles, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, css(customStyles), contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBASO;AACP,iBAAwB;AACxB,qBAAgD;AAYvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,4CAAC,qBAAO,MAAP,EAAa,G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cAAP,EAAqB,GAAG,OAAO;AACzC;;;ADhDO,IAAM,cAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,cAAc;AAChB;","names":[]}
@@ -69,13 +69,13 @@ function DialogPositioner(props) {
69
69
  );
70
70
  }
71
71
  function DialogContent(props) {
72
- const { size, ...contentProps } = props;
72
+ const { size, css: customStyles, ...contentProps } = props;
73
73
  const styles = (0, import_recipes.dialog)({ size });
74
74
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
75
  import_dialog.Dialog.Content,
76
76
  {
77
77
  ...contentProps,
78
- className: (0, import_css.cx)(styles.content, contentProps.className)
78
+ className: (0, import_css.cx)(styles.content, (0, import_css.css)(customStyles), contentProps.className)
79
79
  }
80
80
  );
81
81
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBASO;AACP,iBAAmB;AACnB,qBAAgD;AAWvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,4CAAC,qBAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;AAKO,SAAS,cAAc,OAAyB;AACrD,QAAM,aAAS,uBAAO;AACtB,SACE,4CAAC,qBAAO,OAAP,EAAc,GAAG,OAAO,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,aAAa,MAAM,SAAS;AAAA;AAAA,EACnD;AAEJ;AAKO,SAAS,mBAAmB,OAA2B;AAC5D,SAAO,4CAAC,qBAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;AAMO,IAAM,iBAAiB;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { css, cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\nimport type { WithCss } from '../../types'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(\n props: DialogContentProps & DialogVariantProps & WithCss,\n) {\n const { size, css: customStyles, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, css(customStyles), contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,o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AAO,aAAa,MAAM,SAAS;AAAA;AAAA,EACnD;AAEJ;AAKO,SAAS,mBAAmB,OAA2B;AAC5D,SAAO,4CAAC,qBAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;AAMO,IAAM,iBAAiB;","names":[]}
@@ -70,7 +70,6 @@ function FieldLabel(props) {
70
70
  }
71
71
  function FieldHelperText(props) {
72
72
  const styles = (0, import_recipes.field)();
73
- if (!props.children) return null;
74
73
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
74
  import_field.Field.HelperText,
76
75
  {
@@ -107,22 +106,29 @@ function Show(props) {
107
106
  return null;
108
107
  }
109
108
 
110
- // src/components/field/field.tsx
109
+ // src/components/field/helper-text.tsx
111
110
  var import_jsx_runtime3 = require("react/jsx-runtime");
111
+ function HelperText(props) {
112
+ if (props.invalid) return null;
113
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldHelperText, { "data-has-content": Boolean(props.children), children: props.children });
114
+ }
115
+
116
+ // src/components/field/field.tsx
117
+ var import_jsx_runtime4 = require("react/jsx-runtime");
112
118
  function Field2(props) {
113
119
  const [statusProps, fieldProps, rootProps] = splitProps(
114
120
  props,
115
121
  ["disabled", "required", "readOnly", "invalid"],
116
122
  ["label", "helperText", "secondaryHelperText", "errorText", "children"]
117
123
  );
118
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
119
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: fieldProps.label, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldLabel, { children: fieldProps.label }) }),
124
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
125
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: fieldProps.label, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldLabel, { children: fieldProps.label }) }),
120
126
  fieldProps.children,
121
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: fieldProps.helperText && !statusProps.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
122
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldHelperText, { children: fieldProps.helperText }),
123
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
124
- ] }) }),
125
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldErrorText, { children: fieldProps.errorText })
127
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
128
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HelperText, { invalid: statusProps.invalid, children: fieldProps.helperText }),
129
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldErrorText, { children: fieldProps.errorText }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
131
+ ] })
126
132
  ] });
127
133
  }
128
134
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/field/field.tsx","../../../../src/utils/index.ts","../../../../src/components/field/primitives.tsx","../../../../src/components/Show.tsx"],"sourcesContent":["import { type FieldRootProps } from '@ark-ui/react/field'\nimport { splitProps } from '../../utils/index'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldLabel,\n FieldRoot,\n} from './primitives'\nimport { HStack } from 'styled-system/jsx'\nimport { Show } from '../Show'\n\nexport interface FieldProps extends FieldRootProps {\n /**\n * The label of the field.\n */\n label?: string\n /**\n * The helper text of the field.\n */\n helperText?: string\n /**\n * A helper text positioned at the end of the field. Good for Textarea fields.\n */\n secondaryHelperText?: string\n /**\n * The error text of the field. Shown when the field is invalid.\n */\n errorText?: string\n}\n\n/**\n * The Field component is the context provider for all FieldParts and displays\n * the label, helperText, and ErrorText.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <Field\n * ids={{\n * control: 'firstName',\n * }}\n * label=\"Label\"\n * helperText=\"This is what people will see on your profile.\"\n * errorText=\"A first name is required to create an account.\"\n * required\n * >\n * <Input name=\"firstName\" type=\"text\" />\n * </Field>\n * ```\n */\nexport function Field(props: FieldProps) {\n const [statusProps, fieldProps, rootProps] = splitProps(\n props,\n ['disabled', 'required', 'readOnly', 'invalid'],\n ['label', 'helperText', 'secondaryHelperText', 'errorText', 'children'],\n )\n\n return (\n <FieldRoot {...statusProps} {...rootProps}>\n <Show when={fieldProps.label}>\n <FieldLabel>{fieldProps.label}</FieldLabel>\n </Show>\n\n {fieldProps.children}\n\n <Show when={fieldProps.helperText && !statusProps.invalid}>\n <HStack justifyContent=\"space-between\" w=\"full\">\n <FieldHelperText>{fieldProps.helperText}</FieldHelperText>\n <Show when={fieldProps.secondaryHelperText}>\n <FieldHelperText>{fieldProps.secondaryHelperText}</FieldHelperText>\n </Show>\n </HStack>\n </Show>\n\n <FieldErrorText>{fieldProps.errorText}</FieldErrorText>\n </FieldRoot>\n )\n}\n","/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n\n/**\n * Splits the properties of an object into multiple groups based on lists of keys.\n * @param props - The object to split.\n * @param keyGroups - The lists of keys to include in each group.\n * @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.\n */\nexport function splitProps<T extends object>(\n props: T,\n ...keyGroups: (keyof T)[][]\n): { [K in keyof T]?: T[K] }[] {\n const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })\n const rest = {} as { [K in keyof T]?: T[K] }\n\n for (const key in props) {\n let assigned = false\n for (let i = 0; i < keyGroups.length; i++) {\n if (keyGroups[i].includes(key as keyof T)) {\n result[i][key as keyof T] = props[key]\n assigned = true\n break\n }\n }\n if (!assigned) {\n rest[key as keyof T] = props[key]\n }\n }\n\n return [...result, rest]\n}\n\nexport * from './localStorage'\n","import {\n Field,\n type FieldHelperTextProps,\n type FieldInputProps as ArkFieldInputProps,\n type FieldLabelProps,\n type FieldRootProps as ArkFieldRootProps,\n type FieldTextareaProps,\n} from '@ark-ui/react/field'\nimport type { ReactNode } from 'react'\nimport { cx } from 'styled-system/css'\nimport { field, type FieldVariantProps } from 'styled-system/recipes'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains all the primitives of the Field component.\n * @module 'field'\n */\n\nexport type FieldRootProps = ArkFieldRootProps & FieldVariantProps\n\n/**\n * The context & container for the Field components.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot required ids={{ input: 'exampleId' }}>\n * <FieldLabel>Label</FieldLabel>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldRoot(props: FieldRootProps) {\n const { size, ...fieldProps } = props\n const styles = field({ size })\n return (\n <Field.Root\n {...fieldProps}\n className={cx(styles.root, fieldProps.className)}\n />\n )\n}\n\n/**\n * The label for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldLabel>Label</FieldLabel>\n * </FieldRoot>\n * ```\n */\nexport function FieldLabel(props: FieldLabelProps) {\n const { children, ...nativeProps } = props\n const styles = field()\n return (\n <Field.Label {...nativeProps} className={cx(styles.label, props.className)}>\n {children}\n <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n </Field.Label>\n )\n}\n\n/**\n * The required indicator for the Field component.\n */\nexport function FieldRequiredIndicator() {\n return <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n}\n\nexport interface FieldInputProps\n extends Omit<ArkFieldInputProps, 'size'>,\n FieldVariantProps {\n /**\n * An optional icon to display at the start of the input.\n */\n startIcon?: ReactNode\n /**\n * An optional icon to display at the end of the input.\n */\n endIcon?: ReactNode\n}\n\n/**\n * The input for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldInput(props: FieldInputProps) {\n const { size, startIcon, endIcon, ...fieldProps } = props\n const styles = field({ size })\n const hasStartIcon = Boolean(startIcon)\n\n return (\n <div className={styles.inputRoot}>\n <FieldStartIndicator>{startIcon}</FieldStartIndicator>\n <Field.Input\n {...fieldProps}\n {...(hasStartIcon && { 'data-has': 'start-indicator' })}\n className={cx(styles.input, fieldProps.className)}\n />\n <FieldStatusIndicator fallback={endIcon} />\n </div>\n )\n}\n\n/**\n * The helper text for the Field component that is shown when the field is\n * valid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldHelperText>Helper text</FieldHelperText>\n * </FieldRoot>\n * ```\n */\nexport function FieldHelperText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.HelperText\n {...props}\n className={cx(styles.helperText, props.className)}\n />\n )\n}\n\n/**\n * The error text for the Field component that is shown when the field is\n * invalid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldErrorText>Error text</FieldErrorText>\n * </FieldRoot>\n * ```\n */\nexport function FieldErrorText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.ErrorText\n {...props}\n className={cx(styles.errorText, props.className)}\n />\n )\n}\n\n/**\n * The textarea for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldTextarea />\n * </FieldRoot>\n * ```\n */\nexport function FieldTextarea(props: FieldTextareaProps) {\n const styles = field()\n return (\n <Field.Textarea\n {...props}\n className={cx(styles.textarea, props.className)}\n />\n )\n}\n\n/**\n * A named export for the FieldInput component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * import { Input } from '@cerberus/react'\n *\n * <Field\n * ids={{\n * control: 'email',\n * }}\n * label=\"Enter your email\"\n * helperText=\"We'll never share your email with anyone else.\"\n * errorText=\"Email is required.\"\n * required\n * >\n * <Input type=\"email\" />\n * </Field>\n * ```\n */\nexport const Input = FieldInput\nexport const Textarea = FieldTextarea\n","import { type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps<T> {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: T | boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show<T>(props: PropsWithChildren<ShowProps<T>>) {\n const { when, children, fallback } = props\n\n if (when) {\n return <>{children}</>\n }\n\n if (fallback) {\n return <>{fallback}</>\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA;AAAA;;;AC0BO,SAAS,WACd,UACG,WAC0B;AAC7B,QAAM,SAAS,UAAU,IAAI,OAAO,CAAC,EAA+B;AACpE,QAAM,OAAO,CAAC;AAEd,aAAW,OAAO,OAAO;AACvB,QAAI,WAAW;AACf,aAAS,IAAI,GAAG,IAAI,UAAU,Q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AW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;;;AFxJA,iBAAuB;;;AGwBZ,IAAAC,sBAAA;AAJJ,SAAS,KAAQ,OAAwC;AAC9D,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AAErC,MAAI,MAAM;AACR,WAAO,6EAAG,UAAS;AAAA,EACrB;AAEA,MAAI,UAAU;AACZ,WAAO,6EAAG,oBAAS;AAAA,EACrB;AAEA,SAAO;AACT;;;AHmBQ,IAAAC,sBAAA;AAVD,SAASC,OAAM,OAAmB;AACvC,QAAM,CAAC,aAAa,YAAY,SAAS,IAAI;AAAA,IAC3C;AAAA,IACA,CAAC,YAAY,YAAY,YAAY,SAAS;AAAA,IAC9C,CAAC,SAAS,cAAc,uBAAuB,aAAa,UAAU;AAAA,EACxE;AAEA,SACE,8CAAC,aAAW,GAAG,aAAc,GAAG,WAC9B;AAAA,iDAAC,QAAK,MAAM,WAAW,OACrB,uDAAC,cAAY,qBAAW,OAAM,GAChC;AAAA,IAEC,WAAW;AAAA,IAEZ,6CAAC,QAAK,MAAM,WAAW,cAAc,CAAC,YAAY,SAChD,wDAAC,qBAAO,gBAAe,iBAAgB,GAAE,QACvC;AAAA,mDAAC,mBAAiB,qBAAW,YAAW;AAAA,MACxC,6CAAC,QAAK,MAAM,WAAW,qBACrB,uDAAC,mBAAiB,qBAAW,qBAAoB,GACnD;AAAA,OACF,GACF;AAAA,IAEA,6CAAC,kBAAgB,qBAAW,WAAU;AAAA,KACxC;AAEJ;","names":["Field","import_jsx_runtime","import_jsx_runtime","Field"]}
1
+ {"version":3,"sources":["../../../../src/components/field/field.tsx","../../../../src/utils/index.ts","../../../../src/components/field/primitives.tsx","../../../../src/components/Show.tsx","../../../../src/components/field/helper-text.tsx"],"sourcesContent":["import { type FieldRootProps } from '@ark-ui/react/field'\nimport { splitProps } from '../../utils/index'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldLabel,\n FieldRoot,\n} from './primitives'\nimport { HStack } from 'styled-system/jsx'\nimport { Show } from '../Show'\nimport { HelperText } from './helper-text'\n\nexport interface FieldProps extends FieldRootProps {\n /**\n * The label of the field.\n */\n label?: string\n /**\n * The helper text of the field.\n */\n helperText?: string\n /**\n * A helper text positioned at the end of the field. Good for Textarea fields.\n */\n secondaryHelperText?: string\n /**\n * The error text of the field. Shown when the field is invalid.\n */\n errorText?: string\n}\n\n/**\n * The Field component is the context provider for all FieldParts and displays\n * the label, helperText, and ErrorText.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <Field\n * ids={{\n * control: 'firstName',\n * }}\n * label=\"Label\"\n * helperText=\"This is what people will see on your profile.\"\n * errorText=\"A first name is required to create an account.\"\n * required\n * >\n * <Input name=\"firstName\" type=\"text\" />\n * </Field>\n * ```\n */\nexport function Field(props: FieldProps) {\n const [statusProps, fieldProps, rootProps] = splitProps(\n props,\n ['disabled', 'required', 'readOnly', 'invalid'],\n ['label', 'helperText', 'secondaryHelperText', 'errorText', 'children'],\n )\n\n return (\n <FieldRoot {...statusProps} {...rootProps}>\n <Show when={fieldProps.label}>\n <FieldLabel>{fieldProps.label}</FieldLabel>\n </Show>\n\n {fieldProps.children}\n\n <HStack justifyContent=\"space-between\" w=\"full\">\n <HelperText invalid={statusProps.invalid}>\n {fieldProps.helperText}\n </HelperText>\n\n <FieldErrorText>{fieldProps.errorText}</FieldErrorText>\n\n <Show when={fieldProps.secondaryHelperText}>\n <FieldHelperText>{fieldProps.secondaryHelperText}</FieldHelperText>\n </Show>\n </HStack>\n </FieldRoot>\n )\n}\n","/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n\n/**\n * Splits the properties of an object into multiple groups based on lists of keys.\n * @param props - The object to split.\n * @param keyGroups - The lists of keys to include in each group.\n * @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.\n */\nexport function splitProps<T extends object>(\n props: T,\n ...keyGroups: (keyof T)[][]\n): { [K in keyof T]?: T[K] }[] {\n const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })\n const rest = {} as { [K in keyof T]?: T[K] }\n\n for (const key in props) {\n let assigned = false\n for (let i = 0; i < keyGroups.length; i++) {\n if (keyGroups[i].includes(key as keyof T)) {\n result[i][key as keyof T] = props[key]\n assigned = true\n break\n }\n }\n if (!assigned) {\n rest[key as keyof T] = props[key]\n }\n }\n\n return [...result, rest]\n}\n\nexport * from './localStorage'\n","import {\n Field,\n type FieldHelperTextProps,\n type FieldInputProps as ArkFieldInputProps,\n type FieldLabelProps,\n type FieldRootProps as ArkFieldRootProps,\n type FieldTextareaProps,\n} from '@ark-ui/react/field'\nimport type { ReactNode } from 'react'\nimport { cx } from 'styled-system/css'\nimport { field, type FieldVariantProps } from 'styled-system/recipes'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains all the primitives of the Field component.\n * @module 'field'\n */\n\nexport type FieldRootProps = ArkFieldRootProps & FieldVariantProps\n\n/**\n * The context & container for the Field components.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot required ids={{ input: 'exampleId' }}>\n * <FieldLabel>Label</FieldLabel>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldRoot(props: FieldRootProps) {\n const { size, ...fieldProps } = props\n const styles = field({ size })\n return (\n <Field.Root\n {...fieldProps}\n className={cx(styles.root, fieldProps.className)}\n />\n )\n}\n\n/**\n * The label for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldLabel>Label</FieldLabel>\n * </FieldRoot>\n * ```\n */\nexport function FieldLabel(props: FieldLabelProps) {\n const { children, ...nativeProps } = props\n const styles = field()\n return (\n <Field.Label {...nativeProps} className={cx(styles.label, props.className)}>\n {children}\n <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n </Field.Label>\n )\n}\n\n/**\n * The required indicator for the Field component.\n */\nexport function FieldRequiredIndicator() {\n return <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n}\n\nexport interface FieldInputProps\n extends Omit<ArkFieldInputProps, 'size'>,\n FieldVariantProps {\n /**\n * An optional icon to display at the start of the input.\n */\n startIcon?: ReactNode\n /**\n * An optional icon to display at the end of the input.\n */\n endIcon?: ReactNode\n}\n\n/**\n * The input for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldInput(props: FieldInputProps) {\n const { size, startIcon, endIcon, ...fieldProps } = props\n const styles = field({ size })\n const hasStartIcon = Boolean(startIcon)\n\n return (\n <div className={styles.inputRoot}>\n <FieldStartIndicator>{startIcon}</FieldStartIndicator>\n <Field.Input\n {...fieldProps}\n {...(hasStartIcon && { 'data-has': 'start-indicator' })}\n className={cx(styles.input, fieldProps.className)}\n />\n <FieldStatusIndicator fallback={endIcon} />\n </div>\n )\n}\n\n/**\n * The helper text for the Field component that is shown when the field is\n * valid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldHelperText>Helper text</FieldHelperText>\n * </FieldRoot>\n * ```\n */\nexport function FieldHelperText(props: FieldHelperTextProps) {\n const styles = field()\n return (\n <Field.HelperText\n {...props}\n className={cx(styles.helperText, props.className)}\n />\n )\n}\n\n/**\n * The error text for the Field component that is shown when the field is\n * invalid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldErrorText>Error text</FieldErrorText>\n * </FieldRoot>\n * ```\n */\nexport function FieldErrorText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.ErrorText\n {...props}\n className={cx(styles.errorText, props.className)}\n />\n )\n}\n\n/**\n * The textarea for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldTextarea />\n * </FieldRoot>\n * ```\n */\nexport function FieldTextarea(props: FieldTextareaProps) {\n const styles = field()\n return (\n <Field.Textarea\n {...props}\n className={cx(styles.textarea, props.className)}\n />\n )\n}\n\n/**\n * A named export for the FieldInput component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * import { Input } from '@cerberus/react'\n *\n * <Field\n * ids={{\n * control: 'email',\n * }}\n * label=\"Enter your email\"\n * helperText=\"We'll never share your email with anyone else.\"\n * errorText=\"Email is required.\"\n * required\n * >\n * <Input type=\"email\" />\n * </Field>\n * ```\n */\nexport const Input = FieldInput\nexport const Textarea = FieldTextarea\n","import { type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps<T> {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: T | boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show<T>(props: PropsWithChildren<ShowProps<T>>) {\n const { when, children, fallback } = props\n\n if (when) {\n return <>{children}</>\n }\n\n if (fallback) {\n return <>{fallback}</>\n }\n\n return null\n}\n","import type { PropsWithChildren } from 'react'\nimport { FieldHelperText } from './primitives'\n\ninterface HelperTextProps {\n invalid?: boolean\n}\n\n/**\n * The HelperText component is an abstraction for hiding the helper text\n * when the field is invalid. Ark UI assumes people want the helper text\n * to always be visible, so this is a workaround for that.\n */\nexport function HelperText(props: PropsWithChildren<HelperTextProps>) {\n if (props.invalid) return null\n return (\n <FieldHelperText data-has-content={Boolean(props.children)}>\n {props.children}\n </FieldHelperText>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA;AAAA;;;AC0BO,SAAS,WACd,UACG,WAC0B;AAC7B,QAAM,SAAS,UAAU,IAAI,OAAO,CAAC,EAA+B;AACpE,QAAM,OAAO,CAAC;AAEd,aAAW,OAAO,OAAO;AACvB,QAAI,WAAW;AACf,aAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,UAAI,UAAU,CAAC,EAAE,SAAS,GAAc,GAAG;AACzC,eAAO,CAAC,EAAE,GAAc,IAAI,MAAM,GAAG;AACrC,mBAAW;AACX;AAAA,MACF;AAAA,IACF;AACA,QAAI,CAAC,UAAU;AACb,WAAK,GAAc,IAAI,MAAM,GAAG;AAAA,IAClC;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,QAAQ,IAAI;AACzB;;;AChDA,mBAOO;AAEP,iBAAmB;AACnB,qBAA8C;AA0B1C;AAJG,SAAS,UAAU,OAAuB;AAC/C,QAAM,EAAE,MAAM,GAAG,WAAW,IAAI;AAChC,QAAM,aAAS,sBAAM,EAAE,KAAK,CAAC;AAC7B,SACE;AAAA,IAAC,mBAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,WAAW,SAAS;AAAA;AAAA,EACjD;AAEJ;AAYO,SAAS,WAAW,OAAwB;AACjD,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,QAAM,aAAS,sBAAM;AACrB,SACE,6CAAC,mBAAM,OAAN,EAAa,GAAG,aAAa,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS,GACtE;AAAA;AAAA,IACD,4CAAC,mBAAM,mBAAN,EAAwB,wBAAU;AAAA,KACrC;AAEJ;AA8DO,SA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AAY,SAC9B,qBAAW,YACd;AAAA,MAEA,6CAAC,kBAAgB,qBAAW,WAAU;AAAA,MAEtC,6CAAC,QAAK,MAAM,WAAW,qBACrB,uDAAC,mBAAiB,qBAAW,qBAAoB,GACnD;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Field","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Field"]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/field/helper-text.tsx
21
+ var helper_text_exports = {};
22
+ __export(helper_text_exports, {
23
+ HelperText: () => HelperText
24
+ });
25
+ module.exports = __toCommonJS(helper_text_exports);
26
+
27
+ // src/components/field/primitives.tsx
28
+ var import_field = require("@ark-ui/react/field");
29
+ var import_css = require("styled-system/css");
30
+ var import_recipes = require("styled-system/recipes");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function FieldHelperText(props) {
33
+ const styles = (0, import_recipes.field)();
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
+ import_field.Field.HelperText,
36
+ {
37
+ ...props,
38
+ className: (0, import_css.cx)(styles.helperText, props.className)
39
+ }
40
+ );
41
+ }
42
+
43
+ // src/components/field/helper-text.tsx
44
+ var import_jsx_runtime2 = require("react/jsx-runtime");
45
+ function HelperText(props) {
46
+ if (props.invalid) return null;
47
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldHelperText, { "data-has-content": Boolean(props.children), children: props.children });
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ HelperText
52
+ });
53
+ //# sourceMappingURL=helper-text.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/field/helper-text.tsx","../../../../src/components/field/primitives.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { FieldHelperText } from './primitives'\n\ninterface HelperTextProps {\n invalid?: boolean\n}\n\n/**\n * The HelperText component is an abstraction for hiding the helper text\n * when the field is invalid. Ark UI assumes people want the helper text\n * to always be visible, so this is a workaround for that.\n */\nexport function HelperText(props: PropsWithChildren<HelperTextProps>) {\n if (props.invalid) return null\n return (\n <FieldHelperText data-has-content={Boolean(props.children)}>\n {props.children}\n </FieldHelperText>\n )\n}\n","import {\n Field,\n type FieldHelperTextProps,\n type FieldInputProps as ArkFieldInputProps,\n type FieldLabelProps,\n type FieldRootProps as ArkFieldRootProps,\n type FieldTextareaProps,\n} from '@ark-ui/react/field'\nimport type { ReactNode } from 'react'\nimport { cx } from 'styled-system/css'\nimport { field, type FieldVariantProps } from 'styled-system/recipes'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains all the primitives of the Field component.\n * @module 'field'\n */\n\nexport type FieldRootProps = ArkFieldRootProps & FieldVariantProps\n\n/**\n * The context & container for the Field components.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot required ids={{ input: 'exampleId' }}>\n * <FieldLabel>Label</FieldLabel>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldRoot(props: FieldRootProps) {\n const { size, ...fieldProps } = props\n const styles = field({ size })\n return (\n <Field.Root\n {...fieldProps}\n className={cx(styles.root, fieldProps.className)}\n />\n )\n}\n\n/**\n * The label for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldLabel>Label</FieldLabel>\n * </FieldRoot>\n * ```\n */\nexport function FieldLabel(props: FieldLabelProps) {\n const { children, ...nativeProps } = props\n const styles = field()\n return (\n <Field.Label {...nativeProps} className={cx(styles.label, props.className)}>\n {children}\n <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n </Field.Label>\n )\n}\n\n/**\n * The required indicator for the Field component.\n */\nexport function FieldRequiredIndicator() {\n return <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n}\n\nexport interface FieldInputProps\n extends Omit<ArkFieldInputProps, 'size'>,\n FieldVariantProps {\n /**\n * An optional icon to display at the start of the input.\n */\n startIcon?: ReactNode\n /**\n * An optional icon to display at the end of the input.\n */\n endIcon?: ReactNode\n}\n\n/**\n * The input for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldInput(props: FieldInputProps) {\n const { size, startIcon, endIcon, ...fieldProps } = props\n const styles = field({ size })\n const hasStartIcon = Boolean(startIcon)\n\n return (\n <div className={styles.inputRoot}>\n <FieldStartIndicator>{startIcon}</FieldStartIndicator>\n <Field.Input\n {...fieldProps}\n {...(hasStartIcon && { 'data-has': 'start-indicator' })}\n className={cx(styles.input, fieldProps.className)}\n />\n <FieldStatusIndicator fallback={endIcon} />\n </div>\n )\n}\n\n/**\n * The helper text for the Field component that is shown when the field is\n * valid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldHelperText>Helper text</FieldHelperText>\n * </FieldRoot>\n * ```\n */\nexport function FieldHelperText(props: FieldHelperTextProps) {\n const styles = field()\n return (\n <Field.HelperText\n {...props}\n className={cx(styles.helperText, props.className)}\n />\n )\n}\n\n/**\n * The error text for the Field component that is shown when the field is\n * invalid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldErrorText>Error text</FieldErrorText>\n * </FieldRoot>\n * ```\n */\nexport function FieldErrorText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.ErrorText\n {...props}\n className={cx(styles.errorText, props.className)}\n />\n )\n}\n\n/**\n * The textarea for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldTextarea />\n * </FieldRoot>\n * ```\n */\nexport function FieldTextarea(props: FieldTextareaProps) {\n const styles = field()\n return (\n <Field.Textarea\n {...props}\n className={cx(styles.textarea, props.className)}\n />\n )\n}\n\n/**\n * A named export for the FieldInput component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * import { Input } from '@cerberus/react'\n *\n * <Field\n * ids={{\n * control: 'email',\n * }}\n * label=\"Enter your email\"\n * helperText=\"We'll never share your email with anyone else.\"\n * errorText=\"Email is required.\"\n * required\n * >\n * <Input type=\"email\" />\n * </Field>\n * ```\n */\nexport const Input = FieldInput\nexport const Textarea = FieldTextarea\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAOO;AAEP,iBAAmB;AACnB,qBAA8C;AA0B1C;AAwFG,SAAS,gBAAgB,OAA6B;AAC3D,QAAM,aAAS,sBAAM;AACrB,SACE;AAAA,IAAC,mBAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;;;ADrHI,IAAAA,sBAAA;AAHG,SAAS,WAAW,OAA2C;AACpE,MAAI,MAAM,QAAS,QAAO;AAC1B,SACE,6CAAC,mBAAgB,oBAAkB,QAAQ,MAAM,QAAQ,GACtD,gBAAM,UACT;AAEJ;","names":["import_jsx_runtime"]}
@@ -0,0 +1 @@
1
+ export { HelperText } from '../../_tsup-dts-rollup.cjs';
@@ -170,7 +170,6 @@ function FieldInput(props) {
170
170
  }
171
171
  function FieldHelperText(props) {
172
172
  const styles = (0, import_recipes3.field)();
173
- if (!props.children) return null;
174
173
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
175
174
  import_field.Field.HelperText,
176
175
  {
@@ -219,22 +218,29 @@ function Show(props) {
219
218
  return null;
220
219
  }
221
220
 
222
- // src/components/field/field.tsx
221
+ // src/components/field/helper-text.tsx
223
222
  var import_jsx_runtime6 = require("react/jsx-runtime");
223
+ function HelperText(props) {
224
+ if (props.invalid) return null;
225
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldHelperText, { "data-has-content": Boolean(props.children), children: props.children });
226
+ }
227
+
228
+ // src/components/field/field.tsx
229
+ var import_jsx_runtime7 = require("react/jsx-runtime");
224
230
  function Field2(props) {
225
231
  const [statusProps, fieldProps, rootProps] = splitProps(
226
232
  props,
227
233
  ["disabled", "required", "readOnly", "invalid"],
228
234
  ["label", "helperText", "secondaryHelperText", "errorText", "children"]
229
235
  );
230
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
231
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: fieldProps.label, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldLabel, { children: fieldProps.label }) }),
236
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
237
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Show, { when: fieldProps.label, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FieldLabel, { children: fieldProps.label }) }),
232
238
  fieldProps.children,
233
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: fieldProps.helperText && !statusProps.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
234
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldHelperText, { children: fieldProps.helperText }),
235
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
236
- ] }) }),
237
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldErrorText, { children: fieldProps.errorText })
239
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
240
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HelperText, { invalid: statusProps.invalid, children: fieldProps.helperText }),
241
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FieldErrorText, { children: fieldProps.errorText }),
242
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
243
+ ] })
238
244
  ] });
239
245
  }
240
246
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/field/index.ts","../../../../src/utils/index.ts","../../../../src/components/field/primitives.tsx","../../../../src/components/field/status-indicator.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/field/start-indicator.tsx","../../../../src/components/field/field.tsx","../../../../src/components/Show.tsx","../../../../src/components/field/parts.ts"],"sourcesContent":["export * from './field'\nexport * from './primitives'\nexport * from './start-indicator'\nexport * from './status-indicator'\nexport * from './parts'\n","/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n\n/**\n * Splits the properties of an object into multiple groups based on lists of keys.\n * @param props - The object to split.\n * @param keyGroups - The lists of keys to include in each group.\n * @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.\n */\nexport function splitProps<T extends object>(\n props: T,\n ...keyGroups: (keyof T)[][]\n): { [K in keyof T]?: T[K] }[] {\n const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })\n const rest = {} as { [K in keyof T]?: T[K] }\n\n for (const key in props) {\n let assigned = false\n for (let i = 0; i < keyGroups.length; i++) {\n if (keyGroups[i].includes(key as keyof T)) {\n result[i][key as keyof T] = props[key]\n assigned = true\n break\n }\n }\n if (!assigned) {\n rest[key as keyof T] = props[key]\n }\n }\n\n return [...result, rest]\n}\n\nexport * from './localStorage'\n","import {\n Field,\n type FieldHelperTextProps,\n type FieldInputProps as ArkFieldInputProps,\n type FieldLabelProps,\n type FieldRootProps as ArkFieldRootProps,\n type FieldTextareaProps,\n} from '@ark-ui/react/field'\nimport type { ReactNode } from 'react'\nimport { cx } from 'styled-system/css'\nimport { field, type FieldVariantProps } from 'styled-system/recipes'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains all the primitives of the Field component.\n * @module 'field'\n */\n\nexport type FieldRootProps = ArkFieldRootProps & FieldVariantProps\n\n/**\n * The context & container for the Field components.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot required ids={{ input: 'exampleId' }}>\n * <FieldLabel>Label</FieldLabel>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldRoot(props: FieldRootProps) {\n const { size, ...fieldProps } = props\n const styles = field({ size })\n return (\n <Field.Root\n {...fieldProps}\n className={cx(styles.root, fieldProps.className)}\n />\n )\n}\n\n/**\n * The label for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldLabel>Label</FieldLabel>\n * </FieldRoot>\n * ```\n */\nexport function FieldLabel(props: FieldLabelProps) {\n const { children, ...nativeProps } = props\n const styles = field()\n return (\n <Field.Label {...nativeProps} className={cx(styles.label, props.className)}>\n {children}\n <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n </Field.Label>\n )\n}\n\n/**\n * The required indicator for the Field component.\n */\nexport function FieldRequiredIndicator() {\n return <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n}\n\nexport interface FieldInputProps\n extends Omit<ArkFieldInputProps, 'size'>,\n FieldVariantProps {\n /**\n * An optional icon to display at the start of the input.\n */\n startIcon?: ReactNode\n /**\n * An optional icon to display at the end of the input.\n */\n endIcon?: ReactNode\n}\n\n/**\n * The input for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldInput(props: FieldInputProps) {\n const { size, startIcon, endIcon, ...fieldProps } = props\n const styles = field({ size })\n const hasStartIcon = Boolean(startIcon)\n\n return (\n <div className={styles.inputRoot}>\n <FieldStartIndicator>{startIcon}</FieldStartIndicator>\n <Field.Input\n {...fieldProps}\n {...(hasStartIcon && { 'data-has': 'start-indicator' })}\n className={cx(styles.input, fieldProps.className)}\n />\n <FieldStatusIndicator fallback={endIcon} />\n </div>\n )\n}\n\n/**\n * The helper text for the Field component that is shown when the field is\n * valid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldHelperText>Helper text</FieldHelperText>\n * </FieldRoot>\n * ```\n */\nexport function FieldHelperText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.HelperText\n {...props}\n className={cx(styles.helperText, props.className)}\n />\n )\n}\n\n/**\n * The error text for the Field component that is shown when the field is\n * invalid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldErrorText>Error text</FieldErrorText>\n * </FieldRoot>\n * ```\n */\nexport function FieldErrorText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.ErrorText\n {...props}\n className={cx(styles.errorText, props.className)}\n />\n )\n}\n\n/**\n * The textarea for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldTextarea />\n * </FieldRoot>\n * ```\n */\nexport function FieldTextarea(props: FieldTextareaProps) {\n const styles = field()\n return (\n <Field.Textarea\n {...props}\n className={cx(styles.textarea, props.className)}\n />\n )\n}\n\n/**\n * A named export for the FieldInput component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * import { Input } from '@cerberus/react'\n *\n * <Field\n * ids={{\n * control: 'email',\n * }}\n * label=\"Enter your email\"\n * helperText=\"We'll never share your email with anyone else.\"\n * errorText=\"Email is required.\"\n * required\n * >\n * <Input type=\"email\" />\n * </Field>\n * ```\n */\nexport const Input = FieldInput\nexport const Textarea = FieldTextarea\n","'use client'\n\nimport { useFieldContext } from '@ark-ui/react'\nimport { cx } from 'styled-system/css'\nimport { field } from 'styled-system/recipes'\nimport { useCerberusContext } from '../../context/cerberus'\nimport type { HTMLAttributes, ReactNode } from 'react'\n\nexport interface FieldStatusIndicatorProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The fallback content to display when the field is valid.\n */\n fallback?: ReactNode\n}\n\n/**\n * The invalid status indicator for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldStatusIndicator />\n * </FieldRoot>\n * ```\n */\nexport function FieldStatusIndicator(props: FieldStatusIndicatorProps) {\n const { fallback, ...nativeProps } = props\n const styles = field()\n const fieldContext = useFieldContext()\n\n const { icons } = useCerberusContext()\n const { invalid: InvalidIcon } = icons\n\n if (fieldContext.invalid) {\n return (\n <span\n {...nativeProps}\n aria-hidden=\"true\"\n data-invalid\n className={cx(nativeProps.className, styles.statusIndicator)}\n >\n <InvalidIcon />\n </span>\n )\n }\n\n return (\n <span\n {...nativeProps}\n aria-hidden=\"true\"\n data-part=\"end-indicator\"\n className={cx(nativeProps.className, styles.endIndicator)}\n >\n {fallback}\n </span>\n )\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import { cx } from 'styled-system/css'\nimport { field } from 'styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\nexport type FieldIndicatorProps = HTMLAttributes<HTMLSpanElement>\n\n/**\n * The start indicator displays an indicator at the start of the Input.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n */\nexport function FieldStartIndicator(props: FieldIndicatorProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <span\n {...props}\n data-part=\"start-indicator\"\n className={cx(props.className, styles.startIndicator)}\n />\n )\n}\n","import { type FieldRootProps } from '@ark-ui/react/field'\nimport { splitProps } from '../../utils/index'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldLabel,\n FieldRoot,\n} from './primitives'\nimport { HStack } from 'styled-system/jsx'\nimport { Show } from '../Show'\n\nexport interface FieldProps extends FieldRootProps {\n /**\n * The label of the field.\n */\n label?: string\n /**\n * The helper text of the field.\n */\n helperText?: string\n /**\n * A helper text positioned at the end of the field. Good for Textarea fields.\n */\n secondaryHelperText?: string\n /**\n * The error text of the field. Shown when the field is invalid.\n */\n errorText?: string\n}\n\n/**\n * The Field component is the context provider for all FieldParts and displays\n * the label, helperText, and ErrorText.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <Field\n * ids={{\n * control: 'firstName',\n * }}\n * label=\"Label\"\n * helperText=\"This is what people will see on your profile.\"\n * errorText=\"A first name is required to create an account.\"\n * required\n * >\n * <Input name=\"firstName\" type=\"text\" />\n * </Field>\n * ```\n */\nexport function Field(props: FieldProps) {\n const [statusProps, fieldProps, rootProps] = splitProps(\n props,\n ['disabled', 'required', 'readOnly', 'invalid'],\n ['label', 'helperText', 'secondaryHelperText', 'errorText', 'children'],\n )\n\n return (\n <FieldRoot {...statusProps} {...rootProps}>\n <Show when={fieldProps.label}>\n <FieldLabel>{fieldProps.label}</FieldLabel>\n </Show>\n\n {fieldProps.children}\n\n <Show when={fieldProps.helperText && !statusProps.invalid}>\n <HStack justifyContent=\"space-between\" w=\"full\">\n <FieldHelperText>{fieldProps.helperText}</FieldHelperText>\n <Show when={fieldProps.secondaryHelperText}>\n <FieldHelperText>{fieldProps.secondaryHelperText}</FieldHelperText>\n </Show>\n </HStack>\n </Show>\n\n <FieldErrorText>{fieldProps.errorText}</FieldErrorText>\n </FieldRoot>\n )\n}\n","import { type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps<T> {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: T | boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show<T>(props: PropsWithChildren<ShowProps<T>>) {\n const { when, children, fallback } = props\n\n if (when) {\n return <>{children}</>\n }\n\n if (fallback) {\n return <>{fallback}</>\n }\n\n return null\n}\n","import type { ElementType } from 'react'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldInput,\n FieldLabel,\n FieldRequiredIndicator,\n FieldRoot,\n FieldTextarea,\n} from './primitives'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface FieldPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The input of the field.\n */\n Input: ElementType\n /**\n * The textarea of the field.\n */\n Textarea: ElementType\n /**\n * The text that displays when the field is valid.\n */\n HelperText: ElementType\n /**\n * The text that displays when the field is invalid.\n */\n ErrorText: ElementType\n /**\n * The indicator that appears at the start of the field.\n */\n StartIndicator: ElementType\n /**\n * The status indicator of the field.\n */\n StatusIndicator: ElementType\n /**\n * The indicator that appears at the end of the field.\n */\n RequiredIndicator: ElementType\n}\n\n/**\n * An Object containing the parts of the Field component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the FieldParts object and\n * the entire family of components vs. only what you use.\n */\nexport const FieldParts: FieldPartsValue = {\n Root: FieldRoot,\n Label: FieldLabel,\n Input: FieldInput,\n Textarea: FieldTextarea,\n HelperText: FieldHelperText,\n ErrorText: FieldErrorText,\n StartIndicator: FieldStartIndicator,\n StatusIndicator: FieldStatusIndicator,\n RequiredIndicator: FieldRequiredIndicator,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,IAAAC,sBAAA;AAVD,SAASC,OAAM,OAAmB;AACvC,QAAM,CAAC,aAAa,YAAY,SAAS,IAAI;AAAA,IAC3C;AAAA,IACA,CAAC,YAAY,YAAY,YAAY,SAAS;AAAA,IAC9C,CAAC,SAAS,cAAc,uBAAuB,aAAa,UAAU;AAAA,EACxE;AAEA,SACE,8CAAC,aAAW,GAAG,aAAc,GAAG,WAC9B;AAAA,iDAAC,QAAK,MAAM,WAAW,OACrB,uDAAC,cAAY,qBAAW,OAAM,GAChC;AAAA,IAEC,WAAW;AAAA,IAEZ,6CAAC,QAAK,MAAM,WAAW,cAAc,CAAC,YAAY,SAChD,wDAAC,qBAAO,gBAAe,iBAAgB,GAAE,QACvC;AAAA,mDAAC,mBAAiB,qBAAW,YAAW;AAAA,MACxC,6CAAC,QAAK,MAAM,WAAW,qBACrB,uDAAC,mBAAiB,qBAAW,qBAAoB,GACnD;AAAA,OACF,GACF;AAAA,IAEA,6CAAC,kBAAgB,qBAAW,WAAU;AAAA,KACxC;AAEJ;;;AEVO,IAAM,aAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,mBAAmB;AACrB;","names":["Field","import_css","import_recipes","import_react","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Field"]}
1
+ {"version":3,"sources":["../../../../src/components/field/index.ts","../../../../src/utils/index.ts","../../../../src/components/field/primitives.tsx","../../../../src/components/field/status-indicator.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/field/start-indicator.tsx","../../../../src/components/field/field.tsx","../../../../src/components/Show.tsx","../../../../src/components/field/helper-text.tsx","../../../../src/components/field/parts.ts"],"sourcesContent":["export * from './field'\nexport * from './primitives'\nexport * from './start-indicator'\nexport * from './status-indicator'\nexport * from './parts'\n","/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n\n/**\n * Splits the properties of an object into multiple groups based on lists of keys.\n * @param props - The object to split.\n * @param keyGroups - The lists of keys to include in each group.\n * @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.\n */\nexport function splitProps<T extends object>(\n props: T,\n ...keyGroups: (keyof T)[][]\n): { [K in keyof T]?: T[K] }[] {\n const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })\n const rest = {} as { [K in keyof T]?: T[K] }\n\n for (const key in props) {\n let assigned = false\n for (let i = 0; i < keyGroups.length; i++) {\n if (keyGroups[i].includes(key as keyof T)) {\n result[i][key as keyof T] = props[key]\n assigned = true\n break\n }\n }\n if (!assigned) {\n rest[key as keyof T] = props[key]\n }\n }\n\n return [...result, rest]\n}\n\nexport * from './localStorage'\n","import {\n Field,\n type FieldHelperTextProps,\n type FieldInputProps as ArkFieldInputProps,\n type FieldLabelProps,\n type FieldRootProps as ArkFieldRootProps,\n type FieldTextareaProps,\n} from '@ark-ui/react/field'\nimport type { ReactNode } from 'react'\nimport { cx } from 'styled-system/css'\nimport { field, type FieldVariantProps } from 'styled-system/recipes'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains all the primitives of the Field component.\n * @module 'field'\n */\n\nexport type FieldRootProps = ArkFieldRootProps & FieldVariantProps\n\n/**\n * The context & container for the Field components.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot required ids={{ input: 'exampleId' }}>\n * <FieldLabel>Label</FieldLabel>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldRoot(props: FieldRootProps) {\n const { size, ...fieldProps } = props\n const styles = field({ size })\n return (\n <Field.Root\n {...fieldProps}\n className={cx(styles.root, fieldProps.className)}\n />\n )\n}\n\n/**\n * The label for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldLabel>Label</FieldLabel>\n * </FieldRoot>\n * ```\n */\nexport function FieldLabel(props: FieldLabelProps) {\n const { children, ...nativeProps } = props\n const styles = field()\n return (\n <Field.Label {...nativeProps} className={cx(styles.label, props.className)}>\n {children}\n <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n </Field.Label>\n )\n}\n\n/**\n * The required indicator for the Field component.\n */\nexport function FieldRequiredIndicator() {\n return <Field.RequiredIndicator>(required)</Field.RequiredIndicator>\n}\n\nexport interface FieldInputProps\n extends Omit<ArkFieldInputProps, 'size'>,\n FieldVariantProps {\n /**\n * An optional icon to display at the start of the input.\n */\n startIcon?: ReactNode\n /**\n * An optional icon to display at the end of the input.\n */\n endIcon?: ReactNode\n}\n\n/**\n * The input for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * </FieldRoot>\n * ```\n */\nexport function FieldInput(props: FieldInputProps) {\n const { size, startIcon, endIcon, ...fieldProps } = props\n const styles = field({ size })\n const hasStartIcon = Boolean(startIcon)\n\n return (\n <div className={styles.inputRoot}>\n <FieldStartIndicator>{startIcon}</FieldStartIndicator>\n <Field.Input\n {...fieldProps}\n {...(hasStartIcon && { 'data-has': 'start-indicator' })}\n className={cx(styles.input, fieldProps.className)}\n />\n <FieldStatusIndicator fallback={endIcon} />\n </div>\n )\n}\n\n/**\n * The helper text for the Field component that is shown when the field is\n * valid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldHelperText>Helper text</FieldHelperText>\n * </FieldRoot>\n * ```\n */\nexport function FieldHelperText(props: FieldHelperTextProps) {\n const styles = field()\n return (\n <Field.HelperText\n {...props}\n className={cx(styles.helperText, props.className)}\n />\n )\n}\n\n/**\n * The error text for the Field component that is shown when the field is\n * invalid.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldInput />\n * <FieldErrorText>Error text</FieldErrorText>\n * </FieldRoot>\n * ```\n */\nexport function FieldErrorText(props: FieldHelperTextProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <Field.ErrorText\n {...props}\n className={cx(styles.errorText, props.className)}\n />\n )\n}\n\n/**\n * The textarea for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldTextarea />\n * </FieldRoot>\n * ```\n */\nexport function FieldTextarea(props: FieldTextareaProps) {\n const styles = field()\n return (\n <Field.Textarea\n {...props}\n className={cx(styles.textarea, props.className)}\n />\n )\n}\n\n/**\n * A named export for the FieldInput component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * import { Input } from '@cerberus/react'\n *\n * <Field\n * ids={{\n * control: 'email',\n * }}\n * label=\"Enter your email\"\n * helperText=\"We'll never share your email with anyone else.\"\n * errorText=\"Email is required.\"\n * required\n * >\n * <Input type=\"email\" />\n * </Field>\n * ```\n */\nexport const Input = FieldInput\nexport const Textarea = FieldTextarea\n","'use client'\n\nimport { useFieldContext } from '@ark-ui/react'\nimport { cx } from 'styled-system/css'\nimport { field } from 'styled-system/recipes'\nimport { useCerberusContext } from '../../context/cerberus'\nimport type { HTMLAttributes, ReactNode } from 'react'\n\nexport interface FieldStatusIndicatorProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The fallback content to display when the field is valid.\n */\n fallback?: ReactNode\n}\n\n/**\n * The invalid status indicator for the Field component.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <FieldRoot>\n * <FieldStatusIndicator />\n * </FieldRoot>\n * ```\n */\nexport function FieldStatusIndicator(props: FieldStatusIndicatorProps) {\n const { fallback, ...nativeProps } = props\n const styles = field()\n const fieldContext = useFieldContext()\n\n const { icons } = useCerberusContext()\n const { invalid: InvalidIcon } = icons\n\n if (fieldContext.invalid) {\n return (\n <span\n {...nativeProps}\n aria-hidden=\"true\"\n data-invalid\n className={cx(nativeProps.className, styles.statusIndicator)}\n >\n <InvalidIcon />\n </span>\n )\n }\n\n return (\n <span\n {...nativeProps}\n aria-hidden=\"true\"\n data-part=\"end-indicator\"\n className={cx(nativeProps.className, styles.endIndicator)}\n >\n {fallback}\n </span>\n )\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import { cx } from 'styled-system/css'\nimport { field } from 'styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\nexport type FieldIndicatorProps = HTMLAttributes<HTMLSpanElement>\n\n/**\n * The start indicator displays an indicator at the start of the Input.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n */\nexport function FieldStartIndicator(props: FieldIndicatorProps) {\n const styles = field()\n\n if (!props.children) return null\n\n return (\n <span\n {...props}\n data-part=\"start-indicator\"\n className={cx(props.className, styles.startIndicator)}\n />\n )\n}\n","import { type FieldRootProps } from '@ark-ui/react/field'\nimport { splitProps } from '../../utils/index'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldLabel,\n FieldRoot,\n} from './primitives'\nimport { HStack } from 'styled-system/jsx'\nimport { Show } from '../Show'\nimport { HelperText } from './helper-text'\n\nexport interface FieldProps extends FieldRootProps {\n /**\n * The label of the field.\n */\n label?: string\n /**\n * The helper text of the field.\n */\n helperText?: string\n /**\n * A helper text positioned at the end of the field. Good for Textarea fields.\n */\n secondaryHelperText?: string\n /**\n * The error text of the field. Shown when the field is invalid.\n */\n errorText?: string\n}\n\n/**\n * The Field component is the context provider for all FieldParts and displays\n * the label, helperText, and ErrorText.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <Field\n * ids={{\n * control: 'firstName',\n * }}\n * label=\"Label\"\n * helperText=\"This is what people will see on your profile.\"\n * errorText=\"A first name is required to create an account.\"\n * required\n * >\n * <Input name=\"firstName\" type=\"text\" />\n * </Field>\n * ```\n */\nexport function Field(props: FieldProps) {\n const [statusProps, fieldProps, rootProps] = splitProps(\n props,\n ['disabled', 'required', 'readOnly', 'invalid'],\n ['label', 'helperText', 'secondaryHelperText', 'errorText', 'children'],\n )\n\n return (\n <FieldRoot {...statusProps} {...rootProps}>\n <Show when={fieldProps.label}>\n <FieldLabel>{fieldProps.label}</FieldLabel>\n </Show>\n\n {fieldProps.children}\n\n <HStack justifyContent=\"space-between\" w=\"full\">\n <HelperText invalid={statusProps.invalid}>\n {fieldProps.helperText}\n </HelperText>\n\n <FieldErrorText>{fieldProps.errorText}</FieldErrorText>\n\n <Show when={fieldProps.secondaryHelperText}>\n <FieldHelperText>{fieldProps.secondaryHelperText}</FieldHelperText>\n </Show>\n </HStack>\n </FieldRoot>\n )\n}\n","import { type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps<T> {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: T | boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show<T>(props: PropsWithChildren<ShowProps<T>>) {\n const { when, children, fallback } = props\n\n if (when) {\n return <>{children}</>\n }\n\n if (fallback) {\n return <>{fallback}</>\n }\n\n return null\n}\n","import type { PropsWithChildren } from 'react'\nimport { FieldHelperText } from './primitives'\n\ninterface HelperTextProps {\n invalid?: boolean\n}\n\n/**\n * The HelperText component is an abstraction for hiding the helper text\n * when the field is invalid. Ark UI assumes people want the helper text\n * to always be visible, so this is a workaround for that.\n */\nexport function HelperText(props: PropsWithChildren<HelperTextProps>) {\n if (props.invalid) return null\n return (\n <FieldHelperText data-has-content={Boolean(props.children)}>\n {props.children}\n </FieldHelperText>\n )\n}\n","import type { ElementType } from 'react'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldInput,\n FieldLabel,\n FieldRequiredIndicator,\n FieldRoot,\n FieldTextarea,\n} from './primitives'\nimport { FieldStatusIndicator } from './status-indicator'\nimport { FieldStartIndicator } from './start-indicator'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface FieldPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The input of the field.\n */\n Input: ElementType\n /**\n * The textarea of the field.\n */\n Textarea: ElementType\n /**\n * The text that displays when the field is valid.\n */\n HelperText: ElementType\n /**\n * The text that displays when the field is invalid.\n */\n ErrorText: ElementType\n /**\n * The indicator that appears at the start of the field.\n */\n StartIndicator: ElementType\n /**\n * The status indicator of the field.\n */\n StatusIndicator: ElementType\n /**\n * The indicator that appears at the end of the field.\n */\n RequiredIndicator: ElementType\n}\n\n/**\n * An Object containing the parts of the Field component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the FieldParts object and\n * the entire family of components vs. only what you use.\n */\nexport const FieldParts: FieldPartsValue = {\n Root: FieldRoot,\n Label: FieldLabel,\n Input: FieldInput,\n Textarea: FieldTextarea,\n HelperText: FieldHelperText,\n ErrorText: FieldErrorText,\n StartIndicator: FieldStartIndicator,\n StatusIndicator: FieldStatusIndicator,\n RequiredIndicator: FieldRequiredIndicator,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0BO,SAAS,WACd,UACG,WAC0B;AAC7B,QAAM,SAAS,UAAU,IAAI,OAAO,CAAC,EAA+B;AACpE,QAAM,OAAO,CAAC;AAEd,aAAW,OAAO,OAAO;AACvB,QAAI,WAAW;AACf,aAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,UAAI,UAAU,CAAC,EAAE,SAAS,GAAc,GAAG;AACzC,eAAO,CAAC,EAAE,GAAc,IAAI,MAAM,GAAG;AACrC,mBAAW;AACX;AAAA,MACF;AAAA,IACF;AACA,QAAI,CAAC,UAAU;AACb,WAAK,GAAc,IAAI,MAAM,GAAG;AAAA,IAClC;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,QAAQ,IAAI;AACzB;;;AChDA,mBAOO;AAEP,IAAAC,cAAmB;AACnB,IAAAC,kBAA8C;;;ACR9C,IAAAC,gBAAgC;AAChC,iBAAmB;AACnB,qBAAsB;;;ACFtB,mBAAkE;AAyB9D;AAfJ,IAAM,sBAAkB,4BAA2C,IAAI;AAyBhE,SAAS,qBAAqB;AACnC,QAAM,cAAU,yBAAW,eAAe;AAC1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,S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AAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,mBAAmB;AACrB;","names":["Field","import_css","import_recipes","import_react","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Field"]}
@@ -138,7 +138,6 @@ function FieldInput(props) {
138
138
  }
139
139
  function FieldHelperText(props) {
140
140
  const styles = (0, import_recipes3.field)();
141
- if (!props.children) return null;
142
141
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
143
142
  import_field.Field.HelperText,
144
143
  {