@ecohouse/ui 0.1.0 → 0.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/README.md +238 -36
- package/dist/index.cjs +649 -314
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +181 -258
- package/dist/index.d.ts +181 -258
- package/dist/index.js +626 -304
- package/dist/index.js.map +1 -1
- package/package.json +4 -7
- package/src/components/Button/Button.stories.tsx +98 -0
- package/src/components/{Button.tsx → Button/Button.tsx} +39 -71
- package/src/components/Button/index.ts +2 -0
- package/src/components/Input/Input.stories.tsx +118 -0
- package/src/components/Input/Input.tsx +327 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/index.ts +5 -0
- package/src/icons/{ArrowUpRightIcon.tsx → ArrowRight/ArrowRightIcon.tsx} +8 -7
- package/src/icons/{ArrowUpRightIcon.web.tsx → ArrowRight/ArrowRightIcon.web.tsx} +8 -7
- package/src/icons/ArrowRight/arrowRightPath.ts +2 -0
- package/src/icons/ArrowRight/index.ts +1 -0
- package/src/icons/Bag/BagIcon.tsx +20 -0
- package/src/icons/Bag/BagIcon.web.tsx +26 -0
- package/src/icons/Bag/bagPath.ts +2 -0
- package/src/icons/Bag/index.ts +1 -0
- package/src/icons/Bell/BellIcon.tsx +20 -0
- package/src/icons/Bell/BellIcon.web.tsx +26 -0
- package/src/icons/Bell/bellPath.ts +2 -0
- package/src/icons/Bell/index.ts +1 -0
- package/src/icons/Building/BuildingIcon.tsx +20 -0
- package/src/icons/Building/BuildingIcon.web.tsx +26 -0
- package/src/icons/Building/buildingPath.ts +2 -0
- package/src/icons/Building/index.ts +1 -0
- package/src/icons/Camera/CameraIcon.tsx +20 -0
- package/src/icons/Camera/CameraIcon.web.tsx +26 -0
- package/src/icons/Camera/cameraPath.ts +2 -0
- package/src/icons/Camera/index.ts +1 -0
- package/src/icons/CheckBadge/CheckBadgeIcon.tsx +20 -0
- package/src/icons/CheckBadge/CheckBadgeIcon.web.tsx +26 -0
- package/src/icons/CheckBadge/checkBadgePath.ts +2 -0
- package/src/icons/CheckBadge/index.ts +1 -0
- package/src/icons/Clock/ClockIcon.tsx +20 -0
- package/src/icons/Clock/ClockIcon.web.tsx +26 -0
- package/src/icons/Clock/clockPath.ts +2 -0
- package/src/icons/Clock/index.ts +1 -0
- package/src/icons/Facebook/FacebookIcon.tsx +14 -0
- package/src/icons/Facebook/FacebookIcon.web.tsx +20 -0
- package/src/icons/Facebook/facebookPath.ts +2 -0
- package/src/icons/Facebook/index.ts +1 -0
- package/src/icons/Home/HomeIcon.tsx +20 -0
- package/src/icons/Home/HomeIcon.web.tsx +26 -0
- package/src/icons/Home/homePath.ts +2 -0
- package/src/icons/Home/index.ts +1 -0
- package/src/icons/Icon.tsx +11 -0
- package/src/icons/Icons.stories.tsx +174 -0
- package/src/icons/Instagram/InstagramIcon.tsx +14 -0
- package/src/icons/Instagram/InstagramIcon.web.tsx +20 -0
- package/src/icons/Instagram/index.ts +1 -0
- package/src/icons/Instagram/instagramPath.ts +2 -0
- package/src/icons/Key/KeyIcon.tsx +20 -0
- package/src/icons/Key/KeyIcon.web.tsx +26 -0
- package/src/icons/Key/index.ts +1 -0
- package/src/icons/Key/keyPath.ts +2 -0
- package/src/icons/LinkedIn/LinkedInIcon.tsx +14 -0
- package/src/icons/LinkedIn/LinkedInIcon.web.tsx +20 -0
- package/src/icons/LinkedIn/index.ts +1 -0
- package/src/icons/LinkedIn/linkedinPath.ts +2 -0
- package/src/icons/Mail/MailIcon.tsx +20 -0
- package/src/icons/Mail/MailIcon.web.tsx +26 -0
- package/src/icons/Mail/index.ts +1 -0
- package/src/icons/Mail/mailPath.ts +2 -0
- package/src/icons/Navigate/NavigateIcon.tsx +20 -0
- package/src/icons/Navigate/NavigateIcon.web.tsx +26 -0
- package/src/icons/Navigate/index.ts +1 -0
- package/src/icons/Navigate/navigatePath.ts +2 -0
- package/src/icons/Phone/PhoneIcon.tsx +20 -0
- package/src/icons/Phone/PhoneIcon.web.tsx +26 -0
- package/src/icons/Phone/index.ts +1 -0
- package/src/icons/Phone/phonePath.ts +2 -0
- package/src/icons/Show/ShowIcon.tsx +33 -0
- package/src/icons/Show/ShowIcon.web.tsx +39 -0
- package/src/icons/Show/index.ts +1 -0
- package/src/icons/Show/showPath.ts +6 -0
- package/src/icons/User/UserIcon.tsx +26 -0
- package/src/icons/User/UserIcon.web.tsx +32 -0
- package/src/icons/User/index.ts +1 -0
- package/src/icons/User/userPath.ts +3 -0
- package/src/icons/index.ts +24 -0
- package/src/icons/registry.ts +58 -0
- package/src/icons/types.ts +9 -0
- package/src/index.ts +37 -21
- package/src/theme/colors.test.ts +12 -0
- package/src/theme/colors.ts +46 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/typography.ts +46 -0
- package/src/web/styles/typography.css +8 -90
- package/src/components/Button.stories.tsx +0 -135
- package/src/icons/arrowUpRightPath.ts +0 -1
- package/src/theme/tokens.test.ts +0 -10
- package/src/theme/tokens.ts +0 -286
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MAIL_PATH } from "./mailPath";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
|
|
5
|
+
export function MailIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: IconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
viewBox="0 0 20 20"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
aria-hidden
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d={MAIL_PATH}
|
|
17
|
+
stroke={color}
|
|
18
|
+
strokeWidth={strokeWidth}
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { MAIL_PATH } from "./mailPath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MailIcon, MAIL_PATH } from "./MailIcon";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const MAIL_PATH =
|
|
2
|
+
"M3.33333 4.99984L8.42303 8.84339L8.42473 8.8448C8.98987 9.25924 9.27261 9.46658 9.5823 9.54668C9.85602 9.61748 10.1438 9.61748 10.4175 9.54668C10.7274 9.46651 11.011 9.25856 11.5771 8.84339C11.5771 8.84339 14.8417 6.33812 16.6667 4.99984M2.5 13.1667V6.83333C2.5 5.89991 2.5 5.43285 2.68166 5.07633C2.84144 4.76273 3.09623 4.50795 3.40983 4.34816C3.76635 4.1665 4.23341 4.1665 5.16683 4.1665H14.8335C15.7669 4.1665 16.233 4.1665 16.5895 4.34816C16.9031 4.50795 17.1587 4.76273 17.3185 5.07633C17.5 5.43251 17.5 5.899 17.5 6.8306V13.1695C17.5 14.1011 17.5 14.5669 17.3185 14.9231C17.1587 15.2367 16.9031 15.4919 16.5895 15.6517C16.2333 15.8332 15.7675 15.8332 14.8359 15.8332H5.16409C4.23249 15.8332 3.766 15.8332 3.40983 15.6517C3.09623 15.4919 2.84144 15.2367 2.68166 14.9231C2.5 14.5666 2.5 14.1001 2.5 13.1667Z";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { NAVIGATE_PATH } from "./navigatePath";
|
|
3
|
+
import { colors } from "../../theme";
|
|
4
|
+
import type { IconProps } from "../types";
|
|
5
|
+
|
|
6
|
+
export { NAVIGATE_PATH } from "./navigatePath";
|
|
7
|
+
|
|
8
|
+
export function NavigateIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
|
|
11
|
+
<Path
|
|
12
|
+
d={NAVIGATE_PATH}
|
|
13
|
+
stroke={color}
|
|
14
|
+
strokeWidth={strokeWidth}
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</Svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NAVIGATE_PATH } from "./navigatePath";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
|
|
5
|
+
export function NavigateIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: IconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
viewBox="0 0 20 20"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
aria-hidden
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d={NAVIGATE_PATH}
|
|
17
|
+
stroke={color}
|
|
18
|
+
strokeWidth={strokeWidth}
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { NAVIGATE_PATH } from "./navigatePath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigateIcon, NAVIGATE_PATH } from "./NavigateIcon";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { PHONE_PATH } from "./phonePath";
|
|
3
|
+
import { colors } from "../../theme";
|
|
4
|
+
import type { IconProps } from "../types";
|
|
5
|
+
|
|
6
|
+
export { PHONE_PATH } from "./phonePath";
|
|
7
|
+
|
|
8
|
+
export function PhoneIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
|
|
11
|
+
<Path
|
|
12
|
+
d={PHONE_PATH}
|
|
13
|
+
stroke={color}
|
|
14
|
+
strokeWidth={strokeWidth}
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</Svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PHONE_PATH } from "./phonePath";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
|
|
5
|
+
export function PhoneIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: IconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
viewBox="0 0 20 20"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
aria-hidden
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d={PHONE_PATH}
|
|
17
|
+
stroke={color}
|
|
18
|
+
strokeWidth={strokeWidth}
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { PHONE_PATH } from "./phonePath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PhoneIcon, PHONE_PATH } from "./PhoneIcon";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const PHONE_PATH =
|
|
2
|
+
"M7.91872 3.54768C7.66561 2.91492 7.05276 2.5 6.37126 2.5H4.07895C3.20692 2.5 2.5 3.20675 2.5 4.07878C2.5 11.491 8.50898 17.5 15.9212 17.5C16.7933 17.5 17.5 16.793 17.5 15.921L17.5004 13.6283C17.5004 12.9468 17.0856 12.334 16.4528 12.0809L14.2558 11.2024C13.6874 10.9751 13.0402 11.0774 12.57 11.4693L12.0029 11.9422C11.3407 12.4941 10.3664 12.4502 9.75683 11.8407L8.16018 10.2425C7.55066 9.63302 7.50561 8.65945 8.05745 7.99724L8.53027 7.43025C8.92218 6.95996 9.02541 6.31263 8.79805 5.74424L7.91872 3.54768Z";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { SHOW_PATH, SHOW_PUPIL_PATH } from "./showPath";
|
|
3
|
+
import { colors } from "../../theme";
|
|
4
|
+
|
|
5
|
+
export { SHOW_PATH, SHOW_PUPIL_PATH } from "./showPath";
|
|
6
|
+
|
|
7
|
+
interface ShowIconProps {
|
|
8
|
+
size?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Native — react-native-svg (peer dependency). */
|
|
14
|
+
export function ShowIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: ShowIconProps) {
|
|
15
|
+
return (
|
|
16
|
+
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
|
|
17
|
+
<Path
|
|
18
|
+
d={SHOW_PATH}
|
|
19
|
+
stroke={color}
|
|
20
|
+
strokeWidth={strokeWidth}
|
|
21
|
+
strokeLinecap="round"
|
|
22
|
+
strokeLinejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
<Path
|
|
25
|
+
d={SHOW_PUPIL_PATH}
|
|
26
|
+
stroke={color}
|
|
27
|
+
strokeWidth={strokeWidth}
|
|
28
|
+
strokeLinecap="round"
|
|
29
|
+
strokeLinejoin="round"
|
|
30
|
+
/>
|
|
31
|
+
</Svg>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SHOW_PATH, SHOW_PUPIL_PATH } from "./showPath";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
|
|
4
|
+
interface ShowIconProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Web / Storybook — plain SVG (no react-native-svg). */
|
|
11
|
+
export function ShowIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: ShowIconProps) {
|
|
12
|
+
return (
|
|
13
|
+
<svg
|
|
14
|
+
width={size}
|
|
15
|
+
height={size}
|
|
16
|
+
viewBox="0 0 20 20"
|
|
17
|
+
fill="none"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
aria-hidden
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d={SHOW_PATH}
|
|
23
|
+
stroke={color}
|
|
24
|
+
strokeWidth={strokeWidth}
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d={SHOW_PUPIL_PATH}
|
|
30
|
+
stroke={color}
|
|
31
|
+
strokeWidth={strokeWidth}
|
|
32
|
+
strokeLinecap="round"
|
|
33
|
+
strokeLinejoin="round"
|
|
34
|
+
/>
|
|
35
|
+
</svg>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { SHOW_PATH, SHOW_PUPIL_PATH } from "./showPath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ShowIcon, SHOW_PATH, SHOW_PUPIL_PATH } from "./ShowIcon";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Show (eye) icon path — 20×20 viewBox. */
|
|
2
|
+
export const SHOW_PATH =
|
|
3
|
+
"M1.66669 10C1.66669 10 4.16669 4.16667 10 4.16667C15.8334 4.16667 18.3334 10 18.3334 10C18.3334 10 15.8334 15.8333 10 15.8333C4.16669 15.8333 1.66669 10 1.66669 10Z";
|
|
4
|
+
|
|
5
|
+
export const SHOW_PUPIL_PATH =
|
|
6
|
+
"M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { USER_PATH } from "./userPath";
|
|
3
|
+
import { colors } from "../../theme";
|
|
4
|
+
|
|
5
|
+
export { USER_PATH } from "./userPath";
|
|
6
|
+
|
|
7
|
+
interface UserIconProps {
|
|
8
|
+
size?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Native — react-native-svg (peer dependency). */
|
|
14
|
+
export function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: UserIconProps) {
|
|
15
|
+
return (
|
|
16
|
+
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
|
|
17
|
+
<Path
|
|
18
|
+
d={USER_PATH}
|
|
19
|
+
stroke={color}
|
|
20
|
+
strokeWidth={strokeWidth}
|
|
21
|
+
strokeLinecap="round"
|
|
22
|
+
strokeLinejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
</Svg>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { USER_PATH } from "./userPath";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
|
|
4
|
+
interface UserIconProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Web / Storybook — plain SVG (no react-native-svg). */
|
|
11
|
+
export function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }: UserIconProps) {
|
|
12
|
+
return (
|
|
13
|
+
<svg
|
|
14
|
+
width={size}
|
|
15
|
+
height={size}
|
|
16
|
+
viewBox="0 0 20 20"
|
|
17
|
+
fill="none"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
aria-hidden
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d={USER_PATH}
|
|
23
|
+
stroke={color}
|
|
24
|
+
strokeWidth={strokeWidth}
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { USER_PATH } from "./userPath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserIcon, USER_PATH } from "./UserIcon";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** User icon path — 20×20 viewBox. */
|
|
2
|
+
export const USER_PATH =
|
|
3
|
+
"M15.8334 17.5C15.8334 14.2783 13.2217 11.6667 10 11.6667C6.77836 11.6667 4.16669 14.2783 4.16669 17.5M10 9.16667C8.15907 9.16667 6.66669 7.67428 6.66669 5.83333C6.66669 3.99238 8.15907 2.5 10 2.5C11.841 2.5 13.3334 3.99238 13.3334 5.83333C13.3334 7.67428 11.841 9.16667 10 9.16667Z";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type { IconProps, IconComponent } from "./types";
|
|
2
|
+
export type { IconName, IconGroup } from "./registry";
|
|
3
|
+
export type { IconByNameProps } from "./Icon";
|
|
4
|
+
|
|
5
|
+
export { icons, iconNames, iconGroups, iconGroupNames, getIconsByGroup } from "./registry";
|
|
6
|
+
export { Icon } from "./Icon";
|
|
7
|
+
|
|
8
|
+
export { ArrowRightIcon } from "./ArrowRight";
|
|
9
|
+
export { BagIcon } from "./Bag";
|
|
10
|
+
export { BellIcon } from "./Bell";
|
|
11
|
+
export { BuildingIcon } from "./Building";
|
|
12
|
+
export { CameraIcon } from "./Camera";
|
|
13
|
+
export { CheckBadgeIcon } from "./CheckBadge";
|
|
14
|
+
export { ClockIcon } from "./Clock";
|
|
15
|
+
export { FacebookIcon } from "./Facebook";
|
|
16
|
+
export { HomeIcon } from "./Home";
|
|
17
|
+
export { InstagramIcon } from "./Instagram";
|
|
18
|
+
export { KeyIcon } from "./Key";
|
|
19
|
+
export { LinkedInIcon } from "./LinkedIn";
|
|
20
|
+
export { MailIcon } from "./Mail";
|
|
21
|
+
export { NavigateIcon } from "./Navigate";
|
|
22
|
+
export { PhoneIcon } from "./Phone";
|
|
23
|
+
export { ShowIcon } from "./Show";
|
|
24
|
+
export { UserIcon } from "./User";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ArrowRightIcon } from "./ArrowRight";
|
|
2
|
+
import { BagIcon } from "./Bag";
|
|
3
|
+
import { BellIcon } from "./Bell";
|
|
4
|
+
import { BuildingIcon } from "./Building";
|
|
5
|
+
import { CameraIcon } from "./Camera";
|
|
6
|
+
import { CheckBadgeIcon } from "./CheckBadge";
|
|
7
|
+
import { ClockIcon } from "./Clock";
|
|
8
|
+
import { FacebookIcon } from "./Facebook";
|
|
9
|
+
import { HomeIcon } from "./Home";
|
|
10
|
+
import { InstagramIcon } from "./Instagram";
|
|
11
|
+
import { KeyIcon } from "./Key";
|
|
12
|
+
import { LinkedInIcon } from "./LinkedIn";
|
|
13
|
+
import { MailIcon } from "./Mail";
|
|
14
|
+
import { NavigateIcon } from "./Navigate";
|
|
15
|
+
import { PhoneIcon } from "./Phone";
|
|
16
|
+
import { ShowIcon } from "./Show";
|
|
17
|
+
import { UserIcon } from "./User";
|
|
18
|
+
import type { IconComponent } from "./types";
|
|
19
|
+
|
|
20
|
+
export const icons = {
|
|
21
|
+
arrowRight: ArrowRightIcon,
|
|
22
|
+
bag: BagIcon,
|
|
23
|
+
bell: BellIcon,
|
|
24
|
+
building: BuildingIcon,
|
|
25
|
+
camera: CameraIcon,
|
|
26
|
+
checkBadge: CheckBadgeIcon,
|
|
27
|
+
clock: ClockIcon,
|
|
28
|
+
facebook: FacebookIcon,
|
|
29
|
+
home: HomeIcon,
|
|
30
|
+
instagram: InstagramIcon,
|
|
31
|
+
key: KeyIcon,
|
|
32
|
+
linkedin: LinkedInIcon,
|
|
33
|
+
mail: MailIcon,
|
|
34
|
+
navigate: NavigateIcon,
|
|
35
|
+
phone: PhoneIcon,
|
|
36
|
+
show: ShowIcon,
|
|
37
|
+
user: UserIcon,
|
|
38
|
+
} as const satisfies Record<string, IconComponent>;
|
|
39
|
+
|
|
40
|
+
export type IconName = keyof typeof icons;
|
|
41
|
+
|
|
42
|
+
export const iconNames = Object.keys(icons) as IconName[];
|
|
43
|
+
|
|
44
|
+
export const iconGroups = {
|
|
45
|
+
navigation: ["arrowRight", "home", "navigate"],
|
|
46
|
+
actions: ["show", "bell", "camera", "key", "checkBadge"],
|
|
47
|
+
objects: ["bag", "building", "clock", "user"],
|
|
48
|
+
communication: ["mail", "phone"],
|
|
49
|
+
social: ["facebook", "instagram", "linkedin"],
|
|
50
|
+
} as const satisfies Record<string, readonly IconName[]>;
|
|
51
|
+
|
|
52
|
+
export type IconGroup = keyof typeof iconGroups;
|
|
53
|
+
|
|
54
|
+
export const iconGroupNames = Object.keys(iconGroups) as IconGroup[];
|
|
55
|
+
|
|
56
|
+
export function getIconsByGroup(group: IconGroup): IconName[] {
|
|
57
|
+
return [...iconGroups[group]];
|
|
58
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
export { Button } from "./components
|
|
2
|
-
export type {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export { Button, Input } from "./components";
|
|
2
|
+
export type {
|
|
3
|
+
ButtonProps,
|
|
4
|
+
ButtonSize,
|
|
5
|
+
ButtonVariant,
|
|
6
|
+
InputProps,
|
|
7
|
+
InputSize,
|
|
8
|
+
InputState,
|
|
9
|
+
} from "./components";
|
|
5
10
|
|
|
6
11
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
Icon,
|
|
13
|
+
icons,
|
|
14
|
+
iconNames,
|
|
15
|
+
iconGroups,
|
|
16
|
+
iconGroupNames,
|
|
17
|
+
getIconsByGroup,
|
|
18
|
+
ArrowRightIcon,
|
|
19
|
+
BagIcon,
|
|
20
|
+
BellIcon,
|
|
21
|
+
BuildingIcon,
|
|
22
|
+
CameraIcon,
|
|
23
|
+
CheckBadgeIcon,
|
|
24
|
+
ClockIcon,
|
|
25
|
+
FacebookIcon,
|
|
26
|
+
HomeIcon,
|
|
27
|
+
InstagramIcon,
|
|
28
|
+
KeyIcon,
|
|
29
|
+
LinkedInIcon,
|
|
30
|
+
MailIcon,
|
|
31
|
+
NavigateIcon,
|
|
32
|
+
PhoneIcon,
|
|
33
|
+
ShowIcon,
|
|
34
|
+
UserIcon,
|
|
35
|
+
} from "./icons";
|
|
36
|
+
export type { IconProps, IconName, IconGroup, IconComponent, IconByNameProps } from "./icons";
|
|
37
|
+
|
|
38
|
+
export { colors, grey, buttonTypography, inputTypography, fonts } from "./theme";
|
|
39
|
+
export type { GreyStep } from "./theme";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { colors } from "./colors";
|
|
3
|
+
import { buttonTypography } from "./typography";
|
|
4
|
+
|
|
5
|
+
describe("design tokens", () => {
|
|
6
|
+
it("exposes primary and button typography used by Button", () => {
|
|
7
|
+
expect(colors.primary).toBe("#B46436");
|
|
8
|
+
expect(colors.dark).toBe("#090909");
|
|
9
|
+
expect(buttonTypography.lg.fontSize).toBe(14);
|
|
10
|
+
expect(buttonTypography.lg.fontWeight).toBe("600");
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const grey = {
|
|
2
|
+
"0": "#767676",
|
|
3
|
+
"0.5": "#6E6E6E",
|
|
4
|
+
"1": "#666666",
|
|
5
|
+
"1.5": "#5E5E5E",
|
|
6
|
+
"2": "#565656",
|
|
7
|
+
"3": "#474747",
|
|
8
|
+
"4": "#373737",
|
|
9
|
+
"5": "#272727",
|
|
10
|
+
"6": "#1F1F1F",
|
|
11
|
+
"7": "#171717",
|
|
12
|
+
"7.5": "#161616",
|
|
13
|
+
"8": "#101010",
|
|
14
|
+
"8.5": "#0C0C0C",
|
|
15
|
+
"9": "#080808",
|
|
16
|
+
"9.5": "#040404",
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export type GreyStep = keyof typeof grey;
|
|
20
|
+
|
|
21
|
+
export const colors = {
|
|
22
|
+
primary: "#B46436",
|
|
23
|
+
black: "#000000",
|
|
24
|
+
white: "#ffffff",
|
|
25
|
+
dark: "#090909",
|
|
26
|
+
red: "#A63E3E",
|
|
27
|
+
lightGrey: "#B7B7B7",
|
|
28
|
+
primaryMuted: "#B464360F",
|
|
29
|
+
redMuted: "#A63E3E0F",
|
|
30
|
+
|
|
31
|
+
grey0: grey["0"],
|
|
32
|
+
grey50: grey["0.5"],
|
|
33
|
+
grey100: grey["1"],
|
|
34
|
+
grey150: grey["1.5"],
|
|
35
|
+
grey200: grey["2"],
|
|
36
|
+
grey300: grey["3"],
|
|
37
|
+
grey400: grey["4"],
|
|
38
|
+
grey500: grey["5"],
|
|
39
|
+
grey600: grey["6"],
|
|
40
|
+
grey700: grey["7"],
|
|
41
|
+
grey750: grey["7.5"],
|
|
42
|
+
grey800: grey["8"],
|
|
43
|
+
grey850: grey["8.5"],
|
|
44
|
+
grey900: grey["9"],
|
|
45
|
+
grey950: grey["9.5"],
|
|
46
|
+
} as const;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const fonts = {
|
|
2
|
+
sans: "Noto Sans Armenian",
|
|
3
|
+
} as const;
|
|
4
|
+
|
|
5
|
+
/** Button label — SemiBold, line-height 100%, letter-spacing 3%. */
|
|
6
|
+
export const buttonTypography = {
|
|
7
|
+
lg: {
|
|
8
|
+
fontFamily: fonts.sans,
|
|
9
|
+
fontSize: 14,
|
|
10
|
+
fontWeight: "600" as const,
|
|
11
|
+
lineHeight: 14,
|
|
12
|
+
letterSpacing: 0.42,
|
|
13
|
+
},
|
|
14
|
+
sm: {
|
|
15
|
+
fontFamily: fonts.sans,
|
|
16
|
+
fontSize: 12,
|
|
17
|
+
fontWeight: "600" as const,
|
|
18
|
+
lineHeight: 12,
|
|
19
|
+
letterSpacing: 0.36,
|
|
20
|
+
},
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
/** Input label / field / hint typography. */
|
|
24
|
+
export const inputTypography = {
|
|
25
|
+
label: {
|
|
26
|
+
fontFamily: fonts.sans,
|
|
27
|
+
fontSize: 12,
|
|
28
|
+
fontWeight: "500" as const,
|
|
29
|
+
lineHeight: 16,
|
|
30
|
+
letterSpacing: 0,
|
|
31
|
+
},
|
|
32
|
+
field: {
|
|
33
|
+
fontFamily: fonts.sans,
|
|
34
|
+
fontSize: 14,
|
|
35
|
+
fontWeight: "400" as const,
|
|
36
|
+
lineHeight: 19,
|
|
37
|
+
letterSpacing: 0,
|
|
38
|
+
},
|
|
39
|
+
hint: {
|
|
40
|
+
fontFamily: fonts.sans,
|
|
41
|
+
fontSize: 12,
|
|
42
|
+
fontWeight: "400" as const,
|
|
43
|
+
lineHeight: 16,
|
|
44
|
+
letterSpacing: 0,
|
|
45
|
+
},
|
|
46
|
+
} as const;
|