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

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 +145 -89
  2. package/dist/components/ActionMenu.js +15 -15
  3. package/dist/components/Autocomplete.js +20 -18
  4. package/dist/components/Avatar.js +11 -13
  5. package/dist/components/BaseStyles.js +47 -28
  6. package/dist/components/Box.js +10 -18
  7. package/dist/components/Breadcrumbs.js +32 -22
  8. package/dist/components/Button.js +105 -41
  9. package/dist/components/Checkbox.js +12 -14
  10. package/dist/components/CheckboxGroup.js +36 -34
  11. package/dist/components/CircleBadge.js +10 -10
  12. package/dist/components/CounterLabel.js +11 -13
  13. package/dist/components/DataTable.js +27 -19
  14. package/dist/components/Dialog.js +79 -53
  15. package/dist/components/Flash.js +9 -9
  16. package/dist/components/FormControl.js +15 -15
  17. package/dist/components/Header.js +44 -36
  18. package/dist/components/Heading.js +9 -9
  19. package/dist/components/IconButton.js +36 -23
  20. package/dist/components/Label.js +22 -17
  21. package/dist/components/Link.js +22 -17
  22. package/dist/components/LinkButton.js +9 -9
  23. package/dist/components/NavList.js +65 -46
  24. package/dist/components/Overlay.js +9 -9
  25. package/dist/components/PageHeader.js +100 -62
  26. package/dist/components/RadioGroup.js +36 -34
  27. package/dist/components/RelativeTime.js +11 -11
  28. package/dist/components/SegmentedControl.js +25 -27
  29. package/dist/components/Select.js +20 -15
  30. package/dist/components/Spinner.js +9 -9
  31. package/dist/components/StateLabel.js +11 -13
  32. package/dist/components/SubNav.js +21 -23
  33. package/dist/components/Text.js +22 -17
  34. package/dist/components/TextInput.js +32 -25
  35. package/dist/components/Textarea.js +22 -17
  36. package/dist/components/ThemeProvider.js +185 -132
  37. package/dist/components/Timeline.js +38 -40
  38. package/dist/components/ToggleSwitch.js +11 -13
  39. package/dist/components/Token.js +22 -17
  40. package/dist/components/Tooltip.js +12 -14
  41. package/dist/components/Truncate.js +9 -9
  42. package/dist/components/UnderlineNav.js +39 -27
  43. package/dist/components/UnderlinePanels.js +23 -18
  44. package/dist/components/deprecated/ActionList.js +39 -34
  45. package/dist/components/deprecated/DialogV1.js +38 -28
  46. package/dist/components/deprecated/Octicon.js +35 -28
  47. package/dist/components/deprecated/TabNav.js +38 -24
  48. package/dist/components/deprecated/Tooltip.js +28 -20
  49. package/dist/deprecated.d.ts +5 -75
  50. package/dist/deprecated.d.ts.map +1 -1
  51. package/dist/deprecated.js +5 -7
  52. package/dist/experimental.d.ts +5 -120
  53. package/dist/experimental.d.ts.map +1 -1
  54. package/dist/experimental.js +5 -7
  55. package/dist/index.d.ts +47 -582
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +46 -48
  58. package/dist/sx.js +6 -7
  59. package/dist/theme-get.js +8 -8
  60. package/package.json +4 -7
@@ -1,150 +1,203 @@
1
- import { ThemeProvider } from "styled-components";
2
- import deepmerge from "deepmerge";
3
- import { theme, useId, useSyncedState } from "@primer/react";
4
- import React from "react";
5
- import ReactDOM from "react-dom";
6
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import { ThemeProvider as ThemeProvider$1 } from 'styled-components';
4
+ import { theme, useId, useSyncedState } from '@primer/react';
5
+ import deepmerge from 'deepmerge';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
7
 
