@primer/styled-react 1.0.0-rc.7 → 1.0.0-rc.8
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.d.ts +21 -13
- package/dist/components/ActionList.d.ts.map +1 -1
- package/dist/components/ActionList.js +162 -0
- package/dist/components/ActionMenu.d.ts +2 -2
- package/dist/components/ActionMenu.d.ts.map +1 -1
- package/dist/components/ActionMenu.js +18 -0
- package/dist/components/Autocomplete.d.ts +5 -3
- package/dist/components/Autocomplete.d.ts.map +1 -1
- package/dist/components/Autocomplete.js +24 -0
- package/dist/components/Avatar.js +13 -0
- package/dist/components/BaseStyles.d.ts +17 -0
- package/dist/components/BaseStyles.d.ts.map +1 -0
- package/dist/components/BaseStyles.js +51 -0
- package/dist/components/Breadcrumbs.js +37 -0
- package/dist/components/Button.d.ts +13 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +111 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +14 -0
- package/dist/components/CheckboxGroup.d.ts +16 -4
- package/dist/components/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/CheckboxGroup.js +42 -0
- package/dist/components/CircleBadge.js +11 -0
- package/dist/components/CounterLabel.js +13 -0
- package/dist/components/DataTable.js +32 -0
- package/dist/components/Dialog.js +42 -0
- package/dist/components/FeatureFlaggedTheming.d.ts +6 -0
- package/dist/components/FeatureFlaggedTheming.d.ts.map +1 -0
- package/dist/components/FeatureFlaggedTheming.js +54 -0
- package/dist/components/Flash.js +11 -0
- package/dist/components/FormControl.d.ts +12 -0
- package/dist/components/FormControl.d.ts.map +1 -0
- package/dist/components/FormControl.js +18 -0
- package/dist/components/Header.js +51 -0
- package/dist/components/Heading.js +11 -0
- package/dist/components/IconButton.d.ts +9 -0
- package/dist/components/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton.js +39 -0
- package/dist/components/Label.js +25 -0
- package/dist/components/Link.js +25 -0
- package/dist/components/LinkButton.js +11 -0
- package/dist/components/NavList.d.ts +27 -19
- package/dist/components/NavList.d.ts.map +1 -1
- package/dist/components/NavList.js +56 -0
- package/dist/components/Overlay.js +11 -0
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/{PageHeader-DCDIR2C1.js → components/PageHeader.js} +4 -41
- package/dist/components/PageLayout.d.ts +15 -10
- package/dist/components/PageLayout.d.ts.map +1 -1
- package/dist/components/PageLayout.js +42 -0
- package/dist/components/RadioGroup.d.ts +16 -4
- package/dist/components/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup.js +42 -0
- package/dist/components/RelativeTime.js +13 -0
- package/dist/components/SegmentedControl.d.ts +9 -2
- package/dist/components/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl.js +30 -0
- package/dist/components/Select.d.ts +8 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +23 -0
- package/dist/components/Spinner.js +11 -0
- package/dist/components/StateLabel.js +13 -0
- package/dist/components/SubNav.d.ts +1 -0
- package/dist/components/SubNav.d.ts.map +1 -1
- package/dist/components/SubNav.js +25 -0
- package/dist/components/Text.d.ts +11 -3
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js +25 -0
- package/dist/components/TextInput.d.ts +15 -0
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/components/TextInput.js +37 -0
- package/dist/components/Textarea.d.ts +9 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +25 -0
- package/dist/components/ThemeProvider.d.ts +30 -0
- package/dist/components/ThemeProvider.d.ts.map +1 -0
- package/dist/components/ThemeProvider.js +202 -0
- package/dist/components/Timeline.js +46 -0
- package/dist/components/ToggleSwitch.js +13 -0
- package/dist/components/Token.js +25 -0
- package/dist/components/Tooltip.d.ts +2 -6
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip.js +14 -0
- package/dist/components/Truncate.js +11 -0
- package/dist/components/UnderlineNav.js +43 -0
- package/dist/components/UnderlinePanels.d.ts +7 -5
- package/dist/components/UnderlinePanels.d.ts.map +1 -1
- package/dist/components/UnderlinePanels.js +28 -0
- package/dist/components/deprecated/ActionList.js +48 -0
- package/dist/components/deprecated/DialogV1.js +44 -0
- package/dist/components/deprecated/Octicon.js +39 -0
- package/dist/components/deprecated/TabNav.js +44 -0
- package/dist/components/deprecated/Tooltip.d.ts.map +1 -1
- package/dist/components/deprecated/Tooltip.js +32 -0
- package/dist/components.json +27 -0
- package/dist/deprecated.d.ts +5 -4
- package/dist/deprecated.d.ts.map +1 -1
- package/dist/deprecated.js +5 -84
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +5 -32
- package/dist/index.d.ts +9 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -511
- package/dist/sx.d.ts +3 -0
- package/dist/sx.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/Tooltip-DIHgr01r.js +0 -152
- package/dist/Tooltip-YuSlJ5b_.js +0 -20
- package/dist/components/DialogV1.d.ts +0 -11
- package/dist/components/DialogV1.d.ts.map +0 -1
- package/dist/components/TabNav.d.ts +0 -9
- package/dist/components/TabNav.d.ts.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
|
|
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
|
|
18
|
+
});
|
|
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 {};
|
|
29
|
+
};
|
|
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
|
+
const resolvedColorMode = resolvedColorModePassthrough.current || resolveColorMode(colorMode, systemColorMode);
|
|
54
|
+
const colorScheme = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
|
55
|
+
const {
|
|
56
|
+
resolvedTheme,
|
|
57
|
+
resolvedColorScheme
|
|
58
|
+
} = React.useMemo(() => applyColorScheme(theme$1, colorScheme), [theme$1, colorScheme]);
|
|
59
|
+
|
|
60
|
+
// this effect will only run on client
|
|
61
|
+
React.useEffect(function updateColorModeAfterServerPassthrough() {
|
|
62
|
+
const resolvedColorModeOnClient = resolveColorMode(colorMode, systemColorMode);
|
|
63
|
+
if (resolvedColorModePassthrough.current) {
|
|
64
|
+
// if the resolved color mode passed on from the server is not the resolved color mode on client, change it!
|
|
65
|
+
if (resolvedColorModePassthrough.current !== resolvedColorModeOnClient) {
|
|
66
|
+
window.setTimeout(() => {
|
|
67
|
+
// use ReactDOM.flushSync to prevent automatic batching of state updates since React 18
|
|
68
|
+
// ref: https://github.com/reactwg/react-18/discussions/21
|
|
69
|
+
ReactDOM.flushSync(() => {
|
|
70
|
+
// override colorMode to whatever is resolved on the client to get a re-render
|
|
71
|
+
setColorMode(resolvedColorModeOnClient);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// immediately after that, set the colorMode to what the user passed to respond to system color mode changes
|
|
75
|
+
setColorMode(colorMode);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
resolvedColorModePassthrough.current = null;
|
|
79
|
+
}
|
|
80
|
+
}, [colorMode, systemColorMode, setColorMode]);
|
|
81
|
+
return /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
82
|
+
value: {
|
|
83
|
+
theme: resolvedTheme,
|
|
84
|
+
colorScheme,
|
|
85
|
+
colorMode,
|
|
86
|
+
resolvedColorMode,
|
|
87
|
+
resolvedColorScheme,
|
|
88
|
+
dayScheme,
|
|
89
|
+
nightScheme,
|
|
90
|
+
setColorMode,
|
|
91
|
+
setDayScheme,
|
|
92
|
+
setNightScheme
|
|
93
|
+
},
|
|
94
|
+
children: /*#__PURE__*/jsxs(ThemeProvider$1, {
|
|
95
|
+
theme: resolvedTheme,
|
|
96
|
+
children: [children, props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
|
|
97
|
+
type: "application/json",
|
|
98
|
+
id: `__PRIMER_DATA_${uniqueDataId}__`,
|
|
99
|
+
dangerouslySetInnerHTML: {
|
|
100
|
+
__html: JSON.stringify({
|
|
101
|
+
resolvedServerColorMode: resolvedColorMode
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}) : null]
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
function useTheme() {
|
|
109
|
+
return React.useContext(ThemeContext);
|
|
110
|
+
}
|
|
111
|
+
function useColorSchemeVar(values, fallback) {
|
|
112
|
+
const {
|
|
113
|
+
colorScheme = ''
|
|
114
|
+
} = useTheme();
|
|
115
|
+
return values[colorScheme] ?? fallback;
|
|
116
|
+
}
|
|
117
|
+
function useSystemColorMode() {
|
|
118
|
+
const [systemColorMode, setSystemColorMode] = React.useState(getSystemColorMode);
|
|
119
|
+
React.useEffect(() => {
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
121
|
+
const media = window?.matchMedia?.('(prefers-color-scheme: dark)');
|
|
122
|
+
function matchesMediaToColorMode(matches) {
|
|
123
|
+
return matches ? 'night' : 'day';
|
|
124
|
+
}
|
|
125
|
+
function handleChange(event) {
|
|
126
|
+
const isNight = event.matches;
|
|
127
|
+
setSystemColorMode(matchesMediaToColorMode(isNight));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
131
|
+
if (media) {
|
|
132
|
+
// just in case the preference changed before the event listener was attached
|
|
133
|
+
const isNight = media.matches;
|
|
134
|
+
setSystemColorMode(matchesMediaToColorMode(isNight));
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
136
|
+
if (media.addEventListener !== undefined) {
|
|
137
|
+
media.addEventListener('change', handleChange);
|
|
138
|
+
return function cleanup() {
|
|
139
|
+
media.removeEventListener('change', handleChange);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
143
|
+
else if (media.addListener !== undefined) {
|
|
144
|
+
media.addListener(handleChange);
|
|
145
|
+
return function cleanup() {
|
|
146
|
+
media.removeListener(handleChange);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, []);
|
|
151
|
+
return systemColorMode;
|
|
152
|
+
}
|
|
153
|
+
function getSystemColorMode() {
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
155
|
+
if (typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)')?.matches) {
|
|
156
|
+
return 'night';
|
|
157
|
+
}
|
|
158
|
+
return 'day';
|
|
159
|
+
}
|
|
160
|
+
function resolveColorMode(colorMode, systemColorMode) {
|
|
161
|
+
switch (colorMode) {
|
|
162
|
+
case 'auto':
|
|
163
|
+
return systemColorMode;
|
|
164
|
+
default:
|
|
165
|
+
return colorMode;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function chooseColorScheme(colorMode, dayScheme, nightScheme) {
|
|
169
|
+
switch (colorMode) {
|
|
170
|
+
case 'day':
|
|
171
|
+
case 'light':
|
|
172
|
+
return dayScheme;
|
|
173
|
+
case 'dark':
|
|
174
|
+
case 'night':
|
|
175
|
+
return nightScheme;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function applyColorScheme(theme, colorScheme) {
|
|
179
|
+
if (!theme.colorSchemes) {
|
|
180
|
+
return {
|
|
181
|
+
resolvedTheme: theme,
|
|
182
|
+
resolvedColorScheme: undefined
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
if (!theme.colorSchemes[colorScheme]) {
|
|
186
|
+
// eslint-disable-next-line no-console
|
|
187
|
+
console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
|
|
188
|
+
|
|
189
|
+
// Apply the first defined color scheme
|
|
190
|
+
const defaultColorScheme = Object.keys(theme.colorSchemes)[0];
|
|
191
|
+
return {
|
|
192
|
+
resolvedTheme: deepmerge(theme, theme.colorSchemes[defaultColorScheme]),
|
|
193
|
+
resolvedColorScheme: defaultColorScheme
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
resolvedTheme: deepmerge(theme, theme.colorSchemes[colorScheme]),
|
|
198
|
+
resolvedColorScheme: colorScheme
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export { ThemeProvider, ThemeProvider as default, defaultColorMode, useColorSchemeVar, useTheme };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Box, Timeline as Timeline$1 } from '@primer/react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
|
|
6
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7
|
+
as: Timeline$1,
|
|
8
|
+
ref: ref,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
const TimelineItem = /*#__PURE__*/forwardRef(function TimelineItem(props, ref) {
|
|
13
|
+
return /*#__PURE__*/jsx(Box, {
|
|
14
|
+
as: Timeline$1.Item,
|
|
15
|
+
ref: ref,
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
function TimelineBadge(props) {
|
|
20
|
+
return /*#__PURE__*/jsx(Box, {
|
|
21
|
+
as: Timeline$1.Badge,
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const TimelineBody = /*#__PURE__*/forwardRef(function TimelineBody(props, ref) {
|
|
26
|
+
return /*#__PURE__*/jsx(Box, {
|
|
27
|
+
as: Timeline$1.Body,
|
|
28
|
+
ref: ref,
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
const TimelineBreak = /*#__PURE__*/forwardRef(function TimelineBreak(props, ref) {
|
|
33
|
+
return /*#__PURE__*/jsx(Box, {
|
|
34
|
+
as: Timeline$1.Break,
|
|
35
|
+
ref: ref,
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
const Timeline = Object.assign(TimelineImpl, {
|
|
40
|
+
Item: TimelineItem,
|
|
41
|
+
Badge: TimelineBadge,
|
|
42
|
+
Body: TimelineBody,
|
|
43
|
+
Break: TimelineBreak
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { Timeline };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Box, ToggleSwitch as ToggleSwitch$1 } from '@primer/react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
|
|
6
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7
|
+
as: ToggleSwitch$1,
|
|
8
|
+
ref: ref,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { ToggleSwitch };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Token as Token$1, sx } from '@primer/react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledToken = styled(Token$1).withConfig({
|
|
7
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
8
|
+
}).withConfig({
|
|
9
|
+
displayName: "Token__StyledToken",
|
|
10
|
+
componentId: "sc-ldn0r8-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Token = /*#__PURE__*/forwardRef(({
|
|
13
|
+
as,
|
|
14
|
+
...props
|
|
15
|
+
}, ref) => {
|
|
16
|
+
return /*#__PURE__*/jsx(StyledToken, {
|
|
17
|
+
...props,
|
|
18
|
+
...(as ? {
|
|
19
|
+
forwardedAs: as
|
|
20
|
+
} : {}),
|
|
21
|
+
ref: ref
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { Token };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { type TooltipProps as PrimerTooltipProps, type SxProp } from '@primer/react';
|
|
2
|
-
import { type TooltipProps as PrimerDeprecatedTooltipProps } from '@primer/react/deprecated';
|
|
1
|
+
import { type TooltipProps as PrimerTooltipProps, type SxProp, type SlotMarker } from '@primer/react';
|
|
3
2
|
import { type ForwardRefExoticComponent, type RefAttributes } from 'react';
|
|
4
3
|
type TooltipProps = PrimerTooltipProps & SxProp;
|
|
5
|
-
declare const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<HTMLDivElement
|
|
4
|
+
declare const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<HTMLDivElement>> & SlotMarker;
|
|
6
5
|
export { Tooltip, type TooltipProps };
|
|
7
|
-
type DeprecatedTooltipProps = PrimerDeprecatedTooltipProps & SxProp;
|
|
8
|
-
declare function DeprecatedTooltip(props: DeprecatedTooltipProps): import("react").JSX.Element;
|
|
9
|
-
export { DeprecatedTooltip, type DeprecatedTooltipProps };
|
|
10
6
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,IAAI,kBAAkB,EACvC,KAAK,MAAM,EACX,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAa,KAAK,yBAAyB,EAAE,KAAK,aAAa,EAAC,MAAM,OAAO,CAAA;AAEpF,KAAK,YAAY,GAAG,kBAAkB,GAAG,MAAM,CAAA;AAE/C,QAAA,MAAM,OAAO,EAAE,yBAAyB,CAAC,YAAY,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG,UAKvF,CAAA;AAIF,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tooltip as Tooltip$1, Box } from '@primer/react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
6
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7
|
+
as: Tooltip$1,
|
|
8
|
+
ref: ref,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
Tooltip.__SLOT__ = Tooltip$1.__SLOT__;
|
|
13
|
+
|
|
14
|
+
export { Tooltip };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Truncate as Truncate$1, sx } from '@primer/react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const Truncate = styled(Truncate$1).withConfig({
|
|
5
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
6
|
+
}).withConfig({
|
|
7
|
+
displayName: "Truncate",
|
|
8
|
+
componentId: "sc-x3i4it-0"
|
|
9
|
+
})(["", ""], sx);
|
|
10
|
+
|
|
11
|
+
export { Truncate };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { UnderlineNav as UnderlineNav$1, sx, Box } from '@primer/react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledUnderlineNav = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
|
|
7
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8
|
+
as: UnderlineNav$1,
|
|
9
|
+
ref: ref,
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
const UnderlineNavImpl = /*#__PURE__*/forwardRef(({
|
|
14
|
+
as,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) => /*#__PURE__*/jsx(StyledUnderlineNav, {
|
|
17
|
+
...props,
|
|
18
|
+
...(as ? {
|
|
19
|
+
forwardedAs: as
|
|
20
|
+
} : {}),
|
|
21
|
+
ref: ref
|
|
22
|
+
}));
|
|
23
|
+
const StyledUnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
|
|
24
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
25
|
+
}).withConfig({
|
|
26
|
+
displayName: "UnderlineNav__StyledUnderlineNavItem",
|
|
27
|
+
componentId: "sc-dx6br2-0"
|
|
28
|
+
})(["", ""], sx);
|
|
29
|
+
const UnderlineNavItem = /*#__PURE__*/forwardRef(({
|
|
30
|
+
as,
|
|
31
|
+
...props
|
|
32
|
+
}, ref) => /*#__PURE__*/jsx(StyledUnderlineNavItem, {
|
|
33
|
+
...props,
|
|
34
|
+
...(as ? {
|
|
35
|
+
forwardedAs: as
|
|
36
|
+
} : {}),
|
|
37
|
+
ref: ref
|
|
38
|
+
}));
|
|
39
|
+
const UnderlineNav = Object.assign(UnderlineNavImpl, {
|
|
40
|
+
Item: UnderlineNavItem
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { UnderlineNav, UnderlineNavImpl, UnderlineNavItem };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { type UnderlinePanelsProps as PrimerUnderlinePanelsProps, type UnderlinePanelsPanelProps, type UnderlinePanelsTabProps } from '@primer/react/experimental';
|
|
1
|
+
import { UnderlinePanels as PrimerUnderlinePanels, type UnderlinePanelsProps as PrimerUnderlinePanelsProps, type UnderlinePanelsPanelProps, type UnderlinePanelsTabProps } from '@primer/react/experimental';
|
|
2
2
|
import { type SxProp } from '../sx';
|
|
3
3
|
type UnderlinePanelsProps = PrimerUnderlinePanelsProps & SxProp;
|
|
4
|
-
declare const
|
|
4
|
+
declare const UnderlinePanelsImpl: {
|
|
5
5
|
({ as, ...props }: UnderlinePanelsProps): import("react").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
__SLOT__: symbol | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const UnderlinePanels: typeof UnderlinePanelsImpl & {
|
|
10
|
+
Tab: typeof PrimerUnderlinePanels.Tab;
|
|
11
|
+
Panel: typeof PrimerUnderlinePanels.Panel;
|
|
10
12
|
};
|
|
11
13
|
export { UnderlinePanels, type UnderlinePanelsProps, type UnderlinePanelsTabProps, type UnderlinePanelsPanelProps };
|
|
12
14
|
//# sourceMappingURL=UnderlinePanels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlinePanels.d.ts","sourceRoot":"","sources":["../../src/components/UnderlinePanels.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"UnderlinePanels.d.ts","sourceRoot":"","sources":["../../src/components/UnderlinePanels.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,IAAI,qBAAqB,EACxC,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,KAAK,oBAAoB,GAAG,0BAA0B,GAAG,MAAM,CAAA;AAS/D,QAAA,MAAM,mBAAmB;uBAAoB,oBAAoB;;;CAEhE,CAAA;AAID,QAAA,MAAM,eAAe,EAAE,OAAO,mBAAmB,GAAG;IAClD,GAAG,EAAE,OAAO,qBAAqB,CAAC,GAAG,CAAA;IACrC,KAAK,EAAE,OAAO,qBAAqB,CAAC,KAAK,CAAA;CAIzC,CAAA;AAIF,OAAO,EAAC,eAAe,EAAE,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,KAAK,yBAAyB,EAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UnderlinePanels as UnderlinePanels$1 } from '@primer/react/experimental';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { sx } from '@primer/react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledUnderlinePanels = styled(UnderlinePanels$1).withConfig({
|
|
7
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
8
|
+
}).withConfig({
|
|
9
|
+
displayName: "UnderlinePanels__StyledUnderlinePanels",
|
|
10
|
+
componentId: "sc-1w35i85-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
|
|
13
|
+
// @ts-ignore forwardedAs is valid here but I don't know how to fix the typescript error
|
|
14
|
+
const UnderlinePanelsImpl = ({
|
|
15
|
+
as,
|
|
16
|
+
...props
|
|
17
|
+
}) => /*#__PURE__*/jsx(StyledUnderlinePanels, {
|
|
18
|
+
forwardedAs: as,
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
UnderlinePanelsImpl.displayName = 'UnderlinePanels';
|
|
22
|
+
const UnderlinePanels = Object.assign(UnderlinePanelsImpl, {
|
|
23
|
+
Tab: UnderlinePanels$1.Tab,
|
|
24
|
+
Panel: UnderlinePanels$1.Panel
|
|
25
|
+
});
|
|
26
|
+
UnderlinePanelsImpl.__SLOT__ = UnderlinePanels$1.__SLOT__;
|
|
27
|
+
|
|
28
|
+
export { UnderlinePanels };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { ActionList as ActionList$1 } from '@primer/react/deprecated';
|
|
3
|
+
import { sx, Box } from '@primer/react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const ActionListImpl = /*#__PURE__*/forwardRef(function ActionList(props, ref) {
|
|
8
|
+
return /*#__PURE__*/jsx(Box, {
|
|
9
|
+
as: ActionList$1,
|
|
10
|
+
ref: ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
const StyledActionListItem = styled(ActionList$1.Item).withConfig({
|
|
15
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
16
|
+
}).withConfig({
|
|
17
|
+
displayName: "ActionList__StyledActionListItem",
|
|
18
|
+
componentId: "sc-1ugfmds-0"
|
|
19
|
+
})(["", ""], sx);
|
|
20
|
+
const ActionListItem = /*#__PURE__*/forwardRef(({
|
|
21
|
+
as,
|
|
22
|
+
...props
|
|
23
|
+
}, ref) => /*#__PURE__*/jsx(StyledActionListItem, {
|
|
24
|
+
...props,
|
|
25
|
+
...(as ? {
|
|
26
|
+
forwardedAs: as
|
|
27
|
+
} : {}),
|
|
28
|
+
ref: ref
|
|
29
|
+
}));
|
|
30
|
+
function ActionListGroup(props) {
|
|
31
|
+
return /*#__PURE__*/jsx(Box, {
|
|
32
|
+
as: ActionList$1.Group,
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function ActionListDivider(props) {
|
|
37
|
+
return /*#__PURE__*/jsx(Box, {
|
|
38
|
+
as: ActionList$1.Divider,
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const ActionList = Object.assign(ActionListImpl, {
|
|
43
|
+
Item: ActionListItem,
|
|
44
|
+
Group: ActionListGroup,
|
|
45
|
+
Divider: ActionListDivider
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { ActionList };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Dialog as Dialog$1 } from '@primer/react/deprecated';
|
|
2
|
+
import { Box } from '@primer/react';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledDialog = /*#__PURE__*/forwardRef(function Dialog(props, ref) {
|
|
7
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8
|
+
as: Dialog$1,
|
|
9
|
+
ref: ref,
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
const DialogImpl = /*#__PURE__*/forwardRef(({
|
|
14
|
+
as,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) => /*#__PURE__*/jsx(StyledDialog, {
|
|
17
|
+
...props,
|
|
18
|
+
...(as ? {
|
|
19
|
+
forwardedAs: as
|
|
20
|
+
} : {}),
|
|
21
|
+
ref: ref
|
|
22
|
+
}));
|
|
23
|
+
const StyledDialogHeader = /*#__PURE__*/forwardRef(function DialogHeader(props, ref) {
|
|
24
|
+
return /*#__PURE__*/jsx(Box, {
|
|
25
|
+
as: Dialog$1.Header,
|
|
26
|
+
ref: ref,
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const DialogHeader = /*#__PURE__*/forwardRef(({
|
|
31
|
+
as,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => /*#__PURE__*/jsx(StyledDialogHeader, {
|
|
34
|
+
...props,
|
|
35
|
+
...(as ? {
|
|
36
|
+
forwardedAs: as
|
|
37
|
+
} : {}),
|
|
38
|
+
ref: ref
|
|
39
|
+
}));
|
|
40
|
+
const Dialog = Object.assign(DialogImpl, {
|
|
41
|
+
Header: DialogHeader
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { Dialog };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Octicon as Octicon$1 } from '@primer/react/deprecated';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { sx } from '@primer/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use the icon component directly from `@primer/octicons-react` instead
|
|
9
|
+
*/
|
|
10
|
+
const StyledOcticon = styled(Octicon$1).withConfig({
|
|
11
|
+
shouldForwardProp(prop) {
|
|
12
|
+
return prop !== 'sx';
|
|
13
|
+
}
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "Octicon__StyledOcticon",
|
|
16
|
+
componentId: "sc-jtj3m8-0"
|
|
17
|
+
})(["", ""], ({
|
|
18
|
+
color,
|
|
19
|
+
sx: sxProp
|
|
20
|
+
}) => sx({
|
|
21
|
+
sx: {
|
|
22
|
+
color,
|
|
23
|
+
...sxProp
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
const Octicon = /*#__PURE__*/forwardRef(({
|
|
27
|
+
as,
|
|
28
|
+
...props
|
|
29
|
+
}, ref) => {
|
|
30
|
+
return /*#__PURE__*/jsx(StyledOcticon, {
|
|
31
|
+
...props,
|
|
32
|
+
...(as ? {
|
|
33
|
+
forwardedAs: as
|
|
34
|
+
} : {}),
|
|
35
|
+
ref: ref
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { Octicon, Octicon as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TabNav as TabNav$1 } from '@primer/react/deprecated';
|
|
2
|
+
import { sx } from '@primer/react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const StyledTabNav = styled(TabNav$1).withConfig({
|
|
8
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
9
|
+
}).withConfig({
|
|
10
|
+
displayName: "TabNav__StyledTabNav",
|
|
11
|
+
componentId: "sc-13kad3t-0"
|
|
12
|
+
})(["", ""], sx);
|
|
13
|
+
const TabNavImpl = ({
|
|
14
|
+
as,
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
return /*#__PURE__*/jsx(StyledTabNav, {
|
|
18
|
+
...props,
|
|
19
|
+
...(as ? {
|
|
20
|
+
forwardedAs: as
|
|
21
|
+
} : {})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const StyledTabNavLink = styled(TabNav$1.Link).withConfig({
|
|
25
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
26
|
+
}).withConfig({
|
|
27
|
+
displayName: "TabNav__StyledTabNavLink",
|
|
28
|
+
componentId: "sc-13kad3t-1"
|
|
29
|
+
})(["", ""], sx);
|
|
30
|
+
const TabNavLink = /*#__PURE__*/forwardRef(({
|
|
31
|
+
as,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => /*#__PURE__*/jsx(StyledTabNavLink, {
|
|
34
|
+
...props,
|
|
35
|
+
...(as ? {
|
|
36
|
+
forwardedAs: as
|
|
37
|
+
} : {}),
|
|
38
|
+
ref: ref
|
|
39
|
+
}));
|
|
40
|
+
const TabNav = Object.assign(TabNavImpl, {
|
|
41
|
+
Link: TabNavLink
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { TabNav };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAE1G,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,UAAU,CAAA;AACxC,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAE1G,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,UAAU,CAAA;AACxC,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK5C,KAAK,YAAY,GAAG,iBAAiB,CAAC,kBAAkB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAC,CAAA;AAQ7F,QAAA,MAAM,WAAW,uHAEf,CAAA;AAEF,QAAA,MAAM,OAAO,EAAkB,OAAO,WAAW,GAAG;IAClD,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAOD,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Tooltip as Tooltip$1 } from '@primer/react/deprecated';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { sx } from '@primer/react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const StyledTooltip = styled(Tooltip$1).withConfig({
|
|
8
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
9
|
+
}).withConfig({
|
|
10
|
+
displayName: "Tooltip__StyledTooltip",
|
|
11
|
+
componentId: "sc-145jcib-0"
|
|
12
|
+
})(["", ""], sx);
|
|
13
|
+
const TooltipImpl = /*#__PURE__*/forwardRef(function Tooltip({
|
|
14
|
+
as,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
return /*#__PURE__*/jsx(StyledTooltip, {
|
|
18
|
+
...props,
|
|
19
|
+
...(as ? {
|
|
20
|
+
forwardedAs: as
|
|
21
|
+
} : {}),
|
|
22
|
+
ref: ref
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
const Tooltip = TooltipImpl;
|
|
26
|
+
|
|
27
|
+
// Preserve static properties from the original component
|
|
28
|
+
Tooltip.alignments = Tooltip$1.alignments;
|
|
29
|
+
Tooltip.directions = Tooltip$1.directions;
|
|
30
|
+
Tooltip.__SLOT__ = Tooltip$1.__SLOT__;
|
|
31
|
+
|
|
32
|
+
export { Tooltip };
|