@primer/react-brand 0.3.1-rc.9ad887b → 0.4.0-rc.824ee5c

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +32 -16
  2. package/README.md +25 -9
  3. package/lib/Accordion/Accordion.d.ts +9 -9
  4. package/lib/Button/Button.d.ts +6 -2
  5. package/lib/FAQ/FAQ.d.ts +14 -15
  6. package/lib/Heading/Heading.d.ts +4 -3
  7. package/lib/Hero/Hero.d.ts +3 -3
  8. package/lib/InlineLink/InlineLink.d.ts +4 -7
  9. package/lib/River/River.d.ts +47 -16
  10. package/lib/component-helpers.d.ts +21 -3
  11. package/lib/css/main.css +765 -326
  12. package/lib/css/stylesheets.d.ts +1 -0
  13. package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +2 -268
  14. package/lib/design-tokens/css/tokens/base/colors/color-scales.css +1 -1
  15. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  16. package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
  17. package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +18 -24
  18. package/lib/design-tokens/css/tokens/functional/colors/global.css +9 -1
  19. package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +2 -6
  20. package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +2 -9
  21. package/lib/design-tokens/css/tokens/functional/components/control/base.css +18 -0
  22. package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +39 -0
  23. package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
  24. package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +2 -5
  25. package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
  26. package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
  27. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +2 -6
  28. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
  29. package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
  30. package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
  31. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  32. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  33. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  34. package/lib/design-tokens/css/tokens/functional/size/size.css +3 -5
  35. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
  36. package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
  37. package/lib/design-tokens/js/module/tokens/base/colors/color-scales.js +265 -265
  38. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  39. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
  40. package/lib/design-tokens/js/module/tokens/functional/colors/global.js +189 -41
  41. package/lib/design-tokens/js/module/tokens/functional/components/control/base.js +195 -0
  42. package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
  43. package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +3 -3
  44. package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
  45. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +5 -5
  46. package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
  47. package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
  48. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  49. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  50. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  51. package/lib/design-tokens/js/module/tokens/functional/size/size.js +3 -35
  52. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  53. package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
  54. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
  55. package/lib/design-tokens/js/tokens/base/colors/color-scales.js +1 -1
  56. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  57. package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
  58. package/lib/design-tokens/js/tokens/functional/colors/global.js +9 -1
  59. package/lib/design-tokens/js/tokens/functional/components/control/base.js +16 -0
  60. package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
  61. package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
  62. package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
  63. package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
  64. package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
  65. package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
  66. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  67. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  68. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  69. package/lib/design-tokens/js/tokens/functional/size/size.js +3 -5
  70. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  71. package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
  72. package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
  73. package/lib/design-tokens/ts/tokens/base/colors/color-scales.d.ts +1 -1
  74. package/lib/design-tokens/ts/tokens/base/colors/color-scales.js +1 -1
  75. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  76. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  77. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
  78. package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
  79. package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +13 -1
  80. package/lib/design-tokens/ts/tokens/functional/colors/global.js +13 -1
  81. package/lib/design-tokens/ts/tokens/functional/components/control/base.d.ts +31 -0
  82. package/lib/design-tokens/ts/tokens/functional/components/control/base.js +30 -0
  83. package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
  84. package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
  85. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
  86. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
  87. package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
  88. package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
  89. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
  90. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
  91. package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
  92. package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
  93. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
  94. package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
  95. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  96. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  97. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  98. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  99. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  100. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  101. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -3
  102. package/lib/design-tokens/ts/tokens/functional/size/size.js +3 -5
  103. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  104. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  105. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
  106. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
  107. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
  108. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
  109. package/lib/forms/Checkbox/Checkbox.d.ts +57 -0
  110. package/lib/forms/Checkbox/forms.visual.spec.d.ts +1 -0
  111. package/lib/forms/Checkbox/index.d.ts +1 -0
  112. package/lib/forms/FormControl/FormControl.d.ts +57 -0
  113. package/lib/forms/FormControl/index.d.ts +1 -0
  114. package/lib/forms/Select/Select.d.ts +58 -0
  115. package/lib/forms/Select/index.d.ts +1 -0
  116. package/lib/forms/TextInput/TextInput.d.ts +87 -0
  117. package/lib/forms/TextInput/index.d.ts +1 -0
  118. package/lib/forms/form-types.d.ts +2 -0
  119. package/lib/forms/index.d.ts +10 -0
  120. package/lib/index.d.ts +1 -0
  121. package/lib/index.js +1 -1
  122. package/package.json +17 -8
