@primer/components 0.0.0-202182422492 → 0.0.0-20218276039
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 -17
- package/lib/ActionList/Item.js +6 -8
- package/lib/ActionList/List.d.ts +5 -7
- package/lib/ActionList/List.js +2 -2
- package/lib/ActionList/index.d.ts +2 -1
- package/lib-esm/ActionList/Item.d.ts +4 -17
- package/lib-esm/ActionList/Item.js +5 -8
- package/lib-esm/ActionList/List.d.ts +5 -7
- 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,15 +1,11 @@
|
|
1
1
|
# @primer/components
|
2
2
|
|
3
|
-
## 0.0.0-
|
3
|
+
## 0.0.0-20218276039
|
4
4
|
|
5
5
|
### Major Changes
|
6
6
|
|
7
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
8
|
|
9
|
-
### Minor Changes
|
10
|
-
|
11
|
-
- [#1463](https://github.com/primer/react/pull/1463) [`d058ce6a`](https://github.com/primer/react/commit/d058ce6ad4ae91a1b608418c1d28cba1a5b0e765) 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
|
12
|
-
|
13
9
|
### Patch Changes
|
14
10
|
|
15
11
|
- Fake entry to force publishing
|
package/dist/browser.esm.js
CHANGED
@@ -438,7 +438,6 @@ import e,{useState as r,useRef as t,useCallback as o,useEffect as a,useMemo as n
|
|
438
438
|
color: ${({variant:e,item:r})=>$a(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 o,useEffect as a,useMemo as n
|
|
542
541
|
flex-basis: var(--description-container-flex-basis);
|
543
542
|
`,La=s.input`
|
544
543
|
pointer-events: none;
|
545
|
-
|
544
|
+
`;function Ra(r){const{text:t,description:a,descriptionVariant:n="inline",selected:i,selectionVariant:d,leadingVisual:l,trailingIcon:c,trailingText:s,variant:f="default",showDivider:g,disabled:b,onAction:p,onKeyPress:u,children:m,onClick:h,id:x,...v}=r,y=Wo(),w=Wo(),B=o((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]),$=o((e=>{b||(null==h||h(e),e.defaultPrevented||null==p||p(r,e))}),[p,b,r,h]),k=Ba[f],S=Zr(k.hover,"inherit"),T=Zr(k.focus,"inherit"),{theme:E}=Jr();return e.createElement(Ta,Or({tabIndex:b?void 0:-1,variant:f,showDivider:g,"aria-selected":i,"aria-labelledby":t?y:void 0,"aria-describedby":a?w:void 0},v,{"data-id":x,onKeyPress:B,onClick:$,hoverBackground:b?"inherit":S,focusBackground:b?"inherit":T}),!!i===i&&e.createElement(Ia,null,"multiple"===d?e.createElement(e.Fragment,null,e.createElement(La,{disabled:b,tabIndex:-1,type:"checkbox",checked:i,"aria-label":t,readOnly:!0,"aria-readonly":"false"})):i&&e.createElement(oo,{fill:null==E?void 0:E.colors.text.primary})),l&&e.createElement(Na,{variant:f,disabled:b},e.createElement(l,null)),e.createElement(ka,null,e.createElement(Sa,{style:{"--main-content-flex-direction":"inline"===n?"row":"column"}},m,t?e.createElement(Ea,{id:y},t):null,a?e.createElement(za,{id:w,style:{"--description-container-margin-left":"inline"===n?Cr("space.2")(E):0,"--description-container-flex-basis":"inline"===n?0:"auto"}},"block"===n?a:e.createElement(va,{title:a,inline:!0,maxWidth:"100%"},a)):null),c||s?e.createElement(Aa,{variant:f,disabled:b},s,c&&e.createElement(c,null)):null))}Ra.displayName="Item";const Ha=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 o,useEffect as a,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 Oa=e.forwardRef(((r,t)=>{const{firstGroupStyle:o,lastGroupStyle:a,headerStyle:n,itemStyle:i}=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),d=(t,o,a)=>{var n,d;const
|
557
|
+
`;const Oa=e.forwardRef(((r,t)=>{const{firstGroupStyle:o,lastGroupStyle:a,headerStyle:n,itemStyle:i}=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),d=(t,o,a)=>{var n,d,l;const c="renderItem"in t&&t.renderItem||r.renderItem||Ra,s=null!==(n=null!==(d=t.key)&&void 0!==d?d:null===(l=t.id)||void 0===l?void 0:l.toString())&&void 0!==n?n:a.toString();return e.createElement(c,Or({showDivider:r.showItemDividers,selectionVariant:r.selectionVariant},t,{key:s,sx:{...i,...t.sx},item:o}))};let l=[];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 c,s,f;const r=e.get(t.groupId),o=null!==(c=null==r||null===(s=r.items)||void 0===s?void 0:s.length)&&void 0!==c?c:0;e.set(t.groupId,{...r,items:[...null!==(f=null==r?void 0:r.items)&&void 0!==f?f:[],d({showDivider:null==r?void 0:r.showItemDividers,...r&&"renderItem"in r&&{renderItem:r.renderItem},...t},t,o)]})}l=[...e.values()]}else l=[{items:r.items.map(((e,r)=>d(e,e,r))),groupId:"0"}];return e.createElement(Ha,Or({},r,{ref:t}),l.map((({header:t,...i},d)=>{const c="filled"===(null==t?void 0:t.variant),s=d>0&&!c;return e.createElement(e.Fragment,{key:i.groupId},s?e.createElement(wa,{key:`${i.groupId}-divider`}):null,(t=>{var o;const a=(null!==(o="renderGroup"in t&&t.renderGroup)&&void 0!==o?o:r.renderGroup)||ha;return e.createElement(a,Or({},t,{key:t.groupId}))})({sx:{...0===d&&o,...d===l.length-1&&a,...d>0&&!s&&{mt:2}},...t&&{header:{...t,sx:{...n,...t.sx}}},...i}))})))}));Oa.displayName="ActionList";const Pa=Object.assign(Oa,{Group:ha,Item:Ra,Divider:wa}),Ma={xsmall:"192px",small:"256px",medium:"320px",large:"432px",xlarge:"600px",auto:"auto",initial:"auto"},Da={small:"256px",medium:"320px",large:"480px",xlarge:"640px",xxlarge:"960px",auto:"auto"};const Fa=s.div`
|
559
558
|
background-color: ${Cr("colors.canvas.overlay")};
|
560
559
|
box-shadow: ${Cr("shadows.overlay.shadow")};
|
561
560
|
position: absolute;
|