@ngrok/mantle 0.79.3 → 0.80.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/dist/accordion.d.ts +169 -12
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +496 -30
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +129 -9
- package/dist/alert.js +1 -1
- package/dist/anchor-_2meGDfj.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +214 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-5WsvzIQ6.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-BPMwa2jN.d.ts} +3 -3
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +146 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +224 -8
- package/dist/centered-layout.js +1 -1
- package/dist/checkbox-Cq17y0-R.js +1 -0
- package/dist/checkbox.d.ts +12 -10
- package/dist/checkbox.js +1 -1
- package/dist/choice-Cc8dA5r8.js +1 -0
- package/dist/choice-Ct0KK8jw.d.ts +269 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +270 -50
- package/dist/code-block.js +6 -6
- package/dist/code.d.ts +3 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +190 -11
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +285 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +33 -5
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +79 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CQ2C6vkE.js +1 -0
- package/dist/dialog.d.ts +239 -18
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-CSCDdA3K.js +1 -0
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-CoyozLzy.d.ts} +170 -29
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +596 -45
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +0 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +54 -4
- package/dist/hover-card.js +1 -1
- package/dist/{icon-Cevjo93X.d.ts → icon-BDqpcZ-n.d.ts} +1 -1
- package/dist/icon-CGgMKpJg.js +1 -0
- package/dist/{icon-button-BvQvT790.d.ts → icon-button-C1AfGnQx.d.ts} +6 -60
- package/dist/icon-button-DiOhreJD.js +1 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +5 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/index-B8mIWKIU.d.ts +211 -0
- package/dist/{index-Rv8RL7xy.d.ts → index-BtwKJTLq.d.ts} +1 -1
- package/dist/{index-BSAizFod.d.ts → index-C2jj8U4a.d.ts} +5 -5
- package/dist/index-CdPXa9h1.d.ts +1 -0
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-CVyAVbim.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-DV9M6K4v.d.ts} +42 -2
- package/dist/input.d.ts +4 -55
- package/dist/input.js +1 -1
- package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
- package/dist/label-D-D11mlp.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +150 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/media-object.d.ts +27 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +312 -15
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +129 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +70 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CBMADtjV.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-CJRIlrLz.d.ts +31 -0
- package/dist/primitive-DCPHJsRs.js +1 -0
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +113 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +128 -23
- package/dist/radio-group.js +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/select-SR_9-bxA.js +1 -0
- package/dist/select-idm1jy7y.d.ts +600 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +252 -298
- package/dist/selectable-list.js +1 -1
- package/dist/separator-B5UmkVRL.d.ts +75 -0
- package/dist/separator-bpE_kooz.js +1 -0
- package/dist/separator.d.ts +1 -52
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +295 -21
- package/dist/sheet.js +1 -1
- package/dist/skeleton-CsbUHbBA.js +1 -0
- package/dist/skeleton.d.ts +4 -7
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +24 -4
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → sort-B_DDQcVD.js} +1 -1
- package/dist/split-button.d.ts +28 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → svg-only-CdI_v82i.d.ts} +1 -1
- package/dist/svg-only-d-nMCfAI.js +1 -0
- package/dist/switch.d.ts +9 -6
- package/dist/switch.js +1 -1
- package/dist/table-DUSvU_Jw.d.ts +875 -0
- package/dist/table-GDkapNFi.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +135 -21
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-provider-BftkIiZn.js +1 -0
- package/dist/theme-switcher.d.ts +110 -29
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-wVnzzx2F.js +1 -0
- package/dist/theme.d.ts +53 -14
- package/dist/theme.js +1 -1
- package/dist/toast-DKgMRv4F.js +1 -0
- package/dist/toast.d.ts +98 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +28 -1
- package/dist/tooltip.js +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → traffic-policy-file-CF1lbWtp.js} +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/virtual-UrzmaSQm.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +3 -3
- package/dist/anchor-C_tjSVy6.js +0 -1
- package/dist/as-child-CYEVu1WY.d.ts +0 -23
- package/dist/button-5t6-JS_I.js +0 -1
- package/dist/button-ClC60Nzg.js +0 -1
- package/dist/checkbox-DJ2xl7Rc.js +0 -1
- package/dist/choice-DOdyNzFC.js +0 -1
- package/dist/compose-refs-Cjf2gfB8.js +0 -1
- package/dist/dialog-vxLIvB8M.js +0 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
- package/dist/icon-CDtYjF_H.js +0 -1
- package/dist/icon-button-DV2-GZHf.js +0 -1
- package/dist/index-g2rfwNCH.d.ts +0 -1
- package/dist/input-Ct1YOqSy.js +0 -1
- package/dist/label-BMlHW_2D.js +0 -1
- package/dist/popover-D5WxxnBY.js +0 -1
- package/dist/primitive-C64-m48O.d.ts +0 -13
- package/dist/primitive-IKruV2iB.js +0 -1
- package/dist/select-Bwt2YduR.d.ts +0 -345
- package/dist/select-D-5u0Blc.js +0 -1
- package/dist/separator-kBnnv3Cw.js +0 -1
- package/dist/skeleton-Bu3tgNcW.js +0 -1
- package/dist/slot-DmPrjM7N.js +0 -1
- package/dist/svg-only-DDx6FtJd.js +0 -1
- package/dist/table-CPH2md2-.js +0 -1
- package/dist/table-CwFHXC-G.d.ts +0 -414
- package/dist/theme-D3MDng6U.js +0 -1
- package/dist/theme-provider-C9zpDyJW.js +0 -1
- package/dist/toast-BsCjaMVS.js +0 -1
- package/dist/virtual-DZMBu7Ch.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CGgMKpJg.js";import{t as n}from"./slot-CDk0Bb9z.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=f(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover border border-transparent text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border border-transparent text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},intent:{accent:``,danger:``,neutral:``},size:{xs:``,sm:``,md:``,lg:``,xl:``}},defaultVariants:{isLoading:!1,size:`md`},compoundVariants:[{appearance:[`filled`,`ghost`,`outlined`],size:`xs`,class:`h-6 px-2`},{appearance:[`filled`,`ghost`,`outlined`],size:`sm`,class:`h-7 px-2.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`md`,class:`h-9 px-3`},{appearance:[`filled`,`ghost`,`outlined`],size:`lg`,class:`h-10 px-3.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`xl`,class:`h-12 px-4`},{appearance:`ghost`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,intent:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,intent:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,intent:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600`},{appearance:`filled`,intent:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),h={xs:`ps-1.5`,sm:`ps-2`,md:`ps-2.5`,lg:`ps-3`,xl:`ps-3.5`},g={xs:`pe-1.5`,sm:`pe-2`,md:`pe-2.5`,lg:`pe-3`,xl:`pe-3.5`},_=({"aria-disabled":f,appearance:_,asChild:v,children:y,className:b,disabled:x,icon:S,iconPlacement:C=`start`,intent:w,isLoading:T=!1,ref:E,size:D=`md`,type:O,...k})=>{let A=r(f??x??T),j=T?u(p,{className:`animate-spin`}):S,M=j&&_!==`link`,N={"aria-disabled":A,"data-slot":`button`,className:e(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,m({appearance:_,intent:w,isLoading:T,size:D}),_!==`link`&&`font-sans`,M&&C===`start`&&h[D],M&&C===`end`&&g[D],b),"data-appearance":_,"data-disabled":A,"data-intent":w,"data-loading":T,"data-size":_===`link`?void 0:D,disabled:A,ref:E,...k};return v?(c(s(y)&&a.only(y),"When using `asChild`, Button must be passed a single child as a JSX tag."),u(n,{...N,children:o(y,{},d(l,{children:[j&&u(t,{svg:j,className:i(C===`end`&&`order-last`)}),y.props.children]}))})):d(`button`,{...N,type:O??`button`,children:[j&&u(t,{svg:j,className:i(C===`end`&&`order-last`)}),y]})};export{_ as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as VariantProps } from "./index-
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { r as VariantProps } from "./index-DA4ig3gj.js";
|
|
3
3
|
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
//#region src/components/button/button.d.ts
|
|
@@ -126,6 +126,6 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
126
126
|
* <IconButton appearance="outlined" intent="neutral" icon={<CopyIcon />} label="Copy page" onClick={copyPage} />
|
|
127
127
|
* ```
|
|
128
128
|
*/
|
|
129
|
-
declare const Button:
|
|
129
|
+
declare const Button: ({ "aria-disabled": _ariaDisabled, appearance, asChild, children, className, disabled: _disabled, icon: propIcon, iconPlacement, intent, isLoading, ref, size, type, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
130
130
|
//#endregion
|
|
131
131
|
export { ButtonAppearance as n, ButtonProps as r, Button as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`border-form inline-flex items-center rounded-md`,{variants:{appearance:{panel:`bg-form gap-0.5 border p-0.75 [--icon-button-border-radius:0.125rem] [&>.separator]:mx-px`,ghost:`gap-0.5`,outlined:``}}}),a=({appearance:r,asChild:a,className:o,children:s,ref:c,...l})=>n(a?t:`div`,{"data-slot":`button-group`,className:e(i({appearance:r}),o),ref:c,...l,children:s});export{a as t};
|
package/dist/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
2
|
-
import { n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-
|
|
3
|
-
import { n as IconButtonAppearance, r as IconButtonProps, t as IconButton } from "./icon-button-
|
|
4
|
-
import { n as ButtonGroupProps, t as ButtonGroup } from "./index-
|
|
2
|
+
import { n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-BPMwa2jN.js";
|
|
3
|
+
import { n as IconButtonAppearance, r as IconButtonProps, t as IconButton } from "./icon-button-C1AfGnQx.js";
|
|
4
|
+
import { n as ButtonGroupProps, t as ButtonGroup } from "./index-C2jj8U4a.js";
|
|
5
5
|
import { t as ButtonSize } from "./sizes-BCoI4bhP.js";
|
|
6
6
|
export { Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonIntent, type ButtonProps, type ButtonSize, IconButton, type IconButtonAppearance, type IconButtonProps };
|
package/dist/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-button-
|
|
1
|
+
import{t as e}from"./icon-button-DiOhreJD.js";import{t}from"./button-5WsvzIQ6.js";import{t as n}from"./button-D9n09xUg.js";export{t as Button,n as ButtonGroup,e as IconButton};
|
package/dist/calendar.d.ts
CHANGED
|
@@ -28,8 +28,5 @@ type CalendarProps = ComponentProps<typeof DayPicker>;
|
|
|
28
28
|
* https://github.com/ngrok/mantle/issues
|
|
29
29
|
*/
|
|
30
30
|
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react").JSX.Element;
|
|
31
|
-
declare namespace Calendar {
|
|
32
|
-
var displayName: string;
|
|
33
|
-
}
|
|
34
31
|
//#endregion
|
|
35
32
|
export { Calendar, type CalendarProps, type DateRange };
|
package/dist/calendar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CGgMKpJg.js";import{n}from"./icon-button-DiOhreJD.js";import{jsx as r}from"react/jsx-runtime";import{CaretRightIcon as i}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{DayPicker as o}from"react-day-picker";const s=n({appearance:`ghost`,intent:`neutral`,size:`sm`});function c({className:n,classNames:c,showOutsideDays:l=!1,...u}){return r(o,{"data-slot":`calendar`,animate:!1,components:{Chevron:e=>r(t,{svg:e.orientation===`left`?r(a,{}):r(i,{}),className:`size-4`})},classNames:{root:e(`isolate`,n),button_next:e(s,`absolute right-0`),button_previous:e(s,`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,u.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...c},showOutsideDays:l,...u})}export{c as Calendar};
|
package/dist/card.d.ts
CHANGED
|
@@ -1,9 +1,146 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./index-
|
|
3
|
-
import { ComponentProps
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import "./index-DA4ig3gj.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
4
|
//#region src/components/card/card.d.ts
|
|
5
5
|
type CardProps = ComponentProps<"div"> & WithAsChild;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A container that can be used to display content in a box resembling a
|
|
8
|
+
* physical card. The root component of the all Card components.
|
|
9
|
+
*
|
|
10
|
+
* @see https://mantle.ngrok.com/components/structure/card#cardroot
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Card.Root>
|
|
15
|
+
* <Card.Body>
|
|
16
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
17
|
+
* </Card.Body>
|
|
18
|
+
* </Card.Root>
|
|
19
|
+
*
|
|
20
|
+
* <Card.Root>
|
|
21
|
+
* <Card.Header>
|
|
22
|
+
* <Card.Title>Card Title Here</Card.Title>
|
|
23
|
+
* </Card.Header>
|
|
24
|
+
* <Card.Body>
|
|
25
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
26
|
+
* </Card.Body>
|
|
27
|
+
* <Card.Footer>
|
|
28
|
+
* <p>Card footer</p>
|
|
29
|
+
* </Card.Footer>
|
|
30
|
+
* </Card.Root>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare const Root: {
|
|
34
|
+
({ asChild, className, children, ref, ...rest }: CardProps): import("react").JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The main content of a card. Usually composed as a direct child of a `Card` component.
|
|
39
|
+
*
|
|
40
|
+
* @see https://mantle.ngrok.com/components/structure/card#cardbody
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <Card.Root>
|
|
45
|
+
* <Card.Body>
|
|
46
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
47
|
+
* </Card.Body>
|
|
48
|
+
* </Card.Root>
|
|
49
|
+
*
|
|
50
|
+
* <Card.Root>
|
|
51
|
+
* <Card.Header>
|
|
52
|
+
* <Card.Title>Card Title Here</Card.Title>
|
|
53
|
+
* </Card.Header>
|
|
54
|
+
* <Card.Body>
|
|
55
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
56
|
+
* </Card.Body>
|
|
57
|
+
* <Card.Footer>
|
|
58
|
+
* <p>Card footer</p>
|
|
59
|
+
* </Card.Footer>
|
|
60
|
+
* </Card.Root>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const Body: {
|
|
64
|
+
({ asChild, className, children, ref, ...rest }: CardProps): import("react").JSX.Element;
|
|
65
|
+
displayName: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The footer container of a card. Usually composed as a direct child of a `Card` component.
|
|
69
|
+
*
|
|
70
|
+
* @see https://mantle.ngrok.com/components/structure/card#cardfooter
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <Card.Root>
|
|
75
|
+
* <Card.Header>
|
|
76
|
+
* <Card.Title>Card Title Here</Card.Title>
|
|
77
|
+
* </Card.Header>
|
|
78
|
+
* <Card.Body>
|
|
79
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
80
|
+
* </Card.Body>
|
|
81
|
+
* <Card.Footer>
|
|
82
|
+
* <p>Card footer</p>
|
|
83
|
+
* </Card.Footer>
|
|
84
|
+
* </Card.Root>
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
declare const Footer: {
|
|
88
|
+
({ asChild, className, children, ref, ...rest }: CardProps): import("react").JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The header container of a card. Usually composed as a direct child of a `Card` component.
|
|
93
|
+
*
|
|
94
|
+
* @see https://mantle.ngrok.com/components/structure/card#cardheader
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <Card.Root>
|
|
99
|
+
* <Card.Header>
|
|
100
|
+
* <Card.Title>Card Title Here</Card.Title>
|
|
101
|
+
* </Card.Header>
|
|
102
|
+
* <Card.Body>
|
|
103
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
104
|
+
* </Card.Body>
|
|
105
|
+
* <Card.Footer>
|
|
106
|
+
* <p>Card footer</p>
|
|
107
|
+
* </Card.Footer>
|
|
108
|
+
* </Card.Root>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare const Header: {
|
|
112
|
+
({ asChild, className, children, ref, ...rest }: CardProps): import("react").JSX.Element;
|
|
113
|
+
displayName: string;
|
|
114
|
+
};
|
|
115
|
+
type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
|
|
116
|
+
/**
|
|
117
|
+
* The title of a card. Usually composed as a direct child of a `Card.Header`
|
|
118
|
+
* component.
|
|
119
|
+
* Renders as an `h3` element by default, but can be changed to any other
|
|
120
|
+
* element by using the `asChild` prop. It is preferred to use a heading element
|
|
121
|
+
* (h1-h6) for accessibility reasons.
|
|
122
|
+
*
|
|
123
|
+
* @see https://mantle.ngrok.com/components/structure/card#cardtitle
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```tsx
|
|
127
|
+
* <Card.Root>
|
|
128
|
+
* <Card.Header>
|
|
129
|
+
* <Card.Title>Card Title Here</Card.Title>
|
|
130
|
+
* </Card.Header>
|
|
131
|
+
* <Card.Body>
|
|
132
|
+
* <p>Laborum in aute officia adipisicing elit velit.</p>
|
|
133
|
+
* </Card.Body>
|
|
134
|
+
* <Card.Footer>
|
|
135
|
+
* <p>Card footer</p>
|
|
136
|
+
* </Card.Footer>
|
|
137
|
+
* </Card.Root>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare const Title: {
|
|
141
|
+
({ className, asChild, ref, ...props }: CardTitleProps): import("react").JSX.Element;
|
|
142
|
+
displayName: string;
|
|
143
|
+
};
|
|
7
144
|
/**
|
|
8
145
|
* A container that can be used to display content in a box resembling a
|
|
9
146
|
* physical card.
|
|
@@ -56,7 +193,7 @@ declare const Card: {
|
|
|
56
193
|
* </Card.Root>
|
|
57
194
|
* ```
|
|
58
195
|
*/
|
|
59
|
-
readonly Root:
|
|
196
|
+
readonly Root: typeof Root;
|
|
60
197
|
/**
|
|
61
198
|
* The main content of a card.
|
|
62
199
|
*
|
|
@@ -71,7 +208,7 @@ declare const Card: {
|
|
|
71
208
|
* </Card.Root>
|
|
72
209
|
* ```
|
|
73
210
|
*/
|
|
74
|
-
readonly Body:
|
|
211
|
+
readonly Body: typeof Body;
|
|
75
212
|
/**
|
|
76
213
|
* The footer container of a card.
|
|
77
214
|
*
|
|
@@ -92,7 +229,7 @@ declare const Card: {
|
|
|
92
229
|
* </Card.Root>
|
|
93
230
|
* ```
|
|
94
231
|
*/
|
|
95
|
-
readonly Footer:
|
|
232
|
+
readonly Footer: typeof Footer;
|
|
96
233
|
/**
|
|
97
234
|
* The header container of a card.
|
|
98
235
|
*
|
|
@@ -113,7 +250,7 @@ declare const Card: {
|
|
|
113
250
|
* </Card.Root>
|
|
114
251
|
* ```
|
|
115
252
|
*/
|
|
116
|
-
readonly Header:
|
|
253
|
+
readonly Header: typeof Header;
|
|
117
254
|
/**
|
|
118
255
|
* The title of a card.
|
|
119
256
|
*
|
|
@@ -134,7 +271,7 @@ declare const Card: {
|
|
|
134
271
|
* </Card.Root>
|
|
135
272
|
* ```
|
|
136
273
|
*/
|
|
137
|
-
readonly Title:
|
|
274
|
+
readonly Title: typeof Title;
|
|
138
275
|
};
|
|
139
276
|
//#endregion
|
|
140
277
|
export { Card, type CardProps, type CardTitleProps };
|
package/dist/card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card`,className:e(`border-card bg-card relative rounded-md border`,i),...s,children:a});r.displayName=`Card`;const i=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-body`,className:e(`p-6 border-t border-card-muted first:border-t-0`,i),...s,children:a});i.displayName=`CardBody`;const a=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-footer`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...s,children:a});a.displayName=`CardFooter`;const o=({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-header`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...s,children:a});o.displayName=`CardHeader`;const s=({className:r,asChild:i,ref:a,...o})=>n(i?t:`h3`,{ref:a,"data-slot":`card-title`,className:e(`text-strong text-base font-medium`,r),...o});s.displayName=`CardTitle`;const c={Root:r,Body:i,Footer:a,Header:o,Title:s};export{c as Card};
|
|
@@ -1,6 +1,192 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
3
4
|
//#region src/components/centered-layout/centered-layout.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The outer frame of a centered page flow. Renders a `<div>` with
|
|
7
|
+
* `flex min-h-full flex-col` so it fills its nearest sized ancestor and stacks
|
|
8
|
+
* `CenteredLayout.Notice` and `CenteredLayout.Header` (pinned top),
|
|
9
|
+
* `CenteredLayout.Body` (which grows), and `CenteredLayout.Footer` (pinned
|
|
10
|
+
* bottom). Consumers whose host requires an exact height can merge `h-full`
|
|
11
|
+
* via `className` — `cx` is tailwind-merge-backed, so the override is
|
|
12
|
+
* deterministic.
|
|
13
|
+
*
|
|
14
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <CenteredLayout.Root>
|
|
19
|
+
* <SkipToMainLink />
|
|
20
|
+
* <CenteredLayout.Body>
|
|
21
|
+
* <a href="https://ngrok.com">
|
|
22
|
+
* <NgrokWordmarkIcon className="h-auto w-24" />
|
|
23
|
+
* </a>
|
|
24
|
+
* <Main>
|
|
25
|
+
* <SignInCard />
|
|
26
|
+
* </Main>
|
|
27
|
+
* </CenteredLayout.Body>
|
|
28
|
+
* <CenteredLayout.Footer>
|
|
29
|
+
* <ThemeSwitcher.Root>
|
|
30
|
+
* <ThemeSwitcher.Trigger />
|
|
31
|
+
* <ThemeSwitcher.Content />
|
|
32
|
+
* </ThemeSwitcher.Root>
|
|
33
|
+
* </CenteredLayout.Footer>
|
|
34
|
+
* </CenteredLayout.Root>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const Root: {
|
|
38
|
+
({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A full-window-width strip pinned above everything else in the layout —
|
|
43
|
+
* including `CenteredLayout.Header` — for impersonation notices, environment
|
|
44
|
+
* warnings, and similar app-wide messaging. Renders an unstyled `<div>`
|
|
45
|
+
* (`w-full shrink-0`): the notice content brings its own colors and layout,
|
|
46
|
+
* and the part collapses to nothing when empty, so it can stay mounted and
|
|
47
|
+
* conditionally render its contents. The same slot contract as the
|
|
48
|
+
* app-layout shell's notice strip, so an app-wide banner composes
|
|
49
|
+
* identically across mantle's layouts. Deliberately
|
|
50
|
+
* not named Banner — `CenteredLayout.Header` renders the page's `<header>`
|
|
51
|
+
* (the ARIA `banner` landmark), and this part is not that. Optional: omitting
|
|
52
|
+
* it is fine.
|
|
53
|
+
*
|
|
54
|
+
* On flows that scroll (checkout, plan pickers), the strip scrolls away with
|
|
55
|
+
* the page by default; merge `sticky top-0 z-20` via `className` to pin it to
|
|
56
|
+
* the window. To pin it alongside a sticky `Header`, wrap the two strips in
|
|
57
|
+
* a single `sticky top-0` container instead — two elements pinned at `top-0`
|
|
58
|
+
* overlap each other once the page scrolls.
|
|
59
|
+
*
|
|
60
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <CenteredLayout.Root>
|
|
65
|
+
* <CenteredLayout.Notice>
|
|
66
|
+
* {isImpersonating && <ImpersonationBanner />}
|
|
67
|
+
* </CenteredLayout.Notice>
|
|
68
|
+
* <CenteredLayout.Body>
|
|
69
|
+
* <Main>
|
|
70
|
+
* <SignInCard />
|
|
71
|
+
* </Main>
|
|
72
|
+
* </CenteredLayout.Body>
|
|
73
|
+
* </CenteredLayout.Root>
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare const Notice: {
|
|
77
|
+
({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
78
|
+
displayName: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A utility strip at the top of the layout — an account chip, a close/dismiss
|
|
82
|
+
* button, and similar page furniture for focused flows (checkout, plan
|
|
83
|
+
* pickers). Renders a semantic `<header>` (a page-level frame, so it is
|
|
84
|
+
* exposed as a `banner` landmark when not nested inside a sectioning element)
|
|
85
|
+
* with `flex shrink-0 items-center px-4 py-4`. It sits **outside** the
|
|
86
|
+
* centered `flex-1` region, mirroring `CenteredLayout.Footer`. Optional:
|
|
87
|
+
* omitting it is fine.
|
|
88
|
+
*
|
|
89
|
+
* To pin it to the window while the page scrolls (e.g. a close button that
|
|
90
|
+
* stays reachable), merge `sticky top-0 z-10` via `className` — prefer
|
|
91
|
+
* `sticky` over `fixed`, which removes the strip from flow and underlaps the
|
|
92
|
+
* content below it.
|
|
93
|
+
*
|
|
94
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <CenteredLayout.Root>
|
|
99
|
+
* <CenteredLayout.Header className="sticky top-0 z-10 justify-between">
|
|
100
|
+
* <AccountChip />
|
|
101
|
+
* <IconButton appearance="ghost" intent="neutral" type="button" label="Close" icon={<XIcon />} />
|
|
102
|
+
* </CenteredLayout.Header>
|
|
103
|
+
* <CenteredLayout.Body>
|
|
104
|
+
* <div className="w-full max-w-5xl">
|
|
105
|
+
* <PlanPicker />
|
|
106
|
+
* </div>
|
|
107
|
+
* </CenteredLayout.Body>
|
|
108
|
+
* </CenteredLayout.Root>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare const Header: {
|
|
112
|
+
({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"header"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
113
|
+
displayName: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The growing, centered region of the layout. Renders a `<div>` with
|
|
117
|
+
* `flex flex-1 flex-col items-center justify-center gap-6 py-4` so its
|
|
118
|
+
* children are centered in the space left over by `CenteredLayout.Header`
|
|
119
|
+
* and `CenteredLayout.Footer`. Content taller than the viewport top-flows
|
|
120
|
+
* and the page scrolls, because `Root` grows (`min-h-full`) instead of
|
|
121
|
+
* clipping.
|
|
122
|
+
*
|
|
123
|
+
* By convention the brand mark (a fully-styled logo/wordmark anchor) is the
|
|
124
|
+
* **first child** of `Body` — there is deliberately no `Logo` part because it
|
|
125
|
+
* would own nothing: vertical spacing comes from `Body`'s `gap-6`, and the
|
|
126
|
+
* mark arrives as already-styled JSX.
|
|
127
|
+
*
|
|
128
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <CenteredLayout.Root>
|
|
133
|
+
* <SkipToMainLink />
|
|
134
|
+
* <CenteredLayout.Body>
|
|
135
|
+
* <a href="https://ngrok.com">
|
|
136
|
+
* <NgrokWordmarkIcon className="h-auto w-24" />
|
|
137
|
+
* </a>
|
|
138
|
+
* <Main>
|
|
139
|
+
* <SignInCard />
|
|
140
|
+
* </Main>
|
|
141
|
+
* </CenteredLayout.Body>
|
|
142
|
+
* <CenteredLayout.Footer>
|
|
143
|
+
* <ThemeSwitcher.Root>
|
|
144
|
+
* <ThemeSwitcher.Trigger />
|
|
145
|
+
* <ThemeSwitcher.Content />
|
|
146
|
+
* </ThemeSwitcher.Root>
|
|
147
|
+
* </CenteredLayout.Footer>
|
|
148
|
+
* </CenteredLayout.Root>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
declare const Body: {
|
|
152
|
+
({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
153
|
+
displayName: string;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* A pinned utility strip at the bottom of the layout — a theme switcher,
|
|
157
|
+
* legal links, and similar page furniture. Renders a semantic `<footer>`
|
|
158
|
+
* (a page-level frame, so it is exposed as a `contentinfo` landmark — unlike
|
|
159
|
+
* `Card.Footer`'s generic div) with `flex shrink-0 items-center px-4 py-4`.
|
|
160
|
+
* It sits **outside** the centered `flex-1` region — which is exactly why
|
|
161
|
+
* `Body` exists as a separate part. Optional: omitting it is fine.
|
|
162
|
+
*
|
|
163
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* <CenteredLayout.Root>
|
|
168
|
+
* <SkipToMainLink />
|
|
169
|
+
* <CenteredLayout.Body>
|
|
170
|
+
* <a href="https://ngrok.com">
|
|
171
|
+
* <NgrokWordmarkIcon className="h-auto w-24" />
|
|
172
|
+
* </a>
|
|
173
|
+
* <Main>
|
|
174
|
+
* <SignInCard />
|
|
175
|
+
* </Main>
|
|
176
|
+
* </CenteredLayout.Body>
|
|
177
|
+
* <CenteredLayout.Footer>
|
|
178
|
+
* <ThemeSwitcher.Root>
|
|
179
|
+
* <ThemeSwitcher.Trigger />
|
|
180
|
+
* <ThemeSwitcher.Content />
|
|
181
|
+
* </ThemeSwitcher.Root>
|
|
182
|
+
* </CenteredLayout.Footer>
|
|
183
|
+
* </CenteredLayout.Root>
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare const Footer: {
|
|
187
|
+
({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"footer"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
188
|
+
displayName: string;
|
|
189
|
+
};
|
|
4
190
|
/**
|
|
5
191
|
* A viewport-filling centered page flow for sign-in, sign-up, onboarding,
|
|
6
192
|
* 404, checkout, and other focused full-page states. It owns structure only —
|
|
@@ -14,6 +200,7 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
|
14
200
|
* Composition:
|
|
15
201
|
* ```
|
|
16
202
|
* CenteredLayout.Root
|
|
203
|
+
* ├── CenteredLayout.Notice
|
|
17
204
|
* ├── CenteredLayout.Header
|
|
18
205
|
* ├── CenteredLayout.Body
|
|
19
206
|
* └── CenteredLayout.Footer
|
|
@@ -43,9 +230,9 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
|
43
230
|
declare const CenteredLayout: {
|
|
44
231
|
/**
|
|
45
232
|
* The outer frame of a centered page flow. Fills its nearest sized ancestor
|
|
46
|
-
* (`min-h-full`) and stacks `Header` (pinned top), `Body`
|
|
47
|
-
* and `Footer` (pinned bottom). Merge `h-full` via
|
|
48
|
-
* host requires an exact height.
|
|
233
|
+
* (`min-h-full`) and stacks `Notice` and `Header` (pinned top), `Body`
|
|
234
|
+
* (which grows), and `Footer` (pinned bottom). Merge `h-full` via
|
|
235
|
+
* `className` when the host requires an exact height.
|
|
49
236
|
*
|
|
50
237
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
51
238
|
*
|
|
@@ -70,7 +257,36 @@ declare const CenteredLayout: {
|
|
|
70
257
|
* </CenteredLayout.Root>
|
|
71
258
|
* ```
|
|
72
259
|
*/
|
|
73
|
-
readonly Root:
|
|
260
|
+
readonly Root: typeof Root;
|
|
261
|
+
/**
|
|
262
|
+
* A full-window-width strip pinned above everything else in the layout —
|
|
263
|
+
* including `Header` — for impersonation notices and environment warnings.
|
|
264
|
+
* Renders an unstyled `<div>` (`w-full shrink-0`): the notice content
|
|
265
|
+
* brings its own colors, and the part collapses to nothing when empty. The
|
|
266
|
+
* same slot contract as the app-layout shell's notice strip, so an
|
|
267
|
+
* app-wide banner composes identically across mantle's layouts. Merge
|
|
268
|
+
* `sticky top-0 z-20` via `className` to pin it while a long flow scrolls
|
|
269
|
+
* (to pin it alongside a sticky `Header`, wrap the two strips in a single
|
|
270
|
+
* `sticky top-0` container instead — two elements pinned at `top-0`
|
|
271
|
+
* overlap once the page scrolls). Optional — omitting it is fine.
|
|
272
|
+
*
|
|
273
|
+
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```tsx
|
|
277
|
+
* <CenteredLayout.Root>
|
|
278
|
+
* <CenteredLayout.Notice>
|
|
279
|
+
* {isImpersonating && <ImpersonationBanner />}
|
|
280
|
+
* </CenteredLayout.Notice>
|
|
281
|
+
* <CenteredLayout.Body>
|
|
282
|
+
* <Main>
|
|
283
|
+
* <SignInCard />
|
|
284
|
+
* </Main>
|
|
285
|
+
* </CenteredLayout.Body>
|
|
286
|
+
* </CenteredLayout.Root>
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
readonly Notice: typeof Notice;
|
|
74
290
|
/**
|
|
75
291
|
* A utility strip at the top of the layout (account chip, close button)
|
|
76
292
|
* rendered as a semantic `<header>` (`banner` landmark) outside the
|
|
@@ -95,7 +311,7 @@ declare const CenteredLayout: {
|
|
|
95
311
|
* </CenteredLayout.Root>
|
|
96
312
|
* ```
|
|
97
313
|
*/
|
|
98
|
-
readonly Header:
|
|
314
|
+
readonly Header: typeof Header;
|
|
99
315
|
/**
|
|
100
316
|
* The growing, centered region of the layout. By convention the brand mark
|
|
101
317
|
* (a fully-styled logo/wordmark anchor) is its **first child** — spacing
|
|
@@ -124,7 +340,7 @@ declare const CenteredLayout: {
|
|
|
124
340
|
* </CenteredLayout.Root>
|
|
125
341
|
* ```
|
|
126
342
|
*/
|
|
127
|
-
readonly Body:
|
|
343
|
+
readonly Body: typeof Body;
|
|
128
344
|
/**
|
|
129
345
|
* A pinned utility strip (theme switcher, legal links) rendered as a
|
|
130
346
|
* semantic `<footer>` (`contentinfo` landmark) outside the centered
|
|
@@ -153,7 +369,7 @@ declare const CenteredLayout: {
|
|
|
153
369
|
* </CenteredLayout.Root>
|
|
154
370
|
* ```
|
|
155
371
|
*/
|
|
156
|
-
readonly Footer:
|
|
372
|
+
readonly Footer: typeof Footer;
|
|
157
373
|
};
|
|
158
374
|
//#endregion
|
|
159
375
|
export { CenteredLayout };
|
package/dist/centered-layout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./slot-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./slot-CDk0Bb9z.js";import{jsx as r}from"react/jsx-runtime";const i=({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout`),className:e(`flex min-h-full flex-col`,o),...c,children:a});i.displayName=`CenteredLayout`;const a=({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout-notice`),className:e(`w-full shrink-0`,o),...c,children:a});a.displayName=`CenteredLayoutNotice`;const o=({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`header`,{"data-slot":t(s,`centered-layout-header`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a});o.displayName=`CenteredLayoutHeader`;const s=({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout-body`),className:e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,o),...c,children:a});s.displayName=`CenteredLayoutBody`;const c=({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`footer`,{"data-slot":t(s,`centered-layout-footer`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a});c.displayName=`CenteredLayoutFooter`;const l={Root:i,Notice:a,Header:o,Body:s,Footer:c};export{l as CenteredLayout};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./clsx-DUGZgXfJ.js";import{a as n,r}from"./validation-Bpptk_9t.js";import{useEffect as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";const c=e=>e===`indeterminate`,l=({"aria-invalid":l,className:u,checked:d,defaultChecked:f,defaultValue:p=`on`,onClick:m,readOnly:h,ref:g,validation:_,...v})=>{let y=a(null),[b]=o(f),x=n(),{ariaInvalid:S,validation:C}=r({"aria-invalid":l,validation:_??x}),w=d??b;i(()=>{y.current&&(y.current.indeterminate=c(w))},[w]);let T=d==null?{defaultChecked:c(b)?void 0:b}:{checked:!c(d)&&d};return s(`input`,{"aria-checked":c(d)?`mixed`:d,"aria-invalid":S,"data-slot":`checkbox`,className:t(`border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50`,`bg-center bg-no-repeat focus:outline-hidden`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`checked:border-accent-600 checked:bg-accent-600 checked:bg-checked-icon`,`indeterminate:border-accent-600 indeterminate:bg-accent-600 indeterminate:bg-indeterminate-icon`,`data-validation-success:border-success-600 data-validation-success:checked:bg-success-600 data-validation-success:indeterminate:bg-success-600 focus-visible:data-validation-success:border-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:checked:bg-warning-600 data-validation-warning:indeterminate:bg-warning-600 focus-visible:data-validation-warning:border-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:checked:bg-danger-600 data-validation-error:indeterminate:bg-danger-600 focus-visible:data-validation-error:border-danger-600 focus-visible:data-validation-error:ring-focus-danger`,`where:block where:size-4 where:p-0`,u),...T,"data-validation":C||void 0,defaultValue:p,onClick:e=>{if(h){e.preventDefault();return}m?.(e)},readOnly:h,ref:e(y,g),type:`checkbox`,...v})};function u({allSelected:e,someSelected:t}){return e?!0:t?`indeterminate`:!1}export{u as n,l as t};
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
2
3
|
//#region src/components/checkbox/checkbox.d.ts
|
|
3
4
|
type CheckedState = boolean | "indeterminate";
|
|
5
|
+
type Props = Omit<ComponentProps<"input">, "type" | "checked" | "defaultChecked"> & WithValidation & {
|
|
6
|
+
/**
|
|
7
|
+
* The controlled checked state of the checkbox. Must be used in conjunction with onChange.
|
|
8
|
+
*/
|
|
9
|
+
checked?: CheckedState;
|
|
10
|
+
/**
|
|
11
|
+
* The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
|
|
12
|
+
*/
|
|
13
|
+
defaultChecked?: CheckedState;
|
|
14
|
+
};
|
|
4
15
|
/**
|
|
5
16
|
* A form control that allows the user to toggle between checked and not checked.
|
|
6
17
|
* Supports indeterminate state.
|
|
@@ -21,16 +32,7 @@ type CheckedState = boolean | "indeterminate";
|
|
|
21
32
|
* </form>
|
|
22
33
|
* ```
|
|
23
34
|
*/
|
|
24
|
-
declare const Checkbox:
|
|
25
|
-
/**
|
|
26
|
-
* The controlled checked state of the checkbox. Must be used in conjunction with onChange.
|
|
27
|
-
*/
|
|
28
|
-
checked?: CheckedState;
|
|
29
|
-
/**
|
|
30
|
-
* The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
|
|
31
|
-
*/
|
|
32
|
-
defaultChecked?: CheckedState;
|
|
33
|
-
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
35
|
+
declare const Checkbox: ({ "aria-invalid": _ariaInvalid, className, checked: _checked, defaultChecked: _defaultChecked, defaultValue, onClick, readOnly, ref, validation: _validation, ...props }: Props) => import("react").JSX.Element;
|
|
34
36
|
/**
|
|
35
37
|
* Resolve the tri-state `checked` value for a "select all" checkbox from the
|
|
36
38
|
* current selection counts: `true` when everything is selected,
|
package/dist/checkbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./checkbox-
|
|
1
|
+
import{n as e,t}from"./checkbox-Cq17y0-R.js";export{t as Checkbox,e as selectAllChecked};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{t as n}from"./field-context-BR01g789.js";import{t as r}from"./label-D-D11mlp.js";import{cloneElement as i,createContext as a,isValidElement as o,useContext as s,useId as c,useMemo as l}from"react";import u from"tiny-invariant";import{jsx as d}from"react/jsx-runtime";const f=a(null);function p(e){let t=s(f);return u(t,`Choice.${e} must be rendered inside Choice.Root.`),t}const m=({"aria-describedby":t,"aria-errormessage":r,"aria-invalid":i,children:a,className:o,disabled:u=!1,id:p,name:m,ref:h,...g})=>{let _=s(n),v=_?.id,y=_?.name,b=_?.[`aria-describedby`],x=_?.[`aria-invalid`],S=_?.[`aria-errormessage`],C=c(),w=c(),T=v??p??C,E=[b??t,w].filter(Boolean).join(` `)||void 0,D=l(()=>({controlId:T,descriptionId:w,disabled:u,controlProps:{id:T,name:y??m,disabled:u,"aria-describedby":E,"aria-invalid":x??i,"aria-errormessage":S??r}}),[T,w,u,E,y,m,x,i,S,r]);return d(f.Provider,{value:D,children:d(`div`,{ref:h,"data-slot":`choice`,className:e(`flex w-full items-start gap-2`,o),...g,children:a})})};m.displayName=`Choice`;const h=({children:t,className:n,ref:r,...a})=>{let{controlProps:s}=p(`Indicator`),c=o(t)?i(t,{...s,disabled:s.disabled||t.props.disabled===!0,name:s.name??t.props.name,"aria-invalid":s[`aria-invalid`]??t.props[`aria-invalid`],"aria-errormessage":s[`aria-errormessage`]??t.props[`aria-errormessage`]}):t;return d(`span`,{ref:r,"data-slot":`choice-indicator`,className:e(`flex h-lh shrink-0 items-center text-sm`,n),...a,children:c})};h.displayName=`ChoiceIndicator`;const g=({asChild:n,className:r,ref:i,...a})=>d(n?t:`div`,{ref:i,"data-slot":`choice-content`,className:e(`flex min-w-0 flex-1 flex-col gap-0.5`,r),...a});g.displayName=`ChoiceContent`;const _=({className:t,ref:n,...i})=>{let{controlId:a,disabled:o}=p(`Label`);return d(r,{ref:n,"data-slot":`choice-label`,className:e(o&&`opacity-50`,t),...i,htmlFor:a,disabled:o})},v=({asChild:n,className:r,ref:i,...a})=>{let{disabled:o}=p(`Title`);return d(n?t:`p`,{ref:i,"data-slot":`choice-title`,className:e(`text-strong text-sm font-medium font-sans`,o&&`opacity-50`,r),...a})};v.displayName=`ChoiceTitle`;const y=({asChild:n,className:r,ref:i,...a})=>{let{descriptionId:o,disabled:s}=p(`Description`);return d(n?t:`p`,{ref:i,id:o,"data-slot":`choice-description`,className:e(`text-body text-sm leading-4`,s&&`opacity-50`,r),...a})};y.displayName=`ChoiceDescription`;const b={Root:m,Indicator:h,Content:g,Label:_,Title:v,Description:y};export{b as t};
|