patiya 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -12
- package/dist/patiya13.cjs.map +1 -1
- package/dist/patiya13.mjs.map +1 -1
- package/dist/patiya20.cjs +1 -1
- package/dist/patiya20.cjs.map +1 -1
- package/dist/patiya20.mjs +43 -20
- package/dist/patiya20.mjs.map +1 -1
- package/dist/patiya63.cjs +1 -1
- package/dist/patiya63.cjs.map +1 -1
- package/dist/patiya63.mjs +1 -0
- package/dist/patiya63.mjs.map +1 -1
- package/dist/patiya8.cjs +1 -1
- package/dist/patiya8.cjs.map +1 -1
- package/dist/patiya8.mjs +95 -24
- package/dist/patiya8.mjs.map +1 -1
- package/dist/styles/globals.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -444,14 +444,16 @@ export declare interface DockProps extends default_2.HTMLAttributes<HTMLDivEleme
|
|
|
444
444
|
direction?: 'top' | 'bottom' | 'middle';
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
export declare function Drawer({ open, onOpenChange, children, side }: DrawerProps): default_2.JSX.Element;
|
|
447
|
+
export declare function Drawer({ open, onOpenChange, children, side, className, overlayClassName, }: DrawerProps): default_2.JSX.Element;
|
|
448
448
|
|
|
449
|
-
export declare
|
|
449
|
+
export declare type DrawerProps = {
|
|
450
450
|
open: boolean;
|
|
451
451
|
onOpenChange: (open: boolean) => void;
|
|
452
452
|
children: default_2.ReactNode;
|
|
453
453
|
side?: 'right' | 'left' | 'top' | 'bottom';
|
|
454
|
-
|
|
454
|
+
className?: string;
|
|
455
|
+
overlayClassName?: string;
|
|
456
|
+
};
|
|
455
457
|
|
|
456
458
|
export declare function DropdownMenu({ children, placement }: {
|
|
457
459
|
children: default_2.ReactNode;
|
|
@@ -511,15 +513,31 @@ export declare interface ImageZoomProps extends default_2.ImgHTMLAttributes<HTML
|
|
|
511
513
|
onPrev?: () => void;
|
|
512
514
|
}
|
|
513
515
|
|
|
514
|
-
export declare const Input: default_2.ForwardRefExoticComponent<
|
|
516
|
+
export declare const Input: default_2.ForwardRefExoticComponent<Omit<default_2.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
517
|
+
inputSize?: PatiyaSize;
|
|
518
|
+
variant?: "outline" | "filled" | "soft";
|
|
519
|
+
invalid?: boolean;
|
|
520
|
+
leftIcon?: default_2.ReactNode;
|
|
521
|
+
rightIcon?: default_2.ReactNode;
|
|
522
|
+
showPasswordToggle?: boolean;
|
|
523
|
+
eyeIcon?: default_2.ReactNode;
|
|
524
|
+
eyeOffIcon?: default_2.ReactNode;
|
|
525
|
+
clearable?: boolean;
|
|
526
|
+
onClear?: () => void;
|
|
527
|
+
} & default_2.RefAttributes<HTMLInputElement>>;
|
|
515
528
|
|
|
516
|
-
export declare
|
|
529
|
+
export declare type InputProps = Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
517
530
|
inputSize?: PatiyaSize;
|
|
518
531
|
variant?: 'outline' | 'filled' | 'soft';
|
|
519
532
|
invalid?: boolean;
|
|
520
533
|
leftIcon?: default_2.ReactNode;
|
|
521
534
|
rightIcon?: default_2.ReactNode;
|
|
522
|
-
|
|
535
|
+
showPasswordToggle?: boolean;
|
|
536
|
+
eyeIcon?: default_2.ReactNode;
|
|
537
|
+
eyeOffIcon?: default_2.ReactNode;
|
|
538
|
+
clearable?: boolean;
|
|
539
|
+
onClear?: () => void;
|
|
540
|
+
};
|
|
523
541
|
|
|
524
542
|
export declare const Kbd: default_2.ForwardRefExoticComponent<KbdProps & default_2.RefAttributes<HTMLElement>>;
|
|
525
543
|
|
|
@@ -796,14 +814,19 @@ export declare interface ProgressProps extends default_2.HTMLAttributes<HTMLDivE
|
|
|
796
814
|
isIndeterminate?: boolean;
|
|
797
815
|
}
|
|
798
816
|
|
|
799
|
-
export declare const PromptInput: default_2.ForwardRefExoticComponent<
|
|
817
|
+
export declare const PromptInput: default_2.ForwardRefExoticComponent<default_2.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
818
|
+
onValueSubmit?: (val: string) => void;
|
|
819
|
+
actions?: default_2.ReactNode;
|
|
820
|
+
attachments?: default_2.ReactNode;
|
|
821
|
+
maxRows?: number;
|
|
822
|
+
} & default_2.RefAttributes<HTMLTextAreaElement>>;
|
|
800
823
|
|
|
801
|
-
export declare
|
|
824
|
+
export declare type PromptInputProps = default_2.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
802
825
|
onValueSubmit?: (val: string) => void;
|
|
803
826
|
actions?: default_2.ReactNode;
|
|
804
827
|
attachments?: default_2.ReactNode;
|
|
805
828
|
maxRows?: number;
|
|
806
|
-
}
|
|
829
|
+
};
|
|
807
830
|
|
|
808
831
|
export declare const PromptSuggestion: default_2.ForwardRefExoticComponent<PromptSuggestionProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
809
832
|
|
|
@@ -887,14 +910,19 @@ export declare interface SecurityBadgeProps extends Omit<BadgeProps, 'color' | '
|
|
|
887
910
|
|
|
888
911
|
export declare type SecurityLevel = 'verified' | 'unverified' | 'protected' | 'risky';
|
|
889
912
|
|
|
890
|
-
export declare const Select: default_2.ForwardRefExoticComponent<
|
|
913
|
+
export declare const Select: default_2.ForwardRefExoticComponent<Omit<default_2.SelectHTMLAttributes<HTMLSelectElement>, "size"> & {
|
|
914
|
+
inputSize?: PatiyaSize;
|
|
915
|
+
variant?: "outline" | "filled" | "soft";
|
|
916
|
+
invalid?: boolean;
|
|
917
|
+
leftIcon?: default_2.ReactNode;
|
|
918
|
+
} & default_2.RefAttributes<HTMLSelectElement>>;
|
|
891
919
|
|
|
892
|
-
export declare
|
|
920
|
+
export declare type SelectProps = Omit<default_2.SelectHTMLAttributes<HTMLSelectElement>, 'size'> & {
|
|
893
921
|
inputSize?: PatiyaSize;
|
|
894
922
|
variant?: 'outline' | 'filled' | 'soft';
|
|
895
923
|
invalid?: boolean;
|
|
896
924
|
leftIcon?: default_2.ReactNode;
|
|
897
|
-
}
|
|
925
|
+
};
|
|
898
926
|
|
|
899
927
|
export declare type SessionBrowser = 'chrome' | 'safari' | 'firefox' | 'edge' | 'brave' | 'opera' | 'unknown';
|
|
900
928
|
|
package/dist/patiya13.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya13.cjs","names":["forwardRef","cn","Box","require_runtime","require_Box","react","react_jsx_runtime","cnfast","Select","props","selectClassName","inputSize","variant","invalid","leftIcon","className","ChevronIcon"],"sources":["../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport
|
|
1
|
+
{"version":3,"file":"patiya13.cjs","names":["forwardRef","cn","Box","require_runtime","require_Box","react","react_jsx_runtime","cnfast","Select","props","selectClassName","inputSize","variant","invalid","leftIcon","className","ChevronIcon"],"sources":["../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> & {\n inputSize?: PatiyaSize;\n variant?: 'outline' | 'filled' | 'soft';\n invalid?: boolean;\n leftIcon?: React.ReactNode;\n};\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n inputSize = 'md',\n variant = 'outline',\n invalid = false,\n leftIcon,\n disabled,\n children,\n ...props\n },\n ref\n ) => {\n const sizeClasses: Record<PatiyaSize, string> = {\n xs: 'h-7 text-xs px-2',\n sm: 'h-8 text-sm px-3',\n md: 'h-10 text-base px-4',\n lg: 'h-12 text-lg px-4',\n xl: 'h-14 text-xl px-5',\n };\n\n const variantClasses = {\n outline: 'bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]',\n filled: 'bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n soft: 'bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n };\n\n const selectClassName = cn(\n 'appearance-none flex w-full rounded-md transition-all duration-200 outline-none cursor-pointer',\n 'text-[var(--patiya-color-foreground)]',\n 'focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n sizeClasses[inputSize],\n variantClasses[variant],\n invalid && 'border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10',\n leftIcon ? 'pl-10 pr-10' : 'pr-10',\n className\n );\n\n const ChevronIcon = () => (\n <svg className=\"w-4 h-4 text-(--patiya-color-muted-foreground) pointer-events-none absolute right-3\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n );\n\n return (\n <Box className={cn('relative flex items-center w-full', className)}>\n {leftIcon && (\n <span className=\"absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none\">\n {leftIcon}\n </span>\n )}\n <select ref={ref} disabled={disabled} className={selectClassName} {...props}>\n {children}\n </select>\n <ChevronIcon />\n </Box>\n );\n }\n);\n\nSelect.displayName = 'Select';\n"],"mappings":"2JAYA,IAAaQ,GAAA,EAASR,EAAAA,WAAAA,EAElB,CACE,YACA,YAAY,KACZ,UAAU,UACV,UAAU,GACV,WACA,WACA,WACA,GAAGS,GAEL,IACG,CAeH,IAAMC,GAAA,EAAkBT,EAAAA,GAAAA,CACtB,iGACA,wCACA,2DACA,kDACA,CAlBA,GAAI,mBACJ,GAAI,mBACJ,GAAI,sBACJ,GAAI,oBACJ,GAAI,mBAcJ,EAAYU,GACZ,CAXA,QAAS,wIACT,OAAQ,2HACR,KAAM,8HASN,EAAeC,GACfC,GAAW,0IACXC,EAAW,cAAgB,QAC3BC,CACF,EAEMC,OACJ,EAAAV,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,sFAAsF,KAAK,OAAO,OAAO,eAAe,QAAQ,YAAY,MAAM,6BAC/J,UAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,cAAc,QAAQ,eAAe,QAAQ,YAAa,EAAG,EAAE,gBAAkB,CAAA,CACpF,CAAA,EAGP,OACE,EAAAA,EAAA,KAAA,CAACJ,EAAAA,IAAD,CAAK,WAAA,EAAWD,EAAAA,GAAAA,CAAG,oCAAqCc,CAAS,EAAjE,SAAA,CACGD,IACC,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8GACb,SAAAQ,CACG,CAAA,GAER,EAAAR,EAAA,IAAA,CAAC,SAAD,CAAa,MAAe,WAAU,UAAWI,EAAiB,GAAID,EACnE,UACK,CAAA,GACR,EAAAH,EAAA,IAAA,CAACU,EAAD,CAAc,CAAA,CACX,GAET,CACF,EAEA,EAAO,YAAc"}
|
package/dist/patiya13.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya13.mjs","names":["Select","forwardRef","props","selectClassName","cn","inputSize","variant","invalid","leftIcon","className","ChevronIcon","Box"],"sources":["../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport
|
|
1
|
+
{"version":3,"file":"patiya13.mjs","names":["Select","forwardRef","props","selectClassName","cn","inputSize","variant","invalid","leftIcon","className","ChevronIcon","Box"],"sources":["../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> & {\n inputSize?: PatiyaSize;\n variant?: 'outline' | 'filled' | 'soft';\n invalid?: boolean;\n leftIcon?: React.ReactNode;\n};\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n inputSize = 'md',\n variant = 'outline',\n invalid = false,\n leftIcon,\n disabled,\n children,\n ...props\n },\n ref\n ) => {\n const sizeClasses: Record<PatiyaSize, string> = {\n xs: 'h-7 text-xs px-2',\n sm: 'h-8 text-sm px-3',\n md: 'h-10 text-base px-4',\n lg: 'h-12 text-lg px-4',\n xl: 'h-14 text-xl px-5',\n };\n\n const variantClasses = {\n outline: 'bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]',\n filled: 'bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n soft: 'bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n };\n\n const selectClassName = cn(\n 'appearance-none flex w-full rounded-md transition-all duration-200 outline-none cursor-pointer',\n 'text-[var(--patiya-color-foreground)]',\n 'focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n sizeClasses[inputSize],\n variantClasses[variant],\n invalid && 'border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10',\n leftIcon ? 'pl-10 pr-10' : 'pr-10',\n className\n );\n\n const ChevronIcon = () => (\n <svg className=\"w-4 h-4 text-(--patiya-color-muted-foreground) pointer-events-none absolute right-3\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n );\n\n return (\n <Box className={cn('relative flex items-center w-full', className)}>\n {leftIcon && (\n <span className=\"absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none\">\n {leftIcon}\n </span>\n )}\n <select ref={ref} disabled={disabled} className={selectClassName} {...props}>\n {children}\n </select>\n <ChevronIcon />\n </Box>\n );\n }\n);\n\nSelect.displayName = 'Select';\n"],"mappings":";;;;;AAYA,IAAaA,IAASC,GAElB,EACE,cACA,eAAY,MACZ,aAAU,WACV,aAAU,IACV,aACA,aACA,aACA,GAAGC,KAEL,MACG;CAeH,IAAMC,IAAkBC,EACtB,kGACA,yCACA,4DACA,mDACA;EAlBA,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CAcJ,EAAYC,IACZ;EAXA,SAAS;EACT,QAAQ;EACR,MAAM;CASN,EAAeC,IACfC,KAAW,2IACXC,IAAW,gBAAgB,SAC3BC,CACF,GAEMC,UACJ,kBAAC,OAAD;EAAK,WAAU;EAAsF,MAAK;EAAO,QAAO;EAAe,SAAQ;EAAY,OAAM;EAC/J,UAAA,kBAAC,QAAD;GAAM,eAAc;GAAQ,gBAAe;GAAQ,aAAa;GAAG,GAAE;EAAkB,CAAA;CACpF,CAAA;CAGP,OACE,kBAACC,GAAD;EAAK,WAAWP,EAAG,qCAAqCK,CAAS;EAAjE,UAAA;GACGD,KACC,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAA;GACG,CAAA;GAER,kBAAC,UAAD;IAAa;IAAe;IAAU,WAAWL;IAAiB,GAAID;IACnE;GACK,CAAA;GACR,kBAACQ,GAAD,CAAc,CAAA;EACX;;AAET,CACF;AAEA,EAAO,cAAc"}
|
package/dist/patiya20.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs"),n=require("./patiya19.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("@floating-ui/react"),o=require("cnfast");function s({open:e,onOpenChange:n,children:r,side:s=`right
|
|
1
|
+
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs"),n=require("./patiya19.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("@floating-ui/react"),o=require("cnfast");function s({open:e,onOpenChange:n,children:r,side:s=`right`,className:c,overlayClassName:l}){let{refs:u,context:d}=(0,a.useFloating)({open:e,onOpenChange:n}),f=(0,a.useDismiss)(d,{outsidePressEvent:`mousedown`}),p=(0,a.useRole)(d),{getFloatingProps:m}=(0,a.useInteractions)([f,p]),h=e=>{switch(e){case`right`:return`translate3d(100%, 0, 0)`;case`left`:return`translate3d(-100%, 0, 0)`;case`top`:return`translate3d(0, -100%, 0)`;case`bottom`:return`translate3d(0, 100%, 0)`;default:return`translate3d(100%, 0, 0)`}},{isMounted:g,styles:_}=(0,a.useTransitionStyles)(d,{duration:320,initial:{transform:h(s)},open:{transform:`translate3d(0, 0, 0)`},close:{transform:h(s)},common:{transitionProperty:`transform`,transitionTimingFunction:`cubic-bezier(0.32, 0.72, 0, 1)`}}),{styles:v}=(0,a.useTransitionStyles)(d,{duration:320,initial:{opacity:0},open:{opacity:1},close:{opacity:0},common:{transitionProperty:`opacity`,transitionTimingFunction:`ease-out`}}),y={right:`inset-y-0 right-0 h-full w-full max-w-sm border-l sm:max-w-md`,left:`inset-y-0 left-0 h-full w-full max-w-sm border-r sm:max-w-md`,top:`inset-x-0 top-0 w-full max-h-[85vh] border-b shadow-2xl`,bottom:`inset-x-0 bottom-0 w-full max-h-[85vh] border-t rounded-t-2xl shadow-2xl`};return(0,i.jsx)(i.Fragment,{children:g&&(0,i.jsx)(a.FloatingPortal,{children:(0,i.jsx)(a.FloatingOverlay,{style:v,className:(0,o.cn)(`z-50 bg-black/60 backdrop-blur-sm overflow-hidden`,l),lockScroll:!0,children:(0,i.jsx)(a.FloatingFocusManager,{context:d,children:(0,i.jsx)(t.Box,{ref:u.setFloating,...m(),style:{..._,willChange:`transform`},className:(0,o.cn)(`fixed z-50 bg-[var(--patiya-color-background)] p-6 shadow-2xl border-[var(--patiya-color-border)] outline-none flex flex-col overflow-y-auto transform-gpu`,y[s],c),children:r})})})})})}exports.Drawer=s,exports.DrawerDescription=n.ModalDescription,exports.DrawerFooter=n.ModalFooter,exports.DrawerHeader=n.ModalHeader,exports.DrawerTitle=n.ModalTitle;
|
|
2
2
|
//# sourceMappingURL=patiya20.cjs.map
|
package/dist/patiya20.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya20.cjs","names":["useFloating","useDismiss","useRole","useInteractions","
|
|
1
|
+
{"version":3,"file":"patiya20.cjs","names":["useFloating","useDismiss","useRole","useInteractions","useTransitionStyles","_Fragment","FloatingPortal","FloatingOverlay","cn","FloatingFocusManager","Box","require_runtime","require_Box","require_Modal","react","react_jsx_runtime","_floating_ui_react","cnfast","Drawer","dismiss","context","role","getSlideTransform","s","panelStyles","side","overlayStyles","sideClasses","isMounted","overlayClassName","refs","getFloatingProps","className"],"sources":["../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useFloating,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useTransitionStyles\n} from '@floating-ui/react';\nimport { cn } from '../../utils/cn';\nimport { Box } from '../Layout/Box';\n\nexport type DrawerProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: React.ReactNode;\n side?: 'right' | 'left' | 'top' | 'bottom';\n className?: string;\n overlayClassName?: string;\n};\n\nexport function Drawer({\n open,\n onOpenChange,\n children,\n side = 'right',\n className,\n overlayClassName,\n}: DrawerProps) {\n const { refs, context } = useFloating({\n open,\n onOpenChange,\n });\n\n const dismiss = useDismiss(context, { outsidePressEvent: 'mousedown' });\n const role = useRole(context);\n\n const { getFloatingProps } = useInteractions([dismiss, role]);\n\n const getSlideTransform = (s: string) => {\n switch (s) {\n case 'right': return 'translate3d(100%, 0, 0)';\n case 'left': return 'translate3d(-100%, 0, 0)';\n case 'top': return 'translate3d(0, -100%, 0)';\n case 'bottom': return 'translate3d(0, 100%, 0)';\n default: return 'translate3d(100%, 0, 0)';\n }\n };\n\n const { isMounted, styles: panelStyles } = useTransitionStyles(context, {\n duration: 320,\n initial: {\n transform: getSlideTransform(side),\n },\n open: {\n transform: 'translate3d(0, 0, 0)',\n },\n close: {\n transform: getSlideTransform(side),\n },\n common: {\n transitionProperty: 'transform',\n transitionTimingFunction: 'cubic-bezier(0.32, 0.72, 0, 1)',\n },\n });\n\n const { styles: overlayStyles } = useTransitionStyles(context, {\n duration: 320,\n initial: { opacity: 0 },\n open: { opacity: 1 },\n close: { opacity: 0 },\n common: {\n transitionProperty: 'opacity',\n transitionTimingFunction: 'ease-out',\n },\n });\n\n const sideClasses = {\n right: 'inset-y-0 right-0 h-full w-full max-w-sm border-l sm:max-w-md',\n left: 'inset-y-0 left-0 h-full w-full max-w-sm border-r sm:max-w-md',\n top: 'inset-x-0 top-0 w-full max-h-[85vh] border-b shadow-2xl',\n bottom: 'inset-x-0 bottom-0 w-full max-h-[85vh] border-t rounded-t-2xl shadow-2xl',\n };\n\n return (\n <>\n {isMounted && (\n <FloatingPortal>\n <FloatingOverlay\n style={overlayStyles}\n className={cn(\n \"z-50 bg-black/60 backdrop-blur-sm overflow-hidden\",\n overlayClassName\n )}\n lockScroll\n >\n <FloatingFocusManager context={context}>\n <Box\n ref={refs.setFloating}\n {...getFloatingProps()}\n style={{ ...panelStyles, willChange: 'transform' }}\n className={cn(\n \"fixed z-50 bg-[var(--patiya-color-background)] p-6 shadow-2xl border-[var(--patiya-color-border)] outline-none flex flex-col overflow-y-auto transform-gpu\",\n sideClasses[side],\n className\n )}\n >\n {children}\n </Box>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n )}\n </>\n );\n}\n\nexport { ModalHeader as DrawerHeader, ModalTitle as DrawerTitle, ModalDescription as DrawerDescription, ModalFooter as DrawerFooter } from '../Modal/Modal';\n"],"mappings":"uNAuBA,SAAgBkB,EAAO,CACrB,OACA,eACA,WACA,OAAO,QACP,YACA,oBACc,CACd,GAAM,CAAE,OAAM,YAAA,EAAYlB,EAAAA,YAAAA,CAAY,CACpC,OACA,cACF,CAAC,EAEKmB,GAAA,EAAUlB,EAAAA,WAAAA,CAAWmB,EAAS,CAAE,kBAAmB,WAAY,CAAC,EAChEC,GAAA,EAAOnB,EAAAA,QAAAA,CAAQkB,CAAO,EAEtB,CAAE,qBAAA,EAAqBjB,EAAAA,gBAAAA,CAAgB,CAACgB,EAASE,CAAI,CAAC,EAEtDC,EAAqB,GAAc,CACvC,OAAQC,EAAR,CACE,IAAK,QAAS,MAAO,0BACrB,IAAK,OAAQ,MAAO,2BACpB,IAAK,MAAO,MAAO,2BACnB,IAAK,SAAU,MAAO,0BACtB,QAAS,MAAO,yBAClB,CACF,EAEM,CAAE,YAAW,OAAQC,IAAA,EAAgBpB,EAAAA,oBAAAA,CAAoBgB,EAAS,CACtE,SAAU,IACV,QAAS,CACP,UAAWE,EAAkBG,CAAI,CACnC,EACA,KAAM,CACJ,UAAW,sBACb,EACA,MAAO,CACL,UAAWH,EAAkBG,CAAI,CACnC,EACA,OAAQ,CACN,mBAAoB,YACpB,yBAA0B,gCAC5B,CACF,CAAC,EAEK,CAAE,OAAQC,IAAA,EAAkBtB,EAAAA,oBAAAA,CAAoBgB,EAAS,CAC7D,SAAU,IACV,QAAS,CAAE,QAAS,CAAE,EACtB,KAAM,CAAE,QAAS,CAAE,EACnB,MAAO,CAAE,QAAS,CAAE,EACpB,OAAQ,CACN,mBAAoB,UACpB,yBAA0B,UAC5B,CACF,CAAC,EAEKO,EAAc,CAClB,MAAO,gEACP,KAAM,+DACN,IAAK,0DACL,OAAQ,0EACV,EAEA,OACE,EAAAZ,EAAA,IAAA,CAAAV,EAAAA,SAAA,CAAA,SACGuB,IACC,EAAAb,EAAA,IAAA,CAACT,EAAAA,eAAD,CAAA,UACE,EAAAS,EAAA,IAAA,CAACR,EAAAA,gBAAD,CACE,MAAOmB,EACP,WAAA,EAAWlB,EAAAA,GAAAA,CACT,oDACAqB,CACF,EACA,WAAA,GAEA,UAAA,EAAAd,EAAA,IAAA,CAACN,EAAAA,qBAAD,CAA+B,UAC7B,UAAA,EAAAM,EAAA,IAAA,CAACL,EAAAA,IAAD,CACE,IAAKoB,EAAK,YACV,GAAIC,EAAiB,EACrB,MAAO,CAAE,GAAGP,EAAa,WAAY,WAAY,EACjD,WAAA,EAAWhB,EAAAA,GAAAA,CACT,6JACAmB,EAAYF,GACZO,CACF,EAEC,UACE,CAAA,CACe,CAAA,CACP,CAAA,CACH,CAAA,CAElB,CAAA,CAEN"}
|
package/dist/patiya20.mjs
CHANGED
|
@@ -3,35 +3,58 @@ import { Box as t } from "./patiya4.mjs";
|
|
|
3
3
|
import { ModalDescription as n, ModalFooter as r, ModalHeader as i, ModalTitle as a } from "./patiya19.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment as o, jsx as s } from "react/jsx-runtime";
|
|
6
|
-
import { FloatingFocusManager as c, FloatingOverlay as l, FloatingPortal as u, useDismiss as d, useFloating as f, useInteractions as p, useRole as m,
|
|
6
|
+
import { FloatingFocusManager as c, FloatingOverlay as l, FloatingPortal as u, useDismiss as d, useFloating as f, useInteractions as p, useRole as m, useTransitionStyles as h } from "@floating-ui/react";
|
|
7
7
|
//#region src/components/Drawer/Drawer.tsx
|
|
8
|
-
function g({ open: n, onOpenChange: r, children: i, side: a = "right" }) {
|
|
9
|
-
let { refs:
|
|
8
|
+
function g({ open: n, onOpenChange: r, children: i, side: a = "right", className: g, overlayClassName: _ }) {
|
|
9
|
+
let { refs: v, context: y } = f({
|
|
10
10
|
open: n,
|
|
11
11
|
onOpenChange: r
|
|
12
|
-
}),
|
|
13
|
-
right: "inset-y-0 right-0 h-full w-3/4 max-w-sm border-l sm:max-w-sm",
|
|
14
|
-
left: "inset-y-0 left-0 h-full w-3/4 max-w-sm border-r sm:max-w-sm",
|
|
15
|
-
top: "inset-x-0 top-0 w-full border-b",
|
|
16
|
-
bottom: "inset-x-0 bottom-0 w-full border-t"
|
|
17
|
-
}, w = (e) => {
|
|
12
|
+
}), b = d(y, { outsidePressEvent: "mousedown" }), x = m(y), { getFloatingProps: S } = p([b, x]), C = (e) => {
|
|
18
13
|
switch (e) {
|
|
19
|
-
case "right": return "
|
|
20
|
-
case "left": return "-
|
|
21
|
-
case "top": return "-
|
|
22
|
-
case "bottom": return "
|
|
23
|
-
default: return "
|
|
14
|
+
case "right": return "translate3d(100%, 0, 0)";
|
|
15
|
+
case "left": return "translate3d(-100%, 0, 0)";
|
|
16
|
+
case "top": return "translate3d(0, -100%, 0)";
|
|
17
|
+
case "bottom": return "translate3d(0, 100%, 0)";
|
|
18
|
+
default: return "translate3d(100%, 0, 0)";
|
|
24
19
|
}
|
|
20
|
+
}, { isMounted: w, styles: T } = h(y, {
|
|
21
|
+
duration: 320,
|
|
22
|
+
initial: { transform: C(a) },
|
|
23
|
+
open: { transform: "translate3d(0, 0, 0)" },
|
|
24
|
+
close: { transform: C(a) },
|
|
25
|
+
common: {
|
|
26
|
+
transitionProperty: "transform",
|
|
27
|
+
transitionTimingFunction: "cubic-bezier(0.32, 0.72, 0, 1)"
|
|
28
|
+
}
|
|
29
|
+
}), { styles: E } = h(y, {
|
|
30
|
+
duration: 320,
|
|
31
|
+
initial: { opacity: 0 },
|
|
32
|
+
open: { opacity: 1 },
|
|
33
|
+
close: { opacity: 0 },
|
|
34
|
+
common: {
|
|
35
|
+
transitionProperty: "opacity",
|
|
36
|
+
transitionTimingFunction: "ease-out"
|
|
37
|
+
}
|
|
38
|
+
}), D = {
|
|
39
|
+
right: "inset-y-0 right-0 h-full w-full max-w-sm border-l sm:max-w-md",
|
|
40
|
+
left: "inset-y-0 left-0 h-full w-full max-w-sm border-r sm:max-w-md",
|
|
41
|
+
top: "inset-x-0 top-0 w-full max-h-[85vh] border-b shadow-2xl",
|
|
42
|
+
bottom: "inset-x-0 bottom-0 w-full max-h-[85vh] border-t rounded-t-2xl shadow-2xl"
|
|
25
43
|
};
|
|
26
|
-
return /* @__PURE__ */ s(o, { children:
|
|
27
|
-
|
|
44
|
+
return /* @__PURE__ */ s(o, { children: w && /* @__PURE__ */ s(u, { children: /* @__PURE__ */ s(l, {
|
|
45
|
+
style: E,
|
|
46
|
+
className: e("z-50 bg-black/60 backdrop-blur-sm overflow-hidden", _),
|
|
28
47
|
lockScroll: !0,
|
|
29
48
|
children: /* @__PURE__ */ s(c, {
|
|
30
|
-
context:
|
|
49
|
+
context: y,
|
|
31
50
|
children: /* @__PURE__ */ s(t, {
|
|
32
|
-
ref:
|
|
33
|
-
...
|
|
34
|
-
|
|
51
|
+
ref: v.setFloating,
|
|
52
|
+
...S(),
|
|
53
|
+
style: {
|
|
54
|
+
...T,
|
|
55
|
+
willChange: "transform"
|
|
56
|
+
},
|
|
57
|
+
className: e("fixed z-50 bg-[var(--patiya-color-background)] p-6 shadow-2xl border-[var(--patiya-color-border)] outline-none flex flex-col overflow-y-auto transform-gpu", D[a], g),
|
|
35
58
|
children: i
|
|
36
59
|
})
|
|
37
60
|
})
|
package/dist/patiya20.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya20.mjs","names":["_Fragment","Drawer","useFloating","dismiss","useDismiss","context","role","useRole","useInteractions","
|
|
1
|
+
{"version":3,"file":"patiya20.mjs","names":["_Fragment","Drawer","useFloating","dismiss","useDismiss","context","role","useRole","useInteractions","getSlideTransform","s","panelStyles","useTransitionStyles","side","overlayStyles","sideClasses","Fragment","isMounted","FloatingPortal","FloatingOverlay","cn","overlayClassName","FloatingFocusManager","Box","refs","getFloatingProps","className","ModalDescription","ModalFooter","ModalHeader","ModalTitle"],"sources":["../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useFloating,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useTransitionStyles\n} from '@floating-ui/react';\nimport { cn } from '../../utils/cn';\nimport { Box } from '../Layout/Box';\n\nexport type DrawerProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: React.ReactNode;\n side?: 'right' | 'left' | 'top' | 'bottom';\n className?: string;\n overlayClassName?: string;\n};\n\nexport function Drawer({\n open,\n onOpenChange,\n children,\n side = 'right',\n className,\n overlayClassName,\n}: DrawerProps) {\n const { refs, context } = useFloating({\n open,\n onOpenChange,\n });\n\n const dismiss = useDismiss(context, { outsidePressEvent: 'mousedown' });\n const role = useRole(context);\n\n const { getFloatingProps } = useInteractions([dismiss, role]);\n\n const getSlideTransform = (s: string) => {\n switch (s) {\n case 'right': return 'translate3d(100%, 0, 0)';\n case 'left': return 'translate3d(-100%, 0, 0)';\n case 'top': return 'translate3d(0, -100%, 0)';\n case 'bottom': return 'translate3d(0, 100%, 0)';\n default: return 'translate3d(100%, 0, 0)';\n }\n };\n\n const { isMounted, styles: panelStyles } = useTransitionStyles(context, {\n duration: 320,\n initial: {\n transform: getSlideTransform(side),\n },\n open: {\n transform: 'translate3d(0, 0, 0)',\n },\n close: {\n transform: getSlideTransform(side),\n },\n common: {\n transitionProperty: 'transform',\n transitionTimingFunction: 'cubic-bezier(0.32, 0.72, 0, 1)',\n },\n });\n\n const { styles: overlayStyles } = useTransitionStyles(context, {\n duration: 320,\n initial: { opacity: 0 },\n open: { opacity: 1 },\n close: { opacity: 0 },\n common: {\n transitionProperty: 'opacity',\n transitionTimingFunction: 'ease-out',\n },\n });\n\n const sideClasses = {\n right: 'inset-y-0 right-0 h-full w-full max-w-sm border-l sm:max-w-md',\n left: 'inset-y-0 left-0 h-full w-full max-w-sm border-r sm:max-w-md',\n top: 'inset-x-0 top-0 w-full max-h-[85vh] border-b shadow-2xl',\n bottom: 'inset-x-0 bottom-0 w-full max-h-[85vh] border-t rounded-t-2xl shadow-2xl',\n };\n\n return (\n <>\n {isMounted && (\n <FloatingPortal>\n <FloatingOverlay\n style={overlayStyles}\n className={cn(\n \"z-50 bg-black/60 backdrop-blur-sm overflow-hidden\",\n overlayClassName\n )}\n lockScroll\n >\n <FloatingFocusManager context={context}>\n <Box\n ref={refs.setFloating}\n {...getFloatingProps()}\n style={{ ...panelStyles, willChange: 'transform' }}\n className={cn(\n \"fixed z-50 bg-[var(--patiya-color-background)] p-6 shadow-2xl border-[var(--patiya-color-border)] outline-none flex flex-col overflow-y-auto transform-gpu\",\n sideClasses[side],\n className\n )}\n >\n {children}\n </Box>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n )}\n </>\n );\n}\n\nexport { ModalHeader as DrawerHeader, ModalTitle as DrawerTitle, ModalDescription as DrawerDescription, ModalFooter as DrawerFooter } from '../Modal/Modal';\n"],"mappings":";;;;;;;AAuBA,SAAgBC,EAAO,EACrB,SACA,iBACA,aACA,UAAO,SACP,cACA,uBACc;CACd,IAAM,EAAE,SAAM,eAAYC,EAAY;EACpC;EACA;CACF,CAAC,GAEKC,IAAUC,EAAWC,GAAS,EAAE,mBAAmB,YAAY,CAAC,GAChEC,IAAOC,EAAQF,CAAO,GAEtB,EAAE,wBAAqBG,EAAgB,CAACL,GAASG,CAAI,CAAC,GAEtDG,KAAqB,MAAc;EACvC,QAAQC,GAAR;GACE,KAAK,SAAS,OAAO;GACrB,KAAK,QAAQ,OAAO;GACpB,KAAK,OAAO,OAAO;GACnB,KAAK,UAAU,OAAO;GACtB,SAAS,OAAO;EAClB;CACF,GAEM,EAAE,cAAW,QAAQC,MAAgBC,EAAoBP,GAAS;EACtE,UAAU;EACV,SAAS,EACP,WAAWI,EAAkBI,CAAI,EACnC;EACA,MAAM,EACJ,WAAW,uBACb;EACA,OAAO,EACL,WAAWJ,EAAkBI,CAAI,EACnC;EACA,QAAQ;GACN,oBAAoB;GACpB,0BAA0B;EAC5B;CACF,CAAC,GAEK,EAAE,QAAQC,MAAkBF,EAAoBP,GAAS;EAC7D,UAAU;EACV,SAAS,EAAE,SAAS,EAAE;EACtB,MAAM,EAAE,SAAS,EAAE;EACnB,OAAO,EAAE,SAAS,EAAE;EACpB,QAAQ;GACN,oBAAoB;GACpB,0BAA0B;EAC5B;CACF,CAAC,GAEKU,IAAc;EAClB,OAAO;EACP,MAAM;EACN,KAAK;EACL,QAAQ;CACV;CAEA,OACE,kBAAAf,GAAA,EAAA,UACGiB,KACC,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD;EACE,OAAOL;EACP,WAAWM,EACT,qDACAC,CACF;EACA,YAAA;EAEA,UAAA,kBAACC,GAAD;GAA+B;GAC7B,UAAA,kBAACC,GAAD;IACE,KAAKC,EAAK;IACV,GAAIC,EAAiB;IACrB,OAAO;KAAE,GAAGd;KAAa,YAAY;IAAY;IACjD,WAAWS,EACT,8JACAL,EAAYF,IACZa,CACF;IAEC;GACE,CAAA;EACe,CAAA;CACP,CAAA,EACH,CAAA,EAElB,CAAA;AAEN"}
|
package/dist/patiya63.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs"),n=require("./patiya62.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("cnfast");var o=(0,r.forwardRef)(({className:e,onValueSubmit:o,actions:s,attachments:c,maxRows:l=6,value:u,onChange:d,placeholder:f=`Type a message...`,...p},m)=>{let h=(0,r.useRef)(null),g=m||h,[_,v]=(0,r.useState)(``),y=u!==void 0,b=y?u:_;return(0,i.jsxs)(t.Box,{className:(0,a.cn)(`relative flex flex-col w-full border border-[var(--patiya-color-border)] rounded-2xl bg-[var(--patiya-color-background)] focus-within:ring-2 focus-within:ring-[var(--patiya-color-primary)]/20 focus-within:border-[var(--patiya-color-primary)] transition-all overflow-hidden shadow-sm`,e),children:[c&&(0,i.jsx)(t.Box,{className:`flex flex-wrap gap-2 p-3 pb-0`,children:c}),(0,i.jsx)(`textarea`,{ref:g,value:b,onChange:e=>{y||v(e.target.value),d?.(e);let t=e.target;t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,l*24+16)}px`},onKeyDown:e=>{if(e.key===`Enter`&&!e.shiftKey){e.preventDefault();let t=b;t.trim()&&o&&(o(t),y||v(``),g.current&&(g.current.style.height=`auto`))}},placeholder:f,className:`w-full min-h-[56px] max-h-[200px] resize-none bg-transparent px-4 py-4 outline-none text-sm placeholder:text-[var(--patiya-color-muted-foreground)] custom-scrollbar`,rows:1,...p}),(0,i.jsxs)(t.Box,{className:`flex items-center justify-between px-3 pb-3 pt-1`,children:[(0,i.jsx)(t.Box,{className:`flex items-center gap-2`,children:s}),(0,i.jsx)(n.Button,{size:`sm`,color:`primary`,className:`rounded-xl px-3 h-8 shrink-0`,disabled:!b||!b.trim(),onClick:()=>{o&&b&&(o(b),y||v(``),g.current&&(g.current.style.height=`auto`))},children:(0,i.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,i.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,i.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})});o.displayName=`PromptInput`,exports.PromptInput=o;
|
|
1
|
+
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs"),n=require("./patiya62.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("cnfast");var o=(0,r.forwardRef)(({className:e,onValueSubmit:o,actions:s,attachments:c,maxRows:l=6,value:u,onChange:d,placeholder:f=`Type a message...`,...p},m)=>{let h=(0,r.useRef)(null),g=m||h,[_,v]=(0,r.useState)(``),y=u!==void 0,b=y?u:_;return(0,i.jsxs)(t.Box,{className:(0,a.cn)(`relative flex flex-col w-full border border-[var(--patiya-color-border)] rounded-2xl bg-[var(--patiya-color-background)] focus-within:ring-2 focus-within:ring-[var(--patiya-color-primary)]/20 focus-within:border-[var(--patiya-color-primary)] transition-all overflow-hidden shadow-sm`,e),children:[c&&(0,i.jsx)(t.Box,{className:`flex flex-wrap gap-2 p-3 pb-0`,children:c}),(0,i.jsx)(`textarea`,{ref:g,value:b,onChange:e=>{y||v(e.target.value),d?.(e);let t=e.target;t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,l*24+16)}px`},onKeyDown:e=>{if(e.key===`Enter`&&!e.shiftKey){e.preventDefault();let t=b;t.trim()&&o&&(o(t),y||v(``),g.current&&(g.current.style.height=`auto`))}},placeholder:f,className:`w-full min-h-[56px] max-h-[200px] resize-none bg-transparent px-4 py-4 outline-none text-sm placeholder:text-[var(--patiya-color-muted-foreground)] custom-scrollbar`,rows:1,...p}),(0,i.jsxs)(t.Box,{className:`flex items-center justify-between px-3 pb-3 pt-1`,children:[(0,i.jsx)(t.Box,{className:`flex items-center gap-2`,children:s}),(0,i.jsx)(n.Button,{size:`sm`,color:`primary`,className:`rounded-xl px-3 h-8 shrink-0`,"aria-label":`Send message`,disabled:!b||!b.trim(),onClick:()=>{o&&b&&(o(b),y||v(``),g.current&&(g.current.style.height=`auto`))},children:(0,i.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,i.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,i.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})});o.displayName=`PromptInput`,exports.PromptInput=o;
|
|
2
2
|
//# sourceMappingURL=patiya63.cjs.map
|
package/dist/patiya63.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya63.cjs","names":["forwardRef","useRef","useState","Box","cn","Button","require_runtime","require_Box","require_Button","react","react_jsx_runtime","cnfast","PromptInput","props","internalRef","textAreaRef","ref","internalVal","setInternalVal","isControlled","value","val","className","attachments","onChange","target","maxRows","v","onValueSubmit","actions"],"sources":["../src/components/PromptInput/PromptInput.tsx"],"sourcesContent":["import React, { forwardRef, useState, useRef } from 'react';\nimport { Box } from '../Layout/Box';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button/Button';\n\nexport
|
|
1
|
+
{"version":3,"file":"patiya63.cjs","names":["forwardRef","useRef","useState","Box","cn","Button","require_runtime","require_Box","require_Button","react","react_jsx_runtime","cnfast","PromptInput","props","internalRef","textAreaRef","ref","internalVal","setInternalVal","isControlled","value","val","className","attachments","onChange","target","maxRows","v","onValueSubmit","actions"],"sources":["../src/components/PromptInput/PromptInput.tsx"],"sourcesContent":["import React, { forwardRef, useState, useRef } from 'react';\nimport { Box } from '../Layout/Box';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button/Button';\n\nexport type PromptInputProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n onValueSubmit?: (val: string) => void;\n actions?: React.ReactNode;\n attachments?: React.ReactNode;\n maxRows?: number;\n};\n\nexport const PromptInput = forwardRef<HTMLTextAreaElement, PromptInputProps>(\n ({ className, onValueSubmit, actions, attachments, maxRows = 6, value, onChange, placeholder = 'Type a message...', ...props }, ref) => {\n const internalRef = useRef<HTMLTextAreaElement>(null);\n const textAreaRef = (ref as React.MutableRefObject<HTMLTextAreaElement>) || internalRef;\n const [internalVal, setInternalVal] = useState('');\n\n const isControlled = value !== undefined;\n const val = isControlled ? value : internalVal;\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled) setInternalVal(e.target.value);\n onChange?.(e);\n const target = e.target;\n target.style.height = 'auto';\n target.style.height = `${Math.min(target.scrollHeight, maxRows * 24 + 16)}px`;\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n const v = val as string;\n if (v.trim() && onValueSubmit) {\n onValueSubmit(v);\n if (!isControlled) setInternalVal('');\n if (textAreaRef.current) {\n textAreaRef.current.style.height = 'auto';\n }\n }\n }\n };\n\n return (\n <Box className={cn(\"relative flex flex-col w-full border border-[var(--patiya-color-border)] rounded-2xl bg-[var(--patiya-color-background)] focus-within:ring-2 focus-within:ring-[var(--patiya-color-primary)]/20 focus-within:border-[var(--patiya-color-primary)] transition-all overflow-hidden shadow-sm\", className)}>\n {attachments && (\n <Box className=\"flex flex-wrap gap-2 p-3 pb-0\">\n {attachments}\n </Box>\n )}\n <textarea\n ref={textAreaRef}\n value={val}\n onChange={handleInput}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n className=\"w-full min-h-[56px] max-h-[200px] resize-none bg-transparent px-4 py-4 outline-none text-sm placeholder:text-[var(--patiya-color-muted-foreground)] custom-scrollbar\"\n rows={1}\n {...props}\n />\n <Box className=\"flex items-center justify-between px-3 pb-3 pt-1\">\n <Box className=\"flex items-center gap-2\">\n {actions}\n </Box>\n <Button \n size=\"sm\" \n color=\"primary\" \n className=\"rounded-xl px-3 h-8 shrink-0\" \n aria-label=\"Send message\"\n disabled={!val || !(val as string).trim()}\n onClick={() => {\n if (onValueSubmit && val) {\n onValueSubmit(val as string);\n if (!isControlled) setInternalVal('');\n if (textAreaRef.current) textAreaRef.current.style.height = 'auto';\n }\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"m22 2-7 20-4-9-9-4Z\"/><path d=\"M22 2 11 13\"/></svg>\n </Button>\n </Box>\n </Box>\n );\n }\n);\nPromptInput.displayName = 'PromptInput';\n"],"mappings":"uLAYA,IAAaY,GAAA,EAAcZ,EAAAA,WAAAA,EACxB,CAAE,YAAW,gBAAe,UAAS,cAAa,UAAU,EAAG,QAAO,WAAU,cAAc,oBAAqB,GAAGa,GAAS,IAAQ,CACtI,IAAMC,GAAA,EAAcb,EAAAA,OAAAA,CAA4B,IAAI,EAC9Cc,EAAeC,GAAuDF,EACtE,CAACG,EAAaC,IAAA,EAAkBhB,EAAAA,SAAAA,CAAS,EAAE,EAE3CiB,EAAeC,IAAU,IAAA,GACzBC,EAAMF,EAAeC,EAAQH,EAwBnC,OACE,EAAAP,EAAA,KAAA,CAACP,EAAAA,IAAD,CAAK,WAAA,EAAWC,EAAAA,GAAAA,CAAG,6RAA8RkB,CAAS,EAA1T,SAAA,CACGC,IACC,EAAAb,EAAA,IAAA,CAACP,EAAAA,IAAD,CAAK,UAAU,gCACZ,SAAAoB,CACE,CAAA,GAEP,EAAAb,EAAA,IAAA,CAAC,WAAD,CACE,IAAKK,EACL,MAAOM,EACP,SAhCe,GAA8C,CAC5DF,GAAcD,EAAe,EAAE,OAAO,KAAK,EAChDM,IAAW,CAAC,EACZ,IAAMC,EAAS,EAAE,OACjB,EAAO,MAAM,OAAS,OACtB,EAAO,MAAM,OAAS,GAAG,KAAK,IAAIA,EAAO,aAAcC,EAAU,GAAK,EAAE,EAAE,GAC5E,EA2BM,UAzBiB,GAAgD,CACrE,GAAI,EAAE,MAAQ,SAAW,CAAC,EAAE,SAAU,CACpC,EAAE,eAAe,EACjB,IAAMC,EAAIN,EACNM,EAAE,KAAK,GAAKC,IACdA,EAAcD,CAAC,EACVR,GAAcD,EAAe,EAAE,EAChCH,EAAY,UACd,EAAY,QAAQ,MAAM,OAAS,QAGzC,CACF,EAcmB,cACb,UAAU,uKACV,KAAM,EACN,GAAIF,CACL,CAAA,GACD,EAAAH,EAAA,KAAA,CAACP,EAAAA,IAAD,CAAK,UAAU,mDAAf,SAAA,EACE,EAAAO,EAAA,IAAA,CAACP,EAAAA,IAAD,CAAK,UAAU,0BACZ,SAAA0B,CACE,CAAA,GACL,EAAAnB,EAAA,IAAA,CAACL,EAAAA,OAAD,CACE,KAAK,KACL,MAAM,UACN,UAAU,+BACV,aAAW,eACX,SAAU,CAACgB,GAAO,CAAEA,EAAe,KAAK,EACxC,YAAe,CACTO,GAAiBP,IACnBO,EAAcP,CAAa,EACtBF,GAAcD,EAAe,EAAE,EAChCH,EAAY,UAAS,EAAY,QAAQ,MAAM,OAAS,QAEhE,EAEA,UAAA,EAAAL,EAAA,KAAA,CAAC,MAAD,CAAK,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAA1K,SAAA,EAAkL,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,qBAAsB,CAAA,GAAC,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,aAAc,CAAA,CAAM,GACvO,CAAA,CACL,GACF,GAET,CACF,EACA,EAAY,YAAc"}
|
package/dist/patiya63.mjs
CHANGED
|
@@ -42,6 +42,7 @@ var c = r(({ className: r, onValueSubmit: c, actions: l, attachments: u, maxRows
|
|
|
42
42
|
size: "sm",
|
|
43
43
|
color: "primary",
|
|
44
44
|
className: "rounded-xl px-3 h-8 shrink-0",
|
|
45
|
+
"aria-label": "Send message",
|
|
45
46
|
disabled: !S || !S.trim(),
|
|
46
47
|
onClick: () => {
|
|
47
48
|
c && S && (c(S), x || b(""), v.current && (v.current.style.height = "auto"));
|
package/dist/patiya63.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya63.mjs","names":["PromptInput","forwardRef","props","internalRef","useRef","textAreaRef","ref","internalVal","setInternalVal","useState","isControlled","value","val","Box","cn","className","attachments","onChange","target","maxRows","v","onValueSubmit","actions","Button"],"sources":["../src/components/PromptInput/PromptInput.tsx"],"sourcesContent":["import React, { forwardRef, useState, useRef } from 'react';\nimport { Box } from '../Layout/Box';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button/Button';\n\nexport
|
|
1
|
+
{"version":3,"file":"patiya63.mjs","names":["PromptInput","forwardRef","props","internalRef","useRef","textAreaRef","ref","internalVal","setInternalVal","useState","isControlled","value","val","Box","cn","className","attachments","onChange","target","maxRows","v","onValueSubmit","actions","Button"],"sources":["../src/components/PromptInput/PromptInput.tsx"],"sourcesContent":["import React, { forwardRef, useState, useRef } from 'react';\nimport { Box } from '../Layout/Box';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button/Button';\n\nexport type PromptInputProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n onValueSubmit?: (val: string) => void;\n actions?: React.ReactNode;\n attachments?: React.ReactNode;\n maxRows?: number;\n};\n\nexport const PromptInput = forwardRef<HTMLTextAreaElement, PromptInputProps>(\n ({ className, onValueSubmit, actions, attachments, maxRows = 6, value, onChange, placeholder = 'Type a message...', ...props }, ref) => {\n const internalRef = useRef<HTMLTextAreaElement>(null);\n const textAreaRef = (ref as React.MutableRefObject<HTMLTextAreaElement>) || internalRef;\n const [internalVal, setInternalVal] = useState('');\n\n const isControlled = value !== undefined;\n const val = isControlled ? value : internalVal;\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled) setInternalVal(e.target.value);\n onChange?.(e);\n const target = e.target;\n target.style.height = 'auto';\n target.style.height = `${Math.min(target.scrollHeight, maxRows * 24 + 16)}px`;\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n const v = val as string;\n if (v.trim() && onValueSubmit) {\n onValueSubmit(v);\n if (!isControlled) setInternalVal('');\n if (textAreaRef.current) {\n textAreaRef.current.style.height = 'auto';\n }\n }\n }\n };\n\n return (\n <Box className={cn(\"relative flex flex-col w-full border border-[var(--patiya-color-border)] rounded-2xl bg-[var(--patiya-color-background)] focus-within:ring-2 focus-within:ring-[var(--patiya-color-primary)]/20 focus-within:border-[var(--patiya-color-primary)] transition-all overflow-hidden shadow-sm\", className)}>\n {attachments && (\n <Box className=\"flex flex-wrap gap-2 p-3 pb-0\">\n {attachments}\n </Box>\n )}\n <textarea\n ref={textAreaRef}\n value={val}\n onChange={handleInput}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n className=\"w-full min-h-[56px] max-h-[200px] resize-none bg-transparent px-4 py-4 outline-none text-sm placeholder:text-[var(--patiya-color-muted-foreground)] custom-scrollbar\"\n rows={1}\n {...props}\n />\n <Box className=\"flex items-center justify-between px-3 pb-3 pt-1\">\n <Box className=\"flex items-center gap-2\">\n {actions}\n </Box>\n <Button \n size=\"sm\" \n color=\"primary\" \n className=\"rounded-xl px-3 h-8 shrink-0\" \n aria-label=\"Send message\"\n disabled={!val || !(val as string).trim()}\n onClick={() => {\n if (onValueSubmit && val) {\n onValueSubmit(val as string);\n if (!isControlled) setInternalVal('');\n if (textAreaRef.current) textAreaRef.current.style.height = 'auto';\n }\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"m22 2-7 20-4-9-9-4Z\"/><path d=\"M22 2 11 13\"/></svg>\n </Button>\n </Box>\n </Box>\n );\n }\n);\nPromptInput.displayName = 'PromptInput';\n"],"mappings":";;;;;;AAYA,IAAaA,IAAcC,GACxB,EAAE,cAAW,kBAAe,YAAS,gBAAa,aAAU,GAAG,UAAO,aAAU,iBAAc,qBAAqB,GAAGC,KAAS,MAAQ;CACtI,IAAMC,IAAcC,EAA4B,IAAI,GAC9CC,IAAeC,KAAuDH,GACtE,CAACI,GAAaC,KAAkBC,EAAS,EAAE,GAE3CC,IAAeC,MAAU,KAAA,GACzBC,IAAMF,IAAeC,IAAQJ;CAwBnC,OACE,kBAACM,GAAD;EAAK,WAAWC,EAAG,8RAA8RC,CAAS;EAA1T,UAAA;GACGC,KACC,kBAACH,GAAD;IAAK,WAAU;IACZ,UAAAG;GACE,CAAA;GAEP,kBAAC,YAAD;IACE,KAAKX;IACL,OAAOO;IACP,WAhCe,MAA8C;KAEjE,AADKF,KAAcF,EAAe,EAAE,OAAO,KAAK,GAChDS,IAAW,CAAC;KACZ,IAAMC,IAAS,EAAE;KAEjB,AADA,EAAO,MAAM,SAAS,QACtB,EAAO,MAAM,SAAS,GAAG,KAAK,IAAIA,EAAO,cAAcC,IAAU,KAAK,EAAE,EAAE;IAC5E;IA2BM,YAzBiB,MAAgD;KACrE,IAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;MACpC,EAAE,eAAe;MACjB,IAAMC,IAAIR;MACV,AAAIQ,EAAE,KAAK,KAAKC,MACdA,EAAcD,CAAC,GACVV,KAAcF,EAAe,EAAE,GAChCH,EAAY,YACd,EAAY,QAAQ,MAAM,SAAS;KAGzC;IACF;IAcmB;IACb,WAAU;IACV,MAAM;IACN,GAAIH;GACL,CAAA;GACD,kBAACW,GAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACA,GAAD;KAAK,WAAU;KACZ,UAAAS;IACE,CAAA,GACL,kBAACC,GAAD;KACE,MAAK;KACL,OAAM;KACN,WAAU;KACV,cAAW;KACX,UAAU,CAACX,KAAO,CAAEA,EAAe,KAAK;KACxC,eAAe;MACb,AAAIS,KAAiBT,MACnBS,EAAcT,CAAa,GACtBF,KAAcF,EAAe,EAAE,GAChCH,EAAY,YAAS,EAAY,QAAQ,MAAM,SAAS;KAEhE;KAEA,UAAA,kBAAC,OAAD;MAAK,OAAM;MAA6B,OAAM;MAAK,QAAO;MAAK,SAAQ;MAAY,MAAK;MAAO,QAAO;MAAe,aAAY;MAAI,eAAc;MAAQ,gBAAe;MAA1K,UAAA,CAAkL,kBAAC,QAAD,EAAM,GAAE,sBAAsB,CAAA,GAAC,kBAAC,QAAD,EAAM,GAAE,cAAc,CAAA,CAAM;;IACvO,CAAA,CACL;;EACF;;AAET,CACF;AACA,EAAY,cAAc"}
|
package/dist/patiya8.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime"),i=require("cnfast");var a=(0,n.forwardRef)(({className:e,inputSize:
|
|
1
|
+
const e=require("./patiya2.cjs"),t=require("./patiya4.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime"),i=require("cnfast");var a=()=>(0,r.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`path`,{d:`M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z`}),(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),o=()=>(0,r.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`path`,{d:`M9.88 9.88a3 3 0 1 0 4.24 4.24`}),(0,r.jsx)(`path`,{d:`M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68`}),(0,r.jsx)(`path`,{d:`M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61`}),(0,r.jsx)(`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`})]}),s=(0,n.forwardRef)(({className:e,inputSize:s=`md`,variant:c=`outline`,invalid:l=!1,leftIcon:u,rightIcon:d,disabled:f,type:p=`text`,showPasswordToggle:m=!1,eyeIcon:h,eyeOffIcon:g,clearable:_=!1,onClear:v,value:y,defaultValue:b,onChange:x,...S},C)=>{let w=(0,n.useRef)(null);(0,n.useImperativeHandle)(C,()=>w.current);let[T,E]=(0,n.useState)(!1),[D,O]=(0,n.useState)(b??``),k=y!==void 0,A=k?y:D,j=A!=null&&A!==``,M=e=>{k||O(e.target.value),x?.(e)},N=()=>{if(k||O(``),w.current){w.current.value=``;let e=new Event(`input`,{bubbles:!0});w.current.dispatchEvent(e),w.current.focus()}v?.()},P=p===`password`,F=P&&T?`text`:p,I=d;I||(P&&m?I=(0,r.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>E(e=>!e),"aria-label":T?`Hide password`:`Show password`,className:`cursor-pointer text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors`,children:T?g||(0,r.jsx)(o,{}):h||(0,r.jsx)(a,{})}):_&&j&&(I=(0,r.jsx)(`button`,{type:`button`,disabled:f,onClick:N,"aria-label":`Clear input`,className:`cursor-pointer text-xs px-1 text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors`,children:`✕`})));let L=(0,i.cn)(`flex w-full rounded-md transition-all duration-200 outline-none`,`text-[var(--patiya-color-foreground)] placeholder:text-(--patiya-color-muted-foreground)`,`focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10`,`disabled:cursor-not-allowed disabled:opacity-50`,{xs:`h-7 text-xs px-2`,sm:`h-8 text-sm px-3`,md:`h-10 text-base px-4`,lg:`h-12 text-lg px-4`,xl:`h-14 text-xl px-5`}[s],{outline:`bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]`,filled:`bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]`,soft:`bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]`}[c],l&&`border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10`,u&&`pl-10`,I&&`pr-10`,!u&&!I&&e);return u||I?(0,r.jsxs)(t.Box,{className:(0,i.cn)(`relative flex items-center w-full`,e),children:[u&&(0,r.jsx)(`span`,{className:`absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none`,children:u}),(0,r.jsx)(`input`,{ref:w,type:F,disabled:f,value:y,defaultValue:b,onChange:M,className:(0,i.cn)(L,`w-full`),...S}),I&&(0,r.jsx)(`span`,{className:`absolute right-3 flex items-center justify-center text-(--patiya-color-muted-foreground)`,children:I})]}):(0,r.jsx)(`input`,{ref:w,type:F,disabled:f,value:y,defaultValue:b,onChange:M,className:L,...S})});s.displayName=`Input`,exports.Input=s;
|
|
2
2
|
//# sourceMappingURL=patiya8.cjs.map
|
package/dist/patiya8.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patiya8.cjs","names":["forwardRef","cn","Box","require_runtime","require_Box","react","react_jsx_runtime","cnfast","Input","props","inputClassName","inputSize","variant","invalid","leftIcon","rightIcon","className"],"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n inputSize?: PatiyaSize;\n variant?: 'outline' | 'filled' | 'soft';\n invalid?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n inputSize = 'md',\n variant = 'outline',\n invalid = false,\n leftIcon,\n rightIcon,\n disabled,\n ...props\n },\n ref\n ) => {\n const sizeClasses: Record<PatiyaSize, string> = {\n xs: 'h-7 text-xs px-2',\n sm: 'h-8 text-sm px-3',\n md: 'h-10 text-base px-4',\n lg: 'h-12 text-lg px-4',\n xl: 'h-14 text-xl px-5',\n };\n\n const variantClasses = {\n outline: 'bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]',\n filled: 'bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n soft: 'bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n };\n\n const inputClassName = cn(\n 'flex w-full rounded-md transition-all duration-200 outline-none',\n 'text-[var(--patiya-color-foreground)] placeholder:text-(--patiya-color-muted-foreground)',\n 'focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n sizeClasses[inputSize],\n variantClasses[variant],\n invalid && 'border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10',\n leftIcon && 'pl-10',\n rightIcon && 'pr-10',\n !leftIcon && !rightIcon && className // only apply className directly to input if no wrapper\n );\n\n if (leftIcon || rightIcon) {\n return (\n <Box className={cn('relative flex items-center w-full', className)}>\n {leftIcon && (\n <span className=\"absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none\">\n {leftIcon}\n </span>\n )}\n <input ref={ref} disabled={disabled} className={cn(inputClassName, 'w-full')} {...props} />\n {rightIcon && (\n <span className=\"absolute right-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none\">\n {rightIcon}\n </span>\n )}\n </Box>\n );\n }\n\n return <input ref={ref} disabled={disabled} className={inputClassName} {...props} />;\n }\n);\n\nInput.displayName = 'Input';\n"],"mappings":"2JAaA,IAAaQ,GAAA,EAAQR,EAAAA,WAAAA,EAEjB,CACE,YACA,YAAY,KACZ,UAAU,UACV,UAAU,GACV,WACA,YACA,WACA,GAAGS,GAEL,IACG,CAeH,IAAMC,GAAA,EAAiBT,EAAAA,GAAAA,CACrB,kEACA,2FACA,2DACA,kDACA,CAlBA,GAAI,mBACJ,GAAI,mBACJ,GAAI,sBACJ,GAAI,oBACJ,GAAI,mBAcJ,EAAYU,GACZ,CAXA,QAAS,wIACT,OAAQ,2HACR,KAAM,8HASN,EAAeC,GACfC,GAAW,0IACXC,GAAY,QACZC,GAAa,QACb,CAACD,GAAY,CAACC,GAAaC,CAC7B,EAoBA,OAlBIF,GAAYC,GAEZ,EAAAT,EAAA,KAAA,CAACJ,EAAAA,IAAD,CAAK,WAAA,EAAWD,EAAAA,GAAAA,CAAG,oCAAqCe,CAAS,EAAjE,SAAA,CACGF,IACC,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8GACb,SAAAQ,CACG,CAAA,GAER,EAAAR,EAAA,IAAA,CAAC,QAAD,CAAY,MAAe,WAAU,WAAA,EAAWL,EAAAA,GAAAA,CAAGS,EAAgB,QAAQ,EAAG,GAAID,CAAQ,CAAA,EACzFM,IACC,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+GACb,SAAAS,CACG,CAAA,CAEL,KAIF,EAAAT,EAAA,IAAA,CAAC,QAAD,CAAY,MAAe,WAAU,UAAWI,EAAgB,GAAID,CAAQ,CAAA,CACrF,CACF,EAEA,EAAM,YAAc"}
|
|
1
|
+
{"version":3,"file":"patiya8.cjs","names":["forwardRef","useRef","useState","cn","Box","require_runtime","require_Box","react","react_jsx_runtime","cnfast","DefaultEyeIcon","DefaultEyeOffIcon","Input","props","internalInputRef","ref","showPassword","setShowPassword","internalValue","setInternalValue","defaultValue","isControlled","value","currentVal","hasValue","handleInputChange","onChange","handleClear","syntheticEvent","onClear","isPassword","type","computedType","computedRightIcon","rightIcon","showPasswordToggle","prev","eyeOffIcon","eyeIcon","clearable","inputClassName","inputSize","variant","invalid","leftIcon","className"],"sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import React, { forwardRef, useState, useRef, useImperativeHandle } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PatiyaSize } from '../../types/common';\nimport { Box } from '../Layout/Box';\n\nexport type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {\n inputSize?: PatiyaSize;\n variant?: 'outline' | 'filled' | 'soft';\n invalid?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n showPasswordToggle?: boolean;\n eyeIcon?: React.ReactNode;\n eyeOffIcon?: React.ReactNode;\n clearable?: boolean;\n onClear?: () => void;\n};\n\nconst DefaultEyeIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nconst DefaultEyeOffIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M9.88 9.88a3 3 0 1 0 4.24 4.24\" />\n <path d=\"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68\" />\n <path d=\"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n);\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n inputSize = 'md',\n variant = 'outline',\n invalid = false,\n leftIcon,\n rightIcon,\n disabled,\n type = 'text',\n showPasswordToggle = false,\n eyeIcon,\n eyeOffIcon,\n clearable = false,\n onClear,\n value,\n defaultValue,\n onChange,\n ...props\n },\n ref\n ) => {\n const internalInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => internalInputRef.current as HTMLInputElement);\n\n const [showPassword, setShowPassword] = useState(false);\n const [internalValue, setInternalValue] = useState(defaultValue ?? '');\n\n const isControlled = value !== undefined;\n const currentVal = isControlled ? value : internalValue;\n const hasValue = currentVal !== undefined && currentVal !== null && currentVal !== '';\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setInternalValue(e.target.value);\n }\n onChange?.(e);\n };\n\n const handleClear = () => {\n if (!isControlled) {\n setInternalValue('');\n }\n if (internalInputRef.current) {\n internalInputRef.current.value = '';\n const syntheticEvent = new Event('input', { bubbles: true });\n internalInputRef.current.dispatchEvent(syntheticEvent);\n internalInputRef.current.focus();\n }\n onClear?.();\n };\n\n const isPassword = type === 'password';\n const computedType = isPassword && showPassword ? 'text' : type;\n\n let computedRightIcon = rightIcon;\n if (!computedRightIcon) {\n if (isPassword && showPasswordToggle) {\n computedRightIcon = (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => setShowPassword((prev) => !prev)}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n className=\"cursor-pointer text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors\"\n >\n {showPassword ? (eyeOffIcon || <DefaultEyeOffIcon />) : (eyeIcon || <DefaultEyeIcon />)}\n </button>\n );\n } else if (clearable && hasValue) {\n computedRightIcon = (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={handleClear}\n aria-label=\"Clear input\"\n className=\"cursor-pointer text-xs px-1 text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors\"\n >\n ✕\n </button>\n );\n }\n }\n\n const sizeClasses: Record<PatiyaSize, string> = {\n xs: 'h-7 text-xs px-2',\n sm: 'h-8 text-sm px-3',\n md: 'h-10 text-base px-4',\n lg: 'h-12 text-lg px-4',\n xl: 'h-14 text-xl px-5',\n };\n\n const variantClasses = {\n outline: 'bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]',\n filled: 'bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n soft: 'bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]',\n };\n\n const inputClassName = cn(\n 'flex w-full rounded-md transition-all duration-200 outline-none',\n 'text-[var(--patiya-color-foreground)] placeholder:text-(--patiya-color-muted-foreground)',\n 'focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n sizeClasses[inputSize],\n variantClasses[variant],\n invalid && 'border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10',\n leftIcon && 'pl-10',\n computedRightIcon && 'pr-10',\n !leftIcon && !computedRightIcon && className\n );\n\n if (leftIcon || computedRightIcon) {\n return (\n <Box className={cn('relative flex items-center w-full', className)}>\n {leftIcon && (\n <span className=\"absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none\">\n {leftIcon}\n </span>\n )}\n <input\n ref={internalInputRef}\n type={computedType}\n disabled={disabled}\n value={value}\n defaultValue={defaultValue}\n onChange={handleInputChange}\n className={cn(inputClassName, 'w-full')}\n {...props}\n />\n {computedRightIcon && (\n <span className=\"absolute right-3 flex items-center justify-center text-(--patiya-color-muted-foreground)\">\n {computedRightIcon}\n </span>\n )}\n </Box>\n );\n }\n\n return (\n <input\n ref={internalInputRef}\n type={computedType}\n disabled={disabled}\n value={value}\n defaultValue={defaultValue}\n onChange={handleInputChange}\n className={inputClassName}\n {...props}\n />\n );\n }\n);\n\nInput.displayName = 'Input';\n"],"mappings":"2JAkBA,IAAMU,OACJ,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAK,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAA1K,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,8CAAgD,CAAA,GACxD,EAAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,GAAG,KAAK,GAAG,KAAK,EAAE,GAAK,CAAA,CAC5B,IAGDG,OACJ,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAA1K,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,gCAAkC,CAAA,GAC1C,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,8EAAgF,CAAA,GACxF,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,wEAA0E,CAAA,GAClF,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAM,CAAA,CAClC,IAGMI,GAAA,EAAQZ,EAAAA,WAAAA,EAEjB,CACE,YACA,YAAY,KACZ,UAAU,UACV,UAAU,GACV,WACA,YACA,WACA,OAAO,OACP,qBAAqB,GACrB,UACA,aACA,YAAY,GACZ,UACA,QACA,eACA,WACA,GAAGa,GAEL,IACG,CACH,IAAMC,GAAA,EAAmBb,EAAAA,OAAAA,CAAyB,IAAI,GACtD,EAAAM,EAAA,oBAAA,CAAoBQ,MAAWD,EAAiB,OAA2B,EAE3E,GAAM,CAACE,EAAcC,IAAA,EAAmBf,EAAAA,SAAAA,CAAS,EAAK,EAChD,CAACgB,EAAeC,IAAA,EAAoBjB,EAAAA,SAAAA,CAASkB,GAAgB,EAAE,EAE/DC,EAAeC,IAAU,IAAA,GACzBC,EAAaF,EAAeC,EAAQJ,EACpCM,EAAWD,GAA2C,MAAQA,IAAe,GAE7EE,EAAqB,GAA2C,CAC/DJ,GACHF,EAAiB,EAAE,OAAO,KAAK,EAEjCO,IAAW,CAAC,CACd,EAEMC,MAAoB,CAIxB,GAHKN,GACHF,EAAiB,EAAE,EAEjBL,EAAiB,QAAS,CAC5B,EAAiB,QAAQ,MAAQ,GACjC,IAAMc,EAAiB,IAAI,MAAM,QAAS,CAAE,QAAS,EAAK,CAAC,EAC3Dd,EAAiB,QAAQ,cAAcc,CAAc,EACrDd,EAAiB,QAAQ,MAAM,CACjC,CACAe,IAAU,CACZ,EAEMC,EAAaC,IAAS,WACtBC,EAAeF,GAAcd,EAAe,OAASe,EAEvDE,EAAoBC,EACnBD,IACCH,GAAcK,EAChB,GACE,EAAA3B,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACK,WACV,YAAeS,EAAiB,GAAS,CAACmB,CAAI,EAC9C,aAAYpB,EAAe,gBAAkB,gBAC7C,UAAU,2HAET,SAAAA,EAAgBqB,IAAc,EAAA7B,EAAA,IAAA,CAACG,EAAD,CAAoB,CAAA,EAAM2B,IAAW,EAAA9B,EAAA,IAAA,CAACE,EAAD,CAAiB,CAAA,CAC/E,CAAA,EAED6B,GAAaf,IACtB,GACE,EAAAhB,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACK,WACV,QAASmB,EACT,aAAW,cACX,UAAU,wIACX,SAAA,GAEO,CAAA,IAmBd,IAAMa,GAAA,EAAiBrC,EAAAA,GAAAA,CACrB,kEACA,2FACA,2DACA,kDACA,CAlBA,GAAI,mBACJ,GAAI,mBACJ,GAAI,sBACJ,GAAI,oBACJ,GAAI,mBAcJ,EAAYsC,GACZ,CAXA,QAAS,wIACT,OAAQ,2HACR,KAAM,8HASN,EAAeC,GACfC,GAAW,0IACXC,GAAY,QACZX,GAAqB,QACrB,CAACW,GAAY,CAACX,GAAqBY,CACrC,EA6BA,OA3BID,GAAYX,GAEZ,EAAAzB,EAAA,KAAA,CAACJ,EAAAA,IAAD,CAAK,WAAA,EAAWD,EAAAA,GAAAA,CAAG,oCAAqC0C,CAAS,EAAjE,SAAA,CACGD,IACC,EAAApC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8GACb,SAAAoC,CACG,CAAA,GAER,EAAApC,EAAA,IAAA,CAAC,QAAD,CACE,IAAKM,EACL,KAAMkB,EACI,WACH,QACO,eACd,SAAUP,EACV,WAAA,EAAWtB,EAAAA,GAAAA,CAAGqC,EAAgB,QAAQ,EACtC,GAAI3B,CACL,CAAA,EACAoB,IACC,EAAAzB,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2FACb,SAAAyB,CACG,CAAA,CAEL,KAKP,EAAAzB,EAAA,IAAA,CAAC,QAAD,CACE,IAAKM,EACL,KAAMkB,EACI,WACH,QACO,eACd,SAAUP,EACV,UAAWe,EACX,GAAI3B,CACL,CAAA,CAEL,CACF,EAEA,EAAM,YAAc"}
|
package/dist/patiya8.mjs
CHANGED
|
@@ -1,47 +1,118 @@
|
|
|
1
1
|
import { cn as e } from "./patiya3.mjs";
|
|
2
2
|
import { Box as t } from "./patiya4.mjs";
|
|
3
|
-
import { forwardRef as n } from "react";
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { forwardRef as n, useImperativeHandle as r, useRef as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Input/Input.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var c = () => /* @__PURE__ */ s("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "16",
|
|
9
|
+
height: "16",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "2",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
children: [/* @__PURE__ */ o("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), /* @__PURE__ */ o("circle", {
|
|
17
|
+
cx: "12",
|
|
18
|
+
cy: "12",
|
|
19
|
+
r: "3"
|
|
20
|
+
})]
|
|
21
|
+
}), l = () => /* @__PURE__ */ s("svg", {
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
width: "16",
|
|
24
|
+
height: "16",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "2",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ o("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
33
|
+
/* @__PURE__ */ o("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
34
|
+
/* @__PURE__ */ o("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
35
|
+
/* @__PURE__ */ o("line", {
|
|
36
|
+
x1: "2",
|
|
37
|
+
x2: "22",
|
|
38
|
+
y1: "2",
|
|
39
|
+
y2: "22"
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}), u = n(({ className: n, inputSize: u = "md", variant: d = "outline", invalid: f = !1, leftIcon: p, rightIcon: m, disabled: h, type: g = "text", showPasswordToggle: _ = !1, eyeIcon: v, eyeOffIcon: y, clearable: b = !1, onClear: x, value: S, defaultValue: C, onChange: w, ...T }, E) => {
|
|
43
|
+
let D = i(null);
|
|
44
|
+
r(E, () => D.current);
|
|
45
|
+
let [O, k] = a(!1), [A, j] = a(C ?? ""), M = S !== void 0, N = M ? S : A, P = N != null && N !== "", F = (e) => {
|
|
46
|
+
M || j(e.target.value), w?.(e);
|
|
47
|
+
}, I = () => {
|
|
48
|
+
if (M || j(""), D.current) {
|
|
49
|
+
D.current.value = "";
|
|
50
|
+
let e = new Event("input", { bubbles: !0 });
|
|
51
|
+
D.current.dispatchEvent(e), D.current.focus();
|
|
52
|
+
}
|
|
53
|
+
x?.();
|
|
54
|
+
}, L = g === "password", R = L && O ? "text" : g, z = m;
|
|
55
|
+
z || (L && _ ? z = /* @__PURE__ */ o("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
disabled: h,
|
|
58
|
+
onClick: () => k((e) => !e),
|
|
59
|
+
"aria-label": O ? "Hide password" : "Show password",
|
|
60
|
+
className: "cursor-pointer text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors",
|
|
61
|
+
children: O ? y || /* @__PURE__ */ o(l, {}) : v || /* @__PURE__ */ o(c, {})
|
|
62
|
+
}) : b && P && (z = /* @__PURE__ */ o("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
disabled: h,
|
|
65
|
+
onClick: I,
|
|
66
|
+
"aria-label": "Clear input",
|
|
67
|
+
className: "cursor-pointer text-xs px-1 text-[var(--patiya-color-muted-foreground)] hover:text-[var(--patiya-color-foreground)] transition-colors",
|
|
68
|
+
children: "✕"
|
|
69
|
+
})));
|
|
70
|
+
let B = e("flex w-full rounded-md transition-all duration-200 outline-none", "text-[var(--patiya-color-foreground)] placeholder:text-(--patiya-color-muted-foreground)", "focus:ring-4 focus:ring-[var(--patiya-color-primary)]/10", "disabled:cursor-not-allowed disabled:opacity-50", {
|
|
8
71
|
xs: "h-7 text-xs px-2",
|
|
9
72
|
sm: "h-8 text-sm px-3",
|
|
10
73
|
md: "h-10 text-base px-4",
|
|
11
74
|
lg: "h-12 text-lg px-4",
|
|
12
75
|
xl: "h-14 text-xl px-5"
|
|
13
|
-
}[
|
|
76
|
+
}[u], {
|
|
14
77
|
outline: "bg-transparent border border-[var(--patiya-color-border)] focus:border-[var(--patiya-color-primary)] shadow-[var(--patiya-shadow-sm)]",
|
|
15
78
|
filled: "bg-[var(--patiya-color-muted)] border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]",
|
|
16
79
|
soft: "bg-[var(--patiya-color-primary)]/5 border border-transparent focus:bg-transparent focus:border-[var(--patiya-color-primary)]"
|
|
17
|
-
}[
|
|
18
|
-
return
|
|
80
|
+
}[d], f && "border-[var(--patiya-color-destructive)] focus:border-[var(--patiya-color-destructive)] focus:ring-[var(--patiya-color-destructive)]/10", p && "pl-10", z && "pr-10", !p && !z && n);
|
|
81
|
+
return p || z ? /* @__PURE__ */ s(t, {
|
|
19
82
|
className: e("relative flex items-center w-full", n),
|
|
20
83
|
children: [
|
|
21
|
-
|
|
84
|
+
p && /* @__PURE__ */ o("span", {
|
|
22
85
|
className: "absolute left-3 flex items-center justify-center text-(--patiya-color-muted-foreground) pointer-events-none",
|
|
23
|
-
children:
|
|
86
|
+
children: p
|
|
24
87
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
ref:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
88
|
+
/* @__PURE__ */ o("input", {
|
|
89
|
+
ref: D,
|
|
90
|
+
type: R,
|
|
91
|
+
disabled: h,
|
|
92
|
+
value: S,
|
|
93
|
+
defaultValue: C,
|
|
94
|
+
onChange: F,
|
|
95
|
+
className: e(B, "w-full"),
|
|
96
|
+
...T
|
|
30
97
|
}),
|
|
31
|
-
|
|
32
|
-
className: "absolute right-3 flex items-center justify-center text-(--patiya-color-muted-foreground)
|
|
33
|
-
children:
|
|
98
|
+
z && /* @__PURE__ */ o("span", {
|
|
99
|
+
className: "absolute right-3 flex items-center justify-center text-(--patiya-color-muted-foreground)",
|
|
100
|
+
children: z
|
|
34
101
|
})
|
|
35
102
|
]
|
|
36
|
-
}) : /* @__PURE__ */
|
|
37
|
-
ref:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
103
|
+
}) : /* @__PURE__ */ o("input", {
|
|
104
|
+
ref: D,
|
|
105
|
+
type: R,
|
|
106
|
+
disabled: h,
|
|
107
|
+
value: S,
|
|
108
|
+
defaultValue: C,
|
|
109
|
+
onChange: F,
|
|
110
|
+
className: B,
|
|
111
|
+
...T
|
|
41
112
|
});
|
|
42
113
|
});
|
|
43
|
-
|
|
114
|
+
u.displayName = "Input";
|
|
44
115
|
//#endregion
|
|
45
|
-
export {
|
|
116
|
+
export { u as Input };
|
|
46
117
|
|
|
47
118
|
//# sourceMappingURL=patiya8.mjs.map
|