@zonos/amino 5.2.4 → 5.2.6
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/all.d.ts +1 -0
- package/components/banner/Banner.js +1 -1
- package/components/button/Button.js +1 -1
- package/components/button/ButtonIcon.js +1 -1
- package/components/button/MenuButton.d.ts +1 -1
- package/components/button/MenuButton.js +1 -1
- package/components/collapse/Collapse.d.ts +1 -1
- package/components/collapse/Collapse.js +1 -1
- package/components/connection-map/ConnectionMap.d.ts +2 -2
- package/components/country-multi-select/CountryMultiSelectExpanded.js +1 -1
- package/components/cover-sheet/CoverSheet.js +1 -1
- package/components/dialog/Dialog.js +1 -1
- package/components/dialog/alert/AlertContext.js +1 -1
- package/components/dialog/alert/AlertDialog.js +1 -1
- package/components/dialog/alert/useAlert.js +1 -1
- package/components/dialog/announcement/AnnouncementDialog.js +1 -1
- package/components/dialog/confirm/ConfirmContext.js +1 -1
- package/components/dialog/confirm/ConfirmDialog.js +1 -1
- package/components/dialog/confirm/useConfirm.js +1 -1
- package/components/drop-zone/DropZone.d.ts +1 -1
- package/components/drop-zone/DropZone.js +1 -1
- package/components/file-upload/FileUpload.js +1 -1
- package/components/filter/FilterWrapper.js +1 -1
- package/components/filter/filter-amount/FilterAmount.js +1 -1
- package/components/filter/filter-date/DateControls.js +1 -1
- package/components/filter/filter-date/FilterDate.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsAfter.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsBefore.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsBeforeOrOn.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsBetween.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsEqualTo.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsInTheLast.js +1 -1
- package/components/filter/filter-date/_DateControls/_IsOnOrAfter.js +1 -1
- package/components/filter/filter-multi-select/FilterMultiSelect.js +1 -1
- package/components/filter/filter-select/FilterSelect.js +1 -1
- package/components/filter/filter-text/FilterText.js +1 -1
- package/components/filter/useFilterWrapper.js +1 -1
- package/components/graph-matrix/GraphMatrix.d.ts +1 -1
- package/components/graph-matrix/GraphMatrix.js +1 -1
- package/components/input/Input.js +1 -1
- package/components/input/input-type/_PasswordInput.js +1 -1
- package/components/layout/Layout.d.ts +1 -1
- package/components/layout/Layout.js +1 -1
- package/components/layout/NavigationGroup.js +1 -1
- package/components/nested-data-table/NestedDataTable.d.ts +1 -1
- package/components/nested-data-table/NestedDataTable.js +1 -1
- package/components/nested-data-table/NestedDataTableHasura.d.ts +1 -1
- package/components/nested-data-table/NestedDataTableHasura.js +1 -1
- package/components/nested-data-table/_Filter.js +1 -1
- package/components/nested-data-table/_TableData.js +1 -1
- package/components/section/HSection.js +1 -1
- package/components/select/CountryMultiSelect.d.ts +2 -2
- package/components/select/CountryMultiSelect.js +1 -1
- package/components/select/CountryPhoneSelect.d.ts +1 -1
- package/components/select/CountryPhoneSelect.js +1 -1
- package/components/select/CountrySelect.d.ts +1 -1
- package/components/select/CountrySelect.js +1 -1
- package/components/select/MultiSelect.d.ts +1 -1
- package/components/select/MultiSelect.js +1 -1
- package/components/select/Select.d.ts +1 -1
- package/components/select/Select.js +1 -1
- package/components/slide-over/SlideOver.d.ts +1 -1
- package/components/slide-over/SlideOver.js +1 -1
- package/components/table/TableRowCollapse.js +1 -1
- package/components/text/Text.d.ts +1 -1
- package/components/theme-select/ThemeSelect.js +1 -1
- package/components/tooltip/Tooltip.js +1 -1
- package/icons/icon-base/_IconBase.d.ts +1 -1
- package/package.json +1 -1
- package/utils/getCountryCodeByName.d.ts +1 -1
- package/utils/getProductDetails.d.ts +1 -1
- package/utils/getProductDetails.js +1 -1
- package/utils/hooks/_useGraphiqlStorage.js +1 -1
- package/utils/hooks/useAminoTheme.d.ts +1 -1
- package/utils/hooks/useAminoTheme.js +1 -1
- package/utils/hooks/useCountryOptions.d.ts +71 -0
- package/utils/hooks/useCountryOptions.js +1 -0
- package/utils/hooks/useCurrentShema.d.ts +1 -1
- package/utils/hooks/useCurrentShema.js +1 -1
- package/utils/hooks/useStorage.d.ts +10 -1
- package/utils/hooks/useStorage.js +1 -1
- package/utils/prepCountryOptions.d.ts +4 -4
- package/utils/prepRegionCountryOptions.d.ts +1 -1
- package/utils/prepRegionCountryOptions.js +1 -1
- package/utils/storage.d.ts +9 -2
- package/utils/storage.js +1 -1
- package/NavigationGroup.module-c237c396.js +0 -1
- package/types/Country.d.ts +0 -33
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { GetCountriesResponse } from "
|
|
1
|
+
import type { GetCountriesResponse } from "./hooks/useCountryOptions";
|
|
2
2
|
export declare const prepCountryOptions: <CountryCode extends string = string>({ json, }: {
|
|
3
3
|
json: GetCountriesResponse<CountryCode>;
|
|
4
4
|
}) => {
|
|
5
5
|
label: string;
|
|
6
6
|
phoneCode: string[];
|
|
7
7
|
value: CountryCode;
|
|
8
|
-
active: boolean;
|
|
9
8
|
code: CountryCode;
|
|
9
|
+
region: "Africa" | "Americas" | "Asia" | "Central America" | "Europe" | "North America" | "Oceania" | "South America";
|
|
10
|
+
active: boolean;
|
|
11
|
+
displayName: string;
|
|
10
12
|
code3: string | null;
|
|
11
13
|
currencyCode: string;
|
|
12
|
-
displayName: string;
|
|
13
14
|
fraudRisk: number;
|
|
14
15
|
languageCode: string | null;
|
|
15
16
|
numericCode: string | null;
|
|
16
|
-
region: "Africa" | "Americas" | "Asia" | "Central America" | "Europe" | "North America" | "Oceania" | "South America";
|
|
17
17
|
upsCode: string | null;
|
|
18
18
|
zipRegex: string | null;
|
|
19
19
|
}[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CountryOption } from "
|
|
1
|
+
import { type CountryOption } from "./hooks/useCountryOptions";
|
|
2
2
|
export declare const prepRegionCountryOptions: <T extends string = string>(countries: CountryOption<T>[]) => {
|
|
3
3
|
label: "Africa" | "Americas" | "Asia" | "Central America" | "Europe" | "North America" | "Oceania" | "South America";
|
|
4
4
|
options: CountryOption<T>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=
|
|
1
|
+
"use strict";var r=require("./hooks/useCountryOptions.js");require("../_tslib-bd4862e8.js"),require("dayjs"),require("zod"),require("./handleFetch.js"),require("./hooks/useSwrt.js"),require("lodash/isEqual"),require("swr"),require("./prepCountryOptions.js"),require("./countryPhoneCodes.js"),require("./hooks/useStorage.js"),require("react"),require("./storage.js");exports.prepRegionCountryOptions=function(e){return r.regions.map((function(r){return{label:r,options:e.filter((function(e){return e.region===r}))}}))};
|
package/utils/storage.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import { type Schema } from 'zod';
|
|
2
3
|
export type StorageType = 'session' | 'local';
|
|
3
4
|
export type StorageParams<Value, Key extends string = string> = {
|
|
4
5
|
key: Key;
|
|
@@ -12,5 +13,11 @@ type SetParams<Value> = Omit<StorageParams<Value>, 'schema'> & {
|
|
|
12
13
|
value: Value;
|
|
13
14
|
};
|
|
14
15
|
export declare const getStorageItem: <Value extends unknown>({ key, schema, type, }: StorageParams<Value>) => Value | null;
|
|
15
|
-
export declare const setStorageItem: <Value extends unknown>({ key, type, value, }: SetParams<Value>) =>
|
|
16
|
+
export declare const setStorageItem: <Value extends unknown>({ key, type, value, }: SetParams<Value>) => void;
|
|
17
|
+
export declare const setStorageItemWithLifetime: <Value extends unknown>({ key, lifetime, type, value, }: Omit<StorageParams<Value, string>, "schema"> & {
|
|
18
|
+
value: Value;
|
|
19
|
+
} & {
|
|
20
|
+
lifetime: Dayjs;
|
|
21
|
+
}) => void;
|
|
22
|
+
export declare const getShouldUpdateStorageItem: <Value extends unknown>({ key, type, }: StorageParams<Value>) => boolean;
|
|
16
23
|
export {};
|
package/utils/storage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("
|
|
1
|
+
"use strict";var e=require("dayjs"),t=require("zod");function r(e){return e&&e.__esModule?e:{default:e}}var a=r(e),o="undefined"!=typeof window,n=function(e){var t=e.key,r=e.schema,a=e.type;if(!o)return null;var n=("local"===a?window.localStorage:window.sessionStorage).getItem(t);if(!n)return null;try{var s=JSON.parse(n);return(i=r.safeParse(s)).success?i.data:null}catch(e){var i;return(i=r.safeParse(n)).success?i.data:null}};exports.getShouldUpdateStorageItem=function(e){var r=e.key,o=e.type,s=n({key:"".concat(r,"_update_after"),schema:t.z.string(),type:o});if("string"==typeof s){var i=a.default(s);return a.default().isAfter(i)}return!0},exports.getStorageItem=n,exports.setStorageItem=function(e){var t=e.key,r=e.type,a=e.value;if(!o)throw new Error("Cannot set storage outside client");var n="session"===r?window.sessionStorage:window.localStorage,s="string"==typeof a?a:JSON.stringify(a);n.setItem(t,s),window.dispatchEvent(new Event("amino:storage-".concat(r)))},exports.setStorageItemWithLifetime=function(e){var t=e.key,r=e.lifetime,a=e.type,n=e.value;if(!o)throw new Error("Cannot set storage outside client");var s="session"===a?window.sessionStorage:window.localStorage,i="string"==typeof n?n:JSON.stringify(n);!!n?(s.setItem(t,i),s.setItem("".concat(t,"_update_after"),r.format("YYYY-MM-DD"))):(s.removeItem(t),s.removeItem("".concat(t,"_update_after"))),window.dispatchEvent(new Event("amino:storage-".concat(a)))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("./style-inject.es-d4ddeae4.js").styleInject(".Amino_NavigationGroup-module__wrapper--7xWZ9{display:flex;flex-direction:column}.Amino_NavigationGroup-module__styledNavigationItem--CFkop{align-items:center;border-radius:var(--amino-radius-6);color:var(--amino-gray-800);display:flex;font-size:var(--amino-font-size-base);font-weight:500;gap:var(--amino-space-8);height:28px;margin-bottom:2px;padding:var(--amino-space-4) var(--amino-space-8)}.Amino_NavigationGroup-module__styledNavigationItem--CFkop:hover{background-color:var(--amino-hover-color);color:var(--amino-gray-1000)}.Amino_NavigationGroup-module__styledNavigationItem--CFkop:hover svg{color:var(--amino-gray-800)}.Amino_NavigationGroup-module__styledNavigationItem--CFkop svg{color:var(--amino-gray-600);height:var(--amino-space-24);margin-left:var(--amino-space-negative-4);width:var(--amino-space-24)}.Amino_NavigationGroup-module__styledNavigationItem--CFkop.Amino_NavigationGroup-module__styledNavigationContent--33616{flex-grow:1}.Amino_NavigationGroup-module__styledNavigationItem--CFkop.Amino_NavigationGroup-module__styledNavigationContent--33616>*{height:100%}.Amino_NavigationGroup-module__styledNavigationItem--CFkop.Amino_NavigationGroup-module__styledNavigationItemIcon--d7lUf{flex-basis:var(--amino-space-32);flex-grow:0;flex-shrink:0}.Amino_NavigationGroup-module__styledNavigationItem--CFkop.Amino_NavigationGroup-module__active--Rj4xu{background-color:var(--amino-gray-100);color:var(--amino-gray-1200)}.Amino_NavigationGroup-module__styledNavigationItem--CFkop.Amino_NavigationGroup-module__active--Rj4xu svg{color:var(--amino-gray-1200)}.Amino_NavigationGroup-module__styledItemWrapper--16hAJ.Amino_NavigationGroup-module__collapsed--l1PZq .Amino_NavigationGroup-module__styledNavigationItem--CFkop{color:var(--amino-text-color)}.Amino_NavigationGroup-module__styledItemWrapper--16hAJ.Amino_NavigationGroup-module__collapsed--l1PZq .Amino_NavigationGroup-module__styledNavigationItem--CFkop:hover{background-color:initial}.Amino_NavigationGroup-module__styledItemWrapper--16hAJ.Amino_NavigationGroup-module__collapsed--l1PZq .Amino_NavigationGroup-module__styledNavigationItem--CFkop svg{color:var(--amino-gray-1200)}.Amino_NavigationGroup-module__styledGroupItemWrapper--Lre77{border-left:1px solid var(--amino-border-color);margin-left:15px;padding-left:var(--amino-space-12)}"),exports.styles={wrapper:"Amino_NavigationGroup-module__wrapper--7xWZ9",styledNavigationItem:"Amino_NavigationGroup-module__styledNavigationItem--CFkop",styledNavigationContent:"Amino_NavigationGroup-module__styledNavigationContent--33616",styledNavigationItemIcon:"Amino_NavigationGroup-module__styledNavigationItemIcon--d7lUf",active:"Amino_NavigationGroup-module__active--Rj4xu",styledItemWrapper:"Amino_NavigationGroup-module__styledItemWrapper--16hAJ",collapsed:"Amino_NavigationGroup-module__collapsed--l1PZq",styledGroupItemWrapper:"Amino_NavigationGroup-module__styledGroupItemWrapper--Lre77"};
|
package/types/Country.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { SelectOption } from "./SelectOption";
|
|
2
|
-
export declare const regions: readonly ["Africa", "Americas", "Asia", "Central America", "Europe", "North America", "Oceania", "South America"];
|
|
3
|
-
type Region = (typeof regions)[number];
|
|
4
|
-
/** @desc /api/address/getCountries */
|
|
5
|
-
export type Country<CountryCode extends string = string> = {
|
|
6
|
-
active: boolean;
|
|
7
|
-
code: CountryCode;
|
|
8
|
-
code3: string | null;
|
|
9
|
-
currencyCode: string;
|
|
10
|
-
displayName: string;
|
|
11
|
-
fraudRisk: number;
|
|
12
|
-
languageCode: string | null;
|
|
13
|
-
numericCode: string | null;
|
|
14
|
-
region: Region;
|
|
15
|
-
upsCode: string | null;
|
|
16
|
-
zipRegex: string | null;
|
|
17
|
-
};
|
|
18
|
-
export type CountryOption<CountryCode extends string = string> = {
|
|
19
|
-
phoneCode: string[];
|
|
20
|
-
} & Country<CountryCode> & SelectOption<CountryCode>;
|
|
21
|
-
export type RegionCountryOption = {
|
|
22
|
-
label: Region;
|
|
23
|
-
options: CountryOption[];
|
|
24
|
-
};
|
|
25
|
-
export type UnavailableCountry = {
|
|
26
|
-
code: string;
|
|
27
|
-
message: string;
|
|
28
|
-
};
|
|
29
|
-
/** @desc /api/address/getCountries */
|
|
30
|
-
export type GetCountriesResponse<CountryCode extends string = string> = {
|
|
31
|
-
[key: string]: Country<CountryCode>;
|
|
32
|
-
};
|
|
33
|
-
export {};
|