@sonic-equipment/ui 200.0.0 → 201.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-multi-select-filter-section.js +1 -1
- package/dist/country-select/hooks/use-countries.d.ts +2 -2
- package/dist/country-select/hooks/use-countries.js +1 -1
- package/dist/exports.d.ts +8 -2
- package/dist/forms/elements/checkbox/checkbox.d.ts +1 -0
- package/dist/forms/elements/checkbox/checkbox.js +1 -1
- package/dist/forms/elements/checkbox/checkbox.module.css.js +1 -1
- package/dist/forms/partials/address-form/address-form.d.ts +11 -0
- package/dist/forms/partials/address-form/address-form.js +36 -0
- package/dist/forms/partials/address-form/address-form.module.css.js +3 -0
- package/dist/index.js +9 -3
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/pages/account/components/sign-in-form/sign-in-form.d.ts +2 -1
- package/dist/pages/account/components/sign-in-form/sign-in-form.js +8 -6
- package/dist/pages/account/sign-in-page/sign-in-page.js +2 -2
- package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.js +2 -2
- package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +1 -1
- package/dist/pages/my-sonic/actions/create-ship-to-address/connected-create-ship-to-address-form.d.ts +4 -0
- package/dist/pages/my-sonic/actions/create-ship-to-address/connected-create-ship-to-address-form.js +90 -0
- package/dist/pages/my-sonic/actions/create-ship-to-address/create-ship-to-address.module.css.js +3 -0
- package/dist/pages/my-sonic/actions/edit-bill-to-address/connected-edit-bill-to-address-form.d.ts +4 -0
- package/dist/pages/my-sonic/actions/edit-bill-to-address/connected-edit-bill-to-address-form.js +95 -0
- package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.module.css.js +3 -0
- package/dist/pages/my-sonic/actions/edit-ship-to-address/connected-edit-ship-to-address-form.d.ts +5 -0
- package/dist/pages/my-sonic/actions/edit-ship-to-address/connected-edit-ship-to-address-form.js +127 -0
- package/dist/pages/my-sonic/actions/edit-ship-to-address/edit-ship-to-address.module.css.js +3 -0
- package/dist/pages/my-sonic/widgets/components/address-data-card.d.ts +2 -2
- package/dist/pages/my-sonic/widgets/components/address-data-card.js +2 -6
- package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.d.ts +3 -1
- package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.js +13 -4
- package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.d.ts +4 -1
- package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.js +18 -4
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.d.ts +4 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.js +11 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.d.ts +3 -1
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +3 -7
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.d.ts +3 -1
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.js +6 -12
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.d.ts +5 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.js +18 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.d.ts +13 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +17 -0
- package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.d.ts +17 -0
- package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +17 -0
- package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.d.ts +1 -1
- package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -1
- package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +3 -1
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +2 -2
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +2 -2
- package/dist/shared/api/storefront/model/storefront.model.d.ts +12 -0
- package/dist/shared/api/storefront/services/account-service.js +5 -0
- package/dist/shared/api/storefront/services/customer-service.d.ts +24 -3
- package/dist/shared/api/storefront/services/customer-service.js +39 -5
- package/dist/shared/hooks/use-cookiebot.js +9 -5
- package/dist/shared/routing/types.d.ts +2 -0
- package/dist/styles.css +93 -7
- package/package.json +1 -1
- package/dist/forms/partials/edit-address-form/edit-address-form.d.ts +0 -9
- package/dist/forms/partials/edit-address-form/edit-address-form.js +0 -36
- package/dist/forms/partials/edit-address-form/edit-address-form.module.css.js +0 -3
- package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.d.ts +0 -1
- package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.js +0 -8
package/dist/styles.css
CHANGED
|
@@ -1386,13 +1386,22 @@ html {
|
|
|
1386
1386
|
all: unset;
|
|
1387
1387
|
display: flex;
|
|
1388
1388
|
box-sizing: border-box;
|
|
1389
|
-
align-items:
|
|
1389
|
+
align-items: center;
|
|
1390
1390
|
color: var(--color-brand-black);
|
|
1391
1391
|
cursor: pointer;
|
|
1392
|
-
font-size:
|
|
1392
|
+
font-size: inherit;
|
|
1393
1393
|
forced-color-adjust: none;
|
|
1394
|
+
line-height: 1;
|
|
1394
1395
|
}
|
|
1395
1396
|
|
|
1397
|
+
.checkbox-module-QzsaZ.checkbox-module--o4dt {
|
|
1398
|
+
font-size: var(--font-size-14);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
.checkbox-module-QzsaZ.checkbox-module-5vjph {
|
|
1402
|
+
font-size: var(--font-size-16);
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1396
1405
|
.checkbox-module-QzsaZ .checkbox-module-spG9E {
|
|
1397
1406
|
display: flex;
|
|
1398
1407
|
width: 16px;
|
|
@@ -5354,16 +5363,27 @@ button.swiper-pagination-bullet {
|
|
|
5354
5363
|
*/
|
|
5355
5364
|
}
|
|
5356
5365
|
|
|
5357
|
-
.
|
|
5366
|
+
.address-form-module-pbmJ- {
|
|
5358
5367
|
display: grid;
|
|
5368
|
+
gap: var(--space-16);
|
|
5369
|
+
grid-template-columns: auto;
|
|
5359
5370
|
}
|
|
5360
5371
|
|
|
5361
|
-
|
|
5362
|
-
|
|
5372
|
+
.address-form-module-pbmJ- .address-form-module-dRYo2 {
|
|
5373
|
+
display: grid;
|
|
5374
|
+
}
|
|
5375
|
+
|
|
5376
|
+
@media (width >= 576px) {.address-form-module-pbmJ- {
|
|
5377
|
+
align-items: flex-start;
|
|
5378
|
+
grid-template-columns: 1fr 1fr
|
|
5363
5379
|
}
|
|
5380
|
+
|
|
5381
|
+
.address-form-module-pbmJ- .address-form-module-dRYo2 {
|
|
5382
|
+
grid-column: span 2;
|
|
5383
|
+
}
|
|
5364
5384
|
}
|
|
5365
5385
|
|
|
5366
|
-
.
|
|
5386
|
+
.address-form-module-62GxY {
|
|
5367
5387
|
margin-block-start: var(--space-8);
|
|
5368
5388
|
}
|
|
5369
5389
|
|
|
@@ -7666,7 +7686,7 @@ button.swiper-pagination-bullet {
|
|
|
7666
7686
|
display: grid;
|
|
7667
7687
|
}
|
|
7668
7688
|
|
|
7669
|
-
@media (width >=
|
|
7689
|
+
@media (width >= 768px) {.edit-checkout-bill-to-address-form-module-UWk3T {
|
|
7670
7690
|
align-items: flex-start;
|
|
7671
7691
|
grid-template-columns: 1fr 1fr
|
|
7672
7692
|
}
|
|
@@ -7812,6 +7832,72 @@ button.swiper-pagination-bullet {
|
|
|
7812
7832
|
margin-block-start: var(--space-16);
|
|
7813
7833
|
}
|
|
7814
7834
|
|
|
7835
|
+
.create-ship-to-address-module--IJ52 {
|
|
7836
|
+
display: flex;
|
|
7837
|
+
flex-direction: column;
|
|
7838
|
+
align-items: stretch;
|
|
7839
|
+
justify-content: flex-end;
|
|
7840
|
+
gap: var(--space-8);
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
|
+
@media (width >= 576px) {.create-ship-to-address-module--IJ52 {
|
|
7844
|
+
flex-direction: row;
|
|
7845
|
+
align-items: center;
|
|
7846
|
+
grid-column: span 2
|
|
7847
|
+
}
|
|
7848
|
+
}
|
|
7849
|
+
|
|
7850
|
+
@media (width >= 576px) {
|
|
7851
|
+
|
|
7852
|
+
.create-ship-to-address-module-FYIIw {
|
|
7853
|
+
grid-column: span 2
|
|
7854
|
+
}
|
|
7855
|
+
}
|
|
7856
|
+
|
|
7857
|
+
.edit-bill-to-address-module-u7Vjd {
|
|
7858
|
+
display: flex;
|
|
7859
|
+
flex-direction: column;
|
|
7860
|
+
align-items: stretch;
|
|
7861
|
+
justify-content: flex-end;
|
|
7862
|
+
gap: var(--space-8);
|
|
7863
|
+
}
|
|
7864
|
+
|
|
7865
|
+
@media (width >= 576px) {.edit-bill-to-address-module-u7Vjd {
|
|
7866
|
+
flex-direction: row;
|
|
7867
|
+
align-items: center;
|
|
7868
|
+
grid-column: span 2
|
|
7869
|
+
}
|
|
7870
|
+
}
|
|
7871
|
+
|
|
7872
|
+
@media (width >= 576px) {
|
|
7873
|
+
|
|
7874
|
+
.edit-bill-to-address-module-WZIOF {
|
|
7875
|
+
grid-column: span 2
|
|
7876
|
+
}
|
|
7877
|
+
}
|
|
7878
|
+
|
|
7879
|
+
.edit-ship-to-address-module-aDVqM {
|
|
7880
|
+
display: flex;
|
|
7881
|
+
flex-direction: column;
|
|
7882
|
+
align-items: stretch;
|
|
7883
|
+
justify-content: flex-end;
|
|
7884
|
+
gap: var(--space-8);
|
|
7885
|
+
}
|
|
7886
|
+
|
|
7887
|
+
@media (width >= 576px) {.edit-ship-to-address-module-aDVqM {
|
|
7888
|
+
flex-direction: row;
|
|
7889
|
+
align-items: center;
|
|
7890
|
+
grid-column: span 2
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
|
|
7894
|
+
@media (width >= 576px) {
|
|
7895
|
+
|
|
7896
|
+
.edit-ship-to-address-module-9FsP4 {
|
|
7897
|
+
grid-column: span 2
|
|
7898
|
+
}
|
|
7899
|
+
}
|
|
7900
|
+
|
|
7815
7901
|
.edit-user-info-module-yQOre {
|
|
7816
7902
|
display: grid;
|
|
7817
7903
|
inset: 0;
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Address } from '../../../shared/model/address';
|
|
2
|
-
import { Country } from '../../../shared/model/countries-languages';
|
|
3
|
-
export interface EditAddressFormProps {
|
|
4
|
-
address: Address | null | undefined;
|
|
5
|
-
countries: Country[];
|
|
6
|
-
currentCountry: Country | undefined;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function EditAddressForm({ address, countries, currentCountry: _currentCountry, isLoading, }: EditAddressFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { CountrySelect } from '../../../country-select/country-select.js';
|
|
5
|
-
import { TextField } from '../../fields/text-field/text-field.js';
|
|
6
|
-
import { FormattedMessage } from '../../../intl/formatted-message.js';
|
|
7
|
-
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
8
|
-
import { Message } from '../../../message/message.js';
|
|
9
|
-
import { validatePhone, validateEmail } from '../../../shared/model/address.js';
|
|
10
|
-
import styles from './edit-address-form.module.css.js';
|
|
11
|
-
|
|
12
|
-
function EditAddressForm({ address, countries, currentCountry: _currentCountry, isLoading, }) {
|
|
13
|
-
const t = useFormattedMessage();
|
|
14
|
-
const [companyName, setCompanyName] = useState(address?.companyName || '');
|
|
15
|
-
const [lastName, setLastName] = useState(address?.lastName || '');
|
|
16
|
-
const currentCountry = countries.find(c => c.id === address?.country?.id) || _currentCountry;
|
|
17
|
-
const [selectedCountry, setSelectedCountry] = useState(currentCountry);
|
|
18
|
-
const currencyHasChanged = Boolean(currentCountry) &&
|
|
19
|
-
selectedCountry?.currencyCode !== currentCountry?.currencyCode;
|
|
20
|
-
if (countries.length === 0) {
|
|
21
|
-
return (jsx(Message, { type: "danger", children: jsx(FormattedMessage, { force: true, id: "No countries available. Unable to change address." }) }));
|
|
22
|
-
}
|
|
23
|
-
return (jsxs(Fragment, { children: [jsx(TextField, { defaultValue: address?.firstName, isDisabled: isLoading, label: t('First name'), name: "firstName", showLabel: true }), jsx(TextField, { isDisabled: isLoading, isRequired: !companyName, label: t('Last name'), minLength: 3, name: "lastName", onChange: setLastName, showLabel: true, value: lastName }, `lastname-${Boolean(companyName)}`), jsx(TextField, { defaultValue: address?.companyName, isDisabled: isLoading, label: t('Company name'), name: "companyName", onChange: setCompanyName, showLabel: true, value: companyName }), jsx(TextField, { defaultValue: address?.attention, isDisabled: isLoading, label: t('Attention'), name: "attention", showLabel: true }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, defaultValue: address?.address1, isDisabled: isLoading, label: `${t('Address')} 1`, maxLength: 30, minLength: 3, name: "address1", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { defaultValue: address?.address2, isDisabled: isLoading, label: `${t('Address')} 2`, maxLength: 30, minLength: 3, name: "address2", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { defaultValue: address?.address3, isDisabled: isLoading, label: `${t('Address')} 3`, maxLength: 30, minLength: 3, name: "address3", showLabel: true }) }), jsx(TextField, { isRequired: true, defaultValue: address?.postalCode, isDisabled: isLoading, label: t('Postal Code'), maxLength: 10, minLength: 4, name: "postalCode", showLabel: true }), jsx(TextField, { isRequired: true, defaultValue: address?.city, isDisabled: isLoading, label: t('City'), maxLength: 30, minLength: 3, name: "city", showLabel: true }), jsxs("div", { className: styles['span-2'], children: [jsx(CountrySelect, { isRequired: true, countries: countries, "data-test-selector": "countrySelect", isDisabled: isLoading, name: "countrySelect", onCountryChange: setSelectedCountry, selectedCountry: selectedCountry }), currencyHasChanged && (jsx(Message, { className: styles['currency-warning'], type: "warning", children: jsx(FormattedMessage, { id: "Selecting this country will result in your cart to be converted to the currency {0}", replacementValues: {
|
|
24
|
-
'0': selectedCountry?.currencyCode || t('Unknown'),
|
|
25
|
-
} }) }))] }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, defaultValue: address?.phone, isDisabled: isLoading, label: t('Phone'), name: "phone", showLabel: true, validate: value => {
|
|
26
|
-
if (!value)
|
|
27
|
-
return value;
|
|
28
|
-
return (validatePhone(value) || t('Please enter a valid phone number'));
|
|
29
|
-
} }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, defaultValue: address?.email || '', isDisabled: isLoading, label: t('Email'), name: "email", showLabel: true, type: "email", validate: value => {
|
|
30
|
-
if (!value)
|
|
31
|
-
return value;
|
|
32
|
-
return (validateEmail(value) || t('Please enter a valid email address'));
|
|
33
|
-
} }) })] }));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { EditAddressForm };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function EditBillToAddress(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { EditAddressForm } from '../../../../forms/partials/edit-address-form/edit-address-form.js';
|
|
3
|
-
|
|
4
|
-
function EditBillToAddress() {
|
|
5
|
-
return (jsx(EditAddressForm, { address: undefined, countries: [], currentCountry: undefined, isLoading: false }));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { EditBillToAddress };
|