@primer/react 0.0.0-20260304213041 → 0.0.0-20260304223602
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 +5 -3
- package/dist/Dialog/Dialog-2d417a89.css +2 -0
- package/dist/Dialog/Dialog-2d417a89.css.map +1 -0
- package/dist/Dialog/Dialog.d.ts +11 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +10 -1
- package/dist/Dialog/Dialog.module.css.js +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +262 -331
- package/dist/Timeline/{Timeline-116393ee.css → Timeline-19bef8c5.css} +2 -2
- package/dist/Timeline/{Timeline-116393ee.css.map → Timeline-19bef8c5.css.map} +1 -1
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/generated/components.json +21 -0
- package/package.json +1 -1
- package/dist/Dialog/Dialog-b8e961f6.css +0 -2
- package/dist/Dialog/Dialog-b8e961f6.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260304223602
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- [#7524](https://github.com/primer/react/pull/7524) [`f7bdd1c`](https://github.com/primer/react/commit/f7bdd1c04f8cbb17b6a913ba55f7d0855c8eebf1) Thanks [@francinelucca](https://github.com/francinelucca)! - chore: always render ActionMenu in viewport when inside Dialog under feature flag
|
|
8
8
|
|
|
9
|
+
- [#7594](https://github.com/primer/react/pull/7594) [`1e54bdf`](https://github.com/primer/react/commit/1e54bdf72c9466f23c567cfdc73b7b5c243782a4) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Add `align` and `style` props to Dialog component
|
|
10
|
+
|
|
9
11
|
### Patch Changes
|
|
10
12
|
|
|
11
13
|
- Fake entry to force publishing
|
|
@@ -14,9 +16,9 @@
|
|
|
14
16
|
|
|
15
17
|
- Improves initial render performance for `ActionBar`
|
|
16
18
|
|
|
17
|
-
- [#
|
|
19
|
+
- [#7617](https://github.com/primer/react/pull/7617) [`79c855a`](https://github.com/primer/react/commit/79c855abeb6f46d3fefafb236f00ea65dfcd1ed4) Thanks [@llastflowers](https://github.com/llastflowers)! - Push margin-top of TimelineBody +1px
|
|
18
20
|
|
|
19
|
-
- [#
|
|
21
|
+
- [#7550](https://github.com/primer/react/pull/7550) [`9585669`](https://github.com/primer/react/commit/958566907a580b54b484ff2339b32315b8a3b4b7) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Spinner): replace Web Animations API with CSS animation-delay sync
|
|
20
22
|
|
|
21
23
|
- [#7588](https://github.com/primer/react/pull/7588) [`e649da3`](https://github.com/primer/react/commit/e649da3c89b38f477fb574acf5bb06a49b41ee9d) Thanks [@lukasoppermann](https://github.com/lukasoppermann)! - ToggleSwitch: Updated with a 1px space around the knob to work better with updated primitives.
|
|
22
24
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-align=top]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-align=center]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-align=bottom]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=top]{align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=center]{align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=bottom]{align-items:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=top]{margin-top:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=bottom]{margin-bottom:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk){--can-scroll:0}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}
|
|
2
|
+
/*# sourceMappingURL=Dialog-2d417a89.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,m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ialog-2d417a89.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n /* align only applies when regular position is center (or absent).\n * :where() zeroes out the :not() specificity so narrow-position rules (coming later)\n * always win when data-position-narrow is bottom or fullscreen. */\n &:where(:not([data-position-regular='left']):not([data-position-regular='right'])) {\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n\n /* align still applies when narrow position is center */\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n /* align margins only apply when regular position is center */\n &[data-align='top'] {\n margin-top: var(--base-size-64);\n }\n\n &[data-align='bottom'] {\n margin-bottom: var(--base-size-64);\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n /* reset align margins since position wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n /* reset align margins since fullscreen wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog:has(.Footer) {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -100,6 +100,13 @@ export interface DialogProps {
|
|
|
100
100
|
* The position of the dialog
|
|
101
101
|
*/
|
|
102
102
|
position?: 'center' | 'left' | 'right' | ResponsiveValue<'left' | 'right' | 'bottom' | 'fullscreen' | 'center'>;
|
|
103
|
+
/**
|
|
104
|
+
* The vertical alignment of the dialog. Only applies when position is 'center' (the default).
|
|
105
|
+
* top: positions the Dialog ~4rem from the top of the screen, horizontally centered
|
|
106
|
+
* center: (default) vertically centers the Dialog on the screen
|
|
107
|
+
* bottom: positions the Dialog near the bottom of the screen, horizontally centered
|
|
108
|
+
*/
|
|
109
|
+
align?: 'top' | 'center' | 'bottom';
|
|
103
110
|
/**
|
|
104
111
|
* Return focus to this element when the Dialog closes,
|
|
105
112
|
* instead of the element that had focus immediately before the Dialog opened
|
|
@@ -113,6 +120,10 @@ export interface DialogProps {
|
|
|
113
120
|
* Additional class names to apply to the dialog
|
|
114
121
|
*/
|
|
115
122
|
className?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Additional styles to apply to the dialog
|
|
125
|
+
*/
|
|
126
|
+
style?: React.CSSProperties;
|
|
116
127
|
}
|
|
117
128
|
/**
|
|
118
129
|
* Props that are passed to a component that serves as a dialog header
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAW1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAQ/F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC7D;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAExD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAElF;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAA;IAE1E;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CA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H,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAEpD;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAErD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAGD,QAAA,MAAM,SAAS;;;;CAIL,CAAA;AAGV,QAAA,MAAM,QAAQ;;;;;CAKJ,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAA;AAC/C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,SAAS,CAAA;AA+CjD,eAAO,MAAM,aAAa,mCAAqD,CAAA;AAwP/E,eAAO,MAAM,MAAM;;;;;;;;;;iBAhEuC,iBAAiB,EAAE;;;iBAkCf,MAAM,IAAI;;CAuCtE,CAAA"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -91,9 +91,11 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
91
91
|
height = 'auto',
|
|
92
92
|
footerButtons = defaultFooterButtons,
|
|
93
93
|
position = defaultPosition,
|
|
94
|
+
align,
|
|
94
95
|
returnFocusRef,
|
|
95
96
|
initialFocusRef,
|
|
96
|
-
className
|
|
97
|
+
className,
|
|
98
|
+
style
|
|
97
99
|
} = props;
|
|
98
100
|
const dialogLabelId = useId();
|
|
99
101
|
const dialogDescriptionId = useId();
|
|
@@ -179,6 +181,9 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
179
181
|
ref: backdropRef,
|
|
180
182
|
className: classes.Backdrop,
|
|
181
183
|
...positionDataAttributes,
|
|
184
|
+
...(align && {
|
|
185
|
+
'data-align': align
|
|
186
|
+
}),
|
|
182
187
|
onClick: onBackdropClick,
|
|
183
188
|
onMouseDown: e => {
|
|
184
189
|
setLastMouseDownIsBackdrop(e.target === e.currentTarget);
|
|
@@ -190,9 +195,13 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
190
195
|
"aria-describedby": dialogDescriptionId,
|
|
191
196
|
"aria-modal": true,
|
|
192
197
|
...positionDataAttributes,
|
|
198
|
+
...(align && {
|
|
199
|
+
'data-align': align
|
|
200
|
+
}),
|
|
193
201
|
"data-width": width,
|
|
194
202
|
"data-height": height,
|
|
195
203
|
className: clsx(className, classes.Dialog),
|
|
204
|
+
style: style,
|
|
196
205
|
children: [header, /*#__PURE__*/jsx(ScrollableRegion, {
|
|
197
206
|
"aria-labelledby": dialogLabelId,
|
|
198
207
|
className: classes.DialogOverflowWrapper,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Dialog-
|
|
1
|
+
import './Dialog-2d417a89.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"Backdrop":"prc-Dialog-Backdrop-5Nt2U","dialog-backdrop-appear":"prc-Dialog-dialog-backdrop-appear-tCG2K","Dialog":"prc-Dialog-Dialog-G8cDF","Overlay--motion-scaleFade":"prc-Dialog-Overlay--motion-scaleFade-mE6-C","Overlay--motion-slideInRight":"prc-Dialog-Overlay--motion-slideInRight-BR-CZ","Overlay--motion-slideInLeft":"prc-Dialog-Overlay--motion-slideInLeft-ISmQZ","Overlay--motion-slideUp":"prc-Dialog-Overlay--motion-slideUp-tPElO","DisableScroll":"prc-Dialog-DisableScroll-UkWFM","DialogOverflowWrapper":"prc-Dialog-DialogOverflowWrapper-JvHzz","Footer":"prc-Dialog-Footer-PMeQk","detect-scroll":"prc-Dialog-detect-scroll-b3i8Q","Header":"prc-Dialog-Header-f7Me-","HeaderInner":"prc-Dialog-HeaderInner-H-fFY","HeaderContent":"prc-Dialog-HeaderContent-mjAsn","Title":"prc-Dialog-Title-M-iPn","Subtitle":"prc-Dialog-Subtitle-aBFSq","Body":"prc-Dialog-Body-bB903"};
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputWithTokens.d.ts","sourceRoot":"","sources":["../../src/TextInputWithTokens/TextInputWithTokens.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6D,SAAS,EAAC,MAAM,OAAO,CAAA;AAChG,OAAO,KAAyB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TextInputWithTokens.d.ts","sourceRoot":"","sources":["../../src/TextInputWithTokens/TextInputWithTokens.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6D,SAAS,EAAC,MAAM,OAAO,CAAA;AAChG,OAAO,KAAyB,MAAM,OAAO,CAAA;AAK7C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAQrD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAGlD,KAAK,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;AAI1E;;GAEG;AACH,MAAM,MAAM,wBAAwB,CAAC,kBAAkB,SAAS,iBAAiB,GAAG,OAAO,KAAK,IAAI;IAClG;;OAEG;IACH,MAAM,EAAE,kBAAkB,SAAS,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,UAAU,CAAC,CAAC,GAC7F,UAAU,EAAE,GACZ,KAAK,CAAA;IACT;;OAEG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IACjD;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAA;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;IAC5C;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AA6QhC,QAAA,MAAM,mBAAmB;IAhTvB;;OAEG;;;;;;;;;;IAIH;;OAEG;mBACY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI;IACjD;;OAEG;;IAEH;;;OAGG;gBACS,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC;IAC5C;;OAEG;2BACoB,OAAO;IAC9B;;OAEG;WACI,aAAa;IACpB;;OAEG;6BACsB,OAAO;IAChC;;OAEG;wBACiB,MAAM;yEA8QmD,CAAA;AAK/E;;GAEG;wBACmC,cAAc,CAAC,OAAO,mBAAmB,CAAC;AAAhF,wBAAgF"}
|
|
@@ -5,9 +5,7 @@ import React, { useRef, useState } from 'react';
|
|
|
5
5
|
import { isValidElementType } from 'react-is';
|
|
6
6
|
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
7
7
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
8
|
-
import { useId } from '../hooks/useId.js';
|
|
9
8
|
import Token from '../Token/Token.js';
|
|
10
|
-
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
11
9
|
import { TextInputWrapper } from '../internal/components/TextInputWrapper.js';
|
|
12
10
|
import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
|
|
13
11
|
import TextInputInnerVisualSlot from '../internal/components/TextInputInnerVisualSlot.js';
|
|
@@ -25,7 +23,7 @@ const overflowCountClassMap = {
|
|
|
25
23
|
|
|
26
24
|
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
|
27
25
|
function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
28
|
-
const $ = c(
|
|
26
|
+
const $ = c(135);
|
|
29
27
|
let IconComponent;
|
|
30
28
|
let LeadingVisual;
|
|
31
29
|
let TrailingVisual;
|
|
@@ -133,77 +131,46 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
133
131
|
const preventTokenWrapping = t3 === undefined ? false : t3;
|
|
134
132
|
const size = t4 === undefined ? "xlarge" : t4;
|
|
135
133
|
const hideTokenRemoveButtons = t5 === undefined ? false : t5;
|
|
136
|
-
let ariaDescribedByProp;
|
|
137
134
|
let inputPropsRest;
|
|
138
135
|
let onBlur;
|
|
139
136
|
let onFocus;
|
|
140
137
|
let onKeyDown;
|
|
141
|
-
let role;
|
|
142
138
|
if ($[25] !== rest) {
|
|
143
139
|
({
|
|
144
140
|
onBlur,
|
|
145
141
|
onFocus,
|
|
146
142
|
onKeyDown,
|
|
147
|
-
"aria-describedby": ariaDescribedByProp,
|
|
148
|
-
role,
|
|
149
143
|
...inputPropsRest
|
|
150
144
|
} = rest);
|
|
151
145
|
$[25] = rest;
|
|
152
|
-
$[26] =
|
|
153
|
-
$[27] =
|
|
154
|
-
$[28] =
|
|
155
|
-
$[29] =
|
|
156
|
-
$[30] = onKeyDown;
|
|
157
|
-
$[31] = role;
|
|
146
|
+
$[26] = inputPropsRest;
|
|
147
|
+
$[27] = onBlur;
|
|
148
|
+
$[28] = onFocus;
|
|
149
|
+
$[29] = onKeyDown;
|
|
158
150
|
} else {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
onKeyDown = $[30];
|
|
164
|
-
role = $[31];
|
|
151
|
+
inputPropsRest = $[26];
|
|
152
|
+
onBlur = $[27];
|
|
153
|
+
onFocus = $[28];
|
|
154
|
+
onKeyDown = $[29];
|
|
165
155
|
}
|
|
166
156
|
const ref = useRef(null);
|
|
167
|
-
const selectedValuesDescriptionId = useId();
|
|
168
157
|
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
169
158
|
const [selectedTokenIndex, setSelectedTokenIndex] = useState();
|
|
170
159
|
const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
|
|
171
160
|
let t6;
|
|
172
|
-
if ($[
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
$[
|
|
176
|
-
$[33] = t6;
|
|
161
|
+
if ($[30] !== selectedTokenIndex) {
|
|
162
|
+
t6 = [selectedTokenIndex];
|
|
163
|
+
$[30] = selectedTokenIndex;
|
|
164
|
+
$[31] = t6;
|
|
177
165
|
} else {
|
|
178
|
-
t6 = $[
|
|
179
|
-
}
|
|
180
|
-
const selectedValuesDescription = t6;
|
|
181
|
-
const shouldExposeSelectedValuesDescription = role === "combobox" && Boolean(selectedValuesDescription);
|
|
182
|
-
const t7 = shouldExposeSelectedValuesDescription ? selectedValuesDescriptionId : undefined;
|
|
183
|
-
let t8;
|
|
184
|
-
if ($[34] !== ariaDescribedByProp || $[35] !== t7) {
|
|
185
|
-
t8 = [ariaDescribedByProp, t7].filter(Boolean);
|
|
186
|
-
$[34] = ariaDescribedByProp;
|
|
187
|
-
$[35] = t7;
|
|
188
|
-
$[36] = t8;
|
|
189
|
-
} else {
|
|
190
|
-
t8 = $[36];
|
|
191
|
-
}
|
|
192
|
-
const ariaDescribedBy = t8.join(" ");
|
|
193
|
-
let t9;
|
|
194
|
-
if ($[37] !== selectedTokenIndex) {
|
|
195
|
-
t9 = [selectedTokenIndex];
|
|
196
|
-
$[37] = selectedTokenIndex;
|
|
197
|
-
$[38] = t9;
|
|
198
|
-
} else {
|
|
199
|
-
t9 = $[38];
|
|
166
|
+
t6 = $[31];
|
|
200
167
|
}
|
|
201
168
|
const {
|
|
202
|
-
containerRef:
|
|
169
|
+
containerRef: t7
|
|
203
170
|
} = useFocusZone({
|
|
204
171
|
focusOutBehavior: "wrap",
|
|
205
172
|
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
206
|
-
focusableElementFilter:
|
|
173
|
+
focusableElementFilter: _temp,
|
|
207
174
|
getNextFocusable: direction => {
|
|
208
175
|
var _containerRef$current;
|
|
209
176
|
if (!selectedTokenIndex && selectedTokenIndex !== 0) {
|
|
@@ -221,16 +188,16 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
221
188
|
}
|
|
222
189
|
return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
|
|
223
190
|
}
|
|
224
|
-
},
|
|
225
|
-
const containerRef =
|
|
226
|
-
let
|
|
227
|
-
if ($[
|
|
228
|
-
|
|
191
|
+
}, t6);
|
|
192
|
+
const containerRef = t7;
|
|
193
|
+
let t8;
|
|
194
|
+
if ($[32] !== containerRef || $[33] !== onTokenRemove || $[34] !== selectedTokenIndex) {
|
|
195
|
+
t8 = tokenId => {
|
|
229
196
|
onTokenRemove(tokenId);
|
|
230
197
|
setTimeout(() => {
|
|
231
198
|
var _containerRef$current2, _containerRef$current3;
|
|
232
199
|
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0];
|
|
233
|
-
const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(
|
|
200
|
+
const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(_temp2);
|
|
234
201
|
if (firstFocusable) {
|
|
235
202
|
firstFocusable.focus();
|
|
236
203
|
} else {
|
|
@@ -239,30 +206,30 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
239
206
|
}
|
|
240
207
|
}, 0);
|
|
241
208
|
};
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
209
|
+
$[32] = containerRef;
|
|
210
|
+
$[33] = onTokenRemove;
|
|
211
|
+
$[34] = selectedTokenIndex;
|
|
212
|
+
$[35] = t8;
|
|
246
213
|
} else {
|
|
247
|
-
|
|
214
|
+
t8 = $[35];
|
|
248
215
|
}
|
|
249
|
-
const handleTokenRemove =
|
|
250
|
-
let
|
|
251
|
-
if ($[
|
|
252
|
-
|
|
216
|
+
const handleTokenRemove = t8;
|
|
217
|
+
let t9;
|
|
218
|
+
if ($[36] !== disabled) {
|
|
219
|
+
t9 = tokenIndex => () => {
|
|
253
220
|
if (!disabled) {
|
|
254
221
|
setSelectedTokenIndex(tokenIndex);
|
|
255
222
|
}
|
|
256
223
|
};
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
224
|
+
$[36] = disabled;
|
|
225
|
+
$[37] = t9;
|
|
259
226
|
} else {
|
|
260
|
-
|
|
227
|
+
t9 = $[37];
|
|
261
228
|
}
|
|
262
|
-
const handleTokenFocus =
|
|
263
|
-
let
|
|
264
|
-
if ($[
|
|
265
|
-
|
|
229
|
+
const handleTokenFocus = t9;
|
|
230
|
+
let t10;
|
|
231
|
+
if ($[38] !== containerRef || $[39] !== visibleTokenCount) {
|
|
232
|
+
t10 = () => {
|
|
266
233
|
setSelectedTokenIndex(undefined);
|
|
267
234
|
setTimeout(() => {
|
|
268
235
|
var _containerRef$current4;
|
|
@@ -271,43 +238,43 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
271
238
|
}
|
|
272
239
|
}, 0);
|
|
273
240
|
};
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
241
|
+
$[38] = containerRef;
|
|
242
|
+
$[39] = visibleTokenCount;
|
|
243
|
+
$[40] = t10;
|
|
277
244
|
} else {
|
|
278
|
-
|
|
245
|
+
t10 = $[40];
|
|
279
246
|
}
|
|
280
|
-
const handleTokenBlur =
|
|
281
|
-
let
|
|
282
|
-
if ($[
|
|
283
|
-
|
|
247
|
+
const handleTokenBlur = t10;
|
|
248
|
+
let t11;
|
|
249
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
+
t11 = event => {
|
|
284
251
|
if (event.key === "Escape") {
|
|
285
252
|
var _ref$current2;
|
|
286
253
|
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
|
287
254
|
}
|
|
288
255
|
};
|
|
289
|
-
$[
|
|
256
|
+
$[41] = t11;
|
|
290
257
|
} else {
|
|
291
|
-
|
|
258
|
+
t11 = $[41];
|
|
292
259
|
}
|
|
293
|
-
const handleTokenKeyUp =
|
|
294
|
-
let
|
|
295
|
-
if ($[
|
|
296
|
-
|
|
260
|
+
const handleTokenKeyUp = t11;
|
|
261
|
+
let t12;
|
|
262
|
+
if ($[42] !== onFocus || $[43] !== visibleTokenCount) {
|
|
263
|
+
t12 = event_0 => {
|
|
297
264
|
onFocus && onFocus(event_0);
|
|
298
265
|
setSelectedTokenIndex(undefined);
|
|
299
266
|
visibleTokenCount && setTokensAreTruncated(false);
|
|
300
267
|
};
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
268
|
+
$[42] = onFocus;
|
|
269
|
+
$[43] = visibleTokenCount;
|
|
270
|
+
$[44] = t12;
|
|
304
271
|
} else {
|
|
305
|
-
|
|
272
|
+
t12 = $[44];
|
|
306
273
|
}
|
|
307
|
-
const handleInputFocus =
|
|
308
|
-
let
|
|
309
|
-
if ($[
|
|
310
|
-
|
|
274
|
+
const handleInputFocus = t12;
|
|
275
|
+
let t13;
|
|
276
|
+
if ($[45] !== containerRef || $[46] !== onBlur || $[47] !== visibleTokenCount) {
|
|
277
|
+
t13 = event_1 => {
|
|
311
278
|
onBlur && onBlur(event_1);
|
|
312
279
|
setTimeout(() => {
|
|
313
280
|
var _containerRef$current5;
|
|
@@ -316,17 +283,17 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
316
283
|
}
|
|
317
284
|
}, 0);
|
|
318
285
|
};
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
286
|
+
$[45] = containerRef;
|
|
287
|
+
$[46] = onBlur;
|
|
288
|
+
$[47] = visibleTokenCount;
|
|
289
|
+
$[48] = t13;
|
|
323
290
|
} else {
|
|
324
|
-
|
|
291
|
+
t13 = $[48];
|
|
325
292
|
}
|
|
326
|
-
const handleInputBlur =
|
|
327
|
-
let
|
|
328
|
-
if ($[
|
|
329
|
-
|
|
293
|
+
const handleInputBlur = t13;
|
|
294
|
+
let t14;
|
|
295
|
+
if ($[49] !== handleTokenRemove || $[50] !== onKeyDown || $[51] !== tokens) {
|
|
296
|
+
t14 = e => {
|
|
330
297
|
var _ref$current3;
|
|
331
298
|
if (onKeyDown) {
|
|
332
299
|
onKeyDown(e);
|
|
@@ -346,175 +313,148 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
346
313
|
}, 0);
|
|
347
314
|
}
|
|
348
315
|
};
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
316
|
+
$[49] = handleTokenRemove;
|
|
317
|
+
$[50] = onKeyDown;
|
|
318
|
+
$[51] = tokens;
|
|
319
|
+
$[52] = t14;
|
|
353
320
|
} else {
|
|
354
|
-
|
|
321
|
+
t14 = $[52];
|
|
355
322
|
}
|
|
356
|
-
const handleInputKeyDown =
|
|
357
|
-
let
|
|
358
|
-
if ($[
|
|
359
|
-
|
|
323
|
+
const handleInputKeyDown = t14;
|
|
324
|
+
let t15;
|
|
325
|
+
if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
|
|
326
|
+
t15 = () => {
|
|
360
327
|
var _ref$current5;
|
|
361
328
|
(_ref$current5 = ref.current) === null || _ref$current5 === void 0 ? void 0 : _ref$current5.focus();
|
|
362
329
|
};
|
|
363
|
-
$[
|
|
330
|
+
$[53] = t15;
|
|
364
331
|
} else {
|
|
365
|
-
|
|
332
|
+
t15 = $[53];
|
|
366
333
|
}
|
|
367
|
-
const focusInput =
|
|
368
|
-
const preventTokenClickPropagation =
|
|
369
|
-
let
|
|
370
|
-
if ($[
|
|
371
|
-
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
334
|
+
const focusInput = t15;
|
|
335
|
+
const preventTokenClickPropagation = _temp3;
|
|
336
|
+
let t16;
|
|
337
|
+
if ($[54] !== tokens || $[55] !== tokensAreTruncated || $[56] !== visibleTokenCount) {
|
|
338
|
+
t16 = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
|
|
339
|
+
$[54] = tokens;
|
|
340
|
+
$[55] = tokensAreTruncated;
|
|
341
|
+
$[56] = visibleTokenCount;
|
|
342
|
+
$[57] = t16;
|
|
376
343
|
} else {
|
|
377
|
-
|
|
344
|
+
t16 = $[57];
|
|
378
345
|
}
|
|
379
|
-
const visibleTokens =
|
|
380
|
-
let
|
|
381
|
-
if ($[
|
|
382
|
-
|
|
346
|
+
const visibleTokens = t16;
|
|
347
|
+
let t17;
|
|
348
|
+
if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
|
|
349
|
+
t17 = {
|
|
383
350
|
small: "small",
|
|
384
351
|
medium: "small",
|
|
385
352
|
large: "medium",
|
|
386
353
|
xlarge: "medium"
|
|
387
354
|
};
|
|
388
|
-
$[
|
|
355
|
+
$[58] = t17;
|
|
389
356
|
} else {
|
|
390
|
-
|
|
357
|
+
t17 = $[58];
|
|
391
358
|
}
|
|
392
|
-
const inputSizeMap =
|
|
359
|
+
const inputSizeMap = t17;
|
|
393
360
|
const showLeadingLoadingIndicator = loading && (loaderPosition === "leading" || Boolean(LeadingVisual && loaderPosition !== "trailing"));
|
|
394
361
|
const showTrailingLoadingIndicator = loading && (loaderPosition === "trailing" || loaderPosition === "auto" && !LeadingVisual);
|
|
395
|
-
const
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
const
|
|
399
|
-
let
|
|
400
|
-
if ($[
|
|
401
|
-
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
362
|
+
const t18 = Boolean(LeadingVisual || showLeadingLoadingIndicator);
|
|
363
|
+
const t19 = Boolean(TrailingVisual || showTrailingLoadingIndicator);
|
|
364
|
+
const t20 = inputSizeMap[size];
|
|
365
|
+
const t21 = Boolean(preventTokenWrapping || maxHeight) || undefined;
|
|
366
|
+
let t22;
|
|
367
|
+
if ($[59] !== className) {
|
|
368
|
+
t22 = clsx(className, styles.TextInputWrapper);
|
|
369
|
+
$[59] = className;
|
|
370
|
+
$[60] = t22;
|
|
404
371
|
} else {
|
|
405
|
-
|
|
372
|
+
t22 = $[60];
|
|
406
373
|
}
|
|
407
|
-
let
|
|
408
|
-
if ($[
|
|
409
|
-
|
|
374
|
+
let t23;
|
|
375
|
+
if ($[61] !== maxHeight || $[62] !== style) {
|
|
376
|
+
t23 = maxHeight ? {
|
|
410
377
|
maxHeight,
|
|
411
378
|
...style
|
|
412
379
|
} : style;
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
380
|
+
$[61] = maxHeight;
|
|
381
|
+
$[62] = style;
|
|
382
|
+
$[63] = t23;
|
|
416
383
|
} else {
|
|
417
|
-
|
|
384
|
+
t23 = $[63];
|
|
418
385
|
}
|
|
419
|
-
let
|
|
420
|
-
if ($[
|
|
421
|
-
|
|
386
|
+
let t24;
|
|
387
|
+
if ($[64] !== IconComponent || $[65] !== LeadingVisual) {
|
|
388
|
+
t24 = IconComponent && !LeadingVisual && /*#__PURE__*/jsx(IconComponent, {
|
|
422
389
|
className: "TextInput-icon"
|
|
423
390
|
});
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
391
|
+
$[64] = IconComponent;
|
|
392
|
+
$[65] = LeadingVisual;
|
|
393
|
+
$[66] = t24;
|
|
427
394
|
} else {
|
|
428
|
-
|
|
395
|
+
t24 = $[66];
|
|
429
396
|
}
|
|
430
|
-
const
|
|
431
|
-
let
|
|
432
|
-
if ($[
|
|
433
|
-
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
397
|
+
const t25 = typeof loading === "boolean";
|
|
398
|
+
let t26;
|
|
399
|
+
if ($[67] !== LeadingVisual) {
|
|
400
|
+
t26 = typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual;
|
|
401
|
+
$[67] = LeadingVisual;
|
|
402
|
+
$[68] = t26;
|
|
436
403
|
} else {
|
|
437
|
-
|
|
404
|
+
t26 = $[68];
|
|
438
405
|
}
|
|
439
|
-
let
|
|
440
|
-
if ($[
|
|
441
|
-
|
|
442
|
-
hasLoadingIndicator:
|
|
406
|
+
let t27;
|
|
407
|
+
if ($[69] !== showLeadingLoadingIndicator || $[70] !== t25 || $[71] !== t26) {
|
|
408
|
+
t27 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
|
|
409
|
+
hasLoadingIndicator: t25,
|
|
443
410
|
visualPosition: "leading",
|
|
444
411
|
showLoadingIndicator: showLeadingLoadingIndicator,
|
|
445
|
-
children:
|
|
446
|
-
});
|
|
447
|
-
$[76] = showLeadingLoadingIndicator;
|
|
448
|
-
$[77] = t28;
|
|
449
|
-
$[78] = t29;
|
|
450
|
-
$[79] = t30;
|
|
451
|
-
} else {
|
|
452
|
-
t30 = $[79];
|
|
453
|
-
}
|
|
454
|
-
const t31 = containerRef;
|
|
455
|
-
const t32 = validationStatus === "error" ? "true" : "false";
|
|
456
|
-
const t33 = ariaDescribedBy || undefined;
|
|
457
|
-
let t34;
|
|
458
|
-
if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !== role || $[86] !== t32 || $[87] !== t33) {
|
|
459
|
-
t34 = /*#__PURE__*/jsx(UnstyledTextInput, {
|
|
460
|
-
ref: ref,
|
|
461
|
-
disabled: disabled,
|
|
462
|
-
onFocus: handleInputFocus,
|
|
463
|
-
onBlur: handleInputBlur,
|
|
464
|
-
onKeyDown: handleInputKeyDown,
|
|
465
|
-
type: "text",
|
|
466
|
-
className: styles.UnstyledTextInput,
|
|
467
|
-
"aria-invalid": t32,
|
|
468
|
-
role: role,
|
|
469
|
-
"aria-describedby": t33,
|
|
470
|
-
...inputPropsRest
|
|
412
|
+
children: t26
|
|
471
413
|
});
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[84] = inputPropsRest;
|
|
477
|
-
$[85] = role;
|
|
478
|
-
$[86] = t32;
|
|
479
|
-
$[87] = t33;
|
|
480
|
-
$[88] = t34;
|
|
481
|
-
} else {
|
|
482
|
-
t34 = $[88];
|
|
483
|
-
}
|
|
484
|
-
let t35;
|
|
485
|
-
if ($[89] !== selectedValuesDescription || $[90] !== selectedValuesDescriptionId || $[91] !== shouldExposeSelectedValuesDescription) {
|
|
486
|
-
t35 = shouldExposeSelectedValuesDescription ? /*#__PURE__*/jsx(VisuallyHidden, {
|
|
487
|
-
id: selectedValuesDescriptionId,
|
|
488
|
-
children: selectedValuesDescription
|
|
489
|
-
}) : null;
|
|
490
|
-
$[89] = selectedValuesDescription;
|
|
491
|
-
$[90] = selectedValuesDescriptionId;
|
|
492
|
-
$[91] = shouldExposeSelectedValuesDescription;
|
|
493
|
-
$[92] = t35;
|
|
414
|
+
$[69] = showLeadingLoadingIndicator;
|
|
415
|
+
$[70] = t25;
|
|
416
|
+
$[71] = t26;
|
|
417
|
+
$[72] = t27;
|
|
494
418
|
} else {
|
|
495
|
-
|
|
419
|
+
t27 = $[72];
|
|
496
420
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
421
|
+
const t28 = containerRef;
|
|
422
|
+
const t29 = validationStatus === "error" ? "true" : "false";
|
|
423
|
+
let t30;
|
|
424
|
+
if ($[73] !== disabled || $[74] !== handleInputBlur || $[75] !== handleInputFocus || $[76] !== handleInputKeyDown || $[77] !== inputPropsRest || $[78] !== t29) {
|
|
425
|
+
t30 = /*#__PURE__*/jsx("div", {
|
|
500
426
|
className: styles.InputWrapper,
|
|
501
|
-
children:
|
|
427
|
+
children: /*#__PURE__*/jsx(UnstyledTextInput, {
|
|
428
|
+
ref: ref,
|
|
429
|
+
disabled: disabled,
|
|
430
|
+
onFocus: handleInputFocus,
|
|
431
|
+
onBlur: handleInputBlur,
|
|
432
|
+
onKeyDown: handleInputKeyDown,
|
|
433
|
+
type: "text",
|
|
434
|
+
className: styles.UnstyledTextInput,
|
|
435
|
+
"aria-invalid": t29,
|
|
436
|
+
...inputPropsRest
|
|
437
|
+
})
|
|
502
438
|
});
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
439
|
+
$[73] = disabled;
|
|
440
|
+
$[74] = handleInputBlur;
|
|
441
|
+
$[75] = handleInputFocus;
|
|
442
|
+
$[76] = handleInputKeyDown;
|
|
443
|
+
$[77] = inputPropsRest;
|
|
444
|
+
$[78] = t29;
|
|
445
|
+
$[79] = t30;
|
|
506
446
|
} else {
|
|
507
|
-
|
|
447
|
+
t30 = $[79];
|
|
508
448
|
}
|
|
509
|
-
let
|
|
510
|
-
if ($[
|
|
511
|
-
let
|
|
512
|
-
if ($[
|
|
513
|
-
|
|
449
|
+
let t31;
|
|
450
|
+
if ($[80] !== TokenComponent || $[81] !== disabled || $[82] !== handleTokenBlur || $[83] !== handleTokenFocus || $[84] !== handleTokenRemove || $[85] !== hideTokenRemoveButtons || $[86] !== selectedTokenIndex || $[87] !== size || $[88] !== visibleTokens) {
|
|
451
|
+
let t32;
|
|
452
|
+
if ($[90] !== TokenComponent || $[91] !== disabled || $[92] !== handleTokenBlur || $[93] !== handleTokenFocus || $[94] !== handleTokenRemove || $[95] !== hideTokenRemoveButtons || $[96] !== selectedTokenIndex || $[97] !== size) {
|
|
453
|
+
t32 = (t33, i) => {
|
|
514
454
|
const {
|
|
515
455
|
id,
|
|
516
456
|
...tokenRest
|
|
517
|
-
} =
|
|
457
|
+
} = t33;
|
|
518
458
|
return /*#__PURE__*/jsx(TokenComponent, {
|
|
519
459
|
disabled: disabled,
|
|
520
460
|
onFocus: handleTokenFocus(i),
|
|
@@ -531,149 +471,140 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
531
471
|
...tokenRest
|
|
532
472
|
}, id);
|
|
533
473
|
};
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
536
|
-
$[
|
|
537
|
-
$[
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
474
|
+
$[90] = TokenComponent;
|
|
475
|
+
$[91] = disabled;
|
|
476
|
+
$[92] = handleTokenBlur;
|
|
477
|
+
$[93] = handleTokenFocus;
|
|
478
|
+
$[94] = handleTokenRemove;
|
|
479
|
+
$[95] = hideTokenRemoveButtons;
|
|
480
|
+
$[96] = selectedTokenIndex;
|
|
481
|
+
$[97] = size;
|
|
482
|
+
$[98] = t32;
|
|
543
483
|
} else {
|
|
544
|
-
|
|
484
|
+
t32 = $[98];
|
|
545
485
|
}
|
|
546
|
-
|
|
547
|
-
$[
|
|
548
|
-
$[
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
486
|
+
t31 = visibleTokens.map(t32);
|
|
487
|
+
$[80] = TokenComponent;
|
|
488
|
+
$[81] = disabled;
|
|
489
|
+
$[82] = handleTokenBlur;
|
|
490
|
+
$[83] = handleTokenFocus;
|
|
491
|
+
$[84] = handleTokenRemove;
|
|
492
|
+
$[85] = hideTokenRemoveButtons;
|
|
493
|
+
$[86] = selectedTokenIndex;
|
|
494
|
+
$[87] = size;
|
|
495
|
+
$[88] = visibleTokens;
|
|
496
|
+
$[89] = t31;
|
|
557
497
|
} else {
|
|
558
|
-
|
|
498
|
+
t31 = $[89];
|
|
559
499
|
}
|
|
560
|
-
let
|
|
561
|
-
if ($[
|
|
562
|
-
|
|
500
|
+
let t32;
|
|
501
|
+
if ($[99] !== size || $[100] !== tokens || $[101] !== tokensAreTruncated || $[102] !== visibleTokens.length) {
|
|
502
|
+
t32 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
|
|
563
503
|
className: overflowCountClassMap[size],
|
|
564
504
|
children: ["+", tokens.length - visibleTokens.length]
|
|
565
505
|
}) : null;
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
506
|
+
$[99] = size;
|
|
507
|
+
$[100] = tokens;
|
|
508
|
+
$[101] = tokensAreTruncated;
|
|
509
|
+
$[102] = visibleTokens.length;
|
|
510
|
+
$[103] = t32;
|
|
571
511
|
} else {
|
|
572
|
-
|
|
512
|
+
t32 = $[103];
|
|
573
513
|
}
|
|
574
|
-
let
|
|
575
|
-
if ($[
|
|
576
|
-
|
|
577
|
-
ref:
|
|
514
|
+
let t33;
|
|
515
|
+
if ($[104] !== preventTokenWrapping || $[105] !== t28 || $[106] !== t30 || $[107] !== t31 || $[108] !== t32) {
|
|
516
|
+
t33 = /*#__PURE__*/jsxs("div", {
|
|
517
|
+
ref: t28,
|
|
578
518
|
className: styles.Container,
|
|
579
519
|
"data-prevent-token-wrapping": preventTokenWrapping,
|
|
580
|
-
children: [
|
|
520
|
+
children: [t30, t31, t32]
|
|
581
521
|
});
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
522
|
+
$[104] = preventTokenWrapping;
|
|
523
|
+
$[105] = t28;
|
|
524
|
+
$[106] = t30;
|
|
525
|
+
$[107] = t31;
|
|
526
|
+
$[108] = t32;
|
|
527
|
+
$[109] = t33;
|
|
588
528
|
} else {
|
|
589
|
-
|
|
529
|
+
t33 = $[109];
|
|
590
530
|
}
|
|
591
|
-
const
|
|
592
|
-
let
|
|
593
|
-
if ($[
|
|
594
|
-
|
|
595
|
-
$[
|
|
596
|
-
$[
|
|
531
|
+
const t34 = typeof loading === "boolean";
|
|
532
|
+
let t35;
|
|
533
|
+
if ($[110] !== TrailingVisual) {
|
|
534
|
+
t35 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
|
|
535
|
+
$[110] = TrailingVisual;
|
|
536
|
+
$[111] = t35;
|
|
597
537
|
} else {
|
|
598
|
-
|
|
538
|
+
t35 = $[111];
|
|
599
539
|
}
|
|
600
|
-
let
|
|
601
|
-
if ($[
|
|
602
|
-
|
|
603
|
-
hasLoadingIndicator:
|
|
540
|
+
let t36;
|
|
541
|
+
if ($[112] !== showTrailingLoadingIndicator || $[113] !== t34 || $[114] !== t35) {
|
|
542
|
+
t36 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
|
|
543
|
+
hasLoadingIndicator: t34,
|
|
604
544
|
visualPosition: "trailing",
|
|
605
545
|
showLoadingIndicator: showTrailingLoadingIndicator,
|
|
606
|
-
children:
|
|
546
|
+
children: t35
|
|
607
547
|
});
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
548
|
+
$[112] = showTrailingLoadingIndicator;
|
|
549
|
+
$[113] = t34;
|
|
550
|
+
$[114] = t35;
|
|
551
|
+
$[115] = t36;
|
|
612
552
|
} else {
|
|
613
|
-
|
|
553
|
+
t36 = $[115];
|
|
614
554
|
}
|
|
615
|
-
let
|
|
616
|
-
if ($[
|
|
617
|
-
|
|
555
|
+
let t37;
|
|
556
|
+
if ($[116] !== block || $[117] !== contrast || $[118] !== disabled || $[119] !== maxWidthProp || $[120] !== minWidthProp || $[121] !== t18 || $[122] !== t19 || $[123] !== t20 || $[124] !== t21 || $[125] !== t22 || $[126] !== t23 || $[127] !== t24 || $[128] !== t27 || $[129] !== t33 || $[130] !== t36 || $[131] !== validationStatus || $[132] !== variantProp || $[133] !== widthProp) {
|
|
557
|
+
t37 = /*#__PURE__*/jsxs(TextInputWrapper, {
|
|
618
558
|
block: block,
|
|
619
559
|
contrast: contrast,
|
|
620
560
|
disabled: disabled,
|
|
621
|
-
hasLeadingVisual:
|
|
622
|
-
hasTrailingVisual:
|
|
561
|
+
hasLeadingVisual: t18,
|
|
562
|
+
hasTrailingVisual: t19,
|
|
623
563
|
width: widthProp,
|
|
624
564
|
minWidth: minWidthProp,
|
|
625
565
|
maxWidth: maxWidthProp,
|
|
626
|
-
size:
|
|
566
|
+
size: t20,
|
|
627
567
|
validationStatus: validationStatus,
|
|
628
568
|
variant: variantProp,
|
|
629
569
|
onClick: focusInput,
|
|
630
|
-
"data-token-wrapping":
|
|
631
|
-
className:
|
|
632
|
-
style:
|
|
633
|
-
children: [
|
|
570
|
+
"data-token-wrapping": t21,
|
|
571
|
+
className: t22,
|
|
572
|
+
style: t23,
|
|
573
|
+
children: [t24, t27, t33, t36]
|
|
634
574
|
});
|
|
635
|
-
$[
|
|
636
|
-
$[
|
|
637
|
-
$[
|
|
638
|
-
$[
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
575
|
+
$[116] = block;
|
|
576
|
+
$[117] = contrast;
|
|
577
|
+
$[118] = disabled;
|
|
578
|
+
$[119] = maxWidthProp;
|
|
579
|
+
$[120] = minWidthProp;
|
|
580
|
+
$[121] = t18;
|
|
581
|
+
$[122] = t19;
|
|
582
|
+
$[123] = t20;
|
|
583
|
+
$[124] = t21;
|
|
584
|
+
$[125] = t22;
|
|
585
|
+
$[126] = t23;
|
|
586
|
+
$[127] = t24;
|
|
587
|
+
$[128] = t27;
|
|
588
|
+
$[129] = t33;
|
|
589
|
+
$[130] = t36;
|
|
590
|
+
$[131] = validationStatus;
|
|
591
|
+
$[132] = variantProp;
|
|
592
|
+
$[133] = widthProp;
|
|
593
|
+
$[134] = t37;
|
|
654
594
|
} else {
|
|
655
|
-
|
|
595
|
+
t37 = $[134];
|
|
656
596
|
}
|
|
657
|
-
return
|
|
597
|
+
return t37;
|
|
658
598
|
}
|
|
659
|
-
function
|
|
599
|
+
function _temp3(event_2) {
|
|
660
600
|
event_2.stopPropagation();
|
|
661
601
|
}
|
|
662
|
-
function
|
|
602
|
+
function _temp2(el) {
|
|
663
603
|
return isFocusable(el);
|
|
664
604
|
}
|
|
665
|
-
function
|
|
605
|
+
function _temp(element) {
|
|
666
606
|
return !element.getAttributeNames().includes("aria-hidden");
|
|
667
607
|
}
|
|
668
|
-
function _temp2(tokenText) {
|
|
669
|
-
return tokenText !== null;
|
|
670
|
-
}
|
|
671
|
-
function _temp(token) {
|
|
672
|
-
if ("text" in token && typeof token.text === "string" && token.text.trim().length) {
|
|
673
|
-
return token.text;
|
|
674
|
-
}
|
|
675
|
-
return null;
|
|
676
|
-
}
|
|
677
608
|
const TextInputWithTokens = /*#__PURE__*/React.forwardRef(TextInputWithTokensInnerComponent);
|
|
678
609
|
TextInputWithTokens.displayName = 'TextInputWithTokens';
|
|
679
610
|
TextInputWithTokens.__SLOT__ = Symbol('TextInputWithTokens');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:var(--base-size-4,.25rem);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}
|
|
2
|
-
/*# sourceMappingURL=Timeline-
|
|
1
|
+
.prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:calc(var(--base-size-4,.25rem) + 1px);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}
|
|
2
|
+
/*# sourceMappingURL=Timeline-19bef8c5.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAmBF,CAhBI,qGACE,aAKF,CAHE,yIACE,8BACF,CAGF,oGACE,gBAKF,CAHE,wIACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mEAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCA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uE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAYF,CAHE,yDACE,iDACF","file":"Timeline-19bef8c5.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar]) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n\n .TimelineItem:last-child {\n padding-bottom: 0;\n\n &:where([data-condensed])::before {\n height: var(--base-size-12);\n }\n }\n }\n}\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--base-size-16) 0;\n margin-left: var(--base-size-16);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 2px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-muted);\n }\n\n &:where([data-condensed]) {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n &:last-child {\n padding-bottom: var(--base-size-16);\n }\n\n .TimelineBadge {\n height: 16px;\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n }\n}\n\n.TimelineBadgeWrapper {\n position: relative;\n z-index: 1;\n}\n\n.TimelineBadge {\n display: flex;\n width: 32px;\n height: 32px;\n margin-right: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -15px;\n flex-shrink: 0;\n overflow: hidden;\n color: var(--fgColor-muted);\n\n /* TODOl not quite sure if this is the correct migration for this line */\n background-color: var(--timelineBadge-bgColor);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--bgColor-default);\n border-style: solid;\n border-width: var(--borderWidth-thick);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n}\n\n.TimelineBody {\n min-width: 0;\n max-width: 100%;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc(var(--base-size-4) + 1px);\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineBreak {\n position: relative;\n z-index: 1;\n height: var(--base-size-24);\n margin: 0;\n margin-bottom: calc(-1 * var(--base-size-16));\n margin-left: 0;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n\n &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Timeline-
|
|
1
|
+
import './Timeline-19bef8c5.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"Timeline":"prc-Timeline-Timeline-awSoC","TimelineItem":"prc-Timeline-TimelineItem-QwDVH","TimelineBadge":"prc-Timeline-TimelineBadge-u0qSm","TimelineBadgeWrapper":"prc-Timeline-TimelineBadgeWrapper-SZw4k","TimelineBody":"prc-Timeline-TimelineBody-tjOtb","TimelineBreak":"prc-Timeline-TimelineBreak-X8eti"};
|
|
4
4
|
|
|
@@ -3003,6 +3003,14 @@
|
|
|
3003
3003
|
{
|
|
3004
3004
|
"id": "components-dialog-features--retains-focus-trap-with-dynamic-content",
|
|
3005
3005
|
"code": "() => {\n const [isOpen, setIsOpen] = useState(false)\n const [secondOpen, setSecondOpen] = useState(false)\n const [expandContent, setExpandContent] = useState(false)\n const [changeBodyContent, setChangeBodyContent] = useState(false)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n const onSecondDialogClose = useCallback(() => setSecondOpen(false), [])\n const openSecondDialog = useCallback(() => setSecondOpen(true), [])\n const renderFooterConditionally = () => {\n if (!changeBodyContent) return null\n return (\n <Dialog.Footer>\n <Button variant=\"primary\">Submit</Button>\n </Dialog.Footer>\n )\n }\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(!isOpen)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog\n title=\"My Dialog\"\n onClose={onDialogClose}\n renderFooter={renderFooterConditionally}\n >\n <Button onClick={() => setExpandContent(!expandContent)}>\n Click me to dynamically {expandContent ? 'remove' : 'render'}{' '}\n content\n </Button>\n <Button onClick={() => setChangeBodyContent(!changeBodyContent)}>\n Click me to {changeBodyContent ? 'remove' : 'add'} a footer\n </Button>\n <Button onClick={openSecondDialog}>\n Click me to open a new dialog\n </Button>\n {expandContent && (\n <Stack gap=\"normal\" direction=\"vertical\">\n {lipsum}\n <Button>Dialog Button Example 1</Button>\n <Button>Dialog Button Example 2</Button>\n </Stack>\n )}\n {secondOpen && (\n <Dialog\n title=\"Inner dialog!\"\n onClose={onSecondDialogClose}\n width=\"small\"\n >\n Hello world\n </Dialog>\n )}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
"id": "components-dialog-features--align-top",
|
|
3009
|
+
"code": "() => {\n const [isOpen, setIsOpen] = useState(true)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(true)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog title=\"My Dialog\" onClose={onDialogClose} align=\"top\">\n {bodyContent}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"id": "components-dialog-features--align-bottom",
|
|
3013
|
+
"code": "() => {\n const [isOpen, setIsOpen] = useState(true)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(true)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog title=\"My Dialog\" onClose={onDialogClose} align=\"bottom\">\n {bodyContent}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3006
3014
|
}
|
|
3007
3015
|
],
|
|
3008
3016
|
"importPath": "@primer/react",
|
|
@@ -3074,11 +3082,24 @@
|
|
|
3074
3082
|
"description": "The position of the dialog",
|
|
3075
3083
|
"defaultValue": ""
|
|
3076
3084
|
},
|
|
3085
|
+
{
|
|
3086
|
+
"name": "align",
|
|
3087
|
+
"type": "'top' | 'center' | 'bottom'",
|
|
3088
|
+
"required": false,
|
|
3089
|
+
"description": "The vertical alignment of the dialog. Only applies when position is 'center' (the default). 'top' positions the Dialog ~4rem from the top of the screen, 'center' (default) vertically centers the Dialog, 'bottom' positions the Dialog near the bottom of the screen.",
|
|
3090
|
+
"defaultValue": ""
|
|
3091
|
+
},
|
|
3077
3092
|
{
|
|
3078
3093
|
"name": "className",
|
|
3079
3094
|
"type": "string | undefined",
|
|
3080
3095
|
"defaultValue": "",
|
|
3081
3096
|
"description": "CSS string"
|
|
3097
|
+
},
|
|
3098
|
+
{
|
|
3099
|
+
"name": "style",
|
|
3100
|
+
"type": "React.CSSProperties | undefined",
|
|
3101
|
+
"defaultValue": "",
|
|
3102
|
+
"description": "React CSS properties"
|
|
3082
3103
|
}
|
|
3083
3104
|
],
|
|
3084
3105
|
"subcomponents": [
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk){--can-scroll:0}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}
|
|
2
|
-
/*# sourceMappingURL=Dialog-b8e961f6.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF,CAEA,GACE,SAAU,CACV,kBACF,CACF,CAEA,oDACE,GACE,0BACF,CACF,CAEA,yDACE,GACE,2BACF,CACF,CAEA,wDACE,GACE,0BACF,CACF,CAGA,0CACE,MAEE,cACF,CACF,CAEA,2BAQE,+EAAsE,CADtE,8EAAiD,CAHjD,QAAS,CAET,YAAa,CADb,MAAO,CAJP,cAAe,CAEf,OAAQ,CADR,KAoCF,CA1BE,oFAHA,kBAAmB,CACnB,sBAKA,CAEA,uDACE,kBAAmB,CACnB,0BACF,CAEA,wDACE,kBAAmB,CACnB,wBACF,CAEA,yBACE,wDACE,kBAAmB,CACnB,sBACF,CAEA,wDACE,eAAgB,CAChB,sBACF,CACF,CAGF,yBASE,mEAAwC,CACxC,8CAAwC,CACxC,wEAAmE,CACnE,mEAAwC,CAXxC,YAAa,CAOb,qBAAsB,CAFtB,WAAY,CACZ,8BAA+B,CAF/B,6BAA8B,CAD9B,eAAgB,CAShB,SAAU,CAVV,WAkIF,CAtHE,mDACE,WACF,CAEA,oDACE,WACF,CAEA,mDAEE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F,CAEA,2BAKE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAH3C,QAAS,CACT,oCAIF,CAEA,uBAGE,WAAY,CADZ,aAEF,CAEA,gDALE,gCAoBF,CAfA,yBAEE,YAAa,CACb,cAAe,CAIf,aAAc,CADd,4BAAuB,CAFvB,wBAAyB,CAHzB,SAcF,CANE,0BATF,yBAYI,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAIJ,CADE","file":"Dialog-b8e961f6.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog:has(.Footer) {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
|