@carrier-dpx/air-react-library 0.4.0 → 0.6.0

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.
Files changed (33) hide show
  1. package/README.md +3 -0
  2. package/package.json +10 -7
  3. package/src/components/Copyright/Copyright.figma.tsx +19 -0
  4. package/src/components/Copyright/Copyright.tsx +36 -0
  5. package/src/components/Copyright/index.ts +3 -0
  6. package/src/components/Copyright/styles.ts +8 -0
  7. package/src/components/Copyright/types.ts +8 -0
  8. package/src/components/Divider/Divider.horizontal.figma.tsx +50 -0
  9. package/src/components/Divider/Divider.tsx +57 -0
  10. package/src/components/Divider/Divider.vertical.figma.tsx +54 -0
  11. package/src/components/Divider/index.ts +3 -0
  12. package/src/components/Icon/ArrowLeftIcon.figma.tsx +32 -0
  13. package/src/components/Icon/ArrowRightIcon.figma.tsx +32 -0
  14. package/src/components/Icon/CheckIcon.figma.tsx +32 -0
  15. package/src/components/Icon/CloseIcon.figma.tsx +32 -0
  16. package/src/components/Icon/HomeIcon.figma.tsx +32 -0
  17. package/src/components/Icon/Icon.tsx +24 -0
  18. package/src/components/Icon/InfoIcon.figma.tsx +32 -0
  19. package/src/components/Icon/MenuIcon.figma.tsx +32 -0
  20. package/src/components/Icon/README.md +207 -0
  21. package/src/components/Icon/SearchIcon.figma.tsx +32 -0
  22. package/src/components/Icon/SettingsIcon.figma.tsx +61 -0
  23. package/src/components/Icon/UserIcon.figma.tsx +32 -0
  24. package/src/components/Icon/index.ts +3 -0
  25. package/src/components/Link/Link.figma.tsx +70 -0
  26. package/src/components/Link/Link.tsx +69 -0
  27. package/src/components/Link/index.ts +3 -0
  28. package/src/components/theme/FleetThemeProvider.tsx +50 -50
  29. package/src/components/theme/constants/fleetComponents.ts +873 -873
  30. package/src/components/theme/constants/styleTokens.ts +37 -1
  31. package/src/components/types/common.ts +5 -0
  32. package/src/components/types/props.ts +6 -0
  33. package/src/index.ts +8 -0
package/README.md CHANGED
@@ -154,6 +154,9 @@ Currently available components:
154
154
  - **Button** - Material-UI based button component with Carrier DPX design system styling
155
155
  - **Typography** - Text component with all Carrier DPX typography variants (h1-h6, body1-3, caps, etc.)
156
156
  - **TextField** - Input field component with Carrier DPX styling (supports multiple sizes, colors, validation states)
157
+ - **Link** - Hyperlink component with typography variants and underline options
158
+ - **Divider** - Horizontal and vertical divider lines (with optional text labels)
159
+ - **Copyright** - Copyright notice component (automatically adds © and current year)
157
160
 
158
161
  More components coming soon!
159
162
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrier-dpx/air-react-library",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Air web React component library for Figma Make",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -32,19 +32,22 @@
32
32
  "author": "Carrier DPX",
33
33
  "license": "MIT",
34
34
  "peerDependencies": {
35
- "react": "^18.0.0",
36
- "react-dom": "^18.0.0",
37
- "@mui/material": "^5.0.0",
38
35
  "@emotion/react": "^11.0.0",
39
- "@emotion/styled": "^11.0.0"
36
+ "@emotion/styled": "^11.0.0",
37
+ "@mui/material": "^5.0.0",
38
+ "react": "^18.0.0",
39
+ "react-dom": "^18.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@figma/code-connect": "^1.0.0",
43
- "@mui/material": "^5.15.0",
44
42
  "@emotion/react": "^11.11.0",
45
43
  "@emotion/styled": "^11.11.0",
44
+ "@figma/code-connect": "^1.0.0",
45
+ "@mui/material": "^5.15.0",
46
46
  "@types/react": "^18.0.0",
47
47
  "@types/react-dom": "^18.0.0",
48
48
  "typescript": "^5.0.0"
49
+ },
50
+ "dependencies": {
51
+ "clsx": "^2.1.1"
49
52
  }
