@freightos/freightwind 2.0.0 → 2.1.1
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/cjs/constants/countries.js +53 -0
- package/dist/cjs/constants/index.js +5 -1
- package/dist/cjs/constants/us-states.js +56 -0
- package/dist/cjs/index.js +2 -33
- package/dist/cjs/lib/icon-utils.js +23 -1
- package/dist/esm/constants/countries.js +50 -0
- package/dist/esm/constants/index.js +2 -0
- package/dist/esm/constants/us-states.js +53 -0
- package/dist/esm/index.js +1 -16
- package/dist/esm/lib/icon-utils.js +21 -0
- package/dist/types/constants/countries.d.ts +5 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/constants/us-states.d.ts +5 -0
- package/dist/types/index.d.ts +2 -24
- package/dist/types/lib/icon-utils.d.ts +12 -0
- package/package.json +8 -14
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COUNTRIES = void 0;
|
|
4
|
+
exports.COUNTRIES = [
|
|
5
|
+
{ code: 'US', name: 'United States' },
|
|
6
|
+
{ code: 'CN', name: 'China' },
|
|
7
|
+
{ code: 'GB', name: 'United Kingdom' },
|
|
8
|
+
{ code: 'CA', name: 'Canada' },
|
|
9
|
+
{ code: 'DE', name: 'Germany' },
|
|
10
|
+
{ code: 'FR', name: 'France' },
|
|
11
|
+
{ code: 'IT', name: 'Italy' },
|
|
12
|
+
{ code: 'ES', name: 'Spain' },
|
|
13
|
+
{ code: 'NL', name: 'Netherlands' },
|
|
14
|
+
{ code: 'BE', name: 'Belgium' },
|
|
15
|
+
{ code: 'CH', name: 'Switzerland' },
|
|
16
|
+
{ code: 'AT', name: 'Austria' },
|
|
17
|
+
{ code: 'SE', name: 'Sweden' },
|
|
18
|
+
{ code: 'NO', name: 'Norway' },
|
|
19
|
+
{ code: 'DK', name: 'Denmark' },
|
|
20
|
+
{ code: 'FI', name: 'Finland' },
|
|
21
|
+
{ code: 'PL', name: 'Poland' },
|
|
22
|
+
{ code: 'CZ', name: 'Czech Republic' },
|
|
23
|
+
{ code: 'IE', name: 'Ireland' },
|
|
24
|
+
{ code: 'PT', name: 'Portugal' },
|
|
25
|
+
{ code: 'GR', name: 'Greece' },
|
|
26
|
+
{ code: 'JP', name: 'Japan' },
|
|
27
|
+
{ code: 'KR', name: 'South Korea' },
|
|
28
|
+
{ code: 'IN', name: 'India' },
|
|
29
|
+
{ code: 'AU', name: 'Australia' },
|
|
30
|
+
{ code: 'NZ', name: 'New Zealand' },
|
|
31
|
+
{ code: 'SG', name: 'Singapore' },
|
|
32
|
+
{ code: 'HK', name: 'Hong Kong' },
|
|
33
|
+
{ code: 'TW', name: 'Taiwan' },
|
|
34
|
+
{ code: 'TH', name: 'Thailand' },
|
|
35
|
+
{ code: 'MY', name: 'Malaysia' },
|
|
36
|
+
{ code: 'ID', name: 'Indonesia' },
|
|
37
|
+
{ code: 'PH', name: 'Philippines' },
|
|
38
|
+
{ code: 'VN', name: 'Vietnam' },
|
|
39
|
+
{ code: 'BR', name: 'Brazil' },
|
|
40
|
+
{ code: 'MX', name: 'Mexico' },
|
|
41
|
+
{ code: 'AR', name: 'Argentina' },
|
|
42
|
+
{ code: 'CL', name: 'Chile' },
|
|
43
|
+
{ code: 'CO', name: 'Colombia' },
|
|
44
|
+
{ code: 'PE', name: 'Peru' },
|
|
45
|
+
{ code: 'ZA', name: 'South Africa' },
|
|
46
|
+
{ code: 'EG', name: 'Egypt' },
|
|
47
|
+
{ code: 'IL', name: 'Israel' },
|
|
48
|
+
{ code: 'AE', name: 'United Arab Emirates' },
|
|
49
|
+
{ code: 'SA', name: 'Saudi Arabia' },
|
|
50
|
+
{ code: 'TR', name: 'Turkey' },
|
|
51
|
+
{ code: 'RU', name: 'Russia' },
|
|
52
|
+
{ code: 'UA', name: 'Ukraine' },
|
|
53
|
+
];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PHONE_COUNTRIES = void 0;
|
|
3
|
+
exports.US_STATES = exports.COUNTRIES = exports.PHONE_COUNTRIES = void 0;
|
|
4
4
|
var phone_countries_1 = require("./phone-countries");
|
|
5
5
|
Object.defineProperty(exports, "PHONE_COUNTRIES", { enumerable: true, get: function () { return phone_countries_1.PHONE_COUNTRIES; } });
|
|
6
|
+
var countries_1 = require("./countries");
|
|
7
|
+
Object.defineProperty(exports, "COUNTRIES", { enumerable: true, get: function () { return countries_1.COUNTRIES; } });
|
|
8
|
+
var us_states_1 = require("./us-states");
|
|
9
|
+
Object.defineProperty(exports, "US_STATES", { enumerable: true, get: function () { return us_states_1.US_STATES; } });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.US_STATES = void 0;
|
|
4
|
+
exports.US_STATES = [
|
|
5
|
+
{ value: 'AL', label: 'Alabama' },
|
|
6
|
+
{ value: 'AK', label: 'Alaska' },
|
|
7
|
+
{ value: 'AZ', label: 'Arizona' },
|
|
8
|
+
{ value: 'AR', label: 'Arkansas' },
|
|
9
|
+
{ value: 'CA', label: 'California' },
|
|
10
|
+
{ value: 'CO', label: 'Colorado' },
|
|
11
|
+
{ value: 'CT', label: 'Connecticut' },
|
|
12
|
+
{ value: 'DE', label: 'Delaware' },
|
|
13
|
+
{ value: 'DC', label: 'District of Columbia' },
|
|
14
|
+
{ value: 'FL', label: 'Florida' },
|
|
15
|
+
{ value: 'GA', label: 'Georgia' },
|
|
16
|
+
{ value: 'HI', label: 'Hawaii' },
|
|
17
|
+
{ value: 'ID', label: 'Idaho' },
|
|
18
|
+
{ value: 'IL', label: 'Illinois' },
|
|
19
|
+
{ value: 'IN', label: 'Indiana' },
|
|
20
|
+
{ value: 'IA', label: 'Iowa' },
|
|
21
|
+
{ value: 'KS', label: 'Kansas' },
|
|
22
|
+
{ value: 'KY', label: 'Kentucky' },
|
|
23
|
+
{ value: 'LA', label: 'Louisiana' },
|
|
24
|
+
{ value: 'ME', label: 'Maine' },
|
|
25
|
+
{ value: 'MD', label: 'Maryland' },
|
|
26
|
+
{ value: 'MA', label: 'Massachusetts' },
|
|
27
|
+
{ value: 'MI', label: 'Michigan' },
|
|
28
|
+
{ value: 'MN', label: 'Minnesota' },
|
|
29
|
+
{ value: 'MS', label: 'Mississippi' },
|
|
30
|
+
{ value: 'MO', label: 'Missouri' },
|
|
31
|
+
{ value: 'MT', label: 'Montana' },
|
|
32
|
+
{ value: 'NE', label: 'Nebraska' },
|
|
33
|
+
{ value: 'NV', label: 'Nevada' },
|
|
34
|
+
{ value: 'NH', label: 'New Hampshire' },
|
|
35
|
+
{ value: 'NJ', label: 'New Jersey' },
|
|
36
|
+
{ value: 'NM', label: 'New Mexico' },
|
|
37
|
+
{ value: 'NY', label: 'New York' },
|
|
38
|
+
{ value: 'NC', label: 'North Carolina' },
|
|
39
|
+
{ value: 'ND', label: 'North Dakota' },
|
|
40
|
+
{ value: 'OH', label: 'Ohio' },
|
|
41
|
+
{ value: 'OK', label: 'Oklahoma' },
|
|
42
|
+
{ value: 'OR', label: 'Oregon' },
|
|
43
|
+
{ value: 'PA', label: 'Pennsylvania' },
|
|
44
|
+
{ value: 'RI', label: 'Rhode Island' },
|
|
45
|
+
{ value: 'SC', label: 'South Carolina' },
|
|
46
|
+
{ value: 'SD', label: 'South Dakota' },
|
|
47
|
+
{ value: 'TN', label: 'Tennessee' },
|
|
48
|
+
{ value: 'TX', label: 'Texas' },
|
|
49
|
+
{ value: 'UT', label: 'Utah' },
|
|
50
|
+
{ value: 'VT', label: 'Vermont' },
|
|
51
|
+
{ value: 'VA', label: 'Virginia' },
|
|
52
|
+
{ value: 'WA', label: 'Washington' },
|
|
53
|
+
{ value: 'WV', label: 'West Virginia' },
|
|
54
|
+
{ value: 'WI', label: 'Wisconsin' },
|
|
55
|
+
{ value: 'WY', label: 'Wyoming' },
|
|
56
|
+
];
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
'use client';
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
// Components
|
|
6
|
-
var alert_1 = require("./components/alert");
|
|
7
|
-
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return alert_1.Alert; } });
|
|
8
|
-
var avatar_1 = require("./components/avatar");
|
|
9
|
-
Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return avatar_1.Avatar; } });
|
|
10
|
-
var badge_1 = require("./components/badge");
|
|
11
|
-
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return badge_1.Badge; } });
|
|
12
|
-
var button_1 = require("./components/button");
|
|
13
|
-
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return button_1.Button; } });
|
|
14
|
-
Object.defineProperty(exports, "buttonVariants", { enumerable: true, get: function () { return button_1.buttonVariants; } });
|
|
15
|
-
var checkbox_1 = require("./components/checkbox");
|
|
16
|
-
Object.defineProperty(exports, "Checkbox", { enumerable: true, get: function () { return checkbox_1.Checkbox; } });
|
|
17
|
-
var chip_1 = require("./components/chip");
|
|
18
|
-
Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return chip_1.Chip; } });
|
|
19
|
-
Object.defineProperty(exports, "chipVariants", { enumerable: true, get: function () { return chip_1.chipVariants; } });
|
|
20
|
-
var message_1 = require("./components/message");
|
|
21
|
-
Object.defineProperty(exports, "MessageProvider", { enumerable: true, get: function () { return message_1.MessageProvider; } });
|
|
22
|
-
Object.defineProperty(exports, "message", { enumerable: true, get: function () { return message_1.message; } });
|
|
23
|
-
var pop_confirm_1 = require("./components/pop-confirm");
|
|
24
|
-
Object.defineProperty(exports, "PopConfirm", { enumerable: true, get: function () { return pop_confirm_1.PopConfirm; } });
|
|
25
|
-
var radio_button_group_1 = require("./components/radio-button-group");
|
|
26
|
-
Object.defineProperty(exports, "RadioButtonGroup", { enumerable: true, get: function () { return radio_button_group_1.RadioButtonGroup; } });
|
|
27
|
-
var radio_group_1 = require("./components/radio-group");
|
|
28
|
-
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return radio_group_1.RadioGroup; } });
|
|
29
|
-
Object.defineProperty(exports, "RadioGroupItem", { enumerable: true, get: function () { return radio_group_1.RadioGroupItem; } });
|
|
30
|
-
var slider_1 = require("./components/slider");
|
|
31
|
-
Object.defineProperty(exports, "Slider", { enumerable: true, get: function () { return slider_1.Slider; } });
|
|
32
|
-
var switch_1 = require("./components/switch");
|
|
33
|
-
Object.defineProperty(exports, "Switch", { enumerable: true, get: function () { return switch_1.Switch; } });
|
|
34
|
-
var tooltip_1 = require("./components/tooltip");
|
|
35
|
-
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return tooltip_1.Tooltip; } });
|
|
3
|
+
exports.renderInputIcon = exports.iconMap = exports.useStableId = exports.cn = void 0;
|
|
36
4
|
// Utilities
|
|
37
5
|
var utils_1 = require("./lib/utils");
|
|
38
6
|
Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
|
|
@@ -40,3 +8,4 @@ var use_stable_id_1 = require("./lib/use-stable-id");
|
|
|
40
8
|
Object.defineProperty(exports, "useStableId", { enumerable: true, get: function () { return use_stable_id_1.useStableId; } });
|
|
41
9
|
var icon_utils_1 = require("./lib/icon-utils");
|
|
42
10
|
Object.defineProperty(exports, "iconMap", { enumerable: true, get: function () { return icon_utils_1.iconMap; } });
|
|
11
|
+
Object.defineProperty(exports, "renderInputIcon", { enumerable: true, get: function () { return icon_utils_1.renderInputIcon; } });
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.iconMap = void 0;
|
|
3
|
+
exports.renderInputIcon = exports.iconMap = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
4
5
|
var icons_1 = require("../icons");
|
|
5
6
|
Object.defineProperty(exports, "iconMap", { enumerable: true, get: function () { return icons_1.iconMap; } });
|
|
7
|
+
const icons_2 = require("../icons");
|
|
8
|
+
/** Icon size scales with the shell size. sm→12px, md/lg→16px. */
|
|
9
|
+
const iconSizeForInputShell = {
|
|
10
|
+
sm: 'xs', // 12px
|
|
11
|
+
md: 'sm', // 16px
|
|
12
|
+
lg: 'sm', // 16px
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a kebab-case icon name to a pre-sized `<Icon>` element for use
|
|
16
|
+
* inside an input-shaped primitive. Returns `undefined` if the name is
|
|
17
|
+
* not provided or not found in the icon set.
|
|
18
|
+
*/
|
|
19
|
+
const renderInputIcon = (name, size) => {
|
|
20
|
+
if (!name)
|
|
21
|
+
return undefined;
|
|
22
|
+
const IconComp = icons_2.iconMap[name];
|
|
23
|
+
if (!IconComp)
|
|
24
|
+
return undefined;
|
|
25
|
+
return (0, react_1.createElement)(IconComp, { size: iconSizeForInputShell[size] });
|
|
26
|
+
};
|
|
27
|
+
exports.renderInputIcon = renderInputIcon;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const COUNTRIES = [
|
|
2
|
+
{ code: 'US', name: 'United States' },
|
|
3
|
+
{ code: 'CN', name: 'China' },
|
|
4
|
+
{ code: 'GB', name: 'United Kingdom' },
|
|
5
|
+
{ code: 'CA', name: 'Canada' },
|
|
6
|
+
{ code: 'DE', name: 'Germany' },
|
|
7
|
+
{ code: 'FR', name: 'France' },
|
|
8
|
+
{ code: 'IT', name: 'Italy' },
|
|
9
|
+
{ code: 'ES', name: 'Spain' },
|
|
10
|
+
{ code: 'NL', name: 'Netherlands' },
|
|
11
|
+
{ code: 'BE', name: 'Belgium' },
|
|
12
|
+
{ code: 'CH', name: 'Switzerland' },
|
|
13
|
+
{ code: 'AT', name: 'Austria' },
|
|
14
|
+
{ code: 'SE', name: 'Sweden' },
|
|
15
|
+
{ code: 'NO', name: 'Norway' },
|
|
16
|
+
{ code: 'DK', name: 'Denmark' },
|
|
17
|
+
{ code: 'FI', name: 'Finland' },
|
|
18
|
+
{ code: 'PL', name: 'Poland' },
|
|
19
|
+
{ code: 'CZ', name: 'Czech Republic' },
|
|
20
|
+
{ code: 'IE', name: 'Ireland' },
|
|
21
|
+
{ code: 'PT', name: 'Portugal' },
|
|
22
|
+
{ code: 'GR', name: 'Greece' },
|
|
23
|
+
{ code: 'JP', name: 'Japan' },
|
|
24
|
+
{ code: 'KR', name: 'South Korea' },
|
|
25
|
+
{ code: 'IN', name: 'India' },
|
|
26
|
+
{ code: 'AU', name: 'Australia' },
|
|
27
|
+
{ code: 'NZ', name: 'New Zealand' },
|
|
28
|
+
{ code: 'SG', name: 'Singapore' },
|
|
29
|
+
{ code: 'HK', name: 'Hong Kong' },
|
|
30
|
+
{ code: 'TW', name: 'Taiwan' },
|
|
31
|
+
{ code: 'TH', name: 'Thailand' },
|
|
32
|
+
{ code: 'MY', name: 'Malaysia' },
|
|
33
|
+
{ code: 'ID', name: 'Indonesia' },
|
|
34
|
+
{ code: 'PH', name: 'Philippines' },
|
|
35
|
+
{ code: 'VN', name: 'Vietnam' },
|
|
36
|
+
{ code: 'BR', name: 'Brazil' },
|
|
37
|
+
{ code: 'MX', name: 'Mexico' },
|
|
38
|
+
{ code: 'AR', name: 'Argentina' },
|
|
39
|
+
{ code: 'CL', name: 'Chile' },
|
|
40
|
+
{ code: 'CO', name: 'Colombia' },
|
|
41
|
+
{ code: 'PE', name: 'Peru' },
|
|
42
|
+
{ code: 'ZA', name: 'South Africa' },
|
|
43
|
+
{ code: 'EG', name: 'Egypt' },
|
|
44
|
+
{ code: 'IL', name: 'Israel' },
|
|
45
|
+
{ code: 'AE', name: 'United Arab Emirates' },
|
|
46
|
+
{ code: 'SA', name: 'Saudi Arabia' },
|
|
47
|
+
{ code: 'TR', name: 'Turkey' },
|
|
48
|
+
{ code: 'RU', name: 'Russia' },
|
|
49
|
+
{ code: 'UA', name: 'Ukraine' },
|
|
50
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const US_STATES = [
|
|
2
|
+
{ value: 'AL', label: 'Alabama' },
|
|
3
|
+
{ value: 'AK', label: 'Alaska' },
|
|
4
|
+
{ value: 'AZ', label: 'Arizona' },
|
|
5
|
+
{ value: 'AR', label: 'Arkansas' },
|
|
6
|
+
{ value: 'CA', label: 'California' },
|
|
7
|
+
{ value: 'CO', label: 'Colorado' },
|
|
8
|
+
{ value: 'CT', label: 'Connecticut' },
|
|
9
|
+
{ value: 'DE', label: 'Delaware' },
|
|
10
|
+
{ value: 'DC', label: 'District of Columbia' },
|
|
11
|
+
{ value: 'FL', label: 'Florida' },
|
|
12
|
+
{ value: 'GA', label: 'Georgia' },
|
|
13
|
+
{ value: 'HI', label: 'Hawaii' },
|
|
14
|
+
{ value: 'ID', label: 'Idaho' },
|
|
15
|
+
{ value: 'IL', label: 'Illinois' },
|
|
16
|
+
{ value: 'IN', label: 'Indiana' },
|
|
17
|
+
{ value: 'IA', label: 'Iowa' },
|
|
18
|
+
{ value: 'KS', label: 'Kansas' },
|
|
19
|
+
{ value: 'KY', label: 'Kentucky' },
|
|
20
|
+
{ value: 'LA', label: 'Louisiana' },
|
|
21
|
+
{ value: 'ME', label: 'Maine' },
|
|
22
|
+
{ value: 'MD', label: 'Maryland' },
|
|
23
|
+
{ value: 'MA', label: 'Massachusetts' },
|
|
24
|
+
{ value: 'MI', label: 'Michigan' },
|
|
25
|
+
{ value: 'MN', label: 'Minnesota' },
|
|
26
|
+
{ value: 'MS', label: 'Mississippi' },
|
|
27
|
+
{ value: 'MO', label: 'Missouri' },
|
|
28
|
+
{ value: 'MT', label: 'Montana' },
|
|
29
|
+
{ value: 'NE', label: 'Nebraska' },
|
|
30
|
+
{ value: 'NV', label: 'Nevada' },
|
|
31
|
+
{ value: 'NH', label: 'New Hampshire' },
|
|
32
|
+
{ value: 'NJ', label: 'New Jersey' },
|
|
33
|
+
{ value: 'NM', label: 'New Mexico' },
|
|
34
|
+
{ value: 'NY', label: 'New York' },
|
|
35
|
+
{ value: 'NC', label: 'North Carolina' },
|
|
36
|
+
{ value: 'ND', label: 'North Dakota' },
|
|
37
|
+
{ value: 'OH', label: 'Ohio' },
|
|
38
|
+
{ value: 'OK', label: 'Oklahoma' },
|
|
39
|
+
{ value: 'OR', label: 'Oregon' },
|
|
40
|
+
{ value: 'PA', label: 'Pennsylvania' },
|
|
41
|
+
{ value: 'RI', label: 'Rhode Island' },
|
|
42
|
+
{ value: 'SC', label: 'South Carolina' },
|
|
43
|
+
{ value: 'SD', label: 'South Dakota' },
|
|
44
|
+
{ value: 'TN', label: 'Tennessee' },
|
|
45
|
+
{ value: 'TX', label: 'Texas' },
|
|
46
|
+
{ value: 'UT', label: 'Utah' },
|
|
47
|
+
{ value: 'VT', label: 'Vermont' },
|
|
48
|
+
{ value: 'VA', label: 'Virginia' },
|
|
49
|
+
{ value: 'WA', label: 'Washington' },
|
|
50
|
+
{ value: 'WV', label: 'West Virginia' },
|
|
51
|
+
{ value: 'WI', label: 'Wisconsin' },
|
|
52
|
+
{ value: 'WY', label: 'Wyoming' },
|
|
53
|
+
];
|
package/dist/esm/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
// Components
|
|
3
|
-
export { Alert } from './components/alert';
|
|
4
|
-
export { Avatar } from './components/avatar';
|
|
5
|
-
export { Badge } from './components/badge';
|
|
6
|
-
export { Button, buttonVariants } from './components/button';
|
|
7
|
-
export { Checkbox } from './components/checkbox';
|
|
8
|
-
export { Chip, chipVariants } from './components/chip';
|
|
9
|
-
export { MessageProvider, message } from './components/message';
|
|
10
|
-
export { PopConfirm } from './components/pop-confirm';
|
|
11
|
-
export { RadioButtonGroup } from './components/radio-button-group';
|
|
12
|
-
export { RadioGroup, RadioGroupItem } from './components/radio-group';
|
|
13
|
-
export { Slider } from './components/slider';
|
|
14
|
-
export { Switch } from './components/switch';
|
|
15
|
-
export { Tooltip } from './components/tooltip';
|
|
16
1
|
// Utilities
|
|
17
2
|
export { cn } from './lib/utils';
|
|
18
3
|
export { useStableId } from './lib/use-stable-id';
|
|
19
|
-
export { iconMap } from './lib/icon-utils';
|
|
4
|
+
export { iconMap, renderInputIcon } from './lib/icon-utils';
|
|
@@ -1 +1,22 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
1
2
|
export { iconMap } from '../icons';
|
|
3
|
+
import { iconMap } from '../icons';
|
|
4
|
+
/** Icon size scales with the shell size. sm→12px, md/lg→16px. */
|
|
5
|
+
const iconSizeForInputShell = {
|
|
6
|
+
sm: 'xs', // 12px
|
|
7
|
+
md: 'sm', // 16px
|
|
8
|
+
lg: 'sm', // 16px
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a kebab-case icon name to a pre-sized `<Icon>` element for use
|
|
12
|
+
* inside an input-shaped primitive. Returns `undefined` if the name is
|
|
13
|
+
* not provided or not found in the icon set.
|
|
14
|
+
*/
|
|
15
|
+
export const renderInputIcon = (name, size) => {
|
|
16
|
+
if (!name)
|
|
17
|
+
return undefined;
|
|
18
|
+
const IconComp = iconMap[name];
|
|
19
|
+
if (!IconComp)
|
|
20
|
+
return undefined;
|
|
21
|
+
return createElement(IconComp, { size: iconSizeForInputShell[size] });
|
|
22
|
+
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { PHONE_COUNTRIES } from './phone-countries';
|
|
2
2
|
export type { PhoneCountry } from './phone-countries';
|
|
3
|
+
export { COUNTRIES } from './countries';
|
|
4
|
+
export type { Country } from './countries';
|
|
5
|
+
export { US_STATES } from './us-states';
|
|
6
|
+
export type { USState } from './us-states';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
export { Alert } from './components/alert';
|
|
2
|
-
export { Avatar } from './components/avatar';
|
|
3
|
-
export { Badge } from './components/badge';
|
|
4
|
-
export { Button, buttonVariants } from './components/button';
|
|
5
|
-
export { Checkbox } from './components/checkbox';
|
|
6
|
-
export { Chip, chipVariants } from './components/chip';
|
|
7
|
-
export { MessageProvider, message } from './components/message';
|
|
8
|
-
export { PopConfirm } from './components/pop-confirm';
|
|
9
|
-
export { RadioButtonGroup } from './components/radio-button-group';
|
|
10
|
-
export { RadioGroup, RadioGroupItem } from './components/radio-group';
|
|
11
|
-
export { Slider } from './components/slider';
|
|
12
|
-
export { Switch } from './components/switch';
|
|
13
|
-
export { Tooltip } from './components/tooltip';
|
|
14
|
-
export type { IconName } from './lib/icon-utils';
|
|
15
|
-
export type { ButtonVariant, ButtonSize, ButtonProps } from './components/button';
|
|
16
|
-
export type { BadgeStatus, BadgeSize, BadgeVariant, BadgePosition, BadgeProps } from './components/badge';
|
|
17
|
-
export type { CheckboxProps } from './components/checkbox';
|
|
18
|
-
export type { ChipVariant, ChipProps } from './components/chip';
|
|
19
|
-
export type { PopConfirmProps } from './components/pop-confirm';
|
|
20
|
-
export type { RadioButtonGroupOption, RadioButtonGroupProps } from './components/radio-button-group';
|
|
21
|
-
export type { SliderProps } from './components/slider';
|
|
22
|
-
export type { SwitchProps } from './components/switch';
|
|
23
|
-
export type { TooltipPlacement, TooltipProps } from './components/tooltip';
|
|
24
1
|
export { cn } from './lib/utils';
|
|
25
2
|
export { useStableId } from './lib/use-stable-id';
|
|
26
|
-
export { iconMap } from './lib/icon-utils';
|
|
3
|
+
export { iconMap, renderInputIcon } from './lib/icon-utils';
|
|
4
|
+
export type { IconName, InputShellSize } from './lib/icon-utils';
|
|
@@ -1 +1,13 @@
|
|
|
1
1
|
export { type IconName, iconMap } from '../icons';
|
|
2
|
+
import { type IconName } from '../icons';
|
|
3
|
+
/**
|
|
4
|
+
* Size of an input-shaped primitive (Input, ComboboxTrigger, DatePickerTrigger, ...).
|
|
5
|
+
* Icons inside these shells scale with this size.
|
|
6
|
+
*/
|
|
7
|
+
export type InputShellSize = 'sm' | 'md' | 'lg';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a kebab-case icon name to a pre-sized `<Icon>` element for use
|
|
10
|
+
* inside an input-shaped primitive. Returns `undefined` if the name is
|
|
11
|
+
* not provided or not found in the icon set.
|
|
12
|
+
*/
|
|
13
|
+
export declare const renderInputIcon: (name: IconName | undefined, size: InputShellSize) => import("react").FunctionComponentElement<Omit<import("../icons").IconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>> | undefined;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freightos/freightwind",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "FreightWind Design System —
|
|
5
|
+
"description": "FreightWind Design System — icons, constants, and utilities for Freightos applications",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
8
8
|
"types": "./dist/types/index.d.ts",
|
|
@@ -27,8 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"typesVersions": {
|
|
29
29
|
"*": {
|
|
30
|
-
"icons": [
|
|
31
|
-
|
|
30
|
+
"icons": [
|
|
31
|
+
"./dist/types/icons/index.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"constants": [
|
|
34
|
+
"./dist/types/constants/index.d.ts"
|
|
35
|
+
]
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
"files": [
|
|
@@ -92,17 +96,7 @@
|
|
|
92
96
|
}
|
|
93
97
|
},
|
|
94
98
|
"dependencies": {
|
|
95
|
-
"@radix-ui/react-avatar": "^1.1.11",
|
|
96
|
-
"@radix-ui/react-checkbox": "^1.3.3",
|
|
97
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
98
|
-
"@radix-ui/react-radio-group": "^1.3.8",
|
|
99
|
-
"@radix-ui/react-slider": "^1.3.6",
|
|
100
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
101
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
102
|
-
"class-variance-authority": "^0.7.1",
|
|
103
99
|
"clsx": "^2.1.1",
|
|
104
|
-
"motion": "^12.35.1",
|
|
105
|
-
"sonner": "^2.0.7",
|
|
106
100
|
"tailwind-merge": "^3.4.0"
|
|
107
101
|
}
|
|
108
102
|
}
|