@sonic-equipment/ui 240.0.0 → 241.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.
- package/dist/algolia/algolia-index-config.d.ts +3 -1
- package/dist/algolia/algolia-index-config.js +19 -112
- package/dist/algolia/algolia-initialization.js +1 -1
- package/dist/buttons/button/button.js +1 -1
- package/dist/cart-totals/cart-totals-summary.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/delivery-time/delivery-time.js +1 -1
- package/dist/display/price/price.js +15 -5
- package/dist/info-icon-tooltip/info-icon-tooltip.js +1 -1
- package/dist/modals/confirmation/confirmation-dialog.d.ts +1 -1
- package/dist/pages/checkout/cart-page/cart-page.js +2 -2
- package/dist/pages/checkout/payment-page/components/adyen-payment.d.ts +1 -1
- package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.d.ts +1 -1
- package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.js +1 -1
- package/dist/shared/api/storefront/hooks/account/use-create-account.d.ts +2 -2
- package/dist/shared/api/storefront/hooks/account/use-create-guest-account.d.ts +1 -1
- package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -1
- package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -1
- package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +1 -1
- package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +1 -1
- package/dist/shared/api/storefront/hooks/payment/use-create-adyen-session.d.ts +2 -2
- package/dist/shared/api/storefront/hooks/payment/use-fetch-adyen-config.js +1 -1
- package/dist/shared/api/storefront/services/payment-service.d.ts +1 -1
- package/dist/shared/utils/price.d.ts +4 -2
- package/dist/shared/utils/price.js +8 -5
- package/dist/tooltip/tooltip.js +1 -1
- package/package.json +2 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
function parseCurrency({ currencyCode, locale, price, }) {
|
|
1
|
+
function parseCurrency({ currencyCode, locale, price, useGrouping = true, }) {
|
|
2
2
|
const formatter = new Intl.NumberFormat(locale, {
|
|
3
3
|
currency: currencyCode,
|
|
4
4
|
currencyDisplay: 'narrowSymbol',
|
|
5
5
|
style: 'currency',
|
|
6
|
+
useGrouping,
|
|
6
7
|
});
|
|
7
8
|
const parts = formatter.formatToParts(price);
|
|
8
9
|
const namedParts = parts.reduce((result, part) => {
|
|
@@ -23,16 +24,18 @@ function parseCurrency({ currencyCode, locale, price, }) {
|
|
|
23
24
|
: 'before',
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
function formatCurrency({ currencyCode, locale, price, replaceNonBreakingSpace = false, }) {
|
|
27
|
+
function formatCurrency({ currencyCode, locale, price, replaceNonBreakingSpace = false, useGrouping = true, }) {
|
|
27
28
|
const formatter = new Intl.NumberFormat(locale, {
|
|
28
29
|
currency: currencyCode,
|
|
29
30
|
currencyDisplay: 'narrowSymbol',
|
|
30
31
|
style: 'currency',
|
|
32
|
+
useGrouping,
|
|
31
33
|
});
|
|
32
34
|
const string = formatter.format(price);
|
|
33
|
-
|
|
34
|
-
string.replaceAll('\u00A0', ' ')
|
|
35
|
-
|
|
35
|
+
const normalized = replaceNonBreakingSpace
|
|
36
|
+
? string.replaceAll(new RegExp('\u00A0', 'g'), ' ')
|
|
37
|
+
: string;
|
|
38
|
+
return normalized;
|
|
36
39
|
}
|
|
37
40
|
const countryCodeToCurrencyCode = {
|
|
38
41
|
AR: 'ARS',
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -3,8 +3,8 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useRef, useMemo, cloneElement } from 'react';
|
|
4
4
|
import { usePress } from 'react-aria';
|
|
5
5
|
import { DialogTrigger, Popover, OverlayArrow, Dialog } from 'react-aria-components';
|
|
6
|
-
import { IconButton } from '../buttons/icon-button/icon-button.js';
|
|
7
6
|
import clsx from 'clsx';
|
|
7
|
+
import { IconButton } from '../buttons/icon-button/icon-button.js';
|
|
8
8
|
import { StrokeInformationIcon } from '../icons/stroke/stroke-information-icon.js';
|
|
9
9
|
import { useDisclosure } from '../shared/hooks/use-disclosure.js';
|
|
10
10
|
import styles from './tooltip.module.css.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonic-equipment/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "241.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"eslint-plugin-react": "7.37.5",
|
|
88
88
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
89
89
|
"eslint-plugin-react-server-components": "^1.2.0",
|
|
90
|
+
"eslint-plugin-require-relative-imports": "1.0.0",
|
|
90
91
|
"eslint-plugin-simple-import-sort": "12.1.1",
|
|
91
92
|
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
92
93
|
"eslint-plugin-sort-keys-fix": "1.1.2",
|