@sonic-equipment/ui 128.0.0 → 130.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-query-string-routing.js +2 -2
- package/dist/carousel/carousel.js +3 -3
- package/dist/carousel/pagination/transitions.js +1 -1
- package/dist/carousel/usp-carousel/usp-carousel.js +1 -1
- package/dist/cart-totals/cart-totals.d.ts +3 -1
- package/dist/cart-totals/cart-totals.js +6 -3
- package/dist/checkout/payment.d.ts +1 -2
- package/dist/checkout/payment.js +5 -22
- package/dist/exports.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/media/image-lightbox/image-lightbox.js +3 -3
- package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/routers/history.js +22 -22
- package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/stateMappings/simple.js +5 -5
- package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/documentation.js +1 -1
- package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/logger.js +1 -1
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/stringify.js +1 -1
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/modules/thumbs.js +1 -1
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/ssr-window.esm.js +2 -2
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/swiper-core.js +46 -44
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/update-on-virtual-data.js +2 -2
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/update-swiper.js +6 -6
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/utils.js +25 -9
- package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/swiper-react.js +5 -5
- package/dist/pages/checkout/cart-page/cart-page.js +1 -1
- package/dist/pages/checkout/payment-page/payment-page.js +3 -5
- package/dist/pages/checkout/shipping-page/components/edit-address.d.ts +2 -1
- package/dist/pages/checkout/shipping-page/components/edit-address.js +3 -2
- package/dist/pages/checkout/shipping-page/components/readonly-address.d.ts +2 -1
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +4 -3
- package/dist/pages/checkout/shipping-page/components/sonic-address.d.ts +1 -0
- package/dist/pages/checkout/shipping-page/components/sonic-address.js +9 -0
- package/dist/pages/checkout/shipping-page/components/sonic-address.module.css.js +3 -0
- package/dist/pages/checkout/shipping-page/shipping-page.js +43 -19
- package/dist/pages/checkout/shipping-page/shipping-page.module.css.js +3 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.d.ts +31 -5
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.d.ts +31 -5
- package/dist/shared/api/storefront/services/website-service.js +7 -7
- package/dist/shared/fetch/request.js +4 -4
- package/dist/shared/providers/global-state-provider.js +2 -2
- package/dist/shared/utils/event-emitter.js +1 -1
- package/dist/styles.css +35 -15
- package/package.json +54 -54
- package/dist/checkout/payment-details.d.ts +0 -8
- package/dist/checkout/payment-details.js +0 -71
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/noop.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.75.4_algoliasearch@4.24.0 → instantsearch.js@4.77.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/modules/free-mode.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/modules/navigation.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.1.14 → swiper@11.2.1}/node_modules/swiper/shared/create-element-if-not-defined.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonic-equipment/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "130.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -50,59 +50,59 @@
|
|
|
50
50
|
"react-dom": "^18"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@chromatic-com/storybook": "3.2.
|
|
53
|
+
"@chromatic-com/storybook": "3.2.4",
|
|
54
54
|
"@csstools/postcss-global-data": "3.0.0",
|
|
55
55
|
"@rollup/plugin-alias": "5.1.1",
|
|
56
|
-
"@rollup/plugin-commonjs": "28.0.
|
|
57
|
-
"@rollup/plugin-node-resolve": "
|
|
58
|
-
"@rollup/plugin-replace": "6.0.
|
|
59
|
-
"@rollup/plugin-typescript": "12.1.
|
|
60
|
-
"@storybook/addon-docs": "8.
|
|
61
|
-
"@storybook/addon-essentials": "8.
|
|
62
|
-
"@storybook/addon-interactions": "8.
|
|
63
|
-
"@storybook/addon-links": "8.
|
|
64
|
-
"@storybook/addon-viewport": "8.
|
|
65
|
-
"@storybook/blocks": "8.
|
|
66
|
-
"@storybook/preview-api": "8.
|
|
67
|
-
"@storybook/react": "8.
|
|
68
|
-
"@storybook/react-vite": "8.
|
|
69
|
-
"@storybook/test": "8.
|
|
56
|
+
"@rollup/plugin-commonjs": "28.0.2",
|
|
57
|
+
"@rollup/plugin-node-resolve": "16.0.0",
|
|
58
|
+
"@rollup/plugin-replace": "6.0.2",
|
|
59
|
+
"@rollup/plugin-typescript": "12.1.2",
|
|
60
|
+
"@storybook/addon-docs": "8.5.2",
|
|
61
|
+
"@storybook/addon-essentials": "8.5.2",
|
|
62
|
+
"@storybook/addon-interactions": "8.5.2",
|
|
63
|
+
"@storybook/addon-links": "8.5.2",
|
|
64
|
+
"@storybook/addon-viewport": "8.5.2",
|
|
65
|
+
"@storybook/blocks": "8.5.2",
|
|
66
|
+
"@storybook/preview-api": "8.5.2",
|
|
67
|
+
"@storybook/react": "8.5.2",
|
|
68
|
+
"@storybook/react-vite": "8.5.2",
|
|
69
|
+
"@storybook/test": "8.5.2",
|
|
70
70
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
71
71
|
"@types/js-cookie": "3.0.6",
|
|
72
|
-
"@types/node": "22.
|
|
72
|
+
"@types/node": "22.12.0",
|
|
73
73
|
"@types/postcss-import": "14.0.3",
|
|
74
74
|
"@types/react": "18.3.12",
|
|
75
75
|
"@types/react-dom": "18.3.1",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
77
|
-
"@typescript-eslint/parser": "8.
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "8.22.0",
|
|
77
|
+
"@typescript-eslint/parser": "8.22.0",
|
|
78
78
|
"@typescript/lib-dom": "npm:typescript-partial-lib-dom@^1.1.0",
|
|
79
|
-
"@vitejs/plugin-react": "4.3.
|
|
79
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
80
80
|
"autoprefixer": "10.4.20",
|
|
81
|
-
"concurrently": "9.1.
|
|
81
|
+
"concurrently": "9.1.2",
|
|
82
82
|
"eslint": "8.57.0",
|
|
83
|
-
"eslint-config-prettier": "
|
|
84
|
-
"eslint-import-resolver-typescript": "3.
|
|
83
|
+
"eslint-config-prettier": "10.0.1",
|
|
84
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
85
85
|
"eslint-plugin-css-modules": "^2.12.0",
|
|
86
|
-
"eslint-plugin-formatjs": "^5.2.
|
|
86
|
+
"eslint-plugin-formatjs": "^5.2.13",
|
|
87
87
|
"eslint-plugin-import": "2.31.0",
|
|
88
88
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
89
89
|
"eslint-plugin-mdx": "3.1.5",
|
|
90
|
-
"eslint-plugin-prettier": "5.2.
|
|
91
|
-
"eslint-plugin-react": "7.37.
|
|
92
|
-
"eslint-plugin-react-hooks": "5.
|
|
90
|
+
"eslint-plugin-prettier": "5.2.3",
|
|
91
|
+
"eslint-plugin-react": "7.37.4",
|
|
92
|
+
"eslint-plugin-react-hooks": "5.1.0",
|
|
93
93
|
"eslint-plugin-simple-import-sort": "12.1.1",
|
|
94
94
|
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
95
95
|
"eslint-plugin-sort-keys-fix": "1.1.2",
|
|
96
96
|
"eslint-plugin-ssr-friendly": "^1.3.0",
|
|
97
|
-
"eslint-plugin-storybook": "0.11.
|
|
97
|
+
"eslint-plugin-storybook": "0.11.2",
|
|
98
98
|
"eslint-plugin-typescript-sort-keys": "3.3.0",
|
|
99
99
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
100
100
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
101
101
|
"http-server": "14.1.1",
|
|
102
|
-
"husky": "9.1.
|
|
103
|
-
"instantsearch.js": "4.
|
|
104
|
-
"nodemon": "3.1.
|
|
105
|
-
"postcss": "8.
|
|
102
|
+
"husky": "9.1.7",
|
|
103
|
+
"instantsearch.js": "4.77.3",
|
|
104
|
+
"nodemon": "3.1.9",
|
|
105
|
+
"postcss": "8.5.1",
|
|
106
106
|
"postcss-custom-media": "11.0.5",
|
|
107
107
|
"postcss-import": "16.1.0",
|
|
108
108
|
"postcss-nested": "7.0.2",
|
|
@@ -110,43 +110,43 @@
|
|
|
110
110
|
"react-dom": "18.3.1",
|
|
111
111
|
"react-json-view": "1.21.3",
|
|
112
112
|
"rimraf": "6.0.1",
|
|
113
|
-
"rollup": "4.
|
|
113
|
+
"rollup": "4.32.1",
|
|
114
114
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
115
115
|
"rollup-plugin-postcss": "4.0.2",
|
|
116
116
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
117
|
-
"storybook": "8.
|
|
118
|
-
"stylelint": "16.
|
|
117
|
+
"storybook": "8.5.2",
|
|
118
|
+
"stylelint": "16.14.1",
|
|
119
119
|
"stylelint-config-css-modules": "4.4.0",
|
|
120
120
|
"stylelint-config-idiomatic-order": "10.0.0",
|
|
121
|
-
"stylelint-config-standard": "
|
|
122
|
-
"typescript": "5.
|
|
123
|
-
"vite": "
|
|
124
|
-
"vite-tsconfig-paths": "5.1.
|
|
125
|
-
"vitest": "
|
|
121
|
+
"stylelint-config-standard": "37.0.0",
|
|
122
|
+
"typescript": "5.7.3",
|
|
123
|
+
"vite": "6.0.11",
|
|
124
|
+
"vite-tsconfig-paths": "5.1.4",
|
|
125
|
+
"vitest": "3.0.4"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
128
|
"@adyen/adyen-web": "5.32.0",
|
|
129
|
-
"@algolia/autocomplete-core": "1.
|
|
130
|
-
"@algolia/autocomplete-plugin-query-suggestions": "1.
|
|
131
|
-
"@algolia/autocomplete-plugin-recent-searches": "1.
|
|
132
|
-
"@algolia/autocomplete-preset-algolia": "1.
|
|
129
|
+
"@algolia/autocomplete-core": "1.18.0",
|
|
130
|
+
"@algolia/autocomplete-plugin-query-suggestions": "1.18.0",
|
|
131
|
+
"@algolia/autocomplete-plugin-recent-searches": "1.18.0",
|
|
132
|
+
"@algolia/autocomplete-preset-algolia": "1.18.0",
|
|
133
133
|
"@algolia/client-search": "4.24.0",
|
|
134
|
-
"@tanstack/react-query": "5.
|
|
135
|
-
"@tanstack/react-query-devtools": "5.
|
|
136
|
-
"@types/react-transition-group": "4.4.
|
|
134
|
+
"@tanstack/react-query": "5.66.0",
|
|
135
|
+
"@tanstack/react-query-devtools": "5.66.0",
|
|
136
|
+
"@types/react-transition-group": "4.4.12",
|
|
137
137
|
"algoliasearch": "4.24.0",
|
|
138
138
|
"clsx": "2.1.1",
|
|
139
|
-
"fast-equals": "5.
|
|
140
|
-
"instantsearch.js": "4.
|
|
139
|
+
"fast-equals": "5.2.2",
|
|
140
|
+
"instantsearch.js": "4.77.3",
|
|
141
141
|
"js-cookie": "3.0.5",
|
|
142
142
|
"query-string": "9.1.1",
|
|
143
|
-
"react-aria": "3.
|
|
144
|
-
"react-aria-components": "1.
|
|
145
|
-
"react-instantsearch": "7.
|
|
143
|
+
"react-aria": "3.37.0",
|
|
144
|
+
"react-aria-components": "1.6.0",
|
|
145
|
+
"react-instantsearch": "7.15.3",
|
|
146
146
|
"react-toastify": "10.0.6",
|
|
147
147
|
"react-transition-group": "4.4.5",
|
|
148
|
-
"search-insights": "2.17.
|
|
149
|
-
"swiper": "11.1
|
|
148
|
+
"search-insights": "2.17.3",
|
|
149
|
+
"swiper": "11.2.1"
|
|
150
150
|
},
|
|
151
151
|
"publishConfig": {
|
|
152
152
|
"access": "public"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CartModel, CheckoutAtpEntry } from '../shared/api/storefront/model/storefront.model';
|
|
2
|
-
export declare function PaymentDetails({ atp, cart, fulfillmentMethods, isDisabled, onCartChanged, }: {
|
|
3
|
-
atp: CheckoutAtpEntry[];
|
|
4
|
-
cart: CartModel;
|
|
5
|
-
fulfillmentMethods: string[];
|
|
6
|
-
isDisabled: boolean;
|
|
7
|
-
onCartChanged: (cart: CartModel) => void;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { Checkbox } from '../forms/checkbox/checkbox.js';
|
|
4
|
-
import { Select } from '../forms/select/select.js';
|
|
5
|
-
import { TextField } from '../forms/text-field/text-field.js';
|
|
6
|
-
import { FormattedMessage } from '../intl/formatted-message.js';
|
|
7
|
-
import { useFormattedMessage } from '../intl/use-formatted-message.js';
|
|
8
|
-
import { useDebouncedCallback } from '../shared/hooks/use-debounced-callback.js';
|
|
9
|
-
import { Tooltip } from '../tooltip/tooltip.js';
|
|
10
|
-
import styles from './payment.module.css.js';
|
|
11
|
-
|
|
12
|
-
function PaymentDetails({ atp, cart, fulfillmentMethods, isDisabled, onCartChanged, }) {
|
|
13
|
-
const [vatNumber, setVatNumber] = useState(cart.customerVatNumber);
|
|
14
|
-
const [poNumber, setPONumber] = useState(cart.poNumber);
|
|
15
|
-
const [industry, setIndustry] = useState(cart.properties.industry);
|
|
16
|
-
const [deliveryDate, setDeliveryDate] = useState(cart.requestedDeliveryDate);
|
|
17
|
-
const [asSoonAsPossible, setAsSoonAsPossible] = useState(false);
|
|
18
|
-
const [fulfillmentMethod, setFulfillmentMethod] = useState();
|
|
19
|
-
const [paymentMethod, setPaymentMethod] = useState(cart.paymentOptions?.paymentMethods?.[0]?.name || 'ADY');
|
|
20
|
-
const t = useFormattedMessage();
|
|
21
|
-
const onCartChangedDebounced = useDebouncedCallback(onCartChanged, 500);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!vatNumber || !poNumber)
|
|
24
|
-
return;
|
|
25
|
-
onCartChangedDebounced({
|
|
26
|
-
...cart,
|
|
27
|
-
customerVatNumber: vatNumber,
|
|
28
|
-
fulfillmentMethod: 'Ship',
|
|
29
|
-
poNumber,
|
|
30
|
-
properties: { ...cart.properties, industry: industry || '' },
|
|
31
|
-
requestedDeliveryDate: deliveryDate || '',
|
|
32
|
-
requestedPickupDate: deliveryDate || '',
|
|
33
|
-
});
|
|
34
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
-
}, [vatNumber, poNumber, industry, deliveryDate]);
|
|
36
|
-
const atpSelectOptions = atp
|
|
37
|
-
.filter(atp => atp.date !== null)
|
|
38
|
-
.reduce((acc, atp) => ({
|
|
39
|
-
...acc,
|
|
40
|
-
[atp.date || '']: atp.displayDate,
|
|
41
|
-
}), {});
|
|
42
|
-
const fulfillmentMethodOptions = fulfillmentMethods.reduce((acc, method) => ({
|
|
43
|
-
...acc,
|
|
44
|
-
[method.toLocaleLowerCase()]: t(`fulfillmentMethod.${method}`),
|
|
45
|
-
}), {});
|
|
46
|
-
const paymentMethodOptions = cart.paymentOptions?.paymentMethods?.reduce((acc, method) => {
|
|
47
|
-
acc[method.name] = t(`paymentMethod.${method.description}`);
|
|
48
|
-
return acc;
|
|
49
|
-
}, {});
|
|
50
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: styles['delivery-date'], children: [jsx(Select, { isRequired: true, showLabel: true, "data-test-selector": "delivery-date", defaultSelectedOption: atp[0]?.date ?? undefined, isDisabled: asSoonAsPossible, label: t('Select a desired delivery date'), onChange: value => setDeliveryDate(value), options: atpSelectOptions, selectedOption: deliveryDate, variant: "solid" }), jsxs("div", { className: styles['asap-checkbox'], children: [jsx(Checkbox, { "data-test-selector": "asapCheckbox", isSelected: asSoonAsPossible, onChange: checked => {
|
|
51
|
-
setAsSoonAsPossible(checked);
|
|
52
|
-
if (checked)
|
|
53
|
-
setDeliveryDate('');
|
|
54
|
-
}, children: jsx(FormattedMessage, { id: "As soon as possible" }) }), jsx(Tooltip, { text: t('Selecting As Soon As Possible will enable us to send the products to you as they become available.') })] })] }), jsx(Select, { showLabel: true, isDisabled: fulfillmentMethods.length <= 1, label: t('Fulfillment method'), onChange: setFulfillmentMethod, options: fulfillmentMethodOptions, selectedOption: fulfillmentMethod, variant: "solid" }), jsx(Select, { isRequired: true, label: t('Industry'), onChange: value => setIndustry(value), options: {
|
|
55
|
-
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
56
|
-
PP: 'Private User',
|
|
57
|
-
AU: 'Automotive',
|
|
58
|
-
MC: 'Motorcycle',
|
|
59
|
-
BC: 'Bicycle',
|
|
60
|
-
TR: 'Truck',
|
|
61
|
-
AG: 'Agricultural',
|
|
62
|
-
AV: 'Aviation',
|
|
63
|
-
MA: 'Maritime',
|
|
64
|
-
OT: 'Other',
|
|
65
|
-
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
66
|
-
}, selectedOption: industry, variant: "solid" }), jsx(TextField, { showLabel: true, isDisabled: isDisabled, label: t('VAT Number'), minLength: 8, name: "vatNumber", onChange: setVatNumber, value: vatNumber }), jsx(TextField, { showLabel: true, isDisabled: isDisabled, label: t('PO Number'), onChange: setPONumber, value: poNumber }), paymentMethodOptions && (jsx(Select, { isDisabled: (cart.paymentOptions?.paymentMethods &&
|
|
67
|
-
cart.paymentOptions.paymentMethods.length <= 1) ??
|
|
68
|
-
true, label: t('Payment method'), onChange: value => setPaymentMethod(value), options: paymentMethodOptions, selectedOption: paymentMethod, variant: "solid" }))] }));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export { PaymentDetails };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|