@bigbinary/neeto-atoms 1.0.10 → 1.0.12

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 (113) hide show
  1. package/dist/{Accordion-BzfsJePA.js → Accordion-Ch9S_qd3.js} +3 -3
  2. package/dist/Accordion-Ch9S_qd3.js.map +1 -0
  3. package/dist/{ColorPicker-D-7QGnf9.js → ColorPicker-DtOvy0Gy.js} +3 -2
  4. package/dist/ColorPicker-DtOvy0Gy.js.map +1 -0
  5. package/dist/Input-C1gcv9o2.js.map +1 -1
  6. package/dist/MultiEmailInput-SCTYovtX.js.map +1 -1
  7. package/dist/RadioGroup-BNeYQAoT.js.map +1 -1
  8. package/dist/{Select-BGODpJGc.js → Select-TlFBcxcY.js} +7 -3
  9. package/dist/Select-TlFBcxcY.js.map +1 -0
  10. package/dist/Textarea-C0z50h0N.js.map +1 -1
  11. package/dist/TimePickerPanel-CiF0RExY.js.map +1 -1
  12. package/dist/TranslationProvider-Ba9rn47H.js.map +1 -1
  13. package/dist/{Tree-Dkr11OPy.js → Tree-C7r10UY5.js} +2 -2
  14. package/dist/{Tree-Dkr11OPy.js.map → Tree-C7r10UY5.js.map} +1 -1
  15. package/dist/{TreeSelect-Cmc90YWJ.js → TreeSelect-DRGcYz-6.js} +2 -2
  16. package/dist/{TreeSelect-Cmc90YWJ.js.map → TreeSelect-DRGcYz-6.js.map} +1 -1
  17. package/dist/{Typography-D5TjXEfu.js → Typography-CMJ8OveZ.js} +3 -9
  18. package/dist/Typography-CMJ8OveZ.js.map +1 -0
  19. package/dist/cjs/{Accordion-BX5I9ypV.js → Accordion-BoTckTBI.js} +3 -3
  20. package/dist/cjs/Accordion-BoTckTBI.js.map +1 -0
  21. package/dist/cjs/{ColorPicker-DEELmqH8.js → ColorPicker-Uxgn8U0h.js} +3 -2
  22. package/dist/cjs/ColorPicker-Uxgn8U0h.js.map +1 -0
  23. package/dist/cjs/Input-pkugjUb0.js.map +1 -1
  24. package/dist/cjs/MultiEmailInput-l0_YVjbp.js.map +1 -1
  25. package/dist/cjs/RadioGroup-1RAoe38m.js.map +1 -1
  26. package/dist/cjs/{Select-DOPZHlqc.js → Select-Br1AT_wm.js} +7 -3
  27. package/dist/cjs/Select-Br1AT_wm.js.map +1 -0
  28. package/dist/cjs/Textarea-BfdlAJ59.js.map +1 -1
  29. package/dist/cjs/TimePickerPanel-DGNr97cj.js.map +1 -1
  30. package/dist/cjs/TranslationProvider-DBZHXmzX.js.map +1 -1
  31. package/dist/cjs/{Tree-qpOcsGL9.js → Tree-BPd0DuLh.js} +2 -2
  32. package/dist/cjs/{Tree-qpOcsGL9.js.map → Tree-BPd0DuLh.js.map} +1 -1
  33. package/dist/cjs/{TreeSelect-DiIEdiAU.js → TreeSelect-C9nQJKNo.js} +2 -2
  34. package/dist/cjs/{TreeSelect-DiIEdiAU.js.map → TreeSelect-C9nQJKNo.js.map} +1 -1
  35. package/dist/cjs/{Typography-C3rGpmAY.js → Typography-PojQmdAY.js} +3 -28
  36. package/dist/cjs/Typography-PojQmdAY.js.map +1 -0
  37. package/dist/cjs/components/Accordion.js +1 -1
  38. package/dist/cjs/components/ColorPicker.js +1 -1
  39. package/dist/cjs/components/DropdownMenu.js.map +1 -1
  40. package/dist/cjs/components/Select.js +1 -1
  41. package/dist/cjs/components/Tree.js +6 -34
  42. package/dist/cjs/components/Tree.js.map +1 -1
  43. package/dist/cjs/components/TreeSelect.js +2 -2
  44. package/dist/cjs/components/Typography.js +1 -1
  45. package/dist/cjs/components/index.js +180 -0
  46. package/dist/cjs/components/index.js.map +1 -0
  47. package/dist/cjs/formik/ActionBlock.js +48 -0
  48. package/dist/cjs/formik/ActionBlock.js.map +1 -0
  49. package/dist/cjs/formik/BlockNavigation.js +111 -0
  50. package/dist/cjs/formik/BlockNavigation.js.map +1 -0
  51. package/dist/cjs/formik/Select.js +2 -2
  52. package/dist/cjs/formik/Select.js.map +1 -1
  53. package/dist/cjs/formik/TreeSelect.js +2 -2
  54. package/dist/cjs/formik/index.js +12 -3
  55. package/dist/cjs/formik/index.js.map +1 -1
  56. package/dist/cjs/index.js +10 -9
  57. package/dist/cjs/index.js.map +1 -1
  58. package/dist/cjs/search-CfYUGi4v.js +37 -0
  59. package/dist/cjs/search-CfYUGi4v.js.map +1 -0
  60. package/dist/components/Accordion/Accordion.d.ts +3 -1
  61. package/dist/components/Accordion.js +1 -1
  62. package/dist/components/ColorPicker/ColorPicker.d.ts +1 -2
  63. package/dist/components/ColorPicker/Palette.d.ts +1 -1
  64. package/dist/components/ColorPicker/types.d.ts +6 -1
  65. package/dist/components/ColorPicker.js +1 -1
  66. package/dist/components/DropdownMenu/MenuItemButton.d.ts +1 -2
  67. package/dist/components/DropdownMenu/index.d.ts +1 -0
  68. package/dist/components/DropdownMenu.js.map +1 -1
  69. package/dist/components/Input/Input.d.ts +3 -1
  70. package/dist/components/MultiEmailInput/MultiEmailInput.d.ts +1 -2
  71. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  72. package/dist/components/RadioGroup/index.d.ts +1 -1
  73. package/dist/components/Select/Select.d.ts +1 -2
  74. package/dist/components/Select.js +1 -1
  75. package/dist/components/Textarea/Textarea.d.ts +3 -1
  76. package/dist/components/TimePicker/TimePickerPanel.d.ts +1 -2
  77. package/dist/components/Tree.js +2 -34
  78. package/dist/components/Tree.js.map +1 -1
  79. package/dist/components/TreeSelect.js +2 -2
  80. package/dist/components/Typography/Typography.d.ts +11 -4
  81. package/dist/components/Typography.js +1 -1
  82. package/dist/components/index.d.ts +36 -0
  83. package/dist/components/index.js +128 -0
  84. package/dist/components/index.js.map +1 -0
  85. package/dist/formik/ActionBlock.d.ts +18 -0
  86. package/dist/formik/ActionBlock.js +46 -0
  87. package/dist/formik/ActionBlock.js.map +1 -0
  88. package/dist/formik/BlockNavigation/BlockNavigationAlert.d.ts +23 -0
  89. package/dist/formik/BlockNavigation/index.d.ts +11 -0
  90. package/dist/formik/BlockNavigation.js +109 -0
  91. package/dist/formik/BlockNavigation.js.map +1 -0
  92. package/dist/formik/RadioGroup.d.ts +11 -0
  93. package/dist/formik/Select.js +2 -2
  94. package/dist/formik/Select.js.map +1 -1
  95. package/dist/formik/TreeSelect.js +2 -2
  96. package/dist/formik/index.d.ts +4 -0
  97. package/dist/formik/index.js +10 -3
  98. package/dist/formik/index.js.map +1 -1
  99. package/dist/hooks/useNavPrompt.d.ts +15 -0
  100. package/dist/index.js +10 -9
  101. package/dist/index.js.map +1 -1
  102. package/dist/search-BK7Ozh5_.js +33 -0
  103. package/dist/search-BK7Ozh5_.js.map +1 -0
  104. package/package.json +18 -7
  105. package/dist/Accordion-BzfsJePA.js.map +0 -1
  106. package/dist/ColorPicker-D-7QGnf9.js.map +0 -1
  107. package/dist/Select-BGODpJGc.js.map +0 -1
  108. package/dist/Typography-D5TjXEfu.js.map +0 -1
  109. package/dist/cjs/Accordion-BX5I9ypV.js.map +0 -1
  110. package/dist/cjs/ColorPicker-DEELmqH8.js.map +0 -1
  111. package/dist/cjs/Select-DOPZHlqc.js.map +0 -1
  112. package/dist/cjs/Typography-C3rGpmAY.js.map +0 -1
  113. package/dist/shadcn/components/typography.d.ts +0 -17
