@pycolors/ui 1.2.0 → 1.2.2

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.
@@ -1,12 +1,12 @@
1
- import * as React from 'react';
2
- import { type ButtonProps } from './button.js';
3
- export type PaginationProps = React.ComponentPropsWithoutRef<'nav'>;
1
+ import * as React from "react";
2
+ import { type ButtonProps } from "./button.js";
3
+ export type PaginationProps = React.ComponentPropsWithoutRef<"nav">;
4
4
  export declare function Pagination({ className, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
5
- export type PaginationContentProps = React.ComponentPropsWithoutRef<'ul'>;
5
+ export type PaginationContentProps = React.ComponentPropsWithoutRef<"ul">;
6
6
  export declare function PaginationContent({ className, ...props }: PaginationContentProps): import("react/jsx-runtime").JSX.Element;
7
- export type PaginationItemProps = React.ComponentPropsWithoutRef<'li'>;
7
+ export type PaginationItemProps = React.ComponentPropsWithoutRef<"li">;
8
8
  export declare function PaginationItem({ className, ...props }: PaginationItemProps): import("react/jsx-runtime").JSX.Element;
9
- export interface PaginationLinkProps extends React.ComponentPropsWithoutRef<'button'> {
9
+ export interface PaginationLinkProps extends React.ComponentPropsWithoutRef<"button"> {
10
10
  /**
11
11
  * Marks the current page for accessibility and styling.
12
12
  */
@@ -15,24 +15,24 @@ export interface PaginationLinkProps extends React.ComponentPropsWithoutRef<'but
15
15
  * Optional size mapping to Button sizes.
16
16
  * Defaults to "icon-sm" for compact pagination.
17
17
  */
18
- size?: ButtonProps['size'];
18
+ size?: ButtonProps["size"];
19
19
  }
20
20
  export declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
21
- export interface PaginationPreviousProps extends React.ComponentPropsWithoutRef<'button'> {
21
+ export interface PaginationPreviousProps extends React.ComponentPropsWithoutRef<"button"> {
22
22
  /**
23
23
  * Optional label for accessibility and i18n.
24
24
  */
25
25
  label?: string;
26
26
  }
27
27
  export declare function PaginationPrevious({ className, label, ...props }: PaginationPreviousProps): import("react/jsx-runtime").JSX.Element;
28
- export interface PaginationNextProps extends React.ComponentPropsWithoutRef<'button'> {
28
+ export interface PaginationNextProps extends React.ComponentPropsWithoutRef<"button"> {
29
29
  /**
30
30
  * Optional label for accessibility and i18n.
31
31
  */
32
32
  label?: string;
33
33
  }
34
34
  export declare function PaginationNext({ className, label, ...props }: PaginationNextProps): import("react/jsx-runtime").JSX.Element;
35
- export interface PaginationEllipsisProps extends React.ComponentPropsWithoutRef<'span'> {
35
+ export interface PaginationEllipsisProps extends React.ComponentPropsWithoutRef<"span"> {
36
36
  /**
37
37
  * Accessible label read by screen readers.
38
38
  */
@@ -40,11 +40,11 @@ export interface PaginationEllipsisProps extends React.ComponentPropsWithoutRef<
40
40
  }
41
41
  export declare function PaginationEllipsis({ className, label, ...props }: PaginationEllipsisProps): import("react/jsx-runtime").JSX.Element;
42
42
  export type PaginationToken = {
43
- type: 'page';
43
+ type: "page";
44
44
  value: number;
45
45
  isActive?: boolean;
46
46
  } | {
47
- type: 'ellipsis';
47
+ type: "ellipsis";
48
48
  key: string;
49
49
  };
50
50
  export declare function buildPaginationRange(args: {
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/ui/pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAUvD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAEpE,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CASlE;AAED,MAAM,MAAM,sBAAsB,GAChC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;AAEvC,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAQxB;AAED,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Horizontal, } from 'lucide-react';
3
- import { Button } from './button.js';
4
- import { cn } from '../../lib/utils.js';
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
3
+ import { Button } from "./button.js";
4
+ import { cn } from "../../lib/utils.js";
5
5
  export function Pagination({ className, ...props }) {
6
- return (_jsx("nav", { "aria-label": "Pagination", "data-slot": "pagination", className: cn('flex w-full justify-center', className), ...props }));
6
+ return (_jsx("nav", { "aria-label": "Pagination", "data-slot": "pagination", className: cn("flex w-full justify-center", className), ...props }));
7
7
  }
8
8
  export function PaginationContent({ className, ...props }) {
9
- return (_jsx("ul", { "data-slot": "pagination-content", className: cn('flex items-center gap-1', className), ...props }));
9
+ return (_jsx("ul", { "data-slot": "pagination-content", className: cn("flex items-center gap-1", className), ...props }));
10
10
  }
11
11
  export function PaginationItem({ className, ...props }) {
12
- return (_jsx("li", { "data-slot": "pagination-item", className: cn('list-none', className), ...props }));
12
+ return (_jsx("li", { "data-slot": "pagination-item", className: cn("list-none", className), ...props }));
13
13
  }
14
- export function PaginationLink({ className, isActive = false, size = 'icon-sm', ...props }) {
15
- return (_jsx(Button, { "data-slot": "pagination-link", type: "button", variant: isActive ? 'secondary' : 'outline', size: size, "aria-current": isActive ? 'page' : undefined, className: cn('min-w-8 px-2',
14
+ export function PaginationLink({ className, isActive = false, size = "icon-sm", ...props }) {
15
+ return (_jsx(Button, { "data-slot": "pagination-link", type: "button", variant: isActive ? "secondary" : "outline", size: size, "aria-current": isActive ? "page" : undefined, className: cn("min-w-8 px-2",
16
16
  // for icon sizes, Button already squares; for non-icon, ensure height rhythm
17
- isActive && 'font-semibold', className), ...props }));
17
+ isActive && "font-semibold", className), ...props }));
18
18
  }
19
- export function PaginationPrevious({ className, label = 'Previous page', ...props }) {
20
- return (_jsxs(Button, { "data-slot": "pagination-previous", type: "button", variant: "outline", size: "sm", "aria-label": label, className: cn('gap-2 px-3', className), ...props, children: [_jsx(ChevronLeft, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { className: "hidden sm:inline", children: "Previous" })] }));
19
+ export function PaginationPrevious({ className, label = "Previous page", ...props }) {
20
+ return (_jsxs(Button, { "data-slot": "pagination-previous", type: "button", variant: "outline", size: "sm", "aria-label": label, className: cn("gap-2 px-3", className), ...props, children: [_jsx(ChevronLeft, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { className: "hidden sm:inline", children: "Previous" })] }));
21
21
  }
22
- export function PaginationNext({ className, label = 'Next page', ...props }) {
23
- return (_jsxs(Button, { "data-slot": "pagination-next", type: "button", variant: "outline", size: "sm", "aria-label": label, className: cn('gap-2 px-3', className), ...props, children: [_jsx("span", { className: "hidden sm:inline", children: "Next" }), _jsx(ChevronRight, { className: "h-4 w-4", "aria-hidden": "true" })] }));
22
+ export function PaginationNext({ className, label = "Next page", ...props }) {
23
+ return (_jsxs(Button, { "data-slot": "pagination-next", type: "button", variant: "outline", size: "sm", "aria-label": label, className: cn("gap-2 px-3", className), ...props, children: [_jsx("span", { className: "hidden sm:inline", children: "Next" }), _jsx(ChevronRight, { className: "h-4 w-4", "aria-hidden": "true" })] }));
24
24
  }
25
- export function PaginationEllipsis({ className, label = 'More pages', ...props }) {
26
- return (_jsx("span", { "data-slot": "pagination-ellipsis", "aria-label": label, className: cn('flex h-8 w-8 items-center justify-center text-muted-foreground', className), ...props, children: _jsx(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": "true" }) }));
25
+ export function PaginationEllipsis({ className, label = "More pages", ...props }) {
26
+ return (_jsxs("span", { "data-slot": "pagination-ellipsis", className: cn("flex h-8 w-8 items-center justify-center text-muted-foreground", className), ...props, children: [_jsx(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: label })] }));
27
27
  }
28
28
  export function buildPaginationRange(args) {
29
- const { page, totalPages, siblingCount = 1, boundaryCount = 1, } = args;
29
+ const { page, totalPages, siblingCount = 1, boundaryCount = 1 } = args;
30
30
  const clamp = (n) => Math.max(1, Math.min(totalPages, n));
31
31
  const current = clamp(page);
32
32
  // If total pages is small, show all pages.
33
33
  const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3; // incl current + 2 ellipsis
34
34
  if (totalPages <= totalNumbers) {
35
35
  return Array.from({ length: totalPages }, (_, i) => ({
36
- type: 'page',
36
+ type: "page",
37
37
  value: i + 1,
38
38
  isActive: i + 1 === current,
39
39
  }));
@@ -47,39 +47,39 @@ export function buildPaginationRange(args) {
47
47
  const range = [];
48
48
  // Left boundary
49
49
  for (let p = 1; p <= leftBoundaryEnd; p++) {
50
- range.push({ type: 'page', value: p, isActive: p === current });
50
+ range.push({ type: "page", value: p, isActive: p === current });
51
51
  }
52
52
  // Left ellipsis or gap page
53
53
  if (showLeftEllipsis) {
54
- range.push({ type: 'ellipsis', key: 'left' });
54
+ range.push({ type: "ellipsis", key: "left" });
55
55
  }
56
56
  else {
57
57
  const gapPage = leftBoundaryEnd + 1;
58
58
  range.push({
59
- type: 'page',
59
+ type: "page",
60
60
  value: gapPage,
61
61
  isActive: gapPage === current,
62
62
  });
63
63
  }
64
64
  // Siblings
65
65
  for (let p = leftSiblingStart; p <= rightSiblingEnd; p++) {
66
- range.push({ type: 'page', value: p, isActive: p === current });
66
+ range.push({ type: "page", value: p, isActive: p === current });
67
67
  }
68
68
  // Right ellipsis or gap page
69
69
  if (showRightEllipsis) {
70
- range.push({ type: 'ellipsis', key: 'right' });
70
+ range.push({ type: "ellipsis", key: "right" });
71
71
  }
72
72
  else {
73
73
  const gapPage = rightBoundaryStart - 1;
74
74
  range.push({
75
- type: 'page',
75
+ type: "page",
76
76
  value: gapPage,
77
77
  isActive: gapPage === current,
78
78
  });
79
79
  }
80
80
  // Right boundary
81
81
  for (let p = rightBoundaryStart; p <= totalPages; p++) {
82
- range.push({ type: 'page', value: p, isActive: p === current });
82
+ range.push({ type: "page", value: p, isActive: p === current });
83
83
  }
84
84
  return range;
85
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pycolors/ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Production-ready UI primitives for modern SaaS apps (Radix + Tailwind-friendly).",
5
5
  "keywords": [
6
6
  "pycolors",
@@ -57,7 +57,7 @@
57
57
  "@radix-ui/react-dialog": "^1.1.15",
58
58
  "@radix-ui/react-dropdown-menu": "^2.1.16",
59
59
  "@radix-ui/react-slot": "^1.2.4",
60
- "@radix-ui/react-tabs": "^1.1.13",
60
+ "@radix-ui/react-tabs": "^1.1.21",
61
61
  "@radix-ui/react-toast": "^1.2.15",
62
62
  "class-variance-authority": "^0.7.1",
63
63
  "clsx": "^2.1.1",