@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/field/helper-text.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"],"mappings":";;;;;AAeI;AAHG,SAAS,WAAW,OAA2C;AACpE,MAAI,MAAM,QAAS,QAAO;AAC1B,SACE,oBAAC,mBAAgB,oBAAkB,QAAQ,MAAM,QAAQ,GACtD,gBAAM,UACT;AAEJ;","names":[]}
@@ -0,0 +1,17 @@
1
+ // src/components/date-picker/index.ts
2
+ import { parseDate } from "@ark-ui/react/date-picker";
3
+ import {
4
+ CalendarDate,
5
+ today,
6
+ getLocalTimeZone,
7
+ DateFormatter
8
+ } from "@internationalized/date";
9
+
10
+ export {
11
+ parseDate,
12
+ CalendarDate,
13
+ today,
14
+ getLocalTimeZone,
15
+ DateFormatter
16
+ };
17
+ //# sourceMappingURL=chunk-ADI4DOEW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/date-picker/index.ts"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './date-picker'\nexport * from './input'\nexport * from './range-input'\nexport * from './calendar'\n\n// external dependencies\n\nexport { parseDate, type DateValue } from '@ark-ui/react/date-picker'\nexport {\n CalendarDate,\n today,\n getLocalTimeZone,\n DateFormatter,\n} from '@internationalized/date'\n"],"mappings":";AASA,SAAS,iBAAiC;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FieldLabel
3
- } from "./chunk-WEL43I6Y.js";
3
+ } from "./chunk-OK3VJFQL.js";
4
4
 
5
5
  // src/components/deprecated/Label.tsx
6
6
  import { label } from "styled-system/recipes";
@@ -20,4 +20,4 @@ function Label(props) {
20
20
  export {
21
21
  Label
22
22
  };
23
- //# sourceMappingURL=chunk-GBCF6DOS.js.map
23
+ //# sourceMappingURL=chunk-AN65HXHS.js.map
@@ -2,7 +2,7 @@ import {
2
2
  DialogBackdrop,
3
3
  DialogContent,
4
4
  DialogPositioner
5
- } from "./chunk-SSR3CWJZ.js";
5
+ } from "./chunk-LUGOJGMO.js";
6
6
  import {
7
7
  Portal
8
8
  } from "./chunk-53YVHIGJ.js";
@@ -19,4 +19,4 @@ function Dialog(props) {
19
19
  export {
20
20
  Dialog
21
21
  };
22
- //# sourceMappingURL=chunk-Z2KBUTCO.js.map
22
+ //# sourceMappingURL=chunk-BMDNCJUB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/dialog/dialog.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"],"mappings":";;;;;;;;;;AAmCI,SACE,KADF;AAFG,SAAS,OAAO,OAAoB;AACzC,SACE,qBAAC,UACC;AAAA,wBAAC,kBAAe;AAAA,IAChB,oBAAC,oBACC,8BAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DialogCloseTrigger
3
- } from "./chunk-SSR3CWJZ.js";
3
+ } from "./chunk-LUGOJGMO.js";
4
4
  import {
5
5
  useCerberusContext
6
6
  } from "./chunk-GITT5645.js";
@@ -39,4 +39,4 @@ function DialogCloseIconTrigger(props) {
39
39
  export {
40
40
  DialogCloseIconTrigger
41
41
  };
42
- //# sourceMappingURL=chunk-F3XFJHGR.js.map
42
+ //# sourceMappingURL=chunk-D7PY357P.js.map
@@ -6,7 +6,7 @@ import {
6
6
  FieldRequiredIndicator,
7
7
  FieldRoot,
8
8
  FieldTextarea
9
- } from "./chunk-WEL43I6Y.js";
9
+ } from "./chunk-OK3VJFQL.js";
10
10
  import {
11
11
  FieldStartIndicator
12
12
  } from "./chunk-EMDNETC7.js";
@@ -30,4 +30,4 @@ var FieldParts = {
30
30
  export {
31
31
  FieldParts
32
32
  };
33
- //# sourceMappingURL=chunk-ILROS7ST.js.map
33
+ //# sourceMappingURL=chunk-DVCTN3GN.js.map
@@ -14,8 +14,8 @@ function DatePickerInput(props) {
14
14
  DatePickerParts.Input,
15
15
  {
16
16
  ...props,
17
- placeholder: props.placeholder ?? "DD MMM YYYY",
18
- maxLength: 11
17
+ maxLength: 11,
18
+ placeholder: props.placeholder ?? "DD MMM YYYY"
19
19
  }
20
20
  )
21
21
  ] });
