@sonic-equipment/ui 201.0.0 → 203.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.
Files changed (73) hide show
  1. package/dist/breadcrumbs/breadcrumb.js +7 -16
  2. package/dist/breadcrumbs/breadcrumb.module.css.js +1 -1
  3. package/dist/buttons/add-to-cart-button/add-to-cart-button.d.ts +1 -1
  4. package/dist/buttons/add-to-cart-button/add-to-cart-button.js +12 -13
  5. package/dist/buttons/button/button.js +1 -2
  6. package/dist/buttons/icon-button/icon-button.js +1 -2
  7. package/dist/buttons/link/link.js +1 -2
  8. package/dist/collapsables/accordion/accordion-item.js +6 -5
  9. package/dist/collapsables/accordion/accordion.module.css.js +1 -1
  10. package/dist/cookies/client-cookie-context.d.ts +3 -0
  11. package/dist/cookies/client-cookie-context.js +30 -0
  12. package/dist/cookies/cookie-context.d.ts +2 -0
  13. package/dist/cookies/cookie-context.js +6 -0
  14. package/dist/cookies/cookie-provider.d.ts +6 -0
  15. package/dist/cookies/cookie-provider.js +10 -0
  16. package/dist/cookies/readonly-cookie-reader.d.ts +2 -0
  17. package/dist/cookies/readonly-cookie-reader.js +18 -0
  18. package/dist/cookies/types.d.ts +14 -0
  19. package/dist/cookies/types.js +7 -0
  20. package/dist/{shared/hooks → cookies}/use-cookie.d.ts +1 -2
  21. package/dist/cookies/use-cookie.js +30 -0
  22. package/dist/country-select/hooks/use-countries.js +1 -1
  23. package/dist/country-selector/connected-country-selector.js +1 -1
  24. package/dist/country-selector/use-countries-languages.js +3 -11
  25. package/dist/exports.d.ts +8 -1
  26. package/dist/header/buttons/account/connected-account-button.js +1 -8
  27. package/dist/index.js +10 -3
  28. package/dist/media/image-grid/images-grid.d.ts +2 -1
  29. package/dist/media/image-grid/images-grid.js +2 -2
  30. package/dist/media/image-lightbox/image-lightbox.d.ts +2 -1
  31. package/dist/media/image-lightbox/image-lightbox.js +2 -2
  32. package/dist/pages/account/components/create-account-form/create-account-form.js +1 -1
  33. package/dist/pages/account/create-account-page/create-account-page.js +5 -3
  34. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.d.ts +2 -1
  35. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +2 -4
  36. package/dist/pages/account/sign-in-page/sign-in-page.js +2 -2
  37. package/dist/pages/checkout/cart-page/cart-page.js +1 -1
  38. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
  39. package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.js +2 -1
  40. package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.js +2 -1
  41. package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.js +1 -3
  42. package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.module.css.js +1 -1
  43. package/dist/pages/product/product-details-page/product-details.js +5 -1
  44. package/dist/pages/product/product-listing-page/no-results/no-results.js +3 -1
  45. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +6 -4
  46. package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.d.ts +5 -3
  47. package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +4 -8
  48. package/dist/shared/api/storefront/services/website-service.js +9 -0
  49. package/dist/shared/hooks/use-debounced-callback.d.ts +5 -1
  50. package/dist/shared/hooks/use-debounced-callback.js +10 -10
  51. package/dist/shared/providers/react-query-container.d.ts +8 -3
  52. package/dist/shared/providers/react-query-container.js +4 -4
  53. package/dist/shared/routing/route-context.d.ts +2 -0
  54. package/dist/shared/routing/route-context.js +6 -0
  55. package/dist/shared/routing/route-provider.d.ts +1 -0
  56. package/dist/shared/routing/route-provider.js +7 -8
  57. package/dist/shared/routing/types.d.ts +2 -1
  58. package/dist/shared/routing/use-location.d.ts +3 -3
  59. package/dist/shared/routing/use-location.js +5 -5
  60. package/dist/shared/routing/use-navigate.js +4 -7
  61. package/dist/shared/routing/use-paths.js +4 -5
  62. package/dist/shared/routing/use-route-link-element.d.ts +1 -1
  63. package/dist/shared/routing/use-route-link-element.js +5 -6
  64. package/dist/shared/routing/use-route-link.d.ts +1 -1
  65. package/dist/shared/routing/use-route-link.js +1 -0
  66. package/dist/shared/routing/use-router.d.ts +1 -0
  67. package/dist/shared/routing/use-router.js +13 -0
  68. package/dist/shared/routing/with-routing.d.ts +1 -0
  69. package/dist/shared/routing/with-routing.js +2 -1
  70. package/dist/sidebar/sidebar-provider.js +0 -2
  71. package/dist/styles.css +31 -1
  72. package/package.json +1 -1
  73. package/dist/shared/hooks/use-cookie.js +0 -34
@@ -1,34 +0,0 @@
1
- "use client";
2
- import { useState } from 'react';
3
- import Cookies from 'js-cookie';
4
- import { config } from '../../config.js';
5
-
6
- const defaultCookieOptions = {
7
- domain: config.COOKIE_DOMAIN,
8
- expires: 365,
9
- path: '/',
10
- sameSite: 'None',
11
- secure: true,
12
- };
13
- function useCookie(name, options = defaultCookieOptions) {
14
- const cookieValue = Cookies.get()?.[name];
15
- const [stateValue, setStateValue] = useState(cookieValue);
16
- if (cookieValue !== stateValue) {
17
- setStateValue(cookieValue);
18
- }
19
- function setValue(valueOrFn) {
20
- setStateValue(oldValue => {
21
- const newValue = typeof valueOrFn === 'function' ? valueOrFn(oldValue) : valueOrFn;
22
- if (newValue) {
23
- Cookies.set(name, newValue, options);
24
- }
25
- else {
26
- Cookies.remove(name);
27
- }
28
- return newValue;
29
- });
30
- }
31
- return [stateValue, setValue];
32
- }
33
-
34
- export { defaultCookieOptions, useCookie };