8
- //#region src/components/ThemeProvider.tsx
9
- const defaultColorMode = "day";
10
- const defaultDayScheme = "light";
11
- const defaultNightScheme = "dark";
12
- const ThemeContext = /* @__PURE__ */ React.createContext({
13
- setColorMode: () => null,
14
- setDayScheme: () => null,
15
- setNightScheme: () => null
8
+ const defaultColorMode = 'day';
9
+ const defaultDayScheme = 'light';
10
+ const defaultNightScheme = 'dark';
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+
14
+ const ThemeContext = /*#__PURE__*/React.createContext({
15
+ setColorMode: () => null,
16
+ setDayScheme: () => null,
17
+ setNightScheme: () => null
16
18
  });
17
- const getServerHandoff = (id) => {
18
- try {
19
- const serverData = document.getElementById(`__PRIMER_DATA_${id}__`)?.textContent;
20
- if (serverData) return JSON.parse(serverData);
21
- } catch (_error) {}
22
- return {};
19
+
20
+ // inspired from __NEXT_DATA__, we use application/json to avoid CSRF policy with inline scripts
21
+ const getServerHandoff = id => {
22
+ try {
23
+ const serverData = document.getElementById(`__PRIMER_DATA_${id}__`)?.textContent;
24
+ if (serverData) return JSON.parse(serverData);
25
+ } catch (_error) {
26
+ // if document/element does not exist or JSON is invalid, supress error
27
+ }
28
+ return {};
23
29
  };
24
- const ThemeProvider$1 = ({ children, ...props }) => {
25
- const { theme: fallbackTheme, colorMode: fallbackColorMode, dayScheme: fallbackDayScheme, nightScheme: fallbackNightScheme } = useTheme();
26
- const theme$1 = props.theme ?? fallbackTheme ?? theme;
27
- const uniqueDataId = useId();
28
- const { resolvedServerColorMode } = getServerHandoff(uniqueDataId);
29
- const resolvedColorModePassthrough = React.useRef(resolvedServerColorMode);
30
- const [colorMode, setColorMode] = useSyncedState(props.colorMode ?? fallbackColorMode ?? defaultColorMode);
31
- const [dayScheme, setDayScheme] = useSyncedState(props.dayScheme ?? fallbackDayScheme ?? defaultDayScheme);
32
- const [nightScheme, setNightScheme] = useSyncedState(props.nightScheme ?? fallbackNightScheme ?? defaultNightScheme);
33
- const systemColorMode = useSystemColorMode();
34
- const resolvedColorMode = resolvedColorModePassthrough.current || resolveColorMode(colorMode, systemColorMode);
35
- const colorScheme = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
36
- const { resolvedTheme, resolvedColorScheme } = React.useMemo(() => applyColorScheme(theme$1, colorScheme), [theme$1, colorScheme]);
37
- React.useEffect(function updateColorModeAfterServerPassthrough() {
38
- const resolvedColorModeOnClient = resolveColorMode(colorMode, systemColorMode);
39
- if (resolvedColorModePassthrough.current) {
40
- if (resolvedColorModePassthrough.current !== resolvedColorModeOnClient) window.setTimeout(() => {
41
- ReactDOM.flushSync(() => {
42
- setColorMode(resolvedColorModeOnClient);
43
- });
44
- setColorMode(colorMode);
45
- });
46
- resolvedColorModePassthrough.current = null;
47
- }
48
- }, [
49
- colorMode,
50
- systemColorMode,
51
- setColorMode
52
- ]);
53
- return /* @__PURE__ */ jsx(ThemeContext.Provider, {
54
- value: {
55
- theme: resolvedTheme,
56
- colorScheme,
57
- colorMode,
58
- resolvedColorMode,
59
- resolvedColorScheme,
60
- dayScheme,
61
- nightScheme,
62
- setColorMode,
63
- setDayScheme,
64
- setNightScheme
65
- },
66
- children: /* @__PURE__ */ jsxs(ThemeProvider, {
67
- theme: resolvedTheme,
68
- children: [children, props.preventSSRMismatch ? /* @__PURE__ */ jsx("script", {
69
- type: "application/json",
70
- id: `__PRIMER_DATA_${uniqueDataId}__`,
71
- dangerouslySetInnerHTML: { __html: JSON.stringify({ resolvedServerColorMode: resolvedColorMode }) }
72
- }) : null]
73
- })
74
- });
30
+ const ThemeProvider = ({
31
+ children,
32
+ ...props
33
+ }) => {
34
+ // Get fallback values from parent ThemeProvider (if exists)
35
+ const {
36
+ theme: fallbackTheme,
37
+ colorMode: fallbackColorMode,
38
+ dayScheme: fallbackDayScheme,
39
+ nightScheme: fallbackNightScheme
40
+ } = useTheme();
41
+
42
+ // Initialize state
43
+ const theme$1 = props.theme ?? fallbackTheme ?? theme;
44
+ const uniqueDataId = useId();
45
+ const {
46
+ resolvedServerColorMode
47
+ } = getServerHandoff(uniqueDataId);
48
+ const resolvedColorModePassthrough = React.useRef(resolvedServerColorMode);
49
+ const [colorMode, setColorMode] = useSyncedState(props.colorMode ?? fallbackColorMode ?? defaultColorMode);
50
+ const [dayScheme, setDayScheme] = useSyncedState(props.dayScheme ?? fallbackDayScheme ?? defaultDayScheme);
51
+ const [nightScheme, setNightScheme] = useSyncedState(props.nightScheme ?? fallbackNightScheme ?? defaultNightScheme);
52
+ const systemColorMode = useSystemColorMode();
53
+ // eslint-disable-next-line react-hooks/refs
54
+ const resolvedColorMode = resolvedColorModePassthrough.current || resolveColorMode(colorMode, systemColorMode);
55
+ const colorScheme = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
56
+ const {
57
+ resolvedTheme,
58
+ resolvedColorScheme
59
+ } = React.useMemo(() => applyColorScheme(theme$1, colorScheme), [theme$1, colorScheme]);
60
+
61
+ // this effect will only run on client
62
+ React.useEffect(function updateColorModeAfterServerPassthrough() {
63
+ const resolvedColorModeOnClient = resolveColorMode(colorMode, systemColorMode);
64
+ if (resolvedColorModePassthrough.current) {
65
+ // if the resolved color mode passed on from the server is not the resolved color mode on client, change it!
66
+ if (resolvedColorModePassthrough.current !== resolvedColorModeOnClient) {
67
+ window.setTimeout(() => {
68
+ // use ReactDOM.flushSync to prevent automatic batching of state updates since React 18
69
+ // ref: https://github.com/reactwg/react-18/discussions/21
70
+ ReactDOM.flushSync(() => {
71
+ // override colorMode to whatever is resolved on the client to get a re-render
72
+ setColorMode(resolvedColorModeOnClient);
73
+ });
74
+
75
+ // immediately after that, set the colorMode to what the user passed to respond to system color mode changes
76
+ setColorMode(colorMode);
77
+ });
78
+ }
79
+ resolvedColorModePassthrough.current = null;
80
+ }
81
+ }, [colorMode, systemColorMode, setColorMode]);
82
+ return /*#__PURE__*/jsx(ThemeContext.Provider, {
83
+ value: {
84
+ theme: resolvedTheme,
85
+ colorScheme,
86
+ colorMode,
87
+ resolvedColorMode,
88
+ resolvedColorScheme,
89
+ dayScheme,
90
+ nightScheme,
91
+ setColorMode,
92
+ setDayScheme,
93
+ setNightScheme
94
+ },
95
+ children: /*#__PURE__*/jsxs(ThemeProvider$1, {
96
+ theme: resolvedTheme,
97
+ children: [children, props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
98
+ type: "application/json",
99
+ id: `__PRIMER_DATA_${uniqueDataId}__`,
100
+ dangerouslySetInnerHTML: {
101
+ __html: JSON.stringify({
102
+ resolvedServerColorMode: resolvedColorMode
103
+ })
104
+ }
105
+ }) : null]
106
+ })
107
+ });
75
108
  };
76
109
  function useTheme() {
77
- return React.useContext(ThemeContext);
110
+ return React.useContext(ThemeContext);
78
111
  }
79
112
  function useColorSchemeVar(values, fallback) {
80
- const { colorScheme = "" } = useTheme();
81
- return values[colorScheme] ?? fallback;
113
+ const {
114
+ colorScheme = ''
115
+ } = useTheme();
116
+ return values[colorScheme] ?? fallback;
82
117
  }
83
118
  function useSystemColorMode() {
84
- const [systemColorMode, setSystemColorMode] = React.useState(getSystemColorMode);
85
- React.useEffect(() => {
86
- const media = window?.matchMedia?.("(prefers-color-scheme: dark)");
87
- function matchesMediaToColorMode(matches) {
88
- return matches ? "night" : "day";
89
- }
90
- function handleChange(event) {
91
- const isNight = event.matches;
92
- setSystemColorMode(matchesMediaToColorMode(isNight));
93
- }
94
- if (media) {
95
- const isNight = media.matches;
96
- setSystemColorMode(matchesMediaToColorMode(isNight));
97
- if (media.addEventListener !== void 0) {
98
- media.addEventListener("change", handleChange);
99
- return function cleanup() {
100
- media.removeEventListener("change", handleChange);
101
- };
102
- } else if (media.addListener !== void 0) {
103
- media.addListener(handleChange);
104
- return function cleanup() {
105
- media.removeListener(handleChange);
106
- };
107
- }
108
- }
109
- }, []);
110
- return systemColorMode;
119
+ const [systemColorMode, setSystemColorMode] = React.useState(getSystemColorMode);
120
+ React.useEffect(() => {
121
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
122
+ const media = window?.matchMedia?.('(prefers-color-scheme: dark)');
123
+ function matchesMediaToColorMode(matches) {
124
+ return matches ? 'night' : 'day';
125
+ }
126
+ function handleChange(event) {
127
+ const isNight = event.matches;
128
+ setSystemColorMode(matchesMediaToColorMode(isNight));
129
+ }
130
+
131
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
132
+ if (media) {
133
+ // just in case the preference changed before the event listener was attached
134
+ const isNight = media.matches;
135
+ setSystemColorMode(matchesMediaToColorMode(isNight));
136
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
137
+ if (media.addEventListener !== undefined) {
138
+ media.addEventListener('change', handleChange);
139
+ return function cleanup() {
140
+ media.removeEventListener('change', handleChange);
141
+ };
142
+ }
143
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
144
+ else if (media.addListener !== undefined) {
145
+ media.addListener(handleChange);
146
+ return function cleanup() {
147
+ media.removeListener(handleChange);
148
+ };
149
+ }
150
+ }
151
+ }, []);
152
+ return systemColorMode;
111
153
  }
112
154
  function getSystemColorMode() {
113
- if (typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)")?.matches) return "night";
114
- return "day";
155
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
156
+ if (typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)')?.matches) {
157
+ return 'night';
158
+ }
159
+ return 'day';
115
160
  }
116
161
  function resolveColorMode(colorMode, systemColorMode) {
117
- switch (colorMode) {
118
- case "auto": return systemColorMode;
119
- default: return colorMode;
120
- }
162
+ switch (colorMode) {
163
+ case 'auto':
164
+ return systemColorMode;
165
+ default:
166
+ return colorMode;
167
+ }
121
168
  }
122
169
  function chooseColorScheme(colorMode, dayScheme, nightScheme) {
123
- switch (colorMode) {
124
- case "day":
125
- case "light": return dayScheme;
126
- case "dark":
127
- case "night": return nightScheme;
128
- }
170
+ switch (colorMode) {
171
+ case 'day':
172
+ case 'light':
173
+ return dayScheme;
174
+ case 'dark':
175
+ case 'night':
176
+ return nightScheme;
177
+ }
129
178
  }
130
- function applyColorScheme(theme$1, colorScheme) {
131
- if (!theme$1.colorSchemes) return {
132
- resolvedTheme: theme$1,
133
- resolvedColorScheme: void 0
134
- };
135
- if (!theme$1.colorSchemes[colorScheme]) {
136
- console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
137
- const defaultColorScheme = Object.keys(theme$1.colorSchemes)[0];
138
- return {
139
- resolvedTheme: deepmerge(theme$1, theme$1.colorSchemes[defaultColorScheme]),
140
- resolvedColorScheme: defaultColorScheme
141
- };
142
- }
143
- return {
144
- resolvedTheme: deepmerge(theme$1, theme$1.colorSchemes[colorScheme]),
145
- resolvedColorScheme: colorScheme
146
- };
179
+ function applyColorScheme(theme, colorScheme) {
180
+ if (!theme.colorSchemes) {
181
+ return {
182
+ resolvedTheme: theme,
183
+ resolvedColorScheme: undefined
184
+ };
185
+ }
186
+ if (!theme.colorSchemes[colorScheme]) {
187
+ // eslint-disable-next-line no-console
188
+ console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
189
+
190
+ // Apply the first defined color scheme
191
+ const defaultColorScheme = Object.keys(theme.colorSchemes)[0];
192
+ return {
193
+ resolvedTheme: deepmerge(theme, theme.colorSchemes[defaultColorScheme]),
194
+ resolvedColorScheme: defaultColorScheme
195
+ };
196
+ }
197
+ return {
198
+ resolvedTheme: deepmerge(theme, theme.colorSchemes[colorScheme]),
199
+ resolvedColorScheme: colorScheme
200
+ };
147
201
  }
148
202
 
149
- //#endregion
150
- export { ThemeProvider$1 as ThemeProvider, useColorSchemeVar, useTheme };
203
+ export { ThemeProvider, ThemeProvider as default, defaultColorMode, useColorSchemeVar, useTheme };
@@ -1,49 +1,47 @@
1
- import { Box } from "./Box.js";
2
- import { Timeline } from "@primer/react";
3
- import { forwardRef } from "react";
4
- import { jsx } from "react/jsx-runtime";
1
+ import { Timeline as Timeline$1 } from '@primer/react';
2
+ import Box from './Box.js';
3
+ import { forwardRef } from 'react';
4
+ import { jsx } from 'react/jsx-runtime';
5
5
 
6
- //#region src/components/Timeline.tsx
7
- const TimelineImpl = /* @__PURE__ */ forwardRef(function Timeline$2(props, ref) {
8
- return /* @__PURE__ */ jsx(Box, {
9
- as: Timeline,
10
- ref,
11
- ...props
12
- });
6
+ const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
7
+ return /*#__PURE__*/jsx(Box, {
8
+ as: Timeline$1,
9
+ ref: ref,
10
+ ...props
11
+ });
13
12
  });
14
- const TimelineItem = /* @__PURE__ */ forwardRef(function TimelineItem$1(props, ref) {
15
- return /* @__PURE__ */ jsx(Box, {
16
- as: Timeline.Item,
17
- ref,
18
- ...props
19
- });
13
+ const TimelineItem = /*#__PURE__*/forwardRef(function TimelineItem(props, ref) {
14
+ return /*#__PURE__*/jsx(Box, {
15
+ as: Timeline$1.Item,
16
+ ref: ref,
17
+ ...props
18
+ });
20
19
  });
21
20
  function TimelineBadge(props) {
22
- return /* @__PURE__ */ jsx(Box, {
23
- as: Timeline.Badge,
24
- ...props
25
- });
21
+ return /*#__PURE__*/jsx(Box, {
22
+ as: Timeline$1.Badge,
23
+ ...props
24
+ });
26
25
  }
27
- const TimelineBody = /* @__PURE__ */ forwardRef(function TimelineBody$1(props, ref) {
28
- return /* @__PURE__ */ jsx(Box, {
29
- as: Timeline.Body,
30
- ref,
31
- ...props
32
- });
26
+ const TimelineBody = /*#__PURE__*/forwardRef(function TimelineBody(props, ref) {
27
+ return /*#__PURE__*/jsx(Box, {
28
+ as: Timeline$1.Body,
29
+ ref: ref,
30
+ ...props
31
+ });
33
32
  });
34
- const TimelineBreak = /* @__PURE__ */ forwardRef(function TimelineBreak$1(props, ref) {
35
- return /* @__PURE__ */ jsx(Box, {
36
- as: Timeline.Break,
37
- ref,
38
- ...props
39
- });
33
+ const TimelineBreak = /*#__PURE__*/forwardRef(function TimelineBreak(props, ref) {
34
+ return /*#__PURE__*/jsx(Box, {
35
+ as: Timeline$1.Break,
36
+ ref: ref,
37
+ ...props
38
+ });
40
39
  });
41
- const Timeline$1 = Object.assign(TimelineImpl, {
42
- Item: TimelineItem,
43
- Badge: TimelineBadge,
44
- Body: TimelineBody,
45
- Break: TimelineBreak
40
+ const Timeline = Object.assign(TimelineImpl, {
41
+ Item: TimelineItem,
42
+ Badge: TimelineBadge,
43
+ Body: TimelineBody,
44
+ Break: TimelineBreak
46
45
  });
47
46
 
48
- //#endregion
49
- export { Timeline$1 as Timeline };
47
+ export { Timeline };
@@ -1,16 +1,14 @@
1
- import { Box } from "./Box.js";
2
- import { ToggleSwitch } from "@primer/react";
3
- import { forwardRef } from "react";
4
- import { jsx } from "react/jsx-runtime";
1
+ import { ToggleSwitch as ToggleSwitch$1 } from '@primer/react';
2
+ import { forwardRef } from 'react';
3
+ import Box from './Box.js';
4
+ import { jsx } from 'react/jsx-runtime';
5
5
 
6
- //#region src/components/ToggleSwitch.tsx
7
- const ToggleSwitch$1 = /* @__PURE__ */ forwardRef(function ToggleSwitch$2(props, ref) {
8
- return /* @__PURE__ */ jsx(Box, {
9
- as: ToggleSwitch,
10
- ref,
11
- ...props
12
- });
6
+ const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
7
+ return /*#__PURE__*/jsx(Box, {
8
+ as: ToggleSwitch$1,
9
+ ref: ref,
10
+ ...props
11
+ });
13
12
  });
14
13
 
15
- //#endregion
16
- export { ToggleSwitch$1 as ToggleSwitch };
14
+ export { ToggleSwitch };
@@ -1,21 +1,26 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { Token } from "@primer/react";
4
- import { forwardRef } from "react";
5
- import { jsx } from "react/jsx-runtime";
1
+ import { forwardRef } from 'react';
2
+ import { Token as Token$1 } from '@primer/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/Token.tsx
8
- const StyledToken = styled(Token).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
9
- displayName: "Token__StyledToken",
10
- componentId: "sc-ldn0r8-0"
7
+ const StyledToken = styled(Token$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "Token__StyledToken",
11
+ componentId: "sc-ldn0r8-0"
11
12
  })(["", ""], sx);
12
- const Token$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
- return /* @__PURE__ */ jsx(StyledToken, {
14
- ...props,
15
- ...as ? { forwardedAs: as } : {},
16
- ref
17
- });
13
+ const Token = /*#__PURE__*/forwardRef(({
14
+ as,
15
+ ...props
16
+ }, ref) => {
17
+ return /*#__PURE__*/jsx(StyledToken, {
18
+ ...props,
19
+ ...(as ? {
20
+ forwardedAs: as
21
+ } : {}),
22
+ ref: ref
23
+ });
18
24
  });
19
25
 
20
- //#endregion
21
- export { Token$1 as Token };
26
+ export { Token };
@@ -1,17 +1,15 @@
1
- import { Box } from "./Box.js";
2
- import { Tooltip } from "@primer/react";
3
- import { forwardRef } from "react";
4
- import { jsx } from "react/jsx-runtime";
1
+ import { Tooltip as Tooltip$1 } from '@primer/react';
2
+ import Box from './Box.js';
3
+ import { forwardRef } from 'react';
4
+ import { jsx } from 'react/jsx-runtime';
5
5
 
6
- //#region src/components/Tooltip.tsx
7
- const Tooltip$1 = /* @__PURE__ */ forwardRef(function Tooltip$2(props, ref) {
8
- return /* @__PURE__ */ jsx(Box, {
9
- as: Tooltip,
10
- ref,
11
- ...props
12
- });
6
+ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
7
+ return /*#__PURE__*/jsx(Box, {
8
+ as: Tooltip$1,
9
+ ref: ref,
10
+ ...props
11
+ });
13
12
  });
14
- Tooltip$1.__SLOT__ = Tooltip.__SLOT__;
13
+ Tooltip.__SLOT__ = Tooltip$1.__SLOT__;
15
14
 
16
- //#endregion
17
- export { Tooltip$1 as Tooltip };
15
+ export { Tooltip };
@@ -1,12 +1,12 @@
1
- import { sx } from "../sx.js";
2
- import styled from "styled-components";
3
- import { Truncate } from "@primer/react";
1
+ import { Truncate as Truncate$1 } from '@primer/react';
2
+ import sx from '../sx.js';
3
+ import styled from 'styled-components';
4
4
 
5
- //#region src/components/Truncate.tsx
6
- const Truncate$1 = styled(Truncate).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
7
- displayName: "Truncate",
8
- componentId: "sc-x3i4it-0"
5
+ const Truncate = styled(Truncate$1).withConfig({
6
+ shouldForwardProp: prop => prop !== 'sx'
7
+ }).withConfig({
8
+ displayName: "Truncate",
9
+ componentId: "sc-x3i4it-0"
9
10
  })(["", ""], sx);
10
11
 
11
- //#endregion
12
- export { Truncate$1 as Truncate };
12
+ export { Truncate };
@@ -1,33 +1,45 @@
1
- import { sx } from "../sx.js";
2
- import { Box } from "./Box.js";
3
- import styled from "styled-components";
4
- import { UnderlineNav } from "@primer/react";
5
- import { forwardRef } from "react";
6
- import { jsx } from "react/jsx-runtime";
1
+ import { UnderlineNav as UnderlineNav$1 } from '@primer/react';
2
+ import Box from './Box.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';
7
7
 
8
- //#region src/components/UnderlineNav.tsx
9
- const StyledUnderlineNav = /* @__PURE__ */ forwardRef(function UnderlineNav$2(props, ref) {
10
- return /* @__PURE__ */ jsx(Box, {
11
- as: UnderlineNav,
12
- ref,
13
- ...props
14
- });
8
+ const StyledUnderlineNav = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
9
+ return /*#__PURE__*/jsx(Box, {
10
+ as: UnderlineNav$1,
11
+ ref: ref,
12
+ ...props
13
+ });
15
14
  });
16
- const UnderlineNavImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNav, {
17
- ...props,
18
- ...as ? { forwardedAs: as } : {},
19
- ref
15
+ const UnderlineNavImpl = /*#__PURE__*/forwardRef(({
16
+ as,
17
+ ...props
18
+ }, ref) => /*#__PURE__*/jsx(StyledUnderlineNav, {
19
+ ...props,
20
+ ...(as ? {
21
+ forwardedAs: as
22
+ } : {}),
23
+ ref: ref
20
24
  }));
21
- const StyledUnderlineNavItem = styled(UnderlineNav.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
22
- displayName: "UnderlineNav__StyledUnderlineNavItem",
23
- componentId: "sc-dx6br2-0"
25
+ const StyledUnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
26
+ shouldForwardProp: prop => prop !== 'sx'
27
+ }).withConfig({
28
+ displayName: "UnderlineNav__StyledUnderlineNavItem",
29
+ componentId: "sc-dx6br2-0"
24
30
  })(["", ""], sx);
25
- const UnderlineNavItem = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNavItem, {
26
- ...props,
27
- ...as ? { forwardedAs: as } : {},
28
- ref
31
+ const UnderlineNavItem = /*#__PURE__*/forwardRef(({
32
+ as,
33
+ ...props
34
+ }, ref) => /*#__PURE__*/jsx(StyledUnderlineNavItem, {
35
+ ...props,
36
+ ...(as ? {
37
+ forwardedAs: as
38
+ } : {}),
39
+ ref: ref
29
40
  }));
30
- const UnderlineNav$1 = Object.assign(UnderlineNavImpl, { Item: UnderlineNavItem });
41
+ const UnderlineNav = Object.assign(UnderlineNavImpl, {
42
+ Item: UnderlineNavItem
43
+ });
31
44
 
32
- //#endregion
33
- export { UnderlineNav$1 as UnderlineNav };
45
+ export { UnderlineNav, UnderlineNavImpl, UnderlineNavItem };