@fuf-stack/uniform 1.6.0 → 1.6.2

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 (156) hide show
  1. package/dist/Checkboxes/index.cjs +12 -6
  2. package/dist/Checkboxes/index.cjs.map +1 -1
  3. package/dist/Checkboxes/index.js +11 -5
  4. package/dist/FieldArray/index.cjs +12 -6
  5. package/dist/FieldArray/index.cjs.map +1 -1
  6. package/dist/FieldArray/index.js +11 -5
  7. package/dist/Form/index.cjs +12 -6
  8. package/dist/Form/index.cjs.map +1 -1
  9. package/dist/Form/index.js +11 -5
  10. package/dist/Input/index.cjs +12 -6
  11. package/dist/Input/index.cjs.map +1 -1
  12. package/dist/Input/index.js +11 -5
  13. package/dist/RadioBoxes/index.cjs +12 -6
  14. package/dist/RadioBoxes/index.cjs.map +1 -1
  15. package/dist/RadioBoxes/index.js +11 -5
  16. package/dist/RadioTabs/index.cjs +12 -6
  17. package/dist/RadioTabs/index.cjs.map +1 -1
  18. package/dist/RadioTabs/index.js +11 -5
  19. package/dist/Radios/index.cjs +12 -6
  20. package/dist/Radios/index.cjs.map +1 -1
  21. package/dist/Radios/index.js +11 -5
  22. package/dist/Select/index.cjs +12 -6
  23. package/dist/Select/index.cjs.map +1 -1
  24. package/dist/Select/index.js +11 -5
  25. package/dist/SubmitButton/index.cjs +12 -6
  26. package/dist/SubmitButton/index.cjs.map +1 -1
  27. package/dist/SubmitButton/index.js +11 -5
  28. package/dist/Switch/index.cjs +12 -6
  29. package/dist/Switch/index.cjs.map +1 -1
  30. package/dist/Switch/index.js +11 -5
  31. package/dist/TextArea/index.cjs +12 -6
  32. package/dist/TextArea/index.cjs.map +1 -1
  33. package/dist/TextArea/index.js +11 -5
  34. package/dist/{chunk-GBPAALJG.cjs → chunk-345LYO4H.cjs} +3 -3
  35. package/dist/{chunk-GBPAALJG.cjs.map → chunk-345LYO4H.cjs.map} +1 -1
  36. package/dist/chunk-35V726MB.js +1 -0
  37. package/dist/chunk-35V726MB.js.map +1 -0
  38. package/dist/{chunk-SLLZPY7M.js → chunk-6C6YW5TM.js} +2 -2
  39. package/dist/{chunk-ATRA4SVX.cjs → chunk-A5Z75X7M.cjs} +3 -3
  40. package/dist/{chunk-ATRA4SVX.cjs.map → chunk-A5Z75X7M.cjs.map} +1 -1
  41. package/dist/chunk-AACO4OEK.cjs +100 -0
  42. package/dist/chunk-AACO4OEK.cjs.map +1 -0
  43. package/dist/chunk-AHJJIANM.js +7 -0
  44. package/dist/chunk-AHJJIANM.js.map +1 -0
  45. package/dist/{chunk-5OX4LSPF.js → chunk-BXGILW5C.js} +4 -4
  46. package/dist/chunk-CK362NWK.js +34 -0
  47. package/dist/chunk-CK362NWK.js.map +1 -0
  48. package/dist/chunk-D3NAUOYG.js +122 -0
  49. package/dist/chunk-D3NAUOYG.js.map +1 -0
  50. package/dist/chunk-D5UUY4BD.cjs +68 -0
  51. package/dist/chunk-D5UUY4BD.cjs.map +1 -0
  52. package/dist/{chunk-MTMVQAN3.cjs → chunk-E4DCVJS5.cjs} +3 -3
  53. package/dist/{chunk-MTMVQAN3.cjs.map → chunk-E4DCVJS5.cjs.map} +1 -1
  54. package/dist/{chunk-D5ZZGT4Z.cjs → chunk-F6JQYB53.cjs} +4 -4
  55. package/dist/{chunk-D5ZZGT4Z.cjs.map → chunk-F6JQYB53.cjs.map} +1 -1
  56. package/dist/{chunk-HW4B6QID.js → chunk-GUPJNFEX.js} +10 -6
  57. package/dist/{chunk-HW4B6QID.js.map → chunk-GUPJNFEX.js.map} +1 -1
  58. package/dist/{chunk-GNBMDY5Q.js → chunk-H24QXVUI.js} +2 -2
  59. package/dist/{chunk-YJE5OZJ5.js → chunk-HQGTCSHK.js} +2 -2
  60. package/dist/{chunk-XCYA4ZBY.cjs → chunk-IYULWK4H.cjs} +7 -5
  61. package/dist/chunk-IYULWK4H.cjs.map +1 -0
  62. package/dist/{chunk-CVSFT7PV.js → chunk-JKWNYLNS.js} +4 -4
  63. package/dist/chunk-JMFDNTVC.cjs +34 -0
  64. package/dist/chunk-JMFDNTVC.cjs.map +1 -0
  65. package/dist/chunk-L5TXRTPB.js +68 -0
  66. package/dist/chunk-L5TXRTPB.js.map +1 -0
  67. package/dist/chunk-LTKRK3OS.cjs +1 -0
  68. package/dist/chunk-LTKRK3OS.cjs.map +1 -0
  69. package/dist/{chunk-MVZIOCAW.js → chunk-MXUKW3PZ.js} +2 -2
  70. package/dist/{chunk-3SZ2UKFA.cjs → chunk-NZBO4N3S.cjs} +4 -280
  71. package/dist/chunk-NZBO4N3S.cjs.map +1 -0
  72. package/dist/{chunk-XNAXMUTF.cjs → chunk-NZIAIYPS.cjs} +4 -4
  73. package/dist/{chunk-XNAXMUTF.cjs.map → chunk-NZIAIYPS.cjs.map} +1 -1
  74. package/dist/{chunk-JF437QVX.cjs → chunk-OJHD2XHD.cjs} +3 -3
  75. package/dist/{chunk-JF437QVX.cjs.map → chunk-OJHD2XHD.cjs.map} +1 -1
  76. package/dist/chunk-PCTYJUY7.cjs +7 -0
  77. package/dist/chunk-PCTYJUY7.cjs.map +1 -0
  78. package/dist/{chunk-2K6FWC4H.js → chunk-PO5UQAU6.js} +2 -278
  79. package/dist/chunk-PO5UQAU6.js.map +1 -0
  80. package/dist/{chunk-FNRALO75.js → chunk-QRCV7JVB.js} +2 -2
  81. package/dist/{chunk-3OFR3TO6.cjs → chunk-RMCPVDAC.cjs} +3 -3
  82. package/dist/{chunk-3OFR3TO6.cjs.map → chunk-RMCPVDAC.cjs.map} +1 -1
  83. package/dist/{chunk-NAN6QRAS.js → chunk-SJZ7UUEE.js} +5 -3
  84. package/dist/{chunk-NAN6QRAS.js.map → chunk-SJZ7UUEE.js.map} +1 -1
  85. package/dist/chunk-TGJJZEHB.cjs +122 -0
  86. package/dist/chunk-TGJJZEHB.cjs.map +1 -0
  87. package/dist/{chunk-IRWIEND4.js → chunk-TKFODQWI.js} +2 -2
  88. package/dist/{chunk-4HTB52DX.cjs → chunk-VPUMTPD3.cjs} +3 -3
  89. package/dist/{chunk-4HTB52DX.cjs.map → chunk-VPUMTPD3.cjs.map} +1 -1
  90. package/dist/{chunk-D537ZGNE.cjs → chunk-WFO4XPA3.cjs} +4 -4
  91. package/dist/{chunk-D537ZGNE.cjs.map → chunk-WFO4XPA3.cjs.map} +1 -1
  92. package/dist/{chunk-JEXF6TLO.cjs → chunk-XJBGXFVX.cjs} +10 -6
  93. package/dist/chunk-XJBGXFVX.cjs.map +1 -0
  94. package/dist/chunk-Z7FVILDT.js +100 -0
  95. package/dist/chunk-Z7FVILDT.js.map +1 -0
  96. package/dist/{chunk-MLPLWUXZ.js → chunk-Z7NI5347.js} +2 -2
  97. package/dist/hooks/index.cjs +18 -7
  98. package/dist/hooks/index.cjs.map +1 -1
  99. package/dist/hooks/index.d.cts +10 -287
  100. package/dist/hooks/index.d.ts +10 -287
  101. package/dist/hooks/index.js +24 -13
  102. package/dist/hooks/useClientValidation/index.cjs +12 -0
  103. package/dist/hooks/useClientValidation/index.cjs.map +1 -0
  104. package/dist/hooks/useClientValidation/index.d.cts +147 -0
  105. package/dist/hooks/useClientValidation/index.d.ts +147 -0
  106. package/dist/hooks/useClientValidation/index.js +12 -0
  107. package/dist/hooks/useClientValidation/index.js.map +1 -0
  108. package/dist/hooks/useController/index.cjs +9 -0
  109. package/dist/hooks/useController/index.cjs.map +1 -0
  110. package/dist/hooks/useController/index.d.cts +28 -0
  111. package/dist/hooks/useController/index.d.ts +28 -0
  112. package/dist/hooks/useController/index.js +9 -0
  113. package/dist/hooks/useController/index.js.map +1 -0
  114. package/dist/hooks/useFormContext/index.cjs +11 -0
  115. package/dist/hooks/useFormContext/index.cjs.map +1 -0
  116. package/dist/hooks/useFormContext/index.d.cts +50 -0
  117. package/dist/hooks/useFormContext/index.d.ts +50 -0
  118. package/dist/hooks/useFormContext/index.js +11 -0
  119. package/dist/hooks/useFormContext/index.js.map +1 -0
  120. package/dist/hooks/useInput/index.cjs +8 -0
  121. package/dist/hooks/useInput/index.cjs.map +1 -0
  122. package/dist/hooks/useInput/index.d.cts +1 -0
  123. package/dist/hooks/useInput/index.d.ts +1 -0
  124. package/dist/hooks/useInput/index.js +8 -0
  125. package/dist/hooks/useInput/index.js.map +1 -0
  126. package/dist/hooks/useUniformField/index.cjs +14 -0
  127. package/dist/hooks/useUniformField/index.cjs.map +1 -0
  128. package/dist/hooks/useUniformField/index.d.cts +83 -0
  129. package/dist/hooks/useUniformField/index.d.ts +83 -0
  130. package/dist/hooks/useUniformField/index.js +14 -0
  131. package/dist/hooks/useUniformField/index.js.map +1 -0
  132. package/dist/hooks/useUniformFieldArray/index.cjs +15 -0
  133. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -0
  134. package/dist/hooks/useUniformFieldArray/index.d.cts +70 -0
  135. package/dist/hooks/useUniformFieldArray/index.d.ts +70 -0
  136. package/dist/hooks/useUniformFieldArray/index.js +15 -0
  137. package/dist/hooks/useUniformFieldArray/index.js.map +1 -0
  138. package/dist/index.cjs +28 -17
  139. package/dist/index.cjs.map +1 -1
  140. package/dist/index.d.cts +6 -2
  141. package/dist/index.d.ts +6 -2
  142. package/dist/index.js +38 -27
  143. package/package.json +31 -1
  144. package/dist/chunk-2K6FWC4H.js.map +0 -1
  145. package/dist/chunk-3SZ2UKFA.cjs.map +0 -1
  146. package/dist/chunk-JEXF6TLO.cjs.map +0 -1
  147. package/dist/chunk-XCYA4ZBY.cjs.map +0 -1
  148. /package/dist/{chunk-SLLZPY7M.js.map → chunk-6C6YW5TM.js.map} +0 -0
  149. /package/dist/{chunk-5OX4LSPF.js.map → chunk-BXGILW5C.js.map} +0 -0
  150. /package/dist/{chunk-GNBMDY5Q.js.map → chunk-H24QXVUI.js.map} +0 -0
  151. /package/dist/{chunk-YJE5OZJ5.js.map → chunk-HQGTCSHK.js.map} +0 -0
  152. /package/dist/{chunk-CVSFT7PV.js.map → chunk-JKWNYLNS.js.map} +0 -0
  153. /package/dist/{chunk-MVZIOCAW.js.map → chunk-MXUKW3PZ.js.map} +0 -0
  154. /package/dist/{chunk-FNRALO75.js.map → chunk-QRCV7JVB.js.map} +0 -0
  155. /package/dist/{chunk-IRWIEND4.js.map → chunk-TKFODQWI.js.map} +0 -0
  156. /package/dist/{chunk-MLPLWUXZ.js.map → chunk-Z7NI5347.js.map} +0 -0
