@sonic-equipment/ui 185.0.0 → 186.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/address-info-display/address-info-display.d.ts +2 -2
- package/dist/address-info-display/address-info-display.js +1 -1
- package/dist/algolia/algolia-multi-select-filter-section.js +1 -1
- package/dist/algolia/algolia-sort-by.js +1 -1
- package/dist/buttons/add-to-cart-button/add-to-cart-button.js +1 -1
- package/dist/country-select/country-select.js +1 -1
- package/dist/country-select/hooks/use-countries.js +1 -0
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +1 -1
- package/dist/exports.d.ts +24 -22
- package/dist/filters/pagination/pagination.js +1 -1
- package/dist/forms/elements/checkbox/checkbox.module.css.js +3 -0
- package/dist/forms/{field-error → elements/field-error}/field-error.js +1 -1
- package/dist/forms/elements/field-error/field-error.module.css.js +3 -0
- package/dist/forms/elements/input/input.module.css.js +3 -0
- package/dist/forms/elements/label/label.module.css.js +3 -0
- package/dist/forms/{select → elements/select}/select.js +3 -3
- package/dist/forms/elements/select/select.module.css.js +3 -0
- package/dist/forms/elements/switch/switch.module.css.js +3 -0
- package/dist/forms/elements/textarea/textarea.module.css.js +3 -0
- package/dist/forms/{checkbox-field → fields/checkbox-field}/checkbox-field.d.ts +2 -2
- package/dist/forms/{checkbox-field → fields/checkbox-field}/checkbox-field.js +4 -4
- package/dist/forms/fields/checkbox-field/checkbox-field.module.css.js +3 -0
- package/dist/forms/{number-field → fields/number-field}/number-field.d.ts +1 -1
- package/dist/forms/{number-field → fields/number-field}/number-field.js +8 -8
- package/dist/forms/fields/number-field/number-field.module.css.js +3 -0
- package/dist/forms/{search-field → fields/search-field}/search-field.js +3 -3
- package/dist/forms/{select-field → fields/select-field}/select-field.d.ts +1 -1
- package/dist/forms/{select-field → fields/select-field}/select-field.js +7 -7
- package/dist/forms/fields/select-field/select-field.module.css.js +3 -0
- package/dist/forms/{switch-field → fields/switch-field}/switch-field.d.ts +2 -2
- package/dist/forms/{switch-field → fields/switch-field}/switch-field.js +4 -4
- package/dist/forms/fields/switch-field/switch-field.module.css.js +3 -0
- package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.js +3 -3
- package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.module.css.js +1 -1
- package/dist/forms/{text-field → fields/text-field}/text-field.d.ts +1 -1
- package/dist/forms/{text-field → fields/text-field}/text-field.js +6 -6
- package/dist/forms/fields/text-field/text-field.module.css.js +3 -0
- package/dist/forms/layout/form/form-field-layout.module.css.js +3 -0
- package/dist/forms/layout/form/form-segment-group.module.css.js +3 -0
- package/dist/forms/layout/form/form-segment.module.css.js +3 -0
- package/dist/forms/{form → layout/form}/form.js +3 -3
- package/dist/forms/layout/form/form.module.css.js +3 -0
- package/dist/forms/partials/edit-address-form/edit-address-form.d.ts +8 -0
- package/dist/forms/partials/edit-address-form/edit-address-form.js +35 -0
- package/dist/forms/partials/edit-address-form/edit-address-form.module.css.js +3 -0
- package/dist/forms/{password-validation → partials/password-validation}/password-validation.js +4 -4
- package/dist/index.js +24 -22
- package/dist/intl/formatted-message.js +5 -1
- package/dist/intl/types.d.ts +6 -1
- package/dist/modals/dialog/dialog.d.ts +1 -1
- package/dist/modals/dialog/dialog.js +1 -1
- package/dist/modals/favorite/add-to-favorite-dialog.js +2 -2
- package/dist/modals/recover-password/recover-password-dialog.js +1 -1
- package/dist/pages/account/components/create-account-form/create-account-form.js +7 -7
- package/dist/pages/account/components/sign-in-form/sign-in-form.js +6 -6
- package/dist/pages/checkout/components/billing-and-invoice-information.d.ts +3 -3
- package/dist/pages/checkout/components/billing-and-invoice-information.js +1 -1
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +26 -20
- package/dist/pages/checkout/payment-page/components/payment.js +29 -23
- package/dist/pages/checkout/shipping-page/components/{edit-address-form.d.ts → edit-checkout-bill-to-address-form.d.ts} +3 -17
- package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.js +49 -0
- package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.module.css.js +3 -0
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +7 -5
- package/dist/pages/checkout/shipping-page/shipping-page-content.js +2 -2
- package/dist/pages/checkout/shipping-page/shipping-page.js +2 -2
- package/dist/pages/my-sonic/actions/change-customer/change-customer.js +2 -2
- package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +1 -1
- package/dist/pages/my-sonic/actions/change-password/change-password.js +3 -3
- package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.d.ts +1 -0
- package/dist/pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address.js +8 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info-dialog.d.ts +1 -1
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.js +1 -1
- package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.js +1 -1
- package/dist/shared/data/countries-languages.data.js +4 -0
- package/dist/shared/model/address.d.ts +27 -12
- package/dist/shared/model/countries-languages.d.ts +1 -0
- package/dist/shared/utils/price.d.ts +1 -1
- package/dist/styles.css +362 -349
- package/package.json +1 -1
- package/dist/forms/checkbox/checkbox.module.css.js +0 -3
- package/dist/forms/checkbox-field/checkbox-field.module.css.js +0 -3
- package/dist/forms/field-error/field-error.module.css.js +0 -3
- package/dist/forms/form/form-field-layout.module.css.js +0 -3
- package/dist/forms/form/form-segment-group.module.css.js +0 -3
- package/dist/forms/form/form-segment.module.css.js +0 -3
- package/dist/forms/form/form.module.css.js +0 -3
- package/dist/forms/input/input.module.css.js +0 -3
- package/dist/forms/label/label.module.css.js +0 -3
- package/dist/forms/number-field/number-field.module.css.js +0 -3
- package/dist/forms/select/select.module.css.js +0 -3
- package/dist/forms/select-field/select-field.module.css.js +0 -3
- package/dist/forms/switch/switch.module.css.js +0 -3
- package/dist/forms/switch-field/switch-field.module.css.js +0 -3
- package/dist/forms/text-field/text-field.module.css.js +0 -3
- package/dist/forms/textarea/textarea.module.css.js +0 -3
- package/dist/pages/checkout/shipping-page/components/edit-address-form.js +0 -68
- package/dist/pages/checkout/shipping-page/components/edit-address-form.module.css.js +0 -3
- /package/dist/forms/{checkbox → elements/checkbox}/checkbox.d.ts +0 -0
- /package/dist/forms/{checkbox → elements/checkbox}/checkbox.js +0 -0
- /package/dist/forms/{color-checkbox → elements/color-checkbox}/color-checkbox.d.ts +0 -0
- /package/dist/forms/{color-checkbox → elements/color-checkbox}/color-checkbox.js +0 -0
- /package/dist/forms/{field-error → elements/field-error}/field-error.d.ts +0 -0
- /package/dist/forms/{input → elements/input}/input.d.ts +0 -0
- /package/dist/forms/{input → elements/input}/input.js +0 -0
- /package/dist/forms/{label → elements/label}/label.d.ts +0 -0
- /package/dist/forms/{label → elements/label}/label.js +0 -0
- /package/dist/forms/{select → elements/select}/select.d.ts +0 -0
- /package/dist/forms/{switch → elements/switch}/switch.d.ts +0 -0
- /package/dist/forms/{switch → elements/switch}/switch.js +0 -0
- /package/dist/forms/{textarea → elements/textarea}/textarea.d.ts +0 -0
- /package/dist/forms/{textarea → elements/textarea}/textarea.js +0 -0
- /package/dist/forms/{password-field → fields/password-field}/password-field.d.ts +0 -0
- /package/dist/forms/{password-field → fields/password-field}/password-field.js +0 -0
- /package/dist/forms/{search-field → fields/search-field}/search-field.d.ts +0 -0
- /package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.d.ts +0 -0
- /package/dist/forms/{form → layout/form}/form-field-layout.d.ts +0 -0
- /package/dist/forms/{form → layout/form}/form-field-layout.js +0 -0
- /package/dist/forms/{form → layout/form}/form-segment-group.d.ts +0 -0
- /package/dist/forms/{form → layout/form}/form-segment-group.js +0 -0
- /package/dist/forms/{form → layout/form}/form-segment.d.ts +0 -0
- /package/dist/forms/{form → layout/form}/form-segment.js +0 -0
- /package/dist/forms/{form → layout/form}/form.d.ts +0 -0
- /package/dist/forms/{password-validation → partials/password-validation}/password-validation.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Address } from '../shared/model/address';
|
|
2
2
|
export interface AddressProps {
|
|
3
|
-
address:
|
|
3
|
+
address: Address;
|
|
4
4
|
'data-test-selector'?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function AddressInfoDisplay({ address, 'data-test-selector': dataTestSelector, }: AddressProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import styles from './address-info-display.module.css.js';
|
|
|
3
3
|
|
|
4
4
|
function AddressInfoDisplay({ address, 'data-test-selector': dataTestSelector, }) {
|
|
5
5
|
const { address1, address2, address3, city, companyName, country, email, firstName, lastName, phone, postalCode, } = address;
|
|
6
|
-
return (jsxs("address", { className: styles.address, "data-test-selector": dataTestSelector, children: [(firstName || lastName) && (jsxs("p", { "data-test-selector": "addressInfoDisplay_name", children: [jsx("span", { "data-test-selector": "addressInfoDisplay_name_firstName", children: firstName }), ` `, jsx("span", { "data-test-selector": "addressInfoDisplay_name_lastName", children: lastName })] })), companyName && (jsx("p", { "data-test-selector": "addressInfoDisplay_companyName", children: companyName })), address1 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address1", children: address1 })), address2 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address2", children: address2 })), address3 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address3", children: address3 })), (postalCode || city) && (jsxs("p", { children: [postalCode && (jsxs(Fragment, { children: [jsx("span", { "data-test-selector": "addressInfoDisplay_postalCode", children: postalCode }), ' '] })), city && (jsx("span", { "data-test-selector": "addressInfoDisplay_city", children: city }))] })), country && (jsx("p", { "data-test-selector": "addressInfoDisplay_country", children: country })), phone && jsx("p", { "data-test-selector": "addressInfoDisplay_phone", children: phone }), email && jsx("p", { "data-test-selector": "addressInfoDisplay_email", children: email })] }));
|
|
6
|
+
return (jsxs("address", { className: styles.address, "data-test-selector": dataTestSelector, children: [(firstName || lastName) && (jsxs("p", { "data-test-selector": "addressInfoDisplay_name", children: [jsx("span", { "data-test-selector": "addressInfoDisplay_name_firstName", children: firstName }), ` `, jsx("span", { "data-test-selector": "addressInfoDisplay_name_lastName", children: lastName })] })), companyName && (jsx("p", { "data-test-selector": "addressInfoDisplay_companyName", children: companyName })), address1 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address1", children: address1 })), address2 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address2", children: address2 })), address3 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address3", children: address3 })), (postalCode || city) && (jsxs("p", { children: [postalCode && (jsxs(Fragment, { children: [jsx("span", { "data-test-selector": "addressInfoDisplay_postalCode", children: postalCode }), ' '] })), city && (jsx("span", { "data-test-selector": "addressInfoDisplay_city", children: city }))] })), country && (jsx("p", { "data-test-selector": "addressInfoDisplay_country", children: country.name })), phone && jsx("p", { "data-test-selector": "addressInfoDisplay_phone", children: phone }), email && jsx("p", { "data-test-selector": "addressInfoDisplay_email", children: email })] }));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { AddressInfoDisplay };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useRefinementList } from 'react-instantsearch';
|
|
4
4
|
import { MultiSelect } from '../filters/multi-select/multi-select.js';
|
|
5
|
-
import { Checkbox } from '../forms/checkbox/checkbox.js';
|
|
5
|
+
import { Checkbox } from '../forms/elements/checkbox/checkbox.js';
|
|
6
6
|
import { FilterSection } from './filter-section.js';
|
|
7
7
|
|
|
8
8
|
function AlgoliaMultiSelectFilterSection({ attribute, }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useSortBy } from 'react-instantsearch';
|
|
4
|
-
import { Select } from '../forms/select/select.js';
|
|
4
|
+
import { Select } from '../forms/elements/select/select.js';
|
|
5
5
|
import { useFormattedMessage } from '../intl/use-formatted-message.js';
|
|
6
6
|
import { useLanguageCode } from '../intl/use-language-code.js';
|
|
7
7
|
import { environment } from '../shared/utils/environment.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
4
|
-
import { NumberField } from '../../forms/number-field/number-field.js';
|
|
4
|
+
import { NumberField } from '../../forms/fields/number-field/number-field.js';
|
|
5
5
|
import { SolidCartIcon } from '../../icons/solid/solid-cart-icon.js';
|
|
6
6
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
7
7
|
import { useDebouncedCallback } from '../../shared/hooks/use-debounced-callback.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { SelectField } from '../forms/select-field/select-field.js';
|
|
4
|
+
import { SelectField } from '../forms/fields/select-field/select-field.js';
|
|
5
5
|
import { useFormattedMessage } from '../intl/use-formatted-message.js';
|
|
6
6
|
|
|
7
7
|
function CountrySelect({ countries, countryNameInLanguageOfCountry = false, 'data-test-selector': dataTestSelector, defaultSelectedCountry, isDisabled, isLoading, isRequired, name, onCountryChange, selectedCountry, showLabel = true, }) {
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useMemo, useCallback } from 'react';
|
|
4
4
|
import { Button } from '../../buttons/button/button.js';
|
|
5
5
|
import { CountrySelect } from '../../country-select/country-select.js';
|
|
6
|
-
import { Select } from '../../forms/select/select.js';
|
|
6
|
+
import { Select } from '../../forms/elements/select/select.js';
|
|
7
7
|
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
8
8
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
9
9
|
import { Dialog } from '../../modals/dialog/dialog.js';
|
package/dist/exports.d.ts
CHANGED
|
@@ -89,27 +89,28 @@ export * from './filters/multi-select/multi-select';
|
|
|
89
89
|
export * from './filters/pagination/pagination';
|
|
90
90
|
export * from './footer/connected-footer';
|
|
91
91
|
export * from './footer/footer';
|
|
92
|
-
export * from './forms/checkbox
|
|
93
|
-
export * from './forms/checkbox/checkbox';
|
|
94
|
-
export * from './forms/
|
|
95
|
-
export * from './forms/
|
|
96
|
-
export * from './forms/
|
|
97
|
-
export * from './forms/
|
|
98
|
-
export * from './forms/
|
|
99
|
-
export * from './forms/
|
|
100
|
-
export * from './forms/
|
|
101
|
-
export * from './forms/
|
|
102
|
-
export * from './forms/
|
|
103
|
-
export * from './forms/
|
|
104
|
-
export * from './forms/
|
|
105
|
-
export * from './forms/
|
|
106
|
-
export * from './forms/
|
|
107
|
-
export * from './forms/
|
|
108
|
-
export * from './forms/
|
|
109
|
-
export * from './forms/
|
|
110
|
-
export * from './forms/
|
|
111
|
-
export * from './forms/
|
|
112
|
-
export * from './forms/
|
|
92
|
+
export * from './forms/elements/checkbox/checkbox';
|
|
93
|
+
export * from './forms/elements/color-checkbox/color-checkbox';
|
|
94
|
+
export * from './forms/elements/field-error/field-error';
|
|
95
|
+
export * from './forms/elements/input/input';
|
|
96
|
+
export * from './forms/elements/label/label';
|
|
97
|
+
export * from './forms/elements/select/select';
|
|
98
|
+
export * from './forms/elements/switch/switch';
|
|
99
|
+
export * from './forms/elements/textarea/textarea';
|
|
100
|
+
export * from './forms/fields/checkbox-field/checkbox-field';
|
|
101
|
+
export * from './forms/fields/number-field/number-field';
|
|
102
|
+
export * from './forms/fields/password-field/password-field';
|
|
103
|
+
export * from './forms/fields/search-field/search-field';
|
|
104
|
+
export * from './forms/fields/select-field/select-field';
|
|
105
|
+
export * from './forms/fields/switch-field/switch-field';
|
|
106
|
+
export * from './forms/fields/text-field/password-reveal-toggle/password-reveal-toggle';
|
|
107
|
+
export * from './forms/fields/text-field/text-field';
|
|
108
|
+
export * from './forms/layout/form/form';
|
|
109
|
+
export * from './forms/layout/form/form-field-layout';
|
|
110
|
+
export * from './forms/layout/form/form-segment';
|
|
111
|
+
export * from './forms/layout/form/form-segment-group';
|
|
112
|
+
export * from './forms/partials/edit-address-form/edit-address-form';
|
|
113
|
+
export * from './forms/partials/password-validation/password-validation';
|
|
113
114
|
export * from './global-search/categories-grid/categories-grid';
|
|
114
115
|
export * from './global-search/global-search';
|
|
115
116
|
export * from './global-search/global-search-provider/global-search-provider';
|
|
@@ -223,7 +224,7 @@ export * from './pages/checkout/payment-page/payment-page';
|
|
|
223
224
|
export * from './pages/checkout/payment-page/payment-page-content';
|
|
224
225
|
export * from './pages/checkout/payment-page/utils/parse-amount';
|
|
225
226
|
export * from './pages/checkout/shipping-page/components/currency-change-dialog';
|
|
226
|
-
export * from './pages/checkout/shipping-page/components/edit-address-form';
|
|
227
|
+
export * from './pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form';
|
|
227
228
|
export * from './pages/checkout/shipping-page/components/readonly-address';
|
|
228
229
|
export * from './pages/checkout/shipping-page/components/sonic-address';
|
|
229
230
|
export * from './pages/checkout/shipping-page/hooks/use-patch-shipping-details';
|
|
@@ -240,6 +241,7 @@ export * from './pages/my-sonic/actions/change-customer/connected-change-custome
|
|
|
240
241
|
export * from './pages/my-sonic/actions/change-password/change-password';
|
|
241
242
|
export * from './pages/my-sonic/actions/change-password/change-password-dialog';
|
|
242
243
|
export * from './pages/my-sonic/actions/change-password/connected-change-password-dialog';
|
|
244
|
+
export * from './pages/my-sonic/actions/edit-bill-to-address/edit-bill-to-address';
|
|
243
245
|
export * from './pages/my-sonic/actions/edit-user-info/connected-edit-user-info-dialog';
|
|
244
246
|
export * from './pages/my-sonic/actions/edit-user-info/edit-user-info';
|
|
245
247
|
export * from './pages/my-sonic/actions/edit-user-info/edit-user-info-dialog';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { IconButton } from '../../buttons/icon-button/icon-button.js';
|
|
4
|
-
import { NumberField } from '../../forms/number-field/number-field.js';
|
|
4
|
+
import { NumberField } from '../../forms/fields/number-field/number-field.js';
|
|
5
5
|
import { GlyphsChevronsSlimLeftIcon } from '../../icons/glyph/glyphs-chevrons-slim-left-icon.js';
|
|
6
6
|
import { GlyphsChevronsSlimRightIcon } from '../../icons/glyph/glyphs-chevrons-slim-right-icon.js';
|
|
7
7
|
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { FieldError as FieldError$1 } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { useFormattedMessage } from '
|
|
5
|
+
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
6
6
|
import styles from './field-error.module.css.js';
|
|
7
7
|
|
|
8
8
|
function FieldError({ children, className }) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"input-container":"input-module-uAOUY","solid":"input-module-7IaPE","outline":"input-module-axHOD","shadow-input":"input-module-2u4Pp","lg":"input-module-HFhUu","md":"input-module-DRosR","focus":"input-module-7iPV5","growing-input":"input-module-peOqs","inline-element":"input-module-Ai2f7","input":"input-module-JdwaH"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -3,9 +3,9 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useRef, useEffect } from 'react';
|
|
4
4
|
import { Select as Select$1, Button, SelectValue, Popover, ListBox, ListBoxSection, Header, ListBoxItem } from 'react-aria-components';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { GlyphsChevronsSlimDownIcon } from '
|
|
7
|
-
import { StrokeCheckmarkIcon } from '
|
|
8
|
-
import { ProgressCircle } from '
|
|
6
|
+
import { GlyphsChevronsSlimDownIcon } from '../../../icons/glyph/glyphs-chevrons-slim-down-icon.js';
|
|
7
|
+
import { StrokeCheckmarkIcon } from '../../../icons/stroke/stroke-checkmark-icon.js';
|
|
8
|
+
import { ProgressCircle } from '../../../loading/progress-circle.js';
|
|
9
9
|
import { FieldError } from '../field-error/field-error.js';
|
|
10
10
|
import { Label } from '../label/label.js';
|
|
11
11
|
import styles from './select.module.css.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"select":"select-module-IPU-m","sm":"select-module-ysEmc","md":"select-module-E62kG","button":"select-module-0kwVJ","icon-wrapper":"select-module-ptK6Z","focus":"select-module-cnFLz","solid":"select-module-Qq411","loading":"select-module-KuyIv","popover":"select-module-XFHrL","listbox":"select-module-K6TjK","header":"select-module-AUXLg","item":"select-module-MkKKi","check":"select-module-N7nUk"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckboxProps, CheckboxPropsBase } from '
|
|
2
|
-
import { ValidateFunction } from '
|
|
1
|
+
import { CheckboxProps, CheckboxPropsBase } from '../../elements/checkbox/checkbox';
|
|
2
|
+
import { ValidateFunction } from '../../elements/field-error/field-error';
|
|
3
3
|
export interface CheckboxFieldPropsBase extends CheckboxPropsBase {
|
|
4
4
|
errorMessage?: string;
|
|
5
5
|
info?: string;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { CheckboxGroup } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { InfoIconTooltip } from '
|
|
6
|
-
import { Checkbox } from '
|
|
7
|
-
import { FieldError } from '
|
|
8
|
-
import { FormFieldLayout } from '
|
|
5
|
+
import { InfoIconTooltip } from '../../../info-icon-tooltip/info-icon-tooltip.js';
|
|
6
|
+
import { Checkbox } from '../../elements/checkbox/checkbox.js';
|
|
7
|
+
import { FieldError } from '../../elements/field-error/field-error.js';
|
|
8
|
+
import { FormFieldLayout } from '../../layout/form/form-field-layout.js';
|
|
9
9
|
import styles from './checkbox-field.module.css.js';
|
|
10
10
|
|
|
11
11
|
function CheckboxField(props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FocusEvent, FormEventHandler } from 'react';
|
|
2
|
-
import { ValidateFunction } from '
|
|
2
|
+
import { ValidateFunction } from '../../elements/field-error/field-error';
|
|
3
3
|
interface NumberFieldProps {
|
|
4
4
|
autoFocus?: boolean;
|
|
5
5
|
autoGrow?: boolean;
|
|
@@ -3,14 +3,14 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import { NumberField as NumberField$1, Button } from 'react-aria-components';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { StrokeMinusIcon } from '
|
|
7
|
-
import { StrokePlusIcon } from '
|
|
8
|
-
import { StrokeTrashIcon } from '
|
|
9
|
-
import { InfoIconTooltip } from '
|
|
10
|
-
import { FieldError } from '
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
6
|
+
import { StrokeMinusIcon } from '../../../icons/stroke/stroke-minus-icon.js';
|
|
7
|
+
import { StrokePlusIcon } from '../../../icons/stroke/stroke-plus-icon.js';
|
|
8
|
+
import { StrokeTrashIcon } from '../../../icons/stroke/stroke-trash-icon.js';
|
|
9
|
+
import { InfoIconTooltip } from '../../../info-icon-tooltip/info-icon-tooltip.js';
|
|
10
|
+
import { FieldError } from '../../elements/field-error/field-error.js';
|
|
11
|
+
import { Input } from '../../elements/input/input.js';
|
|
12
|
+
import { Label } from '../../elements/label/label.js';
|
|
13
|
+
import { FormFieldLayout } from '../../layout/form/form-field-layout.js';
|
|
14
14
|
import styles from './number-field.module.css.js';
|
|
15
15
|
|
|
16
16
|
const defaultFormatOptions = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { StrokeSearchIcon } from '
|
|
5
|
-
import { ProgressCircle } from '
|
|
6
|
-
import { useDebouncedCallback } from '
|
|
4
|
+
import { StrokeSearchIcon } from '../../../icons/stroke/stroke-search-icon.js';
|
|
5
|
+
import { ProgressCircle } from '../../../loading/progress-circle.js';
|
|
6
|
+
import { useDebouncedCallback } from '../../../shared/hooks/use-debounced-callback.js';
|
|
7
7
|
import { TextField } from '../text-field/text-field.js';
|
|
8
8
|
|
|
9
9
|
function SearchField({ isDebounced = false, isLoading = false, onChange, value: _value, ...props }) {
|
|
@@ -3,13 +3,13 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { Select, Button, SelectValue, Popover, ListBox, ListBoxSection, Header, ListBoxItem } from 'react-aria-components';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { GlyphsChevronsSlimDownIcon } from '
|
|
7
|
-
import { StrokeCheckmarkIcon } from '
|
|
8
|
-
import { InfoIconTooltip } from '
|
|
9
|
-
import { ProgressCircle } from '
|
|
10
|
-
import { FieldError } from '
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { GlyphsChevronsSlimDownIcon } from '../../../icons/glyph/glyphs-chevrons-slim-down-icon.js';
|
|
7
|
+
import { StrokeCheckmarkIcon } from '../../../icons/stroke/stroke-checkmark-icon.js';
|
|
8
|
+
import { InfoIconTooltip } from '../../../info-icon-tooltip/info-icon-tooltip.js';
|
|
9
|
+
import { ProgressCircle } from '../../../loading/progress-circle.js';
|
|
10
|
+
import { FieldError } from '../../elements/field-error/field-error.js';
|
|
11
|
+
import { Label } from '../../elements/label/label.js';
|
|
12
|
+
import { FormFieldLayout } from '../../layout/form/form-field-layout.js';
|
|
13
13
|
import styles from './select-field.module.css.js';
|
|
14
14
|
|
|
15
15
|
function SelectField({ className, 'data-test-selector': dataTestSelector, defaultSelectedOption, info, isDisabled, isInvalid, isLoading, isRequired, label, name, onChange, options, placeholder, selectedOption, showLabel = true, showPlaceholder, size = 'lg', variant = 'outline', }) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"select-field":"select-field-module-T07fb","md":"select-field-module-x-dtL","solid":"select-field-module-jfk-G","loading":"select-field-module-NyDa0","button":"select-field-module-uGX30","value":"select-field-module-z-6Ym","icon":"select-field-module-Njvvb","popover":"select-field-module-tbhPg","listbox":"select-field-module-Rwf0R","header":"select-field-module-KDZmc","item":"select-field-module-u3hoe"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ValidateFunction } from '
|
|
2
|
-
import { SwitchProps, SwitchPropsBase } from '
|
|
1
|
+
import { ValidateFunction } from '../../elements/field-error/field-error';
|
|
2
|
+
import { SwitchProps, SwitchPropsBase } from '../../elements/switch/switch';
|
|
3
3
|
export interface SwitchFieldPropsBase extends SwitchPropsBase {
|
|
4
4
|
errorMessage?: string;
|
|
5
5
|
info?: string;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { CheckboxGroup } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { InfoIconTooltip } from '
|
|
6
|
-
import { FieldError } from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { InfoIconTooltip } from '../../../info-icon-tooltip/info-icon-tooltip.js';
|
|
6
|
+
import { FieldError } from '../../elements/field-error/field-error.js';
|
|
7
|
+
import { Switch } from '../../elements/switch/switch.js';
|
|
8
|
+
import { FormFieldLayout } from '../../layout/form/form-field-layout.js';
|
|
9
9
|
import styles from './switch-field.module.css.js';
|
|
10
10
|
|
|
11
11
|
function SwitchField(props) {
|
package/dist/forms/{text-field → fields/text-field}/password-reveal-toggle/password-reveal-toggle.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Checkbox } from 'react-aria-components';
|
|
4
|
-
import { StrokeDehashedIcon } from '
|
|
5
|
-
import { StrokeHashedIcon } from '
|
|
6
|
-
import { useFormattedMessage } from '
|
|
4
|
+
import { StrokeDehashedIcon } from '../../../../icons/stroke/stroke-dehashed-icon.js';
|
|
5
|
+
import { StrokeHashedIcon } from '../../../../icons/stroke/stroke-hashed-icon.js';
|
|
6
|
+
import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
|
|
7
7
|
import styles from './password-reveal-toggle.module.css.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FocusEvent, FormEventHandler } from 'react';
|
|
2
|
-
import { ValidateFunction } from '
|
|
2
|
+
import { ValidateFunction } from '../../elements/field-error/field-error';
|
|
3
3
|
interface TextFieldPropsBase {
|
|
4
4
|
autoComplete?: string;
|
|
5
5
|
autoFocus?: boolean;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { TextField as TextField$1 } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { InfoIconTooltip } from '
|
|
6
|
-
import { FieldError } from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { InfoIconTooltip } from '../../../info-icon-tooltip/info-icon-tooltip.js';
|
|
6
|
+
import { FieldError } from '../../elements/field-error/field-error.js';
|
|
7
|
+
import { Input } from '../../elements/input/input.js';
|
|
8
|
+
import { Label } from '../../elements/label/label.js';
|
|
9
|
+
import { TextArea } from '../../elements/textarea/textarea.js';
|
|
10
|
+
import { FormFieldLayout } from '../../layout/form/form-field-layout.js';
|
|
11
11
|
import styles from './text-field.module.css.js';
|
|
12
12
|
|
|
13
13
|
function SingleLineInput({ autoGrow, 'data-test-selector': dataTestSelector, inlineElement, inputMode, label, onBlur, pattern, placeholder, role, size, type = 'text', value, variant, }) {
|
|
@@ -3,8 +3,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { Form as Form$1 } from 'react-aria-components';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { Message } from '
|
|
7
|
-
import { scrollToTop } from '
|
|
6
|
+
import { Message } from '../../../message/message.js';
|
|
7
|
+
import { scrollToTop } from '../../../shared/hooks/use-scroll-to.js';
|
|
8
8
|
import styles from './form.module.css.js';
|
|
9
9
|
|
|
10
10
|
function Form({ autoComplete = false, children, className, errorMessage, footer, header, onSubmit, title, validationErrors, }) {
|
|
@@ -22,7 +22,7 @@ function Form({ autoComplete = false, children, className, errorMessage, footer,
|
|
|
22
22
|
scrollToTop();
|
|
23
23
|
}
|
|
24
24
|
}, [errorMessage]);
|
|
25
|
-
return (jsxs(Form$1, { "aria-label": title, autoComplete: autoComplete ? 'on' : 'off', className: clsx(styles['form'], className), onSubmit: handleSubmit, validationBehavior: "native", validationErrors: validationErrors, children: [jsx("header", { className: styles['form-header'], children: header }), errorMessage && (jsx("section", { className: styles['error-messages'], children: jsx(Message, { type: "danger", children: errorMessage }) })), children, jsx("footer", { className: styles['form-footer'], children: footer })] }));
|
|
25
|
+
return (jsxs(Form$1, { "aria-label": title, autoComplete: autoComplete ? 'on' : 'off', className: clsx(styles['form'], className), onSubmit: handleSubmit, validationBehavior: "native", validationErrors: validationErrors, children: [header && jsx("header", { className: styles['form-header'], children: header }), errorMessage && (jsx("section", { className: styles['error-messages'], children: jsx(Message, { type: "danger", children: errorMessage }) })), children, jsx("footer", { className: styles['form-footer'], children: footer })] }));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { Form };
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
isLoading: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function EditAddressForm({ address, countries, isLoading, }: EditAddressFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
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, isLoading, }) {
|
|
13
|
+
const t = useFormattedMessage();
|
|
14
|
+
const [companyName, setCompanyName] = useState(address?.companyName || '');
|
|
15
|
+
const [lastName, setLastName] = useState(address?.lastName || '');
|
|
16
|
+
const currentCountry = countries.find(country => country.id === address?.country?.id);
|
|
17
|
+
const [selectedCountry, setSelectedCountry] = useState(currentCountry);
|
|
18
|
+
const currencyHasChanged = selectedCountry?.currencyCode !== currentCountry?.currencyCode;
|
|
19
|
+
if (countries.length === 0) {
|
|
20
|
+
return (jsx(Message, { type: "danger", children: jsx(FormattedMessage, { force: true, id: "No countries available. Unable to change address." }) }));
|
|
21
|
+
}
|
|
22
|
+
return (jsxs(Fragment, { children: [jsx(TextField, { defaultValue: address?.firstName, isDisabled: isLoading, label: t('First name'), name: "firstName", showLabel: true }), jsx(TextField, { isDisabled: isLoading, isRequired: !address?.companyName, label: t('Last name'), minLength: 3, name: "lastName", onChange: setLastName, showLabel: true, value: lastName }, `lastname-${Boolean(address?.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: {
|
|
23
|
+
'0': selectedCountry?.currencyCode || t('Unknown'),
|
|
24
|
+
} }) }))] }), 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 => {
|
|
25
|
+
if (!value)
|
|
26
|
+
return value;
|
|
27
|
+
return (validatePhone(value) || t('Please enter a valid phone number'));
|
|
28
|
+
} }) }), 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 => {
|
|
29
|
+
if (!value)
|
|
30
|
+
return value;
|
|
31
|
+
return (validateEmail(value) || t('Please enter a valid email address'));
|
|
32
|
+
} }) })] }));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { EditAddressForm };
|
package/dist/forms/{password-validation → partials/password-validation}/password-validation.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import { useFormattedMessage } from '
|
|
4
|
-
import { validatePassword } from '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
4
|
+
import { validatePassword } from '../../../shared/model/account.js';
|
|
5
|
+
import { PasswordField } from '../../fields/password-field/password-field.js';
|
|
6
|
+
import { FormSegment } from '../../layout/form/form-segment.js';
|
|
7
7
|
|
|
8
8
|
function PasswordValidation({ isDisabled = false, onPasswordChanged, }) {
|
|
9
9
|
const t = useFormattedMessage();
|