@taicode/common-web 1.1.3 → 1.1.5
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/output/catalyst/alert.d.ts +5 -5
- package/output/catalyst/alert.d.ts.map +1 -1
- package/output/catalyst/alert.js +46 -0
- package/output/catalyst/auth-layout.d.ts +1 -1
- package/output/catalyst/auth-layout.d.ts.map +1 -1
- package/output/catalyst/auth-layout.js +4 -0
- package/output/catalyst/avatar.d.ts +1 -1
- package/output/catalyst/avatar.d.ts.map +1 -1
- package/output/catalyst/{avatar.jsx → avatar.js} +5 -20
- package/output/catalyst/badge.d.ts +1 -1
- package/output/catalyst/badge.d.ts.map +1 -1
- package/output/catalyst/{badge.jsx → badge.js} +4 -11
- package/output/catalyst/button.d.ts +1 -1
- package/output/catalyst/button.d.ts.map +1 -1
- package/output/catalyst/{button.jsx → button.js} +4 -10
- package/output/catalyst/checkbox.d.ts +3 -3
- package/output/catalyst/checkbox.d.ts.map +1 -1
- package/output/catalyst/{checkbox.jsx → checkbox.js} +6 -14
- package/output/catalyst/combobox.d.ts +4 -4
- package/output/catalyst/combobox.d.ts.map +1 -1
- package/output/catalyst/combobox.js +101 -0
- package/output/catalyst/description-list.d.ts +3 -3
- package/output/catalyst/description-list.d.ts.map +1 -1
- package/output/catalyst/{description-list.jsx → description-list.js} +4 -3
- package/output/catalyst/dialog.d.ts +5 -5
- package/output/catalyst/dialog.d.ts.map +1 -1
- package/output/catalyst/dialog.js +46 -0
- package/output/catalyst/divider.d.ts +1 -1
- package/output/catalyst/divider.d.ts.map +1 -1
- package/output/catalyst/{divider.jsx → divider.js} +2 -1
- package/output/catalyst/dropdown.d.ts +11 -11
- package/output/catalyst/dropdown.d.ts.map +1 -1
- package/output/catalyst/{dropdown.jsx → dropdown.js} +15 -18
- package/output/catalyst/fieldset.d.ts +7 -7
- package/output/catalyst/fieldset.d.ts.map +1 -1
- package/output/catalyst/fieldset.js +42 -0
- package/output/catalyst/heading.d.ts +2 -2
- package/output/catalyst/heading.d.ts.map +1 -1
- package/output/catalyst/{heading.jsx → heading.js} +3 -2
- package/output/catalyst/input.d.ts +1 -1
- package/output/catalyst/input.d.ts.map +1 -1
- package/output/catalyst/input.js +70 -0
- package/output/catalyst/{link.jsx → link.js} +3 -4
- package/output/catalyst/listbox.d.ts +4 -4
- package/output/catalyst/listbox.d.ts.map +1 -1
- package/output/catalyst/listbox.js +99 -0
- package/output/catalyst/navbar.d.ts +5 -5
- package/output/catalyst/navbar.d.ts.map +1 -1
- package/output/catalyst/{navbar.jsx → navbar.js} +8 -16
- package/output/catalyst/pagination.d.ts +6 -6
- package/output/catalyst/pagination.d.ts.map +1 -1
- package/output/catalyst/pagination.js +35 -0
- package/output/catalyst/radio.d.ts +3 -3
- package/output/catalyst/radio.d.ts.map +1 -1
- package/output/catalyst/{radio.jsx → radio.js} +8 -11
- package/output/catalyst/select.js +52 -0
- package/output/catalyst/sidebar-layout.d.ts +1 -1
- package/output/catalyst/sidebar-layout.d.ts.map +1 -1
- package/output/catalyst/sidebar-layout.js +18 -0
- package/output/catalyst/sidebar.d.ts +9 -9
- package/output/catalyst/sidebar.d.ts.map +1 -1
- package/output/catalyst/{sidebar.jsx → sidebar.js} +12 -20
- package/output/catalyst/stacked-layout.d.ts +1 -1
- package/output/catalyst/stacked-layout.d.ts.map +1 -1
- package/output/catalyst/stacked-layout.js +18 -0
- package/output/catalyst/switch.d.ts +3 -3
- package/output/catalyst/switch.d.ts.map +1 -1
- package/output/catalyst/{switch.jsx → switch.js} +19 -20
- package/output/catalyst/table.d.ts +6 -6
- package/output/catalyst/table.d.ts.map +1 -1
- package/output/catalyst/table.js +56 -0
- package/output/catalyst/text.d.ts +4 -4
- package/output/catalyst/text.d.ts.map +1 -1
- package/output/catalyst/{text.jsx → text.js} +5 -4
- package/output/catalyst/{textarea.jsx → textarea.js} +21 -22
- package/output/service/{service.test.jsx → service.test.js} +6 -15
- package/package.json +6 -1
- package/output/catalyst/alert.jsx +0 -55
- package/output/catalyst/auth-layout.jsx +0 -7
- package/output/catalyst/combobox.jsx +0 -120
- package/output/catalyst/dialog.jsx +0 -55
- package/output/catalyst/fieldset.jsx +0 -41
- package/output/catalyst/input.jsx +0 -73
- package/output/catalyst/listbox.jsx +0 -120
- package/output/catalyst/pagination.jsx +0 -52
- package/output/catalyst/select.jsx +0 -59
- package/output/catalyst/sidebar-layout.jsx +0 -58
- package/output/catalyst/stacked-layout.jsx +0 -55
- package/output/catalyst/table.jsx +0 -68
- package/output/helpers/cache-api/cache-api.d.ts +0 -13
- package/output/helpers/cache-api/cache-api.d.ts.map +0 -1
- package/output/helpers/cache-api/cache-api.js +0 -114
- package/output/helpers/cache-api/cache-api.test.d.ts +0 -2
- package/output/helpers/cache-api/cache-api.test.d.ts.map +0 -1
- package/output/helpers/cache-api/cache-api.test.js +0 -348
- package/output/helpers/cache-api/index.d.ts +0 -2
- package/output/helpers/cache-api/index.d.ts.map +0 -1
- package/output/helpers/cache-api/index.js +0 -1
- package/output/helpers/service/index.d.ts +0 -1
- package/output/helpers/service/index.d.ts.map +0 -1
- package/output/helpers/service/index.js +0 -1
- package/output/helpers/service/service.d.ts +0 -5
- package/output/helpers/service/service.d.ts.map +0 -1
- package/output/helpers/service/service.js +0 -2
- package/output/helpers/side-cache/index.d.ts +0 -2
- package/output/helpers/side-cache/index.d.ts.map +0 -1
- package/output/helpers/side-cache/index.js +0 -1
- package/output/helpers/side-cache/side-cache.d.ts +0 -10
- package/output/helpers/side-cache/side-cache.d.ts.map +0 -1
- package/output/helpers/side-cache/side-cache.js +0 -137
- package/output/helpers/side-cache/side-cache.test.d.ts +0 -2
- package/output/helpers/side-cache/side-cache.test.d.ts.map +0 -1
- package/output/helpers/side-cache/side-cache.test.js +0 -179
- package/output/helpers/use-observer/index.d.ts +0 -2
- package/output/helpers/use-observer/index.d.ts.map +0 -1
- package/output/helpers/use-observer/index.js +0 -1
- package/output/helpers/use-observer/use-observer.d.ts +0 -3
- package/output/helpers/use-observer/use-observer.d.ts.map +0 -1
- package/output/helpers/use-observer/use-observer.js +0 -16
- package/output/helpers/use-observer/use-observer.test.d.ts +0 -2
- package/output/helpers/use-observer/use-observer.test.d.ts.map +0 -1
- package/output/use-observer/use-observer.test.jsx +0 -134
- /package/output/{helpers/use-observer/use-observer.test.jsx → use-observer/use-observer.test.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../source/catalyst/divider.tsx"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,EACtB,IAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../source/catalyst/divider.tsx"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,EACtB,IAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,2CAa3D"}
|
|
@@ -9,8 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import clsx from 'clsx';
|
|
13
14
|
export function Divider(_a) {
|
|
14
15
|
var { soft = false, className } = _a, props = __rest(_a, ["soft", "className"]);
|
|
15
|
-
return (
|
|
16
|
+
return (_jsx("hr", Object.assign({ role: "presentation" }, props, { className: clsx(className, 'w-full border-t', soft && 'border-zinc-950/5 dark:border-white/5', !soft && 'border-zinc-950/10 dark:border-white/10') })));
|
|
16
17
|
}
|
|
@@ -2,32 +2,32 @@ import * as Headless from '@headlessui/react';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import { Button } from './button';
|
|
4
4
|
import { Link } from './link';
|
|
5
|
-
export declare function Dropdown(props: Headless.MenuProps):
|
|
5
|
+
export declare function Dropdown(props: Headless.MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function DropdownButton<T extends React.ElementType = typeof Button>({ as, ...props }: {
|
|
7
7
|
className?: string;
|
|
8
|
-
} & Omit<Headless.MenuButtonProps<T>, 'className'>):
|
|
8
|
+
} & Omit<Headless.MenuButtonProps<T>, 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function DropdownMenu({ anchor, className, ...props }: {
|
|
10
10
|
className?: string;
|
|
11
|
-
} & Omit<Headless.MenuItemsProps, 'as' | 'className'>):
|
|
11
|
+
} & Omit<Headless.MenuItemsProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare function DropdownItem({ className, ...props }: {
|
|
13
13
|
className?: string;
|
|
14
|
-
} & (Omit<Headless.MenuItemProps<'button'>, 'as' | 'className'> | Omit<Headless.MenuItemProps<typeof Link>, 'as' | 'className'>)):
|
|
15
|
-
export declare function DropdownHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
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
16
|
export declare function DropdownSection({ className, ...props }: {
|
|
17
17
|
className?: string;
|
|
18
|
-
} & Omit<Headless.MenuSectionProps, 'as' | 'className'>):
|
|
18
|
+
} & Omit<Headless.MenuSectionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare function DropdownHeading({ className, ...props }: {
|
|
20
20
|
className?: string;
|
|
21
|
-
} & Omit<Headless.MenuHeadingProps, 'as' | 'className'>):
|
|
21
|
+
} & Omit<Headless.MenuHeadingProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare function DropdownDivider({ className, ...props }: {
|
|
23
23
|
className?: string;
|
|
24
|
-
} & Omit<Headless.MenuSeparatorProps, 'as' | 'className'>):
|
|
25
|
-
export declare function DropdownLabel({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
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
26
|
export declare function DropdownDescription({ className, ...props }: {
|
|
27
27
|
className?: string;
|
|
28
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>):
|
|
28
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export declare function DropdownShortcut({ keys, className, ...props }: {
|
|
30
30
|
keys: string | string[];
|
|
31
31
|
className?: string;
|
|
32
|
-
} & Omit<Headless.DescriptionProps<'kbd'>, 'as' | 'className'>):
|
|
32
|
+
} & Omit<Headless.DescriptionProps<'kbd'>, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../source/catalyst/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"dropdown.d.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as Headless from '@headlessui/react';
|
|
14
15
|
import clsx from 'clsx';
|
|
15
16
|
import { Button } from './button';
|
|
16
17
|
import { Link } from './link';
|
|
17
18
|
export function Dropdown(props) {
|
|
18
|
-
return
|
|
19
|
+
return _jsx(Headless.Menu, Object.assign({}, props));
|
|
19
20
|
}
|
|
20
21
|
export function DropdownButton(_a) {
|
|
21
22
|
var { as = Button } = _a, props = __rest(_a, ["as"]);
|
|
22
|
-
return
|
|
23
|
+
return _jsx(Headless.MenuButton, Object.assign({ as: as }, props));
|
|
23
24
|
}
|
|
24
25
|
export function DropdownMenu(_a) {
|
|
25
26
|
var { anchor = 'bottom', className } = _a, props = __rest(_a, ["anchor", "className"]);
|
|
26
|
-
return (
|
|
27
|
+
return (_jsx(Headless.MenuItems, Object.assign({}, props, { transition: true, anchor: anchor, className: clsx(className,
|
|
27
28
|
// Anchor positioning
|
|
28
29
|
'[--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]',
|
|
29
30
|
// Base styles
|
|
@@ -39,7 +40,7 @@ export function DropdownMenu(_a) {
|
|
|
39
40
|
// Define grid at the menu level if subgrid is supported
|
|
40
41
|
'supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]',
|
|
41
42
|
// Transitions
|
|
42
|
-
'transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0')}
|
|
43
|
+
'transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0') })));
|
|
43
44
|
}
|
|
44
45
|
export function DropdownItem(_a) {
|
|
45
46
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
@@ -60,43 +61,39 @@ export function DropdownItem(_a) {
|
|
|
60
61
|
'*: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',
|
|
61
62
|
// Avatar
|
|
62
63
|
'*: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');
|
|
63
|
-
return 'href' in props ? (
|
|
64
|
+
return 'href' in props ? (_jsx(Headless.MenuItem, Object.assign({ as: Link }, props, { className: classes }))) : (_jsx(Headless.MenuItem, Object.assign({ as: "button", type: "button" }, props, { className: classes })));
|
|
64
65
|
}
|
|
65
66
|
export function DropdownHeader(_a) {
|
|
66
67
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
67
|
-
return
|
|
68
|
+
return _jsx("div", Object.assign({}, props, { className: clsx(className, 'col-span-5 px-3.5 pt-2.5 pb-1 sm:px-3') }));
|
|
68
69
|
}
|
|
69
70
|
export function DropdownSection(_a) {
|
|
70
71
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
71
|
-
return (
|
|
72
|
+
return (_jsx(Headless.MenuSection, Object.assign({}, props, { className: clsx(className,
|
|
72
73
|
// Define grid at the section level instead of the item level if subgrid is supported
|
|
73
|
-
'col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]')}
|
|
74
|
+
'col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]') })));
|
|
74
75
|
}
|
|
75
76
|
export function DropdownHeading(_a) {
|
|
76
77
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
77
|
-
return (
|
|
78
|
+
return (_jsx(Headless.MenuHeading, Object.assign({}, 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') })));
|
|
78
79
|
}
|
|
79
80
|
export function DropdownDivider(_a) {
|
|
80
81
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
81
|
-
return (
|
|
82
|
+
return (_jsx(Headless.MenuSeparator, Object.assign({}, 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]') })));
|
|
82
83
|
}
|
|
83
84
|
export function DropdownLabel(_a) {
|
|
84
85
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
85
|
-
return
|
|
86
|
+
return _jsx("div", Object.assign({}, props, { "data-slot": "label", className: clsx(className, 'col-start-2 row-start-1') }, props));
|
|
86
87
|
}
|
|
87
88
|
export function DropdownDescription(_a) {
|
|
88
89
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
89
|
-
return (
|
|
90
|
+
return (_jsx(Headless.Description, Object.assign({ "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]') })));
|
|
90
91
|
}
|
|
91
92
|
export function DropdownShortcut(_a) {
|
|
92
93
|
var { keys, className } = _a, props = __rest(_a, ["keys", "className"]);
|
|
93
|
-
return (
|
|
94
|
-
{(Array.isArray(keys) ? keys : keys.split('')).map((char, index) => (<kbd key={index} className={clsx([
|
|
94
|
+
return (_jsx(Headless.Description, Object.assign({ 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([
|
|
95
95
|
'min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]',
|
|
96
96
|
// Make sure key names that are longer than one character (like "Tab") have extra space
|
|
97
97
|
index > 0 && char.length > 1 && 'pl-1',
|
|
98
|
-
])}
|
|
99
|
-
{char}
|
|
100
|
-
</kbd>))}
|
|
101
|
-
</Headless.Description>);
|
|
98
|
+
]), children: char }, index))) })));
|
|
102
99
|
}
|
|
@@ -2,21 +2,21 @@ import * as Headless from '@headlessui/react';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
export declare function Fieldset({ className, ...props }: {
|
|
4
4
|
className?: string;
|
|
5
|
-
} & Omit<Headless.FieldsetProps, 'as' | 'className'>):
|
|
5
|
+
} & Omit<Headless.FieldsetProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function Legend({ className, ...props }: {
|
|
7
7
|
className?: string;
|
|
8
|
-
} & Omit<Headless.LegendProps, 'as' | 'className'>):
|
|
9
|
-
export declare function FieldGroup({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
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
10
|
export declare function Field({ className, ...props }: {
|
|
11
11
|
className?: string;
|
|
12
|
-
} & Omit<Headless.FieldProps, 'as' | 'className'>):
|
|
12
|
+
} & Omit<Headless.FieldProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare function Label({ className, ...props }: {
|
|
14
14
|
className?: string;
|
|
15
|
-
} & Omit<Headless.LabelProps, 'as' | 'className'>):
|
|
15
|
+
} & Omit<Headless.LabelProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export declare function Description({ className, ...props }: {
|
|
17
17
|
className?: string;
|
|
18
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>):
|
|
18
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare function ErrorMessage({ className, ...props }: {
|
|
20
20
|
className?: string;
|
|
21
|
-
} & Omit<Headless.DescriptionProps, 'as' | 'className'>):
|
|
21
|
+
} & Omit<Headless.DescriptionProps, 'as' | 'className'>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../source/catalyst/fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../source/catalyst/fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,2CAO3E;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,WAAW,CAAC,2CAWzE;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAExF;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CAepH;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,2CAWpH;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAQ9E;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,GAAG,WAAW,CAAC,2CAQ9E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as Headless from '@headlessui/react';
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
export function Fieldset(_a) {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (_jsx(Headless.Fieldset, Object.assign({}, props, { className: clsx(className, '*:data-[slot=text]:mt-1 [&>*+[data-slot=control]]:mt-6') })));
|
|
18
|
+
}
|
|
19
|
+
export function Legend(_a) {
|
|
20
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
+
return (_jsx(Headless.Legend, Object.assign({ "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') })));
|
|
22
|
+
}
|
|
23
|
+
export function FieldGroup(_a) {
|
|
24
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
+
return _jsx("div", Object.assign({ "data-slot": "control" }, props, { className: clsx(className, 'space-y-8') }));
|
|
26
|
+
}
|
|
27
|
+
export function Field(_a) {
|
|
28
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
+
return (_jsx(Headless.Field, Object.assign({}, 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') })));
|
|
30
|
+
}
|
|
31
|
+
export function Label(_a) {
|
|
32
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
+
return (_jsx(Headless.Label, Object.assign({ "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') })));
|
|
34
|
+
}
|
|
35
|
+
export function Description(_a) {
|
|
36
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
+
return (_jsx(Headless.Description, Object.assign({ "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') })));
|
|
38
|
+
}
|
|
39
|
+
export function ErrorMessage(_a) {
|
|
40
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
+
return (_jsx(Headless.Description, Object.assign({ "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') })));
|
|
42
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type HeadingProps = {
|
|
2
2
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
3
|
} & React.ComponentPropsWithoutRef<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
|
|
4
|
-
export declare function Heading({ className, level, ...props }: HeadingProps): import("react").JSX.Element;
|
|
5
|
-
export declare function Subheading({ className, level, ...props }: HeadingProps): import("react").JSX.Element;
|
|
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
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../source/catalyst/heading.tsx"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CACpF,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CACxC,CAAA;AAED,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,KAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../source/catalyst/heading.tsx"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,GAAG,KAAK,CAAC,wBAAwB,CACpF,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CACxC,CAAA;AAED,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,KAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CASvE;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAS1E"}
|
|
@@ -9,14 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import clsx from 'clsx';
|
|
13
14
|
export function Heading(_a) {
|
|
14
15
|
var { className, level = 1 } = _a, props = __rest(_a, ["className", "level"]);
|
|
15
16
|
let Element = `h${level}`;
|
|
16
|
-
return (
|
|
17
|
+
return (_jsx(Element, Object.assign({}, props, { className: clsx(className, 'text-2xl/8 font-semibold text-zinc-950 sm:text-xl/8 dark:text-white') })));
|
|
17
18
|
}
|
|
18
19
|
export function Subheading(_a) {
|
|
19
20
|
var { className, level = 2 } = _a, props = __rest(_a, ["className", "level"]);
|
|
20
21
|
let Element = `h${level}`;
|
|
21
|
-
return (
|
|
22
|
+
return (_jsx(Element, Object.assign({}, props, { className: clsx(className, 'text-base/7 font-semibold text-zinc-950 sm:text-sm/6 dark:text-white') })));
|
|
22
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Headless from '@headlessui/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare function InputGroup({ children }: React.ComponentPropsWithoutRef<'span'>):
|
|
3
|
+
export declare function InputGroup({ children }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const dateTypes: string[];
|
|
5
5
|
type DateType = (typeof dateTypes)[number];
|
|
6
6
|
export declare const Input: React.ForwardRefExoticComponent<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../source/catalyst/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../source/catalyst/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAe9E;AAED,QAAA,MAAM,SAAS,UAAsD,CAAA;AACrE,KAAK,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1C,eAAO,MAAM,KAAK;gBAKF,MAAM;WACX,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ;mGA+DvF,CAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as Headless from '@headlessui/react';
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
import { forwardRef } from 'react';
|
|
16
|
+
export function InputGroup({ children }) {
|
|
17
|
+
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 }));
|
|
18
|
+
}
|
|
19
|
+
const dateTypes = ['date', 'datetime-local', 'month', 'time', 'week'];
|
|
20
|
+
export const Input = forwardRef(function Input(_a, ref) {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx("span", { "data-slot": "control", className: clsx([
|
|
23
|
+
className,
|
|
24
|
+
// Basic layout
|
|
25
|
+
'relative block w-full',
|
|
26
|
+
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
27
|
+
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
28
|
+
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
29
|
+
'dark:before:hidden',
|
|
30
|
+
// Focus ring
|
|
31
|
+
'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',
|
|
32
|
+
// Disabled state
|
|
33
|
+
'has-data-disabled:opacity-50 has-data-disabled:before:bg-zinc-950/5 has-data-disabled:before:shadow-none',
|
|
34
|
+
// Invalid state
|
|
35
|
+
'has-data-invalid:before:shadow-red-500/10',
|
|
36
|
+
]), children: _jsx(Headless.Input, Object.assign({ ref: ref }, props, { className: clsx([
|
|
37
|
+
// Date classes
|
|
38
|
+
props.type &&
|
|
39
|
+
dateTypes.includes(props.type) && [
|
|
40
|
+
'[&::-webkit-datetime-edit-fields-wrapper]:p-0',
|
|
41
|
+
'[&::-webkit-date-and-time-value]:min-h-[1.5em]',
|
|
42
|
+
'[&::-webkit-datetime-edit]:inline-flex',
|
|
43
|
+
'[&::-webkit-datetime-edit]:p-0',
|
|
44
|
+
'[&::-webkit-datetime-edit-year-field]:p-0',
|
|
45
|
+
'[&::-webkit-datetime-edit-month-field]:p-0',
|
|
46
|
+
'[&::-webkit-datetime-edit-day-field]:p-0',
|
|
47
|
+
'[&::-webkit-datetime-edit-hour-field]:p-0',
|
|
48
|
+
'[&::-webkit-datetime-edit-minute-field]:p-0',
|
|
49
|
+
'[&::-webkit-datetime-edit-second-field]:p-0',
|
|
50
|
+
'[&::-webkit-datetime-edit-millisecond-field]:p-0',
|
|
51
|
+
'[&::-webkit-datetime-edit-meridiem-field]:p-0',
|
|
52
|
+
],
|
|
53
|
+
// Basic layout
|
|
54
|
+
'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)]',
|
|
55
|
+
// Typography
|
|
56
|
+
'text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white',
|
|
57
|
+
// Border
|
|
58
|
+
'border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20',
|
|
59
|
+
// Background color
|
|
60
|
+
'bg-transparent dark:bg-white/5',
|
|
61
|
+
// Hide default focus styles
|
|
62
|
+
'focus:outline-hidden',
|
|
63
|
+
// Invalid state
|
|
64
|
+
'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',
|
|
65
|
+
// Disabled state
|
|
66
|
+
'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',
|
|
67
|
+
// System icons
|
|
68
|
+
'dark:scheme-dark',
|
|
69
|
+
]) })) }));
|
|
70
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
* TODO: Update this component to use your client-side framework's link
|
|
3
4
|
* component. We've provided examples of how to do this for Next.js, Remix, and
|
|
@@ -6,9 +7,7 @@
|
|
|
6
7
|
* https://catalyst.tailwindui.com/docs#client-side-router-integration
|
|
7
8
|
*/
|
|
8
9
|
import * as Headless from '@headlessui/react';
|
|
9
|
-
import
|
|
10
|
+
import { forwardRef } from 'react';
|
|
10
11
|
export const Link = forwardRef(function Link(props, ref) {
|
|
11
|
-
return (
|
|
12
|
-
<a {...props} ref={ref}/>
|
|
13
|
-
</Headless.DataInteractive>);
|
|
12
|
+
return (_jsx(Headless.DataInteractive, { children: _jsx("a", Object.assign({}, props, { ref: ref })) }));
|
|
14
13
|
});
|
|
@@ -6,11 +6,11 @@ export declare function Listbox<T>({ className, placeholder, autoFocus, 'aria-la
|
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
'aria-label'?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
} & Omit<Headless.ListboxProps<typeof Fragment, T>, 'as' | 'multiple'>): import("react").JSX.Element;
|
|
9
|
+
} & Omit<Headless.ListboxProps<typeof Fragment, T>, 'as' | 'multiple'>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare function ListboxOption<T>({ children, className, ...props }: {
|
|
11
11
|
className?: string;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
|
-
} & Omit<Headless.ListboxOptionProps<'div', T>, 'as' | 'className'>): import("react").JSX.Element;
|
|
14
|
-
export declare function ListboxLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react").JSX.Element;
|
|
15
|
-
export declare function ListboxDescription({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react").JSX.Element;
|
|
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;
|
|
16
16
|
//# sourceMappingURL=listbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.d.ts","sourceRoot":"","sources":["../../source/catalyst/listbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,SAAS,EACT,WAAW,EACX,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,QAAQ,EAAE,OAAO,EACjB,GAAG,KAAK,EACT,EAAE;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rC,IAAI,GAAG,WAAW,CACnB,2CAgDA;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAE3F;AAED,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAY3G"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as Headless from '@headlessui/react';
|
|
15
|
+
import clsx from 'clsx';
|
|
16
|
+
import { Fragment } from 'react';
|
|
17
|
+
export function Listbox(_a) {
|
|
18
|
+
var { className, placeholder, autoFocus, 'aria-label': ariaLabel, children: options } = _a, props = __rest(_a, ["className", "placeholder", "autoFocus", 'aria-label', "children"]);
|
|
19
|
+
return (_jsxs(Headless.Listbox, Object.assign({}, props, { multiple: false, children: [_jsxs(Headless.ListboxButton, { autoFocus: autoFocus, "data-slot": "control", "aria-label": ariaLabel, className: clsx([
|
|
20
|
+
className,
|
|
21
|
+
// Basic layout
|
|
22
|
+
'group relative block w-full',
|
|
23
|
+
// Background color + shadow applied to inset pseudo element, so shadow blends with border in light mode
|
|
24
|
+
'before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm',
|
|
25
|
+
// Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo
|
|
26
|
+
'dark:before:hidden',
|
|
27
|
+
// Hide default focus styles
|
|
28
|
+
'focus:outline-hidden',
|
|
29
|
+
// Focus ring
|
|
30
|
+
'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',
|
|
31
|
+
// Disabled state
|
|
32
|
+
'data-disabled:opacity-50 data-disabled:before:bg-zinc-950/5 data-disabled:before:shadow-none',
|
|
33
|
+
]), children: [_jsx(Headless.ListboxSelectedOption, { as: "span", options: options, placeholder: placeholder && _jsx("span", { className: "block truncate text-zinc-500", children: placeholder }), className: clsx([
|
|
34
|
+
// Basic layout
|
|
35
|
+
'relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]',
|
|
36
|
+
// Set minimum height for when no value is selected
|
|
37
|
+
'min-h-11 sm:min-h-9',
|
|
38
|
+
// Horizontal padding
|
|
39
|
+
'pr-[calc(--spacing(7)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pl-[calc(--spacing(3)-1px)]',
|
|
40
|
+
// Typography
|
|
41
|
+
'text-left text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
42
|
+
// Border
|
|
43
|
+
'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',
|
|
44
|
+
// Background color
|
|
45
|
+
'bg-transparent dark:bg-white/5',
|
|
46
|
+
// Invalid state
|
|
47
|
+
'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',
|
|
48
|
+
// Disabled state
|
|
49
|
+
'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',
|
|
50
|
+
]) }), _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(
|
|
51
|
+
// Anchor positioning
|
|
52
|
+
'[--anchor-offset:-1.625rem] [--anchor-padding:--spacing(4)] sm:[--anchor-offset:-1.375rem]',
|
|
53
|
+
// Base styles
|
|
54
|
+
'isolate w-max min-w-[calc(var(--button-width)+1.75rem)] scroll-py-1 rounded-xl p-1 select-none',
|
|
55
|
+
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
|
|
56
|
+
'outline outline-transparent focus:outline-hidden',
|
|
57
|
+
// Handle scrolling when menu won't fit in viewport
|
|
58
|
+
'overflow-y-scroll overscroll-contain',
|
|
59
|
+
// Popover background
|
|
60
|
+
'bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75',
|
|
61
|
+
// Shadows
|
|
62
|
+
'shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset',
|
|
63
|
+
// Transitions
|
|
64
|
+
'transition-opacity duration-100 ease-in data-closed:data-leave:opacity-0 data-transition:pointer-events-none'), children: options })] })));
|
|
65
|
+
}
|
|
66
|
+
export function ListboxOption(_a) {
|
|
67
|
+
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
68
|
+
let sharedClasses = clsx(
|
|
69
|
+
// Base
|
|
70
|
+
'flex min-w-0 items-center',
|
|
71
|
+
// Icons
|
|
72
|
+
'*: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]',
|
|
73
|
+
// Avatars
|
|
74
|
+
'*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5');
|
|
75
|
+
return (_jsx(Headless.ListboxOption, Object.assign({ as: Fragment }, props, { children: ({ selectedOption }) => {
|
|
76
|
+
if (selectedOption) {
|
|
77
|
+
return _jsx("div", { className: clsx(className, sharedClasses), children: children });
|
|
78
|
+
}
|
|
79
|
+
return (_jsxs("div", { className: clsx(
|
|
80
|
+
// Basic layout
|
|
81
|
+
'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',
|
|
82
|
+
// Typography
|
|
83
|
+
'text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]',
|
|
84
|
+
// Focus
|
|
85
|
+
'outline-hidden data-focus:bg-blue-500 data-focus:text-white',
|
|
86
|
+
// Forced colors mode
|
|
87
|
+
'forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText]',
|
|
88
|
+
// Disabled
|
|
89
|
+
'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 })] }));
|
|
90
|
+
} })));
|
|
91
|
+
}
|
|
92
|
+
export function ListboxLabel(_a) {
|
|
93
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
94
|
+
return _jsx("span", Object.assign({}, props, { className: clsx(className, 'ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0') }));
|
|
95
|
+
}
|
|
96
|
+
export function ListboxDescription(_a) {
|
|
97
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
98
|
+
return (_jsx("span", Object.assign({}, 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 }) })));
|
|
99
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as Headless from '@headlessui/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare function Navbar({ className, ...props }: React.ComponentPropsWithoutRef<'nav'>):
|
|
4
|
-
export declare function NavbarDivider({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
5
|
-
export declare function NavbarSection({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
6
|
-
export declare function NavbarSpacer({ className, ...props }: React.ComponentPropsWithoutRef<'div'>):
|
|
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
7
|
export declare const NavbarItem: React.ForwardRefExoticComponent<({
|
|
8
8
|
current?: boolean;
|
|
9
9
|
className?: string;
|
|
@@ -11,5 +11,5 @@ export declare const NavbarItem: React.ForwardRefExoticComponent<({
|
|
|
11
11
|
} & (Omit<Headless.ButtonProps<"button">, "className" | "as"> | Omit<Omit<{
|
|
12
12
|
href: string;
|
|
13
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'>):
|
|
14
|
+
export declare function NavbarLabel({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
//# sourceMappingURL=navbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../source/catalyst/navbar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../source/catalyst/navbar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAEpF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAE3F;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAQ3F;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,2CAE1F;AAED,eAAO,MAAM,UAAU;cAMN,OAAO;gBAAc,MAAM;cAAY,KAAK,CAAC,SAAS;;;yOAsDrE,CAAA;AAEF,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,2CAE1F"}
|