@bricks-toolkit/toolkit 0.1.0 → 0.1.1

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.
Files changed (149) hide show
  1. package/dist/Button.types-BsQYqZml.d.ts +27 -0
  2. package/dist/Button.types-D-srlWFf.d.mts +27 -0
  3. package/dist/TextInput.types-DRI8HQza.d.mts +32 -0
  4. package/dist/TextInput.types-DRI8HQza.d.ts +32 -0
  5. package/dist/Tooltip.types-PbUasE3C.d.mts +36 -0
  6. package/dist/Tooltip.types-PbUasE3C.d.ts +36 -0
  7. package/dist/avatar/index.cjs +1 -0
  8. package/dist/avatar/index.d.mts +29 -0
  9. package/dist/avatar/index.d.ts +29 -0
  10. package/dist/avatar/index.mjs +1 -0
  11. package/dist/badge/index.cjs +1 -0
  12. package/dist/badge/index.d.mts +57 -0
  13. package/dist/badge/index.d.ts +57 -0
  14. package/dist/badge/index.mjs +1 -0
  15. package/dist/breadcrumbs/index.cjs +1 -0
  16. package/dist/breadcrumbs/index.d.mts +32 -0
  17. package/dist/breadcrumbs/index.d.ts +32 -0
  18. package/dist/breadcrumbs/index.mjs +1 -0
  19. package/dist/button/index.cjs +2 -0
  20. package/dist/button/index.d.mts +8 -0
  21. package/dist/button/index.d.ts +8 -0
  22. package/dist/button/index.mjs +2 -0
  23. package/dist/card/index.cjs +1 -0
  24. package/dist/card/index.d.mts +42 -0
  25. package/dist/card/index.d.ts +42 -0
  26. package/dist/card/index.mjs +1 -0
  27. package/dist/checkbox/index.cjs +1 -0
  28. package/dist/checkbox/index.d.mts +36 -0
  29. package/dist/checkbox/index.d.ts +36 -0
  30. package/dist/checkbox/index.mjs +1 -0
  31. package/dist/combo-box/index.cjs +1 -0
  32. package/dist/combo-box/index.d.mts +62 -0
  33. package/dist/combo-box/index.d.ts +62 -0
  34. package/dist/combo-box/index.mjs +1 -0
  35. package/dist/date-picker/index.cjs +2 -0
  36. package/dist/date-picker/index.d.mts +32 -0
  37. package/dist/date-picker/index.d.ts +32 -0
  38. package/dist/date-picker/index.mjs +2 -0
  39. package/dist/dialog/index.cjs +1 -0
  40. package/dist/dialog/index.d.mts +61 -0
  41. package/dist/dialog/index.d.ts +61 -0
  42. package/dist/dialog/index.mjs +1 -0
  43. package/dist/dropdown-menu/index.cjs +1 -0
  44. package/dist/dropdown-menu/index.d.mts +34 -0
  45. package/dist/dropdown-menu/index.d.ts +34 -0
  46. package/dist/dropdown-menu/index.mjs +1 -0
  47. package/dist/email/index.cjs +2 -0
  48. package/dist/email/index.d.mts +38 -0
  49. package/dist/email/index.d.ts +38 -0
  50. package/dist/email/index.mjs +2 -0
  51. package/dist/file-upload/index.cjs +1 -0
  52. package/dist/file-upload/index.d.mts +27 -0
  53. package/dist/file-upload/index.d.ts +27 -0
  54. package/dist/file-upload/index.mjs +1 -0
  55. package/dist/header/index.cjs +2 -0
  56. package/dist/header/index.d.mts +28 -0
  57. package/dist/header/index.d.ts +28 -0
  58. package/dist/header/index.mjs +2 -0
  59. package/dist/icon-button/index.cjs +2 -0
  60. package/dist/icon-button/index.d.mts +16 -0
  61. package/dist/icon-button/index.d.ts +16 -0
  62. package/dist/icon-button/index.mjs +2 -0
  63. package/dist/image/index.cjs +1 -0
  64. package/dist/image/index.d.mts +48 -0
  65. package/dist/image/index.d.ts +48 -0
  66. package/dist/image/index.mjs +1 -0
  67. package/dist/index.cjs +2 -0
  68. package/dist/index.d.mts +141 -0
  69. package/dist/index.mjs +2 -0
  70. package/dist/link/index.cjs +1 -0
  71. package/dist/link/index.d.mts +25 -0
  72. package/dist/link/index.d.ts +25 -0
  73. package/dist/link/index.mjs +1 -0
  74. package/dist/loader/index.cjs +2 -0
  75. package/dist/loader/index.d.mts +21 -0
  76. package/dist/loader/index.d.ts +21 -0
  77. package/dist/loader/index.mjs +2 -0
  78. package/dist/modal/index.cjs +1 -0
  79. package/dist/modal/index.d.mts +116 -0
  80. package/dist/modal/index.d.ts +116 -0
  81. package/dist/modal/index.mjs +1 -0
  82. package/dist/multi-select/index.cjs +2 -0
  83. package/dist/multi-select/index.d.mts +59 -0
  84. package/dist/multi-select/index.d.ts +59 -0
  85. package/dist/multi-select/index.mjs +2 -0
  86. package/dist/otp-input/index.cjs +1 -0
  87. package/dist/otp-input/index.d.mts +57 -0
  88. package/dist/otp-input/index.d.ts +57 -0
  89. package/dist/otp-input/index.mjs +1 -0
  90. package/dist/password-input/index.cjs +2 -0
  91. package/dist/password-input/index.d.mts +32 -0
  92. package/dist/password-input/index.d.ts +32 -0
  93. package/dist/password-input/index.mjs +2 -0
  94. package/dist/phone/index.cjs +2 -0
  95. package/dist/phone/index.d.mts +41 -0
  96. package/dist/phone/index.d.ts +41 -0
  97. package/dist/phone/index.mjs +2 -0
  98. package/dist/radio-button/index.cjs +1 -0
  99. package/dist/radio-button/index.d.mts +56 -0
  100. package/dist/radio-button/index.d.ts +56 -0
  101. package/dist/radio-button/index.mjs +1 -0
  102. package/dist/search-input/index.cjs +2 -0
  103. package/dist/search-input/index.d.mts +22 -0
  104. package/dist/search-input/index.d.ts +22 -0
  105. package/dist/search-input/index.mjs +2 -0
  106. package/dist/select/index.cjs +2 -0
  107. package/dist/select/index.d.mts +36 -0
  108. package/dist/select/index.d.ts +36 -0
  109. package/dist/select/index.mjs +2 -0
  110. package/dist/sidebar/index.cjs +1 -0
  111. package/dist/sidebar/index.d.mts +96 -0
  112. package/dist/sidebar/index.d.ts +96 -0
  113. package/dist/sidebar/index.mjs +1 -0
  114. package/dist/skeleton/index.cjs +1 -0
  115. package/dist/skeleton/index.d.mts +76 -0
  116. package/dist/skeleton/index.d.ts +76 -0
  117. package/dist/skeleton/index.mjs +1 -0
  118. package/dist/styles.css +2 -0
  119. package/dist/styles.d.mts +2 -0
  120. package/dist/styles.d.ts +2 -0
  121. package/dist/table/index.cjs +1 -0
  122. package/dist/table/index.d.mts +92 -0
  123. package/dist/table/index.d.ts +92 -0
  124. package/dist/table/index.mjs +1 -0
  125. package/dist/tabs/index.cjs +2 -0
  126. package/dist/tabs/index.d.mts +26 -0
  127. package/dist/tabs/index.d.ts +26 -0
  128. package/dist/tabs/index.mjs +2 -0
  129. package/dist/text-input/index.cjs +2 -0
  130. package/dist/text-input/index.d.mts +7 -0
  131. package/dist/text-input/index.d.ts +7 -0
  132. package/dist/text-input/index.mjs +2 -0
  133. package/dist/theme-provider/index.cjs +1 -0
  134. package/dist/theme-provider/index.d.mts +122 -0
  135. package/dist/theme-provider/index.d.ts +122 -0
  136. package/dist/theme-provider/index.mjs +1 -0
  137. package/dist/time-picker/index.cjs +2 -0
  138. package/dist/time-picker/index.d.mts +32 -0
  139. package/dist/time-picker/index.d.ts +32 -0
  140. package/dist/time-picker/index.mjs +2 -0
  141. package/dist/toaster/index.cjs +1 -0
  142. package/dist/toaster/index.d.mts +28 -0
  143. package/dist/toaster/index.d.ts +28 -0
  144. package/dist/toaster/index.mjs +1 -0
  145. package/dist/tooltip/index.cjs +1 -0
  146. package/dist/tooltip/index.d.mts +7 -0
  147. package/dist/tooltip/index.d.ts +7 -0
  148. package/dist/tooltip/index.mjs +1 -0
  149. package/package.json +56 -54
