@clicktap/ui 0.12.7 → 0.12.9
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/components/Accordion/Accordion/index.js +1 -0
- package/components/Accordion/Accordion.d.ts +3 -0
- package/components/Accordion/index.d.ts +3 -0
- package/components/Accordion/index.js +1 -0
- package/components/Avatar/Avatar/index.js +1 -0
- package/components/Avatar/Avatar.d.ts +3 -0
- package/components/Avatar/Avatar.stories.d.ts +13 -0
- package/components/Avatar/Avatar.types.d.ts +2 -0
- package/components/Avatar/AvatarGroup/AvatarGroup/index.js +1 -0
- package/components/Avatar/AvatarGroup/AvatarGroup.d.ts +4 -0
- package/components/Avatar/AvatarGroup/AvatarGroup.types.d.ts +4 -0
- package/components/Avatar/index.d.ts +4 -0
- package/components/Avatar/index.js +1 -0
- package/components/Badge/Badge/index.js +1 -0
- package/components/Badge/Badge.d.ts +3 -0
- package/components/Badge/Badge.stories.d.ts +8 -0
- package/components/Badge/Badge.types.d.ts +2 -0
- package/components/Badge/index.d.ts +2 -0
- package/components/Badge/index.js +1 -0
- package/components/Breadcrumbs/BreadcrumbEllipsis/index.js +1 -0
- package/components/Breadcrumbs/BreadcrumbEllipsis.d.ts +3 -0
- package/components/Breadcrumbs/BreadcrumbEllipsis.types.d.ts +2 -0
- package/components/Breadcrumbs/BreadcrumbItem/index.js +1 -0
- package/components/Breadcrumbs/BreadcrumbItem.d.ts +3 -0
- package/components/Breadcrumbs/BreadcrumbItem.types.d.ts +2 -0
- package/components/Breadcrumbs/BreadcrumbLink/index.js +1 -0
- package/components/Breadcrumbs/BreadcrumbLink.d.ts +3 -0
- package/components/Breadcrumbs/BreadcrumbLink.types.d.ts +2 -0
- package/components/Breadcrumbs/BreadcrumbSeparator/index.js +1 -0
- package/components/Breadcrumbs/BreadcrumbSeparator.d.ts +3 -0
- package/components/Breadcrumbs/BreadcrumbSeparator.types.d.ts +6 -0
- package/components/Breadcrumbs/Breadcrumbs/index.js +1 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/components/Breadcrumbs/Breadcrumbs.types.d.ts +2 -0
- package/components/Breadcrumbs/index.d.ts +10 -0
- package/components/Breadcrumbs/index.js +1 -0
- package/components/Button/Button/index.js +1 -0
- package/components/Button/Button.d.ts +7 -0
- package/components/Button/Button.types.d.ts +6 -0
- package/components/Button/index.d.ts +2 -0
- package/components/Button/index.js +1 -0
- package/components/Card/Card/index.js +1 -0
- package/components/Card/Card.d.ts +3 -0
- package/components/Card/Card.types.d.ts +2 -0
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.js +1 -0
- package/components/Checkbox/Checkbox/index.js +1 -0
- package/components/Checkbox/Checkbox.d.ts +11 -0
- package/components/Checkbox/Checkbox.types.d.ts +10 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox/index.js +1 -0
- package/components/Collapsible/Collapsible/index.js +1 -0
- package/components/Collapsible/Collapsible.d.ts +3 -0
- package/components/Collapsible/Collapsible.types.d.ts +2 -0
- package/components/Collapsible/CollapsibleTrigger/index.js +1 -0
- package/components/Collapsible/CollapsibleTrigger.d.ts +5 -0
- package/components/Collapsible/CollapsibleTrigger.types.d.ts +12 -0
- package/components/Collapsible/index.d.ts +4 -0
- package/components/Collapsible/index.js +1 -0
- package/components/Container/Container/index.js +1 -0
- package/components/Container/Container.d.ts +5 -0
- package/components/Container/Container.types.d.ts +2 -0
- package/components/Container/index.d.ts +2 -0
- package/components/Container/index.js +1 -0
- package/components/ContextMenu/ContextMenu/index.js +1 -0
- package/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/components/ContextMenu/ContextMenu.types.d.ts +15 -0
- package/components/ContextMenu/index.d.ts +2 -0
- package/components/ContextMenu/index.js +1 -0
- package/components/CreditCardExpirationInput/CreditCardExpirationInput/index.js +1 -0
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.d.ts +12 -0
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.types.d.ts +9 -0
- package/components/CreditCardExpirationInput/index.d.ts +2 -0
- package/components/CreditCardExpirationInput/index.js +1 -0
- package/components/CreditCardInput/CreditCardInput/index.js +1 -0
- package/components/CreditCardInput/CreditCardInput.d.ts +14 -0
- package/components/CreditCardInput/CreditCardInput.types.d.ts +11 -0
- package/components/CreditCardInput/index.d.ts +2 -0
- package/components/CreditCardInput/index.js +1 -0
- package/components/DateInput/DateInput/index.js +1 -0
- package/components/DateInput/DateInput.d.ts +11 -0
- package/components/DateInput/DateInput.types.d.ts +8 -0
- package/components/DateInput/index.d.ts +2 -0
- package/components/DateInput/index.js +1 -0
- package/components/Dialog/Dialog/index.js +1 -0
- package/components/Dialog/Dialog.d.ts +10 -0
- package/components/Dialog/Dialog.types.d.ts +8 -0
- package/components/Dialog/index.d.ts +2 -0
- package/components/Dialog/index.js +1 -0
- package/components/DialogTrigger/DialogTrigger/index.js +1 -0
- package/components/DialogTrigger/DialogTrigger.d.ts +10 -0
- package/components/DialogTrigger/DialogTrigger.types.d.ts +4 -0
- package/components/DialogTrigger/index.d.ts +2 -0
- package/components/DialogTrigger/index.js +1 -0
- package/components/Divider/Divider/index.js +1 -0
- package/components/Divider/Divider.d.ts +3 -0
- package/components/Divider/Divider.stories.d.ts +6 -0
- package/components/Divider/Divider.types.d.ts +4 -0
- package/components/Divider/index.d.ts +2 -0
- package/components/Divider/index.js +1 -0
- package/components/Drawer/Drawer/index.js +1 -0
- package/components/Drawer/Drawer.d.ts +12 -0
- package/components/Drawer/Drawer.types.d.ts +10 -0
- package/components/Drawer/index.d.ts +2 -0
- package/components/Drawer/index.js +1 -0
- package/components/Input/Input/index.js +1 -0
- package/components/Input/Input.d.ts +12 -0
- package/components/Input/Input.types.d.ts +9 -0
- package/components/Input/index.d.ts +2 -0
- package/components/Input/index.js +1 -0
- package/components/Link/Link/index.js +1 -0
- package/components/Link/Link.d.ts +3 -0
- package/components/Link/Link.stories.d.ts +6 -0
- package/components/Link/Link.types.d.ts +2 -0
- package/components/Link/index.d.ts +2 -0
- package/components/Link/index.js +1 -0
- package/components/Loader/CircularEasing/index.js +1 -0
- package/components/Loader/CircularEasing.d.ts +3 -0
- package/components/Loader/CircularEasing.types.d.ts +7 -0
- package/components/Loader/Pulse/index.js +1 -0
- package/components/Loader/Pulse.d.ts +8 -0
- package/components/Loader/Pulse.types.d.ts +4 -0
- package/components/Loader/index.d.ts +4 -0
- package/components/Loader/index.js +1 -0
- package/components/Meter/Meter/index.js +1 -0
- package/components/Meter/Meter.d.ts +10 -0
- package/components/Meter/Meter.stories.d.ts +6 -0
- package/components/Meter/Meter.types.d.ts +7 -0
- package/components/Meter/index.d.ts +2 -0
- package/components/Meter/index.js +1 -0
- package/components/Modal/Modal/index.js +1 -0
- package/components/Modal/Modal.d.ts +3 -0
- package/components/Modal/Modal.types.d.ts +5 -0
- package/components/Modal/index.d.ts +2 -0
- package/components/Modal/index.js +1 -0
- package/components/ModalOverlay/ModalOverlay/index.js +1 -0
- package/components/ModalOverlay/ModalOverlay.d.ts +10 -0
- package/components/ModalOverlay/ModalOverlay.types.d.ts +14 -0
- package/components/ModalOverlay/index.d.ts +2 -0
- package/components/ModalOverlay/index.js +1 -0
- package/components/NumberInput/NumberInput/index.js +1 -0
- package/components/NumberInput/NumberInput.d.ts +15 -0
- package/components/NumberInput/NumberInput.types.d.ts +13 -0
- package/components/NumberInput/index.d.ts +2 -0
- package/components/NumberInput/index.js +1 -0
- package/components/PinInput/PinInput/index.js +1 -0
- package/components/PinInput/PinInput.d.ts +20 -0
- package/components/PinInput/PinInput.types.d.ts +17 -0
- package/components/PinInput/index.d.ts +2 -0
- package/components/PinInput/index.js +1 -0
- package/components/Progressbar/CircularProgressbar/index.js +1 -0
- package/components/Progressbar/CircularProgressbar.d.ts +3 -0
- package/components/Progressbar/CircularProgressbar.types.d.ts +9 -0
- package/components/Progressbar/LinearProgressbar/index.js +1 -0
- package/components/Progressbar/LinearProgressbar.d.ts +3 -0
- package/components/Progressbar/LinearProgressbar.types.d.ts +8 -0
- package/components/Progressbar/index.d.ts +4 -0
- package/components/Progressbar/index.js +1 -0
- package/components/Radio/Radio/index.js +1 -0
- package/components/Radio/Radio.d.ts +10 -0
- package/components/Radio/Radio.types.d.ts +11 -0
- package/components/Radio/index.d.ts +2 -0
- package/components/Radio/index.js +1 -0
- package/components/Select/Option/index.js +1 -0
- package/components/Select/Option.d.ts +3 -0
- package/components/Select/Option.types.d.ts +2 -0
- package/components/Select/Select/index.js +1 -0
- package/components/Select/Select.d.ts +20 -0
- package/components/Select/Select.types.d.ts +21 -0
- package/components/Select/index.d.ts +4 -0
- package/components/Select/index.js +1 -0
- package/components/Slider/Slider/index.js +1 -0
- package/components/Slider/Slider.d.ts +11 -0
- package/components/Slider/Slider.types.d.ts +8 -0
- package/components/Slider/index.d.ts +2 -0
- package/components/Slider/index.js +1 -0
- package/components/Switch/Switch/index.js +1 -0
- package/components/Switch/Switch.d.ts +11 -0
- package/components/Switch/Switch.types.d.ts +3 -0
- package/components/Switch/index.d.ts +2 -0
- package/components/Switch/index.js +1 -0
- package/components/Tabs/Tab/index.js +1 -0
- package/components/Tabs/Tab.d.ts +15 -0
- package/components/Tabs/Tab.types.d.ts +5 -0
- package/components/Tabs/TabList/index.js +1 -0
- package/components/Tabs/TabList.d.ts +3 -0
- package/components/Tabs/TabList.types.d.ts +10 -0
- package/components/Tabs/TabPanel/index.js +1 -0
- package/components/Tabs/TabPanel.d.ts +3 -0
- package/components/Tabs/TabPanel.types.d.ts +2 -0
- package/components/Tabs/Tabs/index.js +1 -0
- package/components/Tabs/Tabs.d.ts +5 -0
- package/components/Tabs/Tabs.types.d.ts +2 -0
- package/components/Tabs/index.d.ts +8 -0
- package/components/Tabs/index.js +1 -0
- package/components/TimeInput/TimeInput/index.js +1 -0
- package/components/TimeInput/TimeInput.d.ts +11 -0
- package/components/TimeInput/TimeInput.stories.d.ts +6 -0
- package/components/TimeInput/TimeInput.types.d.ts +8 -0
- package/components/TimeInput/index.d.ts +2 -0
- package/components/TimeInput/index.js +1 -0
- package/components/ToggleButton/ToggleButton/index.js +1 -0
- package/components/ToggleButton/ToggleButton.d.ts +3 -0
- package/components/ToggleButton/ToggleButton.stories.d.ts +6 -0
- package/components/ToggleButton/ToggleButton.types.d.ts +5 -0
- package/components/ToggleButton/index.d.ts +2 -0
- package/components/ToggleButton/index.js +1 -0
- package/components/Tooltip/Tooltip/index.js +1 -0
- package/components/Tooltip/Tooltip.d.ts +3 -0
- package/components/Tooltip/Tooltip.types.d.ts +2 -0
- package/components/Tooltip/index.d.ts +2 -0
- package/components/Tooltip/index.js +1 -0
- package/hooks/useEnterExitAnimation/index.js +1 -0
- package/hooks/useEnterExitAnimation.d.ts +5 -0
- package/package.json +13 -32
- package/types/SlotsToClasses/index.js +1 -0
- package/types/SlotsToClasses.d.ts +4 -0
- package/utils/cn/index.js +1 -0
- package/utils/cn.d.ts +3 -0
- package/utils/defaultTheme/index.js +1 -0
- package/utils/defaultTheme.d.ts +501 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { DialogTriggerProps } from 'react-aria-components';
|
|
3
|
+
import { DriverAnimationState } from './DialogTrigger.types';
|
|
4
|
+
export declare const useDialogTrigger: () => {
|
|
5
|
+
animation: DriverAnimationState;
|
|
6
|
+
setAnimation: Dispatch<SetStateAction<DriverAnimationState>>;
|
|
7
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function DialogTrigger(props: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default DialogTrigger;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DialogTriggerProps as UIDialogTriggerProps } from 'react-aria-components';
|
|
2
|
+
/** @todo this feels like it should be renamed, maybe moved to modal directly */
|
|
3
|
+
export type DriverAnimationState = 'unmounted' | 'visible' | 'hidden';
|
|
4
|
+
export type DialogTriggerProps = UIDialogTriggerProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DialogTrigger as e,useDialogTrigger as i}from"./DialogTrigger/index.js";export{e as DialogTrigger,i as useDialogTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useSeparator as n}from"react-aria";import{cn as m}from"../../../utils/cn/index.js";function p({orientation:a="horizontal",className:t,...r}){const{separatorProps:i}=n({...r,orientation:a}),o={...r,...i};return e("div",{...o,className:m("bg-slate-200",["w-full","h-px","my-4","mx-0"],["aria-[orientation=vertical]:w-px","aria-[orientation=vertical]:h-auto","aria-[orientation=vertical]:my-0","aria-[orientation=vertical]:mx-4"],t)})}export{p as Divider,p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Divider as i}from"./Divider/index.js";export{i as Divider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{forwardRef as s}from"react";import{Dialog as n}from"react-aria-components";import{motion as d}from"framer-motion";import{cn as m}from"../../../utils/cn/index.js";const l={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},b=s(({style:t,size:r="20rem",...e},a)=>{const o=typeof t=="function"?t(e):{...t,"--drawer-size":`${r}`};return i(n,{...e,ref:a,style:o})}),h=d.create(b);function p({direction:t="right",children:r,className:e,animationVariants:a,...o}){return i(h,{className:m("fixed p-8 outline-0 bg-white","border-solid border-slate-200","max-w-full max-h-[var(--visual-viewport-height)]",t==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",t==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e),"data-direction":t,variants:a||l[t],...o,children:r})}p.defaultProps={direction:"right",key:void 0,style:void 0,animationVariants:void 0,size:"20rem"};export{p as Drawer,p as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DrawerProps } from './Drawer.types';
|
|
2
|
+
export declare function Drawer({ direction, children, className, animationVariants, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Drawer {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
direction: string;
|
|
6
|
+
key: undefined;
|
|
7
|
+
style: undefined;
|
|
8
|
+
animationVariants: undefined;
|
|
9
|
+
size: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default Drawer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Key } from 'react';
|
|
2
|
+
import { DialogProps } from 'react-aria-components';
|
|
3
|
+
import { MotionStyle, Variants } from 'framer-motion';
|
|
4
|
+
export type DrawerProps = DialogProps & {
|
|
5
|
+
direction?: 'top' | 'right' | 'bottom' | 'left';
|
|
6
|
+
key?: Key;
|
|
7
|
+
style?: MotionStyle;
|
|
8
|
+
animationVariants?: Variants;
|
|
9
|
+
size?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Drawer as o}from"./Drawer/index.js";export{o as Drawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as x,jsx as t}from"react/jsx-runtime";import{TextField as f,Label as b,Input as p,Text as v,FieldError as h}from"react-aria-components";import{cn as r}from"../../../utils/cn/index.js";function a({label:d,description:o,errorMessage:i,placeholder:l,className:n,classNames:e,...u}){return x(f,{className:r("flex flex-col w-full text-slate-900",n),...u,children:[t(b,{className:r("flex text-slate-500 text-sm",e==null?void 0:e.label),children:d}),t(p,{placeholder:l,className:r("border-solid border border-slate-300 rounded-md","text-sm text-slate-900 placeholder-slate-400","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-slate-400","focus:outline-2 focus:outline focus:outline-slate-200 focus:border-slate-400","disabled:border-slate-200 disabled:bg-slate-100","invalid:border-red-500 invalid:bg-red-100 invalid:text-red-600","invalid:hover:border-red-600 invalid:focus:border-red-600 invalid:focus:outline-red-200",e==null?void 0:e.input)}),o&&t(v,{className:r("flex text-slate-500 text-sm",e==null?void 0:e.description),slot:"description",children:o}),t(h,{className:r("flex text-red-500 text-sm",e==null?void 0:e.error),children:i})]})}a.defaultProps={label:void 0,description:void 0,errorMessage:void 0,placeholder:void 0,classNames:void 0};export{a as Input,a as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputProps } from './Input.types';
|
|
2
|
+
export declare function Input({ label, description, errorMessage, placeholder, className, classNames, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Input {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
label: undefined;
|
|
6
|
+
description: undefined;
|
|
7
|
+
errorMessage: undefined;
|
|
8
|
+
placeholder: undefined;
|
|
9
|
+
classNames: undefined;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default Input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextFieldProps, ValidationResult } from 'react-aria-components';
|
|
2
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
3
|
+
export interface InputProps extends TextFieldProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
classNames?: SlotsToClasses<'label' | 'input' | 'description' | 'error'>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as r}from"./Input/index.js";export{r as Input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Link as s}from"react-aria-components";import{cn as i}from"../../../utils/cn/index.js";function u({children:t,isDisabled:e,className:r,...a}){return o(s,{...a,isDisabled:e,className:i("cursor-pointer","text-slate-500","no-underline","transition-colors duration-300","hover:text-slate-800",['data-[disabled="true"]:cursor-default','data-[disabled="true"]:text-slate-300','data-[disabled="true"]:hover:text-slate-300'],r),children:t})}export{u as Link,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Link as e}from"./Link/index.js";export{e as Link};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{motion as r}from"framer-motion";import{cn as t}from"../../../utils/cn/index.js";function d({width:a,stroke:i,strokeLinecap:s="round",strokeWidth:n=5,className:o,style:l,...c}){return e("div",{style:{"--circularWidth":`${a}px`,...l},...c,className:t("relative","m-0","w-[--circularWidth]","aspect-square",o),children:e(r.svg,{animate:{transform:"rotate(360deg)",transition:{repeat:1/0,duration:2,ease:"linear"}},viewBox:"25 25 50 50",className:t("w-full h-full","absolute inset-x-0 inset-y-0","origin-center","m-auto"),children:e(r.circle,{animate:{strokeDasharray:["1, 200","89, 200","89, 200"],strokeDashoffset:[0,-35,-124],transition:{repeat:1/0,duration:1.5,ease:"easeInOut"}},className:"path",cx:"50",cy:"50",fill:"none",r:"20",strokeDasharray:"1, 200",strokeDashoffset:"0",stroke:i,strokeLinecap:s,strokeMiterlimit:"10",strokeWidth:n})})})}export{d as CircularEasing,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{motion as i}from"framer-motion";import{cn as n}from"../../../utils/cn/index.js";function e({classNames:r}){return t("span",{className:n(r==null?void 0:r.base),children:Array.from(new Array(3)).map((a,o)=>t(i.div,{animate:{opacity:[1,1,.7,1,1],transform:["scale(1)","scale(1)","scale(0.1)","scale(1)","scale(1)"],transition:{repeat:1/0,duration:.75,delay:o*.1}},className:n("bg-slate-300","inline-block","w-2","h-2","m-0.5","rounded-lg",r==null?void 0:r.dot)},o))})}e.defaultProps={classNames:void 0};export{e as Pulse,e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CircularEasing as e}from"./CircularEasing/index.js";import{Pulse as f}from"./Pulse/index.js";export{e as CircularEasing,f as Pulse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i,jsxs as d,Fragment as b}from"react/jsx-runtime";import{Meter as g,Label as j}from"react-aria-components";import{motion as w}from"framer-motion";import{cn as t}from"../../../utils/cn/index.js";function y({label:o,showValue:n=!0,value:p=0,minValue:f=0,maxValue:u=100,formatOptions:h={style:"percent"},className:l,classNames:r,...v}){return i(g,{className:t("flex flex-col gap-2",l),value:p,minValue:f,maxValue:u,formatOptions:h,...v,children:({percentage:e,valueText:x})=>d(b,{children:[(o||n)&&d("div",{className:t("flex justify-between gap-4",r==null?void 0:r.labelWrapper),children:[o&&i(j,{className:t("text-sm",r==null?void 0:r.label),children:o}),n&&i("span",{className:t("text-sm tabular-nums ml-auto",r==null?void 0:r.value),children:x})]}),i("div",{className:t("h-2.5 rounded-md bg-slate-300 forced-color-adjust-none overflow-hidden",r==null?void 0:r.trackWrapepr),children:i(w.div,{className:t("h-full bg-slate-800",r==null?void 0:r.track),initial:{width:`${e}%`},animate:{width:`${e}%`},transition:{type:"spring",bounce:0}})})]})})}y.defaultProps={showValue:void 0,label:void 0,classNames:void 0};export{y as Meter,y as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MeterProps } from './Meter.types';
|
|
2
|
+
export declare function Meter({ label, showValue, value, minValue, maxValue, formatOptions, className, classNames, ...props }: MeterProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Meter {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
showValue: undefined;
|
|
6
|
+
label: undefined;
|
|
7
|
+
classNames: undefined;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default Meter;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MeterProps as AriaMeterProps } from 'react-aria-components';
|
|
2
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
3
|
+
export type MeterProps = AriaMeterProps & {
|
|
4
|
+
label?: string;
|
|
5
|
+
showValue?: boolean;
|
|
6
|
+
classNames?: SlotsToClasses<'label' | 'value' | 'labelWrapper' | 'track' | 'trackWrapepr'>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Meter as o}from"./Meter/index.js";export{o as Meter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Modal as m}from"react-aria-components";import{cn as s}from"../../../utils/cn/index.js";function i({children:o,className:a,...r}){return t(m,{...r,className:s("absolute inset-1/2",a),children:o})}export{i as Modal,i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Modal as a}from"./Modal/index.js";export{a as Modal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{forwardRef as f,useId as u,createElement as v}from"react";import{ModalOverlay as p}from"react-aria-components";import{motion as y,AnimatePresence as h}from"framer-motion";import{useDialogTrigger as b}from"../../DialogTrigger/DialogTrigger/index.js";import{cn as x}from"../../../utils/cn/index.js";const M=f(({style:i,...e},t)=>{const n=typeof i=="function"?i(e):i;return o(p,{...e,ref:t,style:n})}),O=y.create(M);function r({animate:i,animation:e,setAnimation:t,className:n,animationVariants:d,children:l,...m}){const s=u();return v(O,{...m,key:s,isExiting:e==="hidden",onAnimationComplete:c=>{t(a=>c==="hidden"&&a==="hidden"?"unmounted":a)},variants:d||{hidden:{opacity:0,backdropFilter:"blur(0px)",transition:{delay:.08}},visible:{opacity:1,backdropFilter:"blur(8px)"}},initial:"hidden",animate:i,exit:"hidden",className:x("bg-black/30","fixed top-0 left-0","z-50","w-screen h-[var(--visual-viewport-height)]",n)},l)}function g(i){const{isOpen:e}=i,{animation:t,setAnimation:n}=b();return e!==void 0?o(h,{children:e&&o(r,{...i,animate:"visible",animation:t,setAnimation:n})}):o(r,{...i,animate:t,animation:t,setAnimation:n})}g.defaultProps={key:void 0,style:void 0,animationVariants:void 0};export{g as ModalOverlay,g as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalOverlayProps } from './ModalOverlay.types';
|
|
2
|
+
export declare function ModalOverlay(props: ModalOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace ModalOverlay {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
key: undefined;
|
|
6
|
+
style: undefined;
|
|
7
|
+
animationVariants: undefined;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default ModalOverlay;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Key, ReactNode } from 'react';
|
|
2
|
+
import { ModalOverlayProps as UiModalOverlayProps, ModalRenderProps } from 'react-aria-components';
|
|
3
|
+
import { MotionStyle, Variant } from 'framer-motion';
|
|
4
|
+
export interface ModalOverlayProps extends Omit<UiModalOverlayProps, 'children' | 'style'> {
|
|
5
|
+
key?: Key;
|
|
6
|
+
style?: MotionStyle;
|
|
7
|
+
animationVariants?: {
|
|
8
|
+
visible: Variant;
|
|
9
|
+
hidden: Variant;
|
|
10
|
+
};
|
|
11
|
+
children: ReactNode | ((values: ModalRenderProps & {
|
|
12
|
+
defaultChildren: ReactNode;
|
|
13
|
+
}) => ReactNode);
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ModalOverlay as a}from"./ModalOverlay/index.js";export{a as ModalOverlay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as b,jsx as r}from"react/jsx-runtime";import{NumberField as g,Label as x,Group as v,Button as p,Input as w,Text as k,FieldError as I}from"react-aria-components";import{cn as o}from"../../../utils/cn/index.js";const s=r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r("path",{d:"M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),y=r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r("path",{d:"M12 5V19M5 12H19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function j({label:a,description:d,errorMessage:h,isInvalid:i,isReadOnly:l,slots:t,className:f,classNames:e,...c}){const n=["group-hover:border-slate-400","group-disabled:border-slate-200","group-invalid:border-red-500 group-invalid:bg-red-100 group-invalid:text-red-600","group-invalid:group-hover:border-red-600","group-invalid:group-focus:border-red-600"],u=["flex items-center justify-center shrink-0","rounded-md border-solid border","font-semibold text-sm","w-10 h-10 py-0 px-0 cursor-pointer disabled:cursor-default","transition-all duration-200 ease-in-out","focus:outline-2 focus:outline focus:outline-slate-200 pressed:scale-95","bg-transparent hover:bg-transparent focus:bg-transparent disabled:bg-transparent","border-slate-300 hover:border-slate-400 focus:border-slate-400 disabled:border-slate-200","text-slate-900 disabled:text-slate-500","group-aria-readonly:bg-slate-100 group-aria-readonly:text-slate-500 group-aria-readonly:border-slate-200 group-aria-readonly:cursor-default"];return b(g,{isInvalid:i,isReadOnly:l,className:o("flex flex-col w-full",f),...c,children:[r(x,{className:o("flex text-slate-500 text-sm",e==null?void 0:e.label),children:a}),b(v,{isInvalid:i,"aria-readonly":l,className:o("flex rounded-md group","focus-within:outline-2 focus-within:outline focus-within:outline-slate-200","focus-within:invalid:outline-2 focus-within:invalid:outline focus-within:invalid:outline-slate-200","disabled:bg-slate-100",e==null?void 0:e.group),children:[r(p,{slot:"decrement",className:o("border-r-0 rounded-r-none",u,n,e==null?void 0:e.decrementBtn),children:t==null?void 0:t.decrementIcon}),r(w,{className:o("border-solid border border-slate-300","text-sm text-slate-900 placeholder-slate-400","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-slate-400","focus:outline-0 focus:border-slate-400","disabled:border-slate-200 disabled:bg-slate-100","invalid:border-red-500 invalid:bg-red-100 invalid:text-red-600","invalid:hover:border-red-600 invalid:focus:border-red-600",n,e==null?void 0:e.input)}),r(p,{slot:"increment",className:o("border-l-0 rounded-l-none",u,n,e==null?void 0:e.incrementBtn),children:t==null?void 0:t.incrementIcon})]}),d&&r(k,{className:o("flex text-slate-500 text-sm",e==null?void 0:e.description),slot:"description",children:d}),r(I,{className:o("flex text-red-500 text-sm",e==null?void 0:e.error),children:h})]})}j.defaultProps={label:void 0,description:void 0,errorMessage:void 0,classNames:void 0,slots:{decrementIcon:s,incrementIcon:y}};export{j as NumberInput,j as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NumberInputProps } from './NumberInput.types';
|
|
2
|
+
export declare function NumberInput({ label, description, errorMessage, isInvalid, isReadOnly, slots, className, classNames, ...props }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace NumberInput {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
label: undefined;
|
|
6
|
+
description: undefined;
|
|
7
|
+
errorMessage: undefined;
|
|
8
|
+
classNames: undefined;
|
|
9
|
+
slots: {
|
|
10
|
+
decrementIcon: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
incrementIcon: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default NumberInput;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { NumberFieldProps, ValidationResult } from 'react-aria-components';
|
|
3
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
4
|
+
export interface NumberInputProps extends NumberFieldProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
8
|
+
slots?: {
|
|
9
|
+
decrementIcon?: ReactNode;
|
|
10
|
+
incrementIcon?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
classNames?: SlotsToClasses<'label' | 'input' | 'description' | 'error' | 'incrementBtn' | 'decrementBtn' | 'group'>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NumberInput as m}from"./NumberInput/index.js";export{m as NumberInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as m,jsx as b}from"react/jsx-runtime";import{useState as P,useRef as G,useEffect as T}from"react";import{Group as J,Label as U,TextField as j,Input as z,Text as Z,FieldError as q}from"react-aria-components";import{cn as f}from"../../../utils/cn/index.js";function H({description:k,errorMessage:E,isDisabled:D=!1,isInvalid:v=!1,isMasked:K=!1,isRequired:A=!0,label:V,length:c=6,name:h,onChange:w,value:L="",type:$="numeric",validationBehavior:I="native",className:M,classNames:r,...R}){const[B,C]=P(L),[n,g]=P(Array(c).fill("")),a=G([]);T(()=>{a.current=a.current.slice(0,c)},[c]),T(()=>{const e=n.join("");C(e),w&&w(e)},[w,n]);const F=e=>{var l,o;const t=e.target.value,u=Number(e.target.getAttribute("data-pin-input-index"));t!==""&&u<n.length-1&&((o=(l=a.current)==null?void 0:l[u+1])==null||o.focus());const d=n.map((x,p)=>p===u?t:x);g(d)},S=e=>{var l,o,x,p;const t=Number(e.currentTarget.getAttribute("data-pin-input-index"));if(e.ctrlKey||e.metaKey)return;const u=["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Control","Alt","Meta","Shift","Tab","Enter","Escape"],d={alpha:/^[a-z]$/i,alphanumeric:/^[a-z0-9]$/i,numeric:/^[0-9]$/i};if(!e.key.match(d[$])&&!u.includes(e.key)&&e.preventDefault(),n[t]===""&&t>0&&e.key==="Backspace"){const s=n.map((i,y)=>y===t-1?"":i);g(s),(o=(l=a.current)==null?void 0:l[t-1])==null||o.focus(),e.preventDefault()}if(n[t]===""&&t<n.length-1&&e.key==="Delete"){const s=n.map((i,y)=>y===t+1?"":i);g(s),(p=(x=a.current)==null?void 0:x[t+1])==null||p.focus(),e.preventDefault()}},W=e=>{var p,s;const t=Number(e.currentTarget.getAttribute("data-pin-input-index"));e.preventDefault();const u=(p=e.clipboardData)==null?void 0:p.getData("text");if(!u)return;const d=u.split("").filter(i=>{switch($){case"alpha":return/^[a-zA-Z]$/.test(i);case"alphanumeric":return/^[a-z0-9]$/i.test(i);case"numeric":default:return/^[0-9]$/.test(i)}});if(d.length===0)return;const l=[...n];let o=t;for(let i=0;i<d.length&&t+i<c;i++)l[t+i]=d[i],o=t+i;g(l);const x=o+1<c?o+1:c-1;(s=a.current[x])==null||s.focus()};return m(J,{className:f("flex flex-wrap gap-2",M),"aria-label":V,...R,children:[b(U,{className:f("flex text-slate-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.label),children:V}),n.map((e,t)=>b(j,{className:f("flex flex-col w-full flex-1 text-slate-900",r==null?void 0:r.inputWrap),"aria-label":`Pin Input Digit ${t+1}`,isDisabled:D,isInvalid:v,isRequired:A,validationBehavior:I,children:b(z,{className:f("border-solid border border-slate-300 rounded-md","text-sm text-slate-900 placeholder-slate-400 text-center","h-10 px-2 py-0 m-0 w-full","bg-white","transition-all duration-200 ease-in-out","hover:border-slate-400","focus:outline-2 focus:outline focus:outline-slate-200 focus:border-slate-400","disabled:border-slate-200 disabled:bg-slate-100","invalid:border-red-500 invalid:bg-red-100 invalid:text-red-600","invalid:hover:border-red-600 invalid:focus:border-red-600 invalid:focus:outline-red-200",r==null?void 0:r.input),onChange:F,onKeyDown:S,onPaste:W,type:K?"password":"text",ref:u=>u?a.current[t]=u:null,value:e,maxLength:1,name:h&&`${h}-${t}`,"data-pin-input-index":t})},`pin-input-${t}`)),m(j,{className:f("flex flex-row flex-wrap grow shrink-0 basis-full",r==null?void 0:r.textWrap),"aria-label":"Pin Input",isDisabled:D,isInvalid:v,isRequired:A,validationBehavior:I,children:[h&&b(z,{type:"hidden",name:h,value:B}),k&&b(Z,{className:f("flex text-slate-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.description),slot:"description",children:k}),b(q,{className:f("flex text-red-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.error),children:E})]})]})}H.defaultProps={description:void 0,errorMessage:void 0,isMasked:!1,isRequired:!0,label:void 0,classNames:void 0,length:6,name:"",onChange:()=>{},value:"",type:"numeric",validationBehavior:"native"};export{H as PinInput,H as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PinInputProps } from './PinInput.types';
|
|
2
|
+
/** based on https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/src/pin-input/use-pin-input.ts */
|
|
3
|
+
export declare function PinInput({ description, errorMessage, isDisabled, isInvalid, isMasked, isRequired, label, length, name, onChange: controlledOnChange, value, type, validationBehavior, className, classNames, ...props }: PinInputProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace PinInput {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
description: undefined;
|
|
7
|
+
errorMessage: undefined;
|
|
8
|
+
isMasked: boolean;
|
|
9
|
+
isRequired: boolean;
|
|
10
|
+
label: undefined;
|
|
11
|
+
classNames: undefined;
|
|
12
|
+
length: number;
|
|
13
|
+
name: string;
|
|
14
|
+
onChange: () => void;
|
|
15
|
+
value: string;
|
|
16
|
+
type: string;
|
|
17
|
+
validationBehavior: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default PinInput;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GroupProps, ValidationResult } from 'react-aria-components';
|
|
2
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
3
|
+
/** @todo extend certain textfield props like name, validationBehavior and isRequired */
|
|
4
|
+
export interface PinInputProps extends GroupProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
7
|
+
label?: string;
|
|
8
|
+
length?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
onChange?: (...event: any[]) => void;
|
|
11
|
+
value?: string;
|
|
12
|
+
isMasked?: boolean;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
type?: 'alpha' | 'alphanumeric' | 'numeric';
|
|
15
|
+
validationBehavior?: 'native' | 'aria';
|
|
16
|
+
classNames?: SlotsToClasses<'label' | 'input' | 'description' | 'error' | 'inputWrap' | 'textWrap'>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PinInput as p}from"./PinInput/index.js";export{p as PinInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{ProgressBar as b,Label as g}from"react-aria-components";import{cn as t}from"../../../utils/cn/index.js";function $({label:a,value:x=0,showValue:h=!0,size:n=60,strokeWidth:i=6,className:u,classNames:r,...m}){const e=n/2,l=e-i,c=2*Math.PI*l;return o(b,{"aria-label":"Loading...",className:t("flex",u),...m,value:x,children:({percentage:d=0})=>f("div",{className:t("flex items-center flex-col",r==null?void 0:r.base),children:[o(g,{className:t("text-sm",r==null?void 0:r.label),children:a}),f("svg",{width:n,height:n,fill:"none",children:[o("circle",{className:t("stroke-slate-300"),cx:e,cy:e,r:l,strokeWidth:i}),o("circle",{className:t("stroke-slate-800 transition-stroke-dashoffset duration-500 ease-in-out"),cx:e,cy:e,r:l,strokeWidth:i,strokeDasharray:`${c} ${c}`,strokeDashoffset:(100-d)/100*c,strokeLinecap:"round",transform:`rotate(-90 ${e} ${e})`}),h&&f("text",{className:t("text-sm fill-slate-800",r==null?void 0:r.value),x:"50%",y:"50%",alignmentBaseline:"middle",textAnchor:"middle",children:[d,"%"]})]})]})})}export{$ as CircularProgressbar,$ as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CircularProgressbarProps } from './CircularProgressbar.types';
|
|
2
|
+
export declare function CircularProgressbar({ label, value, showValue, size, strokeWidth, className, classNames, ...props }: CircularProgressbarProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default CircularProgressbar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProgressBarProps } from 'react-aria-components';
|
|
2
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
3
|
+
export interface CircularProgressbarProps extends ProgressBarProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
showValue?: boolean;
|
|
6
|
+
size?: number;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
classNames?: SlotsToClasses<'label' | 'base' | 'value'>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as d,Fragment as w}from"react/jsx-runtime";import{ProgressBar as x,Label as l}from"react-aria-components";import{motion as g}from"framer-motion";import{cn as t}from"../../../utils/cn/index.js";function L({label:e,isIndeterminate:n,showValue:f=!0,width:h,className:u,classNames:r,...p}){return o(x,{style:{width:h||"100%"},className:t("overflow-hidden",u),...p,children:({percentage:i,valueText:b})=>d(w,{children:[d("div",{className:t("flex items-center justify-between gap-2 mb-1",r==null?void 0:r.labelWrapper),children:[o(l,{className:t("text-sm",r==null?void 0:r.label),children:e}),f&&o("span",{className:t("text-sm",r==null?void 0:r.value),children:b})]}),o("div",{className:t("overflow-hidden forced-color-adjust-none h-2.5 rounded will-change-transform bg-slate-300",r==null?void 0:r.trackWrapper),children:o(g.div,{style:{width:!n&&typeof i=="number"?`${i}%`:""},...n&&{animate:{x:["-100%","250px"]},transition:{repeat:1/0,duration:1.5}},className:t("h-full bg-slate-800 rounded transition-width duration-500 ease-in-out",{"w-1/2":n,"transition-none":n},r==null?void 0:r.track)})})]})})}export{L as LinearProgressbar,L as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LinearProgressbarProps } from './LinearProgressbar.types';
|
|
2
|
+
export declare function LinearProgressbar({ label, isIndeterminate, showValue, width, className, classNames, ...props }: LinearProgressbarProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default LinearProgressbar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProgressBarProps } from 'react-aria-components';
|
|
2
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
3
|
+
export interface LinearProgressbarProps extends ProgressBarProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
showValue?: boolean;
|
|
7
|
+
classNames?: SlotsToClasses<'label' | 'value' | 'labelWrapper' | 'track' | 'trackWrapper'>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CircularProgressbar as e}from"./CircularProgressbar/index.js";import{LinearProgressbar as s}from"./LinearProgressbar/index.js";export{e as CircularProgressbar,s as LinearProgressbar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as n,Fragment as v}from"react/jsx-runtime";import{Radio as b}from"react-aria-components";import{cn as i}from"../../../utils/cn/index.js";function c({control:d,classNames:a,...e}){return d?typeof d=="function"?d(e):d:t("div",{"data-hovered":e==null?void 0:e.isHovered,"data-focused":e==null?void 0:e.isFocused,"data-disabled":e==null?void 0:e.isDisabled,"data-invalid":e==null?void 0:e.isInvalid,"data-selected":e==null?void 0:e.isSelected,"data-pressed":e==null?void 0:e.isPressed,className:i("flex items-center justify-center w-6 h-6 border-solid border border-slate-300 ransition-all duration-300 ease rounded-full",'data-[hovered="true"]:border-slate-400','data-[focused="true"]:border-slate-400 data-[focused="true"]:outline-2 data-[focused="true"]:outline data-[focused="true"]:outline-slate-200','data-[disabled="true"]:border-slate-200 data-[disabled="true"]:bg-slate-100','data-[invalid="true"]:bg-red-100 data-[invalid="true"]:text-red-600 data-[invalid="true"]:border-red-500','data-[invalid="true"]:data-[disabled="true"]:border-red-200 data-[invalid="true"]:data-[disabled="true"]:bg-red-100','data-[invalid="true"]:data-[hovered="true"]:border-red-600','data-[invalid="true"]:data-[focused="true"]:border-red-600 data-[invalid="true"]:data-[focused="true"]:outline-red-200','data-[invalid="true"]:data-[selected="true"]:bg-red-100 data-[invalid="true"]:data-[selected="true"]:border-red-500','data-[invalid="true"]:data-[pressed="true"]:bg-red-600 data-[invalid="true"]:data-[pressed="true"]:border-red-600',a==null?void 0:a.control),...e,children:t("div",{"data-invalid":e==null?void 0:e.isInvalid,className:i('w-3 h-3 rounded-full bg-slate-900 opacity-0 transition-all duration-300 ease data-[invalid="true"]:bg-red-500',{"opacity-100":e==null?void 0:e.isSelected})})})}function f({children:d,slots:a,className:e,classNames:l,...u}){return t(b,{className:i("flex items-center gap-2 group","invalid:text-red-500 invalid:disabled:text-red-300","disabled:text-slate-400",e),...u,children:r=>n(v,{children:[t(c,{control:a==null?void 0:a.control,classNames:l,...r}),typeof d=="function"?d(r):d]})})}f.defaultProps={children:void 0,slots:void 0,classNames:void 0};export{f as Radio,f as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RadioProps } from './Radio.types';
|
|
2
|
+
export declare function Radio({ children, slots, className, classNames, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Radio {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
children: undefined;
|
|
6
|
+
slots: undefined;
|
|
7
|
+
classNames: undefined;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default Radio;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RadioRenderProps, RadioProps as UiRadioProps } from 'react-aria-components';
|
|
3
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
4
|
+
export interface RadioSlots {
|
|
5
|
+
control?: ReactNode | ((values: RadioRenderProps) => ReactNode);
|
|
6
|
+
}
|
|
7
|
+
export interface RadioProps extends UiRadioProps {
|
|
8
|
+
children?: ReactNode | ((values: RadioRenderProps) => ReactNode);
|
|
9
|
+
slots?: RadioSlots;
|
|
10
|
+
classNames?: SlotsToClasses<'control'>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Radio as a}from"./Radio/index.js";export{a as Radio};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ListBoxItem as d}from"react-aria-components";import{cn as s}from"../../../utils/cn/index.js";function n({className:e,...t}){return a(d,{...t,className:s("flex flex-auto items-center","rounded-md","p-2.5 mx-1.5","text-sm","cursor-default","outline-none","text-slate-900","transition-all ease-in-out duration-300","data-[hovered]:bg-slate-100 data-[hovered]:text-slate-900","data-[focused]:bg-slate-100 data-[hovered]:text-slate-900","data-[pressed]:bg-slate-200 data-[hovered]:text-slate-900","data-[selected]:bg-none data-[selected]:text-slate-900 data-[selected]:font-semibold data-[selected]:data-[focused]:bg-slate-100","data-[disabled]:bg-none data-[disabled]:text-slate-500",e)})}export{n as Option,n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as x,Fragment as L}from"react/jsx-runtime";import{Popover as O,ComboBox as P,Label as M,Input as S,Button as j,Text as A,FieldError as D,ListBox as E}from"react-aria-components";import{forwardRef as F,useState as v}from"react";import{motion as T}from"framer-motion";import{cn as o}from"../../../utils/cn/index.js";import{Pulse as R}from"../../Loader/Pulse/index.js";const U=F((i,d)=>e(O,{...i,ref:d})),W=T.create(U);function m({buttonIcon:i,...d}){return i?typeof i=="function"?i(d):i:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o("transition-all ease-in-out duration-200",d.isOpen?"rotate-180":"rotate-0"),children:e("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o(["stroke-slate-900",d.isDisabled&&"stroke-slate-400",d.isInvalid&&"stroke-red-500"])})})}function q({label:i,description:d,errorMessage:p,children:h,placeholder:g,key:w,isLoading:n,slots:r,popoverPortalContainer:c,popoverOffset:k,selectedKey:y,className:C,classNames:t,...l}){const[a,u]=v("unmounted"),[b,_]=v(!1);return e(P,{onOpenChange:()=>{u(a==="visible"?"hidden":"visible"),_(!b)},isDisabled:l.isDisabled||n,"data-has-value":!!y,...l,className:o("flex flex-col","w-full",C),children:B=>x(L,{children:[e(M,{className:o("flex","text-xs text-slate-500",t==null?void 0:t.label),children:i}),x("div",{className:o("flex","relative","w-full",t==null?void 0:t.comboBoxContainer),children:[e(S,{placeholder:g,className:o("border border-solid border-slate-300","text-sm text-slate-900","py-0 px-2","h-10 w-full","m-0","rounded-md","bg-white","transition-all ease-in-out duration-200","data-[hovered]:border-slate-400","data-[focused]:border-slate-400 data-[focused]:outline data-[focused]:outline-2 data-[focused]:outline-slate-200"," data-[disabled]:bg-slate-100 data-[disabled]:border-slate-300",n?"data-[disabled]:text-slate-900":"data-[disabled]:text-slate-500","data-[invalid]:border-red-500 data-[invalid]:bg-red-100 data-[invalid]:text-red-600","data-[invalid]:data-[hovered]:border-red-600","data-[invalid]:data-[focused]:border-red-600 data-[invalid]:data-[focused]:outline data-[invalid]:data-[focused]:outline-2 data-[invalid]:data-[focused]:outline-red-200","data-[invalid]:placeholder:text-slate-400",t==null?void 0:t.input)}),n?e("div",{className:o("absolute top-2 right-2","block",t==null?void 0:t.loader),children:(r==null?void 0:r.loadingIcon)||e(R,{})}):e(j,{className:o("absolute top-2 right-0","block","border-none","bg-none",t==null?void 0:t.arrowButton),children:e(m,{buttonIcon:r==null?void 0:r.buttonIcon,...B})})]}),d&&e(A,{slot:"description",className:o("flex","text-xs","text-slate-500",t==null?void 0:t.description),children:d}),e(D,{className:o("flex","text-xs","text-red-500",t==null?void 0:t.errorMessage),children:p}),e(W,{isOpen:b,isExiting:a==="hidden",offset:k,UNSTABLE_portalContainer:c,onAnimationComplete:I=>{u(f=>I==="hidden"&&f==="hidden"?"unmounted":f)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:a,className:o("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-[var(--trigger-width)]","bg-white","border border-solid border-slate-300",t==null?void 0:t.listContainer),children:e(E,{className:o("max-h-80","overflow-y-scroll",t==null?void 0:t.list),children:h})},w)]})})}q.defaultProps={label:void 0,description:void 0,errorMessage:void 0,placeholder:"",key:void 0,isLoading:!1,slots:{loadingIcon:void 0,buttonIcon:void 0},popoverOffset:void 0,popoverPortalContainer:void 0,classNames:void 0};export{q as Select,q as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SelectProps } from './Select.types';
|
|
2
|
+
export declare function Select<T extends object>({ label, description, errorMessage, children, placeholder, key, isLoading, slots, popoverPortalContainer, popoverOffset, selectedKey, className, classNames, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Select {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
label: undefined;
|
|
6
|
+
description: undefined;
|
|
7
|
+
errorMessage: undefined;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
key: undefined;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
slots: {
|
|
12
|
+
loadingIcon: undefined;
|
|
13
|
+
buttonIcon: undefined;
|
|
14
|
+
};
|
|
15
|
+
popoverOffset: undefined;
|
|
16
|
+
popoverPortalContainer: undefined;
|
|
17
|
+
classNames: undefined;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default Select;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComboBoxRenderProps, ComboBoxProps as AriaComboBoxProps, ValidationResult } from 'react-aria-components';
|
|
2
|
+
import { Key, ReactNode } from 'react';
|
|
3
|
+
import { SlotsToClasses } from '../../types/SlotsToClasses';
|
|
4
|
+
export type ComboBoxPopoverAnimationState = 'unmounted' | 'hidden' | 'visible';
|
|
5
|
+
export type SelectSlots = {
|
|
6
|
+
buttonIcon?: ReactNode | ((values: ComboBoxRenderProps) => ReactNode);
|
|
7
|
+
loadingIcon?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export interface SelectProps<T extends object> extends Omit<AriaComboBoxProps<T>, 'children'> {
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string | null;
|
|
12
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
key?: Key | null;
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
children: ReactNode | ((item: T) => ReactNode);
|
|
17
|
+
slots?: SelectSlots;
|
|
18
|
+
popoverOffset?: number;
|
|
19
|
+
popoverPortalContainer?: Element;
|
|
20
|
+
classNames?: SlotsToClasses<'label' | 'name' | 'comboBoxContainer' | 'input' | 'loader' | 'arrowButton' | 'description' | 'errorMessage' | 'listContainer' | 'list'>;
|
|
21
|
+
}
|