tembro 2.0.5 → 2.0.6
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/components/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/data-table/data-table-pagination.js +4 -4
- package/dist/components/data-table/data-table.cjs +1 -1
- package/dist/components/data-table/data-table.d.ts +2 -2
- package/dist/components/data-table/data-table.js +2 -1
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +7 -1
- package/dist/components/display/carousel.js +44 -44
- package/dist/components/display/smart-card.d.ts +1 -1
- package/dist/components/display/status-legend.d.ts +1 -1
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +3 -4
- package/dist/components/form/form-input.js +257 -257
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.d.ts +2 -2
- package/dist/components/form/form-select.js +6 -6
- package/dist/components/inputs/async-select.d.ts +3 -0
- package/dist/components/inputs/search-input.d.ts +3 -0
- package/dist/components/inputs/simple-select.cjs +1 -1
- package/dist/components/inputs/simple-select.d.ts +10 -32
- package/dist/components/inputs/simple-select.js +5 -101
- package/dist/components/ui/card/index.cjs +1 -1
- package/dist/components/ui/card/index.d.ts +13 -2
- package/dist/components/ui/card/index.js +74 -49
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +8 -0
- package/dist/components/ui/input/index.js +63 -30
- package/dist/components/ui/select/index.cjs +1 -1
- package/dist/components/ui/select/index.d.ts +33 -1
- package/dist/components/ui/select/index.js +154 -48
- package/dist/showcase/create-demo.cjs +5 -4
- package/dist/showcase/create-demo.js +2 -2
- package/dist/showcase/premium/data-table/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table/showcase.js +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.js +3 -1
- package/dist/showcase/premium/select/mock.cjs +8 -9
- package/dist/showcase/premium/select/mock.js +1 -1
- package/dist/showcase/premium/select/showcase.cjs +1 -1
- package/dist/showcase/premium/select/showcase.js +76 -86
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +78 -74
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +91 -87
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +1 -1
- package/packages/cli/vendor/src/components/data-table/data-table-pagination.tsx +7 -7
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +21 -20
- package/packages/cli/vendor/src/components/display/carousel.tsx +18 -6
- package/packages/cli/vendor/src/components/display/smart-card.tsx +1 -1
- package/packages/cli/vendor/src/components/display/status-legend.tsx +1 -1
- package/packages/cli/vendor/src/components/form/form-input.tsx +9 -12
- package/packages/cli/vendor/src/components/form/form-select.tsx +4 -4
- package/packages/cli/vendor/src/components/inputs/async-select.tsx +11 -8
- package/packages/cli/vendor/src/components/inputs/search-input.tsx +5 -2
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +20 -190
- package/packages/cli/vendor/src/components/ui/card/index.tsx +95 -25
- package/packages/cli/vendor/src/components/ui/input/index.tsx +98 -0
- package/packages/cli/vendor/src/components/ui/select/index.tsx +227 -34
- package/packages/cli/vendor/src/showcase/create-demo.tsx +16 -15
- package/packages/cli/vendor/src/showcase/premium/data-table/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/data-table-parts/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/select/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/select/showcase.tsx +13 -21
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +7 -8
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +5 -6
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/registry.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/select/index.cjs"),r=require("../navigation/pagination.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");function o(e,t,n){return typeof t==`number`?Math.max(t,1):typeof n==`number`?Math.max(Math.ceil(n/e),1):1}function s({className:e,pageIndex:i,pageSize:s,pageCount:c,rowCount:l,pageSizeOptions:u=[10,20,30,50,100],disabled:d=!1,showPageSize:f=!0,labels:p,onPageChange:m,onPageSizeChange:h,...g}){let _=o(s,c,l),v=Math.min(Math.max(i+1,1),_);return(0,a.jsxs)(`div`,{"data-slot":`data-table-pagination`,className:t.cn(`flex flex-col gap-3 border-t px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,e),...g,children:[(0,a.jsx)(`div`,{className:`text-sm font-medium text-muted-foreground`,children:p?.pageInfo?.(v,_,l)??`Page ${v} of ${_}`}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center`,children:[f&&h&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(`span`,{children:p?.rowsPerPage??`Rows per page`}),(0,a.jsx)(n.Select,{value:String(s),onValueChange:e=>h(Number(e)),options:u.map(e=>({label:String(e),value:String(e)})),disabled:d,triggerClassName:`h-9 w-20 rounded-full border-border/70 bg-background/80 shadow-none`})]}),(0,a.jsx)(r.Pagination,{page:v,pageCount:_,disabled:d,labels:p,onPageChange:e=>m?.(e-1)})]})]})}exports.DataTablePagination=s,exports.getDataTablePageCount=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Select as t } from "../ui/select/index.js";
|
|
3
|
+
import { Pagination as n } from "../navigation/pagination.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/data-table/data-table-pagination.tsx
|
|
@@ -26,7 +26,7 @@ function o({ className: o, pageIndex: s, pageSize: c, pageCount: l, rowCount: u,
|
|
|
26
26
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
27
27
|
children: [p && g && /* @__PURE__ */ i("div", {
|
|
28
28
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
29
|
-
children: [/* @__PURE__ */ r("span", { children: m?.rowsPerPage ?? "Rows per page" }), /* @__PURE__ */ r(
|
|
29
|
+
children: [/* @__PURE__ */ r("span", { children: m?.rowsPerPage ?? "Rows per page" }), /* @__PURE__ */ r(t, {
|
|
30
30
|
value: String(c),
|
|
31
31
|
onValueChange: (e) => g(Number(e)),
|
|
32
32
|
options: d.map((e) => ({
|
|
@@ -36,7 +36,7 @@ function o({ className: o, pageIndex: s, pageSize: c, pageCount: l, rowCount: u,
|
|
|
36
36
|
disabled: f,
|
|
37
37
|
triggerClassName: "h-9 w-20 rounded-full border-border/70 bg-background/80 shadow-none"
|
|
38
38
|
})]
|
|
39
|
-
}), /* @__PURE__ */ r(
|
|
39
|
+
}), /* @__PURE__ */ r(n, {
|
|
40
40
|
page: y,
|
|
41
41
|
pageCount: v,
|
|
42
42
|
disabled: f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/input/index.cjs"),i=require("../ui/table/index.cjs"),a=require("../feedback/loading-state.cjs"),o=require("../display/data-state.cjs"),ee=require("./data-table-actions-column.cjs"),te=require("./data-table-bulk-actions.cjs"),ne=require("./data-table-column-visibility-menu.cjs"),re=require("./data-table-pagination.cjs"),ie=require("./data-table-toolbar.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("react/jsx-runtime"),l=require("@tanstack/react-table");var ae={compact:`h-8 px-2 py-1.5`,default:`h-10 px-2 py-2`,comfortable:`h-12 px-3 py-3`},u={compact:`px-2 py-1.5`,default:`p-2`,comfortable:`px-3 py-3`};function oe(e,t){return typeof t==`function`?t(e):t}function se(e,t){return typeof t==`function`?t(e):t}function ce(e,t){return typeof t==`function`?t(e):t}function le(e){return e==null||e===``}function d({className:e,columns:d,data:f,title:p,description:m,features:h,search:g,filters:_,summary:v,toolbarActions:y,rowActions:b,bulkActions:x,onRefresh:S,onExport:C,refreshLabel:ue=`Refresh`,exportLabel:de=`Export`,getRowId:fe,isLoading:w=!1,isError:pe=!1,emptyState:me,errorState:he,loadingState:T,loadingVariant:ge=`skeleton`,toolbar:E,toolbarProps:D,pagination:O,sorting:_e,onSortingChange:ve,columnVisibility:ye,onColumnVisibilityChange:be,rowSelection:xe,onRowSelectionChange:Se,enableRowSelection:Ce,renderMobileCard:k,onRowClick:A,onRowDoubleClick:we,getRowDisabled:Te,density:j=`default`,striped:M=!1,bordered:N=!1,stickyHeader:P=!1,skeletonRows:Ee=6,skeletonCellClassName:De,cellFallback:Oe=`-`,tableClassName:ke,tableWrapperClassName:Ae,headerCellClassName:je,cellClassName:Me,rowClassName:Ne,renderExpandedRow:Pe,expanded:Fe,onExpandedChange:Ie,getRowCanExpand:Le,columnPinning:F,onColumnPinningChange:Re,...ze}){let Be=s.useMemo(()=>{let e=d;return!b||h?.rowActions===!1?e:[...e,ee.createDataTableActionsColumn({getActions:b})]},[d,h?.rowActions,b]),I=O===!1?void 0:O,Ve=I?{pageIndex:I.pageIndex,pageSize:I.pageSize}:void 0,L=!!(I&&I.manual!==!1),He=xe??{},R=(0,l.useReactTable)({data:f,columns:Be,getRowId:fe,getCoreRowModel:(0,l.getCoreRowModel)(),getPaginationRowModel:I&&!L?(0,l.getPaginationRowModel)():void 0,manualPagination:L,pageCount:I?.pageCount,state:{sorting:_e,columnVisibility:ye,rowSelection:He,pagination:Ve,expanded:Fe,...F?{columnPinning:F}:{}},onSortingChange:ve,onColumnVisibilityChange:be,onRowSelectionChange:Se,onExpandedChange:Ie,onColumnPinningChange:Re,enableRowSelection:Ce,getRowCanExpand:Le,getExpandedRowModel:(0,l.getExpandedRowModel)()}),z=R.getRowModel().rows,B=R.getSelectedRowModel().rows.map(e=>e.original),Ue=B.length,V=s.useMemo(()=>({table:R,data:f,selectedRows:B}),[f,B,R]),H=R.getVisibleLeafColumns(),We=Math.max(H.length,1),U=typeof E==`function`?E(R):E,W=typeof D==`function`?D(R):D,G=typeof _==`function`?_(V):_,K=typeof v==`function`?v(V):v,Ge=!!(g&&h?.search!==!1),Ke=!!(h?.columnVisibility&&R.getAllLeafColumns().some(e=>e.getCanHide())),q=!!(h?.refresh&&S),J=!!(h?.export&&C),qe=!!(h?.bulkActions!==!1&&x?.length),Y=Ke&&!!(p||m||g||G||K||y||q||J),X=Ge&&g?(0,c.jsx)(r.Input,{type:`search`,value:g.value,onValueChange:g.onValueChange,placeholder:g.placeholder??`Search...`,wrapperClassName:g.wrapperClassName??g.className,inputClassName:g.inputClassName,disabled:g.disabled,clearable:g.clearable,clearLabel:g.clearLabel,searchIcon:g.searchIcon}):void 0,Je=(0,c.jsxs)(c.Fragment,{children:[typeof y==`function`?y(V):y,Y&&(0,c.jsx)(ne.DataTableColumnVisibilityMenu,{table:R}),q&&(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,disabled:w,onClick:()=>S?.(V),children:ue}),J&&(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>C?.(V),children:de})]}),Z=qe?(0,c.jsx)(te.DataTableBulkActions,{rows:B,actions:x??[],selectedLabel:()=>`Actions`,clearLabel:null,onClearSelection:()=>R.resetRowSelection(),hideWhenEmpty:!1}):void 0,Ye=!!(U||W||p||m||X||G||K||y||Y||q||J||Z),Xe=!!(I&&!I.hidden),Q=w&&ge===`skeleton`,Ze=e=>(0,c.jsx)(i.TableRow,{children:(0,c.jsx)(i.TableCell,{colSpan:We,className:`p-0`,children:e})}),Qe=()=>Array.from({length:Math.max(Ee,1)},(e,n)=>(0,c.jsx)(i.TableRow,{"aria-hidden":`true`,children:H.map(e=>(0,c.jsx)(i.TableCell,{className:t.cn(u[j],N&&`border-r last:border-r-0`),children:(0,c.jsx)(`div`,{className:t.cn(`h-4 w-full max-w-40 animate-pulse rounded-md bg-muted`,n%3==1&&`max-w-24`,n%3==2&&`max-w-32`,De)})},`${e.id}-${n}`))},`skeleton-${n}`)),$=Q?null:w?(0,c.jsx)(a.LoadingState,{label:`Loading data...`,...T}):pe?(0,c.jsx)(o.DataState,{status:`error`,title:`Could not load data`,description:`Please try again.`,variant:`plain`,...he}):z.length===0?(0,c.jsx)(o.DataState,{status:`empty`,variant:`plain`,...me}):null;return(0,c.jsxs)(`div`,{"data-slot":`data-table`,className:t.cn(`grid gap-3`,e),...ze,children:[Ye&&(U??(0,c.jsx)(ie.DataTableToolbar,{title:p,description:m,search:X,filters:G,summary:K,actions:Je,selectionActions:Z,selectedCount:Ue,totalCount:I?I.rowCount??f.length:f.length,variant:`plain`,...W})),k&&(0,c.jsx)(`div`,{className:`grid gap-3 md:hidden`,children:$??(Q?(0,c.jsx)(a.LoadingState,{label:`Loading data...`,...T}):z.map(e=>(0,c.jsx)(s.Fragment,{children:k(e)},e.id)))}),(0,c.jsxs)(`div`,{"data-slot":`data-table-wrapper`,"data-density":j,"data-striped":M||void 0,"data-bordered":N||void 0,className:t.cn(`overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,0_10px_24px_rgba(15,23,42,0.07))] backdrop-blur`,k&&`hidden md:block`,Ae),children:[(0,c.jsxs)(i.Table,{containerClassName:`rounded-none border-0 bg-transparent shadow-none ring-0`,className:t.cn(`text-[0.95rem]`,ke),children:[(0,c.jsx)(i.TableHeader,{className:t.cn(P&&`sticky top-0 z-10 shadow-sm backdrop-blur`),children:R.getHeaderGroups().map(e=>(0,c.jsx)(i.TableRow,{children:e.headers.map(e=>(0,c.jsx)(i.TableHead,{style:{width:e.getSize(),...e.column.getIsPinned()===`left`?{left:`${e.column.getStart(`left`)}px`,position:`sticky`,zIndex:P?20:11}:{},...e.column.getIsPinned()===`right`?{right:`${e.column.getAfter(`right`)}px`,position:`sticky`,zIndex:P?20:11}:{}},className:t.cn(ae[j],`bg-[color:color-mix(in_oklch,var(--card),var(--background)_10%)] text-muted-foreground`,P&&`bg-[color:color-mix(in_oklch,var(--card),transparent_12%)] backdrop-blur`,e.column.getIsPinned()&&`bg-card shadow-[1px_0_0_var(--border)]`,N&&`border-r last:border-r-0`,se(e,je)),children:e.isPlaceholder?null:(0,l.flexRender)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,c.jsx)(i.TableBody,{children:$?Ze($):Q?Qe():z.map((e,n)=>{let r=Te?.(e)??!1;return(0,c.jsxs)(s.Fragment,{children:[(0,c.jsx)(i.TableRow,{"data-state":e.getIsSelected()?`selected`:void 0,"data-striped":M&&n%2==1?`true`:void 0,"data-disabled":r||void 0,className:t.cn(A&&!r&&`cursor-pointer`,!r&&`transition-colors hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_96%)] data-[state=selected]:bg-[color:color-mix(in_oklch,var(--primary),transparent_90%)]`,r&&`pointer-events-none opacity-55`,oe(e,Ne)),onClick:()=>{r||A?.(e)},onDoubleClick:()=>{r||we?.(e)},children:e.getVisibleCells().map(e=>{let n=(0,l.flexRender)(e.column.columnDef.cell,e.getContext());return(0,c.jsx)(i.TableCell,{style:{...e.column.getIsPinned()===`left`?{left:`${e.column.getStart(`left`)}px`,position:`sticky`,zIndex:10}:{},...e.column.getIsPinned()===`right`?{right:`${e.column.getAfter(`right`)}px`,position:`sticky`,zIndex:10}:{}},className:t.cn(u[j],e.column.getIsPinned()&&`bg-card shadow-[1px_0_0_var(--border)]`,N&&`border-r last:border-r-0`,ce(e,Me)),children:le(n)?Oe:n},e.id)})}),e.getIsExpanded()&&Pe&&(0,c.jsx)(i.TableRow,{className:`bg-muted/50 hover:bg-muted/50`,children:(0,c.jsx)(i.TableCell,{colSpan:e.getVisibleCells().length,children:Pe(e)})})]},e.id)})})]}),Xe&&I&&(0,c.jsx)(re.DataTablePagination,{pageIndex:I.pageIndex,pageSize:I.pageSize,pageCount:I.pageCount,rowCount:I.rowCount,pageSizeOptions:I.pageSizeOptions,showPageSize:I.showPageSize,labels:I.labels,disabled:w,onPageChange:I.onPageChange,onPageSizeChange:I.onPageSizeChange})]})]})}exports.DataTable=d;
|
|
@@ -6,7 +6,7 @@ import { type DataTableRowAction } from "@/components/data-table/data-table-row-
|
|
|
6
6
|
import { type DataTableToolbarProps } from "@/components/data-table/data-table-toolbar";
|
|
7
7
|
import { type DataStateProps } from "@/components/display/data-state";
|
|
8
8
|
import { type LoadingStateProps } from "@/components/feedback/loading-state";
|
|
9
|
-
import { type
|
|
9
|
+
import { type InputSearchProps } from "@/components/ui/input";
|
|
10
10
|
export type DataTableDensity = "compact" | "default" | "comfortable";
|
|
11
11
|
export type DataTableLoadingVariant = "skeleton" | "state";
|
|
12
12
|
export type DataTableFeatureConfig = {
|
|
@@ -17,7 +17,7 @@ export type DataTableFeatureConfig = {
|
|
|
17
17
|
refresh?: boolean;
|
|
18
18
|
export?: boolean;
|
|
19
19
|
};
|
|
20
|
-
export type DataTableSearchConfig = Pick<
|
|
20
|
+
export type DataTableSearchConfig = Pick<InputSearchProps, "value" | "onValueChange" | "placeholder" | "inputClassName" | "disabled" | "clearable" | "clearLabel" | "searchIcon"> & {
|
|
21
21
|
className?: string;
|
|
22
22
|
wrapperClassName?: string;
|
|
23
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { Button as t } from "../ui/button/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Input as n } from "../ui/input/index.js";
|
|
4
4
|
import { Table as r, TableBody as ee, TableCell as i, TableHead as te, TableHeader as ne, TableRow as a } from "../ui/table/index.js";
|
|
5
5
|
import { LoadingState as o } from "../feedback/loading-state.js";
|
|
6
6
|
import { DataState as s } from "../display/data-state.js";
|
|
@@ -78,6 +78,7 @@ function p({ className: p, columns: m, data: h, title: g, description: _, featur
|
|
|
78
78
|
H,
|
|
79
79
|
B
|
|
80
80
|
]), W = B.getVisibleLeafColumns(), $e = Math.max(W.length, 1), G = typeof O == "function" ? O(B) : O, K = typeof k == "function" ? k(B) : k, q = typeof b == "function" ? b(U) : b, J = typeof x == "function" ? x(U) : x, et = !!(y && v?.search !== !1), tt = !!(v?.columnVisibility && B.getAllLeafColumns().some((e) => e.getCanHide())), Y = !!(v?.refresh && T), X = !!(v?.export && E), nt = !!(v?.bulkActions !== !1 && w?.length), Z = tt && !!(g || _ || y || q || J || S || Y || X), rt = et && y ? /* @__PURE__ */ l(n, {
|
|
81
|
+
type: "search",
|
|
81
82
|
value: y.value,
|
|
82
83
|
onValueChange: y.onValueChange,
|
|
83
84
|
placeholder: y.placeholder ?? "Search...",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o(e,t,n){return t<=0?0:n?(e%t+t)%t:Math.min(Math.max(e,0),t-1)}function s({index:e,defaultIndex:s=0,onIndexChange:c,loop:l=!1,variant:u=`default`,showDots:d=!0,showArrows:f=!0,keyboard:p=!0,ariaLabel:m=`Carousel`,previousLabel:h=`Previous slide`,nextLabel:g=`Next slide`,swipeThreshold:_=44,autoplay:v=!1,autoplayInterval:y=4500,pauseOnHover:b=!0,stopAutoplayOnInteraction:x=!0,showPlaybackControl:S=!1,playLabel:C=`Start autoplay`,pauseLabel:w=`Pause autoplay`,onAutoplayChange:T,
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o(e,t,n){return t<=0?0:n?(e%t+t)%t:Math.min(Math.max(e,0),t-1)}function s({index:e,defaultIndex:s=0,onIndexChange:c,loop:l=!1,variant:u=`default`,showDots:d=!0,showArrows:f=!0,keyboard:p=!0,ariaLabel:m=`Carousel`,previousLabel:h=`Previous slide`,nextLabel:g=`Next slide`,swipeThreshold:_=44,autoplay:v=!1,autoplayInterval:y=4500,pauseOnHover:b=!0,stopAutoplayOnInteraction:x=!0,showPlaybackControl:S=!1,playLabel:C=`Start autoplay`,pauseLabel:w=`Pause autoplay`,onAutoplayChange:T,viewportClassName:E,controlsClassName:D,dotsClassName:O,arrowClassName:k,dotClassName:A,activeDotClassName:j,className:M,children:N,...P}){let F=r.Children.toArray(N),[I,L]=r.useState(s),R=r.useRef(null),[z,B]=r.useState(!1),[V,H]=r.useState(!1),[U,W]=r.useState(v),G=e!==void 0,K=o(G?e:I,F.length,l);r.useEffect(()=>{W(v)},[v]);function q(e,t=`manual`){let n=o(e,F.length,l);G||L(n),t===`manual`&&x&&(H(!0),U&&(W(!1),T?.(!1))),c?.(n)}let J=l||K>0,Y=l||K<F.length-1;return r.useEffect(()=>{if(!U||F.length<=1||V||b&&z)return;let e=window.setInterval(()=>{if(!l&&K>=F.length-1){q(0,`autoplay`);return}q(K+1,`autoplay`)},y);return()=>{window.clearInterval(e)}},[K,U,y,V,z,F.length,l,b]),(0,a.jsxs)(`div`,{"data-slot":`carousel`,"data-variant":u,role:`region`,"aria-roledescription":`carousel`,"aria-label":m,tabIndex:p?0:void 0,className:t.cn(`grid gap-3`,M),onKeyDown:e=>{!p||F.length<=1||(e.key===`ArrowLeft`&&J&&(e.preventDefault(),q(K-1)),e.key===`ArrowRight`&&Y&&(e.preventDefault(),q(K+1)))},onTouchStart:e=>{R.current=e.touches[0]?.clientX??null},onTouchEnd:e=>{if(R.current==null||F.length<=1)return;let t=(e.changedTouches[0]?.clientX??R.current)-R.current;R.current=null,!(Math.abs(t)<_)&&(t>0&&J&&q(K-1),t<0&&Y&&q(K+1))},onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),...P,children:[(0,a.jsxs)(`div`,{className:t.cn(`relative overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08))]`,u===`hero`&&`min-h-72`,u===`minimal`&&`rounded-[var(--radius-md)] shadow-none`,E),children:[(0,a.jsx)(`div`,{className:`transition-transform duration-300 ease-out`,"aria-live":`polite`,children:F[K]}),f&&F.length>1?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Button,{type:`button`,variant:u===`hero`?`default`:`secondary`,size:`icon-sm`,className:t.cn(`absolute left-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg`,k),disabled:!J,"aria-label":h,onClick:()=>q(K-1),children:(0,a.jsx)(i.ChevronLeftIcon,{})}),(0,a.jsx)(n.Button,{type:`button`,variant:u===`hero`?`default`:`secondary`,size:`icon-sm`,className:t.cn(`absolute right-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg`,k),disabled:!Y,"aria-label":g,onClick:()=>q(K+1),children:(0,a.jsx)(i.ChevronRightIcon,{})})]}):null]}),d&&F.length>1&&(0,a.jsxs)(`div`,{className:t.cn(`flex flex-wrap items-center justify-center gap-2`,O),role:`tablist`,"aria-label":`${m} slides`,children:[F.map((e,n)=>(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-label":`Go to slide ${n+1}`,"aria-selected":n===K,className:t.cn(`h-2.5 rounded-full bg-muted-foreground/30 transition-[width,background-color,opacity] hover:bg-muted-foreground/55`,n===K?t.cn(`w-7 bg-primary`,j):t.cn(`w-2.5`,A)),onClick:()=>q(n)},n)),S?(0,a.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`sm`,className:t.cn(`ml-2 rounded-full`,D),onClick:()=>{let e=!U;H(!1),W(e),T?.(e)},children:U?w:C}):null]})]})}function c({className:e,...n}){return(0,a.jsx)(`div`,{"data-slot":`carousel-item`,className:t.cn(`min-h-40 p-5 sm:p-6`,e),...n})}exports.Carousel=s,exports.CarouselItem=c;
|
|
@@ -20,8 +20,14 @@ export type CarouselProps = React.ComponentProps<"div"> & {
|
|
|
20
20
|
playLabel?: string;
|
|
21
21
|
pauseLabel?: string;
|
|
22
22
|
onAutoplayChange?: (playing: boolean) => void;
|
|
23
|
+
viewportClassName?: string;
|
|
24
|
+
controlsClassName?: string;
|
|
25
|
+
dotsClassName?: string;
|
|
26
|
+
arrowClassName?: string;
|
|
27
|
+
dotClassName?: string;
|
|
28
|
+
activeDotClassName?: string;
|
|
23
29
|
};
|
|
24
30
|
export type CarouselItemProps = React.ComponentProps<"div">;
|
|
25
|
-
declare function Carousel({ index, defaultIndex, onIndexChange, loop, variant, showDots, showArrows, keyboard, ariaLabel, previousLabel, nextLabel, swipeThreshold, autoplay, autoplayInterval, pauseOnHover, stopAutoplayOnInteraction, showPlaybackControl, playLabel, pauseLabel, onAutoplayChange, className, children, ...props }: CarouselProps): React.JSX.Element;
|
|
31
|
+
declare function Carousel({ index, defaultIndex, onIndexChange, loop, variant, showDots, showArrows, keyboard, ariaLabel, previousLabel, nextLabel, swipeThreshold, autoplay, autoplayInterval, pauseOnHover, stopAutoplayOnInteraction, showPlaybackControl, playLabel, pauseLabel, onAutoplayChange, viewportClassName, controlsClassName, dotsClassName, arrowClassName, dotClassName, activeDotClassName, className, children, ...props }: CarouselProps): React.JSX.Element;
|
|
26
32
|
declare function CarouselItem({ className, ...props }: CarouselItemProps): React.JSX.Element;
|
|
27
33
|
export { Carousel, CarouselItem };
|
|
@@ -7,35 +7,35 @@ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
7
7
|
function c(e, t, n) {
|
|
8
8
|
return t <= 0 ? 0 : n ? (e % t + t) % t : Math.min(Math.max(e, 0), t - 1);
|
|
9
9
|
}
|
|
10
|
-
function l({ index: l, defaultIndex: u = 0, onIndexChange: d, loop: f = !1, variant: p = "default", showDots: m = !0, showArrows: h = !0, keyboard: g = !0, ariaLabel: _ = "Carousel", previousLabel: v = "Previous slide", nextLabel: y = "Next slide", swipeThreshold: b = 44, autoplay: x = !1, autoplayInterval: S = 4500, pauseOnHover: C = !0, stopAutoplayOnInteraction: w = !0, showPlaybackControl: T = !1, playLabel: E = "Start autoplay", pauseLabel: D = "Pause autoplay", onAutoplayChange: O,
|
|
11
|
-
let
|
|
10
|
+
function l({ index: l, defaultIndex: u = 0, onIndexChange: d, loop: f = !1, variant: p = "default", showDots: m = !0, showArrows: h = !0, keyboard: g = !0, ariaLabel: _ = "Carousel", previousLabel: v = "Previous slide", nextLabel: y = "Next slide", swipeThreshold: b = 44, autoplay: x = !1, autoplayInterval: S = 4500, pauseOnHover: C = !0, stopAutoplayOnInteraction: w = !0, showPlaybackControl: T = !1, playLabel: E = "Start autoplay", pauseLabel: D = "Pause autoplay", onAutoplayChange: O, viewportClassName: k, controlsClassName: A, dotsClassName: j, arrowClassName: M, dotClassName: N, activeDotClassName: P, className: F, children: I, ...L }) {
|
|
11
|
+
let R = n.Children.toArray(I), [z, B] = n.useState(u), V = n.useRef(null), [H, U] = n.useState(!1), [W, G] = n.useState(!1), [K, q] = n.useState(x), J = l !== void 0, Y = c(J ? l : z, R.length, f);
|
|
12
12
|
n.useEffect(() => {
|
|
13
|
-
|
|
13
|
+
q(x);
|
|
14
14
|
}, [x]);
|
|
15
|
-
function
|
|
16
|
-
let n = c(e,
|
|
17
|
-
|
|
15
|
+
function X(e, t = "manual") {
|
|
16
|
+
let n = c(e, R.length, f);
|
|
17
|
+
J || B(n), t === "manual" && w && (G(!0), K && (q(!1), O?.(!1))), d?.(n);
|
|
18
18
|
}
|
|
19
|
-
let
|
|
19
|
+
let Z = f || Y > 0, Q = f || Y < R.length - 1;
|
|
20
20
|
return n.useEffect(() => {
|
|
21
|
-
if (!
|
|
21
|
+
if (!K || R.length <= 1 || W || C && H) return;
|
|
22
22
|
let e = window.setInterval(() => {
|
|
23
|
-
if (!f &&
|
|
24
|
-
|
|
23
|
+
if (!f && Y >= R.length - 1) {
|
|
24
|
+
X(0, "autoplay");
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
X(Y + 1, "autoplay");
|
|
28
28
|
}, S);
|
|
29
29
|
return () => {
|
|
30
30
|
window.clearInterval(e);
|
|
31
31
|
};
|
|
32
32
|
}, [
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
Y,
|
|
34
|
+
K,
|
|
35
35
|
S,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
W,
|
|
37
|
+
H,
|
|
38
|
+
R.length,
|
|
39
39
|
f,
|
|
40
40
|
C
|
|
41
41
|
]), /* @__PURE__ */ s("div", {
|
|
@@ -45,67 +45,67 @@ function l({ index: l, defaultIndex: u = 0, onIndexChange: d, loop: f = !1, vari
|
|
|
45
45
|
"aria-roledescription": "carousel",
|
|
46
46
|
"aria-label": _,
|
|
47
47
|
tabIndex: g ? 0 : void 0,
|
|
48
|
-
className: e("grid gap-3",
|
|
48
|
+
className: e("grid gap-3", F),
|
|
49
49
|
onKeyDown: (e) => {
|
|
50
|
-
!g ||
|
|
50
|
+
!g || R.length <= 1 || (e.key === "ArrowLeft" && Z && (e.preventDefault(), X(Y - 1)), e.key === "ArrowRight" && Q && (e.preventDefault(), X(Y + 1)));
|
|
51
51
|
},
|
|
52
52
|
onTouchStart: (e) => {
|
|
53
|
-
|
|
53
|
+
V.current = e.touches[0]?.clientX ?? null;
|
|
54
54
|
},
|
|
55
55
|
onTouchEnd: (e) => {
|
|
56
|
-
if (
|
|
57
|
-
let t = (e.changedTouches[0]?.clientX ??
|
|
58
|
-
|
|
56
|
+
if (V.current == null || R.length <= 1) return;
|
|
57
|
+
let t = (e.changedTouches[0]?.clientX ?? V.current) - V.current;
|
|
58
|
+
V.current = null, !(Math.abs(t) < b) && (t > 0 && Z && X(Y - 1), t < 0 && Q && X(Y + 1));
|
|
59
59
|
},
|
|
60
|
-
onMouseEnter: () =>
|
|
61
|
-
onMouseLeave: () =>
|
|
62
|
-
...
|
|
60
|
+
onMouseEnter: () => U(!0),
|
|
61
|
+
onMouseLeave: () => U(!1),
|
|
62
|
+
...L,
|
|
63
63
|
children: [/* @__PURE__ */ s("div", {
|
|
64
|
-
className: e("relative overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08))]", p === "hero" && "min-h-72", p === "minimal" && "rounded-[var(--radius-md)] shadow-none"),
|
|
64
|
+
className: e("relative overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08))]", p === "hero" && "min-h-72", p === "minimal" && "rounded-[var(--radius-md)] shadow-none", k),
|
|
65
65
|
children: [/* @__PURE__ */ o("div", {
|
|
66
66
|
className: "transition-transform duration-300 ease-out",
|
|
67
67
|
"aria-live": "polite",
|
|
68
|
-
children:
|
|
69
|
-
}), h &&
|
|
68
|
+
children: R[Y]
|
|
69
|
+
}), h && R.length > 1 ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(t, {
|
|
70
70
|
type: "button",
|
|
71
71
|
variant: p === "hero" ? "default" : "secondary",
|
|
72
72
|
size: "icon-sm",
|
|
73
|
-
className: "absolute left-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg",
|
|
74
|
-
disabled: !
|
|
73
|
+
className: e("absolute left-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg", M),
|
|
74
|
+
disabled: !Z,
|
|
75
75
|
"aria-label": v,
|
|
76
|
-
onClick: () =>
|
|
76
|
+
onClick: () => X(Y - 1),
|
|
77
77
|
children: /* @__PURE__ */ o(r, {})
|
|
78
78
|
}), /* @__PURE__ */ o(t, {
|
|
79
79
|
type: "button",
|
|
80
80
|
variant: p === "hero" ? "default" : "secondary",
|
|
81
81
|
size: "icon-sm",
|
|
82
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg",
|
|
83
|
-
disabled: !
|
|
82
|
+
className: e("absolute right-3 top-1/2 -translate-y-1/2 rounded-full shadow-lg", M),
|
|
83
|
+
disabled: !Q,
|
|
84
84
|
"aria-label": y,
|
|
85
|
-
onClick: () =>
|
|
85
|
+
onClick: () => X(Y + 1),
|
|
86
86
|
children: /* @__PURE__ */ o(i, {})
|
|
87
87
|
})] }) : null]
|
|
88
|
-
}), m &&
|
|
89
|
-
className: "flex flex-wrap items-center justify-center gap-2",
|
|
88
|
+
}), m && R.length > 1 && /* @__PURE__ */ s("div", {
|
|
89
|
+
className: e("flex flex-wrap items-center justify-center gap-2", j),
|
|
90
90
|
role: "tablist",
|
|
91
91
|
"aria-label": `${_} slides`,
|
|
92
|
-
children: [
|
|
92
|
+
children: [R.map((t, n) => /* @__PURE__ */ o("button", {
|
|
93
93
|
type: "button",
|
|
94
94
|
role: "tab",
|
|
95
95
|
"aria-label": `Go to slide ${n + 1}`,
|
|
96
|
-
"aria-selected": n ===
|
|
97
|
-
className: e("h-2.5 rounded-full bg-muted-foreground/30 transition-[width,background-color,opacity] hover:bg-muted-foreground/55", n ===
|
|
98
|
-
onClick: () =>
|
|
96
|
+
"aria-selected": n === Y,
|
|
97
|
+
className: e("h-2.5 rounded-full bg-muted-foreground/30 transition-[width,background-color,opacity] hover:bg-muted-foreground/55", n === Y ? e("w-7 bg-primary", P) : e("w-2.5", N)),
|
|
98
|
+
onClick: () => X(n)
|
|
99
99
|
}, n)), T ? /* @__PURE__ */ o(t, {
|
|
100
100
|
type: "button",
|
|
101
101
|
variant: "ghost",
|
|
102
102
|
size: "sm",
|
|
103
|
-
className: "ml-2 rounded-full",
|
|
103
|
+
className: e("ml-2 rounded-full", A),
|
|
104
104
|
onClick: () => {
|
|
105
|
-
let e = !
|
|
106
|
-
|
|
105
|
+
let e = !K;
|
|
106
|
+
G(!1), q(e), O?.(e);
|
|
107
107
|
},
|
|
108
|
-
children:
|
|
108
|
+
children: K ? D : E
|
|
109
109
|
}) : null]
|
|
110
110
|
})]
|
|
111
111
|
});
|
|
@@ -31,7 +31,7 @@ export type InfoCardRenderContext = {
|
|
|
31
31
|
content?: React.ReactNode;
|
|
32
32
|
footer?: React.ReactNode;
|
|
33
33
|
};
|
|
34
|
-
export type InfoCardProps = Omit<React.ComponentProps<typeof Card>, "title" | "content" | "size"> & InfoCardRenderContext & {
|
|
34
|
+
export type InfoCardProps = Omit<React.ComponentProps<typeof Card>, "title" | "content" | "size" | "orientation"> & InfoCardRenderContext & {
|
|
35
35
|
orientation?: InfoCardOrientation;
|
|
36
36
|
variant?: InfoCardVariant;
|
|
37
37
|
size?: InfoCardSize;
|
|
@@ -12,7 +12,7 @@ export type StatusLegendItem = {
|
|
|
12
12
|
hidden?: boolean;
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
|
-
export type StatusLegendProps = React.ComponentProps<typeof Card> & {
|
|
15
|
+
export type StatusLegendProps = Omit<React.ComponentProps<typeof Card>, "orientation"> & {
|
|
16
16
|
title?: React.ReactNode;
|
|
17
17
|
description?: React.ReactNode;
|
|
18
18
|
actions?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../inputs/clearable-input.cjs"),n=require("../inputs/date-input.cjs"),r=require("../inputs/date-range-input.cjs"),i=require("../inputs/money-input.cjs"),a=require("../inputs/masked-input.cjs"),o=require("../inputs/number-input.cjs"),s=require("../inputs/phone-input.cjs"),c=require("../inputs/quantity-input.cjs"),l=require("../inputs/search-input.cjs"),u=require("../ui/input/index.cjs"),d=require("./form-field-shell.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime"),m=require("react-hook-form");function h(e){return{label:e.label,description:e.description,required:e.required,className:e.className,htmlFor:e.id??e.name,layout:e.layout,descriptionPosition:e.descriptionPosition,labelAction:e.labelAction,requiredIndicator:e.requiredIndicator,errorIcon:e.errorIcon,showErrorIcon:e.showErrorIcon,disabled:e.disabled,readOnly:e.readOnly,labelClassName:e.labelClassName,labelRowClassName:e.labelRowClassName,descriptionClassName:e.descriptionClassName,errorClassName:e.errorClassName,contentClassName:e.contentClassName}}function g(e){let f=e.id??e.name,g=h(e),_=e.kind??`text`,v=e.fieldClassName??`w-full`;return(0,p.jsx)(m.Controller,{control:e.control,name:e.name,rules:e.rules,render:({field:m,fieldState:h})=>{let y=h.error?.message,b=d.resolveFormFieldIds(f,{description:e.description,error:y});if(_===`search`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:c,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(l.SearchInput,{...F,id:j??f,name:m.name,ref:m.ref,value:m.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),P?.(e)},onValueChange:e=>{m.onChange(e),N?.(e)}})})}if(_===`password`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:c,labelAction:l,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(u.Input,{...F,type:`password`,id:j??f,ref:m.ref,name:m.name,value:m.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??v,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),P?.(e)},onChange:e=>{let t=e.currentTarget.value;m.onChange(t),N?.(t)},"aria-invalid":h.invalid||void 0})})}if(_===`number`){let{control:t,name:n,label:r,description:i,required:a,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onNumberChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(o.NumberInput,{...I,id:j??f,name:m.name,ref:m.ref,value:m.value??``,disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onNumberChange:e=>{m.onChange(e??N),P?.(e)}})})}if(_===`phone`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,countryCode:P=`+998`,maxDigits:F=12,onValueChange:I,onBlur:L,...R}=e,z=m.value==null?``:String(m.value),B=N===`raw`?s.formatPhoneDigits(z,P,F):z;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(s.PhoneInput,{...R,id:j??f,name:m.name,ref:m.ref,value:B,disabled:C,readOnly:e.readOnly,countryCode:P,maxDigits:F,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),L?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;m.onChange(n),I?.(n,t,e)}})})}if(_===`date`){let{control:t,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(n.DateInput,{...I,id:j??f,name:m.name,ref:m.ref,value:m.value??``,disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onValueChange:e=>{m.onChange(e||N),P?.(e)}})})}if(_===`clearable`){let{control:n,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(t.ClearableInput,{...I,id:j??f,name:m.name,ref:m.ref,value:m.value??``,disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onValueChange:e=>{m.onChange(e||N),P?.(e)}})})}if(_===`masked`){let{control:t,name:n,label:r,description:i,required:o,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,onValueChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(a.MaskedInput,{...I,id:j??f,name:m.name,ref:m.ref,value:String(m.value??``),disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;m.onChange(n),P?.(e,t)}})})}if(_===`money`){let{control:t,name:n,label:r,description:a,required:o,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(i.MoneyInput,{...I,id:j??f,name:m.name,ref:m.ref,value:m.value??null,disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onValueChange:(e,t)=>{m.onChange(e??N),P?.(e,t)}})})}if(_===`quantity`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:j??f,children:(0,p.jsx)(c.QuantityInput,{...I,id:j??f,name:m.name,ref:m.ref,value:m.value,disabled:C,readOnly:e.readOnly,className:A??v,"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,onBlur:e=>{m.onBlur(),F?.(e)},onValueChange:e=>{m.onChange(e??N),P?.(e)}})})}if(_===`date-range`){let{control:t,name:n,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:l,labelAction:u,requiredIndicator:_,errorIcon:v,showErrorIcon:x,disabled:S,labelClassName:C,labelRowClassName:w,descriptionClassName:T,errorClassName:E,contentClassName:D,fieldClassName:O,id:k,kind:A,onValueChange:j,onBlur:M,...N}=e,P=m.value;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:k??f,children:(0,p.jsx)(r.DateRangeInput,{...N,id:k??f,value:P&&typeof P==`object`?{from:P.from,to:P.to}:{from:``,to:``},fromInputProps:{...N.fromInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0},toInputProps:{...N.toInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0},onValueChange:e=>{m.onChange(e),j?.(e)},"aria-invalid":h.invalid||void 0,onBlur:e=>{m.onBlur(),M?.(e)}})})}let{control:x,name:S,label:C,description:w,required:T,className:E,layout:D,descriptionPosition:O,labelAction:k,requiredIndicator:A,errorIcon:j,showErrorIcon:M,disabled:N,readOnly:P,labelClassName:F,labelRowClassName:I,descriptionClassName:L,errorClassName:R,contentClassName:z,fieldClassName:B,transformIn:V,transformOut:H,id:U,kind:W,onChange:G,onBlur:K,...q}=e;return(0,p.jsx)(d.FormFieldShell,{...g,labelId:b.labelId,descriptionId:b.descriptionId,errorId:b.errorId,error:y,htmlFor:U??f,children:(0,p.jsx)(u.Input,{...q,id:U??f,ref:m.ref,name:m.name,value:V?V(m.value):m.value??``,disabled:N,readOnly:P,onBlur:e=>{m.onBlur(),K?.(e)},onChange:e=>{m.onChange(H?H(e):e.target.value),G?.(e)},"aria-invalid":h.invalid||void 0,"aria-describedby":b.describedBy,"aria-errormessage":y?b.errorId:void 0,className:B??v})})}})}exports.FormInput=g;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../inputs/date-input.cjs"),n=require("../inputs/date-range-input.cjs"),r=require("../inputs/money-input.cjs"),i=require("../inputs/masked-input.cjs"),a=require("../inputs/number-input.cjs"),o=require("../inputs/phone-input.cjs"),s=require("../inputs/quantity-input.cjs"),c=require("../ui/input/index.cjs"),l=require("./form-field-shell.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime"),f=require("react-hook-form");function p(e){return{label:e.label,description:e.description,required:e.required,className:e.className,htmlFor:e.id??e.name,layout:e.layout,descriptionPosition:e.descriptionPosition,labelAction:e.labelAction,requiredIndicator:e.requiredIndicator,errorIcon:e.errorIcon,showErrorIcon:e.showErrorIcon,disabled:e.disabled,readOnly:e.readOnly,labelClassName:e.labelClassName,labelRowClassName:e.labelRowClassName,descriptionClassName:e.descriptionClassName,errorClassName:e.errorClassName,contentClassName:e.contentClassName}}function m(e){let u=e.id??e.name,m=p(e),h=e.kind??`text`,g=e.fieldClassName??`w-full`;return(0,d.jsx)(f.Controller,{control:e.control,name:e.name,rules:e.rules,render:({field:f,fieldState:p})=>{let _=p.error?.message,v=l.resolveFormFieldIds(u,{description:e.description,error:_});if(h===`search`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`search`,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onValueChange:e=>{f.onChange(e),N?.(e)}})})}if(h===`password`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`password`,id:j??u,ref:f.ref,name:f.name,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onChange:e=>{let t=e.currentTarget.value;f.onChange(t),N?.(t)},"aria-invalid":p.invalid||void 0})})}if(h===`number`){let{control:t,name:n,label:r,description:i,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onNumberChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(a.NumberInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onNumberChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`phone`){let{control:t,name:n,label:r,description:i,required:a,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,countryCode:P=`+998`,maxDigits:F=12,onValueChange:I,onBlur:L,...R}=e,z=f.value==null?``:String(f.value),B=N===`raw`?o.formatPhoneDigits(z,P,F):z;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(o.PhoneInput,{...R,id:j??u,name:f.name,ref:f.ref,value:B,disabled:C,readOnly:e.readOnly,countryCode:P,maxDigits:F,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),L?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),I?.(n,t,e)}})})}if(h===`date`){let{control:n,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(t.DateInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`clearable`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...I,clearable:!0,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`masked`){let{control:t,name:n,label:r,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(i.MaskedInput,{...I,id:j??u,name:f.name,ref:f.ref,value:String(f.value??``),disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),P?.(e,t)}})})}if(h===`money`){let{control:t,name:n,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(r.MoneyInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??null,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{f.onChange(e??N),P?.(e,t)}})})}if(h===`quantity`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(s.QuantityInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`date-range`){let{control:t,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:g,requiredIndicator:y,errorIcon:b,showErrorIcon:x,disabled:S,labelClassName:C,labelRowClassName:w,descriptionClassName:T,errorClassName:E,contentClassName:D,fieldClassName:O,id:k,kind:A,onValueChange:j,onBlur:M,...N}=e,P=f.value;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:k??u,children:(0,d.jsx)(n.DateRangeInput,{...N,id:k??u,value:P&&typeof P==`object`?{from:P.from,to:P.to}:{from:``,to:``},fromInputProps:{...N.fromInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},toInputProps:{...N.toInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},onValueChange:e=>{f.onChange(e),j?.(e)},"aria-invalid":p.invalid||void 0,onBlur:e=>{f.onBlur(),M?.(e)}})})}let{control:y,name:b,label:x,description:S,required:C,className:w,layout:T,descriptionPosition:E,labelAction:D,requiredIndicator:O,errorIcon:k,showErrorIcon:A,disabled:j,readOnly:M,labelClassName:N,labelRowClassName:P,descriptionClassName:F,errorClassName:I,contentClassName:L,fieldClassName:R,transformIn:z,transformOut:B,id:V,kind:H,onChange:U,onBlur:W,...G}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:V??u,children:(0,d.jsx)(c.Input,{...G,id:V??u,ref:f.ref,name:f.name,value:z?z(f.value):f.value??``,disabled:j,readOnly:M,onBlur:e=>{f.onBlur(),W?.(e)},onChange:e=>{f.onChange(B?B(e):e.target.value),U?.(e)},"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,className:R??g})})}})}exports.FormInput=m;
|
|
@@ -2,13 +2,12 @@ import * as React from "react";
|
|
|
2
2
|
import { type Control, type FieldPath, type FieldValues, type RegisterOptions } from "react-hook-form";
|
|
3
3
|
import { type DateRangeInputProps, type DateRangeValue } from "@/components/inputs/date-range-input";
|
|
4
4
|
import { type DateInputProps } from "@/components/inputs/date-input";
|
|
5
|
+
import { type InputClearableProps, type InputSearchProps } from "@/components/ui/input";
|
|
5
6
|
import { type MaskedInputProps } from "@/components/inputs/masked-input";
|
|
6
7
|
import { type MoneyInputProps } from "@/components/inputs/money-input";
|
|
7
8
|
import { type NumberInputProps } from "@/components/inputs/number-input";
|
|
8
9
|
import { type PhoneInputProps } from "@/components/inputs/phone-input";
|
|
9
10
|
import { type QuantityInputProps } from "@/components/inputs/quantity-input";
|
|
10
|
-
import { type SearchInputProps } from "@/components/inputs/search-input";
|
|
11
|
-
import { type ClearableInputProps } from "@/components/inputs/clearable-input";
|
|
12
11
|
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
13
12
|
export type FormInputKind = "text" | "search" | "password" | "number" | "phone" | "date" | "date-range" | "clearable" | "masked" | "money" | "quantity";
|
|
14
13
|
export type FormInputPhoneInputValueMode = "raw" | "masked";
|
|
@@ -28,7 +27,7 @@ export type FormTextInputProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
28
27
|
transformIn?: (value: unknown) => string | number | readonly string[] | undefined;
|
|
29
28
|
transformOut?: (event: TextInputElementChangeEvent) => unknown;
|
|
30
29
|
};
|
|
31
|
-
export type FormInputSearchVariantProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<
|
|
30
|
+
export type FormInputSearchVariantProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<InputSearchProps, "name" | "value" | "defaultValue" | "onValueChange" | "kind"> & FormControlledFieldProps<TFieldValues, TName> & {
|
|
32
31
|
kind: "search";
|
|
33
32
|
onValueChange?: (value: string) => void;
|
|
34
33
|
};
|
|
@@ -57,7 +56,7 @@ export type FormInputDateRangeVariantProps<TFieldValues extends FieldValues = Fi
|
|
|
57
56
|
kind: "date-range";
|
|
58
57
|
onValueChange?: (value: DateRangeValue) => void;
|
|
59
58
|
};
|
|
60
|
-
export type FormInputClearableVariantProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<
|
|
59
|
+
export type FormInputClearableVariantProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<InputClearableProps, "name" | "value" | "defaultValue" | "onValueChange" | "kind"> & FormControlledFieldProps<TFieldValues, TName> & {
|
|
61
60
|
kind: "clearable";
|
|
62
61
|
emptyValue?: unknown;
|
|
63
62
|
onValueChange?: (value: string) => void;
|