@primer/components 0.0.0-202110118812 → 0.0.0-202110216818

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 (114) hide show
  1. package/CHANGELOG.md +3 -5
  2. package/dist/browser.esm.js +4 -1
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +4 -1
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList2/Description.d.ts +12 -0
  7. package/lib/ActionList2/Description.js +53 -0
  8. package/lib/ActionList2/Divider.d.ts +5 -0
  9. package/lib/ActionList2/Divider.js +33 -0
  10. package/lib/ActionList2/Group.d.ts +11 -0
  11. package/lib/ActionList2/Group.js +55 -0
  12. package/lib/ActionList2/Header.d.ts +26 -0
  13. package/lib/ActionList2/Header.js +57 -0
  14. package/lib/ActionList2/Item.d.ts +53 -0
  15. package/lib/ActionList2/Item.js +213 -0
  16. package/lib/ActionList2/LinkItem.d.ts +16 -0
  17. package/lib/ActionList2/LinkItem.js +54 -0
  18. package/lib/ActionList2/List.d.ts +26 -0
  19. package/lib/ActionList2/List.js +51 -0
  20. package/lib/ActionList2/Selection.d.ts +5 -0
  21. package/lib/ActionList2/Selection.js +73 -0
  22. package/lib/ActionList2/Visuals.d.ts +11 -0
  23. package/lib/ActionList2/Visuals.js +90 -0
  24. package/lib/ActionList2/hacks.d.ts +30 -0
  25. package/lib/ActionList2/hacks.js +38 -0
  26. package/lib/ActionList2/index.d.ts +40 -0
  27. package/lib/ActionList2/index.js +47 -0
  28. package/lib/Autocomplete/Autocomplete.d.ts +26 -26
  29. package/lib/Autocomplete/AutocompleteInput.d.ts +26 -26
  30. package/lib/Breadcrumbs.d.ts +7 -8
  31. package/lib/Breadcrumbs.js +12 -7
  32. package/lib/Button/Button.d.ts +24 -24
  33. package/lib/Button/ButtonClose.d.ts +43 -43
  34. package/lib/Button/ButtonDanger.d.ts +24 -24
  35. package/lib/Button/ButtonInvisible.d.ts +24 -24
  36. package/lib/Button/ButtonOutline.d.ts +24 -24
  37. package/lib/Button/ButtonPrimary.d.ts +24 -24
  38. package/lib/CircleOcticon.d.ts +40 -40
  39. package/lib/Dialog.d.ts +43 -43
  40. package/lib/Dropdown.d.ts +168 -168
  41. package/lib/DropdownMenu/DropdownButton.d.ts +44 -44
  42. package/lib/FilterList.d.ts +40 -40
  43. package/lib/Position.d.ts +4 -4
  44. package/lib/SelectMenu/SelectMenu.d.ts +235 -235
  45. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  46. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  47. package/lib/TextInputWithTokens.d.ts +26 -26
  48. package/lib/Timeline.d.ts +41 -41
  49. package/lib/Token/AvatarToken.d.ts +1 -1
  50. package/lib/Token/IssueLabelToken.d.ts +1 -1
  51. package/lib/Token/Token.d.ts +1 -1
  52. package/lib/experiments.d.ts +1 -0
  53. package/lib/experiments.js +18 -0
  54. package/lib/sx.d.ts +2 -0
  55. package/lib/sx.js +8 -0
  56. package/lib/utils/create-slots.d.ts +17 -0
  57. package/lib/utils/create-slots.js +105 -0
  58. package/lib/utils/use-force-update.d.ts +1 -0
  59. package/lib/utils/use-force-update.js +19 -0
  60. package/lib-esm/ActionList2/Description.d.ts +12 -0
  61. package/lib-esm/ActionList2/Description.js +37 -0
  62. package/lib-esm/ActionList2/Divider.d.ts +5 -0
  63. package/lib-esm/ActionList2/Divider.js +21 -0
  64. package/lib-esm/ActionList2/Group.d.ts +11 -0
  65. package/lib-esm/ActionList2/Group.js +38 -0
  66. package/lib-esm/ActionList2/Header.d.ts +26 -0
  67. package/lib-esm/ActionList2/Header.js +46 -0
  68. package/lib-esm/ActionList2/Item.d.ts +53 -0
  69. package/lib-esm/ActionList2/Item.js +185 -0
  70. package/lib-esm/ActionList2/LinkItem.d.ts +16 -0
  71. package/lib-esm/ActionList2/LinkItem.js +40 -0
  72. package/lib-esm/ActionList2/List.d.ts +26 -0
  73. package/lib-esm/ActionList2/List.js +34 -0
  74. package/lib-esm/ActionList2/Selection.d.ts +5 -0
  75. package/lib-esm/ActionList2/Selection.js +55 -0
  76. package/lib-esm/ActionList2/Visuals.d.ts +11 -0
  77. package/lib-esm/ActionList2/Visuals.js +68 -0
  78. package/lib-esm/ActionList2/hacks.d.ts +30 -0
  79. package/lib-esm/ActionList2/hacks.js +30 -0
  80. package/lib-esm/ActionList2/index.d.ts +40 -0
  81. package/lib-esm/ActionList2/index.js +33 -0
  82. package/lib-esm/Autocomplete/Autocomplete.d.ts +26 -26
  83. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +26 -26
  84. package/lib-esm/Breadcrumbs.d.ts +7 -8
  85. package/lib-esm/Breadcrumbs.js +13 -8
  86. package/lib-esm/Button/Button.d.ts +24 -24
  87. package/lib-esm/Button/ButtonClose.d.ts +43 -43
  88. package/lib-esm/Button/ButtonDanger.d.ts +24 -24
  89. package/lib-esm/Button/ButtonInvisible.d.ts +24 -24
  90. package/lib-esm/Button/ButtonOutline.d.ts +24 -24
  91. package/lib-esm/Button/ButtonPrimary.d.ts +24 -24
  92. package/lib-esm/CircleOcticon.d.ts +40 -40
  93. package/lib-esm/Dialog.d.ts +43 -43
  94. package/lib-esm/Dropdown.d.ts +168 -168
  95. package/lib-esm/DropdownMenu/DropdownButton.d.ts +44 -44
  96. package/lib-esm/FilterList.d.ts +40 -40
  97. package/lib-esm/Position.d.ts +4 -4
  98. package/lib-esm/SelectMenu/SelectMenu.d.ts +235 -235
  99. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  100. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  101. package/lib-esm/TextInputWithTokens.d.ts +26 -26
  102. package/lib-esm/Timeline.d.ts +41 -41
  103. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  104. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  105. package/lib-esm/Token/Token.d.ts +1 -1
  106. package/lib-esm/experiments.d.ts +1 -0
  107. package/lib-esm/experiments.js +2 -0
  108. package/lib-esm/sx.d.ts +2 -0
  109. package/lib-esm/sx.js +3 -1
  110. package/lib-esm/utils/create-slots.d.ts +17 -0
  111. package/lib-esm/utils/create-slots.js +84 -0
  112. package/lib-esm/utils/use-force-update.d.ts +1 -0
  113. package/lib-esm/utils/use-force-update.js +6 -0
  114. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -1,15 +1,13 @@
