@primer/react-brand 0.4.0 → 0.5.0-rc.01a1264

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 (119) hide show
  1. package/CHANGELOG.md +284 -0
  2. package/lib/Button/Button.d.ts +2 -0
  3. package/lib/Stack/Stack.d.ts +112 -0
  4. package/lib/Stack/Stack.visual.spec.d.ts +1 -0
  5. package/lib/Stack/index.d.ts +1 -0
  6. package/lib/SubdomainNavBar/NavigationVisbilityObserver.d.ts +6 -0
  7. package/lib/SubdomainNavBar/SubdomainNavBar.d.ts +63 -0
  8. package/lib/SubdomainNavBar/SubdomainNavBar.visual.spec.d.ts +1 -0
  9. package/lib/SubdomainNavBar/index.d.ts +1 -0
  10. package/lib/SubdomainNavBar/useVisibilityObserver.d.ts +5 -0
  11. package/lib/Testimonial/Testimonial.d.ts +72 -0
  12. package/lib/Testimonial/Testimonial.visual.spec.d.ts +1 -0
  13. package/lib/Testimonial/index.d.ts +1 -0
  14. package/lib/css/main.css +1057 -22
  15. package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
  16. package/lib/design-tokens/css/tokens/base/colors/color-scales.css +1 -1
  17. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  18. package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
  19. package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
  20. package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
  21. package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
  22. package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
  23. package/lib/design-tokens/css/tokens/functional/components/control/base.css +1 -1
  24. package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
  25. package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
  26. package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
  27. package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
  28. package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
  29. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
  30. package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
  31. package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
  32. package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +27 -0
  33. package/lib/design-tokens/css/tokens/functional/size/border.css +4 -4
  34. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  35. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  36. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  37. package/lib/design-tokens/css/tokens/functional/size/size.css +7 -7
  38. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
  39. package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
  40. package/lib/design-tokens/js/module/tokens/base/colors/color-scales.js +1 -1
  41. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  42. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
  43. package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
  44. package/lib/design-tokens/js/module/tokens/functional/components/control/base.js +1 -1
  45. package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
  46. package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
  47. package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
  48. package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
  49. package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
  50. package/lib/design-tokens/js/module/tokens/functional/size/border.js +15 -15
  51. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  52. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  53. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  54. package/lib/design-tokens/js/module/tokens/functional/size/size.js +13 -13
  55. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  56. package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
  57. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
  58. package/lib/design-tokens/js/tokens/base/colors/color-scales.js +1 -1
  59. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  60. package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
  61. package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
  62. package/lib/design-tokens/js/tokens/functional/components/control/base.js +1 -1
  63. package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
  64. package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
  65. package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
  66. package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
  67. package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
  68. package/lib/design-tokens/js/tokens/functional/size/border.js +5 -5
  69. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  70. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  71. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  72. package/lib/design-tokens/js/tokens/functional/size/size.js +7 -7
  73. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  74. package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
  75. package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
  76. package/lib/design-tokens/ts/tokens/base/colors/color-scales.d.ts +1 -1
  77. package/lib/design-tokens/ts/tokens/base/colors/color-scales.js +1 -1
  78. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  79. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  80. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
  81. package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
  82. package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
  83. package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
  84. package/lib/design-tokens/ts/tokens/functional/components/control/base.d.ts +1 -1
  85. package/lib/design-tokens/ts/tokens/functional/components/control/base.js +1 -1
  86. package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
  87. package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
  88. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
  89. package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
  90. package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
  91. package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
  92. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
  93. package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
  94. package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
  95. package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
  96. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +5 -5
  97. package/lib/design-tokens/ts/tokens/functional/size/border.js +5 -5
  98. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  99. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  100. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  101. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  102. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  103. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  104. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
  105. package/lib/design-tokens/ts/tokens/functional/size/size.js +7 -7
  106. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  107. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  108. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
  109. package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
  110. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
  111. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
  112. package/lib/forms/Checkbox/Checkbox.d.ts +1 -1
  113. package/lib/forms/Select/Select.d.ts +1 -1
  114. package/lib/forms/TextInput/TextInput.d.ts +10 -2
  115. package/lib/hooks/useKeyboardEscape.d.ts +1 -0
  116. package/lib/hooks/useOnClickOutside.d.ts +1 -0
  117. package/lib/index.d.ts +3 -0
  118. package/lib/index.js +1 -1
  119. package/package.json +3 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,284 @@
