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

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 (83) hide show
  1. package/dist/components/ActionList.js +145 -89
  2. package/dist/components/ActionMenu.js +15 -15
  3. package/dist/components/Avatar.js +11 -13
  4. package/dist/components/BaseStyles.js +47 -28
  5. package/dist/components/Box.js +10 -18
  6. package/dist/components/Breadcrumbs.js +32 -22
  7. package/dist/components/Button.js +105 -41
  8. package/dist/components/Button.stories.d.ts +8 -0
  9. package/dist/components/Button.stories.d.ts.map +1 -0
  10. package/dist/components/CounterLabel.js +11 -13
  11. package/dist/components/DataTable.js +27 -19
  12. package/dist/components/Dialog.js +79 -53
  13. package/dist/components/Flash.js +9 -9
  14. package/dist/components/FormControl.js +15 -15
  15. package/dist/components/Header.js +44 -36
  16. package/dist/components/Heading.js +9 -9
  17. package/dist/components/IconButton.js +36 -23
  18. package/dist/components/Label.js +22 -17
  19. package/dist/components/Link.js +22 -17
  20. package/dist/components/LinkButton.js +9 -9
  21. package/dist/components/Overlay.js +9 -9
  22. package/dist/components/PageHeader.js +100 -62
  23. package/dist/components/SegmentedControl.js +25 -27
  24. package/dist/components/Spinner.js +9 -9
  25. package/dist/components/Text.js +22 -17
  26. package/dist/components/TextInput.js +32 -25
  27. package/dist/components/Textarea.js +22 -17
  28. package/dist/components/ThemeProvider.js +185 -132
  29. package/dist/components/Timeline.js +38 -40
  30. package/dist/components/ToggleSwitch.js +11 -13
  31. package/dist/components/Token.js +22 -17
  32. package/dist/components/Tooltip.js +12 -14
  33. package/dist/components/Truncate.js +9 -9
  34. package/dist/components/UnderlineNav.js +39 -27
  35. package/dist/components/deprecated/ActionList.js +39 -34
  36. package/dist/components/deprecated/DialogV1.js +38 -28
  37. package/dist/components/deprecated/Octicon.js +35 -28
  38. package/dist/components/deprecated/TabNav.js +38 -24
  39. package/dist/components/deprecated/Tooltip.js +28 -20
  40. package/dist/components.json +2 -28
  41. package/dist/deprecated.js +5 -7
  42. package/dist/experimental.d.ts +0 -21
  43. package/dist/experimental.d.ts.map +1 -1
  44. package/dist/experimental.js +4 -7
  45. package/dist/index.d.ts +0 -122
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +36 -48
  48. package/dist/sx.js +6 -7
  49. package/dist/theme-get.js +8 -8
  50. package/package.json +11 -7
  51. package/dist/components/Autocomplete.d.ts +0 -17
  52. package/dist/components/Autocomplete.d.ts.map +0 -1
  53. package/dist/components/Autocomplete.js +0 -23
  54. package/dist/components/Checkbox.d.ts +0 -5
  55. package/dist/components/Checkbox.d.ts.map +0 -1
  56. package/dist/components/Checkbox.js +0 -17
  57. package/dist/components/CheckboxGroup.d.ts +0 -34
  58. package/dist/components/CheckboxGroup.d.ts.map +0 -1
  59. package/dist/components/CheckboxGroup.js +0 -41
  60. package/dist/components/CircleBadge.d.ts +0 -8
  61. package/dist/components/CircleBadge.d.ts.map +0 -1
  62. package/dist/components/CircleBadge.js +0 -12
  63. package/dist/components/NavList.d.ts +0 -30
  64. package/dist/components/NavList.d.ts.map +0 -1
  65. package/dist/components/NavList.js +0 -55
  66. package/dist/components/RadioGroup.d.ts +0 -34
  67. package/dist/components/RadioGroup.d.ts.map +0 -1
  68. package/dist/components/RadioGroup.js +0 -41
  69. package/dist/components/RelativeTime.d.ts +0 -6
  70. package/dist/components/RelativeTime.d.ts.map +0 -1
  71. package/dist/components/RelativeTime.js +0 -14
  72. package/dist/components/Select.d.ts +0 -8
  73. package/dist/components/Select.d.ts.map +0 -1
  74. package/dist/components/Select.js +0 -19
  75. package/dist/components/StateLabel.d.ts +0 -10
  76. package/dist/components/StateLabel.d.ts.map +0 -1
  77. package/dist/components/StateLabel.js +0 -16
  78. package/dist/components/SubNav.d.ts +0 -10
  79. package/dist/components/SubNav.d.ts.map +0 -1
  80. package/dist/components/SubNav.js +0 -28
  81. package/dist/components/UnderlinePanels.d.ts +0 -14
  82. package/dist/components/UnderlinePanels.d.ts.map +0 -1
  83. package/dist/components/UnderlinePanels.js +0 -23
