@wix/site-ui 1.305.0 → 1.306.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.
- package/dist/Field/index.d.ts +12 -1
- package/dist/Field/index.js +39 -16
- package/dist/RadioField/index.d.ts +12 -1
- package/dist/index.d.ts +12 -1
- package/package.json +2 -2
package/dist/Field/index.d.ts
CHANGED
|
@@ -140,13 +140,24 @@ export declare const Field: {
|
|
|
140
140
|
align?: DescriptionAlign;
|
|
141
141
|
} & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
142
142
|
Control: React_2.ForwardRefExoticComponent<Omit<WithStringClassName<Omit<Omit<FieldControlProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">>, "prefix" | "suffix"> & {
|
|
143
|
-
/** `line` swaps the boxed border for a single bottom border. */
|
|
143
|
+
/** `line` swaps the boxed border for a single bottom border. Inside a `Field.Group`, set it on the group. */
|
|
144
144
|
variant?: ControlVariant;
|
|
145
145
|
/** Content shown inside the field before the input. */
|
|
146
146
|
prefix?: React_2.ReactNode;
|
|
147
147
|
/** Content shown inside the field after the input. */
|
|
148
148
|
suffix?: React_2.ReactNode;
|
|
149
|
+
/** Class applied to the bordered group rendered when `prefix` or `suffix` is shown. Ignored inside a `Field.Group`. */
|
|
150
|
+
groupClassName?: string;
|
|
149
151
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
152
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
|
|
153
|
+
className?: string;
|
|
154
|
+
} & {
|
|
155
|
+
/** `line` swaps the boxed border for a single bottom border. */
|
|
156
|
+
variant?: ControlVariant;
|
|
157
|
+
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
158
|
+
Adornment: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "className"> & {
|
|
159
|
+
className?: string;
|
|
160
|
+
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
150
161
|
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<FieldItemProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
151
162
|
className?: string;
|
|
152
163
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
package/dist/Field/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { InfoCircle } from "@wix/wix-ui-icons-common";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useBaseUiId } from "../6046.js";
|
|
@@ -685,10 +685,14 @@ const Field_module = {
|
|
|
685
685
|
item: "item-kQeHOQ",
|
|
686
686
|
groupLine: "groupLine-vlna4V"
|
|
687
687
|
};
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
688
|
+
const GroupContext = /*#__PURE__*/ __rspack_external_react.createContext(false);
|
|
689
|
+
const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(GroupContext.Provider, {
|
|
690
|
+
value: false,
|
|
691
|
+
children: /*#__PURE__*/ jsx(FieldRoot_FieldRoot, {
|
|
692
|
+
ref: ref,
|
|
693
|
+
className: clsx(Field_module.root, className),
|
|
694
|
+
...props
|
|
695
|
+
})
|
|
692
696
|
}));
|
|
693
697
|
const Label = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, variant = 'default', ...props }, ref)=>/*#__PURE__*/ jsx(FieldLabel_FieldLabel, {
|
|
694
698
|
ref: ref,
|
|
@@ -718,6 +722,21 @@ const Description = /*#__PURE__*/ __rspack_external_react.forwardRef(({ classNam
|
|
|
718
722
|
}, className),
|
|
719
723
|
...props
|
|
720
724
|
}));
|
|
725
|
+
const Group = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, variant = 'box', ...props }, ref)=>/*#__PURE__*/ jsx(GroupContext.Provider, {
|
|
726
|
+
value: true,
|
|
727
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
728
|
+
ref: ref,
|
|
729
|
+
className: clsx(Input_module.root, Field_module.group, {
|
|
730
|
+
[Field_module.groupLine]: 'line' === variant
|
|
731
|
+
}, className),
|
|
732
|
+
...props
|
|
733
|
+
})
|
|
734
|
+
}));
|
|
735
|
+
const Adornment = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("span", {
|
|
736
|
+
ref: ref,
|
|
737
|
+
className: clsx(Field_module.adornment, className),
|
|
738
|
+
...props
|
|
739
|
+
}));
|
|
721
740
|
const TEXT_INPUT_TYPES = new Set([
|
|
722
741
|
'text',
|
|
723
742
|
'email',
|
|
@@ -733,7 +752,8 @@ const TEXT_INPUT_TYPES = new Set([
|
|
|
733
752
|
'time'
|
|
734
753
|
]);
|
|
735
754
|
const hasAdornment = (node)=>null != node && 'boolean' != typeof node;
|
|
736
|
-
const Control = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, type = 'text', variant = 'box', prefix, suffix, ...props }, ref)=>{
|
|
755
|
+
const Control = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, type = 'text', variant = 'box', prefix, suffix, groupClassName, ...props }, ref)=>{
|
|
756
|
+
const insideGroup = __rspack_external_react.useContext(GroupContext);
|
|
737
757
|
const showPrefix = hasAdornment(prefix);
|
|
738
758
|
const showSuffix = hasAdornment(suffix);
|
|
739
759
|
const adorned = showPrefix || showSuffix;
|
|
@@ -745,27 +765,28 @@ const Control = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, t
|
|
|
745
765
|
}, Field_module.control, {
|
|
746
766
|
[Field_module.controlLine]: 'line' === variant
|
|
747
767
|
}, {
|
|
748
|
-
'has-custom-focus': adorned
|
|
768
|
+
'has-custom-focus': adorned || insideGroup
|
|
749
769
|
}, className),
|
|
750
770
|
...props
|
|
751
771
|
});
|
|
752
|
-
|
|
753
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
754
|
-
className: clsx(Input_module.root, Field_module.group, {
|
|
755
|
-
[Field_module.groupLine]: 'line' === variant
|
|
756
|
-
}),
|
|
772
|
+
const adornedControl = /*#__PURE__*/ jsxs(Fragment, {
|
|
757
773
|
children: [
|
|
758
|
-
showPrefix && /*#__PURE__*/ jsx(
|
|
759
|
-
className: Field_module.adornment,
|
|
774
|
+
showPrefix && /*#__PURE__*/ jsx(Adornment, {
|
|
760
775
|
children: prefix
|
|
761
776
|
}),
|
|
762
777
|
control,
|
|
763
|
-
showSuffix && /*#__PURE__*/ jsx(
|
|
764
|
-
className: Field_module.adornment,
|
|
778
|
+
showSuffix && /*#__PURE__*/ jsx(Adornment, {
|
|
765
779
|
children: suffix
|
|
766
780
|
})
|
|
767
781
|
]
|
|
768
782
|
});
|
|
783
|
+
if (insideGroup) return adornedControl;
|
|
784
|
+
if (!adorned) return control;
|
|
785
|
+
return /*#__PURE__*/ jsx(Group, {
|
|
786
|
+
variant: variant,
|
|
787
|
+
className: groupClassName,
|
|
788
|
+
children: adornedControl
|
|
789
|
+
});
|
|
769
790
|
});
|
|
770
791
|
const Item = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(FieldItem_FieldItem, {
|
|
771
792
|
ref: ref,
|
|
@@ -778,6 +799,8 @@ const Field = {
|
|
|
778
799
|
Error: Error,
|
|
779
800
|
Description: Description,
|
|
780
801
|
Control: Control,
|
|
802
|
+
Group: Group,
|
|
803
|
+
Adornment: Adornment,
|
|
781
804
|
Item: Item,
|
|
782
805
|
Validity: FieldValidity_FieldValidity
|
|
783
806
|
};
|
|
@@ -70,13 +70,24 @@ declare const Field: {
|
|
|
70
70
|
align?: DescriptionAlign;
|
|
71
71
|
} & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
72
72
|
Control: React_2.ForwardRefExoticComponent<Omit<WithStringClassName<Omit<Omit<FieldControlProps, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">>, "prefix" | "suffix"> & {
|
|
73
|
-
/** `line` swaps the boxed border for a single bottom border. */
|
|
73
|
+
/** `line` swaps the boxed border for a single bottom border. Inside a `Field.Group`, set it on the group. */
|
|
74
74
|
variant?: ControlVariant;
|
|
75
75
|
/** Content shown inside the field before the input. */
|
|
76
76
|
prefix?: React_2.ReactNode;
|
|
77
77
|
/** Content shown inside the field after the input. */
|
|
78
78
|
suffix?: React_2.ReactNode;
|
|
79
|
+
/** Class applied to the bordered group rendered when `prefix` or `suffix` is shown. Ignored inside a `Field.Group`. */
|
|
80
|
+
groupClassName?: string;
|
|
79
81
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
82
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
|
|
83
|
+
className?: string;
|
|
84
|
+
} & {
|
|
85
|
+
/** `line` swaps the boxed border for a single bottom border. */
|
|
86
|
+
variant?: ControlVariant;
|
|
87
|
+
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
88
|
+
Adornment: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "className"> & {
|
|
89
|
+
className?: string;
|
|
90
|
+
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
80
91
|
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<FieldItemProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
81
92
|
className?: string;
|
|
82
93
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -4237,13 +4237,24 @@ export declare const Field: {
|
|
|
4237
4237
|
align?: DescriptionAlign;
|
|
4238
4238
|
} & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
4239
4239
|
Control: React_2.ForwardRefExoticComponent<Omit<WithStringClassName<Omit<Omit<FieldControlProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">>, "prefix" | "suffix"> & {
|
|
4240
|
-
/** `line` swaps the boxed border for a single bottom border. */
|
|
4240
|
+
/** `line` swaps the boxed border for a single bottom border. Inside a `Field.Group`, set it on the group. */
|
|
4241
4241
|
variant?: ControlVariant;
|
|
4242
4242
|
/** Content shown inside the field before the input. */
|
|
4243
4243
|
prefix?: React_2.ReactNode;
|
|
4244
4244
|
/** Content shown inside the field after the input. */
|
|
4245
4245
|
suffix?: React_2.ReactNode;
|
|
4246
|
+
/** Class applied to the bordered group rendered when `prefix` or `suffix` is shown. Ignored inside a `Field.Group`. */
|
|
4247
|
+
groupClassName?: string;
|
|
4246
4248
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
4249
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & {
|
|
4250
|
+
className?: string;
|
|
4251
|
+
} & {
|
|
4252
|
+
/** `line` swaps the boxed border for a single bottom border. */
|
|
4253
|
+
variant?: ControlVariant;
|
|
4254
|
+
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
4255
|
+
Adornment: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "className"> & {
|
|
4256
|
+
className?: string;
|
|
4257
|
+
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
4247
4258
|
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<FieldItemProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
4248
4259
|
className?: string;
|
|
4249
4260
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.306.0",
|
|
4
4
|
"description": "Pure UI components for the Wix site builder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"registry": "https://registry.npmjs.org/",
|
|
96
96
|
"access": "public"
|
|
97
97
|
},
|
|
98
|
-
"falconPackageHash": "
|
|
98
|
+
"falconPackageHash": "5508fda51c2dac629f39cd93488e8c4e4cef5872969641420fa389eb"
|
|
99
99
|
}
|