@fuf-stack/uniform 0.14.5 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/CheckboxGroup/index.cjs +7 -6
  2. package/dist/CheckboxGroup/index.cjs.map +1 -1
  3. package/dist/CheckboxGroup/index.d.cts +2 -2
  4. package/dist/CheckboxGroup/index.d.ts +2 -2
  5. package/dist/CheckboxGroup/index.js +6 -5
  6. package/dist/{CheckboxGroup-o-qWkWe1.d.cts → CheckboxGroup-fAdey3Td.d.cts} +1 -1
  7. package/dist/{CheckboxGroup-o-qWkWe1.d.ts → CheckboxGroup-fAdey3Td.d.ts} +1 -1
  8. package/dist/Controller/index.cjs +4 -2
  9. package/dist/Controller/index.cjs.map +1 -1
  10. package/dist/Controller/index.d.cts +7 -3
  11. package/dist/Controller/index.d.ts +7 -3
  12. package/dist/Controller/index.js +7 -5
  13. package/dist/Controller-8Nqugui5.d.cts +37 -0
  14. package/dist/Controller-8Nqugui5.d.ts +37 -0
  15. package/dist/FieldArray/index.cjs +6 -5
  16. package/dist/FieldArray/index.cjs.map +1 -1
  17. package/dist/FieldArray/index.d.cts +5 -3
  18. package/dist/FieldArray/index.d.ts +5 -3
  19. package/dist/FieldArray/index.js +5 -4
  20. package/dist/FieldArray-AqM2XKIh.d.cts +151 -0
  21. package/dist/FieldArray-AqM2XKIh.d.ts +151 -0
  22. package/dist/Form/index.cjs +5 -4
  23. package/dist/Form/index.cjs.map +1 -1
  24. package/dist/Form/index.js +4 -3
  25. package/dist/Grid/index.cjs +1 -0
  26. package/dist/Grid/index.cjs.map +1 -1
  27. package/dist/Grid/index.js +1 -0
  28. package/dist/Input/index.cjs +7 -6
  29. package/dist/Input/index.cjs.map +1 -1
  30. package/dist/Input/index.d.cts +2 -2
  31. package/dist/Input/index.d.ts +2 -2
  32. package/dist/Input/index.js +6 -5
  33. package/dist/{Input-IkWP4cWg.d.cts → Input-B_wjhY9e.d.cts} +1 -1
  34. package/dist/{Input-IkWP4cWg.d.ts → Input-B_wjhY9e.d.ts} +1 -1
  35. package/dist/RadioGroup/index.cjs +7 -6
  36. package/dist/RadioGroup/index.cjs.map +1 -1
  37. package/dist/RadioGroup/index.d.cts +2 -2
  38. package/dist/RadioGroup/index.d.ts +2 -2
  39. package/dist/RadioGroup/index.js +6 -5
  40. package/dist/{RadioGroup-1J39ASHa.d.cts → RadioGroup-Dxd2FPQj.d.cts} +1 -1
  41. package/dist/{RadioGroup-1J39ASHa.d.ts → RadioGroup-Dxd2FPQj.d.ts} +1 -1
  42. package/dist/Select/index.cjs +7 -6
  43. package/dist/Select/index.cjs.map +1 -1
  44. package/dist/Select/index.d.cts +2 -2
  45. package/dist/Select/index.d.ts +2 -2
  46. package/dist/Select/index.js +6 -5
  47. package/dist/{Select-BhS4z0Pj.d.cts → Select-JRwrSDew.d.cts} +1 -1
  48. package/dist/{Select-BhS4z0Pj.d.ts → Select-JRwrSDew.d.ts} +1 -1
  49. package/dist/SubmitButton/index.cjs +5 -4
  50. package/dist/SubmitButton/index.cjs.map +1 -1
  51. package/dist/SubmitButton/index.js +4 -3
  52. package/dist/Switch/index.cjs +7 -6
  53. package/dist/Switch/index.cjs.map +1 -1
  54. package/dist/Switch/index.d.cts +2 -2
  55. package/dist/Switch/index.d.ts +2 -2
  56. package/dist/Switch/index.js +6 -5
  57. package/dist/{Switch-Fdldj8LV.d.cts → Switch-mdolzzEc.d.cts} +1 -1
  58. package/dist/{Switch-Fdldj8LV.d.ts → Switch-mdolzzEc.d.ts} +1 -1
  59. package/dist/TextArea/index.cjs +7 -6
  60. package/dist/TextArea/index.cjs.map +1 -1
  61. package/dist/TextArea/index.d.cts +2 -2
  62. package/dist/TextArea/index.d.ts +2 -2
  63. package/dist/TextArea/index.js +6 -5
  64. package/dist/{TextArea-B-sKvTkd.d.cts → TextArea-DNpInDsW.d.cts} +1 -1
  65. package/dist/{TextArea-B-sKvTkd.d.ts → TextArea-DNpInDsW.d.ts} +1 -1
  66. package/dist/{chunk-QCVTB2NI.js → chunk-3QBYSFDX.js} +10 -9
  67. package/dist/chunk-3QBYSFDX.js.map +1 -0
  68. package/dist/chunk-4DAZAO6Y.cjs +59 -0
  69. package/dist/chunk-4DAZAO6Y.cjs.map +1 -0
  70. package/dist/{chunk-BS52M4SZ.js → chunk-5YDNHSEU.js} +47 -41
  71. package/dist/chunk-5YDNHSEU.js.map +1 -0
  72. package/dist/chunk-7ROOJK7G.cjs +110 -0
  73. package/dist/chunk-7ROOJK7G.cjs.map +1 -0
  74. package/dist/{chunk-WKM2D7LF.js → chunk-ASPOGQPS.js} +2 -5
  75. package/dist/chunk-ASPOGQPS.js.map +1 -0
  76. package/dist/{chunk-XCZKNTFT.cjs → chunk-BDVAK232.cjs} +23 -24
  77. package/dist/chunk-BDVAK232.cjs.map +1 -0
  78. package/dist/chunk-CESGUF6F.cjs +63 -0
  79. package/dist/chunk-CESGUF6F.cjs.map +1 -0
  80. package/dist/chunk-CRTRMMJ7.js +59 -0
  81. package/dist/chunk-CRTRMMJ7.js.map +1 -0
  82. package/dist/{chunk-VP7WDLJM.js → chunk-DS7GUNDT.js} +17 -14
  83. package/dist/chunk-DS7GUNDT.js.map +1 -0
  84. package/dist/chunk-ECDLVJLZ.js +246 -0
  85. package/dist/chunk-ECDLVJLZ.js.map +1 -0
  86. package/dist/{chunk-GN5NJ6ZU.js → chunk-GNDW3TAU.js} +3 -6
  87. package/dist/chunk-GNDW3TAU.js.map +1 -0
  88. package/dist/{chunk-VZ5MMFIF.cjs → chunk-H65I56SI.cjs} +4 -7
  89. package/dist/chunk-H65I56SI.cjs.map +1 -0
  90. package/dist/chunk-HCQJGNWT.cjs +246 -0
  91. package/dist/chunk-HCQJGNWT.cjs.map +1 -0
  92. package/dist/chunk-IBQCNI5H.js +372 -0
  93. package/dist/chunk-IBQCNI5H.js.map +1 -0
  94. package/dist/chunk-IUVEFLF3.cjs +133 -0
  95. package/dist/chunk-IUVEFLF3.cjs.map +1 -0
  96. package/dist/{chunk-Y3SFF6RN.cjs → chunk-KIAIGPG7.cjs} +11 -10
  97. package/dist/chunk-KIAIGPG7.cjs.map +1 -0
  98. package/dist/{chunk-QW44EUAH.js → chunk-MEK7YR46.js} +10 -10
  99. package/dist/chunk-MEK7YR46.js.map +1 -0
  100. package/dist/{chunk-OHJYXA6R.cjs → chunk-OE5IW4ZG.cjs} +4 -7
  101. package/dist/chunk-OE5IW4ZG.cjs.map +1 -0
  102. package/dist/chunk-PHGFXKPU.cjs +51 -0
  103. package/dist/chunk-PHGFXKPU.cjs.map +1 -0
  104. package/dist/{chunk-PZ4LZQI4.cjs → chunk-Q23XGBJ5.cjs} +18 -15
  105. package/dist/chunk-Q23XGBJ5.cjs.map +1 -0
  106. package/dist/{chunk-DDZMDOSG.js → chunk-STU7SBQX.js} +25 -23
  107. package/dist/chunk-STU7SBQX.js.map +1 -0
  108. package/dist/{chunk-BZAPTLMC.js → chunk-T4N6TMUL.js} +49 -49
  109. package/dist/chunk-T4N6TMUL.js.map +1 -0
  110. package/dist/chunk-TJESSWIB.cjs +372 -0
  111. package/dist/chunk-TJESSWIB.cjs.map +1 -0
  112. package/dist/chunk-UAV6PVB4.js +63 -0
  113. package/dist/chunk-UAV6PVB4.js.map +1 -0
  114. package/dist/{chunk-BYKOCVCK.js → chunk-WKJN5A2E.js} +22 -23
  115. package/dist/chunk-WKJN5A2E.js.map +1 -0
  116. package/dist/{chunk-XJZAS7NG.cjs → chunk-WRIXKFKW.cjs} +25 -23
  117. package/dist/chunk-WRIXKFKW.cjs.map +1 -0
  118. package/dist/{chunk-RBIX6EWU.cjs → chunk-Y7MJBI4A.cjs} +11 -11
  119. package/dist/chunk-Y7MJBI4A.cjs.map +1 -0
  120. package/dist/chunk-ZI22WT2P.js +51 -0
  121. package/dist/chunk-ZI22WT2P.js.map +1 -0
  122. package/dist/helpers/index.cjs +9 -2
  123. package/dist/helpers/index.cjs.map +1 -1
  124. package/dist/helpers/index.d.cts +67 -4
  125. package/dist/helpers/index.d.ts +67 -4
  126. package/dist/helpers/index.js +10 -3
  127. package/dist/hooks/index.cjs +6 -3
  128. package/dist/hooks/index.cjs.map +1 -1
  129. package/dist/hooks/index.d.cts +3 -2
  130. package/dist/hooks/index.d.ts +3 -2
  131. package/dist/hooks/index.js +7 -4
  132. package/dist/index.cjs +25 -16
  133. package/dist/index.cjs.map +1 -1
  134. package/dist/index.d.cts +11 -10
  135. package/dist/index.d.ts +11 -10
  136. package/dist/index.js +31 -22
  137. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -0
  138. package/dist/partials/FieldCopyTestIdButton/index.cjs.map +1 -1
  139. package/dist/partials/FieldCopyTestIdButton/index.js +1 -0
  140. package/dist/partials/FieldValidationError/index.cjs +3 -3
  141. package/dist/partials/FieldValidationError/index.js +2 -2
  142. package/package.json +18 -20
  143. package/dist/FieldArray-DD9z-xZ3.d.cts +0 -37
  144. package/dist/FieldArray-DD9z-xZ3.d.ts +0 -37
  145. package/dist/chunk-BBB4FEY6.cjs +0 -22
  146. package/dist/chunk-BBB4FEY6.cjs.map +0 -1
  147. package/dist/chunk-BS52M4SZ.js.map +0 -1
  148. package/dist/chunk-BYKOCVCK.js.map +0 -1
  149. package/dist/chunk-BZAPTLMC.js.map +0 -1
  150. package/dist/chunk-DDZMDOSG.js.map +0 -1
  151. package/dist/chunk-EKE5URXQ.cjs +0 -104
  152. package/dist/chunk-EKE5URXQ.cjs.map +0 -1
  153. package/dist/chunk-GN5NJ6ZU.js.map +0 -1
  154. package/dist/chunk-HOETR36J.cjs +0 -299
  155. package/dist/chunk-HOETR36J.cjs.map +0 -1
  156. package/dist/chunk-HZP3EXGR.cjs +0 -241
  157. package/dist/chunk-HZP3EXGR.cjs.map +0 -1
  158. package/dist/chunk-IUNDGVMC.js +0 -241
  159. package/dist/chunk-IUNDGVMC.js.map +0 -1
  160. package/dist/chunk-KOKIM2ND.js +0 -9
  161. package/dist/chunk-KOKIM2ND.js.map +0 -1
  162. package/dist/chunk-OHJYXA6R.cjs.map +0 -1
  163. package/dist/chunk-PZ4LZQI4.cjs.map +0 -1
  164. package/dist/chunk-QCVTB2NI.js.map +0 -1
  165. package/dist/chunk-QW44EUAH.js.map +0 -1
  166. package/dist/chunk-RBIX6EWU.cjs.map +0 -1
  167. package/dist/chunk-V46BHM2U.js +0 -22
  168. package/dist/chunk-V46BHM2U.js.map +0 -1
  169. package/dist/chunk-VP7WDLJM.js.map +0 -1
  170. package/dist/chunk-VQWKXSHW.cjs +0 -9
  171. package/dist/chunk-VQWKXSHW.cjs.map +0 -1
  172. package/dist/chunk-VZ5MMFIF.cjs.map +0 -1
  173. package/dist/chunk-WKM2D7LF.js.map +0 -1
  174. package/dist/chunk-XCZKNTFT.cjs.map +0 -1
  175. package/dist/chunk-XJWEUCV3.cjs +0 -133
  176. package/dist/chunk-XJWEUCV3.cjs.map +0 -1
  177. package/dist/chunk-XJZAS7NG.cjs.map +0 -1
  178. package/dist/chunk-Y3SFF6RN.cjs.map +0 -1
  179. package/dist/chunk-Y53IHK6B.js +0 -299
  180. package/dist/chunk-Y53IHK6B.js.map +0 -1
