@sonic-equipment/ui 0.0.37 → 0.0.38

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.
@@ -2,7 +2,7 @@ type AddToCartState = 'initial' | 'spinner' | 'manual-input';
2
2
  interface AddToCartButtonProps {
3
3
  initialState?: AddToCartState;
4
4
  isDisabled?: boolean;
5
- onChange?: (quantity: number) => void;
5
+ onChange: (quantity: number) => void;
6
6
  quantity: number;
7
7
  }
8
8
  export declare function AddToCartButton({ initialState, isDisabled, onChange, quantity, }: AddToCartButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -20,4 +20,5 @@ export declare const InitialState: Story;
20
20
  export declare const SpinnerState: Story;
21
21
  export declare const ManualInputState: Story;
22
22
  export declare const RightAligned: Story;
23
+ export declare const Slow: Story;
23
24
  export declare const Connected: Story;
package/dist/index.d.ts CHANGED
@@ -3663,7 +3663,7 @@ type AddToCartState = 'initial' | 'spinner' | 'manual-input';
3663
3663
  interface AddToCartButtonProps {
3664
3664
  initialState?: AddToCartState;
3665
3665
  isDisabled?: boolean;
3666
- onChange?: (quantity: number) => void;
3666
+ onChange: (quantity: number) => void;
3667
3667
  quantity: number;
3668
3668
  }
3669
3669
  declare function AddToCartButton({ initialState, isDisabled, onChange, quantity, }: AddToCartButtonProps): react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -591,7 +591,10 @@ function TextAlignedArrowIcon(props) {
591
591
  var styles$B = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
592
592
 
593
593
  function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
594
- return (jsxs(Button$1, { className: clsx(className, styles$B.button, styles$B[variant], styles$B[size], styles$B[color], { [styles$B.condensed]: condensed }, { [styles$B.icon]: icon }, styles$B[_pseudo]), isDisabled: isDisabled, onPress: onPress, type: type, children: [icon && iconPosition === 'left' && (jsx("span", { className: styles$B.icon, children: icon })), children, withArrow && (jsx(TextAlignedArrowIcon, { className: styles$B['right-arrow-icon'] })), icon && iconPosition === 'right' && (jsx("span", { className: styles$B.icon, children: icon }))] }));
594
+ return (jsxs(Button$1, { className: clsx(className, styles$B.button, styles$B[variant], styles$B[size], styles$B[color], { [styles$B.condensed]: condensed }, { [styles$B.icon]: icon }, styles$B[_pseudo]), isDisabled: isDisabled,
595
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
596
+ // @ts-ignore
597
+ onClick: e => e.preventDefault(), onPress: onPress, type: type, children: [icon && iconPosition === 'left' && (jsx("span", { className: styles$B.icon, children: icon })), children, withArrow && (jsx(TextAlignedArrowIcon, { className: styles$B['right-arrow-icon'] })), icon && iconPosition === 'right' && (jsx("span", { className: styles$B.icon, children: icon }))] }));
595
598
  }
596
599
 
597
600
  var styles$A = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
@@ -688,19 +691,13 @@ var styles$u = {"field":"number-field-module-gmnog","button-input-container":"nu
688
691
  */
689
692
  function NumberField({ autoFocus, autoGrow, defaultValue, formatOptions = { style: 'decimal', useGrouping: false }, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel = false, size = 'lg', value, withButtons, }) {
690
693
  const inputRef = useRef(null);
691
- const onFocusInput = useDebouncedCallback(() => {
692
- if (!inputRef.current)
693
- return;
694
- inputRef.current.focus();
695
- inputRef.current.selectionStart = inputRef.current.value.length || 0;
696
- }, 500);
697
694
  return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$u.field, styles$u[size]), defaultValue: defaultValue, formatOptions: formatOptions, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxValue: maxValue, minValue: minValue, name: name, onChange: onChange, onInput: onInput, value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs("div", { className: styles$u['button-input-container'], children: [withButtons && (jsx(Button$1, { isDisabled: isDisabled,
698
695
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
699
696
  // @ts-expect-error
700
- onClick: e => e.preventDefault(), onPressEnd: onFocusInput, onPressStart: e => e.target.focus(), slot: "decrement", children: (value || 0) <= 1 ? jsx(TrashOutlinedIcon, {}) : jsx(MinusFilledIcon, {}) })), jsx(Input, { ref: inputRef, autoGrow: autoGrow, maxLength: maxLength, onKeyUp: e => onKeyUp?.(e), placeholder: placeholder, size: size }), withButtons && (jsx(Button$1, { isDisabled: isDisabled,
697
+ onClick: e => e.preventDefault(), onPressStart: e => e.target.focus(), slot: "decrement", children: (value || 0) <= 1 ? jsx(TrashOutlinedIcon, {}) : jsx(MinusFilledIcon, {}) })), jsx(Input, { ref: inputRef, autoGrow: autoGrow, maxLength: maxLength, onFocus: e => (e.target.selectionStart = e.target.value.length || 0), onKeyUp: e => onKeyUp?.(e), placeholder: placeholder, size: size }), withButtons && (jsx(Button$1, { isDisabled: isDisabled,
701
698
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
702
699
  // @ts-expect-error
703
- onClick: e => e.preventDefault(), onPressEnd: onFocusInput, onPressStart: e => e.target.focus(), slot: "increment", children: jsx(PlusFilledIcon, {}) }))] }), jsx(FieldError, {})] }));
700
+ onClick: e => e.preventDefault(), onPressStart: e => e.target.focus(), slot: "increment", children: jsx(PlusFilledIcon, {}) }))] }), jsx(FieldError, {})] }));
704
701
  }