@@ -1,71 +1,109 @@
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";
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';
7
7
 
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"
8
+ const StyledPageHeader = styled(PageHeader$1).withConfig({
9
+ shouldForwardProp: prop => prop !== 'sx'
10
+ }).withConfig({
11
+ displayName: "PageHeader__StyledPageHeader",
12
+ componentId: "sc-1g9symn-0"
12
13
  })(["", ""], sx);
13
- const PageHeaderImpl = /* @__PURE__ */ React.forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledPageHeader, {
14
- ...props,
15
- ...as ? { forwardedAs: as } : {},
16
- ref
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
17
23
  }));
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
- });
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
+ });
30
46
  }
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
- });
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
+ });
45
77
  }
46
- const PageHeaderTitle = ({ as, ...props }) => /* @__PURE__ */ jsx(StyledPageHeaderTitle, {
47
- ...props,
48
- ...as ? { forwardedAs: as } : {}
78
+ const PageHeaderTitle = ({
79
+ as,
80
+ ...props
81
+ }) => /*#__PURE__*/jsx(StyledPageHeaderTitle, {
82
+ ...props,
83
+ ...(as ? {
84
+ forwardedAs: as
85
+ } : {})
49
86
  });
50
- const PageHeaderTitleArea = styled(PageHeader.TitleArea).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
51
- displayName: "PageHeader__PageHeaderTitleArea",
52
- componentId: "sc-1g9symn-1"
87
+ const PageHeaderTitleArea = styled(PageHeader$1.TitleArea).withConfig({
88
+ shouldForwardProp: prop => prop !== 'sx'
89
+ }).withConfig({
90
+ displayName: "PageHeader__PageHeaderTitleArea",
91
+ componentId: "sc-1g9symn-1"
53
92
  })(["", ""], sx);
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
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
68
107
  });
69
108
 
70
- //#endregion
71
- export { PageHeader$1 as PageHeader };
109
+ export { PageHeader };
@@ -1,33 +1,31 @@
1
- import { Box } from "./Box.js";
2
- import { SegmentedControl } from "@primer/react";
3
- import { jsx } from "react/jsx-runtime";
1
+ import { SegmentedControl as SegmentedControl$1 } from '@primer/react';
2
+ import { Box } from './Box.js';
3
+ import { jsx } from 'react/jsx-runtime';
4
4
 
