@primer/components 29.1.1-rc.0f976d3a → 30.0.0-rc.48fd5c94

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/.eslintrc.json +44 -14
  2. package/CHANGELOG.md +11 -1
  3. package/contributor-docs/CONTRIBUTING.md +2 -2
  4. package/contributor-docs/component-contents-api-patterns.md +5 -4
  5. package/dist/browser.esm.js +130 -130
  6. package/dist/browser.esm.js.map +1 -1
  7. package/dist/browser.umd.js +113 -113
  8. package/dist/browser.umd.js.map +1 -1
  9. package/docs/content/BorderBox.md +1 -1
  10. package/docs/content/Box.md +9 -9
  11. package/docs/content/Breadcrumbs.md +12 -12
  12. package/docs/content/Buttons.md +15 -13
  13. package/docs/content/CircleOcticon.md +1 -1
  14. package/docs/content/CounterLabel.md +5 -3
  15. package/docs/content/Flash.md +6 -4
  16. package/docs/content/Flex.md +6 -6
  17. package/docs/content/FormGroup.md +11 -9
  18. package/docs/content/Grid.md +6 -6
  19. package/docs/content/Label.md +3 -1
  20. package/docs/content/LabelGroup.md +1 -1
  21. package/docs/content/Pagination.md +4 -4
  22. package/docs/content/PointerBox.md +2 -2
  23. package/docs/content/Portal.mdx +13 -8
  24. package/docs/content/Position.md +26 -23
  25. package/docs/content/SelectMenu.md +5 -3
  26. package/docs/content/SideNav.md +5 -5
  27. package/docs/content/StateLabel.md +8 -6
  28. package/docs/content/StyledOcticon.md +4 -2
  29. package/docs/content/Text.md +5 -3
  30. package/docs/content/TextInput.md +5 -3
  31. package/docs/content/Timeline.md +13 -13
  32. package/docs/content/Tooltip.md +1 -1
  33. package/docs/content/Truncate.md +3 -4
  34. package/docs/content/anchoredPosition.mdx +1 -1
  35. package/docs/content/getting-started.md +6 -2
  36. package/docs/content/linting.md +1 -1
  37. package/docs/content/overriding-styles.mdx +15 -13
  38. package/docs/content/primer-theme.md +1 -1
  39. package/docs/content/theming.md +5 -5
  40. package/docs/content/useOnEscapePress.mdx +3 -3
  41. package/docs/content/useOnOutsideClick.mdx +1 -1
  42. package/lib/Breadcrumbs.d.ts +40 -0
  43. package/lib/{Breadcrumb.js → Breadcrumbs.js} +31 -21
  44. package/lib/__tests__/{Breadcrumb.d.ts → Breadcrumbs.d.ts} +0 -0
  45. package/lib/__tests__/{Breadcrumb.js → Breadcrumbs.js} +7 -9
  46. package/lib/__tests__/{BreadcrumbItem.d.ts → BreadcrumbsItem.d.ts} +0 -0
  47. package/lib/__tests__/{BreadcrumbItem.js → BreadcrumbsItem.js} +6 -6
  48. package/lib/index.d.ts +2 -2
  49. package/lib/index.js +8 -2
  50. package/lib-esm/Breadcrumbs.d.ts +40 -0
  51. package/lib-esm/{Breadcrumb.js → Breadcrumbs.js} +28 -19
  52. package/lib-esm/__tests__/{Breadcrumb.d.ts → Breadcrumbs.d.ts} +0 -0
  53. package/lib-esm/__tests__/Breadcrumbs.js +29 -0
  54. package/lib-esm/__tests__/{BreadcrumbItem.d.ts → BreadcrumbsItem.d.ts} +0 -0
  55. package/lib-esm/__tests__/{BreadcrumbItem.js → BreadcrumbsItem.js} +7 -7
  56. package/lib-esm/index.d.ts +2 -2
  57. package/lib-esm/index.js +1 -1
  58. package/migrating.md +4 -4
  59. package/package-lock.json +561 -280
  60. package/package.json +6 -5
  61. package/src/{Breadcrumb.tsx → Breadcrumbs.tsx} +27 -13
  62. package/src/__tests__/Breadcrumbs.tsx +28 -0
  63. package/src/__tests__/{BreadcrumbItem.tsx → BreadcrumbsItem.tsx} +7 -7
  64. package/src/__tests__/__snapshots__/{Breadcrumb.tsx.snap → Breadcrumbs.tsx.snap} +3 -3
  65. package/src/__tests__/__snapshots__/{BreadcrumbItem.tsx.snap → BreadcrumbsItem.tsx.snap} +3 -3
  66. package/src/index.ts +2 -2
  67. package/stats.html +1 -1
  68. package/lib/Breadcrumb.d.ts +0 -23
  69. package/lib-esm/Breadcrumb.d.ts +0 -23
  70. package/lib-esm/__tests__/Breadcrumb.js +0 -31
  71. package/src/__tests__/Breadcrumb.tsx +0 -31
package/.eslintrc.json CHANGED
@@ -53,19 +53,14 @@
53
53
  "camelcase": [
54
54
  "error",
55
55
  {
56
- "allow": [
57
- "dark_dimmed"
58
- ]
56
+ "allow": ["dark_dimmed"]
59
57
  }
60
58
  ]
61
59
  },
