@ngrok/mantle 0.81.0 → 0.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +6 -6
- package/dist/agent.json +1 -1
- package/dist/alert.d.ts +162 -60
- package/dist/alert.js +1 -1
- package/dist/area-chart.d.ts +4 -3
- package/dist/area-chart.js +1 -1
- package/dist/bar-chart.d.ts +4 -3
- package/dist/bar-chart.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{chart-BcOC6Qj0.d.ts → chart-1cVjAcj8.d.ts} +81 -22
- package/dist/chart-Do2qkrxl.js +2 -0
- package/dist/checkbox.d.ts +12 -0
- package/dist/code-block.d.ts +46 -0
- package/dist/command.d.ts +67 -9
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +36 -16
- package/dist/dropdown-menu-BbbQuae2.d.ts +1 -0
- package/dist/{dropdown-menu-DZg-Cd69.d.ts → dropdown-menu-D6pMAY7I.d.ts} +138 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/field.d.ts +12 -9
- package/dist/flag.d.ts +1 -1
- package/dist/icons.d.ts +52 -1
- package/dist/line-chart.d.ts +4 -3
- package/dist/line-chart.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/media-object.d.ts +42 -0
- package/dist/pagination.d.ts +6 -7
- package/dist/pagination.js +1 -1
- package/dist/radio-group.d.ts +119 -0
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/scatter-plot.d.ts +2 -2
- package/dist/scatter-plot.js +1 -1
- package/dist/sheet.d.ts +10 -10
- package/dist/split-button.d.ts +147 -8
- package/dist/split-button.js +1 -1
- package/dist/{table-Bo0vNxIJ.d.ts → table-CZBYEmyK.d.ts} +2 -2
- package/dist/table.d.ts +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/{theme-CYNpplwN.d.ts → theme-FbfjYiD3.d.ts} +16 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme.d.ts +42 -2
- package/dist/toast.d.ts +4 -0
- package/dist/types.js +1 -1
- package/package.json +14 -14
- package/dist/chart-BROa2gqt.js +0 -2
- package/dist/dropdown-menu-Dw-OtXPm.d.ts +0 -1
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-DjpEKt2X.js";import{t as n}from"./button-BAno7KIU.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./icons-B_DDQcVD.js";import{t as a}from"./table-CGxJwtbL.js";import{Fragment as o,createContext as s,useContext as c,useMemo as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{flexRender as m}from"@tanstack/react-table";import{MinusIcon as h}from"@phosphor-icons/react/Minus";import{PlusIcon as g}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const _=[`unsorted`,`asc`,`desc`],v=[`unsorted`,`desc`,`asc`];function y(e,t){return b(t===`alphanumeric`?_:v,e)??`unsorted`}function b(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const x=s(null);function S(){let e=c(x);return u(e,`useDataTableContext should only be used within a DataTable child component`),e}function C({children:e,table:t,...n}){let r=l(()=>({table:t}),[t]);return f(x.Provider,{value:r,children:f(a.Root,{"data-slot":`data-table`,...n,children:f(a.Element,{children:e})})})}function w({appearance:n=`ghost`,children:i,className:a,column:o,disableSorting:s=!1,iconPlacement:c=`end`,intent:l=`neutral`,sortingMode:u,sortIcon:d,onClick:m,...h}){let g=o.getIsSorted(),_=!s&&o.getCanSort(),v=_&&typeof g==`string`?g:`unsorted`,y=d?.(v)??f(B,{mode:u,direction:v});return p(t,{appearance:n,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,n===`ghost`&&l===`neutral`&&`text-muted`,a),"data-sort-direction":v,"data-table-header-action":!0,icon:y,iconPlacement:c,onClick:e=>{m?.(e),!e.defaultPrevented&&(!_||s||u===void 0||V(o,u))},intent:l,type:`button`,...h,children:[_&&v!==`unsorted`&&p(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,u===`alphanumeric`?v===`asc`?`ascending`:`descending`:r(v),` `,`order`]}),i]})}function T({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const E=e=>f(a.Body,{"data-slot":`data-table-body`,...e});function D(e){let{table:t}=S();return f(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>f(a.Row,{children:e.headers.map(e=>f(o,{children:e.isPlaceholder?f(a.Header,{},e.id):m(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function O({className:t,renderExpanded:n,row:r,...i}){let s=f(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>f(o,{children:m(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:p(d,{children:[s,r.getIsExpanded()&&f(R,{row:r,children:n(r)})]})}function k({children:e,...t}){let{table:n}=S(),r=n.getAllColumns().length;return f(a.Row,{"data-slot":`data-table-empty-row`,...t,children:f(a.Cell,{colSpan:r,children:e})})}function A(){return f(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function j({children:t,className:n,...r}){return p(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[f(A,{}),t]})}function M({children:t,className:n,...r}){let{table:i}=S(),o=i.getRowModel().rows.length>0;return p(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&f(A,{}),t]})}function N(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function P({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??f(`span`,{className:`sr-only`,children:`Row details`})})}const F=f(g,{weight:`bold`,className:`size-3.5`}),I=f(h,{weight:`bold`,className:`size-3.5`});function L({appearance:t=`ghost`,className:r,collapseIcon:i=I,expandIcon:a=F,intent:o=`neutral`,label:s,onClick:c,row:l,size:u=`sm`,...d}){if(!l.getCanExpand())return null;let p=l.getIsExpanded(),m=l.getToggleExpandedHandler();return f(n,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:t,intent:o,size:u,className:e(`rounded`,r),"aria-expanded":p,"aria-controls":p?N(l):void 0,icon:p?i:a,label:`${p?`Hide`:`Show`} details for ${s}`,onClick:e=>{e.stopPropagation(),c?.(e),!e.defaultPrevented&&m()},...d})}function R({children:t,className:n,colSpan:r,row:i,...o}){return f(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:f(a.Cell,{id:N(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}const z={Root:C,ActionCell:j,ActionHeader:M,Cell:a.Cell,Body:E,EmptyRow:k,Head:D,Header:T,HeaderSortButton:w,Row:O,ExpandHeader:P,RowExpandButton:L,ExpandedRow:R};function B({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?f(`svg`,{"aria-hidden":!0,...n}):f(i,{mode:t,direction:e,...n})}function V(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(y(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{z as DataTable,N as expandedRowId};
|
|
@@ -32,10 +32,12 @@ type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
|
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```tsx
|
|
35
|
-
* <DescriptionList.
|
|
36
|
-
* <DescriptionList.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* <DescriptionList.Root>
|
|
36
|
+
* <DescriptionList.Item>
|
|
37
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
38
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
39
|
+
* </DescriptionList.Item>
|
|
40
|
+
* </DescriptionList.Root>
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
43
|
declare const Item: ({ asChild, className, children, ref, ...rest }: DescriptionListItemProps) => import("react").JSX.Element;
|
|
@@ -47,7 +49,12 @@ type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
|
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
49
51
|
* ```tsx
|
|
50
|
-
* <DescriptionList.
|
|
52
|
+
* <DescriptionList.Root>
|
|
53
|
+
* <DescriptionList.Item>
|
|
54
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
55
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
56
|
+
* </DescriptionList.Item>
|
|
57
|
+
* </DescriptionList.Root>
|
|
51
58
|
* ```
|
|
52
59
|
*/
|
|
53
60
|
declare const Label: ({ asChild, className, children, ref, ...rest }: DescriptionListLabelProps) => import("react").JSX.Element;
|
|
@@ -61,9 +68,12 @@ type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
|
|
|
61
68
|
*
|
|
62
69
|
* @example
|
|
63
70
|
* ```tsx
|
|
64
|
-
* <DescriptionList.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
71
|
+
* <DescriptionList.Root>
|
|
72
|
+
* <DescriptionList.Item>
|
|
73
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
74
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
75
|
+
* </DescriptionList.Item>
|
|
76
|
+
* </DescriptionList.Root>
|
|
67
77
|
* ```
|
|
68
78
|
*/
|
|
69
79
|
declare const Value: ({ asChild, className, children, ref, ...rest }: DescriptionListValueProps) => import("react").JSX.Element;
|
|
@@ -129,10 +139,12 @@ declare const DescriptionList: {
|
|
|
129
139
|
*
|
|
130
140
|
* @example
|
|
131
141
|
* ```tsx
|
|
132
|
-
* <DescriptionList.
|
|
133
|
-
* <DescriptionList.
|
|
134
|
-
*
|
|
135
|
-
*
|
|
142
|
+
* <DescriptionList.Root>
|
|
143
|
+
* <DescriptionList.Item>
|
|
144
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
145
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
146
|
+
* </DescriptionList.Item>
|
|
147
|
+
* </DescriptionList.Root>
|
|
136
148
|
* ```
|
|
137
149
|
*/
|
|
138
150
|
readonly Item: typeof Item;
|
|
@@ -143,7 +155,12 @@ declare const DescriptionList: {
|
|
|
143
155
|
*
|
|
144
156
|
* @example
|
|
145
157
|
* ```tsx
|
|
146
|
-
* <DescriptionList.
|
|
158
|
+
* <DescriptionList.Root>
|
|
159
|
+
* <DescriptionList.Item>
|
|
160
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
161
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
162
|
+
* </DescriptionList.Item>
|
|
163
|
+
* </DescriptionList.Root>
|
|
147
164
|
* ```
|
|
148
165
|
*/
|
|
149
166
|
readonly Label: typeof Label;
|
|
@@ -154,9 +171,12 @@ declare const DescriptionList: {
|
|
|
154
171
|
*
|
|
155
172
|
* @example
|
|
156
173
|
* ```tsx
|
|
157
|
-
* <DescriptionList.
|
|
158
|
-
*
|
|
159
|
-
*
|
|
174
|
+
* <DescriptionList.Root>
|
|
175
|
+
* <DescriptionList.Item>
|
|
176
|
+
* <DescriptionList.Label>Name</DescriptionList.Label>
|
|
177
|
+
* <DescriptionList.Value>my-api-key</DescriptionList.Value>
|
|
178
|
+
* </DescriptionList.Item>
|
|
179
|
+
* </DescriptionList.Root>
|
|
160
180
|
* ```
|
|
161
181
|
*/
|
|
162
182
|
readonly Value: typeof Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./dropdown-menu-D6pMAY7I.js";
|
|
@@ -23,12 +23,65 @@ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
declare const Trigger: (props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) => import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* A group container for organizing related dropdown menu items.
|
|
28
|
+
*
|
|
29
|
+
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenugroup
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <DropdownMenu.Root>
|
|
34
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
35
|
+
* <DropdownMenu.Content>
|
|
36
|
+
* <DropdownMenu.Group>
|
|
37
|
+
* <DropdownMenu.Label>Account</DropdownMenu.Label>
|
|
38
|
+
* <DropdownMenu.Item>Profile</DropdownMenu.Item>
|
|
39
|
+
* <DropdownMenu.Item>Settings</DropdownMenu.Item>
|
|
40
|
+
* </DropdownMenu.Group>
|
|
41
|
+
* </DropdownMenu.Content>
|
|
42
|
+
* </DropdownMenu.Root>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
26
45
|
declare const Group: ({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Group>) => import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* A radio group container for exclusive selection within the dropdown menu.
|
|
48
|
+
*
|
|
49
|
+
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenuradiogroup
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <DropdownMenu.Root>
|
|
54
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
55
|
+
* <DropdownMenu.Content>
|
|
56
|
+
* <DropdownMenu.RadioGroup value={value} onValueChange={setValue}>
|
|
57
|
+
* <DropdownMenu.RadioItem value="option1">Option 1</DropdownMenu.RadioItem>
|
|
58
|
+
* <DropdownMenu.RadioItem value="option2">Option 2</DropdownMenu.RadioItem>
|
|
59
|
+
* </DropdownMenu.RadioGroup>
|
|
60
|
+
* </DropdownMenu.Content>
|
|
61
|
+
* </DropdownMenu.Root>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
27
64
|
declare const RadioGroup: ({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) => import("react").JSX.Element;
|
|
28
65
|
/**
|
|
29
66
|
* A trigger for a dropdown menu sub-menu.
|
|
30
67
|
*
|
|
31
68
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenusubtrigger
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <DropdownMenu.Root>
|
|
73
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
74
|
+
* <DropdownMenu.Content>
|
|
75
|
+
* <DropdownMenu.Sub>
|
|
76
|
+
* <DropdownMenu.SubTrigger>Share</DropdownMenu.SubTrigger>
|
|
77
|
+
* <DropdownMenu.SubContent>
|
|
78
|
+
* <DropdownMenu.Item>Email</DropdownMenu.Item>
|
|
79
|
+
* <DropdownMenu.Item>Copy link</DropdownMenu.Item>
|
|
80
|
+
* </DropdownMenu.SubContent>
|
|
81
|
+
* </DropdownMenu.Sub>
|
|
82
|
+
* </DropdownMenu.Content>
|
|
83
|
+
* </DropdownMenu.Root>
|
|
84
|
+
* ```
|
|
32
85
|
*/
|
|
33
86
|
declare const SubTrigger: ({ className, inset, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
34
87
|
inset?: boolean;
|
|
@@ -41,6 +94,22 @@ declare const SubTrigger: ({ className, inset, children, ...props }: ComponentPr
|
|
|
41
94
|
* mounted layer renders on top.
|
|
42
95
|
*
|
|
43
96
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenusubcontent
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* <DropdownMenu.Root>
|
|
101
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
102
|
+
* <DropdownMenu.Content>
|
|
103
|
+
* <DropdownMenu.Sub>
|
|
104
|
+
* <DropdownMenu.SubTrigger>Export</DropdownMenu.SubTrigger>
|
|
105
|
+
* <DropdownMenu.SubContent>
|
|
106
|
+
* <DropdownMenu.Item>Export as PDF</DropdownMenu.Item>
|
|
107
|
+
* <DropdownMenu.Item>Export as CSV</DropdownMenu.Item>
|
|
108
|
+
* </DropdownMenu.SubContent>
|
|
109
|
+
* </DropdownMenu.Sub>
|
|
110
|
+
* </DropdownMenu.Content>
|
|
111
|
+
* </DropdownMenu.Root>
|
|
112
|
+
* ```
|
|
44
113
|
*/
|
|
45
114
|
declare const SubContent: ({ className, loop, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) => import("react").JSX.Element;
|
|
46
115
|
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & WithDataSlot & {
|
|
@@ -101,6 +170,18 @@ declare const Item: ({ className, inset, ...props }: ComponentProps<typeof Dropd
|
|
|
101
170
|
* A menu item with a checkbox that can be controlled or uncontrolled.
|
|
102
171
|
*
|
|
103
172
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenucheckboxitem
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```tsx
|
|
176
|
+
* <DropdownMenu.Root>
|
|
177
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
178
|
+
* <DropdownMenu.Content>
|
|
179
|
+
* <DropdownMenu.CheckboxItem checked={true} onCheckedChange={setChecked}>
|
|
180
|
+
* Show notifications
|
|
181
|
+
* </DropdownMenu.CheckboxItem>
|
|
182
|
+
* </DropdownMenu.Content>
|
|
183
|
+
* </DropdownMenu.Root>
|
|
184
|
+
* ```
|
|
104
185
|
*/
|
|
105
186
|
declare const CheckboxItem: ({ className, children, checked, ...props }: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) => import("react").JSX.Element;
|
|
106
187
|
type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
@@ -112,12 +193,38 @@ type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.Ra
|
|
|
112
193
|
* Used within a RadioGroup to create a set of mutually exclusive options.
|
|
113
194
|
*
|
|
114
195
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenuradioitem
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <DropdownMenu.Root>
|
|
200
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
201
|
+
* <DropdownMenu.Content>
|
|
202
|
+
* <DropdownMenu.RadioGroup value="small" onValueChange={setSize}>
|
|
203
|
+
* <DropdownMenu.RadioItem value="small">Small</DropdownMenu.RadioItem>
|
|
204
|
+
* <DropdownMenu.RadioItem value="medium">Medium</DropdownMenu.RadioItem>
|
|
205
|
+
* <DropdownMenu.RadioItem value="large">Large</DropdownMenu.RadioItem>
|
|
206
|
+
* </DropdownMenu.RadioGroup>
|
|
207
|
+
* </DropdownMenu.Content>
|
|
208
|
+
* </DropdownMenu.Root>
|
|
209
|
+
* ```
|
|
115
210
|
*/
|
|
116
211
|
declare const RadioItem: ({ className, children, ...props }: DropdownMenuRadioItemProps) => import("react").JSX.Element;
|
|
117
212
|
/**
|
|
118
213
|
* A label for a group of dropdown menu items.
|
|
119
214
|
*
|
|
120
215
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenulabel
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```tsx
|
|
219
|
+
* <DropdownMenu.Root>
|
|
220
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
221
|
+
* <DropdownMenu.Content>
|
|
222
|
+
* <DropdownMenu.Label>My Account</DropdownMenu.Label>
|
|
223
|
+
* <DropdownMenu.Item>Profile</DropdownMenu.Item>
|
|
224
|
+
* <DropdownMenu.Item>Settings</DropdownMenu.Item>
|
|
225
|
+
* </DropdownMenu.Content>
|
|
226
|
+
* </DropdownMenu.Root>
|
|
227
|
+
* ```
|
|
121
228
|
*/
|
|
122
229
|
declare const Label: ({ className, inset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
123
230
|
inset?: boolean;
|
|
@@ -126,8 +233,39 @@ declare const Label: ({ className, inset, ...props }: ComponentProps<typeof Drop
|
|
|
126
233
|
* A visual separator between dropdown menu items or groups.
|
|
127
234
|
*
|
|
128
235
|
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenuseparator
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```tsx
|
|
239
|
+
* <DropdownMenu.Root>
|
|
240
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
241
|
+
* <DropdownMenu.Content>
|
|
242
|
+
* <DropdownMenu.Item>Edit</DropdownMenu.Item>
|
|
243
|
+
* <DropdownMenu.Item>Copy</DropdownMenu.Item>
|
|
244
|
+
* <DropdownMenu.Separator />
|
|
245
|
+
* <DropdownMenu.Item>Delete</DropdownMenu.Item>
|
|
246
|
+
* </DropdownMenu.Content>
|
|
247
|
+
* </DropdownMenu.Root>
|
|
248
|
+
* ```
|
|
129
249
|
*/
|
|
130
250
|
declare const DropdownSeparator: ({ className, ...props }: ComponentProps<typeof Separator>) => import("react").JSX.Element;
|
|
251
|
+
/**
|
|
252
|
+
* A keyboard shortcut indicator for dropdown menu items.
|
|
253
|
+
*
|
|
254
|
+
* @see https://mantle.ngrok.com/components/overlays/dropdown-menu#dropdownmenushortcut
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```tsx
|
|
258
|
+
* <DropdownMenu.Root>
|
|
259
|
+
* <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>
|
|
260
|
+
* <DropdownMenu.Content>
|
|
261
|
+
* <DropdownMenu.Item>
|
|
262
|
+
* Save
|
|
263
|
+
* <DropdownMenu.Shortcut>⌘S</DropdownMenu.Shortcut>
|
|
264
|
+
* </DropdownMenu.Item>
|
|
265
|
+
* </DropdownMenu.Content>
|
|
266
|
+
* </DropdownMenu.Root>
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
131
269
|
declare const Shortcut: ({ className, ...props }: ComponentProps<"span">) => import("react").JSX.Element;
|
|
132
270
|
/**
|
|
133
271
|
* A menu of options or actions, triggered by a button.
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
2
|
-
import "./dropdown-menu-
|
|
1
|
+
import { t as DropdownMenu } from "./dropdown-menu-D6pMAY7I.js";
|
|
2
|
+
import "./dropdown-menu-BbbQuae2.js";
|
|
3
3
|
export { DropdownMenu };
|
package/dist/field.d.ts
CHANGED
|
@@ -372,6 +372,17 @@ declare const Optional: ({ asChild, children, className, ref, ...props }: Compon
|
|
|
372
372
|
* ```
|
|
373
373
|
*/
|
|
374
374
|
declare const Group: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
375
|
+
/**
|
|
376
|
+
* Props for `Field.Item`.
|
|
377
|
+
*/
|
|
378
|
+
type FieldItemProps = ComponentProps<"div"> & WithAsChild & WithValidation & {
|
|
379
|
+
/**
|
|
380
|
+
* Form-value name for the field. Required so `Field.Control` can splat
|
|
381
|
+
* it onto the focusable child while `Field.Item` owns the stable
|
|
382
|
+
* generated control id used by `Field.Label`'s `htmlFor`.
|
|
383
|
+
*/
|
|
384
|
+
name: string;
|
|
385
|
+
};
|
|
375
386
|
/**
|
|
376
387
|
* A single form field — `Label`, a control (`Input`, `Select`, `Checkbox`,
|
|
377
388
|
* etc.), and any `Field.Description`, `Field.Errors`, or `Field.ErrorList` siblings stacked
|
|
@@ -416,14 +427,6 @@ declare const Group: ({ asChild, className, ref, ...props }: ComponentProps<"div
|
|
|
416
427
|
* </Field.Group>
|
|
417
428
|
* ```
|
|
418
429
|
*/
|
|
419
|
-
type FieldItemProps = ComponentProps<"div"> & WithAsChild & WithValidation & {
|
|
420
|
-
/**
|
|
421
|
-
* Form-value name for the field. Required so `Field.Control` can splat
|
|
422
|
-
* it onto the focusable child while `Field.Item` owns the stable
|
|
423
|
-
* generated control id used by `Field.Label`'s `htmlFor`.
|
|
424
|
-
*/
|
|
425
|
-
name: string;
|
|
426
|
-
};
|
|
427
430
|
declare const Item: ({ asChild, children, className, name, ref, validation: validationProp, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
428
431
|
type FieldControlSlotProps = Omit<ComponentProps<typeof Slot>, "aria-describedby" | "aria-errormessage" | "aria-invalid" | "children">;
|
|
429
432
|
/**
|
|
@@ -874,7 +877,7 @@ declare const Field: {
|
|
|
874
877
|
* opt out (e.g. when the focusable element is rendered outside of
|
|
875
878
|
* `Field.Control`).
|
|
876
879
|
*
|
|
877
|
-
* @see https://mantle.ngrok.com/components/forms/
|
|
880
|
+
* @see https://mantle.ngrok.com/components/forms/field#fieldlabel
|
|
878
881
|
*
|
|
879
882
|
* @example
|
|
880
883
|
* ```tsx
|
package/dist/flag.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
57
57
|
* **Loading.** Defaults to `loading="lazy"`. Use `loading="eager"` for flags
|
|
58
58
|
* above the fold or in critical content.
|
|
59
59
|
*
|
|
60
|
-
* @see https://mantle.ngrok.com/components/data-display/flag
|
|
60
|
+
* @see https://mantle.ngrok.com/components/data-display/flag
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
63
|
* ```tsx
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
|
|
2
2
|
import { a as AlphanumericSortingDirection, c as TimeSortingDirection, o as SortingDirection, s as SortingMode } from "./direction-BjU0bPST.js";
|
|
3
|
-
import { i as Theme } from "./theme-
|
|
3
|
+
import { i as Theme } from "./theme-FbfjYiD3.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
//#region src/components/icons/sort.d.ts
|
|
6
6
|
type Props = SvgAttributes & ({
|
|
@@ -23,12 +23,26 @@ type Props = SvgAttributes & ({
|
|
|
23
23
|
/**
|
|
24
24
|
* A sorting icon that can be used to indicate the sorting direction of a table column or list.
|
|
25
25
|
* It is aware of the sorting mode (alphanumeric or time) and the sorting direction (ascending or descending).
|
|
26
|
+
*
|
|
27
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <SortIcon mode="time" direction="newest-to-oldest" />
|
|
32
|
+
* ```
|
|
26
33
|
*/
|
|
27
34
|
declare const SortIcon: ({ mode, direction, ...props }: Props) => import("react").JSX.Element;
|
|
28
35
|
//#endregion
|
|
29
36
|
//#region src/components/icons/traffic-policy-file.d.ts
|
|
30
37
|
/**
|
|
31
38
|
* An icon representing a traffic policy file.
|
|
39
|
+
*
|
|
40
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <TrafficPolicyFileIcon className="size-5" />
|
|
45
|
+
* ```
|
|
32
46
|
*/
|
|
33
47
|
declare function TrafficPolicyFileIcon(props: SvgAttributes): import("react").JSX.Element;
|
|
34
48
|
//#endregion
|
|
@@ -39,6 +53,13 @@ declare function TrafficPolicyFileIcon(props: SvgAttributes): import("react").JS
|
|
|
39
53
|
* - `dark`: MoonIcon
|
|
40
54
|
* - `light-high-contrast`: SunIcon (fill)
|
|
41
55
|
* - `dark-high-contrast`: MoonIcon (fill)
|
|
56
|
+
*
|
|
57
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <AutoThemeIcon className="size-5" />
|
|
62
|
+
* ```
|
|
42
63
|
*/
|
|
43
64
|
declare function AutoThemeIcon(props: SvgAttributes): import("react").JSX.Element;
|
|
44
65
|
type ThemeIconProps = SvgAttributes & {
|
|
@@ -52,12 +73,28 @@ type ThemeIconProps = SvgAttributes & {
|
|
|
52
73
|
* - `dark`: MoonIcon
|
|
53
74
|
* - `light-high-contrast`: SunIcon (fill)
|
|
54
75
|
* - `dark-high-contrast`: MoonIcon (fill)
|
|
76
|
+
*
|
|
77
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* <ThemeIcon theme="system" />
|
|
82
|
+
* ```
|
|
55
83
|
*/
|
|
56
84
|
declare function ThemeIcon({ theme, ...props }: ThemeIconProps): import("react").JSX.Element;
|
|
57
85
|
//#endregion
|
|
58
86
|
//#region src/components/icons/types.d.ts
|
|
59
87
|
/**
|
|
60
88
|
* Props for an inline svg icon.
|
|
89
|
+
*
|
|
90
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* function BrandIcon(props: InlineIconProps) {
|
|
95
|
+
* return <svg {...props} />;
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
61
98
|
*/
|
|
62
99
|
type InlineIconProps = Omit<ComponentProps<"svg">, "xmlns" | "fill" | "viewBox" | "color" | "children"> & {
|
|
63
100
|
/**
|
|
@@ -72,10 +109,24 @@ type InlineIconProps = Omit<ComponentProps<"svg">, "xmlns" | "fill" | "viewBox"
|
|
|
72
109
|
//#region src/components/icons/ngrok.d.ts
|
|
73
110
|
/**
|
|
74
111
|
* An inline svg icon that renders the ngrok wordmark logo. Fill color is determined by the `color` CSS property.
|
|
112
|
+
*
|
|
113
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx
|
|
117
|
+
* <NgrokWordmarkIcon />
|
|
118
|
+
* ```
|
|
75
119
|
*/
|
|
76
120
|
declare function NgrokWordmarkIcon(props: Omit<InlineIconProps, "color">): import("react").JSX.Element;
|
|
77
121
|
/**
|
|
78
122
|
* An inline svg icon that renders the ngrok lettermark "n" logo. Fill color is determined by the `color` CSS property.
|
|
123
|
+
*
|
|
124
|
+
* @see https://mantle.ngrok.com/components/data-display/icons
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* <NgrokLettermarkIcon />
|
|
129
|
+
* ```
|
|
79
130
|
*/
|
|
80
131
|
declare function NgrokLettermarkIcon(props: Omit<InlineIconProps, "color">): import("react").JSX.Element;
|
|
81
132
|
//#endregion
|
package/dist/line-chart.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as SeriesColor, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as PointShape, h as CurveKind, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ContinuousXScale, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as
|
|
1
|
+
import { _ as SeriesColor, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as PointShape, h as CurveKind, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ContinuousXScale, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps } from "./chart-1cVjAcj8.js";
|
|
2
2
|
//#region src/components/line-chart/line-chart.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Props for {@link LineChart.Root}. Lines encode value by vertical position,
|
|
5
5
|
* not length from a baseline, so the full y domain stays overridable via
|
|
6
6
|
* `yDomain` — and lines never stack, so there is no `stacked` prop.
|
|
7
7
|
*/
|
|
8
|
-
type LineChartRootProps<TDatum extends ChartDatum = ChartDatum> = Omit<ChartRootBaseProps, "stacked"> &
|
|
8
|
+
type LineChartRootProps<TDatum extends ChartDatum = ChartDatum> = Omit<ChartRootBaseProps, "stacked"> & ChartAccessibilityProps & {
|
|
9
9
|
/** Rows of data; each `LineChart.Line` reads one numeric key per row. */
|
|
10
10
|
data: readonly TDatum[];
|
|
11
11
|
/** The key of each row's x value. */
|
|
@@ -292,7 +292,8 @@ declare const CopyButton: (props: LineChartCopyButtonProps) => import("react").J
|
|
|
292
292
|
* ├── LineChart.Line (one per series)
|
|
293
293
|
* ├── LineChart.ReferenceLine
|
|
294
294
|
* ├── LineChart.Tooltip
|
|
295
|
-
*
|
|
295
|
+
* ├── LineChart.Legend
|
|
296
|
+
* └── LineChart.CopyButton
|
|
296
297
|
* ```
|
|
297
298
|
*
|
|
298
299
|
* @example
|
package/dist/line-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-Do2qkrxl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`line`,componentName:`LineChart`,slotName:`line-chart`,...e}),Line:e=>a(`LineChart.Line`,`line`,e),Grid:e=>n(`LineChart.Grid`,e),XAxis:e=>t(`LineChart.XAxis`,e),YAxis:e=>r(`LineChart.YAxis`,e),ReferenceLine:t=>e(`LineChart.ReferenceLine`,t),Tooltip:e=>s(`LineChart.Tooltip`,e),Legend:e=>l(i,{partName:`LineChart.Legend`,slotName:`line-chart`,...e}),CopyButton:e=>l(c,{partName:`LineChart.CopyButton`,slotName:`line-chart`,...e})};export{u as LineChart};
|
package/dist/llms.txt
CHANGED
package/dist/media-object.d.ts
CHANGED
|
@@ -6,14 +6,56 @@ type Props = ComponentProps<"div"> & WithAsChild;
|
|
|
6
6
|
* The media object is an image/icon (media) to the left, with descriptive
|
|
7
7
|
* content (title and subtitle/description) to the right. This is the root
|
|
8
8
|
* component of the media object.
|
|
9
|
+
*
|
|
10
|
+
* @see https://mantle.ngrok.com/components/structure/media-object#mediaobjectroot
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <MediaObject.Root>
|
|
15
|
+
* <MediaObject.Media>
|
|
16
|
+
* <ExampleMedia />
|
|
17
|
+
* </MediaObject.Media>
|
|
18
|
+
* <MediaObject.Content>
|
|
19
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
20
|
+
* </MediaObject.Content>
|
|
21
|
+
* </MediaObject.Root>
|
|
22
|
+
* ```
|
|
9
23
|
*/
|
|
10
24
|
declare const Root: ({ asChild, className, children, style, ref }: Props) => import("react").JSX.Element;
|
|
11
25
|
/**
|
|
12
26
|
* The container for an image or icon to display in the media slot of the media object.
|
|
27
|
+
*
|
|
28
|
+
* @see https://mantle.ngrok.com/components/structure/media-object#mediaobjectmedia
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <MediaObject.Root>
|
|
33
|
+
* <MediaObject.Media>
|
|
34
|
+
* <ExampleMedia />
|
|
35
|
+
* </MediaObject.Media>
|
|
36
|
+
* <MediaObject.Content>
|
|
37
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
38
|
+
* </MediaObject.Content>
|
|
39
|
+
* </MediaObject.Root>
|
|
40
|
+
* ```
|
|
13
41
|
*/
|
|
14
42
|
declare const Media: ({ asChild, className, children, style, ref }: Props) => import("react").JSX.Element;
|
|
15
43
|
/**
|
|
16
44
|
* The container for the content slot of a media object.
|
|
45
|
+
*
|
|
46
|
+
* @see https://mantle.ngrok.com/components/structure/media-object#mediaobjectcontent
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <MediaObject.Root>
|
|
51
|
+
* <MediaObject.Media>
|
|
52
|
+
* <ExampleMedia />
|
|
53
|
+
* </MediaObject.Media>
|
|
54
|
+
* <MediaObject.Content>
|
|
55
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
56
|
+
* </MediaObject.Content>
|
|
57
|
+
* </MediaObject.Root>
|
|
58
|
+
* ```
|
|
17
59
|
*/
|
|
18
60
|
declare const Content: ({ asChild, className, children, style, ref }: Props) => import("react").JSX.Element;
|
|
19
61
|
/**
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
1
|
import { t as ButtonGroup } from "./button-C-gMbPso.js";
|
|
3
2
|
import { t as Select } from "./select-0z7HVS6r.js";
|
|
4
3
|
import { ComponentProps } from "react";
|
|
@@ -22,7 +21,7 @@ type CursorPaginationProps = ComponentProps<"div"> & {
|
|
|
22
21
|
*
|
|
23
22
|
* @example
|
|
24
23
|
* ```tsx
|
|
25
|
-
* <CursorPagination defaultPageSize={10}>
|
|
24
|
+
* <CursorPagination.Root defaultPageSize={10}>
|
|
26
25
|
* <CursorPagination.Buttons
|
|
27
26
|
* hasNextPage={hasNext}
|
|
28
27
|
* hasPreviousPage={hasPrevious}
|
|
@@ -30,7 +29,7 @@ type CursorPaginationProps = ComponentProps<"div"> & {
|
|
|
30
29
|
* onPreviousPage={handlePrevious}
|
|
31
30
|
* />
|
|
32
31
|
* <CursorPagination.PageSizeSelect />
|
|
33
|
-
* </CursorPagination>
|
|
32
|
+
* </CursorPagination.Root>
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
35
|
declare const Root: ({ className, children, defaultPageSize, ref, ...props }: CursorPaginationProps) => import("react").JSX.Element;
|
|
@@ -93,7 +92,7 @@ type CursorPageSizeSelectProps = Omit<ComponentProps<typeof Select.Trigger>, "ch
|
|
|
93
92
|
* ```
|
|
94
93
|
*/
|
|
95
94
|
declare const PageSizeSelect: ({ className, pageSizes, onChangePageSize, ref, ...rest }: CursorPageSizeSelectProps) => import("react").JSX.Element;
|
|
96
|
-
type CursorPageSizeValueProps = Omit<ComponentProps<"span">, "children"
|
|
95
|
+
type CursorPageSizeValueProps = Omit<ComponentProps<"span">, "children">;
|
|
97
96
|
/**
|
|
98
97
|
* Displays the current page size when using cursor-based pagination as a read-only value.
|
|
99
98
|
*
|
|
@@ -107,7 +106,7 @@ type CursorPageSizeValueProps = Omit<ComponentProps<"span">, "children"> & WithA
|
|
|
107
106
|
* </div>
|
|
108
107
|
* ```
|
|
109
108
|
*/
|
|
110
|
-
declare function PageSizeValue({
|
|
109
|
+
declare function PageSizeValue({ className, ...props }: CursorPageSizeValueProps): import("react").JSX.Element;
|
|
111
110
|
/**
|
|
112
111
|
* A pagination component for use with cursor-based pagination.
|
|
113
112
|
*
|
|
@@ -130,7 +129,7 @@ declare function PageSizeValue({ asChild, className, ...props }: CursorPageSizeV
|
|
|
130
129
|
*
|
|
131
130
|
* @example
|
|
132
131
|
* ```tsx
|
|
133
|
-
* <CursorPagination defaultPageSize={10}>
|
|
132
|
+
* <CursorPagination.Root defaultPageSize={10}>
|
|
134
133
|
* <CursorPagination.Buttons
|
|
135
134
|
* hasNextPage={hasNext}
|
|
136
135
|
* hasPreviousPage={hasPrevious}
|
|
@@ -138,7 +137,7 @@ declare function PageSizeValue({ asChild, className, ...props }: CursorPageSizeV
|
|
|
138
137
|
* onPreviousPage={handlePrevious}
|
|
139
138
|
* />
|
|
140
139
|
* <CursorPagination.PageSizeSelect />
|
|
141
|
-
* </CursorPagination>
|
|
140
|
+
* </CursorPagination.Root>
|
|
142
141
|
* ```
|
|
143
142
|
*/
|
|
144
143
|
declare const CursorPagination: {
|
package/dist/pagination.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-BAno7KIU.js";import{t as n}from"./button-D9n09xUg.js";import{n as r}from"./separator-bpE_kooz.js";import{t as i}from"./select-BCHWvmyC.js";import{createContext as a,useContext as o,useEffect as s,useMemo as c,useState as l}from"react";import u from"tiny-invariant";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CaretRightIcon as p}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as m}from"@phosphor-icons/react/CaretLeft";const h=a(void 0),g=({className:t,children:n,defaultPageSize:r,ref:i,...a})=>{let[o,s]=l(r),u=c(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return d(h.Provider,{value:u,children:d(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:i,...a,children:n})})},_=({hasNextPage:e,hasPreviousPage:i,onNextPage:a,onPreviousPage:o,ref:s,...c})=>f(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:s,...c,children:[d(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!i,icon:d(m,{}),intent:`neutral`,label:`Previous page`,onClick:o,size:`sm`,type:`button`}),d(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),d(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:d(p,{}),intent:`neutral`,label:`Next page`,onClick:a,size:`sm`,type:`button`})]}),v=[5,10,20,50,100],y=({className:t,pageSizes:n=v,onChangePageSize:r,ref:a,...s})=>{let c=o(h);return u(c,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),u(n.includes(c.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),u(n.includes(c.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),f(i.Root,{defaultValue:`${c.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=c.defaultPageSize),c.setPageSize(t),r?.(t)},children:[d(i.Trigger,{ref:a,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:c.pageSize,...s,children:d(i.Value,{})}),d(i.Content,{width:`trigger`,children:n.map(e=>f(i.Item,{value:`${e}`,children:[e,` per page`]},e))})]})};function b({className:t,...n}){let r=o(h);return u(r,`CursorPageSizeValue must be used as a child of a CursorPagination component`),f(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,t),...n,children:[r.pageSize,` per page`]})}const x={Root:g,Buttons:_,PageSizeSelect:y,PageSizeValue:b};function S({listSize:e,pageSize:t}){let[n,r]=l(1),[i,a]=l(t);s(()=>{a(t),r(1)},[t]),s(()=>{r(1)},[e]);let o=Math.ceil(e/i),c=(n-1)*i,u=n>1,d=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){d&&r(e=>Math.min(e+1,o))}function m(){u&&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:d,hasPreviousPage:u,nextPage:p,offset:c,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function C(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{x as CursorPagination,C as getOffsetPaginatedSlice,S as useOffsetPagination};
|