@primer/components 31.0.2-rc.95622264 → 31.2.0-rc.50908ce9

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 (93) hide show
  1. package/.storybook/main.js +7 -9
  2. package/.storybook/preview.js +5 -1
  3. package/CHANGELOG.md +15 -1
  4. package/dist/browser.esm.js +1 -1
  5. package/dist/browser.esm.js.map +1 -1
  6. package/dist/browser.umd.js +1 -1
  7. package/dist/browser.umd.js.map +1 -1
  8. package/docs/content/FilterList.md +2 -2
  9. package/docs/content/theming.md +23 -0
  10. package/lib/ActionList/Header.js +1 -1
  11. package/lib/Autocomplete/Autocomplete.d.ts +4 -4
  12. package/lib/Autocomplete/AutocompleteInput.d.ts +4 -4
  13. package/lib/Button/Button.d.ts +5 -5
  14. package/lib/Button/ButtonBase.d.ts +1 -1
  15. package/lib/Button/ButtonClose.d.ts +3 -3
  16. package/lib/Button/ButtonDanger.d.ts +5 -5
  17. package/lib/Button/ButtonInvisible.d.ts +5 -5
  18. package/lib/Button/ButtonOutline.d.ts +5 -5
  19. package/lib/Button/ButtonPrimary.d.ts +5 -5
  20. package/lib/CircleBadge.d.ts +2 -2
  21. package/lib/CircleOcticon.d.ts +4 -4
  22. package/lib/Dialog.d.ts +4 -4
  23. package/lib/Dropdown.d.ts +16 -16
  24. package/lib/DropdownMenu/DropdownButton.d.ts +6 -6
  25. package/lib/FilterList.d.ts +3 -3
  26. package/lib/Flash.d.ts +1 -1
  27. package/lib/Label.d.ts +1 -1
  28. package/lib/Position.d.ts +4 -4
  29. package/lib/ProgressBar.d.ts +1 -1
  30. package/lib/SelectMenu/SelectMenu.d.ts +24 -24
  31. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  32. package/lib/TextInputWithTokens.d.ts +4 -4
  33. package/lib/Timeline.d.ts +4 -4
  34. package/lib/Token/AvatarToken.d.ts +1 -1
  35. package/lib/Token/IssueLabelToken.d.ts +1 -1
  36. package/lib/Token/Token.d.ts +1 -1
  37. package/lib/_TextInputWrapper.d.ts +1 -1
  38. package/lib/__tests__/KeyPaths.types.test.d.ts +11 -0
  39. package/lib/__tests__/KeyPaths.types.test.js +10 -0
  40. package/lib/stories/Token.stories.js +19 -2
  41. package/lib/sx.d.ts +8 -2
  42. package/lib/theme.d.ts +78 -0
  43. package/lib/theme.js +3 -1
  44. package/lib/utils/types/KeyPaths.d.ts +3 -0
  45. package/lib/utils/types/KeyPaths.js +1 -0
  46. package/lib-esm/ActionList/Header.js +1 -1
  47. package/lib-esm/Autocomplete/Autocomplete.d.ts +4 -4
  48. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +4 -4
  49. package/lib-esm/Button/Button.d.ts +5 -5
  50. package/lib-esm/Button/ButtonBase.d.ts +1 -1
  51. package/lib-esm/Button/ButtonClose.d.ts +3 -3
  52. package/lib-esm/Button/ButtonDanger.d.ts +5 -5
  53. package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
  54. package/lib-esm/Button/ButtonOutline.d.ts +5 -5
  55. package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
  56. package/lib-esm/CircleBadge.d.ts +2 -2
  57. package/lib-esm/CircleOcticon.d.ts +4 -4
  58. package/lib-esm/Dialog.d.ts +4 -4
  59. package/lib-esm/Dropdown.d.ts +16 -16
  60. package/lib-esm/DropdownMenu/DropdownButton.d.ts +6 -6
  61. package/lib-esm/FilterList.d.ts +3 -3
  62. package/lib-esm/Flash.d.ts +1 -1
  63. package/lib-esm/Label.d.ts +1 -1
  64. package/lib-esm/Position.d.ts +4 -4
  65. package/lib-esm/ProgressBar.d.ts +1 -1
  66. package/lib-esm/SelectMenu/SelectMenu.d.ts +24 -24
  67. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  68. package/lib-esm/TextInputWithTokens.d.ts +4 -4
  69. package/lib-esm/Timeline.d.ts +4 -4
  70. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  71. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  72. package/lib-esm/Token/Token.d.ts +1 -1
  73. package/lib-esm/_TextInputWrapper.d.ts +1 -1
  74. package/lib-esm/__tests__/KeyPaths.types.test.d.ts +11 -0
  75. package/lib-esm/__tests__/KeyPaths.types.test.js +3 -0
  76. package/lib-esm/stories/Token.stories.js +14 -1
  77. package/lib-esm/sx.d.ts +8 -2
  78. package/lib-esm/theme.d.ts +78 -0
  79. package/lib-esm/theme.js +2 -1
  80. package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
  81. package/lib-esm/utils/types/KeyPaths.js +1 -0
  82. package/package-lock.json +37956 -42
  83. package/package.json +3 -1
  84. package/script/build +2 -0
  85. package/src/ActionList/Header.tsx +1 -1
  86. package/src/__tests__/KeyPaths.types.test.ts +14 -0
  87. package/src/stories/Button.stories.tsx +1 -1
  88. package/src/stories/Token.stories.tsx +12 -1
  89. package/src/sx.ts +14 -2
  90. package/src/theme.ts +86 -0
  91. package/src/utils/types/KeyPaths.ts +10 -0
  92. package/stats.html +1 -1
  93. package/.changeset/tiny-ghosts-repeat.md +0 -5
