@carrier-dpx/air-react-library 0.7.10 → 0.7.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrier-dpx/air-react-library",
3
- "version": "0.7.10",
3
+ "version": "0.7.12",
4
4
  "description": "Air web React component library for Figma Make",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Figma Code Connect Configuration for AppBar Component
3
+ *
4
+ * Figma URL: https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=31342-130614
5
+ */
6
+
7
+ import figma from "@figma/code-connect";
8
+ import AppBar from "./AppBar";
9
+ import { Toolbar } from "@mui/material";
10
+ import IconButton from "@mui/material/IconButton";
11
+ import Typography from "../Typography";
12
+ import Button from "../Button";
13
+ import Icon from "../Icon";
14
+ import { MenuIcon } from "../Icon/icons/demo";
15
+
16
+ figma.connect(
17
+ AppBar,
18
+ "https://www.figma.com/design/vkoHdM6rchIhH9IWetZeP0/Air--Components?node-id=31342-130614",
19
+ {
20
+ props: {
21
+ /**
22
+ * SIZE MAPPING
23
+ * Maps Figma's "size" property to React's "size" prop
24
+ * Figma: dense (48px), basic (64px), prominent (128px)
25
+ */
26
+ size: figma.enum("size", {
27
+ dense: "dense",
28
+ basic: "basic",
29
+ prominent: "prominent",
30
+ }),
31
+
32
+ /**
33
+ * COLOR MAPPING
34
+ * Maps Figma's "color" property to React's "color" prop
35
+ */
36
+ color: figma.enum("color", {
37
+ paper: "paper",
38
+ primary: "primary",
39
+ base: "base",
40
+ transparent: "transparent",
41
+ accent: "accent",
42
+ }),
43
+
44
+ /**
45
+ * DIVIDER MAPPING
46
+ * Maps Figma's "divider" boolean property to React's "divider" prop
47
+ */
48
+ divider: figma.boolean("divider"),
49
+
50
+ /**
51
+ * ELEVATION MAPPING
52
+ * Maps Figma's "elevation" boolean property to React's "elevation" prop
53
+ */
54
+ elevation: figma.boolean("elevation"),
55
+
56
+ /**
57
+ * POSITION
58
+ * AppBar position prop
59
+ */
60
+ position: figma.enum("position", {
61
+ static: "static",
62
+ fixed: "fixed",
63
+ absolute: "absolute",
64
+ sticky: "sticky",
65
+ relative: "relative",
66
+ }),
67
+ },
68
+
69
+ /**
70
+ * CODE EXAMPLE TEMPLATE
71
+ *
72
+ * Shows how AppBar should be used with Toolbar and content
73
+ */
74
+ example: ({ size, color, divider, elevation, position }) => (
75
+ <AppBar
76
+ size={size}
77
+ color={color}
78
+ divider={divider}
79
+ elevation={elevation}
80
+ position={position || "static"}
81
+ >
82
+ <Toolbar>
83
+ <IconButton
84
+ aria-label="menu"
85
+ color="inherit"
86
+ edge="start"
87
+ size="large"
88
+ sx={{ mr: 2 }}
89
+ >
90
+ <Icon fontSize="medium">
91
+ <MenuIcon />
92
+ </Icon>
93
+ </IconButton>
94
+ <Typography
95
+ sx={{ flexGrow: 1 }}
96
+ variant="h6"
97
+ >
98
+ News
99
+ </Typography>
100
+ <Button color="primary">
101
+ Login
102
+ </Button>
103
+ </Toolbar>
104
+ </AppBar>
105
+ ),
106
+ }
107
+ );
@@ -0,0 +1,95 @@
1
+ import { forwardRef } from "react";
2
+
3
+ import MuiAppBar, { AppBarProps as MuiAppBarProps } from "@mui/material/AppBar";
4
+ import { CSSObject } from "@mui/material/styles";
5
+
6
+ import { getSxStyles } from "../utils/styles";
7
+
8
+ export interface AppBarProps extends Omit<MuiAppBarProps, "color"> {
9
+ color?: "paper" | "accent" | "transparent" | "primary" | "base";
10
+ /**
11
+ * Size of the AppBar
12
+ * - dense: 48px height
13
+ * - basic: 64px height (default)
14
+ * - prominent: 128px height
15
+ */
16
+ size?: "dense" | "basic" | "prominent";
17
+ /**
18
+ * Whether to show a divider at the bottom
19
+ * @default false
20
+ */
21
+ divider?: boolean;
22
+ /**
23
+ * Whether to show elevation/shadow
24
+ * @default true
25
+ */
26
+ elevation?: boolean;
27
+ }
28
+
29
+ /** The AppBar component displays application-wide actions, search and information.
30
+ *
31
+ * // Default import
32
+ * import AppBar from '@carrier-dpx/air-react-library/AppBar'
33
+ *
34
+ * // Named import
35
+ * import { AppBar } from '@carrier-dpx/air-react-library'
36
+ */
37
+
38
+ const AppBar = forwardRef<HTMLDivElement, AppBarProps>(
39
+ ({ sx, color = "primary", size = "basic", divider = false, elevation = true, ...rest }, ref) => {
40
+ // Map size to height
41
+ const getHeight = () => {
42
+ switch (size) {
43
+ case "dense":
44
+ return "48px";
45
+ case "prominent":
46
+ return "128px";
47
+ case "basic":
48
+ default:
49
+ return "64px";
50
+ }
51
+ };
52
+
53
+ return (
54
+ <MuiAppBar
55
+ {...rest}
56
+ enableColorOnDark
57
+ elevation={elevation && color !== "transparent" ? 4 : 0}
58
+ sx={(theme) =>
59
+ ({
60
+ ...getSxStyles(theme, sx),
61
+ height: getHeight(),
62
+ ...(divider && {
63
+ borderBottom: `1px solid ${theme.palette.divider}`,
64
+ }),
65
+ ...(color === "paper" && {
66
+ backgroundColor: theme.palette.base?.background.paper,
67
+ color: theme.palette.base?.text.primary,
68
+ }),
69
+ ...(color === "accent" && {
70
+ backgroundColor: theme.palette.base?.background.accent,
71
+ color: theme.palette.base?.text.primary,
72
+ }),
73
+ ...(color === "transparent" && {
74
+ backgroundColor: "transparent",
75
+ color: theme.palette.base?.text.primary,
76
+ }),
77
+ ...(color === "primary" && {
78
+ backgroundColor: theme.palette.primary.dark,
79
+ color: theme.palette.primary.contrastText,
80
+ }),
81
+ ...(color === "base" && {
82
+ backgroundColor: theme.palette.base?.dark,
83
+ color: theme.palette.base?.contrastText,
84
+ }),
85
+ } as CSSObject)
86
+ }
87
+ ref={ref}
88
+ />
89
+ );
90
+ }
91
+ );
92
+
93
+ AppBar.displayName = "AppBar";
94
+
95
+ export default AppBar;
@@ -0,0 +1,3 @@
1
+ export { default } from "./AppBar";
2
+ export * from "./AppBar";
3
+ export type { AppBarProps } from "./AppBar";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Figma Code Connect Configuration for MenuIcon
3
+ *
4
+ * Figma URL: https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=8-98
5
+ */
6
+
7
+ import figma from "@figma/code-connect";
8
+ import Icon from "../../Icon";
9
+ import { MenuIcon } from "./MenuIcon";
10
+
11
+ figma.connect(
12
+ MenuIcon,
13
+ "https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=8-98",
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
+ <MenuIcon variant={variant} />
30
+ </Icon>
31
+ ),
32
+ }
33
+ );
@@ -0,0 +1,21 @@
1
+ import { FC, SVGProps } from "react";
2
+
3
+ export interface MenuIconProps extends SVGProps<SVGSVGElement> {
4
+ variant?: "outlined" | "filled";
5
+ }
6
+
7
+ export const MenuIcon: FC<MenuIconProps> = ({ 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="M20 16C20.5523 16 21 16.4477 21 17C21 17.5523 20.5523 18 20 18H4C3.44772 18 3 17.5523 3 17C3 16.4477 3.44772 16 4 16H20Z" fill="currentColor"/>
17
+ <path d="M20 11C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H4C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11H20Z" fill="currentColor"/>
18
+ <path d="M20 6C20.5523 6 21 6.44772 21 7C21 7.55228 20.5523 8 20 8H4C3.44772 8 3 7.55228 3 7C3 6.44772 3.44772 6 4 6H20Z" fill="currentColor"/>
19
+ </svg>
20
+ );
21
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Figma Code Connect Configuration for MoreVerticalIcon
3
+ *
4
+ * Figma URL: https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=8-82
5
+ */
6
+
7
+ import figma from "@figma/code-connect";
8
+ import Icon from "../../Icon";
9
+ import { MoreVerticalIcon } from "./MoreVerticalIcon";
10
+
11
+ figma.connect(
12
+ MoreVerticalIcon,
13
+ "https://www.figma.com/design/RT43n0bKuuIt7ylllD3DR0/Icon-Library?node-id=8-82",
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
+ <MoreVerticalIcon variant={variant} />
30
+ </Icon>
31
+ ),
32
+ }
33
+ );
@@ -0,0 +1,21 @@
1
+ import { FC, SVGProps } from "react";
2
+
3
+ export interface MoreVerticalIconProps extends SVGProps<SVGSVGElement> {
4
+ variant?: "outlined" | "filled";
5
+ }
6
+
7
+ export const MoreVerticalIcon: FC<MoreVerticalIconProps> = ({ 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="M12 16C13.1 16 14 16.9 14 18C14 19.1 13.1 20 12 20C10.9 20 10 19.1 10 18C10 16.9 10.9 16 12 16Z" fill="currentColor"/>
17
+ <path d="M12 10C13.1 10 14 10.9 14 12C14 13.1 13.1 14 12 14C10.9 14 10 13.1 10 12C10 10.9 10.9 10 12 10Z" fill="currentColor"/>
18
+ <path d="M12 4C13.1 4 14 4.9 14 6C14 7.1 13.1 8 12 8C10.9 8 10 7.1 10 6C10 4.9 10.9 4 12 4Z" fill="currentColor"/>
19
+ </svg>
20
+ );
21
+ };
@@ -45,6 +45,22 @@ const WarningSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
45
45
  </svg>