5
- //#region src/components/SegmentedControl.tsx
6
- const SegmentedControlButton = (props) => {
7
- return /* @__PURE__ */ jsx(Box, {
8
- as: SegmentedControl.Button,
9
- ...props
10
- });
5
+ const SegmentedControlButton = props => {
6
+ return /*#__PURE__*/jsx(Box, {
7
+ as: SegmentedControl$1.Button,
8
+ ...props
9
+ });
11
10
  };
12
- const SegmentedControlIconButton = (props) => {
13
- return /* @__PURE__ */ jsx(Box, {
14
- as: SegmentedControl.IconButton,
15
- ...props
16
- });
11
+ const SegmentedControlIconButton = props => {
12
+ return /*#__PURE__*/jsx(Box, {
13
+ as: SegmentedControl$1.IconButton,
14
+ ...props
15
+ });
17
16
  };
18
- const SegmentedControlImpl = (props) => {
19
- return /* @__PURE__ */ jsx(Box, {
20
- as: SegmentedControl,
21
- ...props
22
- });
17
+ const SegmentedControlImpl = props => {
18
+ return /*#__PURE__*/jsx(Box, {
19
+ as: SegmentedControl$1,
20
+ ...props
21
+ });
23
22
  };
24
- const SegmentedControl$1 = Object.assign(SegmentedControlImpl, {
25
- __SLOT__: SegmentedControl.__SLOT__,
26
- Button: SegmentedControlButton,
27
- IconButton: SegmentedControlIconButton
23
+ const SegmentedControl = Object.assign(SegmentedControlImpl, {
24
+ __SLOT__: SegmentedControl$1.__SLOT__,
25
+ Button: SegmentedControlButton,
26
+ IconButton: SegmentedControlIconButton
28
27
  });
29
- SegmentedControlButton.__SLOT__ = SegmentedControl.Button.__SLOT__;
30
- SegmentedControlIconButton.__SLOT__ = SegmentedControl.IconButton.__SLOT__;
28
+ SegmentedControlButton.__SLOT__ = SegmentedControl$1.Button.__SLOT__;
29
+ SegmentedControlIconButton.__SLOT__ = SegmentedControl$1.IconButton.__SLOT__;
31
30
 
32
- //#endregion
33
- export { SegmentedControl$1 as SegmentedControl };
31
+ export { SegmentedControl };
@@ -1,12 +1,12 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { Spinner } from "@primer/react";
1
+ import { Spinner as Spinner$1 } from '@primer/react';
2
+ import { sx } from '../sx.js';
3
+ import styled from 'styled-components';
4
4
 
5
- //#region src/components/Spinner.tsx
6
- const Spinner$1 = styled(Spinner).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
- displayName: "Spinner",
8
- componentId: "sc-jbw2a0-0"
5
+ const Spinner = styled(Spinner$1).withConfig({
6
+ shouldForwardProp: prop => prop !== 'sx'
7
+ }).withConfig({
8
+ displayName: "Spinner",
9
+ componentId: "sc-jbw2a0-0"
9
10
  })(["", ""], sx);
10
11
 
11
- //#endregion
12
- export { Spinner$1 as Spinner };
12
+ export { Spinner };
@@ -1,21 +1,26 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { Text } from "@primer/react";
4
- import { forwardRef } from "react";
5
- import { jsx } from "react/jsx-runtime";
1
+ import { Text as Text$1 } from '@primer/react';
2
+ import { sx } from '../sx.js';
3
+ import styled from 'styled-components';
4
+ import { forwardRef } from 'react';
5
+ import { jsx } from 'react/jsx-runtime';
6
6
 
7
- //#region src/components/Text.tsx
8
- const StyledText = styled(Text).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
- displayName: "Text__StyledText",
10
- componentId: "sc-1klmep6-0"
7
+ const StyledText = styled(Text$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "Text__StyledText",
11
+ componentId: "sc-1klmep6-0"
11
12
  })(["", ""], sx);
12
- const Text$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
- return /* @__PURE__ */ jsx(StyledText, {
14
- ...props,
15
- ...as ? { forwardedAs: as } : {},
16
- ref
17
- });
13
+ const Text = /*#__PURE__*/forwardRef(({
14
+ as,
15
+ ...props
16
+ }, ref) => {
17
+ return /*#__PURE__*/jsx(StyledText, {
18
+ ...props,
19
+ ...(as ? {
20
+ forwardedAs: as
21
+ } : {}),
22
+ ref: ref
23
+ });
18
24
  });
19
25
 
20
- //#endregion
21
- export { Text$1 as Text };
26
+ export { Text };
@@ -1,31 +1,38 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { TextInput } from "@primer/react";
4
- import { forwardRef } from "react";
5
- import { jsx } from "react/jsx-runtime";
1
+ import { TextInput as TextInput$1 } from '@primer/react';
2
+ import { forwardRef } from 'react';
3
+ import { sx } from '../sx.js';
4
+ import styled from 'styled-components';
5
+ import { jsx } from 'react/jsx-runtime';
6
6
 
7
- //#region src/components/TextInput.tsx
8
- const StyledTextInput = styled(TextInput).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
- displayName: "TextInput__StyledTextInput",
10
- componentId: "sc-ttxlvl-0"
7
+ const StyledTextInput = styled(TextInput$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "TextInput__StyledTextInput",
11
+ componentId: "sc-ttxlvl-0"
11
12
  })(["", ""], sx);
12
- const TextInputImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
- return /* @__PURE__ */ jsx(StyledTextInput, {
14
- ref,
15
- ...props,
16
- ...as ? { forwardedAs: as } : {}
17
- });
13
+ const TextInputImpl = /*#__PURE__*/forwardRef(({
14
+ as,
15
+ ...props
16
+ }, ref) => {
17
+ return /*#__PURE__*/jsx(StyledTextInput, {
18
+ ref: ref,
19
+ ...props,
20
+ ...(as ? {
21
+ forwardedAs: as
22
+ } : {})
23
+ });
18
24
  });
19
- const TextInputAction = styled(TextInput.Action).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
20
- displayName: "TextInput__TextInputAction",
21
- componentId: "sc-ttxlvl-1"
25
+ const TextInputAction = styled(TextInput$1.Action).withConfig({
26
+ shouldForwardProp: prop => prop !== 'sx'
27
+ }).withConfig({
28
+ displayName: "TextInput__TextInputAction",
29
+ componentId: "sc-ttxlvl-1"
22
30
  })(["", ""], sx);
23
- const TextInput$1 = Object.assign(TextInputImpl, {
24
- __SLOT__: TextInput.__SLOT__,
25
- Action: TextInputAction
31
+ const TextInput = Object.assign(TextInputImpl, {
32
+ __SLOT__: TextInput$1.__SLOT__,
33
+ Action: TextInputAction
26
34
  });
27
- TextInputAction.displayName = "TextInputAction";
28
- TextInputImpl.displayName = "TextInput";
35
+ TextInputAction.displayName = 'TextInputAction';
36
+ TextInputImpl.displayName = 'TextInput';
29
37
 
30
- //#endregion
31
- export { TextInput$1 as TextInput };
38
+ export { TextInput };
@@ -1,21 +1,26 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { Textarea } from "@primer/react";
4
- import { forwardRef } from "react";
5
- import { jsx } from "react/jsx-runtime";
1
+ import { Textarea as Textarea$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';
6
6
 
7
- //#region src/components/Textarea.tsx
8
- const StyledTextarea = styled(Textarea).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
- displayName: "Textarea__StyledTextarea",
10
- componentId: "sc-40d1gp-0"
7
+ const StyledTextarea = styled(Textarea$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "Textarea__StyledTextarea",
11
+ componentId: "sc-40d1gp-0"
11
12
  })(["", ""], sx);
12
- const Textarea$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
- return /* @__PURE__ */ jsx(StyledTextarea, {
14
- ...props,
15
- ...as ? { forwardedAs: as } : {},
16
- ref
17
- });
13
+ const Textarea = /*#__PURE__*/forwardRef(({
14
+ as,
15
+ ...props
16
+ }, ref) => {
17
+ return /*#__PURE__*/jsx(StyledTextarea, {
18
+ ...props,
19
+ ...(as ? {
20
+ forwardedAs: as
21
+ } : {}),
22
+ ref: ref
23
+ });
18
24
  });
19
25
 
20
- //#endregion
21
- export { Textarea$1 as Textarea };
26
+ export { Textarea };