@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.
- package/dist/components/ActionList.js +145 -89
- package/dist/components/ActionMenu.js +15 -15
- package/dist/components/Autocomplete.js +20 -18
- package/dist/components/Avatar.js +11 -13
- package/dist/components/BaseStyles.js +47 -28
- package/dist/components/Box.js +10 -18
- package/dist/components/Breadcrumbs.js +32 -22
- package/dist/components/Button.js +105 -41
- package/dist/components/Checkbox.js +12 -14
- package/dist/components/CheckboxGroup.js +36 -34
- package/dist/components/CircleBadge.js +10 -10
- package/dist/components/CounterLabel.js +11 -13
- package/dist/components/DataTable.js +27 -19
- package/dist/components/Dialog.js +79 -53
- package/dist/components/Flash.js +9 -9
- package/dist/components/FormControl.js +15 -15
- package/dist/components/Header.js +44 -36
- package/dist/components/Heading.js +9 -9
- package/dist/components/IconButton.js +36 -23
- package/dist/components/Label.js +22 -17
- package/dist/components/Link.js +22 -17
- package/dist/components/LinkButton.js +9 -9
- package/dist/components/NavList.js +65 -46
- package/dist/components/Overlay.js +9 -9
- package/dist/components/PageHeader.js +100 -62
- package/dist/components/RadioGroup.js +36 -34
- package/dist/components/RelativeTime.js +11 -11
- package/dist/components/SegmentedControl.js +25 -27
- package/dist/components/Select.js +20 -15
- package/dist/components/Spinner.js +9 -9
- package/dist/components/StateLabel.js +11 -13
- package/dist/components/SubNav.js +21 -23
- package/dist/components/Text.js +22 -17
- package/dist/components/TextInput.js +32 -25
- package/dist/components/Textarea.js +22 -17
- package/dist/components/ThemeProvider.js +185 -132
- package/dist/components/Timeline.js +38 -40
- package/dist/components/ToggleSwitch.js +11 -13
- package/dist/components/Token.js +22 -17
- package/dist/components/Tooltip.js +12 -14
- package/dist/components/Truncate.js +9 -9
- package/dist/components/UnderlineNav.js +39 -27
- package/dist/components/UnderlinePanels.js +23 -18
- package/dist/components/deprecated/ActionList.js +39 -34
- package/dist/components/deprecated/DialogV1.js +38 -28
- package/dist/components/deprecated/Octicon.js +35 -28
- package/dist/components/deprecated/TabNav.js +38 -24
- package/dist/components/deprecated/Tooltip.js +28 -20
- package/dist/deprecated.d.ts +5 -75
- package/dist/deprecated.d.ts.map +1 -1
- package/dist/deprecated.js +5 -7
- package/dist/experimental.d.ts +5 -120
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +5 -7
- package/dist/index.d.ts +47 -582
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -48
- package/dist/sx.js +6 -7
- package/dist/theme-get.js +8 -8
- package/package.json +4 -7
|
@@ -1,150 +1,203 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { jsx, jsxs } from
|
|
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
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
110
|
+
return React.useContext(ThemeContext);
|
|
78
111
|
}
|
|
79
112
|
function useColorSchemeVar(values, fallback) {
|
|
80
|
-
|
|
81
|
-
|
|
113
|
+
const {
|
|
114
|
+
colorScheme = ''
|
|
115
|
+
} = useTheme();
|
|
116
|
+
return values[colorScheme] ?? fallback;
|
|
82
117
|
}
|
|
83
118
|
function useSystemColorMode() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
114
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
150
|
-
export { ThemeProvider$1 as ThemeProvider, useColorSchemeVar, useTheme };
|
|
203
|
+
export { ThemeProvider, ThemeProvider as default, defaultColorMode, useColorSchemeVar, useTheme };
|
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return /*#__PURE__*/jsx(Box, {
|
|
22
|
+
as: Timeline$1.Badge,
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
26
25
|
}
|
|
27
|
-
const TimelineBody =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const Timeline = Object.assign(TimelineImpl, {
|
|
41
|
+
Item: TimelineItem,
|
|
42
|
+
Badge: TimelineBadge,
|
|
43
|
+
Body: TimelineBody,
|
|
44
|
+
Break: TimelineBreak
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
export { Timeline$1 as Timeline };
|
|
47
|
+
export { Timeline };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
16
|
-
export { ToggleSwitch$1 as ToggleSwitch };
|
|
14
|
+
export { ToggleSwitch };
|
package/dist/components/Token.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { jsx } from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
21
|
-
export { Token$1 as Token };
|
|
26
|
+
export { Token };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from
|
|
4
|
-
import { jsx } from
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
13
|
+
Tooltip.__SLOT__ = Tooltip$1.__SLOT__;
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
export { Tooltip$1 as Tooltip };
|
|
15
|
+
export { Tooltip };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Truncate as Truncate$1 } from '@primer/react';
|
|
2
|
+
import sx from '../sx.js';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
12
|
-
export { Truncate$1 as Truncate };
|
|
12
|
+
export { Truncate };
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { jsx } from
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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({
|
|
22
|
-
|
|
23
|
-
|
|
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 =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
41
|
+
const UnderlineNav = Object.assign(UnderlineNavImpl, {
|
|
42
|
+
Item: UnderlineNavItem
|
|
43
|
+
});
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
export { UnderlineNav$1 as UnderlineNav };
|
|
45
|
+
export { UnderlineNav, UnderlineNavImpl, UnderlineNavItem };
|