@@ -24,4 +24,4 @@ function DatePickerInput(props) {
24
24
  export {
25
25
  DatePickerInput
26
26
  };
27
- //# sourceMappingURL=chunk-NP73HOHI.js.map
27
+ //# sourceMappingURL=chunk-GJBUGESH.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/date-picker/input.tsx"],"sourcesContent":["import type { DatePickerInputProps } from '@ark-ui/react/date-picker'\nimport { DatePickerTrigger } from './trigger'\nimport { DatePickerParts } from './parts'\n\n/**\n * This module contains an abstraction of the DatePickerInputEl primitive.\n * @module 'date-picker/input'\n */\n\n/**\n * An abstraction of the DatePicker input that wraps the input and the\n * triggers to open the DatePicker and clear the value.\n * @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)\n */\nexport function DatePickerInput(props: DatePickerInputProps) {\n return (\n <DatePickerParts.Control>\n <DatePickerTrigger />\n <DatePickerParts.Input\n {...props}\n placeholder={props.placeholder ?? 'DD MMM YYYY'}\n maxLength={11}\n />\n </DatePickerParts.Control>\n )\n}\n"],"mappings":";;;;;;;;AAgBI,SACE,KADF;AAFG,SAAS,gBAAgB,OAA6B;AAC3D,SACE,qBAAC,gBAAgB,SAAhB,EACC;AAAA,wBAAC,qBAAkB;AAAA,IACnB;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACE,GAAG;AAAA,QACJ,aAAa,MAAM,eAAe;AAAA,QAClC,WAAW;AAAA;AAAA,IACb;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/date-picker/input.tsx"],"sourcesContent":["import type { DatePickerInputProps } from '@ark-ui/react/date-picker'\nimport { DatePickerTrigger } from './trigger'\nimport { DatePickerParts } from './parts'\n\n/**\n * This module contains an abstraction of the DatePickerInputEl primitive.\n * @module 'date-picker/input'\n */\n\n/**\n * An abstraction of the DatePicker input that wraps the input and the\n * triggers to open the DatePicker and clear the value.\n * @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)\n */\nexport function DatePickerInput(props: DatePickerInputProps) {\n return (\n <DatePickerParts.Control>\n <DatePickerTrigger />\n <DatePickerParts.Input\n {...props}\n maxLength={11}\n placeholder={props.placeholder ?? 'DD MMM YYYY'}\n />\n </DatePickerParts.Control>\n )\n}\n"],"mappings":";;;;;;;;AAgBI,SACE,KADF;AAFG,SAAS,gBAAgB,OAA6B;AAC3D,SACE,qBAAC,gBAAgB,SAAhB,EACC;AAAA,wBAAC,qBAAkB;AAAA,IACnB;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACE,GAAG;AAAA,QACJ,WAAW;AAAA,QACX,aAAa,MAAM,eAAe;AAAA;AAAA,IACpC;AAAA,KACF;AAEJ;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Field
3
- } from "./chunk-LEBDLXJE.js";
3
+ } from "./chunk-RTLS6K4E.js";
4
4
  import {
5
5
  FieldHelperText
6
- } from "./chunk-WEL43I6Y.js";
6
+ } from "./chunk-OK3VJFQL.js";
7
7
  import {
8
8
  Avatar
9
9
  } from "./chunk-CF4TCMJI.js";
@@ -223,4 +223,4 @@ export {
223
223
  processStatus,
224
224
  FileStatus
225
225
  };
226
- //# sourceMappingURL=chunk-KABRV6TB.js.map
226
+ //# sourceMappingURL=chunk-JXWNDJJW.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  Dialog
4
4
  } from "@ark-ui/react/dialog";
5
- import { cx } from "styled-system/css";
5
+ import { css, cx } from "styled-system/css";
6
6
  import { dialog } from "styled-system/recipes";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  function DialogRoot(props) {
@@ -39,13 +39,13 @@ function DialogPositioner(props) {
39
39
  );
40
40
  }
