@blakesteve/roster 5.19.0 → 5.19.2
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/README.md +66 -0
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +9 -6
- package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
- package/dist/components/organisms/Sheet/Sheet.d.ts +4 -1
- package/dist/components/organisms/Sheet/Sheet.js +136 -132
- package/dist/meta.json +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1502,6 +1502,32 @@ and checks it's visible (Playwright's `toBeVisible`, say) finds it open. In
|
|
|
1502
1502
|
read as hidden; `Sheet`'s was too, and is fixed the same way. Nothing on
|
|
1503
1503
|
screen moves, and a click outside the panel still closes it.
|
|
1504
1504
|
|
|
1505
|
+
**One opened as another leaves.** A `Dialog` or `Sheet` opened while another
|
|
1506
|
+
is still leaving holds the page from its first frame, so the other one's focus
|
|
1507
|
+
restore can't move focus out onto the page. An opener in the toast host is the
|
|
1508
|
+
exception: the host stays live, so one opened from a toast still gives focus
|
|
1509
|
+
back to it as it leaves, out of whatever opened in its place. In 5.19.0 and
|
|
1510
|
+
before, a `Sheet` that mounted already
|
|
1511
|
+
open, as one whose code loads on its first open does, never held the part of
|
|
1512
|
+
the page it was written in. That part stayed live behind it, and a sheet or
|
|
1513
|
+
dialog leaving at the same time restored focus onto it as its leave ended. A
|
|
1514
|
+
`Sheet` now opens a render later, before anything is painted, as `Dialog`
|
|
1515
|
+
already did, so on that first open it also slides in rather than appearing in
|
|
1516
|
+
place. Nothing to change in your code.
|
|
1517
|
+
|
|
1518
|
+
Such a sheet may also have no opener to give focus back to: Headless UI keeps
|
|
1519
|
+
the record of what was pressed only once its code has loaded, after the press
|
|
1520
|
+
that opened the sheet. Remember the press and pass it as `returnFocus`.
|
|
1521
|
+
|
|
1522
|
+
**Closed and opened again during its entrance.** A `Sheet` closed while it is
|
|
1523
|
+
still coming in and opened again a moment later comes back whole. In 5.19.1, and
|
|
1524
|
+
in earlier releases for any open but one mounted open, a reopen that landed
|
|
1525
|
+
after the panel's part of the close had ended and before the backdrop's could
|
|
1526
|
+
bring back the backdrop, holding the page, and no panel, with focus on `<body>`
|
|
1527
|
+
until Escape or a tap closed it. `Dialog` did the same on any close when a
|
|
1528
|
+
`className` made its panel's transition end before the backdrop's, and came back
|
|
1529
|
+
with no backdrop when one made it end after. Nothing to change in your code.
|
|
1530
|
+
|
|
1505
1531
|
**Full screen.** `layout="fullscreen"` makes a bare dialog over the whole
|
|
1506
1532
|
viewport, for a photo viewer or a full-screen card: no box, no padding, and no
|
|
1507
1533
|
header or close button of Roster's. Everything inside is yours, a close
|
|
@@ -2909,6 +2935,46 @@ output is hidden there), and no `meta.json` is written. A test that passed only
|
|
|
2909
2935
|
on its retry is named in the output too, and `meta.json` records how many there
|
|
2910
2936
|
were, as `passedOnRetry`.
|
|
2911
2937
|
|
|
2938
|
+
## Discord notices
|
|
2939
|
+
|
|
2940
|
+
`.github/workflows/discord.yml` posts to Roster's channel on Blake's Discord,
|
|
2941
|
+
through the webhook in the `DISCORD_WEBHOOK_URL` repository secret. It's a
|
|
2942
|
+
separate workflow, so nothing it does can fail or delay CI or a deploy. Without
|
|
2943
|
+
the secret, as in a fork, it skips cleanly and posts nothing.
|
|
2944
|
+
|
|
2945
|
+
| Event | Posts when | Which copy of the file runs |
|
|
2946
|
+
| --- | --- | --- |
|
|
2947
|
+
| Storybook deployed, or its deploy failed | `deployment_status`, environment `Production`, state `success`, `failure` or `error` | The one in the deployed commit |
|
|
2948
|
+
| A release | `release: published` | The one in the tagged commit |
|
|
2949
|
+
| CI red | `workflow_run` on `CI`, `failure`, on `main`, from a push | The one on `main` |
|
|
2950
|
+
|
|
2951
|
+
A deploy here is Storybook, at `https://roster-tan.vercel.app`, so the post
|
|
2952
|
+
says Storybook was deployed. The package itself ships on `npm publish`, which
|
|
2953
|
+
isn't a GitHub event, so nothing posts it; the GitHub release made beside it
|
|
2954
|
+
does. Previews and pull requests don't post, and neither does a fork's: CI on a
|
|
2955
|
+
pull request isn't a push. Nor does a CI run that ends canceled, which is how a
|
|
2956
|
+
job stopped at its own time limit ends it. The Storybook job's steps have their
|
|
2957
|
+
own limits, so a stalled step there fails and posts, but Unit Tests and Build
|
|
2958
|
+
have only the job's, so a hung step in either is silent.
|
|
2959
|
+
|
|
2960
|
+
Each post has the version, the commit and a link. With `DETAILS: "on"`, a
|
|
2961
|
+
deploy lists the PRs merged since the last good deploy (not the `release/`
|
|
2962
|
+
PRs), a release carries its notes without the authors and links, and red CI
|
|
2963
|
+
names each failed job and its failed step, such as "Storybook Tests: Run
|
|
2964
|
+
Storybook tests with real input". All of that text is escaped, so a title can't
|
|
2965
|
+
ping anyone or draw a link.
|
|
2966
|
+
|
|
2967
|
+
`src/discord-workflow.test.ts` runs the job's real condition and its real
|
|
2968
|
+
script, with stand-ins for `curl` and `gh`, in the `unit` project. To send each
|
|
2969
|
+
message as a test, from `main`:
|
|
2970
|
+
|
|
2971
|
+
```bash
|
|
2972
|
+
gh workflow run discord.yml --repo blakesteve/roster -f message=deploy
|
|
2973
|
+
```
|
|
2974
|
+
|
|
2975
|
+
The other three are `deploy-failed`, `release` and `ci-failed`. A `ci-failed`
|
|
2976
|
+
test names the steps of CI's latest failed push to `main`.
|
|
2977
|
+
|
|
2912
2978
|
## Contributing
|
|
2913
2979
|
|
|
2914
2980
|
Pull requests are welcome. Please:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),D=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),R=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),D=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),R=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),n=require("../../../node_modules/class-variance-authority/dist/index.cjs"),s=require("../../../lib/utils.cjs"),V=require("../../../lib/labels.cjs"),E=require("../../../internal/page-inert.cjs"),S=require("../../../internal/leave-watchdog.cjs"),z=require("../../../internal/key-focus.cjs"),e=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),c=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),C=n.cva("rst:relative rst:w-full rst:transform rst:overflow-hidden rst:rounded-2xl rst:p-6 rst:text-left rst:align-middle rst:elevation-overlay rst:transition-all rst:border",{variants:{size:{xs:"rst:max-w-xs",sm:"rst:max-w-sm",md:"rst:max-w-md",lg:"rst:max-w-lg",xl:"rst:max-w-xl","2xl":"rst:max-w-2xl","3xl":"rst:max-w-3xl",full:"rst:max-w-[95vw] rst:m-4"},variant:{white:"rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]",slate:"rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-gray-700,#44403c)] rst:dark:[--roster-ring-offset:var(--roster-gray-900,#1c1917)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",primary:"rst:bg-primary-700 rst:border-primary-600 rst:text-primary-700-ink rst:dark:text-white rst:dark:bg-primary-950 rst:dark:border-primary-900 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-primary-700,#084063)] rst:dark:[--roster-ring-offset:var(--roster-primary-950,#021724)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",glass:"rst:bg-white/80 rst:border-white/20 rst:backdrop-blur-xl rst:text-gray-900 rst:dark:bg-slate-900/80 rst:dark:border-slate-700/50 rst:dark:text-white"},status:{default:"",destructive:"rst:border-t-4 rst:border-t-error-500",success:"rst:border-t-4 rst:border-t-success-500"}},defaultVariants:{size:"md",variant:"white",status:"default"}}),p=n.cva("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"),y=n.cva("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"),P=n.cva("rst:inline-flex rst:size-11 rst:shrink-0 rst:items-center rst:justify-center rst:-m-3 rst:cursor-pointer rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-50 rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:transition-opacity"),A={close:"Close dialog"},M=200,B=({isOpen:h,onClose:d,title:u,description:o,size:k,variant:f,status:j,children:m,className:x,onAfterClose:w,labels:N,layout:F="default",titleHidden:v=!1})=>{z.useKeyFocus();const _=F==="fullscreen",q=V.withLabels(A,N),[T,L]=t.useState(!1);t.useLayoutEffect(()=>{L(!0)},[]);const a=h&&T,g=t.useRef(null),i=t.useRef(null),l=S.useLeaveWatchdog(g,i,a,M,w),b=t.useRef(null);return t.useLayoutEffect(()=>{if(a)return E.lockPage(b.current)},[a]),r.jsxs(r.Fragment,{children:[a&&r.jsx("span",{ref:b,hidden:!0}),r.jsxs(e.Dialog,{ref:g,open:a,as:"div",className:"rst:font-ui rst:fixed rst:inset-0 rst:z-50",onClose:d,children:[r.jsx(c.TransitionChild,{unmount:!1,as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0",enterTo:"rst:opacity-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:r.jsx(e.DialogBackdrop,{className:s.cn("rst:fixed rst:inset-0 rst:transition-opacity",f==="glass"?"rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_40%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_60%,transparent))]":"rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_60%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_80%,transparent))] rst:backdrop-blur-backdrop")})}),_?r.jsx(c.TransitionChild,{unmount:!1,as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0",enterTo:"rst:opacity-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",afterLeave:l.afterLeave,children:r.jsxs(e.DialogPanel,{ref:i,className:s.cn("rst:fixed rst:inset-0 rst:overflow-y-auto",x),children:[r.jsx(e.DialogTitle,{as:"h2",className:v?"rst:sr-only":s.cn(p()),children:u}),o&&r.jsx("p",{className:s.cn(y()),children:o}),m]})}):r.jsx("div",{className:"rst:fixed rst:inset-0 rst:overflow-y-auto",children:r.jsx("div",{className:"rst:flex rst:min-h-full rst:items-center rst:justify-center rst:p-4 rst:text-center",children:r.jsx(c.TransitionChild,{unmount:!1,as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0 rst:scale-95",enterTo:"rst:opacity-100 rst:scale-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100 rst:scale-100",leaveTo:"rst:opacity-0 rst:scale-95",afterLeave:l.afterLeave,children:r.jsxs(e.DialogPanel,{ref:i,className:s.cn(C({size:k,variant:f,status:j}),x),children:[r.jsxs("div",{className:"rst:flex rst:items-start rst:justify-between",children:[r.jsxs("div",{children:[r.jsx(e.DialogTitle,{as:"h2",className:v?"rst:sr-only":s.cn(p()),children:u}),o&&r.jsx("p",{className:s.cn(y()),children:o})]}),r.jsx("div",{className:"rst:ml-4 rst:flex rst:shrink-0",children:r.jsx("button",{type:"button",onClick:d,className:s.cn(P()),"aria-label":q.close,children:r.jsx(D.FontAwesomeIcon,{icon:R.faXmark,className:"rst:h-5 rst:w-5"})})})]}),r.jsx("div",{className:"rst:mt-6",children:m})]})})})})]},l.key)]})};exports.Dialog=B;
|
|
@@ -88,9 +88,9 @@ const W = /* @__PURE__ */ o(
|
|
|
88
88
|
title: f,
|
|
89
89
|
description: a,
|
|
90
90
|
size: F,
|
|
91
|
-
variant:
|
|
91
|
+
variant: u,
|
|
92
92
|
status: L,
|
|
93
|
-
children:
|
|
93
|
+
children: p,
|
|
94
94
|
className: v,
|
|
95
95
|
onAfterClose: T,
|
|
96
96
|
labels: V,
|
|
@@ -120,6 +120,7 @@ const W = /* @__PURE__ */ o(
|
|
|
120
120
|
/* @__PURE__ */ r(
|
|
121
121
|
d,
|
|
122
122
|
{
|
|
123
|
+
unmount: !1,
|
|
123
124
|
as: c,
|
|
124
125
|
enter: "rst:ease-out rst:duration-300",
|
|
125
126
|
enterFrom: "rst:opacity-0",
|
|
@@ -132,7 +133,7 @@ const W = /* @__PURE__ */ o(
|
|
|
132
133
|
{
|
|
133
134
|
className: t(
|
|
134
135
|
"rst:fixed rst:inset-0 rst:transition-opacity",
|
|
135
|
-
|
|
136
|
+
u === "glass" ? "rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_40%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_60%,transparent))]" : "rst:bg-[var(--roster-backdrop,color-mix(in_oklab,oklch(20.8%_0.042_265.755)_60%,transparent))] rst:dark:bg-[var(--roster-backdrop,color-mix(in_oklab,var(--roster-black,#1e1c1a)_80%,transparent))] rst:backdrop-blur-backdrop"
|
|
136
137
|
)
|
|
137
138
|
}
|
|
138
139
|
)
|
|
@@ -141,6 +142,7 @@ const W = /* @__PURE__ */ o(
|
|
|
141
142
|
z ? /* @__PURE__ */ r(
|
|
142
143
|
d,
|
|
143
144
|
{
|
|
145
|
+
unmount: !1,
|
|
144
146
|
as: c,
|
|
145
147
|
enter: "rst:ease-out rst:duration-300",
|
|
146
148
|
enterFrom: "rst:opacity-0",
|
|
@@ -152,12 +154,13 @@ const W = /* @__PURE__ */ o(
|
|
|
152
154
|
children: /* @__PURE__ */ s(h, { ref: i, className: t("rst:fixed rst:inset-0 rst:overflow-y-auto", v), children: [
|
|
153
155
|
/* @__PURE__ */ r(k, { as: "h2", className: g ? "rst:sr-only" : t(w()), children: f }),
|
|
154
156
|
a && /* @__PURE__ */ r("p", { className: t(N()), children: a }),
|
|
155
|
-
|
|
157
|
+
p
|
|
156
158
|
] })
|
|
157
159
|
}
|
|
158
160
|
) : /* @__PURE__ */ r("div", { className: "rst:fixed rst:inset-0 rst:overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "rst:flex rst:min-h-full rst:items-center rst:justify-center rst:p-4 rst:text-center", children: /* @__PURE__ */ r(
|
|
159
161
|
d,
|
|
160
162
|
{
|
|
163
|
+
unmount: !1,
|
|
161
164
|
as: c,
|
|
162
165
|
enter: "rst:ease-out rst:duration-300",
|
|
163
166
|
enterFrom: "rst:opacity-0 rst:scale-95",
|
|
@@ -171,7 +174,7 @@ const W = /* @__PURE__ */ o(
|
|
|
171
174
|
{
|
|
172
175
|
ref: i,
|
|
173
176
|
className: t(
|
|
174
|
-
W({ size: F, variant:
|
|
177
|
+
W({ size: F, variant: u, status: L }),
|
|
175
178
|
v
|
|
176
179
|
),
|
|
177
180
|
children: [
|
|
@@ -191,7 +194,7 @@ const W = /* @__PURE__ */ o(
|
|
|
191
194
|
}
|
|
192
195
|
) })
|
|
193
196
|
] }),
|
|
194
|
-
/* @__PURE__ */ r("div", { className: "rst:mt-6", children:
|
|
197
|
+
/* @__PURE__ */ r("div", { className: "rst:mt-6", children: p })
|
|
195
198
|
]
|
|
196
199
|
}
|
|
197
200
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),re=require("react"),se=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),x=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),ne=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),p=require("../../../lib/utils.cjs"),oe=require("../../../lib/labels.cjs"),ie=require("../../../internal/popup.cjs"),ae=require("../../../internal/motion.cjs"),ce=require("../../../internal/page-inert.cjs"),ue=require("../../../internal/leave-watchdog.cjs"),D=require("./sheet-drag.cjs"),le=require("./sheet-title.cjs"),de=require("../../../internal/key-focus.cjs");function fe(o){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const d=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(u,l,d.get?d:{enumerable:!0,get:()=>o[l]})}}return u.default=o,Object.freeze(u)}const r=fe(re),pe={close:"Close"},he="rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full",ge="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",me="rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0",ye="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",z={slide:200,fade:150},be=["input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=image])","textarea","select","[contenteditable]:not([contenteditable=false])"].join(",");function xe(o){return o?"current"in o?o.current:o:null}function ve({target:o}){const u=r.useRef(o),l=r.useRef(!1);return r.useEffect(()=>{u.current=o}),r.useEffect(()=>(l.current=!1,()=>{l.current=!0,queueMicrotask(()=>{if(!l.current)return;const d=xe(u.current);d?.isConnected&&d.focus()})}),[]),null}function je(){return s.jsx("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 20 20",className:"rst:h-5 rst:w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:s.jsx("path",{d:"M5 5l10 10M15 5L5 15"})})}const Ee=({isOpen:o,onClose:u,onAfterClose:l,title:d,hideTitle:B=!1,description:N,actions:q,maxWidth:v=560,initialFocus:j,returnFocus:Y,busy:h=!1,dragToDismiss:E=!0,contentKey:g,labels:V,className:K,children:U})=>{de.useKeyFocus();const X=oe.withLabels(pe,V),{ref:R,inDarkScope:$}=ie.useDarkScope(),k=ae.useReducedMotion(),[G,W]=r.useState(!1);r.useLayoutEffect(()=>{W(!0)},[]);const n=o&&G,C=r.useRef(null),c=r.useRef(null),I=ue.useLeaveWatchdog(C,c,n,k?z.fade:z.slide,l);r.useLayoutEffect(()=>{if(n)return ce.lockPage(R.current)},[n,R]);const w=r.useRef(null),P=r.useRef(null),L=r.useRef(null),S=r.useRef(null),M=r.useId(),m=le.titleSignature(d),O=r.useRef({signature:m,contentKey:g,open:n,busy:h});r.useEffect(()=>{const e=O.current;if(O.current={signature:m,contentKey:g,open:n,busy:h},!e.open||!n)return;const t=e.contentKey!==g,i=e.signature!==m&&!e.busy;!t&&!i||(P.current?.focus(),S.current&&(S.current.scrollTop=0))},[m,g,n,h]),r.useEffect(()=>{if(!n)return;const e=requestAnimationFrame(()=>{const t=c.current,i=document.activeElement;!t||i&&t.contains(i)||(j?.current??L.current)?.focus()});return()=>cancelAnimationFrame(e)},[n,j]);const[A,F]=r.useState(null);r.useEffect(()=>{if(!n)return;const e=window.visualViewport;if(!e)return;const t=()=>{const i=document.activeElement,f=!!i&&!!c.current?.contains(i)&&i.matches(be);F(f?Math.round(e.height):null)};return e.addEventListener("resize",t),document.addEventListener("focusin",t),document.addEventListener("focusout",t),()=>{e.removeEventListener("resize",t),document.removeEventListener("focusin",t),document.removeEventListener("focusout",t),F(null)}},[n]);const a=r.useRef(null),y=r.useRef(!1),_=r.useRef(n);r.useEffect(()=>{_.current=n},[n]);const b=e=>{c.current?.style.setProperty("--rst-sheet-drag",`${e}px`)},T=e=>{const t=c.current;a.current=null,t&&(delete t.dataset.dragging,e==="close"?(u(),requestAnimationFrame(()=>{_.current&&!a.current&&b(0)})):b(0))};r.useEffect(()=>{!n&&a.current&&(a.current=null,c.current&&delete c.current.dataset.dragging),n&&!a.current&&b(0)},[n]);const H=e=>{a.current||(y.current=!1,!(!E||!n)&&(e.pointerType==="mouse"&&(e.button!==0||!w.current?.contains(e.target))||(a.current={pointerId:e.pointerId,x0:e.clientX,y0:e.clientY,dy:0,phase:"pending",samples:[{t:e.timeStamp,y:e.clientY}]})))},J=e=>{const t=a.current;if(!t||e.pointerId!==t.pointerId)return;const i=e.clientX-t.x0,f=e.clientY-t.y0;if(t.phase==="pending"){if(!D.exceedsSheetTapSlop(i,f))return;if(Math.abs(i)>Math.abs(f)){t.phase="ignored";return}t.phase="dragging",y.current=!0;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}c.current&&(c.current.dataset.dragging="")}t.phase==="dragging"&&(t.dy=f,t.samples.push({t:e.timeStamp,y:e.clientY}),t.samples.length>32&&t.samples.shift(),b(Math.max(0,f)))},Q=e=>{const t=a.current;if(!t||e.pointerId!==t.pointerId)return;if(t.phase!=="dragging"){a.current=null;return}t.samples.push({t:e.timeStamp,y:e.clientY});const i=e.clientY-t.y0,f=c.current?.getBoundingClientRect().height??0;T(D.sheetDragOutcome(i,f,D.sheetReleaseVelocity(t.samples)))},Z=e=>{const t=a.current;!t||e.pointerId!==t.pointerId||(t.phase==="dragging"?T("stay"):a.current=null)},ee=e=>{!y.current||e.detail===0||(y.current=!1,e.preventDefault(),e.stopPropagation())},te={"--rst-sheet-max-width":typeof v=="number"?`${v}px`:v,...A!==null&&{"--rst-sheet-keyboard-cap":`${A}px`}};return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:R,hidden:!0}),s.jsxs(x.Dialog,{ref:C,open:n,as:"div",onClose:u,initialFocus:j??L,className:p.cn("rst:font-ui rst:fixed rst:inset-0 rst:z-50 rst:focus:outline-hidden",$&&"dark"),children:[s.jsx(x.DialogBackdrop,{transition:!0,"data-testid":"sheet-backdrop",className:p.cn("rst:fixed rst:inset-0 rst:bg-[var(--roster-backdrop,var(--roster-sheet-backdrop))]",k?ye:me)}),s.jsx("div",{className:"rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center",children:s.jsx(ne.TransitionChild,{unmount:!1,afterLeave:I.afterLeave,children:s.jsxs(x.DialogPanel,{ref:c,style:te,"data-testid":"sheet-panel",className:p.cn("rst:relative rst:flex rst:max-h-[min(92dvh,var(--rst-sheet-keyboard-cap,92dvh))] rst:w-full rst:flex-col","rst:md:max-w-(--rst-sheet-max-width)","rst:rounded-t-2xl rst:border rst:border-b-0 rst:elevation-overlay","rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]","rst:[--roster-ring-offset:var(--roster-popover-bg)]","rst:pb-[env(safe-area-inset-bottom)]","rst:translate-y-[var(--rst-sheet-drag,0px)]",k?ge:he,"rst:data-dragging:transition-none",K),children:[s.jsxs("div",{"data-testid":"sheet-drag-zone",className:p.cn("rst:shrink-0",E&&"rst:touch-none"),onPointerDown:H,onPointerMove:J,onPointerUp:Q,onPointerCancel:Z,onClickCapture:ee,children:[s.jsx("div",{ref:w,"aria-hidden":"true","data-testid":"sheet-handle",className:p.cn("rst:flex rst:h-11 rst:items-start rst:justify-center rst:pt-2",E&&"rst:cursor-grab rst:active:cursor-grabbing"),children:s.jsx("span",{className:"rst:h-1 rst:w-10 rst:rounded-full rst:bg-current rst:opacity-30"})}),s.jsxs("div",{className:"rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4",children:[s.jsxs("div",{className:"rst:min-w-0 rst:flex-1 rst:pt-2",children:[s.jsx(x.DialogTitle,{as:"h2",id:M,ref:P,tabIndex:-1,className:p.cn("rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",B&&"rst:sr-only"),children:d}),N&&s.jsx(se.Description,{as:"p",className:"rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",children:N})]}),q&&s.jsx("div",{className:"rst:flex rst:h-11 rst:shrink-0 rst:items-center rst:gap-1",children:q}),s.jsx("button",{ref:L,type:"button",onClick:u,"aria-label":X.close,className:"rst:inline-flex rst:size-11 rst:shrink-0 rst:-mr-2 rst:cursor-pointer rst:items-center rst:justify-center rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:opacity-100 rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:s.jsx(je,{})})]})]}),s.jsx("div",{ref:S,role:"region","aria-labelledby":M,tabIndex:0,"data-testid":"sheet-content","aria-busy":h||void 0,className:"rst:min-h-0 rst:flex-1 rst:overflow-y-auto rst:overscroll-contain rst:px-5 rst:pb-4 rst:focus:outline-hidden rst:ring-inset rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:U}),s.jsx(ve,{target:Y})]})})})]},I.key)]})};exports.Sheet=Ee;
|
|
@@ -46,7 +46,10 @@ export interface SheetProps {
|
|
|
46
46
|
* Where focus goes on close, over whatever opened the sheet.
|
|
47
47
|
*
|
|
48
48
|
* A sheet opened on page load from a deep link has no opener, so without
|
|
49
|
-
* this focus falls to `<body>`.
|
|
49
|
+
* this focus falls to `<body>`. A sheet whose code loads on its first open
|
|
50
|
+
* can have none either: Headless UI, which keeps the record of what was
|
|
51
|
+
* pressed, starts keeping it only once its code has loaded, after the press
|
|
52
|
+
* that opened the sheet. Remember the press yourself and pass it here.
|
|
50
53
|
*/
|
|
51
54
|
returnFocus?: React.RefObject<HTMLElement | null> | HTMLElement | null;
|
|
52
55
|
/** Sets `aria-busy` on the content region while its content loads. */
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { Description as
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { TransitionChild as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { withLabels as
|
|
9
|
-
import { useDarkScope as
|
|
10
|
-
import { useReducedMotion as
|
|
11
|
-
import { lockPage as
|
|
12
|
-
import { useLeaveWatchdog as
|
|
13
|
-
import { sheetDragOutcome as
|
|
14
|
-
import { titleSignature as
|
|
15
|
-
import { useKeyFocus as
|
|
16
|
-
const
|
|
2
|
+
import { jsxs as d, Fragment as et, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { Description as rt } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
5
|
+
import { Dialog as st, DialogBackdrop as nt, DialogPanel as ot, DialogTitle as at } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
|
|
6
|
+
import { TransitionChild as it } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
7
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
8
|
+
import { withLabels as ct } from "../../../lib/labels.js";
|
|
9
|
+
import { useDarkScope as ut } from "../../../internal/popup.js";
|
|
10
|
+
import { useReducedMotion as lt } from "../../../internal/motion.js";
|
|
11
|
+
import { lockPage as dt } from "../../../internal/page-inert.js";
|
|
12
|
+
import { useLeaveWatchdog as ft } from "../../../internal/leave-watchdog.js";
|
|
13
|
+
import { sheetDragOutcome as pt, sheetReleaseVelocity as mt, exceedsSheetTapSlop as ht } from "./sheet-drag.js";
|
|
14
|
+
import { titleSignature as gt } from "./sheet-title.js";
|
|
15
|
+
import { useKeyFocus as yt } from "../../../internal/key-focus.js";
|
|
16
|
+
const bt = { close: "Close" }, vt = "rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full", xt = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", Et = "rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0", Rt = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", Y = { slide: 200, fade: 150 }, kt = [
|
|
17
17
|
"input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=image])",
|
|
18
18
|
"textarea",
|
|
19
19
|
"select",
|
|
20
20
|
"[contenteditable]:not([contenteditable=false])"
|
|
21
21
|
].join(",");
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function Lt(c) {
|
|
23
|
+
return c ? "current" in c ? c.current : c : null;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
if (!
|
|
32
|
-
const
|
|
33
|
-
|
|
25
|
+
function Ct({ target: c }) {
|
|
26
|
+
const l = r.useRef(c), p = r.useRef(!1);
|
|
27
|
+
return r.useEffect(() => {
|
|
28
|
+
l.current = c;
|
|
29
|
+
}), r.useEffect(() => (p.current = !1, () => {
|
|
30
|
+
p.current = !0, queueMicrotask(() => {
|
|
31
|
+
if (!p.current) return;
|
|
32
|
+
const m = Lt(l.current);
|
|
33
|
+
m?.isConnected && m.focus();
|
|
34
34
|
});
|
|
35
35
|
}), []), null;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Nt() {
|
|
38
38
|
return /* @__PURE__ */ n(
|
|
39
39
|
"svg",
|
|
40
40
|
{
|
|
@@ -50,74 +50,78 @@ function kt() {
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
isOpen:
|
|
55
|
-
onClose:
|
|
56
|
-
onAfterClose:
|
|
57
|
-
title:
|
|
53
|
+
const _t = ({
|
|
54
|
+
isOpen: c,
|
|
55
|
+
onClose: l,
|
|
56
|
+
onAfterClose: p,
|
|
57
|
+
title: m,
|
|
58
58
|
hideTitle: _ = !1,
|
|
59
|
-
description:
|
|
59
|
+
description: S,
|
|
60
60
|
actions: D,
|
|
61
|
-
maxWidth:
|
|
62
|
-
initialFocus:
|
|
61
|
+
maxWidth: x = 560,
|
|
62
|
+
initialFocus: E,
|
|
63
63
|
returnFocus: T,
|
|
64
|
-
busy:
|
|
65
|
-
dragToDismiss:
|
|
66
|
-
contentKey:
|
|
64
|
+
busy: h = !1,
|
|
65
|
+
dragToDismiss: R = !0,
|
|
66
|
+
contentKey: g,
|
|
67
67
|
labels: q,
|
|
68
68
|
className: V,
|
|
69
69
|
children: $
|
|
70
70
|
}) => {
|
|
71
|
-
|
|
72
|
-
const K =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!
|
|
71
|
+
yt();
|
|
72
|
+
const K = ct(bt, q), { ref: k, inDarkScope: U } = ut(), L = lt(), [X, G] = r.useState(!1);
|
|
73
|
+
r.useLayoutEffect(() => {
|
|
74
|
+
G(!0);
|
|
75
|
+
}, []);
|
|
76
|
+
const s = c && X, I = r.useRef(null), i = r.useRef(null), w = ft(I, i, s, L ? Y.fade : Y.slide, p);
|
|
77
|
+
r.useLayoutEffect(() => {
|
|
78
|
+
if (s)
|
|
79
|
+
return dt(k.current);
|
|
80
|
+
}, [s, k]);
|
|
81
|
+
const M = r.useRef(null), P = r.useRef(null), C = r.useRef(null), N = r.useRef(null), A = r.useId(), y = gt(m), F = r.useRef({ signature: y, contentKey: g, open: s, busy: h });
|
|
82
|
+
r.useEffect(() => {
|
|
83
|
+
const t = F.current;
|
|
84
|
+
if (F.current = { signature: y, contentKey: g, open: s, busy: h }, !t.open || !s) return;
|
|
85
|
+
const e = t.contentKey !== g, o = t.signature !== y && !t.busy;
|
|
86
|
+
!e && !o || (P.current?.focus(), N.current && (N.current.scrollTop = 0));
|
|
87
|
+
}, [y, g, s, h]), r.useEffect(() => {
|
|
88
|
+
if (!s) return;
|
|
85
89
|
const t = requestAnimationFrame(() => {
|
|
86
90
|
const e = i.current, o = document.activeElement;
|
|
87
|
-
!e || o && e.contains(o) || (
|
|
91
|
+
!e || o && e.contains(o) || (E?.current ?? C.current)?.focus();
|
|
88
92
|
});
|
|
89
93
|
return () => cancelAnimationFrame(t);
|
|
90
|
-
}, [
|
|
91
|
-
const [
|
|
92
|
-
|
|
93
|
-
if (!
|
|
94
|
+
}, [s, E]);
|
|
95
|
+
const [O, j] = r.useState(null);
|
|
96
|
+
r.useEffect(() => {
|
|
97
|
+
if (!s) return;
|
|
94
98
|
const t = window.visualViewport;
|
|
95
99
|
if (!t) return;
|
|
96
100
|
const e = () => {
|
|
97
|
-
const o = document.activeElement,
|
|
98
|
-
j(
|
|
101
|
+
const o = document.activeElement, u = !!o && !!i.current?.contains(o) && o.matches(kt);
|
|
102
|
+
j(u ? Math.round(t.height) : null);
|
|
99
103
|
};
|
|
100
104
|
return t.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
|
|
101
105
|
t.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e), j(null);
|
|
102
106
|
};
|
|
103
|
-
}, [
|
|
104
|
-
const a =
|
|
105
|
-
|
|
106
|
-
z.current =
|
|
107
|
-
}, [
|
|
108
|
-
const
|
|
107
|
+
}, [s]);
|
|
108
|
+
const a = r.useRef(null), b = r.useRef(!1), z = r.useRef(s);
|
|
109
|
+
r.useEffect(() => {
|
|
110
|
+
z.current = s;
|
|
111
|
+
}, [s]);
|
|
112
|
+
const v = (t) => {
|
|
109
113
|
i.current?.style.setProperty("--rst-sheet-drag", `${t}px`);
|
|
110
114
|
}, B = (t) => {
|
|
111
115
|
const e = i.current;
|
|
112
|
-
a.current = null, e && (delete e.dataset.dragging, t === "close" ? (
|
|
113
|
-
z.current && !a.current &&
|
|
114
|
-
})) :
|
|
116
|
+
a.current = null, e && (delete e.dataset.dragging, t === "close" ? (l(), requestAnimationFrame(() => {
|
|
117
|
+
z.current && !a.current && v(0);
|
|
118
|
+
})) : v(0));
|
|
115
119
|
};
|
|
116
|
-
|
|
117
|
-
!
|
|
118
|
-
}, [
|
|
119
|
-
const
|
|
120
|
-
a.current || (
|
|
120
|
+
r.useEffect(() => {
|
|
121
|
+
!s && a.current && (a.current = null, i.current && delete i.current.dataset.dragging), s && !a.current && v(0);
|
|
122
|
+
}, [s]);
|
|
123
|
+
const Q = (t) => {
|
|
124
|
+
a.current || (b.current = !1, !(!R || !s) && (t.pointerType === "mouse" && (t.button !== 0 || !M.current?.contains(t.target)) || (a.current = {
|
|
121
125
|
pointerId: t.pointerId,
|
|
122
126
|
x0: t.clientX,
|
|
123
127
|
y0: t.clientY,
|
|
@@ -125,25 +129,25 @@ const Bt = ({
|
|
|
125
129
|
phase: "pending",
|
|
126
130
|
samples: [{ t: t.timeStamp, y: t.clientY }]
|
|
127
131
|
})));
|
|
128
|
-
},
|
|
132
|
+
}, H = (t) => {
|
|
129
133
|
const e = a.current;
|
|
130
134
|
if (!e || t.pointerId !== e.pointerId) return;
|
|
131
|
-
const o = t.clientX - e.x0,
|
|
135
|
+
const o = t.clientX - e.x0, u = t.clientY - e.y0;
|
|
132
136
|
if (e.phase === "pending") {
|
|
133
|
-
if (!
|
|
134
|
-
if (Math.abs(o) > Math.abs(
|
|
137
|
+
if (!ht(o, u)) return;
|
|
138
|
+
if (Math.abs(o) > Math.abs(u)) {
|
|
135
139
|
e.phase = "ignored";
|
|
136
140
|
return;
|
|
137
141
|
}
|
|
138
|
-
e.phase = "dragging",
|
|
142
|
+
e.phase = "dragging", b.current = !0;
|
|
139
143
|
try {
|
|
140
144
|
t.currentTarget.setPointerCapture(t.pointerId);
|
|
141
145
|
} catch {
|
|
142
146
|
}
|
|
143
147
|
i.current && (i.current.dataset.dragging = "");
|
|
144
148
|
}
|
|
145
|
-
e.phase === "dragging" && (e.dy =
|
|
146
|
-
},
|
|
149
|
+
e.phase === "dragging" && (e.dy = u, e.samples.push({ t: t.timeStamp, y: t.clientY }), e.samples.length > 32 && e.samples.shift(), v(Math.max(0, u)));
|
|
150
|
+
}, J = (t) => {
|
|
147
151
|
const e = a.current;
|
|
148
152
|
if (!e || t.pointerId !== e.pointerId) return;
|
|
149
153
|
if (e.phase !== "dragging") {
|
|
@@ -151,50 +155,50 @@ const Bt = ({
|
|
|
151
155
|
return;
|
|
152
156
|
}
|
|
153
157
|
e.samples.push({ t: t.timeStamp, y: t.clientY });
|
|
154
|
-
const o = t.clientY - e.y0,
|
|
155
|
-
B(
|
|
156
|
-
},
|
|
158
|
+
const o = t.clientY - e.y0, u = i.current?.getBoundingClientRect().height ?? 0;
|
|
159
|
+
B(pt(o, u, mt(e.samples)));
|
|
160
|
+
}, W = (t) => {
|
|
157
161
|
const e = a.current;
|
|
158
162
|
!e || t.pointerId !== e.pointerId || (e.phase === "dragging" ? B("stay") : a.current = null);
|
|
159
|
-
},
|
|
160
|
-
!
|
|
161
|
-
},
|
|
162
|
-
"--rst-sheet-max-width": typeof
|
|
163
|
-
...
|
|
163
|
+
}, Z = (t) => {
|
|
164
|
+
!b.current || t.detail === 0 || (b.current = !1, t.preventDefault(), t.stopPropagation());
|
|
165
|
+
}, tt = {
|
|
166
|
+
"--rst-sheet-max-width": typeof x == "number" ? `${x}px` : x,
|
|
167
|
+
...O !== null && { "--rst-sheet-keyboard-cap": `${O}px` }
|
|
164
168
|
};
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */ n("span", { ref:
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
|
|
169
|
+
return /* @__PURE__ */ d(et, { children: [
|
|
170
|
+
/* @__PURE__ */ n("span", { ref: k, hidden: !0 }),
|
|
171
|
+
/* @__PURE__ */ d(
|
|
172
|
+
st,
|
|
169
173
|
{
|
|
170
174
|
ref: I,
|
|
171
|
-
open:
|
|
175
|
+
open: s,
|
|
172
176
|
as: "div",
|
|
173
|
-
onClose:
|
|
174
|
-
initialFocus:
|
|
175
|
-
className:
|
|
177
|
+
onClose: l,
|
|
178
|
+
initialFocus: E ?? C,
|
|
179
|
+
className: f(
|
|
176
180
|
"rst:font-ui rst:fixed rst:inset-0 rst:z-50 rst:focus:outline-hidden",
|
|
177
181
|
U && "dark"
|
|
178
182
|
),
|
|
179
183
|
children: [
|
|
180
184
|
/* @__PURE__ */ n(
|
|
181
|
-
|
|
185
|
+
nt,
|
|
182
186
|
{
|
|
183
187
|
transition: !0,
|
|
184
188
|
"data-testid": "sheet-backdrop",
|
|
185
|
-
className:
|
|
189
|
+
className: f(
|
|
186
190
|
"rst:fixed rst:inset-0 rst:bg-[var(--roster-backdrop,var(--roster-sheet-backdrop))]",
|
|
187
|
-
|
|
191
|
+
L ? Rt : Et
|
|
188
192
|
)
|
|
189
193
|
}
|
|
190
194
|
),
|
|
191
|
-
/* @__PURE__ */ n("div", { className: "rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center", children: /* @__PURE__ */ n(
|
|
192
|
-
|
|
195
|
+
/* @__PURE__ */ n("div", { className: "rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center", children: /* @__PURE__ */ n(it, { unmount: !1, afterLeave: w.afterLeave, children: /* @__PURE__ */ d(
|
|
196
|
+
ot,
|
|
193
197
|
{
|
|
194
198
|
ref: i,
|
|
195
|
-
style:
|
|
199
|
+
style: tt,
|
|
196
200
|
"data-testid": "sheet-panel",
|
|
197
|
-
className:
|
|
201
|
+
className: f(
|
|
198
202
|
/* 92dvh, or the visual viewport while the keyboard is up,
|
|
199
203
|
whichever is shorter. */
|
|
200
204
|
"rst:relative rst:flex rst:max-h-[min(92dvh,var(--rst-sheet-keyboard-cap,92dvh))] rst:w-full rst:flex-col",
|
|
@@ -206,62 +210,62 @@ const Bt = ({
|
|
|
206
210
|
"rst:[--roster-ring-offset:var(--roster-popover-bg)]",
|
|
207
211
|
"rst:pb-[env(safe-area-inset-bottom)]",
|
|
208
212
|
"rst:translate-y-[var(--rst-sheet-drag,0px)]",
|
|
209
|
-
|
|
213
|
+
L ? xt : vt,
|
|
210
214
|
"rst:data-dragging:transition-none",
|
|
211
215
|
V
|
|
212
216
|
),
|
|
213
217
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ d(
|
|
215
219
|
"div",
|
|
216
220
|
{
|
|
217
221
|
"data-testid": "sheet-drag-zone",
|
|
218
|
-
className:
|
|
219
|
-
onPointerDown:
|
|
220
|
-
onPointerMove:
|
|
221
|
-
onPointerUp:
|
|
222
|
-
onPointerCancel:
|
|
223
|
-
onClickCapture:
|
|
222
|
+
className: f("rst:shrink-0", R && "rst:touch-none"),
|
|
223
|
+
onPointerDown: Q,
|
|
224
|
+
onPointerMove: H,
|
|
225
|
+
onPointerUp: J,
|
|
226
|
+
onPointerCancel: W,
|
|
227
|
+
onClickCapture: Z,
|
|
224
228
|
children: [
|
|
225
229
|
/* @__PURE__ */ n(
|
|
226
230
|
"div",
|
|
227
231
|
{
|
|
228
|
-
ref:
|
|
232
|
+
ref: M,
|
|
229
233
|
"aria-hidden": "true",
|
|
230
234
|
"data-testid": "sheet-handle",
|
|
231
|
-
className:
|
|
235
|
+
className: f(
|
|
232
236
|
/* The grip sits near the top edge, where a sheet's grabber
|
|
233
237
|
is expected, inside a 44px strip. The header below pulls
|
|
234
238
|
up over the strip's lower part, so a touch there drags
|
|
235
239
|
too (the header is a drag zone) and a mouse drags from
|
|
236
240
|
the 32px above it, the full width of the sheet. */
|
|
237
241
|
"rst:flex rst:h-11 rst:items-start rst:justify-center rst:pt-2",
|
|
238
|
-
|
|
242
|
+
R && "rst:cursor-grab rst:active:cursor-grabbing"
|
|
239
243
|
),
|
|
240
244
|
children: /* @__PURE__ */ n("span", { className: "rst:h-1 rst:w-10 rst:rounded-full rst:bg-current rst:opacity-30" })
|
|
241
245
|
}
|
|
242
246
|
),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ d("div", { className: "rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4", children: [
|
|
248
|
+
/* @__PURE__ */ d("div", { className: "rst:min-w-0 rst:flex-1 rst:pt-2", children: [
|
|
245
249
|
/* @__PURE__ */ n(
|
|
246
|
-
|
|
250
|
+
at,
|
|
247
251
|
{
|
|
248
252
|
as: "h2",
|
|
249
|
-
id:
|
|
253
|
+
id: A,
|
|
250
254
|
ref: P,
|
|
251
255
|
tabIndex: -1,
|
|
252
|
-
className:
|
|
256
|
+
className: f(
|
|
253
257
|
"rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",
|
|
254
258
|
_ && "rst:sr-only"
|
|
255
259
|
),
|
|
256
|
-
children:
|
|
260
|
+
children: m
|
|
257
261
|
}
|
|
258
262
|
),
|
|
259
|
-
|
|
260
|
-
|
|
263
|
+
S && /* @__PURE__ */ n(
|
|
264
|
+
rt,
|
|
261
265
|
{
|
|
262
266
|
as: "p",
|
|
263
267
|
className: "rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",
|
|
264
|
-
children:
|
|
268
|
+
children: S
|
|
265
269
|
}
|
|
266
270
|
)
|
|
267
271
|
] }),
|
|
@@ -271,12 +275,12 @@ const Bt = ({
|
|
|
271
275
|
/* @__PURE__ */ n(
|
|
272
276
|
"button",
|
|
273
277
|
{
|
|
274
|
-
ref:
|
|
278
|
+
ref: C,
|
|
275
279
|
type: "button",
|
|
276
|
-
onClick:
|
|
280
|
+
onClick: l,
|
|
277
281
|
"aria-label": K.close,
|
|
278
282
|
className: "rst:inline-flex rst:size-11 rst:shrink-0 rst:-mr-2 rst:cursor-pointer rst:items-center rst:justify-center rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:opacity-100 rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",
|
|
279
|
-
children: /* @__PURE__ */ n(
|
|
283
|
+
children: /* @__PURE__ */ n(Nt, {})
|
|
280
284
|
}
|
|
281
285
|
)
|
|
282
286
|
] })
|
|
@@ -286,26 +290,26 @@ const Bt = ({
|
|
|
286
290
|
/* @__PURE__ */ n(
|
|
287
291
|
"div",
|
|
288
292
|
{
|
|
289
|
-
ref:
|
|
293
|
+
ref: N,
|
|
290
294
|
role: "region",
|
|
291
|
-
"aria-labelledby":
|
|
295
|
+
"aria-labelledby": A,
|
|
292
296
|
tabIndex: 0,
|
|
293
297
|
"data-testid": "sheet-content",
|
|
294
|
-
"aria-busy":
|
|
298
|
+
"aria-busy": h || void 0,
|
|
295
299
|
className: "rst:min-h-0 rst:flex-1 rst:overflow-y-auto rst:overscroll-contain rst:px-5 rst:pb-4 rst:focus:outline-hidden rst:ring-inset rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
|
|
296
300
|
children: $
|
|
297
301
|
}
|
|
298
302
|
),
|
|
299
|
-
/* @__PURE__ */ n(
|
|
303
|
+
/* @__PURE__ */ n(Ct, { target: T })
|
|
300
304
|
]
|
|
301
305
|
}
|
|
302
306
|
) }) })
|
|
303
307
|
]
|
|
304
308
|
},
|
|
305
|
-
|
|
309
|
+
w.key
|
|
306
310
|
)
|
|
307
311
|
] });
|
|
308
312
|
};
|
|
309
313
|
export {
|
|
310
|
-
|
|
314
|
+
_t as Sheet
|
|
311
315
|
};
|
package/dist/meta.json
CHANGED
package/package.json
CHANGED