@sonic-equipment/ui 0.0.32 → 0.0.34

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.
Files changed (26) hide show
  1. package/dist/algolia/algolia-index-config.d.ts +5 -65
  2. package/dist/algolia/algolia-provider.d.ts +2 -1
  3. package/dist/algolia/algolia-query-string-routing.d.ts +2 -1
  4. package/dist/forms/select/select.d.ts +2 -1
  5. package/dist/global-search/global-search-provider/global-search-container.d.ts +2 -0
  6. package/dist/global-search/global-search-provider/use-search-disclosure.d.ts +2 -0
  7. package/dist/index.d.ts +18 -10
  8. package/dist/index.js +198 -135
  9. package/dist/intl/intl-context.d.ts +2 -0
  10. package/dist/intl/intl-provider.d.ts +2 -1
  11. package/dist/intl/translation-id.d.ts +1 -1
  12. package/dist/intl/use-format-message.d.ts +1 -1
  13. package/dist/intl/use-language-code.d.ts +2 -0
  14. package/dist/pages/{page-layout/page-layout.d.ts → page-container/page-container.d.ts} +1 -1
  15. package/dist/pages/{page-layout/page-layout.stories.d.ts → page-container/page-container.stories.d.ts} +2 -2
  16. package/dist/pages/product-listing-page/product-listing-page.d.ts +3 -3
  17. package/dist/pages/product-listing-page/product-listing-page.stories.d.ts +3 -1
  18. package/dist/pages/product-listing-page/use-fetch-product-listing-page/use-fetch-product-listing-page-data.d.ts +5 -1
  19. package/dist/pages/product-listing-page/use-fetch-product-listing-page/use-fetch-product-listing-page-data.stories.d.ts +3 -1
  20. package/dist/shared/hooks/use-breakpoint.d.ts +2 -2
  21. package/dist/shared/hooks/use-is-breakpoint.d.ts +2 -0
  22. package/dist/shared/utils/environment.d.ts +1 -1
  23. package/dist/sidebar/sidebar-context.d.ts +2 -0
  24. package/dist/sidebar/sidebar-provider.d.ts +1 -0
  25. package/dist/styles.css +81 -41
  26. package/package.json +21 -21
