@caratlogic/design-system 0.1.11 → 0.1.13
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/components/layouts/AppShell/AppShell.types.d.ts +14 -1
- package/dist/components/layouts/AppShell/AppShell.types.d.ts.map +1 -1
- package/dist/components/layouts/AppShell/DashboardShell.d.ts.map +1 -1
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.d.ts +5 -0
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.d.ts.map +1 -0
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.types.d.ts +31 -0
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.types.d.ts.map +1 -0
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.utils.d.ts +2 -0
- package/dist/components/molecules/CountryStateSelect/CountryStateSelect.utils.d.ts.map +1 -0
- package/dist/components/molecules/CountryStateSelect/index.d.ts +3 -0
- package/dist/components/molecules/CountryStateSelect/index.d.ts.map +1 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.accessibility.d.ts +4 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.accessibility.d.ts.map +1 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.d.ts +8 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.d.ts.map +1 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.types.d.ts +22 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.types.d.ts.map +1 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.utils.d.ts +4 -0
- package/dist/components/molecules/InAppNotificationCard/InAppNotificationCard.utils.d.ts.map +1 -0
- package/dist/components/molecules/InAppNotificationCard/index.d.ts +4 -0
- package/dist/components/molecules/InAppNotificationCard/index.d.ts.map +1 -0
- package/dist/components/molecules/SearchableSelect/SearchableSelect.d.ts.map +1 -1
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.accessibility.d.ts +9 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.accessibility.d.ts.map +1 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.d.ts +9 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.d.ts.map +1 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.hooks.d.ts +12 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.hooks.d.ts.map +1 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.types.d.ts +41 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.types.d.ts.map +1 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.utils.d.ts +4 -0
- package/dist/components/organisms/InAppNotificationsPanel/InAppNotificationsPanel.utils.d.ts.map +1 -0
- package/dist/components/organisms/InAppNotificationsPanel/index.d.ts +5 -0
- package/dist/components/organisms/InAppNotificationsPanel/index.d.ts.map +1 -0
- package/dist/components/organisms/Navbar/Navbar.d.ts +1 -1
- package/dist/components/organisms/Navbar/Navbar.d.ts.map +1 -1
- package/dist/constants/countries.d.ts +12 -0
- package/dist/constants/countries.d.ts.map +1 -0
- package/dist/index.cjs.js +8861 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +8843 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/utils/geoUtils.d.ts +41 -0
- package/dist/utils/geoUtils.d.ts.map +1 -0
- package/dist/utils/relativeTime.d.ts +6 -0
- package/dist/utils/relativeTime.d.ts.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface StateOption {
|
|
2
|
+
/** Display name, persisted as `address.state`. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** ISO 3166-2 subdivision code, persisted as `address.stateCode`. Absent for code-less regions. */
|
|
5
|
+
code?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function isValidAlpha2CountryCode(code?: string | null): boolean;
|
|
8
|
+
/** Resolve an alpha-2 code from a 2-letter code, 3-letter code, or English name/alias (UK, USA, UAE…). */
|
|
9
|
+
export declare function resolveCountryCode(countryOrCode?: string | null): string | undefined;
|
|
10
|
+
export declare function getCountryName(countryCode?: string | null): string | undefined;
|
|
11
|
+
export declare function getStatesOfCountry(countryCode?: string | null): StateOption[];
|
|
12
|
+
/** Matches the backend resolution order: code first, then name, then name-as-code. */
|
|
13
|
+
export declare function findRegion(countryCode?: string | null, state?: string | null, stateCode?: string | null): StateOption | undefined;
|
|
14
|
+
export declare function isIndiaCountry(countryOrCode?: string | null): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* True when `state` is one of the selected country's subdivisions.
|
|
17
|
+
* Legacy free-text values ("Mah", a city name, a typo) are not, and must be re-picked —
|
|
18
|
+
* otherwise they stay in form state, render as a blank dropdown, and still pass `min(1)`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isKnownRegion(countryCode?: string | null, state?: string | null): boolean;
|
|
21
|
+
/** One-line "City, State, Country" summary used in tables, pickers and detail cards. */
|
|
22
|
+
export declare function formatAddressLocation(address?: {
|
|
23
|
+
city?: string;
|
|
24
|
+
state?: string;
|
|
25
|
+
country?: string;
|
|
26
|
+
} | null): string;
|
|
27
|
+
export interface AddressGeoFields {
|
|
28
|
+
streetAddress?: string;
|
|
29
|
+
city?: string;
|
|
30
|
+
state?: string;
|
|
31
|
+
stateCode?: string;
|
|
32
|
+
zipCode?: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
countryCode?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Seed an address form from an API record. Codes are derived from the display names so
|
|
38
|
+
* records written before the backfill still pre-select in the dropdowns.
|
|
39
|
+
*/
|
|
40
|
+
export declare function toAddressFormValues(address?: AddressGeoFields | null): Required<AddressGeoFields>;
|
|
41
|
+
//# s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IAAI,GACnE,MAAM,CAKR;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAChC,QAAQ,CAAC,gBAAgB,CAAC,CAc5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeTime.d.ts","sourceRoot":"","sources":["../../src/utils/relativeTime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAkBvE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caratlogic/design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Carat Logic Design System",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@rollup/plugin-alias": "^6.0.0",
|
|
59
59
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
60
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
60
61
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
61
62
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
62
63
|
"@tailwindcss/postcss": "^4.1.13",
|
|
@@ -123,8 +124,10 @@
|
|
|
123
124
|
"class-variance-authority": "^0.7",
|
|
124
125
|
"clsx": "^2",
|
|
125
126
|
"cmdk": "^1.1.1",
|
|
127
|
+
"country-region-data": "^4.1.0",
|
|
126
128
|
"embla-carousel-react": "^8.6.0",
|
|
127
129
|
"heic2any": "^0.0.4",
|
|
130
|
+
"i18n-iso-countries": "^7.14.0",
|
|
128
131
|
"input-otp": "^1.4.2",
|
|
129
132
|
"lucide-react": "^0.539.0",
|
|
130
133
|
"moment": "^2.30.1",
|