@primer/components 32.0.2-rc.859381a1 → 32.1.1-rc.b4502a34

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 (155) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/browser.esm.js +9 -2
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +9 -2
  5. package/dist/browser.umd.js.map +1 -1
  6. package/docs/content/ActionList2.mdx +23 -3
  7. package/docs/content/Avatar.mdx +21 -1
  8. package/docs/content/AvatarStack.mdx +23 -3
  9. package/docs/content/BranchName.md +24 -4
  10. package/docs/content/Breadcrumbs.md +22 -1
  11. package/docs/content/Buttons.md +2 -1
  12. package/docs/content/Checkbox.md +118 -0
  13. package/docs/content/CircleBadge.md +1 -0
  14. package/docs/content/CircleOcticon.md +2 -1
  15. package/docs/content/CounterLabel.md +1 -1
  16. package/docs/content/Details.md +2 -1
  17. package/docs/content/Dialog.md +1 -0
  18. package/docs/content/Dialog2.mdx +1 -0
  19. package/docs/content/Dropdown.md +1 -0
  20. package/docs/content/DropdownMenu.mdx +1 -0
  21. package/docs/content/FilterList.md +1 -0
  22. package/docs/content/FilteredSearch.md +1 -0
  23. package/docs/content/Flash.md +1 -0
  24. package/docs/content/FormGroup.md +1 -0
  25. package/docs/content/Header.md +1 -0
  26. package/docs/content/Heading.md +8 -4
  27. package/docs/content/Label.md +1 -0
  28. package/docs/content/LabelGroup.md +1 -0
  29. package/docs/content/Link.md +1 -0
  30. package/docs/content/Overlay.mdx +1 -0
  31. package/docs/content/Pagehead.md +1 -0
  32. package/docs/content/Pagination.md +1 -0
  33. package/docs/content/PointerBox.md +1 -0
  34. package/docs/content/Popover.md +1 -0
  35. package/docs/content/Portal.mdx +1 -0
  36. package/docs/content/Position.md +2 -9
  37. package/docs/content/ProgressBar.mdx +1 -0
  38. package/docs/content/SelectMenu.md +1 -0
  39. package/docs/content/SideNav.md +1 -0
  40. package/docs/content/StateLabel.md +1 -0
  41. package/docs/content/StyledOcticon.md +1 -1
  42. package/docs/content/SubNav.md +1 -0
  43. package/docs/content/TabNav.md +1 -0
  44. package/docs/content/Text.md +10 -3
  45. package/docs/content/TextInput.md +9 -1
  46. package/docs/content/Timeline.md +1 -0
  47. package/docs/content/Tooltip.md +1 -0
  48. package/docs/content/Truncate.md +1 -0
  49. package/docs/content/UnderlineNav.md +1 -0
  50. package/docs/content/status.mdx +10 -0
  51. package/docs/src/@primer/gatsby-theme-doctocat/mdx-components.js +9 -0
  52. package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +4 -0
  53. package/docs/src/component-statuses.js +74 -0
  54. package/lib/ActionList/Item.js +3 -3
  55. package/lib/ActionList2/Item.js +3 -1
  56. package/lib/ActionList2/List.js +1 -2
  57. package/lib/ActionList2/Selection.js +3 -1
  58. package/lib/Autocomplete/Autocomplete.d.ts +1 -0
  59. package/lib/Autocomplete/AutocompleteInput.d.ts +1 -0
  60. package/lib/Button/Button.d.ts +1 -0
  61. package/lib/Button/ButtonClose.d.ts +2 -1
  62. package/lib/Button/ButtonDanger.d.ts +1 -0
  63. package/lib/Button/ButtonInvisible.d.ts +1 -0
  64. package/lib/Button/ButtonOutline.d.ts +1 -0
  65. package/lib/Button/ButtonPrimary.d.ts +1 -0
  66. package/lib/Checkbox.d.ts +29 -0
  67. package/lib/Checkbox.js +64 -0
  68. package/lib/CircleOcticon.d.ts +1 -0
  69. package/lib/Dialog.d.ts +3 -2
  70. package/lib/Dropdown.d.ts +4 -0
  71. package/lib/DropdownMenu/DropdownButton.d.ts +2 -1
  72. package/lib/FilterList.d.ts +1 -0
  73. package/lib/Position.d.ts +4 -4
  74. package/lib/SelectMenu/SelectMenu.d.ts +10 -4
  75. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  76. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  77. package/lib/TextInputWithTokens.d.ts +1 -0
  78. package/lib/Token/AvatarToken.d.ts +1 -1
  79. package/lib/Token/IssueLabelToken.d.ts +1 -1
  80. package/lib/Token/Token.d.ts +1 -1
  81. package/lib/__tests__/ActionList2.test.d.ts +1 -0
  82. package/lib/__tests__/ActionList2.test.js +117 -0
  83. package/lib/__tests__/Checkbox.test.d.ts +2 -0
  84. package/lib/__tests__/Checkbox.test.js +189 -0
  85. package/lib/__tests__/themePreval.test.d.ts +1 -0
  86. package/lib/__tests__/themePreval.test.js +14 -0
  87. package/lib/index.d.ts +2 -0
  88. package/lib/index.js +8 -0
  89. package/lib/stories/ActionList2.stories.js +20 -6
  90. package/lib/stories/Checkbox.stories.js +227 -0
  91. package/lib/utils/testing.d.ts +1 -0
  92. package/lib/utils/testing.js +29 -0
  93. package/lib-esm/ActionList/Item.js +3 -3
  94. package/lib-esm/ActionList2/Item.js +3 -1
  95. package/lib-esm/ActionList2/List.js +1 -2
  96. package/lib-esm/ActionList2/Selection.js +3 -1
  97. package/lib-esm/Autocomplete/Autocomplete.d.ts +1 -0
  98. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +1 -0
  99. package/lib-esm/Button/Button.d.ts +1 -0
  100. package/lib-esm/Button/ButtonClose.d.ts +2 -1
  101. package/lib-esm/Button/ButtonDanger.d.ts +1 -0
  102. package/lib-esm/Button/ButtonInvisible.d.ts +1 -0
  103. package/lib-esm/Button/ButtonOutline.d.ts +1 -0
  104. package/lib-esm/Button/ButtonPrimary.d.ts +1 -0
  105. package/lib-esm/Checkbox.d.ts +29 -0
  106. package/lib-esm/Checkbox.js +44 -0
  107. package/lib-esm/CircleOcticon.d.ts +1 -0
  108. package/lib-esm/Dialog.d.ts +3 -2
  109. package/lib-esm/Dropdown.d.ts +4 -0
  110. package/lib-esm/DropdownMenu/DropdownButton.d.ts +2 -1
  111. package/lib-esm/FilterList.d.ts +1 -0
  112. package/lib-esm/Position.d.ts +4 -4
  113. package/lib-esm/SelectMenu/SelectMenu.d.ts +10 -4
  114. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  115. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  116. package/lib-esm/TextInputWithTokens.d.ts +1 -0
  117. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  118. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  119. package/lib-esm/Token/Token.d.ts +1 -1
  120. package/lib-esm/__tests__/ActionList2.test.d.ts +1 -0
  121. package/lib-esm/__tests__/ActionList2.test.js +105 -2
  122. package/lib-esm/__tests__/Checkbox.test.d.ts +2 -0
  123. package/lib-esm/__tests__/Checkbox.test.js +169 -0
  124. package/lib-esm/__tests__/themePreval.test.d.ts +1 -0
  125. package/lib-esm/__tests__/themePreval.test.js +7 -0
  126. package/lib-esm/index.d.ts +2 -0
  127. package/lib-esm/index.js +1 -0
  128. package/lib-esm/stories/ActionList2.stories.js +20 -6
  129. package/lib-esm/stories/Checkbox.stories.js +197 -0
  130. package/lib-esm/utils/testing.d.ts +1 -0
  131. package/lib-esm/utils/testing.js +24 -0
  132. package/package-lock.json +179 -20
  133. package/package.json +2 -2
  134. package/src/ActionList/Item.tsx +2 -1
  135. package/src/ActionList2/Item.tsx +3 -2
  136. package/src/ActionList2/List.tsx +1 -6
  137. package/src/ActionList2/Selection.tsx +2 -1
  138. package/src/Checkbox.tsx +75 -0
  139. package/src/__tests__/ActionList2.test.tsx +111 -2
  140. package/src/__tests__/Checkbox.test.tsx +155 -0
  141. package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +13 -0
  142. package/src/__tests__/__snapshots__/Checkbox.test.tsx.snap +16 -0
  143. package/src/__tests__/__snapshots__/themePreval.test.ts.snap +3176 -0
  144. package/src/__tests__/themePreval.test.ts +8 -0
  145. package/src/index.ts +3 -0
  146. package/src/stories/ActionList2.stories.tsx +22 -8
  147. package/src/stories/Checkbox.stories.tsx +164 -0
  148. package/src/utils/testing.tsx +22 -0
  149. package/stats.html +1 -1
  150. package/docs/content/TextInputTokens.mdx +0 -89
  151. package/lib/ActionList2/Header.d.ts +0 -26
  152. package/lib/ActionList2/Header.js +0 -55
  153. package/lib-esm/ActionList2/Header.d.ts +0 -26
  154. package/lib-esm/ActionList2/Header.js +0 -44
  155. package/src/ActionList2/Header.tsx +0 -58
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # @primer/components
2
2
 
