@saas-ui/forms 2.6.1 → 2.6.3
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.
- package/CHANGELOG.md +21 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/base-field.tsx +3 -1
- package/src/create-field.tsx +1 -0
- package/src/layout.tsx +11 -2
- package/src/number-input/number-input.test.tsx +3 -1
- package/src/select/select.test.tsx +4 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# @saas-ui/forms
|
2
2
|
|
3
|
+
## 2.6.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 5a334e2: Fixed issue where hideLabel prop would be passed to input
|
8
|
+
- 1cc3e3b: FormLayout now supports theming
|
9
|
+
- Updated dependencies [69f5e66]
|
10
|
+
- @saas-ui/core@2.5.2
|
11
|
+
|
12
|
+
## 2.6.2
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- 5fb8082: Fixed issue where isInvalid would not be passed down to form control
|
17
|
+
- Updated dependencies [5fb8082]
|
18
|
+
- Updated dependencies [d94ccec]
|
19
|
+
- Updated dependencies [d94ccec]
|
20
|
+
- Updated dependencies [06ec4b6]
|
21
|
+
- Updated dependencies [1ff54a2]
|
22
|
+
- @saas-ui/core@2.5.1
|
23
|
+
|
3
24
|
## 2.6.1
|
4
25
|
|
5
26
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -240,12 +240,11 @@ declare const FormLegend: (props: FormLabelProps) => react_jsx_runtime.JSX.Eleme
|
|
240
240
|
*/
|
241
241
|
declare const ObjectField: React$1.FC<ObjectFieldProps>;
|
242
242
|
|
243
|
-
interface FormLayoutProps extends SimpleGridProps {
|
243
|
+
interface FormLayoutProps extends ThemingProps<'SuiFormLayout'>, SimpleGridProps {
|
244
244
|
}
|
245
245
|
/**
|
246
246
|
* Create consistent field spacing and positioning.
|
247
247
|
*
|
248
|
-
*
|
249
248
|
* Renders form items in a `SimpleGrid`
|
250
249
|
* @see https://chakra-ui.com/docs/layout/simple-grid
|
251
250
|
*
|
package/dist/index.d.ts
CHANGED
@@ -240,12 +240,11 @@ declare const FormLegend: (props: FormLabelProps) => react_jsx_runtime.JSX.Eleme
|
|
240
240
|
*/
|
241
241
|
declare const ObjectField: React$1.FC<ObjectFieldProps>;
|
242
242
|
|
243
|
-
interface FormLayoutProps extends SimpleGridProps {
|
243
|
+
interface FormLayoutProps extends ThemingProps<'SuiFormLayout'>, SimpleGridProps {
|
244
244
|
}
|
245
245
|
/**
|
246
246
|
* Create consistent field spacing and positioning.
|
247
247
|
*
|
248
|
-
*
|
249
248
|
* Renders form items in a `SimpleGrid`
|
250
249
|
* @see https://chakra-ui.com/docs/layout/simple-grid
|
251
250
|
*
|
package/dist/index.js
CHANGED
@@ -578,7 +578,8 @@ var useBaseField = (props) => {
|
|
578
578
|
};
|
579
579
|
var BaseField = (props) => {
|
580
580
|
const { controlProps, label, help, hideLabel, error } = useBaseField(props);
|
581
|
-
|
581
|
+
const isInvalid = !!error || controlProps.isInvalid;
|
582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react12.FormControl, { ...controlProps, isInvalid, children: [
|
582
583
|
label && !hideLabel ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.FormLabel, { children: label }) : null,
|
583
584
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react12.Box, { children: [
|
584
585
|
props.children,
|
@@ -612,7 +613,8 @@ var _createField = (InputComponent, { displayName, hideLabel, getBaseField: getB
|
|
612
613
|
"isDisabled",
|
613
614
|
"isInvalid",
|
614
615
|
"isReadOnly",
|
615
|
-
"help"
|
616
|
+
"help",
|
617
|
+
"hideLabel"
|
616
618
|
].concat(extraProps)
|
617
619
|
);
|
618
620
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BaseField2, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
@@ -815,6 +817,7 @@ var FormLayout = ({ children, ...props }) => {
|
|
815
817
|
const defaultProps = (_c = (_b = (_a = theme.components) == null ? void 0 : _a.SuiFormLayout) == null ? void 0 : _b.defaultProps) != null ? _c : {
|
816
818
|
spacing: 4
|
817
819
|
};
|
820
|
+
const styles = (0, import_react15.useStyleConfig)("SuiFormLayout", props);
|
818
821
|
const gridProps = (0, import_react15.omitThemingProps)({
|
819
822
|
...defaultProps,
|
820
823
|
...props
|
@@ -824,6 +827,10 @@ var FormLayout = ({ children, ...props }) => {
|
|
824
827
|
{
|
825
828
|
...gridProps,
|
826
829
|
className: (0, import_utils5.cx)("sui-form__layout", props.className),
|
830
|
+
sx: {
|
831
|
+
...styles,
|
832
|
+
...props.sx
|
833
|
+
},
|
827
834
|
children
|
828
835
|
}
|
829
836
|
);
|