705
702
 
706
703
  function CartFilledIcon(props) {
@@ -711,9 +708,8 @@ var styles$t = {"manual-input-container":"add-to-cart-button-module-AWFvQ","left
711
708
 
712
709
  function AddToCartButton({ initialState = 'initial', isDisabled = false, onChange, quantity, }) {
713
710
  const [currentState, setState] = useState(initialState);
714
- const [manualInputQuantity, setManualInputQuantity] = useState(quantity);
711
+ const [manualInputQuantity, setManualInputQuantity] = useState(null);
715
712
  useEffect(() => {
716
- /* Reset the state when the (initial) quantity changes to zero */
717
713
  setState(currentState => {
718
714
  if (currentState === 'initial' && quantity > 0)
719
715
  return 'spinner';
@@ -721,27 +717,30 @@ function AddToCartButton({ initialState = 'initial', isDisabled = false, onChang
721
717
  return 'initial';
722
718
  if (currentState === 'manual-input' && quantity === 0)
723
719
  return 'initial';
720
+ if (currentState === 'manual-input' && manualInputQuantity === null)
721
+ return 'initial';
724
722
  return currentState;
725
723
  });
726
- }, [currentState, quantity]);
724
+ }, [currentState, quantity, manualInputQuantity]);
725
+ useEffect(() => {
726
+ if (currentState === 'manual-input')
727
+ setManualInputQuantity(null);
728
+ // eslint-disable-next-line react-hooks/exhaustive-deps
729
+ }, [quantity]);
727
730
  if (currentState === 'initial')
728
731
  return (jsx(InitialState, { isDisabled: isDisabled, onAddToCart: () => {
729
- setState('spinner');
730
- onChange?.(1);
732
+ onChange(1);
731
733
  } }));
732
734
  if (currentState === 'spinner')
733
735
  return (jsx(SpinnerState, { isDisabled: isDisabled, onChange: value => {
734
- if (value === 0)
735
- setState('initial');
736
- onChange?.(value);
736
+ onChange(value);
737
737
  }, onManualInput: value => {
738
738
  setManualInputQuantity(value);
739
739
  setState('manual-input');
740
740
  }, quantity: quantity }));
741
741
  return (jsx(ManualInputState, { isDisabled: isDisabled, onCancel: () => setState('spinner'), onConfirm: value => {
742
- onChange?.(value);
743
- setState(value === 0 ? 'initial' : 'spinner');
744
- }, quantity: manualInputQuantity }));
742
+ onChange(value);
743
+ }, quantity: manualInputQuantity || 0 }));
745
744
  }