1
+ # @primer/react-brand
2
+
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#81](https://github.com/primer/brand/pull/81) [`88e2007`](https://github.com/primer/brand/commit/88e20076f797338b9ab6d7d2d932320094cda5d7) Thanks [@rezrah](https://github.com/rezrah)! - Added `SubdomainNavBar` component.
8
+
9
+ Usage example:
10
+
11
+ ```jsx
12
+ <SubdomainNavBar title="Subdomain">
13
+ <SubdomainNavBar.Link href="#">Collections</SubdomainNavBar.Link>
14
+ <SubdomainNavBar.Link href="#">Topics</SubdomainNavBar.Link>
15
+ <SubdomainNavBar.Link href="#">Articles</SubdomainNavBar.Link>
16
+ <SubdomainNavBar.Link href="#">Events</SubdomainNavBar.Link>
17
+ <SubdomainNavBar.Link href="#">Video</SubdomainNavBar.Link>
18
+ <SubdomainNavBar.Link href="#">Social</SubdomainNavBar.Link>
19
+ <SubdomainNavBar.Search ref={inputRef} onSubmit={handleSubmit} />
20
+ <SubdomainNavBar.PrimaryAction href="#">Primary CTA</SubdomainNavBar.PrimaryAction>
21
+ <SubdomainNavBar.SecondaryAction href="#">Secondary CTA</SubdomainNavBar.SecondaryAction>
22
+ </SubdomainNavBar>
23
+ ```
24
+
25
+ See the [documentation](https://primer.style/brand/components/SubdomainNavBar) and [Storybook](https://primer.style/brand/storybook/?path=/story/components-subdomainnavbar--playground) for more usage examples.
26
+
27
+ * [#82](https://github.com/primer/brand/pull/82) [`afbab6c`](https://github.com/primer/brand/commit/afbab6c24b5a8fe08d6eea28dfebc4bde143bfd5) Thanks [@rezrah](https://github.com/rezrah)! - Added `Testimonial` component.
28
+
29
+ Usage example:
30
+
31
+ ```jsx
32
+ <Testimonial>
33
+ <Testimonial.Quote>
34
+ GitHub helps us ensure that we have our security controls baked into our pipelines all the way from the first line
35
+ of code we&apos;re writing.
36
+ </Testimonial.Quote>
37
+ <Testimonial.Name position="Staff Security Engineer">David Ross</Testimonial.Name>
38
+ <Testimonial.Avatar
39
+ src="https://avatars.githubusercontent.com/u/92997159?v=4"
40
+ alt="Circular avatar from David Ross's GitHub profile"
41
+ />
42
+ </Testimonial>
43
+ ```
44
+
45
+ See the [documentation](https://primer.style/brand/components/Testimonial) or [Storybook](https://primer.style/brand/storybook/?path=/story/components-testimonial--playground) for more usage examples.
46
+
47
+ - [#82](https://github.com/primer/brand/pull/82) [`afbab6c`](https://github.com/primer/brand/commit/afbab6c24b5a8fe08d6eea28dfebc4bde143bfd5) Thanks [@rezrah](https://github.com/rezrah)! - Added `Stack` component.
48
+
49
+ Usage example:
50
+
51
+ ```jsx
52
+ <Stack direction="horizontal" gap="spacious" padding="spacious">
53
+ <div>
54
+ <img
55
+ src="https://via.placeholder.com/300x150/f5f5f5/f5f5f5.png"
56
+ alt="placeholder with gray background and no foreground text"
57
+ />
58
+ </div>
59
+ <div>
60
+ <img
61
+ src="https://via.placeholder.com/300x150/f5f5f5/f5f5f5.png"
62
+ alt="placeholder with gray background and no foreground text"
63
+ />
64
+ </div>
65
+ <div>
66
+ <img
67
+ src="https://via.placeholder.com/300x150/f5f5f5/f5f5f5.png"
68
+ alt="placeholder with gray background and no foreground text"
69
+ />
70
+ </div>
71
+ </Stack>
72
+ ```
73
+
74
+ See [Storybook](https://primer.style/brand/storybook/?path=/story/components-stack--playground) for more usage examples.
75
+
76
+ ## 0.4.0
77
+
78
+ ### Minor Changes
79
+
80
+ - [#78](https://github.com/primer/brand/pull/78) [`487a9e7`](https://github.com/primer/brand/commit/487a9e7b03b6c196358e1f1146fd87e8c4fe44d4) Thanks [@JoshBowdenConcepts](https://github.com/JoshBowdenConcepts)! - Added a new `size` prop to `Button` and a `medium` sized variant, making the previous `large` size optional.
81
+
82
+ ⚠️ This update should be considered a breaking change, despite being issued in a `minor` release.
83
+
84
+ Selectable values: `medium` (default) and `large`.
85
+
86
+ **Upgrade steps:**
87
+
88
+ ```diff
89
+ - <Button>before</Button>
90
+ + <Button size="large">after</Button>
91
+ ```
92
+
93
+ * [#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.
94
+
95
+ **Read the Technical Previews for usage examples:**
96
+
97
+ [🔗 FormControl](https://primer.style/brand/components/FormControl)
98
+
99
+ [🔗 Checkbox](https://primer.style/brand/components/Checkbox)
100
+
101
+ [🔗 TextInput](https://primer.style/brand/components/TextInput)
102
+
103
+ [🔗 Select](https://primer.style/brand/components/Select)
104
+
105
+ ## 0.3.1
106
+
107
+ ### Patch Changes
108
+
109
+ - [#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
110
+
111
+ Previously, all image and video children were automatically styled to fit the parent elements dimensions.
112
+
113
+ This isn't ideal in all situations, so the ability to toggle-off this behaviour is now available through an `fillMedia` prop.
114
+
115
+ ## 0.3.0
116
+
117
+ ### Minor Changes
118
+
119
+ - [`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.
120
+
121
+ [See usage examples](https://primer.style/brand/components/FAQ)
122
+
123
+ * [#45](https://github.com/primer/brand/pull/45) [`2fb6924`](https://github.com/primer/brand/commit/2fb6924a834ddcbad34cfb97ecfc1659d54f4ed5) Thanks [@rezrah](https://github.com/rezrah)! - > **Warning**
124
+
125
+ > This is a breaking change, but as the library is a pre-v1 release we are publishing this update as a `minor` change.
126
+ > Please read the following instructions carefully before updating:
127
+
128
+ ### Updated references for "left" and "right" to "start" and "end"
129
+
130
+ For improved i18n support and closer alignment with our Figma naming conventions, we have updated the references for "left" and "right" to "start" and "end" respectively in `Hero` and `River` components.
131
+
132
+ ```diff
133
+ - <River align="left">
134
+ - <River align="right">
135
+ + <River align="start">
136
+ + <River align="end">
137
+ ```
138
+
139
+ ## 0.2.1
140
+
141
+ ### Patch Changes
142
+
143
+ - [#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
144
+
145
+ ## 0.2.0
146
+
147
+ ### Minor Changes
148
+
149
+ - [#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
150
+
151
+ - Renames `LinkButton` to `Button` :warning: (see below)
152
+ - Button supports polymorphism and can be used `as` either `a` or `button`
153
+
154
+ ### `River`
155
+
156
+ **NEW** Component :sparkles:
157
+
158
+ <table>
159
+ <tr>
160
+ <th> Before</th> <th> After</th>
161
+ </tr>
162
+ <tr>
163
+ <td valign="top">❌</td>
164
+ <td valign="top">
165
+
166
+ ```jsx
167
+ // import {River} from "@primer/react-brand";
168
+
169
+ <River>
170
+ <River.Visual>
171
+ <img
172
+ src="https://via.placeholder.com/600x400/f5f5f5/f5f5f5.png"
173
+ alt="placeholder, blank area with an off-white background color"
174
+ />
175
+ </River.Visual>
176
+ <River.Content>
177
+ <Heading>Heading</Heading>
178
+ <Text>
179
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. Aliquam luctus sed turpis
180
+ felis nam pulvinar risus elementum.
181
+ </Text>
182
+ <Link href="#">Call to action</Link>
183
+ </River.Content>
184
+ </River>
185
+ ```
186
+
187
+ </td>
188
+ </tr>
189
+ </table>
190
+
191
+ See more examples in our documentation.
192
+ https://primer.style/brand/components/River
193
+
194
+ ### `LinkButton`
195
+
196
+ > **Warning**
197
+ > The changes below should be considered a breaking change for anyone relying on `LinkButton`, but as we are shipping a pre-v1 library, this has been marked as a `minor` release rather than `major`. Please remember to update your usage per the below example.
198
+
199
+ <table>
200
+ <tr>
201
+ <th> Before</th> <th> After</th>
202
+ </tr>
203
+ <tr>
204
+ <td valign="top">
205
+
206
+ ```jsx
207
+ //import { LinkButton } from '@primer/react-brand';
208
+
209
+ <LinkButton href="#">Sign up</LinkButton>
210
+ ```
211
+
212
+ </td>
213
+ <td valign="top">
214
+
215
+ ```jsx
216
+ //import { Button } from '@primer/react-brand';
217
+
218
+ <Button as="a" href="#">
219
+ Sign up
220
+ </Button>
221
+ ```
222
+
223
+ </td>
224
+ </tr>
225
+ <tr>
226
+ <td valign="top">
227
+
228
+ ❌
229
+
230
+ </td>
231
+ <td valign="top">
232
+
233
+ ```jsx
234
+ //import { Button } from '@primer/react-brand';
235
+
236
+ <Button onClick={handler}>Sign Up</Button>
237
+ ```
238
+
239
+ </td>
240
+ </tr>
241
+
242
+ </table>
243
+
244
+ ## 0.1.0
245
+
246
+ ### Minor Changes
247
+
248
+ - [#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
249
+
250
+ ### Patch Changes
251
+
252
+ - [#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
253
+
254
+ * [#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
255
+
256
+ **To upgrade:**
257
+
258
+ - _Remove_ `import "@primer/react-brand/lib/css/gh-variables.css"`
259
+
260
+ - _Add_ `import "@primer/react-brand/lib/css/main.css"`
261
+
262
+ - [#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
263
+
264
+ * [#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
265
+
266
+ - [#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.
267
+
268
+ * [#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
269
+
270
+ - **updated** Hero description text size from `500` to `400`
271
+ - **updated** button alignment to not stretch on mobile viewports
272
+ - **removed** `size` prop. Now only one responsive size available.
273
+
274
+ ## 0.0.3
275
+
276
+ ### Patch Changes
277
+
278
+ - [#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
279
+
280
+ ## 0.0.2
281
+
282
+ ### Patch Changes
283
+
284
+ - [#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)
@@ -5,9 +5,11 @@ export declare type ButtonProps<C extends React.ElementType> = BaseProps<C> & {
5
5
  as?: C;
6
6
  variant?: 'primary' | 'secondary';
7
7
  size?: 'medium' | 'large';
8
+ hasArrow?: boolean;
8
9
  } & React.ComponentPropsWithoutRef<C>;
9
10
  export declare const Button: React.ForwardRefExoticComponent<Pick<BaseProps<React.ElementType<any>> & {
10
11
  as?: React.ElementType<any> | undefined;
11
12
  variant?: "primary" | "secondary" | undefined;
12
13
  size?: "medium" | "large" | undefined;
14
+ hasArrow?: boolean | undefined;
13
15
  } & Pick<any, string | number | symbol>, string | number | symbol> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,112 @@
1
+ import React from 'react';
2
+ import type { BaseProps } from '../component-helpers';
3
+ import '../../lib/design-tokens/css/tokens/functional/size/size.css';
4
+ export declare const StackDirectionVariants: readonly ["horizontal", "vertical"];
5
+ declare type StackDirectionVariants = typeof StackDirectionVariants[number];
6
+ export declare const defaultStackDirection: "vertical";
7
+ export declare const StackSpacingVariants: readonly ["condensed", "normal", "spacious"];
8
+ declare type StackSpacingVariants = typeof StackSpacingVariants[number];
9
+ export declare const defaultStackSpacing: "normal";
10
+ export declare const StackAlignItemVariants: readonly ["center", "flex-start", "flex-end"];
11
+ declare type StackAlignItemVariants = typeof StackAlignItemVariants[number];
12
+ export declare const StackJustifyContentVariants: readonly ["center", "flex-start", "flex-end", "space-between", "space-around", "space-evenly"];
13
+ declare type justifyContentVariants = typeof StackJustifyContentVariants[number];
14
+ declare type ResponsiveJustifyContentMap = {
15
+ narrow?: justifyContentVariants;
16
+ regular?: justifyContentVariants;
17
+ wide?: justifyContentVariants;
18
+ };
19
+ declare type ResponsiveAlignItemsMap = {
20
+ narrow?: StackAlignItemVariants;
21
+ regular?: StackAlignItemVariants;
22
+ wide?: StackAlignItemVariants;
23
+ };
24
+ declare type ResponsiveDirectionMap = {
25
+ narrow?: StackDirectionVariants;
26
+ regular?: StackDirectionVariants;
27
+ wide?: StackDirectionVariants;
28
+ };
29
+ declare type ResponsiveSpacingMap = {
30
+ narrow?: StackSpacingVariants;
31
+ regular?: StackSpacingVariants;
32
+ wide?: StackSpacingVariants;
33
+ };
34
+ export declare type StackProps = BaseProps<HTMLElement> & {
35
+ children: React.ReactElement[] | React.ReactElement;
36
+ /**
37
+ * Defines the flex-direction CSS property.
38
+ * A string value will be applied to all viewports.
39
+ * An object can be used to define different values for different viewports.
40
+ */
41
+ direction?: StackDirectionVariants | ResponsiveDirectionMap;
42
+ /**
43
+ * Defines the gap CSS property.
44
+ * A string value will be applied to all viewports.
45
+ * An object can be used to define different values for different viewports.
46
+ */
47
+ gap?: StackSpacingVariants | ResponsiveSpacingMap;
48
+ /**
49
+ * Applies vertical alignment to child elements relative to the Stack, using the align-items CSS property.
50
+ * A string value will be applied to all viewports.
51
+ * An object can be used to define different values for different viewports.
52
+ */
53
+ alignItems?: StackAlignItemVariants | ResponsiveAlignItemsMap;
54
+ /**
55
+ * Defines the padding CSS property on the parent Stack.
56
+ * A string value will be applied to all viewports.
57
+ * An object can be used to define different values for different viewports.
58
+ */
59
+ padding?: StackSpacingVariants | ResponsiveSpacingMap;
60
+ /**
61
+ * Applies horizontal alignment to child elements relative to the Stack, using the justify-content CSS property.
62
+ * A string value will be applied to all viewports.
63
+ * An object can be used to define different values for different viewports.
64
+ */
65
+ justifyContent?: justifyContentVariants | ResponsiveJustifyContentMap;
66
+ /**
67
+ * Forward inline styles
68
+ */
69
+ style?: React.CSSProperties;
70
+ } & BaseProps<HTMLDivElement>;
71
+ /**
72
+ * Stack enables layout of its immediate children along the vertical or horizontal axis
73
+ * @see https://primer.style/brand/components/Stack
74
+ */
75
+ export declare const Stack: React.ForwardRefExoticComponent<Pick<BaseProps<HTMLElement> & {
76
+ children: React.ReactElement[] | React.ReactElement;
77
+ /**
78
+ * Defines the flex-direction CSS property.
79
+ * A string value will be applied to all viewports.
80
+ * An object can be used to define different values for different viewports.
81
+ */
82
+ direction?: "horizontal" | "vertical" | ResponsiveDirectionMap | undefined;
83
+ /**
84
+ * Defines the gap CSS property.
85
+ * A string value will be applied to all viewports.
86
+ * An object can be used to define different values for different viewports.
87
+ */
88
+ gap?: "condensed" | "normal" | "spacious" | ResponsiveSpacingMap | undefined;
89
+ /**
90
+ * Applies vertical alignment to child elements relative to the Stack, using the align-items CSS property.
91
+ * A string value will be applied to all viewports.
92
+ * An object can be used to define different values for different viewports.
93
+ */
94
+ alignItems?: "center" | "flex-start" | "flex-end" | ResponsiveAlignItemsMap | undefined;
95
+ /**
96
+ * Defines the padding CSS property on the parent Stack.
97
+ * A string value will be applied to all viewports.
98
+ * An object can be used to define different values for different viewports.
99
+ */
100
+ padding?: "condensed" | "normal" | "spacious" | ResponsiveSpacingMap | undefined;
101
+ /**
102
+ * Applies horizontal alignment to child elements relative to the Stack, using the justify-content CSS property.
103
+ * A string value will be applied to all viewports.
104
+ * An object can be used to define different values for different viewports.
105
+ */
106
+ justifyContent?: "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | ResponsiveJustifyContentMap | undefined;
107
+ /**
108
+ * Forward inline styles
109
+ */
110
+ style?: React.CSSProperties | undefined;
111
+ } & BaseProps<HTMLDivElement>, "children" | "className" | "id" | "style" | "direction" | "gap" | "alignItems" | "padding" | "justifyContent"> & React.RefAttributes<unknown>>;
112
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Stack';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function NavigationVisbilityObserver({ children, className, ...rest }: {
3
+ [x: string]: any;
4
+ children: any;
5
+ className: any;
6
+ }): JSX.Element;
@@ -0,0 +1,63 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ /**
3
+ * Design tokens
4
+ */
5
+ import '../../lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css';
6
+ export declare type SubdomainNavBarProps = {
7
+ /**
8
+ * Valid child elements are `SubdomainNavBar.Link`, `SubdomainNavBar.PrimaryAction`,
9
+ * `SubdomainNavBar.SecondaryAction` and `SubdomainNavBar.Search`
10
+ */
11
+ children?: React.ReactNode | React.ReactElement<LinkProps> | React.ReactElement<SearchProps> | React.ReactElement<CTAActionProps>;
12
+ /**
13
+ * Forward a custom HTML class attribute
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Fixes the navigation bar to the top of the viewport. Defaults to `true`.
18
+ */
19
+ fixed?: boolean;
20
+ /**
21
+ * The title or name of the subdomain. Appears adjacent to the logo and is required for communicating content to assisitive technologies.
22
+ */
23
+ title: string;
24
+ /**
25
+ * Optionally change the URL of the logo
26
+ */
27
+ logoHref?: string;
28
+ };
29
+ declare function Root({ children, fixed, logoHref, title, ...rest }: SubdomainNavBarProps): JSX.Element;
30
+ declare type LinkProps = {
31
+ href: string;
32
+ } & React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
33
+ declare function Link({ href, className, children, ...rest }: PropsWithChildren<LinkProps>): JSX.Element;
34
+ export declare type SubdomainNavBarSearchResultProps = {
35
+ title: string;
36
+ description: string;
37
+ url: string;
38
+ date: string;
39
+ category?: string;
40
+ };
41
+ declare type SearchProps = {
42
+ onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
43
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
44
+ ref: React.RefObject<HTMLInputElement>;
45
+ active?: boolean;
46
+ title?: string;
47
+ handlerFn?: () => void;
48
+ autoComplete?: boolean;
49
+ searchResults?: SubdomainNavBarSearchResultProps[];
50
+ searchTerm?: string;
51
+ };
52
+ declare type CTAActionProps = {
53
+ href: string;
54
+ };
55
+ declare function PrimaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
56
+ declare function SecondaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
57
+ export declare const SubdomainNavBar: typeof Root & {
58
+ Link: typeof Link;
59
+ Search: React.ForwardRefExoticComponent<Pick<SearchProps, "title" | "onChange" | "onSubmit" | "autoComplete" | "active" | "searchResults" | "searchTerm" | "handlerFn"> & React.RefAttributes<unknown>>;
60
+ PrimaryAction: typeof PrimaryAction;
61
+ SecondaryAction: typeof SecondaryAction;
62
+ };
63
+ export {};
@@ -0,0 +1 @@
1
+ export * from './SubdomainNavBar';
@@ -0,0 +1,5 @@
1
+ import { RefObject } from 'react';
2
+ export declare type VisibilityMap = {
3
+ [key: string]: boolean;
4
+ };
5
+ export declare function useVisibilityObserver(navigationRef: RefObject<HTMLUListElement>): VisibilityMap[];