@@ -1,16 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkXNAXMUTFcjs = require('../chunk-XNAXMUTF.cjs');
5
- require('../chunk-3SZ2UKFA.cjs');
6
- require('../chunk-OE5BOGGX.cjs');
7
- require('../chunk-NHEZXA4H.cjs');
8
- require('../chunk-Z353BLWI.cjs');
4
+ var _chunkNZIAIYPScjs = require('../chunk-NZIAIYPS.cjs');
5
+ require('../chunk-LTKRK3OS.cjs');
9
6
  require('../chunk-BZ5OMN4Y.cjs');
10
7
  require('../chunk-4WYC2RBE.cjs');
8
+ require('../chunk-AACO4OEK.cjs');
9
+ require('../chunk-TGJJZEHB.cjs');
10
+ require('../chunk-NHEZXA4H.cjs');
11
+ require('../chunk-JMFDNTVC.cjs');
12
+ require('../chunk-PCTYJUY7.cjs');
13
+ require('../chunk-OE5BOGGX.cjs');
14
+ require('../chunk-D5UUY4BD.cjs');
15
+ require('../chunk-NZBO4N3S.cjs');
16
+ require('../chunk-Z353BLWI.cjs');
11
17
  require('../chunk-555JRYCS.cjs');
12
18
 
