@primer/components 31.2.0-rc.c285489d → 31.2.0-rc.fbb10090
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 +4 -0
- package/dist/browser.esm.js +1 -1
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +1 -1
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/FilterList.md +2 -2
- package/docs/content/theming.md +23 -0
- package/lib/ActionList/Header.js +1 -1
- package/lib-esm/ActionList/Header.js +1 -1
- package/package.json +1 -1
- package/src/ActionList/Header.tsx +1 -1
- package/stats.html +1 -1
@@ -8,10 +8,10 @@ The FilterList component is a menu with filter options that filter the main cont
|
|
8
8
|
|
9
9
|
```jsx live
|
10
10
|
<FilterList>
|
11
|
-
<FilterList.Item selected count=
|
11
|
+
<FilterList.Item selected count={32} href="#foo">
|
12
12
|
First Filter
|
13
13
|
</FilterList.Item>
|
14
|
-
<FilterList.Item count=
|
14
|
+
<FilterList.Item count={2} href="#bar">
|
15
15
|
Second Filter
|
16
16
|
</FilterList.Item>
|
17
17
|
<FilterList.Item href="#baz">Third Filter</FilterList.Item>
|
package/docs/content/theming.md
CHANGED
@@ -3,6 +3,8 @@ title: Theming
|
|
3
3
|
description: Theming in Primer React is made possible by a theme object that defines your application's colors, spacing, fonts, and more.
|
4
4
|
---
|
5
5
|
|
6
|
+
import Code from '@primer/gatsby-theme-doctocat/src/components/code'
|
7
|
+
|
6
8
|
## ThemeProvider
|
7
9
|
|
8
10
|
To give components access to the theme object, you must add `ThemeProvider` to the root of your application:
|
@@ -50,6 +52,27 @@ Some components may break if your custom theme does not include all the same key
|
|
50
52
|
|
51
53
|
You can reference theme values in your application using [system props](/system-props), the [`sx` prop](/overriding-styles), the `themeGet` function, or the `useTheme` hook.
|
52
54
|
|
55
|
+
<Note variant="warning">
|
56
|
+
|
57
|
+
Only use `theme` objects accessed via Primer's theme context to ensure your application’s styling draws from the same theme as Primer components’ internal styling. The `sx` prop, styled system props, `themeGet`, and `useTheme` all use the theme from context.
|
58
|
+
|
59
|
+
<DoDontContainer>
|
60
|
+
<Do>
|
61
|
+
<Code className="language-jsx">
|
62
|
+
{`<Box textShadow="shadow.medium">`}
|
63
|
+
</Code>
|
64
|
+
<Caption>Use the theme from the same context as Primer.</Caption>
|
65
|
+
</Do>
|
66
|
+
<Dont>
|
67
|
+
<Code className="language-jsx">
|
68
|
+
{`import {theme} from '@primer/components'\n\n<Box textShadow={theme.shadows.shadow.medium}>`}
|
69
|
+
</Code>
|
70
|
+
<Caption>Don't style components with any other instance of theme</Caption>
|
71
|
+
</Dont>
|
72
|
+
</DoDontContainer>
|
73
|
+
|
74
|
+
</Note>
|
75
|
+
|
53
76
|
### System props and the `sx` prop
|
54
77
|
|
55
78
|
Some [system props](/system-props) and [`sx` prop](/overriding-styles) keys are theme-aware. For example, the `bg` prop maps to the `colors` theme key which means you can use the `bg` prop to reference values in the `colors` object:
|
package/lib/ActionList/Header.js
CHANGED
@@ -45,7 +45,7 @@ function Header({
|
|
45
45
|
return /*#__PURE__*/_react.default.createElement(StyledHeader, _extends({
|
46
46
|
role: "heading",
|
47
47
|
variant: variant
|
48
|
-
}, props), title, auxiliaryText && /*#__PURE__*/_react.default.createElement("span", null,
|
48
|
+
}, props), title, auxiliaryText && /*#__PURE__*/_react.default.createElement("span", null, auxiliaryText));
|
49
49
|
}
|
50
50
|
|
51
51
|
Header.displayName = "Header";
|
@@ -28,6 +28,6 @@ export function Header({
|
|
28
28
|
return /*#__PURE__*/React.createElement(StyledHeader, _extends({
|
29
29
|
role: "heading",
|
30
30
|
variant: variant
|
31
|
-
}, props), title, auxiliaryText && /*#__PURE__*/React.createElement("span", null,
|
31
|
+
}, props), title, auxiliaryText && /*#__PURE__*/React.createElement("span", null, auxiliaryText));
|
32
32
|
}
|
33
33
|
Header.displayName = "Header";
|
package/package.json
CHANGED