myoperator-ui 0.0.163 → 0.0.165
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/index.js +197 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2874,10 +2874,12 @@ export interface TableProps
|
|
|
2874
2874
|
VariantProps<typeof tableVariants> {
|
|
2875
2875
|
/** Remove outer border from the table */
|
|
2876
2876
|
withoutBorder?: boolean;
|
|
2877
|
+
/** Allow cell content to wrap to multiple lines. By default, content is kept on a single line with horizontal scroll. */
|
|
2878
|
+
wrapContent?: boolean;
|
|
2877
2879
|
}
|
|
2878
2880
|
|
|
2879
2881
|
const Table = React.forwardRef<HTMLTableElement, TableProps>(
|
|
2880
|
-
({ className, size, withoutBorder, ...props }, ref) => (
|
|
2882
|
+
({ className, size, withoutBorder, wrapContent, ...props }, ref) => (
|
|
2881
2883
|
<div
|
|
2882
2884
|
className={cn(
|
|
2883
2885
|
"relative w-full overflow-auto",
|
|
@@ -2886,7 +2888,11 @@ const Table = React.forwardRef<HTMLTableElement, TableProps>(
|
|
|
2886
2888
|
>
|
|
2887
2889
|
<table
|
|
2888
2890
|
ref={ref}
|
|
2889
|
-
className={cn(
|
|
2891
|
+
className={cn(
|
|
2892
|
+
tableVariants({ size }),
|
|
2893
|
+
!wrapContent && "[&_th]:whitespace-nowrap [&_td]:whitespace-nowrap",
|
|
2894
|
+
className
|
|
2895
|
+
)}
|
|
2890
2896
|
{...props}
|
|
2891
2897
|
/>
|
|
2892
2898
|
</div>
|
|
@@ -5887,6 +5893,195 @@ const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(
|
|
|
5887
5893
|
PageHeader.displayName = "PageHeader";
|
|
5888
5894
|
|
|
5889
5895
|
export { PageHeader, pageHeaderVariants };
|
|
5896
|
+
`, prefix)
|
|
5897
|
+
}
|
|
5898
|
+
]
|
|
5899
|
+
},
|
|
5900
|
+
"pagination": {
|
|
5901
|
+
name: "pagination",
|
|
5902
|
+
description: "A composable pagination component with page navigation, next/previous links, and ellipsis",
|
|
5903
|
+
category: "layout",
|
|
5904
|
+
dependencies: [
|
|
5905
|
+
"clsx",
|
|
5906
|
+
"tailwind-merge",
|
|
5907
|
+
"lucide-react"
|
|
5908
|
+
],
|
|
5909
|
+
internalDependencies: [
|
|
5910
|
+
"button"
|
|
5911
|
+
],
|
|
5912
|
+
files: [
|
|
5913
|
+
{
|
|
5914
|
+
name: "pagination.tsx",
|
|
5915
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
5916
|
+
import {
|
|
5917
|
+
ChevronLeftIcon,
|
|
5918
|
+
ChevronRightIcon,
|
|
5919
|
+
MoreHorizontalIcon,
|
|
5920
|
+
} from "lucide-react";
|
|
5921
|
+
|
|
5922
|
+
import { cn } from "../../lib/utils";
|
|
5923
|
+
import { buttonVariants, type ButtonProps } from "./button";
|
|
5924
|
+
|
|
5925
|
+
export interface PaginationProps extends React.ComponentProps<"nav"> {
|
|
5926
|
+
/** Additional CSS classes for the nav wrapper */
|
|
5927
|
+
className?: string;
|
|
5928
|
+
}
|
|
5929
|
+
|
|
5930
|
+
function Pagination({ className, ...props }: PaginationProps) {
|
|
5931
|
+
return (
|
|
5932
|
+
<nav
|
|
5933
|
+
role="navigation"
|
|
5934
|
+
aria-label="pagination"
|
|
5935
|
+
data-slot="pagination"
|
|
5936
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
5937
|
+
{...props}
|
|
5938
|
+
/>
|
|
5939
|
+
);
|
|
5940
|
+
}
|
|
5941
|
+
Pagination.displayName = "Pagination";
|
|
5942
|
+
|
|
5943
|
+
export interface PaginationContentProps extends React.ComponentProps<"ul"> {
|
|
5944
|
+
/** Additional CSS classes for the list container */
|
|
5945
|
+
className?: string;
|
|
5946
|
+
}
|
|
5947
|
+
|
|
5948
|
+
function PaginationContent({
|
|
5949
|
+
className,
|
|
5950
|
+
...props
|
|
5951
|
+
}: PaginationContentProps) {
|
|
5952
|
+
return (
|
|
5953
|
+
<ul
|
|
5954
|
+
data-slot="pagination-content"
|
|
5955
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
5956
|
+
{...props}
|
|
5957
|
+
/>
|
|
5958
|
+
);
|
|
5959
|
+
}
|
|
5960
|
+
PaginationContent.displayName = "PaginationContent";
|
|
5961
|
+
|
|
5962
|
+
export interface PaginationItemProps extends React.ComponentProps<"li"> {
|
|
5963
|
+
/** Additional CSS classes for the list item */
|
|
5964
|
+
className?: string;
|
|
5965
|
+
}
|
|
5966
|
+
|
|
5967
|
+
function PaginationItem({ ...props }: PaginationItemProps) {
|
|
5968
|
+
return <li data-slot="pagination-item" {...props} />;
|
|
5969
|
+
}
|
|
5970
|
+
PaginationItem.displayName = "PaginationItem";
|
|
5971
|
+
|
|
5972
|
+
export interface PaginationLinkProps
|
|
5973
|
+
extends Pick<ButtonProps, "size">,
|
|
5974
|
+
React.ComponentProps<"a"> {
|
|
5975
|
+
/** Highlights the link as the current page */
|
|
5976
|
+
isActive?: boolean;
|
|
5977
|
+
/** Size of the link (uses Button size variants) */
|
|
5978
|
+
size?: ButtonProps["size"];
|
|
5979
|
+
/** Additional CSS classes */
|
|
5980
|
+
className?: string;
|
|
5981
|
+
}
|
|
5982
|
+
|
|
5983
|
+
function PaginationLink({
|
|
5984
|
+
className,
|
|
5985
|
+
isActive,
|
|
5986
|
+
size = "icon",
|
|
5987
|
+
...props
|
|
5988
|
+
}: PaginationLinkProps) {
|
|
5989
|
+
return (
|
|
5990
|
+
<a
|
|
5991
|
+
aria-current={isActive ? "page" : undefined}
|
|
5992
|
+
data-slot="pagination-link"
|
|
5993
|
+
data-active={isActive}
|
|
5994
|
+
className={cn(
|
|
5995
|
+
buttonVariants({
|
|
5996
|
+
variant: isActive ? "outline" : "ghost",
|
|
5997
|
+
size,
|
|
5998
|
+
}),
|
|
5999
|
+
className
|
|
6000
|
+
)}
|
|
6001
|
+
{...props}
|
|
6002
|
+
/>
|
|
6003
|
+
);
|
|
6004
|
+
}
|
|
6005
|
+
PaginationLink.displayName = "PaginationLink";
|
|
6006
|
+
|
|
6007
|
+
export interface PaginationPreviousProps extends PaginationLinkProps {
|
|
6008
|
+
/** Additional CSS classes */
|
|
6009
|
+
className?: string;
|
|
6010
|
+
}
|
|
6011
|
+
|
|
6012
|
+
function PaginationPrevious({
|
|
6013
|
+
className,
|
|
6014
|
+
...props
|
|
6015
|
+
}: PaginationPreviousProps) {
|
|
6016
|
+
return (
|
|
6017
|
+
<PaginationLink
|
|
6018
|
+
aria-label="Go to previous page"
|
|
6019
|
+
size="default"
|
|
6020
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
6021
|
+
{...props}
|
|
6022
|
+
>
|
|
6023
|
+
<ChevronLeftIcon />
|
|
6024
|
+
<span className="hidden sm:block">Previous</span>
|
|
6025
|
+
</PaginationLink>
|
|
6026
|
+
);
|
|
6027
|
+
}
|
|
6028
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
6029
|
+
|
|
6030
|
+
export interface PaginationNextProps extends PaginationLinkProps {
|
|
6031
|
+
/** Additional CSS classes */
|
|
6032
|
+
className?: string;
|
|
6033
|
+
}
|
|
6034
|
+
|
|
6035
|
+
function PaginationNext({
|
|
6036
|
+
className,
|
|
6037
|
+
...props
|
|
6038
|
+
}: PaginationNextProps) {
|
|
6039
|
+
return (
|
|
6040
|
+
<PaginationLink
|
|
6041
|
+
aria-label="Go to next page"
|
|
6042
|
+
size="default"
|
|
6043
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
6044
|
+
{...props}
|
|
6045
|
+
>
|
|
6046
|
+
<span className="hidden sm:block">Next</span>
|
|
6047
|
+
<ChevronRightIcon />
|
|
6048
|
+
</PaginationLink>
|
|
6049
|
+
);
|
|
6050
|
+
}
|
|
6051
|
+
PaginationNext.displayName = "PaginationNext";
|
|
6052
|
+
|
|
6053
|
+
export interface PaginationEllipsisProps extends React.ComponentProps<"span"> {
|
|
6054
|
+
/** Additional CSS classes */
|
|
6055
|
+
className?: string;
|
|
6056
|
+
}
|
|
6057
|
+
|
|
6058
|
+
function PaginationEllipsis({
|
|
6059
|
+
className,
|
|
6060
|
+
...props
|
|
6061
|
+
}: PaginationEllipsisProps) {
|
|
6062
|
+
return (
|
|
6063
|
+
<span
|
|
6064
|
+
aria-hidden
|
|
6065
|
+
data-slot="pagination-ellipsis"
|
|
6066
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
6067
|
+
{...props}
|
|
6068
|
+
>
|
|
6069
|
+
<MoreHorizontalIcon className="size-4" />
|
|
6070
|
+
<span className="sr-only">More pages</span>
|
|
6071
|
+
</span>
|
|
6072
|
+
);
|
|
6073
|
+
}
|
|
6074
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
6075
|
+
|
|
6076
|
+
export {
|
|
6077
|
+
Pagination,
|
|
6078
|
+
PaginationContent,
|
|
6079
|
+
PaginationLink,
|
|
6080
|
+
PaginationItem,
|
|
6081
|
+
PaginationPrevious,
|
|
6082
|
+
PaginationNext,
|
|
6083
|
+
PaginationEllipsis,
|
|
6084
|
+
};
|
|
5890
6085
|
`, prefix)
|
|
5891
6086
|
}
|
|
5892
6087
|
]
|