@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,163 +1,107 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styled from
|
|
3
|
-
import { ActionList
|
|
4
|
-
import
|
|
5
|
-
import { jsx } from
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { ActionList } from "@primer/react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
componentId: "sc-hw2362-0"
|
|
7
|
+
//#region src/components/ActionList.tsx
|
|
8
|
+
const StyledActionList = styled(ActionList).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
9
|
+
displayName: "ActionList__StyledActionList",
|
|
10
|
+
componentId: "sc-hw2362-0"
|
|
12
11
|
})(["", ""], sx);
|
|
13
|
-
const ActionListImpl =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...rest,
|
|
20
|
-
...(as ? {
|
|
21
|
-
forwardedAs: as
|
|
22
|
-
} : {})
|
|
23
|
-
});
|
|
12
|
+
const ActionListImpl = /* @__PURE__ */ React.forwardRef(function ActionListImpl$1({ as, ...rest }, ref) {
|
|
13
|
+
return /* @__PURE__ */ jsx(StyledActionList, {
|
|
14
|
+
ref,
|
|
15
|
+
...rest,
|
|
16
|
+
...as ? { forwardedAs: as } : {}
|
|
17
|
+
});
|
|
24
18
|
});
|
|
25
|
-
const StyledActionListLinkItem = styled(ActionList
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
displayName: "ActionList__StyledActionListLinkItem",
|
|
29
|
-
componentId: "sc-hw2362-1"
|
|
19
|
+
const StyledActionListLinkItem = styled(ActionList.LinkItem).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
20
|
+
displayName: "ActionList__StyledActionListLinkItem",
|
|
21
|
+
componentId: "sc-hw2362-1"
|
|
30
22
|
})(["", ""], sx);
|
|
31
|
-
const ActionListLinkItem =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ref: ref,
|
|
37
|
-
...props,
|
|
38
|
-
...(as ? {
|
|
39
|
-
forwardedAs: as
|
|
40
|
-
} : {}),
|
|
41
|
-
children: children
|
|
23
|
+
const ActionListLinkItem = /* @__PURE__ */ React.forwardRef(({ children, as, ...props }, ref) => /* @__PURE__ */ jsx(StyledActionListLinkItem, {
|
|
24
|
+
ref,
|
|
25
|
+
...props,
|
|
26
|
+
...as ? { forwardedAs: as } : {},
|
|
27
|
+
children
|
|
42
28
|
}));
|
|
43
|
-
ActionListLinkItem.displayName =
|
|
44
|
-
const StyledActionListTrailingAction = styled(ActionList
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
displayName: "ActionList__StyledActionListTrailingAction",
|
|
48
|
-
componentId: "sc-hw2362-2"
|
|
29
|
+
ActionListLinkItem.displayName = "ActionList.LinkItem";
|
|
30
|
+
const StyledActionListTrailingAction = styled(ActionList.TrailingAction).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
31
|
+
displayName: "ActionList__StyledActionListTrailingAction",
|
|
32
|
+
componentId: "sc-hw2362-2"
|
|
49
33
|
})(["", ""], sx);
|
|
50
|
-
const ActionListTrailingAction =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
...(as ? {
|
|
58
|
-
forwardedAs: as
|
|
59
|
-
} : {}),
|
|
60
|
-
ref: ref
|
|
61
|
-
});
|
|
34
|
+
const ActionListTrailingAction = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
35
|
+
const { as, ...rest } = props;
|
|
36
|
+
return /* @__PURE__ */ jsx(StyledActionListTrailingAction, {
|
|
37
|
+
...rest,
|
|
38
|
+
...as ? { forwardedAs: as } : {},
|
|
39
|
+
ref
|
|
40
|
+
});
|
|
62
41
|
});
|
|
63
|
-
const StyledActionListItem = styled(ActionList
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
displayName: "ActionList__StyledActionListItem",
|
|
67
|
-
componentId: "sc-hw2362-3"
|
|
42
|
+
const StyledActionListItem = styled(ActionList.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
43
|
+
displayName: "ActionList__StyledActionListItem",
|
|
44
|
+
componentId: "sc-hw2362-3"
|
|
68
45
|
})(["", ""], sx);
|
|
69
|
-
const ActionListItem =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ref: ref,
|
|
75
|
-
...props,
|
|
76
|
-
...(as ? {
|
|
77
|
-
forwardedAs: as
|
|
78
|
-
} : {}),
|
|
79
|
-
children: children
|
|
46
|
+
const ActionListItem = /* @__PURE__ */ React.forwardRef(({ children, as, ...props }, ref) => /* @__PURE__ */ jsx(StyledActionListItem, {
|
|
47
|
+
ref,
|
|
48
|
+
...props,
|
|
49
|
+
...as ? { forwardedAs: as } : {},
|
|
50
|
+
children
|
|
80
51
|
}));
|
|
81
|
-
const StyledActionListGroup = styled(ActionList
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
displayName: "ActionList__StyledActionListGroup",
|
|
85
|
-
componentId: "sc-hw2362-4"
|
|
52
|
+
const StyledActionListGroup = styled(ActionList.Group).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
53
|
+
displayName: "ActionList__StyledActionListGroup",
|
|
54
|
+
componentId: "sc-hw2362-4"
|
|
86
55
|
})(["", ""], sx);
|
|
87
|
-
const ActionListGroup = ({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}) => /*#__PURE__*/jsx(StyledActionListGroup, {
|
|
92
|
-
...props,
|
|
93
|
-
...(as ? {
|
|
94
|
-
forwardedAs: as
|
|
95
|
-
} : {}),
|
|
96
|
-
children: children
|
|
56
|
+
const ActionListGroup = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListGroup, {
|
|
57
|
+
...props,
|
|
58
|
+
...as ? { forwardedAs: as } : {},
|
|
59
|
+
children
|
|
97
60
|
});
|
|
98
|
-
ActionListGroup.displayName =
|
|
99
|
-
const ActionListDivider = styled(ActionList
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
displayName: "ActionList__ActionListDivider",
|
|
103
|
-
componentId: "sc-hw2362-5"
|
|
61
|
+
ActionListGroup.displayName = "ActionList.Group";
|
|
62
|
+
const ActionListDivider = styled(ActionList.Divider).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
63
|
+
displayName: "ActionList__ActionListDivider",
|
|
64
|
+
componentId: "sc-hw2362-5"
|
|
104
65
|
})(["", ""], sx);
|
|
105
|
-
const StyledActionListLeadingVisual = styled(ActionList
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
displayName: "ActionList__StyledActionListLeadingVisual",
|
|
109
|
-
componentId: "sc-hw2362-6"
|
|
66
|
+
const StyledActionListLeadingVisual = styled(ActionList.LeadingVisual).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
67
|
+
displayName: "ActionList__StyledActionListLeadingVisual",
|
|
68
|
+
componentId: "sc-hw2362-6"
|
|
110
69
|
})(["", ""], sx);
|
|
111
|
-
const ActionListLeadingVisual = ({
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}) => /*#__PURE__*/jsx(StyledActionListLeadingVisual, {
|
|
116
|
-
...props,
|
|
117
|
-
...(as ? {
|
|
118
|
-
forwardedAs: as
|
|
119
|
-
} : {}),
|
|
120
|
-
children: children
|
|
70
|
+
const ActionListLeadingVisual = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListLeadingVisual, {
|
|
71
|
+
...props,
|
|
72
|
+
...as ? { forwardedAs: as } : {},
|
|
73
|
+
children
|
|
121
74
|
});
|
|
122
|
-
ActionListLeadingVisual.displayName =
|
|
123
|
-
const StyledActionListTrailingVisual = styled(ActionList
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
displayName: "ActionList__StyledActionListTrailingVisual",
|
|
127
|
-
componentId: "sc-hw2362-7"
|
|
75
|
+
ActionListLeadingVisual.displayName = "ActionList.LeadingVisual";
|
|
76
|
+
const StyledActionListTrailingVisual = styled(ActionList.TrailingVisual).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
77
|
+
displayName: "ActionList__StyledActionListTrailingVisual",
|
|
78
|
+
componentId: "sc-hw2362-7"
|
|
128
79
|
})(["", ""], sx);
|
|
129
|
-
const ActionListTrailingVisual = ({
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}) => /*#__PURE__*/jsx(StyledActionListTrailingVisual, {
|
|
134
|
-
...props,
|
|
135
|
-
...(as ? {
|
|
136
|
-
forwardedAs: as
|
|
137
|
-
} : {}),
|
|
138
|
-
children: children
|
|
80
|
+
const ActionListTrailingVisual = ({ children, as, ...props }) => /* @__PURE__ */ jsx(StyledActionListTrailingVisual, {
|
|
81
|
+
...props,
|
|
82
|
+
...as ? { forwardedAs: as } : {},
|
|
83
|
+
children
|
|
139
84
|
});
|
|
140
|
-
ActionListTrailingVisual.displayName =
|
|
141
|
-
const ActionList = Object.assign(ActionListImpl, {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
85
|
+
ActionListTrailingVisual.displayName = "ActionList.TrailingVisual";
|
|
86
|
+
const ActionList$1 = Object.assign(ActionListImpl, {
|
|
87
|
+
Item: ActionListItem,
|
|
88
|
+
LinkItem: ActionListLinkItem,
|
|
89
|
+
Group: ActionListGroup,
|
|
90
|
+
GroupHeading: ActionList.GroupHeading,
|
|
91
|
+
Divider: ActionListDivider,
|
|
92
|
+
Description: ActionList.Description,
|
|
93
|
+
LeadingVisual: ActionListLeadingVisual,
|
|
94
|
+
TrailingVisual: ActionListTrailingVisual,
|
|
95
|
+
Heading: ActionList.Heading,
|
|
96
|
+
TrailingAction: ActionListTrailingAction
|
|
152
97
|
});
|
|
98
|
+
ActionListItem.__SLOT__ = ActionList.Item.__SLOT__;
|
|
99
|
+
ActionListLinkItem.__SLOT__ = ActionList.LinkItem.__SLOT__;
|
|
100
|
+
ActionListGroup.__SLOT__ = ActionList.Group.__SLOT__;
|
|
101
|
+
ActionListDivider.__SLOT__ = ActionList.Divider.__SLOT__;
|
|
102
|
+
ActionListLeadingVisual.__SLOT__ = ActionList.LeadingVisual.__SLOT__;
|
|
103
|
+
ActionListTrailingVisual.__SLOT__ = ActionList.TrailingVisual.__SLOT__;
|
|
104
|
+
ActionListTrailingAction.__SLOT__ = ActionList.TrailingAction.__SLOT__;
|
|
153
105
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
ActionListLinkItem.__SLOT__ = ActionList$1.LinkItem.__SLOT__;
|
|
157
|
-
ActionListGroup.__SLOT__ = ActionList$1.Group.__SLOT__;
|
|
158
|
-
ActionListDivider.__SLOT__ = ActionList$1.Divider.__SLOT__;
|
|
159
|
-
ActionListLeadingVisual.__SLOT__ = ActionList$1.LeadingVisual.__SLOT__;
|
|
160
|
-
ActionListTrailingVisual.__SLOT__ = ActionList$1.TrailingVisual.__SLOT__;
|
|
161
|
-
ActionListTrailingAction.__SLOT__ = ActionList$1.TrailingAction.__SLOT__;
|
|
162
|
-
|
|
163
|
-
export { ActionList };
|
|
106
|
+
//#endregion
|
|
107
|
+
export { ActionList$1 as ActionList };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { ActionMenu } from "@primer/react";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
componentId: "sc-w5s60e-0"
|
|
5
|
+
//#region src/components/ActionMenu.tsx
|
|
6
|
+
const ActionMenuOverlay = styled(ActionMenu.Overlay).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
7
|
+
displayName: "ActionMenu__ActionMenuOverlay",
|
|
8
|
+
componentId: "sc-w5s60e-0"
|
|
10
9
|
})(["", ""], sx);
|
|
11
|
-
const ActionMenu = Object.assign(ActionMenu
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const ActionMenu$1 = Object.assign(ActionMenu, {
|
|
11
|
+
Button: ActionMenu.Button,
|
|
12
|
+
Anchor: ActionMenu.Anchor,
|
|
13
|
+
Overlay: ActionMenuOverlay,
|
|
14
|
+
Divider: ActionMenu.Divider
|
|
16
15
|
});
|
|
17
|
-
ActionMenuOverlay.__SLOT__ = ActionMenu
|
|
16
|
+
ActionMenuOverlay.__SLOT__ = ActionMenu.Overlay.__SLOT__;
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ActionMenu$1 as ActionMenu };
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Autocomplete } from "@primer/react";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
componentId: "sc-j8ax2e-0"
|
|
5
|
+
//#region src/components/Autocomplete.tsx
|
|
6
|
+
const AutocompleteOverlay = styled(Autocomplete.Overlay).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
7
|
+
displayName: "Autocomplete__AutocompleteOverlay",
|
|
8
|
+
componentId: "sc-j8ax2e-0"
|
|
10
9
|
})(["", ""], sx);
|
|
11
|
-
const AutocompleteInput = styled(Autocomplete
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
displayName: "Autocomplete__AutocompleteInput",
|
|
15
|
-
componentId: "sc-j8ax2e-1"
|
|
10
|
+
const AutocompleteInput = styled(Autocomplete.Input).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
11
|
+
displayName: "Autocomplete__AutocompleteInput",
|
|
12
|
+
componentId: "sc-j8ax2e-1"
|
|
16
13
|
})(["", ""], sx);
|
|
17
|
-
const Autocomplete = Object.assign(Autocomplete
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const Autocomplete$1 = Object.assign(Autocomplete, {
|
|
15
|
+
Context: Autocomplete.Context,
|
|
16
|
+
Input: AutocompleteInput,
|
|
17
|
+
Menu: Autocomplete.Menu,
|
|
18
|
+
Overlay: AutocompleteOverlay
|
|
22
19
|
});
|
|
23
|
-
AutocompleteOverlay.__SLOT__ = Autocomplete
|
|
20
|
+
AutocompleteOverlay.__SLOT__ = Autocomplete.Overlay.__SLOT__;
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Autocomplete$1 as Autocomplete };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { jsx } from
|
|
1
|
+
import { Box } from "./Box.js";
|
|
2
|
+
import { Avatar } 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/Avatar.tsx
|
|
7
|
+
const Avatar$1 = /* @__PURE__ */ forwardRef(function Avatar$2(props, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
9
|
+
as: Avatar,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
12
13
|
});
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Avatar$1 as Avatar };
|
|
@@ -1,51 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { useTheme } from "./ThemeProvider.js";
|
|
2
|
+
import { createGlobalStyle } from "styled-components";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import "focus-visible";
|
|
6
6
|
|
|
7
|
+
//#region src/components/BaseStyles.tsx
|
|
7
8
|
const GlobalStyle = createGlobalStyle(["*{box-sizing:border-box;}body{margin:0;}table{border-collapse:collapse;}[data-color-mode='light'] input{color-scheme:light;}[data-color-mode='dark'] input{color-scheme:dark;}@media (prefers-color-scheme:light){[data-color-mode='auto'][data-light-theme*='light']{color-scheme:light;}}@media (prefers-color-scheme:dark){[data-color-mode='auto'][data-dark-theme*='dark']{color-scheme:dark;}}[role='button']:focus:not(:focus-visible):not(:global(.focus-visible)),[role='tabpanel'][tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),button:focus:not(:focus-visible):not(:global(.focus-visible)),summary:focus:not(:focus-visible):not(:global(.focus-visible)),a:focus:not(:focus-visible):not(:global(.focus-visible)){outline:none;box-shadow:none;}[tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),details-dialog:focus:not(:focus-visible):not(:global(.focus-visible)){outline:none;}.BaseStyles{font-family:var(--BaseStyles-fontFamily,var(--fontStack-system));line-height:var(--BaseStyles-lineHeight,1.5);color:var(--BaseStyles-fgColor,var(--fgColor-default));&:has([data-color-mode='light']){input &{color-scheme:light;}}&:has([data-color-mode='dark']){input &{color-scheme:dark;}}:where(a:not([class*='prc-']):not([class*='PRC-']):not([class*='Primer_Brand__'])){color:var(--fgColor-accent,var(--color-accent-fg));text-decoration:none;&:hover{text-decoration:underline;}}}"]);
|
|
8
|
-
function BaseStyles({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
return /*#__PURE__*/jsxs(Component, {
|
|
30
|
-
className: clsx('BaseStyles', className),
|
|
31
|
-
"data-portal-root": true
|
|
32
|
-
/**
|
|
33
|
-
* We need to map valid primer/react color modes onto valid color modes for primer/primitives
|
|
34
|
-
* valid color modes for primer/primitives: auto | light | dark
|
|
35
|
-
* valid color modes for primer/primer: auto | day | night | light | dark
|
|
36
|
-
*/,
|
|
37
|
-
"data-color-mode": colorMode === 'auto' ? 'auto' : colorScheme?.includes('dark') ? 'dark' : 'light',
|
|
38
|
-
"data-light-theme": dayScheme,
|
|
39
|
-
"data-dark-theme": nightScheme,
|
|
40
|
-
style: {
|
|
41
|
-
...baseStyles,
|
|
42
|
-
...style
|
|
43
|
-
},
|
|
44
|
-
...rest,
|
|
45
|
-
children: [/*#__PURE__*/jsx(GlobalStyle, {
|
|
46
|
-
colorScheme: colorScheme?.includes('dark') ? 'dark' : 'light'
|
|
47
|
-
}), children]
|
|
48
|
-
});
|
|
9
|
+
function BaseStyles({ children, color, fontFamily, lineHeight, className, as: Component = "div", style, ...rest }) {
|
|
10
|
+
const { colorMode, colorScheme, dayScheme, nightScheme } = useTheme();
|
|
11
|
+
const baseStyles = {
|
|
12
|
+
["--BaseStyles-fgColor"]: color,
|
|
13
|
+
["--BaseStyles-fontFamily"]: fontFamily,
|
|
14
|
+
["--BaseStyles-lineHeight"]: lineHeight
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ jsxs(Component, {
|
|
17
|
+
className: clsx("BaseStyles", className),
|
|
18
|
+
"data-portal-root": true,
|
|
19
|
+
"data-color-mode": colorMode === "auto" ? "auto" : colorScheme?.includes("dark") ? "dark" : "light",
|
|
20
|
+
"data-light-theme": dayScheme,
|
|
21
|
+
"data-dark-theme": nightScheme,
|
|
22
|
+
style: {
|
|
23
|
+
...baseStyles,
|
|
24
|
+
...style
|
|
25
|
+
},
|
|
26
|
+
...rest,
|
|
27
|
+
children: [/* @__PURE__ */ jsx(GlobalStyle, { colorScheme: colorScheme?.includes("dark") ? "dark" : "light" }), children]
|
|
28
|
+
});
|
|
49
29
|
}
|
|
50
30
|
|
|
51
|
-
|
|
31
|
+
//#endregion
|
|
32
|
+
export { BaseStyles };
|
package/dist/components/Box.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { background, border, color, flexbox, grid, layout, position, shadow, space, typography } from "styled-system";
|
|
4
4
|
|
|
5
|
+
//#region src/components/Box.tsx
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* @deprecated The Box component is deprecated. Replace with a `div` or
|
|
8
|
+
* appropriate HTML element instead, with CSS modules for styling.
|
|
9
|
+
* @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
|
|
10
|
+
*/
|
|
10
11
|
const Box = styled.div.withConfig({
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
displayName: "Box",
|
|
13
|
+
componentId: "sc-62in7e-0"
|
|
13
14
|
})(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated The Box component is deprecated. Replace with a `div` or
|
|
17
|
+
* appropriate HTML element instead, with CSS modules for styling.
|
|
18
|
+
* @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
|
|
19
|
+
*/
|
|
20
|
+
var Box_default = Box;
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Box, Box_default as default };
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { jsx } from
|
|
1
|
+
import { sx } from "../sx.js";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Breadcrumbs } from "@primer/react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
componentId: "sc-1qj8pw-0"
|
|
6
|
+
//#region src/components/Breadcrumbs.tsx
|
|
7
|
+
const BreadcrumbsImpl = styled(Breadcrumbs).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
8
|
+
displayName: "Breadcrumbs__BreadcrumbsImpl",
|
|
9
|
+
componentId: "sc-1qj8pw-0"
|
|
11
10
|
})(["", ""], sx);
|
|
12
|
-
const StyledBreadcrumbsItem = styled(Breadcrumbs
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
displayName: "Breadcrumbs__StyledBreadcrumbsItem",
|
|
16
|
-
componentId: "sc-1qj8pw-1"
|
|
11
|
+
const StyledBreadcrumbsItem = styled(Breadcrumbs.Item).withConfig({ shouldForwardProp: (prop) => prop !== "sx" }).withConfig({
|
|
12
|
+
displayName: "Breadcrumbs__StyledBreadcrumbsItem",
|
|
13
|
+
componentId: "sc-1qj8pw-1"
|
|
17
14
|
})(["", ""], sx);
|
|
18
|
-
function BreadcrumbsItem({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
...props,
|
|
24
|
-
...(as ? {
|
|
25
|
-
forwardedAs: as
|
|
26
|
-
} : {})
|
|
27
|
-
});
|
|
15
|
+
function BreadcrumbsItem({ as, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(StyledBreadcrumbsItem, {
|
|
17
|
+
...props,
|
|
18
|
+
...as ? { forwardedAs: as } : {}
|
|
19
|
+
});
|
|
28
20
|
}
|
|
29
|
-
const Breadcrumbs = Object.assign(BreadcrumbsImpl, {
|
|
30
|
-
Item: BreadcrumbsItem
|
|
31
|
-
});
|
|
32
|
-
|
|
21
|
+
const Breadcrumbs$1 = Object.assign(BreadcrumbsImpl, { Item: BreadcrumbsItem });
|
|
33
22
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const Breadcrumb = Breadcrumbs;
|
|
23
|
+
* @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
|
|
24
|
+
*/
|
|
25
|
+
const Breadcrumb = Breadcrumbs$1;
|
|
37
26
|
|
|
38
|
-
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Breadcrumb, Breadcrumbs$1 as Breadcrumbs };
|