@primer/styled-react 0.0.0-20251205165836 → 0.0.0-20251210204724

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 (60) hide show
  1. package/dist/components/ActionList.js +89 -145
  2. package/dist/components/ActionMenu.js +15 -15
  3. package/dist/components/Autocomplete.js +18 -20
  4. package/dist/components/Avatar.js +13 -11
  5. package/dist/components/BaseStyles.js +28 -47
  6. package/dist/components/Box.js +18 -10
  7. package/dist/components/Breadcrumbs.js +22 -32
  8. package/dist/components/Button.js +41 -105
  9. package/dist/components/Checkbox.js +14 -12
  10. package/dist/components/CheckboxGroup.js +34 -36
  11. package/dist/components/CircleBadge.js +10 -10
  12. package/dist/components/CounterLabel.js +13 -11
  13. package/dist/components/DataTable.js +19 -27
  14. package/dist/components/Dialog.js +53 -79
  15. package/dist/components/Flash.js +9 -9
  16. package/dist/components/FormControl.js +15 -15
  17. package/dist/components/Header.js +36 -44
  18. package/dist/components/Heading.js +9 -9
  19. package/dist/components/IconButton.js +23 -36
  20. package/dist/components/Label.js +17 -22
  21. package/dist/components/Link.js +17 -22
  22. package/dist/components/LinkButton.js +9 -9
  23. package/dist/components/NavList.js +46 -65
  24. package/dist/components/Overlay.js +9 -9
  25. package/dist/components/PageHeader.js +62 -100
  26. package/dist/components/RadioGroup.js +34 -36
  27. package/dist/components/RelativeTime.js +11 -11
  28. package/dist/components/SegmentedControl.js +27 -25
  29. package/dist/components/Select.js +15 -20
  30. package/dist/components/Spinner.js +9 -9
  31. package/dist/components/StateLabel.js +13 -11
  32. package/dist/components/SubNav.js +23 -21
  33. package/dist/components/Text.js +17 -22
  34. package/dist/components/TextInput.js +25 -32
  35. package/dist/components/Textarea.js +17 -22
  36. package/dist/components/ThemeProvider.js +132 -185
  37. package/dist/components/Timeline.js +40 -38
  38. package/dist/components/ToggleSwitch.js +13 -11
  39. package/dist/components/Token.js +17 -22
  40. package/dist/components/Tooltip.js +14 -12
  41. package/dist/components/Truncate.js +9 -9
  42. package/dist/components/UnderlineNav.js +27 -39
  43. package/dist/components/UnderlinePanels.js +18 -23
  44. package/dist/components/deprecated/ActionList.js +34 -39
  45. package/dist/components/deprecated/DialogV1.js +28 -38
  46. package/dist/components/deprecated/Octicon.js +28 -35
  47. package/dist/components/deprecated/TabNav.js +24 -38
  48. package/dist/components/deprecated/Tooltip.js +20 -28
  49. package/dist/deprecated.d.ts +75 -5
  50. package/dist/deprecated.d.ts.map +1 -1
  51. package/dist/deprecated.js +7 -5
  52. package/dist/experimental.d.ts +120 -5
  53. package/dist/experimental.d.ts.map +1 -1
  54. package/dist/experimental.js +7 -5
  55. package/dist/index.d.ts +582 -47
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +48 -46
  58. package/dist/sx.js +7 -6
  59. package/dist/theme-get.js +8 -8
  60. package/package.json +7 -4
@@ -1,52 +1,44 @@
1
- import { Header as Header$1 } from '@primer/react';
2
- import { forwardRef } from 'react';
3
- import Box from './Box.js';
4
- import { jsx } from 'react/jsx-runtime';
1
+ import { Box } from "./Box.js";
2
+ import { Header } from "@primer/react";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
5
 