1
1
  # @primer/components
2
2
 
3
- ## 0.0.0-202110118812
4
-
5
- ### Major Changes
6
-
7
- - [#1469](https://github.com/primer/react/pull/1469) [`76aa0739`](https://github.com/primer/react/commit/76aa07395e3ad06665dd374c1fc8c78525bfb88a) Thanks [@jfuchs](https://github.com/jfuchs)! - Breadcrumbs no longer accept styled props
3
+ ## 0.0.0-202110216818
8
4
 
9
5
  ### Minor Changes
10
6
 
11
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.
12
8
 
9
+ * [#1517](https://github.com/primer/react/pull/1517) [`19b430bb`](https://github.com/primer/react/commit/19b430bb48fcce76fc623378055a38392ef5d778) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Add experimental `ActionList` with composable API
10
+
13
11
  ### Patch Changes
14
12
 
15
13
  - Fake entry to force publishing
@@ -810,8 +810,10 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
810
810
  `,Sn=f.nav`
811
811
  display: flex;
812
812
  justify-content: space-between;
813
+ ${It};
814
+ ${Mt};
813
815
  ${rr};
814
- `;function En({className:t,children:r,sx:o}){const a=e.Children.map(r,(t=>e.createElement(Tn,null,t)));return e.createElement(Sn,{className:t,"aria-label":"Breadcrumbs",sx:o},e.createElement(or,{as:"ol",my:0,pl:0},a))}En.displayName="Breadcrumbs";const Cn=f.a.attrs((e=>({activeClassName:"string"==typeof e.to?"selected":"",className:en(e.selected&&"selected",e.className),"aria-current":e.selected?"page":null})))`
816
+ `;function En({className:t,children:r,theme:o,...a}){const n=e.Children.map(r,(t=>e.createElement(Tn,{theme:o},t)));return e.createElement(Sn,Pt({className:t,"aria-label":"Breadcrumbs",theme:o},a),e.createElement(or,{as:"ol",my:0,pl:0},n))}En.displayName="Breadcrumbs";const Cn=f.a.attrs((e=>({activeClassName:"string"==typeof e.to?"selected":"",className:en(e.selected&&"selected",e.className),"aria-current":e.selected?"page":null})))`
815
817
  color: ${Nt("colors.accent.fg")};
816
818
  display: inline-block;
817
819
  font-size: ${Nt("fontSizes.1")};
@@ -823,6 +825,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
823
825
  color: ${Nt("colors.fg.default")};
824
826
  pointer-events: none;
825
827
  }
828
+ ${It}
826
829
  ${rr};
827
830
  `;En.displayName="Breadcrumbs",Cn.displayName="Breadcrumbs.Item";var zn=Object.assign(En,{Item:Cn});const Nn=Object.assign(En,{Item:Cn}),In={top:"Bottom",right:"Left",bottom:"Top",left:"Right"},An={top:"Left",right:"Top",bottom:"Left",left:"Top"};function Rn(e,t,r){const o=In[e].toLowerCase(),a=An[e].toLowerCase();return{[o]:"100%",[t||a]:t?r:"50%"}}const Ln=Tt({prop:"bg",key:"colors"}),On=Tt({prop:"borderColor",key:"colors"}),Mn=Tt({prop:"borderWidth",key:"borderWidths",scale:[0,1]});function Pn(t){var r;const o=e.useContext(b),a={...t,theme:null!==(r=t.theme)&&void 0!==r?r:o},{bg:n}=Ln(a),{borderColor:i}=On(a),{borderWidth:l}=Mn(a),{size:d=8,location:s="bottom"}=t,[c,f]=function(e){const[t,r]=e.split("-");return[t,r]}(s),g=An[c],u=[-d,0],p=[0,d],m=[d,0],h=`M${u}L${p}L${m}L${u}Z`,v=`M${u}L${p}L${m}`,x={top:`translate(${[d,2*d]}) rotate(180)`,right:`translate(${[0,d]}) rotate(-90)`,bottom:`translate(${[d,0]})`,left:`translate(${[2*d,d]}) rotate(90)`}[c];return e.createElement("svg",{width:2*d,height:2*d,style:{pointerEvents:"none",position:"absolute",...Rn(c,f,d),[`margin${g}`]:f?null:-d}},e.createElement("g",{transform:x},e.createElement("path",{d:h,fill:n}),e.createElement("path",{d:v,fill:"none",stroke:i,strokeWidth:l})))}Pn.displayName="Caret",Pn.locations=["top","top-left","top-right","right","right-top","right-bottom","bottom","bottom-left","bottom-right","left","left-top","left-bottom"],Pn.defaultProps={bg:"canvas.default",borderColor:"border.default",borderWidth:1};const Hn={small:56,medium:96,large:128},Dn=f.div`
828
831
  display: ${e=>e.inline?"inline-flex":"flex"};