eglador-ui-react 0.1.0-alpha.7 → 0.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/index.d.mts +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +167 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +163 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Add the following to your global stylesheet (e.g. `app/globals.css`) so Tailwind
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
import { Button, ButtonGroup, Checkbox, CheckboxGroup, Input, InputGroup, Dropdown, Select, MultiSelect, Tabs, Accordion, Modal, MediaImage, MediaVideo, Tooltip, Breadcrumb, Typewriter, Carousel } from "eglador-ui-react";
|
|
29
|
+
import { Button, ButtonGroup, Checkbox, CheckboxGroup, Input, InputGroup, Dropdown, Select, MultiSelect, Tabs, Accordion, Modal, MediaImage, MediaVideo, Tooltip, Breadcrumb, Typewriter, Carousel, Table } from "eglador-ui-react";
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Components
|
|
@@ -62,6 +62,12 @@ import { Button, ButtonGroup, Checkbox, CheckboxGroup, Input, InputGroup, Dropdo
|
|
|
62
62
|
| **Breadcrumb.Item** | `href`, `isActive`, `className`, `children` |
|
|
63
63
|
| **Typewriter** | `texts`, `typingSpeed`, `deletingSpeed`, `pauseDuration`, `deleteMode`, `loop`, `startDelay`, `cursor`, `cursorStyle`, `onComplete`, `className` |
|
|
64
64
|
| **Carousel** | `slides`, `slidesPerView`, `align`, `containScroll`, `dragFree`, `loop`, `axis`, `direction`, `plugins`, `showNavigation`, `showPagination`, `scrollToIndex`, `breakpoints`, `className` |
|
|
65
|
+
| **Table** | `size`, `variant`, `shape`, `fullWidth`, `scrollX`, `scrollY`, `maxHeight`, `className` |
|
|
66
|
+
| **Table.Head** | `className`, `children` |
|
|
67
|
+
| **Table.Body** | `className`, `children` |
|
|
68
|
+
| **Table.Row** | `onClick`, `isActive`, `className`, `children` |
|
|
69
|
+
| **Table.Header** | `align`, `width`, `className`, `children` |
|
|
70
|
+
| **Table.Cell** | `align`, `truncate`, `className`, `children` |
|
|
65
71
|
|
|
66
72
|
## Development
|
|
67
73
|
|
|
@@ -79,7 +85,7 @@ Publishing is automated via GitHub Actions. When a GitHub Release is created, th
|
|
|
79
85
|
|
|
80
86
|
1. Update `version` in `package.json`
|
|
81
87
|
2. Commit and push
|
|
82
|
-
3. Create a GitHub Release with a matching tag (e.g. `v0.1.0-alpha.
|
|
88
|
+
3. Create a GitHub Release with a matching tag (e.g. `v0.1.0-alpha.8`)
|
|
83
89
|
|
|
84
90
|
## Compatibility
|
|
85
91
|
|
package/dist/index.d.mts
CHANGED
|
@@ -347,6 +347,60 @@ interface SelectProps {
|
|
|
347
347
|
}
|
|
348
348
|
declare function Select({ value, onChange, options, placeholder, className, disabled, autoFlip, maxHeight, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
349
349
|
|
|
350
|
+
type TableSize = "xs" | "sm" | "md";
|
|
351
|
+
type TableVariant = "default" | "bordered" | "striped";
|
|
352
|
+
type TableShape = "square" | "rounded";
|
|
353
|
+
interface TableProps {
|
|
354
|
+
size?: TableSize;
|
|
355
|
+
variant?: TableVariant;
|
|
356
|
+
shape?: TableShape;
|
|
357
|
+
fullWidth?: boolean;
|
|
358
|
+
scrollX?: boolean;
|
|
359
|
+
scrollY?: boolean;
|
|
360
|
+
maxHeight?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
children: React.ReactNode;
|
|
363
|
+
}
|
|
364
|
+
interface TableHeadProps {
|
|
365
|
+
className?: string;
|
|
366
|
+
children: React.ReactNode;
|
|
367
|
+
}
|
|
368
|
+
interface TableBodyProps {
|
|
369
|
+
className?: string;
|
|
370
|
+
children: React.ReactNode;
|
|
371
|
+
}
|
|
372
|
+
interface TableRowProps {
|
|
373
|
+
onClick?: () => void;
|
|
374
|
+
isActive?: boolean;
|
|
375
|
+
className?: string;
|
|
376
|
+
children: React.ReactNode;
|
|
377
|
+
}
|
|
378
|
+
interface TableHeaderProps {
|
|
379
|
+
align?: "left" | "center" | "right";
|
|
380
|
+
width?: string;
|
|
381
|
+
className?: string;
|
|
382
|
+
children?: React.ReactNode;
|
|
383
|
+
}
|
|
384
|
+
interface TableCellProps {
|
|
385
|
+
align?: "left" | "center" | "right";
|
|
386
|
+
truncate?: boolean;
|
|
387
|
+
className?: string;
|
|
388
|
+
children?: React.ReactNode;
|
|
389
|
+
}
|
|
390
|
+
declare function TableRoot({ size, variant, shape, fullWidth, scrollX, scrollY, maxHeight, className, children, }: TableProps): react_jsx_runtime.JSX.Element;
|
|
391
|
+
declare function TableHead({ className, children }: TableHeadProps): react_jsx_runtime.JSX.Element;
|
|
392
|
+
declare function TableBody({ className, children }: TableBodyProps): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function TableRow({ onClick, isActive, className, children }: TableRowProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
declare function TableHeader({ align, width, className, children }: TableHeaderProps): react_jsx_runtime.JSX.Element;
|
|
395
|
+
declare function TableCell({ align, truncate, className, children }: TableCellProps): react_jsx_runtime.JSX.Element;
|
|
396
|
+
declare const Table: typeof TableRoot & {
|
|
397
|
+
Head: typeof TableHead;
|
|
398
|
+
Body: typeof TableBody;
|
|
399
|
+
Row: typeof TableRow;
|
|
400
|
+
Header: typeof TableHeader;
|
|
401
|
+
Cell: typeof TableCell;
|
|
402
|
+
};
|
|
403
|
+
|
|
350
404
|
type TabsVariant = "default" | "bordered" | "segmented";
|
|
351
405
|
type TabsSize = "xs" | "sm" | "md";
|
|
352
406
|
interface TabsProps {
|
|
@@ -412,4 +466,4 @@ declare function Typewriter({ texts, typingSpeed, deletingSpeed, pauseDuration,
|
|
|
412
466
|
|
|
413
467
|
declare function cn(...inputs: ClassValue[]): string;
|
|
414
468
|
|
|
415
|
-
export { Accordion, type AccordionProps, type AccordionSize, type AccordionVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Carousel, type CarouselBreakpointOptions, type CarouselProps, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, Dropdown, type DropdownAlign, type DropdownContentProps, type DropdownProps, type DropdownSide, type DropdownTriggerProps, type DropdownWidth, Input, type InputColor, InputGroup, type InputGroupProps, type InputGroupVariant, type InputProps, type InputShape, type InputSize, type InputState, type InputVariant, MediaImage, type MediaImageProps, type MediaImageRatio, type MediaImageShape, type MediaImageSize, MediaVideo, type MediaVideoProps, type MediaVideoRatio, type MediaVideoShape, type MediaVideoSize, Modal, type ModalBodyProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps, Tabs, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, Tooltip, type TooltipPosition, type TooltipProps, Typewriter, type TypewriterProps, cn };
|
|
469
|
+
export { Accordion, type AccordionProps, type AccordionSize, type AccordionVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Carousel, type CarouselBreakpointOptions, type CarouselProps, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, Dropdown, type DropdownAlign, type DropdownContentProps, type DropdownProps, type DropdownSide, type DropdownTriggerProps, type DropdownWidth, Input, type InputColor, InputGroup, type InputGroupProps, type InputGroupVariant, type InputProps, type InputShape, type InputSize, type InputState, type InputVariant, MediaImage, type MediaImageProps, type MediaImageRatio, type MediaImageShape, type MediaImageSize, MediaVideo, type MediaVideoProps, type MediaVideoRatio, type MediaVideoShape, type MediaVideoSize, Modal, type ModalBodyProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps, Table, type TableBodyProps, type TableCellProps, type TableHeadProps, type TableHeaderProps, type TableProps, type TableRowProps, type TableShape, type TableSize, type TableVariant, Tabs, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, Tooltip, type TooltipPosition, type TooltipProps, Typewriter, type TypewriterProps, cn };
|
package/dist/index.d.ts
CHANGED
|
@@ -347,6 +347,60 @@ interface SelectProps {
|
|
|
347
347
|
}
|
|
348
348
|
declare function Select({ value, onChange, options, placeholder, className, disabled, autoFlip, maxHeight, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
349
349
|
|
|
350
|
+
type TableSize = "xs" | "sm" | "md";
|
|
351
|
+
type TableVariant = "default" | "bordered" | "striped";
|
|
352
|
+
type TableShape = "square" | "rounded";
|
|
353
|
+
interface TableProps {
|
|
354
|
+
size?: TableSize;
|
|
355
|
+
variant?: TableVariant;
|
|
356
|
+
shape?: TableShape;
|
|
357
|
+
fullWidth?: boolean;
|
|
358
|
+
scrollX?: boolean;
|
|
359
|
+
scrollY?: boolean;
|
|
360
|
+
maxHeight?: string;
|
|
361
|
+
className?: string;
|
|
362
|
+
children: React.ReactNode;
|
|
363
|
+
}
|
|
364
|
+
interface TableHeadProps {
|
|
365
|
+
className?: string;
|
|
366
|
+
children: React.ReactNode;
|
|
367
|
+
}
|
|
368
|
+
interface TableBodyProps {
|
|
369
|
+
className?: string;
|
|
370
|
+
children: React.ReactNode;
|
|
371
|
+
}
|
|
372
|
+
interface TableRowProps {
|
|
373
|
+
onClick?: () => void;
|
|
374
|
+
isActive?: boolean;
|
|
375
|
+
className?: string;
|
|
376
|
+
children: React.ReactNode;
|
|
377
|
+
}
|
|
378
|
+
interface TableHeaderProps {
|
|
379
|
+
align?: "left" | "center" | "right";
|
|
380
|
+
width?: string;
|
|
381
|
+
className?: string;
|
|
382
|
+
children?: React.ReactNode;
|
|
383
|
+
}
|
|
384
|
+
interface TableCellProps {
|
|
385
|
+
align?: "left" | "center" | "right";
|
|
386
|
+
truncate?: boolean;
|
|
387
|
+
className?: string;
|
|
388
|
+
children?: React.ReactNode;
|
|
389
|
+
}
|
|
390
|
+
declare function TableRoot({ size, variant, shape, fullWidth, scrollX, scrollY, maxHeight, className, children, }: TableProps): react_jsx_runtime.JSX.Element;
|
|
391
|
+
declare function TableHead({ className, children }: TableHeadProps): react_jsx_runtime.JSX.Element;
|
|
392
|
+
declare function TableBody({ className, children }: TableBodyProps): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function TableRow({ onClick, isActive, className, children }: TableRowProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
declare function TableHeader({ align, width, className, children }: TableHeaderProps): react_jsx_runtime.JSX.Element;
|
|
395
|
+
declare function TableCell({ align, truncate, className, children }: TableCellProps): react_jsx_runtime.JSX.Element;
|
|
396
|
+
declare const Table: typeof TableRoot & {
|
|
397
|
+
Head: typeof TableHead;
|
|
398
|
+
Body: typeof TableBody;
|
|
399
|
+
Row: typeof TableRow;
|
|
400
|
+
Header: typeof TableHeader;
|
|
401
|
+
Cell: typeof TableCell;
|
|
402
|
+
};
|
|
403
|
+
|
|
350
404
|
type TabsVariant = "default" | "bordered" | "segmented";
|
|
351
405
|
type TabsSize = "xs" | "sm" | "md";
|
|
352
406
|
interface TabsProps {
|
|
@@ -412,4 +466,4 @@ declare function Typewriter({ texts, typingSpeed, deletingSpeed, pauseDuration,
|
|
|
412
466
|
|
|
413
467
|
declare function cn(...inputs: ClassValue[]): string;
|
|
414
468
|
|
|
415
|
-
export { Accordion, type AccordionProps, type AccordionSize, type AccordionVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Carousel, type CarouselBreakpointOptions, type CarouselProps, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, Dropdown, type DropdownAlign, type DropdownContentProps, type DropdownProps, type DropdownSide, type DropdownTriggerProps, type DropdownWidth, Input, type InputColor, InputGroup, type InputGroupProps, type InputGroupVariant, type InputProps, type InputShape, type InputSize, type InputState, type InputVariant, MediaImage, type MediaImageProps, type MediaImageRatio, type MediaImageShape, type MediaImageSize, MediaVideo, type MediaVideoProps, type MediaVideoRatio, type MediaVideoShape, type MediaVideoSize, Modal, type ModalBodyProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps, Tabs, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, Tooltip, type TooltipPosition, type TooltipProps, Typewriter, type TypewriterProps, cn };
|
|
469
|
+
export { Accordion, type AccordionProps, type AccordionSize, type AccordionVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonColor, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Carousel, type CarouselBreakpointOptions, type CarouselProps, Checkbox, type CheckboxColor, CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupVariant, type CheckboxProps, type CheckboxSize, type CheckboxVariant, Dropdown, type DropdownAlign, type DropdownContentProps, type DropdownProps, type DropdownSide, type DropdownTriggerProps, type DropdownWidth, Input, type InputColor, InputGroup, type InputGroupProps, type InputGroupVariant, type InputProps, type InputShape, type InputSize, type InputState, type InputVariant, MediaImage, type MediaImageProps, type MediaImageRatio, type MediaImageShape, type MediaImageSize, MediaVideo, type MediaVideoProps, type MediaVideoRatio, type MediaVideoShape, type MediaVideoSize, Modal, type ModalBodyProps, type ModalContentProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalSize, type ModalTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps, Table, type TableBodyProps, type TableCellProps, type TableHeadProps, type TableHeaderProps, type TableProps, type TableRowProps, type TableShape, type TableSize, type TableVariant, Tabs, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, Tooltip, type TooltipPosition, type TooltipProps, Typewriter, type TypewriterProps, cn };
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(index_exports, {
|
|
|
46
46
|
Modal: () => Modal,
|
|
47
47
|
MultiSelect: () => MultiSelect,
|
|
48
48
|
Select: () => Select,
|
|
49
|
+
Table: () => Table,
|
|
49
50
|
Tabs: () => Tabs,
|
|
50
51
|
Tooltip: () => Tooltip,
|
|
51
52
|
Typewriter: () => Typewriter,
|
|
@@ -5414,16 +5415,149 @@ function Select({
|
|
|
5414
5415
|
] });
|
|
5415
5416
|
}
|
|
5416
5417
|
|
|
5417
|
-
// src/components/
|
|
5418
|
+
// src/components/table/table.tsx
|
|
5418
5419
|
var React16 = __toESM(require("react"));
|
|
5419
5420
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5420
|
-
var
|
|
5421
|
+
var SIZES8 = {
|
|
5422
|
+
xs: { cell: "px-3 py-1.5", header: "px-3 py-1.5", text: "text-xs" },
|
|
5423
|
+
sm: { cell: "px-4 py-2.5", header: "px-4 py-2.5", text: "text-sm" },
|
|
5424
|
+
md: { cell: "px-5 py-3.5", header: "px-5 py-3.5", text: "text-base" }
|
|
5425
|
+
};
|
|
5426
|
+
var SHAPES5 = {
|
|
5427
|
+
square: "",
|
|
5428
|
+
rounded: "rounded-lg overflow-hidden"
|
|
5429
|
+
};
|
|
5430
|
+
var TABLE_VARIANTS = {
|
|
5431
|
+
default: "",
|
|
5432
|
+
bordered: "border border-zinc-200",
|
|
5433
|
+
striped: ""
|
|
5434
|
+
};
|
|
5435
|
+
var ROW_VARIANTS = {
|
|
5436
|
+
default: {
|
|
5437
|
+
base: "border-b border-zinc-100 last:border-0",
|
|
5438
|
+
active: "bg-zinc-50"
|
|
5439
|
+
},
|
|
5440
|
+
bordered: {
|
|
5441
|
+
base: "border-b border-zinc-100 last:border-0",
|
|
5442
|
+
active: "bg-zinc-50"
|
|
5443
|
+
},
|
|
5444
|
+
striped: {
|
|
5445
|
+
base: "border-b border-zinc-100 last:border-0 even:bg-zinc-50/50",
|
|
5446
|
+
active: "bg-zinc-100"
|
|
5447
|
+
}
|
|
5448
|
+
};
|
|
5449
|
+
var TableContext = React16.createContext({ size: "sm", variant: "default" });
|
|
5450
|
+
function useTable() {
|
|
5451
|
+
return React16.useContext(TableContext);
|
|
5452
|
+
}
|
|
5453
|
+
var ALIGN_MAP = {
|
|
5454
|
+
left: "text-left",
|
|
5455
|
+
center: "text-center",
|
|
5456
|
+
right: "text-right"
|
|
5457
|
+
};
|
|
5458
|
+
function TableRoot({
|
|
5459
|
+
size = "sm",
|
|
5460
|
+
variant = "default",
|
|
5461
|
+
shape = "rounded",
|
|
5462
|
+
fullWidth = true,
|
|
5463
|
+
scrollX = false,
|
|
5464
|
+
scrollY = false,
|
|
5465
|
+
maxHeight,
|
|
5466
|
+
className,
|
|
5467
|
+
children
|
|
5468
|
+
}) {
|
|
5469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TableContext.Provider, { value: { size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5470
|
+
"div",
|
|
5471
|
+
{
|
|
5472
|
+
className: cn(
|
|
5473
|
+
TABLE_VARIANTS[variant],
|
|
5474
|
+
SHAPES5[shape],
|
|
5475
|
+
scrollX && "overflow-x-auto",
|
|
5476
|
+
scrollY && "overflow-y-auto",
|
|
5477
|
+
className
|
|
5478
|
+
),
|
|
5479
|
+
style: scrollY && maxHeight ? { maxHeight } : void 0,
|
|
5480
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("table", { className: cn("border-collapse", fullWidth && "w-full"), children })
|
|
5481
|
+
}
|
|
5482
|
+
) });
|
|
5483
|
+
}
|
|
5484
|
+
function TableHead({ className, children }) {
|
|
5485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { className: cn("bg-zinc-50 border-b border-zinc-200 sticky top-0 z-10", className), children });
|
|
5486
|
+
}
|
|
5487
|
+
function TableBody({ className, children }) {
|
|
5488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tbody", { className: cn("bg-white", className), children });
|
|
5489
|
+
}
|
|
5490
|
+
function TableRow({ onClick, isActive, className, children }) {
|
|
5491
|
+
const { variant } = useTable();
|
|
5492
|
+
const v = ROW_VARIANTS[variant];
|
|
5493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5494
|
+
"tr",
|
|
5495
|
+
{
|
|
5496
|
+
onClick,
|
|
5497
|
+
className: cn(
|
|
5498
|
+
v.base,
|
|
5499
|
+
isActive && v.active,
|
|
5500
|
+
onClick && "cursor-pointer hover:bg-zinc-50 transition-colors",
|
|
5501
|
+
className
|
|
5502
|
+
),
|
|
5503
|
+
children
|
|
5504
|
+
}
|
|
5505
|
+
);
|
|
5506
|
+
}
|
|
5507
|
+
function TableHeader({ align = "left", width, className, children }) {
|
|
5508
|
+
const { size } = useTable();
|
|
5509
|
+
const s = SIZES8[size];
|
|
5510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5511
|
+
"th",
|
|
5512
|
+
{
|
|
5513
|
+
style: width ? { width } : void 0,
|
|
5514
|
+
className: cn(
|
|
5515
|
+
"font-semibold text-zinc-500 uppercase tracking-wider whitespace-nowrap",
|
|
5516
|
+
s.header,
|
|
5517
|
+
s.text,
|
|
5518
|
+
ALIGN_MAP[align],
|
|
5519
|
+
className
|
|
5520
|
+
),
|
|
5521
|
+
children
|
|
5522
|
+
}
|
|
5523
|
+
);
|
|
5524
|
+
}
|
|
5525
|
+
function TableCell({ align = "left", truncate, className, children }) {
|
|
5526
|
+
const { size } = useTable();
|
|
5527
|
+
const s = SIZES8[size];
|
|
5528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5529
|
+
"td",
|
|
5530
|
+
{
|
|
5531
|
+
className: cn(
|
|
5532
|
+
"text-zinc-700",
|
|
5533
|
+
s.cell,
|
|
5534
|
+
s.text,
|
|
5535
|
+
ALIGN_MAP[align],
|
|
5536
|
+
truncate && "max-w-0 truncate",
|
|
5537
|
+
className
|
|
5538
|
+
),
|
|
5539
|
+
children
|
|
5540
|
+
}
|
|
5541
|
+
);
|
|
5542
|
+
}
|
|
5543
|
+
var Table = Object.assign(TableRoot, {
|
|
5544
|
+
Head: TableHead,
|
|
5545
|
+
Body: TableBody,
|
|
5546
|
+
Row: TableRow,
|
|
5547
|
+
Header: TableHeader,
|
|
5548
|
+
Cell: TableCell
|
|
5549
|
+
});
|
|
5550
|
+
|
|
5551
|
+
// src/components/tabs/tabs.tsx
|
|
5552
|
+
var React17 = __toESM(require("react"));
|
|
5553
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5554
|
+
var TabsContext = React17.createContext(null);
|
|
5421
5555
|
function useTabs() {
|
|
5422
|
-
const ctx =
|
|
5556
|
+
const ctx = React17.useContext(TabsContext);
|
|
5423
5557
|
if (!ctx) throw new Error("Tabs sub-components must be used within <Tabs>");
|
|
5424
5558
|
return ctx;
|
|
5425
5559
|
}
|
|
5426
|
-
var
|
|
5560
|
+
var SIZES9 = {
|
|
5427
5561
|
xs: { list: "h-9", trigger: "px-3 gap-1", font: "text-xs", iconSize: "size-3" },
|
|
5428
5562
|
sm: { list: "h-10", trigger: "px-4 gap-1.5", font: "text-sm", iconSize: "size-3.5" },
|
|
5429
5563
|
md: { list: "h-12", trigger: "px-5 gap-2", font: "text-base", iconSize: "size-4" }
|
|
@@ -5456,20 +5590,20 @@ function TabsRoot({
|
|
|
5456
5590
|
className,
|
|
5457
5591
|
children
|
|
5458
5592
|
}) {
|
|
5459
|
-
const [internalValue, setInternalValue] =
|
|
5460
|
-
const baseId =
|
|
5593
|
+
const [internalValue, setInternalValue] = React17.useState(defaultValue);
|
|
5594
|
+
const baseId = React17.useId();
|
|
5461
5595
|
const isControlled = value !== void 0;
|
|
5462
5596
|
const activeValue = isControlled ? value : internalValue;
|
|
5463
5597
|
const onSelect = (val) => {
|
|
5464
5598
|
if (!isControlled) setInternalValue(val);
|
|
5465
5599
|
onValueChange?.(val);
|
|
5466
5600
|
};
|
|
5467
|
-
return /* @__PURE__ */ (0,
|
|
5601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabsContext.Provider, { value: { activeValue, onSelect, variant, size, baseId }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn("flex flex-col", className), children }) });
|
|
5468
5602
|
}
|
|
5469
5603
|
function TabsList({ className, children }) {
|
|
5470
5604
|
const { variant, size } = useTabs();
|
|
5471
|
-
const s =
|
|
5472
|
-
return /* @__PURE__ */ (0,
|
|
5605
|
+
const s = SIZES9[size];
|
|
5606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5473
5607
|
"div",
|
|
5474
5608
|
{
|
|
5475
5609
|
role: "tablist",
|
|
@@ -5486,9 +5620,9 @@ function TabsList({ className, children }) {
|
|
|
5486
5620
|
function TabsTrigger({ value, icon, activeClassName, disabled = false, className, children }) {
|
|
5487
5621
|
const { activeValue, onSelect, variant, size, baseId } = useTabs();
|
|
5488
5622
|
const isActive = activeValue === value;
|
|
5489
|
-
const s =
|
|
5623
|
+
const s = SIZES9[size];
|
|
5490
5624
|
const v = TRIGGER_VARIANTS[variant];
|
|
5491
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5492
5626
|
"button",
|
|
5493
5627
|
{
|
|
5494
5628
|
type: "button",
|
|
@@ -5510,7 +5644,7 @@ function TabsTrigger({ value, icon, activeClassName, disabled = false, className
|
|
|
5510
5644
|
className
|
|
5511
5645
|
),
|
|
5512
5646
|
children: [
|
|
5513
|
-
icon && /* @__PURE__ */ (0,
|
|
5647
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: cn("shrink-0", s.iconSize), children: icon }),
|
|
5514
5648
|
children
|
|
5515
5649
|
]
|
|
5516
5650
|
}
|
|
@@ -5519,7 +5653,7 @@ function TabsTrigger({ value, icon, activeClassName, disabled = false, className
|
|
|
5519
5653
|
function TabsContent({ value, className, children }) {
|
|
5520
5654
|
const { activeValue, baseId } = useTabs();
|
|
5521
5655
|
if (activeValue !== value) return null;
|
|
5522
|
-
return /* @__PURE__ */ (0,
|
|
5656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5523
5657
|
"div",
|
|
5524
5658
|
{
|
|
5525
5659
|
role: "tabpanel",
|
|
@@ -5537,8 +5671,8 @@ var Tabs = Object.assign(TabsRoot, {
|
|
|
5537
5671
|
});
|
|
5538
5672
|
|
|
5539
5673
|
// src/components/tooltip/tooltip.tsx
|
|
5540
|
-
var
|
|
5541
|
-
var
|
|
5674
|
+
var React18 = __toESM(require("react"));
|
|
5675
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
5542
5676
|
var POSITIONS = {
|
|
5543
5677
|
top: {
|
|
5544
5678
|
tooltip: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
@@ -5564,19 +5698,19 @@ function Tooltip({
|
|
|
5564
5698
|
children,
|
|
5565
5699
|
className
|
|
5566
5700
|
}) {
|
|
5567
|
-
const [visible, setVisible] =
|
|
5568
|
-
const timerRef =
|
|
5701
|
+
const [visible, setVisible] = React18.useState(false);
|
|
5702
|
+
const timerRef = React18.useRef(null);
|
|
5569
5703
|
const pos = POSITIONS[position];
|
|
5570
|
-
const show =
|
|
5704
|
+
const show = React18.useCallback(() => {
|
|
5571
5705
|
timerRef.current = setTimeout(() => setVisible(true), delay);
|
|
5572
5706
|
}, [delay]);
|
|
5573
|
-
const hide =
|
|
5707
|
+
const hide = React18.useCallback(() => {
|
|
5574
5708
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
5575
5709
|
setVisible(false);
|
|
5576
5710
|
}, []);
|
|
5577
|
-
return /* @__PURE__ */ (0,
|
|
5711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative inline-flex", onMouseEnter: show, onMouseLeave: hide, children: [
|
|
5578
5712
|
children,
|
|
5579
|
-
visible && /* @__PURE__ */ (0,
|
|
5713
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
5580
5714
|
"div",
|
|
5581
5715
|
{
|
|
5582
5716
|
className: cn(
|
|
@@ -5587,7 +5721,7 @@ function Tooltip({
|
|
|
5587
5721
|
),
|
|
5588
5722
|
children: [
|
|
5589
5723
|
content,
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5724
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("absolute w-0 h-0", pos.arrow) })
|
|
5591
5725
|
]
|
|
5592
5726
|
}
|
|
5593
5727
|
)
|
|
@@ -5595,8 +5729,8 @@ function Tooltip({
|
|
|
5595
5729
|
}
|
|
5596
5730
|
|
|
5597
5731
|
// src/components/typewriter/typewriter.tsx
|
|
5598
|
-
var
|
|
5599
|
-
var
|
|
5732
|
+
var React19 = __toESM(require("react"));
|
|
5733
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
5600
5734
|
function Typewriter({
|
|
5601
5735
|
texts,
|
|
5602
5736
|
typingSpeed = 40,
|
|
@@ -5610,17 +5744,17 @@ function Typewriter({
|
|
|
5610
5744
|
onComplete,
|
|
5611
5745
|
className
|
|
5612
5746
|
}) {
|
|
5613
|
-
const [displayText, setDisplayText] =
|
|
5614
|
-
const [textIndex, setTextIndex] =
|
|
5615
|
-
const [phase, setPhase] =
|
|
5747
|
+
const [displayText, setDisplayText] = React19.useState("");
|
|
5748
|
+
const [textIndex, setTextIndex] = React19.useState(0);
|
|
5749
|
+
const [phase, setPhase] = React19.useState(
|
|
5616
5750
|
startDelay > 0 ? "waiting" : "typing"
|
|
5617
5751
|
);
|
|
5618
|
-
|
|
5752
|
+
React19.useEffect(() => {
|
|
5619
5753
|
if (phase !== "waiting") return;
|
|
5620
5754
|
const timeout = setTimeout(() => setPhase("typing"), startDelay);
|
|
5621
5755
|
return () => clearTimeout(timeout);
|
|
5622
5756
|
}, [phase, startDelay]);
|
|
5623
|
-
const getDelay =
|
|
5757
|
+
const getDelay = React19.useCallback(() => {
|
|
5624
5758
|
switch (phase) {
|
|
5625
5759
|
case "typing":
|
|
5626
5760
|
return typingSpeed;
|
|
@@ -5632,7 +5766,7 @@ function Typewriter({
|
|
|
5632
5766
|
return 0;
|
|
5633
5767
|
}
|
|
5634
5768
|
}, [phase, typingSpeed, pauseDuration, deletingSpeed, deleteMode]);
|
|
5635
|
-
|
|
5769
|
+
React19.useEffect(() => {
|
|
5636
5770
|
if (phase === "waiting" || phase === "done" || !texts.length) return;
|
|
5637
5771
|
const currentFullText = texts[textIndex];
|
|
5638
5772
|
const timeout = setTimeout(() => {
|
|
@@ -5670,7 +5804,7 @@ function Typewriter({
|
|
|
5670
5804
|
}, getDelay());
|
|
5671
5805
|
return () => clearTimeout(timeout);
|
|
5672
5806
|
}, [displayText, textIndex, phase, texts, deleteMode, getDelay, loop, onComplete]);
|
|
5673
|
-
const cursorElement = cursor && phase !== "done" && /* @__PURE__ */ (0,
|
|
5807
|
+
const cursorElement = cursor && phase !== "done" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
5674
5808
|
"span",
|
|
5675
5809
|
{
|
|
5676
5810
|
className: cn(
|
|
@@ -5681,7 +5815,7 @@ function Typewriter({
|
|
|
5681
5815
|
)
|
|
5682
5816
|
}
|
|
5683
5817
|
);
|
|
5684
|
-
return /* @__PURE__ */ (0,
|
|
5818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: cn(className), children: [
|
|
5685
5819
|
displayText,
|
|
5686
5820
|
cursorElement
|
|
5687
5821
|
] });
|
|
@@ -5703,6 +5837,7 @@ function Typewriter({
|
|
|
5703
5837
|
Modal,
|
|
5704
5838
|
MultiSelect,
|
|
5705
5839
|
Select,
|
|
5840
|
+
Table,
|
|
5706
5841
|
Tabs,
|
|
5707
5842
|
Tooltip,
|
|
5708
5843
|
Typewriter,
|