@clicktap/ui 0.14.19 → 0.14.26
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/Avatar/Avatar.d.ts +5 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Avatar/Avatar.types.d.ts +28 -2
- package/components/Avatar/AvatarGroup/AvatarGroup.d.ts +5 -1
- package/components/Avatar/AvatarGroup/AvatarGroup.js +1 -1
- package/components/Avatar/AvatarGroup/AvatarGroup.types.d.ts +7 -2
- package/components/Avatar/index.js +1 -1
- package/components/ContextMenu/ContextMenu.js +1 -1
- package/components/Dialog/Dialog.js +1 -1
- package/components/DialogTrigger/DialogTrigger.js +1 -1
- package/components/Drawer/Drawer.js +1 -1
- package/components/ModalOverlay/ModalOverlay.js +1 -1
- package/components/PinInput/PinInput.js +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Tabs/Tabs.context.d.ts +3 -0
- package/package.json +1 -2
- package/components/Accordion/Accordion.tsx +0 -82
- package/components/Accordion/index.ts +0 -3
- package/components/Avatar/Avatar.stories.tsx +0 -99
- package/components/Avatar/Avatar.tsx +0 -120
- package/components/Avatar/Avatar.types.ts +0 -3
- package/components/Avatar/AvatarGroup/AvatarGroup.tsx +0 -32
- package/components/Avatar/AvatarGroup/AvatarGroup.types.ts +0 -8
- package/components/Avatar/index.ts +0 -4
- package/components/Badge/Badge.stories.tsx +0 -72
- package/components/Badge/Badge.tsx +0 -169
- package/components/Badge/Badge.types.ts +0 -3
- package/components/Badge/index.ts +0 -2
- package/components/Breadcrumbs/BreadcrumbEllipsis.tsx +0 -47
- package/components/Breadcrumbs/BreadcrumbEllipsis.types.ts +0 -5
- package/components/Breadcrumbs/BreadcrumbItem.tsx +0 -23
- package/components/Breadcrumbs/BreadcrumbItem.types.ts +0 -3
- package/components/Breadcrumbs/BreadcrumbLink.tsx +0 -30
- package/components/Breadcrumbs/BreadcrumbLink.types.ts +0 -3
- package/components/Breadcrumbs/BreadcrumbSeparator.tsx +0 -41
- package/components/Breadcrumbs/BreadcrumbSeparator.types.ts +0 -9
- package/components/Breadcrumbs/Breadcrumbs.tsx +0 -28
- package/components/Breadcrumbs/Breadcrumbs.types.ts +0 -6
- package/components/Breadcrumbs/index.ts +0 -10
- package/components/Button/Button.tsx +0 -72
- package/components/Button/Button.types.ts +0 -7
- package/components/Button/index.ts +0 -2
- package/components/Card/Card.tsx +0 -15
- package/components/Card/Card.types.ts +0 -3
- package/components/Card/index.ts +0 -2
- package/components/Checkbox/Checkbox.tsx +0 -122
- package/components/Checkbox/Checkbox.types.ts +0 -15
- package/components/Checkbox/index.ts +0 -2
- package/components/Collapsible/Collapsible.tsx +0 -34
- package/components/Collapsible/Collapsible.types.ts +0 -5
- package/components/Collapsible/CollapsibleTrigger.tsx +0 -57
- package/components/Collapsible/CollapsibleTrigger.types.ts +0 -14
- package/components/Collapsible/index.ts +0 -10
- package/components/Container/Container.tsx +0 -26
- package/components/Container/Container.types.ts +0 -3
- package/components/Container/index.ts +0 -2
- package/components/ContextMenu/ContextMenu.tsx +0 -74
- package/components/ContextMenu/ContextMenu.types.ts +0 -17
- package/components/ContextMenu/index.ts +0 -2
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.tsx +0 -115
- package/components/CreditCardExpirationInput/CreditCardExpirationInput.types.ts +0 -10
- package/components/CreditCardExpirationInput/index.ts +0 -2
- package/components/CreditCardInput/CreditCardInput.tsx +0 -147
- package/components/CreditCardInput/CreditCardInput.types.ts +0 -12
- package/components/CreditCardInput/index.ts +0 -2
- package/components/DateInput/DateInput.tsx +0 -81
- package/components/DateInput/DateInput.types.ts +0 -15
- package/components/DateInput/index.ts +0 -2
- package/components/DateTimeFormat/DateTimeFormat.tsx +0 -16
- package/components/DateTimeFormat/DateTimeFormat.types.ts +0 -7
- package/components/DateTimeFormat/index.ts +0 -2
- package/components/Dialog/Dialog.tsx +0 -65
- package/components/Dialog/Dialog.types.ts +0 -9
- package/components/Dialog/index.ts +0 -2
- package/components/DialogTrigger/DialogTrigger.tsx +0 -45
- package/components/DialogTrigger/DialogTrigger.types.ts +0 -6
- package/components/DialogTrigger/index.ts +0 -5
- package/components/Divider/Divider.stories.tsx +0 -37
- package/components/Divider/Divider.tsx +0 -34
- package/components/Divider/Divider.types.ts +0 -5
- package/components/Divider/index.ts +0 -2
- package/components/DobInput/DobInput.tsx +0 -120
- package/components/DobInput/index.ts +0 -2
- package/components/Drawer/Drawer.tsx +0 -126
- package/components/Drawer/Drawer.types.ts +0 -11
- package/components/Drawer/index.ts +0 -2
- package/components/Icon/Account.tsx +0 -50
- package/components/Icon/Cart.tsx +0 -43
- package/components/Icon/Checkmark.tsx +0 -34
- package/components/Icon/Cross.tsx +0 -36
- package/components/Icon/DownArrow.tsx +0 -23
- package/components/Icon/Hamburger.tsx +0 -23
- package/components/Icon/Icon.types.ts +0 -8
- package/components/Icon/LinkArrow.tsx +0 -32
- package/components/Icon/Minus.tsx +0 -20
- package/components/Icon/Plus.tsx +0 -20
- package/components/Icon/Search.tsx +0 -36
- package/components/Icon/Trash.tsx +0 -27
- package/components/Icon/Verified.tsx +0 -20
- package/components/Icon/index.ts +0 -14
- package/components/Image/Image.tsx +0 -32
- package/components/Image/index.ts +0 -2
- package/components/Input/Input.tsx +0 -109
- package/components/Input/Input.types.ts +0 -17
- package/components/Input/index.ts +0 -2
- package/components/Link/Link.stories.tsx +0 -96
- package/components/Link/Link.tsx +0 -39
- package/components/Link/Link.types.ts +0 -3
- package/components/Link/index.ts +0 -2
- package/components/Loader/CircularEasing.tsx +0 -66
- package/components/Loader/CircularEasing.types.ts +0 -8
- package/components/Loader/Pulse.tsx +0 -45
- package/components/Loader/Pulse.types.ts +0 -5
- package/components/Loader/index.ts +0 -4
- package/components/Menu/ContextMenu.tsx +0 -83
- package/components/Menu/Menu.tsx +0 -143
- package/components/Menu/Menu.types.ts +0 -44
- package/components/Menu/index.ts +0 -4
- package/components/Meter/Meter.stories.tsx +0 -111
- package/components/Meter/Meter.tsx +0 -68
- package/components/Meter/Meter.types.ts +0 -10
- package/components/Meter/index.ts +0 -2
- package/components/Modal/Modal.tsx +0 -16
- package/components/Modal/Modal.types.ts +0 -6
- package/components/Modal/index.ts +0 -2
- package/components/ModalOverlay/ModalOverlay.tsx +0 -121
- package/components/ModalOverlay/ModalOverlay.types.ts +0 -18
- package/components/ModalOverlay/index.ts +0 -2
- package/components/NumberFormat/NumberFormat.tsx +0 -19
- package/components/NumberFormat/NumberFormat.types.ts +0 -8
- package/components/NumberFormat/index.ts +0 -2
- package/components/NumberInput/NumberInput.tsx +0 -164
- package/components/NumberInput/NumberInput.types.ts +0 -22
- package/components/NumberInput/index.ts +0 -2
- package/components/NumberTicker/DigitResolver.tsx +0 -119
- package/components/NumberTicker/DigitResolver.types.ts +0 -18
- package/components/NumberTicker/NumberTicker.tsx +0 -56
- package/components/NumberTicker/NumberTicker.types.ts +0 -96
- package/components/NumberTicker/hooks/useColumnTransition.ts +0 -36
- package/components/NumberTicker/hooks/useNumberDelta.ts +0 -19
- package/components/NumberTicker/hooks/useNumberTicker.ts +0 -36
- package/components/NumberTicker/index.ts +0 -10
- package/components/Pagination/Pagination.tsx +0 -44
- package/components/Pagination/index.ts +0 -2
- package/components/PasswordCheck/PasswordCheck.tsx +0 -59
- package/components/PasswordCheck/PasswordCheck.types.ts +0 -4
- package/components/PasswordCheck/PasswordCheck.utils.ts +0 -47
- package/components/PasswordCheck/index.ts +0 -2
- package/components/PhoneInput/PhoneInput.tsx +0 -191
- package/components/PhoneInput/index.ts +0 -2
- package/components/PinInput/PinInput.tsx +0 -318
- package/components/PinInput/PinInput.types.ts +0 -21
- package/components/PinInput/index.ts +0 -2
- package/components/Progressbar/CircularProgressbar.tsx +0 -71
- package/components/Progressbar/CircularProgressbar.types.ts +0 -10
- package/components/Progressbar/LinearProgressbar.tsx +0 -75
- package/components/Progressbar/LinearProgressbar.types.ts +0 -11
- package/components/Progressbar/index.ts +0 -4
- package/components/Radio/Radio.tsx +0 -88
- package/components/Radio/Radio.types.ts +0 -16
- package/components/Radio/index.ts +0 -2
- package/components/RadioGroup/RadioGroup.tsx +0 -49
- package/components/RadioGroup/RadioGroup.types.ts +0 -7
- package/components/RadioGroup/index.ts +0 -2
- package/components/Select/Option.tsx +0 -32
- package/components/Select/Option.types.ts +0 -3
- package/components/Select/Select.tsx +0 -272
- package/components/Select/Select.types.ts +0 -48
- package/components/Select/index.ts +0 -8
- package/components/Skeleton/Skeleton.tsx +0 -15
- package/components/Skeleton/Skeleton.types.ts +0 -3
- package/components/Skeleton/index.ts +0 -2
- package/components/Slider/Slider.tsx +0 -110
- package/components/Slider/Slider.types.ts +0 -11
- package/components/Slider/index.ts +0 -2
- package/components/Switch/Switch.tsx +0 -63
- package/components/Switch/Switch.types.ts +0 -8
- package/components/Switch/index.ts +0 -2
- package/components/Table/Table.tsx +0 -52
- package/components/Table/Table.types.ts +0 -22
- package/components/Table/index.ts +0 -2
- package/components/Tabs/Tab.tsx +0 -118
- package/components/Tabs/Tab.types.ts +0 -10
- package/components/Tabs/TabList.tsx +0 -51
- package/components/Tabs/TabList.types.ts +0 -12
- package/components/Tabs/TabPanel.tsx +0 -19
- package/components/Tabs/TabPanel.types.ts +0 -3
- package/components/Tabs/Tabs.context.tsx +0 -9
- package/components/Tabs/Tabs.tsx +0 -39
- package/components/Tabs/Tabs.types.ts +0 -3
- package/components/Tabs/index.ts +0 -9
- package/components/TimeInput/TimeInput.stories.tsx +0 -125
- package/components/TimeInput/TimeInput.tsx +0 -81
- package/components/TimeInput/TimeInput.types.ts +0 -15
- package/components/TimeInput/index.ts +0 -2
- package/components/ToggleButton/ToggleButton.stories.tsx +0 -89
- package/components/ToggleButton/ToggleButton.tsx +0 -69
- package/components/ToggleButton/ToggleButton.types.ts +0 -6
- package/components/ToggleButton/index.ts +0 -2
- package/components/Tooltip/Tooltip.tsx +0 -59
- package/components/Tooltip/Tooltip.types.ts +0 -3
- package/components/Tooltip/index.ts +0 -2
- package/components/UploadImage/UploadImage.tsx +0 -206
- package/components/UploadImage/UploadImage.types.ts +0 -15
- package/components/UploadImage/index.ts +0 -2
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { AvatarProps } from './Avatar.types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* SSR-compatible Avatar component.
|
|
4
|
+
* Pure Tailwind implementation that works with Next.js App Router SSR.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Avatar({ icon, className, isDisabled, size, classNames, isBordered, radius, name, src, alt, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
3
7
|
export default Avatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as h}from"react/jsx-runtime";import{cn as o}from"../../utils/cn.js";const w=()=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function C({icon:f,className:x,isDisabled:l,size:d="md",classNames:t,isBordered:p,radius:n="full",name:r,src:i,alt:u}){return e("div",{className:o("group","z-10","first:ms-0",x),children:h("div",{className:o("transition-transform duration-300 ease-in-out","bg-slate-100","flex items-center justify-center","relative","z-10","overflow-hidden",l?"opacity-50":"opacity-100",[d==="sm"&&"h-8 w-8 text-xs",d==="md"&&"h-10 w-10 text-sm",d==="lg"&&"h-12 w-12 text-base"],[n==="full"&&"rounded-full",n==="lg"&&"rounded-2xl",n==="md"&&"rounded-xl",n==="sm"&&"rounded-lg",n==="none"&&"rounded-none"],p&&"shadow-[#fff_0px_0px_0px_2px,_#f1f5f9_0px_0px_0px_4px,_#00000000_0px_0px_0px_0px]",t==null?void 0:t.base),children:[i&&e("img",{src:i,alt:u||r||"Avatar",className:o("absolute","w-full","h-full","overflow-hidden","object-cover","object-center",t==null?void 0:t.icon)}),!i&&r&&e("span",{className:o("flex items-center justify-center","text-center","max-w-full","overflow-hidden","font-medium",t==null?void 0:t.name),children:r}),!i&&!r&&e("span",{className:o("flex items-center justify-center",t==null?void 0:t.fallback),children:f||e(w,{})})]})})}export{C as Avatar,C as default};
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type AvatarProps =
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type AvatarProps = {
|
|
3
|
+
/** Custom icon to display instead of default user icon */
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
/** Additional class name for the wrapper */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Whether the avatar is disabled */
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
/** Size of the avatar */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Custom class names for avatar parts */
|
|
12
|
+
classNames?: {
|
|
13
|
+
base?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
fallback?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Whether to show a border around the avatar */
|
|
19
|
+
isBordered?: boolean;
|
|
20
|
+
/** Border radius of the avatar */
|
|
21
|
+
radius?: 'full' | 'lg' | 'md' | 'sm' | 'none';
|
|
22
|
+
/** Name/initials to display */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Image source URL */
|
|
25
|
+
src?: string;
|
|
26
|
+
/** Alt text for the image */
|
|
27
|
+
alt?: string;
|
|
28
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { AvatarGroupProps } from './AvatarGroup.types';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* SSR-compatible AvatarGroup component.
|
|
5
|
+
* Pure Tailwind implementation that works with Next.js App Router SSR.
|
|
6
|
+
*/
|
|
7
|
+
export declare function AvatarGroup({ children, isGrid, className, }: PropsWithChildren<AvatarGroupProps>): import("react/jsx-runtime").JSX.Element;
|
|
4
8
|
export default AvatarGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{cn as o}from"../../../utils/cn.js";function m({children:e,isGrid:r,className:t}){return a("div",{className:o(r?"inline-grid":"flex",r?"gap-3":"gap-0","grid-cols-4","items-center",t),children:e})}export{m as AvatarGroup,m as default};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type AvatarGroupProps =
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type AvatarGroupProps = {
|
|
3
|
+
/** Whether to display avatars in a grid layout */
|
|
4
|
+
isGrid?: boolean;
|
|
5
|
+
/** Custom render function for the count indicator */
|
|
6
|
+
renderCount?: (count: number) => ReactNode;
|
|
7
|
+
/** Additional class name */
|
|
3
8
|
className?: string;
|
|
4
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Avatar as a}from"./Avatar.js";import{AvatarGroup as e}from"./AvatarGroup/AvatarGroup.js";import"react/jsx-runtime";import"
|
|
1
|
+
import{Avatar as a}from"./Avatar.js";import{AvatarGroup as e}from"./AvatarGroup/AvatarGroup.js";import"react/jsx-runtime";import"../../utils/cn.js";export{a as Avatar,e as AvatarGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Popover as v,Menu as h}from"react-aria-components";import{forwardRef as w}from"react";import{motion as c}from"framer-motion";import{cn as d}from"../../utils/cn.js";const a=w(({style:o,...e},t)=>{const i=typeof o=="function"?o(e):o;return r(v,{...e,ref:t,style:i})});let p=null;function y(){return typeof window>"u"?null:(p||(p=c.create(a)),p)}function E({children:o,key:e,onAction:t,setAnimation:i,animation:u="hidden",className:_,classNames:n,...f}){const m=y(),x=d("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-56","bg-white","border border-solid border-slate-300",_);return m?r(m,{className:x,isExiting:u==="hidden",onAnimationComplete:b=>{i(l=>b==="hidden"&&l==="hidden"?"unmounted":l)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:u,...f,children:r(h,{className:d("outline-none",n==null?void 0:n.menu),onAction:t,children:o})},e):r(a,{className:x,...f,children:r(h,{className:d("outline-none",n==null?void 0:n.menu),onAction:t,children:o})},e)}export{E as ContextMenu,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{forwardRef as f}from"react";import{Dialog as m}from"react-aria-components";import{motion as u}from"framer-motion";import{cn as c}from"../../utils/cn.js";const l=f(({style:o,animationVariants:a,...t},n)=>{const r=typeof o=="function"?o(t):o;return i(m,{...t,ref:n,style:r})});let e=null;function d(){return typeof window>"u"?null:(e||(e=u.create(l)),e)}function D({className:o,children:a,animationVariants:t,...n}){const r=d(),s={className:c("p-8 outline-0 max-w-max w-screen absolute top-2/4 left-2/4","shadow-[0_8px_24px_rgba(0,0,0,0.1)] rounded-lg bg-white border border-solid border-slate-400","transform -translate-x-1/2 -translate-y-1/2",o),...n};return r?i(r,{...s,variants:t||{hidden:{transform:"translate(-50%, -50%) scale(0.8)",transition:{ease:"backIn"}},visible:{transform:"translate(-50%, -50%) scale(1)",transition:{ease:"backOut"}}},children:a}):i(l,{...s,children:a})}export{D as Dialog,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as u,useContext as c,useState as l,useMemo as d}from"react";import{DialogTrigger as f}from"react-aria-components";const a=u({animation:"unmounted",setAnimation:()=>{},onOpenChange:()=>{}}),D=()=>c(a);function T(g){const{onOpenChange:o,...s}=g,[e,n]=l("unmounted"),t=i=>{n(i?"visible":"hidden"),o==null||o(i)},m=d(()=>({animation:e,setAnimation:n,onOpenChange:t}),[e,o]);return r(a.Provider,{value:m,children:r(f,{...s,onOpenChange:t})})}export{T as DialogTrigger,T as default,D as useDialogTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{forwardRef as l}from"react";import{Dialog as m}from"react-aria-components";import{motion as p}from"framer-motion";import{cn as u}from"../../utils/cn.js";const b={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"}}}},f=l(({style:t,size:e="20rem",...r},o)=>{const a=typeof t=="function"?t(r):{...t,"--drawer-size":`${e}`};return n(m,{...r,ref:o,style:a})});let i=null;function w(){return typeof window>"u"?null:(i||(i=p.create(f)),i)}function c({direction:t="right",children:e,className:r,animationVariants:o,...a}){const s=w(),d={className:u("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)]",r),"data-direction":t,...a};return s?n(s,{variants:o||b[t],...d,children:e}):n(f,{...d,children:e})}export{c as Drawer,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as h,useId as b}from"react";import{ModalOverlay as c}from"react-aria-components";import{AnimatePresence as O,motion as g}from"framer-motion";import{useDialogTrigger as x}from"../DialogTrigger/DialogTrigger.js";import{cn as w}from"../../utils/cn.js";const k=h(({style:i,...e},n)=>{const o=typeof i=="function"?i(e):i;return t(c,{...e,ref:n,style:o})});let r=null;function A(){return typeof window>"u"?null:(r||(r=g.create(k)),r)}function s({animate:i,animation:e,setAnimation:n,className:o,animationVariants:f,children:a,...u}){const p=b(),d=A(),{key:v,...y}=u,l={className:w("bg-black/30","fixed top-0 left-0","z-50","w-screen h-[var(--visual-viewport-height)]",o),...y};return d?t(d,{isExiting:e==="hidden",onAnimationComplete:M=>{n(m=>M==="hidden"&&m==="hidden"?"unmounted":m)},variants:f||{hidden:{opacity:0,backdropFilter:"blur(0px)",transition:{delay:.08}},visible:{opacity:1,backdropFilter:"blur(8px)"}},initial:"hidden",animate:i,exit:"hidden",...l,children:a},v||p):t(c,{...l,children:a})}function D(i){const{isOpen:e}=i,{animation:n,setAnimation:o}=x();return e!==void 0?t(O,{children:e&&t(s,{...i,animate:"visible",animation:n,setAnimation:o})}):t(s,{...i,animate:n,animation:n,setAnimation:o})}export{D as ModalOverlay,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as T,jsx as
|
|
1
|
+
import{jsxs as T,jsx as h}from"react/jsx-runtime";import{useState as z,useRef as G,useEffect as U}from"react";import{Group as Z,Label as v,TextField as K,Input as H,Text as P}from"react-aria-components";import{cn as b}from"../../utils/cn.js";function C({description:m,errorMessage:y,isDisabled:A=!1,isInvalid:D=!1,isMasked:E=!1,isRequired:I=!0,label:$,length:s=6,name:M,onChange:f,value:L="",type:j="numeric",validationBehavior:J="native",className:R,classNames:r,...S}){const[Q,g]=z(L),[o,V]=z(Array(s).fill("")),x=G([]);U(()=>{x.current=x.current.slice(0,s)},[s]);const W=e=>{var l,d;const t=e.target.value,n=Number(e.target.getAttribute("data-pin-input-index"));t!==""&&n<o.length-1&&((d=(l=x.current)==null?void 0:l[n+1])==null||d.focus());const p=o.map((w,u)=>u===n?t:w);V(p);const a=p.join("");g(a),f&&f(a)},B=e=>{var a,l,d,w;const t=Number(e.currentTarget.getAttribute("data-pin-input-index"));if(e.ctrlKey||e.metaKey)return;const n=["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Control","Alt","Meta","Shift","Tab","Enter","Escape"],p={alpha:/^[a-z]$/i,alphanumeric:/^[a-z0-9]$/i,numeric:/^[0-9]$/i};if(!e.key.match(p[j])&&!n.includes(e.key)&&e.preventDefault(),o[t]===""&&t>0&&e.key==="Backspace"){const u=o.map((i,k)=>k===t-1?"":i);V(u),(l=(a=x.current)==null?void 0:a[t-1])==null||l.focus(),e.preventDefault();const c=u.join("");g(c),f&&f(c)}if(o[t]===""&&t<o.length-1&&e.key==="Delete"){const u=o.map((i,k)=>k===t+1?"":i);V(u),(w=(d=x.current)==null?void 0:d[t+1])==null||w.focus(),e.preventDefault();const c=u.join("");g(c),f&&f(c)}},F=e=>{var u,c;const t=Number(e.currentTarget.getAttribute("data-pin-input-index"));e.preventDefault();const n=(u=e.clipboardData)==null?void 0:u.getData("text");if(!n)return;const p=n.split("").filter(i=>{switch(j){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(p.length===0)return;const a=[...o];let l=t;for(let i=0;i<p.length&&t+i<s;i++)a[t+i]=p[i],l=t+i;V(a);const d=a.join("");g(d),f&&f(d);const w=l+1<s?l+1:s-1;(c=x.current[w])==null||c.focus()};return T(Z,{className:b("flex flex-wrap gap-2",R),"aria-label":$,...S,children:[h(v,{className:b("flex text-slate-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.label),children:$}),o.map((e,t)=>h(K,{className:b("flex flex-col w-full flex-1 text-slate-900",r==null?void 0:r.inputWrap),"aria-label":`Pin Input Digit ${t+1}`,isDisabled:A,isInvalid:D,isRequired:I,validationBehavior:J,children:h(H,{className:b("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:W,onKeyDown:B,onPaste:F,type:E?"password":"text",autoComplete:"one-time-code",ref:n=>{n&&(x.current[t]=n)},value:e,maxLength:1,"data-pin-input-index":t})},`pin-input-${t}`)),T(K,{className:b("flex flex-row flex-wrap grow shrink-0 basis-full",r==null?void 0:r.textWrap),"aria-label":"Pin Input",isDisabled:A,isInvalid:D,isRequired:I,validationBehavior:J,children:[m&&h(P,{className:b("flex text-slate-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.description),slot:"description",children:m}),D&&y&&typeof y=="string"&&h(P,{className:b("flex text-red-500 text-sm grow shrink-0 basis-full",r==null?void 0:r.error),slot:"errorMessage",children:y})]})]})}export{C as PinInput,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as _,Fragment as j}from"react/jsx-runtime";import{Popover as D,ComboBox as F,Label as T,Input as U,Button as R,Text as W,FieldError as q,ListBox as z}from"react-aria-components";import{forwardRef as L,useState as y}from"react";import{motion as G}from"framer-motion";import{cn as o}from"../../utils/cn.js";import{Pulse as H}from"../Loader/Pulse.js";const S=L((d,n)=>e(D,{...d,ref:n}));let f=null;function J(){return typeof window>"u"?null:(f||(f=G.create(S)),f)}function Q({buttonIcon:d,...n}){return d?typeof d=="function"?d(n):d: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",n.isOpen?"rotate-180":"rotate-0"),children:e("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o(["stroke-slate-900",n.isDisabled&&"stroke-slate-400",n.isInvalid&&"stroke-red-500"])})})}function k({listBoxComponent:d,children:n,...r}){return e(d||z,{...r,children:n})}function V({label:d,description:n,errorMessage:r,children:a,placeholder:I,key:b,isLoading:l,slots:i,popoverPortalContainer:p,popoverOffset:h,selectedKey:v,className:M,classNames:t,autoComplete:O,...w},m){const[u,g]=y("unmounted"),[x,A]=y(!1),C=J(),B=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);return e(F,{onOpenChange:()=>{g(u==="visible"?"hidden":"visible"),A(!x)},isDisabled:w.isDisabled||l,"data-has-value":!!v,selectedKey:v,...w,className:o("flex flex-col","w-full",M),children:E=>_(j,{children:[e(T,{className:o("flex","text-xs text-slate-500",t==null?void 0:t.label),children:d}),_("div",{className:o("flex","relative","w-full",t==null?void 0:t.comboBoxContainer),children:[e(U,{placeholder:I,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",l?"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),ref:m,autoComplete:O}),l?e("div",{className:o("absolute top-2 right-2","block",t==null?void 0:t.loader),children:(i==null?void 0:i.loadingIcon)||e(H,{})}):e(R,{className:o("absolute top-2 right-0","block","border-none","bg-none",t==null?void 0:t.arrowButton),children:e(Q,{buttonIcon:i==null?void 0:i.buttonIcon,...E})})]}),n&&e(W,{slot:"description",className:o("flex","text-xs","text-slate-500",t==null?void 0:t.description),children:n}),e(q,{className:o("flex","text-xs","text-red-500",t==null?void 0:t.errorMessage),children:r}),C?e(C,{isOpen:x,isExiting:u==="hidden",offset:h,UNSTABLE_portalContainer:p,onAnimationComplete:P=>{g(c=>P==="hidden"&&c==="hidden"?"unmounted":c)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:u,className:B,children:e(k,{listBoxComponent:i==null?void 0:i.listBoxComponent,className:o("max-h-80","overflow-y-scroll",t==null?void 0:t.list),children:a})},b):e(S,{isOpen:x,offset:h,UNSTABLE_portalContainer:p,className:B,children:e(k,{listBoxComponent:i==null?void 0:i.listBoxComponent,className:o("max-h-80","overflow-y-scroll",t==null?void 0:t.list),children:a})},b)]})})}const s=L(V);export{s as Select,s as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clicktap/ui",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Clicktap",
|
|
6
6
|
"description": "A library of React UI components and low-level hooks.",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@floating-ui/react": "^0.25.4",
|
|
48
48
|
"@nextui-org/accordion": "^2.0.28",
|
|
49
|
-
"@nextui-org/avatar": "^2.0.32",
|
|
50
49
|
"@nextui-org/badge": "^2.0.31",
|
|
51
50
|
"@nextui-org/pagination": "^2.0.35",
|
|
52
51
|
"@nextui-org/tooltip": "^2.0.30",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Accordion as NextUiAccordion } from '@nextui-org/accordion';
|
|
4
|
-
import type { AccordionProps } from '@nextui-org/accordion';
|
|
5
|
-
import { cn } from '../../utils/cn';
|
|
6
|
-
import { DownArrow } from '../Icon/DownArrow';
|
|
7
|
-
|
|
8
|
-
export function Accordion({
|
|
9
|
-
children,
|
|
10
|
-
variant,
|
|
11
|
-
isCompact,
|
|
12
|
-
className,
|
|
13
|
-
itemClasses,
|
|
14
|
-
...props
|
|
15
|
-
}: AccordionProps) {
|
|
16
|
-
return (
|
|
17
|
-
<NextUiAccordion
|
|
18
|
-
variant={variant}
|
|
19
|
-
isCompact={isCompact}
|
|
20
|
-
dividerProps={{
|
|
21
|
-
className: cn(
|
|
22
|
-
'my-2 border-solid border-slate-200',
|
|
23
|
-
variant === 'shadow' && 'border-slate-300'
|
|
24
|
-
),
|
|
25
|
-
}}
|
|
26
|
-
className={cn(
|
|
27
|
-
'px-0',
|
|
28
|
-
variant === 'bordered' && [
|
|
29
|
-
'px-4 py-4 rounded-xl border-2 border-slate-200',
|
|
30
|
-
],
|
|
31
|
-
variant === 'shadow' && [
|
|
32
|
-
'px-4 py-4 rounded-xl bg-slate-100 shadow-slate-200 border border-slate-200',
|
|
33
|
-
],
|
|
34
|
-
className
|
|
35
|
-
)}
|
|
36
|
-
itemClasses={{
|
|
37
|
-
base: cn(
|
|
38
|
-
'w-full py-2',
|
|
39
|
-
'data-[disabled="true"]:pointer-events-none data-[disabled="true"]:opacity-50',
|
|
40
|
-
variant === 'bordered' && ['rounded-xl py-0'],
|
|
41
|
-
variant === 'splitted' && [
|
|
42
|
-
'flex flex-col bg-slate-100 rounded-xl border border-slate-200',
|
|
43
|
-
],
|
|
44
|
-
isCompact && 'py-0',
|
|
45
|
-
itemClasses?.base
|
|
46
|
-
),
|
|
47
|
-
trigger: cn(
|
|
48
|
-
'w-full h-full flex items-center gap-3 py-0 appearance-none cursor-pointer select-none',
|
|
49
|
-
'data-[focus-visible="true"]:outline-2 data-[focus-visible="true"]:outline data-[focus-visible="true"]:outline-slate-100',
|
|
50
|
-
'bg-transparent text-inherit',
|
|
51
|
-
isCompact && ['py-2'],
|
|
52
|
-
itemClasses?.trigger
|
|
53
|
-
),
|
|
54
|
-
title: cn(
|
|
55
|
-
'text-xl font-semibold',
|
|
56
|
-
isCompact && 'text-base',
|
|
57
|
-
itemClasses?.title
|
|
58
|
-
),
|
|
59
|
-
subtitle: cn(
|
|
60
|
-
'text-base',
|
|
61
|
-
isCompact && 'text-sm',
|
|
62
|
-
itemClasses?.subtitle
|
|
63
|
-
),
|
|
64
|
-
titleWrapper: cn('text-left', itemClasses?.titleWrapper),
|
|
65
|
-
startContent: cn('shrink-0', itemClasses?.startContent),
|
|
66
|
-
content: cn([isCompact ? 'py-1' : 'py-2'], itemClasses?.content),
|
|
67
|
-
indicator: itemClasses?.indicator,
|
|
68
|
-
heading: itemClasses?.heading,
|
|
69
|
-
}}
|
|
70
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
71
|
-
{...props}
|
|
72
|
-
>
|
|
73
|
-
{children}
|
|
74
|
-
</NextUiAccordion>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default Accordion;
|
|
79
|
-
|
|
80
|
-
export function AccordionItemArrow() {
|
|
81
|
-
return <DownArrow className="w-4 h-4" />;
|
|
82
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { Avatar } from './Avatar';
|
|
4
|
-
import type { AvatarProps } from './Avatar.types';
|
|
5
|
-
import { AvatarGroup } from './AvatarGroup/AvatarGroup';
|
|
6
|
-
import type { AvatarGroupProps } from './AvatarGroup/AvatarGroup.types';
|
|
7
|
-
|
|
8
|
-
function Layout({ children }: { children: ReactNode }) {
|
|
9
|
-
return children;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function AvatarExample(props: AvatarProps) {
|
|
13
|
-
return (
|
|
14
|
-
<Layout>
|
|
15
|
-
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
|
16
|
-
<Avatar {...props} />
|
|
17
|
-
</Layout>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function AvatarGroupExample(props: AvatarGroupProps) {
|
|
22
|
-
return (
|
|
23
|
-
<Layout>
|
|
24
|
-
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
|
25
|
-
<AvatarGroup {...props}>
|
|
26
|
-
<Avatar src="https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg" />
|
|
27
|
-
<Avatar src="https://i.pravatar.cc/150?u=a042581f4e29026704d" />
|
|
28
|
-
<Avatar src="https://i.pravatar.cc/150?u=a04258114e29026702d" />
|
|
29
|
-
<Avatar src="https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg" />
|
|
30
|
-
<Avatar src="https://i.pravatar.cc/150?u=a042581f4e29026704d" />
|
|
31
|
-
<Avatar src="https://i.pravatar.cc/150?u=a04258114e29026702d" />
|
|
32
|
-
</AvatarGroup>
|
|
33
|
-
</Layout>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type Story = StoryObj<typeof Avatar>;
|
|
38
|
-
type StoryGroup = StoryObj<typeof AvatarGroup>;
|
|
39
|
-
|
|
40
|
-
const meta: Meta<typeof Layout> = {
|
|
41
|
-
component: Layout,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default meta;
|
|
45
|
-
|
|
46
|
-
export const AvatarComponent: Story = {
|
|
47
|
-
name: 'Avatar',
|
|
48
|
-
render: AvatarExample,
|
|
49
|
-
argTypes: {
|
|
50
|
-
src: {
|
|
51
|
-
control: 'text',
|
|
52
|
-
},
|
|
53
|
-
name: {
|
|
54
|
-
control: 'text',
|
|
55
|
-
},
|
|
56
|
-
size: {
|
|
57
|
-
options: ['sm', 'md', 'lg'],
|
|
58
|
-
control: 'radio',
|
|
59
|
-
},
|
|
60
|
-
showFallback: {
|
|
61
|
-
control: 'boolean',
|
|
62
|
-
},
|
|
63
|
-
radius: {
|
|
64
|
-
options: ['sm', 'md', 'lg', 'none', 'full'],
|
|
65
|
-
control: 'radio',
|
|
66
|
-
},
|
|
67
|
-
isBordered: {
|
|
68
|
-
control: 'boolean',
|
|
69
|
-
},
|
|
70
|
-
isDisabled: {
|
|
71
|
-
control: 'boolean',
|
|
72
|
-
},
|
|
73
|
-
isFocusable: {
|
|
74
|
-
control: 'boolean',
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
args: {
|
|
78
|
-
src: 'https://letsenhance.io/static/8f5e523ee6b2479e26ecc91b9c25261e/1015f/MainAfter.jpg',
|
|
79
|
-
name: 'Avatar',
|
|
80
|
-
size: 'md',
|
|
81
|
-
showFallback: false,
|
|
82
|
-
radius: 'full',
|
|
83
|
-
isBordered: false,
|
|
84
|
-
isDisabled: false,
|
|
85
|
-
isFocusable: false,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
export const AvatarGroupComponent: StoryGroup = {
|
|
89
|
-
name: 'Avatar Group',
|
|
90
|
-
render: AvatarGroupExample,
|
|
91
|
-
argTypes: {
|
|
92
|
-
isGrid: {
|
|
93
|
-
control: 'boolean',
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
args: {
|
|
97
|
-
isGrid: false,
|
|
98
|
-
},
|
|
99
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useAvatarGroupContext, Avatar as UiAvatar } from '@nextui-org/avatar';
|
|
4
|
-
import { cn } from '../../utils/cn';
|
|
5
|
-
import type { AvatarProps } from './Avatar.types';
|
|
6
|
-
|
|
7
|
-
export function Avatar({
|
|
8
|
-
icon,
|
|
9
|
-
className,
|
|
10
|
-
isDisabled,
|
|
11
|
-
size,
|
|
12
|
-
classNames,
|
|
13
|
-
isBordered,
|
|
14
|
-
radius,
|
|
15
|
-
...props
|
|
16
|
-
}: AvatarProps) {
|
|
17
|
-
const avatarGroupContext = useAvatarGroupContext();
|
|
18
|
-
return (
|
|
19
|
-
<div
|
|
20
|
-
className={cn(
|
|
21
|
-
'group',
|
|
22
|
-
'z-10',
|
|
23
|
-
'first:ms-0',
|
|
24
|
-
!avatarGroupContext?.isGrid && !!avatarGroupContext && '-ms-2',
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
>
|
|
28
|
-
<UiAvatar
|
|
29
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
30
|
-
{...props}
|
|
31
|
-
isDisabled={isDisabled}
|
|
32
|
-
size={size}
|
|
33
|
-
radius={radius}
|
|
34
|
-
isBordered={isBordered}
|
|
35
|
-
className={cn(
|
|
36
|
-
!avatarGroupContext?.isGrid &&
|
|
37
|
-
!!avatarGroupContext &&
|
|
38
|
-
'group-hover:-translate-y-3.5',
|
|
39
|
-
'transition-transform duration-300 ease-in-out',
|
|
40
|
-
'bg-slate-100',
|
|
41
|
-
'flex items-center justify-center',
|
|
42
|
-
'relative',
|
|
43
|
-
'z-10',
|
|
44
|
-
'overflow-hidden',
|
|
45
|
-
isDisabled ? 'opacity-50' : 'opacity-100',
|
|
46
|
-
[
|
|
47
|
-
size === 'sm' && 'h-8',
|
|
48
|
-
size === 'md' && 'h-10',
|
|
49
|
-
size === 'lg' && 'h-12',
|
|
50
|
-
size === 'sm' && 'w-8',
|
|
51
|
-
size === 'md' && 'w-10',
|
|
52
|
-
size === 'lg' && 'w-12',
|
|
53
|
-
],
|
|
54
|
-
[
|
|
55
|
-
radius === 'full' && 'rounded-full',
|
|
56
|
-
radius === 'lg' && 'rounded-2xl',
|
|
57
|
-
radius === 'md' && 'rounded-xl',
|
|
58
|
-
radius === 'sm' && 'rounded-lg',
|
|
59
|
-
radius === 'none' && 'rounded-none',
|
|
60
|
-
],
|
|
61
|
-
isBordered &&
|
|
62
|
-
'shadow-[#fff_0px_0px_0px_2px,_#f1f5f9_0px_0px_0px_4px,_#00000000_0px_0px_0px_0px]',
|
|
63
|
-
classNames?.base
|
|
64
|
-
)}
|
|
65
|
-
classNames={{
|
|
66
|
-
icon: cn(
|
|
67
|
-
'data-[loaded=true]:opacity-100 opacity-0',
|
|
68
|
-
'absolute',
|
|
69
|
-
'w-full',
|
|
70
|
-
'h-full',
|
|
71
|
-
'overflow-hidden',
|
|
72
|
-
'object-cover',
|
|
73
|
-
'object-center',
|
|
74
|
-
'transition-opacity ease-in-out duration-500',
|
|
75
|
-
classNames?.icon
|
|
76
|
-
),
|
|
77
|
-
name: cn(
|
|
78
|
-
'flex items-center justify-center',
|
|
79
|
-
'absolute top-1/2 left-1/2',
|
|
80
|
-
'-translate-x-1/2 -translate-y-1/2',
|
|
81
|
-
'text-xs text-center',
|
|
82
|
-
'max-w-full',
|
|
83
|
-
'overflow-hidden',
|
|
84
|
-
classNames?.name
|
|
85
|
-
),
|
|
86
|
-
fallback: cn(
|
|
87
|
-
'flex items-center justify-center',
|
|
88
|
-
'absolute top-1/2 left-1/2',
|
|
89
|
-
'-translate-x-1/2 -translate-y-1/2',
|
|
90
|
-
'text-xs text-center',
|
|
91
|
-
'max-w-full',
|
|
92
|
-
'overflow-hidden',
|
|
93
|
-
classNames?.fallback
|
|
94
|
-
),
|
|
95
|
-
}}
|
|
96
|
-
icon={
|
|
97
|
-
icon || (
|
|
98
|
-
<svg
|
|
99
|
-
width="24"
|
|
100
|
-
height="24"
|
|
101
|
-
viewBox="0 0 24 24"
|
|
102
|
-
fill="none"
|
|
103
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
104
|
-
>
|
|
105
|
-
<path
|
|
106
|
-
d="M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z"
|
|
107
|
-
stroke="black"
|
|
108
|
-
strokeWidth="2"
|
|
109
|
-
strokeLinecap="round"
|
|
110
|
-
strokeLinejoin="round"
|
|
111
|
-
/>
|
|
112
|
-
</svg>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
/>
|
|
116
|
-
</div>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export default Avatar;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { AvatarGroup as UIAvatarGroup } from '@nextui-org/avatar';
|
|
4
|
-
import type { PropsWithChildren } from 'react';
|
|
5
|
-
import { cn } from '../../../utils/cn';
|
|
6
|
-
import type { AvatarGroupProps } from './AvatarGroup.types';
|
|
7
|
-
|
|
8
|
-
export function AvatarGroup({
|
|
9
|
-
children,
|
|
10
|
-
isGrid,
|
|
11
|
-
renderCount,
|
|
12
|
-
className,
|
|
13
|
-
}: PropsWithChildren<AvatarGroupProps>) {
|
|
14
|
-
return (
|
|
15
|
-
<UIAvatarGroup
|
|
16
|
-
isGrid={isGrid}
|
|
17
|
-
max={0}
|
|
18
|
-
renderCount={renderCount ?? undefined}
|
|
19
|
-
className={cn(
|
|
20
|
-
isGrid ? 'inline-grid' : 'flex',
|
|
21
|
-
isGrid ? 'gap-3' : 'gap-0',
|
|
22
|
-
'grid-cols-4',
|
|
23
|
-
'items-center',
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
</UIAvatarGroup>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default AvatarGroup;
|