746
745
  function InitialState({ isDisabled, onAddToCart, }) {
747
746
  return (jsx(Button, { condensed: true, icon: jsx(CartFilledIcon, {}), isDisabled: isDisabled, onPress: onAddToCart, size: "md" }));
@@ -778,8 +777,10 @@ function SpinnerState({ isDisabled, onChange, onManualInput, quantity, }) {
778
777
  useGrouping: false,
779
778
  }, isDisabled: isDisabled, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, onChange: quantity => {
780
779
  setInternalQuantity(quantity);
781
- if (quantity === 0)
780
+ if (quantity === 0) {
781
+ mounted.current = false;
782
782
  return onChange(0);
783
+ }
783
784
  onDebouncedChange(quantity);
784
785
  }, onInput: e => {
785
786
  onManualInput(ensureNumber(e.target.value));
@@ -6609,7 +6610,7 @@ function Sidebar({ children }) {
6609
6610
  return (jsxs("aside", { className: clsx(styles$7.sidebar, {
6610
6611
  [styles$7['is-open']]: isOpen,
6611
6612
  [styles$7['is-closed']]: !isOpen,
6612
- }), children: [jsx("div", { className: styles$7.close, children: jsx(IconButton, { color: "secondary", onPress: toggle, children: jsx(CloseFilledIcon, {}) }) }), children] }));
6613
+ }), children: [jsx("div", { className: styles$7.close, children: jsx(IconButton, { onPress: toggle, children: jsx(CloseFilledIcon, {}) }) }), children] }));
6613
6614
  }
6614
6615
 