@@ -0,0 +1,2 @@
1
+ export declare function useLanguageCode(): string;
2
+ export declare function useUpdateLanguageCode(): (languageCode: string) => void;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare function PageLayout({ children, className, }: {
2
+ export declare function PageContainer({ children, className, }: {
3
3
  children: ReactNode;
4
4
  className?: string;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import type { StoryObj } from '@storybook/react';
2
- import { PageLayout } from './page-layout';
2
+ import { PageContainer } from './page-container';
3
3
  declare const meta: {
4
4
  args: {
5
5
  children: import("react/jsx-runtime").JSX.Element;
6
6
  };
7
- component: typeof PageLayout;
7
+ component: typeof PageContainer;
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
@@ -8,9 +8,9 @@ export interface Filters {
8
8
  }[];
9
9
  };
10
10
  }
11
- export type ProductListingPageProps = {
11
+ export interface ProductListingPageProps {
12
12
  bffUrl: string;
13
13
  pageUrl: string;
14
14
  searchClient?: SearchClient;
15
- };
16
- export declare function ProductListingPage({ bffUrl, pageUrl, searchClient, }: ProductListingPageProps): import("react/jsx-runtime").JSX.Element;
15
+ }
16
+ export declare function ProductListingPage({ bffUrl, pageUrl, searchClient, }: ProductListingPageProps): import("react/jsx-runtime").JSX.Element | null;
@@ -3,13 +3,15 @@ import { StoryObj } from '@storybook/react';
3
3
  import { ProductListingPage } from './product-listing-page';
4
4
  type StoryProps = Omit<ComponentProps<typeof ProductListingPage>, 'searchClient'> & {
5
5
  bff: boolean;
6
+ languageCode: string;
6
7
  online: boolean;
7
8
  };
8
9
  declare const meta: {
9
10
  args: {
10
11
  bff: true;
11
12
  bffUrl: string;
12
- online: false;
13
+ languageCode: string;
14
+ online: true;
13
15
  pageUrl: string;
14
16
  };
15
17
  parameters: {
@@ -1,2 +1,6 @@
1
1
  import { ProductListingPageData } from 'pages/product-listing-page/product-listing-page-data-types';
2
- export declare function useFetchProductListingPageData(bffUrl: string, pageUrl: string): import("@tanstack/react-query").UseQueryResult<ProductListingPageData, Error>;
2
+ export interface FetchProductListingPageDataArgs {
3
+ languageCode: string;
4
+ pageUrl: string;
5
+ }
6
+ export declare function useFetchProductListingPageData(bffUrl: string, { languageCode, pageUrl }: FetchProductListingPageDataArgs): import("@tanstack/react-query").UseQueryResult<ProductListingPageData, Error>;
@@ -1,12 +1,14 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  interface StoryProps {
3
3
  bffUrl: string;
4
+ languageCode: string;
4
5
  pageUrl: string;
5
6
  }
6
- declare function UseFetchProductListingPageDataStory(args: StoryProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function UseFetchProductListingPageDataStory({ bffUrl, languageCode, pageUrl, }: StoryProps): import("react/jsx-runtime").JSX.Element;
7
8
  declare const meta: {
8
9
  args: {
9
10
  bffUrl: string;
11
+ languageCode: string;
10
12
  pageUrl: string;
11
13
  };
12
14
  component: typeof UseFetchProductListingPageDataStory;
@@ -1,11 +1,11 @@
1
- declare const breakpoints: {
1
+ export declare const breakpoints: {
2
2
  readonly sm: 0;
3
3
  readonly md: 576;
4
4
  readonly lg: 768;
5
5
  readonly xl: 1024;
6
6
  readonly xxl: 1440;
7
7
  };
8
- type Breakpoint = keyof typeof breakpoints;
8
+ export type Breakpoint = keyof typeof breakpoints;
9
9
  interface UseBreakpointReturnType extends Record<Breakpoint, boolean> {
10
10
  current: Breakpoint;
11
11
  }
@@ -0,0 +1,2 @@
1
+ import { Breakpoint } from './use-breakpoint';
2
+ export declare function useIsBreakpoint(breakpoint: Breakpoint): boolean;
@@ -1,3 +1,3 @@
1
1
  export declare const environments: readonly ["sandbox", "production"];
2
2
  export type Environment = (typeof environments)[number];
3
- export declare const environment: Environment | undefined;
3
+ export declare let environment: Environment;
@@ -1,5 +1,7 @@
1
1
  export interface SidebarContextType {
2
+ close: () => void;
2
3
  isOpen: boolean;
4
+ open: () => void;
3
5
  toggle: () => void;
4
6
  transition: boolean;
5
7
  }
@@ -2,5 +2,6 @@ import { ReactElement } from 'react';
2
2
  interface SidebarProviderProps {
3
3
  children: ReactElement;
4
4
  }
5
+ export declare function SidebarDetectBreakpoint(): import("react/jsx-runtime").JSX.Element | null;
5
6
  export declare function SidebarProvider({ children }: SidebarProviderProps): import("react/jsx-runtime").JSX.Element;
6
7
  export {};
package/dist/styles.css CHANGED
@@ -283,7 +283,6 @@
283
283
  .button-module-V4meK {
284
284
  all: unset;
285
285
  display: inline-flex;
286
- width: uppercase;
287
286
  box-sizing: border-box;
288
287
  flex-shrink: 0;
289
288
  align-items: center;
@@ -728,21 +727,20 @@
728
727
  width: 28px;
729
728
  }
730
729
 
730
+ :root {
731
+ --tag-height: var(--space-16);
732
+ }
733
+
731
734
  .tag-module-B7r15 {
732
735
  --tag-bg-color: var(--color-brand-red);
733
736
  --tag-fg-color: var(--color-brand-white);
734
737
 
735
738
  display: inline-flex;
736
- height: 16px;
737
- flex: 1 1;
738
- flex-direction: row;
739
- align-items: stretch;
739
+ height: var(--tag-height);
740
740
  }
741
741
 
742
- .tag-module-B7r15 .tag-module-4cfCf {
743
- display: block;
744
- padding: 2px 0 0 4px;
745
- border: 1px solid var(--tag-bg-color);
742
+ .tag-module-B7r15 .tag-module-4cfCf {
743
+ padding: 3px 1px 1px 5px;
746
744
  background-color: var(--tag-bg-color);
747
745
  color: var(--tag-fg-color);
748
746
  font-size: var(--font-size-11);
@@ -751,12 +749,10 @@
751
749
  text-transform: uppercase;
752
750
  }
753
751
 
754
- .tag-module-B7r15 .tag-module-c7CRb {
752
+ .tag-module-B7r15 .tag-module-c7CRb {
755
753
  min-width: 8px;
756
754
  height: 16px;
757
- flex: 0 0;
758
755
  color: var(--tag-bg-color);
759
- vertical-align: top;
760
756
  }
761
757
 
762
758
  .product-price-module-oIU1K {
@@ -889,8 +885,8 @@
889
885
  }
890
886
 
891
887
  .product-card-module-pLaiB .product-card-module-Q0VvF .product-card-module-HkWBE {
892
- display: inline-flex;
893
- flex-direction: row;
888
+ display: flex;
889
+ min-height: var(--tag-height, var(--space-16));
894
890
  margin-bottom: 18px;
895
891
  gap: var(--space-4);
896
892
  }
@@ -985,6 +981,7 @@
985
981
  cursor: pointer;
986
982
  padding-inline: 10px;
987
983
  place-items: center;
984
+ -webkit-tap-highlight-color: transparent;
988
985
  }
989
986
 
990
987
  .category-card-module-4NUjH,
@@ -1002,14 +999,14 @@
1002
999
  line-height: 1;
1003
1000
  text-align: center;
1004
1001
  text-transform: uppercase;
1005
- word-break: break-all;
1002
+ word-break: break-word;
1006
1003
  }
1007
1004
 
1008
1005
  .category-card-module-4NUjH[data-pressed] .category-card-module-LEhh3, .category-card-module-4NUjH[data-hovered] .category-card-module-LEhh3, .category-card-module-4NUjH[data-focused] .category-card-module-LEhh3 {
1009
1006
  color: var(--color-brand-red);
1010
1007
  }
1011
1008
 
1012
- .category-card-module-4NUjH.category-card-module-vJ7vB .category-card-module-LEhh3 {
1009
+ .category-card-module-4NUjH[data-pressed] .category-card-module-LEhh3, .category-card-module-4NUjH[data-hovered] .category-card-module-LEhh3, .category-card-module-4NUjH[data-focused] .category-card-module-LEhh3, .category-card-module-4NUjH.category-card-module-vJ7vB .category-card-module-LEhh3 {
1013
1010
  color: var(--color-brand-red);
1014
1011
  }
1015
1012
 
@@ -1351,6 +1348,9 @@
1351
1348
  position: relative;
1352
1349
  display: block;
1353
1350
  width: 100%;
1351
+ -webkit-user-select: none;
1352
+ -moz-user-select: none;
1353
+ user-select: none;
1354
1354
  }
1355
1355
  .carousel-module-ealh-,
1356
1356
  .carousel-module-ealh- * {
@@ -1731,20 +1731,30 @@
1731
1731
 
1732
1732
  .select-module-ui-Wc {
1733
1733
  --trigger-width: initial;
1734
+ --height: var(--space-44);
1734
1735
 
1735
1736
  all: unset;
1736
1737
  position: relative;
1737
1738
  display: inline-flex;
1738
1739
  box-sizing: border-box;
1740
+ flex-grow: 1;
1739
1741
  gap: var(--space-4);
1740
1742
  }
1741
1743
 
1744
+ .select-module-ui-Wc.select-module-44a1l {
1745
+ --height: var(--space-36);
1746
+ }
1747
+
1748
+ .select-module-ui-Wc.select-module-QUm-8 {
1749
+ --height: var(--space-44);
1750
+ }
1751
+
1742
1752
  .select-module-aMQIQ {
1743
1753
  all: unset;
1744
1754
  position: relative;
1745
1755
  display: flex;
1746
1756
  width: 100%;
1747
- height: var(--space-44);
1757
+ height: var(--height);
1748
1758
  box-sizing: border-box;
1749
1759
  align-items: center;
1750
1760
  padding: 10px 32px 10px 16px;
@@ -1976,31 +1986,31 @@
1976
1986
  }
1977
1987
  }
1978
1988
 
1979
- .page-layout-module-sSsgZ {
1989
+ .page-container-module-PYmbC {
1980
1990
  overflow: hidden;
1981
1991
  }
1982
1992
 
1983
- .page-layout-module-sSsgZ .page-layout-module-osQ2n {
1984
- --page-layout-padding: 10px;
1993
+ .page-container-module-PYmbC .page-container-module-uD8GF {
1994
+ --page-container-padding: 10px;
1985
1995
 
1986
1996
  position: relative;
1987
1997
  box-sizing: border-box;
1988
- padding: var(--page-layout-padding);
1998
+ padding: var(--page-container-padding);
1989
1999
  padding-bottom: var(--space-64);
1990
2000
  }
1991
2001
 
1992
2002
  @media (width >= 768px) {
1993
2003
 
1994
- .page-layout-module-sSsgZ .page-layout-module-osQ2n {
1995
- max-width: calc(806px + (2 * var(--page-layout-padding)));
2004
+ .page-container-module-PYmbC .page-container-module-uD8GF {
2005
+ max-width: calc(806px + (2 * var(--page-container-padding)));
1996
2006
  margin: 0 auto
1997
2007
  }
1998
2008
  }
1999
2009
 
2000
2010
  @media (width >= 1440px) {
2001
2011
 
2002
- .page-layout-module-sSsgZ .page-layout-module-osQ2n {
2003
- max-width: calc(1222px + (2 * var(--page-layout-padding)));
2012
+ .page-container-module-PYmbC .page-container-module-uD8GF {
2013
+ max-width: calc(1222px + (2 * var(--page-container-padding)));
2004
2014
  padding-bottom: var(--space-96)
2005
2015
  }
2006
2016
  }
@@ -2119,10 +2129,6 @@
2119
2129
  padding-inline: var(--padding);
2120
2130
  }
2121
2131
 
2122
- .filter-panel-module-8oxI1 .filter-panel-module-bRChA {
2123
- text-transform: capitalize;
2124
- }
2125
-
2126
2132
  .filter-panel-module-8oxI1 .filter-panel-module-AHlq3 {
2127
2133
  padding-bottom: 14px;
2128
2134
  border-bottom: 1px solid var(--color-brand-medium-gray);
@@ -2259,22 +2265,24 @@
2259
2265
  margin-bottom: 44px;
2260
2266
  }
2261
2267
  .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr {
2262
- display: flex;
2263
- flex-wrap: wrap;
2264
- align-items: center;
2265
- justify-content: space-between;
2266
- margin-bottom: var(--space-24);
2267
- row-gap: var(--space-8);
2268
+ display: grid;
2269
+ gap: var(--space-16);
2270
+ justify-items: center;
2268
2271
  }
2269
- .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr {
2270
- display: flex;
2271
- justify-content: flex-end;
2272
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-F7bxy,
2273
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr {
2274
+ width: 100%;
2272
2275
  }
2276
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-F7bxy > *, .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr > * {
2277
+ display: flex;
2278
+ width: 100%;
2279
+ justify-content: center;
2280
+ }
2273
2281
  .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-zx79v {
2274
- margin: auto;
2282
+ order: 2;
2275
2283
  }
2276
2284
  .product-listing-page-module-dmIHF .product-listing-page-module-R4aOl {
2277
- margin-bottom: var(--space-64);
2285
+ margin-bottom: var(--space-44);
2278
2286
  }
2279
2287
  .product-listing-page-module-dmIHF .product-listing-page-module-ICkKg {
2280
2288
  display: grid;
@@ -2288,12 +2296,44 @@
2288
2296
  margin-top: var(--space-24);
2289
2297
  grid-column: span 2;
2290
2298
  }
2291
- @media (width >= 1440px) {
2299
+ @media (width >= 768px) {
2300
+ .product-listing-page-module-dmIHF .product-listing-page-module-R4aOl {
2301
+ margin-bottom: var(--space-64);
2302
+ }
2303
+
2292
2304
  .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr {
2293
2305
  display: grid;
2306
+ align-items: center;
2307
+ justify-content: space-between;
2308
+ margin-bottom: var(--space-24);
2294
2309
  grid-template-columns: repeat(3, 1fr);
2310
+ row-gap: var(--space-8);
2295
2311
  }
2296
2312
 
2313
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-F7bxy,
2314
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr {
2315
+ width: initial;
2316
+ }
2317
+
2318
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-F7bxy > *, .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr > * {
2319
+ width: initial;
2320
+ }
2321
+
2322
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-F7bxy {
2323
+ justify-self: flex-start;
2324
+ }
2325
+
2326
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-aQzHr {
2327
+ display: flex;
2328
+ justify-self: flex-end;
2329
+ }
2330
+
2331
+ .product-listing-page-module-dmIHF .product-listing-page-module-XxGrr .product-listing-page-module-zx79v {
2332
+ order: initial;
2333
+ margin: auto;
2334
+ }
2335
+ }
2336
+ @media (width >= 1440px) {
2297
2337
  .product-listing-page-module-dmIHF .product-listing-page-module-ICkKg {
2298
2338
  grid-template-columns: auto 1fr;
2299
2339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -51,20 +51,20 @@
51
51
  "@rollup/plugin-commonjs": "^26.0.1",
52
52
  "@rollup/plugin-node-resolve": "^15.2.3",
53
53
  "@rollup/plugin-typescript": "^11.1.6",
54
- "@storybook/addon-docs": "^8.1.9",
55
- "@storybook/addon-essentials": "^8.1.9",
56
- "@storybook/addon-interactions": "^8.1.9",
57
- "@storybook/addon-links": "^8.1.9",
58
- "@storybook/addon-viewport": "^8.1.9",
59
- "@storybook/blocks": "^8.1.9",
60
- "@storybook/preview-api": "^8.1.9",
61
- "@storybook/react": "^8.1.9",
62
- "@storybook/react-vite": "^8.1.9",
63
- "@storybook/test": "^8.1.9",
54
+ "@storybook/addon-docs": "^8.1.10",
55
+ "@storybook/addon-essentials": "^8.1.10",
56
+ "@storybook/addon-interactions": "^8.1.10",
57
+ "@storybook/addon-links": "^8.1.10",
58
+ "@storybook/addon-viewport": "^8.1.10",
59
+ "@storybook/blocks": "^8.1.10",
60
+ "@storybook/preview-api": "^8.1.10",
61
+ "@storybook/react": "^8.1.10",
62
+ "@storybook/react-vite": "^8.1.10",
63
+ "@storybook/test": "^8.1.10",
64
64
  "@types/react": "^18.3.3",
65
65
  "@types/react-dom": "^18.3.0",
66
- "@typescript-eslint/eslint-plugin": "^7.13.0",
67
- "@typescript-eslint/parser": "^7.13.0",
66
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
67
+ "@typescript-eslint/parser": "^7.14.1",
68
68
  "@vitejs/plugin-react": "^4.3.1",
69
69
  "autoprefixer": "^10.4.19",
70
70
  "concurrently": "^8.2.2",
@@ -75,7 +75,7 @@
75
75
  "eslint-plugin-mdx": "^3.1.5",
76
76
  "eslint-plugin-no-relative-import-paths": "^1.5.4",
77
77
  "eslint-plugin-prettier": "^5.1.3",
78
- "eslint-plugin-react": "^7.34.2",
78
+ "eslint-plugin-react": "^7.34.3",
79
79
  "eslint-plugin-react-hooks": "^4.6.2",
80
80
  "eslint-plugin-simple-import-sort": "^12.1.0",
81
81
  "eslint-plugin-sort-destructure-keys": "^2.0.0",
@@ -85,7 +85,7 @@
85
85
  "eslint-plugin-unused-imports": "^3.2.0",
86
86
  "http-server": "^14.1.1",
87
87
  "husky": "^9.0.11",
88
- "instantsearch.js": "^4.71.1",
88
+ "instantsearch.js": "^4.72.1",
89
89
  "postcss": "^8.4.38",
90
90
  "postcss-custom-media": "^10.0.6",
91
91
  "postcss-import": "^16.1.0",
@@ -98,12 +98,12 @@
98
98
  "rollup-plugin-peer-deps-external": "^2.2.4",
99
99
  "rollup-plugin-postcss": "^4.0.2",
100
100
  "rollup-plugin-ts": "^3.4.5",
101
- "storybook": "^8.1.9",
101
+ "storybook": "^8.1.10",
102
102
  "stylelint": "^16.6.1",
103
103
  "stylelint-config-css-modules": "^4.4.0",
104
104
  "stylelint-config-idiomatic-order": "^10.0.0",
105
- "stylelint-config-standard": "^36.0.0",
106
- "typescript": "^5.4.5",
105
+ "stylelint-config-standard": "^36.0.1",
106
+ "typescript": "^5.5.2",
107
107
  "vite": "^5.3.1",
108
108
  "vite-tsconfig-paths": "^4.3.2"
109
109
  },
@@ -113,13 +113,13 @@
113
113
  "@algolia/autocomplete-plugin-recent-searches": "^1.17.2",
114
114
  "@algolia/autocomplete-preset-algolia": "^1.17.2",
115
115
  "@algolia/client-search": "^4.23.3",
116
- "@tanstack/react-query": "^5.45.0",
116
+ "@tanstack/react-query": "^5.47.0",
117
117
  "@types/react-transition-group": "^4.4.10",
118
118
  "algoliasearch": "^4.23.3",
119
119
  "clsx": "^2.1.1",
120
- "instantsearch.js": "^4.71.1",
120
+ "instantsearch.js": "^4.72.1",
121
121
  "react-aria-components": "^1.2.1",
122
- "react-instantsearch": "^7.11.1",
122
+ "react-instantsearch": "^7.11.3",
123
123
  "react-transition-group": "^4.4.5",
124
124
  "swiper": "^11.1.4"
125
125
  },