@ngrok/mantle 0.78.0 → 0.79.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/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +85 -46
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +24 -16
- package/dist/alert.js +1 -1
- package/dist/button-ClC60Nzg.js +1 -0
- package/dist/{button-Bw9MpShl.d.ts → button-DcXOWUYo.d.ts} +49 -7
- package/dist/button.d.ts +6 -5
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/centered-layout.d.ts +17 -5
- package/dist/code-block.js +1 -1
- package/dist/command.d.ts +12 -12
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +36 -10
- package/dist/data-table.js +1 -1
- package/dist/{dialog-DVDFVT_-.js → dialog-ZCgG41hx.js} +1 -1
- package/dist/dialog.d.ts +72 -54
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +1 -0
- package/dist/{dropdown-menu-DT30TQzL.d.ts → dropdown-menu-DP_Ne9Mr.d.ts} +7 -4
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +12 -12
- package/dist/field.d.ts +19 -2
- package/dist/field.js +1 -1
- package/dist/hover-card.d.ts +9 -7
- package/dist/{icon-button-DuRSCsPh.d.ts → icon-button-B7uEj1qq.d.ts} +68 -5
- package/dist/icon-button-DV2-GZHf.js +1 -0
- package/dist/{index-CDwfBOAA.d.ts → index-BivvYYs-.d.ts} +5 -5
- package/dist/index-g2rfwNCH.d.ts +1 -0
- package/dist/intents-DdSKSj1c.d.ts +28 -0
- package/dist/llms.txt +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.d.ts +11 -11
- package/dist/{primitive-wm7Wk-gy.js → primitive-M-kZdNIS.js} +1 -1
- package/dist/sheet.d.ts +81 -52
- package/dist/sheet.js +1 -1
- package/dist/{sizes-Dje_rwKc.d.ts → sizes-BCoI4bhP.d.ts} +2 -2
- package/dist/split-button.d.ts +8 -7
- package/dist/split-button.js +1 -1
- package/dist/theme-switcher.d.ts +150 -21
- package/dist/theme-switcher.js +1 -1
- package/dist/toast-D3ntBmn4.js +1 -0
- package/dist/toast.d.ts +19 -13
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +6 -6
- package/package.json +1 -1
- package/dist/button-AS5Ir3DE.js +0 -1
- package/dist/dropdown-menu-ByUQkAvJ.js +0 -1
- package/dist/icon-button-CxVsZ2N1.js +0 -1
- package/dist/index-BnI3OppC.d.ts +0 -1
- package/dist/toast-RkhbliFh.js +0 -1
package/dist/theme-switcher.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
2
|
+
import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-B7uEj1qq.js";
|
|
3
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
|
|
5
|
+
import "./index-g2rfwNCH.js";
|
|
6
|
+
import { ComponentProps, ComponentPropsWithoutRef } from "react";
|
|
6
7
|
//#region src/components/theme-switcher/theme-switcher.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* The props for the `ThemeDropdownMenuRadioGroup` component.
|
|
@@ -13,22 +14,47 @@ declare namespace ThemeDropdownMenuRadioGroup {
|
|
|
13
14
|
var displayName: string;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
* The props for the `ThemeSwitcher` component.
|
|
17
|
+
* The props for the `ThemeSwitcher.Root` component. Identical to
|
|
18
|
+
* `DropdownMenu.Root`'s props — `Root` forwards everything through.
|
|
17
19
|
*/
|
|
18
|
-
type
|
|
20
|
+
type ThemeSwitcherRootProps = ComponentProps<typeof DropdownMenu.Root>;
|
|
21
|
+
/**
|
|
22
|
+
* The stateful root of the theme switcher: a thin forwarding wrapper over
|
|
23
|
+
* `DropdownMenu.Root` that owns the menu's open/closed state. Renders no DOM
|
|
24
|
+
* of its own. Compose `ThemeSwitcher.Trigger` and `ThemeSwitcher.Content`
|
|
25
|
+
* inside it.
|
|
26
|
+
*
|
|
27
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <ThemeSwitcher.Root>
|
|
32
|
+
* <ThemeSwitcher.Trigger />
|
|
33
|
+
* <ThemeSwitcher.Content />
|
|
34
|
+
* </ThemeSwitcher.Root>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const Root: {
|
|
38
|
+
(props: ThemeSwitcherRootProps): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The props for the `ThemeSwitcher.Trigger` component. Forwards
|
|
43
|
+
* `IconButton`'s props, except the parts the trigger owns: `icon` (the
|
|
44
|
+
* SSR-safe themed icon) and `intent` (always `"neutral"`). `asChild` and
|
|
45
|
+
* `children` are removed — the trigger renders only its icon and sr-only
|
|
46
|
+
* label, so both would be silently meaningless. `appearance` and `label`
|
|
47
|
+
* become optional with theme-switcher defaults.
|
|
48
|
+
*/
|
|
49
|
+
type ThemeSwitcherTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
|
|
19
50
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* menu instead, compose `ThemeDropdownMenuRadioGroup` in your own
|
|
24
|
-
* `DropdownMenu`.
|
|
51
|
+
* The visual style of the trigger `IconButton`. Optional here —
|
|
52
|
+
* `ThemeSwitcher.Trigger` defaults to `"ghost"` so the trigger sits
|
|
53
|
+
* quietly in headers and toolbars.
|
|
25
54
|
*
|
|
26
|
-
* @
|
|
27
|
-
* ```tsx
|
|
28
|
-
* <ThemeSwitcher contentProps={{ collisionPadding: { right: 16 } }} />
|
|
29
|
-
* ```
|
|
55
|
+
* @default "ghost"
|
|
30
56
|
*/
|
|
31
|
-
|
|
57
|
+
appearance?: IconButtonAppearance;
|
|
32
58
|
/**
|
|
33
59
|
* The accessible name for the trigger `IconButton`. Visually hidden but
|
|
34
60
|
* announced to screen readers. Override it for localization.
|
|
@@ -37,9 +63,112 @@ type ThemeSwitcherProps = WithStyleProps & Pick<ComponentProps<typeof IconButton
|
|
|
37
63
|
*/
|
|
38
64
|
label?: string;
|
|
39
65
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The props for the `ThemeSwitcher.Content` component. Identical to
|
|
68
|
+
* `DropdownMenu.Content`'s props — positioning and collision behavior
|
|
69
|
+
* (`align`, `side`, `collisionPadding`, …) plus `className`/`style` all
|
|
70
|
+
* forward through.
|
|
71
|
+
*/
|
|
72
|
+
type ThemeSwitcherContentProps = ComponentPropsWithoutRef<typeof DropdownMenu.Content> & WithDataSlot;
|
|
73
|
+
/**
|
|
74
|
+
* The canonical picker for mantle's theme system: a compact `IconButton`
|
|
75
|
+
* trigger (ghost by default) that opens a `DropdownMenu` hosting
|
|
76
|
+
* `ThemeDropdownMenuRadioGroup`, the theme-selection radio group.
|
|
77
|
+
*
|
|
78
|
+
* Reads and writes the active theme via `useTheme`, so it must render inside
|
|
79
|
+
* a `ThemeProvider` — `useTheme` throws outside of one.
|
|
80
|
+
*
|
|
81
|
+
* To embed theme selection in an existing menu instead (e.g. an account menu
|
|
82
|
+
* submenu), use `ThemeDropdownMenuRadioGroup` directly.
|
|
83
|
+
*
|
|
84
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* Composition:
|
|
88
|
+
* ```
|
|
89
|
+
* ThemeSwitcher.Root
|
|
90
|
+
* ├── ThemeSwitcher.Trigger
|
|
91
|
+
* └── ThemeSwitcher.Content
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <ThemeProvider>
|
|
97
|
+
* <header>
|
|
98
|
+
* <ThemeSwitcher.Root>
|
|
99
|
+
* <ThemeSwitcher.Trigger />
|
|
100
|
+
* <ThemeSwitcher.Content />
|
|
101
|
+
* </ThemeSwitcher.Root>
|
|
102
|
+
* </header>
|
|
103
|
+
* </ThemeProvider>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare const ThemeSwitcher: {
|
|
107
|
+
/**
|
|
108
|
+
* The stateful root: a thin forwarding wrapper over `DropdownMenu.Root`
|
|
109
|
+
* that owns the menu's open/closed state. Renders no DOM of its own.
|
|
110
|
+
*
|
|
111
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <ThemeSwitcher.Root>
|
|
116
|
+
* <ThemeSwitcher.Trigger />
|
|
117
|
+
* <ThemeSwitcher.Content />
|
|
118
|
+
* </ThemeSwitcher.Root>
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
readonly Root: typeof Root;
|
|
122
|
+
/**
|
|
123
|
+
* The button that opens the theme menu: an `IconButton` (ghost by default)
|
|
124
|
+
* with an SSR-safe themed icon. Forwards `IconButton` props; `label`
|
|
125
|
+
* defaults to `"Change Theme"`.
|
|
126
|
+
*
|
|
127
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <ThemeSwitcher.Root>
|
|
132
|
+
* <ThemeSwitcher.Trigger appearance="outlined" label="Choose a theme" />
|
|
133
|
+
* <ThemeSwitcher.Content />
|
|
134
|
+
* </ThemeSwitcher.Root>
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
readonly Trigger: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
|
|
138
|
+
/**
|
|
139
|
+
* The visual style of the trigger `IconButton`. Optional here —
|
|
140
|
+
* `ThemeSwitcher.Trigger` defaults to `"ghost"` so the trigger sits
|
|
141
|
+
* quietly in headers and toolbars.
|
|
142
|
+
*
|
|
143
|
+
* @default "ghost"
|
|
144
|
+
*/
|
|
145
|
+
appearance?: IconButtonAppearance;
|
|
146
|
+
/**
|
|
147
|
+
* The accessible name for the trigger `IconButton`. Visually hidden but
|
|
148
|
+
* announced to screen readers. Override it for localization.
|
|
149
|
+
*
|
|
150
|
+
* @default "Change Theme"
|
|
151
|
+
*/
|
|
152
|
+
label?: string;
|
|
153
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
154
|
+
/**
|
|
155
|
+
* The popover the trigger opens: forwards `DropdownMenu.Content` props
|
|
156
|
+
* (`align`, `side`, `collisionPadding`, `className`, …) and renders the
|
|
157
|
+
* five-theme radio group when no `children` are given.
|
|
158
|
+
*
|
|
159
|
+
* @see https://mantle.ngrok.com/components/forms/theme-switcher
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <ThemeSwitcher.Root>
|
|
164
|
+
* <ThemeSwitcher.Trigger />
|
|
165
|
+
* <ThemeSwitcher.Content align="end" collisionPadding={{ right: 16 }} />
|
|
166
|
+
* </ThemeSwitcher.Root>
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
readonly Content: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
|
|
170
|
+
width?: "trigger" | "content";
|
|
171
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & import("react").RefAttributes<HTMLDivElement>>;
|
|
172
|
+
};
|
|
44
173
|
//#endregion
|
|
45
|
-
export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type
|
|
174
|
+
export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type ThemeSwitcherContentProps, type ThemeSwitcherRootProps, type ThemeSwitcherTriggerProps };
|
package/dist/theme-switcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-CDtYjF_H.js";import{t}from"./icon-button-
|
|
1
|
+
import{t as e}from"./icon-CDtYjF_H.js";import{n as t}from"./slot-DmPrjM7N.js";import{t as n}from"./icon-button-DV2-GZHf.js";import{t as r}from"./browser-only-CPH56Xw_.js";import{d as i,h as a,l as o,p as s}from"./theme-provider-Djj_jBo6.js";import{t as c}from"./dropdown-menu-Bt1aKF1g.js";import{n as l,t as u}from"./theme-D8kZCOzM.js";import{t as d}from"./skeleton-Bu3tgNcW.js";import{forwardRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},g=({className:t,style:n})=>{let[r,u]=o();return p(c.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{s(e)&&u(e)},children:a.map(t=>m(c.RadioItem,{value:i(t),children:[p(e,{svg:p(l,{theme:t})}),h[t]]},t))})};g.displayName=`ThemeDropdownMenuRadioGroup`;const _=e=>p(c.Root,{...e});_.displayName=`ThemeSwitcher`;const v=f(({appearance:e=`ghost`,"data-slot":i,disabled:a,label:o=`Change Theme`,...s},l)=>p(c.Trigger,{asChild:!0,disabled:a,children:p(n,{ref:l,appearance:e,disabled:a,"data-slot":t(i,`theme-switcher-trigger`),intent:`neutral`,icon:p(r,{fallback:p(d,{className:`rounded-full size-5`}),children:()=>p(u,{className:`size-5`})}),label:o,...s})}));v.displayName=`ThemeSwitcherTrigger`;const y=f(({children:e,"data-slot":n,...r},i)=>p(c.Content,{ref:i,"data-slot":t(n,`theme-switcher-content`),...r,children:e??p(g,{})}));y.displayName=`ThemeSwitcherContent`;const b={Root:_,Trigger:v,Content:y};export{g as ThemeDropdownMenuRadioGroup,b as ThemeSwitcher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{s as r}from"./theme-provider-Djj_jBo6.js";import{createContext as i,forwardRef as a,useContext as o,useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{WarningIcon as f}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as p}from"@phosphor-icons/react/WarningDiamond";import*as m from"sonner";const h=({className:t,containerAriaLabel:n,dir:i,duration_ms:a=4e3,position:o=`top-center`,style:s})=>{let l=r();return c(m.Toaster,{"data-slot":`toaster`,className:e(`toaster overlay-prompt pointer-events-auto *:duration-200`,t),containerAriaLabel:n,dir:i,duration:a,gap:12,position:o??`top-center`,style:s,theme:l,toastOptions:{unstyled:!0}})};h.displayName=`Toaster`;const g=i(``);function _(e,t){let n=t?.duration_ms;return typeof n==`number`&&n<=0&&(n=1/0),m.toast.custom(t=>c(g.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const v=i({intent:`info`}),y=a(({asChild:t,children:r,className:i,intent:a,...o},u)=>{let d=t?n:`div`,f=s(()=>({intent:a}),[a]);return c(v.Provider,{value:f,children:l(d,{"data-slot":`toast`,className:e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,i),ref:u,...o,children:[c(E,{intent:a}),r]})})});y.displayName=`Toast`;const b=a(({className:n,svg:r,...i},a)=>{let s=o(v);switch(s.intent){case`danger`:return c(t,{"data-slot":`toast-icon`,className:e(`text-danger-600`,n),ref:a,svg:r??c(f,{weight:`fill`}),...i});case`warning`:return c(t,{"data-slot":`toast-icon`,className:e(`text-warning-600`,n),ref:a,svg:r??c(p,{weight:`fill`}),...i});case`success`:return c(t,{"data-slot":`toast-icon`,className:e(`text-success-600`,n),ref:a,svg:r??c(u,{weight:`fill`}),...i});case`info`:return c(t,{"data-slot":`toast-icon`,className:e(`text-accent-600`,n),ref:a,svg:c(d,{weight:`fill`}),...i});default:throw Error(`Unreachable Case: ${s.intent}`)}});b.displayName=`ToastIcon`;const x=a(({asChild:t,className:r,onClick:i,...a},s)=>{let l=o(g);return c(t?n:`button`,{"data-slot":`toast-action`,className:e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,r),onClick:e=>{i?.(e),!e.defaultPrevented&&m.toast.dismiss(l)},ref:s,...a})});x.displayName=`ToastAction`;const S=a(({asChild:t,className:r,...i},a)=>c(t?n:`p`,{"data-slot":`toast-message`,className:e(`text-strong flex-1 text-sm font-body`,r),ref:a,...i}));S.displayName=`ToastMessage`;const C={Root:y,Action:x,Icon:b,Message:S};function w(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const T={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function E({className:t,intent:n,...r}){return c(`div`,{"aria-hidden":!0,className:e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,T[n],t),...r})}export{w as i,h as n,_ as r,C as t};
|
package/dist/toast.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ type MakeToastOptions = {
|
|
|
40
40
|
* ```tsx
|
|
41
41
|
* // Basic toast with auto-dismiss (default 4000ms, inherits from `<Toaster>`)
|
|
42
42
|
* makeToast(
|
|
43
|
-
* <Toast.Root
|
|
43
|
+
* <Toast.Root intent="success">
|
|
44
44
|
* <Toast.Icon />
|
|
45
45
|
* <Toast.Message>Operation completed successfully!</Toast.Message>
|
|
46
46
|
* <Toast.Action>Dismiss</Toast.Action>
|
|
@@ -49,7 +49,7 @@ type MakeToastOptions = {
|
|
|
49
49
|
*
|
|
50
50
|
* // Toast that stays open until manually dismissed
|
|
51
51
|
* makeToast(
|
|
52
|
-
* <Toast.Root
|
|
52
|
+
* <Toast.Root intent="warning">
|
|
53
53
|
* <Toast.Icon />
|
|
54
54
|
* <Toast.Message>Action required</Toast.Message>
|
|
55
55
|
* <Toast.Action>Dismiss</Toast.Action>
|
|
@@ -59,10 +59,16 @@ type MakeToastOptions = {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
declare function makeToast(children: ReactNode, options?: MakeToastOptions): string | number;
|
|
62
|
-
declare const
|
|
63
|
-
|
|
62
|
+
declare const intents: readonly ["danger", "info", "success", "warning"];
|
|
63
|
+
/**
|
|
64
|
+
* The intent of a toast: the tone or status that the toast's color communicates.
|
|
65
|
+
*/
|
|
66
|
+
type ToastIntent = (typeof intents)[number];
|
|
64
67
|
type ToastProps = ComponentProps<"div"> & WithAsChild & {
|
|
65
|
-
|
|
68
|
+
/**
|
|
69
|
+
* The intent of the toast: the tone or status that the toast's color communicates.
|
|
70
|
+
*/
|
|
71
|
+
intent: ToastIntent;
|
|
66
72
|
};
|
|
67
73
|
type ToastActionProps = ComponentProps<"button"> & WithAsChild;
|
|
68
74
|
type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
@@ -84,7 +90,7 @@ type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
|
84
90
|
* @example
|
|
85
91
|
* ```tsx
|
|
86
92
|
* makeToast(
|
|
87
|
-
* <Toast.Root
|
|
93
|
+
* <Toast.Root intent="success">
|
|
88
94
|
* <Toast.Icon />
|
|
89
95
|
* <Toast.Message>Operation completed successfully!</Toast.Message>
|
|
90
96
|
* <Toast.Action>Dismiss</Toast.Action>
|
|
@@ -94,13 +100,13 @@ type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
|
94
100
|
*/
|
|
95
101
|
declare const Toast: {
|
|
96
102
|
/**
|
|
97
|
-
* A succinct message with
|
|
103
|
+
* A succinct message with an intent that is displayed temporarily.
|
|
98
104
|
*
|
|
99
105
|
* @see https://mantle.ngrok.com/components/feedback/toast#toastroot
|
|
100
106
|
*
|
|
101
107
|
* @example
|
|
102
108
|
* ```tsx
|
|
103
|
-
* <Toast.Root
|
|
109
|
+
* <Toast.Root intent="success">
|
|
104
110
|
* <Toast.Icon />
|
|
105
111
|
* <Toast.Message>Changes saved successfully!</Toast.Message>
|
|
106
112
|
* <Toast.Action>Undo</Toast.Action>
|
|
@@ -115,7 +121,7 @@ declare const Toast: {
|
|
|
115
121
|
*
|
|
116
122
|
* @example
|
|
117
123
|
* ```tsx
|
|
118
|
-
* <Toast.Root
|
|
124
|
+
* <Toast.Root intent="info">
|
|
119
125
|
* <Toast.Icon />
|
|
120
126
|
* <Toast.Message>File uploaded successfully</Toast.Message>
|
|
121
127
|
* <Toast.Action>View File</Toast.Action>
|
|
@@ -124,13 +130,13 @@ declare const Toast: {
|
|
|
124
130
|
*/
|
|
125
131
|
readonly Action: import("react").ForwardRefExoticComponent<Omit<ToastActionProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
126
132
|
/**
|
|
127
|
-
* An icon that visually represents the
|
|
133
|
+
* An icon that visually represents the intent of the toast.
|
|
128
134
|
*
|
|
129
135
|
* @see https://mantle.ngrok.com/components/feedback/toast#toasticon
|
|
130
136
|
*
|
|
131
137
|
* @example
|
|
132
138
|
* ```tsx
|
|
133
|
-
* <Toast.Root
|
|
139
|
+
* <Toast.Root intent="warning">
|
|
134
140
|
* <Toast.Icon />
|
|
135
141
|
* <Toast.Message>Warning message</Toast.Message>
|
|
136
142
|
* </Toast.Root>
|
|
@@ -144,7 +150,7 @@ declare const Toast: {
|
|
|
144
150
|
*
|
|
145
151
|
* @example
|
|
146
152
|
* ```tsx
|
|
147
|
-
* <Toast.Root
|
|
153
|
+
* <Toast.Root intent="success">
|
|
148
154
|
* <Toast.Icon />
|
|
149
155
|
* <Toast.Message>Your changes have been saved</Toast.Message>
|
|
150
156
|
* </Toast.Root>
|
|
@@ -153,4 +159,4 @@ declare const Toast: {
|
|
|
153
159
|
readonly Message: import("react").ForwardRefExoticComponent<Omit<ToastMessageProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
154
160
|
};
|
|
155
161
|
//#endregion
|
|
156
|
-
export { type
|
|
162
|
+
export { Toast, type ToastIntent, Toaster, makeToast };
|
package/dist/toast.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./toast-
|
|
1
|
+
import{n as e,r as t,t as n}from"./toast-D3ntBmn4.js";export{n as Toast,e as Toaster,t as makeToast};
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare namespace TooltipProvider {
|
|
|
21
21
|
* ```tsx
|
|
22
22
|
* <Tooltip.Root>
|
|
23
23
|
* <Tooltip.Trigger asChild>
|
|
24
|
-
* <Button type="button" appearance="outlined">
|
|
24
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
25
25
|
* Hover me
|
|
26
26
|
* </Button>
|
|
27
27
|
* </Tooltip.Trigger>
|
|
@@ -41,7 +41,7 @@ declare function Root(props: ComponentProps<typeof TooltipPrimitive.Root>): impo
|
|
|
41
41
|
* ```tsx
|
|
42
42
|
* <Tooltip.Root>
|
|
43
43
|
* <Tooltip.Trigger asChild>
|
|
44
|
-
* <Button type="button" appearance="outlined">
|
|
44
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
45
45
|
* Hover me
|
|
46
46
|
* </Button>
|
|
47
47
|
* </Tooltip.Trigger>
|
|
@@ -86,7 +86,7 @@ declare function Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>)
|
|
|
86
86
|
* ```tsx
|
|
87
87
|
* <Tooltip.Root>
|
|
88
88
|
* <Tooltip.Trigger asChild>
|
|
89
|
-
* <Button type="button" appearance="outlined">
|
|
89
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
90
90
|
* Hover me
|
|
91
91
|
* </Button>
|
|
92
92
|
* </Tooltip.Trigger>
|
|
@@ -113,7 +113,7 @@ declare const Tooltip: {
|
|
|
113
113
|
* ```tsx
|
|
114
114
|
* <Tooltip.Root>
|
|
115
115
|
* <Tooltip.Trigger asChild>
|
|
116
|
-
* <Button type="button" appearance="outlined">
|
|
116
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
117
117
|
* Hover me
|
|
118
118
|
* </Button>
|
|
119
119
|
* </Tooltip.Trigger>
|
|
@@ -137,7 +137,7 @@ declare const Tooltip: {
|
|
|
137
137
|
* ```tsx
|
|
138
138
|
* <Tooltip.Root>
|
|
139
139
|
* <Tooltip.Trigger asChild>
|
|
140
|
-
* <Button type="button" appearance="outlined">
|
|
140
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
141
141
|
* Hover me
|
|
142
142
|
* </Button>
|
|
143
143
|
* </Tooltip.Trigger>
|
|
@@ -157,7 +157,7 @@ declare const Tooltip: {
|
|
|
157
157
|
* ```tsx
|
|
158
158
|
* <Tooltip.Root>
|
|
159
159
|
* <Tooltip.Trigger asChild>
|
|
160
|
-
* <Button type="button" appearance="outlined">
|
|
160
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
161
161
|
* Hover me
|
|
162
162
|
* </Button>
|
|
163
163
|
* </Tooltip.Trigger>
|
package/package.json
CHANGED
package/dist/button-AS5Ir3DE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{Children as a,cloneElement as o,forwardRef as s,isValidElement as c}from"react";import l from"tiny-invariant";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{CircleNotchIcon as m}from"@phosphor-icons/react/CircleNotch";const h=p(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover border border-transparent text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border border-transparent text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},priority:{danger:``,default:``,neutral:``},size:{xs:``,sm:``,md:``,lg:``,xl:``}},defaultVariants:{appearance:`outlined`,isLoading:!1,priority:`default`,size:`md`},compoundVariants:[{appearance:[`filled`,`ghost`,`outlined`],size:`xs`,class:`h-6 px-2`},{appearance:[`filled`,`ghost`,`outlined`],size:`sm`,class:`h-7 px-2.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`md`,class:`h-9 px-3`},{appearance:[`filled`,`ghost`,`outlined`],size:`lg`,class:`h-10 px-3.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`xl`,class:`h-12 px-4`},{appearance:`ghost`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,priority:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,priority:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,priority:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600`},{appearance:`filled`,priority:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),g={xs:`ps-1.5`,sm:`ps-2`,md:`ps-2.5`,lg:`ps-3`,xl:`ps-3.5`},_={xs:`pe-1.5`,sm:`pe-2`,md:`pe-2.5`,lg:`pe-3`,xl:`pe-3.5`},v=s(({"aria-disabled":s,appearance:p=`outlined`,asChild:v,children:y,className:b,disabled:x,icon:S,iconPlacement:C=`start`,isLoading:w=!1,priority:T=`default`,size:E=`md`,type:D,...O},k)=>{let A=r(s??x??w),j=w?d(m,{className:`animate-spin`}):S,M=j&&p!==`link`,N={"aria-disabled":A,"data-slot":`button`,className:e(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,h({appearance:p,priority:T,isLoading:w,size:E}),p!==`link`&&`font-sans`,M&&C===`start`&&g[E],M&&C===`end`&&_[E],b),"data-appearance":p,"data-disabled":A,"data-loading":w,"data-priority":T,"data-size":p===`link`?void 0:E,disabled:A,ref:k,...O};return v?(l(c(y)&&a.only(y),"When using `asChild`, Button must be passed a single child as a JSX tag."),d(n,{...N,children:o(y,{},f(u,{children:[j&&d(t,{svg:j,className:i(C===`end`&&`order-last`)}),y.props.children]}))})):f(`button`,{...N,type:D??`button`,children:[j&&d(t,{svg:j,className:i(C===`end`&&`order-last`)}),y]})});v.displayName=`Button`;export{v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n}from"./separator-kBnnv3Cw.js";import{forwardRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{CheckIcon as s}from"@phosphor-icons/react/Check";import*as c from"@radix-ui/react-dropdown-menu";const l=c.Root;l.displayName=`DropdownMenu`;const u=r((e,t)=>i(c.Trigger,{ref:t,"data-slot":`dropdown-menu-trigger`,...e}));u.displayName=`DropdownMenuTrigger`;const d=r(({className:t,...n},r)=>i(c.Group,{ref:r,"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}));d.displayName=`DropdownMenuGroup`;const f=c.Portal;f.displayName=`DropdownMenuPortal`;const p=c.Sub;p.displayName=`DropdownMenuSub`;const m=r(({className:t,...n},r)=>i(c.RadioGroup,{ref:r,"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}));m.displayName=`DropdownMenuRadioGroup`;const h=r(({className:n,inset:r,children:s,...l},u)=>a(c.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),ref:u,...l,children:[s,i(`span`,{className:`absolute right-2 flex items-center`,children:i(t,{svg:i(o,{weight:`bold`}),className:`size-4`})})]}));h.displayName=`DropdownMenuSubTrigger`;const g=r(({className:t,loop:n=!0,...r},a)=>i(f,{children:i(c.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,ref:a,...r})}));g.displayName=`DropdownMenuSubContent`;const _=r(({className:t,onClick:n,loop:r=!0,width:a,...o},s)=>i(f,{children:i(c.Content,{ref:s,"data-slot":`dropdown-menu-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,a===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:r,onClick:e=>{e.stopPropagation(),n?.(e)},...o})}));_.displayName=`DropdownMenuContent`;const v=r(({className:t,inset:n,...r},a)=>i(c.Item,{ref:a,"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}));v.displayName=`DropdownMenuItem`;const y=r(({className:n,children:r,checked:o,...l},u)=>a(c.CheckboxItem,{ref:u,"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:o,...l,children:[i(`span`,{className:`absolute right-2 flex items-center`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));y.displayName=`DropdownMenuCheckboxItem`;const b=r(({className:n,children:r,...o},l)=>a(c.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),ref:l,...o,children:[i(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));b.displayName=`DropdownMenuRadioItem`;const x=r(({className:t,inset:n,...r},a)=>i(c.Label,{ref:a,"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}));x.displayName=`DropdownMenuLabel`;const S=r(({className:t,...r},a)=>i(n,{ref:a,"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r}));S.displayName=`DropdownMenuSeparator`;const C=({className:t,...n})=>i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n});C.displayName=`DropdownMenuShortcut`;const w={Root:l,CheckboxItem:y,Content:_,Group:d,Item:v,Label:x,RadioGroup:m,RadioItem:b,Separator:S,Shortcut:C,Sub:p,SubContent:g,SubTrigger:h,Trigger:u};export{w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{Children as i,cloneElement as a,forwardRef as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),h=f(m,{variants:{appearance:{ghost:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`,outlined:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},isLoading:{false:``,true:`opacity-50`},size:{xs:`size-6`,sm:`size-7`,md:`size-9`,lg:`size-10`,xl:`size-12`}},defaultVariants:{appearance:`outlined`,size:`md`}}),g=o(({"aria-disabled":o,appearance:f,asChild:m=!1,children:g,className:_,disabled:v,icon:y,isLoading:b=!1,label:x,size:S=`md`,type:C,...w},T)=>{let E=r(o??v??b),D=b?u(p,{className:`animate-spin`}):y,O={"aria-disabled":E,"data-slot":`icon-button`,className:e(h({appearance:f,isLoading:b,size:S}),_),"data-appearance":f,"data-disabled":E,"data-icon-button":!0,"data-loading":b,"data-size":S,disabled:E,ref:T,...w},k=d(l,{children:[u(`span`,{className:`sr-only`,children:x}),u(t,{svg:D})]});return m?(c(s(g)&&i.only(g),"When using `asChild`, IconButton must be passed a single child as a JSX tag."),u(n,{...O,children:a(g,{},k)})):u(`button`,{...O,type:C??`button`,children:k})});g.displayName=`IconButton`;export{m as n,h as r,g as t};
|
package/dist/index-BnI3OppC.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./dropdown-menu-DT30TQzL.js";
|
package/dist/toast-RkhbliFh.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{s as r}from"./theme-provider-Djj_jBo6.js";import{createContext as i,forwardRef as a,useContext as o,useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{WarningIcon as f}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as p}from"@phosphor-icons/react/WarningDiamond";import*as m from"sonner";const h=({className:t,containerAriaLabel:n,dir:i,duration_ms:a=4e3,position:o=`top-center`,style:s})=>{let l=r();return c(m.Toaster,{"data-slot":`toaster`,className:e(`toaster overlay-prompt pointer-events-auto *:duration-200`,t),containerAriaLabel:n,dir:i,duration:a,gap:12,position:o??`top-center`,style:s,theme:l,toastOptions:{unstyled:!0}})};h.displayName=`Toaster`;const g=i(``);function _(e,t){let n=t?.duration_ms;return typeof n==`number`&&n<=0&&(n=1/0),m.toast.custom(t=>c(g.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const v=i({priority:`info`}),y=a(({asChild:t,children:r,className:i,priority:a,...o},u)=>{let d=t?n:`div`,f=s(()=>({priority:a}),[a]);return c(v.Provider,{value:f,children:l(d,{"data-slot":`toast`,className:e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,i),ref:u,...o,children:[c(E,{priority:a}),r]})})});y.displayName=`Toast`;const b=a(({className:n,svg:r,...i},a)=>{let s=o(v);switch(s.priority){case`danger`:return c(t,{"data-slot":`toast-icon`,className:e(`text-danger-600`,n),ref:a,svg:r??c(f,{weight:`fill`}),...i});case`warning`:return c(t,{"data-slot":`toast-icon`,className:e(`text-warning-600`,n),ref:a,svg:r??c(p,{weight:`fill`}),...i});case`success`:return c(t,{"data-slot":`toast-icon`,className:e(`text-success-600`,n),ref:a,svg:r??c(u,{weight:`fill`}),...i});case`info`:return c(t,{"data-slot":`toast-icon`,className:e(`text-accent-600`,n),ref:a,svg:c(d,{weight:`fill`}),...i});default:throw Error(`Unreachable Case: ${s.priority}`)}});b.displayName=`ToastIcon`;const x=a(({asChild:t,className:r,onClick:i,...a},s)=>{let l=o(g);return c(t?n:`button`,{"data-slot":`toast-action`,className:e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,r),onClick:e=>{i?.(e),!e.defaultPrevented&&m.toast.dismiss(l)},ref:s,...a})});x.displayName=`ToastAction`;const S=a(({asChild:t,className:r,...i},a)=>c(t?n:`p`,{"data-slot":`toast-message`,className:e(`text-strong flex-1 text-sm font-body`,r),ref:a,...i}));S.displayName=`ToastMessage`;const C={Root:y,Action:x,Icon:b,Message:S};function w(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const T={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function E({className:t,priority:n,...r}){return c(`div`,{"aria-hidden":!0,className:e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,T[n],t),...r})}export{w as i,h as n,_ as r,C as t};
|