46
46
  );
47
47
 
48
+ const MenuSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
49
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: "1em", height: "1em", display: "block", ...style }} {...props}>
50
+ <path d="M20 16C20.5523 16 21 16.4477 21 17C21 17.5523 20.5523 18 20 18H4C3.44772 18 3 17.5523 3 17C3 16.4477 3.44772 16 4 16H20Z" fill="currentColor"/>
51
+ <path d="M20 11C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H4C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11H20Z" fill="currentColor"/>
52
+ <path d="M20 6C20.5523 6 21 6.44772 21 7C21 7.55228 20.5523 8 20 8H4C3.44772 8 3 7.55228 3 7C3 6.44772 3.44772 6 4 6H20Z" fill="currentColor"/>
53
+ </svg>
54
+ );
55
+
56
+ const MoreVerticalSvg: FC<React.SVGProps<SVGSVGElement>> = ({ style, ...props }) => (
57
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: "1em", height: "1em", display: "block", ...style }} {...props}>
58
+ <path d="M12 16C13.1 16 14 16.9 14 18C14 19.1 13.1 20 12 20C10.9 20 10 19.1 10 18C10 16.9 10.9 16 12 16Z" fill="currentColor"/>
59
+ <path d="M12 10C13.1 10 14 10.9 14 12C14 13.1 13.1 14 12 14C10.9 14 10 13.1 10 12C10 10.9 10.9 10 12 10Z" fill="currentColor"/>
60
+ <path d="M12 4C13.1 4 14 4.9 14 6C14 7.1 13.1 8 12 8C10.9 8 10 7.1 10 6C10 4.9 10.9 4 12 4Z" fill="currentColor"/>
61
+ </svg>
62
+ );
63
+
48
64
  // WarningTriangle SVG (previously WarningIcon)
