@codefast/ui 0.0.19 → 0.0.21
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.js +1 -8
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs +1 -8
- package/dist/accordion.mjs.map +1 -1
- package/dist/button.d.mts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/command.d.mts +15 -15
- package/dist/command.d.ts +15 -15
- package/dist/command.js +2 -9
- package/dist/command.js.map +1 -1
- package/dist/command.mjs +2 -9
- package/dist/command.mjs.map +1 -1
- package/dist/data-table.js +5 -5
- package/dist/data-table.js.map +1 -1
- package/dist/data-table.mjs +5 -5
- package/dist/data-table.mjs.map +1 -1
- package/dist/drawer.js +2 -2
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +2 -2
- package/dist/drawer.mjs.map +1 -1
- package/dist/form.js +2 -1
- package/dist/form.js.map +1 -1
- package/dist/form.mjs +1 -0
- package/dist/form.mjs.map +1 -1
- package/dist/navigation-menu.js +3 -3
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs +3 -3
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/progress.js +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/progress.mjs +1 -1
- package/dist/progress.mjs.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.mjs +1 -1
- package/dist/radio-group.mjs.map +1 -1
- package/dist/resizable.js +1 -1
- package/dist/resizable.js.map +1 -1
- package/dist/resizable.mjs +1 -1
- package/dist/resizable.mjs.map +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/sheet.mjs +1 -1
- package/dist/sheet.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
- package/src/accordion.tsx +1 -5
- package/src/command.tsx +2 -6
- package/src/data-table.tsx +5 -5
- package/src/drawer.tsx +2 -2
- package/src/form.tsx +2 -0
- package/src/navigation-menu.tsx +3 -3
- package/src/progress.tsx +1 -1
- package/src/radio-group.tsx +1 -1
- package/src/resizable.tsx +1 -1
- package/src/sheet.tsx +1 -1
package/dist/data-table.mjs
CHANGED
|
@@ -42,7 +42,7 @@ function DataTableViewOptions({ table }) {
|
|
|
42
42
|
/* @__PURE__ */ jsx(MixerHorizontalIcon, { className: "mr-2 size-4" }),
|
|
43
43
|
"View"
|
|
44
44
|
] }) }),
|
|
45
|
-
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-
|
|
45
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-36", children: [
|
|
46
46
|
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
47
47
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
48
48
|
table.getAllColumns().filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide()).map((column) => {
|
|
@@ -85,13 +85,13 @@ function DataTablePagination({
|
|
|
85
85
|
table.setPageSize(Number(value));
|
|
86
86
|
},
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 w-
|
|
89
|
-
/* @__PURE__ */ jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsx(SelectItem, { value:
|
|
88
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 w-16", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
|
|
89
|
+
/* @__PURE__ */ jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsx(SelectItem, { value: String(pageSize), children: pageSize }, pageSize)) })
|
|
90
90
|
]
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */ jsxs("div", { className: "flex w-
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-28 items-center justify-center text-sm font-medium", children: [
|
|
95
95
|
"Page ",
|
|
96
96
|
table.getState().pagination.pageIndex + 1,
|
|
97
97
|
" of ",
|
|
@@ -170,7 +170,7 @@ function DataTableColumnHeader({
|
|
|
170
170
|
className
|
|
171
171
|
}) {
|
|
172
172
|
if (!column.getCanSort()) {
|
|
173
|
-
return /* @__PURE__ */ jsx("div", { className
|
|
173
|
+
return /* @__PURE__ */ jsx("div", { className, children: title });
|
|
174
174
|
}
|
|
175
175
|
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center space-x-2", className), children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
176
176
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "xs", className: "data-[state=open]:bg-accent -ml-3", children: [
|
package/dist/data-table.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport { type SortDirection } from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== \"undefined\" && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn(\"flex items-center justify-between px-2\", className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | SortDirection }): React.JSX.Element {\n switch (sorted) {\n case \"desc\":\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case \"asc\":\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0BC,SACE,KADF;AAJR,SAAS,qBAA4B,EAAE,MAAM,GAAwD;AACnG,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B,+BAAC,UAAO,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KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;AAEA,SAAS,SAAS,EAAE,OAAO,GAAyD;AAClF,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,IAChD,KAAK;AACH,aAAO,oBAAC,eAAY,WAAU,eAAc;AAAA,IAC9C;AACE,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,EAClD;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport { type SortDirection } from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== \"undefined\" && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn(\"flex items-center justify-between px-2\", className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-16\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | SortDirection }): React.JSX.Element {\n switch (sorted) {\n case \"desc\":\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case \"asc\":\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0BC,SACE,KADF;AAJR,SAAS,qBAA4B,EAAE,MAAM,GAAwD;AACnG,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B,+BAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,8BAC5C;AAAA,0BAAC,uBAAoB,WAAU,eAAc;AAAA,MAAE;AAAA,OAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,QACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cA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AAAA,IAChD,KAAK;AACH,aAAO,oBAAC,eAAY,WAAU,eAAc;AAAA,IAC9C;AACE,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,EAClD;AACF;","names":[]}
|
package/dist/drawer.js
CHANGED
|
@@ -20,12 +20,12 @@ var DrawerContent = React.forwardRef(
|
|
|
20
20
|
{
|
|
21
21
|
ref,
|
|
22
22
|
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
23
|
-
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-
|
|
23
|
+
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",
|
|
24
24
|
className
|
|
25
25
|
),
|
|
26
26
|
...props,
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted mx-auto mt-4 h-2 w-
|
|
28
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted mx-auto mt-4 h-2 w-24 rounded-full" }),
|
|
29
29
|
children
|
|
30
30
|
]
|
|
31
31
|
}
|
package/dist/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC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AAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
|
package/dist/drawer.mjs
CHANGED
|
@@ -20,12 +20,12 @@ var DrawerContent = React.forwardRef(
|
|
|
20
20
|
{
|
|
21
21
|
ref,
|
|
22
22
|
className: cn(
|
|
23
|
-
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-
|
|
23
|
+
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",
|
|
24
24
|
className
|
|
25
25
|
),
|
|
26
26
|
...props,
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-24 rounded-full" }),
|
|
29
29
|
children
|
|
30
30
|
]
|
|
31
31
|
}
|
package/dist/drawer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-
|
|
1
|
+
{"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,8BAAC,SAAI,WAAU,+CAA8C;AAAA,UAC5D;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,cAAc,cAAc;AAQ5B,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,GAAG,OAAO;AAChG;AAQA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AACtF;AASA,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACnG;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
|
package/dist/form.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
var _chunkIVYGBU4Gjs = require('./chunk-IVYGBU4G.js');
|
|
4
5
|
|
package/dist/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/form.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AA+ED;AA5DN,IAAM,mBAAyB,oBAA4C,IAAI;AAE/E,IAAM,kBAAwB,oBAA2C,IAAI;AAE7E,IAAM,eAAe,MAWhB;AACH,QAAM,eAAqB,iBAAW,gBAAgB;AACtD,QAAM,cAAoB,iBAAW,eAAe;AACpD,QAAM,EAAE,eAAe,UAAU,IAAI,eAAe;AAEpD,MAAI,CAAC,gBAAgB,CAAC,aAAa;AACjC,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,QAAM,aAAa,cAAc,aAAa,MAAM,SAAS;AAE7D,QAAM,EAAE,GAAG,IAAI;AAEf,SAAO;AAAA,IACL;AAAA,IACA,MAAM,aAAa;AAAA,IACnB,YAAY,aAAa,EAAE;AAAA,IAC3B,mBAAmB,yBAAyB,EAAE;AAAA,IAC9C,eAAe,qBAAqB,EAAE;AAAA,IACtC,GAAG;AAAA,EACL;AACF;AAOA,IAAM,OAAO;AAWb,SAAS,UAGP,EAAE,GAAG,MAAM,GAA2D;AACtE,SACE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,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AACrH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,IAAI;AAE7C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,OAAE,KAAU,IAAI,eAAe,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OACzG,gBACH;AAEJ,CAAC;AAED,YAAY,cAAc","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-destructive\", className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn(\"text-muted-foreground text-[0.8rem]\", className)} {...props} />\n );\n },\n);\n\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-destructive text-[0.8rem] font-medium\", className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
|
package/dist/form.mjs
CHANGED
package/dist/form.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/form.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-destructive\", className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn(\"text-muted-foreground text-[0.8rem]\", className)} {...props} />\n );\n },\n);\n\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-destructive text-[0.8rem] font-medium\", className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AA+ED;AA5DN,IAAM,mBAAyB,oBAA4C,IAAI;AAE/E,IAAM,kBAAwB,oBAA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AE,OAAO,YAAY,mBAAmB,cAAc,IAAI,aAAa;AAE7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,oBAAkB,CAAC,QAAQ,oBAAoB,GAAG,iBAAiB,IAAI,aAAa;AAAA,MACpF,gBAAc,QAAQ,KAAK;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,YAAY,cAAc;AAS1B,IAAM,kBAAwB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,WACE,oBAAC,OAAE,KAAU,IAAI,mBAAmB,WAAW,GAAG,uCAAuC,SAAS,GAAI,GAAG,OAAO;AAAA,EAEpH;AACF;AAEA,gBAAgB,cAAc;AAS9B,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AACrH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,IAAI;AAE7C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,OAAE,KAAU,IAAI,eAAe,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OACzG,gBACH;AAEJ,CAAC;AAED,YAAY,cAAc;","names":[]}
|
package/dist/navigation-menu.js
CHANGED
|
@@ -53,7 +53,7 @@ var NavigationMenuTrigger = React.forwardRef(
|
|
|
53
53
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
54
54
|
_reacticons.ChevronDownIcon,
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
57
57
|
"aria-hidden": "true"
|
|
58
58
|
}
|
|
59
59
|
)
|
|
@@ -78,7 +78,7 @@ var NavigationMenuContent = React.forwardRef(
|
|
|
78
78
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
79
79
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
80
80
|
var NavigationMenuViewport = React.forwardRef(
|
|
81
|
-
({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
81
|
+
({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "perspective-[125rem] absolute left-0 top-full flex justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
82
82
|
NavigationMenuPrimitive.Viewport,
|
|
83
83
|
{
|
|
84
84
|
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
@@ -101,7 +101,7 @@ var NavigationMenuIndicator = React.forwardRef(
|
|
|
101
101
|
className
|
|
102
102
|
),
|
|
103
103
|
...props,
|
|
104
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-border relative top-[60%]
|
|
104
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/navigation-menu.tsx"],"names":[],"mappings":";;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,YAAY,6BAA6B;AAoBrC,SAME,KANF;AAbJ,IAAM,gCAAgC,IAAI;AAAA,EACxC,MAAM;AACR,CAAC;AASD,IAAM,iBAAuB;AAAA,EAC3B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,mEAAmE,SAAS;AAAA,MACzF,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,0BAAuB;AAAA;AAAA;AAAA,EAC1B;AAEJ;AAEA,eAAe,cAA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AAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAU,0EAAyE;AAAA;AAAA,EAC1F;AAEJ;AAEA,wBAAwB,cAAsC,kCAAU","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cn, cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: NavigationMenu\n * -------------------------------------------------------------------------- */\n\nconst navigationMenuTriggerVariants = cva({\n base: \"bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 group inline-flex h-10 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n});\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenu\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuElement = React.ElementRef<typeof NavigationMenuPrimitive.Root>;\ntype NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>;\n\nconst NavigationMenu = React.forwardRef<NavigationMenuElement, NavigationMenuProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n ),\n);\n\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuList\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuListElement = React.ElementRef<typeof NavigationMenuPrimitive.List>;\ntype NavigationMenuListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>;\n\nconst NavigationMenuList = React.forwardRef<NavigationMenuListElement, NavigationMenuListProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n ),\n);\n\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuItem\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuTriggerElement = React.ElementRef<typeof NavigationMenuPrimitive.Trigger>;\ntype NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;\n\nconst NavigationMenuTrigger = React.forwardRef<NavigationMenuTriggerElement, NavigationMenuTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={navigationMenuTriggerVariants({\n className: [\"group\", className],\n })}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className={cn(\"relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180\")}\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n ),\n);\n\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuContentElement = React.ElementRef<typeof NavigationMenuPrimitive.Content>;\ntype NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;\n\nconst NavigationMenuContent = React.forwardRef<NavigationMenuContentElement, NavigationMenuContentProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full focus:outline-none md:absolute md:w-auto\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuLink\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuViewport\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuViewportElement = React.ElementRef<typeof NavigationMenuPrimitive.Viewport>;\ntype NavigationMenuViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;\n\nconst NavigationMenuViewport = React.forwardRef<NavigationMenuViewportElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => (\n <div className={cn(\"perspective-[2000px] absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-md border shadow transition-[width,height] duration-200 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n ),\n);\n\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuIndicator\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuIndicatorElement = React.ElementRef<typeof NavigationMenuPrimitive.Indicator>;\ntype NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;\n\nconst NavigationMenuIndicator = React.forwardRef<NavigationMenuIndicatorElement, NavigationMenuIndicatorProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"data-[state=visible]:animate-in data-[state=visible]:fade-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden transition\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n ),\n);\n\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n navigationMenuTriggerVariants,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n type NavigationMenuProps,\n type NavigationMenuListProps,\n type NavigationMenuItemProps,\n type NavigationMenuContentProps,\n type NavigationMenuTriggerProps,\n type NavigationMenuLinkProps,\n type NavigationMenuIndicatorProps,\n type NavigationMenuViewportProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/navigation-menu.tsx"],"names":[],"mappings":";;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,YAAY,6BAA6B;AAoBrC,SAME,KANF;AAbJ,IAAM,gCAAgC,IAAI;AAAA,EACxC,MAAM;AACR,CAAC;AASD,IAAM,iBAAuB;AAAA,EAC3B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,m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AAEJ;AAEA,uBAAuB,cAAsC,iCAAS;AAStE,IAAM,0BAAgC;AAAA,EACpC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAU,yEAAwE;AAAA;AAAA,EACzF;AAEJ;AAEA,wBAAwB,cAAsC,kCAAU","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cn, cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: NavigationMenu\n * -------------------------------------------------------------------------- */\n\nconst navigationMenuTriggerVariants = cva({\n base: \"bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 group inline-flex h-10 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n});\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenu\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuElement = React.ElementRef<typeof NavigationMenuPrimitive.Root>;\ntype NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>;\n\nconst NavigationMenu = React.forwardRef<NavigationMenuElement, NavigationMenuProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n ),\n);\n\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuList\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuListElement = React.ElementRef<typeof NavigationMenuPrimitive.List>;\ntype NavigationMenuListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>;\n\nconst NavigationMenuList = React.forwardRef<NavigationMenuListElement, NavigationMenuListProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n ),\n);\n\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuItem\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuTriggerElement = React.ElementRef<typeof NavigationMenuPrimitive.Trigger>;\ntype NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;\n\nconst NavigationMenuTrigger = React.forwardRef<NavigationMenuTriggerElement, NavigationMenuTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={navigationMenuTriggerVariants({\n className: [\"group\", className],\n })}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className=\"relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n ),\n);\n\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuContentElement = React.ElementRef<typeof NavigationMenuPrimitive.Content>;\ntype NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;\n\nconst NavigationMenuContent = React.forwardRef<NavigationMenuContentElement, NavigationMenuContentProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full focus:outline-none md:absolute md:w-auto\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuLink\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuViewport\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuViewportElement = React.ElementRef<typeof NavigationMenuPrimitive.Viewport>;\ntype NavigationMenuViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;\n\nconst NavigationMenuViewport = React.forwardRef<NavigationMenuViewportElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => (\n <div className=\"perspective-[125rem] absolute left-0 top-full flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-md border shadow transition-[width,height] duration-200 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n ),\n);\n\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuIndicator\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuIndicatorElement = React.ElementRef<typeof NavigationMenuPrimitive.Indicator>;\ntype NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;\n\nconst NavigationMenuIndicator = React.forwardRef<NavigationMenuIndicatorElement, NavigationMenuIndicatorProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"data-[state=visible]:animate-in data-[state=visible]:fade-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden transition\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n ),\n);\n\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n navigationMenuTriggerVariants,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n type NavigationMenuProps,\n type NavigationMenuListProps,\n type NavigationMenuItemProps,\n type NavigationMenuContentProps,\n type NavigationMenuTriggerProps,\n type NavigationMenuLinkProps,\n type NavigationMenuIndicatorProps,\n type NavigationMenuViewportProps,\n};\n"]}
|
package/dist/navigation-menu.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var NavigationMenuTrigger = React.forwardRef(
|
|
|
53
53
|
/* @__PURE__ */ jsx(
|
|
54
54
|
ChevronDownIcon,
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
57
57
|
"aria-hidden": "true"
|
|
58
58
|
}
|
|
59
59
|
)
|
|
@@ -78,7 +78,7 @@ var NavigationMenuContent = React.forwardRef(
|
|
|
78
78
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
79
79
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
80
80
|
var NavigationMenuViewport = React.forwardRef(
|
|
81
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className:
|
|
81
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "perspective-[125rem] absolute left-0 top-full flex justify-center", children: /* @__PURE__ */ jsx(
|
|
82
82
|
NavigationMenuPrimitive.Viewport,
|
|
83
83
|
{
|
|
84
84
|
className: cn(
|
|
@@ -101,7 +101,7 @@ var NavigationMenuIndicator = React.forwardRef(
|
|
|
101
101
|
className
|
|
102
102
|
),
|
|
103
103
|
...props,
|
|
104
|
-
children: /* @__PURE__ */ jsx("div", { className: "bg-border relative top-[60%]
|
|
104
|
+
children: /* @__PURE__ */ jsx("div", { className: "bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/navigation-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cn, cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: NavigationMenu\n * -------------------------------------------------------------------------- */\n\nconst navigationMenuTriggerVariants = cva({\n base: \"bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 group inline-flex h-10 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n});\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenu\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuElement = React.ElementRef<typeof NavigationMenuPrimitive.Root>;\ntype NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>;\n\nconst NavigationMenu = React.forwardRef<NavigationMenuElement, NavigationMenuProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n ),\n);\n\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuList\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuListElement = React.ElementRef<typeof NavigationMenuPrimitive.List>;\ntype NavigationMenuListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>;\n\nconst NavigationMenuList = React.forwardRef<NavigationMenuListElement, NavigationMenuListProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n ),\n);\n\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuItem\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuTriggerElement = React.ElementRef<typeof NavigationMenuPrimitive.Trigger>;\ntype NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;\n\nconst NavigationMenuTrigger = React.forwardRef<NavigationMenuTriggerElement, NavigationMenuTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={navigationMenuTriggerVariants({\n className: [\"group\", className],\n })}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className={cn(\"relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180\")}\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n ),\n);\n\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuContentElement = React.ElementRef<typeof NavigationMenuPrimitive.Content>;\ntype NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;\n\nconst NavigationMenuContent = React.forwardRef<NavigationMenuContentElement, NavigationMenuContentProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full focus:outline-none md:absolute md:w-auto\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuLink\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuViewport\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuViewportElement = React.ElementRef<typeof NavigationMenuPrimitive.Viewport>;\ntype NavigationMenuViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;\n\nconst NavigationMenuViewport = React.forwardRef<NavigationMenuViewportElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => (\n <div className={cn(\"perspective-[2000px] absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-md border shadow transition-[width,height] duration-200 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n ),\n);\n\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuIndicator\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuIndicatorElement = React.ElementRef<typeof NavigationMenuPrimitive.Indicator>;\ntype NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;\n\nconst NavigationMenuIndicator = React.forwardRef<NavigationMenuIndicatorElement, NavigationMenuIndicatorProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"data-[state=visible]:animate-in data-[state=visible]:fade-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden transition\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n ),\n);\n\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n navigationMenuTriggerVariants,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n type NavigationMenuProps,\n type NavigationMenuListProps,\n type NavigationMenuItemProps,\n type NavigationMenuContentProps,\n type NavigationMenuTriggerProps,\n type NavigationMenuLinkProps,\n type NavigationMenuIndicatorProps,\n type NavigationMenuViewportProps,\n};\n"],"mappings":";;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,YAAY,6BAA6B;AAoBrC,SAME,KANF;AAbJ,IAAM,gCAAgC,IAAI;AAAA,EACxC,MAAM;AACR,CAAC;AASD,IAAM,iBAAuB;AAAA,EAC3B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,mEAAmE,SAAS;AAAA,MACzF,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,0BAAuB;AAAA;AAAA;AAAA,EAC1B;AAEJ;AAEA,eAAe,cAAsC,6BAAK;AAS1D,IAAM,qBAA2B;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,qEAAqE,SAAS;AAAA,MAC3F,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,mBAAmB,cAAsC,6BAAK;AAQ9D,IAAM,qBAA6C;AASnD,IAAM,wBAA8B;AAAA,EAClC,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,8BAA8B;AAAA,QACvC,WAAW,CAAC,SAAS,SAAS;AAAA,MAChC,CAAC;AAAA,MACA,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,wFAAwF;AAAA,YACtG,eAAY;AAAA;AAAA,QACd;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,sBAAsB,cAAsC,gCAAQ;AASpE,IAAM,wBAA8B;AAAA,EAClC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,sBAAsB,cAAsC,gCAAQ;AAQpE,IAAM,qBAA6C;AASnD,IAAM,yBAA+B;AAAA,EACnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,WAAW,GAAG,mEAAmE,GACpF;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAEA,uBAAuB,cAAsC,iCAAS;AAStE,IAAM,0BAAgC;AAAA,EACpC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAU,0EAAyE;AAAA;AAAA,EAC1F;AAEJ;AAEA,wBAAwB,cAAsC,kCAAU;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/navigation-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cn, cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: NavigationMenu\n * -------------------------------------------------------------------------- */\n\nconst navigationMenuTriggerVariants = cva({\n base: \"bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 group inline-flex h-10 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n});\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenu\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuElement = React.ElementRef<typeof NavigationMenuPrimitive.Root>;\ntype NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>;\n\nconst NavigationMenu = React.forwardRef<NavigationMenuElement, NavigationMenuProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n ),\n);\n\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuList\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuListElement = React.ElementRef<typeof NavigationMenuPrimitive.List>;\ntype NavigationMenuListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>;\n\nconst NavigationMenuList = React.forwardRef<NavigationMenuListElement, NavigationMenuListProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n ),\n);\n\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuItem\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuTriggerElement = React.ElementRef<typeof NavigationMenuPrimitive.Trigger>;\ntype NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;\n\nconst NavigationMenuTrigger = React.forwardRef<NavigationMenuTriggerElement, NavigationMenuTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={navigationMenuTriggerVariants({\n className: [\"group\", className],\n })}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className=\"relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n ),\n);\n\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuContent\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuContentElement = React.ElementRef<typeof NavigationMenuPrimitive.Content>;\ntype NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;\n\nconst NavigationMenuContent = React.forwardRef<NavigationMenuContentElement, NavigationMenuContentProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full focus:outline-none md:absolute md:w-auto\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuLink\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuViewport\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuViewportElement = React.ElementRef<typeof NavigationMenuPrimitive.Viewport>;\ntype NavigationMenuViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;\n\nconst NavigationMenuViewport = React.forwardRef<NavigationMenuViewportElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => (\n <div className=\"perspective-[125rem] absolute left-0 top-full flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-md border shadow transition-[width,height] duration-200 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n ),\n);\n\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: NavigationMenuIndicator\n * -------------------------------------------------------------------------- */\n\ntype NavigationMenuIndicatorElement = React.ElementRef<typeof NavigationMenuPrimitive.Indicator>;\ntype NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;\n\nconst NavigationMenuIndicator = React.forwardRef<NavigationMenuIndicatorElement, NavigationMenuIndicatorProps>(\n ({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"data-[state=visible]:animate-in data-[state=visible]:fade-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden transition\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n ),\n);\n\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n navigationMenuTriggerVariants,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n type NavigationMenuProps,\n type NavigationMenuListProps,\n type NavigationMenuItemProps,\n type NavigationMenuContentProps,\n type NavigationMenuTriggerProps,\n type NavigationMenuLinkProps,\n type NavigationMenuIndicatorProps,\n type NavigationMenuViewportProps,\n};\n"],"mappings":";;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,YAAY,6BAA6B;AAoBrC,SAME,KANF;AAbJ,IAAM,gCAAgC,IAAI;AAAA,EACxC,MAAM;AACR,CAAC;AASD,IAAM,iBAAuB;AAAA,EAC3B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,mEAAmE,SAAS;AAAA,MACzF,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,0BAAuB;AAAA;AAAA;AAAA,EAC1B;AAEJ;AAEA,eAAe,cAAsC,6BAAK;AAS1D,IAAM,qBAA2B;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,qEAAqE,SAAS;AAAA,MAC3F,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,mBAAmB,cAAsC,6BAAK;AAQ9D,IAAM,qBAA6C;AASnD,IAAM,wBAA8B;AAAA,EAClC,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW,8BAA8B;AAAA,QACvC,WAAW,CAAC,SAAS,SAAS;AAAA,MAChC,CAAC;AAAA,MACA,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,eAAY;AAAA;AAAA,QACd;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,sBAAsB,cAAsC,gCAAQ;AASpE,IAAM,wBAA8B;AAAA,EAClC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,sBAAsB,cAAsC,gCAAQ;AAQpE,IAAM,qBAA6C;AASnD,IAAM,yBAA+B;AAAA,EACnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,WAAU,qEACb;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAEA,uBAAuB,cAAsC,iCAAS;AAStE,IAAM,0BAAgC;AAAA,EACpC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAyB;AAAA,IAAxB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAU,yEAAwE;AAAA;AAAA,EACzF;AAEJ;AAEA,wBAAwB,cAAsC,kCAAU;","names":[]}
|
package/dist/progress.js
CHANGED
|
@@ -16,7 +16,7 @@ var Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__P
|
|
|
16
16
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
17
17
|
ProgressPrimitive.Indicator,
|
|
18
18
|
{
|
|
19
|
-
className: "bg-primary
|
|
19
|
+
className: "bg-primary size-full flex-1 transition-all",
|
|
20
20
|
style: {
|
|
21
21
|
transform: `translateX(-${String(100 - (_nullishCoalesce(value, () => ( 0))))}%)`
|
|
22
22
|
}
|
package/dist/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/progress.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,uBAAuB;AAgB/B;AANJ,IAAM,WAAiB,iBAA2C,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjG;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,kEAAkE,SAAS;AAAA,IACxF,GAAG;AAAA,IAEJ;AAAA,MAAmB;AAAA,MAAlB;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,WAAW,eAAe,OAAO,OAAO,SAAS,EAAE,CAAC;AAAA,QACtD;AAAA;AAAA,IACF;AAAA;AACF,CACD;AAED,SAAS,cAAgC,uBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Progress\n * -------------------------------------------------------------------------- */\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"bg-primary
|
|
1
|
+
{"version":3,"sources":["../src/progress.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,uBAAuB;AAgB/B;AANJ,IAAM,WAAiB,iBAA2C,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjG;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,kEAAkE,SAAS;AAAA,IACxF,GAAG;AAAA,IAEJ;AAAA,MAAmB;AAAA,MAAlB;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,WAAW,eAAe,OAAO,OAAO,SAAS,EAAE,CAAC;AAAA,QACtD;AAAA;AAAA,IACF;AAAA;AACF,CACD;AAED,SAAS,cAAgC,uBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Progress\n * -------------------------------------------------------------------------- */\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"bg-primary size-full flex-1 transition-all\"\n style={{\n transform: `translateX(-${String(100 - (value ?? 0))}%)`,\n }}\n />\n </ProgressPrimitive.Root>\n));\n\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Progress, type ProgressProps };\n"]}
|
package/dist/progress.mjs
CHANGED
|
@@ -16,7 +16,7 @@ var Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__P
|
|
|
16
16
|
children: /* @__PURE__ */ jsx(
|
|
17
17
|
ProgressPrimitive.Indicator,
|
|
18
18
|
{
|
|
19
|
-
className: "bg-primary
|
|
19
|
+
className: "bg-primary size-full flex-1 transition-all",
|
|
20
20
|
style: {
|
|
21
21
|
transform: `translateX(-${String(100 - (value ?? 0))}%)`
|
|
22
22
|
}
|
package/dist/progress.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Progress\n * -------------------------------------------------------------------------- */\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"bg-primary
|
|
1
|
+
{"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Progress\n * -------------------------------------------------------------------------- */\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"bg-primary size-full flex-1 transition-all\"\n style={{\n transform: `translateX(-${String(100 - (value ?? 0))}%)`,\n }}\n />\n </ProgressPrimitive.Root>\n));\n\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Progress, type ProgressProps };\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,uBAAuB;AAgB/B;AANJ,IAAM,WAAiB,iBAA2C,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjG;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,kEAAkE,SAAS;AAAA,IACxF,GAAG;AAAA,IAEJ;AAAA,MAAmB;AAAA,MAAlB;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,UACL,WAAW,eAAe,OAAO,OAAO,SAAS,EAAE,CAAC;AAAA,QACtD;AAAA;AAAA,IACF;AAAA;AACF,CACD;AAED,SAAS,cAAgC,uBAAK;","names":[]}
|
package/dist/radio-group.js
CHANGED
|
@@ -21,7 +21,7 @@ var RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
21
21
|
className
|
|
22
22
|
),
|
|
23
23
|
...props,
|
|
24
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioGroupPrimitive.Indicator, { className: "after:bg-primary relative flex
|
|
24
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioGroupPrimitive.Indicator, { className: "after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full" })
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
});
|
package/dist/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/radio-group.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,yBAAyB;AAW5B;AADT,IAAM,aAAmB,iBAA+C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACxG,SAAO,oBAAqB,0BAApB,EAAyB,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAAO,KAAU;AAChG,CAAC;AAED,WAAW,cAAkC,yBAAK;AASlD,IAAM,iBAAuB,iBAAuD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACpH,SACE;AAAA,IAAqB;AAAA,IAApB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAqB,+BAApB,EAA8B,WAAU,
|
|
1
|
+
{"version":3,"sources":["../src/radio-group.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,yBAAyB;AAW5B;AADT,IAAM,aAAmB,iBAA+C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACxG,SAAO,oBAAqB,0BAApB,EAAyB,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAAO,KAAU;AAChG,CAAC;AAED,WAAW,cAAkC,yBAAK;AASlD,IAAM,iBAAuB,iBAAuD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACpH,SACE;AAAA,IAAqB;AAAA,IAApB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAqB,+BAApB,EAA8B,WAAU,sHAAqH;AAAA;AAAA,EAChK;AAEJ,CAAC;AAED,eAAe,cAAkC,yBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroup\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;\ntype RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\n\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroupItem\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;\ntype RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"border-compound/70 hover:border-compound text-compound-foreground aria-checked:border-primary focus-visible:ring-ring group peer aspect-square size-4 rounded-full border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full\" />\n </RadioGroupPrimitive.Item>\n );\n});\n\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps };\n"]}
|
package/dist/radio-group.mjs
CHANGED
|
@@ -21,7 +21,7 @@ var RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
21
21
|
className
|
|
22
22
|
),
|
|
23
23
|
...props,
|
|
24
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "after:bg-primary relative flex
|
|
24
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full" })
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
});
|
package/dist/radio-group.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroup\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;\ntype RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\n\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroupItem\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;\ntype RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"border-compound/70 hover:border-compound text-compound-foreground aria-checked:border-primary focus-visible:ring-ring group peer aspect-square size-4 rounded-full border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"after:bg-primary relative flex
|
|
1
|
+
{"version":3,"sources":["../src/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroup\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;\ntype RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;\n\nconst RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\n\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: RadioGroupItem\n * -------------------------------------------------------------------------- */\n\ntype RadioGroupItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;\ntype RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;\n\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"border-compound/70 hover:border-compound text-compound-foreground aria-checked:border-primary focus-visible:ring-ring group peer aspect-square size-4 rounded-full border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full\" />\n </RadioGroupPrimitive.Item>\n );\n});\n\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps };\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,yBAAyB;AAW5B;AADT,IAAM,aAAmB,iBAA+C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACxG,SAAO,oBAAqB,0BAApB,EAAyB,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAAO,KAAU;AAChG,CAAC;AAED,WAAW,cAAkC,yBAAK;AASlD,IAAM,iBAAuB,iBAAuD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACpH,SACE;AAAA,IAAqB;AAAA,IAApB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAqB,+BAApB,EAA8B,WAAU,sHAAqH;AAAA;AAAA,EAChK;AAEJ,CAAC;AAED,eAAe,cAAkC,yBAAK;","names":[]}
|
package/dist/resizable.js
CHANGED
|
@@ -14,7 +14,7 @@ function ResizablePanelGroup({
|
|
|
14
14
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15
15
|
ResizablePrimitive.PanelGroup,
|
|
16
16
|
{
|
|
17
|
-
className: _chunkG3NP7M2Njs.cn.call(void 0, "flex
|
|
17
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "flex size-full data-[panel-group-direction=vertical]:flex-col", className),
|
|
18
18
|
...props
|
|
19
19
|
}
|
|
20
20
|
);
|