@@ -1,241 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkVQWKXSHWcjs = require('./chunk-VQWKXSHW.cjs');
4
-
5
-
6
- var _chunkJU5RT22Ycjs = require('./chunk-JU5RT22Y.cjs');
7
-
8
-
9
- var _chunkOHJYXA6Rcjs = require('./chunk-OHJYXA6R.cjs');
10
-
11
-
12
- var _chunkXJWEUCV3cjs = require('./chunk-XJWEUCV3.cjs');
13
-
14
-
15
- var _chunkBBB4FEY6cjs = require('./chunk-BBB4FEY6.cjs');
16
-
17
- // src/Select/Select.tsx
18
- var _react = require('react');
19
- var _reactselect = require('react-select'); var _reactselect2 = _interopRequireDefault(_reactselect);
20
- var _select = require('@nextui-org/select');
21
- var _pixelutils = require('@fuf-stack/pixel-utils');
22
- var _jsxruntime = require('react/jsx-runtime');
23
- var selectVariants = _pixelutils.tv.call(void 0, {
24
- slots: {
25
- base: "group leading-normal",
26
- clearIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800",
27
- control: "rounded-lg border-2 border-default-200 !duration-150 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none",
28
- control_focused: "border-focus",
29
- crossIcon: "",
30
- downChevron: "",
31
- dropdownIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black",
32
- group: "",
33
- groupHeading: "mb-1 ml-3 mt-2 text-sm text-foreground-500",
34
- indicatorsContainer: "gap-1 p-1",
35
- indicatorSeparator: "bg-default-300",
36
- input: "py-0.5 pl-1",
37
- // See NextUI styles for group-data condition, e.g.: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/select.ts
38
- label: 'pointer-events-auto relative bottom-1.5 ml-1 text-small subpixel-antialiased 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-["*"]',
39
- loadingIndicator: "",
40
- loadingMessage: "",
41
- menu: "mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg",
42
- menuList: "",
43
- // ensure menu has same z-index as modal so it is visible when rendered in modal
44
- // see: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)
45
- menuPortal: "!z-50",
46
- multiValue: "items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1",
47
- multiValueContainer: "",
48
- multiValueLabel: "py-0.5 leading-6",
49
- multiValueRemove: "rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800",
50
- noOptionsMessage: "rounded-sm p-2 text-foreground-500",
51
- option_focused: "bg-default-100 active:bg-default-200",
52
- option_selected: "bg-default-300",
53
- option: "rounded px-3 py-2 hover:cursor-pointer",
54
- placeholder: "ml-1 py-0.5 pl-1 text-sm text-foreground-500",
55
- selectContainer: "",
56
- singleValue: "!ml-1 !leading-7",
57
- valueContainer: "gap-1 p-1"
58
- }
59
- });
60
- var InputComponent = (props) => {
61
- const testId = `${props.selectProps["data-testid"]}`;
62
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactselect.components.Input, { "data-testid": testId, ...props });
63
- };
64
- var ControlComponent = (props) => {
65
- const testId = `${props.selectProps["data-testid"]}_select`;
66
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactselect.components.Control, { ...props }) });
67
- };
68
- var OptionComponent = (props) => {
69
- const testId = `${props.selectProps["data-testid"]}_select_option_${_chunkBBB4FEY6cjs.slugify.call(void 0, _nullishCoalesce(_optionalChain([props, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.testId]), () => ( _optionalChain([props, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.value]))))}`;
70
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactselect.components.Option, { ...props }) });
71
- };
72
- var DropdownIndicatorComponent = (props) => {
73
- const testId = _optionalChain([props, 'optionalAccess', _5 => _5.selectProps, 'access', _6 => _6["data-testid"]]);
74
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": `${testId}_select_dropdown`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactselect.components.DropdownIndicator, { ...props }) });
75
- };
76
- var Select = ({
77
- className = void 0,
78
- clearable = true,
79
- disabled = false,
80
- filterOption = void 0,
81
- renderOptionLabel = void 0,
82
- inputValue = void 0,
83
- label: _label = void 0,
84
- loading = false,
85
- multiSelect = false,
86
- name,
87
- onInputChange = void 0,
88
- options,
89
- placeholder = void 0,
90
- testId: _testId = void 0
91
- }) => {
92
- const { control, debugMode, getFieldState } = _chunkXJWEUCV3cjs.useFormContext.call(void 0, );
93
- const { error, invalid, required, testId } = getFieldState(name, _testId);
94
- const [isFocused, setIsFocused] = _react.useState.call(void 0, false);
95
- const variants = selectVariants();
96
- const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
97
- const {
98
- getBaseProps,
99
- getErrorMessageProps,
100
- getHelperWrapperProps,
101
- getLabelProps,
102
- getTriggerProps,
103
- getValueProps,
104
- label
105
- } = _select.useSelect.call(void 0, {
106
- children: [],
107
- classNames,
108
- errorMessage: JSON.stringify(error),
109
- isDisabled: disabled,
110
- isInvalid: invalid,
111
- isLoading: loading,
112
- isRequired: required,
113
- label: _label,
114
- labelPlacement: "outside",
115
- placeholder: " "
116
- });
117
- const showTestIdCopyButton = debugMode === "debug-testids";
118
- const showLabel = label || showTestIdCopyButton;
119
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
120
- _chunkVQWKXSHWcjs.Controller,
121
- {
122
- control,
123
- name,
124
- render: ({
125
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
126
- field: { onChange, value, ref, onBlur }
127
- }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
128
- "div",
129
- {
130
- ...getBaseProps(),
131
- className: _pixelutils.cn.call(void 0, classNames.base),
132
- "data-testid": `${testId}_wrapper`,
133
- "data-required": required,
134
- children: [
135
- showLabel && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
136
- "label",
137
- {
138
- className: classNames.label,
139
- "data-slot": "label",
140
- htmlFor: `react-select-${name}-input`,
141
- id: getLabelProps().id,
142
- children: [
143
- label,
144
- showTestIdCopyButton && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJU5RT22Ycjs.FieldCopyTestIdButton_default, { testId })
145
- ]
146
- }
147
- ),
148
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
149
- _reactselect2.default,
150
- {
151
- "aria-errormessage": "",
152
- "aria-labelledby": _optionalChain([getTriggerProps, 'call', _7 => _7(), 'access', _8 => _8["aria-labelledby"], 'optionalAccess', _9 => _9.split, 'call', _10 => _10(" "), 'access', _11 => _11[1]]),
153
- "aria-invalid": invalid,
154
- classNames: {
155
- control: () => _pixelutils.cn.call(void 0, classNames.control, {
156
- [classNames.control_focused]: isFocused && !invalid
157
- }),
158
- clearIndicator: () => classNames.clearIndicator,
159
- dropdownIndicator: () => classNames.dropdownIndicator,
160
- groupHeading: () => classNames.groupHeading,
161
- indicatorsContainer: () => classNames.indicatorsContainer,
162
- indicatorSeparator: () => classNames.indicatorSeparator,
163
- input: () => classNames.input,
164
- menu: () => classNames.menu,
165
- menuList: () => classNames.menuList,
166
- menuPortal: () => classNames.menuPortal,
167
- multiValue: () => classNames.multiValue,
168
- multiValueLabel: () => _pixelutils.cn.call(void 0, classNames.multiValueLabel, `${getValueProps().className}`),
169
- multiValueRemove: () => classNames.multiValueRemove,
170
- noOptionsMessage: () => classNames.noOptionsMessage,
171
- option: ({
172
- isFocused: optionIsFocused,
173
- isSelected: optionIsSelected
174
- }) => _pixelutils.cn.call(void 0, classNames.option, {
175
- [classNames.option_focused]: optionIsFocused,
176
- [classNames.option_selected]: optionIsSelected
177
- }),
178
- placeholder: () => classNames.placeholder,
179
- singleValue: () => _pixelutils.cn.call(void 0, classNames.singleValue, `${getValueProps().className}`),
180
- valueContainer: () => classNames.valueContainer
181
- },
182
- components: {
183
- Input: InputComponent,
184
- Option: OptionComponent,
185
- DropdownIndicator: DropdownIndicatorComponent,
186
- Control: ControlComponent
187
- },
188
- "data-testid": testId,
189
- filterOption,
190
- formatOptionLabel: renderOptionLabel,
191
- inputValue,
192
- instanceId: name,
193
- isClearable: clearable,
194
- isDisabled: disabled,
195
- isLoading: loading,
196
- isMulti: multiSelect,
197
- name,
198
- menuPosition: "fixed",
199
- menuShouldBlockScroll: true,
200
- options,
201
- placeholder,
202
- onBlur: (_e) => {
203
- setIsFocused(false);
204
- return onBlur();
205
- },
206
- onChange: (option) => {
207
- if (multiSelect) {
208
- onChange(
209
- _optionalChain([option, 'optionalAccess', _12 => _12.map, 'call', _13 => _13((_option) => _option.value)])
210
- );
211
- } else {
212
- onChange(_optionalChain([option, 'optionalAccess', _14 => _14.value]));
213
- }
214
- },
215
- onFocus: (_e) => {
216
- setIsFocused(true);
217
- },
218
- onInputChange,
219
- ref,
220
- value: options.find((option) => option.value === value),
221
- unstyled: true
222
- }
223
- ),
224
- error && // eslint-disable-next-line react/jsx-props-no-spreading
225
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...getHelperWrapperProps(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...getErrorMessageProps(), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOHJYXA6Rcjs.FieldValidationError_default, { error }) }) })
226
- ]
227
- }
228
- )
229
- }
230
- );
231
- };
232
- var Select_default = Select;
233
-
234
- // src/Select/index.ts
235
- var Select_default2 = Select_default;
236
-
237
-
238
-
239
-
240
- exports.Select_default = Select_default; exports.Select_default2 = Select_default2;
241
- //# sourceMappingURL=chunk-HZP3EXGR.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-HZP3EXGR.cjs","../src/Select/Select.tsx","../src/Select/index.ts"],"names":["Select_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wD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AS,oBAAA;AACI,oBAAA;AAEb,kBAAA;AACwB,oBAAA;AACS,oBAAA;AAE/B,kBAAA;AACF,kBAAA;AACA,kBAAA;AAEA,kBAAA;AACF,gBAAA;AACA,gBAAA;AACE,kBAAA;AACA,kBAAA;AACA,kBAAA;AACA,kBAAA;AACF,gBAAA;AAEA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AAIA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACA,gBAAA;AACE,kBAAA;AACA,kBAAA;AACF,gBAAA;AACA,gBAAA;AACE,kBAAA;AACE,oBAAA;AAAA,sCAAA;AAC4D,oBAAA;AAE9D,kBAAA;AACE,oBAAA;AACF,kBAAA;AACF,gBAAA;AACA,gBAAA;AACE,kBAAA;AACF,gBAAA;AACA,gBAAA;AACA,gBAAA;AAEA,gBAAA;AACA,gBAAA;AAAQ,cAAA;AACV,YAAA;AACC,YAAA;AAEC,4BAAA;AAKA,UAAA;AAAA,QAAA;AAEJ,MAAA;AAAA,IAAA;AAEJ,EAAA;AAEJ;AAEO;AD7FW;AACA;AEnOXA;AFqOW;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-HZP3EXGR.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 '@nextui-org/select';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { Controller } from '../Controller';\nimport { slugify } from '../helpers';\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\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 'rounded-lg border-2 border-default-200 !duration-150 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 NextUI styles for group-data condition, e.g.: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 text-small subpixel-antialiased 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: '',\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/nextui-org/nextui/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\ntype 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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n // eslint-disable-next-line react/jsx-props-no-spreading\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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(props?.data?.testId ?? props?.data?.value)}`;\n return (\n <div data-testid={testId}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\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 // eslint-disable-next-line react/prop-types\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [NextUI Select](https://nextui.org/docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n disabled = false,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n label: _label = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n testId: _testId = undefined,\n}: SelectProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const [isFocused, setIsFocused] = useState(false);\n\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const {\n getBaseProps,\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n getTriggerProps,\n getValueProps,\n label,\n } = useSelect({\n children: [],\n classNames,\n errorMessage: JSON.stringify(error),\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n return (\n <Controller\n control={control}\n name={name}\n render={({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n field: { onChange, value, ref, onBlur },\n }) => (\n <div\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...getBaseProps()}\n className={cn(classNames.base)}\n data-testid={`${testId}_wrapper`}\n // See NextUI styles for group-data condition (data-invalid), e.g.: https://github.com/nextui-org/nextui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n >\n {showLabel && (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {showTestIdCopyButton && (\n <FieldCopyTestIdButton testId={testId} />\n )}\n </label>\n )}\n <ReactSelect\n aria-errormessage=\"\"\n aria-labelledby={\n getTriggerProps()['aria-labelledby']?.split(' ')[1]\n }\n aria-invalid={invalid}\n classNames={{\n control: () =>\n cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n }),\n clearIndicator: () => classNames.clearIndicator,\n dropdownIndicator: () => classNames.dropdownIndicator,\n groupHeading: () => classNames.groupHeading,\n indicatorsContainer: () => classNames.indicatorsContainer,\n indicatorSeparator: () => classNames.indicatorSeparator,\n input: () => classNames.input,\n menu: () => classNames.menu,\n menuList: () => classNames.menuList,\n menuPortal: () => classNames.menuPortal,\n multiValue: () => classNames.multiValue,\n multiValueLabel: () =>\n cn(classNames.multiValueLabel, `${getValueProps().className}`),\n multiValueRemove: () => classNames.multiValueRemove,\n noOptionsMessage: () => classNames.noOptionsMessage,\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }) =>\n cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n }),\n placeholder: () => classNames.placeholder,\n singleValue: () =>\n cn(classNames.singleValue, `${getValueProps().className}`),\n valueContainer: () => classNames.valueContainer,\n }}\n components={{\n Input: InputComponent,\n Option: OptionComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Control: ControlComponent,\n }}\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 name={name}\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 menuShouldBlockScroll\n options={options}\n placeholder={placeholder}\n onBlur={(_e) => {\n setIsFocused(false);\n return onBlur();\n }}\n onChange={(option) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => _option.value),\n );\n } else {\n onChange((option as SelectOption)?.value);\n }\n }}\n onFocus={(_e) => {\n setIsFocused(true);\n }}\n onInputChange={onInputChange}\n ref={ref}\n // set complete option as value by current field value\n value={options.find((option) => option.value === value)}\n unstyled\n />\n {error && (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div {...getHelperWrapperProps()}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <div {...getErrorMessageProps()}>\n <FieldValidationError error={error} />\n </div>\n </div>\n )}\n </div>\n )}\n />\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,241 +0,0 @@
1
- import {
2
- Controller
3
- } from "./chunk-KOKIM2ND.js";
4
- import {
5
- FieldCopyTestIdButton_default
6
- } from "./chunk-2CRY7VDQ.js";
7
- import {
8
- FieldValidationError_default
9
- } from "./chunk-WKM2D7LF.js";
10
- import {
11
- useFormContext
12
- } from "./chunk-BZAPTLMC.js";
13
- import {
14
- slugify
15
- } from "./chunk-V46BHM2U.js";
16
-
17
- // src/Select/Select.tsx
18
- import { useState } from "react";
19
- import ReactSelect, { components } from "react-select";
20
- import { useSelect } from "@nextui-org/select";
21
- import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
22
- import { jsx, jsxs } from "react/jsx-runtime";
23
- var selectVariants = tv({
24
- slots: {
25
- base: "group leading-normal",
26
- clearIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800",
27
- control: "rounded-lg border-2 border-default-200 !duration-150 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none",
28
- control_focused: "border-focus",
29
- crossIcon: "",
30
- downChevron: "",
31
- dropdownIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black",
32
- group: "",
33
- groupHeading: "mb-1 ml-3 mt-2 text-sm text-foreground-500",
34
- indicatorsContainer: "gap-1 p-1",
35
- indicatorSeparator: "bg-default-300",
36
- input: "py-0.5 pl-1",
37
- // See NextUI styles for group-data condition, e.g.: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/select.ts
38
- label: 'pointer-events-auto relative bottom-1.5 ml-1 text-small subpixel-antialiased 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-["*"]',
39
- loadingIndicator: "",
40
- loadingMessage: "",
41
- menu: "mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg",
42
- menuList: "",
43
- // ensure menu has same z-index as modal so it is visible when rendered in modal
44
- // see: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)
45
- menuPortal: "!z-50",
46
- multiValue: "items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1",
47
- multiValueContainer: "",
48
- multiValueLabel: "py-0.5 leading-6",
49
- multiValueRemove: "rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800",
50
- noOptionsMessage: "rounded-sm p-2 text-foreground-500",
51
- option_focused: "bg-default-100 active:bg-default-200",
52
- option_selected: "bg-default-300",
53
- option: "rounded px-3 py-2 hover:cursor-pointer",
54
- placeholder: "ml-1 py-0.5 pl-1 text-sm text-foreground-500",
55
- selectContainer: "",
56
- singleValue: "!ml-1 !leading-7",
57
- valueContainer: "gap-1 p-1"
58
- }
59
- });
60
- var InputComponent = (props) => {
61
- const testId = `${props.selectProps["data-testid"]}`;
62
- return /* @__PURE__ */ jsx(components.Input, { "data-testid": testId, ...props });
63
- };
64
- var ControlComponent = (props) => {
65
- const testId = `${props.selectProps["data-testid"]}_select`;
66
- return /* @__PURE__ */ jsx("div", { "data-testid": testId, children: /* @__PURE__ */ jsx(components.Control, { ...props }) });
67
- };
68
- var OptionComponent = (props) => {
69
- const testId = `${props.selectProps["data-testid"]}_select_option_${slugify(props?.data?.testId ?? props?.data?.value)}`;
70
- return /* @__PURE__ */ jsx("div", { "data-testid": testId, children: /* @__PURE__ */ jsx(components.Option, { ...props }) });
71
- };
72
- var DropdownIndicatorComponent = (props) => {
73
- const testId = props?.selectProps["data-testid"];
74
- return /* @__PURE__ */ jsx("div", { "data-testid": `${testId}_select_dropdown`, children: /* @__PURE__ */ jsx(components.DropdownIndicator, { ...props }) });
75
- };
76
- var Select = ({
77
- className = void 0,
78
- clearable = true,
79
- disabled = false,
80
- filterOption = void 0,
81
- renderOptionLabel = void 0,
82
- inputValue = void 0,
83
- label: _label = void 0,
84
- loading = false,
85
- multiSelect = false,
86
- name,
87
- onInputChange = void 0,
88
- options,
89
- placeholder = void 0,
90
- testId: _testId = void 0
91
- }) => {
92
- const { control, debugMode, getFieldState } = useFormContext();
93
- const { error, invalid, required, testId } = getFieldState(name, _testId);
94
- const [isFocused, setIsFocused] = useState(false);
95
- const variants = selectVariants();
96
- const classNames = variantsToClassNames(variants, className, "base");
97
- const {
98
- getBaseProps,
99
- getErrorMessageProps,
100
- getHelperWrapperProps,
101
- getLabelProps,
102
- getTriggerProps,
103
- getValueProps,
104
- label
105
- } = useSelect({
106
- children: [],
107
- classNames,
108
- errorMessage: JSON.stringify(error),
109
- isDisabled: disabled,
110
- isInvalid: invalid,
111
- isLoading: loading,
112
- isRequired: required,
113
- label: _label,
114
- labelPlacement: "outside",
115
- placeholder: " "
116
- });
117
- const showTestIdCopyButton = debugMode === "debug-testids";
118
- const showLabel = label || showTestIdCopyButton;
119
- return /* @__PURE__ */ jsx(
120
- Controller,
121
- {
122
- control,
123
- name,
124
- render: ({
125
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
126
- field: { onChange, value, ref, onBlur }
127
- }) => /* @__PURE__ */ jsxs(
128
- "div",
129
- {
130
- ...getBaseProps(),
131
- className: cn(classNames.base),
132
- "data-testid": `${testId}_wrapper`,
133
- "data-required": required,
134
- children: [
135
- showLabel && /* @__PURE__ */ jsxs(
136
- "label",
137
- {
138
- className: classNames.label,
139
- "data-slot": "label",
140
- htmlFor: `react-select-${name}-input`,
141
- id: getLabelProps().id,
142
- children: [
143
- label,
144
- showTestIdCopyButton && /* @__PURE__ */ jsx(FieldCopyTestIdButton_default, { testId })
145
- ]
146
- }
147
- ),
148
- /* @__PURE__ */ jsx(
149
- ReactSelect,
150
- {
151
- "aria-errormessage": "",
152
- "aria-labelledby": getTriggerProps()["aria-labelledby"]?.split(" ")[1],
153
- "aria-invalid": invalid,
154
- classNames: {
155
- control: () => cn(classNames.control, {
156
- [classNames.control_focused]: isFocused && !invalid
157
- }),
158
- clearIndicator: () => classNames.clearIndicator,
159
- dropdownIndicator: () => classNames.dropdownIndicator,
160
- groupHeading: () => classNames.groupHeading,
161
- indicatorsContainer: () => classNames.indicatorsContainer,
162
- indicatorSeparator: () => classNames.indicatorSeparator,
163
- input: () => classNames.input,
164
- menu: () => classNames.menu,
165
- menuList: () => classNames.menuList,
166
- menuPortal: () => classNames.menuPortal,
167
- multiValue: () => classNames.multiValue,
168
- multiValueLabel: () => cn(classNames.multiValueLabel, `${getValueProps().className}`),
169
- multiValueRemove: () => classNames.multiValueRemove,
170
- noOptionsMessage: () => classNames.noOptionsMessage,
171
- option: ({
172
- isFocused: optionIsFocused,
173
- isSelected: optionIsSelected
174
- }) => cn(classNames.option, {
175
- [classNames.option_focused]: optionIsFocused,
176
- [classNames.option_selected]: optionIsSelected
177
- }),
178
- placeholder: () => classNames.placeholder,
179
- singleValue: () => cn(classNames.singleValue, `${getValueProps().className}`),
180
- valueContainer: () => classNames.valueContainer
181
- },
182
- components: {
183
- Input: InputComponent,
184
- Option: OptionComponent,
185
- DropdownIndicator: DropdownIndicatorComponent,
186
- Control: ControlComponent
187
- },
188
- "data-testid": testId,
189
- filterOption,
190
- formatOptionLabel: renderOptionLabel,
191
- inputValue,
192
- instanceId: name,
193
- isClearable: clearable,
194
- isDisabled: disabled,
195
- isLoading: loading,
196
- isMulti: multiSelect,
197
- name,
198
- menuPosition: "fixed",
199
- menuShouldBlockScroll: true,
200
- options,
201
- placeholder,
202
- onBlur: (_e) => {
203
- setIsFocused(false);
204
- return onBlur();
205
- },
206
- onChange: (option) => {
207
- if (multiSelect) {
208
- onChange(
209
- option?.map((_option) => _option.value)
210
- );
211
- } else {
212
- onChange(option?.value);
213
- }
214
- },
215
- onFocus: (_e) => {
216
- setIsFocused(true);
217
- },
218
- onInputChange,
219
- ref,
220
- value: options.find((option) => option.value === value),
221
- unstyled: true
222
- }
223
- ),
224
- error && // eslint-disable-next-line react/jsx-props-no-spreading
225
- /* @__PURE__ */ jsx("div", { ...getHelperWrapperProps(), children: /* @__PURE__ */ jsx("div", { ...getErrorMessageProps(), children: /* @__PURE__ */ jsx(FieldValidationError_default, { error }) }) })
226
- ]
227
- }
228
- )
229
- }
230
- );
231
- };
232
- var Select_default = Select;
233
-
234
- // src/Select/index.ts
235
- var Select_default2 = Select_default;
236
-
237
- export {
238
- Select_default,
239
- Select_default2
240
- };
241
- //# sourceMappingURL=chunk-IUNDGVMC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Select/Select.tsx","../src/Select/index.ts"],"sourcesContent":["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 '@nextui-org/select';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { Controller } from '../Controller';\nimport { slugify } from '../helpers';\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\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 'rounded-lg border-2 border-default-200 !duration-150 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 NextUI styles for group-data condition, e.g.: https://github.com/nextui-org/nextui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 text-small subpixel-antialiased 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: '',\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/nextui-org/nextui/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\ntype 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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n // eslint-disable-next-line react/jsx-props-no-spreading\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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\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/prop-types, react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(props?.data?.testId ?? props?.data?.value)}`;\n return (\n <div data-testid={testId}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\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 // eslint-disable-next-line react/prop-types\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [NextUI Select](https://nextui.org/docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n disabled = false,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n label: _label = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n testId: _testId = undefined,\n}: SelectProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const [isFocused, setIsFocused] = useState(false);\n\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const {\n getBaseProps,\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n getTriggerProps,\n getValueProps,\n label,\n } = useSelect({\n children: [],\n classNames,\n errorMessage: JSON.stringify(error),\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n return (\n <Controller\n control={control}\n name={name}\n render={({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n field: { onChange, value, ref, onBlur },\n }) => (\n <div\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...getBaseProps()}\n className={cn(classNames.base)}\n data-testid={`${testId}_wrapper`}\n // See NextUI styles for group-data condition (data-invalid), e.g.: https://github.com/nextui-org/nextui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n >\n {showLabel && (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {showTestIdCopyButton && (\n <FieldCopyTestIdButton testId={testId} />\n )}\n </label>\n )}\n <ReactSelect\n aria-errormessage=\"\"\n aria-labelledby={\n getTriggerProps()['aria-labelledby']?.split(' ')[1]\n }\n aria-invalid={invalid}\n classNames={{\n control: () =>\n cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n }),\n clearIndicator: () => classNames.clearIndicator,\n dropdownIndicator: () => classNames.dropdownIndicator,\n groupHeading: () => classNames.groupHeading,\n indicatorsContainer: () => classNames.indicatorsContainer,\n indicatorSeparator: () => classNames.indicatorSeparator,\n input: () => classNames.input,\n menu: () => classNames.menu,\n menuList: () => classNames.menuList,\n menuPortal: () => classNames.menuPortal,\n multiValue: () => classNames.multiValue,\n multiValueLabel: () =>\n cn(classNames.multiValueLabel, `${getValueProps().className}`),\n multiValueRemove: () => classNames.multiValueRemove,\n noOptionsMessage: () => classNames.noOptionsMessage,\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }) =>\n cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n }),\n placeholder: () => classNames.placeholder,\n singleValue: () =>\n cn(classNames.singleValue, `${getValueProps().className}`),\n valueContainer: () => classNames.valueContainer,\n }}\n components={{\n Input: InputComponent,\n Option: OptionComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Control: ControlComponent,\n }}\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 name={name}\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 menuShouldBlockScroll\n options={options}\n placeholder={placeholder}\n onBlur={(_e) => {\n setIsFocused(false);\n return onBlur();\n }}\n onChange={(option) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => _option.value),\n );\n } else {\n onChange((option as SelectOption)?.value);\n }\n }}\n onFocus={(_e) => {\n setIsFocused(true);\n }}\n onInputChange={onInputChange}\n ref={ref}\n // set complete option as value by current field value\n value={options.find((option) => option.value === value)}\n unstyled\n />\n {error && (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div {...getHelperWrapperProps()}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <div {...getErrorMessageProps()}>\n <FieldValidationError error={error} />\n </div>\n </div>\n )}\n </div>\n )}\n />\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"],"mappings":";;;;;;;;;;;;;;;;;AAGA,SAAS,gBAAgB;AACzB,OAAO,eAAe,kBAAkB;AAExC,SAAS,iBAAiB;AAE1B,SAAS,IAAI,IAAI,4BAA4B;AAmGpC,cA2GG,YA3GH;AA3FF,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,gBACE;AAAA,IACF,SACE;AAAA,IACF,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,aAAa;AAAA,IACb,mBACE;AAAA,IACF,OAAO;AAAA,IACP,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,OAAO;AAAA;AAAA,IAEP,OACE;AAAA,IACF,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAAA,IAGV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,kBACE;AAAA,IACF,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,gBAAgB;AAAA,EAClB;AACF,CAAC;AA6CD,IAAM,iBAA0C,CAAC,UA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CAAC,YAAY,QAAQ,KAAK;AAAA,oBAC5D;AAAA,kBACF,OAAO;AACL,6BAAU,QAAyB,KAAK;AAAA,kBAC1C;AAAA,gBACF;AAAA,gBACA,SAAS,CAAC,OAAO;AACf,+BAAa,IAAI;AAAA,gBACnB;AAAA,gBACA;AAAA,gBACA;AAAA,gBAEA,OAAO,QAAQ,KAAK,CAAC,WAAW,OAAO,UAAU,KAAK;AAAA,gBACtD,UAAQ;AAAA;AAAA,YACV;AAAA,YACC;AAAA,YAEC,oBAAC,SAAK,GAAG,sBAAsB,GAE7B,8BAAC,SAAK,GAAG,qBAAqB,GAC5B,8BAAC,gCAAqB,OAAc,GACtC,GACF;AAAA;AAAA;AAAA,MAEJ;AAAA;AAAA,EAEJ;AAEJ;AAEA,IAAO,iBAAQ;;;AC/Tf,IAAOA,kBAAQ;","names":["Select_default"]}
@@ -1,9 +0,0 @@
1
- // src/Controller/index.ts
2
- import { Controller } from "react-hook-form";
3
- var Controller_default = Controller;
4
-
5
- export {
6
- Controller,
7
- Controller_default
8
- };
9
- //# sourceMappingURL=chunk-KOKIM2ND.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Controller/index.ts"],"sourcesContent":["/** @see https://react-hook-form.com/docs/usecontroller/controller */\n\nimport { Controller } from 'react-hook-form';\n\nexport type { ControllerProps } from 'react-hook-form';\n\nexport { Controller };\n\nexport default Controller;\n"],"mappings":";AAEA,SAAS,kBAAkB;AAM3B,IAAO,qBAAQ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-OHJYXA6R.cjs","../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACyCU,+CAAA;AAhCV,IAAM,qBAAA,EAAuB,CAAC;AAAA,EAC5B,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ,KAAA;AAAA,EACA,OAAA,EAAS,KAAA;AACX,CAAA,EAAA,GAAiC;AAC/B,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO;AACV,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI,UAAA,EAA0B,CAAC,CAAA;AAE/B,EAAA,GAAA,CAAI,OAAO,MAAA,IAAU,SAAA,GAAY,CAAA,CAAE,MAAA,WAAiB,KAAA,CAAA,EAAQ;AAC1D,IAAA,MAAM,YAAA,EAAc,KAAA;AACpB,IAAA,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,EAAA,GAAQ;AAClC,MAAA,UAAA,EAAY,CAAC,GAAG,SAAA,EAAW,GAAG,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA,IAChD,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,WAAA,EACJ,IAAA,CAAK,SAAA,CAAU,SAAS,EAAA,IAAM,KAAA,EAAO,UAAA,EAAa,KAAA;AACpD,EAAA,MAAM,aAAA,EAAyB,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,EAAA,GAAM,CAAA,CAAE,OAAO,CAAA;AAC9D,EAAA,MAAM,WAAA,EAAa,CAAA,OAAA,EAAU,YAAA,CAAa,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAGlD,EAAA;AAAC,IAAA;AAAA,IAAA;AAC6C,MAAA;AAChC,MAAA;AACZ,MAAA;AAEwC,MAAA;AAAA;AAGpC,wBAAA;AAEH,MAAA;AAAA,IAAA;AACH,EAAA;AAEJ;AAEe;ADdwC;AACA;AEjCxC;AFmCwC;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-OHJYXA6R.cjs","sourcesContent":[null,"import type { FieldError } from 'react-hook-form';\n\nimport { slugify } from '../../helpers';\n\nexport interface FieldValidationErrorProps {\n className?: string;\n error: FieldError[] | Record<string, FieldError[]>;\n testId?: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error,\n testId = undefined,\n}: FieldValidationErrorProps) => {\n if (!error) {\n return null;\n }\n\n let tmpErrors: FieldError[] = [];\n\n if (typeof error === 'object' && !(error instanceof Array)) {\n const errorObject = error as Record<string, FieldError[]>;\n Object.keys(error).forEach((key) => {\n tmpErrors = [...tmpErrors, ...errorObject[key]];\n });\n }\n\n const errorArray: FieldError[] =\n JSON.stringify(tmpErrors) !== '[]' ? tmpErrors : (error as FieldError[]);\n const errorStrings: string[] = errorArray.map((e) => e.message) as string[];\n const ariaString = `Error: ${errorStrings.join('\\n')}`;\n\n return (\n <ul\n data-testid={slugify(testId || errorStrings.join())}\n aria-label={ariaString} // TODO: ist das richtig @Hannes?\n className={className}\n >\n {errorStrings.map((errorString: string, i: number) => (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`error_${i}`}>\n <div>{errorString}</div>\n </li>\n ))}\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-PZ4LZQI4.cjs","../src/Form/Form.tsx","../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/index.ts"],"names":["jsx","jsxs","cn","Form_default"],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,oDAAmB;ADMnB;AACA;AEVA,8BAAoC;AACpC,oCAAwB;AACxB,sCAAkC;AAElC;AACA,2CAAmC;AAgDrB,+CAAA;AArCd,IAAM,gBAAA,EAAkB,CAAC,EAAE,UAAA,EAAY,KAAA,EAAU,CAAA,EAAA,GAA4B;AAC3E,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,SAAA,EAAW,EAAE,WAAA,EAAa,OAAA,EAAS,aAAa,C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,KAAA,CAAA;AAAA,EACZ,MAAA,EAAQ,KAAA,CAAA;AAAA,EACR,cAAA,EAAgB,KAAA,CAAA;AAAA,EAChB,KAAA,EAAO,KAAA,CAAA;AAAA,EACP,QAAA;AAAA,EACA,OAAA,EAAS,KAAA,CAAA;AAAA,EACT,WAAA,EAAa,KAAA,CAAA;AAAA,EACb,kBAAA,EAAoB;AACtB,CAAA,EAAA,GAAiB;AACf,EAAA,uBACEA,6BAAAA;AAAA,IAAC,qCAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,KAAA;AAAA,MACnB,aAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA;AAAA,MACA,iBAAA;AAAA,MAEC,QAAA,EAAA,CAAC,EAAE,aAAa,CAAA,EAAA,mBACfC,8BAAAA,KAAC,EAAA,EAAI,SAAA,EAAU,4CAAA,EACb,QAAA,EAAA;AAAA,wBAAAD,6BAAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAWE,4BAAAA,WAAG,EAAa,SAAS,CAAA;AAAA,YACpC,aAAA,EAAa,uCAAA,OAAQ,GAAU,KAAA,GAAQ,EAAE,CAAA;AAAA,YACzC,IAAA;AAAA,YACA,QAAA,EAAU,YAAA;AAAA,YAET;AAAA,UAAA;AAAA,QACH,CAAA;AAAA,QACC,iBAAC,KAAA,6BAAO,UAAA,mBAAWF,6BAAAA,uBAAC,EAAA,EAAgB,SAAA,EAAU,mBAAA,CAAmB;AAAA,MAAA,EAAA,CACpE;AAAA,IAAA;AAAA,EAEJ,CAAA;AAEJ,CAAA;AAEA,IAAO,aAAA,EAAQ,IAAA;ADmEf;AACA;AGrIA,IAAOG,cAAAA,EAAQ,YAAA;AHuIf;AACA;AACE;AACA;AACF,2EAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-PZ4LZQI4.cjs","sourcesContent":[null,"import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { slugify } from '../helpers';\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit }) => (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('flex-grow', className)}\n data-testid={slugify(testId || name || '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {!debug?.disable && <FormDebugViewer className=\"w-96 flex-shrink\" />}\n </div>\n )}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import type { VetoError } from '@fuf-stack/veto';\n\nimport { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button, Card, Json } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../../hooks';\nimport { removeNullishFields } from './FormContext';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { dirtyFields, isValid, isSubmitting },\n setDebugMode,\n validation,\n watch,\n } = useFormContext();\n\n const [validationErrors, setValidationErrors] = useState<\n VetoError['errors'] | null\n >(null);\n\n const formValues = removeNullishFields(watch());\n const debugTestIdsEnabled = debugMode === 'debug-testids';\n\n useEffect(\n () => {\n const updateValidationErrors = async () => {\n if (validation) {\n const validateResult = await validation?.validateAsync(formValues);\n setValidationErrors(validateResult?.errors);\n }\n };\n updateValidationErrors();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [JSON.stringify(formValues)],\n );\n\n if (!debugMode || debugMode === 'off') {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n onClick={() => setDebugMode('debug')}\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n variant=\"light\"\n icon={<FaBug />}\n />\n );\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n icon={<FaTimes className=\"text-danger\" />}\n onClick={() => setDebugMode('off')}\n size=\"sm\"\n variant=\"flat\"\n />\n </div>\n }\n >\n <Button\n variant={debugTestIdsEnabled ? 'solid' : 'light'}\n icon={<FaBullseye />}\n className=\"mb-4 ml-auto mr-auto\"\n onClick={() =>\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug')\n }\n >\n {debugTestIdsEnabled ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values: formValues,\n errors: validationErrors,\n dirtyFields,\n isValid,\n isSubmitting,\n }}\n />\n </Card>\n );\n};\nexport default FormDebugViewer;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Textarea as NextTextArea } from '@nextui-org/input';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { Controller } from '../Controller';\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport interface TextAreaProps {\n /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [NextUI TextArea](https://nextui.org/docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className = undefined,\n disabled = false,\n label = undefined,\n name,\n placeholder = ' ',\n testId: _testId = undefined,\n}: TextAreaProps) => {\n const { control, debugMode, getFieldState } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const showLabel = label || showTestIdCopyButton;\n\n return (\n <Controller\n control={control}\n name={name}\n disabled={disabled}\n render={({\n field: { disabled: isDisabled, onChange, onBlur, value = '', ref },\n }) => {\n /**\n * Ensures the textarea always has a defined string value to prevent uncontrolled to\n * controlled component warnings:\n *\n * 1. Warning Prevention:\n * - Sets default value to '' in field destructuring\n * - Guarantees the value prop is never undefined/null\n * - Prevents React warning: \"A component is changing from uncontrolled to controlled\"\n *\n * 2. Value Handling:\n * - Converts undefined/null to empty string\n * - Converts non-string values to strings\n * - Maintains existing string values\n *\n * Examples:\n * - undefined → \"\" (prevents uncontrolled warning)\n * - null → \"\" (prevents uncontrolled warning)\n * - \"hello\" → \"hello\" (maintains string value)\n * - 123 → \"123\" (converts to string)\n *\n * Without this handling, the textarea could switch between controlled/uncontrolled\n * states when the form value changes from undefined to defined, causing React warnings\n * and potential rendering issues.\n */\n const displayValue = value?.toString() ?? '';\n\n return (\n <NextTextArea\n className={cn(className)}\n classNames={{\n inputWrapper: 'group-data-[focus=true]:border-focus',\n }}\n data-testid={testId}\n errorMessage={error && <FieldValidationError error={error} />}\n isDisabled={isDisabled}\n isRequired={required}\n isInvalid={invalid}\n label={\n showLabel && (\n <>\n {label}\n {showTestIdCopyButton && (\n <FieldCopyTestIdButton testId={testId} />\n )}\n </>\n )\n }\n labelPlacement=\"outside\"\n placeholder={placeholder}\n name={name}\n value={displayValue}\n onChange={onChange}\n onBlur={onBlur}\n ref={ref}\n variant=\"bordered\"\n >\n {children}\n </NextTextArea>\n );\n }}\n />\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,YAAY,oBAAoB;AAEzC,SAAS,UAAU;AAmFgB,SAMnB,UANmB,KAMnB,YANmB;AAxDnC,IAAM,WAAW,CAAC;AAAA,EAChB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ;AAAA,EACR;AAAA,EACA,cAAc;AAAA,EACd,QAAQ,UAAU;AACpB,MAAqB;AACnB,QAAM,EAAE,SAAS,WAAW,cAAc,IAAI,eAAe;AAC7D,QAAM,EAAE,OAAO,SAAS,UAAU,OAAO,IAAI,cAAc,MAAM,OAAO;AAExE,QAAM,uBAAuB,cAAc;AAC3C,QAAM,YAAY,SAAS;AAE3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,CAAC;AAAA,QACP,OAAO,EAAE,UAAU,YAAY,UAAU,QAAQ,QAAQ,IAAI,IAAI;AAAA,MACnE,MAAM;AAyBJ,cAAM,eAAe,OAAO,SAAS,KAAK;AAE1C,eACE;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,SAAS;AAAA,YACvB,YAAY;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YACA,eAAa;AAAA,YACb,cAAc,SAAS,oBAAC,gCAAqB,OAAc;AAAA,YAC3D;AAAA,YACA,YAAY;AAAA,YACZ,WAAW;AAAA,YACX,OACE,aACE,iCACG;AAAA;AAAA,cACA,wBACC,oBAAC,iCAAsB,QAAgB;AAAA,eAE3C;AAAA,YAGJ,gBAAe;AAAA,YACf;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAQ;AAAA,YAEP;AAAA;AAAA,QACH;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;;;AChHf,IAAOA,oBAAQ;","names":["TextArea_default"]}