6
- const StyledHeader = /*#__PURE__*/forwardRef(function Header(props, ref) {
7
- return /*#__PURE__*/jsx(Box, {
8
- as: Header$1,
9
- ref: ref,
10
- ...props
11
- });
6
+ //#region src/components/Header.tsx
7
+ const StyledHeader = /* @__PURE__ */ forwardRef(function Header$2(props, ref) {
8
+ return /* @__PURE__ */ jsx(Box, {
9
+ as: Header,
10
+ ref,
11
+ ...props
12
+ });
12
13
  });
13
- const HeaderImpl = /*#__PURE__*/forwardRef(({
14
- as,
15
- ...props
16
- }, ref) => /*#__PURE__*/jsx(StyledHeader, {
17
- ...props,
18
- ...(as ? {
19
- forwardedAs: as
20
- } : {}),
21
- ref: ref
14
+ const HeaderImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledHeader, {
15
+ ...props,
16
+ ...as ? { forwardedAs: as } : {},
17
+ ref
22
18
  }));
23
- const HeaderItem = /*#__PURE__*/forwardRef(function HeaderItem(props, ref) {
24
- return /*#__PURE__*/jsx(Box, {
25
- as: Header$1.Item,
26
- ref: ref,
27
- ...props
28
- });
19
+ const HeaderItem = /* @__PURE__ */ forwardRef(function HeaderItem$1(props, ref) {
20
+ return /* @__PURE__ */ jsx(Box, {
21
+ as: Header.Item,
22
+ ref,
23
+ ...props
24
+ });
29
25
  });
30
- const StyledHeaderLink = /*#__PURE__*/forwardRef(function HeaderLink(props, ref) {
31
- return /*#__PURE__*/jsx(Box, {
32
- as: Header$1.Link,
33
- ref: ref,
34
- ...props
35
- });
26
+ const StyledHeaderLink = /* @__PURE__ */ forwardRef(function HeaderLink$1(props, ref) {
27
+ return /* @__PURE__ */ jsx(Box, {
28
+ as: Header.Link,
29
+ ref,
30
+ ...props
31
+ });
36
32
  });
37
- const HeaderLink = /*#__PURE__*/forwardRef(({
38
- as,
39
- ...props
40
- }, ref) => /*#__PURE__*/jsx(StyledHeaderLink, {
41
- ...props,
42
- ...(as ? {
43
- forwardedAs: as
44
- } : {}),
45
- ref: ref
33
+ const HeaderLink = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledHeaderLink, {
34
+ ...props,
35
+ ...as ? { forwardedAs: as } : {},
36
+ ref
46
37
  }));
47
- const Header = Object.assign(HeaderImpl, {
48
- Item: HeaderItem,
49
- Link: HeaderLink
38
+ const Header$1 = Object.assign(HeaderImpl, {
39
+ Item: HeaderItem,
40
+ Link: HeaderLink
50
41
  });
51
42
 
52
- export { Header };
43
+ //#endregion
44
+ export { Header$1 as Header };
@@ -1,12 +1,12 @@
1
- import { Heading as Heading$1 } from '@primer/react';
2
- import sx from '../sx.js';
3
- import styled from 'styled-components';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Heading } from "@primer/react";
4
4
 
5
- const Heading = styled(Heading$1).withConfig({
6
- shouldForwardProp: prop => prop !== 'sx'
7
- }).withConfig({
8
- displayName: "Heading",
9
- componentId: "sc-1vc165i-0"
5
+ //#region src/components/Heading.tsx
6
+ const Heading$1 = styled(Heading).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
+ displayName: "Heading",
8
+ componentId: "sc-1vc165i-0"
10
9
  })(["", ""], sx);
11
10
 
12
- export { Heading };
11
+ //#endregion
12
+ export { Heading$1 as Heading };
@@ -1,40 +1,27 @@
1
- import { IconButton as IconButton$1 } from '@primer/react';
2
- import { generateCustomSxProp } from './Button.js';
3
- import { forwardRef } from 'react';
4
- import styled from 'styled-components';
5
- import sx from '../sx.js';
6
- import { jsx } from 'react/jsx-runtime';
1
+ import { sx } from "../sx.js";
2
+ import { generateCustomSxProp } from "./Button.js";
3
+ import styled from "styled-components";
4
+ import { IconButton } from "@primer/react";
5
+ import { forwardRef } from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
7
 
8
- const StyledIconButton = styled(IconButton$1).withConfig({
9
- shouldForwardProp: prop => prop !== 'sx'
10
- }).withConfig({
11
- displayName: "IconButton__StyledIconButton",
12
- componentId: "sc-i53dt6-0"
8
+ //#region src/components/IconButton.tsx
9
+ const StyledIconButton = styled(IconButton).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
10
+ displayName: "IconButton__StyledIconButton",
11
+ componentId: "sc-i53dt6-0"
13
12
  })(["", ""], sx);
14
- const IconButton = /*#__PURE__*/forwardRef(({
15
- as,
16
- sx,
17
- ...props
18
- }, ref) => {
19
- let sxStyles = sx;
20
- // grap the button props that have associated data attributes in the styles
21
- const {
22
- size = 'medium'
23
- } = props;
24
- if (sx !== null && sx !== undefined && Object.keys(sx).length > 0) {
25
- sxStyles = generateCustomSxProp({
26
- size
27
- }, sx);
28
- }
29
- return /*#__PURE__*/jsx(StyledIconButton, {
30
- sx: sxStyles,
31
- ...props,
32
- ...(as ? {
33
- forwardedAs: as
34
- } : {}),
35
- ref: ref
36
- });
13
+ const IconButton$1 = /* @__PURE__ */ forwardRef(({ as, sx: sx$1, ...props }, ref) => {
14
+ let sxStyles = sx$1;
15
+ const { size = "medium" } = props;
16
+ if (sx$1 !== null && sx$1 !== void 0 && Object.keys(sx$1).length > 0) sxStyles = generateCustomSxProp({ size }, sx$1);
17
+ return /* @__PURE__ */ jsx(StyledIconButton, {
18
+ sx: sxStyles,
19
+ ...props,
20
+ ...as ? { forwardedAs: as } : {},
21
+ ref
22
+ });
37
23
  });
38
- IconButton.__SLOT__ = IconButton$1.__SLOT__;
24
+ IconButton$1.__SLOT__ = IconButton.__SLOT__;
39
25
 
40
- export { IconButton };
26
+ //#endregion
27
+ export { IconButton$1 as IconButton };
@@ -1,26 +1,21 @@
1
- import { Label as Label$1 } from '@primer/react';
2
- import sx from '../sx.js';
3
- import { forwardRef } from 'react';
4
- import styled from 'styled-components';
5
- import { jsx } from 'react/jsx-runtime';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Label } from "@primer/react";
4
+ import { forwardRef } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
 
7
- const StyledLabel = styled(Label$1).withConfig({
8
- shouldForwardProp: prop => prop !== 'sx'
9
- }).withConfig({
10
- displayName: "Label__StyledLabel",
11
- componentId: "sc-1cpass9-0"
7
+ //#region src/components/Label.tsx
8
+ const StyledLabel = styled(Label).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
+ displayName: "Label__StyledLabel",
10
+ componentId: "sc-1cpass9-0"
12
11
  })(["", ""], sx);
13
- const Label = /*#__PURE__*/forwardRef(({
14
- as,
15
- ...props
16
- }, ref) => {
17
- return /*#__PURE__*/jsx(StyledLabel, {
18
- ...props,
19
- ...(as ? {
20
- forwardedAs: as
21
- } : {}),
22
- ref: ref
23
- });
12
+ const Label$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
+ return /* @__PURE__ */ jsx(StyledLabel, {
14
+ ...props,
15
+ ...as ? { forwardedAs: as } : {},
16
+ ref
17
+ });
24
18
  });
25
19
 
26
- export { Label };
20
+ //#endregion
21
+ export { Label$1 as Label };
@@ -1,26 +1,21 @@
1
- import { Link as Link$1 } from '@primer/react';
2
- import styled from 'styled-components';
3
- import sx from '../sx.js';
4
- import { forwardRef } from 'react';
5
- import { jsx } from 'react/jsx-runtime';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Link } from "@primer/react";
4
+ import { forwardRef } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
 
7
- const StyledLink = styled(Link$1).withConfig({
8
- shouldForwardProp: prop => prop !== 'sx'
9
- }).withConfig({
10
- displayName: "Link__StyledLink",
11
- componentId: "sc-1syctfj-0"
7
+ //#region src/components/Link.tsx
8
+ const StyledLink = styled(Link).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
+ displayName: "Link__StyledLink",
10
+ componentId: "sc-1syctfj-0"
12
11
  })(["", ""], sx);
13
- const Link = /*#__PURE__*/forwardRef(({
14
- as,
15
- ...props
16
- }, ref) => {
17
- return /*#__PURE__*/jsx(StyledLink, {
18
- ...props,
19
- ...(as ? {
20
- forwardedAs: as
21
- } : {}),
22
- ref: ref
23
- });
12
+ const Link$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
+ return /* @__PURE__ */ jsx(StyledLink, {
14
+ ...props,
15
+ ...as ? { forwardedAs: as } : {},
16
+ ref
17
+ });
24
18
  });
25
19
 
26
- export { Link };
20
+ //#endregion
21
+ export { Link$1 as Link };
@@ -1,12 +1,12 @@
1
- import { LinkButton as LinkButton$1 } from '@primer/react';
2
- import styled from 'styled-components';
3
- import sx from '../sx.js';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { LinkButton } from "@primer/react";
4
4
 
5
- const LinkButton = styled(LinkButton$1).withConfig({
6
- shouldForwardProp: prop => prop !== 'sx'
7
- }).withConfig({
8
- displayName: "LinkButton",
9
- componentId: "sc-1v6zkmg-0"
5
+ //#region src/components/LinkButton.tsx
6
+ const LinkButton$1 = styled(LinkButton).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
+ displayName: "LinkButton",
8
+ componentId: "sc-1v6zkmg-0"
10
9
  })(["", ""], sx);
11
10
 
12
- export { LinkButton };
11
+ //#endregion
12
+ export { LinkButton$1 as LinkButton };
@@ -1,74 +1,55 @@
1
- import { NavList as NavList$1 } from '@primer/react';
2
- import { forwardRef } from 'react';
3
- import styled from 'styled-components';
4
- import sx from '../sx.js';
5
- import { jsx } from 'react/jsx-runtime';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { NavList } from "@primer/react";
4
+ import { forwardRef } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
 
7
- const StyledNavListImpl = styled(NavList$1).withConfig({
8
- shouldForwardProp: prop => prop !== 'sx'
9
- }).withConfig({
10
- displayName: "NavList__StyledNavListImpl",
11
- componentId: "sc-86jrwg-0"
7
+ //#region src/components/NavList.tsx
8
+ const StyledNavListImpl = styled(NavList).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
+ displayName: "NavList__StyledNavListImpl",
10
+ componentId: "sc-86jrwg-0"
12
11
  })(["", ""], sx);
13
- const NavListImpl = /*#__PURE__*/forwardRef(function NavList({
14
- as,
15
- ...props
16
- }, ref) {
17
- return /*#__PURE__*/jsx(StyledNavListImpl, {
18
- ref: ref,
19
- ...(as ? {
20
- forwardedAs: as
21
- } : {}),
22
- ...props
23
- });
12
+ const NavListImpl = /* @__PURE__ */ forwardRef(function NavList$2({ as, ...props }, ref) {
13
+ return /* @__PURE__ */ jsx(StyledNavListImpl, {
14
+ ref,
15
+ ...as ? { forwardedAs: as } : {},
16
+ ...props
17
+ });
24
18
  });
25
- const StyledNavListItem = styled(NavList$1.Item).withConfig({
26
- shouldForwardProp: prop => prop !== 'sx'
27
- }).withConfig({
28
- displayName: "NavList__StyledNavListItem",
29
- componentId: "sc-86jrwg-1"
19
+ const StyledNavListItem = styled(NavList.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
20
+ displayName: "NavList__StyledNavListItem",
21
+ componentId: "sc-86jrwg-1"
30
22
  })(["", ""], sx);
31
- const NavListItem = /*#__PURE__*/forwardRef(({
32
- as,
33
- ...props
34
- }, ref) => {
35
- return /*#__PURE__*/jsx(StyledNavListItem, {
36
- ...props,
37
- ...(as ? {
38
- forwardedAs: as
39
- } : {}),
40
- ref: ref
41
- });
23
+ const NavListItem = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
24
+ return /* @__PURE__ */ jsx(StyledNavListItem, {
25
+ ...props,
26
+ ...as ? { forwardedAs: as } : {},
27
+ ref
28
+ });
42
29
  });
43
- const StyledNavListLeadingVisual = styled(NavList$1.LeadingVisual).withConfig({
44
- shouldForwardProp: prop => prop !== 'sx'
45
- }).withConfig({
46
- displayName: "NavList__StyledNavListLeadingVisual",
47
- componentId: "sc-86jrwg-2"
30
+ const StyledNavListLeadingVisual = styled(NavList.LeadingVisual).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
31
+ displayName: "NavList__StyledNavListLeadingVisual",
32
+ componentId: "sc-86jrwg-2"
48
33
  })(["", ""], sx);
49
- const NavListLeadingVisual = /*#__PURE__*/forwardRef(({
50
- as,
51
- ...props
52
- }, ref) => {
53
- return /*#__PURE__*/jsx(StyledNavListLeadingVisual, {
54
- ...props,
55
- ...(as ? {
56
- forwardedAs: as
57
- } : {}),
58
- ref: ref
59
- });
34
+ const NavListLeadingVisual = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
35
+ return /* @__PURE__ */ jsx(StyledNavListLeadingVisual, {
36
+ ...props,
37
+ ...as ? { forwardedAs: as } : {},
38
+ ref
39
+ });
60
40
  });
61
- NavListLeadingVisual.__SLOT__ = NavList$1.LeadingVisual.__SLOT__;
62
- const NavList = Object.assign(NavListImpl, {
63
- Item: NavListItem,
64
- Group: NavList$1.Group,
65
- GroupHeading: NavList$1.GroupHeading,
66
- LeadingVisual: NavListLeadingVisual,
67
- SubNav: NavList$1.SubNav,
68
- Divider: NavList$1.Divider,
69
- TrailingVisual: NavList$1.TrailingVisual,
70
- TrailingAction: NavList$1.TrailingAction,
71
- GroupExpand: NavList$1.GroupExpand
41
+ NavListLeadingVisual.__SLOT__ = NavList.LeadingVisual.__SLOT__;
42
+ const NavList$1 = Object.assign(NavListImpl, {
43
+ Item: NavListItem,
44
+ Group: NavList.Group,
45
+ GroupHeading: NavList.GroupHeading,
46
+ LeadingVisual: NavListLeadingVisual,
47
+ SubNav: NavList.SubNav,
48
+ Divider: NavList.Divider,
49
+ TrailingVisual: NavList.TrailingVisual,
50
+ TrailingAction: NavList.TrailingAction,
51
+ GroupExpand: NavList.GroupExpand
72
52
  });
73
53
 
74
- export { NavList };
54
+ //#endregion
55
+ export { NavList$1 as NavList };
@@ -1,12 +1,12 @@
1
- import { Overlay as Overlay$1 } from '@primer/react';
2
- import styled from 'styled-components';
3
- import sx from '../sx.js';
1
+ import { sx } from "../sx.js";
2
+ import styled from "styled-components";
3
+ import { Overlay } from "@primer/react";
4
4
 
5
- const Overlay = styled(Overlay$1).withConfig({
6
- shouldForwardProp: prop => prop !== 'sx'
7
- }).withConfig({
8
- displayName: "Overlay",
9
- componentId: "sc-tjbd74-0"
5
+ //#region src/components/Overlay.tsx
6
+ const Overlay$1 = styled(Overlay).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
+ displayName: "Overlay",
8
+ componentId: "sc-tjbd74-0"
10
9
  })(["", ""], sx);
11
10
 
12
- export { Overlay };
11
+ //#endregion
12
+ export { Overlay$1 as Overlay };
@@ -1,109 +1,71 @@
1
- import { PageHeader as PageHeader$1 } from '@primer/react';
2
- import styled from 'styled-components';
3
- import sx from '../sx.js';
4
- import Box from './Box.js';
5
- import React from 'react';
6
- import { jsx } from 'react/jsx-runtime';
1
+ import { sx } from "../sx.js";
2
+ import { Box } from "./Box.js";
3
+ import styled from "styled-components";
4
+ import { PageHeader } from "@primer/react";
5
+ import React from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
7
 
8
- const StyledPageHeader = styled(PageHeader$1).withConfig({
9
- shouldForwardProp: prop => prop !== 'sx'
10
- }).withConfig({
11
- displayName: "PageHeader__StyledPageHeader",
12
- componentId: "sc-1g9symn-0"
8
+ //#region src/components/PageHeader.tsx
9
+ const StyledPageHeader = styled(PageHeader).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
10
+ displayName: "PageHeader__StyledPageHeader",
11
+ componentId: "sc-1g9symn-0"
13
12
  })(["", ""], sx);
14
- const PageHeaderImpl = /*#__PURE__*/React.forwardRef(({
15
- as,
16
- ...props
17
- }, ref) => /*#__PURE__*/jsx(StyledPageHeader, {
18
- ...props,
19
- ...(as ? {
20
- forwardedAs: as
21
- } : {}),
22
- ref: ref
13
+ const PageHeaderImpl = /* @__PURE__ */ React.forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledPageHeader, {
14
+ ...props,
15
+ ...as ? { forwardedAs: as } : {},
16
+ ref
23
17
  }));
24
- function PageHeaderActions({
25
- sx,
26
- ...rest
27
- }) {
28
- const style = {};
29
- if (sx) {
30
- // @ts-ignore sx has height attribute
31
- const {
32
- height
33
- } = sx;
34
- if (height) {
35
- style['--custom-height'] = height;
36
- }
37
- }
38
-
39
- // @ts-expect-error type mismatch between Box usage here and PrimerPageHeader.Actions
40
- return /*#__PURE__*/jsx(Box, {
41
- ...rest,
42
- as: PageHeader$1.Actions,
43
- style: style,
44
- sx: sx
45
- });
18
+ function PageHeaderActions({ sx: sx$1, ...rest }) {
19
+ const style = {};
20
+ if (sx$1) {
21
+ const { height } = sx$1;
22
+ if (height) style["--custom-height"] = height;
23
+ }
24
+ return /* @__PURE__ */ jsx(Box, {
25
+ ...rest,
26
+ as: PageHeader.Actions,
27
+ style,
28
+ sx: sx$1
29
+ });
46
30
  }
47
- function StyledPageHeaderTitle({
48
- sx,
49
- ...rest
50
- }) {
51
- const style = {};
52
- if (sx) {
53
- // @ts-ignore sx can have color attribute
54
- const {
55
- fontSize,
56
- lineHeight,
57
- fontWeight
58
- } = sx;
59
- if (fontSize) {
60
- style['--custom-font-size'] = fontSize;
61
- }
62
- if (lineHeight) {
63
- style['--custom-line-height'] = lineHeight;
64
- }
65
- if (fontWeight) {
66
- style['--custom-font-weight'] = fontWeight;
67
- }
68
- }
69
-
70
- // @ts-expect-error type mismatch between Box usage here and PrimerPageHeader.Title
71
- return /*#__PURE__*/jsx(Box, {
72
- ...rest,
73
- as: PageHeader$1.Title,
74
- style: style,
75
- sx: sx
76
- });
31
+ function StyledPageHeaderTitle({ sx: sx$1, ...rest }) {
32
+ const style = {};
33
+ if (sx$1) {
34
+ const { fontSize, lineHeight, fontWeight } = sx$1;
35
+ if (fontSize) style["--custom-font-size"] = fontSize;
36
+ if (lineHeight) style["--custom-line-height"] = lineHeight;
37
+ if (fontWeight) style["--custom-font-weight"] = fontWeight;
38
+ }
39
+ return /* @__PURE__ */ jsx(Box, {
40
+ ...rest,
41
+ as: PageHeader.Title,
42
+ style,
43
+ sx: sx$1
44
+ });
77
45
  }
78
- const PageHeaderTitle = ({
79
- as,
80
- ...props
81
- }) => /*#__PURE__*/jsx(StyledPageHeaderTitle, {
82
- ...props,
83
- ...(as ? {
84
- forwardedAs: as
85
- } : {})
46
+ const PageHeaderTitle = ({ as, ...props }) => /* @__PURE__ */ jsx(StyledPageHeaderTitle, {
47
+ ...props,
48
+ ...as ? { forwardedAs: as } : {}
86
49
  });
87
- const PageHeaderTitleArea = styled(PageHeader$1.TitleArea).withConfig({
88
- shouldForwardProp: prop => prop !== 'sx'
89
- }).withConfig({
90
- displayName: "PageHeader__PageHeaderTitleArea",
91
- componentId: "sc-1g9symn-1"
50
+ const PageHeaderTitleArea = styled(PageHeader.TitleArea).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
51
+ displayName: "PageHeader__PageHeaderTitleArea",
52
+ componentId: "sc-1g9symn-1"
92
53
  })(["", ""], sx);
93
- const PageHeader = Object.assign(PageHeaderImpl, {
94
- Actions: PageHeaderActions,
95
- ContextArea: PageHeader$1.ContextArea,
96
- ParentLink: PageHeader$1.ParentLink,
97
- ContextBar: PageHeader$1.ContextBar,
98
- TitleArea: PageHeaderTitleArea,
99
- ContextAreaActions: PageHeader$1.ContextAreaActions,
100
- LeadingAction: PageHeader$1.LeadingAction,
101
- Breadcrumbs: PageHeader$1.Breadcrumbs,
102
- LeadingVisual: PageHeader$1.LeadingVisual,
103
- Title: PageHeaderTitle,
104
- TrailingVisual: PageHeader$1.TrailingVisual,
105
- Description: PageHeader$1.Description,
106
- TrailingAction: PageHeader$1.TrailingAction
54
+ const PageHeader$1 = Object.assign(PageHeaderImpl, {
55
+ Actions: PageHeaderActions,
56
+ ContextArea: PageHeader.ContextArea,
57
+ ParentLink: PageHeader.ParentLink,
58
+ ContextBar: PageHeader.ContextBar,
59
+ TitleArea: PageHeaderTitleArea,
60
+ ContextAreaActions: PageHeader.ContextAreaActions,
61
+ LeadingAction: PageHeader.LeadingAction,
62
+ Breadcrumbs: PageHeader.Breadcrumbs,
63
+ LeadingVisual: PageHeader.LeadingVisual,
64
+ Title: PageHeaderTitle,
65
+ TrailingVisual: PageHeader.TrailingVisual,
66
+ Description: PageHeader.Description,
67
+ TrailingAction: PageHeader.TrailingAction
107
68
  });
108
69
 
109
- export { PageHeader };
70
+ //#endregion
71
+ export { PageHeader$1 as PageHeader };