@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/agent.json
CHANGED
package/dist/alert-dialog.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
4
|
+
import { n as ButtonAppearance, r as ButtonProps } from "./button-DcXOWUYo.js";
|
|
4
5
|
import { t as Root$1 } from "./primitive-C64-m48O.js";
|
|
5
6
|
import { ComponentProps, ReactNode } from "react";
|
|
6
7
|
//#region src/components/alert-dialog/alert-dialog.d.ts
|
|
7
|
-
declare const
|
|
8
|
-
type
|
|
8
|
+
declare const intents: readonly ["info", "danger"];
|
|
9
|
+
type AlertDialogIntent = (typeof intents)[number];
|
|
9
10
|
type AlertDialogProps = ComponentProps<typeof Root$1> & {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* color and styling
|
|
12
|
+
* The intent of the AlertDialog — the tone its color communicates to the
|
|
13
|
+
* user, affecting the color and styling of descendants like
|
|
14
|
+
* `AlertDialog.Icon` and `AlertDialog.Action`.
|
|
13
15
|
*/
|
|
14
|
-
|
|
16
|
+
intent: AlertDialogIntent;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* A modal dialog that interrupts the user with important content and expects a
|
|
@@ -26,9 +28,9 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
|
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* ```tsx
|
|
29
|
-
* <AlertDialog.Root
|
|
31
|
+
* <AlertDialog.Root intent="danger">
|
|
30
32
|
* <AlertDialog.Trigger asChild>
|
|
31
|
-
* <Button type="button" appearance="outlined">
|
|
33
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
32
34
|
* Show Danger Alert Dialog
|
|
33
35
|
* </Button>
|
|
34
36
|
* </AlertDialog.Trigger>
|
|
@@ -54,7 +56,42 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
|
|
|
54
56
|
* </AlertDialog.Root>
|
|
55
57
|
* ```
|
|
56
58
|
*/
|
|
57
|
-
declare function Root({
|
|
59
|
+
declare function Root({ intent, ...props }: AlertDialogProps): import("react").JSX.Element;
|
|
60
|
+
type AlertDialogActionProps = Omit<ButtonProps, "appearance" | "intent"> & {
|
|
61
|
+
/**
|
|
62
|
+
* The visual style of the action button. Optional here — `AlertDialog.Action`
|
|
63
|
+
* defaults to `"filled"` so the confirming action carries the heaviest
|
|
64
|
+
* visual weight in the dialog.
|
|
65
|
+
*
|
|
66
|
+
* @default "filled"
|
|
67
|
+
*/
|
|
68
|
+
appearance?: ButtonAppearance;
|
|
69
|
+
/**
|
|
70
|
+
* The tone of the action button. Optional here — when omitted,
|
|
71
|
+
* `AlertDialog.Action` derives the tone from the parent `AlertDialog.Root`'s
|
|
72
|
+
* `intent` (`"danger"` → `"danger"`, `"info"` → `"accent"`), so the Action
|
|
73
|
+
* carries the dialog's tone the same way its icon does. A passed value
|
|
74
|
+
* always wins over the context-derived tone.
|
|
75
|
+
*/
|
|
76
|
+
intent?: ButtonIntent;
|
|
77
|
+
};
|
|
78
|
+
type AlertDialogCancelProps = Omit<ButtonProps, "appearance" | "intent"> & {
|
|
79
|
+
/**
|
|
80
|
+
* The visual style of the cancel button. Optional here — `AlertDialog.Cancel`
|
|
81
|
+
* defaults to `"outlined"` so it visually de-emphasizes against
|
|
82
|
+
* `AlertDialog.Action`.
|
|
83
|
+
*
|
|
84
|
+
* @default "outlined"
|
|
85
|
+
*/
|
|
86
|
+
appearance?: ButtonAppearance;
|
|
87
|
+
/**
|
|
88
|
+
* The tone of the cancel button. Optional here — `AlertDialog.Cancel`
|
|
89
|
+
* defaults to `"neutral"`, the workhorse tone for routine actions.
|
|
90
|
+
*
|
|
91
|
+
* @default "neutral"
|
|
92
|
+
*/
|
|
93
|
+
intent?: ButtonIntent;
|
|
94
|
+
};
|
|
58
95
|
type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
|
|
59
96
|
svg?: ReactNode;
|
|
60
97
|
};
|
|
@@ -91,9 +128,9 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
|
|
|
91
128
|
*
|
|
92
129
|
* @example
|
|
93
130
|
* ```tsx
|
|
94
|
-
* <AlertDialog.Root
|
|
131
|
+
* <AlertDialog.Root intent="danger">
|
|
95
132
|
* <AlertDialog.Trigger asChild>
|
|
96
|
-
* <Button type="button" appearance="outlined">
|
|
133
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
97
134
|
* Show Danger Alert Dialog
|
|
98
135
|
* </Button>
|
|
99
136
|
* </AlertDialog.Trigger>
|
|
@@ -122,10 +159,10 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
|
|
|
122
159
|
declare const AlertDialog: {
|
|
123
160
|
/**
|
|
124
161
|
* The root stateful component for the Alert Dialog. Wraps the trigger and
|
|
125
|
-
* content and exposes the required `
|
|
126
|
-
* destructive actions, `"info"` for informational confirmations)
|
|
127
|
-
* propagates color to descendants like
|
|
128
|
-
* `AlertDialog.Action`.
|
|
162
|
+
* content and exposes the required `intent` prop (`"danger"` for
|
|
163
|
+
* destructive actions, `"info"` for informational confirmations) — the tone
|
|
164
|
+
* its color communicates — which propagates color to descendants like
|
|
165
|
+
* `AlertDialog.Icon` and `AlertDialog.Action`.
|
|
129
166
|
*
|
|
130
167
|
* `AlertDialog` renders its floating layer at Tailwind `z-50`, Mantle's
|
|
131
168
|
* shared floating z-index. When multiple shared layers are open, the most
|
|
@@ -135,9 +172,9 @@ declare const AlertDialog: {
|
|
|
135
172
|
*
|
|
136
173
|
* @example
|
|
137
174
|
* ```tsx
|
|
138
|
-
* <AlertDialog.Root
|
|
175
|
+
* <AlertDialog.Root intent="danger">
|
|
139
176
|
* <AlertDialog.Trigger asChild>
|
|
140
|
-
* <Button type="button" appearance="outlined">
|
|
177
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
141
178
|
* Show Danger Alert Dialog
|
|
142
179
|
* </Button>
|
|
143
180
|
* </AlertDialog.Trigger>
|
|
@@ -166,17 +203,19 @@ declare const AlertDialog: {
|
|
|
166
203
|
readonly Root: typeof Root;
|
|
167
204
|
/**
|
|
168
205
|
* A button that confirms the Alert Dialog action. Defaults to
|
|
169
|
-
* `appearance="filled"
|
|
170
|
-
* `AlertDialog.Root
|
|
171
|
-
*
|
|
206
|
+
* `appearance="filled"`, with a tone derived from the parent
|
|
207
|
+
* `AlertDialog.Root`'s intent: danger dialogs get a danger button, info
|
|
208
|
+
* dialogs get an accent one — the Action carries the dialog's tone the
|
|
209
|
+
* same way its icon does. Does not close the dialog by default — wrap
|
|
210
|
+
* with `AlertDialog.Close asChild` if the action should also dismiss.
|
|
172
211
|
*
|
|
173
212
|
* @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogaction
|
|
174
213
|
*
|
|
175
214
|
* @example
|
|
176
215
|
* ```tsx
|
|
177
|
-
* <AlertDialog.Root
|
|
216
|
+
* <AlertDialog.Root intent="danger">
|
|
178
217
|
* <AlertDialog.Trigger asChild>
|
|
179
|
-
* <Button type="button" appearance="outlined">
|
|
218
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
180
219
|
* Show Danger Alert Dialog
|
|
181
220
|
* </Button>
|
|
182
221
|
* </AlertDialog.Trigger>
|
|
@@ -202,7 +241,7 @@ declare const AlertDialog: {
|
|
|
202
241
|
* </AlertDialog.Root>
|
|
203
242
|
* ```
|
|
204
243
|
*/
|
|
205
|
-
readonly Action: import("react").ForwardRefExoticComponent<Omit<
|
|
244
|
+
readonly Action: import("react").ForwardRefExoticComponent<Omit<AlertDialogActionProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
206
245
|
/**
|
|
207
246
|
* Contains the main content of the alert dialog. Wraps the header and footer
|
|
208
247
|
* inside `AlertDialog.Content` next to `AlertDialog.Icon`.
|
|
@@ -211,9 +250,9 @@ declare const AlertDialog: {
|
|
|
211
250
|
*
|
|
212
251
|
* @example
|
|
213
252
|
* ```tsx
|
|
214
|
-
* <AlertDialog.Root
|
|
253
|
+
* <AlertDialog.Root intent="danger">
|
|
215
254
|
* <AlertDialog.Trigger asChild>
|
|
216
|
-
* <Button type="button" appearance="outlined">
|
|
255
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
217
256
|
* Show Danger Alert Dialog
|
|
218
257
|
* </Button>
|
|
219
258
|
* </AlertDialog.Trigger>
|
|
@@ -242,16 +281,16 @@ declare const AlertDialog: {
|
|
|
242
281
|
readonly Body: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
243
282
|
/**
|
|
244
283
|
* A button that closes the dialog and cancels the action. Defaults to
|
|
245
|
-
* `appearance="outlined"` and `
|
|
284
|
+
* `appearance="outlined"` and `intent="neutral"` so it visually
|
|
246
285
|
* de-emphasizes against `AlertDialog.Action`.
|
|
247
286
|
*
|
|
248
287
|
* @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogcancel
|
|
249
288
|
*
|
|
250
289
|
* @example
|
|
251
290
|
* ```tsx
|
|
252
|
-
* <AlertDialog.Root
|
|
291
|
+
* <AlertDialog.Root intent="danger">
|
|
253
292
|
* <AlertDialog.Trigger asChild>
|
|
254
|
-
* <Button type="button" appearance="outlined">
|
|
293
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
255
294
|
* Show Danger Alert Dialog
|
|
256
295
|
* </Button>
|
|
257
296
|
* </AlertDialog.Trigger>
|
|
@@ -277,7 +316,7 @@ declare const AlertDialog: {
|
|
|
277
316
|
* </AlertDialog.Root>
|
|
278
317
|
* ```
|
|
279
318
|
*/
|
|
280
|
-
readonly Cancel: import("react").ForwardRefExoticComponent<Omit<
|
|
319
|
+
readonly Cancel: import("react").ForwardRefExoticComponent<Omit<AlertDialogCancelProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
281
320
|
/**
|
|
282
321
|
* A button that closes the Alert Dialog. (Unstyled) Typically wrapped
|
|
283
322
|
* around `AlertDialog.Action` with `asChild` so the action both performs
|
|
@@ -287,9 +326,9 @@ declare const AlertDialog: {
|
|
|
287
326
|
*
|
|
288
327
|
* @example
|
|
289
328
|
* ```tsx
|
|
290
|
-
* <AlertDialog.Root
|
|
329
|
+
* <AlertDialog.Root intent="danger">
|
|
291
330
|
* <AlertDialog.Trigger asChild>
|
|
292
|
-
* <Button type="button" appearance="outlined">
|
|
331
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
293
332
|
* Show Danger Alert Dialog
|
|
294
333
|
* </Button>
|
|
295
334
|
* </AlertDialog.Trigger>
|
|
@@ -330,9 +369,9 @@ declare const AlertDialog: {
|
|
|
330
369
|
*
|
|
331
370
|
* @example
|
|
332
371
|
* ```tsx
|
|
333
|
-
* <AlertDialog.Root
|
|
372
|
+
* <AlertDialog.Root intent="danger">
|
|
334
373
|
* <AlertDialog.Trigger asChild>
|
|
335
|
-
* <Button type="button" appearance="outlined">
|
|
374
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
336
375
|
* Show Danger Alert Dialog
|
|
337
376
|
* </Button>
|
|
338
377
|
* </AlertDialog.Trigger>
|
|
@@ -377,9 +416,9 @@ declare const AlertDialog: {
|
|
|
377
416
|
*
|
|
378
417
|
* @example
|
|
379
418
|
* ```tsx
|
|
380
|
-
* <AlertDialog.Root
|
|
419
|
+
* <AlertDialog.Root intent="danger">
|
|
381
420
|
* <AlertDialog.Trigger asChild>
|
|
382
|
-
* <Button type="button" appearance="outlined">
|
|
421
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
383
422
|
* Show Danger Alert Dialog
|
|
384
423
|
* </Button>
|
|
385
424
|
* </AlertDialog.Trigger>
|
|
@@ -414,9 +453,9 @@ declare const AlertDialog: {
|
|
|
414
453
|
*
|
|
415
454
|
* @example
|
|
416
455
|
* ```tsx
|
|
417
|
-
* <AlertDialog.Root
|
|
456
|
+
* <AlertDialog.Root intent="danger">
|
|
418
457
|
* <AlertDialog.Trigger asChild>
|
|
419
|
-
* <Button type="button" appearance="outlined">
|
|
458
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
420
459
|
* Show Danger Alert Dialog
|
|
421
460
|
* </Button>
|
|
422
461
|
* </AlertDialog.Trigger>
|
|
@@ -451,9 +490,9 @@ declare const AlertDialog: {
|
|
|
451
490
|
*
|
|
452
491
|
* @example
|
|
453
492
|
* ```tsx
|
|
454
|
-
* <AlertDialog.Root
|
|
493
|
+
* <AlertDialog.Root intent="danger">
|
|
455
494
|
* <AlertDialog.Trigger asChild>
|
|
456
|
-
* <Button type="button" appearance="outlined">
|
|
495
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
457
496
|
* Show Danger Alert Dialog
|
|
458
497
|
* </Button>
|
|
459
498
|
* </AlertDialog.Trigger>
|
|
@@ -481,7 +520,7 @@ declare const AlertDialog: {
|
|
|
481
520
|
*/
|
|
482
521
|
readonly Header: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
483
522
|
/**
|
|
484
|
-
* An icon that visually represents the
|
|
523
|
+
* An icon that visually represents the intent of the AlertDialog.
|
|
485
524
|
* Defaults to a warning icon for `danger` and an info icon for `info`. Can
|
|
486
525
|
* be overridden via the `svg` prop.
|
|
487
526
|
*
|
|
@@ -489,9 +528,9 @@ declare const AlertDialog: {
|
|
|
489
528
|
*
|
|
490
529
|
* @example
|
|
491
530
|
* ```tsx
|
|
492
|
-
* <AlertDialog.Root
|
|
531
|
+
* <AlertDialog.Root intent="danger">
|
|
493
532
|
* <AlertDialog.Trigger asChild>
|
|
494
|
-
* <Button type="button" appearance="outlined">
|
|
533
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
495
534
|
* Show Danger Alert Dialog
|
|
496
535
|
* </Button>
|
|
497
536
|
* </AlertDialog.Trigger>
|
|
@@ -527,9 +566,9 @@ declare const AlertDialog: {
|
|
|
527
566
|
*
|
|
528
567
|
* @example
|
|
529
568
|
* ```tsx
|
|
530
|
-
* <AlertDialog.Root
|
|
569
|
+
* <AlertDialog.Root intent="danger">
|
|
531
570
|
* <AlertDialog.Trigger asChild>
|
|
532
|
-
* <Button type="button" appearance="outlined">
|
|
571
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
533
572
|
* Show Danger Alert Dialog
|
|
534
573
|
* </Button>
|
|
535
574
|
* </AlertDialog.Trigger>
|
|
@@ -563,9 +602,9 @@ declare const AlertDialog: {
|
|
|
563
602
|
*
|
|
564
603
|
* @example
|
|
565
604
|
* ```tsx
|
|
566
|
-
* <AlertDialog.Root
|
|
605
|
+
* <AlertDialog.Root intent="danger">
|
|
567
606
|
* <AlertDialog.Trigger asChild>
|
|
568
|
-
* <Button type="button" appearance="outlined">
|
|
607
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
569
608
|
* Show Danger Alert Dialog
|
|
570
609
|
* </Button>
|
|
571
610
|
* </AlertDialog.Trigger>
|
package/dist/alert-dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./button-ClC60Nzg.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-M-kZdNIS.js";import{createContext as f,forwardRef as p,useContext as m,useMemo as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{InfoIcon as y}from"@phosphor-icons/react/Info";import{WarningIcon as b}from"@phosphor-icons/react/Warning";const x=f(null);function S(){let e=m(x);return g(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function C({intent:e,...t}){let n=h(()=>({intent:e}),[e]);return _(x.Provider,{value:n,children:_(c,{...t})})}C.displayName=`AlertDialog`;const w=p(({...e},t)=>_(a,{ref:t,"data-slot":`alert-dialog-trigger`,...e}));w.displayName=`AlertDialogTrigger`;const T=i;T.displayName=`AlertDialogPortal`;const E=p(({className:t,...n},r)=>_(o,{"data-slot":`alert-dialog-overlay`,className:e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-xs`,t),...n,ref:r}));E.displayName=`AlertDialogOverlay`;const D=p(({className:t,preferredWidth:n=`max-w-md`,...r},i)=>v(T,{children:[_(E,{}),_(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:_(s,{"data-slot":`alert-dialog-content`,"data-mantle-modal-content":!0,ref:i,className:e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`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`,n,t),...r})})]}));D.displayName=`AlertDialogContent`;const O=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-body`,className:e(`flex-1 space-y-4`,r),ref:a,...i}));O.displayName=`AlertDialogBody`;const k=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-header`,className:e(`flex flex-col space-y-2 text-center sm:text-start`,r),ref:a,...i}));k.displayName=`AlertDialogHeader`;const A=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-footer`,className:e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,r),ref:a,...i}));A.displayName=`AlertDialogFooter`;const j=p(({className:t,...n},r)=>_(u,{ref:r,"data-slot":`alert-dialog-title`,className:e(`text-strong text-center text-lg font-medium sm:text-start`,t),...n}));j.displayName=`AlertDialogTitle`;const M=p(({className:t,...n},r)=>_(l,{ref:r,"data-slot":`alert-dialog-description`,className:e(`text-body text-center text-sm font-normal sm:text-start`,t),...n}));M.displayName=`AlertDialogDescription`;const N={danger:`danger`,info:`accent`},P=p(({appearance:e=`filled`,intent:t,...n},i)=>{let a=S(),o=N[a.intent];return _(r,{appearance:e,"data-slot":`alert-dialog-action`,intent:t??o,ref:i,...n})});P.displayName=`AlertDialogAction`;const F=p(({appearance:t=`outlined`,className:n,intent:i=`neutral`,...a},o)=>_(d,{asChild:!0,children:_(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),intent:i,ref:o,...a})}));F.displayName=`AlertDialogCancel`;const I={danger:_(b,{}),info:_(y,{})},L={danger:`text-danger-600`,info:`text-accent-600`},R=p(({className:n,svg:r,...i},a)=>{let o=S(),s=L[o.intent],c=I[o.intent];return _(t,{ref:a,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:r??c,...i})});R.displayName=`AlertDialogIcon`;const z=p(({...e},t)=>_(d,{ref:t,"data-slot":`alert-dialog-close`,...e}));z.displayName=`AlertDialogClose`;const B={Root:C,Action:P,Body:O,Cancel:F,Close:z,Content:D,Description:M,Footer:A,Header:k,Icon:R,Title:j,Trigger:w};export{B as AlertDialog};
|
package/dist/alert.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
3
3
|
import "./index-D47aqlpz.js";
|
|
4
|
-
import { n as IconButtonProps } from "./icon-button-
|
|
4
|
+
import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-B7uEj1qq.js";
|
|
5
5
|
import { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
6
6
|
//#region src/components/alert/alert.d.ts
|
|
7
|
-
declare const
|
|
8
|
-
type
|
|
7
|
+
declare const intents: readonly ["danger", "important", "info", "success", "warning"];
|
|
8
|
+
type AlertIntent = (typeof intents)[number];
|
|
9
9
|
declare const appearances: readonly ["banner", "default"];
|
|
10
10
|
type Appearance = (typeof appearances)[number];
|
|
11
11
|
type AlertProps = ComponentProps<"div"> & {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* color and styling
|
|
13
|
+
* The intent of the Alert — the status its color communicates to the user,
|
|
14
|
+
* determining the color and styling of the Alert.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
intent: AlertIntent;
|
|
17
17
|
/**
|
|
18
18
|
* Controls the visual style of the Alert.
|
|
19
19
|
* - "default" provides standard rounded corners and borders.
|
|
@@ -25,12 +25,20 @@ type AlertProps = ComponentProps<"div"> & {
|
|
|
25
25
|
};
|
|
26
26
|
type AlertIconProps = Omit<SvgAttributes, "children"> & {
|
|
27
27
|
/**
|
|
28
|
-
* An optional icon that renders in place of the default icon for the Alert
|
|
28
|
+
* An optional icon that renders in place of the default icon for the Alert intent.
|
|
29
29
|
*/
|
|
30
30
|
svg?: ReactNode;
|
|
31
31
|
};
|
|
32
32
|
type AlertDescriptionProps = ComponentProps<"div"> & WithAsChild;
|
|
33
|
-
type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "icon">> & {
|
|
33
|
+
type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
|
|
34
|
+
/**
|
|
35
|
+
* The visual style of the dismiss button. Optional here —
|
|
36
|
+
* `Alert.DismissIconButton` defaults to `"ghost"` so the dismiss affordance
|
|
37
|
+
* stays visually quiet inside the Alert.
|
|
38
|
+
*
|
|
39
|
+
* @default "ghost"
|
|
40
|
+
*/
|
|
41
|
+
appearance?: IconButtonAppearance;
|
|
34
42
|
/**
|
|
35
43
|
* An optional icon to render inside the dismiss button. Defaults to an X icon.
|
|
36
44
|
*/
|
|
@@ -58,7 +66,7 @@ declare const DismissIconButton: {
|
|
|
58
66
|
*
|
|
59
67
|
* @example
|
|
60
68
|
* ```tsx
|
|
61
|
-
* <Alert
|
|
69
|
+
* <Alert intent="info">
|
|
62
70
|
* <AlertIcon />
|
|
63
71
|
* <AlertContent>
|
|
64
72
|
* <AlertTitle>Alert Title</AlertTitle>
|
|
@@ -78,7 +86,7 @@ declare const Alert: {
|
|
|
78
86
|
*
|
|
79
87
|
* @example
|
|
80
88
|
* ```tsx
|
|
81
|
-
* <Alert.Root
|
|
89
|
+
* <Alert.Root intent="info">
|
|
82
90
|
* <Alert.Icon />
|
|
83
91
|
* <Alert.Content>
|
|
84
92
|
* <Alert.Title>Alert Title</Alert.Title>
|
|
@@ -95,7 +103,7 @@ declare const Alert: {
|
|
|
95
103
|
*
|
|
96
104
|
* @example
|
|
97
105
|
* ```tsx
|
|
98
|
-
* <Alert.Root
|
|
106
|
+
* <Alert.Root intent="info">
|
|
99
107
|
* <Alert.Icon />
|
|
100
108
|
* <Alert.Content>
|
|
101
109
|
* <Alert.Title>Alert Title</Alert.Title>
|
|
@@ -112,7 +120,7 @@ declare const Alert: {
|
|
|
112
120
|
*
|
|
113
121
|
* @example
|
|
114
122
|
* ```tsx
|
|
115
|
-
* <Alert.Root
|
|
123
|
+
* <Alert.Root intent="info">
|
|
116
124
|
* <Alert.Icon />
|
|
117
125
|
* <Alert.Content>
|
|
118
126
|
* <Alert.Title>Alert Title</Alert.Title>
|
|
@@ -129,7 +137,7 @@ declare const Alert: {
|
|
|
129
137
|
*
|
|
130
138
|
* @example
|
|
131
139
|
* ```tsx
|
|
132
|
-
* <Alert.Root
|
|
140
|
+
* <Alert.Root intent="info">
|
|
133
141
|
* <Alert.Icon />
|
|
134
142
|
* <Alert.Content>
|
|
135
143
|
* <Alert.Title>Alert Title</Alert.Title>
|
|
@@ -141,13 +149,13 @@ declare const Alert: {
|
|
|
141
149
|
*/
|
|
142
150
|
readonly DismissIconButton: typeof DismissIconButton;
|
|
143
151
|
/**
|
|
144
|
-
* An optional icon that visually represents the
|
|
152
|
+
* An optional icon that visually represents the intent of the Alert.
|
|
145
153
|
*
|
|
146
154
|
* @see https://mantle.ngrok.com/components/feedback/alert#alerticon
|
|
147
155
|
*
|
|
148
156
|
* @example
|
|
149
157
|
* ```tsx
|
|
150
|
-
* <Alert.Root
|
|
158
|
+
* <Alert.Root intent="info">
|
|
151
159
|
* <Alert.Icon />
|
|
152
160
|
* <Alert.Content>
|
|
153
161
|
* <Alert.Title>Alert Title</Alert.Title>
|
|
@@ -164,7 +172,7 @@ declare const Alert: {
|
|
|
164
172
|
*
|
|
165
173
|
* @example
|
|
166
174
|
* ```tsx
|
|
167
|
-
* <Alert.Root
|
|
175
|
+
* <Alert.Root intent="info">
|
|
168
176
|
* <Alert.Icon />
|
|
169
177
|
* <Alert.Content>
|
|
170
178
|
* <Alert.Title>Alert Title</Alert.Title>
|
package/dist/alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./icon-button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./icon-button-DV2-GZHf.js";import{createContext as a,forwardRef as o,useContext as s,useMemo as c}from"react";import l from"tiny-invariant";import{jsx as u}from"react/jsx-runtime";import{CheckCircleIcon as d}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as f}from"@phosphor-icons/react/Info";import{MegaphoneIcon as p}from"@phosphor-icons/react/Megaphone";import{WarningIcon as m}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";import{XIcon as g}from"@phosphor-icons/react/X";import{cva as _}from"class-variance-authority";const v=a(null),y=u(g,{});function b(){let e=s(v);return l(e,`useAlertContext hook used outside of Alert parent!`),e}const x=_(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),S=o(({appearance:t=`default`,className:n,intent:r,...i},a)=>{let o=c(()=>({intent:r}),[r]);return u(v.Provider,{value:o,children:u(`div`,{ref:a,"data-slot":`alert`,className:e(x({appearance:t,intent:r}),n),...i})})});S.displayName=`Alert`;const C={danger:u(m,{}),important:u(p,{mirrored:!0}),info:u(f,{}),success:u(d,{}),warning:u(h,{})},w=o(({className:n,svg:r,...i},a)=>{let o=b(),s=C[o.intent];return u(t,{ref:a,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:r??s,...i})});w.displayName=`AlertIcon`;const T=o(({className:t,...n},r)=>u(`div`,{ref:r,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...n}));T.displayName=`AlertContent`;const E=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`h5`,{ref:a,"data-slot":`alert-title`,className:e(`font-medium`,r),...i}));E.displayName=`AlertTitle`;const D=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`div`,{ref:a,"data-slot":`alert-description`,className:e(`text-sm`,r),...i}));D.displayName=`AlertDescription`;const O=e=>`var(--color-${e}-700)`,k=e=>`var(--color-${e}-800)`,A=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,j=({size:t=`sm`,type:n=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=y,style:l,...d})=>{let f=b();return u(i,{appearance:o,icon:c,intent:`neutral`,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:n,style:r({...l,"--alert-dismiss-icon-color":O(f.intent),"--alert-dismiss-icon-hover-color":k(f.intent),"--alert-dismiss-hover-bg":A(f.intent)}),...d})};j.displayName=`AlertDismissIconButton`;const M={Root:S,Content:T,Description:D,DismissIconButton:j,Icon:w,Title:E};export{M as Alert};
|
|
@@ -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{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`},intent:{accent:``,danger:``,neutral:``},size:{xs:``,sm:``,md:``,lg:``,xl:``}},defaultVariants:{isLoading:!1,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`,intent:`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`,intent:`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`,intent:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,intent:`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`,intent:`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`,intent:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,intent:`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,asChild:v,children:y,className:b,disabled:x,icon:S,iconPlacement:C=`start`,intent:w,isLoading:T=!1,size:E=`md`,type:D,...O},k)=>{let A=r(s??x??T),j=T?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,intent:w,isLoading:T,size:E}),p!==`link`&&`font-sans`,M&&C===`start`&&g[E],M&&C===`end`&&_[E],b),"data-appearance":p,"data-disabled":A,"data-intent":w,"data-loading":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,18 +1,52 @@
|
|
|
1
1
|
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { r as VariantProps } from "./index-D47aqlpz.js";
|
|
3
|
+
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
3
4
|
import { ComponentProps, ReactNode } from "react";
|
|
4
5
|
//#region src/components/button/button.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The visual style of a `Button`: how much visual weight the button carries,
|
|
8
|
+
* independent of its tone (`intent`).
|
|
9
|
+
*
|
|
10
|
+
* - `"filled"` — solid fill; the heaviest weight on the page
|
|
11
|
+
* - `"outlined"` — bordered on the form background
|
|
12
|
+
* - `"ghost"` — no border or fill until hovered
|
|
13
|
+
* - `"link"` — renders like an inline link (inherits surrounding typography)
|
|
14
|
+
* while remaining a button that performs an action
|
|
15
|
+
*/
|
|
16
|
+
type ButtonAppearance = "filled" | "ghost" | "link" | "outlined";
|
|
5
17
|
declare const buttonVariants: (props?: ({
|
|
6
18
|
appearance?: "filled" | "ghost" | "link" | "outlined" | null | undefined;
|
|
7
19
|
isLoading?: boolean | null | undefined;
|
|
8
|
-
|
|
20
|
+
intent?: "accent" | "danger" | "neutral" | null | undefined;
|
|
9
21
|
size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
|
|
10
22
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
23
|
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
12
24
|
/**
|
|
13
25
|
* The props for the `Button` component.
|
|
14
26
|
*/
|
|
15
|
-
type ButtonProps = ComponentProps<"button"> & ButtonVariants & WithAsChild & {
|
|
27
|
+
type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance" | "intent"> & WithAsChild & {
|
|
28
|
+
/**
|
|
29
|
+
* The visual style of the Button. Required — there is no default, so
|
|
30
|
+
* every call site states the weight it means.
|
|
31
|
+
*
|
|
32
|
+
* @enum
|
|
33
|
+
* - `"filled"`: solid fill; the heaviest visual weight
|
|
34
|
+
* - `"outlined"`: bordered on the form background
|
|
35
|
+
* - `"ghost"`: no border or fill until hovered
|
|
36
|
+
* - `"link"`: renders like an inline link (inherits surrounding typography) while remaining a button
|
|
37
|
+
*/
|
|
38
|
+
appearance: ButtonAppearance;
|
|
39
|
+
/**
|
|
40
|
+
* The tone of the Button — the purpose its color communicates to the
|
|
41
|
+
* user. Required — there is no default, so every call site states the
|
|
42
|
+
* tone it means.
|
|
43
|
+
*
|
|
44
|
+
* @enum
|
|
45
|
+
* - `"neutral"`: the workhorse tone — routine and secondary actions, and the default primary action (`appearance="filled" intent="neutral"`)
|
|
46
|
+
* - `"accent"`: deliberate brand emphasis; reach for it when an action should carry the brand color, not as the routine primary
|
|
47
|
+
* - `"danger"`: a destructive or irreversible action
|
|
48
|
+
*/
|
|
49
|
+
intent: ButtonIntent;
|
|
16
50
|
/**
|
|
17
51
|
* An icon to render inside the button, beside the button's text
|
|
18
52
|
* children. If the `state` is `"pending"`, then the icon will
|
|
@@ -54,6 +88,13 @@ type ButtonProps = ComponentProps<"button"> & ButtonVariants & WithAsChild & {
|
|
|
54
88
|
* other assistive technology. Once activated, it then performs an action, such
|
|
55
89
|
* as submitting a form or opening a dialog.
|
|
56
90
|
*
|
|
91
|
+
* `appearance` (visual weight) and `intent` (tone) are required — every call
|
|
92
|
+
* site states what it means; there are no implicit defaults.
|
|
93
|
+
*
|
|
94
|
+
* The primary action button should be `appearance="filled" intent="neutral"` —
|
|
95
|
+
* the system's default primary action. Reserve `intent="accent"` for
|
|
96
|
+
* deliberate brand emphasis.
|
|
97
|
+
*
|
|
57
98
|
* An icon-only button is not a `Button` — use `IconButton` instead: an
|
|
58
99
|
* icon-only `Button` has no accessible name and keeps its text-box padding,
|
|
59
100
|
* while `IconButton` requires a screen-reader `label` and renders a square
|
|
@@ -62,8 +103,9 @@ type ButtonProps = ComponentProps<"button"> & ButtonVariants & WithAsChild & {
|
|
|
62
103
|
* @see https://mantle.ngrok.com/components/actions/button
|
|
63
104
|
*
|
|
64
105
|
* @example
|
|
106
|
+
* The default primary action — filled + neutral:
|
|
65
107
|
* ```tsx
|
|
66
|
-
* <Button appearance="filled" onClick={handleClick}>
|
|
108
|
+
* <Button appearance="filled" intent="neutral" onClick={handleClick}>
|
|
67
109
|
* Click me
|
|
68
110
|
* </Button>
|
|
69
111
|
* ```
|
|
@@ -71,7 +113,7 @@ type ButtonProps = ComponentProps<"button"> & ButtonVariants & WithAsChild & {
|
|
|
71
113
|
* @example
|
|
72
114
|
* Submit a form — opt in with `type="submit"` (the default `"button"` does not submit):
|
|
73
115
|
* ```tsx
|
|
74
|
-
* <Button type="submit" appearance="filled">
|
|
116
|
+
* <Button type="submit" appearance="filled" intent="neutral">
|
|
75
117
|
* Save
|
|
76
118
|
* </Button>
|
|
77
119
|
* ```
|
|
@@ -80,10 +122,10 @@ type ButtonProps = ComponentProps<"button"> & ButtonVariants & WithAsChild & {
|
|
|
80
122
|
* Icon-only buttons are not `Button`s — use `IconButton` instead (an icon-only
|
|
81
123
|
* `Button` has no accessible name and keeps its text-box padding):
|
|
82
124
|
* ```tsx
|
|
83
|
-
* // ❌ <Button icon={<CopyIcon />} onClick={copyPage} />
|
|
84
|
-
* <IconButton icon={<CopyIcon />} label="Copy page" onClick={copyPage} />
|
|
125
|
+
* // ❌ <Button appearance="outlined" intent="neutral" icon={<CopyIcon />} onClick={copyPage} />
|
|
126
|
+
* <IconButton appearance="outlined" intent="neutral" icon={<CopyIcon />} label="Copy page" onClick={copyPage} />
|
|
85
127
|
* ```
|
|
86
128
|
*/
|
|
87
129
|
declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
88
130
|
//#endregion
|
|
89
|
-
export {
|
|
131
|
+
export { ButtonAppearance as n, ButtonProps as r, Button as t };
|
package/dist/button.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
4
|
-
import { t as
|
|
5
|
-
|
|
1
|
+
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
2
|
+
import { n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-DcXOWUYo.js";
|
|
3
|
+
import { n as IconButtonAppearance, r as IconButtonProps, t as IconButton } from "./icon-button-B7uEj1qq.js";
|
|
4
|
+
import { n as ButtonGroupProps, t as ButtonGroup } from "./index-BivvYYs-.js";
|
|
5
|
+
import { t as ButtonSize } from "./sizes-BCoI4bhP.js";
|
|
6
|
+
export { Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonIntent, type ButtonProps, type ButtonSize, IconButton, type IconButtonAppearance, type IconButtonProps };
|
package/dist/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-button-
|
|
1
|
+
import{t as e}from"./icon-button-DV2-GZHf.js";import{t}from"./button-ClC60Nzg.js";import{t as n}from"./button-5t6-JS_I.js";export{t as Button,n as ButtonGroup,e as IconButton};
|
package/dist/calendar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n}from"./icon-button-DV2-GZHf.js";import{jsx as r}from"react/jsx-runtime";import{CaretRightIcon as i}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{DayPicker as o}from"react-day-picker";const s=n({appearance:`ghost`,intent:`neutral`,size:`sm`});function c({className:n,classNames:c,showOutsideDays:l=!1,...u}){return r(o,{"data-slot":`calendar`,animate:!1,components:{Chevron:e=>r(t,{svg:e.orientation===`left`?r(a,{}):r(i,{}),className:`size-4`})},classNames:{root:e(`isolate`,n),button_next:e(s,`absolute right-0`),button_previous:e(s,`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,u.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...c},showOutsideDays:l,...u})}c.displayName=`Calendar`;export{c as Calendar};
|