@dashnex/ui 0.5.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.
- package/README.md +522 -0
- package/dashnex.json +1 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.js +12 -0
- package/dist/components/Loading.d.ts +3 -0
- package/dist/components/Loading.js +4 -0
- package/dist/components/tailwind/alert.d.ts +28 -0
- package/dist/components/tailwind/alert.js +30 -0
- package/dist/components/tailwind/auth-layout.d.ts +4 -0
- package/dist/components/tailwind/auth-layout.js +4 -0
- package/dist/components/tailwind/avatar.d.ts +14 -0
- package/dist/components/tailwind/avatar.js +18 -0
- package/dist/components/tailwind/badge.d.ts +33 -0
- package/dist/components/tailwind/badge.js +33 -0
- package/dist/components/tailwind/button.d.ts +58 -0
- package/dist/components/tailwind/button.js +169 -0
- package/dist/components/tailwind/checkbox.d.ts +36 -0
- package/dist/components/tailwind/checkbox.js +83 -0
- package/dist/components/tailwind/combobox.d.ts +19 -0
- package/dist/components/tailwind/combobox.js +86 -0
- package/dist/components/tailwind/description-list.d.ts +3 -0
- package/dist/components/tailwind/description-list.js +11 -0
- package/dist/components/tailwind/dialog.d.ts +28 -0
- package/dist/components/tailwind/dialog.js +30 -0
- package/dist/components/tailwind/divider.d.ts +3 -0
- package/dist/components/tailwind/divider.js +5 -0
- package/dist/components/tailwind/dropdown.d.ts +32 -0
- package/dist/components/tailwind/dropdown.js +78 -0
- package/dist/components/tailwind/fieldset.d.ts +21 -0
- package/dist/components/tailwind/fieldset.js +24 -0
- package/dist/components/tailwind/heading.d.ts +6 -0
- package/dist/components/tailwind/heading.js +10 -0
- package/dist/components/tailwind/index.d.ts +27 -0
- package/dist/components/tailwind/index.js +28 -0
- package/dist/components/tailwind/input.d.ts +10 -0
- package/dist/components/tailwind/input.js +58 -0
- package/dist/components/tailwind/link.d.ts +11 -0
- package/dist/components/tailwind/link.js +13 -0
- package/dist/components/tailwind/listbox.d.ts +15 -0
- package/dist/components/tailwind/listbox.js +84 -0
- package/dist/components/tailwind/navbar.d.ts +14 -0
- package/dist/components/tailwind/navbar.js +42 -0
- package/dist/components/tailwind/pagination.d.ts +17 -0
- package/dist/components/tailwind/pagination.js +21 -0
- package/dist/components/tailwind/radio.d.ts +37 -0
- package/dist/components/tailwind/radio.js +86 -0
- package/dist/components/tailwind/select.d.ts +5 -0
- package/dist/components/tailwind/select.js +40 -0
- package/dist/components/tailwind/sidebar-layout.d.ts +5 -0
- package/dist/components/tailwind/sidebar-layout.js +18 -0
- package/dist/components/tailwind/sidebar.d.ts +18 -0
- package/dist/components/tailwind/sidebar.js +56 -0
- package/dist/components/tailwind/stacked-layout.d.ts +5 -0
- package/dist/components/tailwind/stacked-layout.js +18 -0
- package/dist/components/tailwind/switch.d.ts +36 -0
- package/dist/components/tailwind/switch.js +146 -0
- package/dist/components/tailwind/table.d.ts +16 -0
- package/dist/components/tailwind/table.js +40 -0
- package/dist/components/tailwind/text.d.ts +5 -0
- package/dist/components/tailwind/text.js +15 -0
- package/dist/components/tailwind/textarea.d.ts +6 -0
- package/dist/components/tailwind/textarea.js +36 -0
- package/dist/components/theme/index.d.ts +2 -0
- package/dist/components/theme/index.js +2 -0
- package/dist/components/theme/theme-provider.d.ts +14 -0
- package/dist/components/theme/theme-provider.js +83 -0
- package/dist/components/theme/theme-switcher.d.ts +1 -0
- package/dist/components/theme/theme-switcher.js +12 -0
- package/dist/pages/index.d.ts +2 -0
- package/dist/pages/index.js +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.js +10 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import { Link } from './link.js';
|
|
5
|
+
export declare function Dropdown(props: Headless.MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function DropdownButton<T extends React.ElementType = typeof Button>({ as, ...props }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
} & Omit<Headless.MenuButtonProps<T>, 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function DropdownMenu({ anchor, className, ...props }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
} & Omit<Headless.MenuItemsProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function DropdownItem({ className, ...props }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
} & (Omit<Headless.MenuItemProps<'button'>, 'as' | 'className'> | Omit<Headless.MenuItemProps<typeof Link>, 'as' | 'className'>)): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DropdownHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function DropdownSection({ className, ...props }: {
|
|
17
|
+
className?: string;
|
|
18
|
+
} & Omit<Headless.MenuSectionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function DropdownHeading({ className, ...props }: {
|
|
20
|
+
className?: string;
|
|
21
|
+
} & Omit<Headless.MenuHeadingProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function DropdownDivider({ className, ...props }: {
|
|
23
|
+
className?: string;
|
|
24
|
+
} & Omit<Headless.MenuSeparatorProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function DropdownLabel({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function DropdownDescription({ className, ...props }: {
|
|
27
|
+
className?: string;
|
|
28
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function DropdownShortcut({ keys, className, ...props }: {
|
|
30
|
+
keys: string | string[];
|
|
31
|
+
className?: string;
|
|
32
|
+
} & Omit<Headless.DescriptionProps<'kbd'>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Headless from '@headlessui/react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
import { Link } from './link.js';
|
|
7
|
+
export function Dropdown(props) {
|
|
8
|
+
return _jsx(Headless.Menu, { ...props });
|
|
9
|
+
}
|
|
10
|
+
export function DropdownButton({ as = Button, ...props }) {
|
|
11
|
+
return _jsx(Headless.MenuButton, { as: as, ...props });
|
|
12
|
+
}
|
|
13
|
+
export function DropdownMenu({ anchor = 'bottom', className, ...props }) {
|
|
14
|
+
return (_jsx(Headless.MenuItems, { ...props, transition: true, anchor: anchor, className: clsx(className,
|
|
15
|
+
// Anchor positioning
|
|
16
|
+
'[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(1)] data-[anchor~=end]:[--anchor-offset:6px] data-[anchor~=start]:[--anchor-offset:-6px] sm:data-[anchor~=end]:[--anchor-offset:4px] sm:data-[anchor~=start]:[--anchor-offset:-4px]',
|
|
17
|
+
// Base styles
|
|
18
|
+
'isolate w-max rounded-xl p-1',
|
|
19
|
+
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
20
|
+
'outline outline-transparent focus:outline-hidden',
|
|
21
|
+
// Handle scrolling when menu won't fit in viewport
|
|
22
|
+
'overflow-y-auto',
|
|
23
|
+
// Popover background
|
|
24
|
+
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
25
|
+
// Shadows
|
|
26
|
+
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
27
|
+
// Define grid at the menu level if subgrid is supported
|
|
28
|
+
'supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]',
|
|
29
|
+
// Transitions
|
|
30
|
+
'transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0') }));
|
|
31
|
+
}
|
|
32
|
+
export function DropdownItem({ className, ...props }) {
|
|
33
|
+
const classes = clsx(className,
|
|
34
|
+
// Base styles
|
|
35
|
+
'group cursor-default rounded-lg px-3.5 py-2.5 focus:outline-hidden sm:px-3 sm:py-1.5',
|
|
36
|
+
// Text styles
|
|
37
|
+
'text-left text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
38
|
+
// Focus
|
|
39
|
+
'data-focus:bg-blue-500 data-focus:text-white',
|
|
40
|
+
// Disabled state
|
|
41
|
+
'data-disabled:opacity-50',
|
|
42
|
+
// Forced colors mode
|
|
43
|
+
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText] forced-colors:data-focus:*:data-[slot=icon]:text-[HighlightText]',
|
|
44
|
+
// Use subgrid when available but fallback to an explicit grid layout if not
|
|
45
|
+
'col-span-full grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] items-center supports-[grid-template-columns:subgrid]:grid-cols-subgrid',
|
|
46
|
+
// Icons
|
|
47
|
+
'*:data-[slot=icon]:col-start-1 *:data-[slot=icon]:row-start-1 *:data-[slot=icon]:mr-2.5 *:data-[slot=icon]:-ml-0.5 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:mr-2 sm:*:data-[slot=icon]:size-4', '*:data-[slot=icon]:text-zinc-500 data-focus:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400 dark:data-focus:*:data-[slot=icon]:text-white',
|
|
48
|
+
// Avatar
|
|
49
|
+
'*:data-[slot=avatar]:mr-2.5 *:data-[slot=avatar]:-ml-1 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:mr-2 sm:*:data-[slot=avatar]:size-5');
|
|
50
|
+
return 'href' in props ? (_jsx(Headless.MenuItem, { as: Link, ...props, className: classes })) : (_jsx(Headless.MenuItem, { as: "button", type: "button", ...props, className: classes }));
|
|
51
|
+
}
|
|
52
|
+
export function DropdownHeader({ className, ...props }) {
|
|
53
|
+
return _jsx("div", { ...props, className: clsx(className, 'col-span-5 px-3.5 pt-2.5 pb-1 sm:px-3') });
|
|
54
|
+
}
|
|
55
|
+
export function DropdownSection({ className, ...props }) {
|
|
56
|
+
return (_jsx(Headless.MenuSection, { ...props, className: clsx(className,
|
|
57
|
+
// Define grid at the section level instead of the item level if subgrid is supported
|
|
58
|
+
'col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]') }));
|
|
59
|
+
}
|
|
60
|
+
export function DropdownHeading({ className, ...props }) {
|
|
61
|
+
return (_jsx(Headless.MenuHeading, { ...props, className: clsx(className, 'col-span-full grid grid-cols-[1fr_auto] gap-x-12 px-3.5 pt-2 pb-1 text-sm/5 font-medium text-zinc-500 sm:px-3 sm:text-xs/5 dark:text-zinc-400') }));
|
|
62
|
+
}
|
|
63
|
+
export function DropdownDivider({ className, ...props }) {
|
|
64
|
+
return (_jsx(Headless.MenuSeparator, { ...props, className: clsx(className, 'col-span-full mx-3.5 my-1 h-px border-0 bg-zinc-950/5 sm:mx-3 dark:bg-white/10 forced-colors:bg-[CanvasText]') }));
|
|
65
|
+
}
|
|
66
|
+
export function DropdownLabel({ className, ...props }) {
|
|
67
|
+
return _jsx("div", { ...props, "data-slot": "label", className: clsx(className, 'col-start-2 row-start-1'), ...props });
|
|
68
|
+
}
|
|
69
|
+
export function DropdownDescription({ className, ...props }) {
|
|
70
|
+
return (_jsx(Headless.Description, { "data-slot": "description", ...props, className: clsx(className, 'col-span-2 col-start-2 row-start-2 text-sm/5 text-zinc-500 group-data-focus:text-white sm:text-xs/5 dark:text-zinc-400 forced-colors:group-data-focus:text-[HighlightText]') }));
|
|
71
|
+
}
|
|
72
|
+
export function DropdownShortcut({ keys, className, ...props }) {
|
|
73
|
+
return (_jsx(Headless.Description, { as: "kbd", ...props, className: clsx(className, 'col-start-5 row-start-1 flex justify-self-end'), children: (Array.isArray(keys) ? keys : keys.split('')).map((char, index) => (_jsx("kbd", { className: clsx([
|
|
74
|
+
'min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]',
|
|
75
|
+
// Make sure key names that are longer than one character (like "Tab") have extra space
|
|
76
|
+
index > 0 && char.length > 1 && 'pl-1',
|
|
77
|
+
]), children: char }, index))) }));
|
|
78
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export declare function Fieldset({ className, ...props }: {
|
|
4
|
+
className?: string;
|
|
5
|
+
} & Omit<Headless.FieldsetProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function Legend({ className, ...props }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
} & Omit<Headless.LegendProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function FieldGroup({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Field({ className, ...props }: {
|
|
11
|
+
className?: string;
|
|
12
|
+
} & Omit<Headless.FieldProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function Label({ className, ...props }: {
|
|
14
|
+
className?: string;
|
|
15
|
+
} & Omit<Headless.LabelProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Description({ className, ...props }: {
|
|
17
|
+
className?: string;
|
|
18
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function ErrorMessage({ className, ...props }: {
|
|
20
|
+
className?: string;
|
|
21
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Headless from '@headlessui/react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
export function Fieldset({ className, ...props }) {
|
|
5
|
+
return (_jsx(Headless.Fieldset, { ...props, className: clsx(className, '*:data-[slot=text]:mt-1 [&>*+[data-slot=control]]:mt-6') }));
|
|
6
|
+
}
|
|
7
|
+
export function Legend({ className, ...props }) {
|
|
8
|
+
return (_jsx(Headless.Legend, { "data-slot": "legend", ...props, className: clsx(className, 'text-base/6 font-semibold text-zinc-950 data-disabled:opacity-50 sm:text-sm/6 dark:text-white') }));
|
|
9
|
+
}
|
|
10
|
+
export function FieldGroup({ className, ...props }) {
|
|
11
|
+
return _jsx("div", { "data-slot": "control", ...props, className: clsx(className, 'space-y-8') });
|
|
12
|
+
}
|
|
13
|
+
export function Field({ className, ...props }) {
|
|
14
|
+
return (_jsx(Headless.Field, { ...props, className: clsx(className, '[&>[data-slot=label]+[data-slot=control]]:mt-3', '[&>[data-slot=label]+[data-slot=description]]:mt-1', '[&>[data-slot=description]+[data-slot=control]]:mt-3', '[&>[data-slot=control]+[data-slot=description]]:mt-3', '[&>[data-slot=control]+[data-slot=error]]:mt-3', '*:data-[slot=label]:font-medium') }));
|
|
15
|
+
}
|
|
16
|
+
export function Label({ className, ...props }) {
|
|
17
|
+
return (_jsx(Headless.Label, { "data-slot": "label", ...props, className: clsx(className, 'text-base/6 text-zinc-950 select-none data-disabled:opacity-50 sm:text-sm/6 dark:text-white') }));
|
|
18
|
+
}
|
|
19
|
+
export function Description({ className, ...props }) {
|
|
20
|
+
return (_jsx(Headless.Description, { "data-slot": "description", ...props, className: clsx(className, 'text-base/6 text-zinc-500 data-disabled:opacity-50 sm:text-sm/6 dark:text-zinc-400') }));
|
|
21
|
+
}
|
|
22
|
+
export function ErrorMessage({ className, ...props }) {
|
|
23
|
+
return (_jsx(Headless.Description, { "data-slot": "error", ...props, className: clsx(className, 'text-base/6 text-red-600 data-disabled:opacity-50 sm:text-sm/6 dark:text-red-500') }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type HeadingProps = {
|
|
2
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
} & React.ComponentPropsWithoutRef<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
|
|
4
|
+
export declare function Heading({ className, level, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function Subheading({ className, level, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
export function Heading({ className, level = 1, ...props }) {
|
|
4
|
+
const Element = `h${level}`;
|
|
5
|
+
return (_jsx(Element, { ...props, className: clsx(className, 'text-2xl/8 font-semibold text-zinc-950 sm:text-xl/8 dark:text-white') }));
|
|
6
|
+
}
|
|
7
|
+
export function Subheading({ className, level = 2, ...props }) {
|
|
8
|
+
const Element = `h${level}`;
|
|
9
|
+
return (_jsx(Element, { ...props, className: clsx(className, 'text-base/7 font-semibold text-zinc-950 sm:text-sm/6 dark:text-white') }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './alert.js';
|
|
2
|
+
export * from './auth-layout.js';
|
|
3
|
+
export * from './avatar.js';
|
|
4
|
+
export * from './badge.js';
|
|
5
|
+
export * from './button.js';
|
|
6
|
+
export * from './checkbox.js';
|
|
7
|
+
export * from './combobox.js';
|
|
8
|
+
export * from './description-list.js';
|
|
9
|
+
export * from './dialog.js';
|
|
10
|
+
export * from './divider.js';
|
|
11
|
+
export * from './dropdown.js';
|
|
12
|
+
export * from './fieldset.js';
|
|
13
|
+
export * from './heading.js';
|
|
14
|
+
export * from './input.js';
|
|
15
|
+
export * from './link.js';
|
|
16
|
+
export * from './listbox.js';
|
|
17
|
+
export * from './navbar.js';
|
|
18
|
+
export * from './pagination.js';
|
|
19
|
+
export * from './radio.js';
|
|
20
|
+
export * from './select.js';
|
|
21
|
+
export * from './sidebar-layout.js';
|
|
22
|
+
export * from './sidebar.js';
|
|
23
|
+
export * from './stacked-layout.js';
|
|
24
|
+
export * from './switch.js';
|
|
25
|
+
export * from './table.js';
|
|
26
|
+
export * from './text.js';
|
|
27
|
+
export * from './textarea.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Export all Tailwind components
|
|
2
|
+
export * from './alert.js';
|
|
3
|
+
export * from './auth-layout.js';
|
|
4
|
+
export * from './avatar.js';
|
|
5
|
+
export * from './badge.js';
|
|
6
|
+
export * from './button.js';
|
|
7
|
+
export * from './checkbox.js';
|
|
8
|
+
export * from './combobox.js';
|
|
9
|
+
export * from './description-list.js';
|
|
10
|
+
export * from './dialog.js';
|
|
11
|
+
export * from './divider.js';
|
|
12
|
+
export * from './dropdown.js';
|
|
13
|
+
export * from './fieldset.js';
|
|
14
|
+
export * from './heading.js';
|
|
15
|
+
export * from './input.js';
|
|
16
|
+
export * from './link.js';
|
|
17
|
+
export * from './listbox.js';
|
|
18
|
+
export * from './navbar.js';
|
|
19
|
+
export * from './pagination.js';
|
|
20
|
+
export * from './radio.js';
|
|
21
|
+
export * from './select.js';
|
|
22
|
+
export * from './sidebar-layout.js';
|
|
23
|
+
export * from './sidebar.js';
|
|
24
|
+
export * from './stacked-layout.js';
|
|
25
|
+
export * from './switch.js';
|
|
26
|
+
export * from './table.js';
|
|
27
|
+
export * from './text.js';
|
|
28
|
+
export * from './textarea.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function InputGroup({ children }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const dateTypes: string[];
|
|
5
|
+
type DateType = (typeof dateTypes)[number];
|
|
6
|
+
export declare const Input: React.ForwardRefExoticComponent<{
|
|
7
|
+
className?: string;
|
|
8
|
+
type?: "email" | "number" | "password" | "search" | "tel" | "text" | "url" | DateType;
|
|
9
|
+
} & Omit<Headless.InputProps<"input">, "className" | "as"> & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Headless from '@headlessui/react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
export function InputGroup({ children }) {
|
|
6
|
+
return (_jsx("span", { "data-slot": "control", className: clsx('relative isolate block', 'has-[[data-slot=icon]:first-child]:[&_input]:pl-10 has-[[data-slot=icon]:last-child]:[&_input]:pr-10 sm:has-[[data-slot=icon]:first-child]:[&_input]:pl-8 sm:has-[[data-slot=icon]:last-child]:[&_input]:pr-8', '*:data-[slot=icon]:pointer-events-none *:data-[slot=icon]:absolute *:data-[slot=icon]:top-3 *:data-[slot=icon]:z-10 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:top-2.5 sm:*:data-[slot=icon]:size-4', '[&>[data-slot=icon]:first-child]:left-3 sm:[&>[data-slot=icon]:first-child]:left-2.5 [&>[data-slot=icon]:last-child]:right-3 sm:[&>[data-slot=icon]:last-child]:right-2.5', '*:data-[slot=icon]:text-zinc-500 dark:*:data-[slot=icon]:text-zinc-400'), children: children }));
|
|
7
|
+
}
|
|
8
|
+
const dateTypes = ['date', 'datetime-local', 'month', 'time', 'week'];
|
|
9
|
+
export const Input = forwardRef(function Input({ className, ...props }, ref) {
|
|
10
|
+
return (_jsx("span", { "data-slot": "control", className: clsx([
|
|
11
|
+
className,
|
|
12
|
+
// Basic layout
|
|
13
|
+
'relative block w-full',
|
|
14
|
+
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
15
|
+
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
16
|
+
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
17
|
+
'dark:before:hidden',
|
|
18
|
+
// Focus ring
|
|
19
|
+
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset sm:focus-within:after:ring-2 sm:focus-within:after:ring-blue-500',
|
|
20
|
+
// Disabled state
|
|
21
|
+
'has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none',
|
|
22
|
+
// Invalid state
|
|
23
|
+
'has-data-invalid:before:shadow-red-500/10',
|
|
24
|
+
]), children: _jsx(Headless.Input, { ref: ref, ...props, className: clsx([
|
|
25
|
+
// Date classes
|
|
26
|
+
props.type &&
|
|
27
|
+
dateTypes.includes(props.type) && [
|
|
28
|
+
'[&::-webkit-datetime-edit-fields-wrapper]:p-0',
|
|
29
|
+
'[&::-webkit-date-and-time-value]:min-h-[1.5em]',
|
|
30
|
+
'[&::-webkit-datetime-edit]:inline-flex',
|
|
31
|
+
'[&::-webkit-datetime-edit]:p-0',
|
|
32
|
+
'[&::-webkit-datetime-edit-year-field]:p-0',
|
|
33
|
+
'[&::-webkit-datetime-edit-month-field]:p-0',
|
|
34
|
+
'[&::-webkit-datetime-edit-day-field]:p-0',
|
|
35
|
+
'[&::-webkit-datetime-edit-hour-field]:p-0',
|
|
36
|
+
'[&::-webkit-datetime-edit-minute-field]:p-0',
|
|
37
|
+
'[&::-webkit-datetime-edit-second-field]:p-0',
|
|
38
|
+
'[&::-webkit-datetime-edit-millisecond-field]:p-0',
|
|
39
|
+
'[&::-webkit-datetime-edit-meridiem-field]:p-0',
|
|
40
|
+
],
|
|
41
|
+
// Basic layout
|
|
42
|
+
'relative block w-full appearance-none rounded-lg px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
43
|
+
// Typography
|
|
44
|
+
'text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white',
|
|
45
|
+
// Border
|
|
46
|
+
'border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20',
|
|
47
|
+
// Background color
|
|
48
|
+
'bg-transparent dark:bg-white/5',
|
|
49
|
+
// Hide default focus styles
|
|
50
|
+
'focus:outline-hidden',
|
|
51
|
+
// Invalid state
|
|
52
|
+
'data-invalid:border-red-500 data-invalid:data-hover:border-red-500 dark:data-invalid:border-red-500 dark:data-invalid:data-hover:border-red-500',
|
|
53
|
+
// Disabled state
|
|
54
|
+
'data-disabled:border-zinc-950/20 dark:data-disabled:border-white/15 dark:data-disabled:bg-white/2.5 dark:data-hover:data-disabled:border-white/15',
|
|
55
|
+
// System icons
|
|
56
|
+
'dark:scheme-dark',
|
|
57
|
+
]) }) }));
|
|
58
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: Update this component to use your client-side framework's link
|
|
3
|
+
* component. We've provided examples of how to do this for Next.js, Remix, and
|
|
4
|
+
* Inertia.js in the Catalyst documentation:
|
|
5
|
+
*
|
|
6
|
+
* https://catalyst.tailwindui.com/docs#client-side-router-integration
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
export declare const Link: React.ForwardRefExoticComponent<{
|
|
10
|
+
href: string;
|
|
11
|
+
} & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* TODO: Update this component to use your client-side framework's link
|
|
4
|
+
* component. We've provided examples of how to do this for Next.js, Remix, and
|
|
5
|
+
* Inertia.js in the Catalyst documentation:
|
|
6
|
+
*
|
|
7
|
+
* https://catalyst.tailwindui.com/docs#client-side-router-integration
|
|
8
|
+
*/
|
|
9
|
+
import * as Headless from '@headlessui/react';
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
export const Link = forwardRef(function Link(props, ref) {
|
|
12
|
+
return (_jsx(Headless.DataInteractive, { children: _jsx("a", { ...props, ref: ref }) }));
|
|
13
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
export declare function Listbox<T>({ className, placeholder, autoFocus, 'aria-label': ariaLabel, children: options, ...props }: {
|
|
4
|
+
className?: string;
|
|
5
|
+
placeholder?: React.ReactNode;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
} & Omit<Headless.ListboxProps<typeof Fragment, T>, 'as' | 'multiple'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ListboxOption<T>({ children, className, ...props }: {
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
} & Omit<Headless.ListboxOptionProps<'div', T>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function ListboxLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function ListboxDescription({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Headless from '@headlessui/react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
export function Listbox({ className, placeholder, autoFocus, 'aria-label': ariaLabel, children: options, ...props }) {
|
|
7
|
+
return (_jsxs(Headless.Listbox, { ...props, multiple: false, children: [_jsxs(Headless.ListboxButton, { autoFocus: autoFocus, "data-slot": "control", "aria-label": ariaLabel, className: clsx([
|
|
8
|
+
className,
|
|
9
|
+
// Basic layout
|
|
10
|
+
'group relative block w-full',
|
|
11
|
+
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
12
|
+
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
13
|
+
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
14
|
+
'dark:before:hidden',
|
|
15
|
+
// Hide default focus styles
|
|
16
|
+
'focus:outline-hidden',
|
|
17
|
+
// Focus ring
|
|
18
|
+
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-transparent after:ring-inset data-focus:after:ring-2 data-focus:after:ring-blue-500',
|
|
19
|
+
// Disabled state
|
|
20
|
+
'data-disabled:opacity-50 data-disabled:before:bg-zinc-950/5 data-disabled:before:shadow-none',
|
|
21
|
+
]), children: [_jsx(Headless.ListboxSelectedOption, { as: "span", options: options, placeholder: placeholder && _jsx("span", { className: "block truncate text-zinc-500", children: placeholder }), className: clsx([
|
|
22
|
+
// Basic layout
|
|
23
|
+
'relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
24
|
+
// Set minimum height for when no value is selected
|
|
25
|
+
'min-h-11 sm:min-h-9',
|
|
26
|
+
// Horizontal padding
|
|
27
|
+
'pr-[calc(--spacing(7)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pl-[calc(--spacing(3)-1px)]',
|
|
28
|
+
// Typography
|
|
29
|
+
'text-left text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
30
|
+
// Border
|
|
31
|
+
'border border-zinc-950/10 group-data-active:border-zinc-950/20 group-data-hover:border-zinc-950/20 dark:border-white/10 dark:group-data-active:border-white/20 dark:group-data-hover:border-white/20',
|
|
32
|
+
// Background color
|
|
33
|
+
'bg-transparent dark:bg-white/5',
|
|
34
|
+
// Invalid state
|
|
35
|
+
'group-data-invalid:border-red-500 group-data-hover:group-data-invalid:border-red-500 dark:group-data-invalid:border-red-600 dark:data-hover:group-data-invalid:border-red-600',
|
|
36
|
+
// Disabled state
|
|
37
|
+
'group-data-disabled:border-zinc-950/20 group-data-disabled:opacity-100 dark:group-data-disabled:border-white/15 dark:group-data-disabled:bg-white/2.5 dark:group-data-disabled:data-hover:border-white/15',
|
|
38
|
+
]) }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2", children: _jsxs("svg", { className: "size-5 stroke-zinc-500 group-data-disabled:stroke-zinc-600 sm:size-4 dark:stroke-zinc-400 forced-colors:stroke-[CanvasText]", viewBox: "0 0 16 16", "aria-hidden": "true", fill: "none", children: [_jsx("path", { d: "M5.75 10.75L8 13L10.25 10.75", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.25 5.25L8 3L5.75 5.25", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })] }) })] }), _jsx(Headless.ListboxOptions, { transition: true, anchor: "selection start", className: clsx(
|
|
39
|
+
// Anchor positioning
|
|
40
|
+
'[--anchor-offset:-1.625rem] [--anchor-padding:--spacing(4)] sm:[--anchor-offset:-1.375rem]',
|
|
41
|
+
// Base styles
|
|
42
|
+
'isolate w-max min-w-[calc(var(--button-width)+1.75rem)] scroll-py-1 rounded-xl p-1 select-none',
|
|
43
|
+
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
44
|
+
'outline outline-transparent focus:outline-hidden',
|
|
45
|
+
// Handle scrolling when menu won't fit in viewport
|
|
46
|
+
'overflow-y-scroll overscroll-contain',
|
|
47
|
+
// Popover background
|
|
48
|
+
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
49
|
+
// Shadows
|
|
50
|
+
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
51
|
+
// Transitions
|
|
52
|
+
'transition-opacity duration-100 ease-in data-closed:data-leave:opacity-0 data-transition:pointer-events-none'), children: options })] }));
|
|
53
|
+
}
|
|
54
|
+
export function ListboxOption({ children, className, ...props }) {
|
|
55
|
+
const sharedClasses = clsx(
|
|
56
|
+
// Base
|
|
57
|
+
'flex min-w-0 items-center',
|
|
58
|
+
// Icons
|
|
59
|
+
'*:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 sm:*:data-[slot=icon]:size-4', '*:data-[slot=icon]:text-zinc-500 group-data-focus/option:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400', 'forced-colors:*:data-[slot=icon]:text-[CanvasText] forced-colors:group-data-focus/option:*:data-[slot=icon]:text-[Canvas]',
|
|
60
|
+
// Avatars
|
|
61
|
+
'*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5');
|
|
62
|
+
return (_jsx(Headless.ListboxOption, { as: Fragment, ...props, children: ({ selectedOption }) => {
|
|
63
|
+
if (selectedOption) {
|
|
64
|
+
return _jsx("div", { className: clsx(className, sharedClasses), children: children });
|
|
65
|
+
}
|
|
66
|
+
return (_jsxs("div", { className: clsx(
|
|
67
|
+
// Basic layout
|
|
68
|
+
'group/option grid cursor-default grid-cols-[--spacing(5)_1fr] items-baseline gap-x-2 rounded-lg py-2.5 pr-3.5 pl-2 sm:grid-cols-[--spacing(4)_1fr] sm:py-1.5 sm:pr-3 sm:pl-1.5',
|
|
69
|
+
// Typography
|
|
70
|
+
'text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
71
|
+
// Focus
|
|
72
|
+
'outline-hidden data-focus:bg-blue-500 data-focus:text-white',
|
|
73
|
+
// Forced colors mode
|
|
74
|
+
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText]',
|
|
75
|
+
// Disabled
|
|
76
|
+
'data-disabled:opacity-50'), children: [_jsx("svg", { className: "relative hidden size-5 self-center stroke-current group-data-selected/option:inline sm:size-4", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M4 8.5l3 3L12 4", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { className: clsx(className, sharedClasses, 'col-start-2'), children: children })] }));
|
|
77
|
+
} }));
|
|
78
|
+
}
|
|
79
|
+
export function ListboxLabel({ className, ...props }) {
|
|
80
|
+
return _jsx("span", { ...props, className: clsx(className, 'ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0') });
|
|
81
|
+
}
|
|
82
|
+
export function ListboxDescription({ className, children, ...props }) {
|
|
83
|
+
return (_jsx("span", { ...props, className: clsx(className, 'flex flex-1 overflow-hidden text-zinc-500 group-data-focus/option:text-white before:w-2 before:min-w-0 before:shrink dark:text-zinc-400'), children: _jsx("span", { className: "flex-1 truncate", children: children }) }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function Navbar({ className, ...props }: React.ComponentPropsWithoutRef<'nav'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function NavbarDivider({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function NavbarSection({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function NavbarSpacer({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const NavbarItem: React.ForwardRefExoticComponent<({
|
|
8
|
+
current?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
} & (Omit<Headless.ButtonProps<"button">, "className" | "as"> | Omit<Omit<{
|
|
12
|
+
href: string;
|
|
13
|
+
} & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>, "ref">, "className">)) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
14
|
+
export declare function NavbarLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Headless from '@headlessui/react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { LayoutGroup, motion } from 'framer-motion';
|
|
6
|
+
import { forwardRef, useId } from 'react';
|
|
7
|
+
import { TouchTarget } from './button.js';
|
|
8
|
+
import { Link } from './link.js';
|
|
9
|
+
export function Navbar({ className, ...props }) {
|
|
10
|
+
return _jsx("nav", { ...props, className: clsx(className, 'flex flex-1 items-center gap-4 py-2.5') });
|
|
11
|
+
}
|
|
12
|
+
export function NavbarDivider({ className, ...props }) {
|
|
13
|
+
return _jsx("div", { "aria-hidden": "true", ...props, className: clsx(className, 'h-6 w-px bg-zinc-950/10 dark:bg-white/10') });
|
|
14
|
+
}
|
|
15
|
+
export function NavbarSection({ className, ...props }) {
|
|
16
|
+
const id = useId();
|
|
17
|
+
return (_jsx(LayoutGroup, { id: id, children: _jsx("div", { ...props, className: clsx(className, 'flex items-center gap-3') }) }));
|
|
18
|
+
}
|
|
19
|
+
export function NavbarSpacer({ className, ...props }) {
|
|
20
|
+
return _jsx("div", { "aria-hidden": "true", ...props, className: clsx(className, '-ml-4 flex-1') });
|
|
21
|
+
}
|
|
22
|
+
export const NavbarItem = forwardRef(function NavbarItem({ current, className, children, ...props }, ref) {
|
|
23
|
+
const classes = clsx(
|
|
24
|
+
// Base
|
|
25
|
+
'relative flex min-w-0 items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 sm:text-sm/5',
|
|
26
|
+
// Leading icon/icon-only
|
|
27
|
+
'*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5',
|
|
28
|
+
// Trailing icon (down chevron or similar)
|
|
29
|
+
'*:not-nth-2:last:data-[slot=icon]:ml-auto *:not-nth-2:last:data-[slot=icon]:size-5 sm:*:not-nth-2:last:data-[slot=icon]:size-4',
|
|
30
|
+
// Avatar
|
|
31
|
+
'*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 *:data-[slot=avatar]:[--avatar-radius:var(--radius-md)] sm:*:data-[slot=avatar]:size-6',
|
|
32
|
+
// Hover
|
|
33
|
+
'data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950',
|
|
34
|
+
// Active
|
|
35
|
+
'data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950',
|
|
36
|
+
// Dark mode
|
|
37
|
+
'dark:text-white dark:*:data-[slot=icon]:fill-zinc-400', 'dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white', 'dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white');
|
|
38
|
+
return (_jsxs("span", { className: clsx(className, 'relative'), children: [current && (_jsx(motion.span, { layoutId: "current-indicator", className: "absolute inset-x-2 -bottom-2.5 h-0.5 rounded-full bg-zinc-950 dark:bg-white" })), 'href' in props ? (_jsx(Link, { ...props, className: classes, "data-current": current ? 'true' : undefined, ref: ref, children: _jsx(TouchTarget, { children: children }) })) : (_jsx(Headless.Button, { ...props, className: clsx('cursor-default', classes), "data-current": current ? 'true' : undefined, ref: ref, children: _jsx(TouchTarget, { children: children }) }))] }));
|
|
39
|
+
});
|
|
40
|
+
export function NavbarLabel({ className, ...props }) {
|
|
41
|
+
return _jsx("span", { ...props, className: clsx(className, 'truncate') });
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare function Pagination({ 'aria-label': ariaLabel, className, ...props }: React.ComponentPropsWithoutRef<'nav'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function PaginationPrevious({ href, className, children, }: React.PropsWithChildren<{
|
|
4
|
+
href?: string | null;
|
|
5
|
+
className?: string;
|
|
6
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function PaginationNext({ href, className, children, }: React.PropsWithChildren<{
|
|
8
|
+
href?: string | null;
|
|
9
|
+
className?: string;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function PaginationList({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function PaginationPage({ href, className, current, children, }: React.PropsWithChildren<{
|
|
13
|
+
href: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
current?: boolean;
|
|
16
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function PaginationGap({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
export function Pagination({ 'aria-label': ariaLabel = 'Page navigation', className, ...props }) {
|
|
5
|
+
return _jsx("nav", { "aria-label": ariaLabel, ...props, className: clsx(className, 'flex gap-x-2') });
|
|
6
|
+
}
|
|
7
|
+
export function PaginationPrevious({ href = null, className, children = 'Previous', }) {
|
|
8
|
+
return (_jsx("span", { className: clsx(className, 'grow basis-0'), children: _jsxs(Button, { ...(href === null ? { disabled: true } : { href }), plain: true, "aria-label": "Previous page", children: [_jsx("svg", { className: "stroke-current", "data-slot": "icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M2.75 8H13.25M2.75 8L5.25 5.5M2.75 8L5.25 10.5", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) }), children] }) }));
|
|
9
|
+
}
|
|
10
|
+
export function PaginationNext({ href = null, className, children = 'Next', }) {
|
|
11
|
+
return (_jsx("span", { className: clsx(className, 'flex grow basis-0 justify-end'), children: _jsxs(Button, { ...(href === null ? { disabled: true } : { href }), plain: true, "aria-label": "Next page", children: [children, _jsx("svg", { className: "stroke-current", "data-slot": "icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M13.25 8L2.75 8M13.25 8L10.75 10.5M13.25 8L10.75 5.5", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) })] }) }));
|
|
12
|
+
}
|
|
13
|
+
export function PaginationList({ className, ...props }) {
|
|
14
|
+
return _jsx("span", { ...props, className: clsx(className, 'hidden items-baseline gap-x-2 sm:flex') });
|
|
15
|
+
}
|
|
16
|
+
export function PaginationPage({ href, className, current = false, children, }) {
|
|
17
|
+
return (_jsx(Button, { href: href, plain: true, "aria-label": `Page ${children}`, "aria-current": current ? 'page' : undefined, className: clsx(className, 'min-w-9 before:absolute before:-inset-px before:rounded-lg', current && 'before:bg-zinc-950/5 dark:before:bg-white/10'), children: _jsx("span", { className: "-mx-0.5", children: children }) }));
|
|
18
|
+
}
|
|
19
|
+
export function PaginationGap({ className, children = _jsx(_Fragment, { children: "\u2026" }), ...props }) {
|
|
20
|
+
return (_jsx("span", { "aria-hidden": "true", ...props, className: clsx(className, 'w-9 text-center text-sm/6 font-semibold text-zinc-950 select-none dark:text-white'), children: children }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Headless from '@headlessui/react';
|
|
2
|
+
export declare function RadioGroup({ className, ...props }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
} & Omit<Headless.RadioGroupProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function RadioField({ className, ...props }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
} & Omit<Headless.FieldProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const colors: {
|
|
9
|
+
'dark/zinc': string[];
|
|
10
|
+
'dark/white': string[];
|
|
11
|
+
white: string;
|
|
12
|
+
dark: string;
|
|
13
|
+
zinc: string;
|
|
14
|
+
red: string;
|
|
15
|
+
orange: string;
|
|
16
|
+
amber: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
lime: string;
|
|
19
|
+
green: string;
|
|
20
|
+
emerald: string;
|
|
21
|
+
teal: string;
|
|
22
|
+
cyan: string;
|
|
23
|
+
sky: string;
|
|
24
|
+
blue: string;
|
|
25
|
+
indigo: string;
|
|
26
|
+
violet: string;
|
|
27
|
+
purple: string;
|
|
28
|
+
fuchsia: string;
|
|
29
|
+
pink: string;
|
|
30
|
+
rose: string;
|
|
31
|
+
};
|
|
32
|
+
type Color = keyof typeof colors;
|
|
33
|
+
export declare function Radio({ color, className, ...props }: {
|
|
34
|
+
color?: Color;
|
|
35
|
+
className?: string;
|
|
36
|
+
} & Omit<Headless.RadioProps, 'as' | 'className' | 'children'>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|