@uisatin/ui 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +67 -2
- package/chunk-2HKBZFIK.js +339 -0
- package/chunk-2HKBZFIK.js.map +1 -0
- package/chunk-3DINAQLL.js +153 -0
- package/chunk-3DINAQLL.js.map +1 -0
- package/chunk-3ERGAHKA.js +179 -0
- package/chunk-3ERGAHKA.js.map +1 -0
- package/chunk-6C7CGJX2.js +86 -0
- package/chunk-6C7CGJX2.js.map +1 -0
- package/chunk-6QMSWITQ.js +140 -0
- package/chunk-6QMSWITQ.js.map +1 -0
- package/chunk-6YXUBP27.js +474 -0
- package/chunk-6YXUBP27.js.map +1 -0
- package/chunk-72OCFAPT.js +175 -0
- package/chunk-72OCFAPT.js.map +1 -0
- package/chunk-7TXHCRAG.js +51 -0
- package/chunk-7TXHCRAG.js.map +1 -0
- package/chunk-A5XEM3GF.js +260 -0
- package/chunk-A5XEM3GF.js.map +1 -0
- package/chunk-AN2RNJLR.js +79 -0
- package/chunk-AN2RNJLR.js.map +1 -0
- package/chunk-B2K45IUR.js +36 -0
- package/chunk-B2K45IUR.js.map +1 -0
- package/chunk-B6V4VSGH.js +82 -0
- package/chunk-B6V4VSGH.js.map +1 -0
- package/chunk-BKZBWPUH.js +59 -0
- package/chunk-BKZBWPUH.js.map +1 -0
- package/chunk-BNTPPZCK.js +220 -0
- package/chunk-BNTPPZCK.js.map +1 -0
- package/chunk-BNZVTLHV.js +98 -0
- package/chunk-BNZVTLHV.js.map +1 -0
- package/chunk-CL2II6BX.js +89 -0
- package/chunk-CL2II6BX.js.map +1 -0
- package/chunk-D7RZNTFC.js +95 -0
- package/chunk-D7RZNTFC.js.map +1 -0
- package/chunk-DETGJAIC.js +147 -0
- package/chunk-DETGJAIC.js.map +1 -0
- package/chunk-DO3TBNSC.js +130 -0
- package/chunk-DO3TBNSC.js.map +1 -0
- package/chunk-ESC5JCVQ.js +90 -0
- package/chunk-ESC5JCVQ.js.map +1 -0
- package/chunk-FDKIX4DC.js +55 -0
- package/chunk-FDKIX4DC.js.map +1 -0
- package/chunk-GICKPMJU.js +239 -0
- package/chunk-GICKPMJU.js.map +1 -0
- package/chunk-GQA24FYG.js +57 -0
- package/chunk-GQA24FYG.js.map +1 -0
- package/chunk-H4NU7NPO.js +264 -0
- package/chunk-H4NU7NPO.js.map +1 -0
- package/chunk-H63FYCMY.js +11 -0
- package/chunk-H63FYCMY.js.map +1 -0
- package/chunk-HL42K2NH.js +76 -0
- package/chunk-HL42K2NH.js.map +1 -0
- package/chunk-HNQUX43Z.js +109 -0
- package/chunk-HNQUX43Z.js.map +1 -0
- package/chunk-HRKPV66B.js +32 -0
- package/chunk-HRKPV66B.js.map +1 -0
- package/chunk-J3NSDRVH.js +83 -0
- package/chunk-J3NSDRVH.js.map +1 -0
- package/chunk-JPNWHWAQ.js +151 -0
- package/chunk-JPNWHWAQ.js.map +1 -0
- package/chunk-KNUWZNFV.js +240 -0
- package/chunk-KNUWZNFV.js.map +1 -0
- package/chunk-L6NCCSIP.js +213 -0
- package/chunk-L6NCCSIP.js.map +1 -0
- package/chunk-LLHTVIM3.js +50 -0
- package/chunk-LLHTVIM3.js.map +1 -0
- package/chunk-LW3TRU5W.js +131 -0
- package/chunk-LW3TRU5W.js.map +1 -0
- package/chunk-LZMKSFCF.js +79 -0
- package/chunk-LZMKSFCF.js.map +1 -0
- package/chunk-MR3JDI7E.js +122 -0
- package/chunk-MR3JDI7E.js.map +1 -0
- package/chunk-NN6PKJWS.js +44 -0
- package/chunk-NN6PKJWS.js.map +1 -0
- package/chunk-NSRTTYQ4.js +252 -0
- package/chunk-NSRTTYQ4.js.map +1 -0
- package/chunk-O7F3CIDV.js +45 -0
- package/chunk-O7F3CIDV.js.map +1 -0
- package/chunk-P4O6TGDR.js +166 -0
- package/chunk-P4O6TGDR.js.map +1 -0
- package/chunk-PF3YBUKT.js +81 -0
- package/chunk-PF3YBUKT.js.map +1 -0
- package/chunk-PVOLDO4G.js +47 -0
- package/chunk-PVOLDO4G.js.map +1 -0
- package/chunk-QS4N4MNP.js +215 -0
- package/chunk-QS4N4MNP.js.map +1 -0
- package/chunk-QUF2IPOZ.js +98 -0
- package/chunk-QUF2IPOZ.js.map +1 -0
- package/chunk-RTJ76X5U.js +126 -0
- package/chunk-RTJ76X5U.js.map +1 -0
- package/chunk-SH6NG6VN.js +40 -0
- package/chunk-SH6NG6VN.js.map +1 -0
- package/chunk-SHDFUXYV.js +195 -0
- package/chunk-SHDFUXYV.js.map +1 -0
- package/chunk-TKO44NDI.js +84 -0
- package/chunk-TKO44NDI.js.map +1 -0
- package/chunk-TVLGZGYN.js +59 -0
- package/chunk-TVLGZGYN.js.map +1 -0
- package/chunk-TX3H3QMA.js +520 -0
- package/chunk-TX3H3QMA.js.map +1 -0
- package/chunk-UBNHSZSE.js +88 -0
- package/chunk-UBNHSZSE.js.map +1 -0
- package/chunk-UC3ZJWOD.js +73 -0
- package/chunk-UC3ZJWOD.js.map +1 -0
- package/chunk-UGRSWP6U.js +69 -0
- package/chunk-UGRSWP6U.js.map +1 -0
- package/chunk-VAGIAREV.js +214 -0
- package/chunk-VAGIAREV.js.map +1 -0
- package/chunk-WTMZT3IT.js +105 -0
- package/chunk-WTMZT3IT.js.map +1 -0
- package/chunk-WX6BP5ZP.js +39 -0
- package/chunk-WX6BP5ZP.js.map +1 -0
- package/chunk-X3PQANZO.js +255 -0
- package/chunk-X3PQANZO.js.map +1 -0
- package/chunk-XILQ7GXE.js +66 -0
- package/chunk-XILQ7GXE.js.map +1 -0
- package/chunk-XL75JRUA.js +130 -0
- package/chunk-XL75JRUA.js.map +1 -0
- package/chunk-XZNHT6MO.js +348 -0
- package/chunk-XZNHT6MO.js.map +1 -0
- package/chunk-Y5AYU7PK.js +44 -0
- package/chunk-Y5AYU7PK.js.map +1 -0
- package/chunk-YG7JOOLJ.js +28 -0
- package/chunk-YG7JOOLJ.js.map +1 -0
- package/chunk-YPJYW624.js +195 -0
- package/chunk-YPJYW624.js.map +1 -0
- package/chunk-YPNKBE5X.js +104 -0
- package/chunk-YPNKBE5X.js.map +1 -0
- package/chunk-YX5VNRJX.js +24 -0
- package/chunk-YX5VNRJX.js.map +1 -0
- package/components/accordion.d.ts +27 -0
- package/components/accordion.js +4 -0
- package/components/accordion.js.map +1 -0
- package/components/agent-loading.d.ts +65 -0
- package/components/agent-loading.js +4 -0
- package/components/agent-loading.js.map +1 -0
- package/components/agent-picker.d.ts +82 -0
- package/components/agent-picker.js +5 -0
- package/components/agent-picker.js.map +1 -0
- package/components/agent-suggestion.d.ts +69 -0
- package/components/agent-suggestion.js +6 -0
- package/components/agent-suggestion.js.map +1 -0
- package/components/announcement-bar.d.ts +39 -0
- package/components/announcement-bar.js +7 -0
- package/components/announcement-bar.js.map +1 -0
- package/components/attachment.d.ts +73 -0
- package/components/attachment.js +5 -0
- package/components/attachment.js.map +1 -0
- package/components/avatar.d.ts +34 -0
- package/components/avatar.js +6 -0
- package/components/avatar.js.map +1 -0
- package/components/badge.d.ts +19 -0
- package/components/badge.js +4 -0
- package/components/badge.js.map +1 -0
- package/components/banner-mesh.d.ts +11 -0
- package/components/banner-mesh.js +3 -0
- package/components/banner-mesh.js.map +1 -0
- package/components/banner.d.ts +50 -0
- package/components/banner.js +6 -0
- package/components/banner.js.map +1 -0
- package/components/bar-chart.d.ts +32 -0
- package/components/bar-chart.js +11 -0
- package/components/bar-chart.js.map +1 -0
- package/components/breadcrumb.d.ts +32 -0
- package/components/breadcrumb.js +6 -0
- package/components/breadcrumb.js.map +1 -0
- package/components/button.d.ts +32 -0
- package/components/button.js +4 -0
- package/components/button.js.map +1 -0
- package/components/card.d.ts +28 -0
- package/components/card.js +5 -0
- package/components/card.js.map +1 -0
- package/components/channel-chart.d.ts +14 -0
- package/components/channel-chart.js +11 -0
- package/components/channel-chart.js.map +1 -0
- package/components/chart.d.ts +88 -0
- package/components/chart.js +10 -0
- package/components/chart.js.map +1 -0
- package/components/checkbox.d.ts +17 -0
- package/components/checkbox.js +4 -0
- package/components/checkbox.js.map +1 -0
- package/components/chip.d.ts +54 -0
- package/components/chip.js +4 -0
- package/components/chip.js.map +1 -0
- package/components/citations.d.ts +37 -0
- package/components/citations.js +5 -0
- package/components/citations.js.map +1 -0
- package/components/code-block.d.ts +13 -0
- package/components/code-block.js +5 -0
- package/components/code-block.js.map +1 -0
- package/components/combobox.d.ts +58 -0
- package/components/combobox.js +10 -0
- package/components/combobox.js.map +1 -0
- package/components/command-menu.d.ts +54 -0
- package/components/command-menu.js +6 -0
- package/components/command-menu.js.map +1 -0
- package/components/context-menu.d.ts +46 -0
- package/components/context-menu.js +6 -0
- package/components/context-menu.js.map +1 -0
- package/components/cookie-consent.d.ts +26 -0
- package/components/cookie-consent.js +5 -0
- package/components/cookie-consent.js.map +1 -0
- package/components/date-picker.d.ts +112 -0
- package/components/date-picker.js +9 -0
- package/components/date-picker.js.map +1 -0
- package/components/decision-card.d.ts +65 -0
- package/components/decision-card.js +7 -0
- package/components/decision-card.js.map +1 -0
- package/components/dialog.d.ts +68 -0
- package/components/dialog.js +5 -0
- package/components/dialog.js.map +1 -0
- package/components/donut-chart.d.ts +20 -0
- package/components/donut-chart.js +11 -0
- package/components/donut-chart.js.map +1 -0
- package/components/dot.d.ts +21 -0
- package/components/dot.js +4 -0
- package/components/dot.js.map +1 -0
- package/components/dropdown.d.ts +74 -0
- package/components/dropdown.js +5 -0
- package/components/dropdown.js.map +1 -0
- package/components/empty-state.d.ts +25 -0
- package/components/empty-state.js +4 -0
- package/components/empty-state.js.map +1 -0
- package/components/file-upload.d.ts +78 -0
- package/components/file-upload.js +7 -0
- package/components/file-upload.js.map +1 -0
- package/components/floating.d.ts +30 -0
- package/components/floating.js +3 -0
- package/components/floating.js.map +1 -0
- package/components/form-field.d.ts +35 -0
- package/components/form-field.js +4 -0
- package/components/form-field.js.map +1 -0
- package/components/hover-card.d.ts +30 -0
- package/components/hover-card.js +4 -0
- package/components/hover-card.js.map +1 -0
- package/components/input-otp.d.ts +49 -0
- package/components/input-otp.js +8 -0
- package/components/input-otp.js.map +1 -0
- package/components/input.d.ts +28 -0
- package/components/input.js +5 -0
- package/components/input.js.map +1 -0
- package/components/kbd.d.ts +37 -0
- package/components/kbd.js +4 -0
- package/components/kbd.js.map +1 -0
- package/components/line-chart.d.ts +29 -0
- package/components/line-chart.js +12 -0
- package/components/line-chart.js.map +1 -0
- package/components/message-actions.d.ts +24 -0
- package/components/message-actions.js +5 -0
- package/components/message-actions.js.map +1 -0
- package/components/message.d.ts +40 -0
- package/components/message.js +8 -0
- package/components/message.js.map +1 -0
- package/components/number-input.d.ts +33 -0
- package/components/number-input.js +8 -0
- package/components/number-input.js.map +1 -0
- package/components/pagination.d.ts +45 -0
- package/components/pagination.js +6 -0
- package/components/pagination.js.map +1 -0
- package/components/popover.d.ts +44 -0
- package/components/popover.js +4 -0
- package/components/popover.js.map +1 -0
- package/components/progress.d.ts +24 -0
- package/components/progress.js +4 -0
- package/components/progress.js.map +1 -0
- package/components/prompt-bar.d.ts +63 -0
- package/components/prompt-bar.js +6 -0
- package/components/prompt-bar.js.map +1 -0
- package/components/radio.d.ts +27 -0
- package/components/radio.js +4 -0
- package/components/radio.js.map +1 -0
- package/components/search-bar.d.ts +20 -0
- package/components/search-bar.js +5 -0
- package/components/search-bar.js.map +1 -0
- package/components/segmented-control.d.ts +32 -0
- package/components/segmented-control.js +5 -0
- package/components/segmented-control.js.map +1 -0
- package/components/select.d.ts +97 -0
- package/components/select.js +7 -0
- package/components/select.js.map +1 -0
- package/components/sheet.d.ts +37 -0
- package/components/sheet.js +6 -0
- package/components/sheet.js.map +1 -0
- package/components/sidebar.d.ts +52 -0
- package/components/sidebar.js +4 -0
- package/components/sidebar.js.map +1 -0
- package/components/skeleton.d.ts +18 -0
- package/components/skeleton.js +4 -0
- package/components/skeleton.js.map +1 -0
- package/components/slider.d.ts +57 -0
- package/components/slider.js +8 -0
- package/components/slider.js.map +1 -0
- package/components/sliding-indicator.d.ts +23 -0
- package/components/sliding-indicator.js +3 -0
- package/components/sliding-indicator.js.map +1 -0
- package/components/streaming-text.d.ts +33 -0
- package/components/streaming-text.js +4 -0
- package/components/streaming-text.js.map +1 -0
- package/components/switch.d.ts +15 -0
- package/components/switch.js +4 -0
- package/components/switch.js.map +1 -0
- package/components/table.d.ts +57 -0
- package/components/table.js +5 -0
- package/components/table.js.map +1 -0
- package/components/tabs.d.ts +45 -0
- package/components/tabs.js +5 -0
- package/components/tabs.js.map +1 -0
- package/components/textarea.d.ts +30 -0
- package/components/textarea.js +5 -0
- package/components/textarea.js.map +1 -0
- package/components/thinking.d.ts +64 -0
- package/components/thinking.js +5 -0
- package/components/thinking.js.map +1 -0
- package/components/toast.d.ts +71 -0
- package/components/toast.js +5 -0
- package/components/toast.js.map +1 -0
- package/components/toggle.d.ts +30 -0
- package/components/toggle.js +4 -0
- package/components/toggle.js.map +1 -0
- package/components/tooltip.d.ts +35 -0
- package/components/tooltip.js +5 -0
- package/components/tooltip.js.map +1 -0
- package/index.d.ts +64 -0
- package/index.js +231 -0
- package/index.js.map +1 -0
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +3 -0
- package/lib/utils.js.map +1 -0
- package/package.json +54 -4
- package/styles.css +2 -0
- package/theme/create-theme.d.ts +44 -0
- package/theme/index.d.ts +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maciej Kownacki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uisatin/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Satin's React components: shadcn-based, built on Radix, themed with Satin tokens. Docs: https://uisatin.dev
|
|
4
|
+
|
|
5
|
+
**Satin Free.** This package is the free, open-source edition of Satin, under the MIT license. Satin Pro, with more components, patterns and templates, will ship separately as its own licensed package; nothing here changes when it does.
|
|
6
|
+
|
|
7
|
+
You don't need Tailwind. Satin ships one precompiled stylesheet with the tokens and every class the components use.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i @uisatin/ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
React 19 or newer is a peer dependency.
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
Import the styles once, at the root of your app:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
// main.tsx
|
|
23
|
+
import '@uisatin/ui/styles.css'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then import components, from the package root or one by one:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Button } from '@uisatin/ui/button'
|
|
30
|
+
|
|
31
|
+
export function Save() {
|
|
32
|
+
return <Button>Save changes</Button>
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Dark mode:** add the `dark` class to `<html>` or any parent element.
|
|
37
|
+
|
|
38
|
+
**Font:** the tokens ask for Geist and Geist Mono; load them (for example with `@fontsource-variable/geist`) or the system font is used.
|
|
39
|
+
|
|
40
|
+
## Copy the source instead (shadcn registry)
|
|
41
|
+
|
|
42
|
+
Every component is also a shadcn registry item, so you can own the code:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npx shadcn@latest add https://uisatin.dev/r/button.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This adds the component to `components/ui`, `cn` to `lib/utils` and the precompiled styles to `src/styles/satin.css` (import it once). See https://uisatin.dev/installation. Each registry item carries `meta.version` (the npm release its source matches) and `meta.edition`.
|
|
49
|
+
|
|
50
|
+
## Develop
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npm run build -w @uisatin/ui # dist/: ESM + types + styles.css + the published package.json
|
|
54
|
+
npm run pack:ui # build and pack dist into satin-ui-x.y.z.tgz, to try in another app
|
|
55
|
+
npm run registry # rebuild satin-lab/public/r (the shadcn registry)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Release
|
|
59
|
+
|
|
60
|
+
Releases go through [Changesets](https://github.com/changesets/changesets):
|
|
61
|
+
|
|
62
|
+
1. With a change, run `npm run changeset`, pick patch, minor or major and describe it. Commit the file it writes.
|
|
63
|
+
2. On `main`, the Release workflow opens a "Version packages" pull request that bumps the version and writes the changelog.
|
|
64
|
+
3. Merging it publishes `packages/ui/dist` to npm (`npm run release`) and tags the commit `@uisatin/ui@x.y.z`.
|
|
65
|
+
|
|
66
|
+
The workflow publishes through npm Trusted Publishing (OIDC), so no npm token is stored: npm trusts `.github/workflows/release.yml` in this repository. `npm run release` also works by hand after `npm login`; it skips a version that is already on npm. Never `npm publish` the workspace folder: it points at `src` and refuses to publish.
|
|
67
|
+
|
|
68
|
+
The workspace `package.json` points at `src` so the docs site builds from source with its own Tailwind. `dist/package.json`, written by the build, points consumers at the compiled files.
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { Button } from './chunk-HNQUX43Z.js';
|
|
2
|
+
import { cn } from './chunk-H63FYCMY.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Toast as Toast$1 } from 'radix-ui';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var MOTION_MS = 500;
|
|
8
|
+
var records = [];
|
|
9
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
10
|
+
var counter = 0;
|
|
11
|
+
function emit() {
|
|
12
|
+
for (const listener of listeners) listener();
|
|
13
|
+
}
|
|
14
|
+
function subscribe(listener) {
|
|
15
|
+
listeners.add(listener);
|
|
16
|
+
return () => listeners.delete(listener);
|
|
17
|
+
}
|
|
18
|
+
function snapshot() {
|
|
19
|
+
return records;
|
|
20
|
+
}
|
|
21
|
+
function show(title, options = {}) {
|
|
22
|
+
const id = options.id ?? `toast-${++counter}`;
|
|
23
|
+
const next = { ...options, id, title, open: true };
|
|
24
|
+
records = records.some((r) => r.id === id) ? records.map((r) => r.id === id ? next : r) : [...records, next];
|
|
25
|
+
emit();
|
|
26
|
+
return id;
|
|
27
|
+
}
|
|
28
|
+
function remove(id) {
|
|
29
|
+
records = records.filter((r) => r.id !== id);
|
|
30
|
+
emit();
|
|
31
|
+
}
|
|
32
|
+
function close(id, reason = "close") {
|
|
33
|
+
const r = records.find((r2) => r2.id === id);
|
|
34
|
+
if (!r || !r.open) return;
|
|
35
|
+
records = records.map((r2) => r2.id === id ? { ...r2, open: false, exit: reason } : r2);
|
|
36
|
+
emit();
|
|
37
|
+
setTimeout(() => remove(id), MOTION_MS);
|
|
38
|
+
}
|
|
39
|
+
var toast = Object.assign((title, options) => show(title, options), {
|
|
40
|
+
info: ((title, options) => show(title, { ...options, intent: "info" })),
|
|
41
|
+
success: ((title, options) => show(title, { ...options, intent: "success" })),
|
|
42
|
+
warning: ((title, options) => show(title, { ...options, intent: "warning" })),
|
|
43
|
+
error: ((title, options) => show(title, { ...options, intent: "error" })),
|
|
44
|
+
/** Close one toast, or all of them. */
|
|
45
|
+
dismiss: (id) => {
|
|
46
|
+
for (const r of id === void 0 ? records : records.filter((r2) => r2.id === id)) close(r.id);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var tile = {
|
|
50
|
+
neutral: "bg-status-neutral-bg text-text-default",
|
|
51
|
+
info: "bg-status-sky-bg text-status-sky-fg",
|
|
52
|
+
success: "bg-status-green-bg text-status-green-fg",
|
|
53
|
+
warning: "bg-status-amber-bg text-status-amber-fg",
|
|
54
|
+
// Figma draws the error glyph in action/destructive (#DC2626), not status-red-fg.
|
|
55
|
+
error: "bg-status-red-bg text-action-destructive-bg"
|
|
56
|
+
};
|
|
57
|
+
function IntentIcon({ intent }) {
|
|
58
|
+
if (intent === "neutral") {
|
|
59
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "-1 -1 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxs("g", { stroke: "currentColor", style: { strokeWidth: 1.25 }, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
60
|
+
/* @__PURE__ */ jsx("path", { d: "M11.2738 4.61052C12.3146 4.61052 13.1582 3.76684 13.1582 2.72612C13.1582 1.6854 12.3146 0.841726 11.2738 0.841726C10.2331 0.841726 9.38944 1.6854 9.38944 2.72612C9.38944 3.76684 10.2331 4.61052 11.2738 4.61052Z" }),
|
|
61
|
+
/* @__PURE__ */ jsx("path", { d: "M12.9121 7.12311V9.13483C12.9121 11.3569 11.1107 13.1583 8.88866 13.1583H4.86521C2.64313 13.1583 0.84177 11.3569 0.84177 9.13483V5.11139C0.84177 2.8893 2.64313 1.08794 4.86521 1.08794H6.87694" })
|
|
62
|
+
] }) });
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("g", { stroke: "currentColor", style: { strokeWidth: 1.25 }, strokeLinecap: "round", strokeLinejoin: "round", children: intent === "success" ? /* @__PURE__ */ jsx("path", { d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
|
+
intent === "info" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M8 7.70494V10.6557" }),
|
|
67
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.35022L8.0059 5.34366" })
|
|
68
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.34428V8.29506" }),
|
|
70
|
+
/* @__PURE__ */ jsx("path", { d: "M8 10.6563L8.0059 10.6498" })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx("path", { d: "M8 13.9015C11.2593 13.9015 13.9015 11.2593 13.9015 8C13.9015 4.74066 11.2593 2.09845 8 2.09845C4.74066 2.09845 2.09845 4.74066 2.09845 8C2.09845 11.2593 4.74066 13.9015 8 13.9015Z" })
|
|
73
|
+
] }) }) });
|
|
74
|
+
}
|
|
75
|
+
var card = (intent) => cn(
|
|
76
|
+
"relative flex w-full items-center gap-2.5 overflow-clip pr-2 pl-2.5",
|
|
77
|
+
intent === "neutral" ? "py-2.5" : "pt-2.5 pb-3",
|
|
78
|
+
"rounded-xl border border-border-default bg-bg-popover",
|
|
79
|
+
"[box-shadow:0_4px_6px_-4px_var(--effect-shadow-sm),0_10px_15px_-3px_var(--effect-shadow-sm)]"
|
|
80
|
+
);
|
|
81
|
+
function ToastContent({
|
|
82
|
+
title,
|
|
83
|
+
description,
|
|
84
|
+
intent,
|
|
85
|
+
action,
|
|
86
|
+
closeButton,
|
|
87
|
+
icon,
|
|
88
|
+
onAction
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
+
icon && /* @__PURE__ */ jsx("div", { className: cn("grid size-9 shrink-0 place-items-center rounded-md", tile[intent]), children: /* @__PURE__ */ jsx(IntentIcon, { intent }) }),
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col text-sm", children: [
|
|
93
|
+
/* @__PURE__ */ jsx(Toast$1.Title, { className: "leading-5 font-medium text-text-default", children: title }),
|
|
94
|
+
description ? /* @__PURE__ */ jsx(Toast$1.Description, { className: "leading-4 text-text-muted", children: description }) : null
|
|
95
|
+
] }),
|
|
96
|
+
(action || closeButton) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
97
|
+
action && /* @__PURE__ */ jsx(Toast$1.Action, { asChild: true, altText: action.label, children: /* @__PURE__ */ jsx(
|
|
98
|
+
Button,
|
|
99
|
+
{
|
|
100
|
+
variant: "secondary",
|
|
101
|
+
onClick: () => {
|
|
102
|
+
onAction?.();
|
|
103
|
+
action.onClick?.();
|
|
104
|
+
},
|
|
105
|
+
children: action.label
|
|
106
|
+
}
|
|
107
|
+
) }),
|
|
108
|
+
closeButton && /* @__PURE__ */ jsx(Toast$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "xs", iconOnly: true, "aria-label": "Close", className: "rounded-md text-text-muted", children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
109
|
+
"path",
|
|
110
|
+
{
|
|
111
|
+
d: "M3.94232 10.0582L7.00053 7M7.00053 7L10.0587 3.94179M7.00053 7L3.94232 3.94179M7.00053 7L10.0587 10.0582",
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
strokeWidth: "1.09375",
|
|
114
|
+
strokeLinecap: "round",
|
|
115
|
+
strokeLinejoin: "round"
|
|
116
|
+
}
|
|
117
|
+
) }) }) })
|
|
118
|
+
] })
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
var radixType = (intent) => intent === "error" || intent === "warning" ? "foreground" : "background";
|
|
122
|
+
function Toast({
|
|
123
|
+
title,
|
|
124
|
+
description,
|
|
125
|
+
intent = "neutral",
|
|
126
|
+
action,
|
|
127
|
+
closeButton = true,
|
|
128
|
+
icon = true,
|
|
129
|
+
duration = 5e3,
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
Toast$1.Root,
|
|
135
|
+
{
|
|
136
|
+
"data-slot": "toast",
|
|
137
|
+
"data-intent": intent,
|
|
138
|
+
duration,
|
|
139
|
+
type: radixType(intent),
|
|
140
|
+
className: cn(
|
|
141
|
+
"pointer-events-auto",
|
|
142
|
+
card(intent),
|
|
143
|
+
"focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)] focus-visible:outline-none",
|
|
144
|
+
"data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]",
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
...props,
|
|
148
|
+
children: /* @__PURE__ */ jsx(ToastContent, { title, description, intent, action, closeButton, icon })
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
var PEEK = 16;
|
|
153
|
+
var SCALE_STEP = 0.05;
|
|
154
|
+
var GAP = 8;
|
|
155
|
+
var FALLBACK_HEIGHT = 58;
|
|
156
|
+
var OFFSCREEN = "150%";
|
|
157
|
+
var ease = "var(--ease-out)";
|
|
158
|
+
var cardMotion = `transform ${MOTION_MS}ms ${ease}, height 150ms ${ease}`;
|
|
159
|
+
var contentMotion = `opacity 250ms ${ease}`;
|
|
160
|
+
function StackedToast({ record, index, y, scale, height, beyond, contentVisible, onMeasure, onForget }) {
|
|
161
|
+
const { id, title, open, duration, exit: _exit, intent = "neutral", icon = true, closeButton = true, ...options } = record;
|
|
162
|
+
const [entered, setEntered] = React.useState(false);
|
|
163
|
+
const cardRef = React.useRef(null);
|
|
164
|
+
React.useLayoutEffect(() => {
|
|
165
|
+
cardRef.current?.getBoundingClientRect();
|
|
166
|
+
setEntered(true);
|
|
167
|
+
}, []);
|
|
168
|
+
const measured = React.useCallback(
|
|
169
|
+
(node) => {
|
|
170
|
+
if (!node) return;
|
|
171
|
+
const card2 = node.parentElement;
|
|
172
|
+
const report = () => {
|
|
173
|
+
const cs = getComputedStyle(card2);
|
|
174
|
+
const chrome = ["paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth"].reduce((t, k) => t + parseFloat(cs[k]), 0);
|
|
175
|
+
onMeasure(id, node.offsetHeight + chrome);
|
|
176
|
+
};
|
|
177
|
+
report();
|
|
178
|
+
const observer = new ResizeObserver(report);
|
|
179
|
+
observer.observe(node);
|
|
180
|
+
return () => {
|
|
181
|
+
observer.disconnect();
|
|
182
|
+
onForget(id);
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
[id, onMeasure, onForget]
|
|
186
|
+
);
|
|
187
|
+
const inPlace = entered && open;
|
|
188
|
+
return /* @__PURE__ */ jsx(
|
|
189
|
+
Toast$1.Root,
|
|
190
|
+
{
|
|
191
|
+
"data-slot": "toast",
|
|
192
|
+
"data-intent": intent,
|
|
193
|
+
forceMount: true,
|
|
194
|
+
open,
|
|
195
|
+
onOpenChange: (next) => !next && close(id),
|
|
196
|
+
duration: duration ?? 5e3,
|
|
197
|
+
type: radixType(intent),
|
|
198
|
+
className: cn(
|
|
199
|
+
"absolute inset-x-0 bottom-0 origin-bottom outline-none",
|
|
200
|
+
"focus-visible:[&>div]:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
201
|
+
"data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x)",
|
|
202
|
+
"data-[swipe=cancel]:transition-[translate] data-[swipe=cancel]:duration-(--duration-base) data-[swipe=cancel]:ease-(--ease-out)"
|
|
203
|
+
),
|
|
204
|
+
style: {
|
|
205
|
+
transform: `translate3d(0, ${y}px, 0) scale(${scale})`,
|
|
206
|
+
opacity: beyond ? 0 : 1,
|
|
207
|
+
zIndex: 1e3 - index,
|
|
208
|
+
pointerEvents: beyond || !open ? "none" : void 0,
|
|
209
|
+
transition: `transform ${MOTION_MS}ms ${ease}, opacity ${MOTION_MS}ms ${ease}`
|
|
210
|
+
},
|
|
211
|
+
children: /* @__PURE__ */ jsx(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
ref: cardRef,
|
|
215
|
+
className: cn("pointer-events-auto", card(intent), "items-start"),
|
|
216
|
+
style: {
|
|
217
|
+
transform: inPlace ? "translate3d(0, 0, 0)" : `translate3d(0, ${OFFSCREEN}, 0)`,
|
|
218
|
+
height,
|
|
219
|
+
transition: cardMotion,
|
|
220
|
+
willChange: "transform"
|
|
221
|
+
},
|
|
222
|
+
children: /* @__PURE__ */ jsx(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
ref: measured,
|
|
226
|
+
className: "flex w-full min-w-0 items-center gap-2.5",
|
|
227
|
+
style: { opacity: contentVisible ? 1 : 0, transition: contentMotion },
|
|
228
|
+
"aria-hidden": !contentVisible || void 0,
|
|
229
|
+
inert: !contentVisible || void 0,
|
|
230
|
+
children: /* @__PURE__ */ jsx(
|
|
231
|
+
ToastContent,
|
|
232
|
+
{
|
|
233
|
+
title,
|
|
234
|
+
intent,
|
|
235
|
+
icon,
|
|
236
|
+
closeButton,
|
|
237
|
+
onAction: () => close(id, "action"),
|
|
238
|
+
...options
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
function Toaster({ className, limit = 3, children }) {
|
|
249
|
+
const all = React.useSyncExternalStore(subscribe, snapshot, snapshot);
|
|
250
|
+
const stack = React.useMemo(() => [...all].reverse(), [all]);
|
|
251
|
+
const [hovered, setHovered] = React.useState(false);
|
|
252
|
+
const [focused, setFocused] = React.useState(false);
|
|
253
|
+
const viewportRef = React.useRef(null);
|
|
254
|
+
React.useEffect(() => {
|
|
255
|
+
const el = viewportRef.current;
|
|
256
|
+
if (!el) return;
|
|
257
|
+
const enter = () => setHovered(true);
|
|
258
|
+
const leave = () => setHovered(false);
|
|
259
|
+
const focusIn = () => setFocused(true);
|
|
260
|
+
const focusOut = (e) => {
|
|
261
|
+
if (!el.contains(e.relatedTarget)) setFocused(false);
|
|
262
|
+
};
|
|
263
|
+
el.addEventListener("pointermove", enter);
|
|
264
|
+
el.addEventListener("pointerleave", leave);
|
|
265
|
+
el.addEventListener("focusin", focusIn);
|
|
266
|
+
el.addEventListener("focusout", focusOut);
|
|
267
|
+
return () => {
|
|
268
|
+
el.removeEventListener("pointermove", enter);
|
|
269
|
+
el.removeEventListener("pointerleave", leave);
|
|
270
|
+
el.removeEventListener("focusin", focusIn);
|
|
271
|
+
el.removeEventListener("focusout", focusOut);
|
|
272
|
+
};
|
|
273
|
+
}, []);
|
|
274
|
+
const expanded = (hovered || focused) && stack.some((r) => r.open);
|
|
275
|
+
const [heights, setHeights] = React.useState({});
|
|
276
|
+
const measure = React.useCallback((id, h) => setHeights((c) => c[id] === h ? c : { ...c, [id]: h }), []);
|
|
277
|
+
const forget = React.useCallback(
|
|
278
|
+
(id) => setHeights((c) => {
|
|
279
|
+
if (!(id in c)) return c;
|
|
280
|
+
const { [id]: _, ...rest } = c;
|
|
281
|
+
return rest;
|
|
282
|
+
}),
|
|
283
|
+
[]
|
|
284
|
+
);
|
|
285
|
+
const placed = [];
|
|
286
|
+
let cursor = 0;
|
|
287
|
+
for (const record of stack) {
|
|
288
|
+
placed.push({ record, index: cursor });
|
|
289
|
+
if (record.open) cursor += 1;
|
|
290
|
+
}
|
|
291
|
+
const slots = stack.filter((r) => r.open).map((r) => heights[r.id] ?? FALLBACK_HEIGHT);
|
|
292
|
+
const depth = Math.max(limit, 1);
|
|
293
|
+
const frontHeight = slots[0] ?? FALLBACK_HEIGHT;
|
|
294
|
+
const scaleOf = (slot) => expanded ? 1 : Math.max(1 - slot * SCALE_STEP, 0);
|
|
295
|
+
const offset = (slot) => {
|
|
296
|
+
if (!expanded) return slot * PEEK + (1 - scaleOf(slot)) * frontHeight;
|
|
297
|
+
let y = 0;
|
|
298
|
+
for (let i = 0; i < slot; i++) y += (slots[i] ?? FALLBACK_HEIGHT) + GAP;
|
|
299
|
+
return y;
|
|
300
|
+
};
|
|
301
|
+
const count = Math.min(slots.length, depth);
|
|
302
|
+
const height = expanded ? slots.slice(0, count).reduce((t, h, i) => t + h + (i ? GAP : 0), 0) : count ? frontHeight + (count - 1) * PEEK : 0;
|
|
303
|
+
return /* @__PURE__ */ jsxs(Toast$1.Provider, { swipeDirection: "right", label: "Notifications", children: [
|
|
304
|
+
children,
|
|
305
|
+
placed.map(({ record, index }) => {
|
|
306
|
+
const slot = Math.min(index, depth - 1);
|
|
307
|
+
return /* @__PURE__ */ jsx(
|
|
308
|
+
StackedToast,
|
|
309
|
+
{
|
|
310
|
+
record,
|
|
311
|
+
index,
|
|
312
|
+
y: -offset(slot),
|
|
313
|
+
scale: scaleOf(slot),
|
|
314
|
+
height: !expanded && slot > 0 && record.open ? frontHeight : heights[record.id],
|
|
315
|
+
beyond: index >= depth,
|
|
316
|
+
contentVisible: expanded || index === 0,
|
|
317
|
+
onMeasure: measure,
|
|
318
|
+
onForget: forget
|
|
319
|
+
},
|
|
320
|
+
record.id
|
|
321
|
+
);
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ jsx(
|
|
324
|
+
Toast$1.Viewport,
|
|
325
|
+
{
|
|
326
|
+
ref: viewportRef,
|
|
327
|
+
style: { height, transition: `height ${MOTION_MS}ms var(--ease-out)` },
|
|
328
|
+
className: cn(
|
|
329
|
+
"fixed right-4 bottom-4 z-[100] m-0 w-[397px] max-w-[calc(100%-32px)] list-none p-0 outline-none",
|
|
330
|
+
className
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
] });
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export { Toast, Toaster, toast };
|
|
338
|
+
//# sourceMappingURL=chunk-2HKBZFIK.js.map
|
|
339
|
+
//# sourceMappingURL=chunk-2HKBZFIK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/toast.tsx"],"names":["r","ToastPrimitive","card"],"mappings":";;;;;;AAqDA,IAAM,SAAA,GAAY,GAAA;AAIlB,IAAI,UAAyB,EAAC;AAC9B,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,IAAI,OAAA,GAAU,CAAA;AAEd,SAAS,IAAA,GAAO;AACd,EAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAC7C;AACA,SAAS,UAAU,QAAA,EAAsB;AACvC,EAAA,SAAA,CAAU,IAAI,QAAQ,CAAA;AACtB,EAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,QAAQ,CAAA;AACxC;AACA,SAAS,QAAA,GAAW;AAClB,EAAA,OAAO,OAAA;AACT;AAEA,SAAS,IAAA,CAAK,KAAA,EAAwB,OAAA,GAAwB,EAAC,EAAG;AAChE,EAAA,MAAM,EAAA,GAAK,OAAA,CAAQ,EAAA,IAAM,CAAA,MAAA,EAAS,EAAE,OAAO,CAAA,CAAA;AAC3C,EAAA,MAAM,OAAoB,EAAE,GAAG,SAAS,EAAA,EAAI,KAAA,EAAO,MAAM,IAAA,EAAK;AAC9D,EAAA,OAAA,GAAU,OAAA,CAAQ,KAAK,CAAC,CAAA,KAAM,EAAE,EAAA,KAAO,EAAE,IAAI,OAAA,CAAQ,GAAA,CA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":["'use client'\n\nimport * as React from 'react'\nimport { Toast as ToastPrimitive } from 'radix-ui'\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\n/**\n * Toast, 1:1 with the uiKit `Toast` set (3650:17696): intent neutral, info, success, warning or\n * error. A 397px popover surface, radius-xl, border/default, the shadcn `lg` shadow, padding\n * 10 left / 8 right and 10 top and bottom (12 at the bottom on the four status intents, as in\n * Figma). A 36px radius-md icon tile in the intent's status bg, a 13px medium title (20px line)\n * over a 13px muted description (16px line), then an optional secondary action and a 24px close.\n *\n * Built on the Radix Toast. Render one `<Toaster />` near the root and call `toast()` anywhere:\n * toast.success('Booking confirmed', { description: 'Table for 4…', action: { label: 'Undo' } })\n *\n * The Toaster stacks them bottom-right, newest in front. Behind it, the next ones peek 16px above,\n * each 5% smaller, cut to the front one's height with their content faded out, so the stack is\n * even; three show at most and the rest wait, parked in the last place. Hovering or focusing the\n * stack unfolds it, one under another 8px apart at their own heights, every toast readable, and\n * pauses their timers.\n *\n * Toasts move as whole cards and never fade on the way: a new one slides up from below the\n * stack (150% of its height), a closed one slides back down the same way, and the rest move to\n * their new places at the same time. Every move is one transform on one element, 500 ms on the\n * kit's ease-out, so a toast added or closed mid-move just carries on from where it is. The\n * cut to the front one's height eases over 150 ms, the content fade over 250 ms.\n */\nexport type ToastIntent = 'neutral' | 'info' | 'success' | 'warning' | 'error'\n\nexport interface ToastAction {\n label: string\n onClick?: () => void\n}\n\nexport interface ToastOptions {\n description?: React.ReactNode\n intent?: ToastIntent\n action?: ToastAction\n /** The small close button on the right. */\n closeButton?: boolean\n /** The status icon tile on the left. */\n icon?: boolean\n /** Milliseconds before it closes by itself. `Infinity` keeps it until dismissed. */\n duration?: number\n id?: string\n}\n\ntype ExitReason = 'close' | 'action'\ntype ToastRecord = ToastOptions & { id: string; title: React.ReactNode; open: boolean; exit?: ExitReason }\n\n/** Enter, exit and re-stack, ms. A closed toast stays this long to play out. */\nconst MOTION_MS = 500\n\n/* ---------- the store behind toast() ---------- */\n\nlet records: ToastRecord[] = []\nconst listeners = new Set<() => void>()\nlet counter = 0\n\nfunction emit() {\n for (const listener of listeners) listener()\n}\nfunction subscribe(listener: () => void) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\nfunction snapshot() {\n return records\n}\n\nfunction show(title: React.ReactNode, options: ToastOptions = {}) {\n const id = options.id ?? `toast-${++counter}`\n const next: ToastRecord = { ...options, id, title, open: true }\n records = records.some((r) => r.id === id) ? records.map((r) => (r.id === id ? next : r)) : [...records, next]\n emit()\n return id\n}\n\nfunction remove(id: string) {\n records = records.filter((r) => r.id !== id)\n emit()\n}\n\n/** Marks a toast as leaving, so the stack can play it out, and drops it one motion later. */\nfunction close(id: string, reason: ExitReason = 'close') {\n const r = records.find((r) => r.id === id)\n if (!r || !r.open) return\n records = records.map((r) => (r.id === id ? { ...r, open: false, exit: reason } : r))\n emit()\n setTimeout(() => remove(id), MOTION_MS)\n}\n\ntype Shortcut = (title: React.ReactNode, options?: Omit<ToastOptions, 'intent'>) => string\n\n/** Show a toast. Returns its id, which `toast.dismiss(id)` takes. */\nexport const toast = Object.assign((title: React.ReactNode, options?: ToastOptions) => show(title, options), {\n info: ((title, options) => show(title, { ...options, intent: 'info' })) as Shortcut,\n success: ((title, options) => show(title, { ...options, intent: 'success' })) as Shortcut,\n warning: ((title, options) => show(title, { ...options, intent: 'warning' })) as Shortcut,\n error: ((title, options) => show(title, { ...options, intent: 'error' })) as Shortcut,\n /** Close one toast, or all of them. */\n dismiss: (id?: string) => {\n for (const r of id === undefined ? records : records.filter((r) => r.id === id)) close(r.id)\n },\n})\n\n/* ---------- glyphs, from Figma ---------- */\n\nconst tile: Record<ToastIntent, string> = {\n neutral: 'bg-status-neutral-bg text-text-default',\n info: 'bg-status-sky-bg text-status-sky-fg',\n success: 'bg-status-green-bg text-status-green-fg',\n warning: 'bg-status-amber-bg text-status-amber-fg',\n // Figma draws the error glyph in action/destructive (#DC2626), not status-red-fg.\n error: 'bg-status-red-bg text-action-destructive-bg',\n}\n\nfunction IntentIcon({ intent }: { intent: ToastIntent }) {\n if (intent === 'neutral') {\n // Notification glyph, 14px inside a 16px box.\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"-1 -1 16 16\" fill=\"none\" aria-hidden>\n <g stroke=\"currentColor\" style={{ strokeWidth: 1.25 }} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M11.2738 4.61052C12.3146 4.61052 13.1582 3.76684 13.1582 2.72612C13.1582 1.6854 12.3146 0.841726 11.2738 0.841726C10.2331 0.841726 9.38944 1.6854 9.38944 2.72612C9.38944 3.76684 10.2331 4.61052 11.2738 4.61052Z\" />\n <path d=\"M12.9121 7.12311V9.13483C12.9121 11.3569 11.1107 13.1583 8.88866 13.1583H4.86521C2.64313 13.1583 0.84177 11.3569 0.84177 9.13483V5.11139C0.84177 2.8893 2.64313 1.08794 4.86521 1.08794H6.87694\" />\n </g>\n </svg>\n )\n }\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <g stroke=\"currentColor\" style={{ strokeWidth: 1.25 }} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n {intent === 'success' ? (\n <path d=\"M3.33333 8.66667L6 11.3333L12.6667 4.66667\" />\n ) : (\n <>\n {intent === 'info' ? (\n <>\n <path d=\"M8 7.70494V10.6557\" />\n <path d=\"M8 5.35022L8.0059 5.34366\" />\n </>\n ) : (\n <>\n <path d=\"M8 5.34428V8.29506\" />\n <path d=\"M8 10.6563L8.0059 10.6498\" />\n </>\n )}\n <path d=\"M8 13.9015C11.2593 13.9015 13.9015 11.2593 13.9015 8C13.9015 4.74066 11.2593 2.09845 8 2.09845C4.74066 2.09845 2.09845 4.74066 2.09845 8C2.09845 11.2593 4.74066 13.9015 8 13.9015Z\" />\n </>\n )}\n </g>\n </svg>\n )\n}\n\n/* ---------- one toast ---------- */\n\nexport interface ToastProps extends Omit<React.ComponentProps<typeof ToastPrimitive.Root>, 'title'> {\n title: React.ReactNode\n description?: React.ReactNode\n intent?: ToastIntent\n action?: ToastAction\n closeButton?: boolean\n icon?: boolean\n}\n\n/** The card surface: popover bg, border/default, radius-xl, the shadcn `lg` shadow. */\nconst card = (intent: ToastIntent) =>\n cn(\n 'relative flex w-full items-center gap-2.5 overflow-clip pr-2 pl-2.5',\n intent === 'neutral' ? 'py-2.5' : 'pt-2.5 pb-3',\n 'rounded-xl border border-border-default bg-bg-popover',\n '[box-shadow:0_4px_6px_-4px_var(--effect-shadow-sm),0_10px_15px_-3px_var(--effect-shadow-sm)]',\n )\n\n/** What sits on the card: the icon tile, title and description, the action and the close. */\nfunction ToastContent({\n title,\n description,\n intent,\n action,\n closeButton,\n icon,\n onAction,\n}: Pick<ToastProps, 'title' | 'description' | 'action' | 'closeButton' | 'icon'> & {\n intent: ToastIntent\n onAction?: () => void\n}) {\n return (\n <>\n {icon && (\n <div className={cn('grid size-9 shrink-0 place-items-center rounded-md', tile[intent])}>\n <IntentIcon intent={intent} />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col text-sm\">\n <ToastPrimitive.Title className=\"leading-5 font-medium text-text-default\">{title}</ToastPrimitive.Title>\n {description ? (\n <ToastPrimitive.Description className=\"leading-4 text-text-muted\">{description}</ToastPrimitive.Description>\n ) : null}\n </div>\n {(action || closeButton) && (\n <div className=\"flex shrink-0 items-center gap-1\">\n {action && (\n <ToastPrimitive.Action asChild altText={action.label}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onAction?.()\n action.onClick?.()\n }}\n >\n {action.label}\n </Button>\n </ToastPrimitive.Action>\n )}\n {closeButton && (\n <ToastPrimitive.Close asChild>\n <Button variant=\"tertiary\" size=\"xs\" iconOnly aria-label=\"Close\" className=\"rounded-md text-text-muted\">\n {/* 14px X at 1.09, from Figma. */}\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden>\n <path\n d=\"M3.94232 10.0582L7.00053 7M7.00053 7L10.0587 3.94179M7.00053 7L3.94232 3.94179M7.00053 7L10.0587 10.0582\"\n stroke=\"currentColor\"\n strokeWidth=\"1.09375\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </Button>\n </ToastPrimitive.Close>\n )}\n </div>\n )}\n </>\n )\n}\n\nconst radixType = (intent: ToastIntent) => (intent === 'error' || intent === 'warning' ? 'foreground' : 'background')\n\n/** A single toast on its own. Lives inside `<Toaster>` (it needs the Radix toast provider). */\nexport function Toast({\n title,\n description,\n intent = 'neutral',\n action,\n closeButton = true,\n icon = true,\n duration = 5000,\n className,\n ...props\n}: ToastProps) {\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n data-intent={intent}\n duration={duration}\n type={radixType(intent)}\n className={cn(\n 'pointer-events-auto',\n card(intent),\n 'focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)] focus-visible:outline-none',\n 'data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]',\n className,\n )}\n {...props}\n >\n <ToastContent title={title} description={description} intent={intent} action={action} closeButton={closeButton} icon={icon} />\n </ToastPrimitive.Root>\n )\n}\n\n/* ---------- the stack ---------- */\n\n/** Peek of each toast behind the front one, px; the scale each step back loses; gap unfolded, px. */\nconst PEEK = 16\nconst SCALE_STEP = 0.05\nconst GAP = 8\nconst FALLBACK_HEIGHT = 58\n\n/** Where a toast comes in from and goes to: this much of its own height below its place. */\nconst OFFSCREEN = '150%'\nconst ease = 'var(--ease-out)'\nconst cardMotion = `transform ${MOTION_MS}ms ${ease}, height 150ms ${ease}`\nconst contentMotion = `opacity 250ms ${ease}`\n\ninterface StackedToastProps {\n record: ToastRecord\n index: number\n /** Its place in the stack, px up from the bottom, and its scale. */\n y: number\n scale: number\n /** Cut to this height (the front toast's) while it waits behind; undefined shows its own. */\n height?: number\n beyond: boolean\n contentVisible: boolean\n onMeasure: (id: string, height: number) => void\n onForget: (id: string) => void\n}\n\n/**\n * One toast in the stack, on two elements so the two movements never fight over one transform:\n * the `li` (the Radix root) takes its place in the stack, the card inside slides in and out.\n */\nfunction StackedToast({ record, index, y, scale, height, beyond, contentVisible, onMeasure, onForget }: StackedToastProps) {\n const { id, title, open, duration, exit: _exit, intent = 'neutral', icon = true, closeButton = true, ...options } = record\n const [entered, setEntered] = React.useState(false)\n const cardRef = React.useRef<HTMLDivElement>(null)\n React.useLayoutEffect(() => {\n // Read the start (below the stack) so the browser has it, then move to the place: the\n // transition runs from there without waiting on animation frames.\n cardRef.current?.getBoundingClientRect()\n setEntered(true)\n }, [])\n\n // Its own height, whatever the stack cuts it to: the content plus the card's padding and border.\n const measured = React.useCallback(\n (node: HTMLDivElement | null) => {\n if (!node) return\n const card = node.parentElement as HTMLElement\n const report = () => {\n const cs = getComputedStyle(card)\n const chrome = ['paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth'].reduce((t, k) => t + parseFloat(cs[k as 'paddingTop']), 0)\n onMeasure(id, node.offsetHeight + chrome)\n }\n report()\n const observer = new ResizeObserver(report)\n observer.observe(node)\n return () => {\n observer.disconnect()\n onForget(id)\n }\n },\n [id, onMeasure, onForget],\n )\n\n const inPlace = entered && open\n\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n data-intent={intent}\n // Kept mounted while it plays out; the store drops it one motion later.\n forceMount\n open={open}\n onOpenChange={(next) => !next && close(id)}\n duration={duration ?? 5000}\n type={radixType(intent)}\n className={cn(\n 'absolute inset-x-0 bottom-0 origin-bottom outline-none',\n 'focus-visible:[&>div]:[box-shadow:0_0_0_2px_var(--action-focus-ring)]',\n 'data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x)',\n 'data-[swipe=cancel]:transition-[translate] data-[swipe=cancel]:duration-(--duration-base) data-[swipe=cancel]:ease-(--ease-out)',\n )}\n style={{\n transform: `translate3d(0, ${y}px, 0) scale(${scale})`,\n opacity: beyond ? 0 : 1,\n zIndex: 1000 - index,\n pointerEvents: beyond || !open ? 'none' : undefined,\n transition: `transform ${MOTION_MS}ms ${ease}, opacity ${MOTION_MS}ms ${ease}`,\n }}\n >\n <div\n ref={cardRef}\n className={cn('pointer-events-auto', card(intent), 'items-start')}\n style={{\n transform: inPlace ? 'translate3d(0, 0, 0)' : `translate3d(0, ${OFFSCREEN}, 0)`,\n height,\n transition: cardMotion,\n willChange: 'transform',\n }}\n >\n <div\n ref={measured}\n className=\"flex w-full min-w-0 items-center gap-2.5\"\n style={{ opacity: contentVisible ? 1 : 0, transition: contentMotion }}\n // The cards behind the front one show no content, so nothing in them can be reached.\n aria-hidden={!contentVisible || undefined}\n inert={!contentVisible || undefined}\n >\n <ToastContent\n title={title}\n intent={intent}\n icon={icon}\n closeButton={closeButton}\n onAction={() => close(id, 'action')}\n {...options}\n />\n </div>\n </div>\n </ToastPrimitive.Root>\n )\n}\n\n/* ---------- the region ---------- */\n\nexport interface ToasterProps {\n /** Classes for the viewport; `absolute` instead of `fixed` keeps it inside a positioned parent. */\n className?: string\n /** Most toasts on screen at once; the rest wait behind. */\n limit?: number\n /** Your own controlled `<Toast>`s, rendered alongside the ones from `toast()`. */\n children?: React.ReactNode\n}\n\nexport function Toaster({ className, limit = 3, children }: ToasterProps) {\n const all = React.useSyncExternalStore(subscribe, snapshot, snapshot)\n // Newest first: index 0 is the front of the stack.\n const stack = React.useMemo(() => [...all].reverse(), [all])\n\n const [hovered, setHovered] = React.useState(false)\n const [focused, setFocused] = React.useState(false)\n // Native listeners: the toasts are portalled into the viewport, so React's own events from\n // them never reach it. pointermove (as Radix's pause uses) also catches a pointer at rest there.\n const viewportRef = React.useRef<HTMLOListElement>(null)\n React.useEffect(() => {\n const el = viewportRef.current\n if (!el) return\n const enter = () => setHovered(true)\n const leave = () => setHovered(false)\n const focusIn = () => setFocused(true)\n const focusOut = (e: FocusEvent) => {\n if (!el.contains(e.relatedTarget as Node | null)) setFocused(false)\n }\n el.addEventListener('pointermove', enter)\n el.addEventListener('pointerleave', leave)\n el.addEventListener('focusin', focusIn)\n el.addEventListener('focusout', focusOut)\n return () => {\n el.removeEventListener('pointermove', enter)\n el.removeEventListener('pointerleave', leave)\n el.removeEventListener('focusin', focusIn)\n el.removeEventListener('focusout', focusOut)\n }\n }, [])\n const expanded = (hovered || focused) && stack.some((r) => r.open)\n\n const [heights, setHeights] = React.useState<Record<string, number>>({})\n const measure = React.useCallback((id: string, h: number) => setHeights((c) => (c[id] === h ? c : { ...c, [id]: h })), [])\n const forget = React.useCallback(\n (id: string) =>\n setHeights((c) => {\n if (!(id in c)) return c\n const { [id]: _, ...rest } = c\n return rest\n }),\n [],\n )\n\n // A toast on its way out keeps its index but frees its place, so the ones behind move up.\n const placed: { record: ToastRecord; index: number }[] = []\n let cursor = 0\n for (const record of stack) {\n placed.push({ record, index: cursor })\n if (record.open) cursor += 1\n }\n const slots = stack.filter((r) => r.open).map((r) => heights[r.id] ?? FALLBACK_HEIGHT)\n const depth = Math.max(limit, 1)\n const frontHeight = slots[0] ?? FALLBACK_HEIGHT\n const scaleOf = (slot: number) => (expanded ? 1 : Math.max(1 - slot * SCALE_STEP, 0))\n\n // Px up from the bottom. Folded, every card is the front one's height, scaled from its bottom\n // edge, so lifting it by the height it lost puts its top exactly PEEK above the one in front.\n const offset = (slot: number) => {\n if (!expanded) return slot * PEEK + (1 - scaleOf(slot)) * frontHeight\n let y = 0\n for (let i = 0; i < slot; i++) y += (slots[i] ?? FALLBACK_HEIGHT) + GAP\n return y\n }\n\n // The viewport covers the whole stack, gaps included, so moving between toasts never refolds it.\n const count = Math.min(slots.length, depth)\n const height = expanded\n ? slots.slice(0, count).reduce((t, h, i) => t + h + (i ? GAP : 0), 0)\n : count\n ? frontHeight + (count - 1) * PEEK\n : 0\n\n return (\n <ToastPrimitive.Provider swipeDirection=\"right\" label=\"Notifications\">\n {children}\n {placed.map(({ record, index }) => {\n const slot = Math.min(index, depth - 1)\n return (\n <StackedToast\n key={record.id}\n record={record}\n index={index}\n y={-offset(slot)}\n scale={scaleOf(slot)}\n height={!expanded && slot > 0 && record.open ? frontHeight : heights[record.id]}\n beyond={index >= depth}\n contentVisible={expanded || index === 0}\n onMeasure={measure}\n onForget={forget}\n />\n )\n })}\n <ToastPrimitive.Viewport\n ref={viewportRef}\n style={{ height, transition: `height ${MOTION_MS}ms var(--ease-out)` }}\n className={cn(\n 'fixed right-4 bottom-4 z-[100] m-0 w-[397px] max-w-[calc(100%-32px)] list-none p-0 outline-none',\n className,\n )}\n />\n </ToastPrimitive.Provider>\n )\n}\n"]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { KbdGroup } from './chunk-BKZBWPUH.js';
|
|
2
|
+
import { cn } from './chunk-H63FYCMY.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import { DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
5
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var menuSurfaceClass = cn(
|
|
8
|
+
"rounded-xl border border-border-subtle bg-bg-popover",
|
|
9
|
+
"[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]"
|
|
10
|
+
);
|
|
11
|
+
var menuGroupClass = "flex flex-col gap-1 not-last:after:block not-last:after:h-px not-last:after:bg-bg-muted";
|
|
12
|
+
var menuGroupLabelClass = "flex h-6 items-center px-3 text-xs leading-3 tracking-normal text-text-subtle";
|
|
13
|
+
function DropdownMenu({
|
|
14
|
+
trigger,
|
|
15
|
+
children,
|
|
16
|
+
open,
|
|
17
|
+
defaultOpen,
|
|
18
|
+
onOpenChange,
|
|
19
|
+
modal = true,
|
|
20
|
+
side = "bottom",
|
|
21
|
+
align = "start",
|
|
22
|
+
sideOffset = 8,
|
|
23
|
+
container,
|
|
24
|
+
onFocusOutside,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { asChild: true, children: trigger }),
|
|
30
|
+
/* @__PURE__ */ jsx(DropdownMenu$1.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
31
|
+
DropdownMenu$1.Content,
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "dropdown-menu",
|
|
34
|
+
"aria-label": props["aria-label"],
|
|
35
|
+
side,
|
|
36
|
+
align,
|
|
37
|
+
sideOffset,
|
|
38
|
+
collisionPadding: 8,
|
|
39
|
+
onFocusOutside,
|
|
40
|
+
className: cn(
|
|
41
|
+
"pointer-events-auto z-50 flex w-[255px] max-w-[520px] flex-col gap-1 overflow-x-clip overflow-y-auto p-1",
|
|
42
|
+
"max-h-(--radix-dropdown-menu-content-available-height)",
|
|
43
|
+
menuSurfaceClass,
|
|
44
|
+
"origin-(--radix-dropdown-menu-content-transform-origin) outline-none",
|
|
45
|
+
"data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
children
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function DropdownMenuGroup({ label, children, className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
DropdownMenu$1.Group,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "dropdown-group",
|
|
58
|
+
className: cn(menuGroupClass, className),
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
label ? /* @__PURE__ */ jsx(DropdownMenu$1.Label, { className: menuGroupLabelClass, children: label }) : null,
|
|
62
|
+
children
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
var menuItemClass = cn(
|
|
68
|
+
"flex min-h-menu-row w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-1.5 text-left outline-none select-none focus-visible:ring-0",
|
|
69
|
+
"transition-colors duration-(--duration-fast) ease-(--ease-out)",
|
|
70
|
+
"data-[highlighted]:bg-bg-selected data-[force=hover]:bg-bg-selected data-[selected]:bg-bg-selected",
|
|
71
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
72
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
73
|
+
);
|
|
74
|
+
function MenuItemContent({
|
|
75
|
+
label,
|
|
76
|
+
description,
|
|
77
|
+
icon,
|
|
78
|
+
iconSize = 16,
|
|
79
|
+
selected = false,
|
|
80
|
+
layout = "stacked",
|
|
81
|
+
shortcut,
|
|
82
|
+
renderLabel = (l) => l
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
+
icon ? /* @__PURE__ */ jsx(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
className: cn(
|
|
89
|
+
"grid shrink-0 place-items-center text-text-muted",
|
|
90
|
+
iconSize === 20 ? "size-5 [&_svg]:size-5 [&_svg]:[stroke-width:1.5]" : "size-4 [&_svg]:size-4 [&_svg]:[stroke-width:1.875]"
|
|
91
|
+
),
|
|
92
|
+
children: icon
|
|
93
|
+
}
|
|
94
|
+
) : null,
|
|
95
|
+
layout === "stacked" ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col justify-center gap-0.5", children: [
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "text-base leading-5 font-medium text-text-default", children: renderLabel(label) }),
|
|
97
|
+
description ? /* @__PURE__ */ jsx("span", { className: "text-sm leading-[18px] text-text-muted", children: description }) : null
|
|
98
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-baseline gap-3", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-base leading-5 font-medium whitespace-nowrap text-text-default", children: renderLabel(label) }),
|
|
100
|
+
description ? /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm text-text-muted", children: description }) : null
|
|
101
|
+
] }),
|
|
102
|
+
shortcut && /* @__PURE__ */ jsx(KbdGroup, { keys: shortcut, "aria-hidden": true }),
|
|
103
|
+
selected && /* @__PURE__ */ jsx("span", { className: "sr-only", children: "(selected)" }),
|
|
104
|
+
selected && /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: "text-status-green-fg", children: /* @__PURE__ */ jsx(
|
|
105
|
+
"path",
|
|
106
|
+
{
|
|
107
|
+
d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
strokeWidth: "1.25",
|
|
110
|
+
strokeLinecap: "round",
|
|
111
|
+
strokeLinejoin: "round"
|
|
112
|
+
}
|
|
113
|
+
) })
|
|
114
|
+
] });
|
|
115
|
+
}
|
|
116
|
+
function DropdownMenuItem({
|
|
117
|
+
label,
|
|
118
|
+
description,
|
|
119
|
+
icon,
|
|
120
|
+
iconSize = 16,
|
|
121
|
+
selected = false,
|
|
122
|
+
layout = "stacked",
|
|
123
|
+
shortcut,
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}) {
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
DropdownMenu$1.Item,
|
|
129
|
+
{
|
|
130
|
+
"data-slot": "dropdown-item",
|
|
131
|
+
"data-selected": selected || void 0,
|
|
132
|
+
textValue: label,
|
|
133
|
+
className: cn(menuItemClass, className),
|
|
134
|
+
...props,
|
|
135
|
+
children: /* @__PURE__ */ jsx(
|
|
136
|
+
MenuItemContent,
|
|
137
|
+
{
|
|
138
|
+
label,
|
|
139
|
+
description,
|
|
140
|
+
icon,
|
|
141
|
+
iconSize,
|
|
142
|
+
selected,
|
|
143
|
+
layout,
|
|
144
|
+
shortcut
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { DropdownMenu, DropdownMenuGroup, DropdownMenuItem, MenuItemContent, menuGroupClass, menuGroupLabelClass, menuItemClass, menuSurfaceClass };
|
|
152
|
+
//# sourceMappingURL=chunk-3DINAQLL.js.map
|
|
153
|
+
//# sourceMappingURL=chunk-3DINAQLL.js.map
|