@douglasneuroinformatics/libui 2.3.0 → 2.4.0
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/dist/components/ActionDropdown/ActionDropdown.d.ts +2 -1
- package/dist/components/ActionDropdown/ActionDropdown.d.ts.map +1 -1
- package/dist/components/ActionDropdown/ActionDropdown.js +2 -2
- package/dist/components/ClientTable/ClientTable.js +5 -5
- package/dist/components/Dialog/Dialog.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +2 -0
- package/dist/components/Dialog/DialogBody.d.ts +3 -0
- package/dist/components/Dialog/DialogBody.d.ts.map +1 -0
- package/dist/components/Dialog/DialogBody.js +5 -0
- package/dist/components/SearchBar/SearchBar.d.ts +3 -1
- package/dist/components/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +2 -0
- package/dist/components/Sheet/SheetBody.d.ts +3 -0
- package/dist/components/Sheet/SheetBody.d.ts.map +1 -0
- package/dist/components/Sheet/SheetBody.js +5 -0
- package/dist/components/Table/TableCell.d.ts.map +1 -1
- package/dist/components/Table/TableCell.js +1 -1
- package/dist/components/Table/TableHead.js +1 -1
- package/dist/components.d.ts +0 -3
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +0 -3
- package/dist/hooks.d.ts +0 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +0 -1
- package/package.json +1 -1
- package/src/components/ActionDropdown/ActionDropdown.tsx +5 -2
- package/src/components/ClientTable/ClientTable.tsx +5 -5
- package/src/components/Dialog/Dialog.tsx +2 -0
- package/src/components/Dialog/DialogBody.tsx +15 -0
- package/src/components/SearchBar/SearchBar.tsx +4 -1
- package/src/components/Sheet/Sheet.tsx +2 -0
- package/src/components/Sheet/SheetBody.tsx +15 -0
- package/src/components/Table/TableCell.tsx +3 -1
- package/src/components/Table/TableHead.tsx +1 -1
- package/src/components.ts +0 -3
- package/src/hooks.ts +0 -1
- package/dist/components/LegacyModal/LegacyModal.d.ts +0 -13
- package/dist/components/LegacyModal/LegacyModal.d.ts.map +0 -1
- package/dist/components/LegacyModal/LegacyModal.js +0 -25
- package/dist/components/LegacySlider/LegacySlider.d.ts +0 -11
- package/dist/components/LegacySlider/LegacySlider.d.ts.map +0 -1
- package/dist/components/LegacySlider/LegacySlider.js +0 -24
- package/dist/components/LegacyStepper/LegacyStepper.d.ts +0 -15
- package/dist/components/LegacyStepper/LegacyStepper.d.ts.map +0 -1
- package/dist/components/LegacyStepper/LegacyStepper.js +0 -46
- package/dist/context/LegacyStepperContext.d.ts +0 -7
- package/dist/context/LegacyStepperContext.d.ts.map +0 -1
- package/dist/context/LegacyStepperContext.js +0 -3
- package/dist/hooks/useLegacyStepper.d.ts +0 -7
- package/dist/hooks/useLegacyStepper.d.ts.map +0 -1
- package/dist/hooks/useLegacyStepper.js +0 -6
- package/src/components/LegacyModal/LegacyModal.tsx +0 -77
- package/src/components/LegacySlider/LegacySlider.tsx +0 -67
- package/src/components/LegacyStepper/LegacyStepper.tsx +0 -91
- package/src/context/LegacyStepperContext.tsx +0 -7
- package/src/hooks/useLegacyStepper.ts +0 -8
|
@@ -14,7 +14,8 @@ export type ActionDropdownProps<T extends ActionDropdownOptions> = {
|
|
|
14
14
|
options: T;
|
|
15
15
|
/** The text content for the dropdown toggle */
|
|
16
16
|
title: string;
|
|
17
|
+
triggerClassName?: string;
|
|
17
18
|
};
|
|
18
|
-
export declare function ActionDropdown<const T extends ActionDropdownOptions>({ align, onSelection, options, title }: ActionDropdownProps<T>): React.JSX.Element;
|
|
19
|
+
export declare function ActionDropdown<const T extends ActionDropdownOptions>({ align, onSelection, options, title, triggerClassName }: ActionDropdownProps<T>): React.JSX.Element;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=ActionDropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDropdown/ActionDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,KAAK,qBAAqB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAS,MAAM,EAAE,CAAC;AAE3E,KAAK,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,MAAM,EAAE,GACzD,CAAC,CAAC,MAAM,CAAC,GACT,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GACxB,KAAK,CAAC;AAEZ,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,qBAAqB,IAAI;IACjE,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAE1C,2DAA2D;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE1D,oGAAoG;IACpG,OAAO,EAAE,CAAC,CAAC;IAEX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/ActionDropdown/ActionDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,KAAK,qBAAqB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAS,MAAM,EAAE,CAAC;AAE3E,KAAK,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,MAAM,EAAE,GACzD,CAAC,CAAC,MAAM,CAAC,GACT,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GACxB,KAAK,CAAC;AAEZ,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,qBAAqB,IAAI;IACjE,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAE1C,2DAA2D;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE1D,oGAAoG;IACpG,OAAO,EAAE,CAAC,CAAC;IAEX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IAEd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAGF,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,qBAAqB,EAAE,EACpE,KAAe,EACf,WAAW,EACX,OAAO,EACP,KAAK,EACL,gBAAgB,EACjB,EAAE,mBAAmB,CAAC,CAAC,CAAC,qBAyBxB"}
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { DropdownButton } from '../DropdownButton/DropdownButton.js';
|
|
3
3
|
import { DropdownMenu } from '../DropdownMenu/DropdownMenu.js';
|
|
4
4
|
// eslint-disable-next-line react/function-component-definition
|
|
5
|
-
export function ActionDropdown({ align = 'start', onSelection, options, title }) {
|
|
5
|
+
export function ActionDropdown({ align = 'start', onSelection, options, title, triggerClassName }) {
|
|
6
6
|
const optionKeys = options instanceof Array ? options : Object.keys(options);
|
|
7
7
|
return (React.createElement(DropdownMenu, null,
|
|
8
8
|
React.createElement("div", { className: "w-full" },
|
|
9
9
|
React.createElement(DropdownMenu.Trigger, { asChild: true },
|
|
10
|
-
React.createElement(DropdownButton,
|
|
10
|
+
React.createElement(DropdownButton, { className: triggerClassName }, title)),
|
|
11
11
|
React.createElement(DropdownMenu.Content, { align: align, style: { width: 'var(--radix-popper-anchor-width)' } },
|
|
12
12
|
React.createElement(DropdownMenu.Group, null, optionKeys.map((option) => (React.createElement(DropdownMenu.Item, { key: option, onClick: () => {
|
|
13
13
|
onSelection(option);
|
|
@@ -24,16 +24,16 @@ function defaultFormatter(value) {
|
|
|
24
24
|
}
|
|
25
25
|
export const ClientTable = ({ className, columnDropdownOptions, columns, data, entriesPerPage = 10, minRows, onEntryClick }) => {
|
|
26
26
|
const [currentPage, setCurrentPage] = useState(1);
|
|
27
|
-
const pageCount = Math.ceil(data.length / entriesPerPage);
|
|
27
|
+
const pageCount = Math.max(Math.ceil(data.length / entriesPerPage), 1);
|
|
28
28
|
const firstEntry = data.length === 0 ? 0 : (currentPage - 1) * entriesPerPage + 1;
|
|
29
29
|
const lastEntry = Math.min(firstEntry + entriesPerPage - 1, data.length);
|
|
30
30
|
const currentEntries = data.slice(firstEntry - 1, lastEntry);
|
|
31
31
|
const nRows = Math.max(currentEntries.length, minRows ?? -1);
|
|
32
32
|
return (React.createElement("div", { className: className },
|
|
33
|
-
React.createElement("div", { className: "rounded-md border bg-card tracking-tight text-muted-foreground shadow" },
|
|
33
|
+
React.createElement("div", { className: "rounded-md border bg-card tracking-tight text-muted-foreground shadow-sm" },
|
|
34
34
|
React.createElement(Table, null,
|
|
35
35
|
React.createElement(Table.Header, null,
|
|
36
|
-
React.createElement(Table.Row, null, columns.map((column, i) => (React.createElement(Table.Head, { className: "whitespace-nowrap text-foreground
|
|
36
|
+
React.createElement(Table.Row, null, columns.map((column, i) => (React.createElement(Table.Head, { className: "whitespace-nowrap text-foreground", key: i }, columnDropdownOptions ? (React.createElement(DropdownMenu, null,
|
|
37
37
|
React.createElement(DropdownMenu.Trigger, { className: "flex items-center justify-between gap-3" },
|
|
38
38
|
React.createElement("span", null, column.label),
|
|
39
39
|
React.createElement(ChevronDownIcon, null)),
|
|
@@ -53,7 +53,7 @@ export const ClientTable = ({ className, columnDropdownOptions, columns, data, e
|
|
|
53
53
|
} }, columns.map(({ field, formatter }, j) => {
|
|
54
54
|
let value;
|
|
55
55
|
if (!entry) {
|
|
56
|
-
value = '';
|
|
56
|
+
value = 'NA';
|
|
57
57
|
}
|
|
58
58
|
else if (typeof field === 'function') {
|
|
59
59
|
value = field(entry);
|
|
@@ -62,7 +62,7 @@ export const ClientTable = ({ className, columnDropdownOptions, columns, data, e
|
|
|
62
62
|
value = entry[field];
|
|
63
63
|
}
|
|
64
64
|
const formattedValue = entry && formatter ? formatter(value) : defaultFormatter(value);
|
|
65
|
-
return (React.createElement(Table.Cell, { className:
|
|
65
|
+
return (React.createElement(Table.Cell, { className: cn('text-ellipsis leading-none', !entry && 'invisible'), key: j }, formattedValue));
|
|
66
66
|
})));
|
|
67
67
|
})))),
|
|
68
68
|
React.createElement(ClientTablePagination, { currentPage: currentPage, firstEntry: firstEntry, lastEntry: lastEntry, pageCount: pageCount, setCurrentPage: setCurrentPage, totalEntries: data.length })));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
2
|
export declare const Dialog: import("react").FC<import("@radix-ui/react-dialog").DialogProps> & {
|
|
3
|
+
Body: ({ children, className, ...props }: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").JSX.Element;
|
|
3
4
|
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
5
|
Description: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
5
6
|
Footer: ({ className, ...props }: import("react").HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";AASA,eAAO,MAAM,MAAM;;;;;;;;CAQjB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Root, Trigger } from '@radix-ui/react-dialog';
|
|
2
|
+
import { DialogBody } from './DialogBody.js';
|
|
2
3
|
import { DialogContent } from './DialogContent.js';
|
|
3
4
|
import { DialogDescription } from './DialogDescription.js';
|
|
4
5
|
import { DialogFooter } from './DialogFooter.js';
|
|
5
6
|
import { DialogHeader } from './DialogHeader.js';
|
|
6
7
|
import { DialogTitle } from './DialogTitle.js';
|
|
7
8
|
export const Dialog = Object.assign(Root.bind(null), {
|
|
9
|
+
Body: DialogBody,
|
|
8
10
|
Content: DialogContent,
|
|
9
11
|
Description: DialogDescription,
|
|
10
12
|
Footer: DialogFooter,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogBody.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/DialogBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,UAAU,sCAIpB,MAAM,iBAAiB,CAAC,MAAM,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,sBAM/E,CAAC"}
|
|
@@ -6,6 +6,8 @@ export type BaseSearchBarProps = {
|
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
/** Custom placeholder to use instead of the default */
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
/** Whether the input element should be readonly */
|
|
10
|
+
readOnly?: boolean;
|
|
9
11
|
};
|
|
10
12
|
type ControlledSearchBarProps = {
|
|
11
13
|
/** Event handler called when the value changes */
|
|
@@ -18,6 +20,6 @@ type UncontrolledSearchBarProps = {
|
|
|
18
20
|
value?: never;
|
|
19
21
|
} & BaseSearchBarProps;
|
|
20
22
|
export type SearchBarProps = ControlledSearchBarProps | UncontrolledSearchBarProps;
|
|
21
|
-
export declare const SearchBar: ({ className, onClick, onValueChange, placeholder, value }: SearchBarProps) => React.JSX.Element;
|
|
23
|
+
export declare const SearchBar: ({ className, onClick, onValueChange, placeholder, readOnly, value }: SearchBarProps) => React.JSX.Element;
|
|
22
24
|
export {};
|
|
23
25
|
//# sourceMappingURL=SearchBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0GAA0G;IAC1G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../src/components/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0GAA0G;IAC1G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,kDAAkD;IAClD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qGAAqG;IACrG,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,kBAAkB,CAAC;AAEvB,KAAK,0BAA0B,GAAG;IAChC,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,GAAG,kBAAkB,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG,0BAA0B,CAAC;AAEnF,eAAO,MAAM,SAAS,wEAAyE,cAAc,sBAkB5G,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { SearchIcon } from 'lucide-react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { cn } from '../../utils.js';
|
|
5
5
|
import { Input } from '../Input/Input.js';
|
|
6
|
-
export const SearchBar = ({ className, onClick, onValueChange, placeholder, value }) => {
|
|
6
|
+
export const SearchBar = ({ className, onClick, onValueChange, placeholder, readOnly, value }) => {
|
|
7
7
|
const { t } = useTranslation('libui');
|
|
8
8
|
return (React.createElement("form", { className: cn('relative', className) },
|
|
9
9
|
React.createElement(SearchIcon, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
10
|
-
React.createElement(Input, { className: "pl-8", placeholder: placeholder ?? t('searchBar.placeholder'), type: "search", value: value, onChange: (event) => {
|
|
10
|
+
React.createElement(Input, { className: "pl-8", placeholder: placeholder ?? t('searchBar.placeholder'), readOnly: readOnly, type: "search", value: value, onChange: (event) => {
|
|
11
11
|
onValueChange?.(event.target.value);
|
|
12
12
|
}, onClick: () => onClick?.() })));
|
|
13
13
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
2
|
export declare const Sheet: import("react").FC<import("@radix-ui/react-dialog").DialogProps> & {
|
|
3
|
+
Body: ({ children, className, ...props }: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").JSX.Element;
|
|
3
4
|
Close: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
5
|
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
|
|
5
6
|
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":";AAUA,eAAO,MAAM,KAAK;;;;;;;;;;;;;CAWhB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Close, Portal, Root, Trigger } from '@radix-ui/react-dialog';
|
|
2
|
+
import { SheetBody } from './SheetBody.js';
|
|
2
3
|
import { SheetContent } from './SheetContent.js';
|
|
3
4
|
import { SheetDescription } from './SheetDescription.js';
|
|
4
5
|
import { SheetFooter } from './SheetFooter.js';
|
|
@@ -6,6 +7,7 @@ import { SheetHeader } from './SheetHeader.js';
|
|
|
6
7
|
import { SheetOverlay } from './SheetOverlay.js';
|
|
7
8
|
import { SheetTitle } from './SheetTitle.js';
|
|
8
9
|
export const Sheet = Object.assign(Root.bind(null), {
|
|
10
|
+
Body: SheetBody,
|
|
9
11
|
Close,
|
|
10
12
|
Content: SheetContent,
|
|
11
13
|
Description: SheetDescription,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetBody.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/SheetBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,SAAS,sCAInB,MAAM,iBAAiB,CAAC,MAAM,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,sBAM/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,SAAS,2HAMrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { cn } from '../../utils.js';
|
|
3
3
|
export const TableCell = React.forwardRef(function TableCell({ className, ...props }, ref) {
|
|
4
|
-
return React.createElement("td", { className: cn('
|
|
4
|
+
return (React.createElement("td", { className: cn('px-6 py-3 align-middle [&:has([role=checkbox])]:pr-0', className), ref: ref, ...props }));
|
|
5
5
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { cn } from '../../utils.js';
|
|
3
3
|
export const TableHead = React.forwardRef(function TableHead({ className, ...props }, ref) {
|
|
4
|
-
return (React.createElement("th", { className: cn('
|
|
4
|
+
return (React.createElement("th", { className: cn('px-6 py-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0', className), ref: ref, ...props }));
|
|
5
5
|
});
|
package/dist/components.d.ts
CHANGED
|
@@ -25,9 +25,6 @@ export * from './components/HoverCard/HoverCard.js';
|
|
|
25
25
|
export * from './components/Input/Input.js';
|
|
26
26
|
export * from './components/Label/Label.js';
|
|
27
27
|
export * from './components/LanguageToggle/LanguageToggle.js';
|
|
28
|
-
export * from './components/LegacyModal/LegacyModal.js';
|
|
29
|
-
export * from './components/LegacySlider/LegacySlider.js';
|
|
30
|
-
export * from './components/LegacyStepper/LegacyStepper.js';
|
|
31
28
|
export * from './components/LineGraph/LineGraph.js';
|
|
32
29
|
export * from './components/ListboxDropdown/ListboxDropdown.js';
|
|
33
30
|
export * from './components/MenuBar/MenuBar.js';
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,iDAAiD,CAAC;AAChE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC"}
|
package/dist/components.js
CHANGED
|
@@ -25,9 +25,6 @@ export * from './components/HoverCard/HoverCard.js';
|
|
|
25
25
|
export * from './components/Input/Input.js';
|
|
26
26
|
export * from './components/Label/Label.js';
|
|
27
27
|
export * from './components/LanguageToggle/LanguageToggle.js';
|
|
28
|
-
export * from './components/LegacyModal/LegacyModal.js';
|
|
29
|
-
export * from './components/LegacySlider/LegacySlider.js';
|
|
30
|
-
export * from './components/LegacyStepper/LegacyStepper.js';
|
|
31
28
|
export * from './components/LineGraph/LineGraph.js';
|
|
32
29
|
export * from './components/ListboxDropdown/ListboxDropdown.js';
|
|
33
30
|
export * from './components/MenuBar/MenuBar.js';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from './hooks/useEventCallback.js';
|
|
|
3
3
|
export * from './hooks/useEventListener.js';
|
|
4
4
|
export * from './hooks/useInterval.js';
|
|
5
5
|
export * from './hooks/useIsomorphicLayoutEffect.js';
|
|
6
|
-
export * from './hooks/useLegacyStepper.js';
|
|
7
6
|
export * from './hooks/useMediaQuery.js';
|
|
8
7
|
export * from './hooks/useNotificationsStore.js';
|
|
9
8
|
export * from './hooks/useOnClickOutside.js';
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
package/dist/hooks.js
CHANGED
|
@@ -3,7 +3,6 @@ export * from './hooks/useEventCallback.js';
|
|
|
3
3
|
export * from './hooks/useEventListener.js';
|
|
4
4
|
export * from './hooks/useInterval.js';
|
|
5
5
|
export * from './hooks/useIsomorphicLayoutEffect.js';
|
|
6
|
-
export * from './hooks/useLegacyStepper.js';
|
|
7
6
|
export * from './hooks/useMediaQuery.js';
|
|
8
7
|
export * from './hooks/useNotificationsStore.js';
|
|
9
8
|
export * from './hooks/useOnClickOutside.js';
|
package/package.json
CHANGED
|
@@ -24,6 +24,8 @@ export type ActionDropdownProps<T extends ActionDropdownOptions> = {
|
|
|
24
24
|
|
|
25
25
|
/** The text content for the dropdown toggle */
|
|
26
26
|
title: string;
|
|
27
|
+
|
|
28
|
+
triggerClassName?: string;
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -31,14 +33,15 @@ export function ActionDropdown<const T extends ActionDropdownOptions>({
|
|
|
31
33
|
align = 'start',
|
|
32
34
|
onSelection,
|
|
33
35
|
options,
|
|
34
|
-
title
|
|
36
|
+
title,
|
|
37
|
+
triggerClassName
|
|
35
38
|
}: ActionDropdownProps<T>) {
|
|
36
39
|
const optionKeys: readonly string[] = options instanceof Array ? options : Object.keys(options);
|
|
37
40
|
return (
|
|
38
41
|
<DropdownMenu>
|
|
39
42
|
<div className="w-full">
|
|
40
43
|
<DropdownMenu.Trigger asChild>
|
|
41
|
-
<DropdownButton>{title}</DropdownButton>
|
|
44
|
+
<DropdownButton className={triggerClassName}>{title}</DropdownButton>
|
|
42
45
|
</DropdownMenu.Trigger>
|
|
43
46
|
<DropdownMenu.Content align={align} style={{ width: 'var(--radix-popper-anchor-width)' }}>
|
|
44
47
|
<DropdownMenu.Group>
|
|
@@ -72,7 +72,7 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
72
72
|
}: ClientTableProps<T>) => {
|
|
73
73
|
const [currentPage, setCurrentPage] = useState(1);
|
|
74
74
|
|
|
75
|
-
const pageCount = Math.ceil(data.length / entriesPerPage);
|
|
75
|
+
const pageCount = Math.max(Math.ceil(data.length / entriesPerPage), 1);
|
|
76
76
|
|
|
77
77
|
const firstEntry = data.length === 0 ? 0 : (currentPage - 1) * entriesPerPage + 1;
|
|
78
78
|
const lastEntry = Math.min(firstEntry + entriesPerPage - 1, data.length);
|
|
@@ -81,12 +81,12 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<div className={className}>
|
|
84
|
-
<div className="rounded-md border bg-card tracking-tight text-muted-foreground shadow">
|
|
84
|
+
<div className="rounded-md border bg-card tracking-tight text-muted-foreground shadow-sm">
|
|
85
85
|
<Table>
|
|
86
86
|
<Table.Header>
|
|
87
87
|
<Table.Row>
|
|
88
88
|
{columns.map((column, i) => (
|
|
89
|
-
<Table.Head className="whitespace-nowrap text-foreground
|
|
89
|
+
<Table.Head className="whitespace-nowrap text-foreground" key={i}>
|
|
90
90
|
{columnDropdownOptions ? (
|
|
91
91
|
<DropdownMenu>
|
|
92
92
|
<DropdownMenu.Trigger className="flex items-center justify-between gap-3">
|
|
@@ -133,7 +133,7 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
133
133
|
{columns.map(({ field, formatter }, j) => {
|
|
134
134
|
let value: unknown;
|
|
135
135
|
if (!entry) {
|
|
136
|
-
value = '';
|
|
136
|
+
value = 'NA';
|
|
137
137
|
} else if (typeof field === 'function') {
|
|
138
138
|
value = field(entry);
|
|
139
139
|
} else {
|
|
@@ -141,7 +141,7 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
141
141
|
}
|
|
142
142
|
const formattedValue = entry && formatter ? formatter(value) : defaultFormatter(value);
|
|
143
143
|
return (
|
|
144
|
-
<Table.Cell className=
|
|
144
|
+
<Table.Cell className={cn('text-ellipsis leading-none', !entry && 'invisible')} key={j}>
|
|
145
145
|
{formattedValue}
|
|
146
146
|
</Table.Cell>
|
|
147
147
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Root, Trigger } from '@radix-ui/react-dialog';
|
|
2
2
|
|
|
3
|
+
import { DialogBody } from './DialogBody.js';
|
|
3
4
|
import { DialogContent } from './DialogContent.js';
|
|
4
5
|
import { DialogDescription } from './DialogDescription.js';
|
|
5
6
|
import { DialogFooter } from './DialogFooter.js';
|
|
@@ -7,6 +8,7 @@ import { DialogHeader } from './DialogHeader.js';
|
|
|
7
8
|
import { DialogTitle } from './DialogTitle.js';
|
|
8
9
|
|
|
9
10
|
export const Dialog = Object.assign(Root.bind(null), {
|
|
11
|
+
Body: DialogBody,
|
|
10
12
|
Content: DialogContent,
|
|
11
13
|
Description: DialogDescription,
|
|
12
14
|
Footer: DialogFooter,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../utils.js';
|
|
4
|
+
|
|
5
|
+
export const DialogBody = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={cn('py-4', className)} {...props}>
|
|
12
|
+
{children}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -13,6 +13,8 @@ export type BaseSearchBarProps = {
|
|
|
13
13
|
onClick?: () => void;
|
|
14
14
|
/** Custom placeholder to use instead of the default */
|
|
15
15
|
placeholder?: string;
|
|
16
|
+
/** Whether the input element should be readonly */
|
|
17
|
+
readOnly?: boolean;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
type ControlledSearchBarProps = {
|
|
@@ -29,7 +31,7 @@ type UncontrolledSearchBarProps = {
|
|
|
29
31
|
|
|
30
32
|
export type SearchBarProps = ControlledSearchBarProps | UncontrolledSearchBarProps;
|
|
31
33
|
|
|
32
|
-
export const SearchBar = ({ className, onClick, onValueChange, placeholder, value }: SearchBarProps) => {
|
|
34
|
+
export const SearchBar = ({ className, onClick, onValueChange, placeholder, readOnly, value }: SearchBarProps) => {
|
|
33
35
|
const { t } = useTranslation('libui');
|
|
34
36
|
return (
|
|
35
37
|
<form className={cn('relative', className)}>
|
|
@@ -37,6 +39,7 @@ export const SearchBar = ({ className, onClick, onValueChange, placeholder, valu
|
|
|
37
39
|
<Input
|
|
38
40
|
className="pl-8"
|
|
39
41
|
placeholder={placeholder ?? t('searchBar.placeholder')}
|
|
42
|
+
readOnly={readOnly}
|
|
40
43
|
type="search"
|
|
41
44
|
value={value}
|
|
42
45
|
onChange={(event) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Close, Portal, Root, Trigger } from '@radix-ui/react-dialog';
|
|
2
2
|
|
|
3
|
+
import { SheetBody } from './SheetBody.js';
|
|
3
4
|
import { SheetContent } from './SheetContent.js';
|
|
4
5
|
import { SheetDescription } from './SheetDescription.js';
|
|
5
6
|
import { SheetFooter } from './SheetFooter.js';
|
|
@@ -8,6 +9,7 @@ import { SheetOverlay } from './SheetOverlay.js';
|
|
|
8
9
|
import { SheetTitle } from './SheetTitle.js';
|
|
9
10
|
|
|
10
11
|
export const Sheet = Object.assign(Root.bind(null), {
|
|
12
|
+
Body: SheetBody,
|
|
11
13
|
Close,
|
|
12
14
|
Content: SheetContent,
|
|
13
15
|
Description: SheetDescription,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '../../utils.js';
|
|
4
|
+
|
|
5
|
+
export const SheetBody = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={cn('py-4', className)} {...props}>
|
|
12
|
+
{children}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -4,6 +4,8 @@ import { cn } from '../../utils.js';
|
|
|
4
4
|
|
|
5
5
|
export const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(
|
|
6
6
|
function TableCell({ className, ...props }, ref) {
|
|
7
|
-
return
|
|
7
|
+
return (
|
|
8
|
+
<td className={cn('px-6 py-3 align-middle [&:has([role=checkbox])]:pr-0', className)} ref={ref} {...props} />
|
|
9
|
+
);
|
|
8
10
|
}
|
|
9
11
|
);
|
|
@@ -7,7 +7,7 @@ export const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttr
|
|
|
7
7
|
return (
|
|
8
8
|
<th
|
|
9
9
|
className={cn(
|
|
10
|
-
'
|
|
10
|
+
'px-6 py-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0',
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
13
13
|
ref={ref}
|
package/src/components.ts
CHANGED
|
@@ -25,9 +25,6 @@ export * from './components/HoverCard/HoverCard.js';
|
|
|
25
25
|
export * from './components/Input/Input.js';
|
|
26
26
|
export * from './components/Label/Label.js';
|
|
27
27
|
export * from './components/LanguageToggle/LanguageToggle.js';
|
|
28
|
-
export * from './components/LegacyModal/LegacyModal.js';
|
|
29
|
-
export * from './components/LegacySlider/LegacySlider.js';
|
|
30
|
-
export * from './components/LegacyStepper/LegacyStepper.js';
|
|
31
28
|
export * from './components/LineGraph/LineGraph.js';
|
|
32
29
|
export * from './components/ListboxDropdown/ListboxDropdown.js';
|
|
33
30
|
export * from './components/MenuBar/MenuBar.js';
|
package/src/hooks.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from './hooks/useEventCallback.js';
|
|
|
3
3
|
export * from './hooks/useEventListener.js';
|
|
4
4
|
export * from './hooks/useInterval.js';
|
|
5
5
|
export * from './hooks/useIsomorphicLayoutEffect.js';
|
|
6
|
-
export * from './hooks/useLegacyStepper.js';
|
|
7
6
|
export * from './hooks/useMediaQuery.js';
|
|
8
7
|
export * from './hooks/useNotificationsStore.js';
|
|
9
8
|
export * from './hooks/useOnClickOutside.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
export type LegacyModalProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
open: boolean;
|
|
7
|
-
showCloseButton?: boolean;
|
|
8
|
-
title: string;
|
|
9
|
-
width?: 'lg' | 'md' | 'sm' | 'xl';
|
|
10
|
-
};
|
|
11
|
-
/** @deprecated */
|
|
12
|
-
export declare const LegacyModal: ({ children, onClose, open, showCloseButton, title, width }: LegacyModalProps) => React.JSX.Element;
|
|
13
|
-
//# sourceMappingURL=LegacyModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyModal.d.ts","sourceRoot":"","sources":["../../../src/components/LegacyModal/LegacyModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,kBAAkB;AAClB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,WAAW,+DAAuE,gBAAgB,sBA2D9G,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Dialog, Transition } from '@headlessui/react';
|
|
3
|
-
import { XMarkIcon } from '@heroicons/react/24/solid';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
export const LegacyModal = ({ children, onClose, open, showCloseButton, title, width = 'md' }) => {
|
|
7
|
-
return (React.createElement(Transition, { appear: true, as: React.Fragment, show: open },
|
|
8
|
-
React.createElement(Dialog, { as: "div", className: "relative z-10", onClose: onClose },
|
|
9
|
-
React.createElement(Transition.Child, { as: React.Fragment, enter: "ease-out duration-300", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "ease-in duration-200", leaveFrom: "opacity-100", leaveTo: "opacity-0" },
|
|
10
|
-
React.createElement("div", { className: "fixed inset-0 bg-black bg-opacity-50" })),
|
|
11
|
-
React.createElement("div", { className: "fixed inset-0 overflow-y-auto" },
|
|
12
|
-
React.createElement("div", { className: "flex min-h-full items-center justify-center p-4 text-center" },
|
|
13
|
-
React.createElement(Transition.Child, { as: React.Fragment, enter: "ease-out duration-300", enterFrom: "opacity-0 scale-95", enterTo: "opacity-100 scale-100", leave: "ease-in duration-200", leaveFrom: "opacity-100 scale-100", leaveTo: "opacity-0 scale-95" },
|
|
14
|
-
React.createElement(Dialog.Panel, { className: clsx('relative w-full transform overflow-visible rounded-2xl bg-slate-100 p-6 text-left align-middle text-slate-900 shadow-xl transition-all dark:bg-slate-800 dark:text-slate-100', {
|
|
15
|
-
'max-w-lg': width === 'lg',
|
|
16
|
-
'max-w-md': width === 'md',
|
|
17
|
-
'max-w-sm': width === 'sm',
|
|
18
|
-
'max-w-xl': width === 'xl'
|
|
19
|
-
}) },
|
|
20
|
-
React.createElement("div", { className: "flex items-center justify-between" },
|
|
21
|
-
React.createElement(Dialog.Title, { as: "h3", className: "p-0.5 text-xl font-bold leading-6" }, title),
|
|
22
|
-
showCloseButton && (React.createElement("button", { className: "flex items-center justify-center rounded-md p-0.5 hover:bg-slate-200 dark:hover:bg-slate-700", type: "button", onClick: onClose },
|
|
23
|
-
React.createElement(XMarkIcon, { height: 24, width: 24 })))),
|
|
24
|
-
React.createElement("div", { className: "my-2 p-0.5" }, children))))))));
|
|
25
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
export type LegacySliderProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
setIsOpen: (isOpen: boolean) => void;
|
|
7
|
-
title: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
export declare const LegacySlider: ({ children, isOpen, setIsOpen, title }: LegacySliderProps) => React.JSX.Element;
|
|
11
|
-
//# sourceMappingURL=LegacySlider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacySlider.d.ts","sourceRoot":"","sources":["../../../src/components/LegacySlider/LegacySlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,kBAAkB;AAClB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,YAAY,2CAA4C,iBAAiB,sBAoDrF,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Dialog, Transition } from '@headlessui/react';
|
|
3
|
-
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
4
|
-
/** @deprecated */
|
|
5
|
-
export const LegacySlider = ({ children, isOpen, setIsOpen, title }) => {
|
|
6
|
-
return (React.createElement(Transition, { as: React.Fragment, show: isOpen },
|
|
7
|
-
React.createElement(Dialog, { as: "div", className: "fixed inset-0 z-10 overflow-hidden", onClose: setIsOpen },
|
|
8
|
-
React.createElement("div", { className: "absolute inset-0 overflow-hidden" },
|
|
9
|
-
React.createElement(Transition.Child, { as: React.Fragment, enter: "transition-opacity ease-linear duration-500", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "transition-opacity ease-linear duration-500", leaveFrom: "opacity-100", leaveTo: "opacity-0" },
|
|
10
|
-
React.createElement("div", { className: "fixed inset-0 bg-black/30" })),
|
|
11
|
-
React.createElement("div", { className: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10" },
|
|
12
|
-
React.createElement(Transition.Child, { as: React.Fragment, enter: "transform transition ease-in-out duration-500", enterFrom: "translate-x-full", enterTo: "translate-x-0", leave: "transform transition ease-in-out duration-500", leaveFrom: "translate-x-0", leaveTo: "translate-x-full" },
|
|
13
|
-
React.createElement("div", { className: "pointer-events-auto w-screen max-w-md" },
|
|
14
|
-
React.createElement("div", { className: "flex h-full flex-col overflow-y-scroll bg-slate-50 py-6 shadow-xl dark:bg-slate-800" },
|
|
15
|
-
React.createElement("div", { className: "px-4 sm:px-6" },
|
|
16
|
-
React.createElement("div", { className: "flex items-center justify-between" },
|
|
17
|
-
React.createElement(Dialog.Title, { className: "font-semibold text-slate-900 dark:text-slate-100" }, title),
|
|
18
|
-
React.createElement("button", { className: "text-muted-foreground hover:text-slate-500", type: "button", onClick: () => {
|
|
19
|
-
setIsOpen(false);
|
|
20
|
-
} },
|
|
21
|
-
React.createElement(XMarkIcon, { "aria-hidden": "true", className: "h-6 w-6" })))),
|
|
22
|
-
React.createElement("hr", { className: "mx-4 my-4 border-slate-300" }),
|
|
23
|
-
React.createElement("div", { className: "relative flex-1 px-4 sm:px-6" }, children)))))))));
|
|
24
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
export type Step = {
|
|
4
|
-
element: React.ReactElement;
|
|
5
|
-
icon: React.ReactElement;
|
|
6
|
-
label: string;
|
|
7
|
-
};
|
|
8
|
-
/** @deprecated */
|
|
9
|
-
export type LegacyStepperProps = {
|
|
10
|
-
className?: string;
|
|
11
|
-
steps: Step[];
|
|
12
|
-
};
|
|
13
|
-
/** @deprecated */
|
|
14
|
-
export declare const LegacyStepper: ({ className, steps }: LegacyStepperProps) => React.JSX.Element;
|
|
15
|
-
//# sourceMappingURL=LegacyStepper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyStepper.d.ts","sourceRoot":"","sources":["../../../src/components/LegacyStepper/LegacyStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,kBAAkB;AAClB,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,kBAAkB;AAClB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,aAAa,yBAA0B,kBAAkB,sBAoErE,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useReducer, useRef, useState } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { LegacyStepperContext } from '../../context/LegacyStepperContext.js';
|
|
4
|
-
import { useWindowSize } from '../../hooks/useWindowSize.js';
|
|
5
|
-
import { cn } from '../../utils.js';
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
export const LegacyStepper = ({ className, steps }) => {
|
|
8
|
-
const icons = useRef([]);
|
|
9
|
-
const [divideStyles, setDivideStyles] = useState([]);
|
|
10
|
-
const { height, width } = useWindowSize();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const styles = [];
|
|
13
|
-
for (let i = 0; i < steps.length - 1; i++) {
|
|
14
|
-
const current = icons.current[i];
|
|
15
|
-
const next = icons.current[i + 1];
|
|
16
|
-
const left = current.offsetLeft + current.offsetWidth;
|
|
17
|
-
styles.push({
|
|
18
|
-
left,
|
|
19
|
-
width: next.offsetLeft - left
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
setDivideStyles(styles);
|
|
23
|
-
}, [height, width]);
|
|
24
|
-
const [index, updateIndex] = useReducer((prevIndex, action) => {
|
|
25
|
-
if (action === 'decrement' && prevIndex > 0) {
|
|
26
|
-
return prevIndex - 1;
|
|
27
|
-
}
|
|
28
|
-
else if (action === 'increment' && prevIndex < steps.length - 1) {
|
|
29
|
-
return prevIndex + 1;
|
|
30
|
-
}
|
|
31
|
-
return prevIndex;
|
|
32
|
-
}, 0);
|
|
33
|
-
return (React.createElement(LegacyStepperContext.Provider, { value: { index, updateIndex } },
|
|
34
|
-
React.createElement("div", { className: cn('flex flex-col', className) },
|
|
35
|
-
React.createElement("div", { className: "relative mb-12 flex items-center justify-between print:hidden" }, steps.map((step, i) => {
|
|
36
|
-
return (React.createElement(React.Fragment, { key: i },
|
|
37
|
-
React.createElement("div", { className: "flex items-center" },
|
|
38
|
-
React.createElement("div", { className: "flex flex-col items-center justify-center" },
|
|
39
|
-
React.createElement("div", { className: clsx('h-12 w-12 rounded-full bg-sky-700 py-3 text-white transition duration-500 ease-in-out [&>*]:h-full [&>*]:w-full', i > index && 'bg-slate-200 dark:bg-slate-700'), ref: (e) => {
|
|
40
|
-
icons.current[i] = e;
|
|
41
|
-
} }, step.icon),
|
|
42
|
-
React.createElement("span", { className: "mt-2 text-xs font-medium uppercase text-muted-foreground" }, step.label))),
|
|
43
|
-
i !== steps.length - 1 && (React.createElement("div", { className: clsx('absolute top-6 flex-auto border-t-2 transition duration-500 ease-in-out', i >= index ? 'border-slate-200 dark:border-slate-700' : 'border-sky-700'), style: divideStyles[i] }))));
|
|
44
|
-
})),
|
|
45
|
-
React.createElement("div", { className: "flex-grow" }, steps[index]?.element))));
|
|
46
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyStepperContext.d.ts","sourceRoot":"","sources":["../../src/context/LegacyStepperContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,kBAAkB;AAClB,eAAO,MAAM,oBAAoB;WACxB,MAAM;iBACA,MAAM,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;EAC/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLegacyStepper.d.ts","sourceRoot":"","sources":["../../src/hooks/useLegacyStepper.ts"],"names":[],"mappings":";AAIA,kBAAkB;AAClB,wBAAgB,gBAAgB;;;EAE/B"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Dialog, Transition } from '@headlessui/react';
|
|
4
|
-
import { XMarkIcon } from '@heroicons/react/24/solid';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
export type LegacyModalProps = {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
open: boolean;
|
|
12
|
-
showCloseButton?: boolean;
|
|
13
|
-
title: string;
|
|
14
|
-
width?: 'lg' | 'md' | 'sm' | 'xl';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/** @deprecated */
|
|
18
|
-
export const LegacyModal = ({ children, onClose, open, showCloseButton, title, width = 'md' }: LegacyModalProps) => {
|
|
19
|
-
return (
|
|
20
|
-
<Transition appear as={React.Fragment} show={open}>
|
|
21
|
-
<Dialog as="div" className="relative z-10" onClose={onClose}>
|
|
22
|
-
<Transition.Child
|
|
23
|
-
as={React.Fragment}
|
|
24
|
-
enter="ease-out duration-300"
|
|
25
|
-
enterFrom="opacity-0"
|
|
26
|
-
enterTo="opacity-100"
|
|
27
|
-
leave="ease-in duration-200"
|
|
28
|
-
leaveFrom="opacity-100"
|
|
29
|
-
leaveTo="opacity-0"
|
|
30
|
-
>
|
|
31
|
-
<div className="fixed inset-0 bg-black bg-opacity-50" />
|
|
32
|
-
</Transition.Child>
|
|
33
|
-
<div className="fixed inset-0 overflow-y-auto">
|
|
34
|
-
<div className="flex min-h-full items-center justify-center p-4 text-center">
|
|
35
|
-
<Transition.Child
|
|
36
|
-
as={React.Fragment}
|
|
37
|
-
enter="ease-out duration-300"
|
|
38
|
-
enterFrom="opacity-0 scale-95"
|
|
39
|
-
enterTo="opacity-100 scale-100"
|
|
40
|
-
leave="ease-in duration-200"
|
|
41
|
-
leaveFrom="opacity-100 scale-100"
|
|
42
|
-
leaveTo="opacity-0 scale-95"
|
|
43
|
-
>
|
|
44
|
-
<Dialog.Panel
|
|
45
|
-
className={clsx(
|
|
46
|
-
'relative w-full transform overflow-visible rounded-2xl bg-slate-100 p-6 text-left align-middle text-slate-900 shadow-xl transition-all dark:bg-slate-800 dark:text-slate-100',
|
|
47
|
-
{
|
|
48
|
-
'max-w-lg': width === 'lg',
|
|
49
|
-
'max-w-md': width === 'md',
|
|
50
|
-
'max-w-sm': width === 'sm',
|
|
51
|
-
'max-w-xl': width === 'xl'
|
|
52
|
-
}
|
|
53
|
-
)}
|
|
54
|
-
>
|
|
55
|
-
<div className="flex items-center justify-between">
|
|
56
|
-
<Dialog.Title as="h3" className="p-0.5 text-xl font-bold leading-6">
|
|
57
|
-
{title}
|
|
58
|
-
</Dialog.Title>
|
|
59
|
-
{showCloseButton && (
|
|
60
|
-
<button
|
|
61
|
-
className="flex items-center justify-center rounded-md p-0.5 hover:bg-slate-200 dark:hover:bg-slate-700"
|
|
62
|
-
type="button"
|
|
63
|
-
onClick={onClose}
|
|
64
|
-
>
|
|
65
|
-
<XMarkIcon height={24} width={24} />
|
|
66
|
-
</button>
|
|
67
|
-
)}
|
|
68
|
-
</div>
|
|
69
|
-
<div className="my-2 p-0.5">{children}</div>
|
|
70
|
-
</Dialog.Panel>
|
|
71
|
-
</Transition.Child>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</Dialog>
|
|
75
|
-
</Transition>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Dialog, Transition } from '@headlessui/react';
|
|
4
|
-
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
5
|
-
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
export type LegacySliderProps = {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
isOpen: boolean;
|
|
10
|
-
setIsOpen: (isOpen: boolean) => void;
|
|
11
|
-
title: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** @deprecated */
|
|
15
|
-
export const LegacySlider = ({ children, isOpen, setIsOpen, title }: LegacySliderProps) => {
|
|
16
|
-
return (
|
|
17
|
-
<Transition as={React.Fragment} show={isOpen}>
|
|
18
|
-
<Dialog as="div" className="fixed inset-0 z-10 overflow-hidden" onClose={setIsOpen}>
|
|
19
|
-
<div className="absolute inset-0 overflow-hidden">
|
|
20
|
-
<Transition.Child
|
|
21
|
-
as={React.Fragment}
|
|
22
|
-
enter="transition-opacity ease-linear duration-500"
|
|
23
|
-
enterFrom="opacity-0"
|
|
24
|
-
enterTo="opacity-100"
|
|
25
|
-
leave="transition-opacity ease-linear duration-500"
|
|
26
|
-
leaveFrom="opacity-100"
|
|
27
|
-
leaveTo="opacity-0"
|
|
28
|
-
>
|
|
29
|
-
<div className="fixed inset-0 bg-black/30" />
|
|
30
|
-
</Transition.Child>
|
|
31
|
-
<div className="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10">
|
|
32
|
-
<Transition.Child
|
|
33
|
-
as={React.Fragment}
|
|
34
|
-
enter="transform transition ease-in-out duration-500"
|
|
35
|
-
enterFrom="translate-x-full"
|
|
36
|
-
enterTo="translate-x-0"
|
|
37
|
-
leave="transform transition ease-in-out duration-500"
|
|
38
|
-
leaveFrom="translate-x-0"
|
|
39
|
-
leaveTo="translate-x-full"
|
|
40
|
-
>
|
|
41
|
-
<div className="pointer-events-auto w-screen max-w-md">
|
|
42
|
-
<div className="flex h-full flex-col overflow-y-scroll bg-slate-50 py-6 shadow-xl dark:bg-slate-800">
|
|
43
|
-
<div className="px-4 sm:px-6">
|
|
44
|
-
<div className="flex items-center justify-between">
|
|
45
|
-
<Dialog.Title className="font-semibold text-slate-900 dark:text-slate-100">{title}</Dialog.Title>
|
|
46
|
-
<button
|
|
47
|
-
className="text-muted-foreground hover:text-slate-500"
|
|
48
|
-
type="button"
|
|
49
|
-
onClick={() => {
|
|
50
|
-
setIsOpen(false);
|
|
51
|
-
}}
|
|
52
|
-
>
|
|
53
|
-
<XMarkIcon aria-hidden="true" className="h-6 w-6" />
|
|
54
|
-
</button>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<hr className="mx-4 my-4 border-slate-300" />
|
|
58
|
-
<div className="relative flex-1 px-4 sm:px-6">{children}</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</Transition.Child>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</Dialog>
|
|
65
|
-
</Transition>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useReducer, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
|
|
5
|
-
import { LegacyStepperContext } from '../../context/LegacyStepperContext.js';
|
|
6
|
-
import { useWindowSize } from '../../hooks/useWindowSize.js';
|
|
7
|
-
import { cn } from '../../utils.js';
|
|
8
|
-
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
export type Step = {
|
|
11
|
-
element: React.ReactElement;
|
|
12
|
-
icon: React.ReactElement;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/** @deprecated */
|
|
17
|
-
export type LegacyStepperProps = {
|
|
18
|
-
className?: string;
|
|
19
|
-
steps: Step[];
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/** @deprecated */
|
|
23
|
-
export const LegacyStepper = ({ className, steps }: LegacyStepperProps) => {
|
|
24
|
-
const icons = useRef<HTMLDivElement[]>([]);
|
|
25
|
-
const [divideStyles, setDivideStyles] = useState<React.CSSProperties[]>([]);
|
|
26
|
-
const { height, width } = useWindowSize();
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
const styles: React.CSSProperties[] = [];
|
|
30
|
-
for (let i = 0; i < steps.length - 1; i++) {
|
|
31
|
-
const current = icons.current[i];
|
|
32
|
-
const next = icons.current[i + 1];
|
|
33
|
-
const left = current.offsetLeft + current.offsetWidth;
|
|
34
|
-
styles.push({
|
|
35
|
-
left,
|
|
36
|
-
width: next.offsetLeft - left
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
setDivideStyles(styles);
|
|
40
|
-
}, [height, width]);
|
|
41
|
-
|
|
42
|
-
const [index, updateIndex] = useReducer((prevIndex: number, action: 'decrement' | 'increment') => {
|
|
43
|
-
if (action === 'decrement' && prevIndex > 0) {
|
|
44
|
-
return prevIndex - 1;
|
|
45
|
-
} else if (action === 'increment' && prevIndex < steps.length - 1) {
|
|
46
|
-
return prevIndex + 1;
|
|
47
|
-
}
|
|
48
|
-
return prevIndex;
|
|
49
|
-
}, 0);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<LegacyStepperContext.Provider value={{ index, updateIndex }}>
|
|
53
|
-
<div className={cn('flex flex-col', className)}>
|
|
54
|
-
<div className="relative mb-12 flex items-center justify-between print:hidden">
|
|
55
|
-
{steps.map((step, i) => {
|
|
56
|
-
return (
|
|
57
|
-
<React.Fragment key={i}>
|
|
58
|
-
<div className="flex items-center">
|
|
59
|
-
<div className="flex flex-col items-center justify-center">
|
|
60
|
-
<div
|
|
61
|
-
className={clsx(
|
|
62
|
-
'h-12 w-12 rounded-full bg-sky-700 py-3 text-white transition duration-500 ease-in-out [&>*]:h-full [&>*]:w-full',
|
|
63
|
-
i > index && 'bg-slate-200 dark:bg-slate-700'
|
|
64
|
-
)}
|
|
65
|
-
ref={(e) => {
|
|
66
|
-
icons.current[i] = e!;
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
{step.icon}
|
|
70
|
-
</div>
|
|
71
|
-
<span className="mt-2 text-xs font-medium uppercase text-muted-foreground">{step.label}</span>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
{i !== steps.length - 1 && (
|
|
75
|
-
<div
|
|
76
|
-
className={clsx(
|
|
77
|
-
'absolute top-6 flex-auto border-t-2 transition duration-500 ease-in-out',
|
|
78
|
-
i >= index ? 'border-slate-200 dark:border-slate-700' : 'border-sky-700'
|
|
79
|
-
)}
|
|
80
|
-
style={divideStyles[i]}
|
|
81
|
-
/>
|
|
82
|
-
)}
|
|
83
|
-
</React.Fragment>
|
|
84
|
-
);
|
|
85
|
-
})}
|
|
86
|
-
</div>
|
|
87
|
-
<div className="flex-grow">{steps[index]?.element}</div>
|
|
88
|
-
</div>
|
|
89
|
-
</LegacyStepperContext.Provider>
|
|
90
|
-
);
|
|
91
|
-
};
|