@ngrok/mantle 0.85.1 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/agent.json +1 -1
- package/dist/alert-center.d.ts +13 -0
- package/dist/alert-center.js +1 -1
- package/dist/area-chart.d.ts +21 -0
- package/dist/area-chart.js +1 -1
- package/dist/bar-chart.d.ts +21 -0
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +11 -0
- package/dist/{chart-2rorgvW0.js → chart-aZLMj4xx.js} +1 -1
- package/dist/command.d.ts +1 -1
- package/dist/data-table.d.ts +56 -0
- package/dist/data-table.js +1 -1
- package/dist/dropdown-menu-BSOdApBD.d.ts +1 -0
- package/dist/dropdown-menu-Bir-GKUs.js +1 -0
- package/dist/{dropdown-menu-BYapTV0f.d.ts → dropdown-menu-DhwzMnoH.d.ts} +147 -4
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/line-chart.d.ts +21 -0
- package/dist/line-chart.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/multi-select.d.ts +43 -0
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/scatter-plot.d.ts +21 -0
- package/dist/scatter-plot.js +1 -1
- package/dist/{select-ouAW88jx.d.ts → select-DMlziWUZ.d.ts} +276 -13
- package/dist/select-DX72zQN2.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +52 -0
- package/dist/selectable-list.js +1 -1
- package/dist/sidebar.d.ts +28 -1
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/split-button.js +1 -1
- package/dist/tabs.d.ts +38 -0
- package/dist/tabs.js +1 -1
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/toast.d.ts +34 -1
- package/dist/toast.js +1 -1
- package/dist/tooltip-CHgJAU6j.js +1 -0
- package/dist/{tooltip-DA41fxe5.d.ts → tooltip-CfsA_JPe.d.ts} +42 -6
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/dropdown-menu-BkPBh_8y.d.ts +0 -1
- package/dist/dropdown-menu-WydWB9lo.js +0 -1
- package/dist/select-sOHUE2Bm.js +0 -1
- package/dist/tooltip-DikKOzqN.js +0 -1
package/dist/sidebar.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
3
|
import { n as IconButtonProps } from "./button-crUf0hbR.js";
|
|
4
4
|
import { n as Separator } from "./separator-Bo4nY_3M.js";
|
|
5
|
-
import { t as Tooltip } from "./tooltip-
|
|
5
|
+
import { t as Tooltip } from "./tooltip-CfsA_JPe.js";
|
|
6
6
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
7
7
|
//#region src/components/sidebar/sidebar.d.ts
|
|
8
8
|
/**
|
|
@@ -401,6 +401,9 @@ type SidebarTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "chi
|
|
|
401
401
|
* | --- | --- | --- |
|
|
402
402
|
* | `data-state` | `"expanded"` \| `"collapsed"` | Mirrors what the trigger toggles: the mobile sheet below the root's `mobileBreakpoint`, the desktop panel otherwise. Pairs with `aria-expanded`. |
|
|
403
403
|
* | `data-slot` | `"sidebar-trigger-tooltip"` | On the tooltip surface, not the button — the styling hook for the label-and-chord popup this part renders. |
|
|
404
|
+
* | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present. |
|
|
405
|
+
* | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
|
|
406
|
+
* | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
|
|
404
407
|
* | `data-appearance` | `"filled"` \| `"ghost"` \| `"outlined"` | Read, not stamped: the underlying `IconButton` reflects its `appearance`, which this part defaults to `"ghost"`. |
|
|
405
408
|
* | `data-intent` | `"neutral"` | Read, not stamped: the underlying `IconButton` reflects its `intent`, and it draws the neutral tone only. |
|
|
406
409
|
* | `data-size` | `"xs"` \| `"sm"` \| `"md"` \| `"lg"` \| `"xl"` | Read, not stamped: the underlying `IconButton` reflects its `size` and its own `"md"` default. |
|
|
@@ -1086,6 +1089,9 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
|
|
|
1086
1089
|
*
|
|
1087
1090
|
* | Data Attribute | Value | Description |
|
|
1088
1091
|
* | --- | --- | --- |
|
|
1092
|
+
* | `data-slot` | `"sidebar-search-trigger"` | On the row element. |
|
|
1093
|
+
* | `data-slot` | `"sidebar-search-trigger-label"` | On the `<span>` wrapping `children` on the default `button` path. Absent under `asChild`, which renders no sibling. |
|
|
1094
|
+
* | `data-slot` | `"sidebar-search-trigger-shortcut"` | On the chord chips. Always present on the default `button` path, and `display: none` while it is empty. Absent under `asChild`, where the props union forbids `shortcut`. |
|
|
1089
1095
|
* | `data-state` | `"open"` \| `"closed"` | **Read, not stamped** — supplied by the composing `Command.SearchTrigger` / `Dialog.Trigger`. The row stays highlighted while its palette is open. |
|
|
1090
1096
|
*
|
|
1091
1097
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarsearchtrigger
|
|
@@ -1308,6 +1314,15 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
|
|
|
1308
1314
|
* `asChild`, which Radix's `Tooltip.Content` implements itself. `side` defaults
|
|
1309
1315
|
* to `"right"` so the tooltip opens away from the rail.
|
|
1310
1316
|
*
|
|
1317
|
+
* **Data attributes:**
|
|
1318
|
+
*
|
|
1319
|
+
* | Data Attribute | Value | Description |
|
|
1320
|
+
* | --- | --- | --- |
|
|
1321
|
+
* | `data-slot` | `"sidebar-tooltip"` | On the tooltip surface. |
|
|
1322
|
+
* | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present, so a chord that arrives later appends instead of replacing the label. |
|
|
1323
|
+
* | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
|
|
1324
|
+
* | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
|
|
1325
|
+
*
|
|
1311
1326
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebartooltip
|
|
1312
1327
|
*
|
|
1313
1328
|
* @example
|
|
@@ -2168,6 +2183,9 @@ declare const Sidebar: {
|
|
|
2168
2183
|
*
|
|
2169
2184
|
* | Data Attribute | Value | Description |
|
|
2170
2185
|
* | --- | --- | --- |
|
|
2186
|
+
* | `data-slot` | `"sidebar-search-trigger"` | On the row element. |
|
|
2187
|
+
* | `data-slot` | `"sidebar-search-trigger-label"` | On the `<span>` wrapping `children` on the default `button` path. Absent under `asChild`, which renders no sibling. |
|
|
2188
|
+
* | `data-slot` | `"sidebar-search-trigger-shortcut"` | On the chord chips. Always present on the default `button` path, and `display: none` while it is empty. Absent under `asChild`, where the props union forbids `shortcut`. |
|
|
2171
2189
|
* | `data-state` | `"open"` \| `"closed"` | **Read, not stamped** — supplied by the composing `Command.SearchTrigger` / `Dialog.Trigger`. Style the row while its palette is open with `data-state-open:`. |
|
|
2172
2190
|
*
|
|
2173
2191
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarsearchtrigger
|
|
@@ -2295,6 +2313,15 @@ declare const Sidebar: {
|
|
|
2295
2313
|
* `TooltipProvider` ancestor. Takes `Tooltip.Content`'s props (including
|
|
2296
2314
|
* `asChild`) on the tooltip surface; `side` defaults to `"right"`.
|
|
2297
2315
|
*
|
|
2316
|
+
* **Data attributes:**
|
|
2317
|
+
*
|
|
2318
|
+
* | Data Attribute | Value | Description |
|
|
2319
|
+
* | --- | --- | --- |
|
|
2320
|
+
* | `data-slot` | `"sidebar-tooltip"` | On the tooltip surface. |
|
|
2321
|
+
* | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present, so a chord that arrives later appends instead of replacing the label. |
|
|
2322
|
+
* | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
|
|
2323
|
+
* | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
|
|
2324
|
+
*
|
|
2298
2325
|
* @see https://mantle.ngrok.com/components/navigation/sidebar#sidebartooltip
|
|
2299
2326
|
*
|
|
2300
2327
|
* @example
|
package/dist/sidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-D8KGX4q1.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-DikKOzqN.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(5),{label:n,shortcut:r}=e;if(r==null)return n;let i;t[0]===r?i=t[1]:(i=S(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=C(`span`,{className:`flex items-center gap-1.5`,children:[n,i]}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(22),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==o||i[9]!==u?(m=u==null?o:C(x,{children:[o,S(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:u})]}),i[8]=o,i[9]=u,i[10]=m):m=i[10];let h=m,g;i[11]===c?g=i[12]:(g=t(c,`sidebar-search-trigger`),i[11]=c,i[12]=g);let _=a?d:d??`button`,v;i[13]===s?v=i[14]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[13]=s,i[14]=v);let y;return i[15]!==f||i[16]!==h||i[17]!==l||i[18]!==g||i[19]!==_||i[20]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[15]=f,i[16]=h,i[17]=l,i[18]=g,i[19]=_,i[20]=v,i[21]=y):y=i[21],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-D8KGX4q1.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-CHgJAU6j.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
|
package/dist/split-button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Button } from "./button-B5i9n7Qp.js";
|
|
2
2
|
import { t as IconButton } from "./button-crUf0hbR.js";
|
|
3
3
|
import { t as ButtonSize } from "./button-BCoI4bhP.js";
|
|
4
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-DhwzMnoH.js";
|
|
5
5
|
import { ComponentProps, ReactNode } from "react";
|
|
6
6
|
//#region src/components/split-button/split-button.d.ts
|
|
7
7
|
type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
|
package/dist/split-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./button-Dij5vCQG.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./button-Dij5vCQG.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./dropdown-menu-Bir-GKUs.js";import{c as a}from"react/compiler-runtime";import{CaretDownIcon as o}from"@phosphor-icons/react/CaretDown";import{createContext as s,useContext as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=s({size:`md`}),d={Root:t=>{let n=a(31),r,o,s,c,d,f,p,m,h,g;n[0]===t?(r=n[1],o=n[2],s=n[3],c=n[4],d=n[5],f=n[6],p=n[7],m=n[8],h=n[9],g=n[10]):({className:o,children:r,dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,size:g,ref:h,...m}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=s,n[4]=c,n[5]=d,n[6]=f,n[7]=p,n[8]=m,n[9]=h,n[10]=g);let _=g===void 0?`md`:g,v;n[11]===_?v=n[12]:(v={size:_},n[11]=_,n[12]=v);let y=v,b;n[13]===o?b=n[14]:(b=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,o),n[13]=o,n[14]=b);let x;n[15]!==r||n[16]!==m||n[17]!==h||n[18]!==_||n[19]!==b?(x=l(`div`,{"data-slot":`split-button`,"data-size":_,className:b,ref:h,...m,children:r}),n[15]=r,n[16]=m,n[17]=h,n[18]=_,n[19]=b,n[20]=x):x=n[20];let S;n[21]!==y||n[22]!==x?(S=l(u.Provider,{value:y,children:x}),n[21]=y,n[22]=x,n[23]=S):S=n[23];let C;return n[24]!==s||n[25]!==c||n[26]!==d||n[27]!==f||n[28]!==p||n[29]!==S?(C=l(i.Root,{dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,children:S}),n[24]=s,n[25]=c,n[26]=d,n[27]=f,n[28]=p,n[29]=S,n[30]=C):C=n[30],C},PrimaryAction:e=>{let t=a(3),{size:r}=c(u),i;return t[0]!==e||t[1]!==r?(i=l(n,{appearance:`outlined`,intent:`neutral`,size:r,...e}),t[0]=e,t[1]=r,t[2]=i):i=t[2],i},MenuTrigger:e=>{let n=a(9),s,d;n[0]===e?(s=n[1],d=n[2]):({icon:s,...d}=e,n[0]=e,n[1]=s,n[2]=d);let{size:f}=c(u),p;n[3]===s?p=n[4]:(p=s??l(t,{svg:l(o,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),n[3]=s,n[4]=p);let m;return n[5]!==d||n[6]!==f||n[7]!==p?(m=l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...d})}),n[5]=d,n[6]=f,n[7]=p,n[8]=m):m=n[8],m},MenuContent:e=>{let t=a(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let o=r===void 0?`end`:r,s;return t[3]!==o||t[4]!==n?(s=l(i.Content,{align:o,...n}),t[3]=o,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=a(8),r,o;n[0]===t?(r=n[1],o=n[2]):({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=l(i.Item,{className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}};export{d as SplitButton};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -78,6 +78,25 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
|
78
78
|
/**
|
|
79
79
|
* The button that activates its associated content.
|
|
80
80
|
*
|
|
81
|
+
* **Structure.** `children` render inside a
|
|
82
|
+
* `<span data-slot="tabs-trigger-label">`, on the plain path and the `asChild`
|
|
83
|
+
* path alike. The active-tab decoration is a permanent element sibling, so
|
|
84
|
+
* without the span a bare text label is never a lone child: a browser
|
|
85
|
+
* translation engine reparents that text node, and the removal React runs when
|
|
86
|
+
* the label changes shape or goes away throws. The span is `display: contents`,
|
|
87
|
+
* so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
|
|
88
|
+
* keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
|
|
89
|
+
* pass as a child, because that icon is now a grandchild. Match the part's own
|
|
90
|
+
* variant instead — `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
|
|
91
|
+
* or a class on the icon loses to the default, which is more specific.
|
|
92
|
+
*
|
|
93
|
+
* **Data attributes:**
|
|
94
|
+
*
|
|
95
|
+
* | Data Attribute | Value | Description |
|
|
96
|
+
* | -------------- | ------------------------ | ------------------------------------ |
|
|
97
|
+
* | `data-slot` | `"tabs-trigger"` | On the trigger element. |
|
|
98
|
+
* | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
|
|
99
|
+
*
|
|
81
100
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
|
|
82
101
|
*
|
|
83
102
|
* @example
|
|
@@ -230,6 +249,25 @@ declare const Tabs: {
|
|
|
230
249
|
/**
|
|
231
250
|
* The button that activates its associated content.
|
|
232
251
|
*
|
|
252
|
+
* **Structure.** `children` render inside a
|
|
253
|
+
* `<span data-slot="tabs-trigger-label">`, on the plain path and the `asChild`
|
|
254
|
+
* path alike. The active-tab decoration is a permanent element sibling, so
|
|
255
|
+
* without the span a bare text label is never a lone child: a browser
|
|
256
|
+
* translation engine reparents that text node, and the removal React runs when
|
|
257
|
+
* the label changes shape or goes away throws. The span is `display: contents`,
|
|
258
|
+
* so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
|
|
259
|
+
* keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
|
|
260
|
+
* pass as a child, because that icon is now a grandchild. Match the part's own
|
|
261
|
+
* variant instead — `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
|
|
262
|
+
* or a class on the icon loses to the default, which is more specific.
|
|
263
|
+
*
|
|
264
|
+
* **Data attributes:**
|
|
265
|
+
*
|
|
266
|
+
* | Data Attribute | Value | Description |
|
|
267
|
+
* | -------------- | ------------------------ | ------------------------------------ |
|
|
268
|
+
* | `data-slot` | `"tabs-trigger"` | On the trigger element. |
|
|
269
|
+
* | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
|
|
270
|
+
*
|
|
233
271
|
* @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
|
|
234
272
|
*
|
|
235
273
|
* @example
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{c as a}from"react/compiler-runtime";import{Children as o,cloneElement as s,createContext as c,isValidElement as l,useContext as u,useEffect as d,useRef as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=c({orientation:`horizontal`,appearance:`classic`}),C=e=>{let n=a(21),r,i,o,s,c;n[0]===e?(r=n[1],i=n[2],o=n[3],s=n[4],c=n[5]):({className:i,children:r,orientation:s,appearance:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=c);let l=s===void 0?`horizontal`:s,u=c===void 0?`classic`:c,d;n[6]!==u||n[7]!==l?(d={orientation:l,appearance:u},n[6]=u,n[7]=l,n[8]=d):d=n[8];let f=d,p=l===`horizontal`?`flex-col`:`flex-row`,m;n[9]!==i||n[10]!==p?(m=t(`flex gap-4`,p,i),n[9]=i,n[10]=p,n[11]=m):m=n[11];let g;n[12]!==r||n[13]!==f?(g=h(S.Provider,{value:f,children:r}),n[12]=r,n[13]=f,n[14]=g):g=n[14];let _;return n[15]!==u||n[16]!==l||n[17]!==o||n[18]!==m||n[19]!==g?(_=h(b,{"data-slot":`tabs`,"data-appearance":u,className:m,orientation:l,...o,children:g}),n[15]=u,n[16]=l,n[17]=o,n[18]=m,n[19]=g,n[20]=_):_=n[20],_},w=t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`),T=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:w},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),E=n=>{let r=a(19),o,s,c,l;r[0]===n?(o=r[1],s=r[2],c=r[3],l=r[4]):({className:o,hideBorder:l,ref:c,...s}=n,r[0]=n,r[1]=o,r[2]=s,r[3]=c,r[4]=l);let p=l!==void 0&&l,{orientation:m,appearance:g}=u(S),_=f(null),v=e(_,c),b,x;r[5]===m?(b=r[6],x=r[7]):(b=()=>{let e=_.current;if(!e||m!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let a=()=>{r=!1};return e.addEventListener(`pointerup`,a,{signal:n}),e.addEventListener(`pointercancel`,a,{signal:n}),e.addEventListener(`keydown`,a,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},x=[m],r[5]=m,r[6]=b,r[7]=x),d(b,x);let C=p?``:void 0,w;r[8]!==g||r[9]!==o||r[10]!==p||r[11]!==m?(w=t(T({orientation:m,appearance:g,hideBorder:p}),o),r[8]=g,r[9]=o,r[10]=p,r[11]=m,r[12]=w):w=r[12];let E;return r[13]!==v||r[14]!==m||r[15]!==s||r[16]!==C||r[17]!==w?(E=h(y,{"aria-orientation":m,"data-slot":`tabs-list`,"data-hide-border":C,className:w,ref:v,...s}),r[13]=v,r[14]=m,r[15]=s,r[16]=C,r[17]=w,r[18]=E):E=r[18],E},D=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),O=()=>{let e=a(5),{orientation:t,appearance:n}=u(S),i;e[0]!==n||e[1]!==t?(i=r(D({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=i):i=e[2];let o;return e[3]===i?o=e[4]:(o=h(`span`,{"aria-hidden":!0,className:i}),e[3]=i,e[4]=o),o},k=_(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`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`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),A={Root:C,Content:e=>{let n=a(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==o?(s=h(v,{"data-slot":`tabs-content`,className:o,...i}),n[5]=i,n[6]=o,n[7]=s):s=n[7],s},List:E,Trigger:e=>{let r=a(
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{c as a}from"react/compiler-runtime";import{Children as o,cloneElement as s,createContext as c,isValidElement as l,useContext as u,useEffect as d,useRef as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=c({orientation:`horizontal`,appearance:`classic`}),C=e=>{let n=a(21),r,i,o,s,c;n[0]===e?(r=n[1],i=n[2],o=n[3],s=n[4],c=n[5]):({className:i,children:r,orientation:s,appearance:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=c);let l=s===void 0?`horizontal`:s,u=c===void 0?`classic`:c,d;n[6]!==u||n[7]!==l?(d={orientation:l,appearance:u},n[6]=u,n[7]=l,n[8]=d):d=n[8];let f=d,p=l===`horizontal`?`flex-col`:`flex-row`,m;n[9]!==i||n[10]!==p?(m=t(`flex gap-4`,p,i),n[9]=i,n[10]=p,n[11]=m):m=n[11];let g;n[12]!==r||n[13]!==f?(g=h(S.Provider,{value:f,children:r}),n[12]=r,n[13]=f,n[14]=g):g=n[14];let _;return n[15]!==u||n[16]!==l||n[17]!==o||n[18]!==m||n[19]!==g?(_=h(b,{"data-slot":`tabs`,"data-appearance":u,className:m,orientation:l,...o,children:g}),n[15]=u,n[16]=l,n[17]=o,n[18]=m,n[19]=g,n[20]=_):_=n[20],_},w=t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`),T=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:w},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),E=n=>{let r=a(19),o,s,c,l;r[0]===n?(o=r[1],s=r[2],c=r[3],l=r[4]):({className:o,hideBorder:l,ref:c,...s}=n,r[0]=n,r[1]=o,r[2]=s,r[3]=c,r[4]=l);let p=l!==void 0&&l,{orientation:m,appearance:g}=u(S),_=f(null),v=e(_,c),b,x;r[5]===m?(b=r[6],x=r[7]):(b=()=>{let e=_.current;if(!e||m!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let a=()=>{r=!1};return e.addEventListener(`pointerup`,a,{signal:n}),e.addEventListener(`pointercancel`,a,{signal:n}),e.addEventListener(`keydown`,a,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},x=[m],r[5]=m,r[6]=b,r[7]=x),d(b,x);let C=p?``:void 0,w;r[8]!==g||r[9]!==o||r[10]!==p||r[11]!==m?(w=t(T({orientation:m,appearance:g,hideBorder:p}),o),r[8]=g,r[9]=o,r[10]=p,r[11]=m,r[12]=w):w=r[12];let E;return r[13]!==v||r[14]!==m||r[15]!==s||r[16]!==C||r[17]!==w?(E=h(y,{"aria-orientation":m,"data-slot":`tabs-list`,"data-hide-border":C,className:w,ref:v,...s}),r[13]=v,r[14]=m,r[15]=s,r[16]=C,r[17]=w,r[18]=E):E=r[18],E},D=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),O=()=>{let e=a(5),{orientation:t,appearance:n}=u(S),i;e[0]!==n||e[1]!==t?(i=r(D({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=i):i=e[2];let o;return e[3]===i?o=e[4]:(o=h(`span`,{"aria-hidden":!0,className:i}),e[3]=i,e[4]=o),o},k=_(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),A={Root:C,Content:e=>{let n=a(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==o?(s=h(v,{"data-slot":`tabs-content`,className:o,...i}),n[5]=i,n[6]=o,n[7]=s):s=n[7],s},List:E,Trigger:e=>{let r=a(40),i,c,d,f,_,v,y;r[0]===e?(i=r[1],c=r[2],d=r[3],f=r[4],_=r[5],v=r[6],y=r[7]):({"aria-disabled":i,asChild:y,children:d,className:f,disabled:c,ref:v,..._}=e,r[0]=e,r[1]=i,r[2]=c,r[3]=d,r[4]=f,r[5]=_,r[6]=v,r[7]=y);let b=y!==void 0&&y,{orientation:C,appearance:w}=u(S),T=i??c,E;r[8]===T?E=r[9]:(E=n(T),r[8]=T,r[9]=E);let D=E,A=i??c,j;r[10]!==w||r[11]!==f||r[12]!==C?(j=t(k({orientation:C,appearance:w}),f),r[10]=w,r[11]=f,r[12]=C,r[13]=j):j=r[13];let M;r[14]!==D||r[15]!==_||r[16]!==A||r[17]!==j?(M={"aria-disabled":A,className:j,disabled:D,..._},r[14]=D,r[15]=_,r[16]=A,r[17]=j,r[18]=M):M=r[18];let N=M;if(b){let e;r[19]===d?e=r[20]:(e=o.only(d),p(l(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),r[19]=d,r[20]=e);let t=e.props?.children,n;if(r[21]!==D||r[22]!==t||r[23]!==v||r[24]!==e||r[25]!==N){let i=D?{href:void 0,to:void 0}:{},a;r[27]!==D||r[28]!==e?(a=D?h(`button`,{type:`button`}):e,r[27]=D,r[28]=e,r[29]=a):a=r[29];let o;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(o=h(O,{}),r[30]=o):o=r[30];let c;r[31]===t?c=r[32]:(c=g(m,{children:[o,h(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),r[31]=t,r[32]=c),n=h(x,{asChild:!0,"data-slot":`tabs-trigger`,...N,ref:v,children:s(a,i,c)}),r[21]=D,r[22]=t,r[23]=v,r[24]=e,r[25]=N,r[26]=n}else n=r[26];return n}let P;r[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=h(O,{}),r[33]=P):P=r[33];let F;r[34]===d?F=r[35]:(F=h(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:d}),r[34]=d,r[35]=F);let I;return r[36]!==v||r[37]!==F||r[38]!==N?(I=g(x,{"data-slot":`tabs-trigger`,ref:v,...N,children:[P,F]}),r[36]=v,r[37]=F,r[38]=N,r[39]=I):I=r[39],I},Badge:e=>{let n=a(10),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:i,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]===i?s=n[5]:(s=t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,i),n[4]=i,n[5]=s);let c;return n[6]!==r||n[7]!==o||n[8]!==s?(c=h(`span`,{"data-slot":`tabs-badge`,className:s,...o,children:r}),n[6]=r,n[7]=o,n[8]=s,n[9]=c):c=n[9],c}};export{A as Tabs};
|
package/dist/theme-switcher.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
2
|
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
3
3
|
import { n as IconButtonProps, r as IconButtonAppearance } from "./button-crUf0hbR.js";
|
|
4
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
5
|
-
import "./dropdown-menu-
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-DhwzMnoH.js";
|
|
5
|
+
import "./dropdown-menu-BSOdApBD.js";
|
|
6
6
|
import { ComponentProps } from "react";
|
|
7
7
|
//#region src/components/theme-switcher/theme-switcher.d.ts
|
|
8
8
|
/**
|
package/dist/theme-switcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-BT8FnkkJ.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-pwkdtR3U.js";import{t as r}from"./browser-only-Crr3sgA0.js";import{t as i}from"./skeleton-bVDP8BzY.js";import{t as a}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./icon-BT8FnkkJ.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-pwkdtR3U.js";import{t as r}from"./browser-only-Crr3sgA0.js";import{t as i}from"./skeleton-bVDP8BzY.js";import{t as a}from"./dropdown-menu-Bir-GKUs.js";import{d as o,h as s,l as c,p as l}from"./theme-C1kFFdIk.js";import{n as u,t as d}from"./icons-BQRcOU6J.js";import{c as f}from"react/compiler-runtime";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},g=e=>{let t=f(10),{"aria-label":n,"aria-labelledby":r,className:i,style:o}=e,[u,d]=c(),m=r==null?n??`Theme`:n,h;t[0]===d?h=t[1]:(h=e=>{l(e)&&d(e)},t[0]=d,t[1]=h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=s.map(v),t[2]=g):g=t[2];let _;return t[3]!==r||t[4]!==i||t[5]!==u||t[6]!==o||t[7]!==m||t[8]!==h?(_=p(a.RadioGroup,{"aria-label":m,"aria-labelledby":r,"data-slot":`theme-dropdown-menu-radio-group`,className:i,style:o,value:u,onValueChange:h,children:g}),t[3]=r,t[4]=i,t[5]=u,t[6]=o,t[7]=m,t[8]=h,t[9]=_):_=t[9],_},_={Root:e=>{let t=f(2),n;return t[0]===e?n=t[1]:(n=p(a.Root,{...e}),t[0]=e,t[1]=n),n},Trigger:e=>{let o=f(20),s,c,l,u,d,m;o[0]===e?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],m=o[6]):({appearance:d,"data-slot":s,disabled:c,label:m,ref:u,...l}=e,o[0]=e,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=m);let h=d===void 0?`ghost`:d,g=m===void 0?`Change Theme`:m,_;o[7]===s?_=o[8]:(_=t(s,`theme-switcher-trigger`),o[7]=s,o[8]=_);let v;o[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=p(r,{fallback:p(i,{asChild:!0,className:`rounded-full size-5`,children:p(`span`,{})}),children:y}),o[9]=v):v=o[9];let b;o[10]!==h||o[11]!==c||o[12]!==g||o[13]!==l||o[14]!==u||o[15]!==_?(b=p(n,{ref:u,appearance:h,disabled:c,"data-slot":_,intent:`neutral`,icon:v,label:g,...l}),o[10]=h,o[11]=c,o[12]=g,o[13]=l,o[14]=u,o[15]=_,o[16]=b):b=o[16];let x;return o[17]!==c||o[18]!==b?(x=p(a.Trigger,{asChild:!0,disabled:c,children:b}),o[17]=c,o[18]=b,o[19]=x):x=o[19],x},Content:e=>{let n=f(12),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({children:r,"data-slot":i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]===i?s=n[5]:(s=t(i,`theme-switcher-content`),n[4]=i,n[5]=s);let c;n[6]===r?c=n[7]:(c=r??p(g,{}),n[6]=r,n[7]=c);let l;return n[8]!==o||n[9]!==s||n[10]!==c?(l=p(a.Content,{"data-slot":s,...o,children:c}),n[8]=o,n[9]=s,n[10]=c,n[11]=l):l=n[11],l}};function v(t){return m(a.RadioItem,{value:o(t),children:[p(e,{svg:p(u,{theme:t})}),h[t]]},t)}function y(){return p(d,{className:`size-5`})}export{g as ThemeDropdownMenuRadioGroup,_ as ThemeSwitcher};
|
package/dist/toast.d.ts
CHANGED
|
@@ -80,7 +80,8 @@ declare const intents: readonly ["danger", "info", "success", "warning"];
|
|
|
80
80
|
type ToastIntent = (typeof intents)[number];
|
|
81
81
|
/**
|
|
82
82
|
* Props for `Toast.Root`. `asChild` is omitted: the root renders the intent
|
|
83
|
-
* accent bar next to `children`, so a slot would receive
|
|
83
|
+
* accent bar next to the label div holding `children`, so a slot would receive
|
|
84
|
+
* two elements and throw.
|
|
84
85
|
*/
|
|
85
86
|
type ToastProps = ComponentProps<"div"> & {
|
|
86
87
|
/**
|
|
@@ -93,6 +94,22 @@ type ToastProps = ComponentProps<"div"> & {
|
|
|
93
94
|
* is the tone or status that the toast's color communicates.
|
|
94
95
|
* Toasts give the user feedback without interrupting their workflow.
|
|
95
96
|
*
|
|
97
|
+
* **Structure.** `children` render inside a
|
|
98
|
+
* `<div data-slot="toast-label">`. The intent accent bar is a permanent element
|
|
99
|
+
* sibling, so without the wrapper a bare text child is never a lone child: a
|
|
100
|
+
* browser translation engine reparents that text node, and the removal React
|
|
101
|
+
* runs when the content changes shape or goes away throws. The wrapper is a
|
|
102
|
+
* `<div>` because `Toast.Message` renders a `<p>`, which a `<span>` may not
|
|
103
|
+
* contain. It is `display: contents`, so the icon, the message, and an action
|
|
104
|
+
* stay flex items of the root and `Toast.Message`'s `flex-1` still resolves.
|
|
105
|
+
*
|
|
106
|
+
* **Data attributes:**
|
|
107
|
+
*
|
|
108
|
+
* | Data Attribute | Value | Description |
|
|
109
|
+
* | --- | --- | --- |
|
|
110
|
+
* | `data-slot` | `"toast"` | On the toast root. |
|
|
111
|
+
* | `data-slot` | `"toast-label"` | On the `<div>` wrapping `children`, not only the message text. |
|
|
112
|
+
*
|
|
96
113
|
* @see https://mantle.ngrok.com/components/feedback/toast#toastroot
|
|
97
114
|
*
|
|
98
115
|
* @example
|
|
@@ -185,6 +202,22 @@ declare const Toast: {
|
|
|
185
202
|
/**
|
|
186
203
|
* A succinct message with an intent that appears temporarily.
|
|
187
204
|
*
|
|
205
|
+
* **Structure.** `children` render inside a
|
|
206
|
+
* `<div data-slot="toast-label">`. The intent accent bar is a permanent element
|
|
207
|
+
* sibling, so without the wrapper a bare text child is never a lone child: a
|
|
208
|
+
* browser translation engine reparents that text node, and the removal React
|
|
209
|
+
* runs when the content changes shape or goes away throws. The wrapper is a
|
|
210
|
+
* `<div>` because `Toast.Message` renders a `<p>`, which a `<span>` may not
|
|
211
|
+
* contain. It is `display: contents`, so the icon, the message, and an action
|
|
212
|
+
* stay flex items of the root and `Toast.Message`'s `flex-1` still resolves.
|
|
213
|
+
*
|
|
214
|
+
* **Data attributes:**
|
|
215
|
+
*
|
|
216
|
+
* | Data Attribute | Value | Description |
|
|
217
|
+
* | --- | --- | --- |
|
|
218
|
+
* | `data-slot` | `"toast"` | On the toast root. |
|
|
219
|
+
* | `data-slot` | `"toast-label"` | On the `<div>` wrapping `children`, not only the message text. |
|
|
220
|
+
*
|
|
188
221
|
* @see https://mantle.ngrok.com/components/feedback/toast#toastroot
|
|
189
222
|
*
|
|
190
223
|
* @example
|
package/dist/toast.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./slot-BsvE2ntj.js";import{s as r}from"./theme-C1kFFdIk.js";import{c as i}from"react/compiler-runtime";import{createContext as a,useContext as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{CheckCircleIcon as l}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as u}from"@phosphor-icons/react/Info";import{WarningIcon as d}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as f}from"@phosphor-icons/react/WarningDiamond";import*as p from"sonner";function m(e){return typeof e==`number`&&e<=0?1/0:e}const h=t=>{let n=i(13),{className:a,containerAriaLabel:o,dir:c,duration_ms:l,position:u,style:d}=t,f=l===void 0?4e3:l,h=u===void 0?`top-center`:u,g=r(),_;n[0]===a?_=n[1]:(_=e(`toaster overlay-prompt pointer-events-auto *:duration-200`,a),n[0]=a,n[1]=_);let v;n[2]===f?v=n[3]:(v=m(f),n[2]=f,n[3]=v);let y=h??`top-center`,b=g,x;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={unstyled:!0},n[4]=x):x=n[4];let S;return n[5]!==o||n[6]!==c||n[7]!==d||n[8]!==_||n[9]!==v||n[10]!==y||n[11]!==b?(S=s(p.Toaster,{"data-slot":`toaster`,className:_,containerAriaLabel:o,dir:c,duration:v,gap:12,position:y,style:d,theme:b,toastOptions:x}),n[5]=o,n[6]=c,n[7]=d,n[8]=_,n[9]=v,n[10]=y,n[11]=b,n[12]=S):S=n[12],S},g=a(``);function _(e,t){let n=m(t?.duration_ms);return p.toast.custom(t=>s(g.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const v=a({intent:`info`}),y={Root:t=>{let n=i(
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./slot-BsvE2ntj.js";import{s as r}from"./theme-C1kFFdIk.js";import{c as i}from"react/compiler-runtime";import{createContext as a,useContext as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{CheckCircleIcon as l}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as u}from"@phosphor-icons/react/Info";import{WarningIcon as d}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as f}from"@phosphor-icons/react/WarningDiamond";import*as p from"sonner";function m(e){return typeof e==`number`&&e<=0?1/0:e}const h=t=>{let n=i(13),{className:a,containerAriaLabel:o,dir:c,duration_ms:l,position:u,style:d}=t,f=l===void 0?4e3:l,h=u===void 0?`top-center`:u,g=r(),_;n[0]===a?_=n[1]:(_=e(`toaster overlay-prompt pointer-events-auto *:duration-200`,a),n[0]=a,n[1]=_);let v;n[2]===f?v=n[3]:(v=m(f),n[2]=f,n[3]=v);let y=h??`top-center`,b=g,x;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={unstyled:!0},n[4]=x):x=n[4];let S;return n[5]!==o||n[6]!==c||n[7]!==d||n[8]!==_||n[9]!==v||n[10]!==y||n[11]!==b?(S=s(p.Toaster,{"data-slot":`toaster`,className:_,containerAriaLabel:o,dir:c,duration:v,gap:12,position:y,style:d,theme:b,toastOptions:x}),n[5]=o,n[6]=c,n[7]=d,n[8]=_,n[9]=v,n[10]=y,n[11]=b,n[12]=S):S=n[12],S},g=a(``);function _(e,t){let n=m(t?.duration_ms);return p.toast.custom(t=>s(g.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const v=a({intent:`info`}),y={Root:t=>{let n=i(23),r,a,o,l,u;n[0]===t?(r=n[1],a=n[2],o=n[3],l=n[4],u=n[5]):({children:r,className:a,intent:o,ref:u,...l}=t,n[0]=t,n[1]=r,n[2]=a,n[3]=o,n[4]=l,n[5]=u);let d;n[6]===o?d=n[7]:(d={intent:o},n[6]=o,n[7]=d);let f=d,p;n[8]===a?p=n[9]:(p=e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,a),n[8]=a,n[9]=p);let m;n[10]===o?m=n[11]:(m=s(x,{intent:o}),n[10]=o,n[11]=m);let h;n[12]===r?h=n[13]:(h=s(`div`,{"data-slot":`toast-label`,className:`contents`,children:r}),n[12]=r,n[13]=h);let g;n[14]!==l||n[15]!==u||n[16]!==p||n[17]!==m||n[18]!==h?(g=c(`div`,{"data-slot":`toast`,className:p,ref:u,...l,children:[m,h]}),n[14]=l,n[15]=u,n[16]=p,n[17]=m,n[18]=h,n[19]=g):g=n[19];let _;return n[20]!==f||n[21]!==g?(_=s(v.Provider,{value:f,children:g}),n[20]=f,n[21]=g,n[22]=_):_=n[22],_},Action:t=>{let r=i(17),a,c,l,u,d;r[0]===t?(a=r[1],c=r[2],l=r[3],u=r[4],d=r[5]):({asChild:a,className:c,onClick:l,ref:d,...u}=t,r[0]=t,r[1]=a,r[2]=c,r[3]=l,r[4]=u,r[5]=d);let f=o(g),m=a?n:`button`,h;r[6]===c?h=r[7]:(h=e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,c),r[6]=c,r[7]=h);let _;r[8]!==f||r[9]!==l?(_=e=>{l?.(e),!e.defaultPrevented&&p.toast.dismiss(f)},r[8]=f,r[9]=l,r[10]=_):_=r[10];let v;return r[11]!==m||r[12]!==u||r[13]!==d||r[14]!==h||r[15]!==_?(v=s(m,{"data-slot":`toast-action`,className:h,onClick:_,ref:d,...u}),r[11]=m,r[12]=u,r[13]=d,r[14]=h,r[15]=_,r[16]=v):v=r[16],v},Icon:n=>{let r=i(41),a,c,p,m;r[0]===n?(a=r[1],c=r[2],p=r[3],m=r[4]):({className:a,svg:m,ref:p,...c}=n,r[0]=n,r[1]=a,r[2]=c,r[3]=p,r[4]=m);let h=o(v);switch(h.intent){case`danger`:{let n;r[5]===a?n=r[6]:(n=e(`text-danger-600`,a),r[5]=a,r[6]=n);let i;r[7]===m?i=r[8]:(i=m??s(d,{weight:`fill`}),r[7]=m,r[8]=i);let o;return r[9]!==c||r[10]!==p||r[11]!==n||r[12]!==i?(o=s(t,{"data-slot":`toast-icon`,className:n,ref:p,svg:i,...c}),r[9]=c,r[10]=p,r[11]=n,r[12]=i,r[13]=o):o=r[13],o}case`warning`:{let n;r[14]===a?n=r[15]:(n=e(`text-warning-600`,a),r[14]=a,r[15]=n);let i;r[16]===m?i=r[17]:(i=m??s(f,{weight:`fill`}),r[16]=m,r[17]=i);let o;return r[18]!==c||r[19]!==p||r[20]!==n||r[21]!==i?(o=s(t,{"data-slot":`toast-icon`,className:n,ref:p,svg:i,...c}),r[18]=c,r[19]=p,r[20]=n,r[21]=i,r[22]=o):o=r[22],o}case`success`:{let n;r[23]===a?n=r[24]:(n=e(`text-success-600`,a),r[23]=a,r[24]=n);let i;r[25]===m?i=r[26]:(i=m??s(l,{weight:`fill`}),r[25]=m,r[26]=i);let o;return r[27]!==c||r[28]!==p||r[29]!==n||r[30]!==i?(o=s(t,{"data-slot":`toast-icon`,className:n,ref:p,svg:i,...c}),r[27]=c,r[28]=p,r[29]=n,r[30]=i,r[31]=o):o=r[31],o}case`info`:{let n;r[32]===a?n=r[33]:(n=e(`text-accent-600`,a),r[32]=a,r[33]=n);let i;r[34]===m?i=r[35]:(i=m??s(u,{weight:`fill`}),r[34]=m,r[35]=i);let o;return r[36]!==c||r[37]!==p||r[38]!==n||r[39]!==i?(o=s(t,{"data-slot":`toast-icon`,className:n,ref:p,svg:i,...c}),r[36]=c,r[37]=p,r[38]=n,r[39]=i,r[40]=o):o=r[40],o}default:throw Error(`Unreachable Case: ${h.intent}`)}},Message:t=>{let r=i(12),a,o,c,l;r[0]===t?(a=r[1],o=r[2],c=r[3],l=r[4]):({asChild:a,className:o,ref:l,...c}=t,r[0]=t,r[1]=a,r[2]=o,r[3]=c,r[4]=l);let u=a?n:`p`,d;r[5]===o?d=r[6]:(d=e(`text-strong flex-1 text-sm font-body`,o),r[5]=o,r[6]=d);let f;return r[7]!==u||r[8]!==c||r[9]!==l||r[10]!==d?(f=s(u,{"data-slot":`toast-message`,className:d,ref:l,...c}),r[7]=u,r[8]=c,r[9]=l,r[10]=d,r[11]=f):f=r[11],f}},b={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function x(t){let n=i(10),r,a,o;n[0]===t?(r=n[1],a=n[2],o=n[3]):({className:r,intent:a,...o}=t,n[0]=t,n[1]=r,n[2]=a,n[3]=o);let c=b[a],l;n[4]!==r||n[5]!==c?(l=e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,c,r),n[4]=r,n[5]=c,n[6]=l):l=n[6];let u;return n[7]!==o||n[8]!==l?(u=s(`div`,{"aria-hidden":!0,className:l,...o}),n[7]=o,n[8]=l,n[9]=u):u=n[9],u}export{y as Toast,h as Toaster,_ as makeToast};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{r as t}from"./layer-container-R7aux3n8.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"@radix-ui/react-tooltip";const o=e=>{let t=n(6),i,o;t[0]===e?(i=t[1],o=t[2]):({delayDuration:o,...i}=e,t[0]=e,t[1]=i,t[2]=o);let s=(o===void 0?0:o)??0,c;return t[3]!==i||t[4]!==s?(c=r(a.Provider,{delayDuration:s,...i}),t[3]=i,t[4]=s,t[5]=c):c=t[5],c};function s(e){let t=n(2),i;return t[0]===e?i=t[1]:(i=r(a.Root,{...e}),t[0]=e,t[1]=i),i}function c(e){let t=n(2),i;return t[0]===e?i=t[1]:(i=r(a.Trigger,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=i),i}const l={Root:s,Content:o=>{let s=n(20),c,l,u,d,f;s[0]===o?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5]):({children:c,className:l,ref:d,sideOffset:f,...u}=o,s[0]=o,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f);let p=f===void 0?4:f,m=t(),h;s[6]===l?h=s[7]:(h=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-visible wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow`,l),s[6]=l,s[7]=h);let g;s[8]===c?g=s[9]:(g=r(`div`,{"data-slot":`tooltip-label`,className:`contents`,children:c}),s[8]=c,s[9]=g);let _;s[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=r(a.Arrow,{asChild:!0,children:r(`div`,{className:`bg-tooltip z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs`})}),s[10]=_):_=s[10];let v;s[11]!==u||s[12]!==d||s[13]!==p||s[14]!==h||s[15]!==g?(v=i(a.Content,{className:h,"data-slot":`tooltip-content`,ref:d,sideOffset:p,...u,children:[g,_]}),s[11]=u,s[12]=d,s[13]=p,s[14]=h,s[15]=g,s[16]=v):v=s[16];let y;return s[17]!==m||s[18]!==v?(y=r(a.Portal,{container:m,children:v}),s[17]=m,s[18]=v,s[19]=y):y=s[19],y},Trigger:c};export{o as n,l as t};
|
|
@@ -78,6 +78,12 @@ declare function Root(props: ComponentProps<typeof TooltipPrimitive.Root>): impo
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
declare function Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>): import("react").JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Props for `Tooltip.Content`. `asChild` is omitted: the content renders its own
|
|
83
|
+
* arrow next to `children`, so a slot would receive more than one element and
|
|
84
|
+
* throw.
|
|
85
|
+
*/
|
|
86
|
+
type TooltipContentProps = Omit<ComponentProps<typeof TooltipPrimitive.Content>, "asChild">;
|
|
81
87
|
/**
|
|
82
88
|
* The content to render inside the tooltip.
|
|
83
89
|
*
|
|
@@ -88,6 +94,24 @@ declare function Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>)
|
|
|
88
94
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
89
95
|
* float paints on top.
|
|
90
96
|
*
|
|
97
|
+
* **Structure.** `children` render inside a
|
|
98
|
+
* `<div data-slot="tooltip-label">`. The arrow is a permanent element sibling,
|
|
99
|
+
* so without the wrapper a bare text body is never a lone child: a browser
|
|
100
|
+
* translation engine reparents that text node, and the removal React runs when
|
|
101
|
+
* the body changes shape or goes away throws. The wrapper is a `<div>` because a
|
|
102
|
+
* tooltip body is often a `<p>`, which a `<span>` may not contain. It is
|
|
103
|
+
* `display: contents`, so it adds no box and every child of the body stays a
|
|
104
|
+
* layout child of the surface.
|
|
105
|
+
*
|
|
106
|
+
* **Data attributes:**
|
|
107
|
+
*
|
|
108
|
+
* | Data Attribute | Value | Description |
|
|
109
|
+
* | ---------------- | -------------------------------------------------- | ------------------------------------------------- |
|
|
110
|
+
* | `data-slot` | `"tooltip-content"` | On the tooltip surface. |
|
|
111
|
+
* | `data-slot` | `"tooltip-label"` | On the `<div>` wrapping `children`. |
|
|
112
|
+
* | `data-state` | `"delayed-open"` \| `"instant-open"` \| `"closed"` | The open state Radix stamps on the surface. |
|
|
113
|
+
* | `data-side` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | Which side of the trigger the surface resolved to. |
|
|
114
|
+
*
|
|
91
115
|
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltipcontent
|
|
92
116
|
*
|
|
93
117
|
* @example
|
|
@@ -104,12 +128,6 @@ declare function Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>)
|
|
|
104
128
|
* </Tooltip.Root>
|
|
105
129
|
* ```
|
|
106
130
|
*/
|
|
107
|
-
/**
|
|
108
|
-
* Props for `Tooltip.Content`. `asChild` is omitted: the content renders its own
|
|
109
|
-
* arrow next to `children`, so a slot would receive more than one element and
|
|
110
|
-
* throw.
|
|
111
|
-
*/
|
|
112
|
-
type TooltipContentProps = Omit<ComponentProps<typeof TooltipPrimitive.Content>, "asChild">;
|
|
113
131
|
declare const Content: ({ children, className, ref, sideOffset, ...props }: TooltipContentProps) => import("react").JSX.Element;
|
|
114
132
|
/**
|
|
115
133
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
@@ -199,6 +217,24 @@ declare const Tooltip: {
|
|
|
199
217
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
200
218
|
* float paints on top.
|
|
201
219
|
*
|
|
220
|
+
* **Structure.** `children` render inside a
|
|
221
|
+
* `<div data-slot="tooltip-label">`. The arrow is a permanent element sibling,
|
|
222
|
+
* so without the wrapper a bare text body is never a lone child: a browser
|
|
223
|
+
* translation engine reparents that text node, and the removal React runs when
|
|
224
|
+
* the body changes shape or goes away throws. The wrapper is a `<div>` because a
|
|
225
|
+
* tooltip body is often a `<p>`, which a `<span>` may not contain. It is
|
|
226
|
+
* `display: contents`, so it adds no box and every child of the body stays a
|
|
227
|
+
* layout child of the surface.
|
|
228
|
+
*
|
|
229
|
+
* **Data attributes:**
|
|
230
|
+
*
|
|
231
|
+
* | Data Attribute | Value | Description |
|
|
232
|
+
* | ---------------- | -------------------------------------------------- | ------------------------------------------------- |
|
|
233
|
+
* | `data-slot` | `"tooltip-content"` | On the tooltip surface. |
|
|
234
|
+
* | `data-slot` | `"tooltip-label"` | On the `<div>` wrapping `children`. |
|
|
235
|
+
* | `data-state` | `"delayed-open"` \| `"instant-open"` \| `"closed"` | The open state Radix stamps on the surface. |
|
|
236
|
+
* | `data-side` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | Which side of the trigger the surface resolved to. |
|
|
237
|
+
*
|
|
202
238
|
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltipcontent
|
|
203
239
|
*
|
|
204
240
|
* @example
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TooltipProvider, t as Tooltip } from "./tooltip-
|
|
1
|
+
import { n as TooltipProvider, t as Tooltip } from "./tooltip-CfsA_JPe.js";
|
|
2
2
|
export { Tooltip, TooltipProvider };
|
package/dist/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./tooltip-
|
|
1
|
+
import{n as e,t}from"./tooltip-CHgJAU6j.js";export{t as Tooltip,e as TooltipProvider};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"description": "mantle is ngrok's UI library and design system.",
|
|
5
5
|
"homepage": "https://mantle.ngrok.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"./well": "./dist/well.js"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@ariakit/react": "0.4.
|
|
122
|
+
"@ariakit/react": "0.4.40",
|
|
123
123
|
"@headlessui/react": "2.2.10",
|
|
124
124
|
"@radix-ui/react-dialog": "1.1.23",
|
|
125
125
|
"@radix-ui/react-dropdown-menu": "2.1.24",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@radix-ui/react-tabs": "1.1.21",
|
|
134
134
|
"@radix-ui/react-tooltip": "1.2.16",
|
|
135
135
|
"@tanstack/react-table": "9.2.4",
|
|
136
|
-
"@tanstack/react-virtual": "3.14.
|
|
136
|
+
"@tanstack/react-virtual": "3.14.13",
|
|
137
137
|
"class-variance-authority": "0.7.1",
|
|
138
138
|
"cmdk": "1.1.1",
|
|
139
139
|
"d3-scale": "4.0.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./dropdown-menu-BYapTV0f.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{r}from"./layer-container-R7aux3n8.js";import{n as i}from"./separator-D98be0gY.js";import{c as a}from"react/compiler-runtime";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{CheckIcon as c}from"@phosphor-icons/react/Check";import{CaretRightIcon as l}from"@phosphor-icons/react/CaretRight";import*as u from"@radix-ui/react-dropdown-menu";const d=u.Root,f=e=>{let t=a(2),n;return t[0]===e?n=t[1]:(n=o(u.Trigger,{"data-slot":`dropdown-menu-trigger`,...e}),t[0]=e,t[1]=n),n},p=t=>{let n=a(8),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=e(`space-y-px`,r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=o(u.Group,{"data-slot":`dropdown-menu-group`,className:s,...i}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c},m=e=>{let t=a(6),n,i;t[0]===e?(n=t[1],i=t[2]):({container:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let s=r(),c=n??s,l;return t[3]!==i||t[4]!==c?(l=o(u.Portal,{container:c,...i}),t[3]=i,t[4]=c,t[5]=l):l=t[5],l},h={Root:d,CheckboxItem:n=>{let r=a(13),i,l,d,f;r[0]===n?(i=r[1],l=r[2],d=r[3],f=r[4]):({className:d,children:l,checked:i,...f}=n,r[0]=n,r[1]=i,r[2]=l,r[3]=d,r[4]=f);let p;r[5]===d?p=r[6]:(p=e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,d),r[5]=d,r[6]=p);let m;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=o(`span`,{className:`absolute right-2 flex items-center`,children:o(u.ItemIndicator,{children:o(t,{svg:o(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r[7]=m):m=r[7];let h;return r[8]!==i||r[9]!==l||r[10]!==f||r[11]!==p?(h=s(u.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:p,checked:i,...f,children:[m,l]}),r[8]=i,r[9]=l,r[10]=f,r[11]=p,r[12]=h):h=r[12],h},Content:t=>{let r=a(20),i,s,c,l,d,f;r[0]===t?(i=r[1],s=r[2],c=r[3],l=r[4],d=r[5],f=r[6]):({className:i,"data-slot":s,onClick:c,loop:d,width:f,...l}=t,r[0]=t,r[1]=i,r[2]=s,r[3]=c,r[4]=l,r[5]=d,r[6]=f);let p=d===void 0||d,h;r[7]===s?h=r[8]:(h=n(s,`dropdown-menu-content`),r[7]=s,r[8]=h);let g=f===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,_;r[9]!==i||r[10]!==g?(_=e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,g,i),r[9]=i,r[10]=g,r[11]=_):_=r[11];let v;r[12]===c?v=r[13]:(v=e=>{e.stopPropagation(),c?.(e)},r[12]=c,r[13]=v);let y;return r[14]!==p||r[15]!==l||r[16]!==h||r[17]!==_||r[18]!==v?(y=o(m,{children:o(u.Content,{"data-slot":h,className:_,loop:p,onClick:v,...l})}),r[14]=p,r[15]=l,r[16]=h,r[17]=_,r[18]=v,r[19]=y):y=r[19],y},Group:p,Item:t=>{let n=a(10),r,i,s;n[0]===t?(r=n[1],i=n[2],s=n[3]):({className:r,inset:i,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s);let c=i&&`pl-8`,l;n[4]!==r||n[5]!==c?(l=e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,c,r),n[4]=r,n[5]=c,n[6]=l):l=n[6];let d;return n[7]!==s||n[8]!==l?(d=o(u.Item,{"data-slot":`dropdown-menu-item`,className:l,...s}),n[7]=s,n[8]=l,n[9]=d):d=n[9],d},Label:t=>{let n=a(10),r,i,s;n[0]===t?(r=n[1],i=n[2],s=n[3]):({className:r,inset:i,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s);let c=i&&`pl-8`,l;n[4]!==r||n[5]!==c?(l=e(`px-2 py-1.5 text-sm font-medium`,c,r),n[4]=r,n[5]=c,n[6]=l):l=n[6];let d;return n[7]!==s||n[8]!==l?(d=o(u.Label,{"data-slot":`dropdown-menu-label`,className:l,...s}),n[7]=s,n[8]=l,n[9]=d):d=n[9],d},RadioGroup:t=>{let n=a(8),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=e(`space-y-px`,r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=o(u.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,className:s,...i}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c},RadioItem:n=>{let r=a(11),i,l,d;r[0]===n?(i=r[1],l=r[2],d=r[3]):({className:l,children:i,...d}=n,r[0]=n,r[1]=i,r[2]=l,r[3]=d);let f;r[4]===l?f=r[5]:(f=e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,l),r[4]=l,r[5]=f);let p;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=o(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:o(u.ItemIndicator,{children:o(t,{svg:o(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r[6]=p):p=r[6];let m;return r[7]!==i||r[8]!==d||r[9]!==f?(m=s(u.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:f,...d,children:[p,i]}),r[7]=i,r[8]=d,r[9]=f,r[10]=m):m=r[10],m},Separator:t=>{let n=a(8),r,s;n[0]===t?(r=n[1],s=n[2]):({className:r,...s}=t,n[0]=t,n[1]=r,n[2]=s);let c;n[3]===r?c=n[4]:(c=e(`-mx-1.25 my-1 w-auto`,r),n[3]=r,n[4]=c);let l;return n[5]!==s||n[6]!==c?(l=o(i,{"data-slot":`dropdown-menu-separator`,className:c,...s}),n[5]=s,n[6]=c,n[7]=l):l=n[7],l},Shortcut:t=>{let n=a(8),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=e(`ml-auto text-xs tracking-widest opacity-60`,r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=o(`span`,{"data-slot":`dropdown-menu-shortcut`,className:s,...i,translate:`no`}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c},Sub:u.Sub,SubContent:t=>{let n=a(10),r,i,s;n[0]===t?(r=n[1],i=n[2],s=n[3]):({className:r,loop:s,...i}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s);let c=s===void 0||s,l;n[4]===r?l=n[5]:(l=e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,r),n[4]=r,n[5]=l);let d;return n[6]!==c||n[7]!==i||n[8]!==l?(d=o(m,{children:o(u.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:l,loop:c,...i})}),n[6]=c,n[7]=i,n[8]=l,n[9]=d):d=n[9],d},SubTrigger:n=>{let r=a(13),i,c,d,f;r[0]===n?(i=r[1],c=r[2],d=r[3],f=r[4]):({className:c,inset:d,children:i,...f}=n,r[0]=n,r[1]=i,r[2]=c,r[3]=d,r[4]=f);let p=d&&`pl-8`,m;r[5]!==c||r[6]!==p?(m=e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,p,c),r[5]=c,r[6]=p,r[7]=m):m=r[7];let h;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=o(`span`,{className:`absolute right-2 flex items-center`,children:o(t,{svg:o(l,{weight:`bold`}),className:`size-4`})}),r[8]=h):h=r[8];let g;return r[9]!==i||r[10]!==f||r[11]!==m?(g=s(u.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:m,...f,children:[i,h]}),r[9]=i,r[10]=f,r[11]=m,r[12]=g):g=r[12],g},Trigger:f};export{h as t};
|
package/dist/select-sOHUE2Bm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./icon-BT8FnkkJ.js";import{r}from"./layer-container-R7aux3n8.js";import{a as i,r as a}from"./field-Bpptk_9t.js";import{t as o}from"./field-B1wqeZr4.js";import{n as s}from"./separator-D98be0gY.js";import{c}from"react/compiler-runtime";import{CaretDownIcon as l}from"@phosphor-icons/react/CaretDown";import{createContext as u,useContext as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CheckIcon as m}from"@phosphor-icons/react/Check";import{CaretUpIcon as h}from"@phosphor-icons/react/CaretUp";import*as g from"@radix-ui/react-select";const _=u({}),v=e=>{let t=c(26),n,r,i,a,o,s,l,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],d=t[9]):({"aria-invalid":n,children:r,id:i,validation:d,onBlur:a,onValueChange:s,onChange:o,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=d);let p;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==d?(p={"aria-invalid":n,id:i,validation:d,onBlur:a,ref:u},t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=d,t[15]=p):p=t[15];let m=p,h;t[16]!==o||t[17]!==s?(h=e=>{o?.(e),s?.(e)},t[16]=o,t[17]=s,t[18]=h):h=t[18];let v;t[19]!==r||t[20]!==m?(v=f(_.Provider,{value:m,children:r}),t[19]=r,t[20]=m,t[21]=v):v=t[21];let y;return t[22]!==l||t[23]!==h||t[24]!==v?(y=f(g.Root,{...l,onValueChange:h,children:v}),t[22]=l,t[23]=h,t[24]=v,t[25]=y):y=t[25],y},y=e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`space-y-px`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=f(g.Group,{ref:a,"data-slot":`select-group`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},b=g.Value,x=r=>{let s=c(30),u,m,h,v,y,b,x,S;s[0]===r?(u=s[1],m=s[2],h=s[3],v=s[4],y=s[5],b=s[6],x=s[7],S=s[8]):({"aria-invalid":u,className:h,children:m,id:y,onBlur:v,ref:S,validation:b,...x}=r,s[0]=r,s[1]=u,s[2]=m,s[3]=h,s[4]=v,s[5]=y,s[6]=b,s[7]=x,s[8]=S);let C=d(_),w=d(o),T=e(S,C.ref),E=i(),D=w?w[`aria-invalid`]:C[`aria-invalid`]??u,O=C.validation??b??E,k;s[9]!==D||s[10]!==O?(k=a({"aria-invalid":D,validation:O}),s[9]=D,s[10]=O,s[11]=k):k=s[11];let{ariaInvalid:A,validation:j}=k,M=w?w.id:C.id??y,N;s[12]===h?N=s[13]:(N=t(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,h),s[12]=h,s[13]=N);let P=j||void 0,F;s[14]!==C||s[15]!==v?(F=e=>{v?.(e),C.onBlur?.(e)},s[14]=C,s[15]=v,s[16]=F):F=s[16];let I;s[17]===w?I=s[18]:(I=w?{"aria-describedby":w[`aria-describedby`],"aria-errormessage":w[`aria-errormessage`]}:void 0,s[17]=w,s[18]=I);let L;s[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=f(g.Icon,{asChild:!0,children:f(n,{svg:f(l,{weight:`bold`}),className:`size-4`})}),s[19]=L):L=s[19];let R;return s[20]!==A||s[21]!==m||s[22]!==M||s[23]!==x||s[24]!==N||s[25]!==P||s[26]!==F||s[27]!==I||s[28]!==T?(R=p(g.Trigger,{"data-slot":`select-trigger`,className:N,"data-validation":P,id:M,ref:T,...x,onBlur:F,...I,"aria-invalid":A,children:[m,L]}),s[20]=A,s[21]=m,s[22]=M,s[23]=x,s[24]=N,s[25]=P,s[26]=F,s[27]=I,s[28]=T,s[29]=R):R=s[29],R},S=e=>{let r=c(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let l;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=f(n,{svg:f(h,{weight:`bold`}),className:`size-4`}),r[6]=l):l=r[6];let u;return r[7]!==a||r[8]!==o||r[9]!==s?(u=f(g.ScrollUpButton,{ref:o,className:s,...a,children:l}),r[7]=a,r[8]=o,r[9]=s,r[10]=u):u=r[10],u},C=e=>{let r=c(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let u;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=f(n,{svg:f(l,{weight:`bold`}),className:`size-4`}),r[6]=u):u=r[6];let d;return r[7]!==a||r[8]!==o||r[9]!==s?(d=f(g.ScrollDownButton,{ref:o,className:s,...a,children:u}),r[7]=a,r[8]=o,r[9]=s,r[10]=d):d=r[10],d},w={Root:v,Content:e=>{let n=c(27),i,a,o,s,l,u;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6]):({className:a,children:i,position:l,ref:s,width:u,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=u);let d=l===void 0?`popper`:l,m=u===void 0?`trigger`:u,h=r(),_=d===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,v=m===`trigger`&&`w-(--radix-select-trigger-width)`,y;n[7]!==a||n[8]!==_||n[9]!==v?(y=t(`border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,_,v,a),n[7]=a,n[8]=_,n[9]=v,n[10]=y):y=n[10];let b;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=f(S,{}),n[11]=b):b=n[11];let x=d===`popper`&&`h-(--radix-select-trigger-height) w-full`,w;n[12]===x?w=n[13]:(w=t(`p-1 space-y-px`,x),n[12]=x,n[13]=w);let T;n[14]!==i||n[15]!==w?(T=f(g.Viewport,{className:w,children:i}),n[14]=i,n[15]=w,n[16]=T):T=n[16];let E;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=f(C,{}),n[17]=E):E=n[17];let D;n[18]!==d||n[19]!==o||n[20]!==s||n[21]!==y||n[22]!==T?(D=p(g.Content,{ref:s,"data-slot":`select-content`,className:y,position:d,...o,children:[b,T,E]}),n[18]=d,n[19]=o,n[20]=s,n[21]=y,n[22]=T,n[23]=D):D=n[23];let O;return n[24]!==h||n[25]!==D?(O=f(g.Portal,{container:h,children:D}),n[24]=h,n[25]=D,n[26]=O):O=n[26],O},Group:y,Item:e=>{let r=c(19),i,a,o,s,l;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],l=r[5]):({className:a,children:i,icon:o,ref:l,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l);let u;r[6]===a?u=r[7]:(u=t(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,a),r[6]=a,r[7]=u);let d;r[8]===o?d=r[9]:(d=o&&f(n,{svg:o}),r[8]=o,r[9]=d);let h;r[10]===i?h=r[11]:(h=f(g.ItemText,{children:i}),r[10]=i,r[11]=h);let _;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=f(g.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:f(n,{svg:f(m,{weight:`bold`}),className:`size-4 text-accent-600`})}),r[12]=_):_=r[12];let v;return r[13]!==s||r[14]!==l||r[15]!==u||r[16]!==d||r[17]!==h?(v=p(g.Item,{ref:l,"data-slot":`select-item`,className:u,...s,children:[d,h,_]}),r[13]=s,r[14]=l,r[15]=u,r[16]=d,r[17]=h,r[18]=v):v=r[18],v},Label:e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`px-2 py-1.5 text-sm font-medium`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=f(g.Label,{ref:a,"data-slot":`select-label`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},Separator:e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`-mx-1 my-1 h-px w-auto`,r),n[4]=r,n[5]=o);let l;return n[6]!==i||n[7]!==a||n[8]!==o?(l=f(s,{ref:a,"data-slot":`select-separator`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=l):l=n[9],l},Trigger:x,Value:b};export{w as t};
|
package/dist/tooltip-DikKOzqN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{r as t}from"./layer-container-R7aux3n8.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"@radix-ui/react-tooltip";const o=e=>{let t=n(6),i,o;t[0]===e?(i=t[1],o=t[2]):({delayDuration:o,...i}=e,t[0]=e,t[1]=i,t[2]=o);let s=(o===void 0?0:o)??0,c;return t[3]!==i||t[4]!==s?(c=r(a.Provider,{"data-slot":`tooltip-provider`,delayDuration:s,...i}),t[3]=i,t[4]=s,t[5]=c):c=t[5],c};function s(e){let t=n(2),i;return t[0]===e?i=t[1]:(i=r(a.Root,{...e}),t[0]=e,t[1]=i),i}function c(e){let t=n(2),i;return t[0]===e?i=t[1]:(i=r(a.Trigger,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=i),i}const l={Root:s,Content:o=>{let s=n(18),c,l,u,d,f;s[0]===o?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5]):({children:c,className:l,ref:d,sideOffset:f,...u}=o,s[0]=o,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f);let p=f===void 0?4:f,m=t(),h;s[6]===l?h=s[7]:(h=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-visible wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow`,l),s[6]=l,s[7]=h);let g;s[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=r(a.Arrow,{asChild:!0,children:r(`div`,{className:`bg-tooltip z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs`})}),s[8]=g):g=s[8];let _;s[9]!==c||s[10]!==u||s[11]!==d||s[12]!==p||s[13]!==h?(_=i(a.Content,{className:h,"data-slot":`tooltip-content`,ref:d,sideOffset:p,...u,children:[c,g]}),s[9]=c,s[10]=u,s[11]=d,s[12]=p,s[13]=h,s[14]=_):_=s[14];let v;return s[15]!==m||s[16]!==_?(v=r(a.Portal,{container:m,children:_}),s[15]=m,s[16]=_,s[17]=v):v=s[17],v},Trigger:c};export{o as n,l as t};
|