@ngrok/mantle 0.77.0 → 0.78.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 +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +4 -1
- package/dist/alert-dialog.d.ts +19 -26
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +16 -24
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-AS5Ir3DE.js +1 -0
- package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
- package/dist/button.d.ts +5 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +9 -11
- package/dist/checkbox.js +1 -1
- package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
- package/dist/choice.d.ts +16 -14
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +5 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +60 -38
- package/dist/command.js +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +45 -131
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-uyJcNks7.js → dialog-DVDFVT_-.js} +1 -1
- package/dist/dialog.d.ts +155 -48
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +133 -53
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +24 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +13 -15
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +34 -14
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
- package/dist/index-BnI3OppC.d.ts +1 -0
- package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/{input-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
- package/dist/input.d.ts +10 -11
- package/dist/input.js +1 -1
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/{label-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +18 -60
- package/dist/list.js +1 -1
- package/dist/llms.txt +4 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +6 -7
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BuVqb6zf.js → primitive-wm7Wk-gy.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-Bxq_N-_o.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +160 -146
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +231 -47
- package/dist/sheet.js +1 -1
- package/dist/sizes-Dje_rwKc.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +20 -12
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +4 -5
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +45 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/{toast-CZBWjXcP.js → toast-RkhbliFh.js} +1 -1
- package/dist/toast.d.ts +13 -37
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +10 -44
- package/dist/tooltip.js +1 -1
- package/dist/{types-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/{virtual-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +17 -14
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/checkbox-Apow0ipK.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-C5XYi2-H.js +0 -1
- package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
package/dist/otp-input.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { o as WithValidation } from "./validation-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import { OTPInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
5
|
-
|
|
6
5
|
//#region src/components/otp-input/otp-input.d.ts
|
|
7
6
|
type OtpInputRootProps = Omit<ComponentProps<typeof OTPInput>, "render" | "children"> & WithValidation & {
|
|
8
7
|
children?: ReactNode;
|
|
@@ -32,7 +31,7 @@ type OtpInputSeparatorProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
32
31
|
* single hidden input (handling paste, autofill, and IME) with a row of
|
|
33
32
|
* styled character slots.
|
|
34
33
|
*
|
|
35
|
-
* @see https://mantle.ngrok.com/components/otp-input
|
|
34
|
+
* @see https://mantle.ngrok.com/components/forms/otp-input
|
|
36
35
|
*
|
|
37
36
|
* @example
|
|
38
37
|
* Composition:
|
|
@@ -68,7 +67,7 @@ declare const OtpInput: {
|
|
|
68
67
|
* keystrokes, paste, and autofill, and provides per-slot state to
|
|
69
68
|
* descendant `OtpInput.Slot` parts.
|
|
70
69
|
*
|
|
71
|
-
* @see https://mantle.ngrok.com/components/otp-input
|
|
70
|
+
* @see https://mantle.ngrok.com/components/forms/otp-input
|
|
72
71
|
*
|
|
73
72
|
* @example
|
|
74
73
|
* ```tsx
|
|
@@ -92,7 +91,7 @@ declare const OtpInput: {
|
|
|
92
91
|
* Groups one or more `OtpInput.Slot` parts into a visually-connected
|
|
93
92
|
* segment with shared rounded corners and joined borders.
|
|
94
93
|
*
|
|
95
|
-
* @see https://mantle.ngrok.com/components/otp-input
|
|
94
|
+
* @see https://mantle.ngrok.com/components/forms/otp-input
|
|
96
95
|
*
|
|
97
96
|
* @example
|
|
98
97
|
* ```tsx
|
|
@@ -117,7 +116,7 @@ declare const OtpInput: {
|
|
|
117
116
|
* Reads its character, active state, and fake caret position from the
|
|
118
117
|
* root via context.
|
|
119
118
|
*
|
|
120
|
-
* @see https://mantle.ngrok.com/components/otp-input
|
|
119
|
+
* @see https://mantle.ngrok.com/components/forms/otp-input
|
|
121
120
|
*
|
|
122
121
|
* @example
|
|
123
122
|
* ```tsx
|
|
@@ -141,7 +140,7 @@ declare const OtpInput: {
|
|
|
141
140
|
* A visual separator between two `OtpInput.Group` segments. Renders a
|
|
142
141
|
* minus icon by default; pass `children` to override.
|
|
143
142
|
*
|
|
144
|
-
* @see https://mantle.ngrok.com/components/otp-input
|
|
143
|
+
* @see https://mantle.ngrok.com/components/forms/otp-input
|
|
145
144
|
*
|
|
146
145
|
* @example
|
|
147
146
|
* ```tsx
|
package/dist/otp-input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{t as n}from"./types-D85fCNV3.js";import{a as r,r as i}from"./validation-Bpptk_9t.js";import{t as a}from"./field-context-BR01g789.js";import{forwardRef as o,useContext as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{MinusIcon as u}from"@phosphor-icons/react/Minus";import{OTPInput as d,OTPInputContext as f,REGEXP_ONLY_CHARS as p,REGEXP_ONLY_DIGITS as m,REGEXP_ONLY_DIGITS_AND_CHARS as h}from"input-otp";const g={error:`danger`,success:`success`,warning:`warning`},_=e=>`var(--color-${e}-600)`,v=e=>`var(--ring-color-focus-${e})`,y=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,b=({children:e,validation:t})=>{let r=s(f),i=r.slots.length,a=r.slots.reduce((e,t)=>e+ +!!t.isActive,0),o=y({totalActive:a,total:i}),l=t?g[t]:void 0,u=l?n({"--otp-validation-border":_(l),"--otp-validation-ring":v(l)}):void 0;return c(`div`,{className:`group/otp contents`,"data-otp-state":o,"data-validation":t||void 0,style:u,children:e})},x=o(({"aria-invalid":t,children:n,className:o,containerClassName:l,validation:u,...f},p)=>{let m=r(),h=s(a),{ariaInvalid:g,validation:_}=i({"aria-invalid":t,defaultAriaInvalid:!1,validation:u??m});return c(d,{ref:p,"aria-invalid":g,"data-slot":`otp-input`,containerClassName:e(`flex items-center gap-2 has-disabled:opacity-50`,l),className:e(`disabled:cursor-not-allowed`,o),...f,...h?{"aria-describedby":h[`aria-describedby`],"aria-errormessage":h[`aria-errormessage`],id:h.id,name:h.name}:void 0,children:c(b,{validation:_,children:n})})});x.displayName=`OtpInput`;const S=o(({asChild:n,children:r,className:i,...a},o)=>c(n?t:`div`,{ref:o,"data-slot":`otp-input-group`,className:e(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,i),...a,children:r}));S.displayName=`OtpInputGroup`;const C=o(({className:t,index:n,...r},i)=>{let a=s(f).slots[n],o=a?.char??null,u=a?.hasFakeCaret??!1;return l(`div`,{ref:i,"data-slot":`otp-input-slot`,"data-active":a?.isActive??!1?``:void 0,className:e(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...r,children:[o,u&&c(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:c(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})});C.displayName=`OtpInputSlot`;const w=o(({asChild:n,children:r,className:i,semantic:a=!1,...o},s)=>{let l=n?t:`div`,d=a?{role:`separator`}:{"aria-hidden":!0,role:`none`};return c(l,{ref:s,"data-slot":`otp-input-separator`,className:e(`text-separator flex items-center`,i),...d,...o,children:r??c(u,{weight:`bold`})})});w.displayName=`OtpInputSeparator`;const T={Root:x,Group:S,Slot:C,Separator:w};export{T as OtpInput,p as REGEXP_ONLY_CHARS,m as REGEXP_ONLY_DIGITS,h as REGEXP_ONLY_DIGITS_AND_CHARS};
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as ButtonGroup } from "./index-
|
|
3
|
-
import { t as Select } from "./select-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { t as ButtonGroup } from "./index-CDwfBOAA.js";
|
|
3
|
+
import { t as Select } from "./select-Bwt2YduR.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/components/pagination/cursor-pagination.d.ts
|
|
7
6
|
type CursorPaginationProps = ComponentProps<"div"> & {
|
|
8
7
|
/**
|
|
@@ -43,7 +42,7 @@ type CursorPageSizeValueProps = Omit<ComponentProps<"span">, "children"> & WithA
|
|
|
43
42
|
/**
|
|
44
43
|
* Displays the current page size when using cursor-based pagination as a read-only value.
|
|
45
44
|
*
|
|
46
|
-
* @see https://mantle.ngrok.com/components/pagination#cursorpaginationpagesizevalue
|
|
45
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination#cursorpaginationpagesizevalue
|
|
47
46
|
*
|
|
48
47
|
* @example
|
|
49
48
|
* ```tsx
|
|
@@ -53,14 +52,7 @@ type CursorPageSizeValueProps = Omit<ComponentProps<"span">, "children"> & WithA
|
|
|
53
52
|
* </div>
|
|
54
53
|
* ```
|
|
55
54
|
*/
|
|
56
|
-
declare function PageSizeValue({
|
|
57
|
-
asChild,
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: CursorPageSizeValueProps): import("react").JSX.Element;
|
|
61
|
-
declare namespace PageSizeValue {
|
|
62
|
-
var displayName: string;
|
|
63
|
-
}
|
|
55
|
+
declare function PageSizeValue({ asChild, className, ...props }: CursorPageSizeValueProps): import("react").JSX.Element;
|
|
64
56
|
/**
|
|
65
57
|
* A pagination component for use with cursor-based pagination.
|
|
66
58
|
*
|
|
@@ -70,7 +62,7 @@ declare namespace PageSizeValue {
|
|
|
70
62
|
* of data. It doesn't let you jump to a specific page or know how many total pages
|
|
71
63
|
* there are, but it's more efficient for large or real-time data sets.
|
|
72
64
|
*
|
|
73
|
-
* @see https://mantle.ngrok.com/components/pagination
|
|
65
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination
|
|
74
66
|
*
|
|
75
67
|
* @example
|
|
76
68
|
* Composition:
|
|
@@ -98,7 +90,7 @@ declare const CursorPagination: {
|
|
|
98
90
|
/**
|
|
99
91
|
* The root container of the cursor pagination component.
|
|
100
92
|
*
|
|
101
|
-
* @see https://mantle.ngrok.com/components/pagination#cursorpaginationroot
|
|
93
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination#cursorpaginationroot
|
|
102
94
|
*
|
|
103
95
|
* @example
|
|
104
96
|
* ```tsx
|
|
@@ -117,7 +109,7 @@ declare const CursorPagination: {
|
|
|
117
109
|
/**
|
|
118
110
|
* A pair of buttons for navigating between pages of data when using cursor-based pagination.
|
|
119
111
|
*
|
|
120
|
-
* @see https://mantle.ngrok.com/components/pagination#cursorpaginationbuttons
|
|
112
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination#cursorpaginationbuttons
|
|
121
113
|
*
|
|
122
114
|
* @example
|
|
123
115
|
* ```tsx
|
|
@@ -133,7 +125,7 @@ declare const CursorPagination: {
|
|
|
133
125
|
/**
|
|
134
126
|
* A select input for changing the number of items per page when using cursor-based pagination.
|
|
135
127
|
*
|
|
136
|
-
* @see https://mantle.ngrok.com/components/pagination#cursorpaginationpagesizeselect
|
|
128
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination#cursorpaginationpagesizeselect
|
|
137
129
|
*
|
|
138
130
|
* @example
|
|
139
131
|
* ```tsx
|
|
@@ -147,7 +139,7 @@ declare const CursorPagination: {
|
|
|
147
139
|
/**
|
|
148
140
|
* Displays the current page size when using cursor-based pagination as a read-only value.
|
|
149
141
|
*
|
|
150
|
-
* @see https://mantle.ngrok.com/components/pagination#cursorpaginationpagesizevalue
|
|
142
|
+
* @see https://mantle.ngrok.com/components/navigation/pagination#cursorpaginationpagesizevalue
|
|
151
143
|
*
|
|
152
144
|
* @example
|
|
153
145
|
* ```tsx
|
|
@@ -244,10 +236,7 @@ type OffsetPaginationState = {
|
|
|
244
236
|
* );
|
|
245
237
|
* ```
|
|
246
238
|
*/
|
|
247
|
-
declare function useOffsetPagination({
|
|
248
|
-
listSize,
|
|
249
|
-
pageSize
|
|
250
|
-
}: UseOffsetPaginationProps): OffsetPaginationState;
|
|
239
|
+
declare function useOffsetPagination({ listSize, pageSize }: UseOffsetPaginationProps): OffsetPaginationState;
|
|
251
240
|
/**
|
|
252
241
|
* Get a paginated slice of a list based on the current offset pagination state.
|
|
253
242
|
*
|
package/dist/pagination.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{t as n}from"./icon-button-CxVsZ2N1.js";import{t as r}from"./button-5t6-JS_I.js";import{n as i}from"./separator-kBnnv3Cw.js";import{t as a}from"./select-D-5u0Blc.js";import{createContext as o,forwardRef as s,useContext as c,useEffect as l,useMemo as u,useState as d}from"react";import f from"tiny-invariant";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{CaretRightIcon as h}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as g}from"@phosphor-icons/react/CaretLeft";const _=o(void 0),v=s(({className:t,children:n,defaultPageSize:r,...i},a)=>{let[o,s]=d(r),c=u(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return p(_.Provider,{value:c,children:p(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:a,...i,children:n})})});v.displayName=`CursorPagination`;const y=s(({hasNextPage:e,hasPreviousPage:t,onNextPage:a,onPreviousPage:o,...s},c)=>m(r,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:c,...s,children:[p(n,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!t,icon:p(g,{}),label:`Previous page`,onClick:o,size:`sm`,type:`button`}),p(i,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),p(n,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:p(h,{}),label:`Next page`,onClick:a,size:`sm`,type:`button`})]}));y.displayName=`CursorButtons`;const b=[5,10,20,50,100],x=s(({className:t,pageSizes:n=b,onChangePageSize:r,...i},o)=>{let s=c(_);return f(s,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),f(n.includes(s.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),f(n.includes(s.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),m(a.Root,{defaultValue:`${s.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=s.defaultPageSize),s.setPageSize(t),r?.(t)},children:[p(a.Trigger,{ref:o,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:s.pageSize,...i,children:p(a.Value,{})}),p(a.Content,{width:`trigger`,children:n.map(e=>m(a.Item,{value:`${e}`,children:[e,` per page`]},e))})]})});x.displayName=`CursorPageSizeSelect`;function S({asChild:n=!1,className:r,...i}){let a=c(_);return f(a,`CursorPageSizeValue must be used as a child of a CursorPagination component`),m(n?t:`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,r),...i,children:[a.pageSize,` per page`]})}S.displayName=`CursorPageSizeValue`;const C={Root:v,Buttons:y,PageSizeSelect:x,PageSizeValue:S};function w({listSize:e,pageSize:t}){let[n,r]=d(1),[i,a]=d(t);l(()=>{a(t),r(1)},[t]),l(()=>{r(1)},[e]);let o=Math.ceil(e/i),s=(n-1)*i,c=n>1,u=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){u&&r(e=>Math.min(e+1,o))}function m(){c&&r(e=>Math.max(e-1,1))}function h(e){a(e),r(1)}function g(){r(o)}function _(){r(1)}return{currentPage:n,goToFirstPage:_,goToLastPage:g,goToPage:f,hasNextPage:u,hasPreviousPage:c,nextPage:p,offset:s,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function T(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{C as CursorPagination,T as getOffsetPaginatedSlice,w as useOffsetPagination};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import*as r from"@radix-ui/react-popover";const i=r.Root;i.displayName=`Popover`;const a=r.Trigger;a.displayName=`PopoverTrigger`;const o=r.Anchor;o.displayName=`PopoverAnchor`;const s=r.Close;s.displayName=`PopoverClose`;const c=t(({align:t=`center`,className:i,onClick:a,preferredWidth:o=`max-w-72`,sideOffset:s=4,...c},l)=>n(r.Portal,{children:n(r.Content,{align:t,"data-slot":`popover-content`,className:e(`text-popover-foreground border-popover bg-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 z-50 rounded-md border p-4 shadow-md outline-hidden`,o,i),onClick:e=>{e.stopPropagation(),a?.(e)},ref:l,sideOffset:s,...c})}));c.displayName=`PopoverContent`;const l={Root:i,Anchor:o,Close:s,Content:c,Trigger:a};export{l as t};
|
package/dist/popover.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
-
|
|
3
2
|
//#region src/components/popover/popover.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A floating overlay that displays rich content in a portal, triggered by a button.
|
|
@@ -21,7 +20,7 @@ import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
|
21
20
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
22
21
|
* layer renders on top.
|
|
23
22
|
*
|
|
24
|
-
* @see https://mantle.ngrok.com/components/popover
|
|
23
|
+
* @see https://mantle.ngrok.com/components/overlays/popover
|
|
25
24
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
26
25
|
*
|
|
27
26
|
* @example
|
|
@@ -56,7 +55,7 @@ declare const Popover: {
|
|
|
56
55
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
57
56
|
* layer renders on top.
|
|
58
57
|
*
|
|
59
|
-
* @see https://mantle.ngrok.com/components/popover#popoverroot
|
|
58
|
+
* @see https://mantle.ngrok.com/components/overlays/popover#popoverroot
|
|
60
59
|
*
|
|
61
60
|
* @example
|
|
62
61
|
* ```tsx
|
|
@@ -74,7 +73,7 @@ declare const Popover: {
|
|
|
74
73
|
/**
|
|
75
74
|
* An optional element to position the PopoverContent against. If not used, content positions alongside the trigger.
|
|
76
75
|
*
|
|
77
|
-
* @see https://mantle.ngrok.com/components/popover#popoveranchor
|
|
76
|
+
* @see https://mantle.ngrok.com/components/overlays/popover#popoveranchor
|
|
78
77
|
*
|
|
79
78
|
* @example
|
|
80
79
|
* ```tsx
|
|
@@ -98,7 +97,7 @@ declare const Popover: {
|
|
|
98
97
|
/**
|
|
99
98
|
* A button that closes an open popover. Can be placed anywhere within the popover content.
|
|
100
99
|
*
|
|
101
|
-
* @see https://mantle.ngrok.com/components/popover#popoverclose
|
|
100
|
+
* @see https://mantle.ngrok.com/components/overlays/popover#popoverclose
|
|
102
101
|
*
|
|
103
102
|
* @example
|
|
104
103
|
* ```tsx
|
|
@@ -126,7 +125,7 @@ declare const Popover: {
|
|
|
126
125
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
127
126
|
* layer renders on top.
|
|
128
127
|
*
|
|
129
|
-
* @see https://mantle.ngrok.com/components/popover#popovercontent
|
|
128
|
+
* @see https://mantle.ngrok.com/components/overlays/popover#popovercontent
|
|
130
129
|
*
|
|
131
130
|
* @example
|
|
132
131
|
* ```tsx
|
|
@@ -158,7 +157,7 @@ declare const Popover: {
|
|
|
158
157
|
/**
|
|
159
158
|
* The trigger button that opens the popover when clicked or focused.
|
|
160
159
|
*
|
|
161
|
-
* @see https://mantle.ngrok.com/components/popover#popovertrigger
|
|
160
|
+
* @see https://mantle.ngrok.com/components/overlays/popover#popovertrigger
|
|
162
161
|
*
|
|
163
162
|
* @example
|
|
164
163
|
* ```tsx
|
package/dist/popover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./popover-
|
|
1
|
+
import{t as e}from"./popover-D5WxxnBY.js";export{e as Popover};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
|
|
4
3
|
//#region src/components/dialog/primitive.d.ts
|
|
5
4
|
declare function Root(props: ComponentPropsWithoutRef<typeof DialogPrimitive.Root>): import("react").JSX.Element;
|
|
6
5
|
declare namespace Root {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./slot-
|
|
1
|
+
import{t as e}from"./slot-DmPrjM7N.js";import{t}from"./booleanish-BfvnW6vy.js";import{i as n}from"./toast-RkhbliFh.js";import{createContext as r,forwardRef as i,useContext as a,useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import*as u from"@radix-ui/react-dialog";const d=r({hasDescription:!1,setHasDescription:()=>{}});function f(e){let[t,n]=c(!1),r=s(()=>({hasDescription:t,setHasDescription:n}),[t]);return l(d.Provider,{value:r,children:l(u.Root,{...e})})}f.displayName=`DialogPrimitiveRoot`;const p=u.Trigger;p.displayName=`DialogPrimitiveTrigger`;const m=u.Portal;m.displayName=`DialogPrimitivePortal`;const h=u.Close;h.displayName=`DialogPrimitiveClose`;const g=i((e,t)=>l(u.Overlay,{"data-overlay":!0,ref:t,...e}));g.displayName=`DialogPrimitiveOverlay`;const _=i(({onEscapeKeyDown:e,onInteractOutside:t,onPointerDownOutside:r,...i},o)=>{let s=a(d);return l(u.Content,{ref:o,onEscapeKeyDown:t=>{x(t),e?.(t)},onInteractOutside:e=>{n(e),t?.(e)},onPointerDownOutside:e=>{n(e),r?.(e)},...s.hasDescription?{}:{"aria-describedby":void 0},...i})});_.displayName=`DialogPrimitiveContent`;const v=u.Title,y=i(({asChild:t,children:n,...r},i)=>{let s=a(d);o(()=>(s.setHasDescription(!0),()=>s.setHasDescription(!1)),[s]);let c=t?e:`div`;return l(u.Description,{ref:i,asChild:!0,children:l(c,{...r,children:n})})});y.displayName=`DialogPrimitiveDescription`;function b(e){return e instanceof HTMLElement&&e.hasAttribute(`data-overlay`)}function x(e){if(!T(e.currentTarget))return;let n=e.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=S(e.target)??S(r),a=i?C(i):null;i!=null&&t(i.getAttribute(`aria-expanded`))&&a!=null&&n.contains(i)&&n.contains(a)&&(a.getAttribute(`data-open`)===`true`||a.getAttribute(`data-state`)===`open`)&&e.preventDefault()}function S(e){return w(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function C(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function w(e){return e instanceof HTMLElement}function T(e){return e instanceof Node&&`querySelector`in e}export{m as a,p as c,g as i,b as l,_ as n,f as o,y as r,v as s,h as t};
|
package/dist/progress.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
-
|
|
4
3
|
//#region src/components/progress/types.d.ts
|
|
5
4
|
type ValueType = number | "indeterminate";
|
|
6
5
|
//#endregion
|
|
@@ -44,14 +43,57 @@ type Props = SvgAttributes & {
|
|
|
44
43
|
*/
|
|
45
44
|
indeterminateRotationSpeed?: `animation-duration-${string}`;
|
|
46
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* A simple circular progress bar which shows the completion progress of a task.
|
|
48
|
+
*
|
|
49
|
+
* The indicator color is inherited via `currentColor`. Override the default
|
|
50
|
+
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
51
|
+
*
|
|
52
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <ProgressDonut.Root value={60}>
|
|
57
|
+
* <ProgressDonut.Indicator />
|
|
58
|
+
* </ProgressDonut.Root>
|
|
59
|
+
*
|
|
60
|
+
* <ProgressDonut.Root value={60}>
|
|
61
|
+
* <ProgressDonut.Indicator color="text-danger-600" />
|
|
62
|
+
* </ProgressDonut.Root>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const Root$1: {
|
|
66
|
+
({ children, className, max: _max, strokeWidth: _strokeWidth, value: _value, indeterminateRotationSpeed, ...props }: Props): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
47
69
|
type ProgressDonutIndicatorProps = Omit<ComponentProps<"g">, "children">;
|
|
70
|
+
/**
|
|
71
|
+
* The indicator for the circular progress bar.
|
|
72
|
+
*
|
|
73
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-indicator
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* <ProgressDonut.Root value={60}>
|
|
78
|
+
* <ProgressDonut.Indicator />
|
|
79
|
+
* </ProgressDonut.Root>
|
|
80
|
+
*
|
|
81
|
+
* <ProgressDonut.Root value={60}>
|
|
82
|
+
* <ProgressDonut.Indicator color="text-danger-600" />
|
|
83
|
+
* </ProgressDonut.Root>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
declare const Indicator$1: {
|
|
87
|
+
({ className, ...props }: ProgressDonutIndicatorProps): import("react").JSX.Element;
|
|
88
|
+
displayName: string;
|
|
89
|
+
};
|
|
48
90
|
/**
|
|
49
91
|
* A simple circular progress bar which shows the completion progress of a task.
|
|
50
92
|
*
|
|
51
93
|
* The indicator color is inherited via `currentColor`. Override the default
|
|
52
94
|
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
53
95
|
*
|
|
54
|
-
* @see https://mantle.ngrok.com/components/progress
|
|
96
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut
|
|
55
97
|
*
|
|
56
98
|
* @example
|
|
57
99
|
* Composition:
|
|
@@ -78,7 +120,7 @@ declare const ProgressDonut: {
|
|
|
78
120
|
* The indicator color is inherited via `currentColor`. Override the default
|
|
79
121
|
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
80
122
|
*
|
|
81
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-donut-root
|
|
123
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-root
|
|
82
124
|
*
|
|
83
125
|
* @example
|
|
84
126
|
* ```tsx
|
|
@@ -91,22 +133,11 @@ declare const ProgressDonut: {
|
|
|
91
133
|
* </ProgressDonut.Root>
|
|
92
134
|
* ```
|
|
93
135
|
*/
|
|
94
|
-
readonly Root:
|
|
95
|
-
({
|
|
96
|
-
children,
|
|
97
|
-
className,
|
|
98
|
-
max: _max,
|
|
99
|
-
strokeWidth: _strokeWidth,
|
|
100
|
-
value: _value,
|
|
101
|
-
indeterminateRotationSpeed,
|
|
102
|
-
...props
|
|
103
|
-
}: Props): import("react").JSX.Element;
|
|
104
|
-
displayName: string;
|
|
105
|
-
};
|
|
136
|
+
readonly Root: typeof Root$1;
|
|
106
137
|
/**
|
|
107
138
|
* The indicator for the circular progress bar.
|
|
108
139
|
*
|
|
109
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-donut-indicator
|
|
140
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-indicator
|
|
110
141
|
*
|
|
111
142
|
* @example
|
|
112
143
|
* ```tsx
|
|
@@ -119,13 +150,7 @@ declare const ProgressDonut: {
|
|
|
119
150
|
* </ProgressDonut.Root>
|
|
120
151
|
* ```
|
|
121
152
|
*/
|
|
122
|
-
readonly Indicator:
|
|
123
|
-
({
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: ProgressDonutIndicatorProps): import("react").JSX.Element;
|
|
127
|
-
displayName: string;
|
|
128
|
-
};
|
|
153
|
+
readonly Indicator: typeof Indicator$1;
|
|
129
154
|
};
|
|
130
155
|
//#endregion
|
|
131
156
|
//#region src/components/progress/progress-bar.d.ts
|
|
@@ -154,7 +179,7 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
154
179
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
155
180
|
* Use this component for linear progress indication.
|
|
156
181
|
*
|
|
157
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar
|
|
182
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar
|
|
158
183
|
*
|
|
159
184
|
* @example
|
|
160
185
|
* ```tsx
|
|
@@ -172,16 +197,7 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
172
197
|
* </ProgressBar.Root>
|
|
173
198
|
* ```
|
|
174
199
|
*/
|
|
175
|
-
declare function Root({
|
|
176
|
-
className,
|
|
177
|
-
children,
|
|
178
|
-
max: _max,
|
|
179
|
-
value: _value,
|
|
180
|
-
...props
|
|
181
|
-
}: RootProps): import("react").JSX.Element;
|
|
182
|
-
declare namespace Root {
|
|
183
|
-
var displayName: string;
|
|
184
|
-
}
|
|
200
|
+
declare function Root({ className, children, max: _max, value: _value, ...props }: RootProps): import("react").JSX.Element;
|
|
185
201
|
type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
186
202
|
/**
|
|
187
203
|
* Displays the progress indicator, which visually represents the completion progress of a task.
|
|
@@ -189,7 +205,7 @@ type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
|
189
205
|
* The visual indicator that shows the actual progress within the progress bar.
|
|
190
206
|
* This component should be used inside a ProgressBar.Root component.
|
|
191
207
|
*
|
|
192
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar-indicator
|
|
208
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar-indicator
|
|
193
209
|
*
|
|
194
210
|
* @example
|
|
195
211
|
* ```tsx
|
|
@@ -203,21 +219,14 @@ type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
|
203
219
|
* </ProgressBar.Root>
|
|
204
220
|
* ```
|
|
205
221
|
*/
|
|
206
|
-
declare function Indicator({
|
|
207
|
-
className,
|
|
208
|
-
style,
|
|
209
|
-
...props
|
|
210
|
-
}: IndicatorProps): import("react").JSX.Element;
|
|
211
|
-
declare namespace Indicator {
|
|
212
|
-
var displayName: string;
|
|
213
|
-
}
|
|
222
|
+
declare function Indicator({ className, style, ...props }: IndicatorProps): import("react").JSX.Element;
|
|
214
223
|
/**
|
|
215
224
|
* Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
|
|
216
225
|
*
|
|
217
226
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
218
227
|
* Use this component for linear progress indication.
|
|
219
228
|
*
|
|
220
|
-
* @see https://mantle.ngrok.com/components/progress
|
|
229
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar
|
|
221
230
|
*
|
|
222
231
|
* @example
|
|
223
232
|
* Composition:
|
|
@@ -249,7 +258,7 @@ declare const ProgressBar: {
|
|
|
249
258
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
250
259
|
* Use this component for linear progress indication.
|
|
251
260
|
*
|
|
252
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar
|
|
261
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar
|
|
253
262
|
*
|
|
254
263
|
* @example
|
|
255
264
|
* ```tsx
|
|
@@ -274,7 +283,7 @@ declare const ProgressBar: {
|
|
|
274
283
|
* The visual indicator that shows the actual progress within the progress bar.
|
|
275
284
|
* This component should be used inside a ProgressBar.Root component.
|
|
276
285
|
*
|
|
277
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar-indicator
|
|
286
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar-indicator
|
|
278
287
|
*
|
|
279
288
|
* @example
|
|
280
289
|
* ```tsx
|
package/dist/progress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./types-D85fCNV3.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{createContext as r,useContext as i,useId as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@radix-ui/react-progress";function u(e,{min:t,max:n}){return Math.min(n,Math.max(t,e))}function d(e){return typeof e==`number`}function f(e,t){return d(e)&&!Number.isNaN(e)&&e<=t&&e>=0}function p(e){return d(e)&&!Number.isNaN(e)&&e>0}const m={max:100,strokeWidth:`0.25rem`,value:0},h=r(m),g=({children:n,className:r,max:i=100,strokeWidth:a=4,value:l,indeterminateRotationSpeed:u,...g})=>{let _=p(i)?i:100,v=f(l,_)?l:l==null?0:`indeterminate`,x=y(a??m.strokeWidth),S=d(v)?v:void 0,C=b(x),w=o(()=>({max:_,strokeWidth:x,value:v}),[_,x,v]);return s(h.Provider,{value:w,children:c(`svg`,{"data-slot":`progress-donut`,"aria-valuemax":_,"aria-valuemin":0,"aria-valuenow":S,className:e(`size-6 text-gray-200 dark:text-gray-300`,v===`indeterminate`&&[`animate-spin`,u??`animation-duration-[15s]`],r),"data-max":_,"data-min":0,"data-value":S,height:`100%`,role:`progressbar`,width:`100%`,...g,children:[s(`circle`,{className:`[r:var(--radius)]`,cx:`50%`,cy:`50%`,fill:`transparent`,stroke:`currentColor`,strokeWidth:x,style:t({"--radius":C})}),n]})})};g.displayName=`ProgressDonut`;const _=({className:r,...o})=>{let l=a(),u=i(h)??m,d=(u.value===`indeterminate`?.6:u.value/u.max)*100,f=y(u.strokeWidth),p=b(f);return c(`g`,{"data-slot":`progress-donut-indicator`,className:e(`text-accent-600`,r),...o,children:[u.value===`indeterminate`&&s(`defs`,{children:c(`linearGradient`,{id:l,children:[s(`stop`,{className:`stop-opacity-100 stop-color-current`,offset:`0%`}),s(`stop`,{className:`stop-opacity-0 stop-color-current`,offset:`95%`})]})}),s(`circle`,{className:n(`[r:var(--radius)]`,`origin-center`),cx:`50%`,cy:`50%`,fill:`transparent`,pathLength:100,stroke:u.value===`indeterminate`?`url(#${l})`:`currentColor`,strokeDasharray:100,strokeDashoffset:100-d,strokeLinecap:`round`,strokeWidth:f,style:t({"--radius":p}),transform:`rotate(-90)`})]})};_.displayName=`ProgressDonutIndicator`;const v={Root:g,Indicator:_};function y(e){let t=4;return e==null?t:(t=typeof e==`number`?e:e.endsWith(`rem`)?Number(e.replace(`rem`,``))*16:Number(e),u(Number.isNaN(t)?4:t,{min:1,max:12}))}function b(e){return`calc(50% - ${e/2}px)`}const x=r({max:100,value:0});function S({className:t,children:n,max:r=100,value:i,...a}){let c=p(r)?r:100,u=f(i,c)?i:i==null?0:`indeterminate`,m=d(u)?u:void 0,h=o(()=>({max:c,value:u}),[c,u]);return s(x.Provider,{value:h,children:s(l.Root,{"data-slot":`progress-bar`,className:e(`bg-base-hover dark:bg-base shadow-inner relative h-3 w-full overflow-hidden rounded-md`,t),value:m,max:c,...a,children:n})})}S.displayName=`Root`;function C({className:t,style:n,...r}){let a=i(x),{max:o}=a,c=(o-(a.value===`indeterminate`?0:a.value))/o*100;return s(l.Indicator,{"data-slot":`progress-bar-indicator`,className:e(`bg-accent-600 h-full w-full flex-1 transition-all`,t),style:{...n,transform:`translateX(-${c}%)`},...r})}C.displayName=`Indicator`;const w={Root:S,Indicator:C};export{w as ProgressBar,v as ProgressDonut};
|
package/dist/qr-code.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/qr-code/qr-code.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* QR error correction level — the share of the code that can be damaged or
|
|
@@ -13,12 +12,14 @@ type QrCodeErrorCorrection = "L" | "M" | "Q" | "H";
|
|
|
13
12
|
* value for child parts.
|
|
14
13
|
*/
|
|
15
14
|
type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
16
|
-
/** The string to encode (e.g. a URL or `otpauth://` MFA URI). */
|
|
15
|
+
/** The string to encode (e.g. a URL or `otpauth://` MFA URI). */
|
|
16
|
+
value: string;
|
|
17
17
|
/**
|
|
18
18
|
* The error correction level. Defaults to `"L"`. Use `"H"` when an
|
|
19
19
|
* `Overlay` covers center modules so the code stays scannable.
|
|
20
20
|
*/
|
|
21
|
-
ecc?: QrCodeErrorCorrection;
|
|
21
|
+
ecc?: QrCodeErrorCorrection;
|
|
22
|
+
/** The pixel size of each module, affecting internal resolution. */
|
|
22
23
|
pixelSize?: number;
|
|
23
24
|
/**
|
|
24
25
|
* Width of the quiet zone — the light-module margin baked into the encoded
|
|
@@ -52,7 +53,7 @@ type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
|
52
53
|
* `Root` and `Overlay` support the `asChild` prop for polymorphic composition.
|
|
53
54
|
* `Frame` and `Pattern` render fixed SVG elements and do not.
|
|
54
55
|
*
|
|
55
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
56
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* Composition:
|
|
@@ -80,7 +81,7 @@ declare const QrCode: {
|
|
|
80
81
|
* The root container of a QR code. Encodes `value` and renders a positioned
|
|
81
82
|
* white tile. Set `ecc` (e.g. `"H"` when using an `Overlay`).
|
|
82
83
|
*
|
|
83
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
84
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
84
85
|
*
|
|
85
86
|
* @example
|
|
86
87
|
* ```tsx
|
|
@@ -99,7 +100,7 @@ declare const QrCode: {
|
|
|
99
100
|
* The `svg` frame that holds the QR `Pattern`. Defaults to `size-48`; resize
|
|
100
101
|
* the whole code by passing a different size to `className`.
|
|
101
102
|
*
|
|
102
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
103
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
103
104
|
*
|
|
104
105
|
* @example
|
|
105
106
|
* ```tsx
|
|
@@ -118,7 +119,7 @@ declare const QrCode: {
|
|
|
118
119
|
* The encoded QR modules, rendered as a `path` inside the `Frame`. Defaults
|
|
119
120
|
* to black fill so the code stays scannable in every theme.
|
|
120
121
|
*
|
|
121
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
122
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
122
123
|
*
|
|
123
124
|
* @example
|
|
124
125
|
* ```tsx
|
|
@@ -138,7 +139,7 @@ declare const QrCode: {
|
|
|
138
139
|
* Renders a white rounded "punch-out" so the logo stays legible. Use a higher
|
|
139
140
|
* `ecc` on the `Root` when an overlay is present.
|
|
140
141
|
*
|
|
141
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
142
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
142
143
|
*
|
|
143
144
|
* @example
|
|
144
145
|
* ```tsx
|
package/dist/qr-code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{createContext as n,forwardRef as r,useContext as i,useMemo as a}from"react";import o from"tiny-invariant";import{jsx as s}from"react/jsx-runtime";import{encode as c}from"uqr";const l=n(null);function u(e,t){o(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),o(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function d(){let e=i(l);return o(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function f(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const p=r(({value:n,ecc:r=`L`,pixelSize:i=10,quietZone:o=4,asChild:d,className:p,children:m,...h},g)=>{u(i,o);let _=a(()=>c(n,{ecc:r,border:o}),[n,r,o]),v=a(()=>f(_.data,i),[_,i]),y=a(()=>({path:v,dimension:_.size*i}),[v,_.size,i]),b=d?t:`div`;return s(l.Provider,{value:y,children:s(b,{ref:g,...h,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})});p.displayName=`QrCode`;const m=r(({className:t,children:n,...r},i)=>{let{dimension:a}=d();return s(`svg`,{ref:i,...r,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${a}`,shapeRendering:`crispEdges`,className:e(`block size-48`,t),children:n})});m.displayName=`QrCodeFrame`;const h=r(({className:t,...n},r)=>{let{path:i}=d();return s(`path`,{ref:r,...n,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})});h.displayName=`QrCodePattern`;const g=r(({asChild:n,className:r,...i},a)=>s(n?t:`div`,{ref:a,...i,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)}));g.displayName=`QrCodeOverlay`;const _={Root:p,Frame:m,Pattern:h,Overlay:g};export{_ as QrCode};
|