@sonic-equipment/ui 0.0.99 → 0.0.101
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/index.d.ts +1 -1
- package/dist/index.js +26 -46
- package/dist/src/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +2 -16
- package/dist/src/buttons/button/button.stories.d.ts +2 -13
- package/dist/src/buttons/favorite/favorite-button.stories.d.ts +2 -12
- package/dist/src/buttons/icon-button/icon-button.stories.d.ts +2 -12
- package/dist/src/buttons/link/link.stories.d.ts +2 -12
- package/dist/src/collapsables/show-all/show-all.stories.d.ts +2 -12
- package/dist/src/country-selector/use-countries-languages.d.ts +3 -3
- package/dist/src/filters/active-filters/active-filters.stories.d.ts +3 -13
- package/dist/src/filters/multi-select/multi-select.stories.d.ts +2 -12
- package/dist/src/filters/pagination/pagination.stories.d.ts +2 -14
- package/dist/src/forms/checkbox/checkbox.stories.d.ts +2 -12
- package/dist/src/forms/color-checkbox/color-checkbox.stories.d.ts +2 -12
- package/dist/src/forms/select/select.stories.d.ts +2 -12
- package/dist/src/shared/api/storefront/hooks/website/use-update-locale.d.ts +5 -0
- package/dist/src/shared/api/storefront/services/website-service.d.ts +2 -1
- package/dist/src/shared/providers/cart-provider.d.ts +1 -1
- package/package.json +64 -61
- package/dist/src/shared/api/storefront/hooks/website/use-update-language-by-id.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -4048,7 +4048,7 @@ interface Props$2 {
|
|
|
4048
4048
|
onCartLineUpdated?: (cartLine: CartLineModel$1) => void;
|
|
4049
4049
|
}
|
|
4050
4050
|
declare function CartProvider(props: Props$2): null;
|
|
4051
|
-
declare function useCartEvents(): Props$2;
|
|
4051
|
+
declare function useCartEvents(): Props$2 | undefined;
|
|
4052
4052
|
|
|
4053
4053
|
interface Props$1 {
|
|
4054
4054
|
onFavoriteAdded: () => void;
|
package/dist/index.js
CHANGED
|
@@ -1133,9 +1133,6 @@ function CartProvider(props) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
function useCartEvents() {
|
|
1135
1135
|
const [state] = useGlobalState('cart');
|
|
1136
|
-
if (!state) {
|
|
1137
|
-
throw new Error('useCart must be used together with the CartProvider');
|
|
1138
|
-
}
|
|
1139
1136
|
return state;
|
|
1140
1137
|
}
|
|
1141
1138
|
|
|
@@ -1526,8 +1523,10 @@ function SpinnerState({ isDisabled, onChange, onManualInput, quantity, }) {
|
|
|
1526
1523
|
function ManualInputState({ isDisabled, onCancel, onConfirm, quantity, }) {
|
|
1527
1524
|
const [updatedQuantity, setQuantity] = useState(quantity);
|
|
1528
1525
|
const onKeyUp = (e) => {
|
|
1529
|
-
e.key === 'Enter'
|
|
1530
|
-
|
|
1526
|
+
if (e.key === 'Enter')
|
|
1527
|
+
onConfirm(ensureNumber(updatedQuantity));
|
|
1528
|
+
if (e.key === 'Escape')
|
|
1529
|
+
onCancel();
|
|
1531
1530
|
};
|
|
1532
1531
|
return (jsxs("div", { className: styles$11['manual-input-container'], children: [jsx("div", { className: styles$11['left-button-spacer'] }), jsx(NumberField, { autoFocus: true, autoGrow: true, defaultValue: quantity ? ensureNumber(quantity) : undefined, formatOptions: {
|
|
1533
1532
|
maximumFractionDigits: 0,
|
|
@@ -1639,7 +1638,7 @@ const ConnectedAddToCartButton = ({ onAddToCart, productId }) => {
|
|
|
1639
1638
|
const { isPending: isPendingDeleteCartLine, mutate: deleteCartLine } = useDeleteCartLineById();
|
|
1640
1639
|
const { mutate: updateCartLine } = useUpdateCartLineById();
|
|
1641
1640
|
const { addToast } = useToast();
|
|
1642
|
-
const { onCartLineAdded, onCartLineError, onCartLineRemoved, onCartLineUpdated, } = useCartEvents();
|
|
1641
|
+
const { onCartLineAdded, onCartLineError, onCartLineRemoved, onCartLineUpdated, } = useCartEvents() || {};
|
|
1643
1642
|
const cartLine = cartLines?.find(line => line.productId === productId);
|
|
1644
1643
|
const quantity = cartLine?.qtyOrdered || 0;
|
|
1645
1644
|
const handleChange = (quantity) => {
|
|
@@ -7818,19 +7817,18 @@ async function fetchCountriesLanguages() {
|
|
|
7818
7817
|
languages: body.languages?.languages || [],
|
|
7819
7818
|
};
|
|
7820
7819
|
}
|
|
7821
|
-
async function
|
|
7820
|
+
async function updateLocale({ countryId, languageId, }) {
|
|
7822
7821
|
const { body } = await request({
|
|
7823
7822
|
body: JSON.stringify({
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
},
|
|
7823
|
+
countryId,
|
|
7824
|
+
languageId,
|
|
7827
7825
|
}),
|
|
7828
7826
|
credentials: 'include',
|
|
7829
7827
|
headers: {
|
|
7830
7828
|
'Content-Type': 'application/json',
|
|
7831
7829
|
},
|
|
7832
|
-
method: '
|
|
7833
|
-
url: `${config.SHOP_API_URL}/api/v1/
|
|
7830
|
+
method: 'POST',
|
|
7831
|
+
url: `${config.SHOP_API_URL}/api/v1/locale`,
|
|
7834
7832
|
});
|
|
7835
7833
|
return body;
|
|
7836
7834
|
}
|
|
@@ -7872,18 +7870,6 @@ function useFetchCountriesLanguages({ enabled = true, } = { enabled: true }) {
|
|
|
7872
7870
|
});
|
|
7873
7871
|
}
|
|
7874
7872
|
|
|
7875
|
-
function useUpdateLanguageById() {
|
|
7876
|
-
const queryClient = useQueryClient();
|
|
7877
|
-
return useMutation({
|
|
7878
|
-
mutationFn: async (languageId) => {
|
|
7879
|
-
const session = await updateLanguageById({ languageId });
|
|
7880
|
-
// Update the session query cache
|
|
7881
|
-
queryClient.setQueryData(['session'], session);
|
|
7882
|
-
return session;
|
|
7883
|
-
},
|
|
7884
|
-
});
|
|
7885
|
-
}
|
|
7886
|
-
|
|
7887
7873
|
function useCookie(name, options) {
|
|
7888
7874
|
const cookieValue = Cookies.get()[name];
|
|
7889
7875
|
const [stateValue, setStateValue] = useState(cookieValue);
|
|
@@ -7927,13 +7913,12 @@ const cookieOptions = {
|
|
|
7927
7913
|
};
|
|
7928
7914
|
function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
|
|
7929
7915
|
const [sessionCountries, setSessionCountries] = useSessionStorage('countries-v1');
|
|
7930
|
-
const [currentCountryId
|
|
7931
|
-
const [currentLanguageId
|
|
7932
|
-
const [contextLanguageCode
|
|
7916
|
+
const [currentCountryId] = useCookie('CurrentCountryId', cookieOptions);
|
|
7917
|
+
const [currentLanguageId] = useCookie('CurrentLanguageId', cookieOptions);
|
|
7918
|
+
const [contextLanguageCode] = useCookie('SetContextLanguageCode', cookieOptions);
|
|
7933
7919
|
const { data: apiCountries, error, isFetching, } = useFetchCountriesLanguages({
|
|
7934
7920
|
enabled: !sessionCountries,
|
|
7935
7921
|
});
|
|
7936
|
-
const { mutate: updateLanguageById } = useUpdateLanguageById();
|
|
7937
7922
|
const countries = sessionCountries ?? apiCountries;
|
|
7938
7923
|
useEffect(() => {
|
|
7939
7924
|
if (sessionCountries)
|
|
@@ -7941,11 +7926,8 @@ function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
|
|
|
7941
7926
|
setSessionCountries(apiCountries);
|
|
7942
7927
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7943
7928
|
}, [apiCountries]);
|
|
7944
|
-
function updateCountryLanguage({ country, language, }) {
|
|
7945
|
-
|
|
7946
|
-
setCurrentLanguageId(language.id);
|
|
7947
|
-
setContextLanguageCode(language.languageCode);
|
|
7948
|
-
updateLanguageById(language.id);
|
|
7929
|
+
async function updateCountryLanguage({ country, language, }) {
|
|
7930
|
+
await updateLocale({ countryId: country.id, languageId: language.id });
|
|
7949
7931
|
}
|
|
7950
7932
|
if (error)
|
|
7951
7933
|
throw error;
|
|
@@ -7997,8 +7979,8 @@ function CountrySelector({ defaultCountryCode, defaultLanguageCode, onChange, sh
|
|
|
7997
7979
|
}, [selectedCountry, selectedLanguage]);
|
|
7998
7980
|
if (isFetching)
|
|
7999
7981
|
return null;
|
|
8000
|
-
return (jsxs(Fragment, { children: [jsx(CountrySelectorTrigger, { onClick: open, selectedCountry: selectedCountry, selectedLanguage: selectedLanguage, showCountry: showCountry }), jsx(CountrySelectorDialog, { countries: countries, isOpen: isOpen, onSubmit: args => {
|
|
8001
|
-
updateCountryLanguage(args);
|
|
7982
|
+
return (jsxs(Fragment, { children: [jsx(CountrySelectorTrigger, { onClick: open, selectedCountry: selectedCountry, selectedLanguage: selectedLanguage, showCountry: showCountry }), jsx(CountrySelectorDialog, { countries: countries, isOpen: isOpen, onSubmit: async (args) => {
|
|
7983
|
+
await updateCountryLanguage(args);
|
|
8002
7984
|
close();
|
|
8003
7985
|
onChange?.(args);
|
|
8004
7986
|
}, selectedCountry: selectedCountry || defaultCountry, selectedLanguage: selectedLanguage || defaultLanguage, showCountry: showCountry })] }));
|
|
@@ -8095,19 +8077,17 @@ var styles$H = {"badge":"badge-module-X5Au9","count":"badge-module-ododp","is-an
|
|
|
8095
8077
|
|
|
8096
8078
|
const ANIMATION_DURATION = 600;
|
|
8097
8079
|
function Badge({ count, variant = 'red' }) {
|
|
8098
|
-
const [prevCount, setPrevCount] = useState(count);
|
|
8099
8080
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
8100
8081
|
useEffect(() => {
|
|
8101
|
-
if (count
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
}, [count, prevCount]);
|
|
8082
|
+
if (count === undefined)
|
|
8083
|
+
return;
|
|
8084
|
+
setIsAnimating(true);
|
|
8085
|
+
const timer = setTimeout(() => setIsAnimating(false), ANIMATION_DURATION);
|
|
8086
|
+
return () => clearTimeout(timer);
|
|
8087
|
+
}, [count]);
|
|
8108
8088
|
return (jsx("span", { className: clsx(styles$H.badge, styles$H[variant], {
|
|
8109
8089
|
[styles$H['is-animating']]: isAnimating,
|
|
8110
|
-
}), style: { '--animation-duration': `${ANIMATION_DURATION}ms` }, children: count
|
|
8090
|
+
}), style: { '--animation-duration': `${ANIMATION_DURATION}ms` }, children: count !== undefined && jsx("span", { className: styles$H.count, children: count }) }, count));
|
|
8111
8091
|
}
|
|
8112
8092
|
|
|
8113
8093
|
var styles$G = {"icon-with-badge":"icon-with-badge-module-eCTIN","badge-wrapper":"icon-with-badge-module-NUjwN"};
|
|
@@ -10468,14 +10448,14 @@ function ProductHitCard({ autocomplete, hit, index, source, }) {
|
|
|
10468
10448
|
queryId: hit.queryId,
|
|
10469
10449
|
}), onClick: () => {
|
|
10470
10450
|
close();
|
|
10471
|
-
hit.queryId
|
|
10451
|
+
if (hit.queryId)
|
|
10472
10452
|
sendProductClickFromSearchEvent({
|
|
10473
10453
|
objectId: hit.objectId,
|
|
10474
10454
|
position: hit.position || index + 1,
|
|
10475
10455
|
queryId: hit.queryId,
|
|
10476
10456
|
});
|
|
10477
10457
|
}, onFavoriting: () => {
|
|
10478
|
-
hit.queryId
|
|
10458
|
+
if (hit.queryId)
|
|
10479
10459
|
sendAddToWishListFromSearchEvent({
|
|
10480
10460
|
objectId: hit.objectId,
|
|
10481
10461
|
position: hit.position || index + 1,
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { AddToCartButton } from './add-to-cart-button';
|
|
3
|
-
declare const meta:
|
|
4
|
-
argTypes: {
|
|
5
|
-
isDisabled: {
|
|
6
|
-
control: "boolean";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
args: {
|
|
10
|
-
isDisabled: false;
|
|
11
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
12
|
-
quantity: number;
|
|
13
|
-
};
|
|
14
|
-
component: typeof AddToCartButton;
|
|
15
|
-
tags: string[];
|
|
16
|
-
title: string;
|
|
17
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof AddToCartButton>;
|
|
18
4
|
export default meta;
|
|
19
5
|
type Story = StoryObj<typeof meta>;
|
|
20
6
|
export declare const InitialState: Story;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Button } from './button';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
size: "lg";
|
|
7
|
-
};
|
|
8
|
-
component: typeof Button;
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: string;
|
|
11
|
-
};
|
|
12
|
-
tags: string[];
|
|
13
|
-
title: string;
|
|
14
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
15
4
|
export default meta;
|
|
16
5
|
type Story = StoryObj<typeof meta>;
|
|
17
6
|
export declare const Solid: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { FavoriteButton } from './favorite-button';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onPress: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof FavoriteButton;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof FavoriteButton>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof meta>;
|
|
16
6
|
export declare const InFavorites: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { IconButton } from './icon-button';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof IconButton;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof IconButton>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof meta>;
|
|
16
6
|
export declare const Primary: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Link } from './link';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof Link;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Link>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof meta>;
|
|
16
6
|
export declare const Default: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onToggle: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof ShowAll;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
2
|
+
import { ShowAllPropsControlled, ShowAllPropsUncontrolled } from './show-all';
|
|
3
|
+
declare const meta: Meta<ShowAllPropsControlled>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<Meta<ShowAllPropsControlled>>;
|
|
16
6
|
export declare const Text: Story;
|
|
@@ -13,7 +13,7 @@ interface UseCountriesLanguagesReturnTypeFetching {
|
|
|
13
13
|
updateCountryLanguage(args: {
|
|
14
14
|
country: Country;
|
|
15
15
|
language: Language;
|
|
16
|
-
}): void
|
|
16
|
+
}): Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
interface UseCountriesLanguagesReturnTypeSelected {
|
|
19
19
|
countries: CountriesLanguages;
|
|
@@ -25,7 +25,7 @@ interface UseCountriesLanguagesReturnTypeSelected {
|
|
|
25
25
|
updateCountryLanguage(args: {
|
|
26
26
|
country: Country;
|
|
27
27
|
language: Language;
|
|
28
|
-
}): void
|
|
28
|
+
}): Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
interface UseCountriesLanguagesReturnType {
|
|
31
31
|
countries: CountriesLanguages;
|
|
@@ -37,7 +37,7 @@ interface UseCountriesLanguagesReturnType {
|
|
|
37
37
|
updateCountryLanguage(args: {
|
|
38
38
|
country: Country;
|
|
39
39
|
language: Language;
|
|
40
|
-
}): void
|
|
40
|
+
}): Promise<void>;
|
|
41
41
|
}
|
|
42
42
|
export declare function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }: UseCountriesLanguagesArgs): UseCountriesLanguagesReturnType | UseCountriesLanguagesReturnTypeFetching | UseCountriesLanguagesReturnTypeSelected;
|
|
43
43
|
export {};
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onClearAllFilters: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
5
|
-
onClearFilter: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }: import("./active-filters").ActiveFiltersProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ActiveFilters } from './active-filters';
|
|
3
|
+
declare const meta: Meta<typeof ActiveFilters>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof meta>;
|
|
16
6
|
export declare const Default: Story;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { FilterOption, MultiSelect, MultiSelectProps } from './multi-select';
|
|
3
3
|
type ColorFilterOption = FilterOption & {
|
|
4
4
|
color: string;
|
|
5
5
|
};
|
|
6
|
-
declare const meta:
|
|
7
|
-
args: {
|
|
8
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
9
|
-
};
|
|
10
|
-
component: typeof MultiSelect;
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: string;
|
|
13
|
-
};
|
|
14
|
-
tags: string[];
|
|
15
|
-
title: string;
|
|
16
|
-
};
|
|
6
|
+
declare const meta: Meta<typeof MultiSelect>;
|
|
17
7
|
export default meta;
|
|
18
8
|
type Story = StoryObj<typeof meta>;
|
|
19
9
|
export declare const WithCheckboxes: Story;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Pagination } from './pagination';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
currentPage: number;
|
|
6
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
7
|
-
totalPages: number;
|
|
8
|
-
};
|
|
9
|
-
component: typeof Pagination;
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: string;
|
|
12
|
-
};
|
|
13
|
-
tags: string[];
|
|
14
|
-
title: string;
|
|
15
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Pagination>;
|
|
16
4
|
export default meta;
|
|
17
5
|
type Story = StoryObj<typeof Pagination>;
|
|
18
6
|
export declare const Default: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Checkbox } from './checkbox';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof Checkbox;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof Checkbox>;
|
|
16
6
|
export declare const Unchecked: Story;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { ColorCheckbox } from './color-checkbox';
|
|
3
|
-
declare const meta:
|
|
4
|
-
args: {
|
|
5
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
component: typeof ColorCheckbox;
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
tags: string[];
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof ColorCheckbox>;
|
|
14
4
|
export default meta;
|
|
15
5
|
type Story = StoryObj<typeof ColorCheckbox>;
|
|
16
6
|
export declare const Checked: Story;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Select } from './select';
|
|
3
3
|
declare const options: {
|
|
4
4
|
readonly new: "New";
|
|
@@ -7,17 +7,7 @@ declare const options: {
|
|
|
7
7
|
readonly price_desc: "Price: High - Low";
|
|
8
8
|
readonly recommended: "Recommended";
|
|
9
9
|
};
|
|
10
|
-
declare const meta:
|
|
11
|
-
args: {
|
|
12
|
-
onChange: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
13
|
-
};
|
|
14
|
-
component: typeof Select;
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: string;
|
|
17
|
-
};
|
|
18
|
-
tags: string[];
|
|
19
|
-
title: string;
|
|
20
|
-
};
|
|
10
|
+
declare const meta: Meta<typeof Select>;
|
|
21
11
|
export default meta;
|
|
22
12
|
type Story = StoryObj<typeof Select>;
|
|
23
13
|
export declare const WithLabel: Story;
|
|
@@ -4,6 +4,7 @@ export declare function fetchCountriesLanguages(): Promise<{
|
|
|
4
4
|
countries: CountryModel[];
|
|
5
5
|
languages: LanguageModel[];
|
|
6
6
|
}>;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function updateLocale({ countryId, languageId, }: {
|
|
8
|
+
countryId: string;
|
|
8
9
|
languageId: string;
|
|
9
10
|
}): Promise<SessionModel>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonic-equipment/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.101",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
19
22
|
"main": "dist/index.js",
|
|
20
23
|
"types": "./dist/index.d.ts",
|
|
21
24
|
"scripts": {
|
|
@@ -50,93 +53,93 @@
|
|
|
50
53
|
"react-instantsearch-core": "^7"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
|
-
"@chromatic-com/storybook": "^
|
|
54
|
-
"@csstools/postcss-global-data": "^
|
|
55
|
-
"@rollup/plugin-alias": "^5.1.
|
|
56
|
-
"@rollup/plugin-commonjs": "^
|
|
57
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
58
|
-
"@rollup/plugin-replace": "^
|
|
59
|
-
"@rollup/plugin-typescript": "^
|
|
60
|
-
"@storybook/addon-docs": "^8.
|
|
61
|
-
"@storybook/addon-essentials": "^8.
|
|
62
|
-
"@storybook/addon-interactions": "^8.
|
|
63
|
-
"@storybook/addon-links": "^8.
|
|
64
|
-
"@storybook/addon-viewport": "^8.
|
|
65
|
-
"@storybook/blocks": "^8.
|
|
66
|
-
"@storybook/preview-api": "^8.
|
|
67
|
-
"@storybook/react": "^8.
|
|
68
|
-
"@storybook/react-vite": "^8.
|
|
69
|
-
"@storybook/test": "^8.
|
|
56
|
+
"@chromatic-com/storybook": "^3.2.2",
|
|
57
|
+
"@csstools/postcss-global-data": "^3.0.0",
|
|
58
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
59
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
60
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
61
|
+
"@rollup/plugin-replace": "^6.0.1",
|
|
62
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
63
|
+
"@storybook/addon-docs": "^8.4.2",
|
|
64
|
+
"@storybook/addon-essentials": "^8.4.2",
|
|
65
|
+
"@storybook/addon-interactions": "^8.4.2",
|
|
66
|
+
"@storybook/addon-links": "^8.4.2",
|
|
67
|
+
"@storybook/addon-viewport": "^8.4.2",
|
|
68
|
+
"@storybook/blocks": "^8.4.2",
|
|
69
|
+
"@storybook/preview-api": "^8.4.2",
|
|
70
|
+
"@storybook/react": "^8.4.2",
|
|
71
|
+
"@storybook/react-vite": "^8.4.2",
|
|
72
|
+
"@storybook/test": "^8.4.2",
|
|
70
73
|
"@types/js-cookie": "^3.0.6",
|
|
71
|
-
"@types/
|
|
72
|
-
"@types/react
|
|
73
|
-
"@
|
|
74
|
-
"@typescript-eslint/
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"
|
|
74
|
+
"@types/node": "^22.9.0",
|
|
75
|
+
"@types/react": "^18.3.12",
|
|
76
|
+
"@types/react-dom": "^18.3.1",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
78
|
+
"@typescript-eslint/parser": "^8.13.0",
|
|
79
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
80
|
+
"autoprefixer": "^10.4.20",
|
|
81
|
+
"concurrently": "^9.1.0",
|
|
78
82
|
"eslint": "^8.57.0",
|
|
79
83
|
"eslint-config-prettier": "^9.1.0",
|
|
80
|
-
"eslint-import-resolver-typescript": "^3.6.
|
|
81
|
-
"eslint-plugin-import": "^2.
|
|
84
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
85
|
+
"eslint-plugin-import": "^2.31.0",
|
|
82
86
|
"eslint-plugin-mdx": "^3.1.5",
|
|
83
87
|
"eslint-plugin-no-relative-import-paths": "^1.5.5",
|
|
84
|
-
"eslint-plugin-prettier": "^5.1
|
|
85
|
-
"eslint-plugin-react": "7.
|
|
86
|
-
"eslint-plugin-react-hooks": "^
|
|
88
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
89
|
+
"eslint-plugin-react": "7.37.2",
|
|
90
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
87
91
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
88
92
|
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
89
93
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
90
|
-
"eslint-plugin-storybook": "^0.
|
|
91
|
-
"eslint-plugin-typescript-sort-keys": "^3.
|
|
92
|
-
"eslint-plugin-unused-imports": "^
|
|
94
|
+
"eslint-plugin-storybook": "^0.11.0",
|
|
95
|
+
"eslint-plugin-typescript-sort-keys": "^3.3.0",
|
|
96
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
93
97
|
"http-server": "^14.1.1",
|
|
94
|
-
"husky": "^9.
|
|
95
|
-
"instantsearch.js": "^4.
|
|
96
|
-
"nodemon": "^3.1.
|
|
97
|
-
"postcss": "^8.4.
|
|
98
|
-
"postcss-custom-media": "^
|
|
98
|
+
"husky": "^9.1.6",
|
|
99
|
+
"instantsearch.js": "^4.75.4",
|
|
100
|
+
"nodemon": "^3.1.7",
|
|
101
|
+
"postcss": "^8.4.47",
|
|
102
|
+
"postcss-custom-media": "^11.0.5",
|
|
99
103
|
"postcss-import": "^16.1.0",
|
|
100
|
-
"postcss-nested": "^
|
|
104
|
+
"postcss-nested": "^7.0.2",
|
|
101
105
|
"react": "^18.3.1",
|
|
102
106
|
"react-dom": "^18.3.1",
|
|
103
107
|
"rimraf": "^6.0.1",
|
|
104
|
-
"rollup": "^4.
|
|
108
|
+
"rollup": "^4.24.4",
|
|
105
109
|
"rollup-plugin-dts": "^6.1.1",
|
|
106
110
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
107
111
|
"rollup-plugin-postcss": "^4.0.2",
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"stylelint": "^16.7.0",
|
|
112
|
+
"storybook": "^8.4.2",
|
|
113
|
+
"stylelint": "^16.10.0",
|
|
111
114
|
"stylelint-config-css-modules": "^4.4.0",
|
|
112
115
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
113
116
|
"stylelint-config-standard": "^36.0.1",
|
|
114
|
-
"typescript": "^5.
|
|
115
|
-
"vite": "^5.
|
|
116
|
-
"vite-tsconfig-paths": "^
|
|
117
|
+
"typescript": "^5.6.3",
|
|
118
|
+
"vite": "^5.4.10",
|
|
119
|
+
"vite-tsconfig-paths": "^5.1.0"
|
|
117
120
|
},
|
|
118
121
|
"dependencies": {
|
|
119
|
-
"@algolia/autocomplete-core": "^1.17.
|
|
120
|
-
"@algolia/autocomplete-plugin-query-suggestions": "^1.17.
|
|
121
|
-
"@algolia/autocomplete-plugin-recent-searches": "^1.17.
|
|
122
|
-
"@algolia/autocomplete-preset-algolia": "^1.17.
|
|
122
|
+
"@algolia/autocomplete-core": "^1.17.7",
|
|
123
|
+
"@algolia/autocomplete-plugin-query-suggestions": "^1.17.7",
|
|
124
|
+
"@algolia/autocomplete-plugin-recent-searches": "^1.17.7",
|
|
125
|
+
"@algolia/autocomplete-preset-algolia": "^1.17.7",
|
|
123
126
|
"@algolia/client-search": "^4.24.0",
|
|
124
|
-
"@tanstack/react-query": "^5.
|
|
125
|
-
"@tanstack/react-query-devtools": "^5.
|
|
126
|
-
"@types/react-transition-group": "^4.4.
|
|
127
|
+
"@tanstack/react-query": "^5.59.20",
|
|
128
|
+
"@tanstack/react-query-devtools": "^5.59.20",
|
|
129
|
+
"@types/react-transition-group": "^4.4.11",
|
|
127
130
|
"algoliasearch": "^4.24.0",
|
|
128
131
|
"clsx": "^2.1.1",
|
|
129
132
|
"fast-equals": "^5.0.1",
|
|
130
|
-
"instantsearch.js": "^4.
|
|
133
|
+
"instantsearch.js": "^4.75.4",
|
|
131
134
|
"js-cookie": "^3.0.5",
|
|
132
|
-
"query-string": "^9.1.
|
|
133
|
-
"react-aria": "^3.35.
|
|
134
|
-
"react-aria-components": "^1.4.
|
|
135
|
-
"react-instantsearch": "^7.
|
|
135
|
+
"query-string": "^9.1.1",
|
|
136
|
+
"react-aria": "^3.35.1",
|
|
137
|
+
"react-aria-components": "^1.4.1",
|
|
138
|
+
"react-instantsearch": "^7.13.7",
|
|
136
139
|
"react-toastify": "^10.0.6",
|
|
137
140
|
"react-transition-group": "^4.4.5",
|
|
138
|
-
"search-insights": "2.
|
|
139
|
-
"swiper": "^11.1.
|
|
141
|
+
"search-insights": "2.17.2",
|
|
142
|
+
"swiper": "^11.1.14"
|
|
140
143
|
},
|
|
141
144
|
"publishConfig": {
|
|
142
145
|
"access": "public"
|