41
41
  function DialogContent(props) {
42
- const { size, ...contentProps } = props;
42
+ const { size, css: customStyles, ...contentProps } = props;
43
43
  const styles = dialog({ size });
44
44
  return /* @__PURE__ */ jsx(
45
45
  Dialog.Content,
46
46
  {
47
47
  ...contentProps,
48
- className: cx(styles.content, contentProps.className)
48
+ className: cx(styles.content, css(customStyles), contentProps.className)
49
49
  }
50
50
  );
51
51
  }
@@ -79,4 +79,4 @@ export {
79
79
  DialogCloseTrigger,
80
80
  DialogProvider
81
81
  };
82
- //# sourceMappingURL=chunk-SSR3CWJZ.js.map
82
+ //# sourceMappingURL=chunk-LUGOJGMO.js.map
@@ -0,0 +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 { 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,EACE;AAAA,OAQK;AACP,SAAS,KAAK,UAAU;AACxB,SAAS,cAAuC;AAYvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,oBAAC,OAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,eAAe,OAA4B;AACzD,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cACd,OACA;AACA,QAAM,EAAE,MAAM,KAAK,cAAc,GAAG,aAAa,IAAI;AACrD,QAAM,SAAS,OAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,SAAS,IAAI,YAAY,GAAG,aAAa,SAAS;AAAA;AAAA,EACzE;AAEJ;AAKO,SAAS,cAAc,OAAyB;AACrD,QAAM,SAAS,OAAO;AACtB,SACE,oBAAC,OAAO,OAAP,EAAc,GAAG,OAAO,WAAW,GAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,aAAa,MAAM,SAAS;AAAA;AAAA,EACnD;AAEJ;AAKO,SAAS,mBAAmB,OAA2B;AAC5D,SAAO,oBAAC,OAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;AAMO,IAAM,iBAAiB;","names":[]}
@@ -1,9 +1,9 @@
1
- import {
2
- MatchAvatar
3
- } from "./chunk-NJ37QRAI.js";
4
1
  import {
5
2
  AdmonitionParts
6
3
  } from "./chunk-JQYW4IOC.js";
4
+ import {
5
+ MatchAvatar
6
+ } from "./chunk-NJ37QRAI.js";
7
7
  import {
8
8
  splitProps
9
9
  } from "./chunk-BL7G3577.js";
@@ -38,4 +38,4 @@ function Admonition(props) {
38
38
  export {
39
39
  Admonition
40
40
  };
41
- //# sourceMappingURL=chunk-3IT3V3YA.js.map
41
+ //# sourceMappingURL=chunk-M3TZCQ7J.js.map
@@ -53,7 +53,6 @@ function FieldInput(props) {
53
53
  }
54
54
  function FieldHelperText(props) {
55
55
  const styles = field();
56
- if (!props.children) return null;
57
56
  return /* @__PURE__ */ jsx(
58
57
  Field.HelperText,
59
58
  {
@@ -97,4 +96,4 @@ export {
97
96
  Input,
98
97
  Textarea
99
98
  };
100
- //# sourceMappingURL=chunk-WEL43I6Y.js.map
99
+ //# sourceMappingURL=chunk-OK3VJFQL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/field/primitives.tsx"],"sourcesContent":["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 *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6B;AAC3D,QAAM,SAAS,MAAM;AAErB,MAAI,CAAC,MAAM,SAAU,QAAO;AAE5B,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAcO,SAAS,eAAe,OAA6B;AAC1D,QAAM,SAAS,MAAM;AAErB,MAAI,CAAC,MAAM,SAAU,QAAO;AAE5B,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,WAAW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;AAYO,SAAS,cAAc,OAA2B;AACvD,QAAM,SAAS,MAAM;AACrB,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAsBO,IAAM,QAAQ;AACd,IAAM,WAAW;","names":[]}
1
+ {"version":3,"sources":["../../src/components/field/primitives.tsx"],"sourcesContent":["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,EACE;AAAA,OAMK;AAEP,SAAS,UAAU;AACnB,SAAS,aAAqC;AA0B1C,cAqBA,YArBA;AAJG,SAAS,UAAU,OAAuB;AAC/C,QAAM,EAAE,MAAM,GAAG,WAAW,IAAI;AAChC,QAAM,SAAS,MAAM,EAAE,KAAK,CAAC;AAC7B,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,MAAM,WAAW,SAAS;AAAA;AAAA,EACjD;AAEJ;AAYO,SAA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,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAsBO,IAAM,QAAQ;AACd,IAAM,WAAW;","names":[]}
@@ -6,20 +6,15 @@ import {
6
6
  } from "./chunk-J76SGDYP.js";
7
7
 
8
8
  // src/components/date-picker/range-input.tsx
9
- import { useMemo } from "react";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
11
10
  function RangePickerInput(props) {
12
- const { defaultValue, ...nativeProps } = props;
13
- const startDate = useMemo(() => defaultValue?.[0], [defaultValue]);
14
- const endDate = useMemo(() => defaultValue?.[1], [defaultValue]);
15
11
  return /* @__PURE__ */ jsxs(DatePickerParts.Control, { "data-range": true, children: [
16
12
  /* @__PURE__ */ jsx(DatePickerTrigger, {}),
17
13
  /* @__PURE__ */ jsx(
18
14
  DatePickerParts.Input,
19
15
  {
20
- ...nativeProps,
16
+ ...props,
21
17
  "data-range-input": true,
22
- defaultValue: startDate,
23
18
  placeholder: props.placeholder ?? "DD MMM YYYY",
24
19
  maxLength: 11,
25
20
  index: 0
@@ -28,9 +23,8 @@ function RangePickerInput(props) {
28
23
  /* @__PURE__ */ jsx(
29
24
  DatePickerParts.Input,
30
25
  {
31
- ...nativeProps,
26
+ ...props,
32
27
  "data-range-input": true,
33
- defaultValue: endDate,
34
28
  "data-range-end-input": true,
35
29
  placeholder: props.placeholder ?? "DD MMM YYYY",
36
30
  maxLength: 11,
@@ -43,4 +37,4 @@ function RangePickerInput(props) {
43
37
  export {
44
38
  RangePickerInput
45
39
  };
46
- //# sourceMappingURL=chunk-ADZRQNW3.js.map
40
+ //# sourceMappingURL=chunk-P7FPAUWN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/date-picker/range-input.tsx"],"sourcesContent":["import { type DatePickerInputProps } from '@ark-ui/react/date-picker'\nimport { DatePickerParts } from './parts'\nimport { DatePickerTrigger } from './trigger'\n\n/**\n * This private module contains the RangePickerInput component.\n * @module RangePickerInput\n */\n\nexport type RangePickerInputProps = DatePickerInputProps\n\n/**\n * An abstraction of the DatePicker input that wraps the input and the\n * triggers to open the DatePicker and clear the value.\n * @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)\n */\nexport function RangePickerInput(props: RangePickerInputProps) {\n return (\n <DatePickerParts.Control data-range>\n <DatePickerTrigger />\n <DatePickerParts.Input\n {...props}\n data-range-input\n placeholder={props.placeholder ?? 'DD MMM YYYY'}\n maxLength={11}\n index={0}\n />\n <DatePickerParts.Input\n {...props}\n data-range-input\n data-range-end-input\n placeholder={props.placeholder ?? 'DD MMM YYYY'}\n maxLength={11}\n index={1}\n />\n </DatePickerParts.Control>\n )\n}\n"],"mappings":";;;;;;;;AAkBI,SACE,KADF;AAFG,SAAS,iBAAiB,OAA8B;AAC7D,SACE,qBAAC,gBAAgB,SAAhB,EAAwB,cAAU,MACjC;AAAA,wBAAC,qBAAkB;AAAA,IACnB;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACE,GAAG;AAAA,QACJ,oBAAgB;AAAA,QAChB,aAAa,MAAM,eAAe;AAAA,QAClC,WAAW;AAAA,QACX,OAAO;AAAA;AAAA,IACT;AAAA,IACA;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACE,GAAG;AAAA,QACJ,oBAAgB;AAAA,QAChB,wBAAoB;AAAA,QACpB,aAAa,MAAM,eAAe;AAAA,QAClC,WAAW;AAAA,QACX,OAAO;AAAA;AAAA,IACT;AAAA,KACF;AAEJ;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-52ZQ26IV.js";
7
7
  import {
8
8
  Text
9
- } from "./chunk-L64HQGLQ.js";
9
+ } from "./chunk-ZPHPCKAG.js";
10
10
  import {
11
11
  Show
12
12
  } from "./chunk-VEAC4I3F.js";
@@ -28,4 +28,4 @@ function Checkbox(props) {
28
28
  export {
29
29
  Checkbox
30
30
  };
31
- //# sourceMappingURL=chunk-OY7BOKWW.js.map
31
+ //# sourceMappingURL=chunk-QBA6KLL7.js.map
@@ -0,0 +1,218 @@
1
+ import {
2
+ Dialog
3
+ } from "./chunk-BMDNCJUB.js";
4
+ import {
5
+ DialogDescription,
6
+ DialogHeading,
7
+ DialogProvider
8
+ } from "./chunk-LUGOJGMO.js";
9
+ import {
10
+ Button
11
+ } from "./chunk-GB7W3YNU.js";
12
+ import {
13
+ Text
14
+ } from "./chunk-ZPHPCKAG.js";
15
+ import {
16
+ FieldLabel,
17
+ FieldRoot,
18
+ Input
19
+ } from "./chunk-OK3VJFQL.js";
20
+ import {
21
+ Avatar
22
+ } from "./chunk-CF4TCMJI.js";
23
+ import {
24
+ useCerberusContext
25
+ } from "./chunk-GITT5645.js";
26
+ import {
27
+ Show
28
+ } from "./chunk-VEAC4I3F.js";
29
+
30
+ // src/context/prompt-modal.tsx
31
+ import {
32
+ createContext,
33
+ useCallback,
34
+ useContext,
35
+ useMemo,
36
+ useRef,
37
+ useState
38
+ } from "react";
39
+ import { DialogCloseTrigger } from "@ark-ui/react/dialog";
40
+ import { HStack, VStack } from "styled-system/jsx";
41
+ import { css } from "styled-system/css";
42
+ import { hstack } from "styled-system/patterns";
43
+ import { jsx, jsxs } from "react/jsx-runtime";
44
+ var PromptModalContext = createContext(null);
45
+ function PromptModal(props) {
46
+ const resolveRef = useRef(null);
47
+ const [open, setOpen] = useState(false);
48
+ const [content, setContent] = useState(null);
49
+ const [inputValue, setInputValue] = useState("");
50
+ const { icons } = useCerberusContext();
51
+ const { promptModal: PromptIcon } = icons;
52
+ const isValid = useMemo(
53
+ () => inputValue === content?.key,
54
+ [inputValue, content]
55
+ );
56
+ const palette = useMemo(
57
+ () => content?.kind === "destructive" ? "danger" : "action",
58
+ [content]
59
+ );
60
+ const handleChange = useCallback(
61
+ (e) => {
62
+ setInputValue(e.currentTarget.value);
63
+ },
64
+ [content]
65
+ );
66
+ const handleChoice = useCallback(
67
+ (e) => {
68
+ const target = e.currentTarget;
69
+ if (target.value === "true") {
70
+ resolveRef.current?.(inputValue);
71
+ }
72
+ setOpen(false);
73
+ },
74
+ [inputValue, setOpen]
75
+ );
76
+ const handleShow = useCallback(
77
+ (options) => {
78
+ return new Promise((resolve) => {
79
+ setContent({ ...options, kind: options.kind || "non-destructive" });
80
+ setOpen(true);
81
+ resolveRef.current = resolve;
82
+ });
83
+ },
84
+ [setOpen]
85
+ );
86
+ const value = useMemo(
87
+ () => ({
88
+ show: handleShow
89
+ }),
90
+ [handleShow]
91
+ );
92
+ return /* @__PURE__ */ jsxs(PromptModalContext.Provider, { value, children: [
93
+ props.children,
94
+ /* @__PURE__ */ jsx(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ jsx(
95
+ Dialog,
96
+ {
97
+ size: "sm",
98
+ style: {
99
+ "--dialog-content-min-h": "auto"
100
+ },
101
+ children: /* @__PURE__ */ jsxs(
102
+ VStack,
103
+ {
104
+ alignItems: "flex-start",
105
+ h: "full",
106
+ justify: "space-between",
107
+ w: "full",
108
+ children: [
109
+ /* @__PURE__ */ jsx(
110
+ HStack,
111
+ {
112
+ alignSelf: "center",
113
+ justify: "center",
114
+ paddingBlockEnd: "md",
115
+ w: "full",
116
+ children: /* @__PURE__ */ jsx(
117
+ Show,
118
+ {
119
+ when: palette === "danger",
120
+ fallback: /* @__PURE__ */ jsx(
121
+ Avatar,
122
+ {
123
+ gradient: "charon-light",
124
+ fallback: /* @__PURE__ */ jsx(PromptIcon, { size: 24 })
125
+ }
126
+ ),
127
+ children: /* @__PURE__ */ jsx(
128
+ Avatar,
129
+ {
130
+ gradient: "hades-dark",
131
+ fallback: /* @__PURE__ */ jsx(PromptIcon, { size: 24 })
132
+ }
133
+ )
134
+ }
135
+ )
136
+ }
137
+ ),
138
+ /* @__PURE__ */ jsx(DialogHeading, { children: content?.heading }),
139
+ /* @__PURE__ */ jsx(DialogDescription, { children: content?.description }),
140
+ /* @__PURE__ */ jsx(
141
+ VStack,
142
+ {
143
+ alignItems: "flex-start",
144
+ marginBlockStart: "md",
145
+ marginBlockEnd: "lg",
146
+ w: "full",
147
+ children: /* @__PURE__ */ jsxs(FieldRoot, { invalid: !isValid, children: [
148
+ /* @__PURE__ */ jsxs(
149
+ FieldLabel,
150
+ {
151
+ className: hstack({
152
+ gap: "xs",
153
+ justify: "flex-start",
154
+ marginBlockEnd: "xs",
155
+ textStyle: "label-md",
156
+ w: "initial"
157
+ }),
158
+ children: [
159
+ "Type",
160
+ /* @__PURE__ */ jsx(Text, { as: "strong", textTransform: "uppercase", children: content?.key }),
161
+ "to confirm"
162
+ ]
163
+ }
164
+ ),
165
+ /* @__PURE__ */ jsx(Input, { name: "confirm", onChange: handleChange, type: "text" })
166
+ ] })
167
+ }
168
+ ),
169
+ /* @__PURE__ */ jsxs(HStack, { gap: "md", justify: "stretch", w: "full", children: [
170
+ /* @__PURE__ */ jsx(
171
+ Button,
172
+ {
173
+ autoFocus: true,
174
+ className: css({
175
+ w: "1/2"
176
+ }),
177
+ disabled: !isValid,
178
+ name: "confirm",
179
+ onClick: handleChoice,
180
+ palette,
181
+ value: "true",
182
+ children: content?.actionText
183
+ }
184
+ ),
185
+ /* @__PURE__ */ jsx(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
186
+ Button,
187
+ {
188
+ className: css({
189
+ w: "1/2"
190
+ }),
191
+ name: "cancel",
192
+ onClick: handleChoice,
193
+ usage: "outlined",
194
+ value: "false",
195
+ children: content?.cancelText
196
+ }
197
+ ) })
198
+ ] })
199
+ ]
200
+ }
201
+ )
202
+ }
203
+ ) })
204
+ ] });
205
+ }
206
+ function usePromptModal() {
207
+ const context = useContext(PromptModalContext);
208
+ if (context === null) {
209
+ throw new Error("usePromptModal must be used within a PromptModal Provider");
210
+ }
211
+ return context;
212
+ }
213
+
214
+ export {
215
+ PromptModal,
216
+ usePromptModal
217
+ };
218
+ //# sourceMappingURL=chunk-RMSM3XPV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/prompt-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type MouseEvent,\n type PropsWithChildren,\n} from 'react'\nimport { DialogCloseTrigger } from '@ark-ui/react/dialog'\nimport { HStack, VStack } from 'styled-system/jsx'\nimport { css } from 'styled-system/css'\nimport { hstack } from 'styled-system/patterns'\nimport { FieldLabel, FieldRoot, Input } from '../components/field/index'\nimport { Button } from '../components/button/button'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/avatar/avatar'\nimport { Text } from '../components/Text'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/dialog'\nimport { useCerberusContext } from './cerberus'\n\n/**\n * This module provides a context and hook for the prompt modal.\n * @module PromptModal\n */\n\nexport interface ShowPromptModalOptions {\n /**\n * The kind of prompt modal to show.\n * @default 'non-destructive'\n */\n kind?: 'destructive' | 'non-destructive'\n /**\n * The heading of the prompt modal.\n */\n heading: string\n /**\n * The description of the prompt modal.\n */\n description?: string\n /**\n * The key to confirm the action.\n */\n key: string\n /**\n * The text for the action button.\n */\n actionText: string\n /**\n * The text for the cancel button.\n */\n cancelText: string\n}\nexport type PromptShowResult =\n | ((value: string | PromiseLike<string>) => void)\n | null\n\nexport interface PromptModalValue {\n /**\n * The method to trigger the prompt modal.\n * @returns the value of the key if the action is confirmed.\n * @example\n * ```tsx\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n */\n show: (options: ShowPromptModalOptions) => Promise<string>\n}\n\nconst PromptModalContext = createContext<PromptModalValue | null>(null)\n\nexport type PromptModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a prompt modal to the app.\n * @see https://cerberus.digitalu.design/react/prompt-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <PromptModal>\n * <SomeFeatureSection />\n * </PromptModal>\n *\n * // Use the hook to show the prompt modal.\n * const prompt = usePromptModal()\n *\n * const handleClick = useCallback(async () => {\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n * // do something with accepted\n * }, [prompt])\n * ```\n */\nexport function PromptModal(\n props: PropsWithChildren<PromptModalProviderProps>,\n) {\n const resolveRef = useRef<PromptShowResult>(null)\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowPromptModalOptions | null>(null)\n const [inputValue, setInputValue] = useState<string>('')\n\n const { icons } = useCerberusContext()\n const { promptModal: PromptIcon } = icons\n\n const isValid = useMemo(\n () => inputValue === content?.key,\n [inputValue, content],\n )\n\n const palette = useMemo(\n () => (content?.kind === 'destructive' ? 'danger' : 'action'),\n [content],\n )\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setInputValue(e.currentTarget.value)\n },\n [content],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(inputValue)\n }\n setOpen(false)\n },\n [inputValue, setOpen],\n )\n\n const handleShow = useCallback(\n (options: ShowPromptModalOptions) => {\n return new Promise<string>((resolve) => {\n setContent({ ...options, kind: options.kind || 'non-destructive' })\n setOpen(true)\n resolveRef.current = resolve\n })\n },\n [setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <PromptModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog\n size=\"sm\"\n style={{\n '--dialog-content-min-h': 'auto',\n }}\n >\n <VStack\n alignItems=\"flex-start\"\n h=\"full\"\n justify=\"space-between\"\n w=\"full\"\n >\n <HStack\n alignSelf=\"center\"\n justify=\"center\"\n paddingBlockEnd=\"md\"\n w=\"full\"\n >\n <Show\n when={palette === 'danger'}\n fallback={\n <Avatar\n gradient=\"charon-light\"\n fallback={<PromptIcon size={24} />}\n />\n }\n >\n <Avatar\n gradient=\"hades-dark\"\n fallback={<PromptIcon size={24} />}\n />\n </Show>\n </HStack>\n\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n\n <VStack\n alignItems=\"flex-start\"\n marginBlockStart=\"md\"\n marginBlockEnd=\"lg\"\n w=\"full\"\n >\n <FieldRoot invalid={!isValid}>\n <FieldLabel\n className={hstack({\n gap: 'xs',\n justify: 'flex-start',\n marginBlockEnd: 'xs',\n textStyle: 'label-md',\n w: 'initial',\n })}\n >\n Type\n <Text as=\"strong\" textTransform=\"uppercase\">\n {content?.key}\n </Text>\n to confirm\n </FieldLabel>\n <Input name=\"confirm\" onChange={handleChange} type=\"text\" />\n </FieldRoot>\n </VStack>\n\n <HStack gap=\"md\" justify=\"stretch\" w=\"full\">\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n disabled={!isValid}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n\n <DialogCloseTrigger asChild>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </DialogCloseTrigger>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </PromptModalContext.Provider>\n )\n}\n\n/**\n * Used to retrieve the context of the PromptModal provider.\n */\nexport function usePromptModal(): PromptModalValue {\n const context = useContext(PromptModalContext)\n if (context === null) {\n throw new Error('usePromptModal must be used within a PromptModal Provider')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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AAgB;AAAA,0BAChB,WAAW;AAAA,0BACX,GAAG;AAAA,wBACL,CAAC;AAAA,wBACF;AAAA;AAAA,0BAEC,oBAAC,QAAK,IAAG,UAAS,eAAc,aAC7B,mBAAS,KACZ;AAAA,0BAAO;AAAA;AAAA;AAAA,oBAET;AAAA,oBACA,oBAAC,SAAM,MAAK,WAAU,UAAU,cAAc,MAAK,QAAO;AAAA,qBAC5D;AAAA;AAAA,cACF;AAAA,cAEA,qBAAC,UAAO,KAAI,MAAK,SAAQ,WAAU,GAAE,QACnC;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAS;AAAA,oBACT,WAAW,IAAI;AAAA,sBACb,GAAG;AAAA,oBACL,CAAC;AAAA,oBACD,UAAU,CAAC;AAAA,oBACX,MAAK;AAAA,oBACL,SAAS;AAAA,oBACT;AAAA,oBACA,OAAM;AAAA,oBAEL,mBAAS;AAAA;AAAA,gBACZ;AAAA,gBAEA,oBAAC,sBAAmB,SAAO,MACzB;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW,IAAI;AAAA,sBACb,GAAG;AAAA,oBACL,CAAC;AAAA,oBACD,MAAK;AAAA,oBACL,SAAS;AAAA,oBACT,OAAM;AAAA,oBACN,OAAM;AAAA,oBAEL,mBAAS;AAAA;AAAA,gBACZ,GACF;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GACF;AAAA,KACF;AAEJ;AAKO,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;","names":[]}
@@ -1,9 +1,12 @@
1
+ import {
2
+ HelperText
3
+ } from "./chunk-2U2JYN3D.js";
1
4
  import {
2
5
  FieldErrorText,
3
6
  FieldHelperText,
4
7
  FieldLabel,
5
8
  FieldRoot
6
- } from "./chunk-WEL43I6Y.js";
9
+ } from "./chunk-OK3VJFQL.js";
7
10
  import {
8
11
  splitProps
9
12
  } from "./chunk-BL7G3577.js";
@@ -23,15 +26,15 @@ function Field(props) {
23
26
  return /* @__PURE__ */ jsxs(FieldRoot, { ...statusProps, ...rootProps, children: [
24
27
  /* @__PURE__ */ jsx(Show, { when: fieldProps.label, children: /* @__PURE__ */ jsx(FieldLabel, { children: fieldProps.label }) }),
25
28
  fieldProps.children,
26
- /* @__PURE__ */ jsx(Show, { when: fieldProps.helperText && !statusProps.invalid, children: /* @__PURE__ */ jsxs(HStack, { justifyContent: "space-between", w: "full", children: [
27
- /* @__PURE__ */ jsx(FieldHelperText, { children: fieldProps.helperText }),
29
+ /* @__PURE__ */ jsxs(HStack, { justifyContent: "space-between", w: "full", children: [
30
+ /* @__PURE__ */ jsx(HelperText, { invalid: statusProps.invalid, children: fieldProps.helperText }),
31
+ /* @__PURE__ */ jsx(FieldErrorText, { children: fieldProps.errorText }),
28
32
  /* @__PURE__ */ jsx(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ jsx(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
29
- ] }) }),
30
- /* @__PURE__ */ jsx(FieldErrorText, { children: fieldProps.errorText })
33
+ ] })
31
34
  ] });
32
35
  }
33
36
 
34
37
  export {
35
38
  Field
36
39
  };
37
- //# sourceMappingURL=chunk-LEBDLXJE.js.map
40
+ //# sourceMappingURL=chunk-RTLS6K4E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/field/field.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"],"mappings":";;;;;;;;;;;;;;;;;AAQA,SAAS,cAAc;AAoDf,cAKF,YALE;AAVD,SAAS,MAAM,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,qBAAC,aAAW,GAAG,aAAc,GAAG,WAC9B;AAAA,wBAAC,QAAK,MAAM,WAAW,OACrB,8BAAC,cAAY,qBAAW,OAAM,GAChC;AAAA,IAEC,WAAW;AAAA,IAEZ,qBAAC,UAAO,gBAAe,iBAAgB,GAAE,QACvC;AAAA,0BAAC,cAAW,SAAS,YAAY,SAC9B,qBAAW,YACd;AAAA,MAEA,oBAAC,kBAAgB,qBAAW,WAAU;AAAA,MAEtC,oBAAC,QAAK,MAAM,WAAW,qBACrB,8BAAC,mBAAiB,qBAAW,qBAAoB,GACnD;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}