@sonic-equipment/ui 184.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/cards/data-card/data-card.js +37 -20
- package/dist/cards/data-card/data-card.module.css.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 +2 -6
- package/dist/exports.d.ts +43 -23
- 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.d.ts +2 -1
- package/dist/forms/{select → elements/select}/select.js +5 -5
- 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/layout/form/form.d.ts +20 -0
- package/dist/forms/{form → layout/form}/form.js +4 -4
- 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/partials/password-validation/password-validation.d.ts +4 -0
- package/dist/forms/partials/password-validation/password-validation.js +32 -0
- package/dist/index.js +44 -24
- package/dist/intl/formatted-message.js +5 -1
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/intl/types.d.ts +6 -1
- package/dist/intl/use-formatted-message.js +2 -1
- package/dist/lists/menu-list/menu-list.d.ts +2 -1
- package/dist/lists/menu-list/menu-list.js +2 -2
- package/dist/lists/widget-grid/widget-grid.d.ts +5 -0
- package/dist/lists/widget-grid/widget-grid.js +9 -0
- package/dist/lists/widget-grid/widget-grid.module.css.js +3 -0
- package/dist/lists/widget-grid/widget.d.ts +6 -0
- package/dist/lists/widget-grid/widget.js +10 -0
- package/dist/modals/dialog/dialog.d.ts +5 -5
- package/dist/modals/dialog/dialog.js +18 -18
- package/dist/modals/dialog/dialog.module.css.js +1 -1
- package/dist/modals/favorite/add-to-favorite-dialog.js +2 -2
- package/dist/modals/recover-password/recover-password-dialog.js +2 -4
- package/dist/pages/account/components/create-account-form/create-account-form.js +8 -23
- package/dist/pages/account/components/sign-in-form/sign-in-form.js +6 -6
- package/dist/pages/account/create-account-page/create-account-page.js +4 -5
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +1 -1
- package/dist/pages/account/sign-in-page/sign-in-page.js +2 -3
- 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/hooks/use-patch-shipping-details.d.ts +1 -0
- 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/components/page-container/page-container.js +1 -1
- package/dist/pages/my-sonic/actions/change-customer/change-customer-dialog.d.ts +4 -3
- package/dist/pages/my-sonic/actions/change-customer/change-customer-dialog.js +10 -4
- package/dist/pages/my-sonic/actions/change-customer/change-customer.d.ts +5 -2
- package/dist/pages/my-sonic/actions/change-customer/change-customer.js +17 -8
- package/dist/pages/my-sonic/actions/change-customer/change-customer.module.css.js +1 -1
- package/dist/pages/my-sonic/actions/change-customer/connected-change-customer-dialog.d.ts +7 -2
- package/dist/pages/my-sonic/actions/change-customer/connected-change-customer-dialog.js +9 -6
- package/dist/pages/my-sonic/actions/change-password/change-password-dialog.d.ts +10 -0
- package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +24 -0
- package/dist/pages/my-sonic/actions/change-password/change-password.d.ts +7 -0
- package/dist/pages/my-sonic/actions/change-password/change-password.js +35 -0
- package/dist/pages/my-sonic/actions/change-password/change-password.module.css.js +3 -0
- package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.d.ts +5 -0
- package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +39 -0
- 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/connected-edit-user-info-dialog.d.ts +5 -0
- package/dist/pages/my-sonic/actions/edit-user-info/connected-edit-user-info-dialog.js +56 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info-dialog.d.ts +10 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info-dialog.js +15 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.d.ts +11 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.js +29 -0
- package/dist/pages/my-sonic/actions/edit-user-info/edit-user-info.module.css.js +3 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.d.ts +4 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.js +9 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.d.ts +4 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.js +9 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.d.ts +5 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.js +10 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.d.ts +4 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.js +9 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.d.ts +4 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.js +10 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.d.ts +5 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.js +10 -0
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.module.css.js +3 -0
- package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.js +3 -4
- package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.module.css.js +3 -0
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.d.ts +2 -1
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +2 -2
- package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.d.ts +2 -1
- package/dist/pages/my-sonic/navigation/my-sonic-mobile-navigation.js +3 -3
- package/dist/pages/my-sonic/widgets/connected-customer-information-widget.js +3 -3
- package/dist/pages/my-sonic/widgets/connected-user-account-widget.js +16 -5
- package/dist/shared/api/shared/hooks/use-awaitable-mutation.d.ts +1 -0
- package/dist/shared/api/shared/hooks/use-awaitable-mutation.js +6 -0
- package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-account.d.ts +1 -1
- package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-account.js +3 -1
- package/dist/shared/api/storefront/hooks/{authentication → account}/use-create-guest-account.js +3 -1
- package/dist/shared/api/storefront/hooks/account/use-fetch-current-account.d.ts +3 -0
- package/dist/shared/api/storefront/hooks/account/use-fetch-current-account.js +13 -0
- package/dist/shared/api/storefront/hooks/account/use-patch-current-account.d.ts +11 -0
- package/dist/shared/api/storefront/hooks/account/use-patch-current-account.js +20 -0
- package/dist/shared/api/storefront/hooks/authentication/use-patch-session.d.ts +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -1
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart.d.ts +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-place-order.d.ts +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.d.ts +1 -0
- package/dist/shared/api/storefront/services/account-service.d.ts +31 -0
- package/dist/shared/api/storefront/services/account-service.js +84 -0
- package/dist/shared/api/storefront/services/authentication-service.d.ts +7 -26
- package/dist/shared/api/storefront/services/authentication-service.js +38 -65
- 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 +751 -627
- 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.d.ts +0 -16
- 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/{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/shared/api/storefront/hooks/{authentication → account}/use-create-guest-account.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,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
4
5
|
import { ProgressCircle } from '../../loading/progress-circle.js';
|
|
@@ -8,43 +9,59 @@ import styles from './data-card.module.css.js';
|
|
|
8
9
|
|
|
9
10
|
function DataCard({ actions, data, 'data-test-selector': dataTestSelector, isLoading = false, rendering, showError = false, title, }) {
|
|
10
11
|
const dataFields = data.flatMap((entry) => entry.type === 'section' ? entry.data : [entry]);
|
|
11
|
-
const visibleData = dataFields.filter(
|
|
12
|
+
const visibleData = dataFields.filter(dataField => isDataFieldVisible(dataField, rendering));
|
|
12
13
|
const hasItems = visibleData.length > 0;
|
|
13
|
-
const sections = sectionizeItems(data);
|
|
14
|
-
return (jsxs("section", { className: styles['data-card-container'], "data-test-selector": dataTestSelector, children: [title && (jsx(Heading, { className: styles.title, size: "xxs", tag: "h3", children: jsx(FormattedMessage, { id: title }) })), jsx("div", { className: styles['data-card'], children: showError ? (jsx("div", { className: styles['error-container'], children: showError instanceof UnauthorizedRequestError ? (jsx(FormattedMessage, { id: "You are not authorized to access this information." })) : typeof showError === 'string' ? (jsx(FormattedMessage, { id: showError })) : (jsx(FormattedMessage, { id: "An unexpected error occured" })) })) : isLoading ? (jsx("div", { className: styles['loading-container'], children: jsx(ProgressCircle, { variant: "gray" }) })) : hasItems ? (jsxs("div", { className: clsx(styles['container']), children: [jsx("dl", { className: styles['data-table'], children: sections.map(section => (jsx(DataTableSection, { dataSection: section, rendering: rendering }, section.key))) }), actions?.length && (jsx("div", { className: styles['data-card-actions'], children: actions }))] })) : (jsx("div", { className: clsx(styles['no-data-container']), children: jsx(FormattedMessage, { id: "There is no information to display" }) })) })] }));
|
|
14
|
+
const sections = sectionizeItems(data, rendering);
|
|
15
|
+
return (jsxs("section", { className: styles['data-card-container'], "data-test-selector": dataTestSelector, children: [title && (jsx(Heading, { className: styles.title, size: "xxs", tag: "h3", children: jsx(FormattedMessage, { id: title }) })), jsx("div", { className: styles['data-card'], children: showError ? (jsx("div", { className: styles['error-container'], children: showError instanceof UnauthorizedRequestError ? (jsx(FormattedMessage, { id: "You are not authorized to access this information." })) : typeof showError === 'string' ? (jsx(FormattedMessage, { id: showError })) : (jsx(FormattedMessage, { id: "An unexpected error occured" })) })) : isLoading ? (jsx("div", { className: styles['loading-container'], children: jsx(ProgressCircle, { variant: "gray" }) })) : hasItems ? (jsxs("div", { className: clsx(styles['container']), children: [jsx("dl", { className: styles['data-table'], children: sections.map(section => (jsx(DataTableSection, { dataSection: section, rendering: rendering }, section.key))) }), Boolean(actions?.length) && (jsx("div", { className: styles['data-card-actions'], children: actions }))] })) : (jsx("div", { className: clsx(styles['no-data-container']), children: jsx(FormattedMessage, { id: "There is no information to display" }) })) })] }));
|
|
16
|
+
}
|
|
17
|
+
function renderValue(rendering, key, value) {
|
|
18
|
+
const renderedValue = rendering?.value
|
|
19
|
+
? rendering.value({ key, value })
|
|
20
|
+
: value !== undefined && value !== null
|
|
21
|
+
? String(value)
|
|
22
|
+
: null;
|
|
23
|
+
if (renderedValue === null ||
|
|
24
|
+
renderedValue === undefined ||
|
|
25
|
+
renderedValue === 'string' ||
|
|
26
|
+
isValidElement(renderedValue))
|
|
27
|
+
return renderedValue;
|
|
28
|
+
return String(renderedValue);
|
|
15
29
|
}
|
|
16
30
|
function DataTable({ data, rendering, }) {
|
|
17
31
|
return data.map(({ key, label, value }, index) => (jsxs(Fragment, { children: [jsx("dt", { className: clsx(styles['data-table-key'], {
|
|
18
32
|
[styles['data-table-section-end']]: index === data.length - 1,
|
|
19
|
-
}), children: rendering?.label ? (rendering.label({ key, label })) : (jsx(FormattedMessage, { id: label })) }), jsx("dd", { className: styles['data-table-value'], "data-key": key, children: rendering
|
|
20
|
-
? rendering.value({ key, value })
|
|
21
|
-
: value !== undefined && value !== null
|
|
22
|
-
? String(value)
|
|
23
|
-
: null })] }, key)));
|
|
33
|
+
}), children: rendering?.label ? (rendering.label({ key, label })) : (jsx(FormattedMessage, { id: label })) }), jsx("dd", { className: styles['data-table-value'], "data-key": key, children: renderValue(rendering, key, value) })] }, key)));
|
|
24
34
|
}
|
|
25
35
|
function DataTableSection({ dataSection, rendering, }) {
|
|
26
36
|
return (jsxs(Fragment, { children: [dataSection.heading && (jsx(Heading, { className: styles['data-table-section-heading'], size: "xxxs", tag: "h3", children: dataSection.heading })), jsx(DataTable, { data: dataSection.data, rendering: rendering })] }));
|
|
27
37
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
38
|
+
function isDataFieldVisible({ key, value }, rendering) {
|
|
39
|
+
return Boolean(renderValue(rendering, key, value));
|
|
40
|
+
}
|
|
41
|
+
function sectionizeItems(data, rendering) {
|
|
42
|
+
const dataSections = [];
|
|
30
43
|
let currentSection = null;
|
|
31
44
|
data.forEach((item, index) => {
|
|
32
45
|
if (item.type === 'section') {
|
|
33
46
|
currentSection = null;
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
else if (currentSection) {
|
|
37
|
-
currentSection.data.push(item);
|
|
47
|
+
dataSections.push(item);
|
|
38
48
|
}
|
|
39
49
|
else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
50
|
+
if (!isDataFieldVisible(item, rendering))
|
|
51
|
+
return;
|
|
52
|
+
if (currentSection) {
|
|
53
|
+
currentSection.data.push(item);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
dataSections.push((currentSection = {
|
|
57
|
+
data: [item],
|
|
58
|
+
key: `section-${index}`,
|
|
59
|
+
type: 'section',
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
45
62
|
}
|
|
46
63
|
});
|
|
47
|
-
return
|
|
64
|
+
return dataSections.filter(section => section.data.length > 0);
|
|
48
65
|
}
|
|
49
66
|
|
|
50
67
|
export { DataCard };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"data-card-container":"data-card-module-OMXIh","title":"data-card-module-DMbBO","data-card":"data-card-module-24uin","error-container":"data-card-module-j-RFT","loading-container":"data-card-module-d9zvu","no-data-container":"data-card-module-FVD44","container":"data-card-module-ZefqY","data-table":"data-card-module-EDbE-","data-table-section-heading":"data-card-module-CjTal","data-table-section-end":"data-card-module-QixKJ","data-table-
|
|
1
|
+
var styles = {"data-card-container":"data-card-module-OMXIh","title":"data-card-module-DMbBO","data-card":"data-card-module-24uin","error-container":"data-card-module-j-RFT","loading-container":"data-card-module-d9zvu","no-data-container":"data-card-module-FVD44","container":"data-card-module-ZefqY","data-table":"data-card-module-EDbE-","data-table-section-heading":"data-card-module-CjTal","data-table-section-end":"data-card-module-QixKJ","data-table-value":"data-card-module-fcSbu","data-table-key":"data-card-module-FAgmN","data-card-actions":"data-card-module-Qv5iI"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -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';
|
|
@@ -28,11 +28,7 @@ function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange,
|
|
|
28
28
|
return (jsx(Dialog, { hideTitle: true, allowClose: isDismissable, className: {
|
|
29
29
|
dialog: styles['country-selector-dialog'],
|
|
30
30
|
modal: styles.modal,
|
|
31
|
-
}, footer: jsx(Button, { withArrow: true, "data-test-selector": "clSelector_apply", type: "submit", children: jsx(FormattedMessage, { id: "Save" }) }), hasCloseButton: isDismissable, isDismissable: isDismissable, isOpen: isOpen, onOpenChange: onOpenChange, onSubmit:
|
|
32
|
-
onSubmit({ country: currentCountry, language: currentLanguage });
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
e.stopPropagation();
|
|
35
|
-
}, shouldCloseOnInteractOutside: isDismissable, title: "Country Selector", children: jsxs("div", { className: styles.content, children: [jsx("svg", { className: styles.logo, height: "32", viewBox: "0 0 134 32", width: "134", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { fill: "none", fillRule: "evenodd", children: [jsx("path", { d: "M15.83 11.533c2.42 0 4.382 1.977 4.382 4.415 0 8.794-7.1 15.95-15.83 15.95C1.963 31.897 0 29.92 0 27.481c0-2.354 1.83-4.278 4.134-4.408l.249-.007c3.797 0 6.905-3.036 7.058-6.826l.006-.293c0-2.438 1.963-4.415 4.383-4.415zM15.83 0c2.42 0 4.383 1.977 4.383 4.415 0 2.355-1.83 4.279-4.134 4.409l-.249.007c-3.8 0-6.906 3.035-7.059 6.824l-.006.293c0 2.438-1.962 4.415-4.382 4.415S0 18.386 0 15.948C0 7.154 7.101 0 15.83 0zm8.208 16.022c0 8.794 7.101 15.95 15.83 15.95s15.83-7.156 15.83-15.95S48.597.074 39.868.074s-15.83 7.154-15.83 15.948zm8.765 0c0-3.924 3.169-7.118 7.065-7.118 3.895 0 7.065 3.194 7.065 7.118 0 3.926-3.17 7.119-7.065 7.119-3.896 0-7.065-3.193-7.065-7.12zm76.888-11.276c-6.173 6.217-6.173 16.335-.002 22.553 6.173 6.217 16.215 6.217 22.388 0a4.44 4.44 0 0 0 .001-6.244 4.359 4.359 0 0 0-6.003-.184l-.194.184a7.04 7.04 0 0 1-9.994 0c-2.753-2.775-2.753-7.29.002-10.065a7.036 7.036 0 0 1 9.751-.233l.24.231a4.36 4.36 0 0 0 6.198 0 4.44 4.44 0 0 0-.001-6.245c-6.173-6.217-16.215-6.216-22.386.003zm-17.162-.174v22.863c0 2.439 1.961 4.416 4.381 4.416 2.422 0 4.384-1.977 4.384-4.416V4.572c0-2.439-1.962-4.416-4.384-4.416-2.42 0-4.38 1.977-4.38 4.416zM64.1.1c-2.42 0-4.383 1.977-4.383 4.415v23.07c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V8.93h3.933c3.895 0 7.065 3.192 7.065 7.118v11.537c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V16.048C88.244 7.254 81.143.1 72.414.1h-8.316z", fill: "#000" }), jsx("path", { d: "M47.036 16.022c0 3.99-3.209 7.222-7.168 7.222-3.96 0-7.169-3.233-7.169-7.222 0-3.989 3.21-7.222 7.169-7.222 3.96 0 7.168 3.233 7.168 7.222", fill: "#E30613" })] }) }), jsx("p", { className: styles.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles.selects, children: [showCountry && (jsx(CountrySelect, { isRequired: true, countries: countries, countryNameInLanguageOfCountry: true, "data-test-selector": "clSelector_country", onCountryChange: onCountryChange, selectedCountry: currentCountry })), jsx(Select, { isRequired: true, "data-test-selector": "clSelector_language", label: t('Language'), onChange: value => setCurrentLanguage(currentCountry.languages.find(language => language.id === value) || currentLanguage), options: languageOptions, placeholder: t('Select a language'), selectedOption: currentLanguage.id, showPlaceholder: false, variant: "solid" })] })] }) }));
|
|
31
|
+
}, footer: jsx(Button, { withArrow: true, "data-test-selector": "clSelector_apply", type: "submit", children: jsx(FormattedMessage, { id: "Save" }) }), hasCloseButton: isDismissable, isDismissable: isDismissable, isOpen: isOpen, onOpenChange: onOpenChange, onSubmit: () => onSubmit({ country: currentCountry, language: currentLanguage }), shouldCloseOnInteractOutside: isDismissable, title: "Country Selector", children: jsxs("div", { className: styles.content, children: [jsx("svg", { className: styles.logo, height: "32", viewBox: "0 0 134 32", width: "134", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { fill: "none", fillRule: "evenodd", children: [jsx("path", { d: "M15.83 11.533c2.42 0 4.382 1.977 4.382 4.415 0 8.794-7.1 15.95-15.83 15.95C1.963 31.897 0 29.92 0 27.481c0-2.354 1.83-4.278 4.134-4.408l.249-.007c3.797 0 6.905-3.036 7.058-6.826l.006-.293c0-2.438 1.963-4.415 4.383-4.415zM15.83 0c2.42 0 4.383 1.977 4.383 4.415 0 2.355-1.83 4.279-4.134 4.409l-.249.007c-3.8 0-6.906 3.035-7.059 6.824l-.006.293c0 2.438-1.962 4.415-4.382 4.415S0 18.386 0 15.948C0 7.154 7.101 0 15.83 0zm8.208 16.022c0 8.794 7.101 15.95 15.83 15.95s15.83-7.156 15.83-15.95S48.597.074 39.868.074s-15.83 7.154-15.83 15.948zm8.765 0c0-3.924 3.169-7.118 7.065-7.118 3.895 0 7.065 3.194 7.065 7.118 0 3.926-3.17 7.119-7.065 7.119-3.896 0-7.065-3.193-7.065-7.12zm76.888-11.276c-6.173 6.217-6.173 16.335-.002 22.553 6.173 6.217 16.215 6.217 22.388 0a4.44 4.44 0 0 0 .001-6.244 4.359 4.359 0 0 0-6.003-.184l-.194.184a7.04 7.04 0 0 1-9.994 0c-2.753-2.775-2.753-7.29.002-10.065a7.036 7.036 0 0 1 9.751-.233l.24.231a4.36 4.36 0 0 0 6.198 0 4.44 4.44 0 0 0-.001-6.245c-6.173-6.217-16.215-6.216-22.386.003zm-17.162-.174v22.863c0 2.439 1.961 4.416 4.381 4.416 2.422 0 4.384-1.977 4.384-4.416V4.572c0-2.439-1.962-4.416-4.384-4.416-2.42 0-4.38 1.977-4.38 4.416zM64.1.1c-2.42 0-4.383 1.977-4.383 4.415v23.07c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V8.93h3.933c3.895 0 7.065 3.192 7.065 7.118v11.537c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V16.048C88.244 7.254 81.143.1 72.414.1h-8.316z", fill: "#000" }), jsx("path", { d: "M47.036 16.022c0 3.99-3.209 7.222-7.168 7.222-3.96 0-7.169-3.233-7.169-7.222 0-3.989 3.21-7.222 7.169-7.222 3.96 0 7.168 3.233 7.168 7.222", fill: "#E30613" })] }) }), jsx("p", { className: styles.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles.selects, children: [showCountry && (jsx(CountrySelect, { isRequired: true, countries: countries, countryNameInLanguageOfCountry: true, "data-test-selector": "clSelector_country", onCountryChange: onCountryChange, selectedCountry: currentCountry })), jsx(Select, { isRequired: true, "data-test-selector": "clSelector_language", label: t('Language'), onChange: value => setCurrentLanguage(currentCountry.languages.find(language => language.id === value) || currentLanguage), options: languageOptions, placeholder: t('Select a language'), selectedOption: currentLanguage.id, showPlaceholder: false, variant: "solid" })] })] }) }));
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
export { CountrySelectorDialog };
|
package/dist/exports.d.ts
CHANGED
|
@@ -89,26 +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/
|
|
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';
|
|
112
114
|
export * from './global-search/categories-grid/categories-grid';
|
|
113
115
|
export * from './global-search/global-search';
|
|
114
116
|
export * from './global-search/global-search-provider/global-search-provider';
|
|
@@ -170,6 +172,8 @@ export * from './lists/menu-list/menu-list-header';
|
|
|
170
172
|
export * from './lists/menu-list/menu-list-item';
|
|
171
173
|
export * from './lists/orderline-list/orderline-list';
|
|
172
174
|
export * from './lists/product-overview-grid/product-overview-grid';
|
|
175
|
+
export * from './lists/widget-grid/widget';
|
|
176
|
+
export * from './lists/widget-grid/widget-grid';
|
|
173
177
|
export * from './loading/blank-page-spacer';
|
|
174
178
|
export * from './loading/loading-overlay';
|
|
175
179
|
export * from './loading/progress-circle';
|
|
@@ -220,7 +224,7 @@ export * from './pages/checkout/payment-page/payment-page';
|
|
|
220
224
|
export * from './pages/checkout/payment-page/payment-page-content';
|
|
221
225
|
export * from './pages/checkout/payment-page/utils/parse-amount';
|
|
222
226
|
export * from './pages/checkout/shipping-page/components/currency-change-dialog';
|
|
223
|
-
export * from './pages/checkout/shipping-page/components/edit-address-form';
|
|
227
|
+
export * from './pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form';
|
|
224
228
|
export * from './pages/checkout/shipping-page/components/readonly-address';
|
|
225
229
|
export * from './pages/checkout/shipping-page/components/sonic-address';
|
|
226
230
|
export * from './pages/checkout/shipping-page/hooks/use-patch-shipping-details';
|
|
@@ -234,6 +238,19 @@ export * from './pages/loading-page/loading-page';
|
|
|
234
238
|
export * from './pages/my-sonic/actions/change-customer/change-customer';
|
|
235
239
|
export * from './pages/my-sonic/actions/change-customer/change-customer-dialog';
|
|
236
240
|
export * from './pages/my-sonic/actions/change-customer/connected-change-customer-dialog';
|
|
241
|
+
export * from './pages/my-sonic/actions/change-password/change-password';
|
|
242
|
+
export * from './pages/my-sonic/actions/change-password/change-password-dialog';
|
|
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';
|
|
245
|
+
export * from './pages/my-sonic/actions/edit-user-info/connected-edit-user-info-dialog';
|
|
246
|
+
export * from './pages/my-sonic/actions/edit-user-info/edit-user-info';
|
|
247
|
+
export * from './pages/my-sonic/actions/edit-user-info/edit-user-info-dialog';
|
|
248
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout';
|
|
249
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside';
|
|
250
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main';
|
|
251
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page';
|
|
252
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside';
|
|
253
|
+
export * from './pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title';
|
|
237
254
|
export * from './pages/my-sonic/navigation/connected-my-sonic-navigation';
|
|
238
255
|
export * from './pages/my-sonic/navigation/my-sonic-desktop-navigation';
|
|
239
256
|
export * from './pages/my-sonic/navigation/my-sonic-mobile-navigation';
|
|
@@ -272,8 +289,10 @@ export * from './shared/api/bff/hooks/use-fetch-product-listing-page-data';
|
|
|
272
289
|
export * from './shared/api/bff/hooks/use-fetch-recently-viewed-products';
|
|
273
290
|
export * from './shared/api/bff/services/bff-service';
|
|
274
291
|
export * from './shared/api/shared/hooks/use-awaitable-mutation';
|
|
275
|
-
export * from './shared/api/storefront/hooks/
|
|
276
|
-
export * from './shared/api/storefront/hooks/
|
|
292
|
+
export * from './shared/api/storefront/hooks/account/use-create-account';
|
|
293
|
+
export * from './shared/api/storefront/hooks/account/use-create-guest-account';
|
|
294
|
+
export * from './shared/api/storefront/hooks/account/use-fetch-current-account';
|
|
295
|
+
export * from './shared/api/storefront/hooks/account/use-patch-current-account';
|
|
277
296
|
export * from './shared/api/storefront/hooks/authentication/use-fetch-session';
|
|
278
297
|
export * from './shared/api/storefront/hooks/authentication/use-invalidate-session';
|
|
279
298
|
export * from './shared/api/storefront/hooks/authentication/use-is-authenticated';
|
|
@@ -321,6 +340,7 @@ export * from './shared/api/storefront/hooks/wishlist/use-create-wishlist';
|
|
|
321
340
|
export * from './shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist';
|
|
322
341
|
export * from './shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items';
|
|
323
342
|
export * from './shared/api/storefront/hooks/wishlist/use-fetch-wishlists';
|
|
343
|
+
export * from './shared/api/storefront/services/account-service';
|
|
324
344
|
export * from './shared/api/storefront/services/authentication-service';
|
|
325
345
|
export * from './shared/api/storefront/services/cart-service';
|
|
326
346
|
export * from './shared/api/storefront/services/customer-service';
|
|
@@ -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 };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface SelectProps<T> {
|
|
2
|
+
className?: string;
|
|
2
3
|
'data-test-selector'?: string;
|
|
3
4
|
defaultSelectedOption?: keyof T;
|
|
4
5
|
icon?: React.ReactNode;
|
|
@@ -16,4 +17,4 @@ export interface SelectProps<T> {
|
|
|
16
17
|
size?: 'sm' | 'md';
|
|
17
18
|
variant?: 'outline' | 'solid';
|
|
18
19
|
}
|
|
19
|
-
export declare function Select<T extends Record<string, string>>({ 'data-test-selector': dataTestSelector, defaultSelectedOption, icon, isDisabled, isLoading, isRequired, label, name, onChange, options, placeholder, selectedOption, showLabel, showPlaceholder, size, variant, }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function Select<T extends Record<string, string>>({ className, 'data-test-selector': dataTestSelector, defaultSelectedOption, icon, isDisabled, isLoading, isRequired, label, name, onChange, options, placeholder, selectedOption, showLabel, showPlaceholder, size, variant, }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,15 +3,15 @@ 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';
|
|
12
12
|
|
|
13
13
|
const defaultIcon = (jsx(GlyphsChevronsSlimDownIcon, { "aria-hidden": "true", className: styles.chevron }));
|
|
14
|
-
function Select({ 'data-test-selector': dataTestSelector, defaultSelectedOption, icon = defaultIcon, isDisabled = false, isLoading, isRequired = false, label, name, onChange, options, placeholder, selectedOption, showLabel = false, showPlaceholder = true, size = 'md', variant = 'outline', }) {
|
|
14
|
+
function Select({ className, 'data-test-selector': dataTestSelector, defaultSelectedOption, icon = defaultIcon, isDisabled = false, isLoading, isRequired = false, label, name, onChange, options, placeholder, selectedOption, showLabel = false, showPlaceholder = true, size = 'md', variant = 'outline', }) {
|
|
15
15
|
const selectRef = useRef(null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
const updateWidth = () => {
|
|
@@ -28,7 +28,7 @@ function Select({ 'data-test-selector': dataTestSelector, defaultSelectedOption,
|
|
|
28
28
|
}, []);
|
|
29
29
|
return (jsxs(Select$1, { ref: selectRef, "aria-label": label, className: clsx(styles.select, styles[size], styles[variant], {
|
|
30
30
|
[styles['loading']]: isLoading,
|
|
31
|
-
}), "data-test-selector": dataTestSelector, defaultSelectedKey: defaultSelectedOption === undefined
|
|
31
|
+
}, className), "data-test-selector": dataTestSelector, defaultSelectedKey: defaultSelectedOption === undefined
|
|
32
32
|
? undefined
|
|
33
33
|
: String(defaultSelectedOption), isDisabled: isDisabled, isRequired: isRequired, name: name, onSelectionChange: selected => onChange?.(selected), placeholder: placeholder || label, selectedKey: selectedOption === undefined ? undefined : String(selectedOption), children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs(Button, { className: styles.button, children: [jsx(SelectValue, { "data-test-selector": "value" }), jsx("div", { className: styles['icon-wrapper'], children: isLoading ? jsx(ProgressCircle, { variant: "gray" }) : icon })] }), jsx(FieldError, {}), jsx(Popover, { ref: ref =>
|
|
34
34
|
// Workaround for react/react-aria #1513
|
|
@@ -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
|
/**
|