49
65
 
50
66
  export interface IconInfo {
@@ -74,6 +90,16 @@ export const iconRegistry: Record<string, IconInfo> = {
74
90
  component: WarningSvg,
75
91
  variant: "outlined",
76
92
  },
93
+ menu: {
94
+ name: "menu",
95
+ component: MenuSvg,
96
+ variant: "outlined",
97
+ },
98
+ morevertical: {
99
+ name: "morevertical",
100
+ component: MoreVerticalSvg,
101
+ variant: "outlined",
102
+ },
77
103
  };
78
104
 
79
105
  /**
@@ -18,3 +18,9 @@ export type { SiteIconProps } from "./SiteIcon";
18
18
 
19
19
  export { WarningTriangle } from "./WarningTriangle";
20
20
  export type { WarningTriangleProps } from "./WarningTriangle";
21
+
22
+ export { MenuIcon } from "./MenuIcon";
23
+ export type { MenuIconProps } from "./MenuIcon";
24
+
25
+ export { MoreVerticalIcon } from "./MoreVerticalIcon";
26
+ export type { MoreVerticalIconProps } from "./MoreVerticalIcon";
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M20 16C20.5523 16 21 16.4477 21 17C21 17.5523 20.5523 18 20 18H4C3.44772 18 3 17.5523 3 17C3 16.4477 3.44772 16 4 16H20Z" fill="black"/>
3
+ <path d="M20 11C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H4C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11H20Z" fill="black"/>
4
+ <path d="M20 6C20.5523 6 21 6.44772 21 7C21 7.55228 20.5523 8 20 8H4C3.44772 8 3 7.55228 3 7C3 6.44772 3.44772 6 4 6H20Z" fill="black"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12 16C13.1 16 14 16.9 14 18C14 19.1 13.1 20 12 20C10.9 20 10 19.1 10 18C10 16.9 10.9 16 12 16Z" fill="black"/>
3
+ <path d="M12 10C13.1 10 14 10.9 14 12C14 13.1 13.1 14 12 14C10.9 14 10 13.1 10 12C10 10.9 10.9 10 12 10Z" fill="black"/>
4
+ <path d="M12 4C13.1 4 14 4.9 14 6C14 7.1 13.1 8 12 8C10.9 8 10 7.1 10 6C10 4.9 10.9 4 12 4Z" fill="black"/>
5
+ </svg>
@@ -591,13 +591,13 @@ const fleetComponents: Components = {
591
591
  },
592
592
  styleOverrides: {
593
593
  root: {
594
- fontSize: "18px",
594
+ fontSize: "24px",
595
595
  },
596
596
  fontSizeSmall: {
597
- fontSize: "15px",
597
+ fontSize: "20px",
598
598
  },
599
599
  fontSizeLarge: {
600
- fontSize: "21px",
600
+ fontSize: "28px",
601
601
  },
602
602
  fontSizeInherit: {
603
603
  fontSize: "inherit",
@@ -607,7 +607,7 @@ const fleetComponents: Components = {
607
607
  {
608
608
  props: { fontSize: "xsmall" },
609
609
  style: {
610
- fontSize: "12px",
610
+ fontSize: "16px",
611
611
  },
612
612
  },
613
613
  ],
package/src/index.ts CHANGED
@@ -22,6 +22,8 @@ export { default as BottomNavigation } from "./components/BottomNavigation";
22
22
  export { default as BottomNavigationAction } from "./components/BottomNavigation/BottomNavigationAction";
23
23
  export type { BottomNavigationProps } from "./components/BottomNavigation";
24
24
  export type { BottomNavigationActionProps } from "./components/BottomNavigation/BottomNavigationAction";
25
+ export { default as AppBar } from "./components/AppBar";
26
+ export type { AppBarProps } from "./components/AppBar";
25
27
  export * from "./components/theme";
26
28
 
27
29
  // Demo Icons - exported from main index to avoid deep-path imports
@@ -30,6 +32,8 @@ export {
30
32
  DeviceManagerIcon,
31
33
  SiteIcon,
32
34
  WarningTriangle,
35
+ MenuIcon,
36
+ MoreVerticalIcon,
33
37
  SvgIcon,
34
38
  iconRegistry,
35
39
  getIcon,
@@ -40,6 +44,8 @@ export type {
40
44
  DeviceManagerIconProps,
41
45
  SiteIconProps,
42
46
  WarningTriangleProps,
47
+ MenuIconProps,
48
+ MoreVerticalIconProps,
43
49
  SvgIconProps,
44
50
  IconInfo,
45
51
  } from "./components/Icon/icons/demo";