@carrier-dpx/air-react-library 0.7.26 → 0.7.28
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/package.json +1 -1
- package/src/components/Icon/icons/demo/AccountCircleIcon.figma.tsx +33 -0
- package/src/components/Icon/icons/demo/AccountCircleIcon.tsx +20 -0
- package/src/components/Icon/icons/demo/ChevronLeftIcon.figma.tsx +33 -0
- package/src/components/Icon/icons/demo/ChevronLeftIcon.tsx +19 -0
- package/src/components/Icon/icons/demo/NotificationsIcon.figma.tsx +33 -0
- package/src/components/Icon/icons/demo/NotificationsIcon.tsx +20 -0
- package/src/components/Icon/icons/demo/acount_circle_outlined.svg +4 -0
- package/src/components/Icon/icons/demo/chevron_left_outlined.svg +3 -0
- package/src/components/Icon/icons/demo/iconRegistry.tsx +35 -0
- package/src/components/Icon/icons/demo/index.ts +9 -0
- package/src/components/Icon/icons/demo/notifications_outlined.svg +4 -0
- package/src/components/StatusLed/StatusLed.figma.tsx +98 -0
- package/src/components/StatusLed/StatusLed.tsx +77 -0
- package/src/components/StatusLed/index.ts +4 -0
- package/src/components/StatusLed/styles.ts +39 -0
- package/src/components/StatusLed/types.ts +59 -0
- package/src/components/StatusLed/utils.ts +31 -0
- package/src/index.ts +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Code Connect Configuration for AccountCircleIcon
|
|
3
|
+
*
|
|
4
|
+
* Figma URL: https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=56-325
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import figma from "@figma/code-connect";
|
|
8
|
+
import Icon from "../../Icon";
|
|
9
|
+
import { AccountCircleIcon } from "./AccountCircleIcon";
|
|
10
|
+
|
|
11
|
+
figma.connect(
|
|
12
|
+
AccountCircleIcon,
|
|
13
|
+
"https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=56-325",
|
|
14
|
+
{
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* STYLE/VARIANT MAPPING
|
|
18
|
+
* Maps Figma's "Style" property to React's "variant" prop
|
|
19
|
+
* Figma: Style="Outlined" → React: variant="outlined"
|
|
20
|
+
* Figma: Style="Filled" → React: variant="filled"
|
|
21
|
+
*/
|
|
22
|
+
variant: figma.enum("Style", {
|
|
23
|
+
Outlined: "outlined",
|
|
24
|
+
Filled: "filled",
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
example: ({ variant }) => (
|
|
28
|
+
<Icon fontSize="medium">
|
|
29
|
+
<AccountCircleIcon variant={variant} />
|
|
30
|
+
</Icon>
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export interface AccountCircleIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
variant?: "outlined" | "filled";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const AccountCircleIcon: FC<AccountCircleIconProps> = ({ variant = "outlined", style, ...props }) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
style={{ width: "1em", height: "1em", display: "block", ...style }}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 6C13.93 6 15.5 7.57 15.5 9.5C15.5 11.43 13.93 13 12 13C10.07 13 8.5 11.43 8.5 9.5C8.5 7.57 10.07 6 12 6ZM12 8C11.17 8 10.5 8.67 10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8Z" fill="currentColor"/>
|
|
17
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 2C17.52 2 22 6.48 22 12C22 17.52 17.52 22 12 22C6.48 22 2 17.52 2 12C2 6.48 6.48 2 12 2ZM12 17C10.26 17 8.65961 17.56 7.34961 18.5C8.65961 19.44 10.26 20 12 20C13.74 20 15.3404 19.44 16.6504 18.5C15.3404 17.56 13.74 17 12 17ZM12 4C7.58 4 4 7.58 4 12C4 13.95 4.70035 15.7301 5.86035 17.1201C7.55033 15.8002 9.68007 15 12 15C14.3199 15 16.4497 15.8002 18.1396 17.1201C19.2996 15.7301 20 13.95 20 12C20 7.58 16.42 4 12 4Z" fill="currentColor"/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Code Connect Configuration for ChevronLeftIcon
|
|
3
|
+
*
|
|
4
|
+
* Figma URL: https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=12-149
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import figma from "@figma/code-connect";
|
|
8
|
+
import Icon from "../../Icon";
|
|
9
|
+
import { ChevronLeftIcon } from "./ChevronLeftIcon";
|
|
10
|
+
|
|
11
|
+
figma.connect(
|
|
12
|
+
ChevronLeftIcon,
|
|
13
|
+
"https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=12-149",
|
|
14
|
+
{
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* STYLE/VARIANT MAPPING
|
|
18
|
+
* Maps Figma's "Style" property to React's "variant" prop
|
|
19
|
+
* Figma: Style="Outlined" → React: variant="outlined"
|
|
20
|
+
* Figma: Style="Filled" → React: variant="filled"
|
|
21
|
+
*/
|
|
22
|
+
variant: figma.enum("Style", {
|
|
23
|
+
Outlined: "outlined",
|
|
24
|
+
Filled: "filled",
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
example: ({ variant }) => (
|
|
28
|
+
<Icon fontSize="medium">
|
|
29
|
+
<ChevronLeftIcon variant={variant} />
|
|
30
|
+
</Icon>
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export interface ChevronLeftIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
variant?: "outlined" | "filled";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ChevronLeftIcon: FC<ChevronLeftIconProps> = ({ variant = "outlined", style, ...props }) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
style={{ width: "1em", height: "1em", display: "block", ...style }}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<path d="M14.2998 6.4248C14.5831 6.4248 14.8167 6.51686 15 6.7002C15.1833 6.88352 15.2754 7.1171 15.2754 7.40039C15.2753 7.68345 15.1831 7.91638 15 8.09961L11.0996 12L15 15.9004C15.1831 16.0836 15.2753 16.3166 15.2754 16.5996C15.2754 16.8829 15.1832 17.1165 15 17.2998C14.8167 17.4831 14.5831 17.5752 14.2998 17.5752C14.0165 17.5752 13.7829 17.4831 13.5996 17.2998L9 12.7002C8.9 12.6002 8.82878 12.4917 8.78711 12.375C8.74548 12.2584 8.72461 12.1333 8.72461 12C8.72461 11.8667 8.74547 11.7416 8.78711 11.625C8.82878 11.5083 8.9 11.3998 9 11.2998L13.5996 6.7002C13.7829 6.5169 14.0165 6.42484 14.2998 6.4248Z" fill="currentColor"/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Code Connect Configuration for NotificationsIcon
|
|
3
|
+
*
|
|
4
|
+
* Figma URL: https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=47-218
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import figma from "@figma/code-connect";
|
|
8
|
+
import Icon from "../../Icon";
|
|
9
|
+
import { NotificationsIcon } from "./NotificationsIcon";
|
|
10
|
+
|
|
11
|
+
figma.connect(
|
|
12
|
+
NotificationsIcon,
|
|
13
|
+
"https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=47-218",
|
|
14
|
+
{
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* STYLE/VARIANT MAPPING
|
|
18
|
+
* Maps Figma's "Style" property to React's "variant" prop
|
|
19
|
+
* Figma: Style="Outlined" → React: variant="outlined"
|
|
20
|
+
* Figma: Style="Filled" → React: variant="filled"
|
|
21
|
+
*/
|
|
22
|
+
variant: figma.enum("Style", {
|
|
23
|
+
Outlined: "outlined",
|
|
24
|
+
Filled: "filled",
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
example: ({ variant }) => (
|
|
28
|
+
<Icon fontSize="medium">
|
|
29
|
+
<NotificationsIcon variant={variant} />
|
|
30
|
+
</Icon>
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export interface NotificationsIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
variant?: "outlined" | "filled";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const NotificationsIcon: FC<NotificationsIconProps> = ({ variant = "outlined", style, ...props }) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
style={{ width: "1em", height: "1em", display: "block", ...style }}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<path d="M14 20C14 20.55 13.8038 21.0204 13.4121 21.4121C13.0204 21.8038 12.55 22 12 22C11.45 22 10.9796 21.8038 10.5879 21.4121C10.1962 21.0204 10 20.55 10 20H14Z" fill="currentColor"/>
|
|
17
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 2C12.4167 2 12.7708 2.14583 13.0625 2.4375C13.3542 2.72917 13.5 3.08333 13.5 3.5V4.2002C14.8333 4.53353 15.9167 5.23751 16.75 6.3125C17.5833 7.3875 18 8.61667 18 10V17H19C19.2833 17 19.5212 17.0954 19.7129 17.2871C19.9046 17.4788 20 17.7167 20 18C20 18.2833 19.9046 18.5212 19.7129 18.7129C19.5212 18.9046 19.2833 19 19 19H5C4.71667 19 4.47878 18.9046 4.28711 18.7129C4.09544 18.5212 4 18.2833 4 18C4 17.7167 4.09544 17.4788 4.28711 17.2871C4.47878 17.0954 4.71667 17 5 17H6V10C6 8.61667 6.41667 7.3875 7.25 6.3125C8.08332 5.23751 9.16669 4.53353 10.5 4.2002V3.5C10.5 3.08333 10.6458 2.72917 10.9375 2.4375C11.2292 2.14583 11.5833 2 12 2ZM12 6C10.9 6 9.95814 6.39147 9.1748 7.1748C8.39147 7.95814 8 8.9 8 10V17H16V10C16 8.9 15.6085 7.95814 14.8252 7.1748C14.0419 6.39147 13.1 6 12 6Z" fill="currentColor"/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C13.93 6 15.5 7.57 15.5 9.5C15.5 11.43 13.93 13 12 13C10.07 13 8.5 11.43 8.5 9.5C8.5 7.57 10.07 6 12 6ZM12 8C11.17 8 10.5 8.67 10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C17.52 2 22 6.48 22 12C22 17.52 17.52 22 12 22C6.48 22 2 17.52 2 12C2 6.48 6.48 2 12 2ZM12 17C10.26 17 8.65961 17.56 7.34961 18.5C8.65961 19.44 10.26 20 12 20C13.74 20 15.3404 19.44 16.6504 18.5C15.3404 17.56 13.74 17 12 17ZM12 4C7.58 4 4 7.58 4 12C4 13.95 4.70035 15.7301 5.86035 17.1201C7.55033 15.8002 9.68007 15 12 15C14.3199 15 16.4497 15.8002 18.1396 17.1201C19.2996 15.7301 20 13.95 20 12C20 7.58 16.42 4 12 4Z" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.2998 6.4248C14.5831 6.4248 14.8167 6.51686 15 6.7002C15.1833 6.88352 15.2754 7.1171 15.2754 7.40039C15.2753 7.68345 15.1831 7.91638 15 8.09961L11.0996 12L15 15.9004C15.1831 16.0836 15.2753 16.3166 15.2754 16.5996C15.2754 16.8829 15.1832 17.1165 15 17.2998C14.8167 17.4831 14.5831 17.5752 14.2998 17.5752C14.0165 17.5752 13.7829 17.4831 13.5996 17.2998L9 12.7002C8.9 12.6002 8.82878 12.4917 8.78711 12.375C8.74548 12.2584 8.72461 12.1333 8.72461 12C8.72461 11.8667 8.74547 11.7416 8.78711 11.625C8.82878 11.5083 8.9 11.3998 9 11.2998L13.5996 6.7002C13.7829 6.5169 14.0165 6.42484 14.2998 6.4248Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -61,6 +61,26 @@ const MoreVerticalSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props })
|
|
|
61
61
|
</svg>
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
+
const NotificationsSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
|
|
65
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: "1em", height: "1em", display: "block", ...style }} {...props}>
|
|
66
|
+
<path d="M14 20C14 20.55 13.8038 21.0204 13.4121 21.4121C13.0204 21.8038 12.55 22 12 22C11.45 22 10.9796 21.8038 10.5879 21.4121C10.1962 21.0204 10 20.55 10 20H14Z" fill="currentColor"/>
|
|
67
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 2C12.4167 2 12.7708 2.14583 13.0625 2.4375C13.3542 2.72917 13.5 3.08333 13.5 3.5V4.2002C14.8333 4.53353 15.9167 5.23751 16.75 6.3125C17.5833 7.3875 18 8.61667 18 10V17H19C19.2833 17 19.5212 17.0954 19.7129 17.2871C19.9046 17.4788 20 17.7167 20 18C20 18.2833 19.9046 18.5212 19.7129 18.7129C19.5212 18.9046 19.2833 19 19 19H5C4.71667 19 4.47878 18.9046 4.28711 18.7129C4.09544 18.5212 4 18.2833 4 18C4 17.7167 4.09544 17.4788 4.28711 17.2871C4.47878 17.0954 4.71667 17 5 17H6V10C6 8.61667 6.41667 7.3875 7.25 6.3125C8.08332 5.23751 9.16669 4.53353 10.5 4.2002V3.5C10.5 3.08333 10.6458 2.72917 10.9375 2.4375C11.2292 2.14583 11.5833 2 12 2ZM12 6C10.9 6 9.95814 6.39147 9.1748 7.1748C8.39147 7.95814 8 8.9 8 10V17H16V10C16 8.9 15.6085 7.95814 14.8252 7.1748C14.0419 6.39147 13.1 6 12 6Z" fill="currentColor"/>
|
|
68
|
+
</svg>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const AccountCircleSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
|
|
72
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: "1em", height: "1em", display: "block", ...style }} {...props}>
|
|
73
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 6C13.93 6 15.5 7.57 15.5 9.5C15.5 11.43 13.93 13 12 13C10.07 13 8.5 11.43 8.5 9.5C8.5 7.57 10.07 6 12 6ZM12 8C11.17 8 10.5 8.67 10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8Z" fill="currentColor"/>
|
|
74
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M12 2C17.52 2 22 6.48 22 12C22 17.52 17.52 22 12 22C6.48 22 2 17.52 2 12C2 6.48 6.48 2 12 2ZM12 17C10.26 17 8.65961 17.56 7.34961 18.5C8.65961 19.44 10.26 20 12 20C13.74 20 15.3404 19.44 16.6504 18.5C15.3404 17.56 13.74 17 12 17ZM12 4C7.58 4 4 7.58 4 12C4 13.95 4.70035 15.7301 5.86035 17.1201C7.55033 15.8002 9.68007 15 12 15C14.3199 15 16.4497 15.8002 18.1396 17.1201C19.2996 15.7301 20 13.95 20 12C20 7.58 16.42 4 12 4Z" fill="currentColor"/>
|
|
75
|
+
</svg>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const ChevronLeftSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
|
|
79
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: "1em", height: "1em", display: "block", ...style }} {...props}>
|
|
80
|
+
<path d="M14.2998 6.4248C14.5831 6.4248 14.8167 6.51686 15 6.7002C15.1833 6.88352 15.2754 7.1171 15.2754 7.40039C15.2753 7.68345 15.1831 7.91638 15 8.09961L11.0996 12L15 15.9004C15.1831 16.0836 15.2753 16.3166 15.2754 16.5996C15.2754 16.8829 15.1832 17.1165 15 17.2998C14.8167 17.4831 14.5831 17.5752 14.2998 17.5752C14.0165 17.5752 13.7829 17.4831 13.5996 17.2998L9 12.7002C8.9 12.6002 8.82878 12.4917 8.78711 12.375C8.74548 12.2584 8.72461 12.1333 8.72461 12C8.72461 11.8667 8.74547 11.7416 8.78711 11.625C8.82878 11.5083 8.9 11.3998 9 11.2998L13.5996 6.7002C13.7829 6.5169 14.0165 6.42484 14.2998 6.4248Z" fill="currentColor"/>
|
|
81
|
+
</svg>
|
|
82
|
+
);
|
|
83
|
+
|
|
64
84
|
// WarningTriangle SVG (previously WarningIcon)
|
|
65
85
|
|
|
66
86
|
export interface IconInfo {
|
|
@@ -100,6 +120,21 @@ export const iconRegistry: Record<string, IconInfo> = {
|
|
|
100
120
|
component: MoreVerticalSvg,
|
|
101
121
|
variant: "outlined",
|
|
102
122
|
},
|
|
123
|
+
notifications: {
|
|
124
|
+
name: "notifications",
|
|
125
|
+
component: NotificationsSvg,
|
|
126
|
+
variant: "outlined",
|
|
127
|
+
},
|
|
128
|
+
accountcircle: {
|
|
129
|
+
name: "accountcircle",
|
|
130
|
+
component: AccountCircleSvg,
|
|
131
|
+
variant: "outlined",
|
|
132
|
+
},
|
|
133
|
+
chevronleft: {
|
|
134
|
+
name: "chevronleft",
|
|
135
|
+
component: ChevronLeftSvg,
|
|
136
|
+
variant: "outlined",
|
|
137
|
+
},
|
|
103
138
|
};
|
|
104
139
|
|
|
105
140
|
/**
|
|
@@ -24,3 +24,12 @@ export type { MenuIconProps } from "./MenuIcon";
|
|
|
24
24
|
|
|
25
25
|
export { MoreVerticalIcon } from "./MoreVerticalIcon";
|
|
26
26
|
export type { MoreVerticalIconProps } from "./MoreVerticalIcon";
|
|
27
|
+
|
|
28
|
+
export { NotificationsIcon } from "./NotificationsIcon";
|
|
29
|
+
export type { NotificationsIconProps } from "./NotificationsIcon";
|
|
30
|
+
|
|
31
|
+
export { AccountCircleIcon } from "./AccountCircleIcon";
|
|
32
|
+
export type { AccountCircleIconProps } from "./AccountCircleIcon";
|
|
33
|
+
|
|
34
|
+
export { ChevronLeftIcon } from "./ChevronLeftIcon";
|
|
35
|
+
export type { ChevronLeftIconProps } from "./ChevronLeftIcon";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14 20C14 20.55 13.8038 21.0204 13.4121 21.4121C13.0204 21.8038 12.55 22 12 22C11.45 22 10.9796 21.8038 10.5879 21.4121C10.1962 21.0204 10 20.55 10 20H14Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C12.4167 2 12.7708 2.14583 13.0625 2.4375C13.3542 2.72917 13.5 3.08333 13.5 3.5V4.2002C14.8333 4.53353 15.9167 5.23751 16.75 6.3125C17.5833 7.3875 18 8.61667 18 10V17H19C19.2833 17 19.5212 17.0954 19.7129 17.2871C19.9046 17.4788 20 17.7167 20 18C20 18.2833 19.9046 18.5212 19.7129 18.7129C19.5212 18.9046 19.2833 19 19 19H5C4.71667 19 4.47878 18.9046 4.28711 18.7129C4.09544 18.5212 4 18.2833 4 18C4 17.7167 4.09544 17.4788 4.28711 17.2871C4.47878 17.0954 4.71667 17 5 17H6V10C6 8.61667 6.41667 7.3875 7.25 6.3125C8.08332 5.23751 9.16669 4.53353 10.5 4.2002V3.5C10.5 3.08333 10.6458 2.72917 10.9375 2.4375C11.2292 2.14583 11.5833 2 12 2ZM12 6C10.9 6 9.95814 6.39147 9.1748 7.1748C8.39147 7.95814 8 8.9 8 10V17H16V10C16 8.9 15.6085 7.95814 14.8252 7.1748C14.0419 6.39147 13.1 6 12 6Z" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma Code Connect Configuration for StatusLed Component
|
|
3
|
+
*
|
|
4
|
+
* Figma URL: https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=37599-424674
|
|
5
|
+
*
|
|
6
|
+
* Figma Properties:
|
|
7
|
+
* - severity (error, warning, success, info, default, static)
|
|
8
|
+
* - size (xsmall: 24px, micro: 20px)
|
|
9
|
+
* - labelPosition (start, end)
|
|
10
|
+
* - label (true, false) - controls visibility of nested "Label" Typography component
|
|
11
|
+
*
|
|
12
|
+
* Notes:
|
|
13
|
+
* - labelPosition changes where the label is placed, either before or after the StatusLED
|
|
14
|
+
* - The "label" boolean prop hides/shows the nested "Label" component which is an instance of the Typography component
|
|
15
|
+
* - Size can be customized in code for any size, but design only supports two sizes
|
|
16
|
+
* - Size mapping: xsmall (24px) → size 12, micro (20px) → size 10 (since circleSize = size * 2)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import figma from "@figma/code-connect";
|
|
20
|
+
import StatusLed from "./StatusLed";
|
|
21
|
+
|
|
22
|
+
figma.connect(
|
|
23
|
+
StatusLed,
|
|
24
|
+
"https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=37599-424674",
|
|
25
|
+
{
|
|
26
|
+
props: {
|
|
27
|
+
/**
|
|
28
|
+
* SEVERITY MAPPING
|
|
29
|
+
* Maps Figma's "severity" property to React's "severity" prop
|
|
30
|
+
* Controls the color of the StatusLED
|
|
31
|
+
*/
|
|
32
|
+
severity: figma.enum("severity", {
|
|
33
|
+
error: "error",
|
|
34
|
+
warning: "warning",
|
|
35
|
+
success: "success",
|
|
36
|
+
info: "info",
|
|
37
|
+
default: "default",
|
|
38
|
+
static: "static",
|
|
39
|
+
}),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* SIZE MAPPING
|
|
43
|
+
* Maps Figma's "size" property to React's "size" prop
|
|
44
|
+
* Figma: xsmall (24px), micro (20px)
|
|
45
|
+
* React: size is the inner circle size in pixels
|
|
46
|
+
* - xsmall (24px total) → size 12 (12 * 2 = 24)
|
|
47
|
+
* - micro (20px total) → size 10 (10 * 2 = 20)
|
|
48
|
+
*/
|
|
49
|
+
size: figma.enum("size", {
|
|
50
|
+
"xsmall: 24px": 12,
|
|
51
|
+
"micro: 20px": 10,
|
|
52
|
+
// Handle cases where Figma might show just the size name
|
|
53
|
+
xsmall: 12,
|
|
54
|
+
micro: 10,
|
|
55
|
+
}),
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* LABEL POSITION MAPPING
|
|
59
|
+
* Maps Figma's "labelPosition" property to React's "labelPosition" prop
|
|
60
|
+
* Controls where the label is placed relative to the StatusLED
|
|
61
|
+
*/
|
|
62
|
+
labelPosition: figma.enum("labelPosition", {
|
|
63
|
+
start: "start",
|
|
64
|
+
end: "end",
|
|
65
|
+
}),
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* LABEL VISIBILITY
|
|
69
|
+
* Maps Figma's "label" boolean property
|
|
70
|
+
* When true, shows the nested "Label" Typography component
|
|
71
|
+
* When false, hides the label
|
|
72
|
+
*/
|
|
73
|
+
showLabel: figma.boolean("label"),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* LABEL TEXT CONTENT
|
|
77
|
+
* Maps text property "✏️ Label" from the nested "Label" Typography component
|
|
78
|
+
* The Label is an instance of the Typography component
|
|
79
|
+
* The text property must be surfaced from the "Label" layer
|
|
80
|
+
* Only used when showLabel is true
|
|
81
|
+
*/
|
|
82
|
+
label: figma.string("✏️ Label"),
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* EXAMPLE CODE TEMPLATE
|
|
87
|
+
* Shows how StatusLed should be used with optional label
|
|
88
|
+
*/
|
|
89
|
+
example: ({ severity, size, labelPosition, showLabel, label }) => (
|
|
90
|
+
<StatusLed
|
|
91
|
+
severity={severity}
|
|
92
|
+
size={size}
|
|
93
|
+
labelPosition={labelPosition}
|
|
94
|
+
label={showLabel ? label : undefined}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
}
|
|
98
|
+
);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { styled } from "@mui/material/styles";
|
|
3
|
+
import Box from "../Box";
|
|
4
|
+
import { Severity, StatusLedProps, StyleProps } from "./types";
|
|
5
|
+
import Typography from "../Typography";
|
|
6
|
+
import styles from "./styles";
|
|
7
|
+
|
|
8
|
+
const CircleInnerStyled = styled(Box, {
|
|
9
|
+
shouldForwardProp: (prop) => prop !== "size",
|
|
10
|
+
})<Omit<StyleProps, "theme">>(styles.circleInner);
|
|
11
|
+
|
|
12
|
+
const CircleOuterStyled = styled(Box, {
|
|
13
|
+
shouldForwardProp: (prop) => prop !== "size",
|
|
14
|
+
})<Omit<StyleProps, "theme">>(styles.circleOuter);
|
|
15
|
+
|
|
16
|
+
const BoxCircleStyled = styled(Box, {
|
|
17
|
+
shouldForwardProp: (prop) => prop !== "size",
|
|
18
|
+
})<Pick<StyleProps, "size">>(styles.containerCircle);
|
|
19
|
+
|
|
20
|
+
const BoxStyled = styled(Box)(styles.container);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The StatusLED pattern provides on and off states and serves as a visual cue intended to attract
|
|
24
|
+
* the user's attention and communicate severity level information.
|
|
25
|
+
*
|
|
26
|
+
* //Default Import
|
|
27
|
+
* `import StatusLed from '@carrier-io/air-react/StatusLed'`
|
|
28
|
+
*/
|
|
29
|
+
const StatusLed: React.FC<StatusLedProps> = ({
|
|
30
|
+
severity = Severity.Default,
|
|
31
|
+
glow = false,
|
|
32
|
+
size = 12,
|
|
33
|
+
label,
|
|
34
|
+
labelPosition = "end",
|
|
35
|
+
...rest
|
|
36
|
+
}) => {
|
|
37
|
+
const circleSize = size * 2;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<BoxStyled data-testid={rest["data-testid"]}>
|
|
41
|
+
{label && labelPosition === "start" && (
|
|
42
|
+
<Typography
|
|
43
|
+
variant="body2"
|
|
44
|
+
aria-label="label"
|
|
45
|
+
sx={(theme) => ({ mr: 0.5, color: theme.palette.base?.text.primary })}
|
|
46
|
+
>
|
|
47
|
+
{label}
|
|
48
|
+
</Typography>
|
|
49
|
+
)}
|
|
50
|
+
<BoxCircleStyled size={circleSize}>
|
|
51
|
+
{glow && (
|
|
52
|
+
<CircleOuterStyled
|
|
53
|
+
severity={severity}
|
|
54
|
+
size={size}
|
|
55
|
+
aria-label="circle-outer"
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
<CircleInnerStyled
|
|
59
|
+
severity={severity}
|
|
60
|
+
size={size}
|
|
61
|
+
aria-label="circle-inner"
|
|
62
|
+
/>
|
|
63
|
+
</BoxCircleStyled>
|
|
64
|
+
{label && labelPosition === "end" && (
|
|
65
|
+
<Typography
|
|
66
|
+
variant="body2"
|
|
67
|
+
aria-label="label"
|
|
68
|
+
sx={(theme) => ({ mr: 0.5, color: theme.palette.base?.text.primary })}
|
|
69
|
+
>
|
|
70
|
+
{label}
|
|
71
|
+
</Typography>
|
|
72
|
+
)}
|
|
73
|
+
</BoxStyled>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default StatusLed;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CSSObject } from "@mui/material";
|
|
2
|
+
import { Theme } from "@mui/material/styles";
|
|
3
|
+
|
|
4
|
+
import { getColorInner, getColorOuter } from "./utils";
|
|
5
|
+
import { StyleProps } from "./types";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
circleInner: ({ theme, severity, size }: StyleProps): CSSObject => ({
|
|
9
|
+
height: size,
|
|
10
|
+
width: size,
|
|
11
|
+
borderRadius: "50%",
|
|
12
|
+
backgroundColor: getColorInner(theme as unknown as Theme, severity),
|
|
13
|
+
position: "absolute",
|
|
14
|
+
}),
|
|
15
|
+
circleOuter: ({ theme, severity, size }: StyleProps): CSSObject => {
|
|
16
|
+
const roundedOuterSize = Math.round(size * 1.5);
|
|
17
|
+
return {
|
|
18
|
+
height: roundedOuterSize,
|
|
19
|
+
width: roundedOuterSize,
|
|
20
|
+
borderRadius: "50%",
|
|
21
|
+
filter: `blur(${size / 6}px)`,
|
|
22
|
+
backgroundColor: getColorOuter(theme as unknown as Theme, severity),
|
|
23
|
+
"will-change": "transform",
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
containerCircle: ({ size }: Pick<StyleProps, "size">): CSSObject => ({
|
|
27
|
+
position: "relative",
|
|
28
|
+
display: "flex",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
width: size,
|
|
32
|
+
height: size,
|
|
33
|
+
}),
|
|
34
|
+
container: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexDirection: "row",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
} as CSSObject,
|
|
39
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Theme } from "@mui/material/styles";
|
|
2
|
+
|
|
3
|
+
export enum Severity {
|
|
4
|
+
Success = "success",
|
|
5
|
+
Info = "info",
|
|
6
|
+
Warning = "warning",
|
|
7
|
+
Error = "error",
|
|
8
|
+
Default = "default",
|
|
9
|
+
Static = "static",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface StyleProps {
|
|
13
|
+
severity: Severity;
|
|
14
|
+
size: number;
|
|
15
|
+
theme: Theme;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StatusLedProps {
|
|
19
|
+
/**
|
|
20
|
+
* The severity of the StatusLed. This defines the color.
|
|
21
|
+
*
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
severity?: Severity;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A boolean that controls the presence of outer circle (glow) of the StatusLed.
|
|
28
|
+
* The overall size is rounded 150% of the size property value if glow is enabled
|
|
29
|
+
*
|
|
30
|
+
* @default False
|
|
31
|
+
*/
|
|
32
|
+
glow?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The size of the inner circle in pixels.
|
|
36
|
+
* The size of the outer circle (glow) is rounded 50% larger if present.
|
|
37
|
+
*
|
|
38
|
+
* @default 12
|
|
39
|
+
*/
|
|
40
|
+
size?: number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The label content.
|
|
44
|
+
*/
|
|
45
|
+
label?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Controls where the label should be placed.
|
|
49
|
+
*
|
|
50
|
+
* @default end
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
labelPosition?: "start" | "end";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* For testing purposes
|
|
57
|
+
*/
|
|
58
|
+
"data-testid"?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { lighten, PaletteOptions } from "@mui/material";
|
|
2
|
+
import { Theme } from "@mui/material/styles";
|
|
3
|
+
import { SimplePaletteColorOptions } from "@mui/material/styles/createPalette";
|
|
4
|
+
|
|
5
|
+
import { Severity } from "./types";
|
|
6
|
+
|
|
7
|
+
export const getColorInner = (theme: Theme, severity: Severity): string => {
|
|
8
|
+
const key = severity.toLowerCase() as keyof PaletteOptions;
|
|
9
|
+
const palette = theme.palette[key] as SimplePaletteColorOptions;
|
|
10
|
+
const finalColor =
|
|
11
|
+
palette?.main ||
|
|
12
|
+
(severity == Severity.Static
|
|
13
|
+
? theme.palette.base?.dark || theme.palette.common.black
|
|
14
|
+
: theme.palette.base?.state?.disabledContent ||
|
|
15
|
+
lighten(theme.palette.common.black, 0.7));
|
|
16
|
+
|
|
17
|
+
return finalColor;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const getColorOuter = (theme: Theme, severity: Severity): string => {
|
|
21
|
+
const key = severity.toLowerCase() as keyof PaletteOptions;
|
|
22
|
+
const palette = theme.palette[key] as SimplePaletteColorOptions;
|
|
23
|
+
const finalColor =
|
|
24
|
+
palette?.light ??
|
|
25
|
+
(severity == Severity.Static
|
|
26
|
+
? theme.palette.base?.dark || theme.palette.common.black
|
|
27
|
+
: theme.palette.base?.state?.disabledContent ||
|
|
28
|
+
lighten(theme.palette.common.black, 0.8));
|
|
29
|
+
|
|
30
|
+
return finalColor;
|
|
31
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export { default as Avatar, AvatarGroup } from "./components/Avatar";
|
|
|
32
32
|
export type { AvatarProps, AvatarGroupProps } from "./components/Avatar";
|
|
33
33
|
export { default as MobileStatusBar } from "./components/MobileStatusBar";
|
|
34
34
|
export type { MobileStatusBarProps } from "./components/MobileStatusBar";
|
|
35
|
+
export { default as StatusLed } from "./components/StatusLed";
|
|
36
|
+
export type { StatusLedProps, Severity } from "./components/StatusLed";
|
|
35
37
|
export * from "./components/theme";
|
|
36
38
|
|
|
37
39
|
// Demo Icons - exported from main index to avoid deep-path imports
|
|
@@ -42,6 +44,9 @@ export {
|
|
|
42
44
|
WarningTriangle,
|
|
43
45
|
MenuIcon,
|
|
44
46
|
MoreVerticalIcon,
|
|
47
|
+
NotificationsIcon,
|
|
48
|
+
AccountCircleIcon,
|
|
49
|
+
ChevronLeftIcon,
|
|
45
50
|
SvgIcon,
|
|
46
51
|
iconRegistry,
|
|
47
52
|
getIcon,
|
|
@@ -54,6 +59,9 @@ export type {
|
|
|
54
59
|
WarningTriangleProps,
|
|
55
60
|
MenuIconProps,
|
|
56
61
|
MoreVerticalIconProps,
|
|
62
|
+
NotificationsIconProps,
|
|
63
|
+
AccountCircleIconProps,
|
|
64
|
+
ChevronLeftIconProps,
|
|
57
65
|
SvgIconProps,
|
|
58
66
|
IconInfo,
|
|
59
67
|
} from "./components/Icon/icons/demo";
|