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

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 (54) 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.js +7 -5
  50. package/dist/experimental.js +7 -5
  51. package/dist/index.js +48 -46
  52. package/dist/sx.js +7 -6
  53. package/dist/theme-get.js +8 -8
  54. package/package.json +7 -4
@@ -1,203 +1,150 @@
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';
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";
7
7
 
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
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
18
16
  });
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 {};
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 {};
29
23
  };
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
- });
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
+ });
108
75
  };
109
76
  function useTheme() {
110
- return React.useContext(ThemeContext);
77
+ return React.useContext(ThemeContext);
111
78
  }
112
79
  function useColorSchemeVar(values, fallback) {
113
- const {
114
- colorScheme = ''
115
- } = useTheme();
116
- return values[colorScheme] ?? fallback;
80
+ const { colorScheme = "" } = useTheme();
81
+ return values[colorScheme] ?? fallback;
117
82
  }
118
83
  function useSystemColorMode() {
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;
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;
153
111
  }
154
112
  function getSystemColorMode() {
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';
113
+ if (typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)")?.matches) return "night";
114
+ return "day";
160
115
  }
161
116
  function resolveColorMode(colorMode, systemColorMode) {
162
- switch (colorMode) {
163
- case 'auto':
164
- return systemColorMode;
165
- default:
166
- return colorMode;
167
- }
117
+ switch (colorMode) {
118
+ case "auto": return systemColorMode;
119
+ default: return colorMode;
120
+ }
168
121
  }
169
122
  function chooseColorScheme(colorMode, dayScheme, nightScheme) {
170
- switch (colorMode) {
171
- case 'day':
172
- case 'light':
173
- return dayScheme;
174
- case 'dark':
175
- case 'night':
176
- return nightScheme;
177
- }
123
+ switch (colorMode) {
124
+ case "day":
125
+ case "light": return dayScheme;
126
+ case "dark":
127
+ case "night": return nightScheme;
128
+ }
178
129
  }
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
- };
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
+ };
201
147
  }
202
148
 
203
- export { ThemeProvider, ThemeProvider as default, defaultColorMode, useColorSchemeVar, useTheme };
149
+ //#endregion
150
+ export { ThemeProvider$1 as ThemeProvider, useColorSchemeVar, useTheme };
@@ -1,47 +1,49 @@
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';
1
+ import { Box } from "./Box.js";
2
+ import { Timeline } from "@primer/react";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
5
 
6
- const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
7
- return /*#__PURE__*/jsx(Box, {
8
- as: Timeline$1,
9
- ref: ref,
10
- ...props
11
- });
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
+ });
12
13
  });
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
- });
14
+ const TimelineItem = /* @__PURE__ */ forwardRef(function TimelineItem$1(props, ref) {
15
+ return /* @__PURE__ */ jsx(Box, {
16
+ as: Timeline.Item,
17
+ ref,
18
+ ...props
19
+ });
19
20
  });
20
21
  function TimelineBadge(props) {
21
- return /*#__PURE__*/jsx(Box, {
22
- as: Timeline$1.Badge,
23
- ...props
24
- });
22
+ return /* @__PURE__ */ jsx(Box, {
23
+ as: Timeline.Badge,
24
+ ...props
25
+ });
25
26
  }
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
- });
27
+ const TimelineBody = /* @__PURE__ */ forwardRef(function TimelineBody$1(props, ref) {
28
+ return /* @__PURE__ */ jsx(Box, {
29
+ as: Timeline.Body,
30
+ ref,
31
+ ...props
32
+ });
32
33
  });
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
- });
34
+ const TimelineBreak = /* @__PURE__ */ forwardRef(function TimelineBreak$1(props, ref) {
35
+ return /* @__PURE__ */ jsx(Box, {
36
+ as: Timeline.Break,
37
+ ref,
38
+ ...props
39
+ });
39
40
  });