62
60
  "overrides": [
63
61
  // rules which apply only to JS
64
62
  {
65
- "files": [
66
- "**/*.js",
67
- "**/*.jsx"
68
- ],
63
+ "files": ["**/*.{js,jsx}"],
69
64
  "rules": {
70
65
  "eslint-comments/no-use": 0,
71
66
  "import/no-namespace": 0,
@@ -83,13 +78,8 @@
83
78
  "parserOptions": {
84
79
  "project": "tsconfig.json"
85
80
  },
86
- "files": [
87
- "**/*.ts",
88
- "**/*.tsx"
89
- ],
90
- "extends": [
91
- "plugin:@typescript-eslint/recommended"
92
- ],
81
+ "files": ["**/*.{ts,tsx}"],
82
+ "extends": ["plugin:@typescript-eslint/recommended"],
93
83
  "rules": {
94
84
  "@typescript-eslint/no-explicit-any": 2,
95
85
  "@typescript-eslint/no-unnecessary-condition": 2,
@@ -101,6 +91,46 @@
101
91
  }
102
92
  ]
103
93
  }
94
+ },
95
+ // rules which apply only to Markdown
96
+ {
97
+ "files": ["**/*.{md,mdx}"],
98
+ "extends": ["plugin:mdx/recommended"],
99
+ "settings": {
100
+ "mdx/code-blocks": true
101
+ },
102
+ "rules": {
103
+ "prettier/prettier": 0
104
+ }
105
+ },
106
+ // rules which apply only to Markdown code blocks
107
+ {
108
+ "files": ["**/*.{md,mdx}/**"],
109
+ "parserOptions": {
110
+ "project": false
111
+ },
112
+ "rules": {
113
+ "camelcase": 0,
114
+ "no-constant-condition": 0,
115
+ "no-console": 0,
116
+ "no-empty-pattern": 0,
117
+ "no-unused-vars": 0,
118
+ "no-undef": 0,
119
+ "react/no-unescaped-entities": 0,
120
+ "react/react-in-jsx-scope": 0,
121
+ "react/jsx-no-undef": 0,
122
+ "react/jsx-key": 0,
123
+ "react/jsx-no-comment-textnodes": 0,
124
+ "import/no-anonymous-default-export": 0,
125
+ "prettier/prettier": 0,
126
+ // These a11y rules should eventually be re-enabled
127
+ "jsx-a11y/anchor-is-valid": 0,
128
+ "jsx-a11y/accessible-emoji": 0,
129
+ "jsx-a11y/label-has-for": 0,
130
+ "@typescript-eslint/no-unnecessary-condition": 0,
131
+ "@typescript-eslint/no-unused-vars": 0,
132
+ "primer-react/no-deprecated-colors": ["error", {"skipImportCheck": true}]
133
+ }
104
134
  }
105
135
  ]
106
136
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @primer/components
2
2
 
3
+ ## 30.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#1448](https://github.com/primer/react/pull/1448) [`1a39fb02`](https://github.com/primer/react/commit/1a39fb0284c5e19324d378629d09a343be4cde05) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove `.Breadcrumb` classname from the root element of the `Breadcrumbs` component. This change shouldn't break anything unless you have styles, scripts, or tests that reference the `.Breadcrumb` classname.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1448](https://github.com/primer/react/pull/1448) [`1a39fb02`](https://github.com/primer/react/commit/1a39fb0284c5e19324d378629d09a343be4cde05) Thanks [@SferaDev](https://github.com/SferaDev)! - Rename `Breadcrumb` component to `Breadcrumbs`
12
+
3
13
  ## 29.1.1
4
14
 
5
15
  ### Patch Changes
@@ -558,7 +568,7 @@
558
568
  import {ThemeProvider} from 'styled-components'
559
569
  import {theme} from '@primer/react'
560
570
 
561
- funciton App(props) {
571
+ function App(props) {
562
572
  return (
563
573
  <div>
564
574
  <ThemeProvider theme={theme}>
@@ -79,7 +79,7 @@ Here's an example of a basic component written in the style of Primer Components
79
79
 
80
80
  ```jsx
81
81
  import {TYPOGRAPHY, COMMON} from './constants'
82
- import sx from './sx
82
+ import sx from './sx'
83
83
 
84
84
  const Component = styled.div`
85
85
  // additional styles here
@@ -258,7 +258,7 @@ Ensure you are using the latest minor of Node.js for the major version specified
258
258
  System props are style functions that provide one or more props, and can be passed directly the return value of [styled-components]'s `styled()` function:
259
259
 
260
260
  ```jsx
261
- import {styled} from 'styled-components'
261
+ import styled from 'styled-components'
262
262
  import {space} from 'styled-system'
263
263
  const SpaceDiv = styled.div`
264
264
  ${space}
@@ -166,12 +166,13 @@ Now let's dive into `WordWrap`, implemented with a React children-based API:
166
166
 
167
167
  ```jsx
168
168
  function WordWrap({ children, charactersPerLine }) {
169
+ const items = React.Children.toArray(children);
169
170
  let textContent = "";
170
- React.Children.forEach(children, (child) => {
171
+ for (const child of items) {
171
172
  if (typeof child === "string") {
172
173
  textContent += child;
173
174
  }
174
- });
175
+ }
175
176
  const lines = [];
176
177
  for (
177
178
  let low = 0;
@@ -247,8 +248,8 @@ function MyApp() {
247
248
  ```jsx
248
249
  function List({ items, ordered }) {
249
250
  const Elem = ordered ? "ol" : "ul";
250
- const items = items.map((i) => <li key={i}>i</li>);
251
- return <Elem>{items}</Elem>;
251
+ const listItems = items.map((i) => <li key={i}>i</li>);
252
+ return <Elem>{listItems}</Elem>;
252
253
  }
253
254
 
254
255
  // usage