6615
6616
  function FilterOutlinedIcon(props) {
@@ -6646,7 +6647,7 @@ function ProductListingPageContent() {
6646
6647
  }
6647
6648
  function ProductOverview() {
6648
6649
  const { hits: productHits } = useHits();
6649
- return (jsx(ProductOverviewGrid, { children: productHits.map(productHit => (jsx(ConnectedProductCart, { href: `/Product/${productHit.storefrontSlug}`, image: {
6650
+ return (jsx(ProductOverviewGrid, { children: productHits.map(productHit => (jsx(ConnectedProductCart, { href: productHit.storefrontSlug, image: {
6650
6651
  alt: productHit.name,
6651
6652
  fit: 'contain',
6652
6653
  src: productHit.images?.find(image => image.quality === 'medium')
@@ -6661,7 +6662,7 @@ function ProductOverview() {
6661
6662
 
6662
6663
  var styles$5 = {"overlay-background":"overlay-background-module-j7R7T","open":"overlay-background-module-DZWsP","close":"overlay-background-module-8pcWN"};
6663
6664
 
6664
- function OverlayBackground({ isOpen, onClick }) {
6665
+ function OverlayBackground({ className, isOpen, onClick, }) {
6665
6666
  const [, setRender] = useState(isOpen);
6666
6667
  const nodeRef = useRef(null);
6667
6668
  useEffect(() => {
@@ -6683,7 +6684,7 @@ function OverlayBackground({ isOpen, onClick }) {
6683
6684
  return ReactDOM.createPortal(jsx("div", { ref: nodeRef, className: clsx(styles$5['overlay-background'], {
6684
6685
  [styles$5['open']]: isOpen,
6685
6686
  [styles$5['close']]: !isOpen,
6686
- }), onClick: onClick }), document.body);
6687
+ }, className), onClick: onClick }), document.body);
6687
6688
  }
6688
6689
 
6689
6690
  function useIsBreakpoint(breakpoint) {
@@ -7043,10 +7044,12 @@ function useAlgoliaSearch() {
7043
7044
  };
7044
7045
  }
7045
7046
 
7047
+ var styles$3 = {"global-search-overlay-background-position":"global-search-module-mmXv1","search-wrapper":"global-search-module-d2g2F","search-root":"global-search-module-Sx8Lx"};
7048
+
7046
7049
  const GlobalSearchDisclosureContext = createContext(null);
7047
7050
  function GlobalSearchContainer({ children, }) {
7048
7051
  const { close, isOpen, open, toggle } = useDisclosure(false);
7049
- return (jsx(TransitionGroup, { children: jsxs(GlobalSearchDisclosureContext.Provider, { value: { close, isOpen, open, toggle }, children: [jsx(Transition, { in: isOpen, timeout: 300, children: state => jsx("div", { className: state, children: children }) }), jsx(OverlayBackground, { isOpen: isOpen, onClick: toggle })] }) }));
7052
+ return (jsx(TransitionGroup, { children: jsxs(GlobalSearchDisclosureContext.Provider, { value: { close, isOpen, open, toggle }, children: [jsx(Transition, { in: isOpen, timeout: 300, children: state => jsx("div", { className: state, children: children }) }), jsx(OverlayBackground, { className: styles$3['global-search-overlay-background-position'], isOpen: isOpen, onClick: toggle })] }) }));
7050
7053
  }
7051
7054
 
7052
7055
  const useGlobalSearchDisclosure = () => {
@@ -7065,7 +7068,7 @@ function ResetIcon(props) {
7065
7068
  return (jsx("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10S2 17.514 2 12 6.486 2 12 2zm4.495 5.505a.7.7 0 0 0-.99 0L12 11.011 8.495 7.505a.7.7 0 0 0-.99 0l-.074.087a.7.7 0 0 0 .074.903L11.011 12l-3.506 3.505a.7.7 0 0 0 0 .99l.087.074a.7.7 0 0 0 .903-.074L12 12.988l3.505 3.507a.7.7 0 0 0 .99 0l.074-.087a.7.7 0 0 0-.074-.903L12.988 12l3.507-3.505a.7.7 0 0 0 0-.99z", fill: "currentColor", fillRule: "evenodd" }) }));
7066
7069
  }
7067
7070
 
7068
- var styles$3 = {"form":"search-input-module-xCCzd","input-container":"search-input-module-okP8k","icon":"search-input-module-GZbhK","label":"search-input-module-vKCm4","reset-btn":"search-input-module-lYseZ","input":"search-input-module-bELFK"};
7071
+ var styles$2 = {"form":"search-input-module-xCCzd","input-container":"search-input-module-okP8k","icon":"search-input-module-GZbhK","label":"search-input-module-vKCm4","reset-btn":"search-input-module-lYseZ","input":"search-input-module-bELFK"};
7069
7072
 
7070
7073
  function SearchInput({ autocomplete, formRef, inputRef, }) {
7071
7074
  const formProps = autocomplete?.getFormProps({
@@ -7075,7 +7078,7 @@ function SearchInput({ autocomplete, formRef, inputRef, }) {
7075
7078
  inputElement: inputRef.current,
7076
7079
  });
7077
7080
  const labelProps = autocomplete?.getLabelProps({});
7078
- return (jsx("form", { ref: formRef, className: styles$3.form, ...formProps, children: jsxs("div", { className: styles$3['input-container'], children: [jsx("label", { className: styles$3.label, ...labelProps, children: jsx(MagnifyingGlassIcon, { className: clsx(styles$3['icon-search'], styles$3.icon) }) }), jsx("input", { ref: inputRef, ...inputProps, className: styles$3.input }), inputProps?.value && (jsx(IconButton, { className: styles$3['reset-btn'], color: "secondary", onPress: () => formRef.current?.reset(), type: "reset", children: jsx(ResetIcon, {}) }))] }) }));
7081
+ return (jsx("form", { ref: formRef, className: styles$2.form, ...formProps, children: jsxs("div", { className: styles$2['input-container'], children: [jsx("label", { className: styles$2.label, ...labelProps, children: jsx(MagnifyingGlassIcon, { className: clsx(styles$2['icon-search'], styles$2.icon) }) }), jsx("input", { ref: inputRef, ...inputProps, className: styles$2.input }), inputProps?.value && (jsx(IconButton, { className: styles$2['reset-btn'], color: "secondary", onPress: () => formRef.current?.reset(), type: "reset", children: jsx(ResetIcon, {}) }))] }) }));
7079
7082
  }
7080
7083
 
7081
7084
  function ConnectedSearchInput() {
@@ -7181,13 +7184,14 @@ function SuggestionsSection() {
7181
7184
  }
7182
7185
  function ProductResultsSection() {
7183
7186
  const { autocomplete, products: collection } = useAlgoliaSearch();
7187
+ const [quantity, setQuantity] = useState(0);
7184
7188
  if (!collection)
7185
7189
  return null;
7186
7190
  const { items, source } = collection;
7187
7191
  return (jsxs("div", { children: [jsx("h3", { children: "Products" }), jsx("div", { style: { display: 'flex' }, ...autocomplete.getListProps({ source }), children: items.map(item => (jsx(ProductCard, { href: "#", ...autocomplete.getItemProps({
7188
7192
  item,
7189
7193
  source: source,
7190
- }), addToCartButton: jsx(AddToCartButton, { quantity: 0 }), image: {
7194
+ }), addToCartButton: jsx(AddToCartButton, { onChange: setQuantity, quantity: quantity }), image: {
7191
7195
  alt: item.name,
7192
7196
  fit: 'contain',
7193
7197
  src: item.images?.find(image => image.quality === 'medium')?.url ||
@@ -7200,16 +7204,16 @@ function ProductResultsSection() {
7200
7204
  }, sku: item.ean, title: item.name }, item.id))) })] }));
7201
7205
  }
7202
7206
 
7203
- var styles$2 = {"search-result-panel":"search-result-panel-module-KBrc9","entering":"search-result-panel-module-Us8rb","entered":"search-result-panel-module-7UxfH","exiting":"search-result-panel-module-3xEiy","exited":"search-result-panel-module-xSeC-"};
7207
+ var styles$1 = {"search-result-panel":"search-result-panel-module-KBrc9","entering":"search-result-panel-module-Us8rb","entered":"search-result-panel-module-7UxfH","exiting":"search-result-panel-module-3xEiy","exited":"search-result-panel-module-xSeC-"};
7204
7208
 
7205
7209
  function SearchResultPanel() {
7206
7210
  const { autocomplete, panelRef } = useAlgoliaSearch();
7207
7211
  const { isOpen } = useGlobalSearchDisclosure();
7208
7212
  // https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer/#check-network-status
7209
- return (jsx(Transition, { in: isOpen, nodeRef: panelRef, timeout: 300, children: transitionState => (jsx("div", { ref: panelRef, className: clsx(styles$2['search-result-panel'], styles$2[transitionState]), ...autocomplete.getPanelProps({}), children: jsx(PanelContent, {}) })) }));
7213
+ return (jsx(Transition, { in: isOpen, nodeRef: panelRef, timeout: 300, children: transitionState => (jsx("div", { ref: panelRef, className: clsx(styles$1['search-result-panel'], styles$1[transitionState]), ...autocomplete.getPanelProps({}), children: jsx(PanelContent, {}) })) }));
7210
7214
  }
7211
7215
 
7212
- var styles$1 = {"search-container":"search-root-module-g9MP0","input":"search-root-module-X7N83","entering":"search-root-module-dQDFs","entered":"search-root-module-fXUUb","exiting":"search-root-module-ZFQys","exited":"search-root-module-gd9xY"};
7216
+ var styles = {"search-container":"search-root-module-g9MP0","input":"search-root-module-X7N83","entering":"search-root-module-dQDFs","entered":"search-root-module-fXUUb","exiting":"search-root-module-ZFQys","exited":"search-root-module-gd9xY"};
7213
7217
 
7214
7218
  function SearchRoot() {
7215
7219
  const { autocomplete, inputRef } = useAlgoliaSearch();
@@ -7224,11 +7228,9 @@ function SearchRoot() {
7224
7228
  inputRef.current.blur();
7225
7229
  }
7226
7230
  }, [inputRef, isOpen]);
7227
- return (jsx(Fragment, { children: jsx(Transition, { in: isOpen, timeout: 300, children: transitionState => (jsxs("div", { className: clsx(styles$1['search-container'], styles$1[transitionState]), ...autocomplete.getRootProps({}), children: [jsx("div", { className: styles$1.input, children: jsx(ConnectedSearchInput, {}) }), jsx("div", { className: styles$1.panel, children: jsx(SearchResultPanel, {}) })] })) }) }));
7231
+ return (jsx(Fragment, { children: jsx(Transition, { in: isOpen, timeout: 300, children: transitionState => (jsxs("div", { className: clsx(styles['search-container'], styles[transitionState]), ...autocomplete.getRootProps({}), children: [jsx("div", { className: styles.input, children: jsx(ConnectedSearchInput, {}) }), jsx("div", { className: styles.panel, children: jsx(SearchResultPanel, {}) })] })) }) }));
7228
7232
  }
7229
7233
 
7230
- var styles = {"search-wrapper":"global-search-module-d2g2F","search-root":"global-search-module-Sx8Lx"};
7231
-
7232
7234
  /**
7233
7235
  * Global search using algolia autocomplete with a custom renderer
7234
7236
  * https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer/
@@ -7238,7 +7240,7 @@ var styles = {"search-wrapper":"global-search-module-d2g2F","search-root":"globa
7238
7240
  * https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/two-column-layout
7239
7241
  */
7240
7242
  function GlobalSearch({ children, searchClient }) {
7241
- return (jsx(GlobalSearchContainer, { children: jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs("div", { className: styles['search-wrapper'], children: [children, jsx("div", { className: styles['search-root'], children: jsx(SearchRoot, {}) })] }) }) }));
7243
+ return (jsx(GlobalSearchContainer, { children: jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs("div", { className: styles$3['search-wrapper'], children: [children, jsx("div", { className: styles$3['search-root'], children: jsx(SearchRoot, {}) })] }) }) }));
7242
7244
  }
7243
7245
 
7244
7246
  export { Accordion, AddProductToCurrentCartError, AddToCartButton, AlgoliaCategories, AlgoliaFilterPanel, AlgoliaFilterSection, AlgoliaMultiSelectFilterSection, AlgoliaPagination, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, AvailabilityMessageType, BadgeImagePlacementValues, BadgeStyleValues, BadgeTypeValues, Breadcrumb, Button, CartFilledIcon, CartOutlinedIcon, CartProvider, CategoryCarousel, Checkbox, ColorCheckbox, ConnectedAddToCartButton, CurrencyPositioningType, DehashedOutlinedIcon, DeleteCartLineByIdError, FavoriteButton, FavoriteFilledIcon, FavoriteOutlinedIcon, FavoriteProvider, FetchCurrentCartLinesError, FetchProductListingPageDataError, FormattedMessage, GlobalSearch, GlobalSearchContainer, GlobalSearchDisclosureContext, GlobalStateProvider, GlobalStateProviderContext, HashedOutlinedIcon, IconButton, Image, IntlProvider, LeftArrowFilledIcon, LinkButton, MultiSelect, NumberField, Page, PageContainer, ProductCard, ProductListingPage, ProductOverviewGrid, ProductPrice, ProductSku, RightArrowFilledIcon, RouteButton, RouteLink, RouteProvider, Select, ShowAll, Sidebar, SidebarDetectBreakpoint, SidebarProvider, TextAlignedArrowIcon, TextField, UpdateCartLineByIdError, VariantDisplayTypeValues, breakpoints$1 as breakpoints, createSonicSearchClient, useAddProductToCurrentCart, useAlgolia, useAlgoliaSearch, useBreakpoint, useCartEvents, useDebouncedCallback, useDeleteCartLineById, useDisclosure, useFavorite, useFetchCurrentCartLines, useFetchProductListingPageData, useFormattedMessage, useGlobalSearchDisclosure, useGlobalState, useNavigate, useScrollLock, useUpdateCartLineById };
@@ -1,6 +1,7 @@
1
1
  interface OverlayBackgroundProps {
2
+ className?: string;
2
3
  isOpen: boolean;
3
4
  onClick: VoidFunction;
4
5
  }
5
- export declare function OverlayBackground({ isOpen, onClick }: OverlayBackgroundProps): React.ReactPortal | null;
6
+ export declare function OverlayBackground({ className, isOpen, onClick, }: OverlayBackgroundProps): React.ReactPortal | null;
6
7
  export {};
package/dist/styles.css CHANGED
@@ -211,8 +211,8 @@
211
211
  :root {
212
212
  --carousel-layer: 10;
213
213
  --sidebar-layer: 100;
214
- --overlay-background-layer: 99;
215
214
  --search-layer: 200;
215
+ --header-layer: 15;
216
216
  }
217
217
 
218
218
  /* stylelint-disable max-nesting-depth */
@@ -2343,7 +2343,6 @@
2343
2343
 
2344
2344
  .overlay-background-module-j7R7T {
2345
2345
  position: fixed;
2346
- z-index: calc(var(--overlay-background-layer) - 1);
2347
2346
  -webkit-backdrop-filter: blur(4px);
2348
2347
  backdrop-filter: blur(4px);
2349
2348
  background-color: rgb(0 0 0 / 52%);
@@ -2415,6 +2414,20 @@
2415
2414
  }
2416
2415
  }
2417
2416
 
2417
+ .global-search-module-mmXv1 {
2418
+ z-index: calc(var(--header-layer) - 1);
2419
+ }
2420
+
2421
+ .global-search-module-d2g2F {
2422
+ position: relative;
2423
+ z-index: var(--search-layer);
2424
+ }
2425
+
2426
+ .global-search-module-d2g2F .global-search-module-Sx8Lx {
2427
+ position: relative;
2428
+ z-index: -1;
2429
+ }
2430
+
2418
2431
  .search-input-module-xCCzd {
2419
2432
  box-sizing: border-box;
2420
2433
  }
@@ -2532,13 +2545,3 @@
2532
2545
  pointer-events: none;
2533
2546
  transform: translateY(-100%);
2534
2547
  }
2535
-
2536
- .global-search-module-d2g2F {
2537
- position: relative;
2538
- z-index: var(--search-layer);
2539
- }
2540
-
2541
- .global-search-module-d2g2F .global-search-module-Sx8Lx {
2542
- position: relative;
2543
- z-index: -1;
2544
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {