@primer/react 0.0.0-20260529001925 → 0.0.0-20260529131357
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/CHANGELOG.md +8 -4
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +42 -40
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260529131357
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fake entry to force publishing
|
|
8
|
+
|
|
9
|
+
## 38.26.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
@@ -13,7 +19,7 @@
|
|
|
13
19
|
- Add `asSlot(component, slotSource)` helper: a typed utility that copies a `__SLOT__` marker from a source slot component onto a wrapper component, replacing the cast-heavy `(Wrapper as typeof Wrapper & {__SLOT__?: symbol}).__SLOT__ = Source.__SLOT__` pattern.
|
|
14
20
|
- Add a dev-mode warning in `useSlots` when a child's `displayName` matches a slot component's `displayName` but the child is missing the `__SLOT__` marker — a common footgun when wrapping slot components.
|
|
15
21
|
|
|
16
|
-
- [#7898](https://github.com/primer/react/pull/7898) [`
|
|
22
|
+
- [#7898](https://github.com/primer/react/pull/7898) [`da27739`](https://github.com/primer/react/commit/da2773915b5d299fd5971322f41dc9a2cfb8a13a) Thanks [@francinelucca](https://github.com/francinelucca)! - ThemeProvider: Add `contextOnly` prop to opt out of rendering the wrapping `<div>` with `data-*` theme attributes
|
|
17
23
|
|
|
18
24
|
- [#7886](https://github.com/primer/react/pull/7886) [`64dfbd3`](https://github.com/primer/react/commit/64dfbd307314d4c52c2072d0f72611a5da3e6739) Thanks [@janmaarten-a11y](https://github.com/janmaarten-a11y)! - Add `Timeline.Actions` sub-component for rendering action buttons, links, SHAs, status labels, and similar right-aligned content on a `Timeline.Item`. Renders as a horizontal flex row pushed to the right edge of the item with `gap: 8px` between children and `min-height` matching the badge so contents vertically center against it.
|
|
19
25
|
|
|
@@ -44,8 +50,6 @@
|
|
|
44
50
|
|
|
45
51
|
- [#7878](https://github.com/primer/react/pull/7878) [`8c468fd`](https://github.com/primer/react/commit/8c468fd28322456f48601f9cbf6226fc4c35b661) Thanks [@mattcosta7](https://github.com/mattcosta7)! - FilteredActionList: Guard against `undefined` items in the virtualizer's `getItemKey` callback to prevent a crash when `@tanstack/react-virtual` invokes it with an index whose item was just removed (e.g. when filtering shrinks the items list).
|
|
46
52
|
|
|
47
|
-
- Fake entry to force publishing
|
|
48
|
-
|
|
49
53
|
- [#7893](https://github.com/primer/react/pull/7893) [`0eef204`](https://github.com/primer/react/commit/0eef20484e5e26d0b6edb89dca68c538e7e898c6) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Button: Replace the icon-only-with-counter `:has(...):not(:has(...))` selector with a `data-icon-only-counter` attribute computed from props. Reduces style-recalculation cost on pages that render many Buttons. No visual or behavioral changes.
|
|
50
54
|
|
|
51
55
|
- [#7896](https://github.com/primer/react/pull/7896) [`673514b`](https://github.com/primer/react/commit/673514bf6743067d9db887a2c57e675a7e2a52f8) Thanks [@mattcosta7](https://github.com/mattcosta7)! - TextInput / TextInputWithTokens / Select / Autocomplete: Replace chained `:not([data-leading-visual])`, `:not([data-trailing-visual])`, and `:not([data-trailing-action])` attribute negations in `TextInputWrapper` styles with positive `data-no-leading-visual`, `data-no-trailing-visual`, and `data-no-trailing-action` markers emitted by the wrapper components. Eliminates the 2- and 3-deep `:not()` chains that previously evaluated against every input on every state change. No visual or behavioral changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAKrC,MAAM,MA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CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAwF/E,CAAA;AAED,wBAAgB,QAAQ;YArId,KAAK;kBACC,MAAM;gBACR,iBAAiB;wBACT,SAAS;0BACP,MAAM;gBAChB,MAAM;kBACJ,MAAM;kBACN,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;kBACvD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAC1C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;EA8H7D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,UAG1F;AAqED,eAAe,aAAa,CAAA"}
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -43,7 +43,7 @@ const getServerHandoff = id => {
|
|
|
43
43
|
const emptySubscribe = () => () => {};
|
|
44
44
|
const ThemeProvider = t0 => {
|
|
45
45
|
var _ref, _props$colorMode, _ref2, _props$dayScheme, _ref3, _props$nightScheme;
|
|
46
|
-
const $ = c(
|
|
46
|
+
const $ = c(46);
|
|
47
47
|
let children;
|
|
48
48
|
let props;
|
|
49
49
|
if ($[0] !== t0) {
|
|
@@ -154,25 +154,9 @@ const ThemeProvider = t0 => {
|
|
|
154
154
|
t6 = $[28];
|
|
155
155
|
}
|
|
156
156
|
const contextValue = t6;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
t7 = /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
161
|
-
value: contextValue,
|
|
162
|
-
children: children
|
|
163
|
-
});
|
|
164
|
-
$[29] = children;
|
|
165
|
-
$[30] = contextValue;
|
|
166
|
-
$[31] = t7;
|
|
167
|
-
} else {
|
|
168
|
-
t7 = $[31];
|
|
169
|
-
}
|
|
170
|
-
return t7;
|
|
171
|
-
}
|
|
172
|
-
const t7 = colorMode === "auto" ? "auto" : colorScheme.includes("dark") ? "dark" : "light";
|
|
173
|
-
let t8;
|
|
174
|
-
if ($[32] !== props.preventSSRMismatch || $[33] !== resolvedColorMode || $[34] !== uniqueDataId) {
|
|
175
|
-
t8 = props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
|
|
157
|
+
let t7;
|
|
158
|
+
if ($[29] !== props.preventSSRMismatch || $[30] !== resolvedColorMode || $[31] !== uniqueDataId) {
|
|
159
|
+
t7 = props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
|
|
176
160
|
type: "application/json",
|
|
177
161
|
id: `__PRIMER_DATA_${uniqueDataId}__`,
|
|
178
162
|
dangerouslySetInnerHTML: {
|
|
@@ -181,41 +165,59 @@ const ThemeProvider = t0 => {
|
|
|
181
165
|
})
|
|
182
166
|
}
|
|
183
167
|
}) : null;
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
168
|
+
$[29] = props.preventSSRMismatch;
|
|
169
|
+
$[30] = resolvedColorMode;
|
|
170
|
+
$[31] = uniqueDataId;
|
|
171
|
+
$[32] = t7;
|
|
188
172
|
} else {
|
|
189
|
-
|
|
173
|
+
t7 = $[32];
|
|
174
|
+
}
|
|
175
|
+
const ssrHandoffScript = t7;
|
|
176
|
+
if (props.contextOnly) {
|
|
177
|
+
let t8;
|
|
178
|
+
if ($[33] !== children || $[34] !== contextValue || $[35] !== ssrHandoffScript) {
|
|
179
|
+
t8 = /*#__PURE__*/jsxs(ThemeContext.Provider, {
|
|
180
|
+
value: contextValue,
|
|
181
|
+
children: [children, ssrHandoffScript]
|
|
182
|
+
});
|
|
183
|
+
$[33] = children;
|
|
184
|
+
$[34] = contextValue;
|
|
185
|
+
$[35] = ssrHandoffScript;
|
|
186
|
+
$[36] = t8;
|
|
187
|
+
} else {
|
|
188
|
+
t8 = $[36];
|
|
189
|
+
}
|
|
190
|
+
return t8;
|
|
190
191
|
}
|
|
192
|
+
const t8 = colorMode === "auto" ? "auto" : colorScheme.includes("dark") ? "dark" : "light";
|
|
191
193
|
let t9;
|
|
192
|
-
if ($[
|
|
194
|
+
if ($[37] !== children || $[38] !== dayScheme || $[39] !== nightScheme || $[40] !== ssrHandoffScript || $[41] !== t8) {
|
|
193
195
|
t9 = /*#__PURE__*/jsxs("div", {
|
|
194
|
-
"data-color-mode":
|
|
196
|
+
"data-color-mode": t8,
|
|
195
197
|
"data-light-theme": dayScheme,
|
|
196
198
|
"data-dark-theme": nightScheme,
|
|
197
|
-
children: [children,
|
|
199
|
+
children: [children, ssrHandoffScript]
|
|
198
200
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
201
|
+
$[37] = children;
|
|
202
|
+
$[38] = dayScheme;
|
|
203
|
+
$[39] = nightScheme;
|
|
204
|
+
$[40] = ssrHandoffScript;
|
|
205
|
+
$[41] = t8;
|
|
206
|
+
$[42] = t9;
|
|
205
207
|
} else {
|
|
206
|
-
t9 = $[
|
|
208
|
+
t9 = $[42];
|
|
207
209
|
}
|
|
208
210
|
let t10;
|
|
209
|
-
if ($[
|
|
211
|
+
if ($[43] !== contextValue || $[44] !== t9) {
|
|
210
212
|
t10 = /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
211
213
|
value: contextValue,
|
|
212
214
|
children: t9
|
|
213
215
|
});
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
216
|
+
$[43] = contextValue;
|
|
217
|
+
$[44] = t9;
|
|
218
|
+
$[45] = t10;
|
|
217
219
|
} else {
|
|
218
|
-
t10 = $[
|
|
220
|
+
t10 = $[45];
|
|
219
221
|
}
|
|
220
222
|
return t10;
|
|
221
223
|
};
|
package/package.json
CHANGED