3
- ## 32.0.2
3
+ ## 32.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1668](https://github.com/primer/react/pull/1668) [`98dc6336`](https://github.com/primer/react/commit/98dc633674b793edfa4fbeb88fd239e6ca40544e) Thanks [@siddharthkp](https://github.com/siddharthkp)! - ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com
8
+
9
+ * [#1596](https://github.com/primer/react/pull/1596) [`5c6dc644`](https://github.com/primer/react/commit/5c6dc644c1e68b36d309deac653aca189f1fa624) Thanks [@dmarcey](https://github.com/dmarcey)! - Fix alignment of items in ActionList (single-select) if some of the items have wrapping text.
10
+
11
+ ## 32.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#1606](https://github.com/primer/react/pull/1606) [`985120a6`](https://github.com/primer/react/commit/985120a61b62c1bbd1872d9a11e34fab407a4096) Thanks [@rezrah](https://github.com/rezrah)! - Adds a new Checkbox form component
4
16
 
5
17
  ### Patch Changes
6
18
 
@@ -517,13 +517,13 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
517
517
  display: flex;
518
518
  justify-content: center;
519
519
  align-items: center;
520
+ flex-shrink: 0;
520
521
  `,Ca=g(Ea)`
521
522
  svg {
522
523
  fill: ${({variant:e,disabled:t})=>Ba(e,t).iconColor};
523
524
  font-size: ${It("fontSizes.0")};
524
525
  }
525
526
  `,za=g(Ca)`
526
- flex-shrink: 0;
527
527
  display: flex;
528
528
  flex-direction: column;
529
529
  justify-content: center;
@@ -549,6 +549,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
549
549
  rect {
550
550
  fill: ${({selected:e})=>It(e?"colors.accent.fg":"colors.canvas.default")};
551
551
  stroke: ${({selected:e})=>It(e?"colors.accent.fg":"colors.border.default")};
552
+ shape-rendering: auto; // this is a workaround to override global style in github/github, see primer/react#1666
552
553
  }
553
554
  path {
554
555
  fill: ${It("colors.fg.onEmphasis")};
@@ -2207,5 +2208,11 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
2207
2208
  }
2208
2209
 
2209
2210
  ${Zt};
2210
- `;ps.displayName="UnderlineNav.Link";var bs=Object.assign(us,{Link:ps});export{dr as Absolute,Da as ActionList,Va as ActionMenu,gn as Autocomplete,un as Avatar,hn as AvatarPair,xn as AvatarStack,ss as AvatarToken,Dt as BaseStyles,tr as BorderBox,Qt as Box,yn as BranchName,Sn as Breadcrumb,Tn as Breadcrumbs,jr as Button,fo as ButtonClose,Ur as ButtonDanger,Vr as ButtonGroup,Xr as ButtonInvisible,Gr as ButtonOutline,qr as ButtonPrimary,Yr as ButtonTableList,Hn as Caret,Un as CircleBadge,Kn as CircleOcticon,fa as ConfirmationDialog,An as CounterLabel,Gn as Details,oi as Dialog,gi as Dropdown,fi as DropdownButton,ui as DropdownMenu,xi as FilterList,pi as FilteredSearch,sr as Fixed,Bi as Flash,or as Flex,Ti as FormGroup,nr as Grid,zi as Header,Ai as Heading,is as IssueLabelToken,Di as Label,Ni as LabelGroup,Oi as Link,Rn as NewButton,Wa as Overlay,Pi as Pagehead,ji as Pagination,Vi as PointerBox,Xi as Popover,lr as Position,Qi as ProgressBar,cr as Relative,Po as SSRProvider,Xl as SelectMenu,td as SideNav,Tl as Spinner,id as StateLabel,gr as Sticky,Ao as StyledOcticon,gd as SubNav,hd as TabNav,Yn as Text,tn as TextInput,Md as TextInputWithTokens,Jt as ThemeProvider,jd as Timeline,Rd as Token,gs as Tooltip,xa as Truncate,bs as UnderlineNav,x as theme,It as themeGet,Xt as useColorSchemeVar,ua as useConfirm,fr as useDetails,$r as useOnEscapePress,mr as useOnOutsideClick,wr as useOpenAndCloseFocus,Sr as useOverlay,Wo as useSSRSafeId,ur as useSafeTimeout,qt as useTheme};
2211
+ `;ps.displayName="UnderlineNav.Link";var bs=Object.assign(us,{Link:ps});const hs=g.input`
2212
+ cursor: pointer;
2213
+
2214
+ ${e=>e.disabled&&"cursor: not-allowed;"}
2215
+
2216
+ ${Zt}
2217
+ `,ms=e.forwardRef((({checked:t,indeterminate:r,disabled:o,sx:a,required:n,validationStatus:i,...d},s)=>{const c=Tr(s);return l((()=>{c.current&&(c.current.indeterminate=r||!1)}),[r,t,c]),e.createElement(hs,Rt({type:"checkbox",disabled:o,"aria-disabled":o?"true":"false",ref:s||c,checked:!r&&t,"aria-checked":r?"mixed":t?"true":"false",sx:a,required:n,"aria-required":n?"true":"false","aria-invalid":"error"===i?"true":"false"},d))}));ms.displayName="Checkbox";var vs=ms;export{dr as Absolute,Da as ActionList,Va as ActionMenu,gn as Autocomplete,un as Avatar,hn as AvatarPair,xn as AvatarStack,ss as AvatarToken,Dt as BaseStyles,tr as BorderBox,Qt as Box,yn as BranchName,Sn as Breadcrumb,Tn as Breadcrumbs,jr as Button,fo as ButtonClose,Ur as ButtonDanger,Vr as ButtonGroup,Xr as ButtonInvisible,Gr as ButtonOutline,qr as ButtonPrimary,Yr as ButtonTableList,Hn as Caret,vs as Checkbox,Un as CircleBadge,Kn as CircleOcticon,fa as ConfirmationDialog,An as CounterLabel,Gn as Details,oi as Dialog,gi as Dropdown,fi as DropdownButton,ui as DropdownMenu,xi as FilterList,pi as FilteredSearch,sr as Fixed,Bi as Flash,or as Flex,Ti as FormGroup,nr as Grid,zi as Header,Ai as Heading,is as IssueLabelToken,Di as Label,Ni as LabelGroup,Oi as Link,Rn as NewButton,Wa as Overlay,Pi as Pagehead,ji as Pagination,Vi as PointerBox,Xi as Popover,lr as Position,Qi as ProgressBar,cr as Relative,Po as SSRProvider,Xl as SelectMenu,td as SideNav,Tl as Spinner,id as StateLabel,gr as Sticky,Ao as StyledOcticon,gd as SubNav,hd as TabNav,Yn as Text,tn as TextInput,Md as TextInputWithTokens,Jt as ThemeProvider,jd as Timeline,Rd as Token,gs as Tooltip,xa as Truncate,bs as UnderlineNav,x as theme,It as themeGet,Xt as useColorSchemeVar,ua as useConfirm,fr as useDetails,$r as useOnEscapePress,mr as useOnOutsideClick,wr as useOpenAndCloseFocus,Sr as useOverlay,Wo as useSSRSafeId,ur as useSafeTimeout,qt as useTheme};
2211
2218
  //# sourceMappingURL=browser.esm.js.map