@moondreamsdev/dreamer-ui 1.7.7-test.2 → 1.7.7-test.21
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 +13 -0
- package/dist/QuestionMarkCircled-BaSE7iv0.cjs +2 -0
- package/dist/QuestionMarkCircled-BaSE7iv0.cjs.map +1 -0
- package/dist/{QuestionMarkCircled-BVBF3skB.js → QuestionMarkCircled-CY81euqP.js} +119 -7
- package/dist/QuestionMarkCircled-CY81euqP.js.map +1 -0
- package/dist/Toast-B-Zu6Kp_.cjs +2 -0
- package/dist/Toast-B-Zu6Kp_.cjs.map +1 -0
- package/dist/{Toast-C5BwqBkw.js → Toast-BFQrI1bB.js} +129 -100
- package/dist/Toast-BFQrI1bB.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +2117 -684
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +0 -1
- package/dist/src/components/carousel/Carousel.d.ts +46 -0
- package/dist/src/components/carousel/hooks.d.ts +20 -0
- package/dist/src/components/carousel/index.d.ts +2 -0
- package/dist/src/components/carousel/useScreenSize.d.ts +15 -0
- package/dist/src/components/carousel/variants.d.ts +36 -0
- package/dist/src/components/clickable/Clickable.d.ts +0 -1
- package/dist/src/components/index.d.ts +9 -0
- package/dist/src/components/label/Label.d.ts +2 -1
- package/dist/src/components/pagination/Pagination.d.ts +24 -0
- package/dist/src/components/pagination/index.d.ts +1 -0
- package/dist/src/components/pagination/variants.d.ts +15 -0
- package/dist/src/components/panel/Panel.d.ts +36 -0
- package/dist/src/components/panel/hooks.d.ts +6 -0
- package/dist/src/components/panel/index.d.ts +3 -0
- package/dist/src/components/panel/variants.d.ts +12 -0
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
- package/dist/src/components/scroll-area/ScrollArea.d.ts +20 -0
- package/dist/src/components/scroll-area/hooks.d.ts +12 -0
- package/dist/src/components/scroll-area/index.d.ts +2 -0
- package/dist/src/components/select/Select.d.ts +22 -0
- package/dist/src/components/select/hooks.d.ts +35 -0
- package/dist/src/components/select/index.d.ts +2 -0
- package/dist/src/components/select/variants.d.ts +15 -0
- package/dist/src/components/separator/Separator.d.ts +15 -0
- package/dist/src/components/separator/index.d.ts +2 -0
- package/dist/src/components/separator/variants.d.ts +7 -0
- package/dist/src/components/skeleton/Skeleton.d.ts +13 -0
- package/dist/src/components/skeleton/index.d.ts +1 -0
- package/dist/src/components/skeleton/variants.d.ts +18 -0
- package/dist/src/components/slider/Slider.d.ts +33 -0
- package/dist/src/components/slider/hooks.d.ts +30 -0
- package/dist/src/components/slider/index.d.ts +2 -0
- package/dist/src/components/slider/variants.d.ts +49 -0
- package/dist/src/components/tabs/Tabs.d.ts +26 -0
- package/dist/src/components/tabs/TabsContent.d.ts +10 -0
- package/dist/src/components/tabs/TabsContext.d.ts +11 -0
- package/dist/src/components/tabs/TabsList.d.ts +7 -0
- package/dist/src/components/tabs/TabsTrigger.d.ts +15 -0
- package/dist/src/components/tabs/hooks.d.ts +9 -0
- package/dist/src/components/tabs/index.d.ts +4 -0
- package/dist/src/components/tabs/variants.d.ts +18 -0
- package/dist/src/components/tooltip/hooks.d.ts +0 -1
- package/dist/src/hooks/useActionModal.d.ts +0 -1
- package/dist/src/hooks/useToast.d.ts +0 -1
- package/dist/src/symbols/ChevronDoubleLeft.d.ts +2 -0
- package/dist/src/symbols/ChevronDoubleRight.d.ts +2 -0
- package/dist/src/symbols/ChevronLeft.d.ts +2 -0
- package/dist/src/symbols/ChevronRight.d.ts +2 -0
- package/dist/src/symbols/index.d.ts +4 -1
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +14 -10
- package/dist/theme.css +4 -0
- package/package.json +3 -3
- package/dist/QuestionMarkCircled-BVBF3skB.js.map +0 -1
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs +0 -2
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs.map +0 -1
- package/dist/Toast-C5BwqBkw.js.map +0 -1
- package/dist/Toast-FzI16Fnl.cjs +0 -2
- package/dist/Toast-FzI16Fnl.cjs.map +0 -1
package/dist/providers.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),x=require("./Toast-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),x=require("./Toast-B-Zu6Kp_.cjs");require("react-dom");const g=require("./useToast-CraVIawn.cjs"),b=require("./utils.cjs.js");function y({children:d}){const[e,n]=r.useState(null),m=r.useCallback(t=>new Promise(a=>{n({isOpen:!0,type:"confirm",title:t.title,message:t.message,confirmText:t.confirmText,cancelText:t.cancelText,destructive:t.destructive,resolve:a})}),[]),c=r.useCallback(t=>new Promise(a=>{n({isOpen:!0,type:"alert",title:t.title,message:t.message,confirmText:t.confirmText,destructive:t.destructive,resolve:a})}),[]),i=r.useCallback(()=>{e!=null&&e.resolve&&(e.type==="confirm"?e.resolve(!1):e.resolve()),n(null)},[e]),l=r.useCallback(()=>{e!=null&&e.resolve&&(e.type==="confirm"?e.resolve(!0):e.resolve()),n(null)},[e]),f={confirm:m,alert:c};return o.jsxs(g.ActionModalContext.Provider,{value:f,children:[d,e&&e.type==="alert"&&o.jsx(x.ActionModal,{type:"alert",isOpen:e.isOpen,onClose:i,title:e.title,message:e.message,confirmText:e.confirmText,destructive:e.destructive,onConfirm:l,className:"bg-white dark:bg-gray-800 rounded-lg"}),e&&e.type==="confirm"&&o.jsx(x.ActionModal,{type:"confirm",isOpen:e.isOpen,onClose:i,title:e.title,message:e.message,confirmText:e.confirmText,cancelText:e.cancelText,destructive:e.destructive,onConfirm:l,className:"bg-white dark:bg-gray-800 rounded-lg"})]})}const C={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"};function h({children:d,customTypes:e,customComponent:n,position:m="top-right",maxToasts:c=5}){const[i,l]=r.useState([]),f=r.useCallback(s=>{const v=`toast-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,u=s.id||v,T={id:u,title:s.title,description:s.description,type:s.type||"info",action:s.action,duration:s.duration??5e3};return l(p=>[T,...p].slice(0,c)),u},[c]),t=r.useCallback(s=>{l(v=>v.filter(u=>u.id!==s))},[]),a={addToast:f,removeToast:t,toasts:i};return o.jsxs(g.ToastContext.Provider,{value:a,children:[d,o.jsx("div",{className:b.join("fixed z-50 pointer-events-none max-w-sm w-full space-y-2",C[m]),role:"region","aria-label":"Notifications",children:i.map(s=>o.jsx("div",{className:"pointer-events-auto",children:o.jsx(x.Toast,{...s,onRemove:t,customTypes:e,customComponent:n})},s.id))})]})}exports.ActionModalProvider=y;exports.ToastProvider=h;
|
|
2
2
|
//# sourceMappingURL=providers.cjs.js.map
|
package/dist/providers.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as g, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as x, useCallback as s } from "react";
|
|
3
|
-
import { A as v, T as y } from "./Toast-
|
|
3
|
+
import { A as v, T as y } from "./Toast-BFQrI1bB.js";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
import { A as b, T as C } from "./useToast-CEKvEJVB.js";
|
|
6
6
|
import { join as w } from "./utils.esm.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScreenSize } from './useScreenSize';
|
|
3
|
+
import { ButtonPosition, ButtonSize, ButtonStyle } from './variants';
|
|
4
|
+
export interface CarouselProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
id?: string;
|
|
7
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Enable automatic scrolling */
|
|
10
|
+
autoScroll?: boolean;
|
|
11
|
+
/** Interval in milliseconds for auto scroll */
|
|
12
|
+
scrollInterval?: number;
|
|
13
|
+
/** Pause auto scroll on hover */
|
|
14
|
+
pauseScrollOnHover?: boolean;
|
|
15
|
+
/** Manually control the current index */
|
|
16
|
+
currentIndex?: number;
|
|
17
|
+
/** Callback when index changes */
|
|
18
|
+
onIndexChange?: (index: number) => void;
|
|
19
|
+
/** Hide previous/next navigation buttons */
|
|
20
|
+
hidePrevNext?: boolean;
|
|
21
|
+
/** Hide dot indicators */
|
|
22
|
+
hideDots?: boolean;
|
|
23
|
+
/** Number of items to show at once, or breakpoint object mapping screen sizes to item counts */
|
|
24
|
+
itemsToShow?: number | Partial<Record<ScreenSize, number>>;
|
|
25
|
+
/** Size variant for navigation buttons */
|
|
26
|
+
buttonSize?: ButtonSize;
|
|
27
|
+
/** Style variant for navigation buttons */
|
|
28
|
+
buttonVariant?: ButtonStyle;
|
|
29
|
+
/** Position of navigation buttons relative to carousel */
|
|
30
|
+
buttonPosition?: ButtonPosition;
|
|
31
|
+
/** Enable infinite scrolling */
|
|
32
|
+
infinite?: boolean;
|
|
33
|
+
/** Custom previous button content */
|
|
34
|
+
prevButton?: React.ReactNode;
|
|
35
|
+
/** Custom next button content */
|
|
36
|
+
nextButton?: React.ReactNode;
|
|
37
|
+
/** Additional class names for carousel items */
|
|
38
|
+
itemsClassName?: string;
|
|
39
|
+
/** Additional class names for the carousel container */
|
|
40
|
+
containerClassName?: string;
|
|
41
|
+
/** Additional class names for the dot indicators */
|
|
42
|
+
dotsClassName?: string;
|
|
43
|
+
/** Gap between carousel items in pixels */
|
|
44
|
+
gap?: number;
|
|
45
|
+
}
|
|
46
|
+
export default function Carousel({ children, id, ref, className, autoScroll, scrollInterval, pauseScrollOnHover, currentIndex, onIndexChange, hidePrevNext, hideDots, itemsToShow, buttonSize, buttonVariant, buttonPosition, infinite, prevButton, nextButton, itemsClassName, containerClassName, dotsClassName, gap, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UseCarouselProps {
|
|
2
|
+
totalItems: number;
|
|
3
|
+
itemsToShow: number;
|
|
4
|
+
infinite: boolean;
|
|
5
|
+
autoScroll: boolean;
|
|
6
|
+
scrollInterval: number;
|
|
7
|
+
pauseScrollOnHover: boolean;
|
|
8
|
+
currentIndex?: number;
|
|
9
|
+
onIndexChange?: (index: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useCarousel({ totalItems, itemsToShow, infinite, autoScroll, scrollInterval, pauseScrollOnHover, currentIndex, onIndexChange, }: UseCarouselProps): {
|
|
12
|
+
currentSlide: number;
|
|
13
|
+
canGoPrev: boolean;
|
|
14
|
+
canGoNext: boolean;
|
|
15
|
+
goToPrev: () => void;
|
|
16
|
+
goToNext: () => void;
|
|
17
|
+
goToSlide: (index: number) => void;
|
|
18
|
+
isHovered: boolean;
|
|
19
|
+
setIsHovered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const breakpoints: {
|
|
2
|
+
xs: number;
|
|
3
|
+
sm: number;
|
|
4
|
+
md: number;
|
|
5
|
+
lg: number;
|
|
6
|
+
xl: number;
|
|
7
|
+
'2xl': number;
|
|
8
|
+
};
|
|
9
|
+
export type ScreenSize = keyof typeof breakpoints;
|
|
10
|
+
export default function useScreenSize(): {
|
|
11
|
+
screenSize: "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | undefined;
|
|
12
|
+
screenWidth: number;
|
|
13
|
+
getBreakpoint: (size: ScreenSize) => number;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const buttonSizeVariants: {
|
|
2
|
+
sm: {
|
|
3
|
+
button: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
};
|
|
6
|
+
md: {
|
|
7
|
+
button: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
};
|
|
10
|
+
lg: {
|
|
11
|
+
button: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type ButtonSize = keyof typeof buttonSizeVariants;
|
|
16
|
+
export declare const buttonStyleVariants: {
|
|
17
|
+
default: string;
|
|
18
|
+
outline: string;
|
|
19
|
+
ghost: string;
|
|
20
|
+
};
|
|
21
|
+
export type ButtonStyle = keyof typeof buttonStyleVariants;
|
|
22
|
+
export declare const buttonPositionVariants: {
|
|
23
|
+
aligned: {
|
|
24
|
+
prev: string;
|
|
25
|
+
next: string;
|
|
26
|
+
};
|
|
27
|
+
exterior: {
|
|
28
|
+
prev: string;
|
|
29
|
+
next: string;
|
|
30
|
+
};
|
|
31
|
+
interior: {
|
|
32
|
+
prev: string;
|
|
33
|
+
next: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type ButtonPosition = keyof typeof buttonPositionVariants;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
export * from './accordion';
|
|
2
2
|
export * from './actionmodal';
|
|
3
3
|
export * from './button';
|
|
4
|
+
export * from './carousel';
|
|
4
5
|
export * from './checkbox';
|
|
5
6
|
export * from './clickable';
|
|
6
7
|
export * from './input';
|
|
7
8
|
export * from './label';
|
|
8
9
|
export * from './modal';
|
|
10
|
+
export * from './pagination';
|
|
11
|
+
export * from './panel';
|
|
9
12
|
export * from './radiogroup';
|
|
13
|
+
export * from './scroll-area';
|
|
14
|
+
export * from './select';
|
|
15
|
+
export * from './separator';
|
|
16
|
+
export * from './skeleton';
|
|
17
|
+
export * from './slider';
|
|
10
18
|
export * from './slot';
|
|
19
|
+
export * from './tabs';
|
|
11
20
|
export * from './textarea';
|
|
12
21
|
export * from './toast';
|
|
13
22
|
export * from './toggle';
|
|
@@ -5,5 +5,6 @@ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
|
|
|
5
5
|
required?: boolean;
|
|
6
6
|
helpMessage?: string;
|
|
7
7
|
suffix?: React.ReactNode;
|
|
8
|
+
description?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function Label({ display, width, className, required, helpMessage, suffix, htmlFor, children, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Label({ display, width, className, required, helpMessage, suffix, htmlFor, children, description, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaginationSize, PaginationVariant } from './variants';
|
|
3
|
+
interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The current page number (1-indexed) */
|
|
5
|
+
page: number;
|
|
6
|
+
/** Total number of pages. Use Infinity for infinite pagination */
|
|
7
|
+
pageCount?: number;
|
|
8
|
+
/** Maximum number of page buttons to show */
|
|
9
|
+
maxVisiblePages?: number;
|
|
10
|
+
/** Show first and last page buttons */
|
|
11
|
+
showFirstLast?: boolean;
|
|
12
|
+
/** Button variant style */
|
|
13
|
+
variant?: PaginationVariant;
|
|
14
|
+
/** Button size */
|
|
15
|
+
size?: PaginationSize;
|
|
16
|
+
/** Callback when page changes */
|
|
17
|
+
onPageChange: (page: number) => void;
|
|
18
|
+
/** Ref for the pagination container */
|
|
19
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
20
|
+
/** Additional class names for the button elements */
|
|
21
|
+
buttonsClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
export default function Pagination({ page, pageCount, maxVisiblePages, showFirstLast, onPageChange, size, variant, className, ref, buttonsClassName, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Pagination } from './Pagination';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const paginationVariants: {
|
|
2
|
+
readonly link: "text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary";
|
|
3
|
+
readonly outline: "border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary";
|
|
4
|
+
readonly filled: "bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground";
|
|
5
|
+
};
|
|
6
|
+
export type PaginationVariant = keyof typeof paginationVariants;
|
|
7
|
+
export declare const paginationSizes: {
|
|
8
|
+
readonly sm: "px-2 py-1 text-sm min-w-[32px] min-h-8";
|
|
9
|
+
readonly md: "px-2 py-1 text-base min-w-[40px] min-h-10";
|
|
10
|
+
};
|
|
11
|
+
export type PaginationSize = keyof typeof paginationSizes;
|
|
12
|
+
export interface PaginationVariants {
|
|
13
|
+
variant: PaginationVariant;
|
|
14
|
+
size: PaginationSize;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelSize } from './variants';
|
|
3
|
+
export interface PanelProps {
|
|
4
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5
|
+
/** Unique identifier for the panel */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Whether the panel is open */
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/** Callback when panel should close */
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** Panel title - can be a string or React node */
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/** Panel content */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** Panel footer - can be a string or React node */
|
|
16
|
+
footer?: React.ReactNode;
|
|
17
|
+
/** Panel size variant */
|
|
18
|
+
size?: PanelSize;
|
|
19
|
+
/** Additional CSS classes for the panel */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Additional CSS classes for the overlay */
|
|
22
|
+
overlayClassName?: string;
|
|
23
|
+
/** Whether to hide the close button */
|
|
24
|
+
hideCloseButton?: boolean;
|
|
25
|
+
/** Whether to disable closing when clicking the overlay */
|
|
26
|
+
disableCloseOnOverlayClick?: boolean;
|
|
27
|
+
/** ARIA labelledby attribute */
|
|
28
|
+
ariaLabelledBy?: string;
|
|
29
|
+
/** ARIA describedby attribute */
|
|
30
|
+
ariaDescribedBy?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Panel component that slides in from the right side of the screen.
|
|
34
|
+
* Provides an overlay and slide-in animation for side content display.
|
|
35
|
+
*/
|
|
36
|
+
export default function Panel({ ref, id, isOpen, onClose, title, children, footer, size, className, overlayClassName, hideCloseButton, disableCloseOnOverlayClick, ariaLabelledBy, ariaDescribedBy, }: PanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useAnimationSlideIn(isOpen: boolean): {
|
|
2
|
+
show: boolean;
|
|
3
|
+
shouldRender: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function usePanelDocumentChanges(isOpen: boolean, onClose: () => void): void;
|
|
6
|
+
export declare function usePanelFocus(panelId: string, isOpen: boolean): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const panelVariants: {
|
|
2
|
+
readonly size: {
|
|
3
|
+
readonly sm: "max-w-sm";
|
|
4
|
+
readonly md: "max-w-md";
|
|
5
|
+
readonly lg: "max-w-lg";
|
|
6
|
+
readonly xl: "max-w-xl";
|
|
7
|
+
readonly '2xl': "max-w-2xl";
|
|
8
|
+
readonly full: "w-full";
|
|
9
|
+
readonly screen: "w-screen";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type PanelSize = keyof typeof panelVariants.size;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Custom CSS classes for the root container. Use this to set width/height */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Custom CSS classes for the scroll thumb */
|
|
6
|
+
thumbClassName?: string;
|
|
7
|
+
/** Custom CSS classes for the viewport (scrollable content area) */
|
|
8
|
+
viewportClassName?: string;
|
|
9
|
+
/** Custom CSS classes for the scrollbar track */
|
|
10
|
+
scrollbarClassName?: string;
|
|
11
|
+
/** Scrollbar thickness in pixels. Defaults to 10px */
|
|
12
|
+
scrollbarThickness?: number;
|
|
13
|
+
/** Children content to be scrolled */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** HTML id attribute */
|
|
16
|
+
id?: string;
|
|
17
|
+
/** Reference to the root element */
|
|
18
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
19
|
+
}
|
|
20
|
+
export default function ScrollArea({ className, thumbClassName, viewportClassName, scrollbarClassName, scrollbarThickness, children, id, ref, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function useScrollArea(scrollbarThickness: number): {
|
|
2
|
+
viewportRef: import("react").RefObject<HTMLDivElement | null>;
|
|
3
|
+
verticalThumbRef: import("react").RefObject<HTMLDivElement | null>;
|
|
4
|
+
horizontalThumbRef: import("react").RefObject<HTMLDivElement | null>;
|
|
5
|
+
isScrolling: boolean;
|
|
6
|
+
isFadingOut: boolean;
|
|
7
|
+
scrollbarVisible: {
|
|
8
|
+
vertical: boolean;
|
|
9
|
+
horizontal: boolean;
|
|
10
|
+
};
|
|
11
|
+
handleScroll: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectOption } from './hooks';
|
|
3
|
+
import { SelectSize } from './variants';
|
|
4
|
+
export type { SelectOption };
|
|
5
|
+
export interface SelectProps {
|
|
6
|
+
options: SelectOption[];
|
|
7
|
+
value?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
clearable?: boolean;
|
|
12
|
+
size?: SelectSize;
|
|
13
|
+
className?: string;
|
|
14
|
+
triggerClassName?: string;
|
|
15
|
+
dropdownClassName?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
onChange?: (value: string) => void;
|
|
19
|
+
onSearch?: (searchTerm: string) => void;
|
|
20
|
+
searchPlaceholder?: string;
|
|
21
|
+
}
|
|
22
|
+
export default function Select({ options, value, placeholder, searchable, disabled, clearable, size, className, triggerClassName, dropdownClassName, id, ref, onChange, onSearch, searchPlaceholder, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
text: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function useSelectDropdown(isOpen: boolean): {
|
|
9
|
+
show: boolean;
|
|
10
|
+
shouldRender: boolean;
|
|
11
|
+
};
|
|
12
|
+
interface UseSelectKeyboardNavigationProps {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
setIsOpen: (open: boolean) => void;
|
|
15
|
+
filteredOptions: SelectOption[];
|
|
16
|
+
highlightedIndex: number;
|
|
17
|
+
setHighlightedIndex: (index: number) => void;
|
|
18
|
+
onSelect: (option: SelectOption) => void;
|
|
19
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
20
|
+
}
|
|
21
|
+
export declare function useSelectKeyboardNavigation({ isOpen, setIsOpen, filteredOptions, highlightedIndex, setHighlightedIndex, onSelect, triggerRef, }: UseSelectKeyboardNavigationProps): {
|
|
22
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
23
|
+
};
|
|
24
|
+
interface UseSelectHighlightProps {
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
filteredOptions: SelectOption[];
|
|
27
|
+
selectedOption?: SelectOption;
|
|
28
|
+
shouldRender: boolean;
|
|
29
|
+
optionsContainerRef: RefObject<HTMLDivElement | null>;
|
|
30
|
+
}
|
|
31
|
+
export declare function useSelectHighlight({ isOpen, filteredOptions, selectedOption, shouldRender, optionsContainerRef, }: UseSelectHighlightProps): {
|
|
32
|
+
highlightedIndex: number;
|
|
33
|
+
setHighlightedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const sizeVariants: {
|
|
2
|
+
readonly sm: {
|
|
3
|
+
readonly trigger: "px-2 py-1 text-sm";
|
|
4
|
+
readonly options: "px-2 py-2 text-xs";
|
|
5
|
+
};
|
|
6
|
+
readonly md: {
|
|
7
|
+
readonly trigger: "px-3 py-2 text-base";
|
|
8
|
+
readonly options: "px-3 py-2.5 text-sm";
|
|
9
|
+
};
|
|
10
|
+
readonly lg: {
|
|
11
|
+
readonly trigger: "px-4 py-3 text-lg";
|
|
12
|
+
readonly options: "px-4 py-3 text-base";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type SelectSize = keyof typeof sizeVariants;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
|
+
import { Thickness } from './variants';
|
|
3
|
+
export type Orientation = 'horizontal' | 'vertical';
|
|
4
|
+
export interface SeparatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
orientation?: Orientation;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the separator is decorative only or serves a semantic purpose.
|
|
9
|
+
* When decorative=true, it's hidden from screen readers.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
decorative?: boolean;
|
|
13
|
+
thickness?: Thickness;
|
|
14
|
+
}
|
|
15
|
+
export default function Separator({ orientation, decorative, thickness, className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Orientation } from './Separator';
|
|
2
|
+
export declare const thicknessVariants: Record<Thickness, Record<Orientation, string>>;
|
|
3
|
+
export type Thickness = 'thin' | 'medium' | 'thick' | 'extra-thick';
|
|
4
|
+
export declare const sizeVariants: Record<Orientation, string>;
|
|
5
|
+
export declare const defaultVariants: {
|
|
6
|
+
thickness: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SkeletonVariants } from './variants';
|
|
3
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, SkeletonVariants {
|
|
4
|
+
/** Custom class name for additional styling */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Number of skeleton lines to render (for text-like skeletons) */
|
|
7
|
+
lines?: number;
|
|
8
|
+
/** Whether the skeleton should animate */
|
|
9
|
+
animate?: boolean;
|
|
10
|
+
/** Ref to be passed to the skeleton element */
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
}
|
|
13
|
+
export default function Skeleton({ shape, lineSpacing, className, lines, animate, ref, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton } from './Skeleton';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const skeletonVariants: {
|
|
2
|
+
readonly shape: {
|
|
3
|
+
readonly rectangle: "rounded-md min-h-1";
|
|
4
|
+
readonly circle: "rounded-full aspect-square min-h-1";
|
|
5
|
+
readonly text: "rounded-sm min-h-1 h-4";
|
|
6
|
+
};
|
|
7
|
+
readonly lineSpacing: {
|
|
8
|
+
readonly xs: "space-y-1";
|
|
9
|
+
readonly sm: "space-y-2";
|
|
10
|
+
readonly md: "space-y-3";
|
|
11
|
+
readonly lg: "space-y-4";
|
|
12
|
+
readonly xl: "space-y-6";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export interface SkeletonVariants {
|
|
16
|
+
shape?: keyof typeof skeletonVariants.shape;
|
|
17
|
+
lineSpacing?: keyof typeof skeletonVariants.lineSpacing;
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SliderProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
/** Current value of the slider */
|
|
5
|
+
value?: number;
|
|
6
|
+
/** Default value when uncontrolled */
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
/** Callback fired when the value changes */
|
|
9
|
+
onValueChange?: (value: number) => void;
|
|
10
|
+
/** Minimum value */
|
|
11
|
+
min?: number;
|
|
12
|
+
/** Maximum value */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Step increment */
|
|
15
|
+
step?: number;
|
|
16
|
+
/** Whether the slider is disabled */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Custom class name for the track element */
|
|
19
|
+
trackClassName?: string;
|
|
20
|
+
/** Custom class name for the range element */
|
|
21
|
+
rangeClassName?: string;
|
|
22
|
+
/** Custom class name for the thumb element */
|
|
23
|
+
thumbClassName?: string;
|
|
24
|
+
/** Custom class name for the root element */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Ref to the root element */
|
|
27
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
28
|
+
/** ARIA label for accessibility */
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
/** ARIA labelledby for accessibility */
|
|
31
|
+
ariaLabelledBy?: string;
|
|
32
|
+
}
|
|
33
|
+
export default function Slider({ id, value, defaultValue, onValueChange, min, max, step, disabled, trackClassName, rangeClassName, thumbClassName, className, ref, ariaLabel, ariaLabelledBy, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface UseSliderProps {
|
|
2
|
+
/** Initial value */
|
|
3
|
+
defaultValue?: number;
|
|
4
|
+
/** Minimum value */
|
|
5
|
+
min?: number;
|
|
6
|
+
/** Maximum value */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** Step increment */
|
|
9
|
+
step?: number;
|
|
10
|
+
/** Callback fired when the value changes */
|
|
11
|
+
onValueChange?: (value: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface UseSliderReturn {
|
|
14
|
+
/** Current value */
|
|
15
|
+
value: number;
|
|
16
|
+
/** Function to update the value */
|
|
17
|
+
setValue: (value: number) => void;
|
|
18
|
+
/** Function to increment the value by step */
|
|
19
|
+
increment: () => void;
|
|
20
|
+
/** Function to decrement the value by step */
|
|
21
|
+
decrement: () => void;
|
|
22
|
+
/** Function to reset to default value */
|
|
23
|
+
reset: () => void;
|
|
24
|
+
/** Percentage representation of current value */
|
|
25
|
+
percentage: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Hook for managing slider state and providing utility functions
|
|
29
|
+
*/
|
|
30
|
+
export declare function useSlider({ defaultValue, min, max, step, onValueChange, }: UseSliderProps): UseSliderReturn;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const trackVariants: {
|
|
2
|
+
readonly primary: "bg-muted";
|
|
3
|
+
readonly secondary: "bg-secondary/30";
|
|
4
|
+
readonly accent: "bg-accent/30";
|
|
5
|
+
readonly muted: "bg-muted";
|
|
6
|
+
};
|
|
7
|
+
export type TrackVariant = keyof typeof trackVariants;
|
|
8
|
+
export declare const rangeVariants: {
|
|
9
|
+
readonly primary: "bg-primary";
|
|
10
|
+
readonly secondary: "bg-secondary";
|
|
11
|
+
readonly accent: "bg-accent";
|
|
12
|
+
readonly success: "bg-success";
|
|
13
|
+
readonly destructive: "bg-destructive";
|
|
14
|
+
};
|
|
15
|
+
export type RangeVariant = keyof typeof rangeVariants;
|
|
16
|
+
export declare const thumbVariants: {
|
|
17
|
+
readonly primary: "bg-primary border-white";
|
|
18
|
+
readonly secondary: "bg-secondary border-white";
|
|
19
|
+
readonly accent: "bg-accent border-white";
|
|
20
|
+
readonly success: "bg-success border-white";
|
|
21
|
+
readonly destructive: "bg-destructive border-white";
|
|
22
|
+
readonly outline: "bg-white border-primary";
|
|
23
|
+
};
|
|
24
|
+
export type ThumbVariant = keyof typeof thumbVariants;
|
|
25
|
+
export declare const sizeVariants: {
|
|
26
|
+
readonly sm: {
|
|
27
|
+
readonly track: "h-1";
|
|
28
|
+
readonly thumb: "w-3 h-3 -top-1";
|
|
29
|
+
readonly thumbOffset: "6px";
|
|
30
|
+
};
|
|
31
|
+
readonly md: {
|
|
32
|
+
readonly track: "h-2";
|
|
33
|
+
readonly thumb: "w-5 h-5 -top-1.5";
|
|
34
|
+
readonly thumbOffset: "10px";
|
|
35
|
+
};
|
|
36
|
+
readonly lg: {
|
|
37
|
+
readonly track: "h-3";
|
|
38
|
+
readonly thumb: "w-6 h-6 -top-1.5";
|
|
39
|
+
readonly thumbOffset: "12px";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type SliderSize = keyof typeof sizeVariants;
|
|
43
|
+
export interface SliderVariants {
|
|
44
|
+
track: TrackVariant;
|
|
45
|
+
range: RangeVariant;
|
|
46
|
+
thumb: ThumbVariant;
|
|
47
|
+
size: SliderSize;
|
|
48
|
+
}
|
|
49
|
+
export declare const sliderDefaults: SliderVariants;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabsVariant, TabsWidth } from './variants';
|
|
3
|
+
export interface TabsProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The default selected tab value (uncontrolled) */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
/** The selected tab value (controlled) */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Callback fired when the tab selection changes */
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
/** How the tabs should be sized */
|
|
12
|
+
tabsWidth?: TabsWidth;
|
|
13
|
+
/** The visual style variant */
|
|
14
|
+
variant?: TabsVariant;
|
|
15
|
+
/** Additional class names for the tabs container */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** The tab content and triggers */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/** Ref to the tabs container */
|
|
20
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
21
|
+
/** Additional class names for the tab triggers */
|
|
22
|
+
triggersClassName?: string;
|
|
23
|
+
/** Additional class names for the tab content */
|
|
24
|
+
contentClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function Tabs({ defaultValue, value, onValueChange, tabsWidth, variant, className, children, ref, id, triggersClassName, contentClassName, }: TabsProps): import("react/jsx-runtime").JSX.Element;
|