50
53
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Copyright Component
3
+ */
4
+
5
+ import figma from "@figma/code-connect";
6
+ import Copyright from "./Copyright";
7
+
8
+ figma.connect(
9
+ Copyright,
10
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=37592-67050",
11
+ {
12
+ /**
13
+ * CODE EXAMPLE TEMPLATE
14
+ * Copyright automatically adds © symbol and current year
15
+ * Since Figma component has no props, we provide a default example
16
+ */
17
+ example: () => <Copyright text="Carrier" />,
18
+ }
19
+ );
@@ -0,0 +1,36 @@
1
+ import { FC, useMemo } from "react";
2
+ import { CSSObject, styled } from "@mui/material/styles";
3
+ import Typography from "../Typography";
4
+ import { CopyrightProps } from "./types";
5
+ import clsx from "clsx";
6
+ import styles from "./styles";
7
+ import { getSxStyles } from "../utils/styles";
8
+
9
+ const CopyrightStyled = styled(Typography)(styles);
10
+ const baseClassName = "copyright";
11
+
12
+ /** The Copyright pattern provides legal confirmation for time of ownership.
13
+ * //Default Import
14
+ * `import Copyright from '@carrier-io/air-react/Copyright'`
15
+ * //Named Import
16
+ * `import { Copyright } from '@carrier-io/air-react'`
17
+ */
18
+ const Copyright: FC<CopyrightProps> = ({ text, sx, className }) => {
19
+ const currentYear = useMemo(() => {
20
+ return new Date().getFullYear();
21
+ }, []);
22
+
23
+ return (
24
+ <CopyrightStyled
25
+ variant="body3"
26
+ sx={(theme) =>
27
+ ({ fontSize: "12px", ...getSxStyles(theme, sx) } as CSSObject)
28
+ }
29
+ className={clsx(baseClassName, className)}
30
+ >
31
+ © {currentYear} {text}
32
+ </CopyrightStyled>
33
+ );
34
+ };
35
+
36
+ export default Copyright;
@@ -0,0 +1,3 @@
1
+ export * from "./Copyright";
2
+ export * from "./types";
3
+ export { default } from "./Copyright";
@@ -0,0 +1,8 @@
1
+ import { lighten } from "@mui/material";
2
+ import { StyledComponentDefaultProps } from "../types/common";
3
+
4
+ const styles = ({ theme }: StyledComponentDefaultProps) => ({
5
+ color: lighten(theme.palette.common.black, 0.6),
6
+ });
7
+
8
+ export default styles;
@@ -0,0 +1,8 @@
1
+ import { StylesExtendable } from "../types/props";
2
+
3
+ export interface CopyrightProps extends StylesExtendable {
4
+ /**
5
+ * The content rendered within the component.
6
+ */
7
+ text: string;
8
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Divider Component (Horizontal)
3
+ */
4
+
5
+ import figma from "@figma/code-connect";
6
+ import Divider from "./Divider";
7
+
8
+ figma.connect(
9
+ Divider,
10
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=15518-67418",
11
+ {
12
+ props: {
13
+ /**
14
+ * VARIANT MAPPING
15
+ */
16
+ variant: figma.enum("variant", {
17
+ full: "full",
18
+ padded: "padded",
19
+ }),
20
+
21
+ /**
22
+ * TEXT ALIGN MAPPING
23
+ */
24
+ textAlign: figma.enum("textAlign", {
25
+ center: "center",
26
+ left: "left",
27
+ right: "right",
28
+ }),
29
+
30
+ /**
31
+ * TEXT CONTENT
32
+ * When text boolean is true, shows Typography children
33
+ */
34
+ children: figma.boolean("text") ? figma.children("*") : undefined,
35
+ },
36
+
37
+ /**
38
+ * CODE EXAMPLE TEMPLATE
39
+ * Horizontal divider (default orientation)
40
+ */
41
+ example: ({ variant, textAlign, children }) =>
42
+ children ? (
43
+ <Divider variant={variant} textAlign={textAlign}>
44
+ {children}
45
+ </Divider>
46
+ ) : (
47
+ <Divider variant={variant} />
48
+ ),
49
+ }
50
+ );
@@ -0,0 +1,57 @@
1
+ import { forwardRef } from "react";
2
+
3
+ import MuiDivider, {
4
+ DividerProps as MuiDividerProps,
5
+ } from "@mui/material/Divider";
6
+ import { styled } from "@mui/material/styles";
7
+
8
+ import { styleTokens } from "../theme/constants/styleTokens";
9
+
10
+ export interface DividerProps extends Omit<MuiDividerProps, "light"> {}
11
+
12
+ declare module "@mui/material/Divider" {
13
+ interface DividerPropsVariantOverrides {
14
+ padded: true;
15
+ middle: false;
16
+ full: true;
17
+ fullWidth: false;
18
+ inset: false;
19
+ }
20
+ }
21
+
22
+ /** The Divider component is a thin line that groups content in lists and layouts.
23
+ *
24
+ * // Default import
25
+ * import Divider from '@carrier-io/air-react/Divider'
26
+ *
27
+ * // Named import
28
+ * import { Divider } from '@carrier-io/air-react'
29
+ */
30
+
31
+ const MuiDividerStyled = styled(MuiDivider)(({ theme }) => ({
32
+ "&.MuiDivider-padded": {
33
+ marginLeft: styleTokens.margin.large,
34
+ marginRight: styleTokens.margin.large,
35
+ paddingTop: "8px",
36
+ paddingBottom: "8px",
37
+ },
38
+ "& .MuiDivider-wrapper": {
39
+ paddingLeft: styleTokens.padding.xsmall,
40
+ paddingRight: styleTokens.padding.xsmall,
41
+ color: theme.palette.base?.text.primary,
42
+ },
43
+ "&.MuiDivider-root": {
44
+ borderColor: theme.palette.base?.divider,
45
+ "&:before, &:after": {
46
+ borderTop: `thin solid ${theme.palette.base?.divider}`,
47
+ },
48
+ },
49
+ }));
50
+
51
+ const Divider = forwardRef<HTMLHRElement, DividerProps>((props, ref) => {
52
+ return <MuiDividerStyled {...props} ref={ref} />;
53
+ });
54
+
55
+ Divider.displayName = "Divider";
56
+
57
+ export default Divider;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Divider Component (Vertical)
3
+ */
4
+
5
+ import figma from "@figma/code-connect";
6
+ import Divider from "./Divider";
7
+
8
+ figma.connect(
9
+ Divider,
10
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=15556-68596",
11
+ {
12
+ props: {
13
+ /**
14
+ * VARIANT MAPPING
15
+ */
16
+ variant: figma.enum("variant", {
17
+ full: "full",
18
+ padded: "padded",
19
+ }),
20
+
21
+ /**
22
+ * TEXT ALIGN MAPPING
23
+ */
24
+ textAlign: figma.enum("textAlign", {
25
+ center: "center",
26
+ left: "left",
27
+ right: "right",
28
+ }),
29
+
30
+ /**
31
+ * TEXT CONTENT
32
+ * When text boolean is true, shows Typography children
33
+ */
34
+ children: figma.boolean("text") ? figma.children("*") : undefined,
35
+ },
36
+
37
+ /**
38
+ * CODE EXAMPLE TEMPLATE
39
+ * Vertical divider - sets orientation="vertical"
40
+ */
41
+ example: ({ variant, textAlign, children }) =>
42
+ children ? (
43
+ <Divider
44
+ orientation="vertical"
45
+ variant={variant}
46
+ textAlign={textAlign}
47
+ >
48
+ {children}
49
+ </Divider>
50
+ ) : (
51
+ <Divider orientation="vertical" variant={variant} />
52
+ ),
53
+ }
54
+ );
@@ -0,0 +1,3 @@
1
+ export { default } from "./Divider";
2
+ export * from "./Divider";
3
+ export type { DividerProps } from "./Divider";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for ArrowLeft Icon
3
+ *
4
+ * NOTE: Import ArrowLeftIcon from your actual icon library package.
5
+ * Example: import { ArrowLeftIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { ArrowLeftIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual ArrowLeftIcon import
14
+ const ArrowLeftIcon = ({ variant, ...props }: any) => <span {...props}>ArrowLeftIcon</span>;
15
+
16
+ figma.connect(
17
+ ArrowLeftIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=ARROW-LEFT-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <ArrowLeftIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for ArrowRight Icon
3
+ *
4
+ * NOTE: Import ArrowRightIcon from your actual icon library package.
5
+ * Example: import { ArrowRightIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { ArrowRightIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual ArrowRightIcon import
14
+ const ArrowRightIcon = ({ variant, ...props }: any) => <span {...props}>ArrowRightIcon</span>;
15
+
16
+ figma.connect(
17
+ ArrowRightIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=ARROW-RIGHT-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <ArrowRightIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Check Icon
3
+ *
4
+ * NOTE: Import CheckIcon from your actual icon library package.
5
+ * Example: import { CheckIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { CheckIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual CheckIcon import
14
+ const CheckIcon = ({ variant, ...props }: any) => <span {...props}>CheckIcon</span>;
15
+
16
+ figma.connect(
17
+ CheckIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=CHECK-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <CheckIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Close Icon
3
+ *
4
+ * NOTE: Import CloseIcon from your actual icon library package.
5
+ * Example: import { CloseIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { CloseIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual CloseIcon import
14
+ const CloseIcon = ({ variant, ...props }: any) => <span {...props}>CloseIcon</span>;
15
+
16
+ figma.connect(
17
+ CloseIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=CLOSE-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <CloseIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Home Icon
3
+ *
4
+ * NOTE: Import HomeIcon from your actual icon library package.
5
+ * Example: import { HomeIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { HomeIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual HomeIcon import
14
+ const HomeIcon = ({ variant, ...props }: any) => <span {...props}>HomeIcon</span>;
15
+
16
+ figma.connect(
17
+ HomeIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=HOME-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <HomeIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,24 @@
1
+ import { forwardRef } from "react";
2
+
3
+ import { Icon as MuiIcon, IconProps as MuiIconProps } from "@mui/material";
4
+
5
+ export interface IconProps extends MuiIconProps {}
6
+
7
+ declare module "@mui/material/Icon" {
8
+ interface IconPropsSizeOverrides {
9
+ xsmall: true;
10
+ }
11
+ }
12
+
13
+ /** The Icon component provides access to our Icon Library and allows graphic, size and color customization.
14
+ *
15
+ * `import Icon from '@carrier-io/air-react/Icon'`
16
+ */
17
+
18
+ const Icon = forwardRef<HTMLSpanElement, IconProps>((props, ref) => {
19
+ return <MuiIcon {...props} ref={ref} />;
20
+ });
21
+
22
+ Icon.displayName = "Icon";
23
+
24
+ export default Icon;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Info Icon
3
+ *
4
+ * NOTE: Import InfoIcon from your actual icon library package.
5
+ * Example: import { InfoIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { InfoIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual InfoIcon import
14
+ const InfoIcon = ({ variant, ...props }: any) => <span {...props}>InfoIcon</span>;
15
+
16
+ figma.connect(
17
+ InfoIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=INFO-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <InfoIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Figma Code Connect Configuration for Menu Icon
3
+ *
4
+ * NOTE: Import MenuIcon from your actual icon library package.
5
+ * Example: import { MenuIcon } from '@carrier-io/icons';
6
+ */
7
+
8
+ import figma from "@figma/code-connect";
9
+ import Icon from "./Icon";
10
+ // TODO: Import from your actual icon library
11
+ // import { MenuIcon } from '@carrier-io/icons';
12
+
13
+ // Placeholder - replace with actual MenuIcon import
14
+ const MenuIcon = ({ variant, ...props }: any) => <span {...props}>MenuIcon</span>;
15
+
16
+ figma.connect(
17
+ MenuIcon,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=MENU-ICON-NODE-ID",
19
+ {
20
+ props: {
21
+ variant: figma.enum("variant", {
22
+ outlined: "outlined",
23
+ filled: "filled",
24
+ }),
25
+ },
26
+ example: ({ variant }) => (
27
+ <Icon fontSize="medium">
28
+ <MenuIcon variant={variant} />
29
+ </Icon>
30
+ ),
31
+ }
32
+ );