13
19
 
14
20
 
15
- exports.TextArea = _chunkXNAXMUTFcjs.TextArea_default; exports.default = _chunkXNAXMUTFcjs.TextArea_default2;
21
+ exports.TextArea = _chunkNZIAIYPScjs.TextArea_default; exports.default = _chunkNZIAIYPScjs.TextArea_default2;
16
22
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/TextArea/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACF,6GAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/TextArea/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/TextArea/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACF,6GAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/TextArea/index.cjs"}
@@ -1,13 +1,19 @@
1
1
  import {
2
2
  TextArea_default,
3
3
  TextArea_default2
4
- } from "../chunk-CVSFT7PV.js";
5
- import "../chunk-2K6FWC4H.js";
6
- import "../chunk-NTDKZW4E.js";
7
- import "../chunk-ELYGQTXB.js";
8
- import "../chunk-76KOVUDN.js";
4
+ } from "../chunk-JKWNYLNS.js";
5
+ import "../chunk-35V726MB.js";
9
6
  import "../chunk-MODD3TFE.js";
10
7
  import "../chunk-7KLFK2IT.js";
8
+ import "../chunk-Z7FVILDT.js";
9
+ import "../chunk-D3NAUOYG.js";
10
+ import "../chunk-ELYGQTXB.js";
11
+ import "../chunk-CK362NWK.js";
12
+ import "../chunk-AHJJIANM.js";
13
+ import "../chunk-NTDKZW4E.js";
14
+ import "../chunk-L5TXRTPB.js";
15
+ import "../chunk-PO5UQAU6.js";
16
+ import "../chunk-76KOVUDN.js";
11
17
  import "../chunk-K2V4ULA2.js";
