556 lines
14 KiB
Plaintext
556 lines
14 KiB
Plaintext
"use strict";
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// src/components/pagination.ts
|
|
var pagination_exports = {};
|
|
__export(pagination_exports, {
|
|
pagination: () => pagination
|
|
});
|
|
module.exports = __toCommonJS(pagination_exports);
|
|
|
|
// src/utils/tv.ts
|
|
var import_tailwind_variants = require("tailwind-variants");
|
|
|
|
// src/utils/tw-merge-config.ts
|
|
var COMMON_UNITS = ["small", "medium", "large"];
|
|
var twMergeConfig = {
|
|
theme: {
|
|
opacity: ["disabled"],
|
|
spacing: ["divider"],
|
|
borderWidth: COMMON_UNITS,
|
|
borderRadius: COMMON_UNITS
|
|
},
|
|
classGroups: {
|
|
shadow: [{ shadow: COMMON_UNITS }],
|
|
"font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
|
|
"bg-image": [
|
|
"bg-stripe-gradient-default",
|
|
"bg-stripe-gradient-primary",
|
|
"bg-stripe-gradient-secondary",
|
|
"bg-stripe-gradient-success",
|
|
"bg-stripe-gradient-warning",
|
|
"bg-stripe-gradient-danger"
|
|
]
|
|
}
|
|
};
|
|
|
|
// src/utils/tv.ts
|
|
var tv = (options, config) => {
|
|
var _a, _b, _c;
|
|
return (0, import_tailwind_variants.tv)(options, {
|
|
...config,
|
|
twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
|
|
twMergeConfig: {
|
|
...config == null ? void 0 : config.twMergeConfig,
|
|
theme: {
|
|
...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
|
|
...twMergeConfig.theme
|
|
},
|
|
classGroups: {
|
|
...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
|
|
...twMergeConfig.classGroups
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
// src/utils/classes.ts
|
|
var dataFocusVisibleClasses = [
|
|
"outline-none",
|
|
"data-[focus-visible=true]:z-10",
|
|
"data-[focus-visible=true]:outline-2",
|
|
"data-[focus-visible=true]:outline-focus",
|
|
"data-[focus-visible=true]:outline-offset-2"
|
|
];
|
|
|
|
// src/utils/variants.ts
|
|
var solid = {
|
|
default: "bg-default text-default-foreground",
|
|
primary: "bg-primary text-primary-foreground",
|
|
secondary: "bg-secondary text-secondary-foreground",
|
|
success: "bg-success text-success-foreground",
|
|
warning: "bg-warning text-warning-foreground",
|
|
danger: "bg-danger text-danger-foreground",
|
|
foreground: "bg-foreground text-background"
|
|
};
|
|
var shadow = {
|
|
default: "shadow-lg shadow-default/50 bg-default text-default-foreground",
|
|
primary: "shadow-lg shadow-primary/40 bg-primary text-primary-foreground",
|
|
secondary: "shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",
|
|
success: "shadow-lg shadow-success/40 bg-success text-success-foreground",
|
|
warning: "shadow-lg shadow-warning/40 bg-warning text-warning-foreground",
|
|
danger: "shadow-lg shadow-danger/40 bg-danger text-danger-foreground",
|
|
foreground: "shadow-lg shadow-foreground/40 bg-foreground text-background"
|
|
};
|
|
var bordered = {
|
|
default: "bg-transparent border-default text-foreground",
|
|
primary: "bg-transparent border-primary text-primary",
|
|
secondary: "bg-transparent border-secondary text-secondary",
|
|
success: "bg-transparent border-success text-success",
|
|
warning: "bg-transparent border-warning text-warning",
|
|
danger: "bg-transparent border-danger text-danger",
|
|
foreground: "bg-transparent border-foreground text-foreground"
|
|
};
|
|
var flat = {
|
|
default: "bg-default/40 text-default-700",
|
|
primary: "bg-primary/20 text-primary-600",
|
|
secondary: "bg-secondary/20 text-secondary-600",
|
|
success: "bg-success/20 text-success-700 dark:text-success",
|
|
warning: "bg-warning/20 text-warning-700 dark:text-warning",
|
|
danger: "bg-danger/20 text-danger-600 dark:text-danger-500",
|
|
foreground: "bg-foreground/10 text-foreground"
|
|
};
|
|
var faded = {
|
|
default: "border-default bg-default-100 text-default-foreground",
|
|
primary: "border-default bg-default-100 text-primary",
|
|
secondary: "border-default bg-default-100 text-secondary",
|
|
success: "border-default bg-default-100 text-success",
|
|
warning: "border-default bg-default-100 text-warning",
|
|
danger: "border-default bg-default-100 text-danger",
|
|
foreground: "border-default bg-default-100 text-foreground"
|
|
};
|
|
var light = {
|
|
default: "bg-transparent text-default-foreground",
|
|
primary: "bg-transparent text-primary",
|
|
secondary: "bg-transparent text-secondary",
|
|
success: "bg-transparent text-success",
|
|
warning: "bg-transparent text-warning",
|
|
danger: "bg-transparent text-danger",
|
|
foreground: "bg-transparent text-foreground"
|
|
};
|
|
var ghost = {
|
|
default: "border-default text-default-foreground",
|
|
primary: "border-primary text-primary",
|
|
secondary: "border-secondary text-secondary",
|
|
success: "border-success text-success",
|
|
warning: "border-warning text-warning",
|
|
danger: "border-danger text-danger",
|
|
foreground: "border-foreground text-foreground hover:!bg-foreground"
|
|
};
|
|
var colorVariants = {
|
|
solid,
|
|
shadow,
|
|
bordered,
|
|
flat,
|
|
faded,
|
|
light,
|
|
ghost
|
|
};
|
|
|
|
// src/components/pagination.ts
|
|
var pagination = tv({
|
|
slots: {
|
|
base: ["p-2.5", "-m-2.5", "overflow-x-scroll", "scrollbar-hide"],
|
|
wrapper: [
|
|
"flex",
|
|
"flex-nowrap",
|
|
"h-fit",
|
|
"max-w-fit",
|
|
"relative",
|
|
"gap-1",
|
|
"items-center",
|
|
"overflow-visible"
|
|
],
|
|
item: ["tap-highlight-transparent", "select-none", "touch-none"],
|
|
prev: "",
|
|
next: "",
|
|
cursor: [
|
|
"absolute",
|
|
"flex",
|
|
"overflow-visible",
|
|
"items-center",
|
|
"justify-center",
|
|
"origin-center",
|
|
"left-0",
|
|
"select-none",
|
|
"touch-none",
|
|
"pointer-events-none",
|
|
"z-20"
|
|
],
|
|
forwardIcon: [
|
|
"hidden",
|
|
"group-hover:block",
|
|
"group-data-[focus-visible=true]:block",
|
|
"data-[before=true]:rotate-180"
|
|
],
|
|
ellipsis: "group-hover:hidden group-data-[focus-visible=true]:hidden",
|
|
chevronNext: "rotate-180"
|
|
},
|
|
variants: {
|
|
variant: {
|
|
bordered: {
|
|
item: [
|
|
"border-medium",
|
|
"border-default",
|
|
"bg-transparent",
|
|
"data-[hover=true]:bg-default-100"
|
|
]
|
|
},
|
|
light: {
|
|
item: "bg-transparent"
|
|
},
|
|
flat: {},
|
|
faded: {
|
|
item: ["border-medium", "border-default"]
|
|
}
|
|
},
|
|
color: {
|
|
default: {
|
|
cursor: colorVariants.solid.default
|
|
},
|
|
primary: {
|
|
cursor: colorVariants.solid.primary
|
|
},
|
|
secondary: {
|
|
cursor: colorVariants.solid.secondary
|
|
},
|
|
success: {
|
|
cursor: colorVariants.solid.success
|
|
},
|
|
warning: {
|
|
cursor: colorVariants.solid.warning
|
|
},
|
|
danger: {
|
|
cursor: colorVariants.solid.danger
|
|
}
|
|
},
|
|
size: {
|
|
sm: {},
|
|
md: {},
|
|
lg: {}
|
|
},
|
|
radius: {
|
|
none: {},
|
|
sm: {},
|
|
md: {},
|
|
lg: {},
|
|
full: {}
|
|
},
|
|
isCompact: {
|
|
true: {
|
|
wrapper: "gap-0 shadow-sm",
|
|
item: [
|
|
"shadow-none",
|
|
"first-of-type:rounded-e-none",
|
|
"last-of-type:rounded-s-none",
|
|
"[&:not(:first-of-type):not(:last-of-type)]:rounded-none"
|
|
],
|
|
prev: "!rounded-e-none",
|
|
next: "!rounded-s-none"
|
|
}
|
|
},
|
|
isDisabled: {
|
|
true: {
|
|
base: "opacity-disabled pointer-events-none"
|
|
}
|
|
},
|
|
showShadow: {
|
|
true: {}
|
|
},
|
|
disableCursorAnimation: {
|
|
true: {
|
|
cursor: "hidden"
|
|
}
|
|
},
|
|
disableAnimation: {
|
|
true: {
|
|
item: "transition-none",
|
|
cursor: "transition-none"
|
|
},
|
|
false: {
|
|
item: ["data-[pressed=true]:scale-[0.97]", "transition-transform-background"],
|
|
cursor: [
|
|
"data-[moving=true]:transition-transform",
|
|
"!data-[moving=true]:duration-300",
|
|
"opacity-0",
|
|
"data-[moving]:opacity-100"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
defaultVariants: {
|
|
variant: "flat",
|
|
color: "primary",
|
|
size: "md",
|
|
radius: "md",
|
|
isCompact: false,
|
|
isDisabled: false,
|
|
showShadow: false,
|
|
disableCursorAnimation: false
|
|
},
|
|
compoundVariants: [
|
|
{
|
|
showShadow: true,
|
|
color: "default",
|
|
class: {
|
|
cursor: [colorVariants.shadow.default, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
showShadow: true,
|
|
color: "primary",
|
|
class: {
|
|
cursor: [colorVariants.shadow.primary, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
showShadow: true,
|
|
color: "secondary",
|
|
class: {
|
|
cursor: [colorVariants.shadow.secondary, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
showShadow: true,
|
|
color: "success",
|
|
class: {
|
|
cursor: [colorVariants.shadow.success, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
showShadow: true,
|
|
color: "warning",
|
|
class: {
|
|
cursor: [colorVariants.shadow.warning, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
showShadow: true,
|
|
color: "danger",
|
|
class: {
|
|
cursor: [colorVariants.shadow.danger, "shadow-md"]
|
|
}
|
|
},
|
|
{
|
|
isCompact: true,
|
|
variant: "bordered",
|
|
class: {
|
|
item: "[&:not(:first-of-type)]:ms-[calc(theme(borderWidth.2)*-1)]"
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "default",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-default-400",
|
|
"data-[active=true]:border-default-400",
|
|
"data-[active=true]:text-default-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "primary",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-primary",
|
|
"data-[active=true]:border-primary",
|
|
"data-[active=true]:text-primary-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "secondary",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-secondary",
|
|
"data-[active=true]:border-secondary",
|
|
"data-[active=true]:text-secondary-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "success",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-success",
|
|
"data-[active=true]:border-success",
|
|
"data-[active=true]:text-success-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "warning",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-warning",
|
|
"data-[active=true]:border-warning",
|
|
"data-[active=true]:text-warning-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
color: "danger",
|
|
class: {
|
|
item: [
|
|
"data-[active=true]:bg-danger",
|
|
"data-[active=true]:border-danger",
|
|
"data-[active=true]:text-danger-foreground"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "default",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-default/50"]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "primary",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-primary/40"]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "secondary",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-secondary/40"]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "success",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-success/40"]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "warning",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-warning/40"]
|
|
}
|
|
},
|
|
{
|
|
disableCursorAnimation: true,
|
|
showShadow: true,
|
|
color: "danger",
|
|
class: {
|
|
item: ["data-[active=true]:shadow-md", "data-[active=true]:shadow-danger/40"]
|
|
}
|
|
}
|
|
],
|
|
compoundSlots: [
|
|
{
|
|
slots: ["item", "prev", "next"],
|
|
class: [
|
|
"flex",
|
|
"flex-wrap",
|
|
"truncate",
|
|
"box-border",
|
|
"outline-none",
|
|
"items-center",
|
|
"justify-center",
|
|
"text-default-foreground",
|
|
...dataFocusVisibleClasses,
|
|
"data-[disabled=true]:text-default-300",
|
|
"data-[disabled=true]:pointer-events-none"
|
|
]
|
|
},
|
|
{
|
|
slots: ["item", "prev", "next"],
|
|
variant: ["flat", "bordered", "faded"],
|
|
class: ["shadow-sm"]
|
|
},
|
|
{
|
|
slots: ["item", "prev", "next"],
|
|
variant: "flat",
|
|
class: [
|
|
"bg-default-100",
|
|
"[&[data-hover=true]:not([data-active=true])]:bg-default-200",
|
|
"active:bg-default-300"
|
|
]
|
|
},
|
|
{
|
|
slots: ["item", "prev", "next"],
|
|
variant: "faded",
|
|
class: [
|
|
"bg-default-50",
|
|
"[&[data-hover=true]:not([data-active=true])]:bg-default-100",
|
|
"active:bg-default-200"
|
|
]
|
|
},
|
|
{
|
|
slots: ["item", "prev", "next"],
|
|
variant: "light",
|
|
class: [
|
|
"[&[data-hover=true]:not([data-active=true])]:bg-default-100",
|
|
"active:bg-default-200"
|
|
]
|
|
},
|
|
{
|
|
slots: ["item", "cursor", "prev", "next"],
|
|
size: "sm",
|
|
class: "min-w-8 w-8 h-8 text-tiny"
|
|
},
|
|
{
|
|
slots: ["item", "cursor", "prev", "next"],
|
|
size: "md",
|
|
class: "min-w-9 w-9 h-9 text-small"
|
|
},
|
|
{
|
|
slots: ["item", "cursor", "prev", "next"],
|
|
size: "lg",
|
|
class: "min-w-10 w-10 h-10 text-medium"
|
|
},
|
|
{
|
|
slots: ["wrapper", "item", "cursor", "prev", "next"],
|
|
radius: "none",
|
|
class: "rounded-none"
|
|
},
|
|
{
|
|
slots: ["wrapper", "item", "cursor", "prev", "next"],
|
|
radius: "sm",
|
|
class: "rounded-small"
|
|
},
|
|
{
|
|
slots: ["wrapper", "item", "cursor", "prev", "next"],
|
|
radius: "md",
|
|
class: "rounded-medium"
|
|
},
|
|
{
|
|
slots: ["wrapper", "item", "cursor", "prev", "next"],
|
|
radius: "lg",
|
|
class: "rounded-large"
|
|
},
|
|
{
|
|
slots: ["wrapper", "item", "cursor", "prev", "next"],
|
|
radius: "full",
|
|
class: "rounded-full"
|
|
}
|
|
]
|
|
});
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
pagination
|
|
});
|