package/CHANGELOG.md CHANGED
@@ -1,10 +1,26 @@
1
1
  # @primer/react-brand
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#69](https://github.com/primer/brand/pull/69) [`7838af5`](https://github.com/primer/brand/commit/7838af57ae2fdb94d07c188a142feebc0a4a605d) Thanks [@rezrah](https://github.com/rezrah)! - Added `FormControl`, `Checkbox`, `TextInput` and `Select` components.
8
+
9
+ **Read the Technical Previews for usage examples:**
10
+
11
+ [🔗 FormControl](https://primer.style/brand/components/FormControl)
12
+
13
+ [🔗 Checkbox](https://primer.style/brand/components/Checkbox)
14
+
15
+ [🔗 TextInput](https://primer.style/brand/components/TextInput)
16
+
17
+ [🔗 Select](https://primer.style/brand/components/Select)
18
+
3
19
  ## 0.3.1
4
20
 
5
21
  ### Patch Changes
6
22
 
7
- - [#59](https://github.com/primer/react-brand/pull/59) [`fdc731b`](https://github.com/primer/react-brand/commit/fdc731bda050aaef7041aafe6aaa7857c49ea03b) Thanks [@rezrah](https://github.com/rezrah)! - Added `fillMedia` prop to River.Visual
23
+ - [#59](https://github.com/primer/brand/pull/59) [`fdc731b`](https://github.com/primer/brand/commit/fdc731bda050aaef7041aafe6aaa7857c49ea03b) Thanks [@rezrah](https://github.com/rezrah)! - Added `fillMedia` prop to River.Visual
8
24
 
9
25
  Previously, all image and video children were automatically styled to fit the parent elements dimensions.
10
26
 
@@ -14,11 +30,11 @@
14
30
 
15
31
  ### Minor Changes
16
32
 
17
- - [`c8609a8`](https://github.com/primer/react-brand/commit/c8609a8d35ea80192d85e97794390207f4624e63) Thanks [@rezrah](https://github.com/rezrah)! - added an FAQ component, which displays a list of questions and answers relating to a particular subject.
33
+ - [`c8609a8`](https://github.com/primer/brand/commit/c8609a8d35ea80192d85e97794390207f4624e63) Thanks [@rezrah](https://github.com/rezrah)! - added an FAQ component, which displays a list of questions and answers relating to a particular subject.
18
34
 
19
- [See usage examples](https://primer.style/react-brand/components/FAQ)
35
+ [See usage examples](https://primer.style/brand/components/FAQ)
20
36
 
21
- * [#45](https://github.com/primer/react-brand/pull/45) [`2fb6924`](https://github.com/primer/react-brand/commit/2fb6924a834ddcbad34cfb97ecfc1659d54f4ed5) Thanks [@rezrah](https://github.com/rezrah)! - > **Warning**
37
+ * [#45](https://github.com/primer/brand/pull/45) [`2fb6924`](https://github.com/primer/brand/commit/2fb6924a834ddcbad34cfb97ecfc1659d54f4ed5) Thanks [@rezrah](https://github.com/rezrah)! - > **Warning**
22
38
 
23
39
  > This is a breaking change, but as the library is a pre-v1 release we are publishing this update as a `minor` change.
24
40
  > Please read the following instructions carefully before updating:
@@ -38,13 +54,13 @@
38
54
 
39
55
  ### Patch Changes
40
56
 
41
- - [#38](https://github.com/primer/react-brand/pull/38) [`b0c9293`](https://github.com/primer/react-brand/commit/b0c929389d62f184e5ae447c0b00e351cb2d1c6e) Thanks [@rezrah](https://github.com/rezrah)! - updated `css-loader` to generate valid (escaped) class names
57
+ - [#38](https://github.com/primer/brand/pull/38) [`b0c9293`](https://github.com/primer/brand/commit/b0c929389d62f184e5ae447c0b00e351cb2d1c6e) Thanks [@rezrah](https://github.com/rezrah)! - updated `css-loader` to generate valid (escaped) class names
42
58
 
43
59
  ## 0.2.0
44
60
 
45
61
  ### Minor Changes
46
62
 
47
- - [#33](https://github.com/primer/react-brand/pull/33) [`662fcfc`](https://github.com/primer/react-brand/commit/662fcfc6d123460730317b7ddd3d3a4622d30dce) Thanks [@rezrah](https://github.com/rezrah)! - - Adds `River` component
63
+ - [#33](https://github.com/primer/brand/pull/33) [`662fcfc`](https://github.com/primer/brand/commit/662fcfc6d123460730317b7ddd3d3a4622d30dce) Thanks [@rezrah](https://github.com/rezrah)! - - Adds `River` component
48
64
 
49
65
  - Renames `LinkButton` to `Button` :warning: (see below)
50
66
  - Button supports polymorphism and can be used `as` either `a` or `button`
@@ -87,7 +103,7 @@
87
103
  </table>
88
104
 
89
105
  See more examples in our documentation.
90
- https://primer.style/react-brand/components/River
106
+ https://primer.style/brand/components/River
91
107
 
92
108
  ### `LinkButton`
93
109
 
@@ -143,13 +159,13 @@
143
159
 
144
160
  ### Minor Changes
145
161
 
146
- - [#19](https://github.com/primer/react-brand/pull/19) [`3b22e9e`](https://github.com/primer/react-brand/commit/3b22e9e0823401104d6e33b3c4f8664b755ea6ba) Thanks [@colebemis](https://github.com/colebemis)! - Add `size` prop to `Hero` component
162
+ - [#19](https://github.com/primer/brand/pull/19) [`3b22e9e`](https://github.com/primer/brand/commit/3b22e9e0823401104d6e33b3c4f8664b755ea6ba) Thanks [@colebemis](https://github.com/colebemis)! - Add `size` prop to `Hero` component
147
163
 
148
164
  ### Patch Changes
149
165
 
150
- - [#23](https://github.com/primer/react-brand/pull/23) [`77abf53`](https://github.com/primer/react-brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - add Text and Heading components
166
+ - [#23](https://github.com/primer/brand/pull/23) [`77abf53`](https://github.com/primer/brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - add Text and Heading components
151
167
 
152
- * [#29](https://github.com/primer/react-brand/pull/29) [`144c7d7`](https://github.com/primer/react-brand/commit/144c7d762a91cb691699e4f8923ab08385c77966) Thanks [@rezrah](https://github.com/rezrah)! - Removed `gh-variables.css` from package as Brand variables are now surfaced in main.css
168
+ * [#29](https://github.com/primer/brand/pull/29) [`144c7d7`](https://github.com/primer/brand/commit/144c7d762a91cb691699e4f8923ab08385c77966) Thanks [@rezrah](https://github.com/rezrah)! - Removed `gh-variables.css` from package as Brand variables are now surfaced in main.css
153
169
 
154
170
  **To upgrade:**
155
171
 
@@ -157,13 +173,13 @@
157
173
 
158
174
  - _Add_ `import "@primer/react-brand/lib/css/main.css"`
159
175
 
160
- - [#23](https://github.com/primer/react-brand/pull/23) [`77abf53`](https://github.com/primer/react-brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - forward className in Hero
176
+ - [#23](https://github.com/primer/brand/pull/23) [`77abf53`](https://github.com/primer/brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - forward className in Hero
161
177
 
162
- * [#25](https://github.com/primer/react-brand/pull/25) [`4b00b72`](https://github.com/primer/react-brand/commit/4b00b72f5dbf5e578351ea77e1e74cddc69833e7) Thanks [@rezrah](https://github.com/rezrah)! - adds baseline tokens
178
+ * [#25](https://github.com/primer/brand/pull/25) [`4b00b72`](https://github.com/primer/brand/commit/4b00b72f5dbf5e578351ea77e1e74cddc69833e7) Thanks [@rezrah](https://github.com/rezrah)! - adds baseline tokens
163
179
 
164
- - [#21](https://github.com/primer/react-brand/pull/21) [`ab06cce`](https://github.com/primer/react-brand/commit/ab06cceb6ed3b2eaca70f9738b9708343b4e6db9) Thanks [@rezrah](https://github.com/rezrah)! - Remove fixed background color from `Hero` to allow underlying customisation to be surfaced.
180
+ - [#21](https://github.com/primer/brand/pull/21) [`ab06cce`](https://github.com/primer/brand/commit/ab06cceb6ed3b2eaca70f9738b9708343b4e6db9) Thanks [@rezrah](https://github.com/rezrah)! - Remove fixed background color from `Hero` to allow underlying customisation to be surfaced.
165
181
 
166
- * [#27](https://github.com/primer/react-brand/pull/27) [`ca2d300`](https://github.com/primer/react-brand/commit/ca2d3002ba6f7ca9c719f80077c4d95246f33410) Thanks [@rezrah](https://github.com/rezrah)! - Updated Hero text appearance
182
+ * [#27](https://github.com/primer/brand/pull/27) [`ca2d300`](https://github.com/primer/brand/commit/ca2d3002ba6f7ca9c719f80077c4d95246f33410) Thanks [@rezrah](https://github.com/rezrah)! - Updated Hero text appearance
167
183
 
168
184
  - **updated** Hero description text size from `500` to `400`
169
185
  - **updated** button alignment to not stretch on mobile viewports
@@ -173,10 +189,10 @@
173
189
 
174
190
  ### Patch Changes
175
191
 
176
- - [#18](https://github.com/primer/react-brand/pull/18) [`0835830`](https://github.com/primer/react-brand/commit/0835830fc15c582e280ac692ff3d578d6bcf282e) Thanks [@rezrah](https://github.com/rezrah)! - Fixes for production bundles
192
+ - [#18](https://github.com/primer/brand/pull/18) [`0835830`](https://github.com/primer/brand/commit/0835830fc15c582e280ac692ff3d578d6bcf282e) Thanks [@rezrah](https://github.com/rezrah)! - Fixes for production bundles
177
193
 
178
194
  ## 0.0.2
179
195
 
180
196
  ### Patch Changes
181
197
 
182
- - [#2](https://github.com/primer/react-brand/pull/2) [`ab01a8a`](https://github.com/primer/react-brand/commit/ab01a8ad1dc504f7a2865213b6f41c0b0adba131) Thanks [@colebemis](https://github.com/colebemis)! - Initialize releases with [changesets](https://github.com/changesets/changesets)
198
+ - [#2](https://github.com/primer/brand/pull/2) [`ab01a8a`](https://github.com/primer/brand/commit/ab01a8ad1dc504f7a2865213b6f41c0b0adba131) Thanks [@colebemis](https://github.com/colebemis)! - Initialize releases with [changesets](https://github.com/changesets/changesets)
package/README.md CHANGED
@@ -2,30 +2,38 @@
2
2
  <img width="300px" src="https://user-images.githubusercontent.com/4608155/127241386-f11da52d-00d9-4366-b01c-6f4c1ebcf7f2.png">
3
3
  </p>
4
4
 
5
- <h1 align="center">Primer React Brand</h1>
5
+ <h1 align="center">Primer Brand</h1>
6
6
 
7
- <p align="center">A React implementation of GitHub's Brand Design System</p>
7
+ <p align="center"><strong>Primer Brand is a GitHub’s design system for creating one-off marketing websites and digital experiences.</strong>
8
+ </p>
9
+
10
+ <p align="center">The design system comprises a Figma library and corresponding React components.
11
+ </p>
8
12
 
9
13
  <p align="center">
10
14
  <a aria-label="npm package" href="https://www.npmjs.com/package/@primer/react-brand">
11
15
  <img alt="" src="https://img.shields.io/npm/v/@primer/react-brand.svg">
12
16
  </a>
13
- <a aria-label="build status" href="https://github.com/primer/react-brand/actions/workflows/ci.yml">
14
- <img alt="" src="https://github.com/primer/react-brand/actions/workflows/ci.yml/badge.svg">
17
+ <a aria-label="build status" href="https://github.com/primer/brand/actions/workflows/ci.yml">
18
+ <img alt="" src="https://github.com/primer/brand/actions/workflows/ci.yml/badge.svg">
15
19
  </a>
16
20
  <img src="https://img.shields.io/badge/status-experimental-red" alt="status: experimental">
17
- <a aria-label="license" href="https://github.com/primer/react-brand/blob/main/LICENSE">
18
- <img src="https://img.shields.io/github/license/primer/react-brand.svg" alt="">
21
+ <a aria-label="license" href="https://github.com/primer/brand/blob/main/LICENSE">
22
+ <img src="https://img.shields.io/github/license/primer/brand" alt="">
19
23
  </a>
20
24
  </p>
21
25
 
22
26
  <p align="center">
23
- <a href="https://primer.github.io/react-brand/" target="_blank">https://primer.github.io/react-brand</a>
27
+ <a href="https://primer.github.io/brand/" target="_blank">https://primer.style/brand</a>
24
28
  </p>
25
29
 
30
+ ## Documentation
31
+
32
+ Our documentation site lives at [primer.style/brand](https://primer.style/brand). You'll be able to find detailed documentation on getting started, all of the components and more.
33
+
26
34
  ## Install
27
35
 
28
- This repository is distributed on [npm]. After [installing npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), you can install `@primer/react-brand` as a dependency of your project:
36
+ Primer Brand libraries are published to the [npm](https://www.npmjs.com/package/@primer/react-brand) registry. After [installing npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), you can install `@primer/react-brand` as a dependency of your project:
29
37
 
30
38
  ```sh
31
39
  npm install @primer/react-brand
@@ -33,7 +41,15 @@ npm install @primer/react-brand
33
41
 
34
42
  ## Usage
35
43
 
36
- See our [getting started guide](https://primer.github.io/react-brand/getting-started) for more information.
44
+ See our [getting started guide](https://primer.github.io/brand/getting-started) for more information.
45
+
46
+ ## Contributing
47
+
48
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for development and contribution guidelines.
49
+
50
+ ## Releasing (for GitHub staff)
51
+
52
+ You can find docs about our release process in [RELEASING.md](RELEASING.md).
37
53
 
38
54
  ## License
39
55
 
@@ -1,29 +1,29 @@
1
1
  import React from 'react';
2
+ import type { BaseProps } from '../component-helpers';
2
3
  /**
3
4
  * Design tokens
4
5
  */
5
6
  import '../../lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css';
6
- export declare type AccordionRootProps = {
7
+ export declare type AccordionRootProps = BaseProps<HTMLDetailsElement> & {
7
8
  open?: boolean;
8
- className?: string;
9
9
  children: React.ReactElement<AccordionHeadingProps | AccordionContentProps>[];
10
10
  } & React.HTMLAttributes<HTMLDetailsElement>;
11
- export declare function AccordionRoot({ children, className, open, ...rest }: AccordionRootProps): JSX.Element;
12
- declare type AccordionHeadingProps = {
11
+ export declare const AccordionRoot: React.ForwardRefExoticComponent<Pick<AccordionRootProps, "children" | "className" | "id" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "open"> & React.RefAttributes<HTMLDetailsElement>>;
12
+ declare type AccordionHeadingProps = BaseProps<HTMLHeadingElement> & {
13
13
  className?: string;
14
14
  children: string;
15
15
  };
16
- export declare function AccordionHeading({ children, className }: AccordionHeadingProps): JSX.Element;
17
- declare type AccordionContentProps = {
16
+ export declare const AccordionHeading: React.ForwardRefExoticComponent<Pick<AccordionHeadingProps, "children" | "className" | "id"> & React.RefAttributes<HTMLHeadingElement>>;
17
+ declare type AccordionContentProps = BaseProps<HTMLElement> & {
18
18
  className?: string;
19
19
  children: React.ReactElement | React.ReactElement[];
20
20
  };
21
- export declare function AccordionContent({ children, className }: AccordionContentProps): JSX.Element;
21
+ export declare function AccordionContent({ children, className, ...rest }: AccordionContentProps): JSX.Element;
22
22
  /**
23
23
  * Branded Accordion component
24
24
  */
25
- export declare const Accordion: typeof AccordionRoot & {
25
+ export declare const Accordion: React.ForwardRefExoticComponent<Pick<AccordionRootProps, "children" | "className" | "id" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "open"> & React.RefAttributes<HTMLDetailsElement>> & {
26
26
  Content: typeof AccordionContent;
27
- Heading: typeof AccordionHeading;
27
+ Heading: React.ForwardRefExoticComponent<Pick<AccordionHeadingProps, "children" | "className" | "id"> & React.RefAttributes<HTMLHeadingElement>>;
28
28
  };
29
29
  export {};
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import '../../lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css';
3
- export declare type ButtonProps<C extends React.ElementType> = {
3
+ import type { BaseProps } from '../component-helpers';
4
+ export declare type ButtonProps<C extends React.ElementType> = BaseProps<C> & {
4
5
  as?: C;
5
6
  variant?: 'primary' | 'secondary';
6
7
  } & React.ComponentPropsWithoutRef<C>;
7
- export declare function Button<C extends React.ElementType>({ as, variant, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: ButtonProps<C>): JSX.Element;
8
+ export declare const Button: React.ForwardRefExoticComponent<Pick<BaseProps<React.ElementType<any>> & {
9
+ as?: React.ElementType<any> | undefined;
10
+ variant?: "primary" | "secondary" | undefined;
11
+ } & Pick<any, string | number | symbol>, string | number | symbol> & React.RefAttributes<HTMLButtonElement>>;
package/lib/FAQ/FAQ.d.ts CHANGED
@@ -1,37 +1,36 @@
1
1
  import React from 'react';
2
- import { AccordionHeading, AccordionContent, AccordionRoot, AccordionRootProps } from '..';
2
+ import { AccordionContent, AccordionRootProps } from '..';
3
+ import type { BaseProps } from '../component-helpers';
3
4
  /**
4
5
  * Design tokens
5
6
  */
6
7
  import '../../lib/design-tokens/css/tokens/functional/components/faq/base.css';
7
8
  import '../../lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css';
8
- declare type FAQRootProps = {
9
- className?: string;
9
+ declare type FAQRootProps = BaseProps<HTMLElement> & {
10
10
  children: React.ReactElement<FAQHeadingProps | FAQSubheadingProps | AccordionRootProps>[];
11
11
  };
12
- declare function FAQRoot({ children, className }: FAQRootProps): JSX.Element;
13
- declare type FAQHeadingProps = {
14
- className?: string;
12
+ declare type FAQHeadingProps = BaseProps<HTMLHeadingElement> & {
15
13
  size?: 'medium' | 'large';
16
14
  align?: 'start' | 'center';
17
15
  children: string;
18
16
  };
19
- declare function FAQHeading({ children, className, size, align }: FAQHeadingProps): JSX.Element;
20
- declare type FAQSubheadingProps = {
17
+ declare type FAQSubheadingProps = BaseProps<HTMLHeadingElement> & {
21
18
  align?: 'start' | 'center';
22
- className?: string;
23
19
  children: string;
24
20
  };
25
- declare function FAQSubheading({ children, className }: FAQSubheadingProps): JSX.Element;
21
+ declare function FAQSubheading({ children, className, ...rest }: FAQSubheadingProps): JSX.Element;
26
22
  /**
27
23
  * FAQ component:
28
- * {@link https://primer.style/react-brand/components/FAQ/ See usage examples}.
24
+ * {@link https://primer.style/brand/components/FAQ/ See usage examples}.
29
25
  */
30
- export declare const FAQ: typeof FAQRoot & {
26
+ export declare const FAQ: React.ForwardRefExoticComponent<Pick<FAQRootProps, "children" | "className" | "id"> & React.RefAttributes<HTMLElement>> & {
31
27
  Subheading: typeof FAQSubheading;
32
- Heading: typeof FAQHeading;
33
- Item: typeof AccordionRoot;
34
- Question: typeof AccordionHeading;
28
+ Heading: React.ForwardRefExoticComponent<Pick<FAQHeadingProps, "children" | "className" | "align" | "id" | "size"> & React.RefAttributes<HTMLHeadingElement>>;
29
+ Item: React.ForwardRefExoticComponent<Pick<AccordionRootProps, "children" | "className" | "id" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "open"> & React.RefAttributes<HTMLDetailsElement>>;
30
+ Question: React.ForwardRefExoticComponent<Pick<BaseProps<HTMLHeadingElement> & {
31
+ className?: string | undefined;
32
+ children: string;
33
+ }, "children" | "className" | "id"> & React.RefAttributes<HTMLHeadingElement>>;
35
34
  Answer: typeof AccordionContent;
36
35
  };
37
36
  export {};
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React from 'react';
2
+ import type { BaseProps } from '../component-helpers';
2
3
  export declare const HeadingSizes: readonly ["1", "2", "3", "4", "5", "6"];
3
4
  export declare const HeadingTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4
5
  export declare const defaultHeadingTag: "h2";
@@ -10,11 +11,11 @@ export declare const classMap: {
10
11
  h5: "5";
11
12
  h6: "6";
12
13
  };
13
- declare type HeadingTags = {
14
+ declare type HeadingTags = BaseProps<HTMLHeadingElement> & {
14
15
  as?: typeof HeadingTags[number];
15
16
  } & React.HTMLAttributes<HTMLHeadingElement>;
16
17
  export declare type HeadingProps = {
17
18
  className?: string;
18
19
  } & HeadingTags;
19
- export declare function Heading({ className, children, as, ...rest }: PropsWithChildren<HeadingProps>): JSX.Element;
20
+ export declare const Heading: React.ForwardRefExoticComponent<Pick<HeadingProps, "children" | "className" | "id" | "slot" | "style" | "title" | "as" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLHeadingElement>>;
20
21
  export {};
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
+ import type { BaseProps } from '../component-helpers';
2
3
  import '../../lib/design-tokens/css/tokens/functional/components/hero/base.css';
3
4
  declare type Action = {
4
5
  text: string;
5
6
  href: string;
6
7
  };
7
- export declare type HeroProps = {
8
- className?: string;
8
+ export declare type HeroProps = BaseProps<HTMLDivElement> & {
9
9
  heading: string | React.ReactElement;
10
10
  description?: string | React.ReactElement;
11
11
  primaryAction: Action;
12
12
  secondaryAction?: Action;
13
13
  align?: 'start' | 'center';
14
14
  };
15
- export declare function Hero({ className, heading, description, primaryAction, secondaryAction, align }: HeroProps): JSX.Element;
15
+ export declare const Hero: React.ForwardRefExoticComponent<Pick<HeroProps, "className" | "heading" | "description" | "primaryAction" | "secondaryAction" | "align" | "id"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export {};
@@ -1,14 +1,11 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React from 'react';
2
2
  import { TextSizes } from '../';
3
+ import type { BaseProps } from '../component-helpers';
3
4
  /**
4
5
  * Design tokens
5
6
  */
6
7
  import '../../lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css';
7
- export declare type InlineLinkProps = {
8
- /**
9
- * Forward a custom HTML class attribute
10
- */
11
- className?: string;
8
+ export declare type InlineLinkProps = BaseProps<HTMLAnchorElement> & {
12
9
  /**
13
10
  * Specify the links destination
14
11
  */
@@ -21,4 +18,4 @@ export declare type InlineLinkProps = {
21
18
  /**
22
19
  * A HTML anchor link component that renders inline with adjacent text.
23
20
  */
24
- export declare function InlineLink({ className, size, children, href, ...rest }: PropsWithChildren<InlineLinkProps>): JSX.Element;
21
+ export declare const InlineLink: React.ForwardRefExoticComponent<Pick<InlineLinkProps, "children" | "className" | "id" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "href" | "type" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy"> & React.RefAttributes<HTMLAnchorElement>>;
@@ -1,7 +1,8 @@
1
- import React from 'react';
1
+ import React, { PropsWithChildren } from 'react';
2
2
  import { HeadingTags, LinkProps, HeadingProps, TextProps } from '../';
3
+ import type { BaseProps } from '../component-helpers';
3
4
  import '../../lib/design-tokens/css/tokens/functional/components/river/base.css';
4
- export declare type RiverProps = {
5
+ export declare type RiverProps = BaseProps<HTMLElement> & {
5
6
  /**
6
7
  * Only specific children are valid.
7
8
  * These include: `River.Visual` and `River.Content`.
@@ -9,10 +10,6 @@ export declare type RiverProps = {
9
10
  * to enforce correct HTML semantics.
10
11
  */
11
12
  children: React.ReactElement<RiverVisualProps | RiverContentProps>[];
12
- /**
13
- * Apply a custom classname that will be forwarded to the root River element.
14
- */
15
- className?: string;
16
13
  /**
17
14
  * Apply an alternative image to text column ratio. The default is `50:50`.
18
15
  */
@@ -24,8 +21,7 @@ export declare type RiverProps = {
24
21
  };
25
22
  export declare const defaultRiverImageTextRatio = "50:50";
26
23
  export declare const defaultRiverAlign = "start";
27
- declare function Root({ imageTextRatio, align, className, children, ...rest }: RiverProps): JSX.Element;
28
- declare type RiverContentProps = {
24
+ declare type RiverContentProps = BaseProps<HTMLDivElement> & {
29
25
  /**
30
26
  * Escape-hatch for inserting custom React components.
31
27
  * Warning:
@@ -49,26 +45,61 @@ declare type RiverContentProps = {
49
45
  children: React.ReactElement<TextProps> | React.ReactElement<HeadingProps | TextProps | LinkProps>[];
50
46
  };
51
47
  export declare const getHeadingWarning: (size: (typeof HeadingTags)[number]) => string;
52
- declare function Content({ children, leadingComponent: LeadingComponent, trailingComponent: TrailingComponent }: RiverContentProps): JSX.Element;
53
- declare type RiverVisualProps = {
48
+ declare type RiverVisualProps = BaseProps<HTMLDivElement> & PropsWithChildren<{
54
49
  /**
55
50
  * Applies automatic size constraints to child images and video.
56
51
  * This can be disabled by setting this prop to `false`.
57
52
  */
58
53
  fillMedia?: boolean;
59
- className?: string;
60
54
  /**
61
55
  * `img` and `video` elements will apply a shadow by default.
62
56
  * This can be disabled by setting this prop to `false`.
63
57
  */
64
58
  hasShadow?: boolean;
65
- };
66
- declare function Visual({ fillMedia, children, className, hasShadow }: React.PropsWithChildren<RiverVisualProps>): JSX.Element;
59
+ }>;
67
60
  /**
68
61
  * Alternating text and image pairs.
69
62
  */
70
- export declare const River: typeof Root & {
71
- Visual: typeof Visual;
72
- Content: typeof Content;
63
+ export declare const River: React.ForwardRefExoticComponent<Pick<BaseProps<HTMLElement> & {
64
+ /**
65
+ * Only specific children are valid.
66
+ * These include: `River.Visual` and `River.Content`.
67
+ * The declarative order of the children will be ignored in the rendered output
68
+ * to enforce correct HTML semantics.
69
+ */
70
+ children: React.ReactElement<RiverVisualProps | RiverContentProps>[];
71
+ /**
72
+ * Apply an alternative image to text column ratio. The default is `50:50`.
73
+ */
74
+ imageTextRatio?: "60:40" | "50:50" | undefined;
75
+ /**
76
+ * Adjust the order of the `Content` column. The default is `start`.
77
+ */
78
+ align?: "start" | "center" | "end" | undefined;
79
+ }, "children" | "className" | "align" | "id" | "imageTextRatio"> & React.RefAttributes<HTMLElement>> & {
80
+ Visual: React.ForwardRefExoticComponent<Pick<RiverVisualProps, "children" | "className" | "id" | "fillMedia" | "hasShadow"> & React.RefAttributes<HTMLDivElement>>;
81
+ Content: React.ForwardRefExoticComponent<Pick<BaseProps<HTMLDivElement> & {
82
+ /**
83
+ * Escape-hatch for inserting custom React components.
84
+ * Warning:
85
+ * This prop isn't advertised in our docs but remains part of the public API for edge-cases.
86
+ * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.
87
+ */
88
+ trailingComponent?: React.FunctionComponent<{}> | undefined;
89
+ /**
90
+ * Escape-hatch for inserting custom React components.
91
+ * Warning:
92
+ * This prop isn't advertised in our docs but remains part of the public API for edge-cases.
93
+ * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.
94
+ */
95
+ leadingComponent?: React.FunctionComponent<{}> | undefined;
96
+ /**
97
+ * Only valid children are allowed.
98
+ * These include: `Heading`, `Text` and `Link`.
99
+ * The declarative order of the children will be ignored in the rendered output
100
+ * to enforce correct HTML semantics.
101
+ */
102
+ children: React.ReactElement<TextProps> | React.ReactElement<HeadingProps | TextProps | LinkProps>[];
103
+ }, "children" | "className" | "id" | "leadingComponent" | "trailingComponent"> & React.RefAttributes<HTMLDivElement>>;
73
104
  };
74
105
  export {};
@@ -1,7 +1,25 @@
1
- /// <reference types="react" />
1
+ import React, { Ref } from 'react';
2
2
  /**
3
3
  * Layout
4
4
  */
5
- export declare const Container: ({ children }: {
6
- children: any;
5
+ export declare const Container: ({ children, style }: {
6
+ children: React.ReactElement[] | React.ReactElement;
7
+ style?: React.CSSProperties | undefined;
7
8
  }) => JSX.Element;
9
+ /**
10
+ * Base Types
11
+ */
12
+ /**
13
+ * Component helper type to be extended by component types, e.g.:
14
+ * type CustomComponentProps = BaseProps<HTMLDivElement> & { ... }
15
+ *
16
+ * Example use:
17
+ * const CustomComponent = forwardRef<HTMLDivElement, CustomComponentProps>(({className, ...props}, ref) => { ... })
18
+ * // OR:
19
+ * const CustomComponent = forwardRef(({className: CustomComponentProps, ...props}, ref: Ref<HTMLDivElement>) => { ... })
20
+ */
21
+ export declare type BaseProps<T> = {
22
+ className?: string;
23
+ id?: string;
24
+ ref?: Ref<T>;
25
+ };