@@ -0,0 +1,42 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ type CardVariant = 'default' | 'outlined' | 'elevated' | 'filled';
4
+ type CardPadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
5
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
6
+ /** The overall visual style of the card */
7
+ variant?: CardVariant;
8
+ /** Internal padding scale to apply strictly to the overall wrapper */
9
+ padding?: CardPadding;
10
+ }
11
+ type CardHeaderProps = HTMLAttributes<HTMLDivElement>;
12
+ type CardTitleProps = HTMLAttributes<HTMLHeadingElement>;
13
+ type CardDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
14
+ type CardContentProps = HTMLAttributes<HTMLDivElement>;
15
+ type CardFooterProps = HTMLAttributes<HTMLDivElement>;
16
+
17
+ /**
18
+ * Root Card wrapper containing styles, border radiuses, and shadow mappings.
19
+ */
20
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
21
+ /**
22
+ * Card Header segment, ideal for stacking Titles, actions, and meta data.
23
+ */
24
+ declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
25
+ /**
26
+ * Semantically native Header 3 representation ensuring text harmony generically.
27
+ */
28
+ declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLHeadingElement>>;
29
+ /**
30
+ * Muted paragraph utility explicitly meant for text trailing a Title internally.
31
+ */
32
+ declare const CardDescription: React.ForwardRefExoticComponent<CardDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
33
+ /**
34
+ * Physical payload payload explicitly anchoring generic HTML spacing between a header and a footer correctly.
35
+ */
36
+ declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
37
+ /**
38
+ * Spaced flex container automatically injecting actions aligned horizontally below content natively.
39
+ */
40
+ declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
41
+
42
+ export { Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, CardTitle, type CardTitleProps, type CardVariant };
@@ -0,0 +1,42 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ type CardVariant = 'default' | 'outlined' | 'elevated' | 'filled';
4
+ type CardPadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
5
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
6
+ /** The overall visual style of the card */
7
+ variant?: CardVariant;
8
+ /** Internal padding scale to apply strictly to the overall wrapper */
9
+ padding?: CardPadding;
10
+ }
11
+ type CardHeaderProps = HTMLAttributes<HTMLDivElement>;
12
+ type CardTitleProps = HTMLAttributes<HTMLHeadingElement>;
13
+ type CardDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
14
+ type CardContentProps = HTMLAttributes<HTMLDivElement>;
15
+ type CardFooterProps = HTMLAttributes<HTMLDivElement>;
16
+
17
+ /**
18
+ * Root Card wrapper containing styles, border radiuses, and shadow mappings.
19
+ */
20
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
21
+ /**
22
+ * Card Header segment, ideal for stacking Titles, actions, and meta data.
23
+ */
24
+ declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
25
+ /**
26
+ * Semantically native Header 3 representation ensuring text harmony generically.
27
+ */
28
+ declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLHeadingElement>>;
29
+ /**
30
+ * Muted paragraph utility explicitly meant for text trailing a Title internally.
31
+ */
32
+ declare const CardDescription: React.ForwardRefExoticComponent<CardDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
33
+ /**
34
+ * Physical payload payload explicitly anchoring generic HTML spacing between a header and a footer correctly.
35
+ */
36
+ declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
37
+ /**
38
+ * Spaced flex container automatically injecting actions aligned horizontally below content natively.
39
+ */
40
+ declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
41
+
42
+ export { Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, CardTitle, type CardTitleProps, type CardVariant };
@@ -0,0 +1 @@
1
+ import {forwardRef}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function o(...a){return twMerge(clsx(a))}var l={default:"bg-surface text-text border border-border shadow-sm",outlined:"bg-surface text-text border border-border",elevated:"bg-surface text-text border-transparent shadow-md",filled:"bg-surface-secondary border-transparent text-text-secondary"},C={none:"p-0",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},m=forwardRef(function({className:e,variant:r="default",padding:t="none",...s},i){return jsx("div",{ref:i,className:o("rounded-lg flex flex-col transition-all duration-normal",l[r],C[t],e),...s})});m.displayName="Card";var f=forwardRef(function({className:e,...r},t){return jsx("div",{ref:t,className:o("flex flex-col space-y-1 p-4",e),...r})});f.displayName="CardHeader";var x=forwardRef(function({className:e,children:r,...t},s){return jsx("h3",{ref:s,className:o("font-bold leading-none tracking-tight text-lg text-text",e),...t,children:r})});x.displayName="CardTitle";var u=forwardRef(function({className:e,...r},t){return jsx("p",{ref:t,className:o("text-sm text-text-secondary",e),...r})});u.displayName="CardDescription";var R=forwardRef(function({className:e,...r},t){return jsx("div",{ref:t,className:o("p-4 pt-0",e),...r})});R.displayName="CardContent";var P=forwardRef(function({className:e,...r},t){return jsx("div",{ref:t,className:o("flex items-center p-4 pt-0",e),...r})});P.displayName="CardFooter";export{m as Card,R as CardContent,u as CardDescription,P as CardFooter,f as CardHeader,x as CardTitle};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),solid=require('@heroicons/react/16/solid'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function t(...n){return tailwindMerge.twMerge(clsx.clsx(n))}var G={xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-7 h-7"},J={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},C={xs:"text-[10px]",sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},K={default:"border-border text-accent focus:ring-accent/40",error:"border-error text-error focus:ring-error/20",success:"border-success text-success focus:ring-success/20",warning:"border-warning text-warning focus:ring-warning/20"},O={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},Q="disabled:opacity-50 disabled:bg-surface-secondary disabled:cursor-not-allowed disabled:border-border";function U(n,a,o,r){if(n==="error"&&a)return a;if(n==="success"&&o)return o;if(n==="warning"&&r)return r}var W=react.forwardRef(function({id:a,label:o,helperText:r,errorMessage:k,successMessage:y,warningMessage:R,size:e="md",state:c="default",indeterminate:p=false,className:N,containerClassName:v,wrapperClassName:I,inputClassName:S,labelClassName:M,messageClassName:b,disabled:i=false,required:h=false,...E},d){let H=react.useId(),l=a??`checkbox-${H.replace(/:/g,"")}`,g=`${l}-helper`,w=`${l}-state`,x=react.useRef(null),L=f=>{x.current=f,typeof d=="function"?d(f):d&&(d.current=f);};react.useEffect(()=>{x.current&&(x.current.indeterminate=p);},[p]);let u=U(c,k,y,R),P=[r?g:null,u?w:null].filter(Boolean).join(" ")||void 0,$=r??u;return jsxRuntime.jsxs("div",{className:t("relative flex items-start",v,I,N),children:[jsxRuntime.jsxs("div",{className:"relative flex h-6 w-auto items-center justify-center",children:[jsxRuntime.jsx("input",{...E,ref:L,id:l,type:"checkbox",disabled:i,required:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":P,className:t("peer appearance-none rounded-sm border bg-surface transition-all duration-normal","checked:bg-current checked:border-transparent","indeterminate:bg-current indeterminate:border-transparent","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",G[e],K[c],Q,S)}),jsxRuntime.jsx(solid.CheckIcon,{className:t("pointer-events-none absolute inset-0 m-auto text-text-inverse opacity-0 transition-opacity peer-checked:opacity-100",e==="xs"?"w-2.5 h-2.5":e==="sm"?"w-3 h-3":e==="md"?"w-3.5 h-3.5":e==="lg"?"w-4 h-4":"w-5 h-5")}),jsxRuntime.jsx(solid.MinusIcon,{className:t("pointer-events-none absolute inset-0 m-auto text-text-inverse opacity-0 transition-opacity peer-indeterminate:opacity-100",e==="xs"?"w-2.5 h-2.5":e==="sm"?"w-3 h-3":e==="md"?"w-3.5 h-3.5":e==="lg"?"w-4 h-4":"w-5 h-5")})]}),(!!o||!!$)&&jsxRuntime.jsxs("div",{className:"ml-3 flex flex-col pt-0.5",children:[o&&jsxRuntime.jsxs("label",{htmlFor:l,className:t("font-bold leading-none text-text uppercase tracking-widest select-none",i&&"opacity-50 cursor-not-allowed",J[e],M),children:[o,h&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),r&&jsxRuntime.jsx("p",{id:g,className:t("text-text-muted mt-1 font-medium",i&&"opacity-50",C[e],b),children:r}),u&&jsxRuntime.jsx("p",{id:w,role:c==="error"?"alert":void 0,className:t("mt-1",i&&"opacity-50",O[c],C[e],b),children:u})]})]})});W.displayName="Checkbox";exports.Checkbox=W;
@@ -0,0 +1,36 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type CheckboxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ type CheckboxState = 'default' | 'error' | 'success' | 'warning';
5
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
6
+ /** The primary label to display next to the checkbox */
7
+ label?: ReactNode;
8
+ /** Additional helper text displayed beneath the checkbox */
9
+ helperText?: ReactNode;
10
+ /** Error message displayed beneath the checkbox when state is 'error' */
11
+ errorMessage?: ReactNode;
12
+ /** Success message displayed beneath the checkbox when state is 'success' */
13
+ successMessage?: ReactNode;
14
+ /** Warning message displayed beneath the checkbox when state is 'warning' */
15
+ warningMessage?: ReactNode;
16
+ /** The size of the checkbox and its associated text */
17
+ size?: CheckboxSize;
18
+ /** The validation state of the checkbox */
19
+ state?: CheckboxState;
20
+ /** Whether the checkbox represents a mixed or indeterminate state */
21
+ indeterminate?: boolean;
22
+ /** Custom class for the outermost container */
23
+ containerClassName?: string;
24
+ /** Alias for containerClassName to match other components */
25
+ wrapperClassName?: string;
26
+ /** Custom class for the underlying input element */
27
+ inputClassName?: string;
28
+ /** Custom class for the label element */
29
+ labelClassName?: string;
30
+ /** Custom class for the helper/message text element */
31
+ messageClassName?: string;
32
+ }
33
+
34
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
35
+
36
+ export { Checkbox, type CheckboxProps, type CheckboxSize, type CheckboxState };
@@ -0,0 +1,36 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type CheckboxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ type CheckboxState = 'default' | 'error' | 'success' | 'warning';
5
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
6
+ /** The primary label to display next to the checkbox */
7
+ label?: ReactNode;
8
+ /** Additional helper text displayed beneath the checkbox */
9
+ helperText?: ReactNode;
10
+ /** Error message displayed beneath the checkbox when state is 'error' */
11
+ errorMessage?: ReactNode;
12
+ /** Success message displayed beneath the checkbox when state is 'success' */
13
+ successMessage?: ReactNode;
14
+ /** Warning message displayed beneath the checkbox when state is 'warning' */
15
+ warningMessage?: ReactNode;
16
+ /** The size of the checkbox and its associated text */
17
+ size?: CheckboxSize;
18
+ /** The validation state of the checkbox */
19
+ state?: CheckboxState;
20
+ /** Whether the checkbox represents a mixed or indeterminate state */
21
+ indeterminate?: boolean;
22
+ /** Custom class for the outermost container */
23
+ containerClassName?: string;
24
+ /** Alias for containerClassName to match other components */
25
+ wrapperClassName?: string;
26
+ /** Custom class for the underlying input element */
27
+ inputClassName?: string;
28
+ /** Custom class for the label element */
29
+ labelClassName?: string;
30
+ /** Custom class for the helper/message text element */
31
+ messageClassName?: string;
32
+ }
33
+
34
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
35
+
36
+ export { Checkbox, type CheckboxProps, type CheckboxSize, type CheckboxState };
@@ -0,0 +1 @@
1
+ import {forwardRef,useId,useRef,useEffect}from'react';import {CheckIcon,MinusIcon}from'@heroicons/react/16/solid';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function t(...n){return twMerge(clsx(n))}var G={xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-7 h-7"},J={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},C={xs:"text-[10px]",sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},K={default:"border-border text-accent focus:ring-accent/40",error:"border-error text-error focus:ring-error/20",success:"border-success text-success focus:ring-success/20",warning:"border-warning text-warning focus:ring-warning/20"},O={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},Q="disabled:opacity-50 disabled:bg-surface-secondary disabled:cursor-not-allowed disabled:border-border";function U(n,a,o,r){if(n==="error"&&a)return a;if(n==="success"&&o)return o;if(n==="warning"&&r)return r}var W=forwardRef(function({id:a,label:o,helperText:r,errorMessage:k,successMessage:y,warningMessage:R,size:e="md",state:c="default",indeterminate:p=false,className:N,containerClassName:v,wrapperClassName:I,inputClassName:S,labelClassName:M,messageClassName:b,disabled:i=false,required:h=false,...E},d){let H=useId(),l=a??`checkbox-${H.replace(/:/g,"")}`,g=`${l}-helper`,w=`${l}-state`,x=useRef(null),L=f=>{x.current=f,typeof d=="function"?d(f):d&&(d.current=f);};useEffect(()=>{x.current&&(x.current.indeterminate=p);},[p]);let u=U(c,k,y,R),P=[r?g:null,u?w:null].filter(Boolean).join(" ")||void 0,$=r??u;return jsxs("div",{className:t("relative flex items-start",v,I,N),children:[jsxs("div",{className:"relative flex h-6 w-auto items-center justify-center",children:[jsx("input",{...E,ref:L,id:l,type:"checkbox",disabled:i,required:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":P,className:t("peer appearance-none rounded-sm border bg-surface transition-all duration-normal","checked:bg-current checked:border-transparent","indeterminate:bg-current indeterminate:border-transparent","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",G[e],K[c],Q,S)}),jsx(CheckIcon,{className:t("pointer-events-none absolute inset-0 m-auto text-text-inverse opacity-0 transition-opacity peer-checked:opacity-100",e==="xs"?"w-2.5 h-2.5":e==="sm"?"w-3 h-3":e==="md"?"w-3.5 h-3.5":e==="lg"?"w-4 h-4":"w-5 h-5")}),jsx(MinusIcon,{className:t("pointer-events-none absolute inset-0 m-auto text-text-inverse opacity-0 transition-opacity peer-indeterminate:opacity-100",e==="xs"?"w-2.5 h-2.5":e==="sm"?"w-3 h-3":e==="md"?"w-3.5 h-3.5":e==="lg"?"w-4 h-4":"w-5 h-5")})]}),(!!o||!!$)&&jsxs("div",{className:"ml-3 flex flex-col pt-0.5",children:[o&&jsxs("label",{htmlFor:l,className:t("font-bold leading-none text-text uppercase tracking-widest select-none",i&&"opacity-50 cursor-not-allowed",J[e],M),children:[o,h&&jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),r&&jsx("p",{id:g,className:t("text-text-muted mt-1 font-medium",i&&"opacity-50",C[e],b),children:r}),u&&jsx("p",{id:w,role:c==="error"?"alert":void 0,className:t("mt-1",i&&"opacity-50",O[c],C[e],b),children:u})]})]})});W.displayName="Checkbox";export{W as Checkbox};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),solid=require('@heroicons/react/20/solid'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function r(...u){return tailwindMerge.twMerge(clsx.clsx(u))}var ve={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},Ce={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},P={xs:"px-2 py-1 text-xs",sm:"px-3 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base",xl:"px-4 py-3 text-lg"},ke={default:"border-border focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/40",error:"border-error focus-within:ring-2 focus-within:ring-error/20",success:"border-success focus-within:ring-2 focus-within:ring-success/20",warning:"border-warning focus-within:ring-2 focus-within:ring-warning/20"},Ne={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"};function Be(u,d,s,a){if(u==="error"&&d)return d;if(u==="success"&&s)return s;if(u==="warning"&&a)return a}var Ee=react.forwardRef(function({options:d,value:s,onChange:a,multiple:l=false,searchable:m=true,clearable:q=false,label:D,required:A=false,helperText:M,errorMessage:Q,successMessage:U,warningMessage:X,state:g="default",size:C="md",fullWidth:G=true,placeholder:J="Select\u2026",noOptionsMessage:W="No options",wrapperClassName:Y,inputClassName:Z,listClassName:_,labelClassName:ee,helperClassName:H,disabled:f,id:te,className:ne,...re},k){let oe=react.useId(),w=te??oe,N=`${w}-listbox`,K=`${w}-helper`,T=`${w}-state`,[o,B]=react.useState(false),[R,h]=react.useState(""),[x,p]=react.useState(-1),L=react.useRef(null),V=react.useRef(null),i=react.useMemo(()=>s==null?[]:Array.isArray(s)?s:[s],[s]),se=o&&m?R:i.map(e=>d.find(t=>t.value===e)?.label??e).join(", "),y=o&&m&&R.length>0?d.filter(e=>e.label.toLowerCase().includes(R.toLowerCase())):d;react.useEffect(()=>{let e=t=>{L.current&&!L.current.contains(t.target)&&(B(false),h(""));};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[]);let E=react.useCallback(()=>{f||(B(true),h(""),p(-1));},[f]),I=react.useCallback(()=>{B(false),h(""),p(-1);},[]),O=react.useCallback(e=>{if(!e.disabled)if(l){let t=i.includes(e.value)?i.filter(c=>c!==e.value):[...i,e.value];a?.(t);}else a?.(e.value),I();},[l,i,a,I]),ae=react.useCallback(()=>{a?.(l?[]:""),h(""),V.current?.focus();},[l,a]),ie=e=>{h(e.target.value),p(-1),o||B(true);},le=e=>{if(!f)switch(e.key){case "ArrowDown":e.preventDefault(),o?p(t=>t<y.length-1?t+1:t):E();break;case "ArrowUp":e.preventDefault(),p(t=>t>0?t-1:0);break;case "Enter":if(e.preventDefault(),!o)E();else if(x>=0&&x<y.length){let t=y[x];t!=null&&O(t);}break;case "Escape":e.preventDefault(),I();break;case "Tab":I();break;}},z=Be(g,Q,U,X),ce=[M?K:null,z?T:null].filter(Boolean).join(" ")||void 0,ue=q&&i.length>0&&!f,de=e=>i.includes(e);return jsxRuntime.jsxs("div",{className:r("flex flex-col gap-1",G?"w-full":"w-fit",o&&"z-[60]",Y,ne),children:[D!=null&&jsxRuntime.jsxs("label",{htmlFor:w,className:r("font-black leading-none text-text uppercase tracking-widest",Ce[C],ee),children:[D,A&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxRuntime.jsxs("div",{ref:L,className:"relative",onKeyDown:le,children:[jsxRuntime.jsxs("div",{className:r("flex items-center w-full rounded-md border bg-surface shadow-sm transition-all duration-normal",ve[C],ke[g],f&&"cursor-not-allowed opacity-50 bg-surface-secondary"),children:[jsxRuntime.jsx("input",{...re,ref:e=>{V.current=e,typeof k=="function"?k(e):k!=null&&(k.current=e);},id:w,role:"combobox",type:"text",autoComplete:"off","aria-expanded":o,"aria-haspopup":"listbox","aria-controls":N,"aria-autocomplete":m?"list":"none","aria-activedescendant":x>=0?`${N}-opt-${String(x)}`:void 0,"aria-invalid":g==="error"?true:void 0,"aria-required":A,"aria-describedby":ce,disabled:f,readOnly:!m,placeholder:i.length===0?J:void 0,value:se,onChange:m?ie:void 0,onFocus:E,onClick:E,className:r("flex-1 min-w-0 bg-transparent outline-none placeholder:text-text-muted transition-all duration-normal",!m&&"cursor-pointer select-none",Z)}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 ml-1 shrink-0",children:[ue&&jsxRuntime.jsx("button",{type:"button","aria-label":"Clear selection",onMouseDown:e=>{e.preventDefault();},onClick:ae,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast",children:jsxRuntime.jsx(solid.XMarkIcon,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:r("text-text-muted transition-transform duration-200",o&&"rotate-180"),children:jsxRuntime.jsx(solid.ChevronDownIcon,{className:"w-4 h-4"})})]})]}),o&&jsxRuntime.jsx("ul",{id:N,role:"listbox","aria-multiselectable":l,"aria-label":D??"Options",className:r("absolute z-dropdown mt-1 w-full bg-surface border border-border rounded-lg shadow-lg overflow-y-auto max-h-60 py-1.5 animate-in fade-in zoom-in-95 duration-normal",_),children:y.length===0?jsxRuntime.jsx("li",{className:r("text-text-muted italic select-none font-medium",P[C]),children:W}):y.map((e,t)=>{let c=de(e.value),me=t===x;return jsxRuntime.jsxs("li",{id:`${N}-opt-${String(t)}`,role:"option","aria-selected":c,"aria-disabled":e.disabled,onMouseDown:v=>{v.preventDefault();},onClick:()=>{O(e);},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),O(e));},onMouseEnter:()=>{p(t);},className:r("flex items-center gap-2 cursor-pointer select-none transition-all duration-fast font-medium",P[C],me&&!e.disabled&&"bg-hover",c&&"text-primary font-bold",e.disabled&&"cursor-not-allowed opacity-40"),children:[l&&jsxRuntime.jsx("span",{className:r("shrink-0 w-4 h-4 rounded-sm border flex items-center justify-center transition-all duration-normal",c?"bg-primary border-primary":"border-border"),"aria-hidden":"true",children:c&&jsxRuntime.jsx(solid.CheckIcon,{className:"w-2.5 h-2.5 text-text-inverse"})}),!l&&jsxRuntime.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true",children:c&&jsxRuntime.jsx(solid.CheckIcon,{className:"w-4 h-4 text-primary"})}),e.label]},e.value)})})]}),M!=null&&jsxRuntime.jsx("p",{id:K,className:r("text-xs leading-tight text-text-muted font-medium",H),children:M}),z!=null&&jsxRuntime.jsx("p",{id:T,role:g==="error"?"alert":void 0,className:r("text-xs leading-tight font-medium",Ne[g],H),children:z})]})});Ee.displayName="ComboBox";exports.ComboBox=Ee;
@@ -0,0 +1,62 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type ComboBoxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ type ComboBoxState = 'default' | 'error' | 'success' | 'warning';
5
+ interface ComboBoxOption {
6
+ /** The underlying value submitted/returned. */
7
+ value: string;
8
+ /** The human-readable label shown in the dropdown and input. */
9
+ label: string;
10
+ /** When true the option is shown but cannot be selected. */
11
+ disabled?: boolean;
12
+ }
13
+ interface ComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'onChange' | 'multiple'> {
14
+ /** List of selectable options. */
15
+ options: ComboBoxOption[];
16
+ /** Currently selected value(s). Pass string for single, string[] for multi. */
17
+ value?: string | string[];
18
+ /** Fired when selection changes. */
19
+ onChange?: (value: string | string[]) => void;
20
+ /** Allow selecting multiple options. Defaults to false. */
21
+ multiple?: boolean;
22
+ /** Allow the user to type and filter options. Defaults to true. */
23
+ searchable?: boolean;
24
+ /** Show a clear (×) button when a value is selected. Defaults to false. */
25
+ clearable?: boolean;
26
+ /** Field label rendered above the input. */
27
+ label?: string;
28
+ /** Makes the label show a required asterisk. */
29
+ required?: boolean;
30
+ /** Helper text shown below the field. */
31
+ helperText?: string;
32
+ /** Message shown when state = 'error'. */
33
+ errorMessage?: string;
34
+ /** Message shown when state = 'success'. */
35
+ successMessage?: string;
36
+ /** Message shown when state = 'warning'. */
37
+ warningMessage?: string;
38
+ /** Visual / validation state. Defaults to 'default'. */
39
+ state?: ComboBoxState;
40
+ /** Input size. Defaults to 'md'. */
41
+ size?: ComboBoxSize;
42
+ /** Stretch to fill its container. Defaults to true. */
43
+ fullWidth?: boolean;
44
+ /** Placeholder shown in the input when nothing is selected. */
45
+ placeholder?: string;
46
+ /** Rendered when no options match the current search query. */
47
+ noOptionsMessage?: ReactNode;
48
+ /** Additional class for the outer wrapper div. */
49
+ wrapperClassName?: string;
50
+ /** Additional class for the trigger / input element. */
51
+ inputClassName?: string;
52
+ /** Additional class for the dropdown list. */
53
+ listClassName?: string;
54
+ /** Additional class for the label element. */
55
+ labelClassName?: string;
56
+ /** Additional class for helper / state message text. */
57
+ helperClassName?: string;
58
+ }
59
+
60
+ declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLInputElement>>;
61
+
62
+ export { ComboBox, type ComboBoxOption, type ComboBoxProps, type ComboBoxSize, type ComboBoxState };
@@ -0,0 +1,62 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type ComboBoxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ type ComboBoxState = 'default' | 'error' | 'success' | 'warning';
5
+ interface ComboBoxOption {
6
+ /** The underlying value submitted/returned. */
7
+ value: string;
8
+ /** The human-readable label shown in the dropdown and input. */
9
+ label: string;
10
+ /** When true the option is shown but cannot be selected. */
11
+ disabled?: boolean;
12
+ }
13
+ interface ComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'onChange' | 'multiple'> {
14
+ /** List of selectable options. */
15
+ options: ComboBoxOption[];
16
+ /** Currently selected value(s). Pass string for single, string[] for multi. */
17
+ value?: string | string[];
18
+ /** Fired when selection changes. */
19
+ onChange?: (value: string | string[]) => void;
20
+ /** Allow selecting multiple options. Defaults to false. */
21
+ multiple?: boolean;
22
+ /** Allow the user to type and filter options. Defaults to true. */
23
+ searchable?: boolean;
24
+ /** Show a clear (×) button when a value is selected. Defaults to false. */
25
+ clearable?: boolean;
26
+ /** Field label rendered above the input. */
27
+ label?: string;
28
+ /** Makes the label show a required asterisk. */
29
+ required?: boolean;
30
+ /** Helper text shown below the field. */
31
+ helperText?: string;
32
+ /** Message shown when state = 'error'. */
33
+ errorMessage?: string;
34
+ /** Message shown when state = 'success'. */
35
+ successMessage?: string;
36
+ /** Message shown when state = 'warning'. */
37
+ warningMessage?: string;
38
+ /** Visual / validation state. Defaults to 'default'. */
39
+ state?: ComboBoxState;
40
+ /** Input size. Defaults to 'md'. */
41
+ size?: ComboBoxSize;
42
+ /** Stretch to fill its container. Defaults to true. */
43
+ fullWidth?: boolean;
44
+ /** Placeholder shown in the input when nothing is selected. */
45
+ placeholder?: string;
46
+ /** Rendered when no options match the current search query. */
47
+ noOptionsMessage?: ReactNode;
48
+ /** Additional class for the outer wrapper div. */
49
+ wrapperClassName?: string;
50
+ /** Additional class for the trigger / input element. */
51
+ inputClassName?: string;
52
+ /** Additional class for the dropdown list. */
53
+ listClassName?: string;
54
+ /** Additional class for the label element. */
55
+ labelClassName?: string;
56
+ /** Additional class for helper / state message text. */
57
+ helperClassName?: string;
58
+ }
59
+
60
+ declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLInputElement>>;
61
+
62
+ export { ComboBox, type ComboBoxOption, type ComboBoxProps, type ComboBoxSize, type ComboBoxState };
@@ -0,0 +1 @@
1
+ import {forwardRef,useId,useState,useRef,useMemo,useEffect,useCallback}from'react';import {XMarkIcon,ChevronDownIcon,CheckIcon}from'@heroicons/react/20/solid';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function r(...u){return twMerge(clsx(u))}var ve={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},Ce={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},P={xs:"px-2 py-1 text-xs",sm:"px-3 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base",xl:"px-4 py-3 text-lg"},ke={default:"border-border focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/40",error:"border-error focus-within:ring-2 focus-within:ring-error/20",success:"border-success focus-within:ring-2 focus-within:ring-success/20",warning:"border-warning focus-within:ring-2 focus-within:ring-warning/20"},Ne={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"};function Be(u,d,s,a){if(u==="error"&&d)return d;if(u==="success"&&s)return s;if(u==="warning"&&a)return a}var Ee=forwardRef(function({options:d,value:s,onChange:a,multiple:l=false,searchable:m=true,clearable:q=false,label:D,required:A=false,helperText:M,errorMessage:Q,successMessage:U,warningMessage:X,state:g="default",size:C="md",fullWidth:G=true,placeholder:J="Select\u2026",noOptionsMessage:W="No options",wrapperClassName:Y,inputClassName:Z,listClassName:_,labelClassName:ee,helperClassName:H,disabled:f,id:te,className:ne,...re},k){let oe=useId(),w=te??oe,N=`${w}-listbox`,K=`${w}-helper`,T=`${w}-state`,[o,B]=useState(false),[R,h]=useState(""),[x,p]=useState(-1),L=useRef(null),V=useRef(null),i=useMemo(()=>s==null?[]:Array.isArray(s)?s:[s],[s]),se=o&&m?R:i.map(e=>d.find(t=>t.value===e)?.label??e).join(", "),y=o&&m&&R.length>0?d.filter(e=>e.label.toLowerCase().includes(R.toLowerCase())):d;useEffect(()=>{let e=t=>{L.current&&!L.current.contains(t.target)&&(B(false),h(""));};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[]);let E=useCallback(()=>{f||(B(true),h(""),p(-1));},[f]),I=useCallback(()=>{B(false),h(""),p(-1);},[]),O=useCallback(e=>{if(!e.disabled)if(l){let t=i.includes(e.value)?i.filter(c=>c!==e.value):[...i,e.value];a?.(t);}else a?.(e.value),I();},[l,i,a,I]),ae=useCallback(()=>{a?.(l?[]:""),h(""),V.current?.focus();},[l,a]),ie=e=>{h(e.target.value),p(-1),o||B(true);},le=e=>{if(!f)switch(e.key){case "ArrowDown":e.preventDefault(),o?p(t=>t<y.length-1?t+1:t):E();break;case "ArrowUp":e.preventDefault(),p(t=>t>0?t-1:0);break;case "Enter":if(e.preventDefault(),!o)E();else if(x>=0&&x<y.length){let t=y[x];t!=null&&O(t);}break;case "Escape":e.preventDefault(),I();break;case "Tab":I();break;}},z=Be(g,Q,U,X),ce=[M?K:null,z?T:null].filter(Boolean).join(" ")||void 0,ue=q&&i.length>0&&!f,de=e=>i.includes(e);return jsxs("div",{className:r("flex flex-col gap-1",G?"w-full":"w-fit",o&&"z-[60]",Y,ne),children:[D!=null&&jsxs("label",{htmlFor:w,className:r("font-black leading-none text-text uppercase tracking-widest",Ce[C],ee),children:[D,A&&jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxs("div",{ref:L,className:"relative",onKeyDown:le,children:[jsxs("div",{className:r("flex items-center w-full rounded-md border bg-surface shadow-sm transition-all duration-normal",ve[C],ke[g],f&&"cursor-not-allowed opacity-50 bg-surface-secondary"),children:[jsx("input",{...re,ref:e=>{V.current=e,typeof k=="function"?k(e):k!=null&&(k.current=e);},id:w,role:"combobox",type:"text",autoComplete:"off","aria-expanded":o,"aria-haspopup":"listbox","aria-controls":N,"aria-autocomplete":m?"list":"none","aria-activedescendant":x>=0?`${N}-opt-${String(x)}`:void 0,"aria-invalid":g==="error"?true:void 0,"aria-required":A,"aria-describedby":ce,disabled:f,readOnly:!m,placeholder:i.length===0?J:void 0,value:se,onChange:m?ie:void 0,onFocus:E,onClick:E,className:r("flex-1 min-w-0 bg-transparent outline-none placeholder:text-text-muted transition-all duration-normal",!m&&"cursor-pointer select-none",Z)}),jsxs("div",{className:"flex items-center gap-0.5 ml-1 shrink-0",children:[ue&&jsx("button",{type:"button","aria-label":"Clear selection",onMouseDown:e=>{e.preventDefault();},onClick:ae,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast",children:jsx(XMarkIcon,{className:"w-3.5 h-3.5"})}),jsx("span",{"aria-hidden":"true",className:r("text-text-muted transition-transform duration-200",o&&"rotate-180"),children:jsx(ChevronDownIcon,{className:"w-4 h-4"})})]})]}),o&&jsx("ul",{id:N,role:"listbox","aria-multiselectable":l,"aria-label":D??"Options",className:r("absolute z-dropdown mt-1 w-full bg-surface border border-border rounded-lg shadow-lg overflow-y-auto max-h-60 py-1.5 animate-in fade-in zoom-in-95 duration-normal",_),children:y.length===0?jsx("li",{className:r("text-text-muted italic select-none font-medium",P[C]),children:W}):y.map((e,t)=>{let c=de(e.value),me=t===x;return jsxs("li",{id:`${N}-opt-${String(t)}`,role:"option","aria-selected":c,"aria-disabled":e.disabled,onMouseDown:v=>{v.preventDefault();},onClick:()=>{O(e);},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),O(e));},onMouseEnter:()=>{p(t);},className:r("flex items-center gap-2 cursor-pointer select-none transition-all duration-fast font-medium",P[C],me&&!e.disabled&&"bg-hover",c&&"text-primary font-bold",e.disabled&&"cursor-not-allowed opacity-40"),children:[l&&jsx("span",{className:r("shrink-0 w-4 h-4 rounded-sm border flex items-center justify-center transition-all duration-normal",c?"bg-primary border-primary":"border-border"),"aria-hidden":"true",children:c&&jsx(CheckIcon,{className:"w-2.5 h-2.5 text-text-inverse"})}),!l&&jsx("span",{className:"w-4 shrink-0","aria-hidden":"true",children:c&&jsx(CheckIcon,{className:"w-4 h-4 text-primary"})}),e.label]},e.value)})})]}),M!=null&&jsx("p",{id:K,className:r("text-xs leading-tight text-text-muted font-medium",H),children:M}),z!=null&&jsx("p",{id:T,role:g==="error"?"alert":void 0,className:r("text-xs leading-tight font-medium",Ne[g],H),children:z})]})});Ee.displayName="ComboBox";export{Ee as ComboBox};
@@ -0,0 +1,2 @@
1
+ 'use strict';var react=require('react'),outline=require('@heroicons/react/24/outline'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function s(...r){return tailwindMerge.twMerge(clsx.clsx(r))}var re={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},te={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},ne={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none focus:ring-0",unstyled:"border-0 bg-transparent p-0 focus:outline-none focus:ring-0"},oe={default:{default:"border-border focus:border-primary focus:ring-primary/40",filled:"focus:border-primary focus:ring-primary/40",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error focus:ring-error/20",filled:"bg-error/5 focus:border-error focus:ring-error/20",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success focus:ring-success/20",filled:"bg-success/5 focus:border-success focus:ring-success/20",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning focus:ring-warning/20",filled:"bg-warning/5 focus:border-warning focus:ring-warning/20",flushed:"border-warning focus:border-warning",unstyled:""}},se={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},ie="disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-surface-secondary";function ae(r,t,n){let o={xs:"pl-6",sm:"pl-8",md:"pl-9",lg:"pl-10",xl:"pl-11"},u={xs:"pr-6",sm:"pr-8",md:"pr-9",lg:"pr-10",xl:"pr-11"},a=[];return r&&a.push(o[n]),t&&a.push(u[n]),a.join(" ")}function de(r,t,n,o){if(r==="error"&&t)return t;if(r==="success"&&n)return n;if(r==="warning"&&o)return o}function z({children:r,side:t,size:n,pointerEvents:o=false}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:s("absolute top-1/2 -translate-y-1/2 text-text-secondary flex items-center justify-center",!o&&"pointer-events-none",t==="left"?"left-3":"right-3",{xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5"}[n]),children:r})}function A({children:r,side:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:s("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",t==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:r})}var V=react.forwardRef(function({label:t,required:n=false,helperText:o,errorMessage:u,successMessage:a,warningMessage:E,variant:w="default",size:d="md",state:c="default",fullWidth:k=true,leftElement:D,rightElement:g,prefix:f,suffix:p,wrapperClassName:B,inputGroupClassName:M,inputClassName:H,labelClassName:j,helperClassName:v,id:L,disabled:T,className:F,clearable:$,isLoading:b,value:x,onChange:h,...O},i){let W=react.useId(),m=L??W,R=`${m}-helper`,N=`${m}-state`,y=$&&typeof x=="string"&&x.length>0,S=D!==void 0,C=g!==void 0||!!y||!!b,P=de(c,u,a,E),X=[o?R:null,P?N:null].filter(Boolean).join(" ")||void 0,q=()=>{if(i&&typeof i!="function"&&i.current){let I=Reflect.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;I&&Reflect.apply(I,i.current,[""]);let Q=new Event("input",{bubbles:true});i.current.dispatchEvent(Q);}else h&&h({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},G=()=>b?jsxRuntime.jsxs("svg",{className:"animate-spin h-full w-full text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):y?jsxRuntime.jsx("button",{type:"button",onClick:q,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast","aria-label":"Clear input",children:jsxRuntime.jsx(outline.XMarkIcon,{className:"w-full h-full",strokeWidth:2.5})}):g,J=jsxRuntime.jsx("input",{ref:i,id:m,disabled:!!T||!!b,type:"date",value:x,onChange:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":X,"aria-required":n,className:s("w-full transition-colors duration-150",re[d],ne[w],oe[c][w],ie,ae(S,C,d),H),...O});return jsxRuntime.jsxs("div",{className:s("flex flex-col gap-1",k?"w-full":"w-fit",B,F),children:[t!==void 0&&jsxRuntime.jsxs("label",{htmlFor:m,className:s("font-black leading-none text-text uppercase tracking-widest",te[d],j),children:[t,n&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxRuntime.jsxs("div",{className:s("flex items-stretch",k?"w-full":"w-fit",M),children:[f!==void 0&&jsxRuntime.jsx(A,{side:"left",children:f}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 items-center",children:[S&&jsxRuntime.jsx(z,{side:"left",size:d,children:D}),jsxRuntime.jsx("div",{className:s("flex-1",f!==void 0&&p!==void 0?"[&>input]:rounded-none":f!==void 0?"[&>input]:rounded-l-none":p!==void 0?"[&>input]:rounded-r-none":""),children:J}),C&&jsxRuntime.jsx(z,{side:"right",size:d,pointerEvents:!g&&!!y,children:G()})]}),p!==void 0&&jsxRuntime.jsx(A,{side:"right",children:p})]}),o!==void 0&&jsxRuntime.jsx("p",{id:R,className:s("text-xs leading-tight text-text-muted font-medium",v),children:o}),P!==void 0&&jsxRuntime.jsx("p",{id:N,role:c==="error"?"alert":void 0,className:s("text-xs leading-tight mt-1 font-medium",se[c],v),children:P})]})});V.displayName="DatePicker";
2
+ exports.DatePicker=V;
@@ -0,0 +1,32 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type DatePickerVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
4
+ type DatePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type DatePickerState = 'default' | 'error' | 'success' | 'warning';
6
+ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
7
+ label?: string;
8
+ required?: boolean;
9
+ helperText?: string;
10
+ errorMessage?: string;
11
+ successMessage?: string;
12
+ warningMessage?: string;
13
+ variant?: DatePickerVariant;
14
+ size?: DatePickerSize;
15
+ state?: DatePickerState;
16
+ fullWidth?: boolean;
17
+ leftElement?: ReactNode;
18
+ rightElement?: ReactNode;
19
+ prefix?: ReactNode;
20
+ suffix?: ReactNode;
21
+ wrapperClassName?: string;
22
+ inputGroupClassName?: string;
23
+ inputClassName?: string;
24
+ labelClassName?: string;
25
+ helperClassName?: string;
26
+ clearable?: boolean;
27
+ isLoading?: boolean;
28
+ }
29
+
30
+ declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
31
+
32
+ export { DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerState, type DatePickerVariant };
@@ -0,0 +1,32 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+
3
+ type DatePickerVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
4
+ type DatePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type DatePickerState = 'default' | 'error' | 'success' | 'warning';
6
+ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
7
+ label?: string;
8
+ required?: boolean;
9
+ helperText?: string;
10
+ errorMessage?: string;
11
+ successMessage?: string;
12
+ warningMessage?: string;
13
+ variant?: DatePickerVariant;
14
+ size?: DatePickerSize;
15
+ state?: DatePickerState;
16
+ fullWidth?: boolean;
17
+ leftElement?: ReactNode;
18
+ rightElement?: ReactNode;
19
+ prefix?: ReactNode;
20
+ suffix?: ReactNode;
21
+ wrapperClassName?: string;
22
+ inputGroupClassName?: string;
23
+ inputClassName?: string;
24
+ labelClassName?: string;
25
+ helperClassName?: string;
26
+ clearable?: boolean;
27
+ isLoading?: boolean;
28
+ }
29
+
30
+ declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
31
+
32
+ export { DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerState, type DatePickerVariant };
@@ -0,0 +1,2 @@
1
+ import {forwardRef,useId}from'react';import {XMarkIcon}from'@heroicons/react/24/outline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';function s(...r){return twMerge(clsx(r))}var re={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base",xl:"h-12 px-4 text-lg"},te={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-sm",xl:"text-base"},ne={default:"rounded-md border border-border bg-surface shadow-sm focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",filled:"rounded-md border border-transparent bg-surface-secondary focus:bg-surface focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-0 transition-all duration-normal",flushed:"rounded-none border-0 border-b border-border bg-transparent focus:outline-none focus:ring-0",unstyled:"border-0 bg-transparent p-0 focus:outline-none focus:ring-0"},oe={default:{default:"border-border focus:border-primary focus:ring-primary/40",filled:"focus:border-primary focus:ring-primary/40",flushed:"border-border focus:border-primary",unstyled:""},error:{default:"border-error focus:border-error focus:ring-error/20",filled:"bg-error/5 focus:border-error focus:ring-error/20",flushed:"border-error focus:border-error",unstyled:""},success:{default:"border-success focus:border-success focus:ring-success/20",filled:"bg-success/5 focus:border-success focus:ring-success/20",flushed:"border-success focus:border-success",unstyled:""},warning:{default:"border-warning focus:border-warning focus:ring-warning/20",filled:"bg-warning/5 focus:border-warning focus:ring-warning/20",flushed:"border-warning focus:border-warning",unstyled:""}},se={default:"text-text-muted",error:"text-error font-medium",success:"text-success font-medium",warning:"text-warning font-medium"},ie="disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-surface-secondary";function ae(r,t,n){let o={xs:"pl-6",sm:"pl-8",md:"pl-9",lg:"pl-10",xl:"pl-11"},u={xs:"pr-6",sm:"pr-8",md:"pr-9",lg:"pr-10",xl:"pr-11"},a=[];return r&&a.push(o[n]),t&&a.push(u[n]),a.join(" ")}function de(r,t,n,o){if(r==="error"&&t)return t;if(r==="success"&&n)return n;if(r==="warning"&&o)return o}function z({children:r,side:t,size:n,pointerEvents:o=false}){return jsx("span",{"aria-hidden":"true",className:s("absolute top-1/2 -translate-y-1/2 text-text-secondary flex items-center justify-center",!o&&"pointer-events-none",t==="left"?"left-3":"right-3",{xs:"w-3.5 h-3.5",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5"}[n]),children:r})}function A({children:r,side:t}){return jsx("span",{"aria-hidden":"true",className:s("inline-flex items-center border border-border bg-surface-secondary px-3 text-sm text-text-secondary select-none",t==="left"?"rounded-l-md border-r-0":"rounded-r-md border-l-0"),children:r})}var V=forwardRef(function({label:t,required:n=false,helperText:o,errorMessage:u,successMessage:a,warningMessage:E,variant:w="default",size:d="md",state:c="default",fullWidth:k=true,leftElement:D,rightElement:g,prefix:f,suffix:p,wrapperClassName:B,inputGroupClassName:M,inputClassName:H,labelClassName:j,helperClassName:v,id:L,disabled:T,className:F,clearable:$,isLoading:b,value:x,onChange:h,...O},i){let W=useId(),m=L??W,R=`${m}-helper`,N=`${m}-state`,y=$&&typeof x=="string"&&x.length>0,S=D!==void 0,C=g!==void 0||!!y||!!b,P=de(c,u,a,E),X=[o?R:null,P?N:null].filter(Boolean).join(" ")||void 0,q=()=>{if(i&&typeof i!="function"&&i.current){let I=Reflect.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;I&&Reflect.apply(I,i.current,[""]);let Q=new Event("input",{bubbles:true});i.current.dispatchEvent(Q);}else h&&h({target:{value:""},currentTarget:{value:""},preventDefault:()=>{},stopPropagation:()=>{}});},G=()=>b?jsxs("svg",{className:"animate-spin h-full w-full text-text-muted",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):y?jsx("button",{type:"button",onClick:q,className:"flex items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-hover p-0.5 transition-all duration-fast","aria-label":"Clear input",children:jsx(XMarkIcon,{className:"w-full h-full",strokeWidth:2.5})}):g,J=jsx("input",{ref:i,id:m,disabled:!!T||!!b,type:"date",value:x,onChange:h,"aria-invalid":c==="error"?true:void 0,"aria-describedby":X,"aria-required":n,className:s("w-full transition-colors duration-150",re[d],ne[w],oe[c][w],ie,ae(S,C,d),H),...O});return jsxs("div",{className:s("flex flex-col gap-1",k?"w-full":"w-fit",B,F),children:[t!==void 0&&jsxs("label",{htmlFor:m,className:s("font-black leading-none text-text uppercase tracking-widest",te[d],j),children:[t,n&&jsx("span",{"aria-hidden":"true",className:"ml-1 text-error",children:"*"})]}),jsxs("div",{className:s("flex items-stretch",k?"w-full":"w-fit",M),children:[f!==void 0&&jsx(A,{side:"left",children:f}),jsxs("div",{className:"relative flex flex-1 items-center",children:[S&&jsx(z,{side:"left",size:d,children:D}),jsx("div",{className:s("flex-1",f!==void 0&&p!==void 0?"[&>input]:rounded-none":f!==void 0?"[&>input]:rounded-l-none":p!==void 0?"[&>input]:rounded-r-none":""),children:J}),C&&jsx(z,{side:"right",size:d,pointerEvents:!g&&!!y,children:G()})]}),p!==void 0&&jsx(A,{side:"right",children:p})]}),o!==void 0&&jsx("p",{id:R,className:s("text-xs leading-tight text-text-muted font-medium",v),children:o}),P!==void 0&&jsx("p",{id:N,role:c==="error"?"alert":void 0,className:s("text-xs leading-tight mt-1 font-medium",se[c],v),children:P})]})});V.displayName="DatePicker";
2
+ export{V as DatePicker};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),outline=require('@heroicons/react/24/outline'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function n(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var S={xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full m-0 rounded-none h-full"};function V({isOpen:e,onClose:t,children:y,size:m="md",isCentered:v=false,closeOnOverlayClick:w=true,closeOnEsc:c=true,trapFocus:f=true,lockScroll:u=true,contentClassName:D,overlayClassName:E,showBackdrop:h=true,isModal:o=true,ariaLabel:P,ariaLabelledby:C,ariaDescribedby:R}){let s=react.useRef(null),x=react.useRef(null),d=react.useCallback(()=>{t();},[t]);return react.useEffect(()=>{if(e){x.current=document.activeElement,o&&u&&(document.body.style.overflow="hidden");let a=r=>{if(c&&r.key==="Escape"){d();return}if(o&&f&&r.key==="Tab"){let i=s.current?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i||i.length===0)return;let p=i[0],b=i[i.length-1];r.shiftKey?document.activeElement===p&&(b.focus(),r.preventDefault()):document.activeElement===b&&(p.focus(),r.preventDefault());}};return document.addEventListener("keydown",a),o&&setTimeout(()=>{let r=s.current?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');r!=null?r.focus():s.current?.focus();},0),()=>{document.removeEventListener("keydown",a),o&&u&&(document.body.style.overflow=""),x.current?.focus();}}},[e,c,d,u,f,o]),e?reactDom.createPortal(jsxRuntime.jsx("div",{role:"presentation",className:n("fixed inset-0 z-50 flex items-start justify-center p-4 sm:p-6 overflow-y-auto transition-opacity duration-300",h&&"bg-black/60 backdrop-blur-sm",!o&&"pointer-events-none",v&&"items-center",E),onClick:a=>{w&&a.target===a.currentTarget&&d();},children:jsxRuntime.jsx("div",{ref:s,role:"dialog",tabIndex:-1,"aria-modal":o?"true":"false","aria-label":P,"aria-labelledby":C,"aria-describedby":R,className:n("relative w-full mx-auto bg-surface rounded-xl shadow-lg border border-border transition-all duration-300 transform scale-100 opacity-100 flex flex-col",m!=="full"&&"max-h-[90vh]",!o&&"pointer-events-auto",S[m],D),children:y})}),document.body):null}function j({children:e,className:t}){return jsxRuntime.jsx("div",{className:n("px-6 py-5 border-b border-border/60",t),children:jsxRuntime.jsx("h2",{className:"text-xl font-bold text-text uppercase tracking-wider",children:e})})}function A({children:e,className:t}){return jsxRuntime.jsx("div",{className:n("px-6 py-6 overflow-y-auto flex-1 text-text-secondary leading-relaxed font-medium",t),children:e})}function M({children:e,className:t}){return jsxRuntime.jsx("div",{className:n("px-6 py-4 bg-surface-secondary border-t border-border flex items-center justify-end gap-3 rounded-b-xl",t),children:e})}function G({onClick:e,className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:e,className:n("absolute top-4 right-4 p-2 text-text-muted hover:text-text hover:bg-hover rounded-lg transition-all duration-fast",t),"aria-label":"Close dialog",children:jsxRuntime.jsx(outline.XMarkIcon,{className:"w-5 h-5"})})}exports.Dialog=V;exports.DialogBody=A;exports.DialogCloseButton=G;exports.DialogFooter=M;exports.DialogHeader=j;
@@ -0,0 +1,61 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | 'full';
4
+ interface DialogProps {
5
+ /** If true, the dialog will be open. */
6
+ isOpen: boolean;
7
+ /** Callback invoked when the dialog should close. */
8
+ onClose: () => void;
9
+ /** The content of the dialog. Usually includes DialogHeader, DialogBody, and DialogFooter. */
10
+ children: ReactNode;
11
+ /** The size of the dialog. Defaults to 'md'. */
12
+ size?: DialogSize;
13
+ /** If true, the dialog will be centered on the screen. Defaults to false. */
14
+ isCentered?: boolean;
15
+ /** If true, the dialog will close when the overlay is clicked. Defaults to true. */
16
+ closeOnOverlayClick?: boolean;
17
+ /** If true, the dialog will close when the ESC key is pressed. Defaults to true. */
18
+ closeOnEsc?: boolean;
19
+ /** If true, focus will be trapped inside the dialog. Defaults to true. */
20
+ trapFocus?: boolean;
21
+ /** If true, the body scroll will be locked when the dialog is open. Defaults to true. */
22
+ lockScroll?: boolean;
23
+ /** Additional class names for the dialog content. */
24
+ contentClassName?: string;
25
+ /** Additional class names for the overlay. */
26
+ overlayClassName?: string;
27
+ /** If true, the backdrop will be visible. Defaults to true. */
28
+ showBackdrop?: boolean;
29
+ /** If true, the dialog will be treated as a modal (traps focus, locked scroll). Defaults to true. */
30
+ isModal?: boolean;
31
+ /** ARIA label for the dialog. */
32
+ ariaLabel?: string;
33
+ /** ID of the element that labels the dialog. */
34
+ ariaLabelledby?: string;
35
+ /** ID of the element that describes the dialog. */
36
+ ariaDescribedby?: string;
37
+ }
38
+ interface DialogHeaderProps {
39
+ children: ReactNode;
40
+ className?: string;
41
+ }
42
+ interface DialogBodyProps {
43
+ children: ReactNode;
44
+ className?: string;
45
+ }
46
+ interface DialogFooterProps {
47
+ children: ReactNode;
48
+ className?: string;
49
+ }
50
+ interface DialogCloseButtonProps {
51
+ onClick?: () => void;
52
+ className?: string;
53
+ }
54
+
55
+ declare function Dialog({ isOpen, onClose, children, size, isCentered, closeOnOverlayClick, closeOnEsc, trapFocus, lockScroll, contentClassName, overlayClassName, showBackdrop, isModal, ariaLabel, ariaLabelledby, ariaDescribedby, }: DialogProps): React.ReactPortal | null;
56
+ declare function DialogHeader({ children, className }: DialogHeaderProps): React.JSX.Element;
57
+ declare function DialogBody({ children, className }: DialogBodyProps): React.JSX.Element;
58
+ declare function DialogFooter({ children, className }: DialogFooterProps): React.JSX.Element;
59
+ declare function DialogCloseButton({ onClick, className, }: DialogCloseButtonProps): React.JSX.Element;
60
+
61
+ export { Dialog, DialogBody, type DialogBodyProps, DialogCloseButton, type DialogCloseButtonProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, type DialogSize };
@@ -0,0 +1,61 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | 'full';
4
+ interface DialogProps {
5
+ /** If true, the dialog will be open. */
6
+ isOpen: boolean;
7
+ /** Callback invoked when the dialog should close. */
8
+ onClose: () => void;
9
+ /** The content of the dialog. Usually includes DialogHeader, DialogBody, and DialogFooter. */
10
+ children: ReactNode;
11
+ /** The size of the dialog. Defaults to 'md'. */
12
+ size?: DialogSize;
13
+ /** If true, the dialog will be centered on the screen. Defaults to false. */
14
+ isCentered?: boolean;
15
+ /** If true, the dialog will close when the overlay is clicked. Defaults to true. */
16
+ closeOnOverlayClick?: boolean;
17
+ /** If true, the dialog will close when the ESC key is pressed. Defaults to true. */
18
+ closeOnEsc?: boolean;
19
+ /** If true, focus will be trapped inside the dialog. Defaults to true. */
20
+ trapFocus?: boolean;
21
+ /** If true, the body scroll will be locked when the dialog is open. Defaults to true. */
22
+ lockScroll?: boolean;
23
+ /** Additional class names for the dialog content. */
24
+ contentClassName?: string;
25
+ /** Additional class names for the overlay. */
26
+ overlayClassName?: string;
27
+ /** If true, the backdrop will be visible. Defaults to true. */
28
+ showBackdrop?: boolean;
29
+ /** If true, the dialog will be treated as a modal (traps focus, locked scroll). Defaults to true. */
30
+ isModal?: boolean;
31
+ /** ARIA label for the dialog. */
32
+ ariaLabel?: string;
33
+ /** ID of the element that labels the dialog. */
34
+ ariaLabelledby?: string;
35
+ /** ID of the element that describes the dialog. */
36
+ ariaDescribedby?: string;
37
+ }
38
+ interface DialogHeaderProps {
39
+ children: ReactNode;
40
+ className?: string;
41
+ }
42
+ interface DialogBodyProps {
43
+ children: ReactNode;
44
+ className?: string;
45
+ }
46
+ interface DialogFooterProps {
47
+ children: ReactNode;
48
+ className?: string;
49
+ }
50
+ interface DialogCloseButtonProps {
51
+ onClick?: () => void;
52
+ className?: string;
53
+ }
54
+
55
+ declare function Dialog({ isOpen, onClose, children, size, isCentered, closeOnOverlayClick, closeOnEsc, trapFocus, lockScroll, contentClassName, overlayClassName, showBackdrop, isModal, ariaLabel, ariaLabelledby, ariaDescribedby, }: DialogProps): React.ReactPortal | null;
56
+ declare function DialogHeader({ children, className }: DialogHeaderProps): React.JSX.Element;
57
+ declare function DialogBody({ children, className }: DialogBodyProps): React.JSX.Element;
58
+ declare function DialogFooter({ children, className }: DialogFooterProps): React.JSX.Element;
59
+ declare function DialogCloseButton({ onClick, className, }: DialogCloseButtonProps): React.JSX.Element;
60
+
61
+ export { Dialog, DialogBody, type DialogBodyProps, DialogCloseButton, type DialogCloseButtonProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, type DialogSize };
@@ -0,0 +1 @@
1
+ import {useRef,useCallback,useEffect}from'react';import {XMarkIcon}from'@heroicons/react/24/outline';import {createPortal}from'react-dom';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function n(...e){return twMerge(clsx(e))}var S={xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full m-0 rounded-none h-full"};function V({isOpen:e,onClose:t,children:y,size:m="md",isCentered:v=false,closeOnOverlayClick:w=true,closeOnEsc:c=true,trapFocus:f=true,lockScroll:u=true,contentClassName:D,overlayClassName:E,showBackdrop:h=true,isModal:o=true,ariaLabel:P,ariaLabelledby:C,ariaDescribedby:R}){let s=useRef(null),x=useRef(null),d=useCallback(()=>{t();},[t]);return useEffect(()=>{if(e){x.current=document.activeElement,o&&u&&(document.body.style.overflow="hidden");let a=r=>{if(c&&r.key==="Escape"){d();return}if(o&&f&&r.key==="Tab"){let i=s.current?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i||i.length===0)return;let p=i[0],b=i[i.length-1];r.shiftKey?document.activeElement===p&&(b.focus(),r.preventDefault()):document.activeElement===b&&(p.focus(),r.preventDefault());}};return document.addEventListener("keydown",a),o&&setTimeout(()=>{let r=s.current?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');r!=null?r.focus():s.current?.focus();},0),()=>{document.removeEventListener("keydown",a),o&&u&&(document.body.style.overflow=""),x.current?.focus();}}},[e,c,d,u,f,o]),e?createPortal(jsx("div",{role:"presentation",className:n("fixed inset-0 z-50 flex items-start justify-center p-4 sm:p-6 overflow-y-auto transition-opacity duration-300",h&&"bg-black/60 backdrop-blur-sm",!o&&"pointer-events-none",v&&"items-center",E),onClick:a=>{w&&a.target===a.currentTarget&&d();},children:jsx("div",{ref:s,role:"dialog",tabIndex:-1,"aria-modal":o?"true":"false","aria-label":P,"aria-labelledby":C,"aria-describedby":R,className:n("relative w-full mx-auto bg-surface rounded-xl shadow-lg border border-border transition-all duration-300 transform scale-100 opacity-100 flex flex-col",m!=="full"&&"max-h-[90vh]",!o&&"pointer-events-auto",S[m],D),children:y})}),document.body):null}function j({children:e,className:t}){return jsx("div",{className:n("px-6 py-5 border-b border-border/60",t),children:jsx("h2",{className:"text-xl font-bold text-text uppercase tracking-wider",children:e})})}function A({children:e,className:t}){return jsx("div",{className:n("px-6 py-6 overflow-y-auto flex-1 text-text-secondary leading-relaxed font-medium",t),children:e})}function M({children:e,className:t}){return jsx("div",{className:n("px-6 py-4 bg-surface-secondary border-t border-border flex items-center justify-end gap-3 rounded-b-xl",t),children:e})}function G({onClick:e,className:t}){return jsx("button",{type:"button",onClick:e,className:n("absolute top-4 right-4 p-2 text-text-muted hover:text-text hover:bg-hover rounded-lg transition-all duration-fast",t),"aria-label":"Close dialog",children:jsx(XMarkIcon,{className:"w-5 h-5"})})}export{V as Dialog,A as DialogBody,G as DialogCloseButton,M as DialogFooter,j as DialogHeader};
@@ -0,0 +1 @@
1
+ 'use strict';var t=require('react'),solid=require('@heroicons/react/20/solid'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var t__namespace=/*#__PURE__*/_interopNamespace(t);function w(...n){return tailwindMerge.twMerge(clsx.clsx(n))}var v=t__namespace.createContext(null);function M(){let n=t__namespace.useContext(v);if(!n)throw new Error("DropdownMenu components must be used within a DropdownMenu");return n}var R=({children:n,open:s,onOpenChange:o,className:m})=>{let[i,u]=t__namespace.useState(false),[e,d]=t__namespace.useState(null),l=s??i,a=t__namespace.useCallback(r=>{u(r),o?.(r);},[o]);return t__namespace.useEffect(()=>{if(!l)return;let r=p=>{e&&!e.contains(p.target)&&!p.target.closest("[data-dropdown-content]")&&a(false);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[l,a,e]),t__namespace.useEffect(()=>{if(!l)return;let r=p=>{p.key==="Escape"&&(a(false),e?.focus());};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r);}},[l,a,e]),jsxRuntime.jsx(v.Provider,{value:{open:l,setOpen:a,triggerElement:e,setTriggerElement:d},children:jsxRuntime.jsx("div",{className:w("relative inline-block",m),children:n})})},y={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-11 px-5 text-base"},h={default:"bg-surface border border-border text-text shadow-sm hover:bg-hover focus:ring-2 focus:ring-primary/40",subtle:"bg-surface-secondary text-text hover:bg-active",ghost:"bg-transparent text-text-secondary hover:bg-hover"},C=t__namespace.forwardRef(({children:n,className:s,size:o="md",variant:m="default",onClick:i,...u},e)=>{let{open:d,setOpen:l,setTriggerElement:a}=M(),r=t__namespace.useCallback(g=>{a(g),typeof e=="function"?e(g):e&&(e.current=g);},[e,a]),p=g=>{l(!d),i?.(g);};return jsxRuntime.jsxs("button",{ref:r,type:"button","aria-expanded":d,"aria-haspopup":"menu",className:w("inline-flex items-center justify-center rounded-md font-bold uppercase tracking-widest transition-all duration-normal focus:outline-none disabled:opacity-50 disabled:pointer-events-none",y[o],h[m],s),onClick:p,...u,children:[n,jsxRuntime.jsx(solid.ChevronDownIcon,{className:w("ml-2 h-4 w-4 transition-transform duration-200",d&&"rotate-180")})]})}),T=t__namespace.forwardRef(({children:n,className:s,align:o="left",width:m=220,...i},u)=>{let{open:e}=M();return e?jsxRuntime.jsx("div",{ref:u,"data-dropdown-content":true,role:"menu",style:{width:m},className:w("absolute top-full z-dropdown mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-surface p-1.5 text-text shadow-lg ring-1 ring-border/5 animate-in fade-in zoom-in-95 duration-normal",{left:"left-0",right:"right-0",center:"left-1/2 -translate-x-1/2"}[o],s),...i,children:n}):null}),L=t__namespace.forwardRef(({children:n,className:s,disabled:o,destructive:m,icon:i,shortcut:u,onClick:e,...d},l)=>{let{setOpen:a}=M(),r=f=>{o||(e?.(f),a(false));},p=f=>{o||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e?.(f),a(false));};return jsxRuntime.jsxs("div",{ref:l,role:"menuitem","aria-disabled":o,tabIndex:o?-1:0,className:w("relative flex cursor-default select-none items-center rounded-sm px-3 py-2 text-sm outline-none transition-all duration-fast focus:bg-hover data-disabled:pointer-events-none data-disabled:opacity-50 hover:bg-hover font-medium",m&&"text-error hover:bg-error/10 hover:text-error",o&&"opacity-50 pointer-events-none",s),onClick:r,onKeyDown:p,...d,children:[i&&jsxRuntime.jsx("span",{className:"mr-2 flex h-4 w-4 items-center justify-center",children:i}),jsxRuntime.jsx("span",{className:"flex-1",children:n}),u&&jsxRuntime.jsx("span",{className:"ml-auto text-xs tracking-widest text-text-muted font-bold",children:u})]})}),H=({className:n,...s})=>jsxRuntime.jsx("div",{className:w("-mx-1.5 my-1 h-px bg-divider",n),...s});R.displayName="DropdownMenu";C.displayName="DropdownMenuTrigger";T.displayName="DropdownMenuContent";L.displayName="DropdownMenuItem";H.displayName="DropdownMenuSeparator";exports.DropdownMenu=R;exports.DropdownMenuContent=T;exports.DropdownMenuItem=L;exports.DropdownMenuSeparator=H;exports.DropdownMenuTrigger=C;