@primer/styled-react 0.0.0-20251202210025 → 0.0.0-20251202220556
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/_virtual/rolldown_runtime.js +29 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/deepmerge/dist/cjs.js +88 -0
- package/dist/node_modules/focus-visible/dist/focus-visible.js +212 -0
- package/dist/packages/styled-react/src/components/ActionList.js +107 -0
- package/dist/packages/styled-react/src/components/ActionMenu.js +19 -0
- package/dist/packages/styled-react/src/components/Autocomplete.js +23 -0
- package/dist/packages/styled-react/src/components/Avatar.js +16 -0
- package/dist/{components → packages/styled-react/src/components}/BaseStyles.js +29 -47
- package/dist/packages/styled-react/src/components/Box.js +23 -0
- package/dist/packages/styled-react/src/components/Breadcrumbs.js +28 -0
- package/dist/packages/styled-react/src/components/Button.js +48 -0
- package/dist/packages/styled-react/src/components/Checkbox.js +17 -0
- package/dist/packages/styled-react/src/components/CheckboxGroup.js +41 -0
- package/dist/packages/styled-react/src/components/CircleBadge.js +12 -0
- package/dist/packages/styled-react/src/components/CounterLabel.js +16 -0
- package/dist/packages/styled-react/src/components/DataTable.js +24 -0
- package/dist/packages/styled-react/src/components/Dialog.js +64 -0
- package/dist/packages/styled-react/src/components/Flash.js +12 -0
- package/dist/packages/styled-react/src/components/FormControl.js +19 -0
- package/dist/packages/styled-react/src/components/Header.js +44 -0
- package/dist/packages/styled-react/src/components/Heading.js +12 -0
- package/dist/packages/styled-react/src/components/IconButton.js +27 -0
- package/dist/packages/styled-react/src/components/Label.js +21 -0
- package/dist/packages/styled-react/src/components/Link.js +21 -0
- package/dist/packages/styled-react/src/components/LinkButton.js +12 -0
- package/dist/packages/styled-react/src/components/NavList.js +55 -0
- package/dist/packages/styled-react/src/components/Overlay.js +12 -0
- package/dist/packages/styled-react/src/components/PageHeader.js +71 -0
- package/dist/packages/styled-react/src/components/RadioGroup.js +41 -0
- package/dist/packages/styled-react/src/components/RelativeTime.js +14 -0
- package/dist/packages/styled-react/src/components/SegmentedControl.js +33 -0
- package/dist/packages/styled-react/src/components/Select.js +19 -0
- package/dist/packages/styled-react/src/components/Spinner.js +12 -0
- package/dist/packages/styled-react/src/components/StateLabel.js +16 -0
- package/dist/packages/styled-react/src/components/SubNav.js +28 -0
- package/dist/packages/styled-react/src/components/Text.js +21 -0
- package/dist/packages/styled-react/src/components/TextInput.js +31 -0
- package/dist/packages/styled-react/src/components/Textarea.js +21 -0
- package/dist/packages/styled-react/src/components/ThemeProvider.js +152 -0
- package/dist/packages/styled-react/src/components/Timeline.js +49 -0
- package/dist/packages/styled-react/src/components/ToggleSwitch.js +16 -0
- package/dist/packages/styled-react/src/components/Token.js +21 -0
- package/dist/packages/styled-react/src/components/Tooltip.js +17 -0
- package/dist/packages/styled-react/src/components/Truncate.js +12 -0
- package/dist/packages/styled-react/src/components/UnderlineNav.js +33 -0
- package/dist/packages/styled-react/src/components/UnderlinePanels.js +23 -0
- package/dist/packages/styled-react/src/components/deprecated/ActionList.js +44 -0
- package/dist/packages/styled-react/src/components/deprecated/DialogV1.js +34 -0
- package/dist/packages/styled-react/src/components/deprecated/Octicon.js +32 -0
- package/dist/packages/styled-react/src/components/deprecated/TabNav.js +30 -0
- package/dist/packages/styled-react/src/components/deprecated/Tooltip.js +24 -0
- package/dist/packages/styled-react/src/deprecated.js +7 -0
- package/dist/packages/styled-react/src/experimental.js +7 -0
- package/dist/packages/styled-react/src/index.js +50 -0
- package/dist/packages/styled-react/src/sx.js +11 -0
- package/dist/packages/styled-react/src/theme-get.js +10 -0
- package/package.json +4 -4
- package/dist/components/ActionList.js +0 -163
- package/dist/components/ActionMenu.js +0 -19
- package/dist/components/Autocomplete.js +0 -25
- package/dist/components/Avatar.js +0 -14
- package/dist/components/Box.js +0 -15
- package/dist/components/Breadcrumbs.js +0 -38
- package/dist/components/Button.js +0 -112
- package/dist/components/Checkbox.js +0 -15
- package/dist/components/CheckboxGroup.js +0 -43
- package/dist/components/CircleBadge.js +0 -12
- package/dist/components/CounterLabel.js +0 -14
- package/dist/components/DataTable.js +0 -32
- package/dist/components/Dialog.js +0 -90
- package/dist/components/Flash.js +0 -12
- package/dist/components/FormControl.js +0 -19
- package/dist/components/Header.js +0 -52
- package/dist/components/Heading.js +0 -12
- package/dist/components/IconButton.js +0 -40
- package/dist/components/Label.js +0 -26
- package/dist/components/Link.js +0 -26
- package/dist/components/LinkButton.js +0 -12
- package/dist/components/NavList.js +0 -74
- package/dist/components/Overlay.js +0 -12
- package/dist/components/PageHeader.js +0 -109
- package/dist/components/RadioGroup.js +0 -43
- package/dist/components/RelativeTime.js +0 -14
- package/dist/components/SegmentedControl.js +0 -31
- package/dist/components/Select.js +0 -24
- package/dist/components/Spinner.js +0 -12
- package/dist/components/StateLabel.js +0 -14
- package/dist/components/SubNav.js +0 -26
- package/dist/components/Text.js +0 -26
- package/dist/components/TextInput.js +0 -38
- package/dist/components/Textarea.js +0 -26
- package/dist/components/ThemeProvider.js +0 -203
- package/dist/components/Timeline.js +0 -47
- package/dist/components/ToggleSwitch.js +0 -14
- package/dist/components/Token.js +0 -26
- package/dist/components/Tooltip.js +0 -15
- package/dist/components/Truncate.js +0 -12
- package/dist/components/UnderlineNav.js +0 -45
- package/dist/components/UnderlinePanels.js +0 -28
- package/dist/components/deprecated/ActionList.js +0 -49
- package/dist/components/deprecated/DialogV1.js +0 -44
- package/dist/components/deprecated/Octicon.js +0 -39
- package/dist/components/deprecated/TabNav.js +0 -44
- package/dist/components/deprecated/Tooltip.js +0 -32
- package/dist/deprecated.js +0 -5
- package/dist/experimental.js +0 -5
- package/dist/index.js +0 -46
- package/dist/sx.js +0 -8
- package/dist/theme-get.js +0 -10
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Spinner } from "@primer/react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Spinner.tsx
|
|
6
|
+
const Spinner$1 = styled(Spinner).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
7
|
+
displayName: "Spinner",
|
|
8
|
+
componentId: "sc-jbw2a0-0"
|
|
9
|
+
})(["", ""], sx);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Spinner$1 as Spinner };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Box } from "./Box.js";
|
|
2
|
+
import { StateLabel } from "@primer/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/StateLabel.tsx
|
|
7
|
+
const StateLabel$1 = /* @__PURE__ */ forwardRef(function StateLabel$2(props, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
9
|
+
as: StateLabel,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { StateLabel$1 as StateLabel };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Box } from "./Box.js";
|
|
2
|
+
import { SubNav } from "@primer/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/SubNav.tsx
|
|
7
|
+
const SubNavImpl = /* @__PURE__ */ forwardRef(function SubNav$2(props, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
9
|
+
as: SubNav,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
const SubNavLink = /* @__PURE__ */ forwardRef(function SubNavLink$1(props, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
16
|
+
as: SubNav.Link,
|
|
17
|
+
ref,
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
const SubNav$1 = Object.assign(SubNavImpl, {
|
|
22
|
+
__SLOT__: SubNav.__SLOT__,
|
|
23
|
+
Link: SubNavLink
|
|
24
|
+
});
|
|
25
|
+
SubNavLink.__SLOT__ = SubNav.Link.__SLOT__;
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SubNav$1 as SubNav };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Text } from "@primer/react";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Text.tsx
|
|
8
|
+
const StyledText = styled(Text).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "Text__StyledText",
|
|
10
|
+
componentId: "sc-1klmep6-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Text$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledText, {
|
|
14
|
+
...props,
|
|
15
|
+
...as ? { forwardedAs: as } : {},
|
|
16
|
+
ref
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Text$1 as Text };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { TextInput } from "@primer/react";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/TextInput.tsx
|
|
8
|
+
const StyledTextInput = styled(TextInput).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "TextInput__StyledTextInput",
|
|
10
|
+
componentId: "sc-ttxlvl-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const TextInputImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledTextInput, {
|
|
14
|
+
ref,
|
|
15
|
+
...props,
|
|
16
|
+
...as ? { forwardedAs: as } : {}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
const TextInputAction = styled(TextInput.Action).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
20
|
+
displayName: "TextInput__TextInputAction",
|
|
21
|
+
componentId: "sc-ttxlvl-1"
|
|
22
|
+
})(["", ""], sx);
|
|
23
|
+
const TextInput$1 = Object.assign(TextInputImpl, {
|
|
24
|
+
__SLOT__: TextInput.__SLOT__,
|
|
25
|
+
Action: TextInputAction
|
|
26
|
+
});
|
|
27
|
+
TextInputAction.displayName = "TextInputAction";
|
|
28
|
+
TextInputImpl.displayName = "TextInput";
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TextInput$1 as TextInput };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Textarea } from "@primer/react";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Textarea.tsx
|
|
8
|
+
const StyledTextarea = styled(Textarea).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "Textarea__StyledTextarea",
|
|
10
|
+
componentId: "sc-40d1gp-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Textarea$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledTextarea, {
|
|
14
|
+
...props,
|
|
15
|
+
...as ? { forwardedAs: as } : {},
|
|
16
|
+
ref
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Textarea$1 as Textarea };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { __toESM } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_cjs } from "../../../../node_modules/deepmerge/dist/cjs.js";
|
|
3
|
+
import { ThemeProvider } from "styled-components";
|
|
4
|
+
import { theme, useId, useSyncedState } from "@primer/react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import ReactDOM from "react-dom";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/ThemeProvider.tsx
|
|
10
|
+
var import_cjs = /* @__PURE__ */ __toESM(require_cjs());
|
|
11
|
+
const defaultColorMode = "day";
|
|
12
|
+
const defaultDayScheme = "light";
|
|
13
|
+
const defaultNightScheme = "dark";
|
|
14
|
+
const ThemeContext = /* @__PURE__ */ React.createContext({
|
|
15
|
+
setColorMode: () => null,
|
|
16
|
+
setDayScheme: () => null,
|
|
17
|
+
setNightScheme: () => null
|
|
18
|
+
});
|
|
19
|
+
const getServerHandoff = (id) => {
|
|
20
|
+
try {
|
|
21
|
+
const serverData = document.getElementById(`__PRIMER_DATA_${id}__`)?.textContent;
|
|
22
|
+
if (serverData) return JSON.parse(serverData);
|
|
23
|
+
} catch (_error) {}
|
|
24
|
+
return {};
|
|
25
|
+
};
|
|
26
|
+
const ThemeProvider$1 = ({ children, ...props }) => {
|
|
27
|
+
const { theme: fallbackTheme, colorMode: fallbackColorMode, dayScheme: fallbackDayScheme, nightScheme: fallbackNightScheme } = useTheme();
|
|
28
|
+
const theme$1 = props.theme ?? fallbackTheme ?? theme;
|
|
29
|
+
const uniqueDataId = useId();
|
|
30
|
+
const { resolvedServerColorMode } = getServerHandoff(uniqueDataId);
|
|
31
|
+
const resolvedColorModePassthrough = React.useRef(resolvedServerColorMode);
|
|
32
|
+
const [colorMode, setColorMode] = useSyncedState(props.colorMode ?? fallbackColorMode ?? defaultColorMode);
|
|
33
|
+
const [dayScheme, setDayScheme] = useSyncedState(props.dayScheme ?? fallbackDayScheme ?? defaultDayScheme);
|
|
34
|
+
const [nightScheme, setNightScheme] = useSyncedState(props.nightScheme ?? fallbackNightScheme ?? defaultNightScheme);
|
|
35
|
+
const systemColorMode = useSystemColorMode();
|
|
36
|
+
const resolvedColorMode = resolvedColorModePassthrough.current || resolveColorMode(colorMode, systemColorMode);
|
|
37
|
+
const colorScheme = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
|
38
|
+
const { resolvedTheme, resolvedColorScheme } = React.useMemo(() => applyColorScheme(theme$1, colorScheme), [theme$1, colorScheme]);
|
|
39
|
+
React.useEffect(function updateColorModeAfterServerPassthrough() {
|
|
40
|
+
const resolvedColorModeOnClient = resolveColorMode(colorMode, systemColorMode);
|
|
41
|
+
if (resolvedColorModePassthrough.current) {
|
|
42
|
+
if (resolvedColorModePassthrough.current !== resolvedColorModeOnClient) window.setTimeout(() => {
|
|
43
|
+
ReactDOM.flushSync(() => {
|
|
44
|
+
setColorMode(resolvedColorModeOnClient);
|
|
45
|
+
});
|
|
46
|
+
setColorMode(colorMode);
|
|
47
|
+
});
|
|
48
|
+
resolvedColorModePassthrough.current = null;
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
colorMode,
|
|
52
|
+
systemColorMode,
|
|
53
|
+
setColorMode
|
|
54
|
+
]);
|
|
55
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
56
|
+
value: {
|
|
57
|
+
theme: resolvedTheme,
|
|
58
|
+
colorScheme,
|
|
59
|
+
colorMode,
|
|
60
|
+
resolvedColorMode,
|
|
61
|
+
resolvedColorScheme,
|
|
62
|
+
dayScheme,
|
|
63
|
+
nightScheme,
|
|
64
|
+
setColorMode,
|
|
65
|
+
setDayScheme,
|
|
66
|
+
setNightScheme
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsxs(ThemeProvider, {
|
|
69
|
+
theme: resolvedTheme,
|
|
70
|
+
children: [children, props.preventSSRMismatch ? /* @__PURE__ */ jsx("script", {
|
|
71
|
+
type: "application/json",
|
|
72
|
+
id: `__PRIMER_DATA_${uniqueDataId}__`,
|
|
73
|
+
dangerouslySetInnerHTML: { __html: JSON.stringify({ resolvedServerColorMode: resolvedColorMode }) }
|
|
74
|
+
}) : null]
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
function useTheme() {
|
|
79
|
+
return React.useContext(ThemeContext);
|
|
80
|
+
}
|
|
81
|
+
function useColorSchemeVar(values, fallback) {
|
|
82
|
+
const { colorScheme = "" } = useTheme();
|
|
83
|
+
return values[colorScheme] ?? fallback;
|
|
84
|
+
}
|
|
85
|
+
function useSystemColorMode() {
|
|
86
|
+
const [systemColorMode, setSystemColorMode] = React.useState(getSystemColorMode);
|
|
87
|
+
React.useEffect(() => {
|
|
88
|
+
const media = window?.matchMedia?.("(prefers-color-scheme: dark)");
|
|
89
|
+
function matchesMediaToColorMode(matches) {
|
|
90
|
+
return matches ? "night" : "day";
|
|
91
|
+
}
|
|
92
|
+
function handleChange(event) {
|
|
93
|
+
const isNight = event.matches;
|
|
94
|
+
setSystemColorMode(matchesMediaToColorMode(isNight));
|
|
95
|
+
}
|
|
96
|
+
if (media) {
|
|
97
|
+
const isNight = media.matches;
|
|
98
|
+
setSystemColorMode(matchesMediaToColorMode(isNight));
|
|
99
|
+
if (media.addEventListener !== void 0) {
|
|
100
|
+
media.addEventListener("change", handleChange);
|
|
101
|
+
return function cleanup() {
|
|
102
|
+
media.removeEventListener("change", handleChange);
|
|
103
|
+
};
|
|
104
|
+
} else if (media.addListener !== void 0) {
|
|
105
|
+
media.addListener(handleChange);
|
|
106
|
+
return function cleanup() {
|
|
107
|
+
media.removeListener(handleChange);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, []);
|
|
112
|
+
return systemColorMode;
|
|
113
|
+
}
|
|
114
|
+
function getSystemColorMode() {
|
|
115
|
+
if (typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)")?.matches) return "night";
|
|
116
|
+
return "day";
|
|
117
|
+
}
|
|
118
|
+
function resolveColorMode(colorMode, systemColorMode) {
|
|
119
|
+
switch (colorMode) {
|
|
120
|
+
case "auto": return systemColorMode;
|
|
121
|
+
default: return colorMode;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function chooseColorScheme(colorMode, dayScheme, nightScheme) {
|
|
125
|
+
switch (colorMode) {
|
|
126
|
+
case "day":
|
|
127
|
+
case "light": return dayScheme;
|
|
128
|
+
case "dark":
|
|
129
|
+
case "night": return nightScheme;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function applyColorScheme(theme$1, colorScheme) {
|
|
133
|
+
if (!theme$1.colorSchemes) return {
|
|
134
|
+
resolvedTheme: theme$1,
|
|
135
|
+
resolvedColorScheme: void 0
|
|
136
|
+
};
|
|
137
|
+
if (!theme$1.colorSchemes[colorScheme]) {
|
|
138
|
+
console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
|
|
139
|
+
const defaultColorScheme = Object.keys(theme$1.colorSchemes)[0];
|
|
140
|
+
return {
|
|
141
|
+
resolvedTheme: (0, import_cjs.default)(theme$1, theme$1.colorSchemes[defaultColorScheme]),
|
|
142
|
+
resolvedColorScheme: defaultColorScheme
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
resolvedTheme: (0, import_cjs.default)(theme$1, theme$1.colorSchemes[colorScheme]),
|
|
147
|
+
resolvedColorScheme: colorScheme
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
export { ThemeProvider$1 as ThemeProvider, useColorSchemeVar, useTheme };
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
|
|
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
|
+
});
|
|
13
|
+
});
|
|
14
|
+
const TimelineItem = /* @__PURE__ */ forwardRef(function TimelineItem$1(props, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
16
|
+
as: Timeline.Item,
|
|
17
|
+
ref,
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
function TimelineBadge(props) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
23
|
+
as: Timeline.Badge,
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const TimelineBody = /* @__PURE__ */ forwardRef(function TimelineBody$1(props, ref) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
29
|
+
as: Timeline.Body,
|
|
30
|
+
ref,
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
const TimelineBreak = /* @__PURE__ */ forwardRef(function TimelineBreak$1(props, ref) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
36
|
+
as: Timeline.Break,
|
|
37
|
+
ref,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
const Timeline$1 = Object.assign(TimelineImpl, {
|
|
42
|
+
Item: TimelineItem,
|
|
43
|
+
Badge: TimelineBadge,
|
|
44
|
+
Body: TimelineBody,
|
|
45
|
+
Break: TimelineBreak
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Timeline$1 as Timeline };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
|
|
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
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ToggleSwitch$1 as ToggleSwitch };
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
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"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Token$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledToken, {
|
|
14
|
+
...props,
|
|
15
|
+
...as ? { forwardedAs: as } : {},
|
|
16
|
+
ref
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Token$1 as Token };
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
|
|
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
|
+
});
|
|
13
|
+
});
|
|
14
|
+
Tooltip$1.__SLOT__ = Tooltip.__SLOT__;
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Tooltip$1 as Tooltip };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Truncate } from "@primer/react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Truncate.tsx
|
|
6
|
+
const Truncate$1 = styled(Truncate).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
7
|
+
displayName: "Truncate",
|
|
8
|
+
componentId: "sc-x3i4it-0"
|
|
9
|
+
})(["", ""], sx);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Truncate$1 as Truncate };
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
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
|
+
});
|
|
15
|
+
});
|
|
16
|
+
const UnderlineNavImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNav, {
|
|
17
|
+
...props,
|
|
18
|
+
...as ? { forwardedAs: as } : {},
|
|
19
|
+
ref
|
|
20
|
+
}));
|
|
21
|
+
const StyledUnderlineNavItem = styled(UnderlineNav.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
22
|
+
displayName: "UnderlineNav__StyledUnderlineNavItem",
|
|
23
|
+
componentId: "sc-dx6br2-0"
|
|
24
|
+
})(["", ""], sx);
|
|
25
|
+
const UnderlineNavItem = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledUnderlineNavItem, {
|
|
26
|
+
...props,
|
|
27
|
+
...as ? { forwardedAs: as } : {},
|
|
28
|
+
ref
|
|
29
|
+
}));
|
|
30
|
+
const UnderlineNav$1 = Object.assign(UnderlineNavImpl, { Item: UnderlineNavItem });
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { UnderlineNav$1 as UnderlineNav };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { UnderlinePanels } from "@primer/react/experimental";
|
|
5
|
+
|
|
6
|
+
//#region src/components/UnderlinePanels.tsx
|
|
7
|
+
const StyledUnderlinePanels = styled(UnderlinePanels).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
8
|
+
displayName: "UnderlinePanels__StyledUnderlinePanels",
|
|
9
|
+
componentId: "sc-1w35i85-0"
|
|
10
|
+
})(["", ""], sx);
|
|
11
|
+
const UnderlinePanelsImpl = ({ as, ...props }) => /* @__PURE__ */ jsx(StyledUnderlinePanels, {
|
|
12
|
+
forwardedAs: as,
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
UnderlinePanelsImpl.displayName = "UnderlinePanels";
|
|
16
|
+
const UnderlinePanels$1 = Object.assign(UnderlinePanelsImpl, {
|
|
17
|
+
Tab: UnderlinePanels.Tab,
|
|
18
|
+
Panel: UnderlinePanels.Panel
|
|
19
|
+
});
|
|
20
|
+
UnderlinePanelsImpl.__SLOT__ = UnderlinePanels.__SLOT__;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { UnderlinePanels$1 as UnderlinePanels };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { sx } from "../../sx.js";
|
|
2
|
+
import { Box } from "../Box.js";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ActionList } from "@primer/react/deprecated";
|
|
7
|
+
|
|
8
|
+
//#region src/components/deprecated/ActionList.tsx
|
|
9
|
+
const ActionListImpl = /* @__PURE__ */ forwardRef(function ActionList$2(props, ref) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
11
|
+
as: ActionList,
|
|
12
|
+
ref,
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
const StyledActionListItem = styled(ActionList.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
17
|
+
displayName: "ActionList__StyledActionListItem",
|
|
18
|
+
componentId: "sc-1ugfmds-0"
|
|
19
|
+
})(["", ""], sx);
|
|
20
|
+
const ActionListItem = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledActionListItem, {
|
|
21
|
+
...props,
|
|
22
|
+
...as ? { forwardedAs: as } : {},
|
|
23
|
+
ref
|
|
24
|
+
}));
|
|
25
|
+
function ActionListGroup(props) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
27
|
+
as: ActionList.Group,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function ActionListDivider(props) {
|
|
32
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
33
|
+
as: ActionList.Divider,
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const ActionList$1 = Object.assign(ActionListImpl, {
|
|
38
|
+
Item: ActionListItem,
|
|
39
|
+
Group: ActionListGroup,
|
|
40
|
+
Divider: ActionListDivider
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { ActionList$1 as ActionList };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Box } from "../Box.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Dialog } from "@primer/react/deprecated";
|
|
5
|
+
|
|
6
|
+
//#region src/components/deprecated/DialogV1.tsx
|
|
7
|
+
const StyledDialog = /* @__PURE__ */ forwardRef(function Dialog$2(props, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
9
|
+
as: Dialog,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
const DialogImpl = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledDialog, {
|
|
15
|
+
...props,
|
|
16
|
+
...as ? { forwardedAs: as } : {},
|
|
17
|
+
ref
|
|
18
|
+
}));
|
|
19
|
+
const StyledDialogHeader = /* @__PURE__ */ forwardRef(function DialogHeader$1(props, ref) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
21
|
+
as: Dialog.Header,
|
|
22
|
+
ref,
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const DialogHeader = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledDialogHeader, {
|
|
27
|
+
...props,
|
|
28
|
+
...as ? { forwardedAs: as } : {},
|
|
29
|
+
ref
|
|
30
|
+
}));
|
|
31
|
+
const Dialog$1 = Object.assign(DialogImpl, { Header: DialogHeader });
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Dialog$1 as Dialog };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { sx } from "../../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Octicon } from "@primer/react/deprecated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/deprecated/Octicon.tsx
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use the icon component directly from `@primer/octicons-react` instead
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use the icon component directly from `@primer/octicons-react` instead
|
|
13
|
+
*/
|
|
14
|
+
const StyledOcticon = styled(Octicon).withConfig({ shouldForwardProp(prop) {
|
|
15
|
+
return prop !== "sx";
|
|
16
|
+
} }).withConfig({
|
|
17
|
+
displayName: "Octicon__StyledOcticon",
|
|
18
|
+
componentId: "sc-jtj3m8-0"
|
|
19
|
+
})(["", ""], ({ color, sx: sxProp }) => sx({ sx: {
|
|
20
|
+
color,
|
|
21
|
+
...sxProp
|
|
22
|
+
} }));
|
|
23
|
+
const Octicon$1 = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => {
|
|
24
|
+
return /* @__PURE__ */ jsx(StyledOcticon, {
|
|
25
|
+
...props,
|
|
26
|
+
...as ? { forwardedAs: as } : {},
|
|
27
|
+
ref
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Octicon$1 as Octicon };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sx } from "../../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { TabNav } from "@primer/react/deprecated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/deprecated/TabNav.tsx
|
|
8
|
+
const StyledTabNav = styled(TabNav).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "TabNav__StyledTabNav",
|
|
10
|
+
componentId: "sc-13kad3t-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const TabNavImpl = ({ as, ...props }) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledTabNav, {
|
|
14
|
+
...props,
|
|
15
|
+
...as ? { forwardedAs: as } : {}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const StyledTabNavLink = styled(TabNav.Link).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
19
|
+
displayName: "TabNav__StyledTabNavLink",
|
|
20
|
+
componentId: "sc-13kad3t-1"
|
|
21
|
+
})(["", ""], sx);
|
|
22
|
+
const TabNavLink = /* @__PURE__ */ forwardRef(({ as, ...props }, ref) => /* @__PURE__ */ jsx(StyledTabNavLink, {
|
|
23
|
+
...props,
|
|
24
|
+
...as ? { forwardedAs: as } : {},
|
|
25
|
+
ref
|
|
26
|
+
}));
|
|
27
|
+
const TabNav$1 = Object.assign(TabNavImpl, { Link: TabNavLink });
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { TabNav$1 as TabNav };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { sx } from "../../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Tooltip } from "@primer/react/deprecated";
|
|
6
|
+
|
|
7
|
+
//#region src/components/deprecated/Tooltip.tsx
|
|
8
|
+
const StyledTooltip = styled(Tooltip).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "Tooltip__StyledTooltip",
|
|
10
|
+
componentId: "sc-145jcib-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Tooltip$1 = /* @__PURE__ */ forwardRef(function Tooltip$2({ as, ...props }, ref) {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledTooltip, {
|
|
14
|
+
...props,
|
|
15
|
+
...as ? { forwardedAs: as } : {},
|
|
16
|
+
ref
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
Tooltip$1.alignments = Tooltip.alignments;
|
|
20
|
+
Tooltip$1.directions = Tooltip.directions;
|
|
21
|
+
Tooltip$1.__SLOT__ = Tooltip.__SLOT__;
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Tooltip$1 as Tooltip };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TabNav } from "./components/deprecated/TabNav.js";
|
|
2
|
+
import { Dialog } from "./components/deprecated/DialogV1.js";
|
|
3
|
+
import { Octicon } from "./components/deprecated/Octicon.js";
|
|
4
|
+
import { Tooltip } from "./components/deprecated/Tooltip.js";
|
|
5
|
+
import { ActionList } from "./components/deprecated/ActionList.js";
|
|
6
|
+
|
|
7
|
+
export { ActionList, Dialog, Octicon, TabNav, Tooltip };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dialog } from "./components/Dialog.js";
|
|
2
|
+
import { PageHeader } from "./components/PageHeader.js";
|
|
3
|
+
import { Tooltip } from "./components/Tooltip.js";
|
|
4
|
+
import { UnderlinePanels } from "./components/UnderlinePanels.js";
|
|
5
|
+
import { Table } from "./components/DataTable.js";
|
|
6
|
+
|
|
7
|
+
export { Dialog, PageHeader, Table, Tooltip, UnderlinePanels };
|