@primer/react 38.29.1-rc.4254fa28f → 38.29.1-rc.42909d47c
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 +8 -0
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css +2 -0
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +1 -0
- package/dist/ButtonGroup/ButtonGroup.module.css.js +2 -2
- package/dist/Checkbox/Checkbox-7476a7ba.css +2 -0
- package/dist/Checkbox/Checkbox-7476a7ba.css.map +1 -0
- package/dist/Checkbox/Checkbox.module.css.js +1 -1
- package/dist/DataTable/Pagination-aebe86e8.css +2 -0
- package/dist/DataTable/Pagination-aebe86e8.css.map +1 -0
- package/dist/DataTable/Pagination.module.css.js +1 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +27 -68
- package/dist/Textarea/Textarea.d.ts.map +1 -1
- package/dist/Textarea/Textarea.js +158 -186
- package/dist/_VisuallyHidden.js +2 -2
- package/dist/_VisuallyHidden.module.css.js +2 -2
- package/dist/live-region/Announce.d.ts.map +1 -1
- package/dist/live-region/Announce.js +51 -36
- package/dist/utils/character-counter.d.ts +16 -21
- package/dist/utils/character-counter.d.ts.map +1 -1
- package/dist/utils/character-counter.js +23 -59
- package/package.json +1 -1
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css +0 -2
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css.map +0 -1
- package/dist/Checkbox/Checkbox-edc5dc3e.css +0 -2
- package/dist/Checkbox/Checkbox-edc5dc3e.css.map +0 -1
- package/dist/DataTable/Pagination-b6f8418c.css +0 -2
- package/dist/DataTable/Pagination-b6f8418c.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Announce, AriaStatus, AriaAlert: Avoid an extra React render on every content change (e.g. per keystroke when tied to an input)
|
|
8
|
+
|
|
7
9
|
- [#7935](https://github.com/primer/react/pull/7935) [`5b3c806`](https://github.com/primer/react/commit/5b3c806305cfa09d33d42fc2957d55105725ea3b) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - ConfirmationDialog: `useConfirm`/`confirm` now removes its host element from `document.body` after the dialog is closed, and uses a fresh host element per call, so the empty container no longer lingers or leaks into other components and tests
|
|
8
10
|
|
|
11
|
+
- [#8007](https://github.com/primer/react/pull/8007) [`f052126`](https://github.com/primer/react/commit/f0521263c85a8d665f7c031bd711b3568bdac8e2) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Improve style-recalc performance by making ButtonGroup, DataTable Pagination, and Checkbox CSS selectors bucketable (removing universal `*`/`:not([attr])` subjects and `:is()` selector-list merges)
|
|
12
|
+
|
|
13
|
+
- [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Textarea: Improve typing performance by deriving the character counter in render instead of in effects, removing extra re-renders on each keystroke.
|
|
14
|
+
|
|
15
|
+
- [#8021](https://github.com/primer/react/pull/8021) [`6131a94`](https://github.com/primer/react/commit/6131a9424b5bd5bb98b7ae05771d8187fe2f58cd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - TextInput: Improve typing performance by deriving the character counter in render instead of in effects, removing extra re-renders on each keystroke.
|
|
16
|
+
|
|
9
17
|
## 38.29.0
|
|
10
18
|
|
|
11
19
|
### Minor Changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-ButtonGroup-ButtonGroup-vFUrY{display:inline-flex;isolation:isolate;vertical-align:middle}.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl{margin-inline-end:-1px;position:relative}.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl a,.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl button{border-radius:0}.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:first-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:last-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:active,.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:focus,.prc-ButtonGroup-ButtonGroup-vFUrY>.prc-ButtonGroup-Item-PqvDl:hover{z-index:1}.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) a,.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) button{border-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]{margin-inline-end:-1px;position:relative}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper] a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper] button{border-radius:0}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:active,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:focus,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:hover{z-index:1}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:first-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:last-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}
|
|
2
|
+
/*# sourceMappingURL=ButtonGroup-be1c1123.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ButtonGroup/ButtonGroup.module.css.js"],"names":[],"mappings":"AAAA,mCACE,mBAAoB,CAEpB,iBAAkB,CADlB,qBAgFF,CA7EE,+DAEE,sBAAuB,CACvB,iBA6BF,CA1BE,uIAEE,eACF,CAGE,+JAGE,4DAAqD,CADrD,yDAEF,CAIA,6JAGE,6DAAsD,CADtD,0DAEF,CAGF,gNAGE,SACF,CAMA,mIAEE,gDACF,CAIF,0DAEE,sBAAuB,CACvB,iBA6BF,CA1BE,6HAEE,eACF,CAEA,iMAGE,SACF,CAGE,qJAGE,4DAAqD,CADrD,yDAEF,CAIA,mJAGE,6DAAsD,CADtD,0DAEF","file":"ButtonGroup-be1c1123.css","sourcesContent":[".ButtonGroup {\n display: inline-flex;\n vertical-align: middle;\n isolation: isolate;\n\n & > .Item {\n /* stylelint-disable-next-line primer/spacing */\n margin-inline-end: -1px;\n position: relative;\n\n /* reset border-radius */\n button,\n a {\n border-radius: 0;\n }\n\n &:first-child {\n button,\n a {\n border-top-left-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:last-child {\n button,\n a {\n border-top-right-radius: var(--borderRadius-medium);\n border-bottom-right-radius: var(--borderRadius-medium);\n }\n }\n\n &:focus,\n &:active,\n &:hover {\n z-index: 1;\n }\n }\n\n /* this is a workaround until portal based tooltips are fully removed from dotcom */\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(div:last-child:empty) {\n button,\n a {\n border-radius: var(--borderRadius-medium);\n }\n }\n\n /* if child is loading button */\n & > *[data-loading-wrapper] {\n /* stylelint-disable-next-line primer/spacing */\n margin-inline-end: -1px;\n position: relative;\n\n /* reset border-radius */\n button,\n a {\n border-radius: 0;\n }\n\n &:focus,\n &:active,\n &:hover {\n z-index: 1;\n }\n\n &:first-child {\n button,\n a {\n border-top-left-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:last-child {\n button,\n a {\n border-top-right-radius: var(--borderRadius-medium);\n border-bottom-right-radius: var(--borderRadius-medium);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAKnD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAKnD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,WAAW,EA8BX,8BAA8B,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;AAI7D,eAAe,WAAW,CAAA"}
|
|
@@ -95,6 +95,7 @@ const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(t0, forwa
|
|
|
95
95
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
96
96
|
function _temp(child, index) {
|
|
97
97
|
return /*#__PURE__*/jsx("div", {
|
|
98
|
+
className: classes.Item,
|
|
98
99
|
children: child
|
|
99
100
|
}, index);
|
|
100
101
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './ButtonGroup-
|
|
1
|
+
import './ButtonGroup-be1c1123.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"ButtonGroup":"prc-ButtonGroup-ButtonGroup-vFUrY"};
|
|
3
|
+
var classes = {"ButtonGroup":"prc-ButtonGroup-ButtonGroup-vFUrY","Item":"prc-ButtonGroup-Item-PqvDl"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-Checkbox-Checkbox-jjOgT{border-radius:var(--borderRadius-small,.1875rem);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Checkbox-Checkbox-jjOgT:before{animation:prc-Checkbox-checkmarkOut-mrgEX 80ms cubic-bezier(.65,0,.35,1) forwards;background-color:var(--fgColor-onEmphasis,#fff);clip-path:inset(var(--base-size-16,1rem) 0 0 0);content:"";height:var(--base-size-16,1rem);mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFMNC41MiA4LjU0MWEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");mask-position:center;mask-repeat:no-repeat;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16,1rem)}.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,#0969da);border-color:var(--control-checked-bgColor-rest,#0969da)}@media (forced-colors:active){.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background-color:canvastext;border-color:canvastext}}.prc-Checkbox-Checkbox-jjOgT:checked:before,.prc-Checkbox-Checkbox-jjOgT:indeterminate:before{animation:prc-Checkbox-checkmarkIn-73iWj 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}.prc-Checkbox-Checkbox-jjOgT:checked:disabled,.prc-Checkbox-Checkbox-jjOgT:indeterminate:disabled{background-color:var(--control-checked-bgColor-disabled,#818b98);border-color:var(--control-checked-borderColor-disabled,#818b98);opacity:1}.prc-Checkbox-Checkbox-jjOgT:checked:disabled:before,.prc-Checkbox-Checkbox-jjOgT:indeterminate:disabled:before{background-color:var(--control-checked-fgColor-disabled,#fff)}.prc-Checkbox-Checkbox-jjOgT:disabled{cursor:not-allowed}.prc-Checkbox-Checkbox-jjOgT:checked{transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0s}.prc-Checkbox-Checkbox-jjOgT:checked:before{transition:visibility 0s linear 0s;visibility:visible}.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,#0969da)}.prc-Checkbox-Checkbox-jjOgT:indeterminate:before{mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTAgMiI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCAxYTEgMSAwIDAgMSAxLTFoOGExIDEgMCAxIDEgMCAySDFhMSAxIDAgMCAxLTEtMSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");visibility:visible}.prc-Checkbox-Checkbox-jjOgT:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--focus-outline-color,var(--focus-outlineColor,#0969da));outline-offset:2px}@keyframes prc-Checkbox-checkmarkIn-73iWj{0%{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes prc-Checkbox-checkmarkOut-mrgEX{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}}
|
|
2
|
+
/*# sourceMappingURL=Checkbox-7476a7ba.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Checkbox/Checkbox.module.css.js","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,6BACE,gDAAwC,CAGxC,uEAgFF,CA5EE,oCAaE,iFAAoE,CAPpE,+CAA2C,CAE3C,+CAA2C,CAJ3C,UAAW,CAFX,+BAA2B,CAO3B,ocAA69B,CAG79B,oBAAqB,CADrB,qBAAsB,CADtB,aAAc,CAHd,oCAAsC,CAJtC,iBAAkB,CAFlB,8BAaF,CAEA,gFAEE,sDAA+C,CAI/C,wDAOF,CAJE,8BATF,gFAUI,2BAA4B,CAC5B,uBAEJ,CADE,CAGF,8FAEE,qFACF,CAEA,kGAEE,gEAAyD,CACzD,gEAAyD,CACzD,SACF,CAEA,gHAGE,6DACF,CAEA,sCACE,kBACF,CAEA,qCACE,0EAQF,CAJE,4CAEE,kCAAmC,CADnC,kBAEF,CAGF,2CACE,sDAMF,CAJE,kDACE,wUAAia,CACja,kBACF,CAGF,0DC9EA,eAAgB,CAFhB,8EAAgC,CAChC,kBDiFA,CAGF,0CACE,GACE,+CACF,CAEA,GACE,wBACF,CACF,CAEA,2CACE,GACE,wBACF,CAEA,GACE,+CACF,CACF","file":"Checkbox-7476a7ba.css","sourcesContent":[".Checkbox {\n border-radius: var(--borderRadius-small);\n\n /* checked -> unchecked - add 120ms delay to fully see animation-out */\n transition:\n background-color,\n border-color 80ms cubic-bezier(0.33, 1, 0.68, 1);\n\n &::before {\n width: var(--base-size-16);\n height: var(--base-size-16);\n visibility: hidden;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--fgColor-onEmphasis);\n transition: visibility 0s linear 230ms;\n clip-path: inset(var(--base-size-16) 0 0 0);\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzgwMyAwLjIxOTYyNUMxMS45MjEgMC4zNjA0MjcgMTIgMC41NTEzMDUgMTIgMC43NTAzMTNDMTIgMC45NDkzMjEgMTEuOTIxIDEuMTQwMTkgMTEuNzgwMyAxLjI4MUw0LjUxODYgOC41NDA0MkM0LjM3Nzc1IDguNjgxIDQuMTg2ODIgOC43NiAzLjk4Nzc0IDguNzZDMy43ODg2NyA4Ljc2IDMuNTk3NzMgOC42ODEgMy40NTY4OSA4LjU0MDQyTDAuMjAxNjIyIDUuMjg2MkMwLjA2ODkyNzcgNS4xNDM4MyAtMC4wMDMzMDkwNSA0Ljk1NTU1IDAuMDAwMTE2NDkzIDQuNzYwOThDMC4wMDM1NTIwNSA0LjU2NjQzIDAuMDgyMzg5NCA0LjM4MDgxIDAuMjIwMDMyIDQuMjQzMjFDMC4zNTc2NjUgNC4xMDU2MiAwLjU0MzM1NSA0LjAyNjgxIDAuNzM3OTcgNC4wMjMzOEMwLjkzMjU4NCA0LjAxOTk0IDEuMTIwOTMgNC4wOTIxNyAxLjI2MzM0IDQuMjI0ODJMMy45ODc3NCA2Ljk0ODM1TDEwLjcxODYgMC4yMTk2MjVDMTAuODU5NSAwLjA3ODk5MjMgMTEuMDUwNCAwIDExLjI0OTUgMEMxMS40NDg1IDAgMTEuNjM5NSAwLjA3ODk5MjMgMTEuNzgwMyAwLjIxOTYyNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=');\n mask-size: 75%;\n mask-repeat: no-repeat;\n mask-position: center;\n animation: checkmarkOut 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards;\n }\n\n &:checked,\n &:indeterminate {\n background: var(--control-checked-bgColor-rest);\n\n /* using bgColor here to avoid a border change in dark high contrast */\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--control-checked-bgColor-rest);\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n }\n\n &:checked::before,\n &:indeterminate::before {\n animation: checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards 80ms;\n }\n\n &:checked:disabled,\n &:indeterminate:disabled {\n background-color: var(--control-checked-bgColor-disabled);\n border-color: var(--control-checked-borderColor-disabled);\n opacity: 1;\n }\n\n &:checked:disabled::before,\n &:indeterminate:disabled::before {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--control-checked-fgColor-disabled);\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n &:checked {\n transition:\n background-color,\n border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0ms;\n\n &::before {\n visibility: visible;\n transition: visibility 0s linear 0s;\n }\n }\n\n &:indeterminate {\n background: var(--control-checked-bgColor-rest);\n\n &::before {\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAxQzAgMC40NDc3MTUgMC40NDc3MTUgMCAxIDBIOUM5LjU1MjI5IDAgMTAgMC40NDc3MTUgMTAgMUMxMCAxLjU1MjI4IDkuNTUyMjkgMiA5IDJIMUMwLjQ0NzcxNSAyIDAgMS41NTIyOCAwIDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');\n visibility: visible;\n }\n }\n\n &:focus-visible:not(:disabled) {\n @mixin focusOutline 2px;\n }\n}\n\n@keyframes checkmarkIn {\n from {\n clip-path: inset(var(--base-size-16) 0 0 0);\n }\n\n to {\n clip-path: inset(0 0 0 0);\n }\n}\n\n@keyframes checkmarkOut {\n from {\n clip-path: inset(0 0 0 0);\n }\n\n to {\n clip-path: inset(var(--base-size-16) 0 0 0);\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outline-color, var(--focus-outlineColor)) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-DataTable-TablePagination-AJ0K7{align-items:center;border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);border-end-end-radius:var(--borderRadius-medium,.375rem);border-end-start-radius:var(--borderRadius-medium,.375rem);border-top-width:0;column-gap:1rem;display:flex;grid-area:footer;justify-content:space-between;padding:var(--base-size-8,.5rem) var(--base-size-16,1rem);width:100%}@media ((max-width:calc(768px - 0.02px))){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>li:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>li:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>li:last-child{margin-inline-start:0}}@media ((min-width:768px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>li:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>li:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>li:last-child{margin-inline-start:0}}@media ((min-width:1400px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>li:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>li:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>li:last-child{margin-inline-start:0}}.prc-DataTable-TablePaginationRange-R7KK2{color:var(--fgColor-muted,#59636e);font-size:var(--text-body-size-small,.75rem);margin:0}.prc-DataTable-TablePaginationSteps-Vxbth{align-items:center;color:var(--fgColor-default,#1f2328);display:flex;flex-wrap:wrap;font-size:var(--text-body-size-medium,.875rem);list-style:none;margin:0;padding:0}.prc-DataTable-TablePaginationStep-jdto6:first-of-type{margin-right:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationStep-jdto6:last-of-type{margin-left:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationAction-SPa7Q{align-items:center;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,#59636e);display:flex;font-size:var(--text-body-size-medium,.875rem);line-height:1.42857;padding:var(--base-size-8,.5rem);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]{color:var(--fgColor-accent,#0969da)}.prc-DataTable-TablePaginationPage-Fn3s-{align-items:center;border-radius:var(--borderRadius-medium,.375rem);display:flex;font-size:var(--text-body-size-medium,.875rem);justify-content:center;line-height:1.42857;min-height:2rem;min-width:2rem;padding:var(--base-size-8,.5rem) calc((var(--base-size-32,2rem) - var(--base-size-20,1.25rem))/2);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:focus,.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:hover,.prc-DataTable-TablePaginationPage-Fn3s-:focus,.prc-DataTable-TablePaginationPage-Fn3s-:hover{background-color:var(--control-transparent-bgColor-hover,#818b981a)}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]{background-color:var(--bgColor-accent-emphasis,#0969da);color:var(--fgColor-onEmphasis,#fff)}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]:focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis,#fff);outline:2px solid var(--bgColor-accent-emphasis,#0969da);outline-offset:-2px}.prc-DataTable-TablePaginationTruncationStep-gRyLp{align-items:center;display:flex;justify-content:center;min-height:2rem;min-width:2rem;-webkit-user-select:none;user-select:none}
|
|
2
|
+
/*# sourceMappingURL=Pagination-aebe86e8.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/DataTable/Pagination.module.css.js"],"names":[],"mappings":"AAAA,qCAEE,kBAAmB,CAOnB,gFAAmB,CAEnB,wDAAiD,CADjD,0DAAmD,CADnD,kBAAmB,CALnB,eAAgB,CAHhB,YAAa,CAKb,gBAAiB,CAHjB,6BAA8B,CAI9B,yDAA+C,CAF/C,UAOF,CAEA,0CAEE,qHACE,YACF,CAEA,8FACE,mBACF,CAEA,6FACE,qBACF,CACF,CAEA,2BAEE,sHACE,YACF,CAEA,+FACE,mBACF,CAEA,8FACE,qBACF,CACF,CAEA,4BAEE,mHACE,YACF,CAEA,4FACE,mBACF,CAEA,2FACE,qBACF,CACF,CAEA,0CACE,kCAA2B,CAC3B,4CAAsC,CACtC,QACF,CAEA,0CAEE,kBAAmB,CAGnB,oCAA6B,CAJ7B,YAAa,CAEb,cAAe,CAGf,8CAAuC,CAFvC,eAAgB,CAGhB,QAAS,CACT,SACF,CAEA,uDACE,qCACF,CAEA,sDACE,oCACF,CAEA,2CAEE,kBAAmB,CAOnB,gDAAyC,CANzC,kCAA2B,CAF3B,YAAa,CAGb,8CAAuC,CAEvC,mBAA0B,CAE1B,gCAA2B,CAD3B,wBAAiB,CAAjB,gBAGF,CAEA,0DACE,mCACF,CAEA,yCAIE,kBAAmB,CAMnB,gDAAyC,CAPzC,YAAa,CAGb,8CAAuC,CADvC,sBAAuB,CAGvB,mBAA0B,CAN1B,eAAgB,CADhB,cAAe,CAUf,iGAAiF,CAFjF,wBAAiB,CAAjB,gBAGF,CAEA,8NAIE,mEACF,CAEA,2DACE,uDAAgD,CAChD,oCACF,CAEA,yEAIE,yDAAqD,CAHrD,wDAAiD,CACjD,mBAGF,CAEA,mDAEE,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,eAAgB,CADhB,cAAe,CAEf,wBAAiB,CAAjB,gBACF","file":"Pagination-aebe86e8.css","sourcesContent":[".TablePagination {\n display: flex;\n align-items: center;\n justify-content: space-between;\n column-gap: 1rem;\n width: 100%;\n grid-area: footer;\n padding: var(--base-size-8) var(--base-size-16);\n border: var(--borderWidth-thin) solid var(--borderColor-default);\n border-top-width: 0;\n border-end-start-radius: var(--borderRadius-medium);\n border-end-end-radius: var(--borderRadius-medium);\n}\n\n@media ((max-width: calc(768px - 0.02px))) {\n /* stylelint-disable-next-line selector-max-specificity -- li type subject keeps the selector bucketable for style-recalc perf (github/github-ui#23654) */\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > li:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > li:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > li:last-child {\n margin-inline-start: 0;\n }\n}\n\n@media ((min-width: 768px)) {\n /* stylelint-disable-next-line selector-max-specificity -- li type subject keeps the selector bucketable for style-recalc perf (github/github-ui#23654) */\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > li:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > li:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > li:last-child {\n margin-inline-start: 0;\n }\n}\n\n@media ((min-width: 1400px)) {\n /* stylelint-disable-next-line selector-max-specificity -- li type subject keeps the selector bucketable for style-recalc perf (github/github-ui#23654) */\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > li:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > li:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > li:last-child {\n margin-inline-start: 0;\n }\n}\n\n.TablePaginationRange {\n color: var(--fgColor-muted);\n font-size: var(--text-body-size-small);\n margin: 0;\n}\n\n.TablePaginationSteps {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n list-style: none;\n color: var(--fgColor-default);\n font-size: var(--text-body-size-medium);\n margin: 0;\n padding: 0;\n}\n\n.TablePaginationStep:first-of-type {\n margin-right: var(--base-size-16);\n}\n\n.TablePaginationStep:last-of-type {\n margin-left: var(--base-size-16);\n}\n\n.TablePaginationAction {\n display: flex;\n align-items: center;\n color: var(--fgColor-muted);\n font-size: var(--text-body-size-medium);\n /* stylelint-disable-next-line primer/typography */\n line-height: calc(20 / 14);\n user-select: none;\n padding: var(--base-size-8);\n border-radius: var(--borderRadius-medium);\n}\n\n.TablePaginationAction[data-has-page] {\n color: var(--fgColor-accent);\n}\n\n.TablePaginationPage {\n min-width: 2rem;\n min-height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--text-body-size-medium);\n /* stylelint-disable-next-line primer/typography */\n line-height: calc(20 / 14);\n user-select: none;\n border-radius: var(--borderRadius-medium);\n padding: var(--base-size-8) calc((var(--base-size-32) - var(--base-size-20)) / 2); /* primer.control.medium.paddingInline.condensed primer.control.medium.paddingBlock */\n}\n\n.TablePaginationAction[data-has-page]:hover,\n.TablePaginationAction[data-has-page]:focus,\n.TablePaginationPage:hover,\n.TablePaginationPage:focus {\n background-color: var(--control-transparent-bgColor-hover);\n}\n\n.TablePaginationPage[data-active='true'] {\n background-color: var(--bgColor-accent-emphasis);\n color: var(--fgColor-onEmphasis);\n}\n\n.TablePaginationPage[data-active='true']:focus-visible {\n outline: 2px solid var(--bgColor-accent-emphasis);\n outline-offset: -2px;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 3px var(--fgColor-onEmphasis);\n}\n\n.TablePaginationTruncationStep {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 2rem;\n min-height: 2rem;\n user-select: none;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Pagination-
|
|
1
|
+
import './Pagination-aebe86e8.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"TablePagination":"prc-DataTable-TablePagination-AJ0K7","TablePaginationSteps":"prc-DataTable-TablePaginationSteps-Vxbth","TablePaginationRange":"prc-DataTable-TablePaginationRange-R7KK2","TablePaginationStep":"prc-DataTable-TablePaginationStep-jdto6","TablePaginationAction":"prc-DataTable-TablePaginationAction-SPa7Q","TablePaginationPage":"prc-DataTable-TablePaginationPage-Fn3s-","TablePaginationTruncationStep":"prc-DataTable-TablePaginationTruncationStep-gRyLp"};
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAU/E,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;QAKI;IACJ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IAChD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACnD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACvE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CACT,IAAI,CACF,kBAAkB,EAChB,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,kBAAkB,CACrB,CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAA;;;;;;;;;;;AAyNzG,wBAGE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
import React, { useState, useId, useCallback } from 'react';
|
|
2
2
|
import { isValidElementType } from 'react-is';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { AlertFillIcon } from '@primer/octicons-react';
|
|
@@ -8,9 +8,11 @@ import { TextInputWrapper } from '../internal/components/TextInputWrapper.js';
|
|
|
8
8
|
import TextInputAction from '../internal/components/TextInputInnerAction.js';
|
|
9
9
|
import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
|
|
10
10
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
11
|
-
import
|
|
11
|
+
import visuallyHiddenClasses from '../_VisuallyHidden.module.css.js';
|
|
12
|
+
import { SCREEN_READER_DELAY, getCharacterCountState } from '../utils/character-counter.js';
|
|
12
13
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
14
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
15
|
+
import { AriaStatus } from '../live-region/AriaStatus.js';
|
|
14
16
|
import Text from '../Text/Text.js';
|
|
15
17
|
|
|
16
18
|
// using forwardRef is important so that other components can autofocus the input
|
|
@@ -46,16 +48,22 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
46
48
|
'data-component': dataComponent,
|
|
47
49
|
...inputProps
|
|
48
50
|
}, ref) => {
|
|
51
|
+
var _counter$isOverLimit;
|
|
49
52
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
50
53
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
54
|
+
|
|
55
|
+
// For uncontrolled usage we track the length of the input's content so the
|
|
56
|
+
// character counter can be derived during render rather than synced from an
|
|
57
|
+
// effect (which would trigger an extra render on every keystroke). For
|
|
58
|
+
// controlled usage the `value` prop is the source of truth.
|
|
59
|
+
const isControlled = value !== undefined;
|
|
60
|
+
const [uncontrolledLength, setUncontrolledLength] = useState(() => defaultValue !== undefined ? String(defaultValue).length : 0);
|
|
61
|
+
const currentLength = isControlled ? String(value).length : uncontrolledLength;
|
|
62
|
+
|
|
63
|
+
// The counter and validation state are derived directly from the current
|
|
64
|
+
// length, so they stay in sync with the input without an extra render.
|
|
65
|
+
const counter = characterLimit ? getCharacterCountState(currentLength, characterLimit) : undefined;
|
|
66
|
+
const isOverLimit = (_counter$isOverLimit = counter === null || counter === void 0 ? void 0 : counter.isOverLimit) !== null && _counter$isOverLimit !== void 0 ? _counter$isOverLimit : false;
|
|
59
67
|
|
|
60
68
|
// this class is necessary to style FilterSearch, plz no touchy!
|
|
61
69
|
const wrapperClasses = clsx(className, 'TextInput-wrapper');
|
|
@@ -84,63 +92,13 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
84
92
|
onBlur && onBlur(e_1);
|
|
85
93
|
}, [onBlur]);
|
|
86
94
|
|
|
87
|
-
// Initialize character counter
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
if (characterLimit) {
|
|
90
|
-
characterCounterRef.current = new CharacterCounter({
|
|
91
|
-
onCountUpdate: (count, overLimit, message) => {
|
|
92
|
-
if (message !== lastCharacterCountRef.current) {
|
|
93
|
-
lastCharacterCountRef.current = message;
|
|
94
|
-
setCharacterCount(message);
|
|
95
|
-
}
|
|
96
|
-
if (overLimit !== lastIsOverLimitRef.current) {
|
|
97
|
-
lastIsOverLimitRef.current = overLimit;
|
|
98
|
-
setIsOverLimit(overLimit);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
onScreenReaderAnnounce: message_0 => {
|
|
102
|
-
if (message_0 !== lastScreenReaderMessageRef.current) {
|
|
103
|
-
lastScreenReaderMessageRef.current = message_0;
|
|
104
|
-
setScreenReaderMessage(message_0);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
lastCountedLengthRef.current = null;
|
|
109
|
-
return () => {
|
|
110
|
-
var _characterCounterRef$;
|
|
111
|
-
(_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 ? void 0 : _characterCounterRef$.cleanup();
|
|
112
|
-
characterCounterRef.current = null;
|
|
113
|
-
lastCountedLengthRef.current = null;
|
|
114
|
-
lastCharacterCountRef.current = '';
|
|
115
|
-
lastIsOverLimitRef.current = false;
|
|
116
|
-
lastScreenReaderMessageRef.current = '';
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}, [characterLimit]);
|
|
120
|
-
|
|
121
|
-
// Update character count when value changes or on mount
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (characterLimit && characterCounterRef.current) {
|
|
124
|
-
const currentValue = value !== undefined ? String(value) : defaultValue !== undefined ? String(defaultValue) : '';
|
|
125
|
-
const currentLength = currentValue.length;
|
|
126
|
-
if (currentLength !== lastCountedLengthRef.current) {
|
|
127
|
-
lastCountedLengthRef.current = currentLength;
|
|
128
|
-
characterCounterRef.current.updateCharacterCount(currentLength, characterLimit);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, [value, defaultValue, characterLimit]);
|
|
132
|
-
|
|
133
95
|
// Handle input change with character counter
|
|
134
96
|
const handleInputChange = useCallback(e_2 => {
|
|
135
|
-
if (characterLimit &&
|
|
136
|
-
|
|
137
|
-
if (currentLength_0 !== lastCountedLengthRef.current) {
|
|
138
|
-
lastCountedLengthRef.current = currentLength_0;
|
|
139
|
-
characterCounterRef.current.updateCharacterCount(currentLength_0, characterLimit);
|
|
140
|
-
}
|
|
97
|
+
if (characterLimit && !isControlled) {
|
|
98
|
+
setUncontrolledLength(e_2.target.value.length);
|
|
141
99
|
}
|
|
142
100
|
onChange === null || onChange === void 0 ? void 0 : onChange(e_2);
|
|
143
|
-
}, [onChange, characterLimit]);
|
|
101
|
+
}, [onChange, characterLimit, isControlled]);
|
|
144
102
|
const characterCountId = useId();
|
|
145
103
|
const characterCountStaticMessageId = useId();
|
|
146
104
|
const isValid = isOverLimit ? 'error' : validationStatus;
|
|
@@ -202,10 +160,11 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
202
160
|
children: typeof TrailingVisual !== 'string' && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual
|
|
203
161
|
}), trailingAction]
|
|
204
162
|
}), characterLimit && /*#__PURE__*/jsxs(Fragment, {
|
|
205
|
-
children: [/*#__PURE__*/jsx(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
163
|
+
children: [/*#__PURE__*/jsx(AriaStatus, {
|
|
164
|
+
announceOnShow: false,
|
|
165
|
+
delayMs: SCREEN_READER_DELAY,
|
|
166
|
+
className: visuallyHiddenClasses.InternalVisuallyHidden,
|
|
167
|
+
children: counter === null || counter === void 0 ? void 0 : counter.message
|
|
209
168
|
}), /*#__PURE__*/jsxs(VisuallyHidden, {
|
|
210
169
|
id: characterCountStaticMessageId,
|
|
211
170
|
children: ["You can enter up to ", characterLimit, " ", characterLimit === 1 ? 'character' : 'characters']
|
|
@@ -217,7 +176,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
217
176
|
"data-component": "TextInput.CharacterCounter",
|
|
218
177
|
children: [isOverLimit && /*#__PURE__*/jsx(AlertFillIcon, {
|
|
219
178
|
size: 16
|
|
220
|
-
}),
|
|
179
|
+
}), counter === null || counter === void 0 ? void 0 : counter.message]
|
|
221
180
|
})]
|
|
222
181
|
})]
|
|
223
182
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAe,MAAM,OAAO,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAe,MAAM,OAAO,CAAA;AAC/D,OAAO,KAAqC,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAA;AAE7E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AASlD,eAAO,MAAM,qBAAqB,IAAI,CAAA;AACtC,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,eAAO,MAAM,uBAAuB,SAAS,CAAA;AAE7C,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAA;IACpD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAA;AAE/C;;;GAGG;AACH,QAAA,MAAM,QAAQ;IA/CZ;;OAEG;eACQ,OAAO;IAClB;;OAEG;uBACgB,oBAAoB;IACvC;;OAEG;YACK,OAAO;IACf;;OAEG;aACM,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU;IACpD;;OAEG;eACQ,OAAO;IAClB;;OAEG;gBACS,MAAM;IAClB;;OAEG;gBACS,MAAM;IAClB;;OAEG;gBACS,MAAM;IAClB;;OAEG;YACK,KAAK,CAAC,aAAa;IAC3B;;;OAGG;qBACc,MAAM;2FA6HxB,CAAA;wBAK0B,cAAc,CAAC,OAAO,QAAQ,CAAC;AAA1D,wBAA0D"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useId, useState } from 'react';
|
|
3
3
|
import { TextInputBaseWrapper } from '../internal/components/TextInputWrapper.js';
|
|
4
4
|
import classes from './TextArea.module.css.js';
|
|
5
5
|
import { AlertFillIcon } from '@primer/octicons-react';
|
|
6
|
-
import {
|
|
6
|
+
import { SCREEN_READER_DELAY, getCharacterCountState } from '../utils/character-counter.js';
|
|
7
7
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
8
|
+
import visuallyHiddenClasses from '../_VisuallyHidden.module.css.js';
|
|
8
9
|
import { clsx } from 'clsx';
|
|
9
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
|
+
import { AriaStatus } from '../live-region/AriaStatus.js';
|
|
10
12
|
import Text from '../Text/Text.js';
|
|
11
13
|
|
|
12
14
|
const DEFAULT_TEXTAREA_ROWS = 7;
|
|
@@ -17,7 +19,7 @@ const DEFAULT_TEXTAREA_RESIZE = 'both';
|
|
|
17
19
|
* This component accepts all native HTML <textarea> attributes as props.
|
|
18
20
|
*/
|
|
19
21
|
const Textarea = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
20
|
-
const $ = c(
|
|
22
|
+
const $ = c(76);
|
|
21
23
|
let block;
|
|
22
24
|
let characterLimit;
|
|
23
25
|
let className;
|
|
@@ -95,200 +97,170 @@ const Textarea = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
95
97
|
const rows = t1 === undefined ? DEFAULT_TEXTAREA_ROWS : t1;
|
|
96
98
|
const cols = t2 === undefined ? DEFAULT_TEXTAREA_COLS : t2;
|
|
97
99
|
const resize = t3 === undefined ? DEFAULT_TEXTAREA_RESIZE : t3;
|
|
98
|
-
const [characterCount, setCharacterCount] = React.useState("");
|
|
99
|
-
const [isOverLimit, setIsOverLimit] = React.useState(false);
|
|
100
|
-
const [screenReaderMessage, setScreenReaderMessage] = React.useState("");
|
|
101
|
-
const characterCounterRef = useRef(null);
|
|
102
100
|
const characterCountId = useId();
|
|
103
101
|
const characterCountStaticMessageId = useId();
|
|
102
|
+
const isControlled = value !== undefined;
|
|
104
103
|
let t4;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (characterLimit) {
|
|
109
|
-
characterCounterRef.current = new CharacterCounter({
|
|
110
|
-
onCountUpdate: (count, overLimit, message) => {
|
|
111
|
-
setCharacterCount(message);
|
|
112
|
-
setIsOverLimit(overLimit);
|
|
113
|
-
},
|
|
114
|
-
onScreenReaderAnnounce: message_0 => {
|
|
115
|
-
setScreenReaderMessage(message_0);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
return () => {
|
|
119
|
-
var _characterCounterRef$;
|
|
120
|
-
(_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 ? void 0 : _characterCounterRef$.cleanup();
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
t5 = [characterLimit];
|
|
125
|
-
$[18] = characterLimit;
|
|
104
|
+
if ($[18] !== defaultValue) {
|
|
105
|
+
t4 = () => defaultValue !== undefined ? String(defaultValue).length : 0;
|
|
106
|
+
$[18] = defaultValue;
|
|
126
107
|
$[19] = t4;
|
|
127
|
-
$[20] = t5;
|
|
128
108
|
} else {
|
|
129
109
|
t4 = $[19];
|
|
130
|
-
t5 = $[20];
|
|
131
|
-
}
|
|
132
|
-
useEffect(t4, t5);
|
|
133
|
-
let t6;
|
|
134
|
-
let t7;
|
|
135
|
-
if ($[21] !== characterLimit || $[22] !== defaultValue || $[23] !== value) {
|
|
136
|
-
t6 = () => {
|
|
137
|
-
if (characterLimit && characterCounterRef.current) {
|
|
138
|
-
const currentValue = value !== undefined ? String(value) : defaultValue !== undefined ? String(defaultValue) : "";
|
|
139
|
-
characterCounterRef.current.updateCharacterCount(currentValue.length, characterLimit);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
t7 = [value, defaultValue, characterLimit];
|
|
143
|
-
$[21] = characterLimit;
|
|
144
|
-
$[22] = defaultValue;
|
|
145
|
-
$[23] = value;
|
|
146
|
-
$[24] = t6;
|
|
147
|
-
$[25] = t7;
|
|
148
|
-
} else {
|
|
149
|
-
t6 = $[24];
|
|
150
|
-
t7 = $[25];
|
|
151
|
-
}
|
|
152
|
-
useEffect(t6, t7);
|
|
153
|
-
let t8;
|
|
154
|
-
if ($[26] !== characterLimit || $[27] !== onChange) {
|
|
155
|
-
t8 = e => {
|
|
156
|
-
var _onChange;
|
|
157
|
-
if (characterLimit && characterCounterRef.current) {
|
|
158
|
-
characterCounterRef.current.updateCharacterCount(e.target.value.length, characterLimit);
|
|
159
|
-
}
|
|
160
|
-
(_onChange = onChange) === null || _onChange === void 0 ? void 0 : _onChange(e);
|
|
161
|
-
};
|
|
162
|
-
$[26] = characterLimit;
|
|
163
|
-
$[27] = onChange;
|
|
164
|
-
$[28] = t8;
|
|
165
|
-
} else {
|
|
166
|
-
t8 = $[28];
|
|
167
|
-
}
|
|
168
|
-
const handleTextareaChange = t8;
|
|
169
|
-
const isValid = isOverLimit ? "error" : validationStatus;
|
|
170
|
-
const t9 = isValid === "error" ? "true" : "false";
|
|
171
|
-
let t10;
|
|
172
|
-
if ($[29] !== maxHeight || $[30] !== minHeight || $[31] !== style) {
|
|
173
|
-
t10 = {
|
|
174
|
-
minHeight,
|
|
175
|
-
maxHeight,
|
|
176
|
-
...style
|
|
177
|
-
};
|
|
178
|
-
$[29] = maxHeight;
|
|
179
|
-
$[30] = minHeight;
|
|
180
|
-
$[31] = style;
|
|
181
|
-
$[32] = t10;
|
|
182
|
-
} else {
|
|
183
|
-
t10 = $[32];
|
|
184
|
-
}
|
|
185
|
-
let t11;
|
|
186
|
-
if ($[33] !== characterCountStaticMessageId || $[34] !== characterLimit || $[35] !== rest) {
|
|
187
|
-
t11 = characterLimit ? [characterCountStaticMessageId, rest["aria-describedby"]].filter(Boolean).join(" ") || undefined : rest["aria-describedby"];
|
|
188
|
-
$[33] = characterCountStaticMessageId;
|
|
189
|
-
$[34] = characterLimit;
|
|
190
|
-
$[35] = rest;
|
|
191
|
-
$[36] = t11;
|
|
192
|
-
} else {
|
|
193
|
-
t11 = $[36];
|
|
194
110
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
$[
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
$[57]
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"aria-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
111
|
+
const [uncontrolledLength, setUncontrolledLength] = useState(t4);
|
|
112
|
+
const currentLength = isControlled ? String(value).length : uncontrolledLength;
|
|
113
|
+
let t5;
|
|
114
|
+
if ($[20] !== block || $[21] !== characterCountId || $[22] !== characterCountStaticMessageId || $[23] !== characterLimit || $[24] !== className || $[25] !== cols || $[26] !== contrast || $[27] !== currentLength || $[28] !== defaultValue || $[29] !== disabled || $[30] !== isControlled || $[31] !== maxHeight || $[32] !== minHeight || $[33] !== onChange || $[34] !== ref || $[35] !== required || $[36] !== resize || $[37] !== rest || $[38] !== rows || $[39] !== style || $[40] !== validationStatus || $[41] !== value) {
|
|
115
|
+
var _counter$isOverLimit;
|
|
116
|
+
const counter = characterLimit ? getCharacterCountState(currentLength, characterLimit) : undefined;
|
|
117
|
+
const isOverLimit = (_counter$isOverLimit = counter === null || counter === void 0 ? void 0 : counter.isOverLimit) !== null && _counter$isOverLimit !== void 0 ? _counter$isOverLimit : false;
|
|
118
|
+
let t6;
|
|
119
|
+
if ($[43] !== characterLimit || $[44] !== isControlled || $[45] !== onChange) {
|
|
120
|
+
t6 = e => {
|
|
121
|
+
var _onChange;
|
|
122
|
+
if (characterLimit && !isControlled) {
|
|
123
|
+
setUncontrolledLength(e.target.value.length);
|
|
124
|
+
}
|
|
125
|
+
(_onChange = onChange) === null || _onChange === void 0 ? void 0 : _onChange(e);
|
|
126
|
+
};
|
|
127
|
+
$[43] = characterLimit;
|
|
128
|
+
$[44] = isControlled;
|
|
129
|
+
$[45] = onChange;
|
|
130
|
+
$[46] = t6;
|
|
131
|
+
} else {
|
|
132
|
+
t6 = $[46];
|
|
133
|
+
}
|
|
134
|
+
const handleTextareaChange = t6;
|
|
135
|
+
const isValid = isOverLimit ? "error" : validationStatus;
|
|
136
|
+
const t7 = isValid === "error" ? "true" : "false";
|
|
137
|
+
let t8;
|
|
138
|
+
if ($[47] !== maxHeight || $[48] !== minHeight || $[49] !== style) {
|
|
139
|
+
t8 = {
|
|
140
|
+
minHeight,
|
|
141
|
+
maxHeight,
|
|
142
|
+
...style
|
|
143
|
+
};
|
|
144
|
+
$[47] = maxHeight;
|
|
145
|
+
$[48] = minHeight;
|
|
146
|
+
$[49] = style;
|
|
147
|
+
$[50] = t8;
|
|
148
|
+
} else {
|
|
149
|
+
t8 = $[50];
|
|
150
|
+
}
|
|
151
|
+
let t9;
|
|
152
|
+
if ($[51] !== characterCountStaticMessageId || $[52] !== characterLimit || $[53] !== rest) {
|
|
153
|
+
t9 = characterLimit ? [characterCountStaticMessageId, rest["aria-describedby"]].filter(Boolean).join(" ") || undefined : rest["aria-describedby"];
|
|
154
|
+
$[51] = characterCountStaticMessageId;
|
|
155
|
+
$[52] = characterLimit;
|
|
156
|
+
$[53] = rest;
|
|
157
|
+
$[54] = t9;
|
|
158
|
+
} else {
|
|
159
|
+
t9 = $[54];
|
|
160
|
+
}
|
|
161
|
+
let t10;
|
|
162
|
+
if ($[55] !== cols || $[56] !== defaultValue || $[57] !== disabled || $[58] !== handleTextareaChange || $[59] !== ref || $[60] !== required || $[61] !== resize || $[62] !== rest || $[63] !== rows || $[64] !== t7 || $[65] !== t8 || $[66] !== t9 || $[67] !== value) {
|
|
163
|
+
t10 = /*#__PURE__*/jsx("textarea", {
|
|
164
|
+
value: value,
|
|
165
|
+
defaultValue: defaultValue,
|
|
166
|
+
"data-resize": resize,
|
|
167
|
+
"aria-required": required,
|
|
168
|
+
"aria-invalid": t7,
|
|
169
|
+
ref: ref,
|
|
170
|
+
disabled: disabled,
|
|
171
|
+
rows: rows,
|
|
172
|
+
cols: cols,
|
|
173
|
+
className: classes.TextArea,
|
|
174
|
+
onChange: handleTextareaChange,
|
|
175
|
+
style: t8,
|
|
176
|
+
...rest,
|
|
177
|
+
"aria-describedby": t9
|
|
178
|
+
});
|
|
179
|
+
$[55] = cols;
|
|
180
|
+
$[56] = defaultValue;
|
|
181
|
+
$[57] = disabled;
|
|
182
|
+
$[58] = handleTextareaChange;
|
|
183
|
+
$[59] = ref;
|
|
184
|
+
$[60] = required;
|
|
185
|
+
$[61] = resize;
|
|
186
|
+
$[62] = rest;
|
|
187
|
+
$[63] = rows;
|
|
188
|
+
$[64] = t7;
|
|
189
|
+
$[65] = t8;
|
|
190
|
+
$[66] = t9;
|
|
191
|
+
$[67] = value;
|
|
192
|
+
$[68] = t10;
|
|
193
|
+
} else {
|
|
194
|
+
t10 = $[68];
|
|
195
|
+
}
|
|
196
|
+
let t11;
|
|
197
|
+
if ($[69] !== block || $[70] !== className || $[71] !== contrast || $[72] !== disabled || $[73] !== isValid || $[74] !== t10) {
|
|
198
|
+
t11 = /*#__PURE__*/jsx(TextInputBaseWrapper, {
|
|
199
|
+
validationStatus: isValid,
|
|
200
|
+
disabled: disabled,
|
|
201
|
+
block: block,
|
|
202
|
+
contrast: contrast,
|
|
203
|
+
className: className,
|
|
204
|
+
children: t10
|
|
205
|
+
});
|
|
206
|
+
$[69] = block;
|
|
207
|
+
$[70] = className;
|
|
208
|
+
$[71] = contrast;
|
|
209
|
+
$[72] = disabled;
|
|
210
|
+
$[73] = isValid;
|
|
211
|
+
$[74] = t10;
|
|
212
|
+
$[75] = t11;
|
|
213
|
+
} else {
|
|
214
|
+
t11 = $[75];
|
|
215
|
+
}
|
|
216
|
+
t5 = /*#__PURE__*/jsxs(Fragment, {
|
|
217
|
+
children: [t11, characterLimit && /*#__PURE__*/jsxs(Fragment, {
|
|
218
|
+
children: [/*#__PURE__*/jsx(AriaStatus, {
|
|
219
|
+
announceOnShow: false,
|
|
220
|
+
delayMs: SCREEN_READER_DELAY,
|
|
221
|
+
className: visuallyHiddenClasses.InternalVisuallyHidden,
|
|
222
|
+
children: counter === null || counter === void 0 ? void 0 : counter.message
|
|
223
|
+
}), /*#__PURE__*/jsxs(VisuallyHidden, {
|
|
224
|
+
id: characterCountStaticMessageId,
|
|
225
|
+
children: ["You can enter up to ", characterLimit, " ", characterLimit === 1 ? "character" : "characters"]
|
|
226
|
+
}), /*#__PURE__*/jsxs(Text, {
|
|
227
|
+
"aria-hidden": "true",
|
|
228
|
+
id: characterCountId,
|
|
229
|
+
size: "small",
|
|
230
|
+
className: clsx(classes.CharacterCounter, isOverLimit && classes["CharacterCounter--error"]),
|
|
231
|
+
children: [isOverLimit && /*#__PURE__*/jsx(AlertFillIcon, {
|
|
232
|
+
size: 16
|
|
233
|
+
}), counter === null || counter === void 0 ? void 0 : counter.message]
|
|
234
|
+
})]
|
|
268
235
|
})]
|
|
269
236
|
});
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
237
|
+
$[20] = block;
|
|
238
|
+
$[21] = characterCountId;
|
|
239
|
+
$[22] = characterCountStaticMessageId;
|
|
240
|
+
$[23] = characterLimit;
|
|
241
|
+
$[24] = className;
|
|
242
|
+
$[25] = cols;
|
|
243
|
+
$[26] = contrast;
|
|
244
|
+
$[27] = currentLength;
|
|
245
|
+
$[28] = defaultValue;
|
|
246
|
+
$[29] = disabled;
|
|
247
|
+
$[30] = isControlled;
|
|
248
|
+
$[31] = maxHeight;
|
|
249
|
+
$[32] = minHeight;
|
|
250
|
+
$[33] = onChange;
|
|
251
|
+
$[34] = ref;
|
|
252
|
+
$[35] = required;
|
|
253
|
+
$[36] = resize;
|
|
254
|
+
$[37] = rest;
|
|
255
|
+
$[38] = rows;
|
|
256
|
+
$[39] = style;
|
|
257
|
+
$[40] = validationStatus;
|
|
258
|
+
$[41] = value;
|
|
259
|
+
$[42] = t5;
|
|
288
260
|
} else {
|
|
289
|
-
|
|
261
|
+
t5 = $[42];
|
|
290
262
|
}
|
|
291
|
-
return
|
|
263
|
+
return t5;
|
|
292
264
|
});
|
|
293
265
|
Textarea.displayName = 'Textarea';
|
|
294
266
|
Textarea.__SLOT__ = Symbol('Textarea');
|
package/dist/_VisuallyHidden.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import
|
|
2
|
+
import visuallyHiddenClasses from './_VisuallyHidden.module.css.js';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -36,7 +36,7 @@ function VisuallyHidden(t0) {
|
|
|
36
36
|
let t2;
|
|
37
37
|
if ($[6] !== className || $[7] !== t1) {
|
|
38
38
|
t2 = clsx(className, {
|
|
39
|
-
[
|
|
39
|
+
[visuallyHiddenClasses.InternalVisuallyHidden]: t1
|
|
40
40
|
});
|
|
41
41
|
$[6] = className;
|
|
42
42
|
$[7] = t1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './_VisuallyHidden-1f156b61.css';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var visuallyHiddenClasses = {"InternalVisuallyHidden":"prc-src-InternalVisuallyHidden-2YaI6"};
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export { visuallyHiddenClasses as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Announce.d.ts","sourceRoot":"","sources":["../../src/live-region/Announce.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAEjE,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,gBAAgB,CACxE,EAAE,EACF,KAAK,EACL;IACE;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAA;CACpC,CACF,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"Announce.d.ts","sourceRoot":"","sources":["../../src/live-region/Announce.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAEjE,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,gBAAgB,CACxE,EAAE,EACF,KAAK,EACL;IACE;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAA;CACpC,CACF,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,qBAsGtF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { announceFromElement } from '@primer/live-region-element';
|
|
3
|
-
import { useRef,
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
4
|
import { useEffectOnce } from '../internal/hooks/useEffectOnce.js';
|
|
5
5
|
import { useEffectCallback } from '../internal/hooks/useEffectCallback.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -11,7 +11,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
11
11
|
* will also announce any changes to the text content of `children`
|
|
12
12
|
*/
|
|
13
13
|
function Announce(props) {
|
|
14
|
-
const $ = c(
|
|
14
|
+
const $ = c(24);
|
|
15
15
|
let children;
|
|
16
16
|
let delayMs;
|
|
17
17
|
let rest;
|
|
@@ -51,10 +51,10 @@ function Announce(props) {
|
|
|
51
51
|
const hidden = t2 === undefined ? false : t2;
|
|
52
52
|
const politeness = t3 === undefined ? "polite" : t3;
|
|
53
53
|
const ref = useRef(null);
|
|
54
|
-
const
|
|
54
|
+
const previousAnnouncementText = useRef(null);
|
|
55
55
|
const savedAnnouncement = useRef(null);
|
|
56
56
|
let t4;
|
|
57
|
-
if ($[8] !== delayMs || $[9] !== hidden || $[10] !== politeness
|
|
57
|
+
if ($[8] !== delayMs || $[9] !== hidden || $[10] !== politeness) {
|
|
58
58
|
t4 = () => {
|
|
59
59
|
var _savedAnnouncement$cu;
|
|
60
60
|
const {
|
|
@@ -70,14 +70,10 @@ function Announce(props) {
|
|
|
70
70
|
if (!textContent) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
if (textContent === previousAnnouncementText) {
|
|
73
|
+
if (textContent === previousAnnouncementText.current) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
if (style.display === "none") {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (style.visibility === "hidden") {
|
|
76
|
+
if (!isVisible(element)) {
|
|
81
77
|
return;
|
|
82
78
|
}
|
|
83
79
|
(_savedAnnouncement$cu = savedAnnouncement.current) === null || _savedAnnouncement$cu === void 0 ? void 0 : _savedAnnouncement$cu.cancel();
|
|
@@ -87,34 +83,33 @@ function Announce(props) {
|
|
|
87
83
|
politeness,
|
|
88
84
|
delayMs
|
|
89
85
|
});
|
|
90
|
-
|
|
86
|
+
previousAnnouncementText.current = textContent;
|
|
91
87
|
};
|
|
92
88
|
$[8] = delayMs;
|
|
93
89
|
$[9] = hidden;
|
|
94
90
|
$[10] = politeness;
|
|
95
|
-
$[11] =
|
|
96
|
-
$[12] = t4;
|
|
91
|
+
$[11] = t4;
|
|
97
92
|
} else {
|
|
98
|
-
t4 = $[
|
|
93
|
+
t4 = $[11];
|
|
99
94
|
}
|
|
100
95
|
const announce = useEffectCallback(t4);
|
|
101
96
|
let t5;
|
|
102
|
-
if ($[
|
|
97
|
+
if ($[12] !== announce || $[13] !== announceOnShow) {
|
|
103
98
|
t5 = () => {
|
|
104
99
|
if (announceOnShow) {
|
|
105
100
|
announce();
|
|
106
101
|
}
|
|
107
102
|
};
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
103
|
+
$[12] = announce;
|
|
104
|
+
$[13] = announceOnShow;
|
|
105
|
+
$[14] = t5;
|
|
111
106
|
} else {
|
|
112
|
-
t5 = $[
|
|
107
|
+
t5 = $[14];
|
|
113
108
|
}
|
|
114
109
|
useEffectOnce(t5);
|
|
115
110
|
let t6;
|
|
116
111
|
let t7;
|
|
117
|
-
if ($[
|
|
112
|
+
if ($[15] !== announce) {
|
|
118
113
|
t6 = () => {
|
|
119
114
|
const {
|
|
120
115
|
current: container
|
|
@@ -135,17 +130,17 @@ function Announce(props) {
|
|
|
135
130
|
};
|
|
136
131
|
};
|
|
137
132
|
t7 = [announce];
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
133
|
+
$[15] = announce;
|
|
134
|
+
$[16] = t6;
|
|
135
|
+
$[17] = t7;
|
|
141
136
|
} else {
|
|
142
|
-
t6 = $[
|
|
143
|
-
t7 = $[
|
|
137
|
+
t6 = $[16];
|
|
138
|
+
t7 = $[17];
|
|
144
139
|
}
|
|
145
140
|
useEffect(t6, t7);
|
|
146
141
|
let t8;
|
|
147
142
|
let t9;
|
|
148
|
-
if ($[
|
|
143
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
149
144
|
t8 = () => () => {
|
|
150
145
|
if (savedAnnouncement.current !== null) {
|
|
151
146
|
savedAnnouncement.current.cancel();
|
|
@@ -153,26 +148,26 @@ function Announce(props) {
|
|
|
153
148
|
}
|
|
154
149
|
};
|
|
155
150
|
t9 = [];
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
151
|
+
$[18] = t8;
|
|
152
|
+
$[19] = t9;
|
|
158
153
|
} else {
|
|
159
|
-
t8 = $[
|
|
160
|
-
t9 = $[
|
|
154
|
+
t8 = $[18];
|
|
155
|
+
t9 = $[19];
|
|
161
156
|
}
|
|
162
157
|
useEffect(t8, t9);
|
|
163
158
|
let t10;
|
|
164
|
-
if ($[
|
|
159
|
+
if ($[20] !== BaseComponent || $[21] !== children || $[22] !== rest) {
|
|
165
160
|
t10 = /*#__PURE__*/jsx(BaseComponent, {
|
|
166
161
|
...rest,
|
|
167
162
|
ref: ref,
|
|
168
163
|
children: children
|
|
169
164
|
});
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
165
|
+
$[20] = BaseComponent;
|
|
166
|
+
$[21] = children;
|
|
167
|
+
$[22] = rest;
|
|
168
|
+
$[23] = t10;
|
|
174
169
|
} else {
|
|
175
|
-
t10 = $[
|
|
170
|
+
t10 = $[23];
|
|
176
171
|
}
|
|
177
172
|
return t10;
|
|
178
173
|
}
|
|
@@ -186,4 +181,24 @@ function getTextContent(element) {
|
|
|
186
181
|
return value ? value.trim() : '';
|
|
187
182
|
}
|
|
188
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Determine if an element is visible (not hidden via `display: none` or
|
|
186
|
+
* `visibility: hidden`). Prefers the native `checkVisibility()` API when
|
|
187
|
+
* available and falls back to `getComputedStyle` for older browsers.
|
|
188
|
+
*/
|
|
189
|
+
function isVisible(element) {
|
|
190
|
+
if (typeof element.checkVisibility === 'function') {
|
|
191
|
+
return element.checkVisibility({
|
|
192
|
+
// `visibilityProperty` is the standard option name (Chrome 116+, Firefox
|
|
193
|
+
// 125+, Safari 17.4+); `checkVisibilityCSS` is the legacy Chromium name
|
|
194
|
+
// (Chrome 105+). Unknown options are ignored, so passing both ensures
|
|
195
|
+
// `visibility: hidden` is treated as not visible across all engines.
|
|
196
|
+
visibilityProperty: true,
|
|
197
|
+
checkVisibilityCSS: true
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
const style = window.getComputedStyle(element);
|
|
201
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
202
|
+
}
|
|
203
|
+
|
|
189
204
|
export { Announce };
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared character counting
|
|
3
|
-
*
|
|
2
|
+
* Shared character counting helpers for text inputs with character limits.
|
|
3
|
+
* Provides the pure derivation used to render the counter and validation state.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
onScreenReaderAnnounce: (message: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare class CharacterCounter {
|
|
10
|
-
private announceTimeout;
|
|
11
|
-
private callbacks;
|
|
12
|
-
private isInitialLoad;
|
|
13
|
-
constructor(callbacks: CharacterCounterCallbacks);
|
|
14
|
-
/**
|
|
15
|
-
* Update the character count based on current input value
|
|
16
|
-
*/
|
|
17
|
-
updateCharacterCount(currentLength: number, maxLength: number): void;
|
|
5
|
+
export declare const SCREEN_READER_DELAY = 500;
|
|
6
|
+
export interface CharacterCountState {
|
|
18
7
|
/**
|
|
19
|
-
*
|
|
8
|
+
* Number of characters remaining before the limit is reached, or the number of
|
|
9
|
+
* characters over the limit when it has been exceeded.
|
|
20
10
|
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
count: number;
|
|
12
|
+
/** Whether the current length exceeds the limit. */
|
|
13
|
+
isOverLimit: boolean;
|
|
14
|
+
/** Human readable description of the remaining or over count. */
|
|
15
|
+
message: string;
|
|
26
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Compute the character count state for a given length and limit. This is a pure
|
|
19
|
+
* function so the counter can be derived during render without component state.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCharacterCountState(currentLength: number, maxLength: number): CharacterCountState;
|
|
27
22
|
//# sourceMappingURL=character-counter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character-counter.d.ts","sourceRoot":"","sources":["../../src/utils/character-counter.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"character-counter.d.ts","sourceRoot":"","sources":["../../src/utils/character-counter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAEtC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,WAAW,EAAE,OAAO,CAAA;IACpB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAmBpG"}
|
|
@@ -1,66 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared character counting
|
|
3
|
-
*
|
|
2
|
+
* Shared character counting helpers for text inputs with character limits.
|
|
3
|
+
* Provides the pure derivation used to render the counter and validation state.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const SCREEN_READER_DELAY = 500;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
let message = '';
|
|
21
|
-
if (charactersRemaining >= 0) {
|
|
22
|
-
const characterText = charactersRemaining === 1 ? 'character' : 'characters';
|
|
23
|
-
message = `${charactersRemaining} ${characterText} remaining`;
|
|
24
|
-
this.callbacks.onCountUpdate(charactersRemaining, false, message);
|
|
25
|
-
} else {
|
|
26
|
-
const charactersOver = -charactersRemaining;
|
|
27
|
-
const characterText = charactersOver === 1 ? 'character' : 'characters';
|
|
28
|
-
message = `${charactersOver} ${characterText} over`;
|
|
29
|
-
this.callbacks.onCountUpdate(charactersOver, true, message);
|
|
30
|
-
}
|
|
31
|
-
if (!this.isInitialLoad) {
|
|
32
|
-
this.announceToScreenReader(message);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// After first update, set isInitialLoad to false
|
|
36
|
-
if (this.isInitialLoad) {
|
|
37
|
-
this.isInitialLoad = false;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Announce character count to screen readers with debouncing
|
|
43
|
-
*/
|
|
44
|
-
announceToScreenReader(message) {
|
|
45
|
-
if (this.announceTimeout) {
|
|
46
|
-
clearTimeout(this.announceTimeout);
|
|
47
|
-
}
|
|
48
|
-
if (typeof window === 'undefined' || typeof window.setTimeout !== 'function') {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.announceTimeout = window.setTimeout(() => {
|
|
52
|
-
this.callbacks.onScreenReaderAnnounce(message);
|
|
53
|
-
}, SCREEN_READER_DELAY);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Clean up any pending timeouts
|
|
58
|
-
*/
|
|
59
|
-
cleanup() {
|
|
60
|
-
if (this.announceTimeout) {
|
|
61
|
-
clearTimeout(this.announceTimeout);
|
|
62
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* Compute the character count state for a given length and limit. This is a pure
|
|
9
|
+
* function so the counter can be derived during render without component state.
|
|
10
|
+
*/
|
|
11
|
+
function getCharacterCountState(currentLength, maxLength) {
|
|
12
|
+
const charactersRemaining = maxLength - currentLength;
|
|
13
|
+
if (charactersRemaining >= 0) {
|
|
14
|
+
const characterText = charactersRemaining === 1 ? 'character' : 'characters';
|
|
15
|
+
return {
|
|
16
|
+
count: charactersRemaining,
|
|
17
|
+
isOverLimit: false,
|
|
18
|
+
message: `${charactersRemaining} ${characterText} remaining`
|
|
19
|
+
};
|
|
63
20
|
}
|
|
21
|
+
const charactersOver = -charactersRemaining;
|
|
22
|
+
const characterText = charactersOver === 1 ? 'character' : 'characters';
|
|
23
|
+
return {
|
|
24
|
+
count: charactersOver,
|
|
25
|
+
isOverLimit: true,
|
|
26
|
+
message: `${charactersOver} ${characterText} over`
|
|
27
|
+
};
|
|
64
28
|
}
|
|
65
29
|
|
|
66
|
-
export {
|
|
30
|
+
export { SCREEN_READER_DELAY, getCharacterCountState };
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-ButtonGroup-ButtonGroup-vFUrY{display:inline-flex;isolation:isolate;vertical-align:middle}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]){margin-inline-end:-1px;position:relative}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]) a,.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]) button{border-radius:0}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):first-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):last-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):active,.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):focus,.prc-ButtonGroup-ButtonGroup-vFUrY>:not([data-loading-wrapper]):hover{z-index:1}.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) a,.prc-ButtonGroup-ButtonGroup-vFUrY:has(div:last-child:empty) button{border-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]{margin-inline-end:-1px;position:relative}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper] a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper] button{border-radius:0}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:active,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:focus,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:hover{z-index:1}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:first-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:first-child button{border-bottom-left-radius:var(--borderRadius-medium,.375rem);border-top-left-radius:var(--borderRadius-medium,.375rem)}.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:last-child a,.prc-ButtonGroup-ButtonGroup-vFUrY>[data-loading-wrapper]:last-child button{border-bottom-right-radius:var(--borderRadius-medium,.375rem);border-top-right-radius:var(--borderRadius-medium,.375rem)}
|
|
2
|
-
/*# sourceMappingURL=ButtonGroup-54ba293b.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ButtonGroup/ButtonGroup.module.css.js"],"names":[],"mappings":"AAAA,mCACE,mBAAoB,CAEpB,iBAAkB,CADlB,qBAgFF,CA7EE,gEAEE,sBAAuB,CACvB,iBA6BF,CA1BE,yIAEE,eACF,CAGE,iKAGE,4DAAqD,CADrD,yDAEF,CAIA,+JAGE,6DAAsD,CADtD,0DAEF,CAGF,mNAGE,SACF,CAMA,mIAEE,gDACF,CAIF,0DAEE,sBAAuB,CACvB,iBA6BF,CA1BE,6HAEE,eACF,CAEA,iMAGE,SACF,CAGE,qJAGE,4DAAqD,CADrD,yDAEF,CAIA,mJAGE,6DAAsD,CADtD,0DAEF","file":"ButtonGroup-54ba293b.css","sourcesContent":[".ButtonGroup {\n display: inline-flex;\n vertical-align: middle;\n isolation: isolate;\n\n & > *:not([data-loading-wrapper]) {\n /* stylelint-disable-next-line primer/spacing */\n margin-inline-end: -1px;\n position: relative;\n\n /* reset border-radius */\n button,\n a {\n border-radius: 0;\n }\n\n &:first-child {\n button,\n a {\n border-top-left-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:last-child {\n button,\n a {\n border-top-right-radius: var(--borderRadius-medium);\n border-bottom-right-radius: var(--borderRadius-medium);\n }\n }\n\n &:focus,\n &:active,\n &:hover {\n z-index: 1;\n }\n }\n\n /* this is a workaround until portal based tooltips are fully removed from dotcom */\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(div:last-child:empty) {\n button,\n a {\n border-radius: var(--borderRadius-medium);\n }\n }\n\n /* if child is loading button */\n & > *[data-loading-wrapper] {\n /* stylelint-disable-next-line primer/spacing */\n margin-inline-end: -1px;\n position: relative;\n\n /* reset border-radius */\n button,\n a {\n border-radius: 0;\n }\n\n &:focus,\n &:active,\n &:hover {\n z-index: 1;\n }\n\n &:first-child {\n button,\n a {\n border-top-left-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:last-child {\n button,\n a {\n border-top-right-radius: var(--borderRadius-medium);\n border-bottom-right-radius: var(--borderRadius-medium);\n }\n }\n }\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-Checkbox-Checkbox-jjOgT{border-radius:var(--borderRadius-small,.1875rem);transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1)}.prc-Checkbox-Checkbox-jjOgT:before{animation:prc-Checkbox-checkmarkOut-mrgEX 80ms cubic-bezier(.65,0,.35,1) forwards;background-color:var(--fgColor-onEmphasis,#fff);clip-path:inset(var(--base-size-16,1rem) 0 0 0);content:"";height:var(--base-size-16,1rem);mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFMNC41MiA4LjU0MWEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");mask-position:center;mask-repeat:no-repeat;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16,1rem)}.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,#0969da);border-color:var(--control-checked-bgColor-rest,#0969da)}.prc-Checkbox-Checkbox-jjOgT:checked:before{animation:prc-Checkbox-checkmarkIn-73iWj 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}.prc-Checkbox-Checkbox-jjOgT:indeterminate:before{animation:prc-Checkbox-checkmarkIn-73iWj 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}.prc-Checkbox-Checkbox-jjOgT:checked:disabled{background-color:var(--control-checked-bgColor-disabled,#818b98);border-color:var(--control-checked-borderColor-disabled,#818b98);opacity:1}.prc-Checkbox-Checkbox-jjOgT:indeterminate:disabled{background-color:var(--control-checked-bgColor-disabled,#818b98);border-color:var(--control-checked-borderColor-disabled,#818b98);opacity:1}.prc-Checkbox-Checkbox-jjOgT:checked:disabled:before{background-color:var(--control-checked-fgColor-disabled,#fff)}.prc-Checkbox-Checkbox-jjOgT:indeterminate:disabled:before{background-color:var(--control-checked-fgColor-disabled,#fff)}@media (forced-colors:active){.prc-Checkbox-Checkbox-jjOgT:checked,.prc-Checkbox-Checkbox-jjOgT:indeterminate{background-color:canvastext;border-color:canvastext}}.prc-Checkbox-Checkbox-jjOgT:disabled{cursor:not-allowed}.prc-Checkbox-Checkbox-jjOgT:checked{transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0s}.prc-Checkbox-Checkbox-jjOgT:checked:before{transition:visibility 0s linear 0s;visibility:visible}.prc-Checkbox-Checkbox-jjOgT:indeterminate{background:var(--control-checked-bgColor-rest,#0969da)}.prc-Checkbox-Checkbox-jjOgT:indeterminate:before{mask-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTAgMiI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCAxYTEgMSAwIDAgMSAxLTFoOGExIDEgMCAxIDEgMCAySDFhMSAxIDAgMCAxLTEtMSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");visibility:visible}.prc-Checkbox-Checkbox-jjOgT:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--focus-outline-color,var(--focus-outlineColor,#0969da));outline-offset:2px}@keyframes prc-Checkbox-checkmarkIn-73iWj{0%{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes prc-Checkbox-checkmarkOut-mrgEX{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,1rem) 0 0 0)}}
|
|
2
|
-
/*# sourceMappingURL=Checkbox-edc5dc3e.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Checkbox/Checkbox.module.css.js","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,6BACE,gDAAwC,CAGxC,uEA6EF,CAzEE,oCAaE,iFAAoE,CAPpE,+CAA2C,CAE3C,+CAA2C,CAJ3C,UAAW,CAFX,+BAA2B,CAO3B,ocAA69B,CAG79B,oBAAqB,CADrB,qBAAsB,CADtB,aAAc,CAHd,oCAAsC,CAJtC,iBAAkB,CAFlB,8BAaF,CAEA,gFAEE,sDAA+C,CAI/C,wDAsBF,CApBE,4CACE,qFACF,CAFA,kDACE,qFACF,CAEA,8CACE,gEAAyD,CACzD,gEAAyD,CACzD,SAMF,CATA,oDACE,gEAAyD,CACzD,gEAAyD,CACzD,SAMF,CAJE,qDAEE,6DACF,CAHA,2DAEE,6DACF,CAIF,8BAxBF,gFAyBI,2BAA4B,CAC5B,uBAEJ,CADE,CAGF,sCACE,kBACF,CAEA,qCACE,0EAQF,CAJE,4CAEE,kCAAmC,CADnC,kBAEF,CAGF,2CACE,sDAMF,CAJE,kDACE,wUAAia,CACja,kBACF,CAGF,0DC3EA,eAAgB,CAFhB,8EAAgC,CAChC,kBD8EA,CAGF,0CACE,GACE,+CACF,CAEA,GACE,wBACF,CACF,CAEA,2CACE,GACE,wBACF,CAEA,GACE,+CACF,CACF","file":"Checkbox-edc5dc3e.css","sourcesContent":[".Checkbox {\n border-radius: var(--borderRadius-small);\n\n /* checked -> unchecked - add 120ms delay to fully see animation-out */\n transition:\n background-color,\n border-color 80ms cubic-bezier(0.33, 1, 0.68, 1);\n\n &::before {\n width: var(--base-size-16);\n height: var(--base-size-16);\n visibility: hidden;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--fgColor-onEmphasis);\n transition: visibility 0s linear 230ms;\n clip-path: inset(var(--base-size-16) 0 0 0);\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzgwMyAwLjIxOTYyNUMxMS45MjEgMC4zNjA0MjcgMTIgMC41NTEzMDUgMTIgMC43NTAzMTNDMTIgMC45NDkzMjEgMTEuOTIxIDEuMTQwMTkgMTEuNzgwMyAxLjI4MUw0LjUxODYgOC41NDA0MkM0LjM3Nzc1IDguNjgxIDQuMTg2ODIgOC43NiAzLjk4Nzc0IDguNzZDMy43ODg2NyA4Ljc2IDMuNTk3NzMgOC42ODEgMy40NTY4OSA4LjU0MDQyTDAuMjAxNjIyIDUuMjg2MkMwLjA2ODkyNzcgNS4xNDM4MyAtMC4wMDMzMDkwNSA0Ljk1NTU1IDAuMDAwMTE2NDkzIDQuNzYwOThDMC4wMDM1NTIwNSA0LjU2NjQzIDAuMDgyMzg5NCA0LjM4MDgxIDAuMjIwMDMyIDQuMjQzMjFDMC4zNTc2NjUgNC4xMDU2MiAwLjU0MzM1NSA0LjAyNjgxIDAuNzM3OTcgNC4wMjMzOEMwLjkzMjU4NCA0LjAxOTk0IDEuMTIwOTMgNC4wOTIxNyAxLjI2MzM0IDQuMjI0ODJMMy45ODc3NCA2Ljk0ODM1TDEwLjcxODYgMC4yMTk2MjVDMTAuODU5NSAwLjA3ODk5MjMgMTEuMDUwNCAwIDExLjI0OTUgMEMxMS40NDg1IDAgMTEuNjM5NSAwLjA3ODk5MjMgMTEuNzgwMyAwLjIxOTYyNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=');\n mask-size: 75%;\n mask-repeat: no-repeat;\n mask-position: center;\n animation: checkmarkOut 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards;\n }\n\n &:checked,\n &:indeterminate {\n background: var(--control-checked-bgColor-rest);\n\n /* using bgColor here to avoid a border change in dark high contrast */\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--control-checked-bgColor-rest);\n\n &::before {\n animation: checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards 80ms;\n }\n\n &:disabled {\n background-color: var(--control-checked-bgColor-disabled);\n border-color: var(--control-checked-borderColor-disabled);\n opacity: 1;\n\n &::before {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--control-checked-fgColor-disabled);\n }\n }\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n &:checked {\n transition:\n background-color,\n border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0ms;\n\n &::before {\n visibility: visible;\n transition: visibility 0s linear 0s;\n }\n }\n\n &:indeterminate {\n background: var(--control-checked-bgColor-rest);\n\n &::before {\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAxQzAgMC40NDc3MTUgMC40NDc3MTUgMCAxIDBIOUM5LjU1MjI5IDAgMTAgMC40NDc3MTUgMTAgMUMxMCAxLjU1MjI4IDkuNTUyMjkgMiA5IDJIMUMwLjQ0NzcxNSAyIDAgMS41NTIyOCAwIDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');\n visibility: visible;\n }\n }\n\n &:focus-visible:not(:disabled) {\n @mixin focusOutline 2px;\n }\n}\n\n@keyframes checkmarkIn {\n from {\n clip-path: inset(var(--base-size-16) 0 0 0);\n }\n\n to {\n clip-path: inset(0 0 0 0);\n }\n}\n\n@keyframes checkmarkOut {\n from {\n clip-path: inset(0 0 0 0);\n }\n\n to {\n clip-path: inset(var(--base-size-16) 0 0 0);\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outline-color, var(--focus-outlineColor)) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-DataTable-TablePagination-AJ0K7{align-items:center;border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);border-end-end-radius:var(--borderRadius-medium,.375rem);border-end-start-radius:var(--borderRadius-medium,.375rem);border-top-width:0;column-gap:1rem;display:flex;grid-area:footer;justify-content:space-between;padding:var(--base-size-8,.5rem) var(--base-size-16,1rem);width:100%}@media ((max-width:calc(768px - 0.02px))){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=narrow]>:last-child{margin-inline-start:0}}@media ((min-width:768px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=regular]>:last-child{margin-inline-start:0}}@media ((min-width:1400px)){.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:not(:first-child):not(:last-child){display:none}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:first-child{margin-inline-end:0}.prc-DataTable-TablePaginationSteps-Vxbth[data-hidden-viewport-ranges*=wide]>:last-child{margin-inline-start:0}}.prc-DataTable-TablePaginationRange-R7KK2{color:var(--fgColor-muted,#59636e);font-size:var(--text-body-size-small,.75rem);margin:0}.prc-DataTable-TablePaginationSteps-Vxbth{align-items:center;color:var(--fgColor-default,#1f2328);display:flex;flex-wrap:wrap;font-size:var(--text-body-size-medium,.875rem);list-style:none;margin:0;padding:0}.prc-DataTable-TablePaginationStep-jdto6:first-of-type{margin-right:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationStep-jdto6:last-of-type{margin-left:var(--base-size-16,1rem)}.prc-DataTable-TablePaginationAction-SPa7Q{align-items:center;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,#59636e);display:flex;font-size:var(--text-body-size-medium,.875rem);line-height:1.42857;padding:var(--base-size-8,.5rem);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]{color:var(--fgColor-accent,#0969da)}.prc-DataTable-TablePaginationPage-Fn3s-{align-items:center;border-radius:var(--borderRadius-medium,.375rem);display:flex;font-size:var(--text-body-size-medium,.875rem);justify-content:center;line-height:1.42857;min-height:2rem;min-width:2rem;padding:var(--base-size-8,.5rem) calc((var(--base-size-32,2rem) - var(--base-size-20,1.25rem))/2);-webkit-user-select:none;user-select:none}.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:focus,.prc-DataTable-TablePaginationAction-SPa7Q[data-has-page]:hover,.prc-DataTable-TablePaginationPage-Fn3s-:focus,.prc-DataTable-TablePaginationPage-Fn3s-:hover{background-color:var(--control-transparent-bgColor-hover,#818b981a)}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]{background-color:var(--bgColor-accent-emphasis,#0969da);color:var(--fgColor-onEmphasis,#fff)}.prc-DataTable-TablePaginationPage-Fn3s-[data-active=true]:focus-visible{box-shadow:inset 0 0 0 3px var(--fgColor-onEmphasis,#fff);outline:2px solid var(--bgColor-accent-emphasis,#0969da);outline-offset:-2px}.prc-DataTable-TablePaginationTruncationStep-gRyLp{align-items:center;display:flex;justify-content:center;min-height:2rem;min-width:2rem;-webkit-user-select:none;user-select:none}
|
|
2
|
-
/*# sourceMappingURL=Pagination-b6f8418c.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DataTable/Pagination.module.css.js"],"names":[],"mappings":"AAAA,qCAEE,kBAAmB,CAOnB,gFAAmB,CAEnB,wDAAiD,CADjD,0DAAmD,CADnD,kBAAmB,CALnB,eAAgB,CAHhB,YAAa,CAKb,gBAAiB,CAHjB,6BAA8B,CAI9B,yDAA+C,CAF/C,UAOF,CAEA,0CACE,mHACE,YACF,CAEA,4FACE,mBACF,CAEA,2FACE,qBACF,CACF,CAEA,2BACE,oHACE,YACF,CAEA,6FACE,mBACF,CAEA,4FACE,qBACF,CACF,CAEA,4BACE,iHACE,YACF,CAEA,0FACE,mBACF,CAEA,yFACE,qBACF,CACF,CAEA,0CACE,kCAA2B,CAC3B,4CAAsC,CACtC,QACF,CAEA,0CAEE,kBAAmB,CAGnB,oCAA6B,CAJ7B,YAAa,CAEb,cAAe,CAGf,8CAAuC,CAFvC,eAAgB,CAGhB,QAAS,CACT,SACF,CAEA,uDACE,qCACF,CAEA,sDACE,oCACF,CAEA,2CAEE,kBAAmB,CAOnB,gDAAyC,CANzC,kCAA2B,CAF3B,YAAa,CAGb,8CAAuC,CAEvC,mBAA0B,CAE1B,gCAA2B,CAD3B,wBAAiB,CAAjB,gBAGF,CAEA,0DACE,mCACF,CAEA,yCAIE,kBAAmB,CAMnB,gDAAyC,CAPzC,YAAa,CAGb,8CAAuC,CADvC,sBAAuB,CAGvB,mBAA0B,CAN1B,eAAgB,CADhB,cAAe,CAUf,iGAAiF,CAFjF,wBAAiB,CAAjB,gBAGF,CAEA,8NAIE,mEACF,CAEA,2DACE,uDAAgD,CAChD,oCACF,CAEA,yEAIE,yDAAqD,CAHrD,wDAAiD,CACjD,mBAGF,CAEA,mDAEE,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,eAAgB,CADhB,cAAe,CAEf,wBAAiB,CAAjB,gBACF","file":"Pagination-b6f8418c.css","sourcesContent":[".TablePagination {\n display: flex;\n align-items: center;\n justify-content: space-between;\n column-gap: 1rem;\n width: 100%;\n grid-area: footer;\n padding: var(--base-size-8) var(--base-size-16);\n border: var(--borderWidth-thin) solid var(--borderColor-default);\n border-top-width: 0;\n border-end-start-radius: var(--borderRadius-medium);\n border-end-end-radius: var(--borderRadius-medium);\n}\n\n@media ((max-width: calc(768px - 0.02px))) {\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:last-child {\n margin-inline-start: 0;\n }\n}\n\n@media ((min-width: 768px)) {\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:last-child {\n margin-inline-start: 0;\n }\n}\n\n@media ((min-width: 1400px)) {\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:not(:first-child):not(:last-child) {\n display: none;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:first-child {\n margin-inline-end: 0;\n }\n\n .TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:last-child {\n margin-inline-start: 0;\n }\n}\n\n.TablePaginationRange {\n color: var(--fgColor-muted);\n font-size: var(--text-body-size-small);\n margin: 0;\n}\n\n.TablePaginationSteps {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n list-style: none;\n color: var(--fgColor-default);\n font-size: var(--text-body-size-medium);\n margin: 0;\n padding: 0;\n}\n\n.TablePaginationStep:first-of-type {\n margin-right: var(--base-size-16);\n}\n\n.TablePaginationStep:last-of-type {\n margin-left: var(--base-size-16);\n}\n\n.TablePaginationAction {\n display: flex;\n align-items: center;\n color: var(--fgColor-muted);\n font-size: var(--text-body-size-medium);\n /* stylelint-disable-next-line primer/typography */\n line-height: calc(20 / 14);\n user-select: none;\n padding: var(--base-size-8);\n border-radius: var(--borderRadius-medium);\n}\n\n.TablePaginationAction[data-has-page] {\n color: var(--fgColor-accent);\n}\n\n.TablePaginationPage {\n min-width: 2rem;\n min-height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--text-body-size-medium);\n /* stylelint-disable-next-line primer/typography */\n line-height: calc(20 / 14);\n user-select: none;\n border-radius: var(--borderRadius-medium);\n padding: var(--base-size-8) calc((var(--base-size-32) - var(--base-size-20)) / 2); /* primer.control.medium.paddingInline.condensed primer.control.medium.paddingBlock */\n}\n\n.TablePaginationAction[data-has-page]:hover,\n.TablePaginationAction[data-has-page]:focus,\n.TablePaginationPage:hover,\n.TablePaginationPage:focus {\n background-color: var(--control-transparent-bgColor-hover);\n}\n\n.TablePaginationPage[data-active='true'] {\n background-color: var(--bgColor-accent-emphasis);\n color: var(--fgColor-onEmphasis);\n}\n\n.TablePaginationPage[data-active='true']:focus-visible {\n outline: 2px solid var(--bgColor-accent-emphasis);\n outline-offset: -2px;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 3px var(--fgColor-onEmphasis);\n}\n\n.TablePaginationTruncationStep {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 2rem;\n min-height: 2rem;\n user-select: none;\n}\n"]}
|