@sonic-equipment/ui 227.0.0 → 229.0.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.
@@ -6,6 +6,7 @@ interface AccordionProps {
6
6
  }
7
7
  interface AccordionStandardProps extends AccordionProps {
8
8
  borderType?: BorderType | BorderType[];
9
+ className?: string;
9
10
  color?: 'white' | 'black';
10
11
  hasLineSeparator?: boolean;
11
12
  indented?: boolean;
@@ -15,8 +15,8 @@ function Accordion({ variant = 'standard', ...rest }) {
15
15
  throw new Error(`Invalid variant ${variant}`);
16
16
  /* eslint-enable @typescript-eslint/no-unnecessary-condition */
17
17
  }
18
- function StandardAccordion({ borderType = 'bottom', children, color = 'black', hasLineSeparator = true, indented, size = 'md', }) {
19
- return (jsx("div", { className: clsx({ [styles.indented]: indented }, styles.accordion, styles[color], styles[size], hasLineSeparator && styles['with-seperators']), children: Boolean(children) &&
18
+ function StandardAccordion({ borderType = 'bottom', children, className, color = 'black', hasLineSeparator = true, indented, size = 'md', }) {
19
+ return (jsx("div", { className: clsx({ [styles.indented]: indented }, styles.accordion, styles[color], styles[size], hasLineSeparator && styles['with-seperators'], className), children: Boolean(children) &&
20
20
  Children.map(children, child => {
21
21
  if (!child)
22
22
  return null;
@@ -5,7 +5,6 @@ import { Link } from '../buttons/link/link.js';
5
5
  import { Accordion } from '../collapsables/accordion/accordion.js';
6
6
  import { AccordionItem } from '../collapsables/accordion/accordion-item.js';
7
7
  import { isNavigationSection, isNavigationLinkItem, isNavigationLink } from '../shared/api/bff/model/bff.model.js';
8
- import { useIsBreakpoint } from '../shared/hooks/use-is-breakpoint.js';
9
8
  import styles from './footer.module.css.js';
10
9
 
11
10
  function BottomSection({ copyright, countrySelector, footerBottomSection, }) {
@@ -15,8 +14,7 @@ function BottomSection({ copyright, countrySelector, footerBottomSection, }) {
15
14
  return (jsxs("section", { className: styles['bottom-section'], children: [copyright && jsx("p", { className: styles.copyright, children: copyright }), footerBottomSection.items.length > 0 && (jsx("ul", { className: styles['bottom-links'], children: links.map(link => (jsx(Link, { className: styles['bottom-link'], href: link.href || undefined, target: link.openInNewTab ? '_blank' : undefined, children: link.label }, link.key))) })), countrySelector && (jsx("div", { className: styles['country-selector'], children: countrySelector }))] }));
16
15
  }
17
16
  function LinkSection({ linkGroup }) {
18
- const isXl = useIsBreakpoint('xl');
19
- return (jsx("section", { className: styles['link-block'], children: jsx(Accordion, { color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: !isXl, id: `link-block-${linkGroup.key}`, initialIsOpen: isXl, title: linkGroup.header || linkGroup.label, children: jsx("ul", { className: styles['list'], children: linkGroup.items.filter(isNavigationLink).map(link => (jsx("li", { children: jsx(FooterLink, { link: link }) }, link.key))) }) }) }) }, linkGroup.key));
17
+ return (jsxs("section", { className: styles['link-block'], children: [jsx(Accordion, { className: styles['accordion-small'], color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: true, id: `link-block-${linkGroup.key}`, initialIsOpen: false, title: linkGroup.header || linkGroup.label, children: jsx("ul", { className: styles['list'], children: linkGroup.items.filter(isNavigationLink).map(link => (jsx("li", { children: jsx(FooterLink, { link: link }) }, link.key))) }) }) }), jsx(Accordion, { className: styles['accordion-large'], color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: false, id: `link-block-${linkGroup.key}`, initialIsOpen: true, title: linkGroup.header || linkGroup.label, children: jsx("ul", { className: styles['list'], children: linkGroup.items.filter(isNavigationLink).map(link => (jsx("li", { children: jsx(FooterLink, { link: link }) }, link.key))) }) }) })] }, linkGroup.key));
20
18
  }
21
19
  function FooterLink({ link }) {
22
20
  return (jsx(Link, { href: link.href || undefined, target: link.openInNewTab ? '_blank' : undefined, children: link.label }));
@@ -1,3 +1,3 @@
1
- var styles = {"footer":"footer-module-YzJ68","main-links":"footer-module-rFBXC","link-block":"footer-module-P5FXP","list":"footer-module-FM4hU","bottom-section":"footer-module-TZq-4","copyright":"footer-module-qlHSS","bottom-links":"footer-module-5eyFH","country-selector":"footer-module-rc0bC"};
1
+ var styles = {"footer":"footer-module-YzJ68","main-links":"footer-module-rFBXC","link-block":"footer-module-P5FXP","list":"footer-module-FM4hU","accordion-small":"footer-module-FfTbn","accordion-large":"footer-module-1wP8R","bottom-section":"footer-module-TZq-4","copyright":"footer-module-qlHSS","bottom-links":"footer-module-5eyFH","country-selector":"footer-module-rc0bC"};
2
2
 
3
3
  export { styles as default };
@@ -1,2 +1,2 @@
1
- import type { GADataLayerEvent } from './types';
2
- export declare const dataLayer: GADataLayerEvent[];
1
+ import type { DataLayer } from './types';
2
+ export declare const dataLayer: DataLayer;
@@ -1,3 +1,6 @@
1
+ export interface GAContext {
2
+ [key: string]: string | number | boolean | null | undefined;
3
+ }
1
4
  export interface GABaseEvent {
2
5
  [key: string]: any;
3
6
  event: string;
@@ -27,8 +30,9 @@ export interface GAPageviewEvent extends GABaseEvent {
27
30
  page_title?: string;
28
31
  }
29
32
  export type GADataLayerEvent = GABaseEvent | GAEcommerceEvent | GAPageviewEvent;
33
+ export type DataLayer = (GADataLayerEvent | GAContext)[];
30
34
  declare global {
31
35
  interface Window {
32
- dataLayer?: GADataLayerEvent[];
36
+ dataLayer?: DataLayer;
33
37
  }
34
38
  }
@@ -1,5 +1,5 @@
1
1
  import { CartModel } from '../api/storefront/model/storefront.model';
2
- import { type GADataLayerEvent, type GAEcommerceEvent } from './types';
2
+ import { DataLayer, type GADataLayerEvent, type GAEcommerceEvent } from './types';
3
3
  interface GAProductModel {
4
4
  price?: number;
5
5
  productNumber: string;
@@ -44,7 +44,7 @@ interface CreateEcommerceEvent {
44
44
  }
45
45
  interface UseDataLayerReturnValue {
46
46
  createEcommerceEvent: CreateEcommerceEvent;
47
- dataLayer: GADataLayerEvent[];
47
+ dataLayer: DataLayer;
48
48
  }
49
49
  export declare function useDataLayer(): UseDataLayerReturnValue;
50
50
  export declare function useDataLayer(event: GADataLayerEvent): UseDataLayerReturnValue;
@@ -1,7 +1,7 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
  export declare const globalQueryClient: QueryClient;
4
- export declare function ReactQueryContainer({ children, enableDevTools, queryClient, }: {
4
+ export declare function ReactQueryContainer({ children, enableDevTools, queryClient: _queryClient, }: {
5
5
  children: ReactNode | ((args: {
6
6
  queryClient: QueryClient;
7
7
  }) => ReactNode | ReactElement);
@@ -1,21 +1,26 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useMemo } from 'react';
3
4
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4
5
  import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
5
6
  import { environment } from '../utils/environment.js';
6
7
  import { TIME } from '../utils/time.js';
7
8
 
8
- const globalQueryClient = new QueryClient({
9
- defaultOptions: {
10
- queries: {
11
- /* Set gcTime and staleTime to 0 to disable react query cache */
12
- gcTime: 1 * TIME.DAY,
13
- retry: false,
14
- staleTime: 1 * TIME.DAY,
9
+ function createQueryClient() {
10
+ return new QueryClient({
11
+ defaultOptions: {
12
+ queries: {
13
+ /* Set gcTime and staleTime to 0 to disable react query cache */
14
+ gcTime: 1 * TIME.DAY,
15
+ retry: false,
16
+ staleTime: 1 * TIME.DAY,
17
+ },
15
18
  },
16
- },
17
- });
18
- function ReactQueryContainer({ children, enableDevTools = environment !== 'production', queryClient = globalQueryClient, }) {
19
+ });
20
+ }
21
+ const globalQueryClient = createQueryClient();
22
+ function ReactQueryContainer({ children, enableDevTools = environment !== 'production', queryClient: _queryClient, }) {
23
+ const queryClient = useMemo(() => _queryClient || createQueryClient(), [_queryClient]);
19
24
  return (jsxs(QueryClientProvider, { client: queryClient, children: [enableDevTools && jsx(ReactQueryDevtools, { initialIsOpen: false }), children instanceof Function ? children({ queryClient }) : children] }));
20
25
  }
21
26
 
package/dist/styles.css CHANGED
@@ -5154,6 +5154,20 @@ button.swiper-pagination-bullet {
5154
5154
  }
5155
5155
  }
5156
5156
 
5157
+ @media (width >= 1024px) {
5158
+
5159
+ .footer-module-YzJ68 .footer-module-FfTbn {
5160
+ display: none
5161
+ }
5162
+ }
5163
+
5164
+ @media (width < 1024px) {
5165
+
5166
+ .footer-module-YzJ68 .footer-module-1wP8R {
5167
+ display: none
5168
+ }
5169
+ }
5170
+
5157
5171
  .footer-module-YzJ68 .footer-module-TZq-4 {
5158
5172
  display: flex;
5159
5173
  flex-direction: column-reverse;
@@ -6133,6 +6147,7 @@ button.swiper-pagination-bullet {
6133
6147
  }
6134
6148
 
6135
6149
  @media (width < 576px) {.connected-account-button-module-d7qyN {
6150
+ position: fixed !important;
6136
6151
  margin: auto;
6137
6152
  block-size: -moz-fit-content;
6138
6153
  block-size: fit-content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "227.0.0",
3
+ "version": "229.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {