@primer/components 0.0.0-2021829205643 → 0.0.0-202182923742
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.
- package/CHANGELOG.md +1 -5
- package/dist/browser.esm.js +2 -3
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2 -3
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.d.ts +4 -16
- package/lib/ActionList/Item.js +6 -9
- package/lib/ActionList/List.d.ts +7 -11
- package/lib/ActionList/List.js +2 -2
- package/lib/ActionList/index.d.ts +2 -1
- package/lib-esm/ActionList/Item.d.ts +4 -16
- package/lib-esm/ActionList/Item.js +5 -8
- package/lib-esm/ActionList/List.d.ts +7 -11
- package/lib-esm/ActionList/List.js +2 -2
- package/lib-esm/ActionList/index.d.ts +2 -1
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
# @primer/components
|
2
2
|
|
3
|
-
## 0.0.0-
|
4
|
-
|
5
|
-
### Minor Changes
|
6
|
-
|
7
|
-
- [#1463](https://github.com/primer/react/pull/1463) [`c6291814`](https://github.com/primer/react/commit/c629181409a60f5b191d663a39568e0fc3ba9e1e) Thanks [@jfuchs](https://github.com/jfuchs)! - `ActionList.item` accepts an `as` prop, allowing it to be a link, or (in combination with the renderItem prop) a Next.js or React Router link
|
3
|
+
## 0.0.0-202182923742
|
8
4
|
|
9
5
|
### Patch Changes
|
10
6
|
|
package/dist/browser.esm.js
CHANGED
@@ -438,7 +438,6 @@ import e,{useState as r,useRef as t,useCallback as a,useEffect as o,useMemo as n
|
|
438
438
|
color: ${({variant:e,item:r})=>ko(e,null==r?void 0:r.disabled).color};
|
439
439
|
// 2 frames on a 60hz monitor
|
440
440
|
transition: background 33.333ms linear;
|
441
|
-
text-decoration: none;
|
442
441
|
|
443
442
|
@media (hover: hover) and (pointer: fine) {
|
444
443
|
:hover {
|
@@ -542,7 +541,7 @@ import e,{useState as r,useRef as t,useCallback as a,useEffect as o,useMemo as n
|
|
542
541
|
flex-basis: var(--description-container-flex-basis);
|
543
542
|
`,Lo=s.input`
|
544
543
|
pointer-events: none;
|
545
|
-
|
544
|
+
`;function zo(r){const{text:t,description:o,descriptionVariant:n="inline",selected:d,selectionVariant:i,leadingVisual:c,trailingIcon:l,trailingText:s,variant:f="default",showDivider:g,disabled:b,onAction:p,onKeyPress:u,children:h,onClick:m,id:x,...v}=r,B=Da(),y=Da(),w=a((e=>{if(b)return;null==u||u(e);e.target instanceof HTMLInputElement&&"checkbox"===e.target.type&&" "===e.key||!e.defaultPrevented&&[" ","Enter"].includes(e.key)&&(null==p||p(r,e))}),[p,b,r,u]),k=a((e=>{b||(null==m||m(e),e.defaultPrevented||null==p||p(r,e))}),[p,b,r,m]),$=wo[f],T=Zr($.hover,"inherit"),S=Zr($.focus,"inherit"),{theme:I}=Jr();return e.createElement(So,Or({tabIndex:b?void 0:-1,variant:f,showDivider:g,"aria-selected":d,"aria-labelledby":t?B:void 0,"aria-describedby":o?y:void 0},v,{"data-id":x,onKeyPress:w,onClick:k,hoverBackground:b?"inherit":T,focusBackground:b?"inherit":S}),!!d===d&&e.createElement(Eo,null,"multiple"===i?e.createElement(e.Fragment,null,e.createElement(Lo,{disabled:b,tabIndex:-1,type:"checkbox",checked:d,"aria-label":t,readOnly:!0,"aria-readonly":"false"})):d&&e.createElement(aa,{fill:null==I?void 0:I.colors.text.primary})),c&&e.createElement(Ao,{variant:f,disabled:b},e.createElement(c,null)),e.createElement($o,null,e.createElement(To,{style:{"--main-content-flex-direction":"inline"===n?"row":"column"}},h,t?e.createElement(Io,{id:B},t):null,o?e.createElement(Ho,{id:y,style:{"--description-container-margin-left":"inline"===n?Cr("space.2")(I):0,"--description-container-flex-basis":"inline"===n?0:"auto"}},"block"===n?o:e.createElement(vo,{title:o,inline:!0,maxWidth:"100%"},o)):null),l||s?e.createElement(No,{variant:f,disabled:b},s,l&&e.createElement(l,null)):null))}zo.displayName="Item";const Ro=s.div`
|
546
545
|
font-size: ${Cr("fontSizes.1")};
|
547
546
|
/* 14px font-size * 1.428571429 = 20px line height
|
548
547
|
*
|
@@ -555,7 +554,7 @@ import e,{useState as r,useRef as t,useCallback as a,useEffect as o,useMemo as n
|
|
555
554
|
--item-hover-bg-override: none;
|
556
555
|
--item-hover-divider-border-color-override: ${Cr("colors.border.muted")};
|
557
556
|
}
|
558
|
-
`;const Oo=e.forwardRef(((r,t)=>{const{firstGroupStyle:a,lastGroupStyle:o,headerStyle:n,itemStyle:d}=function(e="inset"){switch(e){case"full":return{headerStyle:{paddingX:Cr("space.2")},itemStyle:{borderRadius:0}};default:return{firstGroupStyle:{marginTop:Cr("space.2")},lastGroupStyle:{marginBottom:Cr("space.2")},itemStyle:{marginX:Cr("space.2")}}}}(r.variant),i=(t,a,o)=>{var n,i,c;const l="renderItem"in t&&t.renderItem||r.renderItem||zo,s=null!==(n=null!==(i=
|
557
|
+
`;const Oo=e.forwardRef(((r,t)=>{const{firstGroupStyle:a,lastGroupStyle:o,headerStyle:n,itemStyle:d}=function(e="inset"){switch(e){case"full":return{headerStyle:{paddingX:Cr("space.2")},itemStyle:{borderRadius:0}};default:return{firstGroupStyle:{marginTop:Cr("space.2")},lastGroupStyle:{marginBottom:Cr("space.2")},itemStyle:{marginX:Cr("space.2")}}}}(r.variant),i=(t,a,o)=>{var n,i,c;const l="renderItem"in t&&t.renderItem||r.renderItem||zo,s=null!==(n=null!==(i=t.key)&&void 0!==i?i:null===(c=t.id)||void 0===c?void 0:c.toString())&&void 0!==n?n:o.toString();return e.createElement(l,Or({showDivider:r.showItemDividers,selectionVariant:r.selectionVariant},t,{key:s,sx:{...d,...t.sx},item:a}))};let c=[];if(function(e){return"groupMetadata"in e}(r)){const e=r.groupMetadata.reduce(((e,r)=>e.set(r.groupId,r)),new Map);for(const t of r.items){var l,s,f;const r=e.get(t.groupId),a=null!==(l=null==r||null===(s=r.items)||void 0===s?void 0:s.length)&&void 0!==l?l:0;e.set(t.groupId,{...r,items:[...null!==(f=null==r?void 0:r.items)&&void 0!==f?f:[],i({showDivider:null==r?void 0:r.showItemDividers,...r&&"renderItem"in r&&{renderItem:r.renderItem},...t},t,a)]})}c=[...e.values()]}else c=[{items:r.items.map(((e,r)=>i(e,e,r))),groupId:"0"}];return e.createElement(Ro,Or({},r,{ref:t}),c.map((({header:t,...d},i)=>{const l="filled"===(null==t?void 0:t.variant),s=i>0&&!l;return e.createElement(e.Fragment,{key:d.groupId},s?e.createElement(yo,{key:`${d.groupId}-divider`}):null,(t=>{var a;const o=(null!==(a="renderGroup"in t&&t.renderGroup)&&void 0!==a?a:r.renderGroup)||mo;return e.createElement(o,Or({},t,{key:t.groupId}))})({sx:{...0===i&&a,...i===c.length-1&&o,...i>0&&!s&&{mt:2}},...t&&{header:{...t,sx:{...n,...t.sx}}},...d}))})))}));Oo.displayName="ActionList";const Mo=Object.assign(Oo,{Group:mo,Item:zo,Divider:yo}),Po={xsmall:"192px",small:"256px",medium:"320px",large:"432px",xlarge:"600px",auto:"auto",initial:"auto"},Fo={small:"256px",medium:"320px",large:"480px",xlarge:"640px",xxlarge:"960px",auto:"auto"};const Do=s.div`
|
559
558
|
background-color: ${Cr("colors.canvas.overlay")};
|
560
559
|
box-shadow: ${Cr("shadows.overlay.shadow")};
|
561
560
|
position: absolute;
|