40
- const Timeline = Object.assign(TimelineImpl, {
41
- Item: TimelineItem,
42
- Badge: TimelineBadge,
43
- Body: TimelineBody,
44
- Break: TimelineBreak
41
+ const Timeline$1 = Object.assign(TimelineImpl, {
42
+ Item: TimelineItem,
43
+ Badge: TimelineBadge,
44
+ Body: TimelineBody,
45
+ Break: TimelineBreak
45
46
  });
46
47
 
47
- export { Timeline };
48
+ //#endregion
49
+ export { Timeline$1 as Timeline };
@@ -1,14 +1,16 @@
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';
1
+ import { Box } from "./Box.js";
2
+ import { ToggleSwitch } from "@primer/react";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
5
 
6
- const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
7
- return /*#__PURE__*/jsx(Box, {
8
- as: ToggleSwitch$1,
9
- ref: ref,
10
- ...props
11
- });
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
+ });
12
13
  });
13
14
 
14
- export { ToggleSwitch };
15
+ //#endregion
16
+ export { ToggleSwitch$1 as ToggleSwitch };
@@ -1,26 +1,21 @@
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';
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";
6
6
 
7
- const StyledToken = styled(Token$1).withConfig({
8
- shouldForwardProp: prop => prop !== 'sx'
9
- }).withConfig({
10
- displayName: "Token__StyledToken",
11
- componentId: "sc-ldn0r8-0"
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"
12
11
  })(["", ""], sx);
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
- });
12
+ const Token$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
13
+ return /* @__PURE__ */ jsx(StyledToken, {
14
+ ...props,
15
+ ...as ? { forwardedAs: as } : {},
16
+ ref
17
+ });
24
18
  });
25
19
 
26
- export { Token };
20
+ //#endregion
21
+ export { Token$1 as Token };
@@ -1,15 +1,17 @@
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';
1
+ import { Box } from "./Box.js";
2
+ import { Tooltip } from "@primer/react";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
5
 
6
- const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
7
- return /*#__PURE__*/jsx(Box, {
8
- as: Tooltip$1,
9
- ref: ref,
10
- ...props
11
- });
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
+ });
12
13
  });
13
- Tooltip.__SLOT__ = Tooltip$1.__SLOT__;
14
+ Tooltip$1.__SLOT__ = Tooltip.__SLOT__;
14
15
 
15
- export { Tooltip };
16
+ //#endregion
17
+ export { Tooltip$1 as Tooltip };
@@ -1,12 +1,12 @@
1
- import { Truncate as Truncate$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 { Truncate } from "@primer/react";
4
4
 
5
- const Truncate = styled(Truncate$1).withConfig({
6
- shouldForwardProp: prop => prop !== 'sx'
7
- }).withConfig({
8
- displayName: "Truncate",
9
- componentId: "sc-x3i4it-0"
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"
10
9
  })(["", ""], sx);
11
10
 
12
- export { Truncate };
11
+ //#endregion
12
+ export { Truncate$1 as Truncate };
@@ -1,45 +1,33 @@
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';
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";
7
7
 
8
- const StyledUnderlineNav = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
9
- return /*#__PURE__*/jsx(Box, {
10
- as: UnderlineNav$1,
11
- ref: ref,
12
- ...props
13
- });
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
+ });
14
15
  });
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
16
+ const UnderlineNavImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNav, {
17
+ ...props,
18
+ ...as ? { forwardedAs: as } : {},
19
+ ref
24
20
  }));
25
- const StyledUnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
26
- shouldForwardProp: prop => prop !== 'sx'
27
- }).withConfig({
28
- displayName: "UnderlineNav__StyledUnderlineNavItem",
29
- componentId: "sc-dx6br2-0"
21
+ const StyledUnderlineNavItem = styled(UnderlineNav.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
22
+ displayName: "UnderlineNav__StyledUnderlineNavItem",
23
+ componentId: "sc-dx6br2-0"
30
24
  })(["", ""], sx);
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
25
+ const UnderlineNavItem = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNavItem, {
26
+ ...props,
27
+ ...as ? { forwardedAs: as } : {},
28
+ ref
40
29
  }));
41
- const UnderlineNav = Object.assign(UnderlineNavImpl, {
42
- Item: UnderlineNavItem
43
- });
30
+ const UnderlineNav$1 = Object.assign(UnderlineNavImpl, { Item: UnderlineNavItem });
44
31
 
45
- export { UnderlineNav, UnderlineNavImpl, UnderlineNavItem };
32
+ //#endregion
33
+ export { UnderlineNav$1 as UnderlineNav };