@ngrok/mantle 0.32.0 → 0.32.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/accordion.d.ts +143 -2
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/alert-dialog.d.ts +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.d.ts +5 -2
- package/dist/alert.js +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor.d.ts +1 -1
- package/dist/anchor.js +1 -1
- package/dist/anchor.js.map +1 -1
- package/dist/badge.d.ts +4 -1
- package/dist/badge.js +1 -1
- package/dist/badge.js.map +1 -1
- package/dist/{button-C8eGiHOm.d.ts → button-BvWgeelK.d.ts} +8 -1
- package/dist/{button-group-CpDp0fYZ.d.ts → button-group-7oT-O90J.d.ts} +11 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +17 -0
- package/dist/calendar.js +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/{chunk-7XIZZ4HQ.js → chunk-3H3EUKI7.js} +1 -1
- package/dist/chunk-3H3EUKI7.js.map +1 -0
- package/dist/{chunk-ZXLA5BJX.js → chunk-3X4AKTRA.js} +2 -2
- package/dist/chunk-3X4AKTRA.js.map +1 -0
- package/dist/chunk-6RJ2G2DK.js +34 -0
- package/dist/chunk-6RJ2G2DK.js.map +1 -0
- package/dist/chunk-I6T6YV2L.js +2 -0
- package/dist/chunk-I6T6YV2L.js.map +1 -0
- package/dist/chunk-IVXZIYX4.js +2 -0
- package/dist/chunk-IVXZIYX4.js.map +1 -0
- package/dist/chunk-J6ZF5J72.js +2 -0
- package/dist/chunk-J6ZF5J72.js.map +1 -0
- package/dist/chunk-JIRNFNH5.js +2 -0
- package/dist/{chunk-72UMV3YP.js.map → chunk-JIRNFNH5.js.map} +1 -1
- package/dist/chunk-NPTDRQT5.js +2 -0
- package/dist/chunk-NPTDRQT5.js.map +1 -0
- package/dist/chunk-NRMIFYYG.js +2 -0
- package/dist/chunk-NRMIFYYG.js.map +1 -0
- package/dist/{chunk-VTCWSFFJ.js → chunk-PANPBV3Q.js} +2 -2
- package/dist/{chunk-VTCWSFFJ.js.map → chunk-PANPBV3Q.js.map} +1 -1
- package/dist/{chunk-BK4P33ZH.js → chunk-RTXWW6ND.js} +2 -2
- package/dist/{chunk-BK4P33ZH.js.map → chunk-RTXWW6ND.js.map} +1 -1
- package/dist/{chunk-3MDQ3LC2.js → chunk-W2YQRWR5.js} +2 -2
- package/dist/{chunk-3MDQ3LC2.js.map → chunk-W2YQRWR5.js.map} +1 -1
- package/dist/code-block.d.ts +3 -0
- package/dist/code-block.js +3 -3
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.d.ts +4 -1
- package/dist/combobox.js +1 -1
- package/dist/combobox.js.map +1 -1
- package/dist/data-table.d.ts +41 -12
- package/dist/data-table.js +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/dialog.d.ts +256 -3
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.d.ts +80 -0
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/flag.d.ts +4 -1
- package/dist/flag.js +1 -1
- package/dist/flag.js.map +1 -1
- package/dist/hover-card.d.ts +58 -0
- package/dist/hover-card.js +1 -1
- package/dist/hover-card.js.map +1 -1
- package/dist/{icon-Cu-iYUjr.d.ts → icon-CkvpQ4BK.d.ts} +1 -7
- package/dist/{icon-button-D41yiI7H.d.ts → icon-button-D4BTvC7F.d.ts} +12 -1
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +9 -0
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/inline-code.d.ts +10 -1
- package/dist/inline-code.js.map +1 -1
- package/dist/input.d.ts +39 -1
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js.map +1 -1
- package/dist/pagination.d.ts +51 -1
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +77 -17
- package/dist/popover.js.map +1 -1
- package/dist/{primitive-hud69IM9.d.ts → primitive-BUbUB7RS.d.ts} +3 -0
- package/dist/progress.d.ts +14 -2
- package/dist/progress.js +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.d.ts +51 -3
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/sandboxed-on-click.d.ts +0 -3
- package/dist/sandboxed-on-click.js.map +1 -1
- package/dist/select.d.ts +8 -4
- package/dist/select.js +1 -1
- package/dist/separator.d.ts +4 -1
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +18 -6
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/{svg-only-CS2INnEL.d.ts → svg-only-Bj2yffO4.d.ts} +7 -7
- package/dist/switch.d.ts +2 -2
- package/dist/switch.js.map +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +104 -1
- package/dist/tabs.js +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/text-area.d.ts +2 -1
- package/dist/text-area.js.map +1 -1
- package/dist/theme-provider.d.ts +29 -5
- package/dist/theme-provider.js +1 -1
- package/dist/toast.d.ts +70 -2
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +53 -13
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3XX7M573.js +0 -34
- package/dist/chunk-3XX7M573.js.map +0 -1
- package/dist/chunk-72UMV3YP.js +0 -2
- package/dist/chunk-7XIZZ4HQ.js.map +0 -1
- package/dist/chunk-BGY3DO4G.js +0 -2
- package/dist/chunk-BGY3DO4G.js.map +0 -1
- package/dist/chunk-HDPLH5HC.js +0 -2
- package/dist/chunk-HDPLH5HC.js.map +0 -1
- package/dist/chunk-HVMKFNT3.js +0 -2
- package/dist/chunk-HVMKFNT3.js.map +0 -1
- package/dist/chunk-UXH22BMO.js +0 -2
- package/dist/chunk-UXH22BMO.js.map +0 -1
- package/dist/chunk-XQVVOOLT.js +0 -2
- package/dist/chunk-XQVVOOLT.js.map +0 -1
- package/dist/chunk-ZXLA5BJX.js.map +0 -1
package/dist/switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/switch/switch.tsx"],"sourcesContent":["import {\n\tRoot as SwitchPrimitiveRoot,\n\tThumb as SwitchPrimitiveThumb,\n} from \"@radix-ui/react-switch\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { parseBooleanish } from \"../../types/booleanish.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype SwitchProps = ComponentPropsWithoutRef<typeof SwitchPrimitiveRoot> & {\n\t/**\n\t * Makes the switch immutable, meaning the user can not edit the control.\n\t */\n\treadOnly?: boolean;\n};\n\n/**\n * A form control that allows the user to toggle between checked and not checked.\n *\n * @see https://mantle.ngrok.com/components/switch#api\n *\n * @example\n * ```tsx\n * <form>\n * <Label htmlFor=\"airplane-mode\" className=\"flex items-center gap-2\">\n * Airplane Mode\n * <Switch name=\"airplane-mode\" id=\"airplane-mode\" />\n * </Label>\n * </form>\n
|
|
1
|
+
{"version":3,"sources":["../src/components/switch/switch.tsx"],"sourcesContent":["import {\n\tRoot as SwitchPrimitiveRoot,\n\tThumb as SwitchPrimitiveThumb,\n} from \"@radix-ui/react-switch\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { parseBooleanish } from \"../../types/booleanish.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype SwitchProps = ComponentPropsWithoutRef<typeof SwitchPrimitiveRoot> & {\n\t/**\n\t * Makes the switch immutable, meaning the user can not edit the control.\n\t */\n\treadOnly?: boolean;\n};\n\n/**\n * A form control that allows the user to toggle between checked and not checked.\n *\n * @see https://mantle.ngrok.com/components/switch#api-switch\n *\n * @example\n * ```tsx\n * <form>\n * <Label htmlFor=\"airplane-mode\" className=\"flex items-center gap-2\">\n * Airplane Mode\n * <Switch name=\"airplane-mode\" id=\"airplane-mode\" />\n * </Label>\n * </form>\n * ```\n */\nconst Switch = forwardRef<\n\tComponentRef<typeof SwitchPrimitiveRoot>,\n\tSwitchProps\n>(\n\t(\n\t\t{\n\t\t\t\"aria-readonly\": _ariaReadOnly,\n\t\t\tclassName,\n\t\t\treadOnly: _readOnly,\n\t\t\tonClick,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst readOnly = parseBooleanish(_readOnly ?? _ariaReadOnly);\n\n\t\treturn (\n\t\t\t<SwitchPrimitiveRoot\n\t\t\t\taria-readonly={readOnly}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-none\",\n\t\t\t\t\t\"disabled:cursor-default disabled:opacity-50\",\n\t\t\t\t\t\"focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-none focus-visible:ring-4\",\n\t\t\t\t\t\"data-state-checked:bg-blue-500 data-state-unchecked:bg-gray-400\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (readOnly) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<SwitchPrimitiveThumb\n\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\"pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform\",\n\t\t\t\t\t\t\"data-state-checked:translate-x-[1.125rem] data-state-unchecked:translate-x-[0.125rem]\",\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</SwitchPrimitiveRoot>\n\t\t);\n\t},\n);\nSwitch.displayName = \"Switch\";\n\nexport {\n\t//\n\tSwitch,\n};\n"],"mappings":"gFAAA,OACC,QAAQA,EACR,SAASC,MACH,yBACP,OAAOC,MAAU,OACjB,OAAS,cAAAC,MAAkB,QAgEvB,cAAAC,MAAA,oBArCJ,IAAMC,EAASC,EAId,CACC,CACC,gBAAiBC,EACjB,UAAAC,EACA,SAAUC,EACV,QAAAC,EACA,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAWC,EAAgBL,GAAaF,CAAa,EAE3D,OACCH,EAACW,EAAA,CACA,gBAAeF,EACf,UAAWG,EACV,0FACA,8CACA,kHACA,kEACAR,CACD,EACA,QAAUS,GAAU,CACnB,GAAIJ,EAAU,CACbI,EAAM,eAAe,EACrBA,EAAM,gBAAgB,EACtB,MACD,CACAP,IAAUO,CAAK,CAChB,EACA,IAAKL,EACJ,GAAGD,EAEJ,SAAAP,EAACc,EAAA,CACA,UAAWC,EACV,gGACA,uFACD,EACD,EACD,CAEF,CACD,EACAd,EAAO,YAAc","names":["SwitchPrimitiveRoot","SwitchPrimitiveThumb","clsx","forwardRef","jsx","Switch","forwardRef","_ariaReadOnly","className","_readOnly","onClick","props","ref","readOnly","parseBooleanish","SwitchPrimitiveRoot","cx","event","SwitchPrimitiveThumb","clsx"]}
|
package/dist/table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,b as a,c as l,d as b,e as o,f as T,g as t,h as d,i as r}from"./chunk-
|
|
1
|
+
import{a as e,b as a,c as l,d as b,e as o,f as T,g as t,h as d,i as r}from"./chunk-JIRNFNH5.js";import"./chunk-MF2QITTY.js";import"./chunk-AZ56JGNY.js";export{a as Table,b as TableBody,r as TableCaption,d as TableCell,o as TableFoot,l as TableHead,t as TableHeader,e as TableRoot,T as TableRow};
|
|
2
2
|
//# sourceMappingURL=table.js.map
|
package/dist/tabs.d.ts
CHANGED
|
@@ -3,10 +3,113 @@ import * as react from 'react';
|
|
|
3
3
|
import { HTMLAttributes } from 'react';
|
|
4
4
|
import * as _radix_ui_react_tabs from '@radix-ui/react-tabs';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* A set of layered sections of content—known as tab panels—that are displayed one at a time.
|
|
8
|
+
* The root component that provides context for all tab components.
|
|
9
|
+
*
|
|
10
|
+
* @see https://mantle.ngrok.com/components/tabs#api-tabs
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Tabs defaultValue="account">
|
|
15
|
+
* <TabsList>
|
|
16
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
17
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
18
|
+
* </TabsList>
|
|
19
|
+
* <TabsContent value="account">
|
|
20
|
+
* <p>Make changes to your account here.</p>
|
|
21
|
+
* </TabsContent>
|
|
22
|
+
* <TabsContent value="password">
|
|
23
|
+
* <p>Change your password here.</p>
|
|
24
|
+
* </TabsContent>
|
|
25
|
+
* </Tabs>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
6
28
|
declare const Tabs: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
/**
|
|
30
|
+
* Contains the triggers that are aligned along the edge of the active content.
|
|
31
|
+
* The container for tab triggers that provides the visual layout for tab navigation.
|
|
32
|
+
*
|
|
33
|
+
* @see https://mantle.ngrok.com/components/tabs#api-tabs-list
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Tabs defaultValue="account">
|
|
38
|
+
* <TabsList>
|
|
39
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
40
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
41
|
+
* </TabsList>
|
|
42
|
+
* <TabsContent value="account">
|
|
43
|
+
* <p>Make changes to your account here.</p>
|
|
44
|
+
* </TabsContent>
|
|
45
|
+
* </Tabs>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
7
48
|
declare const TabsList: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
/**
|
|
50
|
+
* The button that activates its associated content.
|
|
51
|
+
* A clickable tab trigger that switches between different tab content panels.
|
|
52
|
+
*
|
|
53
|
+
* @see https://mantle.ngrok.com/components/tabs#api-tabs-trigger
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <Tabs defaultValue="account">
|
|
58
|
+
* <TabsList>
|
|
59
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
60
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
61
|
+
* </TabsList>
|
|
62
|
+
* <TabsContent value="account">
|
|
63
|
+
* <p>Make changes to your account here.</p>
|
|
64
|
+
* </TabsContent>
|
|
65
|
+
* </Tabs>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
8
68
|
declare const TabsTrigger: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
|
|
69
|
+
/**
|
|
70
|
+
* A badge component that can be used inside tab triggers to display additional information.
|
|
71
|
+
* Typically used to show counts or status indicators within tab headers.
|
|
72
|
+
*
|
|
73
|
+
* @see https://mantle.ngrok.com/components/tabs#api-tab-badge
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* <Tabs defaultValue="account">
|
|
78
|
+
* <TabsList>
|
|
79
|
+
* <TabsTrigger value="account">
|
|
80
|
+
* Account <TabBadge>5</TabBadge>
|
|
81
|
+
* </TabsTrigger>
|
|
82
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
83
|
+
* </TabsList>
|
|
84
|
+
* </Tabs>
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
declare const TabBadge: {
|
|
88
|
+
({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Contains the content associated with each trigger.
|
|
93
|
+
* The content panel that displays when its corresponding tab trigger is active.
|
|
94
|
+
*
|
|
95
|
+
* @see https://mantle.ngrok.com/components/tabs#api-tabs-content
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <Tabs defaultValue="account">
|
|
100
|
+
* <TabsList>
|
|
101
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
102
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
103
|
+
* </TabsList>
|
|
104
|
+
* <TabsContent value="account">
|
|
105
|
+
* <p>Make changes to your account here.</p>
|
|
106
|
+
* </TabsContent>
|
|
107
|
+
* <TabsContent value="password">
|
|
108
|
+
* <p>Change your password here.</p>
|
|
109
|
+
* </TabsContent>
|
|
110
|
+
* </Tabs>
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
10
113
|
declare const TabsContent: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
11
114
|
|
|
12
115
|
export { TabBadge, Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f}from"./chunk-3C5O3AQA.js";import{a as i}from"./chunk-AZ56JGNY.js";import{Content as z,List as w,Root as S,Trigger as u}from"@radix-ui/react-tabs";import W from"clsx";import{Children as B,cloneElement as E,createContext as H,forwardRef as n,isValidElement as M,useContext as m}from"react";import V from"tiny-invariant";import{Fragment as A,jsx as r,jsxs as v}from"react/jsx-runtime";var g=H({orientation:"horizontal"}),x=n(({className:t,children:a,orientation:e="horizontal",...o},s)=>r(S,{className:i("flex gap-4",e==="horizontal"?"flex-col":"flex-row",t),orientation:e,ref:s,...o,children:r(g.Provider,{value:{orientation:e},children:a})}));x.displayName="Tabs";var h=n(({className:t,...a},e)=>{let o=m(g);return r(w,{"aria-orientation":o.orientation,className:i("flex border-gray-200",o.orientation==="horizontal"?"flex-row items-center gap-6 border-b":"flex-col items-end gap-[0.875rem] self-stretch border-r",t),ref:e,...a})});h.displayName="TabsList";var p=()=>{let t=m(g);return r("span",{"aria-hidden":!0,className:W("group-data-state-active/tab-trigger:bg-blue-600 absolute z-0",t.orientation==="horizontal"&&"-bottom-px left-0 right-0 h-[0.1875rem]",t.orientation==="vertical"&&"-right-px bottom-0 top-0 w-[0.1875rem]")})};p.displayName="TabsTriggerDecoration";var y=n(({"aria-disabled":t,asChild:a=!1,children:e,className:o,disabled:s,...R},d)=>{let c=m(g),b=f(t??s),T={"aria-disabled":t??s,className:i("group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600",c.orientation==="horizontal"&&"rounded-tl-md rounded-tr-md",c.orientation==="vertical"&&"rounded-bl-md rounded-tl-md pr-3","ring-focus-accent outline-none","aria-disabled:cursor-default aria-disabled:opacity-50","focus-visible:ring-4","[&>svg]:shrink-0 [&>svg]:size-5","not-aria-disabled:hover:text-gray-900 not-aria-disabled:hover:data-state-active:text-blue-600","data-state-active:text-blue-600",o),disabled:b,...R};if(a){let l=B.only(e);V(M(l),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let N=l.props?.children,L={...b?{href:void 0,to:void 0}:{tabIndex:0}};return r(u,{asChild:!0,...T,ref:d,children:E(b?r("button",{type:"button"}):l,L,v(A,{children:[r(p,{}),N]}))})}return v(u,{ref:d,...T,children:[r(p,{}),e]})});y.displayName="TabsTrigger";var C=({className:t,children:a,...e})=>r("span",{className:i("rounded-full bg-gray-500/20 px-1.5 text-xs font-medium text-gray-600","group-data-state-active/tab-trigger:bg-blue-500/20 group-data-state-active/tab-trigger:text-blue-700 group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-blue-700","group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700",t),...e,children:a});C.displayName="TabBadge";var P=n(({className:t,...a},e)=>r(z,{ref:e,className:i("focus-visible:ring-focus-accent outline-none focus-visible:ring-4",t),...a}));P.displayName="TabsContent";export{C as TabBadge,x as Tabs,P as TabsContent,h as TabsList,y as TabsTrigger};
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
package/dist/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tabs/tabs.tsx"],"sourcesContent":["import {\n\tContent as TabsPrimitiveContent,\n\tList as TabsPrimitiveList,\n\tRoot as TabsPrimitiveRoot,\n\tTrigger as TabsPrimitiveTrigger,\n} from \"@radix-ui/react-tabs\";\nimport clsx from \"clsx\";\nimport type {\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tHTMLAttributes,\n} from \"react\";\nimport {\n\tChildren,\n\tcloneElement,\n\tcreateContext,\n\tforwardRef,\n\tisValidElement,\n\tuseContext,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { parseBooleanish } from \"../../types/booleanish.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype TabsStateContextValue = {\n\torientation: \"horizontal\" | \"vertical\";\n};\n\nconst TabsStateContext = createContext<TabsStateContextValue>({\n\torientation: \"horizontal\",\n});\n\nconst Tabs = forwardRef<\n\tComponentRef<typeof TabsPrimitiveRoot>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveRoot>\n>(({ className, children, orientation = \"horizontal\", ...props }, ref) => (\n\t<TabsPrimitiveRoot\n\t\tclassName={cx(\n\t\t\t\"flex gap-4\",\n\t\t\torientation === \"horizontal\" ? \"flex-col\" : \"flex-row\",\n\t\t\tclassName,\n\t\t)}\n\t\torientation={orientation}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t<TabsStateContext.Provider value={{ orientation }}>\n\t\t\t{children}\n\t\t</TabsStateContext.Provider>\n\t</TabsPrimitiveRoot>\n));\nTabs.displayName = \"Tabs\";\n\nconst TabsList = forwardRef<\n\tComponentRef<typeof TabsPrimitiveList>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveList>\n>(({ className, ...props }, ref) => {\n\tconst ctx = useContext(TabsStateContext);\n\n\treturn (\n\t\t<TabsPrimitiveList\n\t\t\taria-orientation={ctx.orientation}\n\t\t\tclassName={cx(\n\t\t\t\t\"flex border-gray-200\",\n\t\t\t\tctx.orientation === \"horizontal\"\n\t\t\t\t\t? \"flex-row items-center gap-6 border-b\"\n\t\t\t\t\t: \"flex-col items-end gap-[0.875rem] self-stretch border-r\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nTabsList.displayName = \"TabsList\";\n\ntype TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitiveTrigger>;\n\nconst TabsTriggerDecoration = () => {\n\tconst ctx = useContext(TabsStateContext);\n\n\treturn (\n\t\t<span\n\t\t\taria-hidden\n\t\t\tclassName={clsx(\n\t\t\t\t\"group-data-state-active/tab-trigger:bg-blue-600 absolute z-0\",\n\t\t\t\tctx.orientation === \"horizontal\" &&\n\t\t\t\t\t\"-bottom-px left-0 right-0 h-[0.1875rem]\",\n\t\t\t\tctx.orientation === \"vertical\" &&\n\t\t\t\t\t\"-right-px bottom-0 top-0 w-[0.1875rem]\",\n\t\t\t)}\n\t\t/>\n\t);\n};\n\nconst TabsTrigger = forwardRef<\n\tComponentRef<typeof TabsPrimitiveTrigger>,\n\tTabsTriggerProps\n>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled: _disabled,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(TabsStateContext);\n\t\tconst disabled = parseBooleanish(_ariaDisabled ?? _disabled);\n\n\t\tconst tabsTriggerProps = {\n\t\t\t\"aria-disabled\": _ariaDisabled ?? _disabled,\n\t\t\tclassName: cx(\n\t\t\t\t\"group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600\",\n\t\t\t\tctx.orientation === \"horizontal\" && \"rounded-tl-md rounded-tr-md\",\n\t\t\t\tctx.orientation === \"vertical\" && \"rounded-bl-md rounded-tl-md pr-3\",\n\t\t\t\t\"ring-focus-accent outline-none\",\n\t\t\t\t\"aria-disabled:cursor-default aria-disabled:opacity-50\",\n\t\t\t\t\"focus-visible:ring-4\",\n\t\t\t\t\"[&>svg]:shrink-0 [&>svg]:size-5\",\n\t\t\t\t\"not-aria-disabled:hover:text-gray-900 not-aria-disabled:hover:data-state-active:text-blue-600\",\n\t\t\t\t\"data-state-active:text-blue-600\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\tdisabled,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tinvariant(\n\t\t\t\tisValidElement<TabsTriggerProps>(singleChild),\n\t\t\t\t\"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.\",\n\t\t\t);\n\t\t\tconst grandchildren = singleChild.props?.children;\n\n\t\t\tconst cloneProps = {\n\t\t\t\t...(disabled\n\t\t\t\t\t? /**\n\t\t\t\t\t\t * When disabled, prevent anchor/link children from being clickable by\n\t\t\t\t\t\t * removing their href/to props!\n\t\t\t\t\t\t * This is necessary because `<a>` doesn't support the `disabled`\n\t\t\t\t\t\t * attribute and would be navigable. We could use `pointer-events-none`\n\t\t\t\t\t\t * instead, but don't by default because it would also prevent tooltip\n\t\t\t\t\t\t * interactions, which may be surprising.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t{ href: undefined, to: undefined }\n\t\t\t\t\t: /**\n\t\t\t\t\t\t * when NOT disabled, allow keyboard navigation to the trigger,\n\t\t\t\t\t\t * even for asChild anchors/links\n\t\t\t\t\t\t */\n\t\t\t\t\t\t{ tabIndex: 0 }),\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<TabsPrimitiveTrigger asChild {...tabsTriggerProps} ref={ref}>\n\t\t\t\t\t{cloneElement(\n\t\t\t\t\t\tdisabled ? <button type=\"button\" /> : singleChild,\n\t\t\t\t\t\tcloneProps,\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<TabsTriggerDecoration />\n\t\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t\t</>,\n\t\t\t\t\t)}\n\t\t\t\t</TabsPrimitiveTrigger>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TabsPrimitiveTrigger ref={ref} {...tabsTriggerProps}>\n\t\t\t\t<TabsTriggerDecoration />\n\t\t\t\t{children}\n\t\t\t</TabsPrimitiveTrigger>\n\t\t);\n\t},\n);\nTabsTrigger.displayName = \"TabsTrigger\";\n\nconst TabBadge = ({\n\tclassName,\n\tchildren,\n\t...props\n}: HTMLAttributes<HTMLSpanElement>) => (\n\t<span\n\t\tclassName={cx(\n\t\t\t\"rounded-full bg-gray-500/20 px-1.5 text-xs font-medium text-gray-600\",\n\t\t\t\"group-data-state-active/tab-trigger:bg-blue-500/20 group-data-state-active/tab-trigger:text-blue-700 group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-blue-700\",\n\t\t\t\"group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</span>\n);\n\nconst TabsContent = forwardRef<\n\tComponentRef<typeof TabsPrimitiveContent>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveContent>\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitiveContent\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"focus-visible:ring-focus-accent outline-none focus-visible:ring-4\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsContent.displayName = \"TabsContent\";\n\nexport {\n\t//\n\tTabBadge,\n\tTabs,\n\tTabsContent,\n\tTabsList,\n\tTabsTrigger,\n};\n"],"mappings":"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","names":["TabsPrimitiveContent","TabsPrimitiveList","TabsPrimitiveRoot","TabsPrimitiveTrigger","clsx","Children","cloneElement","createContext","forwardRef","isValidElement","useContext","invariant","Fragment","jsx","jsxs","TabsStateContext","createContext","Tabs","forwardRef","className","children","orientation","props","ref","TabsPrimitiveRoot","cx","TabsList","ctx","useContext","TabsPrimitiveList","TabsTriggerDecoration","clsx","TabsTrigger","_ariaDisabled","asChild","_disabled","disabled","parseBooleanish","tabsTriggerProps","singleChild","Children","invariant","isValidElement","grandchildren","cloneProps","TabsPrimitiveTrigger","cloneElement","TabBadge","TabsContent","TabsPrimitiveContent"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/tabs/tabs.tsx"],"sourcesContent":["import {\n\tContent as TabsPrimitiveContent,\n\tList as TabsPrimitiveList,\n\tRoot as TabsPrimitiveRoot,\n\tTrigger as TabsPrimitiveTrigger,\n} from \"@radix-ui/react-tabs\";\nimport clsx from \"clsx\";\nimport type {\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tHTMLAttributes,\n} from \"react\";\nimport {\n\tChildren,\n\tcloneElement,\n\tcreateContext,\n\tforwardRef,\n\tisValidElement,\n\tuseContext,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { parseBooleanish } from \"../../types/booleanish.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype TabsStateContextValue = {\n\torientation: \"horizontal\" | \"vertical\";\n};\n\nconst TabsStateContext = createContext<TabsStateContextValue>({\n\torientation: \"horizontal\",\n});\n\n/**\n * A set of layered sections of content—known as tab panels—that are displayed one at a time.\n * The root component that provides context for all tab components.\n *\n * @see https://mantle.ngrok.com/components/tabs#api-tabs\n *\n * @example\n * ```tsx\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTrigger value=\"account\">Account</TabsTrigger>\n * <TabsTrigger value=\"password\">Password</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"account\">\n * <p>Make changes to your account here.</p>\n * </TabsContent>\n * <TabsContent value=\"password\">\n * <p>Change your password here.</p>\n * </TabsContent>\n * </Tabs>\n * ```\n */\nconst Tabs = forwardRef<\n\tComponentRef<typeof TabsPrimitiveRoot>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveRoot>\n>(({ className, children, orientation = \"horizontal\", ...props }, ref) => (\n\t<TabsPrimitiveRoot\n\t\tclassName={cx(\n\t\t\t\"flex gap-4\",\n\t\t\torientation === \"horizontal\" ? \"flex-col\" : \"flex-row\",\n\t\t\tclassName,\n\t\t)}\n\t\torientation={orientation}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t<TabsStateContext.Provider value={{ orientation }}>\n\t\t\t{children}\n\t\t</TabsStateContext.Provider>\n\t</TabsPrimitiveRoot>\n));\nTabs.displayName = \"Tabs\";\n\n/**\n * Contains the triggers that are aligned along the edge of the active content.\n * The container for tab triggers that provides the visual layout for tab navigation.\n *\n * @see https://mantle.ngrok.com/components/tabs#api-tabs-list\n *\n * @example\n * ```tsx\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTrigger value=\"account\">Account</TabsTrigger>\n * <TabsTrigger value=\"password\">Password</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"account\">\n * <p>Make changes to your account here.</p>\n * </TabsContent>\n * </Tabs>\n * ```\n */\nconst TabsList = forwardRef<\n\tComponentRef<typeof TabsPrimitiveList>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveList>\n>(({ className, ...props }, ref) => {\n\tconst ctx = useContext(TabsStateContext);\n\n\treturn (\n\t\t<TabsPrimitiveList\n\t\t\taria-orientation={ctx.orientation}\n\t\t\tclassName={cx(\n\t\t\t\t\"flex border-gray-200\",\n\t\t\t\tctx.orientation === \"horizontal\"\n\t\t\t\t\t? \"flex-row items-center gap-6 border-b\"\n\t\t\t\t\t: \"flex-col items-end gap-[0.875rem] self-stretch border-r\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nTabsList.displayName = \"TabsList\";\n\ntype TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitiveTrigger>;\n\nconst TabsTriggerDecoration = () => {\n\tconst ctx = useContext(TabsStateContext);\n\n\treturn (\n\t\t<span\n\t\t\taria-hidden\n\t\t\tclassName={clsx(\n\t\t\t\t\"group-data-state-active/tab-trigger:bg-blue-600 absolute z-0\",\n\t\t\t\tctx.orientation === \"horizontal\" &&\n\t\t\t\t\t\"-bottom-px left-0 right-0 h-[0.1875rem]\",\n\t\t\t\tctx.orientation === \"vertical\" &&\n\t\t\t\t\t\"-right-px bottom-0 top-0 w-[0.1875rem]\",\n\t\t\t)}\n\t\t/>\n\t);\n};\nTabsTriggerDecoration.displayName = \"TabsTriggerDecoration\";\n\n/**\n * The button that activates its associated content.\n * A clickable tab trigger that switches between different tab content panels.\n *\n * @see https://mantle.ngrok.com/components/tabs#api-tabs-trigger\n *\n * @example\n * ```tsx\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTrigger value=\"account\">Account</TabsTrigger>\n * <TabsTrigger value=\"password\">Password</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"account\">\n * <p>Make changes to your account here.</p>\n * </TabsContent>\n * </Tabs>\n * ```\n */\nconst TabsTrigger = forwardRef<\n\tComponentRef<typeof TabsPrimitiveTrigger>,\n\tTabsTriggerProps\n>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled: _disabled,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(TabsStateContext);\n\t\tconst disabled = parseBooleanish(_ariaDisabled ?? _disabled);\n\n\t\tconst tabsTriggerProps = {\n\t\t\t\"aria-disabled\": _ariaDisabled ?? _disabled,\n\t\t\tclassName: cx(\n\t\t\t\t\"group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600\",\n\t\t\t\tctx.orientation === \"horizontal\" && \"rounded-tl-md rounded-tr-md\",\n\t\t\t\tctx.orientation === \"vertical\" && \"rounded-bl-md rounded-tl-md pr-3\",\n\t\t\t\t\"ring-focus-accent outline-none\",\n\t\t\t\t\"aria-disabled:cursor-default aria-disabled:opacity-50\",\n\t\t\t\t\"focus-visible:ring-4\",\n\t\t\t\t\"[&>svg]:shrink-0 [&>svg]:size-5\",\n\t\t\t\t\"not-aria-disabled:hover:text-gray-900 not-aria-disabled:hover:data-state-active:text-blue-600\",\n\t\t\t\t\"data-state-active:text-blue-600\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\tdisabled,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tinvariant(\n\t\t\t\tisValidElement<TabsTriggerProps>(singleChild),\n\t\t\t\t\"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.\",\n\t\t\t);\n\t\t\tconst grandchildren = singleChild.props?.children;\n\n\t\t\tconst cloneProps = {\n\t\t\t\t...(disabled\n\t\t\t\t\t? /**\n\t\t\t\t\t\t * When disabled, prevent anchor/link children from being clickable by\n\t\t\t\t\t\t * removing their href/to props!\n\t\t\t\t\t\t * This is necessary because `<a>` doesn't support the `disabled`\n\t\t\t\t\t\t * attribute and would be navigable. We could use `pointer-events-none`\n\t\t\t\t\t\t * instead, but don't by default because it would also prevent tooltip\n\t\t\t\t\t\t * interactions, which may be surprising.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t{ href: undefined, to: undefined }\n\t\t\t\t\t: /**\n\t\t\t\t\t\t * when NOT disabled, allow keyboard navigation to the trigger,\n\t\t\t\t\t\t * even for asChild anchors/links\n\t\t\t\t\t\t */\n\t\t\t\t\t\t{ tabIndex: 0 }),\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<TabsPrimitiveTrigger asChild {...tabsTriggerProps} ref={ref}>\n\t\t\t\t\t{cloneElement(\n\t\t\t\t\t\tdisabled ? <button type=\"button\" /> : singleChild,\n\t\t\t\t\t\tcloneProps,\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<TabsTriggerDecoration />\n\t\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t\t</>,\n\t\t\t\t\t)}\n\t\t\t\t</TabsPrimitiveTrigger>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TabsPrimitiveTrigger ref={ref} {...tabsTriggerProps}>\n\t\t\t\t<TabsTriggerDecoration />\n\t\t\t\t{children}\n\t\t\t</TabsPrimitiveTrigger>\n\t\t);\n\t},\n);\nTabsTrigger.displayName = \"TabsTrigger\";\n\n/**\n * A badge component that can be used inside tab triggers to display additional information.\n * Typically used to show counts or status indicators within tab headers.\n *\n * @see https://mantle.ngrok.com/components/tabs#api-tab-badge\n *\n * @example\n * ```tsx\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTrigger value=\"account\">\n * Account <TabBadge>5</TabBadge>\n * </TabsTrigger>\n * <TabsTrigger value=\"password\">Password</TabsTrigger>\n * </TabsList>\n * </Tabs>\n * ```\n */\nconst TabBadge = ({\n\tclassName,\n\tchildren,\n\t...props\n}: HTMLAttributes<HTMLSpanElement>) => (\n\t<span\n\t\tclassName={cx(\n\t\t\t\"rounded-full bg-gray-500/20 px-1.5 text-xs font-medium text-gray-600\",\n\t\t\t\"group-data-state-active/tab-trigger:bg-blue-500/20 group-data-state-active/tab-trigger:text-blue-700 group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-blue-700\",\n\t\t\t\"group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</span>\n);\nTabBadge.displayName = \"TabBadge\";\n\n/**\n * Contains the content associated with each trigger.\n * The content panel that displays when its corresponding tab trigger is active.\n *\n * @see https://mantle.ngrok.com/components/tabs#api-tabs-content\n *\n * @example\n * ```tsx\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTrigger value=\"account\">Account</TabsTrigger>\n * <TabsTrigger value=\"password\">Password</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"account\">\n * <p>Make changes to your account here.</p>\n * </TabsContent>\n * <TabsContent value=\"password\">\n * <p>Change your password here.</p>\n * </TabsContent>\n * </Tabs>\n * ```\n */\nconst TabsContent = forwardRef<\n\tComponentRef<typeof TabsPrimitiveContent>,\n\tComponentPropsWithoutRef<typeof TabsPrimitiveContent>\n>(({ className, ...props }, ref) => (\n\t<TabsPrimitiveContent\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"focus-visible:ring-focus-accent outline-none focus-visible:ring-4\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nTabsContent.displayName = \"TabsContent\";\n\nexport {\n\t//\n\tTabBadge,\n\tTabs,\n\tTabsContent,\n\tTabsList,\n\tTabsTrigger,\n};\n"],"mappings":"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","names":["TabsPrimitiveContent","TabsPrimitiveList","TabsPrimitiveRoot","TabsPrimitiveTrigger","clsx","Children","cloneElement","createContext","forwardRef","isValidElement","useContext","invariant","Fragment","jsx","jsxs","TabsStateContext","createContext","Tabs","forwardRef","className","children","orientation","props","ref","TabsPrimitiveRoot","cx","TabsList","ctx","useContext","TabsPrimitiveList","TabsTriggerDecoration","clsx","TabsTrigger","_ariaDisabled","asChild","_disabled","disabled","parseBooleanish","tabsTriggerProps","singleChild","Children","invariant","isValidElement","grandchildren","cloneProps","TabsPrimitiveTrigger","cloneElement","TabBadge","TabsContent","TabsPrimitiveContent"]}
|
package/dist/text-area.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
|
|
|
13
13
|
* to enter a sizeable amount of free-form text, for example a comment on a
|
|
14
14
|
* review or feedback form.
|
|
15
15
|
*
|
|
16
|
-
* @see https://mantle.ngrok.com/components/text-area#api
|
|
16
|
+
* @see https://mantle.ngrok.com/components/text-area#api-text-area
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```tsx
|
|
@@ -27,6 +27,7 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
|
|
|
27
27
|
* />
|
|
28
28
|
* </div>
|
|
29
29
|
* </form>
|
|
30
|
+
* ```
|
|
30
31
|
*/
|
|
31
32
|
declare const TextArea: react.ForwardRefExoticComponent<Omit<Props, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
32
33
|
|
package/dist/text-area.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/text-area/text-area.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, ComponentRef } from \"react\";\nimport { forwardRef, useRef, useState } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { WithValidation } from \"../input/types.js\";\n\ntype Props = ComponentProps<\"textarea\"> &\n\tWithValidation & {\n\t\t/**\n\t\t * The visual style of the textarea.\n\t\t */\n\t\tappearance?: \"monospaced\";\n\t};\n\n/**\n * A multi-line plain-text editing control, useful when you want to allow users\n * to enter a sizeable amount of free-form text, for example a comment on a\n * review or feedback form.\n *\n * @see https://mantle.ngrok.com/components/text-area#api\n *\n * @example\n * ```tsx\n * <form>\n * <div>\n * <Label htmlFor=\"feedback\">Feedback:</Label>\n * <TextArea\n * id=\"feedback\"\n * name=\"feedback\"\n * placeholder=\"Enter your feedback here\"\n * />\n * </div>\n * </form>\n */\nconst TextArea = forwardRef<ComponentRef<\"textarea\">, Props>(\n\t(\n\t\t{\n\t\t\tappearance,\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tclassName,\n\t\t\tonDragEnter,\n\t\t\tonDragLeave,\n\t\t\tonDropCapture,\n\t\t\tvalidation: _validation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\t\tconst [isDragOver, setIsDragOver] = useState(false);\n\t\tconst _ref = useRef<HTMLTextAreaElement | null>(null);\n\n\t\treturn (\n\t\t\t<textarea\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tclassName={cx(\n\t\t\t\t\tappearance === \"monospaced\" &&\n\t\t\t\t\t\t\"pointer-coarse:text-[0.9375rem] font-mono text-[0.8125rem]\",\n\t\t\t\t\t\"border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(theme(spacing[2.5])-1px)] pointer-coarse:text-base flex min-h-24 w-full rounded-md border px-3 py-[calc(theme(spacing[2])-1px)] focus-visible:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50\",\n\t\t\t\t\t\"placeholder:text-placeholder data-drag-over:border-dashed\",\n\t\t\t\t\t\"border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-drag-over={isDragOver}\n\t\t\t\tonDragEnter={(event) => {\n\t\t\t\t\tsetIsDragOver(true);\n\t\t\t\t\tonDragEnter?.(event);\n\t\t\t\t}}\n\t\t\t\tonDragLeave={(event) => {\n\t\t\t\t\tsetIsDragOver(false);\n\t\t\t\t\tonDragLeave?.(event);\n\t\t\t\t}}\n\t\t\t\tonDropCapture={(event) => {\n\t\t\t\t\tsetIsDragOver(false);\n\t\t\t\t\t_ref.current?.focus();\n\t\t\t\t\tonDropCapture?.(event);\n\t\t\t\t}}\n\t\t\t\tref={(node) => {\n\t\t\t\t\t_ref.current = node;\n\t\t\t\t\tif (typeof ref === \"function\") {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nTextArea.displayName = \"TextArea\";\n\nexport {\n\t//,\n\tTextArea,\n};\n\nexport type {\n\t//,\n\tProps as TextAreaProps,\n};\n"],"mappings":"wCAGA,OAAS,cAAAA,EAAY,UAAAC,EAAQ,YAAAC,MAAgB,
|
|
1
|
+
{"version":3,"sources":["../src/components/text-area/text-area.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, ComponentRef } from \"react\";\nimport { forwardRef, useRef, useState } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { WithValidation } from \"../input/types.js\";\n\ntype Props = ComponentProps<\"textarea\"> &\n\tWithValidation & {\n\t\t/**\n\t\t * The visual style of the textarea.\n\t\t */\n\t\tappearance?: \"monospaced\";\n\t};\n\n/**\n * A multi-line plain-text editing control, useful when you want to allow users\n * to enter a sizeable amount of free-form text, for example a comment on a\n * review or feedback form.\n *\n * @see https://mantle.ngrok.com/components/text-area#api-text-area\n *\n * @example\n * ```tsx\n * <form>\n * <div>\n * <Label htmlFor=\"feedback\">Feedback:</Label>\n * <TextArea\n * id=\"feedback\"\n * name=\"feedback\"\n * placeholder=\"Enter your feedback here\"\n * />\n * </div>\n * </form>\n * ```\n */\nconst TextArea = forwardRef<ComponentRef<\"textarea\">, Props>(\n\t(\n\t\t{\n\t\t\tappearance,\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tclassName,\n\t\t\tonDragEnter,\n\t\t\tonDragLeave,\n\t\t\tonDropCapture,\n\t\t\tvalidation: _validation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst isInvalid = _ariaInvalid != null && _ariaInvalid !== \"false\";\n\t\tconst validation = isInvalid\n\t\t\t? \"error\"\n\t\t\t: typeof _validation === \"function\"\n\t\t\t\t? _validation()\n\t\t\t\t: _validation;\n\t\tconst ariaInvalid = _ariaInvalid ?? validation === \"error\";\n\t\tconst [isDragOver, setIsDragOver] = useState(false);\n\t\tconst _ref = useRef<HTMLTextAreaElement | null>(null);\n\n\t\treturn (\n\t\t\t<textarea\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tclassName={cx(\n\t\t\t\t\tappearance === \"monospaced\" &&\n\t\t\t\t\t\t\"pointer-coarse:text-[0.9375rem] font-mono text-[0.8125rem]\",\n\t\t\t\t\t\"border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(theme(spacing[2.5])-1px)] pointer-coarse:text-base flex min-h-24 w-full rounded-md border px-3 py-[calc(theme(spacing[2])-1px)] focus-visible:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50\",\n\t\t\t\t\t\"placeholder:text-placeholder data-drag-over:border-dashed\",\n\t\t\t\t\t\"border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-drag-over={isDragOver}\n\t\t\t\tonDragEnter={(event) => {\n\t\t\t\t\tsetIsDragOver(true);\n\t\t\t\t\tonDragEnter?.(event);\n\t\t\t\t}}\n\t\t\t\tonDragLeave={(event) => {\n\t\t\t\t\tsetIsDragOver(false);\n\t\t\t\t\tonDragLeave?.(event);\n\t\t\t\t}}\n\t\t\t\tonDropCapture={(event) => {\n\t\t\t\t\tsetIsDragOver(false);\n\t\t\t\t\t_ref.current?.focus();\n\t\t\t\t\tonDropCapture?.(event);\n\t\t\t\t}}\n\t\t\t\tref={(node) => {\n\t\t\t\t\t_ref.current = node;\n\t\t\t\t\tif (typeof ref === \"function\") {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nTextArea.displayName = \"TextArea\";\n\nexport {\n\t//,\n\tTextArea,\n};\n\nexport type {\n\t//,\n\tProps as TextAreaProps,\n};\n"],"mappings":"wCAGA,OAAS,cAAAA,EAAY,UAAAC,EAAQ,YAAAC,MAAgB,QA0D1C,cAAAC,MAAA,oBAzBH,IAAMC,EAAWC,EAChB,CACC,CACC,WAAAC,EACA,eAAgBC,EAChB,UAAAC,EACA,YAAAC,EACA,YAAAC,EACA,cAAAC,EACA,WAAYC,EACZ,GAAGC,CACJ,EACAC,IACI,CAEJ,IAAMC,EADYR,GAAgB,MAAQA,IAAiB,QAExD,QACA,OAAOK,GAAgB,WACtBA,EAAY,EACZA,EACEI,EAAcT,GAAgBQ,IAAe,QAC7C,CAACE,EAAYC,CAAa,EAAIC,EAAS,EAAK,EAC5CC,EAAOC,EAAmC,IAAI,EAEpD,OACClB,EAAC,YACA,eAAca,EACd,kBAAiBD,GAAc,OAC/B,UAAWO,EACVhB,IAAe,cACd,6DACD,mUACA,4DACA,qGACA,+LACA,2MACA,2MACAE,CACD,EACA,iBAAgBS,EAChB,YAAcM,GAAU,CACvBL,EAAc,EAAI,EAClBT,IAAcc,CAAK,CACpB,EACA,YAAcA,GAAU,CACvBL,EAAc,EAAK,EACnBR,IAAca,CAAK,CACpB,EACA,cAAgBA,GAAU,CACzBL,EAAc,EAAK,EACnBE,EAAK,SAAS,MAAM,EACpBT,IAAgBY,CAAK,CACtB,EACA,IAAMC,GAAS,CACdJ,EAAK,QAAUI,EACX,OAAOV,GAAQ,WAClBA,EAAIU,CAAI,EACEV,IACVA,EAAI,QAAUU,EAEhB,EACC,GAAGX,EACL,CAEF,CACD,EACAT,EAAS,YAAc","names":["forwardRef","useRef","useState","jsx","TextArea","forwardRef","appearance","_ariaInvalid","className","onDragEnter","onDragLeave","onDropCapture","_validation","props","ref","validation","ariaInvalid","isDragOver","setIsDragOver","useState","_ref","useRef","cx","event","node"]}
|
package/dist/theme-provider.d.ts
CHANGED
|
@@ -9,10 +9,19 @@ type Props = {
|
|
|
9
9
|
includeNunitoSans?: boolean;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Preload custom fonts used in the theme.
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
* Preload custom fonts used in the theme.
|
|
13
|
+
*
|
|
14
|
+
* @see https://mantle.ngrok.com/components/theme-provider#api-preload-fonts
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <PreloadFonts includeNunitoSans />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const PreloadFonts: {
|
|
22
|
+
({ includeNunitoSans }: Props): react_jsx_runtime.JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
16
25
|
|
|
17
26
|
/**
|
|
18
27
|
* resolvedThemes is a tuple of valid themes that have been resolved from "system" to a specific theme.
|
|
@@ -56,8 +65,20 @@ type ThemeProviderProps = PropsWithChildren & {
|
|
|
56
65
|
};
|
|
57
66
|
/**
|
|
58
67
|
* ThemeProvider is a React Context Provider that provides the current theme and a function to set the theme.
|
|
68
|
+
*
|
|
69
|
+
* @see https://mantle.ngrok.com/components/theme-provider#api-theme-provider
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <ThemeProvider defaultTheme="system" storageKey="app-theme">
|
|
74
|
+
* <App />
|
|
75
|
+
* </ThemeProvider>
|
|
76
|
+
* ```
|
|
59
77
|
*/
|
|
60
78
|
declare function ThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
declare namespace ThemeProvider {
|
|
80
|
+
var displayName: string;
|
|
81
|
+
}
|
|
61
82
|
/**
|
|
62
83
|
* useTheme returns the current theme and a function to set the theme.
|
|
63
84
|
*
|
|
@@ -93,7 +114,10 @@ type MantleThemeHeadContentProps = {
|
|
|
93
114
|
* MantleThemeHeadContent is a React component that prevents the wrong theme from flashing on initial page load.
|
|
94
115
|
* Render as high as possible in the <head> element.
|
|
95
116
|
*/
|
|
96
|
-
declare const MantleThemeHeadContent:
|
|
117
|
+
declare const MantleThemeHeadContent: {
|
|
118
|
+
({ defaultTheme, storageKey, includeNunitoSans, }: MantleThemeHeadContentProps): react_jsx_runtime.JSX.Element;
|
|
119
|
+
displayName: string;
|
|
120
|
+
};
|
|
97
121
|
type InitialThemeProps = {
|
|
98
122
|
className: string;
|
|
99
123
|
"data-applied-theme": Omit<Theme, "system">;
|
package/dist/theme-provider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,b as m,c as r,d as o,e as t,f as h,g as s,h as T,i as p,j as l,k as d,l as n,m as i,n as a,o as v}from"./chunk-
|
|
1
|
+
import{a as e,b as m,c as r,d as o,e as t,f as h,g as s,h as T,i as p,j as l,k as d,l as n,m as i,n as a,o as v}from"./chunk-6RJ2G2DK.js";import"./chunk-D3XF6J5A.js";export{h as $resolvedTheme,o as $theme,a as MantleThemeHeadContent,e as PreloadFonts,T as ThemeProvider,l as applyTheme,s as isResolvedTheme,t as isTheme,i as preventWrongThemeFlashScriptContent,d as readThemeFromHtmlElement,m as resolvedThemes,r as themes,n as useAppliedTheme,v as useInitialHtmlThemeProps,p as useTheme};
|
|
2
2
|
//# sourceMappingURL=theme-provider.js.map
|
package/dist/toast.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import * as ToastPrimitive from 'sonner';
|
|
5
5
|
import { W as WithAsChild } from './as-child-DJ7x3JFV.js';
|
|
6
6
|
import { W as WithStyleProps } from './with-style-props-VnLWm0Yd.js';
|
|
7
|
-
import { a as SvgOnlyProps } from './svg-only-
|
|
7
|
+
import { a as SvgOnlyProps } from './svg-only-Bj2yffO4.js';
|
|
8
8
|
import './types-BuKAGhC-.js';
|
|
9
9
|
|
|
10
10
|
type ToasterPrimitiveProps = ComponentProps<typeof ToastPrimitive.Toaster>;
|
|
@@ -21,8 +21,21 @@ type ToasterProps = WithStyleProps & Pick<ToasterPrimitiveProps, "containerAriaL
|
|
|
21
21
|
*
|
|
22
22
|
* Only one `<Toaster />` should be rendered in an app a time, preferably at the
|
|
23
23
|
* root level of the app.
|
|
24
|
+
*
|
|
25
|
+
* @see https://mantle.ngrok.com/components/toast#api-toaster
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Toaster
|
|
30
|
+
* position="top-right"
|
|
31
|
+
* duration_ms={5000}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
24
34
|
*/
|
|
25
|
-
declare const Toaster:
|
|
35
|
+
declare const Toaster: {
|
|
36
|
+
({ className, containerAriaLabel, dir, duration_ms, position, style, }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
26
39
|
type MakeToastOptions = {
|
|
27
40
|
/**
|
|
28
41
|
* Time in milliseconds that should elapse before automatically closing the toast.
|
|
@@ -37,6 +50,19 @@ type MakeToastOptions = {
|
|
|
37
50
|
/**
|
|
38
51
|
* Create a toast. Provide a `<Toast>` component as the `children` to be rendered
|
|
39
52
|
* inside the `<Toaster />` section.
|
|
53
|
+
*
|
|
54
|
+
* @see https://mantle.ngrok.com/components/toast#api-make-toast
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* makeToast(
|
|
59
|
+
* <Toast priority="success">
|
|
60
|
+
* <ToastIcon />
|
|
61
|
+
* <ToastMessage>Operation completed successfully!</ToastMessage>
|
|
62
|
+
* <ToastAction>Dismiss</ToastAction>
|
|
63
|
+
* </Toast>
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
40
66
|
*/
|
|
41
67
|
declare function makeToast(children: ReactNode, options?: MakeToastOptions): string | number;
|
|
42
68
|
declare const priorities: readonly ["danger", "info", "success", "warning"];
|
|
@@ -47,22 +73,64 @@ type ToastProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
47
73
|
/**
|
|
48
74
|
* A succinct message with a priority that is displayed temporarily.
|
|
49
75
|
* Toasts are used to provide feedback to the user without interrupting their workflow.
|
|
76
|
+
*
|
|
77
|
+
* @see https://mantle.ngrok.com/components/toast#api-toast
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* <Toast priority="success">
|
|
82
|
+
* <ToastIcon />
|
|
83
|
+
* <ToastMessage>Changes saved successfully!</ToastMessage>
|
|
84
|
+
* <ToastAction>Undo</ToastAction>
|
|
85
|
+
* </Toast>
|
|
86
|
+
* ```
|
|
50
87
|
*/
|
|
51
88
|
declare const Toast: react.ForwardRefExoticComponent<Omit<ToastProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
52
89
|
/**
|
|
53
90
|
* An icon that visually represents the priority of the toast.
|
|
54
91
|
* If you do not provide an icon, the default icon and color for the priority is used.
|
|
92
|
+
*
|
|
93
|
+
* @see https://mantle.ngrok.com/components/toast#api-toast-icon
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <Toast priority="warning">
|
|
98
|
+
* <ToastIcon />
|
|
99
|
+
* <ToastMessage>Warning message</ToastMessage>
|
|
100
|
+
* </Toast>
|
|
101
|
+
* ```
|
|
55
102
|
*/
|
|
56
103
|
declare const ToastIcon: react.ForwardRefExoticComponent<Omit<Partial<SvgOnlyProps>, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
57
104
|
type ToastActionProps = ComponentProps<"button"> & WithAsChild;
|
|
58
105
|
/**
|
|
59
106
|
* A button that dismisses the toast when clicked.
|
|
60
107
|
* You can prevent the toast from being dismissed `onClick` by calling `event.preventDefault()`
|
|
108
|
+
*
|
|
109
|
+
* @see https://mantle.ngrok.com/components/toast#api-toast-action
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* <Toast priority="info">
|
|
114
|
+
* <ToastIcon />
|
|
115
|
+
* <ToastMessage>File uploaded successfully</ToastMessage>
|
|
116
|
+
* <ToastAction>View File</ToastAction>
|
|
117
|
+
* </Toast>
|
|
118
|
+
* ```
|
|
61
119
|
*/
|
|
62
120
|
declare const ToastAction: react.ForwardRefExoticComponent<Omit<ToastActionProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
63
121
|
type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
64
122
|
/**
|
|
65
123
|
* The message content of the toast.
|
|
124
|
+
*
|
|
125
|
+
* @see https://mantle.ngrok.com/components/toast#api-toast-message
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```tsx
|
|
129
|
+
* <Toast priority="success">
|
|
130
|
+
* <ToastIcon />
|
|
131
|
+
* <ToastMessage>Your changes have been saved</ToastMessage>
|
|
132
|
+
* </Toast>
|
|
133
|
+
* ```
|
|
66
134
|
*/
|
|
67
135
|
declare const ToastMessage: react.ForwardRefExoticComponent<Omit<ToastMessageProps, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
68
136
|
|
package/dist/toast.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as t,c as s,d as a,e,f as r}from"./chunk-
|
|
1
|
+
import{a as o,b as t,c as s,d as a,e,f as r}from"./chunk-NRMIFYYG.js";import"./chunk-6RJ2G2DK.js";import"./chunk-D3XF6J5A.js";import"./chunk-I6T6YV2L.js";import"./chunk-NPTDRQT5.js";import"./chunk-AZ56JGNY.js";export{s as Toast,e as ToastAction,a as ToastIcon,r as ToastMessage,o as Toaster,t as makeToast};
|
|
2
2
|
//# sourceMappingURL=toast.js.map
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -8,39 +8,79 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
8
8
|
* Wraps your app to provide global functionality to your tooltips.
|
|
9
9
|
* Only one instance of this component should be rendered in your app, preferably at the root.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* There may also be bugs! Please file an issue if you find any! <3
|
|
11
|
+
* @see https://mantle.ngrok.com/components/tooltip#api-tooltip-provider
|
|
13
12
|
*
|
|
14
|
-
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <TooltipProvider>
|
|
16
|
+
* <App />
|
|
17
|
+
* </TooltipProvider>
|
|
18
|
+
* ```
|
|
15
19
|
*/
|
|
16
|
-
declare const TooltipProvider:
|
|
20
|
+
declare const TooltipProvider: {
|
|
21
|
+
({ delayDuration, ...props }: ComponentPropsWithoutRef<typeof Provider>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
17
24
|
/**
|
|
18
25
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
19
26
|
* This is the root, stateful component that manages the open/closed state of the tooltip.
|
|
20
27
|
* Will throw if you have not wrapped your app in a `TooltipProvider`.
|
|
21
28
|
*
|
|
22
|
-
* @
|
|
23
|
-
* There may also be bugs! Please file an issue if you find any! <3
|
|
29
|
+
* @see https://mantle.ngrok.com/components/tooltip#api-tooltip
|
|
24
30
|
*
|
|
25
|
-
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Tooltip>
|
|
34
|
+
* <TooltipTrigger asChild>
|
|
35
|
+
* <Button type="button" appearance="outlined">
|
|
36
|
+
* Hover me
|
|
37
|
+
* </Button>
|
|
38
|
+
* </TooltipTrigger>
|
|
39
|
+
* <TooltipContent>
|
|
40
|
+
* This is a tooltip
|
|
41
|
+
* </TooltipContent>
|
|
42
|
+
* </Tooltip>
|
|
43
|
+
* ```
|
|
26
44
|
*/
|
|
27
45
|
declare const Tooltip: react.FC<_radix_ui_react_tooltip.TooltipProps>;
|
|
28
46
|
/**
|
|
29
47
|
* The trigger button that opens the tooltip.
|
|
30
48
|
*
|
|
31
|
-
* @
|
|
32
|
-
* There may also be bugs! Please file an issue if you find any! <3
|
|
49
|
+
* @see https://mantle.ngrok.com/components/tooltip#api-tooltip-trigger
|
|
33
50
|
*
|
|
34
|
-
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <Tooltip>
|
|
54
|
+
* <TooltipTrigger asChild>
|
|
55
|
+
* <Button type="button" appearance="outlined">
|
|
56
|
+
* Hover me
|
|
57
|
+
* </Button>
|
|
58
|
+
* </TooltipTrigger>
|
|
59
|
+
* <TooltipContent>
|
|
60
|
+
* This is a tooltip
|
|
61
|
+
* </TooltipContent>
|
|
62
|
+
* </Tooltip>
|
|
63
|
+
* ```
|
|
35
64
|
*/
|
|
36
65
|
declare const TooltipTrigger: react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
37
66
|
/**
|
|
38
67
|
* The content to render inside the tooltip.
|
|
39
68
|
*
|
|
40
|
-
* @
|
|
41
|
-
* There may also be bugs! Please file an issue if you find any! <3
|
|
69
|
+
* @see https://mantle.ngrok.com/components/tooltip#api-tooltip-content
|
|
42
70
|
*
|
|
43
|
-
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <Tooltip>
|
|
74
|
+
* <TooltipTrigger asChild>
|
|
75
|
+
* <Button type="button" appearance="outlined">
|
|
76
|
+
* Hover me
|
|
77
|
+
* </Button>
|
|
78
|
+
* </TooltipTrigger>
|
|
79
|
+
* <TooltipContent>
|
|
80
|
+
* This is a tooltip
|
|
81
|
+
* </TooltipContent>
|
|
82
|
+
* </Tooltip>
|
|
83
|
+
* ```
|
|
44
84
|
*/
|
|
45
85
|
declare const TooltipContent: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
46
86
|
|
package/dist/tooltip.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-AZ56JGNY.js";import{Content as
|
|
1
|
+
import{a as e}from"./chunk-AZ56JGNY.js";import{Content as l,Provider as f,Root as T,Trigger as C}from"@radix-ui/react-tooltip";import{forwardRef as g}from"react";import{jsx as p}from"react/jsx-runtime";var i=({delayDuration:o=0,...t})=>p(f,{delayDuration:o??0,...t});i.displayName="TooltipProvider";var r=T;r.displayName="Tooltip";var n=C;n.displayName="TooltipTrigger";var a=g(({children:o,className:t,sideOffset:d=4,...s},m)=>p(l,{ref:m,sideOffset:d,className:e("bg-tooltip text-tooltip animate-in fade-in-0 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 z-50 max-w-72 overflow-hidden break-words rounded-md px-3 py-1.5 text-sm shadow font-sans",t),...s,children:o}));a.displayName="TooltipContent";export{r as Tooltip,a as TooltipContent,i as TooltipProvider,n as TooltipTrigger};
|
|
2
2
|
//# sourceMappingURL=tooltip.js.map
|
package/dist/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { Content, Provider, Root, Trigger } from \"@radix-ui/react-tooltip\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * Wraps your app to provide global functionality to your tooltips.\n * Only one instance of this component should be rendered in your app, preferably at the root.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { Content, Provider, Root, Trigger } from \"@radix-ui/react-tooltip\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * Wraps your app to provide global functionality to your tooltips.\n * Only one instance of this component should be rendered in your app, preferably at the root.\n *\n * @see https://mantle.ngrok.com/components/tooltip#api-tooltip-provider\n *\n * @example\n * ```tsx\n * <TooltipProvider>\n * <App />\n * </TooltipProvider>\n * ```\n */\nconst TooltipProvider = ({\n\tdelayDuration = 0,\n\t...props\n}: ComponentPropsWithoutRef<typeof Provider>) => (\n\t<Provider delayDuration={delayDuration ?? 0} {...props} />\n);\nTooltipProvider.displayName = \"TooltipProvider\";\n\n/**\n * A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.\n * This is the root, stateful component that manages the open/closed state of the tooltip.\n * Will throw if you have not wrapped your app in a `TooltipProvider`.\n *\n * @see https://mantle.ngrok.com/components/tooltip#api-tooltip\n *\n * @example\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </TooltipTrigger>\n * <TooltipContent>\n * This is a tooltip\n * </TooltipContent>\n * </Tooltip>\n * ```\n */\nconst Tooltip = Root;\nTooltip.displayName = \"Tooltip\";\n\n/**\n * The trigger button that opens the tooltip.\n *\n * @see https://mantle.ngrok.com/components/tooltip#api-tooltip-trigger\n *\n * @example\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </TooltipTrigger>\n * <TooltipContent>\n * This is a tooltip\n * </TooltipContent>\n * </Tooltip>\n * ```\n */\nconst TooltipTrigger = Trigger;\nTooltipTrigger.displayName = \"TooltipTrigger\";\n\n/**\n * The content to render inside the tooltip.\n *\n * @see https://mantle.ngrok.com/components/tooltip#api-tooltip-content\n *\n * @example\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </TooltipTrigger>\n * <TooltipContent>\n * This is a tooltip\n * </TooltipContent>\n * </Tooltip>\n * ```\n */\nconst TooltipContent = forwardRef<\n\tComponentRef<typeof Content>,\n\tComponentPropsWithoutRef<typeof Content>\n>(({ children, className, sideOffset = 4, ...props }, ref) => (\n\t<Content\n\t\tref={ref}\n\t\tsideOffset={sideOffset}\n\t\tclassName={cx(\n\t\t\t\"bg-tooltip text-tooltip animate-in fade-in-0 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 z-50 max-w-72 overflow-hidden break-words rounded-md px-3 py-1.5 text-sm shadow font-sans\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</Content>\n));\nTooltipContent.displayName = \"TooltipContent\";\n\nexport {\n\t//,\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n};\n"],"mappings":"wCAAA,OAAS,WAAAA,EAAS,YAAAC,EAAU,QAAAC,EAAM,WAAAC,MAAe,0BACjD,OAAS,cAAAC,MAAkB,QAqB1B,cAAAC,MAAA,oBAJD,IAAMC,EAAkB,CAAC,CACxB,cAAAC,EAAgB,EAChB,GAAGC,CACJ,IACCH,EAACI,EAAA,CAAS,cAAeF,GAAiB,EAAI,GAAGC,EAAO,EAEzDF,EAAgB,YAAc,kBAuB9B,IAAMI,EAAUC,EAChBD,EAAQ,YAAc,UAqBtB,IAAME,EAAiBC,EACvBD,EAAe,YAAc,iBAqB7B,IAAME,EAAiBC,EAGrB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,WAAAC,EAAa,EAAG,GAAGV,CAAM,EAAGW,IACrDd,EAACe,EAAA,CACA,IAAKD,EACL,WAAYD,EACZ,UAAWG,EACV,iYACAJ,CACD,EACC,GAAGT,EAEH,SAAAQ,EACF,CACA,EACDF,EAAe,YAAc","names":["Content","Provider","Root","Trigger","forwardRef","jsx","TooltipProvider","delayDuration","props","Provider","Tooltip","Root","TooltipTrigger","Trigger","TooltipContent","forwardRef","children","className","sideOffset","ref","Content","cx"]}
|