@dashforge/tw 0.3.0-beta → 0.5.0-beta
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/CHANGELOG.md +246 -0
- package/PARITY.md +483 -0
- package/PERFORMANCE.md +169 -0
- package/dist/index.esm.js +1055 -2
- package/dist/src/components/Accordion/Accordion.d.ts +21 -0
- package/dist/src/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/src/components/Accordion/accordion.types.d.ts +74 -0
- package/dist/src/components/Accordion/accordion.types.d.ts.map +1 -0
- package/dist/src/components/Accordion/accordion.variants.d.ts +58 -0
- package/dist/src/components/Accordion/accordion.variants.d.ts.map +1 -0
- package/dist/src/components/Dialog/Dialog.d.ts +17 -0
- package/dist/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/src/components/Dialog/dialog.types.d.ts +75 -0
- package/dist/src/components/Dialog/dialog.types.d.ts.map +1 -0
- package/dist/src/components/Dialog/dialog.variants.d.ts +80 -0
- package/dist/src/components/Dialog/dialog.variants.d.ts.map +1 -0
- package/dist/src/components/Pagination/Pagination.d.ts +32 -0
- package/dist/src/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.helpers.d.ts +23 -0
- package/dist/src/components/Pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.types.d.ts +120 -0
- package/dist/src/components/Pagination/pagination.types.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.variants.d.ts +150 -0
- package/dist/src/components/Pagination/pagination.variants.d.ts.map +1 -0
- package/dist/src/components/Popover/Popover.d.ts +15 -0
- package/dist/src/components/Popover/Popover.d.ts.map +1 -0
- package/dist/src/components/Popover/popover.types.d.ts +45 -0
- package/dist/src/components/Popover/popover.types.d.ts.map +1 -0
- package/dist/src/components/Popover/popover.variants.d.ts +34 -0
- package/dist/src/components/Popover/popover.variants.d.ts.map +1 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts +23 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/src/components/Skeleton/skeleton.types.d.ts +56 -0
- package/dist/src/components/Skeleton/skeleton.types.d.ts.map +1 -0
- package/dist/src/components/Skeleton/skeleton.variants.d.ts +110 -0
- package/dist/src/components/Skeleton/skeleton.variants.d.ts.map +1 -0
- package/dist/src/components/Tabs/Tabs.d.ts +15 -0
- package/dist/src/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/src/components/Tabs/tabs.types.d.ts +55 -0
- package/dist/src/components/Tabs/tabs.types.d.ts.map +1 -0
- package/dist/src/components/Tabs/tabs.variants.d.ts +82 -0
- package/dist/src/components/Tabs/tabs.variants.d.ts.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +29 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/src/components/Tooltip/tooltip.types.d.ts +47 -0
- package/dist/src/components/Tooltip/tooltip.types.d.ts.map +1 -0
- package/dist/src/components/Tooltip/tooltip.variants.d.ts +34 -0
- package/dist/src/components/Tooltip/tooltip.variants.d.ts.map +1 -0
- package/dist/src/index.d.ts +22 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/components/Accordion/Accordion.test.tsx +95 -0
- package/src/components/Accordion/Accordion.tsx +97 -0
- package/src/components/Accordion/accordion.types.ts +66 -0
- package/src/components/Accordion/accordion.variants.ts +30 -0
- package/src/components/Dialog/Dialog.test.tsx +96 -0
- package/src/components/Dialog/Dialog.tsx +93 -0
- package/src/components/Dialog/dialog.types.ts +62 -0
- package/src/components/Dialog/dialog.variants.ts +62 -0
- package/src/components/Pagination/Pagination.test.tsx +314 -0
- package/src/components/Pagination/Pagination.tsx +275 -0
- package/src/components/Pagination/pagination.helpers.ts +102 -0
- package/src/components/Pagination/pagination.types.ts +117 -0
- package/src/components/Pagination/pagination.variants.ts +111 -0
- package/src/components/Popover/Popover.test.tsx +72 -0
- package/src/components/Popover/Popover.tsx +55 -0
- package/src/components/Popover/popover.types.ts +42 -0
- package/src/components/Popover/popover.variants.ts +18 -0
- package/src/components/Skeleton/Skeleton.test.tsx +127 -0
- package/src/components/Skeleton/Skeleton.tsx +49 -0
- package/src/components/Skeleton/skeleton.types.ts +59 -0
- package/src/components/Skeleton/skeleton.variants.ts +86 -0
- package/src/components/Tabs/Tabs.test.tsx +74 -0
- package/src/components/Tabs/Tabs.tsx +66 -0
- package/src/components/Tabs/tabs.types.ts +49 -0
- package/src/components/Tabs/tabs.variants.ts +58 -0
- package/src/components/Tooltip/Tooltip.test.tsx +73 -0
- package/src/components/Tooltip/Tooltip.tsx +70 -0
- package/src/components/Tooltip/tooltip.types.ts +44 -0
- package/src/components/Tooltip/tooltip.variants.ts +18 -0
- package/src/index.ts +57 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AccordionProps } from './accordion.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<Accordion>` — collapsible section list.
|
|
4
|
+
*
|
|
5
|
+
* Built on `@radix-ui/react-accordion`:
|
|
6
|
+
* - APG accordion pattern: `role="region"` on content, header
|
|
7
|
+
* button with `aria-expanded` and `aria-controls` linked to
|
|
8
|
+
* the panel.
|
|
9
|
+
* - Keyboard support: Space / Enter toggle, ArrowDown / ArrowUp
|
|
10
|
+
* move focus between triggers, Home / End to extremes.
|
|
11
|
+
* - Two modes:
|
|
12
|
+
* - `type="single"` — at most one section open at a time;
|
|
13
|
+
* `collapsible` allows clicking the open section to close it
|
|
14
|
+
* (default true).
|
|
15
|
+
* - `type="multiple"` — multiple sections open simultaneously.
|
|
16
|
+
*
|
|
17
|
+
* The trigger renders a chevron that flips 180° via CSS
|
|
18
|
+
* (`data-state=open` selector) — no React state, no JS animation.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Accordion(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAqE9C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AccordionSlotProps {
|
|
3
|
+
root?: {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
item?: {
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
header?: {
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
trigger?: {
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
content?: {
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
chevron?: {
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Single accordion section — paired `{ value, header, content }`.
|
|
24
|
+
* The `value` is the canonical id (used in `value` / `defaultValue`
|
|
25
|
+
* to control which sections are expanded).
|
|
26
|
+
*/
|
|
27
|
+
export interface AccordionItem {
|
|
28
|
+
value: string;
|
|
29
|
+
/** Trigger label (clickable to expand / collapse). */
|
|
30
|
+
header: ReactNode;
|
|
31
|
+
/** Section body, revealed when this item is expanded. */
|
|
32
|
+
content: ReactNode;
|
|
33
|
+
/** Per-item disabled flag. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface AccordionBaseProps {
|
|
37
|
+
items: AccordionItem[];
|
|
38
|
+
/** Root className shortcut. */
|
|
39
|
+
sx?: string;
|
|
40
|
+
/** Per-slot overrides. */
|
|
41
|
+
slotProps?: AccordionSlotProps;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Single-mode props — at most one section open at a time.
|
|
45
|
+
* `collapsible: true` (default) lets the user close the open
|
|
46
|
+
* section by clicking it again.
|
|
47
|
+
*/
|
|
48
|
+
export interface AccordionSingleProps extends AccordionBaseProps {
|
|
49
|
+
type?: 'single';
|
|
50
|
+
value?: string;
|
|
51
|
+
defaultValue?: string;
|
|
52
|
+
onValueChange?: (value: string) => void;
|
|
53
|
+
/** @default true */
|
|
54
|
+
collapsible?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Multiple-mode props — any number of sections open simultaneously.
|
|
58
|
+
*/
|
|
59
|
+
export interface AccordionMultipleProps extends AccordionBaseProps {
|
|
60
|
+
type: 'multiple';
|
|
61
|
+
value?: string[];
|
|
62
|
+
defaultValue?: string[];
|
|
63
|
+
onValueChange?: (value: string[]) => void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Props for `<Accordion>`.
|
|
67
|
+
*
|
|
68
|
+
* Built on `@radix-ui/react-accordion`. Discriminated by `type`:
|
|
69
|
+
* - `type="single"` (default) — `value` is `string`.
|
|
70
|
+
* - `type="multiple"` — `value` is `string[]`.
|
|
71
|
+
*/
|
|
72
|
+
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=accordion.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/accordion.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,O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@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const accordionVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
[key: string]: {
|
|
4
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
5
|
+
content?: import("tailwind-merge").ClassNameValue;
|
|
6
|
+
root?: import("tailwind-merge").ClassNameValue;
|
|
7
|
+
trigger?: import("tailwind-merge").ClassNameValue;
|
|
8
|
+
item?: import("tailwind-merge").ClassNameValue;
|
|
9
|
+
header?: import("tailwind-merge").ClassNameValue;
|
|
10
|
+
chevron?: import("tailwind-merge").ClassNameValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
16
|
+
content?: import("tailwind-merge").ClassNameValue;
|
|
17
|
+
root?: import("tailwind-merge").ClassNameValue;
|
|
18
|
+
trigger?: import("tailwind-merge").ClassNameValue;
|
|
19
|
+
item?: import("tailwind-merge").ClassNameValue;
|
|
20
|
+
header?: import("tailwind-merge").ClassNameValue;
|
|
21
|
+
chevron?: import("tailwind-merge").ClassNameValue;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
} | {}, {
|
|
25
|
+
root: string;
|
|
26
|
+
item: string;
|
|
27
|
+
header: string;
|
|
28
|
+
trigger: string[];
|
|
29
|
+
content: string[];
|
|
30
|
+
chevron: string[];
|
|
31
|
+
}, undefined, {
|
|
32
|
+
[key: string]: {
|
|
33
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
34
|
+
content?: import("tailwind-merge").ClassNameValue;
|
|
35
|
+
root?: import("tailwind-merge").ClassNameValue;
|
|
36
|
+
trigger?: import("tailwind-merge").ClassNameValue;
|
|
37
|
+
item?: import("tailwind-merge").ClassNameValue;
|
|
38
|
+
header?: import("tailwind-merge").ClassNameValue;
|
|
39
|
+
chevron?: import("tailwind-merge").ClassNameValue;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
} | {}, {
|
|
43
|
+
root: string;
|
|
44
|
+
item: string;
|
|
45
|
+
header: string;
|
|
46
|
+
trigger: string[];
|
|
47
|
+
content: string[];
|
|
48
|
+
chevron: string[];
|
|
49
|
+
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
50
|
+
root: string;
|
|
51
|
+
item: string;
|
|
52
|
+
header: string;
|
|
53
|
+
trigger: string[];
|
|
54
|
+
content: string[];
|
|
55
|
+
chevron: string[];
|
|
56
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
57
|
+
export type AccordionVariants = VariantProps<typeof accordionVariants>;
|
|
58
|
+
//# sourceMappingURL=accordion.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/accordion.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAyB5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DialogProps } from './dialog.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<Dialog>` — declarative modal dialog.
|
|
4
|
+
*
|
|
5
|
+
* Built on `@radix-ui/react-dialog`:
|
|
6
|
+
* - APG dialog pattern out of the box (focus trap, restore focus on
|
|
7
|
+
* close, Esc-to-close, `aria-modal`, `aria-labelledby`).
|
|
8
|
+
* - Renders into a portal (no z-index hell).
|
|
9
|
+
* - Scroll lock on `<body>` while open.
|
|
10
|
+
*
|
|
11
|
+
* Use the imperative `useDialog()` (export from this same module) if
|
|
12
|
+
* you want a `confirm()`-style return value pattern (similar to
|
|
13
|
+
* `useConfirm()` from `ConfirmDialog`). Use `<Dialog>` when you want
|
|
14
|
+
* the control flow living in your component tree.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Dialog(props: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAyExC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DialogVariants } from './dialog.variants.js';
|
|
3
|
+
/**
|
|
4
|
+
* Per-slot className overrides for `<Dialog>`. Mirrors the
|
|
5
|
+
* canonical TW slotProps shape: `{ slot?: { className?: string } }`.
|
|
6
|
+
*/
|
|
7
|
+
export interface DialogSlotProps {
|
|
8
|
+
overlay?: {
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
content?: {
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
title?: {
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
description?: {
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
closeButton?: {
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
body?: {
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
actions?: {
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Props for the declarative `<Dialog>` component.
|
|
32
|
+
*
|
|
33
|
+
* Built on `@radix-ui/react-dialog`. Use this when:
|
|
34
|
+
* - You want full control over the dialog's open state (controlled
|
|
35
|
+
* from a parent component).
|
|
36
|
+
* - You want to mount a custom-styled dialog body / trigger that
|
|
37
|
+
* composes with the rest of your component tree.
|
|
38
|
+
* - You don't need an imperative `confirm()`-style return value
|
|
39
|
+
* (use `useDialog()` or `useConfirm()` for those).
|
|
40
|
+
*
|
|
41
|
+
* Three size variants (`sm` / `md` / `lg`) with sensible defaults.
|
|
42
|
+
* Backdrop + content animations respect `prefers-reduced-motion`.
|
|
43
|
+
*/
|
|
44
|
+
export interface DialogProps extends Pick<DialogVariants, 'size'> {
|
|
45
|
+
/** Controlled open state. */
|
|
46
|
+
open: boolean;
|
|
47
|
+
/** Called when the dialog requests to change open state. */
|
|
48
|
+
onOpenChange: (open: boolean) => void;
|
|
49
|
+
/** Dialog body — usually a `<DialogContent>` subtree. */
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
/** Dialog title (screen-reader announced via `aria-labelledby`). */
|
|
52
|
+
title?: ReactNode;
|
|
53
|
+
/** Dialog description (announced via `aria-describedby`). */
|
|
54
|
+
description?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Show the `×` close button in the top-right corner.
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
showCloseButton?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Disable closing on backdrop click.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
disableBackdropClose?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Disable closing on Escape key.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
disableEscapeClose?: boolean;
|
|
70
|
+
/** Root className shortcut on the content element. */
|
|
71
|
+
sx?: string;
|
|
72
|
+
/** Per-slot overrides. */
|
|
73
|
+
slotProps?: DialogSlotProps;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=dialog.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.types.ts"],"names":[],"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CAAC;IACZ,0BAA0B;IAC1B,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* `<Dialog>` variant recipe.
|
|
4
|
+
*
|
|
5
|
+
* Slots:
|
|
6
|
+
* - `overlay` — backdrop (Radix's `DialogOverlay`)
|
|
7
|
+
* - `content` — the dialog box itself
|
|
8
|
+
* - `title` — heading at the top
|
|
9
|
+
* - `description` — secondary text under the title
|
|
10
|
+
* - `closeButton` — top-right `×` button
|
|
11
|
+
* - `body` — main scrollable area
|
|
12
|
+
* - `actions` — footer action bar
|
|
13
|
+
*
|
|
14
|
+
* Three sizes (`sm` / `md` / `lg`) drive the content max-width.
|
|
15
|
+
* Motion is gated by `prefers-reduced-motion` so the slide-in
|
|
16
|
+
* animation collapses to an instant appear on users that opt out.
|
|
17
|
+
*/
|
|
18
|
+
export declare const dialogVariants: import("tailwind-variants").TVReturnType<{
|
|
19
|
+
size: {
|
|
20
|
+
sm: {
|
|
21
|
+
content: string;
|
|
22
|
+
};
|
|
23
|
+
md: {
|
|
24
|
+
content: string;
|
|
25
|
+
};
|
|
26
|
+
lg: {
|
|
27
|
+
content: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
overlay: string[];
|
|
32
|
+
content: string[];
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
closeButton: string[];
|
|
36
|
+
body: string;
|
|
37
|
+
actions: string;
|
|
38
|
+
}, undefined, {
|
|
39
|
+
size: {
|
|
40
|
+
sm: {
|
|
41
|
+
content: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
content: string;
|
|
45
|
+
};
|
|
46
|
+
lg: {
|
|
47
|
+
content: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}, {
|
|
51
|
+
overlay: string[];
|
|
52
|
+
content: string[];
|
|
53
|
+
title: string;
|
|
54
|
+
description: string;
|
|
55
|
+
closeButton: string[];
|
|
56
|
+
body: string;
|
|
57
|
+
actions: string;
|
|
58
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
59
|
+
size: {
|
|
60
|
+
sm: {
|
|
61
|
+
content: string;
|
|
62
|
+
};
|
|
63
|
+
md: {
|
|
64
|
+
content: string;
|
|
65
|
+
};
|
|
66
|
+
lg: {
|
|
67
|
+
content: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
overlay: string[];
|
|
72
|
+
content: string[];
|
|
73
|
+
title: string;
|
|
74
|
+
description: string;
|
|
75
|
+
closeButton: string[];
|
|
76
|
+
body: string;
|
|
77
|
+
actions: string;
|
|
78
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
79
|
+
export type DialogVariants = VariantProps<typeof dialogVariants>;
|
|
80
|
+
//# sourceMappingURL=dialog.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAyCzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PaginationProps } from './pagination.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dashforge TW `<Pagination>` — controlled pagination primitive.
|
|
4
|
+
*
|
|
5
|
+
* Three variants:
|
|
6
|
+
* - `default` — page-size selector + summary + page numbers + nav buttons + jump input
|
|
7
|
+
* - `compact` — page numbers + nav buttons only (no summary, no selector, no jump)
|
|
8
|
+
* - `minimal` — "Page X of Y" + prev/next only
|
|
9
|
+
*
|
|
10
|
+
* Always controlled (no internal state besides the jump-input draft).
|
|
11
|
+
*
|
|
12
|
+
* A11Y:
|
|
13
|
+
* - `<nav aria-label="Pagination">` root
|
|
14
|
+
* - `aria-current="page"` on the active page button
|
|
15
|
+
* - `aria-label` on every interactive element
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const [page, setPage] = useState(1);
|
|
20
|
+
* const [pageSize, setPageSize] = useState(20);
|
|
21
|
+
*
|
|
22
|
+
* <Pagination
|
|
23
|
+
* page={page}
|
|
24
|
+
* pageSize={pageSize}
|
|
25
|
+
* totalCount={1437}
|
|
26
|
+
* onPageChange={setPage}
|
|
27
|
+
* onPageSizeChange={setPageSize}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function Pagination(props: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAC;AAgB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAiOhD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the array of page indices (or `'ellipsis'` sentinels) to
|
|
3
|
+
* render for a `<Pagination>`.
|
|
4
|
+
*
|
|
5
|
+
* Algorithm (standard "siblings + boundaries + ellipsis fill"):
|
|
6
|
+
* 1. Always show `boundaryCount` pages at the start and `boundaryCount`
|
|
7
|
+
* at the end.
|
|
8
|
+
* 2. Show `siblingCount` pages on each side of the current page.
|
|
9
|
+
* 3. Fill gaps wider than 1 with `'ellipsis'`.
|
|
10
|
+
* 4. If a gap is exactly 1 page wide, include that page directly
|
|
11
|
+
* (no ellipsis for a single hidden number).
|
|
12
|
+
*
|
|
13
|
+
* Output is 1-indexed page numbers OR the literal string `'ellipsis'`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* range(1, 10, 1, 1) // [1, 'ellipsis', 5, 'ellipsis', 10] when current=5
|
|
18
|
+
* range(1, 5, 1, 1) // [1, 2, 3, 4, 5]
|
|
19
|
+
* range(1, 100, 1, 1) // edges varying with current
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function computePageRange(currentPage: number, totalPages: number, siblingCount: number, boundaryCount: number): (number | 'ellipsis')[];
|
|
23
|
+
//# sourceMappingURL=pagination.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/pagination.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAsEzB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { PaginationVariants } from './pagination.variants.js';
|
|
2
|
+
export interface PaginationSlotProps {
|
|
3
|
+
root?: {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
summary?: {
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
list?: {
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
pageButton?: {
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
activeButton?: {
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
navButton?: {
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
ellipsis?: {
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
pageSizeSelector?: {
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
jumpInput?: {
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* I18n strings for `<Pagination>`. Default = English. Override the
|
|
33
|
+
* subset you need to translate; the rest fall back to defaults.
|
|
34
|
+
*/
|
|
35
|
+
export interface PaginationLabels {
|
|
36
|
+
first?: string;
|
|
37
|
+
prev?: string;
|
|
38
|
+
next?: string;
|
|
39
|
+
last?: string;
|
|
40
|
+
page?: string;
|
|
41
|
+
of?: string;
|
|
42
|
+
showing?: string;
|
|
43
|
+
perPage?: string;
|
|
44
|
+
goToPage?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Props for `<Pagination>`.
|
|
48
|
+
*
|
|
49
|
+
* Controlled component: the consumer owns `page` + `pageSize`. The
|
|
50
|
+
* component emits `onPageChange` / `onPageSizeChange` and recomputes
|
|
51
|
+
* the visible page range from `totalCount`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* const [page, setPage] = useState(1);
|
|
56
|
+
* const [pageSize, setPageSize] = useState(20);
|
|
57
|
+
*
|
|
58
|
+
* <Pagination
|
|
59
|
+
* page={page}
|
|
60
|
+
* pageSize={pageSize}
|
|
61
|
+
* totalCount={1437}
|
|
62
|
+
* onPageChange={setPage}
|
|
63
|
+
* onPageSizeChange={setPageSize}
|
|
64
|
+
* pageSizeOptions={[10, 20, 50, 100]}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export interface PaginationProps extends Pick<PaginationVariants, 'variant' | 'size'> {
|
|
69
|
+
/** Current page, **1-indexed**. */
|
|
70
|
+
page: number;
|
|
71
|
+
/** Items per page. */
|
|
72
|
+
pageSize: number;
|
|
73
|
+
/** Total items in the underlying data set (NOT total pages — we compute that). */
|
|
74
|
+
totalCount: number;
|
|
75
|
+
/** Fired when the user picks a different page. */
|
|
76
|
+
onPageChange: (page: number) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Fired when the user picks a different page size. Omit (or pass
|
|
79
|
+
* undefined) to hide the page-size selector.
|
|
80
|
+
*/
|
|
81
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Options shown in the page-size selector.
|
|
84
|
+
* @default [10, 20, 50, 100]
|
|
85
|
+
*/
|
|
86
|
+
pageSizeOptions?: number[];
|
|
87
|
+
/**
|
|
88
|
+
* How many page buttons to show on each side of the current page.
|
|
89
|
+
* @default 1
|
|
90
|
+
*/
|
|
91
|
+
siblingCount?: number;
|
|
92
|
+
/**
|
|
93
|
+
* How many page buttons to always show at the start/end of the
|
|
94
|
+
* sequence (acts as "boundary"). @default 1
|
|
95
|
+
*/
|
|
96
|
+
boundaryCount?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Show first/last buttons (`«` / `»`). @default true
|
|
99
|
+
*/
|
|
100
|
+
showFirstLast?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Show the direct page-jump input (variant=`default` only).
|
|
103
|
+
* @default true
|
|
104
|
+
*/
|
|
105
|
+
showJumpInput?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Disable all interactive elements (kept rendered but inert).
|
|
108
|
+
*/
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* I18n strings. Defaults are English; pass the subset you need
|
|
112
|
+
* to translate.
|
|
113
|
+
*/
|
|
114
|
+
labels?: PaginationLabels;
|
|
115
|
+
/** Root-level Tailwind override. */
|
|
116
|
+
sx?: string;
|
|
117
|
+
/** Per-slot overrides. */
|
|
118
|
+
slotProps?: PaginationSlotProps;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=pagination.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/pagination.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,UAAU,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,M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