@@ -0,0 +1,128 @@
1
+ export { A as Accordion } from '../Accordion-Ch9S_qd3.js';
2
+ export { A as Alert } from '../Alert-D_FV8xxo.js';
3
+ export { A as Avatar } from '../Avatar-D5YGlXVF.js';
4
+ export { B as Badge } from '../Badge-8FkscqDt.js';
5
+ export { B as Button } from '../Button-Q7MPG6ph.js';
6
+ export { C as Callout } from '../Callout-B0w4GQtx.js';
7
+ export { C as Checkbox } from '../Checkbox-zCxgcZiC.js';
8
+ export { C as ColorPicker } from '../ColorPicker-DtOvy0Gy.js';
9
+ export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from '../DataTable-DWR9gX9d.js';
10
+ export { D as DatePicker } from '../DatePicker-COxwHPIZ.js';
11
+ export { D as Dialog } from '../Dialog-BURSzxaP.js';
12
+ export { DropdownMenu } from './DropdownMenu.js';
13
+ export { E as Empty } from '../Empty-B2JwFmru.js';
14
+ export { I as Input } from '../Input-C1gcv9o2.js';
15
+ export { K as Kbd } from '../Kbd-EqbC0bua.js';
16
+ export { L as Label } from '../Label-BVy4hy9Z.js';
17
+ export { M as MultiEmailInput } from '../MultiEmailInput-SCTYovtX.js';
18
+ export { P as Pagination } from '../Pagination-DSc9yXPy.js';
19
+ export { P as Popover } from '../Popover-BFMrtVPq.js';
20
+ export { P as Progress } from '../Progress-B9NlUm6e.js';
21
+ export { R as RadioGroup } from '../RadioGroup-BNeYQAoT.js';
22
+ export { S as Select } from '../Select-TlFBcxcY.js';
23
+ export { S as Sheet } from '../Sheet-QFC_mHyj.js';
24
+ export { S as Slider } from '../Slider-BCQXhs0Q.js';
25
+ export { S as Spinner } from '../Spinner-C8HSac-2.js';
26
+ export { S as Stepper } from '../Stepper-BoGkmkY0.js';
27
+ export { S as Switch } from '../Switch-B83TGxJ_.js';
28
+ export { T as Tabs } from '../Tabs-DWfKnl3S.js';
29
+ export { T as Textarea } from '../Textarea-C0z50h0N.js';
30
+ export { T as TimePicker } from '../TimePicker-C4x62jI1.js';
31
+ export { T as TimePickerPanel } from '../TimePickerPanel-CiF0RExY.js';
32
+ export { T as Toastr } from '../Toastr-DYqpSaMd.js';
33
+ export { T as Tooltip } from '../Tooltip-DhwIZnOU.js';
34
+ export { T as TranslationProvider } from '../TranslationProvider-Ba9rn47H.js';
35
+ export { T as Tree } from '../Tree-C7r10UY5.js';
36
+ export { f as flattenTreeData, g as getExpandedKeysFromSearch, a as getParentKey } from '../search-BK7Ozh5_.js';
37
+ export { T as TreeSelect } from '../TreeSelect-DRGcYz-6.js';
38
+ export { T as Typography, t as typographyVariants } from '../Typography-CMJ8OveZ.js';
39
+ import 'react/jsx-runtime';
40
+ import 'react';
41
+ import '../utils-DdHUxIdC.js';
42
+ import '../primitives/Accordion.js';
43
+ import '../chevron-down-BNi0ntys.js';
44
+ import '../createLucideIcon-C8ycilSN.js';
45
+ import '../chevron-up-Bf2G3AAU.js';
46
+ import '../index-CiyxEyB0.js';
47
+ import '../index-Dd1i1d2M.js';
48
+ import '../index-BtkPdosV.js';
49
+ import '../index-DNzunGHb.js';
50
+ import '../index-Cor698lu.js';
51
+ import '../index-DOzu5J1s.js';
52
+ import '../index-DhnfW8wQ.js';
53
+ import 'react-dom';
54
+ import '../index-0o2E3Cnw.js';
55
+ import '../index-yFgkK_AM.js';
56
+ import '../index-zW4GjM5L.js';
57
+ import '../index-BA158WEj.js';
58
+ import 'react-i18next';
59
+ import '../primitives/Dialog.js';
60
+ import '../button-COIbN8dg.js';
61
+ import '../index-D7Zy7P05.js';
62
+ import '../index-CfriMyrd.js';
63
+ import '../dialog-CrB6N_2a.js';
64
+ import '../x-_o2T3n6D.js';
65
+ import '../index-9HvIbmnI.js';
66
+ import '../index-BNPynZWM.js';
67
+ import '../index-CSUSJzOJ.js';
68
+ import '../index-B4_fVWDx.js';
69
+ import '../index-fV_U4ZJM.js';
70
+ import '../primitives/Avatar.js';
71
+ import '../index-DZXbzIgC.js';
72
+ import '../index-CSMSzzKM.js';
73
+ import '../primitives/Tooltip.js';
74
+ import '../tooltip-XkHLgxlU.js';
75
+ import '../index-C3hByjk3.js';
76
+ import '../floating-ui.react-dom-D8_f_WWh.js';
77
+ import '../index-BYZaLNq1.js';
78
+ import '../index-CSggBaQF.js';
79
+ import '../renderIcon-tlvMyboj.js';
80
+ import '../primitives/Badge.js';
81
+ import '../primitives/Button.js';
82
+ import '../primitives/Spinner.js';
83
+ import '../loader-circle-DycHUAWN.js';
84
+ import '../primitives/Alert.js';
85
+ import '../triangle-alert-PXnNWQy_.js';
86
+ import '../primitives/Checkbox.js';
87
+ import '../check-Cpkv29p1.js';
88
+ import '../index-30QpKM0j.js';
89
+ import '../primitives/Field.js';
90
+ import '../label-B4qDF3W1.js';
91
+ import '../separator-BbhgePmX.js';
92
+ import 'react-colorful';
93
+ import '../primitives/Popover.js';
94
+ import '../primitives/Table.js';
95
+ import '../primitives/Pagination.js';
96
+ import '../chevron-left-BDoT8E2-.js';
97
+ import '../ellipsis-lb8Ws6br.js';
98
+ import '../chevron-right-DQnrO-ek.js';
99
+ import '../primitives/DropdownMenu.js';
100
+ import '../index-DLPtgEJ_.js';
101
+ import '../index-j_qxDBFl.js';
102
+ import '../Calendar-pDD7nRF-.js';
103
+ import '../primitives/ButtonGroup.js';
104
+ import '../primitives/Empty.js';
105
+ import '../primitives/InputGroup.js';
106
+ import '../input-group-ytECR3Hw.js';
107
+ import '../input-GLCCE2kT.js';
108
+ import '../textarea-BSZwxzjQ.js';
109
+ import '../primitives/Kbd.js';
110
+ import '../primitives/Label.js';
111
+ import '../primitives/HoverCard.js';
112
+ import '../primitives/Progress.js';
113
+ import '../primitives/RadioGroup.js';
114
+ import '../SelectFieldWrapper-BJzq9aCY.js';
115
+ import '../primitives/Combobox.js';
116
+ import '../with-selector-Dv0G_V_o.js';
117
+ import '../primitives/Sheet.js';
118
+ import '../sheet-C763FqIh.js';
119
+ import '../primitives/Slider.js';
120
+ import '../index-BfAAoDv6.js';
121
+ import '../primitives/Switch.js';
122
+ import '../primitives/Tabs.js';
123
+ import '../primitives/Textarea.js';
124
+ import '../primitives/ScrollArea.js';
125
+ import '../index-D_roZz8G.js';
126
+ import 'i18next';
127
+ import '../redux-BKH6DnBB.js';
128
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ import { type ButtonProps } from "src/components/Button";
2
+ export interface FormikActionBlockProps {
3
+ /** Additional CSS class names for the wrapper. */
4
+ className?: string;
5
+ /** Props forwarded to the submit button. */
6
+ submitButtonProps?: ButtonProps;
7
+ /** Props forwarded to the cancel button. */
8
+ cancelButtonProps?: ButtonProps;
9
+ /**
10
+ * Override the auto-computed submitting state (e.g. from React Query mutation).
11
+ * Falls back to Formik's `isSubmitting` when not provided.
12
+ */
13
+ isSubmitting?: boolean;
14
+ /** Alignment of the buttons. */
15
+ position?: "left" | "right";
16
+ }
17
+ declare const FormikActionBlock: import("react").ForwardRefExoticComponent<FormikActionBlockProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ export { FormikActionBlock };
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { useFormikContext } from 'formik';
4
+ import { B as Button } from '../Button-Q7MPG6ph.js';
5
+ import { c as cn } from '../utils-DdHUxIdC.js';
6
+ import { FormikButton } from './Button.js';
7
+ import '../renderIcon-tlvMyboj.js';
8
+ import '../primitives/Button.js';
9
+ import '../button-COIbN8dg.js';
10
+ import '../index-D7Zy7P05.js';
11
+ import '../index-CfriMyrd.js';
12
+ import '../index-BtkPdosV.js';
13
+ import '../primitives/Spinner.js';
14
+ import 'react-i18next';
15
+ import '../loader-circle-DycHUAWN.js';
16
+ import '../createLucideIcon-C8ycilSN.js';
17
+ import '../primitives/Tooltip.js';
18
+ import '../tooltip-XkHLgxlU.js';
19
+ import '../index-DNzunGHb.js';
20
+ import '../index-CiyxEyB0.js';
21
+ import '../index-BNPynZWM.js';
22
+ import '../index-DhnfW8wQ.js';
23
+ import 'react-dom';
24
+ import '../index-CSUSJzOJ.js';
25
+ import '../index-zW4GjM5L.js';
26
+ import '../index-DOzu5J1s.js';
27
+ import '../index-C3hByjk3.js';
28
+ import '../floating-ui.react-dom-D8_f_WWh.js';
29
+ import '../index-BYZaLNq1.js';
30
+ import '../index-fV_U4ZJM.js';
31
+ import '../index-yFgkK_AM.js';
32
+ import '../index-Cor698lu.js';
33
+ import '../index-CSggBaQF.js';
34
+ import 'ramda';
35
+
36
+ const FormikActionBlock = forwardRef(({ className, submitButtonProps, cancelButtonProps, isSubmitting: isSubmittingProp, position = "left", }, ref) => {
37
+ const { handleReset, isSubmitting: isFormikSubmitting } = useFormikContext();
38
+ const isSubmitting = isSubmittingProp ?? isFormikSubmitting;
39
+ const cancelButton = (jsx(Button, { "data-testid": "cancel-button", disabled: isSubmitting, label: "Cancel", variant: "ghost", onClick: handleReset, onMouseDown: (e) => e.preventDefault(), ...cancelButtonProps }));
40
+ const submitButton = (jsx(FormikButton, { "data-testid": "save-changes-button", label: "Save changes", type: "submit", ...submitButtonProps }));
41
+ return (jsx("div", { ref: ref, className: cn("flex items-center gap-2", position === "right" && "justify-end", className), children: position === "right" ? (jsxs(Fragment, { children: [cancelButton, submitButton] })) : (jsxs(Fragment, { children: [submitButton, cancelButton] })) }));
42
+ });
43
+ FormikActionBlock.displayName = "FormikActionBlock";
44
+
45
+ export { FormikActionBlock };
46
+ //# sourceMappingURL=ActionBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionBlock.js","sources":["../../src/formik/ActionBlock.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useFormikContext } from \"formik\";\n\nimport { Button, type ButtonProps } from \"src/components/Button\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nimport { FormikButton } from \"./Button\";\n\nexport interface FormikActionBlockProps {\n /** Additional CSS class names for the wrapper. */\n className?: string;\n /** Props forwarded to the submit button. */\n submitButtonProps?: ButtonProps;\n /** Props forwarded to the cancel button. */\n cancelButtonProps?: ButtonProps;\n /**\n * Override the auto-computed submitting state (e.g. from React Query mutation).\n * Falls back to Formik's `isSubmitting` when not provided.\n */\n isSubmitting?: boolean;\n /** Alignment of the buttons. */\n position?: \"left\" | \"right\";\n}\n\nconst FormikActionBlock = forwardRef<HTMLDivElement, FormikActionBlockProps>(\n (\n {\n className,\n submitButtonProps,\n cancelButtonProps,\n isSubmitting: isSubmittingProp,\n position = \"left\",\n },\n ref\n ) => {\n const { handleReset, isSubmitting: isFormikSubmitting } =\n useFormikContext();\n\n const isSubmitting = isSubmittingProp ?? isFormikSubmitting;\n\n const cancelButton = (\n <Button\n data-testid=\"cancel-button\"\n disabled={isSubmitting}\n label=\"Cancel\"\n variant=\"ghost\"\n onClick={handleReset}\n onMouseDown={(e: React.MouseEvent) => e.preventDefault()}\n {...cancelButtonProps}\n />\n );\n\n const submitButton = (\n <FormikButton\n data-testid=\"save-changes-button\"\n label=\"Save changes\"\n type=\"submit\"\n {...submitButtonProps}\n />\n );\n\n return (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-2\",\n position === \"right\" && \"justify-end\",\n className\n )}\n >\n {position === \"right\" ? (\n <>\n {cancelButton}\n {submitButton}\n </>\n ) : (\n <>\n {submitButton}\n {cancelButton}\n </>\n )}\n </div>\n );\n }\n);\n\nFormikActionBlock.displayName = \"FormikActionBlock\";\n\nexport { FormikActionBlock };\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,iBAAiB,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,GAAG,MAAM,GAClB,EACD,GAAG,KACD;IACF,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,GACrD,gBAAgB,EAAE;AAEpB,IAAA,MAAM,YAAY,GAAG,gBAAgB,IAAI,kBAAkB;AAE3D,IAAA,MAAM,YAAY,IAChBA,GAAA,CAAC,MAAM,mBACO,eAAe,EAC3B,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,CAAC,CAAmB,KAAK,CAAC,CAAC,cAAc,EAAE,KACpD,iBAAiB,EAAA,CACrB,CACH;AAED,IAAA,MAAM,YAAY,IAChBA,IAAC,YAAY,EAAA,EAAA,aAAA,EACC,qBAAqB,EACjC,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,QAAQ,KACT,iBAAiB,EAAA,CACrB,CACH;IAED,QACEA,aACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,yBAAyB,EACzB,QAAQ,KAAK,OAAO,IAAI,aAAa,EACrC,SAAS,CACV,EAAA,QAAA,EAEA,QAAQ,KAAK,OAAO,IACnBC,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,YAAY,EACZ,YAAY,IACZ,KAEHD,4BACG,YAAY,EACZ,YAAY,CAAA,EAAA,CACZ,CACJ,EAAA,CACG;AAEV,CAAC;AAGH,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
@@ -0,0 +1,23 @@
1
+ export interface BlockNavigationAlertProps {
2
+ /** Whether the alert dialog is open. */
3
+ isOpen?: boolean;
4
+ /** Called when the dialog should close. */
5
+ onClose?: () => void;
6
+ /** Called when the user chooses to stay. */
7
+ onSubmit?: () => void;
8
+ /** Called when the user chooses to discard and leave. */
9
+ onDiscardChanges?: () => void;
10
+ /** Custom title for the alert. */
11
+ title?: string;
12
+ /** Custom message for the alert body. */
13
+ message?: string;
14
+ /** Custom label for the discard/cancel button. */
15
+ cancelButtonLabel?: string;
16
+ /** Custom label for the stay/submit button. */
17
+ submitButtonLabel?: string;
18
+ }
19
+ declare const BlockNavigationAlert: {
20
+ ({ isOpen, onClose, onSubmit, onDiscardChanges, title, message, cancelButtonLabel, submitButtonLabel, }: BlockNavigationAlertProps): import("react/jsx-runtime").JSX.Element;
21
+ displayName: string;
22
+ };
23
+ export { BlockNavigationAlert };
@@ -0,0 +1,11 @@
1
+ import { type BlockNavigationAlertProps } from "./BlockNavigationAlert";
2
+ export interface FormikBlockNavigationProps extends Omit<BlockNavigationAlertProps, "isOpen" | "onClose" | "onSubmit" | "onDiscardChanges"> {
3
+ /** Force the navigation block regardless of Formik dirty state. */
4
+ isDirty?: boolean;
5
+ }
6
+ declare const FormikBlockNavigation: {
7
+ ({ isDirty, ...otherProps }: FormikBlockNavigationProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export { FormikBlockNavigation };
11
+ export type { BlockNavigationAlertProps };
@@ -0,0 +1,109 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useFormikContext } from 'formik';
3
+ import { useState, useRef, useCallback, useEffect } from 'react';
4
+ import { useHistory } from 'react-router-dom';
5
+ import { B as Button } from '../Button-Q7MPG6ph.js';
6
+ import { D as Dialog } from '../Dialog-BURSzxaP.js';
7
+ import '../utils-DdHUxIdC.js';
8
+ import '../renderIcon-tlvMyboj.js';
9
+ import '../primitives/Button.js';
10
+ import '../button-COIbN8dg.js';
11
+ import '../index-D7Zy7P05.js';
12
+ import '../index-CfriMyrd.js';
13
+ import '../index-BtkPdosV.js';
14
+ import '../primitives/Spinner.js';
15
+ import 'react-i18next';
16
+ import '../loader-circle-DycHUAWN.js';
17
+ import '../createLucideIcon-C8ycilSN.js';
18
+ import '../primitives/Tooltip.js';
19
+ import '../tooltip-XkHLgxlU.js';
20
+ import '../index-DNzunGHb.js';
21
+ import '../index-CiyxEyB0.js';
22
+ import '../index-BNPynZWM.js';
23
+ import '../index-DhnfW8wQ.js';
24
+ import 'react-dom';
25
+ import '../index-CSUSJzOJ.js';
26
+ import '../index-zW4GjM5L.js';
27
+ import '../index-DOzu5J1s.js';
28
+ import '../index-C3hByjk3.js';
29
+ import '../floating-ui.react-dom-D8_f_WWh.js';
30
+ import '../index-BYZaLNq1.js';
31
+ import '../index-fV_U4ZJM.js';
32
+ import '../index-yFgkK_AM.js';
33
+ import '../index-Cor698lu.js';
34
+ import '../index-CSggBaQF.js';
35
+ import '../primitives/Dialog.js';
36
+ import '../dialog-CrB6N_2a.js';
37
+ import '../x-_o2T3n6D.js';
38
+ import '../index-9HvIbmnI.js';
39
+ import '../index-B4_fVWDx.js';
40
+
41
+ const useNavPrompt = ({ shouldBlock = true, }) => {
42
+ const [isBlocked, setIsBlocked] = useState(false);
43
+ const history = useHistory();
44
+ const unblockRef = useRef();
45
+ const navRef = useRef(null);
46
+ const handleNavigation = useCallback((action, transition) => {
47
+ switch (action) {
48
+ case "PUSH":
49
+ history.push(transition);
50
+ break;
51
+ case "REPLACE":
52
+ history.replace(transition);
53
+ break;
54
+ case "POP":
55
+ history.goBack();
56
+ break;
57
+ }
58
+ }, [history]);
59
+ const continueNavigation = useCallback(() => {
60
+ if (isBlocked && unblockRef.current) {
61
+ unblockRef.current();
62
+ setIsBlocked(false);
63
+ if (navRef.current) {
64
+ const { action, transition } = navRef.current;
65
+ handleNavigation(action, transition);
66
+ }
67
+ }
68
+ }, [isBlocked, handleNavigation]);
69
+ const hidePrompt = useCallback(() => setIsBlocked(false), []);
70
+ useEffect(() => {
71
+ if (shouldBlock) {
72
+ unblockRef.current = history.block((transition, action) => {
73
+ setIsBlocked(true);
74
+ navRef.current = { transition: transition.pathname, action };
75
+ return false;
76
+ });
77
+ return () => {
78
+ unblockRef.current?.();
79
+ };
80
+ }
81
+ return undefined;
82
+ }, [shouldBlock, history]);
83
+ return { isBlocked, continueNavigation, hidePrompt };
84
+ };
85
+
86
+ const BlockNavigationAlert = ({ isOpen = false, onClose, onSubmit, onDiscardChanges, title = "You have unsaved changes", message = "Are you sure you want to leave? All unsaved changes will be lost.", cancelButtonLabel = "Discard and leave", submitButtonLabel = "Stay on this page", }) => {
87
+ const submitButtonRef = useRef(null);
88
+ return (jsxs(Dialog, { isOpen: isOpen, onClose: onClose ?? (() => { }), closeButton: true, closeOnEsc: true, closeOnOutsideClick: true, initialFocusRef: submitButtonRef, size: "medium", "data-testid": "alert-box", children: [jsx(Dialog.Header, { children: jsx(Dialog.Title, { "data-testid": "alert-title", children: title }) }), jsx(Dialog.Body, { children: jsx("p", { "data-testid": "alert-message", className: "text-sm text-muted-foreground", children: message }) }), jsxs(Dialog.Footer, { className: "flex items-center justify-end gap-2", children: [jsx(Button, { "data-testid": "alert-cancel-button", label: cancelButtonLabel, variant: "destructive", onClick: onDiscardChanges }), jsx(Button, { "data-testid": "alert-submit-button", label: submitButtonLabel, ref: submitButtonRef, onClick: onSubmit })] })] }));
89
+ };
90
+ BlockNavigationAlert.displayName = "BlockNavigationAlert";
91
+
92
+ const FormikBlockNavigation = ({ isDirty = false, ...otherProps }) => {
93
+ const formikContext = useFormikContext();
94
+ const shouldBlock = isDirty || (Boolean(formikContext) && Boolean(formikContext.dirty));
95
+ const { isBlocked, continueNavigation, hidePrompt } = useNavPrompt({
96
+ shouldBlock,
97
+ });
98
+ const handleDiscardChanges = () => {
99
+ if (formikContext)
100
+ formikContext.resetForm();
101
+ hidePrompt();
102
+ continueNavigation();
103
+ };
104
+ return (jsx(BlockNavigationAlert, { isOpen: isBlocked, onClose: hidePrompt, onDiscardChanges: handleDiscardChanges, onSubmit: hidePrompt, ...otherProps }));
105
+ };
106
+ FormikBlockNavigation.displayName = "FormikBlockNavigation";
107
+
108
+ export { FormikBlockNavigation };
109
+ //# sourceMappingURL=BlockNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockNavigation.js","sources":["../../src/hooks/useNavPrompt.ts","../../src/formik/BlockNavigation/BlockNavigationAlert.tsx","../../src/formik/BlockNavigation/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { useHistory } from \"react-router-dom\";\n\ninterface UseNavPromptOptions {\n /** Whether navigation should be blocked. */\n shouldBlock?: boolean;\n}\n\ninterface UseNavPromptReturn {\n /** Whether a navigation attempt is currently blocked. */\n isBlocked: boolean;\n /** Unblock and continue the pending navigation. */\n continueNavigation: () => void;\n /** Dismiss the prompt without navigating. */\n hidePrompt: () => void;\n}\n\nconst useNavPrompt = ({\n shouldBlock = true,\n}: UseNavPromptOptions): UseNavPromptReturn => {\n const [isBlocked, setIsBlocked] = useState(false);\n\n const history = useHistory();\n\n const unblockRef = useRef<(() => void) | undefined>();\n const navRef = useRef<{ transition: string; action: string } | null>(null);\n\n const handleNavigation = useCallback(\n (action: string, transition: string) => {\n switch (action) {\n case \"PUSH\":\n history.push(transition);\n break;\n case \"REPLACE\":\n history.replace(transition);\n break;\n case \"POP\":\n history.goBack();\n break;\n }\n },\n [history]\n );\n\n const continueNavigation = useCallback(() => {\n if (isBlocked && unblockRef.current) {\n unblockRef.current();\n setIsBlocked(false);\n if (navRef.current) {\n const { action, transition } = navRef.current;\n handleNavigation(action, transition);\n }\n }\n }, [isBlocked, handleNavigation]);\n\n const hidePrompt = useCallback(() => setIsBlocked(false), []);\n\n useEffect(() => {\n if (shouldBlock) {\n unblockRef.current = history.block(\n (transition: { pathname: string }, action: string) => {\n setIsBlocked(true);\n navRef.current = { transition: transition.pathname, action };\n\n return false;\n }\n ) as unknown as () => void;\n\n return () => {\n unblockRef.current?.();\n };\n }\n\n return undefined;\n }, [shouldBlock, history]);\n\n return { isBlocked, continueNavigation, hidePrompt };\n};\n\nexport { useNavPrompt };\nexport type { UseNavPromptOptions, UseNavPromptReturn };\n","import React, { useRef } from \"react\";\n\nimport { Button } from \"src/components/Button\";\nimport { Dialog } from \"src/components/Dialog\";\n\nexport interface BlockNavigationAlertProps {\n /** Whether the alert dialog is open. */\n isOpen?: boolean;\n /** Called when the dialog should close. */\n onClose?: () => void;\n /** Called when the user chooses to stay. */\n onSubmit?: () => void;\n /** Called when the user chooses to discard and leave. */\n onDiscardChanges?: () => void;\n /** Custom title for the alert. */\n title?: string;\n /** Custom message for the alert body. */\n message?: string;\n /** Custom label for the discard/cancel button. */\n cancelButtonLabel?: string;\n /** Custom label for the stay/submit button. */\n submitButtonLabel?: string;\n}\n\nconst BlockNavigationAlert = ({\n isOpen = false,\n onClose,\n onSubmit,\n onDiscardChanges,\n title = \"You have unsaved changes\",\n message = \"Are you sure you want to leave? All unsaved changes will be lost.\",\n cancelButtonLabel = \"Discard and leave\",\n submitButtonLabel = \"Stay on this page\",\n}: BlockNavigationAlertProps) => {\n const submitButtonRef = useRef<HTMLButtonElement>(null);\n\n return (\n <Dialog\n isOpen={isOpen}\n onClose={onClose ?? (() => {})}\n closeButton\n closeOnEsc\n closeOnOutsideClick\n initialFocusRef={submitButtonRef}\n size=\"medium\"\n data-testid=\"alert-box\"\n >\n <Dialog.Header>\n <Dialog.Title data-testid=\"alert-title\">{title}</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body>\n <p\n data-testid=\"alert-message\"\n className=\"text-sm text-muted-foreground\"\n >\n {message}\n </p>\n </Dialog.Body>\n <Dialog.Footer className=\"flex items-center justify-end gap-2\">\n <Button\n data-testid=\"alert-cancel-button\"\n label={cancelButtonLabel}\n variant=\"destructive\"\n onClick={onDiscardChanges}\n />\n <Button\n data-testid=\"alert-submit-button\"\n label={submitButtonLabel}\n ref={submitButtonRef}\n onClick={onSubmit}\n />\n </Dialog.Footer>\n </Dialog>\n );\n};\n\nBlockNavigationAlert.displayName = \"BlockNavigationAlert\";\n\nexport { BlockNavigationAlert };\n","import { useFormikContext } from \"formik\";\n\nimport { useNavPrompt } from \"src/hooks/useNavPrompt\";\n\nimport {\n BlockNavigationAlert,\n type BlockNavigationAlertProps,\n} from \"./BlockNavigationAlert\";\n\nexport interface FormikBlockNavigationProps extends Omit<\n BlockNavigationAlertProps,\n \"isOpen\" | \"onClose\" | \"onSubmit\" | \"onDiscardChanges\"\n> {\n /** Force the navigation block regardless of Formik dirty state. */\n isDirty?: boolean;\n}\n\nconst FormikBlockNavigation = ({\n isDirty = false,\n ...otherProps\n}: FormikBlockNavigationProps) => {\n const formikContext = useFormikContext();\n const shouldBlock =\n isDirty || (Boolean(formikContext) && Boolean(formikContext.dirty));\n\n const { isBlocked, continueNavigation, hidePrompt } = useNavPrompt({\n shouldBlock,\n });\n\n const handleDiscardChanges = () => {\n if (formikContext) formikContext.resetForm();\n hidePrompt();\n continueNavigation();\n };\n\n return (\n <BlockNavigationAlert\n isOpen={isBlocked}\n onClose={hidePrompt}\n onDiscardChanges={handleDiscardChanges}\n onSubmit={hidePrompt}\n {...otherProps}\n />\n );\n};\n\nFormikBlockNavigation.displayName = \"FormikBlockNavigation\";\n\nexport { FormikBlockNavigation };\nexport type { BlockNavigationAlertProps };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,GAAG,IAAI,GACE,KAAwB;IAC5C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEjD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE;AAE5B,IAAA,MAAM,UAAU,GAAG,MAAM,EAA4B;AACrD,IAAA,MAAM,MAAM,GAAG,MAAM,CAAgD,IAAI,CAAC;IAE1E,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,MAAc,EAAE,UAAkB,KAAI;QACrC,QAAQ,MAAM;AACZ,YAAA,KAAK,MAAM;AACT,gBAAA,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;gBACxB;AACF,YAAA,KAAK,SAAS;AACZ,gBAAA,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC3B;AACF,YAAA,KAAK,KAAK;gBACR,OAAO,CAAC,MAAM,EAAE;gBAChB;;AAEN,IAAA,CAAC,EACD,CAAC,OAAO,CAAC,CACV;AAED,IAAA,MAAM,kBAAkB,GAAG,WAAW,CAAC,MAAK;AAC1C,QAAA,IAAI,SAAS,IAAI,UAAU,CAAC,OAAO,EAAE;YACnC,UAAU,CAAC,OAAO,EAAE;YACpB,YAAY,CAAC,KAAK,CAAC;AACnB,YAAA,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,OAAO;AAC7C,gBAAA,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC;YACtC;QACF;AACF,IAAA,CAAC,EAAE,CAAC,SAAS,EAAE,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AAC5C,QAAA,UAAU,EAAE;AACZ,QAAA,kBAAkB,EAAE;AACtB,IAAA,CAAC;IAED,QACEA,IAAC,oBAAoB,EAAA,EACnB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,gBAAgB,EAAE,oBAAoB,EACtC,QAAQ,EAAE,UAAU,EAAA,GAChB,UAAU,EAAA,CACd;AAEN;AAEA,qBAAqB,CAAC,WAAW,GAAG,uBAAuB;;;;"}
@@ -0,0 +1,11 @@
1
+ import { RadioGroupProps } from "src/components/RadioGroup";
2
+ export interface FormikRadioGroupProps extends Omit<RadioGroupProps, "name"> {
3
+ /** Formik field name. */
4
+ name: string;
5
+ }
6
+ declare const FormikRadioGroup: {
7
+ ({ name, ...props }: FormikRadioGroupProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ Item: import("react").ForwardRefExoticComponent<Omit<import("src/components/RadioGroup").RadioGroupItemProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
10
+ };
11
+ export { FormikRadioGroup };
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { useField, useFormikContext, getIn } from 'formik';
4
4
  import { dissoc } from 'ramda';
5
- import { S as Select } from '../Select-BGODpJGc.js';
5
+ import { S as Select } from '../Select-TlFBcxcY.js';
6
6
  import '../SelectFieldWrapper-BJzq9aCY.js';
7
7
  import '../primitives/Field.js';
8
8
  import '../index-D7Zy7P05.js';
@@ -31,7 +31,7 @@ import 'react-i18next';
31
31
  import '../loader-circle-DycHUAWN.js';
32
32
 
33
33
  const FormikSelect = forwardRef((props, ref) => {
34
- const { name, onOpenChange, onChange: _, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars
34
+ const { name, onOpenChange, onChange: _, ...otherProps } = props;
35
35
  const [field, meta, { setValue, setTouched }] = useField(name);
36
36
  const { status = {}, setStatus } = useFormikContext();
37
37
  const fieldStatus = getIn(status, name);
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange: _, ...otherProps } = props; // eslint-disable-line @typescript-eslint/no-unused-vars\n const [field, meta, { setValue, setTouched }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n const selectProps = {\n ...otherProps,\n ref,\n error: meta.touched ? meta.error || fieldStatus : \"\",\n name: field.name,\n value: field.value,\n onOpenChange: (open: boolean) => {\n if (!open) setTouched(true);\n onOpenChange?.(open);\n },\n onChange: (value: unknown) => {\n setStatus(dissoc(name, status));\n setValue(value);\n },\n };\n\n return <Select {...(selectProps as SelectProps)} />;\n }\n);\n\nFormikSelect.displayName = \"FormikSelect\";\n\nexport { FormikSelect };\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,KAAK,EAAE,GAAG,KAAI;AACb,IAAA,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;AACjE,IAAA,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC9D,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE;IACrD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;AAEvC,IAAA,MAAM,WAAW,GAAG;AAClB,QAAA,GAAG,UAAU;QACb,GAAG;AACH,QAAA,KAAK,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,WAAW,GAAG,EAAE;QACpD,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;AAClB,QAAA,YAAY,EAAE,CAAC,IAAa,KAAI;AAC9B,YAAA,IAAI,CAAC,IAAI;gBAAE,UAAU,CAAC,IAAI,CAAC;AAC3B,YAAA,YAAY,GAAG,IAAI,CAAC;QACtB,CAAC;AACD,QAAA,QAAQ,EAAE,CAAC,KAAc,KAAI;YAC3B,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC/B,QAAQ,CAAC,KAAK,CAAC;QACjB,CAAC;KACF;AAED,IAAA,OAAOA,GAAA,CAAC,MAAM,EAAA,EAAA,GAAM,WAA2B,GAAI;AACrD,CAAC;AAGH,YAAY,CAAC,WAAW,GAAG,cAAc;;;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../src/formik/Select.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useField, useFormikContext, getIn } from \"formik\";\nimport { dissoc } from \"ramda\";\n\nimport { Select, SelectProps } from \"src/components/Select\";\n\nexport type FormikSelectProps = SelectProps & {\n /** Formik field name. */\n name: string;\n};\n\nconst FormikSelect = forwardRef<HTMLInputElement, FormikSelectProps>(\n (props, ref) => {\n const { name, onOpenChange, onChange: _, ...otherProps } = props;\n const [field, meta, { setValue, setTouched }] = useField(name);\n const { status = {}, setStatus } = useFormikContext();\n const fieldStatus = getIn(status, name);\n\n const selectProps = {\n ...otherProps,\n ref,\n error: meta.touched ? meta.error || fieldStatus : \"\",\n name: field.name,\n value: field.value,\n onOpenChange: (open: boolean) => {\n if (!open) setTouched(true);\n onOpenChange?.(open);\n },\n onChange: (value: unknown) => {\n setStatus(dissoc(name, status));\n setValue(value);\n },\n };\n\n return <Select {...(selectProps as SelectProps)} />;\n }\n);\n\nFormikS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ardRef } from 'react';
3
3
  import { useField, useFormikContext, getIn } from 'formik';
4
4
  import { dissoc } from 'ramda';
5
- import { T as TreeSelect } from '../TreeSelect-Cmc90YWJ.js';
5
+ import { T as TreeSelect } from '../TreeSelect-DRGcYz-6.js';
6
6
  import '../utils-DdHUxIdC.js';
7
7
  import '../primitives/Popover.js';
8
8
  import '../index-DNzunGHb.js';
@@ -26,7 +26,7 @@ import '../primitives/Field.js';
26
26
  import '../index-D7Zy7P05.js';
27
27
  import '../label-B4qDF3W1.js';
28
28
  import '../separator-BbhgePmX.js';
29
- import '../Tree-Dkr11OPy.js';
29
+ import '../Tree-C7r10UY5.js';
30
30
  import '../chevron-down-BNi0ntys.js';
31
31
  import '../createLucideIcon-C8ycilSN.js';
32
32
  import '../chevron-right-DQnrO-ek.js';
@@ -18,5 +18,9 @@ export { FormikMultiEmailInput as MultiEmailInput } from "./MultiEmailInput";
18
18
  export type { FormikMultiEmailInputProps as MultiEmailInputProps } from "./MultiEmailInput";
19
19
  export { FormikButton as Button } from "./Button";
20
20
  export type { FormikButtonProps as ButtonProps } from "./Button";
21
+ export { FormikActionBlock as ActionBlock } from "./ActionBlock";
22
+ export type { FormikActionBlockProps as ActionBlockProps } from "./ActionBlock";
23
+ export { FormikBlockNavigation as BlockNavigation } from "./BlockNavigation";
24
+ export type { FormikBlockNavigationProps as BlockNavigationProps } from "./BlockNavigation";
21
25
  export { Form } from "./Form";
22
26
  export type { FormProps } from "./Form";
@@ -8,6 +8,8 @@ export { FormikSlider as Slider } from './Slider.js';
8
8
  export { FormikTreeSelect as TreeSelect } from './TreeSelect.js';
9
9
  export { FormikMultiEmailInput as MultiEmailInput } from './MultiEmailInput.js';
10
10
  export { FormikButton as Button } from './Button.js';
11
+ export { FormikActionBlock as ActionBlock } from './ActionBlock.js';
12
+ export { FormikBlockNavigation as BlockNavigation } from './BlockNavigation.js';
11
13
  export { Form } from './Form.js';
12
14
  import 'react/jsx-runtime';
13
15
  import 'react';
@@ -30,7 +32,7 @@ import '../input-GLCCE2kT.js';
30
32
  import '../textarea-BSZwxzjQ.js';
31
33
  import '../Textarea-C0z50h0N.js';
32
34
  import '../primitives/Textarea.js';
33
- import '../Select-BGODpJGc.js';
35
+ import '../Select-TlFBcxcY.js';
34
36
  import '../SelectFieldWrapper-BJzq9aCY.js';
35
37
  import '../primitives/Combobox.js';
36
38
  import '../check-Cpkv29p1.js';
@@ -66,13 +68,13 @@ import '../primitives/Switch.js';
66
68
  import '../Slider-BCQXhs0Q.js';
67
69
  import '../primitives/Slider.js';
68
70
  import '../index-BfAAoDv6.js';
69
- import '../TreeSelect-Cmc90YWJ.js';
71
+ import '../TreeSelect-DRGcYz-6.js';
70
72
  import '../primitives/Popover.js';
71
73
  import '../index-BNPynZWM.js';
72
74
  import '../index-B4_fVWDx.js';
73
75
  import '../index-C3hByjk3.js';
74
76
  import '../index-fV_U4ZJM.js';
75
- import '../Tree-Dkr11OPy.js';
77
+ import '../Tree-C7r10UY5.js';
76
78
  import '../chevron-right-DQnrO-ek.js';
77
79
  import '../redux-BKH6DnBB.js';
78
80
  import '../MultiEmailInput-SCTYovtX.js';
@@ -82,4 +84,9 @@ import '../primitives/Button.js';
82
84
  import '../primitives/Tooltip.js';
83
85
  import '../tooltip-XkHLgxlU.js';
84
86
  import '../index-CSggBaQF.js';
87
+ import 'react-router-dom';
88
+ import '../Dialog-BURSzxaP.js';
89
+ import '../primitives/Dialog.js';
90
+ import '../dialog-CrB6N_2a.js';
91
+ import '../index-9HvIbmnI.js';
85
92
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,15 @@
1
+ interface UseNavPromptOptions {
2
+ /** Whether navigation should be blocked. */
3
+ shouldBlock?: boolean;
4
+ }
5
+ interface UseNavPromptReturn {
6
+ /** Whether a navigation attempt is currently blocked. */
7
+ isBlocked: boolean;
8
+ /** Unblock and continue the pending navigation. */
9
+ continueNavigation: () => void;
10
+ /** Dismiss the prompt without navigating. */
11
+ hidePrompt: () => void;
12
+ }
13
+ declare const useNavPrompt: ({ shouldBlock, }: UseNavPromptOptions) => UseNavPromptReturn;
14
+ export { useNavPrompt };
15
+ export type { UseNavPromptOptions, UseNavPromptReturn };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export { A as Accordion } from './Accordion-BzfsJePA.js';
1
+ export { A as Accordion } from './Accordion-Ch9S_qd3.js';
2
2
  export { A as Alert } from './Alert-D_FV8xxo.js';
3
3
  export { A as Avatar } from './Avatar-D5YGlXVF.js';
4
4
  export { B as Badge } from './Badge-8FkscqDt.js';
5
5
  export { B as Button } from './Button-Q7MPG6ph.js';
6
6
  export { C as Callout } from './Callout-B0w4GQtx.js';
7
7
  export { C as Checkbox } from './Checkbox-zCxgcZiC.js';
8
- export { C as ColorPicker } from './ColorPicker-D-7QGnf9.js';
8
+ export { C as ColorPicker } from './ColorPicker-DtOvy0Gy.js';
9
9
  export { D as DatePicker } from './DatePicker-COxwHPIZ.js';
10
10
  export { T as TimePicker } from './TimePicker-C4x62jI1.js';
11
11
  import './TimePickerPanel-CiF0RExY.js';
@@ -23,7 +23,7 @@ export { K as Kbd } from './Kbd-EqbC0bua.js';
23
23
  export { L as Label } from './Label-BVy4hy9Z.js';
24
24
  export { P as Pagination } from './Pagination-DSc9yXPy.js';
25
25
  export { R as RadioGroup } from './RadioGroup-BNeYQAoT.js';
26
- export { S as Select } from './Select-BGODpJGc.js';
26
+ export { S as Select } from './Select-TlFBcxcY.js';
27
27
  export { M as MultiEmailInput } from './MultiEmailInput-SCTYovtX.js';
28
28
  export { S as Sheet } from './Sheet-QFC_mHyj.js';
29
29
  export { P as Popover } from './Popover-BFMrtVPq.js';
@@ -36,10 +36,10 @@ export { S as Switch } from './Switch-B83TGxJ_.js';
36
36
  export { T as Tabs } from './Tabs-DWfKnl3S.js';
37
37
  export { T as Textarea } from './Textarea-C0z50h0N.js';
38
38
  export { T as Tooltip } from './Tooltip-DhwIZnOU.js';
39
- export { T as Typography, t as typographyVariants } from './Typography-D5TjXEfu.js';
39
+ export { T as Typography, t as typographyVariants } from './Typography-CMJ8OveZ.js';
40
40
  export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from './DataTable-DWR9gX9d.js';
41
- export { T as Tree } from './Tree-Dkr11OPy.js';
42
- export { T as TreeSelect } from './TreeSelect-Cmc90YWJ.js';
41
+ export { T as Tree } from './Tree-C7r10UY5.js';
42
+ export { T as TreeSelect } from './TreeSelect-DRGcYz-6.js';
43
43
  export { u as useIsMobile } from './use-mobile-IRjN_mlT.js';
44
44
  export { c as cn } from './utils-DdHUxIdC.js';
45
45
  import 'react/jsx-runtime';
@@ -248,7 +248,7 @@ const timezonePlugin = (_o, c, d) => {
248
248
  const startOfWithoutTz = oldStartOf.call(withoutTz, units, startOf);
249
249
  return startOfWithoutTz.tz(this.$x.$timezone, true);
250
250
  };
251
- dayjsFactory.tz = function (input, arg1, arg2) {
251
+ const tzFunction = function (input, arg1, arg2) {
252
252
  const parseFormat = arg2 && arg1;
253
253
  const timezone = arg2 || arg1 || defaultTimezone;
254
254
  const previousOffset = tzOffset(Number(dayjsFactory()), timezone);
@@ -261,12 +261,13 @@ const timezonePlugin = (_o, c, d) => {
261
261
  ins.$x.$timezone = timezone;
262
262
  return ins;
263
263
  };
264
- dayjsFactory.tz.guess = function () {
264
+ tzFunction.guess = function () {
265
265
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
266
266
  };
267
- dayjsFactory.tz.setDefault = function (timezone) {
267
+ tzFunction.setDefault = function (timezone) {
268
268
  defaultTimezone = timezone;
269
269
  };
270
+ dayjsFactory.tz = tzFunction;
270
271
  };
271
272
 
272
273
  pureDayjs.extend(weekOfYear);