@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.
- package/dist/components/ActionList.js +89 -145
- package/dist/components/ActionMenu.js +15 -15
- package/dist/components/Autocomplete.js +18 -20
- package/dist/components/Avatar.js +13 -11
- package/dist/components/BaseStyles.js +28 -47
- package/dist/components/Box.js +18 -10
- package/dist/components/Breadcrumbs.js +22 -32
- package/dist/components/Button.js +41 -105
- package/dist/components/Checkbox.js +14 -12
- package/dist/components/CheckboxGroup.js +34 -36
- package/dist/components/CircleBadge.js +10 -10
- package/dist/components/CounterLabel.js +13 -11
- package/dist/components/DataTable.js +19 -27
- package/dist/components/Dialog.js +53 -79
- package/dist/components/Flash.js +9 -9
- package/dist/components/FormControl.js +15 -15
- package/dist/components/Header.js +36 -44
- package/dist/components/Heading.js +9 -9
- package/dist/components/IconButton.js +23 -36
- package/dist/components/Label.js +17 -22
- package/dist/components/Link.js +17 -22
- package/dist/components/LinkButton.js +9 -9
- package/dist/components/NavList.js +46 -65
- package/dist/components/Overlay.js +9 -9
- package/dist/components/PageHeader.js +62 -100
- package/dist/components/RadioGroup.js +34 -36
- package/dist/components/RelativeTime.js +11 -11
- package/dist/components/SegmentedControl.js +27 -25
- package/dist/components/Select.js +15 -20
- package/dist/components/Spinner.js +9 -9
- package/dist/components/StateLabel.js +13 -11
- package/dist/components/SubNav.js +23 -21
- package/dist/components/Text.js +17 -22
- package/dist/components/TextInput.js +25 -32
- package/dist/components/Textarea.js +17 -22
- package/dist/components/ThemeProvider.js +132 -185
- package/dist/components/Timeline.js +40 -38
- package/dist/components/ToggleSwitch.js +13 -11
- package/dist/components/Token.js +17 -22
- package/dist/components/Tooltip.js +14 -12
- package/dist/components/Truncate.js +9 -9
- package/dist/components/UnderlineNav.js +27 -39
- package/dist/components/UnderlinePanels.js +18 -23
- package/dist/components/deprecated/ActionList.js +34 -39
- package/dist/components/deprecated/DialogV1.js +28 -38
- package/dist/components/deprecated/Octicon.js +28 -35
- package/dist/components/deprecated/TabNav.js +24 -38
- package/dist/components/deprecated/Tooltip.js +20 -28
- package/dist/deprecated.js +7 -5
- package/dist/experimental.js +7 -5
- package/dist/index.js +48 -46
- package/dist/sx.js +7 -6
- package/dist/theme-get.js +8 -8
- package/package.json +7 -4
|
@@ -1,203 +1,150 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { jsx, jsxs } from
|
|
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
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
77
|
+
return React.useContext(ThemeContext);
|
|
111
78
|
}
|
|
112
79
|
function useColorSchemeVar(values, fallback) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} = useTheme();
|
|
116
|
-
return values[colorScheme] ?? fallback;
|
|
80
|
+
const { colorScheme = "" } = useTheme();
|
|
81
|
+
return values[colorScheme] ?? fallback;
|
|
117
82
|
}
|
|
118
83
|
function useSystemColorMode() {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
156
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
149
|
+
//#endregion
|
|
150
|
+
export { ThemeProvider$1 as ThemeProvider, useColorSchemeVar, useTheme };
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
23
|
+
as: Timeline.Badge,
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
25
26
|
}
|
|
26
|
-
const TimelineBody =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const Timeline$1 = Object.assign(TimelineImpl, {
|
|
42
|
+
Item: TimelineItem,
|
|
43
|
+
Badge: TimelineBadge,
|
|
44
|
+
Body: TimelineBody,
|
|
45
|
+
Break: TimelineBreak
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Timeline$1 as Timeline };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ToggleSwitch$1 as ToggleSwitch };
|
package/dist/components/Token.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { jsx } from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Token$1 as Token };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
14
|
+
Tooltip$1.__SLOT__ = Tooltip.__SLOT__;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Tooltip$1 as Tooltip };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Truncate } from "@primer/react";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Truncate$1 as Truncate };
|
|
@@ -1,45 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import Box from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { jsx } from
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
26
|
-
|
|
27
|
-
|
|
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 =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
export { UnderlineNav$1 as UnderlineNav };
|