@@ -1,11 +1,9 @@
1
1
  module.exports = {
2
- "stories": [
3
- "../src/**/*.stories.mdx",
4
- "../src/**/*.stories.@(js|jsx|ts|tsx)"
5
- ],
6
- "addons": [
7
- "@storybook/addon-a11y",
8
- "@storybook/addon-links",
9
- "@storybook/addon-essentials"
2
+ stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
3
+ addons: [
4
+ '@storybook/addon-a11y',
5
+ '@storybook/addon-links',
6
+ '@storybook/addon-essentials',
7
+ 'storybook-addon-performance/register'
10
8
  ]
11
- }
9
+ }
@@ -1,6 +1,10 @@
1
1
  import {addons} from '@storybook/addons'
2
2
  import {ThemeProvider, themeGet, theme} from '../src'
3
3
  import styled, {createGlobalStyle} from 'styled-components'
4
+ import {addDecorator} from '@storybook/react'
5
+ import {withPerformance} from 'storybook-addon-performance'
6
+
7
+ addDecorator(withPerformance)
4
8
 
5
9
  // set global theme styles for each story
6
10
  const GlobalStyle = createGlobalStyle`
@@ -100,7 +104,7 @@ const withThemeProvider = (Story, context) => {
100
104
  </ThemeProvider>
101
105
  )
102
106
  }
103
- export const decorators = [withThemeProvider]
107
+ export const decorators = [withThemeProvider, withPerformance]
104
108
 
105
109
  addons.setConfig({
106
110
  // Some stories may set up keyboard event handlers, which can can be interfered
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # @primer/components
2
2
 
3
- ## 31.0.2
3
+ ## 31.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1544](https://github.com/primer/react/pull/1544) [`5b55b0ab`](https://github.com/primer/react/commit/5b55b0ab8ea06b077e141c02285c81b99e246b77) Thanks [@jfuchs](https://github.com/jfuchs)! - The sx prop now has types that will inform autocomplete for color and shadow values that are key paths into the theme.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1549](https://github.com/primer/react/pull/1549) [`f565840f`](https://github.com/primer/react/commit/f565840f2d879b987ef9df7cd046e146214ed5f5) Thanks [@michael-lefebvre](https://github.com/michael-lefebvre)! - Fix `auxiliaryText` in ActionList Group header
12
+
13
+ ## 31.1.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#1523](https://github.com/primer/react/pull/1523) [`56e2f159`](https://github.com/primer/react/commit/56e2f159b9d627564a7717e6961a6bfa355189b3) Thanks [@mperrotti](https://github.com/mperrotti)! - Add the ability to truncate tokens in the TextInputWithToken component when the input is not focused
4
18
 
5
19
  ### Patch Changes
6
20
 
@@ -400,7 +400,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
400
400
  ${({variant:e})=>"filled"===e&&p(["background:",";margin:"," 0;border-top:1px solid ",";border-bottom:1px solid ",";&:first-child{margin-top:0;}"],Nt("colors.canvas.subtle"),Nt("space.2"),Nt("colors.neutral.muted"),Nt("colors.neutral.muted"))}
401
401
 
402
402
  ${rr}
403
- `;function va({variant:t="subtle",title:r,auxiliaryText:o,children:a,...n}){return e.createElement(ha,Pt({role:"heading",variant:t},n),r,o&&e.createElement("span",null,"auxiliaryText"))}va.displayName="Header";const xa=f.div`
403
+ `;function va({variant:t="subtle",title:r,auxiliaryText:o,children:a,...n}){return e.createElement(ha,Pt({role:"heading",variant:t},n),r,o&&e.createElement("span",null,o))}va.displayName="Header";const xa=f.div`
404
404
  ${rr}
405
405
  `;function ya({header:t,items:r,...o}){return e.createElement(xa,o,t&&e.createElement(va,t),r)}ya.displayName="Group";const wa=f.div`
406
406
  ${At}