@wix/site-ui 1.305.0 → 1.307.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.
@@ -24,6 +24,10 @@
24
24
  overflow-y: auto;
25
25
  }
26
26
 
27
+ .containScroll-M8I4Mc {
28
+ overscroll-behavior: contain;
29
+ }
30
+
27
31
  .viewport-nOzLZZ :focus-visible {
28
32
  outline: 2px solid var(--wst-links-and-actions-color, #116dff);
29
33
  outline-offset: 2px;
@@ -139,7 +139,7 @@ export declare const Dialog: {
139
139
  Viewport: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<AlertDialogViewportProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
140
140
  className?: string;
141
141
  } & React_2.RefAttributes<HTMLDivElement>>;
142
- Root: typeof Dialog_2.Root;
142
+ Root: typeof Root;
143
143
  Trigger: typeof Trigger;
144
144
  Portal: ({ container, ...props }: PortalProps) => JSX_2.Element;
145
145
  Handle: typeof Dialog_2.Handle;
@@ -948,6 +948,8 @@ declare interface ReasonToEventMap {
948
948
 
949
949
  declare type ReferenceType = Element | VirtualElement;
950
950
 
951
+ declare function Root<Payload = unknown>({ modal, ...props }: Dialog_2.Root.Props<Payload>): JSX_2.Element;
952
+
951
953
  declare const scrub: "scrub";
952
954
 
953
955
  declare const selectors: {
@@ -8,11 +8,13 @@ import * as __rspack_external_react from "react";
8
8
  const Dialog_module = {
9
9
  backdrop: "backdrop-EHLKAc",
10
10
  viewport: "viewport-nOzLZZ",
11
+ containScroll: "containScroll-M8I4Mc",
11
12
  popup: "popup-RjSkgq",
12
13
  close: "close-zqdBdX",
13
14
  title: "title-U8Hyut",
14
15
  description: "description-ZV1a4j"
15
16
  };
17
+ const PageScrollUnlockedContext = /*#__PURE__*/ __rspack_external_react.createContext(false);
16
18
  const Portal = ({ container, ...props })=>/*#__PURE__*/ jsx(DialogPortal_DialogPortal, {
17
19
  container: container ?? getThemedContainer(),
18
20
  ...props
@@ -42,11 +44,23 @@ const Title = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...
42
44
  className: clsx(Dialog_module.title, className),
43
45
  ...props
44
46
  }));
45
- const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(DialogViewport_DialogViewport, {
47
+ const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>{
48
+ const pageScrollUnlocked = __rspack_external_react.useContext(PageScrollUnlockedContext);
49
+ return /*#__PURE__*/ jsx(DialogViewport_DialogViewport, {
46
50
  ref: ref,
47
- className: clsx(Dialog_module.viewport, className),
51
+ className: clsx(Dialog_module.viewport, pageScrollUnlocked && Dialog_module.containScroll, className),
48
52
  ...props
49
- }));
53
+ });
54
+ });
55
+ function Root({ modal = true, ...props }) {
56
+ return /*#__PURE__*/ jsx(PageScrollUnlockedContext.Provider, {
57
+ value: 'trap-focus' === modal,
58
+ children: /*#__PURE__*/ jsx(DialogRoot, {
59
+ modal: modal,
60
+ ...props
61
+ })
62
+ });
63
+ }
50
64
  function Trigger({ className, ...props }) {
51
65
  return /*#__PURE__*/ jsx(DialogTrigger_DialogTrigger, {
52
66
  ...props,
@@ -60,7 +74,7 @@ const Dialog = {
60
74
  Popup: Popup,
61
75
  Title: Title,
62
76
  Viewport: Viewport,
63
- Root: DialogRoot,
77
+ Root: Root,
64
78
  Trigger: Trigger,
65
79
  Portal: Portal,
66
80
  Handle: DialogHandle,
@@ -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>>;
@@ -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 Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(FieldRoot_FieldRoot, {
689
- ref: ref,
690
- className: clsx(Field_module.root, className),
691
- ...props
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
- if (!adorned) return control;
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("span", {
759
- className: Field_module.adornment,
774
+ showPrefix && /*#__PURE__*/ jsx(Adornment, {
760
775
  children: prefix
761
776
  }),
762
777
  control,
763
- showSuffix && /*#__PURE__*/ jsx("span", {
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
@@ -3157,7 +3157,7 @@ export declare const Dialog: {
3157
3157
  Viewport: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<AlertDialogViewportProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
3158
3158
  className?: string;
3159
3159
  } & React_2.RefAttributes<HTMLDivElement>>;
3160
- Root: typeof Dialog_2.Root;
3160
+ Root: typeof Root_3;
3161
3161
  Trigger: typeof Trigger_3;
3162
3162
  Portal: ({ container, ...props }: PortalProps) => JSX_2.Element;
3163
3163
  Handle: typeof Dialog_2.Handle;
@@ -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>>;
@@ -6335,7 +6346,7 @@ export declare const NavigationMenu: {
6335
6346
  Icon: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NavigationMenuIconProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
6336
6347
  className?: string;
6337
6348
  } & React_2.RefAttributes<HTMLSpanElement>>;
6338
- Root: typeof Root_3;
6349
+ Root: typeof Root_4;
6339
6350
  Portal: React_2.ForwardRefExoticComponent<Omit<NavigationMenuPortalProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
6340
6351
  };
6341
6352
 
@@ -8355,7 +8366,7 @@ export declare interface ProgressValueProps extends Omit<BaseUIComponentProps<'s
8355
8366
  export declare interface ProgressValueState extends ProgressRootState {}
8356
8367
 
8357
8368
  export declare const Radio: {
8358
- Root: typeof Root_4;
8369
+ Root: typeof Root_5;
8359
8370
  Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<RadioIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
8360
8371
  className?: string;
8361
8372
  } & React_2.RefAttributes<HTMLSpanElement>>;
@@ -8764,13 +8775,15 @@ declare function Root_2<Value = any>({ className, dir, separator, 'aria-label':
8764
8775
  separator?: React_2.ReactNode;
8765
8776
  }): JSX_2.Element;
8766
8777
 
8767
- declare function Root_3<Value = any>({ className, orientation, ...props }: WithStringClassName<NavigationMenu_2.Root.Props<Value>>): JSX_2.Element;
8778
+ declare function Root_3<Payload = unknown>({ modal, ...props }: Dialog_2.Root.Props<Payload>): JSX_2.Element;
8768
8779
 
8769
- declare function Root_4<Value>({ className, size, style, ...props }: RootProps_2<Value>): JSX_2.Element;
8780
+ declare function Root_4<Value = any>({ className, orientation, ...props }: WithStringClassName<NavigationMenu_2.Root.Props<Value>>): JSX_2.Element;
8770
8781
 
8771
- declare function Root_5<Value extends number | ReadonlyArray<number>>({ className, size, style, ...props }: RootProps_3<Value>): JSX_2.Element;
8782
+ declare function Root_5<Value>({ className, size, style, ...props }: RootProps_2<Value>): JSX_2.Element;
8772
8783
 
8773
- declare const Root_6: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
8784
+ declare function Root_6<Value extends number | ReadonlyArray<number>>({ className, size, style, ...props }: RootProps_3<Value>): JSX_2.Element;
8785
+
8786
+ declare const Root_7: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
8774
8787
  className?: string;
8775
8788
  } & {
8776
8789
  skin?: string;
@@ -11728,7 +11741,7 @@ export declare const Slider: {
11728
11741
  Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<SliderIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
11729
11742
  className?: string;
11730
11743
  } & React_2.RefAttributes<HTMLDivElement>>;
11731
- Root: typeof Root_5;
11744
+ Root: typeof Root_6;
11732
11745
  };
11733
11746
 
11734
11747
  export declare namespace Slider_2 {
@@ -12795,7 +12808,7 @@ declare type ToastNamespace = {
12795
12808
  Provider: typeof Toast_2.Provider;
12796
12809
  Portal: typeof Portal;
12797
12810
  Viewport: typeof Viewport;
12798
- Root: typeof Root_6;
12811
+ Root: typeof Root_7;
12799
12812
  Title: typeof Title_2;
12800
12813
  Close: typeof CloseButton;
12801
12814
  useToastManager: typeof Toast_2.useToastManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/site-ui",
3
- "version": "1.305.0",
3
+ "version": "1.307.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": "a737b726b90b19a7cb5c486bea69d5838e150d73656b13a69374a7c8"
98
+ "falconPackageHash": "897e7589cc1211e7c27a38dab7d7123acc891838bf54a7872b808b1d"
99
99
  }