12
18
  export {
13
19
  TextArea_default as TextArea,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunk3SZ2UKFAcjs = require('./chunk-3SZ2UKFA.cjs');
3
+ var _chunkTGJJZEHBcjs = require('./chunk-TGJJZEHB.cjs');
4
4
 
5
5
 
6
6
 
@@ -69,7 +69,7 @@ var RadioTabs = (_a) => {
69
69
  label,
70
70
  required,
71
71
  testId
72
- } = _chunk3SZ2UKFAcjs.useUniformField.call(void 0, _chunk555JRYCScjs.__spreadValues.call(void 0, {
72
+ } = _chunkTGJJZEHBcjs.useUniformField.call(void 0, _chunk555JRYCScjs.__spreadValues.call(void 0, {
73
73
  name
74
74
  }, uniformFieldProps));
75
75
  const tabOptions = options.map((option) => {
@@ -144,4 +144,4 @@ var RadioTabs_default2 = RadioTabs_default;
144
144
 
145
145
 
146
146
  exports.RadioTabs_default = RadioTabs_default; exports.RadioTabs_default2 = RadioTabs_default2;
147
- //# sourceMappingURL=chunk-GBPAALJG.cjs.map
147
+ //# sourceMappingURL=chunk-345LYO4H.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-GBPAALJG.cjs","../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"names":["_a","_b"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACHA,sCAA6C;AAE7C,oDAAkD;AAClD,0FAAiB;AA8II,+CAAA;AA1Id,IAAM,kBAAA,EAAoB,4BAAA;AAAG,EAClC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA;AAAA,IACN,MAAA,EAAQ,EAAA;AAAA,IACR,KAAA,EACE,qGAAA;AAAA,IACF,GAAA,EAAK,EAAA;AAAA,IACL,OAAA,EAAS,EAAA;AAAA,IACT,UAAA,EAAY,EAAA;AAAA,IACZ,OAAA,EAAS,EAAA;AAAA,IACT,QAAA,EAAU,KAAA;AAAA,IACV,UAAA,EAAY,EAAA;AAAA,I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,YAAA;AACH,YAAA;AACG,YAAA;AACzB,UAAA;AAAA,QAAA;AACF,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AAEe;AD5CwH;AACA;AErIxH;AFuIwH;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-GBPAALJG.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useUniformField } from '../hooks';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1 pb-0',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** Whether tabs should take up full container width */\n fullWidth?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({ hasContent, fullWidth });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroRadioGroup\n ref={ref}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n onSelectionChange={onChange}\n // make sure component is controlled\n selectedKey={value ?? ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-345LYO4H.cjs","../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"names":["_a","_b"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACHA,sCAA6C;AAE7C,oDAAkD;AAClD,0FAAiB;AA8II,+CAAA;AA1Id,IAAM,kBAAA,EAAoB,4BAAA;AAAG,EAClC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA;AAAA,IACN,MAAA,EAAQ,EAAA;AAAA,IACR,KAAA,EACE,qGAAA;AAAA,IACF,GAAA,EAAK,EAAA;AAAA,IACL,OAAA,EAAS,EAAA;AAAA,IACT,UAAA,EAAY,EAAA;AAAA,IACZ,OAAA,EAAS,EAAA;AAAA,IACT,QAAA,EAAU,KAAA;AAAA,IACV,UAAA,EAAY,EAAA;AAAA,IACZ,OAAA,EAAS;AAAA,EACX,CAAA;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,EAAA;AAAA,QACN,OAAA,EAAS,UAAA;AAAA,QACT,UAAA,EAAY;AAA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345LYO4H.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { useUniformField } from '../hooks';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1 pb-0',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** Whether tabs should take up full container width */\n fullWidth?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n key: option.value,\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({ hasContent, fullWidth });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroRadioGroup\n ref={ref}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n onSelectionChange={onChange}\n // make sure component is controlled\n selectedKey={value ?? ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n />\n </HeroRadioGroup>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-35V726MB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FormContext_default,
3
3
  useFormContext
4
- } from "./chunk-2K6FWC4H.js";
4
+ } from "./chunk-PO5UQAU6.js";
5
5
 
6
6
  // src/Form/Form.tsx
7
7
  import { cn as cn2, slugify } from "@fuf-stack/pixel-utils";
@@ -148,4 +148,4 @@ export {
148
148
  Form_default,
149
149
  Form_default2
150
150
  };
151
- //# sourceMappingURL=chunk-SLLZPY7M.js.map
151
+ //# sourceMappingURL=chunk-6C6YW5TM.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunk3SZ2UKFAcjs = require('./chunk-3SZ2UKFA.cjs');
3
+ var _chunkTGJJZEHBcjs = require('./chunk-TGJJZEHB.cjs');
4
4
 
5
5
 
6
6
 
@@ -106,7 +106,7 @@ var Select = (_a) => {
106
106
  label,
107
107
  required,
108
108
  testId
109
- } = _chunk3SZ2UKFAcjs.useUniformField.call(void 0, _chunk555JRYCScjs.__spreadValues.call(void 0, {
109
+ } = _chunkTGJJZEHBcjs.useUniformField.call(void 0, _chunk555JRYCScjs.__spreadValues.call(void 0, {
110
110
  name
111
111
  }, uniformFieldProps));
112
112
  const [isFocused, setIsFocused] = _react.useState.call(void 0, false);
@@ -279,4 +279,4 @@ var Select_default2 = Select_default;
279
279
 
280
280
 
281
281
  exports.Select_default = Select_default; exports.Select_default2 = Select_default2;
282
- //# sourceMappingURL=chunk-ATRA4SVX.cjs.map
282
+ //# sourceMappingURL=chunk-A5Z75X7M.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-ATRA4SVX.cjs","../src/Select/Select.tsx","../src/Select/index.ts"],"names":["_a","Select_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,8BAAyB;AACzB,qGAAwC;AAExC,wCAA0B;AAE1B,oDAAsD;AAgG7C,+CAAA;AA5FF,IAAM,eAAA,EAAiB,4BAAA;AAAG,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,sBAAA;AAAA,IACN,cAAA,EACE,wGAAA;AAAA,IACF,OAAA,EACE,qOAAA;AAAA,IACF,eAAA,EAAiB,cAAA;AAAA,IACjB,SAAA,EAAW,EAAA;AAAA,IACX,WAAA,EAAa,EAAA;AAAA,IACb,iBAAA,EACE,+FAAA;AAAA,IACF,KAAA,EAAO,EAAA;AAAA,IACP,YAAA,EAAc,4CAAA;AAAA,IACd,mBAAA,EAAqB,WAAA;AAAA,IACrB,kBAAA,EAAoB,gBAAA;AAAA,IACpB,KAAA,EAAO,aAAA;AAAA;AAAA;AAAA,IAGP,KAAA,EACE,yPAAA;AAAA,IACF,gBAAA,EAAkB,EAAA;AAAA,IAClB,cAAA,EAAgB,oCAAA;AAAA,IAChB,IAAA,EAAM,qEAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA;AAAA;AAAA,IAGV,UAAA,EAAY,OAAA;AAAA,IACZ,UAAA,EAAY,8DAAA;AAAA,IACZ,mBAAA,EAAqB,EAAA;AAAA,IACrB,eAAA,EAAiB,kBAAA;AAAA,IACjB,gBAAA,EACE,+FAAA;AAAA,IACF,gBAAA,EAAkB,oCAAA;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A;AACF,YAAA;AACA,YAAA;AACM,cAAA;AACF,gBAAA;AACG,kBAAA;AACC,oBAAA;AACF,kBAAA;AACF,gBAAA;AACF,cAAA;AACE,gBAAA;AACF,cAAA;AACF,YAAA;AACA,YAAA;AACE,cAAA;AACF,YAAA;AAEA,YAAA;AACE,cAAA;AACD,YAAA;AAAA,UAAA;AACH,QAAA;AAEE,QAAA;AAIE,MAAA;AAAA,IAAA;AACN,EAAA;AAEJ;AAEO;AD7EW;AACA;AE5QXC;AF8QW;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-ATRA4SVX.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { Props } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 subpixel-antialiased text-small group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /** option label */\n label?: React.ReactNode;\n /** option value */\n value: string;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: React.ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** The options for the Select component */\n options: SelectOption[];\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {}\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(props?.data?.testId ?? props?.data?.value, { replaceDots: true })}`;\n return (\n <div data-testid={testId}>\n {}\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n menuShouldBlockScroll\n unstyled\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-labelledby={getTriggerProps()['aria-labelledby']?.split(' ')[1]}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n name={name}\n onInputChange={onInputChange}\n options={options}\n placeholder={placeholder}\n classNames={{\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n input: () => {\n return classNames.input;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(\n classNames.multiValueLabel,\n `${getValueProps().className}`,\n );\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }) => {\n return cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n }}\n components={{\n Input: InputComponent,\n Option: OptionComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Control: ControlComponent,\n }}\n onBlur={(_e) => {\n setIsFocused(false);\n onBlur();\n }}\n onChange={(option) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return _option.value;\n }),\n );\n } else {\n onChange((option as SelectOption)?.value);\n }\n }}\n onFocus={(_e) => {\n setIsFocused(true);\n }}\n // set complete option as value by current field value\n value={options.find((option) => {\n return option.value === value;\n })}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n {}\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-A5Z75X7M.cjs","../src/Select/Select.tsx","../src/Select/index.ts"],"names":["_a","Select_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,8BAAyB;AACzB,qGAAwC;AAExC,wCAA0B;AAE1B,oDAAsD;AAgG7C,+CAAA;AA5FF,IAAM,e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ACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACE,kBAAA;AACA,kBAAA;AACF,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACA,gBAAA;AACF,cAAA;AACE,gBAAA;AACE,kBAAA;AACA,kBAAA;AACD,gBAAA;AACH,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACA,cAAA;AACE,gBAAA;AACF,cAAA;AACF,YAAA;AACA,YAAA;AACE,cAAA;AACA,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACA,YAAA;AACE,cAAA;AACA,cAAA;AACF,YAAA;AACA,YAAA;AACM,cAAA;AACF,gBAAA;AACG,kBAAA;AACC,oBAAA;AACF,kBAAA;AACF,gBAAA;AACF,cAAA;AACE,gBAAA;AACF,cAAA;AACF,YAAA;AACA,YAAA;AACE,cAAA;AACF,YAAA;AAEA,YAAA;AACE,cAAA;AACD,YAAA;AAAA,UAAA;AACH,QAAA;AAEE,QAAA;AAIE,MAAA;AAAA,IAAA;AACN,EAAA;AAEJ;AAEO;AD7EW;AACA;AE5QXC;AF8QW;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-A5Z75X7M.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { Props } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 subpixel-antialiased text-small group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /** option label */\n label?: React.ReactNode;\n /** option value */\n value: string;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: React.ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** The options for the Select component */\n options: SelectOption[];\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {}\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(props?.data?.testId ?? props?.data?.value, { replaceDots: true })}`;\n return (\n <div data-testid={testId}>\n {}\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n menuShouldBlockScroll\n unstyled\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-labelledby={getTriggerProps()['aria-labelledby']?.split(' ')[1]}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n name={name}\n onInputChange={onInputChange}\n options={options}\n placeholder={placeholder}\n classNames={{\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n input: () => {\n return classNames.input;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(\n classNames.multiValueLabel,\n `${getValueProps().className}`,\n );\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }) => {\n return cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n }}\n components={{\n Input: InputComponent,\n Option: OptionComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Control: ControlComponent,\n }}\n onBlur={(_e) => {\n setIsFocused(false);\n onBlur();\n }}\n onChange={(option) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return _option.value;\n }),\n );\n } else {\n onChange((option as SelectOption)?.value);\n }\n }}\n onFocus={(_e) => {\n setIsFocused(true);\n }}\n // set complete option as value by current field value\n value={options.find((option) => {\n return option.value === value;\n })}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n {}\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"]}
@@ -0,0 +1,100 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkTGJJZEHBcjs = require('./chunk-TGJJZEHB.cjs');
4
+
5
+
6
+ var _chunkNZBO4N3Scjs = require('./chunk-NZBO4N3S.cjs');
7
+
8
+
9
+ var _chunkZ353BLWIcjs = require('./chunk-Z353BLWI.cjs');
10
+
11
+
12
+ var _chunk555JRYCScjs = require('./chunk-555JRYCS.cjs');
13
+
14
+ // src/hooks/useUniformFieldArray/useUniformFieldArray.ts
15
+ var _react = require('react');
16
+ var _reacthookform = require('react-hook-form');
17
+ var _pixelmotion = require('@fuf-stack/pixel-motion');
18
+ var useUniformFieldArray = ({
19
+ name,
20
+ flat = false,
21
+ elementInitialValue: _elementInitialValue = null,
22
+ lastElementNotRemovable = false,
23
+ disabled,
24
+ testId: explicitTestId,
25
+ label
26
+ }) => {
27
+ const uniformField = _chunkTGJJZEHBcjs.useUniformField.call(void 0, {
28
+ name,
29
+ disabled,
30
+ testId: explicitTestId,
31
+ label
32
+ });
33
+ const { control } = uniformField;
34
+ const { fields, append, remove, insert, move } = _reacthookform.useFieldArray.call(void 0, {
35
+ control,
36
+ name
37
+ });
38
+ const { trigger, setValue } = _chunkNZBO4N3Scjs.useFormContext.call(void 0, );
39
+ const needsInitialize = lastElementNotRemovable && fields.length === 0;
40
+ const hasInitialized = _react.useRef.call(void 0, !needsInitialize);
41
+ _react.useEffect.call(void 0, () => {
42
+ if (needsInitialize) {
43
+ hasInitialized.current = false;
44
+ }
45
+ }, [needsInitialize]);
46
+ _react.useEffect.call(void 0, () => {
47
+ if (hasInitialized.current) {
48
+ setTimeout(() => {
49
+ trigger(name);
50
+ }, 200);
51
+ }
52
+ }, [fields.length]);
53
+ const [disableAnimation, setDisableAnimation] = _react.useState.call(void 0, true);
54
+ const prefersReducedMotion = _pixelmotion.useReducedMotion.call(void 0, );
55
+ _react.useEffect.call(void 0, () => {
56
+ if (hasInitialized.current) {
57
+ setDisableAnimation(!!prefersReducedMotion);
58
+ }
59
+ }, [prefersReducedMotion]);
60
+ const elementInitialValue = _react.useMemo.call(void 0, () => {
61
+ return flat ? { [_chunkZ353BLWIcjs.flatArrayKey]: _elementInitialValue != null ? _elementInitialValue : null } : _elementInitialValue != null ? _elementInitialValue : {};
62
+ }, [flat, _elementInitialValue]);
63
+ _react.useEffect.call(void 0,
64
+ () => {
65
+ if (needsInitialize) {
66
+ if (!disableAnimation) {
67
+ setDisableAnimation(true);
68
+ }
69
+ setValue(name, [elementInitialValue], {
70
+ shouldDirty: false,
71
+ shouldTouch: false
72
+ });
73
+ hasInitialized.current = true;
74
+ if (!prefersReducedMotion) {
75
+ setTimeout(() => {
76
+ setDisableAnimation(false);
77
+ }, 1);
78
+ }
79
+ }
80
+ },
81
+ // Run when needsInitialize changes (initial mount or reset)
82
+ // eslint-disable-next-line react-hooks/exhaustive-deps
83
+ [needsInitialize]
84
+ );
85
+ return _chunk555JRYCScjs.__spreadValues.call(void 0, {
86
+ // Field array methods and state
87
+ fields,
88
+ append,
89
+ remove,
90
+ insert,
91
+ move,
92
+ disableAnimation,
93
+ elementInitialValue
94
+ }, uniformField);
95
+ };
96
+
97
+
98
+
99
+ exports.useUniformFieldArray = useUniformFieldArray;
100
+ //# sourceMappingURL=chunk-AACO4OEK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-AACO4OEK.cjs","../src/hooks/useUniformFieldArray/useUniformFieldArray.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACVA,8BAAqD;AACrD,gDAAkD;AAElD,sDAAiC;AAqC1B,IAAM,qBAAA,EAAuB,CAElC;AAAA,EACA,IAAA;AAAA,EACA,KAAA,EAAO,KAAA;AAAA,EACP,mBAAA,EAAqB,qBAAA,EAAuB,IAAA;AAAA,EAC5C,wBAAA,EAA0B,KAAA;AAAA,EAC1B,QAAA;AAAA,EACA,MAAA,EAAQ,cAAA;AAAA,EACR;AACF,CAAA,EAAA,GAA+C;AAE7C,EAAA,MAAM,aAAA,EAAe,+CAAA;AAA8B,IACjD,IAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,cAAA;AAAA,IACR;AAAA,EACF,CAAC,CAAA;AAED,EAAA,MAAM,EAAE,QAAQ,EAAA,EAAI,YAAA;AAEpB,EAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,KAAK,EAAA,EAAI,0CAAA;AAAiB,IAChE,OAAA;AAAA,IACA;AAAA,EACF,CAAC,CAAA;AAED,EAAA,MAAM,EAAE,OAAA,EAAS,SAAS,EAAA,EAAI,8CAAA,CAA6B;AAO3D,EAAA,MAAM,gBAAA,EAAkB,wBAAA,GAA2B,MAAA,CAAO,OAAA,IAAW,CAAA;AASrE,EAAA,MAAM,eAAA,EAAiB,2BAAA,CAAQ,eAAe,CAAA;AAK9C,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,GAAA,CAAI,eAAA,EAAiB;AACn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AAA,EAAU;AAAA,UACjE,WAAA,EAAa,KAAA;AAAA,UACb,WAAA,EAAa;AAAA,QACf,CAAC,CAAA;AAGD,QAAA,cAAA,CAAe,QAAA,EAAU,IAAA;AAKzB,QAAA,GAAA,CAAI,CAAC,oBAAA,EAAsB;AACzB,UAAA,UAAA,CAAW,CAAA,EAAA,GAAM;AACf,YAAA,mBAAA,CAAoB,KAAK,CAAA;AAAA,UAC3B,CAAA,EAAG,CAAC,CAAA;AAAA,QACN;AAAA,MACF;AAAA,IACF,CAAA;AAAA;AAAA;AAAA,IAGA,CAAC,eAAe;AAAA,EAClB,CAAA;AAEA,EAAA,OAAO,8CAAA;AAAA;AAAA,IAEL,MAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,EAAA,CAAA,EAEG,YAAA,CAAA;AAEP,CAAA;AD1FA;AACA;AACE;AACF,oDAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-AACO4OEK.cjs","sourcesContent":[null,"import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useUniformField } from '../useUniformField/useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content; pass false to suppress label entirely */\n label?: ReactNode | false;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n const needsInitialize = lastElementNotRemovable && fields.length === 0;\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n // Trigger validation so min/max errors appear instantly when user adds/removes items\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // Disable animations if they're currently enabled (important for reset scenario).\n // During initial mount, animations are already disabled, but after a form reset\n // animations might be enabled, so we need to disable them before adding the element.\n if (!disableAnimation) {\n setDisableAnimation(true);\n }\n\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a 1ms delay (unless user prefers reduced motion).\n // The delay ensures the setValue completes before animations turn on,\n // preventing the initial element from animating in.\n if (!prefersReducedMotion) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n"]}
@@ -0,0 +1,7 @@
1
+ // src/hooks/useInput/useInput.ts
2
+ import { useInput } from "@heroui/input";
3
+
4
+ export {
5
+ useInput
6
+ };
7
+ //# sourceMappingURL=chunk-AHJJIANM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useInput/useInput.ts"],"sourcesContent":["/* eslint-disable import-x/prefer-default-export */\nexport { useInput } from '@heroui/input';\n"],"mappings":";AACA,SAAS,gBAAgB;","names":[]}
@@ -1,9 +1,9 @@
1
- import {
2
- useUniformField
3
- } from "./chunk-2K6FWC4H.js";
4
1
  import {
5
2
  useInputValueDebounce
6
3
  } from "./chunk-MODD3TFE.js";
4
+ import {
5
+ useUniformField
6
+ } from "./chunk-D3NAUOYG.js";
7
7
  import {
8
8
  __objRest,
9
9
  __spreadValues
@@ -128,4 +128,4 @@ export {
128
128
  Input_default,
129
129
  Input_default2
130
130
  };
131
- //# sourceMappingURL=chunk-5OX4LSPF.js.map
131
+ //# sourceMappingURL=chunk-BXGILW5C.js.map
@@ -0,0 +1,34 @@
1
+ import {
2
+ fromNullishString,
3
+ toNullishString
4
+ } from "./chunk-76KOVUDN.js";
5
+ import {
6
+ __spreadProps,
7
+ __spreadValues
8
+ } from "./chunk-K2V4ULA2.js";
9
+
10
+ // src/hooks/useController/useController.ts
11
+ import { useController as useRHFController } from "react-hook-form";
12
+ var useController = (props) => {
13
+ const { field, formState, fieldState } = useRHFController(props);
14
+ return {
15
+ field: __spreadProps(__spreadValues({}, field), {
16
+ // Handles both direct values (onChange("value")) and events (onChange(event))
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ onChange: (...event) => {
19
+ var _a, _b, _c;
20
+ const value = (_c = (_b = (_a = event[0]) == null ? void 0 : _a.target) == null ? void 0 : _b.value) != null ? _c : event[0];
21
+ field.onChange(value === "" ? "" : toNullishString(value));
22
+ },
23
+ // Convert null/undefined to empty string for UI display
24
+ value: fromNullishString(field.value)
25
+ }),
26
+ formState,
27
+ fieldState
28
+ };
29
+ };
30
+
31
+ export {
32
+ useController
33
+ };
34
+ //# sourceMappingURL=chunk-CK362NWK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n formState: UseFormStateReturn<TFieldValues>;\n fieldState: ControllerFieldState;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n // Preserve empty strings for required field validation\n // Only convert non-empty values to nullish strings\n field.onChange(value === '' ? '' : toNullishString(value));\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;AAOA,SAAS,iBAAiB,wBAAwB;AAgC3C,IAAM,gBAAgB,CAC3B,UACsC;AACtC,QAAM,EAAE,OAAO,WAAW,WAAW,IAAI,iBAAiB,KAAK;AAE/D,SAAO;AAAA,IACL,OAAO,iCACF,QADE;AAAA;AAAA;AAAA,MAIL,UAAU,IAAI,UAAiB;AAjDrC;AAkDQ,cAAM,SAAQ,uBAAM,CAAC,MAAP,mBAAU,WAAV,mBAAkB,UAAlB,YAA2B,MAAM,CAAC;AAGhD,cAAM,SAAS,UAAU,KAAK,KAAK,gBAAgB,KAAK,CAAC;AAAA,MAC3D;AAAA;AAAA,MAEA,OAAO,kBAAkB,MAAM,KAAK;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,122 @@
1
+ import {
2
+ FieldValidationError_default
3
+ } from "./chunk-ELYGQTXB.js";
4
+ import {
5
+ useController
6
+ } from "./chunk-CK362NWK.js";
7
+ import {
8
+ useInput
9
+ } from "./chunk-AHJJIANM.js";
10
+ import {
11
+ FieldCopyTestIdButton_default
12
+ } from "./chunk-NTDKZW4E.js";
13
+ import {
14
+ useFormContext
15
+ } from "./chunk-PO5UQAU6.js";
16
+
17
+ // src/hooks/useUniformField/useUniformField.tsx
18
+ import { useEffect, useRef, useState } from "react";
19
+ import { useReducedMotion } from "@fuf-stack/pixel-motion";
20
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ var useDebouncedInvalid = (value, delayMs) => {
22
+ const [state, setState] = useState(value);
23
+ const timeoutRef = useRef(null);
24
+ const prefersReducedMotion = useReducedMotion();
25
+ useEffect(() => {
26
+ if (prefersReducedMotion) {
27
+ if (timeoutRef.current) {
28
+ clearTimeout(timeoutRef.current);
29
+ timeoutRef.current = null;
30
+ }
31
+ setState(value);
32
+ return void 0;
33
+ }
34
+ if (timeoutRef.current) {
35
+ clearTimeout(timeoutRef.current);
36
+ }
37
+ timeoutRef.current = setTimeout(() => {
38
+ setState(value);
39
+ timeoutRef.current = null;
40
+ }, delayMs);
41
+ return () => {
42
+ if (timeoutRef.current) {
43
+ clearTimeout(timeoutRef.current);
44
+ timeoutRef.current = null;
45
+ }
46
+ };
47
+ }, [value, delayMs, prefersReducedMotion]);
48
+ return state;
49
+ };
50
+ function useUniformField(params) {
51
+ var _a;
52
+ const { name, disabled = false, testId: explicitTestId, label } = params;
53
+ const {
54
+ control,
55
+ debugMode,
56
+ formState: { submitCount },
57
+ getFieldState,
58
+ getValues,
59
+ resetField
60
+ } = useFormContext();
61
+ const {
62
+ error,
63
+ invalid: rawInvalid,
64
+ isDirty,
65
+ isTouched,
66
+ required,
67
+ testId
68
+ } = getFieldState(name, explicitTestId);
69
+ const { field } = useController({
70
+ control,
71
+ disabled,
72
+ name
73
+ });
74
+ const { onChange, disabled: isDisabled, onBlur, ref } = field;
75
+ const defaultValue = (_a = getValues()) == null ? void 0 : _a[name];
76
+ const showInvalid = rawInvalid && (isDirty || isTouched || submitCount > 0);
77
+ const invalid = useDebouncedInvalid(showInvalid, 200);
78
+ const showTestIdCopyButton = debugMode === "debug-testids";
79
+ const labelNode = !!label || showTestIdCopyButton ? /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ label !== false ? label : null,
81
+ showTestIdCopyButton ? /* @__PURE__ */ jsx(FieldCopyTestIdButton_default, { testId }) : null
82
+ ] }) : null;
83
+ const errorMessage = /* @__PURE__ */ jsx(FieldValidationError_default, { error, testId });
84
+ const { getErrorMessageProps, getLabelProps, getHelperWrapperProps } = useInput({
85
+ ref,
86
+ classNames: {
87
+ // set padding to 0 for error message exit animation
88
+ helperWrapper: "p-0"
89
+ },
90
+ errorMessage: JSON.stringify(error),
91
+ isInvalid: invalid,
92
+ isRequired: required,
93
+ label,
94
+ labelPlacement: "outside"
95
+ });
96
+ return {
97
+ control,
98
+ debugMode,
99
+ defaultValue,
100
+ disabled: isDisabled,
101
+ error,
102
+ errorMessage,
103
+ field,
104
+ getErrorMessageProps,
105
+ getHelperWrapperProps,
106
+ getLabelProps,
107
+ getValues,
108
+ invalid,
109
+ label: labelNode,
110
+ onBlur,
111
+ onChange,
112
+ ref,
113
+ required,
114
+ resetField,
115
+ testId
116
+ };
117
+ }
118
+
119
+ export {
120
+ useUniformField
121
+ };
122
+ //# sourceMappingURL=chunk-D3NAUOYG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useUniformField/useUniformField.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { FieldCopyTestIdButton } from '../../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInput } from '../useInput/useInput';\n\n/**\n * Debounce invalid state changes for smooth UI transitions while respecting accessibility.\n *\n * Behavior:\n * - Specifically intended for validation invalid flags: debounces both\n * true → false and false → true transitions by `delayMs` to prevent\n * flicker and allow enter/exit animations to complete.\n * - If the user prefers reduced motion (via `useReducedMotion` from\n * `@fuf-stack/pixel-motion`), updates apply immediately with no delay.\n */\nconst useDebouncedInvalid = (value: boolean, delayMs: number) => {\n const [state, setState] = useState(value);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const prefersReducedMotion = useReducedMotion();\n\n useEffect(() => {\n if (prefersReducedMotion) {\n // Respect reduced motion: apply immediately\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n setState(value);\n return undefined;\n }\n\n // Debounce any change (true or false) by delayMs\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => {\n setState(value);\n timeoutRef.current = null;\n }, delayMs);\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n };\n }, [value, delayMs, prefersReducedMotion]);\n\n return state;\n};\n\nexport interface UseUniformFieldParams<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Form field name */\n name: Path<TFieldValues> & string;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content; pass false to suppress label entirely */\n label?: ReactNode | false;\n}\n\nexport interface UseUniformFieldReturn<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** react-hook-form control instance for advanced integrations */\n control: ReturnType<typeof useFormContext<TFieldValues>>['control'];\n /** Debug mode from Uniform provider */\n debugMode: ReturnType<typeof useFormContext<TFieldValues>>['debugMode'];\n /** Current value used to initialize uncontrolled components */\n defaultValue: unknown;\n /** Whether the field is currently disabled (from RHF) */\n disabled: boolean | undefined;\n /** Validation error(s) for the field */\n error: FieldError[] | undefined;\n /** Pre-built errorMessage node to plug into components */\n errorMessage: ReactNode | null;\n /** RHF controller field with nullish conversions applied */\n field: ReturnType<typeof useController<TFieldValues>>['field'];\n /** Helper to spread standardized error message props to underlying components */\n getErrorMessageProps: ReturnType<typeof useInput>['getErrorMessageProps'];\n /** Helper to spread standardized helper wrapper props (for spacing/animation) */\n getHelperWrapperProps: ReturnType<typeof useInput>['getHelperWrapperProps'];\n /** Helper to spread standardized label props to underlying components */\n getLabelProps: ReturnType<typeof useInput>['getLabelProps'];\n /** Access current form values (converted to validation-friendly format) */\n getValues: ReturnType<typeof useFormContext<TFieldValues>>['getValues'];\n /** Whether the field should show invalid state (debounced for smooth animations). True when field is invalid AND (dirty OR touched OR submitted) */\n invalid: boolean;\n /** Computed label node including optional test id copy button */\n label: ReactNode | null;\n /** onBlur handler from controller */\n onBlur: ReturnType<typeof useController<TFieldValues>>['field']['onBlur'];\n /** onChange handler from controller (with nullish handling) */\n onChange: ReturnType<typeof useController<TFieldValues>>['field']['onChange'];\n /** Ref to forward to underlying control */\n ref: ReturnType<typeof useController<TFieldValues>>['field']['ref'];\n /** Whether the field is required according to validation schema */\n required: boolean;\n /** Reset a specific field in the form */\n resetField: ReturnType<typeof useFormContext<TFieldValues>>['resetField'];\n /** Generated HTML data-testid for the field */\n testId: string;\n}\n\n/**\n * Combines frequently used form field logic into a single hook.\n *\n * Provides:\n * - Enhanced form context (validation-aware state, `testId`, value transforms)\n * - Controller field with nullish conversion handling\n * - Debounced `invalid` state with smart timing:\n * • `true` (field becomes invalid): applies immediately so errors show right away\n * • `false` (field becomes valid): delayed 200ms to allow smooth exit animations\n * • Respects `prefers-reduced-motion` by skipping delays when user prefers reduced motion\n * - Smart `invalid` visibility (via `showInvalid`):\n * • Shows errors when field is dirty OR touched OR form has been submitted\n * • Prevents showing errors on pristine/untouched fields for better UX\n * • Works well for all field types (text inputs, checkboxes, radios, arrays)\n * - Prebuilt `errorMessage` React node using `FieldValidationError`\n * - Computed `label` node which appends a `FieldCopyTestIdButton` in\n * `debug-testids` mode\n * - `defaultValue` for uncontrolled defaults and all usual field handlers\n * - Access to form utilities: `control`, `getValues`, `resetField`\n * - Presentation helpers: `getLabelProps`, `getErrorMessageProps`,\n * `getHelperWrapperProps` for consistent wiring to underlying UI components\n */\nexport function useUniformField<TFieldValues extends FieldValues = FieldValues>(\n params: UseUniformFieldParams<TFieldValues>,\n): UseUniformFieldReturn<TFieldValues> {\n const { name, disabled = false, testId: explicitTestId, label } = params;\n\n const {\n control,\n debugMode,\n formState: { submitCount },\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n const {\n error,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n const { field } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n const { onChange, disabled: isDisabled, onBlur, ref } = field;\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n /**\n * Determine when to show the invalid state to the user.\n *\n * Show errors when the field is invalid AND any of these conditions are met:\n * - Field is dirty (value changed from initial) - good for checkboxes/radios/arrays\n * - Field is touched (focused and blurred) - good for text inputs\n * - Form has been submitted - shows all errors after submit attempt\n *\n * This prevents showing errors on pristine/untouched fields for better UX.\n * Examples:\n * - Text input: User loads form with empty required field → no error shown yet\n * - Text input: User focuses and blurs → error shows (via isTouched)\n * - Checkbox group: User clicks first checkbox → error shows immediately (via isDirty)\n * - Any field: User submits form → all errors show (via submitCount)\n *\n * The entire condition is debounced to prevent flickering and allow smooth animations\n * when any of the states (invalid, isDirty, isTouched, submitCount) change.\n */\n const showInvalid = rawInvalid && (isDirty || isTouched || submitCount > 0);\n const invalid = useDebouncedInvalid(showInvalid, 200);\n\n // Build a label node that:\n // - shows the provided label (unless explicitly set to false)\n // - appends a copy-to-clipboard button for the test id in `debug-testids` mode\n // Consumers can pass this directly to component `label` props\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // Ready-to-render error message; consumers can drop this into their\n // component `errorMessage` prop without repeating mapping/markup\n const errorMessage = <FieldValidationError error={error} testId={testId} />;\n\n // Generate standardized props for label, helper wrapper and error message\n // so consumers can spread them directly into UI components (e.g. HeroUI),\n // keeping animations/spacing consistent across fields\n const { getErrorMessageProps, getLabelProps, getHelperWrapperProps } =\n useInput({\n ref,\n classNames: {\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n },\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n return {\n control,\n debugMode,\n defaultValue,\n disabled: isDisabled,\n error,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n getValues,\n invalid,\n label: labelNode,\n onBlur,\n onChange,\n ref,\n required,\n resetField,\n testId,\n };\n}\n\nexport default useUniformField;\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAAS,wBAAwB;AAiM3B,mBAGI,KAHJ;AA/KN,IAAM,sBAAsB,CAAC,OAAgB,YAAoB;AAC/D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK;AACxC,QAAM,aAAa,OAA6C,IAAI;AACpE,QAAM,uBAAuB,iBAAiB;AAE9C,YAAU,MAAM;AACd,QAAI,sBAAsB;AAExB,UAAI,WAAW,SAAS;AACtB,qBAAa,WAAW,OAAO;AAC/B,mBAAW,UAAU;AAAA,MACvB;AACA,eAAS,KAAK;AACd,aAAO;AAAA,IACT;AAGA,QAAI,WAAW,SAAS;AACtB,mBAAa,WAAW,OAAO;AAAA,IACjC;AACA,eAAW,UAAU,WAAW,MAAM;AACpC,eAAS,KAAK;AACd,iBAAW,UAAU;AAAA,IACvB,GAAG,OAAO;AACV,WAAO,MAAM;AACX,UAAI,WAAW,SAAS;AACtB,qBAAa,WAAW,OAAO;AAC/B,mBAAW,UAAU;AAAA,MACvB;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,SAAS,oBAAoB,CAAC;AAEzC,SAAO;AACT;AAgFO,SAAS,gBACd,QACqC;AA1IvC;AA2IE,QAAM,EAAE,MAAM,WAAW,OAAO,QAAQ,gBAAgB,MAAM,IAAI;AAElE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW,EAAE,YAAY;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,eAA6B;AAEjC,QAAM;AAA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