@moondreamsdev/dreamer-ui 1.7.7-test.21 → 1.7.7-test.22
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/Toast-CUHmqnRs.cjs +2 -0
- package/dist/Toast-CUHmqnRs.cjs.map +1 -0
- package/dist/{Toast-BFQrI1bB.js → Toast-PqPYiAd5.js} +29 -28
- package/dist/Toast-PqPYiAd5.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +37 -37
- 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 +1 -0
- package/dist/src/components/accordion/index.d.ts +2 -4
- package/dist/src/components/actionmodal/index.d.ts +1 -2
- package/dist/src/components/button/Button.d.ts +1 -1
- package/dist/src/components/button/LoadingDots.d.ts +1 -1
- package/dist/src/components/button/index.d.ts +2 -4
- package/dist/src/components/carousel/Carousel.d.ts +1 -1
- package/dist/src/components/carousel/hooks.d.ts +1 -0
- package/dist/src/components/carousel/index.d.ts +1 -2
- package/dist/src/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/src/components/checkbox/index.d.ts +1 -1
- package/dist/src/components/clickable/Clickable.d.ts +3 -3
- package/dist/src/components/clickable/index.d.ts +1 -1
- package/dist/src/components/input/Input.d.ts +2 -3
- package/dist/src/components/input/index.d.ts +1 -1
- package/dist/src/components/pagination/Pagination.d.ts +2 -3
- package/dist/src/components/pagination/index.d.ts +1 -1
- package/dist/src/components/panel/Panel.d.ts +1 -1
- package/dist/src/components/panel/index.d.ts +1 -3
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
- package/dist/src/components/scroll-area/ScrollArea.d.ts +1 -1
- package/dist/src/components/scroll-area/hooks.d.ts +1 -0
- package/dist/src/components/scroll-area/index.d.ts +1 -2
- package/dist/src/components/select/Select.d.ts +1 -1
- package/dist/src/components/select/index.d.ts +1 -2
- package/dist/src/components/separator/Separator.d.ts +1 -1
- package/dist/src/components/separator/index.d.ts +1 -2
- package/dist/src/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/src/components/skeleton/index.d.ts +1 -1
- package/dist/src/components/slider/Slider.d.ts +1 -1
- package/dist/src/components/slider/index.d.ts +1 -2
- package/dist/src/components/tabs/TabsContent.d.ts +1 -0
- package/dist/src/components/tabs/TabsContext.d.ts +1 -0
- package/dist/src/components/tabs/TabsList.d.ts +1 -0
- package/dist/src/components/tabs/TabsTrigger.d.ts +1 -0
- package/dist/src/components/textarea/Textarea.d.ts +2 -3
- package/dist/src/components/textarea/index.d.ts +1 -1
- package/dist/src/components/toast/Toast.d.ts +1 -0
- package/dist/src/components/toast/index.d.ts +1 -2
- package/dist/src/components/toggle/Toggle.d.ts +1 -1
- package/dist/src/components/toggle/index.d.ts +1 -2
- package/dist/src/components/tooltip/hooks.d.ts +1 -0
- package/dist/src/components/tooltip/index.d.ts +1 -2
- package/dist/src/hooks/useActionModal.d.ts +1 -0
- package/dist/src/hooks/useToast.d.ts +1 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/Toast-B-Zu6Kp_.cjs +0 -2
- package/dist/Toast-B-Zu6Kp_.cjs.map +0 -1
- package/dist/Toast-BFQrI1bB.js.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-CUHmqnRs.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-PqPYiAd5.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";
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export { Accordion } from './Accordion';
|
|
2
|
-
export { AccordionItem } from './AccordionItem';
|
|
3
|
-
export type { AccordionProps, AccordionOption } from './Accordion';
|
|
4
|
-
export type { AccordionItemProps } from './AccordionItem';
|
|
1
|
+
export { Accordion, type AccordionProps, type AccordionOption } from './Accordion';
|
|
2
|
+
export { AccordionItem, type AccordionItemProps } from './AccordionItem';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { ActionModal } from './ActionModal';
|
|
2
|
-
export type { ActionModalProps } from './ActionModal';
|
|
1
|
+
export { ActionModal, type ActionModalProps } from './ActionModal';
|
|
@@ -6,4 +6,4 @@ export interface ButtonProps extends Partial<ButtonVariants>, ButtonHTMLAttribut
|
|
|
6
6
|
linkTo?: string;
|
|
7
7
|
linkProps?: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export declare function Button({ variant, size, rounded, loading, linkTo, linkProps, type, className, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function LoadingDots(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export { default as ButtonLoadingDots } from './LoadingDots';
|
|
4
|
-
export { type ButtonRounded, type ButtonSize, type ButtonVariants } from './variants';
|
|
1
|
+
export { Button, type ButtonProps } from './Button';
|
|
2
|
+
export { LoadingDots } from './LoadingDots';
|
|
@@ -43,4 +43,4 @@ export interface CarouselProps {
|
|
|
43
43
|
/** Gap between carousel items in pixels */
|
|
44
44
|
gap?: number;
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export declare 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;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { CarouselProps } from './Carousel';
|
|
1
|
+
export { Carousel, type CarouselProps } from './Carousel';
|
|
@@ -8,4 +8,4 @@ export interface CheckboxProps extends React.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
8
8
|
checked?: boolean;
|
|
9
9
|
onCheckedChange?: (checked: boolean) => void;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export declare function Checkbox({ ref, id, size, color, filled, rounded, checked, onCheckedChange, disabled, className, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ClickableProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onClick'> {
|
|
2
3
|
children: React.ReactNode;
|
|
3
4
|
linkTo?: React.HTMLProps<HTMLAnchorElement>['href'];
|
|
4
5
|
linkProps?: Omit<React.HTMLProps<HTMLAnchorElement>, 'href'>;
|
|
5
6
|
onButtonClick?: React.HTMLProps<HTMLButtonElement>['onClick'];
|
|
6
7
|
buttonProps?: Omit<React.HTMLProps<HTMLButtonElement>, 'onClick'>;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
-
export {};
|
|
9
|
+
export declare function Clickable({ children, className, linkTo, linkProps, onButtonClick, buttonProps, ...props }: ClickableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Clickable, type ClickableProps } from './Clickable';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import './styles.css';
|
|
3
3
|
import { InputVariants } from './variants';
|
|
4
|
-
interface InputProps extends Partial<InputVariants>, React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
export interface InputProps extends Partial<InputVariants>, React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
5
|
ref?: Ref<HTMLInputElement>;
|
|
6
6
|
displayOnlyMode?: boolean;
|
|
7
7
|
errorMessage?: string;
|
|
8
8
|
successMessage?: string;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
10
|
+
export declare function Input({ variant, rounded, displayOnlyMode, errorMessage, successMessage, type, className, ...rest }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Input, type InputProps } from './Input';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PaginationSize, PaginationVariant } from './variants';
|
|
3
|
-
interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/** The current page number (1-indexed) */
|
|
5
5
|
page: number;
|
|
6
6
|
/** Total number of pages. Use Infinity for infinite pagination */
|
|
@@ -20,5 +20,4 @@ interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
20
20
|
/** Additional class names for the button elements */
|
|
21
21
|
buttonsClassName?: string;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export {};
|
|
23
|
+
export declare function Pagination({ page, pageCount, maxVisiblePages, showFirstLast, onPageChange, size, variant, className, ref, buttonsClassName, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Pagination, type PaginationProps } from './Pagination';
|
|
@@ -33,4 +33,4 @@ export interface PanelProps {
|
|
|
33
33
|
* Panel component that slides in from the right side of the screen.
|
|
34
34
|
* Provides an overlay and slide-in animation for side content display.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export declare function Panel({ ref, id, isOpen, onClose, title, children, footer, size, className, overlayClassName, hideCloseButton, disableCloseOnOverlayClick, ariaLabelledBy, ariaDescribedBy, }: PanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -17,4 +17,4 @@ export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
17
17
|
/** Reference to the root element */
|
|
18
18
|
ref?: React.Ref<HTMLDivElement>;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export declare function ScrollArea({ className, thumbClassName, viewportClassName, scrollbarClassName, scrollbarThickness, children, id, ref, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { ScrollAreaProps } from './ScrollArea';
|
|
1
|
+
export { ScrollArea, type ScrollAreaProps } from './ScrollArea';
|
|
@@ -19,4 +19,4 @@ export interface SelectProps {
|
|
|
19
19
|
onSearch?: (searchTerm: string) => void;
|
|
20
20
|
searchPlaceholder?: string;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export declare function Select({ options, value, placeholder, searchable, disabled, clearable, size, className, triggerClassName, dropdownClassName, id, ref, onChange, onSearch, searchPlaceholder, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { SelectOption, SelectProps } from './Select';
|
|
1
|
+
export { Select, type SelectOption, type SelectProps } from './Select';
|
|
@@ -12,4 +12,4 @@ export interface SeparatorProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
12
12
|
decorative?: boolean;
|
|
13
13
|
thickness?: Thickness;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export declare function Separator({ orientation, decorative, thickness, className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { SeparatorProps } from './Separator';
|
|
1
|
+
export { Separator, type SeparatorProps } from './Separator';
|
|
@@ -10,4 +10,4 @@ export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, Ske
|
|
|
10
10
|
/** Ref to be passed to the skeleton element */
|
|
11
11
|
ref?: React.Ref<HTMLDivElement>;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare function Skeleton({ shape, lineSpacing, className, lines, animate, ref, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Skeleton, type SkeletonProps } from './Skeleton';
|
|
@@ -30,4 +30,4 @@ export interface SliderProps {
|
|
|
30
30
|
/** ARIA labelledby for accessibility */
|
|
31
31
|
ariaLabelledBy?: string;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export declare 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;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { SliderProps } from './Slider';
|
|
1
|
+
export { Slider, type SliderProps } from './Slider';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import './styles.css';
|
|
3
3
|
import { TextareaVariants } from './variants';
|
|
4
|
-
interface TextareaProps extends Partial<TextareaVariants>, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
export interface TextareaProps extends Partial<TextareaVariants>, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
5
5
|
ref?: Ref<HTMLTextAreaElement>;
|
|
6
6
|
displayOnlyMode?: boolean;
|
|
7
7
|
errorMessage?: string;
|
|
@@ -10,5 +10,4 @@ interface TextareaProps extends Partial<TextareaVariants>, React.TextareaHTMLAtt
|
|
|
10
10
|
autoExpand?: boolean;
|
|
11
11
|
characterLimit?: number;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export {};
|
|
13
|
+
export declare function Textarea({ variant, rounded, displayOnlyMode, errorMessage, successMessage, hideResizeHandle, autoExpand, characterLimit, className, ...rest }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Textarea, type TextareaProps } from './Textarea';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { Toast } from './Toast';
|
|
2
|
-
export type { ToastAction, ToastData, ToastType } from './Toast';
|
|
1
|
+
export { Toast, type ToastAction, type ToastData, type ToastType } from './Toast';
|
|
@@ -10,4 +10,4 @@ export interface ToggleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
10
10
|
thumbClassName?: string;
|
|
11
11
|
backgroundClassNames?: ToggleBackgroundClasses;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare function Toggle({ ref, id, size, variant, checked, onCheckedChange, disabled, className, thumbClassName, backgroundClassNames, ...props }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { ToggleProps } from './Toggle';
|
|
1
|
+
export { Toggle, type ToggleProps } from './Toggle';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { Tooltip } from './Tooltip';
|
|
2
|
-
export type { TooltipPlacement, TooltipProps } from './Tooltip';
|
|
1
|
+
export { Tooltip, type TooltipPlacement, type TooltipProps } from './Tooltip';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moondreamsdev/dreamer-ui",
|
|
3
|
-
"version": "1.7.7-test.
|
|
3
|
+
"version": "1.7.7-test.22",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"require": "./dist/providers.js"
|
|
38
38
|
},
|
|
39
39
|
"./symbols": {
|
|
40
|
-
"types": "./dist/src/symbols/index.d.
|
|
40
|
+
"types": "./dist/src/symbols/index.d.ts",
|
|
41
41
|
"import": "./dist/symbols.esm.js",
|
|
42
42
|
"require": "./dist/symbols.js"
|
|
43
43
|
},
|
package/dist/Toast-B-Zu6Kp_.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),n=require("react"),I=require("react-dom"),g=require("./X-CgjeP2OI.cjs"),M=require("./utils.cjs.js");function h(...e){return e.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}function O({size:e=15,color:l="currentColor",className:s="inline",...r}){return t.jsx("svg",{...r,width:e,height:e,className:s,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function y(...e){return e.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}n.createContext(void 0);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);n.createContext(null);function B(){const[e,l]=n.useState(0);return n.useEffect(()=>{const s=setInterval(()=>{l(r=>(r+1)%3)},500);return()=>clearInterval(s)},[]),t.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(s=>t.jsx("div",{className:h("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",e===s&&"transform -translate-y-1")},s))})}const F={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},H={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},P={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},p={variant:"primary",size:"md",rounded:"md"};function D({variant:e=p.variant,size:l,rounded:s=p.rounded,loading:r,linkTo:a,linkProps:i,type:o="button",className:c,...d}){let u;e==="link"&&!l?u="fitted":u=l||p.size;const m=h("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",F[e],H[u],P[s],r&&"relative pointer-events-none",a&&"relative",c);return t.jsxs("button",{...d,role:a?"link":d.role,"aria-label":d["aria-label"]||(i==null?void 0:i["aria-label"]),"aria-description":d["aria-description"]||(i==null?void 0:i["aria-description"]),"aria-disabled":d.disabled||r,"aria-busy":r,type:o,className:m,children:[r&&t.jsx(B,{}),t.jsx("span",{className:h(r&&"invisible"),children:d.children}),a&&!d.disabled&&t.jsx("a",{...i,"aria-hidden":!0,href:a,rel:(i==null?void 0:i.rel)||"noreferrer",className:"absolute inset-0"})]})}function K(e){const[l,s]=n.useState(!1),[r,a]=n.useState(!1);return n.useEffect(()=>{e?(a(!0),setTimeout(()=>s(!0),10)):(s(!1),setTimeout(()=>a(!1),150))},[e]),{show:l,shouldRender:r}}function X(e,l){n.useEffect(()=>{const s=r=>{r.key==="Escape"&&e&&l()};return document.addEventListener("keydown",s),e&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow="auto"}},[e,l])}function J(e,l){const s=n.useRef(null),r=n.useCallback(()=>{const a=document.getElementById(e);if(!a)return;const i=a.querySelectorAll('[data-modal-action="true"]');if(i.length>0){i[0].focus();return}const o=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(o.length>0){const c=Array.from(o).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}o[0].focus();return}a.focus()},[e]);n.useEffect(()=>(l&&(s.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",s.current instanceof HTMLElement&&s.current.focus()}),[l,r])}function V({id:e,isOpen:l,onClose:s,title:r,children:a,contentOnly:i=!1,className:o,overlayClassName:c,hideCloseButton:d=!1,actions:u=[],disableCloseOnOverlayClick:m=!1,ariaLabelledBy:f,ariaDescribedBy:x}){const b=n.useId(),j=e||`modal-${b}`,C=e?`${e}-title`:`modal-title-${b}`,{show:k,shouldRender:v}=K(l);if(J(j,v),X(v,s),!v)return null;const E=()=>r?n.isValidElement(r)?t.jsx("div",{className:"mb-4",children:r}):t.jsx("h2",{className:"mb-4 text-xl font-semibold",id:C,children:r}):null,T=()=>u.length===0?null:t.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:u.map((z,L)=>{const{label:q,className:S,...A}=z;return t.jsx(D,{className:S,type:"button",...A,"data-modal-action":"true",children:q},L)})});return t.jsx(t.Fragment,{children:I.createPortal(t.jsx("div",{"aria-labelledby":f??r?C:void 0,"aria-describedby":x,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:t.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[t.jsx("div",{className:y("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{m||s()}}),i&&t.jsx("div",{className:y("relative w-fit",o),children:a}),!i&&t.jsxs("div",{id:j,tabIndex:-1,className:y("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",k?"opacity-100 scale-100":"opacity-0 scale-90",o),children:[!d&&t.jsx("button",{type:"button",onClick:s,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:t.jsx(O,{size:18})}),E(),a,T()]})]})}),document.body)})}function Y({type:e,message:l,cancelText:s,confirmText:r,onConfirm:a,onClose:i,destructive:o=!1,title:c,...d}){const u=n.useMemo(()=>e==="confirm"?{confirm:r||"Confirm",cancel:s||"Cancel",defaultTitle:c||"Confirm Action"}:{confirm:r||"OK",cancel:null,defaultTitle:c||"Alert"},[e,r,c,s]),m=n.useMemo(()=>[...u.cancel?[{label:u.cancel,variant:"secondary",onClick:i}]:[],{label:u.confirm,variant:o?"destructive":"primary",onClick:()=>{a==null||a(),i()}}],[u,o,a,i]);return t.jsx(V,{...d,title:c||u.defaultTitle,onClose:i,actions:m,disableCloseOnOverlayClick:e==="confirm",hideCloseButton:e==="confirm",children:typeof l=="string"?t.jsx("p",{className:"text-sm",children:l}):l})}const N=n.createContext(null),Z=()=>{const e=n.useContext(N);if(!e)throw new Error("Tabs components must be used within a Tabs component");return e},w={info:{className:"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",icon:t.jsx(g.InfoCircled,{size:20})},warning:{className:"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",icon:t.jsx(g.ExclamationTriangle,{size:20})},error:{className:"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",icon:t.jsx(g.CrossCircled,{size:20})}};function G({id:e,title:l,description:s,type:r="info",action:a,duration:i=5e3,onRemove:o,customTypes:c,customComponent:d}){const[u,m]=n.useState(!1),f=n.useCallback(()=>{m(!0),setTimeout(()=>{o==null||o(e)},150)},[e,o]);if(n.useEffect(()=>{if(i>0){const b=setTimeout(()=>{f()},i);return()=>clearTimeout(b)}},[i,e,o,f]),d)return t.jsx(d,{id:e,title:l,description:s,type:r,action:a,duration:i,onRemove:o});const x=(c==null?void 0:c[r])||w[r]||w.info;return t.jsxs("div",{role:r==="error"?"alert":"status","aria-live":r==="error"?void 0:"polite",className:M.join("relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",a&&"pb-3",x.className,u?"opacity-0 translate-x-full":"opacity-100 translate-x-0"),children:[t.jsx("div",{className:"flex-shrink-0 mr-3",children:x.icon}),t.jsxs("div",{className:"flex-grow min-w-0",children:[t.jsx("div",{className:"font-medium text-sm leading-5",children:l}),s&&t.jsx("div",{className:"mt-1 text-sm opacity-90 leading-5",children:s}),a&&t.jsx("div",{className:"mt-1.5",children:t.jsx("button",{onClick:a.onClick,className:"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",children:a.label})})]}),t.jsx("button",{onClick:f,className:"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",children:t.jsx(g.X,{size:16})})]})}exports.ActionModal=Y;exports.TabsContext=N;exports.Toast=G;exports.n=h;exports.useTabsContext=Z;
|
|
2
|
-
//# sourceMappingURL=Toast-B-Zu6Kp_.cjs.map
|