@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,96 @@
1
+ import { ReactNode, ElementType, CSSProperties } from 'react';
2
+
3
+ interface SidebarItem {
4
+ id: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ href?: string;
8
+ onClick?: () => void;
9
+ isActive?: boolean;
10
+ badge?: ReactNode;
11
+ /** Optional component to use for the item (e.g., NavLink) */
12
+ component?: ElementType;
13
+ /** Optional props for the custom component */
14
+ componentProps?: Record<string, unknown>;
15
+ /** Optional nested items */
16
+ items?: SidebarItem[];
17
+ /** Whether the item is currently expanded (for nested items) */
18
+ isExpanded?: boolean;
19
+ /** Whether the item should be hidden */
20
+ hidden?: boolean;
21
+ }
22
+ interface SidebarGroup {
23
+ id: string;
24
+ label?: string;
25
+ items: SidebarItem[];
26
+ /** Whether the group should be hidden */
27
+ hidden?: boolean;
28
+ }
29
+ interface SidebarClassNames {
30
+ root?: string;
31
+ header?: string;
32
+ content?: string;
33
+ footer?: string;
34
+ group?: string;
35
+ groupLabel?: string;
36
+ item?: string;
37
+ itemIcon?: string;
38
+ itemLabel?: string;
39
+ itemActive?: string;
40
+ itemCollapsed?: string;
41
+ toggleButton?: string;
42
+ }
43
+ interface SidebarStyles {
44
+ root?: CSSProperties;
45
+ header?: CSSProperties;
46
+ content?: CSSProperties;
47
+ footer?: CSSProperties;
48
+ group?: CSSProperties;
49
+ groupLabel?: CSSProperties;
50
+ item?: CSSProperties;
51
+ itemIcon?: CSSProperties;
52
+ itemLabel?: CSSProperties;
53
+ toggleButton?: CSSProperties;
54
+ }
55
+ interface SidebarProps {
56
+ /** Groups of navigation items to display in the sidebar. */
57
+ groups: SidebarGroup[];
58
+ /** Whether the sidebar is in its collapsed state. */
59
+ isCollapsed?: boolean;
60
+ /** Callback triggered when the collapsed state changes. */
61
+ onToggleCollapse?: (isCollapsed: boolean) => void;
62
+ /** Optional logo or brand element to display at the top. */
63
+ logo?: ReactNode;
64
+ /** Optional footer content. */
65
+ footer?: ReactNode;
66
+ /** Additional CSS classes for the container. */
67
+ className?: string;
68
+ /** Whether to show the glass effect. */
69
+ glass?: boolean;
70
+ /** Custom width for expanded state (default: 288px / 72rem) */
71
+ width?: string | number;
72
+ /** Custom width for collapsed state (default: 80px / 20rem) */
73
+ collapsedWidth?: string | number;
74
+ /** Whether to show the built-in collapse toggle button */
75
+ showToggleButton?: boolean;
76
+ /** Position of the toggle button ('top' | 'bottom' | 'center') */
77
+ togglePosition?: 'top' | 'bottom' | 'center';
78
+ /** Placement of the sidebar */
79
+ position?: 'left' | 'right';
80
+ /** Whether icons should be centered when collapsed */
81
+ centerIcons?: boolean;
82
+ /** Deep customization of CSS classes */
83
+ classNames?: SidebarClassNames;
84
+ /** Deep customization of inline styles */
85
+ styles?: SidebarStyles;
86
+ /** Custom render function for items */
87
+ renderItem?: (item: SidebarItem, isCollapsed: boolean) => ReactNode;
88
+ }
89
+
90
+ interface SidebarComponent {
91
+ (props: SidebarProps): React.JSX.Element;
92
+ displayName?: string;
93
+ }
94
+ declare const Sidebar: SidebarComponent;
95
+
96
+ export { Sidebar, type SidebarGroup, type SidebarItem, type SidebarProps };
@@ -0,0 +1,96 @@
1
+ import { ReactNode, ElementType, CSSProperties } from 'react';
2
+
3
+ interface SidebarItem {
4
+ id: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ href?: string;
8
+ onClick?: () => void;
9
+ isActive?: boolean;
10
+ badge?: ReactNode;
11
+ /** Optional component to use for the item (e.g., NavLink) */
12
+ component?: ElementType;
13
+ /** Optional props for the custom component */
14
+ componentProps?: Record<string, unknown>;
15
+ /** Optional nested items */
16
+ items?: SidebarItem[];
17
+ /** Whether the item is currently expanded (for nested items) */
18
+ isExpanded?: boolean;
19
+ /** Whether the item should be hidden */
20
+ hidden?: boolean;
21
+ }
22
+ interface SidebarGroup {
23
+ id: string;
24
+ label?: string;
25
+ items: SidebarItem[];
26
+ /** Whether the group should be hidden */
27
+ hidden?: boolean;
28
+ }
29
+ interface SidebarClassNames {
30
+ root?: string;
31
+ header?: string;
32
+ content?: string;
33
+ footer?: string;
34
+ group?: string;
35
+ groupLabel?: string;
36
+ item?: string;
37
+ itemIcon?: string;
38
+ itemLabel?: string;
39
+ itemActive?: string;
40
+ itemCollapsed?: string;
41
+ toggleButton?: string;
42
+ }
43
+ interface SidebarStyles {
44
+ root?: CSSProperties;
45
+ header?: CSSProperties;
46
+ content?: CSSProperties;
47
+ footer?: CSSProperties;
48
+ group?: CSSProperties;
49
+ groupLabel?: CSSProperties;
50
+ item?: CSSProperties;
51
+ itemIcon?: CSSProperties;
52
+ itemLabel?: CSSProperties;
53
+ toggleButton?: CSSProperties;
54
+ }
55
+ interface SidebarProps {
56
+ /** Groups of navigation items to display in the sidebar. */
57
+ groups: SidebarGroup[];
58
+ /** Whether the sidebar is in its collapsed state. */
59
+ isCollapsed?: boolean;
60
+ /** Callback triggered when the collapsed state changes. */
61
+ onToggleCollapse?: (isCollapsed: boolean) => void;
62
+ /** Optional logo or brand element to display at the top. */
63
+ logo?: ReactNode;
64
+ /** Optional footer content. */
65
+ footer?: ReactNode;
66
+ /** Additional CSS classes for the container. */
67
+ className?: string;
68
+ /** Whether to show the glass effect. */
69
+ glass?: boolean;
70
+ /** Custom width for expanded state (default: 288px / 72rem) */
71
+ width?: string | number;
72
+ /** Custom width for collapsed state (default: 80px / 20rem) */
73
+ collapsedWidth?: string | number;
74
+ /** Whether to show the built-in collapse toggle button */
75
+ showToggleButton?: boolean;
76
+ /** Position of the toggle button ('top' | 'bottom' | 'center') */
77
+ togglePosition?: 'top' | 'bottom' | 'center';
78
+ /** Placement of the sidebar */
79
+ position?: 'left' | 'right';
80
+ /** Whether icons should be centered when collapsed */
81
+ centerIcons?: boolean;
82
+ /** Deep customization of CSS classes */
83
+ classNames?: SidebarClassNames;
84
+ /** Deep customization of inline styles */
85
+ styles?: SidebarStyles;
86
+ /** Custom render function for items */
87
+ renderItem?: (item: SidebarItem, isCollapsed: boolean) => ReactNode;
88
+ }
89
+
90
+ interface SidebarComponent {
91
+ (props: SidebarProps): React.JSX.Element;
92
+ displayName?: string;
93
+ }
94
+ declare const Sidebar: SidebarComponent;
95
+
96
+ export { Sidebar, type SidebarGroup, type SidebarItem, type SidebarProps };
@@ -0,0 +1 @@
1
+ import {useState}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {ChevronRightIcon,ChevronLeftIcon,ChevronDownIcon}from'@heroicons/react/24/outline';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function a(...s){return twMerge(clsx(s))}var C=({groups:s,isCollapsed:I,onToggleCollapse:u,logo:m,footer:x,className:N,glass:k=false,width:E=288,collapsedWidth:R=80,showToggleButton:L=false,togglePosition:p="center",position:l="left",centerIcons:A=true,classNames:o={},styles:n={},renderItem:f})=>{let[B,j]=useState(false),[z,G]=useState({}),r=I??B,M=()=>{let e=!r;u?u(e):j(e);},P=e=>{G(d=>({...d,[e]:!d[e]}));},D=r?R:E,h=(e,d=0)=>{if(e.hidden)return null;if(f)return jsx("div",{children:f(e,r)},e.id);let c=e.items&&e.items.length>0,v=z[e.id]??!!e.isExpanded,y=e.component??"button",V=jsxs(Fragment,{children:[e.icon&&jsx("span",{className:a("shrink-0 transition-colors duration-normal",e.isActive?"text-text-inverse":"text-text-muted group-hover:text-text",r&&A&&"mx-auto",o.itemIcon),style:n.itemIcon,children:e.icon}),!r&&jsx("span",{className:a("truncate",o.itemLabel),style:n.itemLabel,children:e.label}),!r&&jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.badge&&jsx("span",{className:"shrink-0",children:e.badge}),c&&jsx(ChevronDownIcon,{className:a("w-4 h-4 transition-transform duration-normal",v&&"rotate-180")})]}),r&&jsx("div",{className:"absolute left-full ml-2 px-2 py-1 bg-surface-secondary border border-border rounded shadow-lg text-xs opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-index-tooltip whitespace-nowrap text-text",children:e.label})]});return jsxs("div",{className:"w-full",children:[jsx(y,{type:y==="button"?"button":void 0,onClick:b=>{c&&!r&&(b.preventDefault(),P(e.id)),e.onClick?.();},className:a("w-full flex items-center gap-4 transition-all duration-normal group relative text-base rounded-lg",d===0?"px-4 py-3":"px-3 py-2 pl-10",e.isActive?"bg-black text-text-inverse shadow-md shadow-black/20 font-bold":"text-text-secondary hover:bg-hover hover:text-text",r&&"justify-center px-0",e.isActive&&o.itemActive,r&&o.itemCollapsed,o.item),style:n.item,title:r?e.label:void 0,...e.componentProps??{},children:V}),c&&v&&!r&&jsx("div",{className:"mt-1 space-y-1",children:e.items?.map(b=>h(b,d+1))})]},e.id)},J=L&&jsx("button",{onClick:M,className:a("absolute z-index-popover flex items-center justify-center w-8 h-8 rounded-full bg-surface border border-border shadow-sm hover:shadow-md transition-all duration-normal hover:bg-hover text-text-muted hover:text-text",l==="left"?"-right-4":"-left-4",p==="top"&&"top-12",p==="center"&&"top-1/2 -translate-y-1/2",p==="bottom"&&"bottom-12",o.toggleButton),style:n.toggleButton,"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?l==="left"?jsx(ChevronRightIcon,{className:"w-4 h-4"}):jsx(ChevronLeftIcon,{className:"w-4 h-4"}):l==="left"?jsx(ChevronLeftIcon,{className:"w-4 h-4"}):jsx(ChevronRightIcon,{className:"w-4 h-4"})});return jsxs("aside",{className:a("flex flex-col h-full bg-surface transition-all duration-slow ease-in-out z-index-sticky shadow-premium relative",l==="right"&&"border-l border-border",l==="left"&&"border-r border-border",k&&"glass",o.root,N),style:{width:D,...n.root},children:[J,m&&jsx("div",{className:a("flex items-center px-6 pt-10 pb-6",r&&"justify-center px-0",o.header),style:n.header,children:m}),jsx("div",{className:a("flex-1 overflow-y-auto overflow-x-hidden px-4 py-6 space-y-10 custom-scrollbar",o.content),style:n.content,children:s.map(e=>e.hidden?null:jsxs("div",{className:a("space-y-4",o.group),style:n.group,children:[e.label&&!r&&jsx("h3",{className:a("px-2 text-xs font-bold text-text-muted uppercase tracking-wider",o.groupLabel),style:n.groupLabel,children:e.label}),jsx("div",{className:"space-y-1",children:e.items.map(d=>h(d))})]},e.id))}),x&&jsx("div",{className:a("p-6 mt-auto border-t border-border/50",r&&"flex justify-center px-0",o.footer),style:n.footer,children:x})]})};C.displayName="Sidebar";export{C as Sidebar};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function l(...p){return tailwindMerge.twMerge(clsx.clsx(p))}var g={default:"animate-pulse bg-skeleton",wave:"skeleton-wave bg-skeleton",pulse:"animate-pulse bg-skeleton-shine"},x={rectangle:"rounded-sm",circle:"rounded-full",rounded:"rounded-md"},s=react.forwardRef(function({className:r,variant:a="wave",shape:n="rectangle",width:e,height:o,style:d,...f},m){return jsxRuntime.jsx("div",{ref:m,role:"status","aria-busy":"true","aria-label":"Loading",style:{width:e!==void 0?typeof e=="number"?`${String(e)}px`:e:void 0,height:o!==void 0?typeof o=="number"?`${String(o)}px`:o:void 0,...d},className:l("overflow-hidden",g[a],x[n],r),...f})});s.displayName="Skeleton";var k=react.forwardRef(function({lines:r=3,variant:a="wave",shortLast:n=true,className:e,...o},d){return jsxRuntime.jsx("div",{ref:d,className:l("flex flex-col gap-2",e),role:"status","aria-busy":"true","aria-label":"Loading",...o,children:Array.from({length:r}).map((f,m)=>{let i=m===r-1;return jsxRuntime.jsx(s,{variant:a,height:14,className:l(i&&n?"w-3/5":"w-full")},m)})})});k.displayName="SkeletonText";var h=react.forwardRef(function({size:r=40,variant:a="wave",className:n,...e},o){return jsxRuntime.jsx(s,{ref:o,variant:a,shape:"circle",width:r,height:r,className:l("shrink-0",n),...e})});h.displayName="SkeletonAvatar";var y=react.forwardRef(function({showImage:r=true,imageHeight:a=160,lines:n=3,variant:e="wave",className:o,...d},f){return jsxRuntime.jsxs("div",{ref:f,className:l("rounded-lg border border-border bg-surface overflow-hidden flex flex-col",o),role:"status","aria-busy":"true","aria-label":"Loading",...d,children:[r&&jsxRuntime.jsx(s,{variant:e,shape:"rectangle",height:a,className:"w-full rounded-none"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[jsxRuntime.jsx(s,{variant:e,height:20,className:"w-2/3"}),jsxRuntime.jsx(k,{lines:n,variant:e,className:"mt-1"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[jsxRuntime.jsx(s,{variant:e,width:80,height:32,shape:"rounded"}),jsxRuntime.jsx(s,{variant:e,width:80,height:32,shape:"rounded"})]})]})]})});y.displayName="SkeletonCard";var w=react.forwardRef(function({rows:r=5,columns:a=4,variant:n="wave",showHeader:e=true,className:o,...d},f){return jsxRuntime.jsxs("div",{ref:f,className:l("w-full rounded-lg border border-border overflow-hidden bg-surface",o),role:"status","aria-busy":"true","aria-label":"Loading",...d,children:[e&&jsxRuntime.jsx("div",{className:"flex items-center gap-4 border-b border-border px-4 py-2 bg-surface-secondary",children:Array.from({length:a}).map((m,i)=>jsxRuntime.jsx(s,{variant:n,height:14,className:l(i===0?"w-1/4":i===a-1?"w-16":"flex-1")},i))}),Array.from({length:r}).map((m,i)=>jsxRuntime.jsx("div",{className:l("flex items-center gap-4 px-4 py-2",i<r-1&&"border-b border-border"),children:Array.from({length:a}).map((R,v)=>jsxRuntime.jsx(s,{variant:n,height:14,className:l(v===0?"w-1/4":v===a-1?"w-16":"flex-1")},v))},i))]})});w.displayName="SkeletonTable";exports.Skeleton=s;exports.SkeletonAvatar=h;exports.SkeletonCard=y;exports.SkeletonTable=w;exports.SkeletonText=k;
@@ -0,0 +1,76 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ type SkeletonVariant = 'default' | 'wave' | 'pulse';
4
+ type SkeletonShape = 'rectangle' | 'circle' | 'rounded';
5
+ interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
6
+ /** Animation style of the skeleton. Defaults to 'wave'. */
7
+ variant?: SkeletonVariant;
8
+ /** Shape of the skeleton block. Defaults to 'rectangle'. */
9
+ shape?: SkeletonShape;
10
+ /** Explicit width (e.g. '100%', '200px'). Falls back to the element's natural width. */
11
+ width?: string | number;
12
+ /** Explicit height (e.g. '1rem', 48). Falls back to the element's natural height. */
13
+ height?: string | number;
14
+ }
15
+ interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {
16
+ /** Number of text lines to render. Defaults to 3. */
17
+ lines?: number;
18
+ /** Animation variant forwarded to each line. Defaults to 'wave'. */
19
+ variant?: SkeletonVariant;
20
+ /** When true the last line is shorter (≈ 60 %) to look like natural prose. Defaults to true. */
21
+ shortLast?: boolean;
22
+ }
23
+ interface SkeletonAvatarProps extends HTMLAttributes<HTMLDivElement> {
24
+ /** Diameter of the avatar circle in pixels. Defaults to 40. */
25
+ size?: number;
26
+ /** Animation variant. Defaults to 'wave'. */
27
+ variant?: SkeletonVariant;
28
+ }
29
+ interface SkeletonCardProps extends HTMLAttributes<HTMLDivElement> {
30
+ /** Show a header image placeholder at the top of the card. Defaults to true. */
31
+ showImage?: boolean;
32
+ /** Height of the image placeholder in pixels. Defaults to 160. */
33
+ imageHeight?: number;
34
+ /** Number of text-line skeletons in the body. Defaults to 3. */
35
+ lines?: number;
36
+ /** Animation variant forwarded to all children. Defaults to 'wave'. */
37
+ variant?: SkeletonVariant;
38
+ }
39
+ interface SkeletonTableProps extends HTMLAttributes<HTMLDivElement> {
40
+ /** Number of rows to render. Defaults to 5. */
41
+ rows?: number;
42
+ /** Number of columns to render. Defaults to 4. */
43
+ columns?: number;
44
+ /** Animation variant. Defaults to 'wave'. */
45
+ variant?: SkeletonVariant;
46
+ /** Show a header row above the body rows. Defaults to true. */
47
+ showHeader?: boolean;
48
+ }
49
+
50
+ /**
51
+ * Primitive skeleton block. Use this as the building brick for any custom
52
+ * layout skeleton you need.
53
+ */
54
+ declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
55
+ /**
56
+ * Multi-line text placeholder. The last line is intentionally shorter to
57
+ * mimic natural prose paragraph endings.
58
+ */
59
+ declare const SkeletonText: React.ForwardRefExoticComponent<SkeletonTextProps & React.RefAttributes<HTMLDivElement>>;
60
+ /**
61
+ * Circular avatar placeholder. Pairs naturally with SkeletonText to build
62
+ * user-card or comment-thread loaders.
63
+ */
64
+ declare const SkeletonAvatar: React.ForwardRefExoticComponent<SkeletonAvatarProps & React.RefAttributes<HTMLDivElement>>;
65
+ /**
66
+ * Pre-composed card skeleton mirroring the Card component structure:
67
+ * optional hero image → title → description lines → action bar.
68
+ */
69
+ declare const SkeletonCard: React.ForwardRefExoticComponent<SkeletonCardProps & React.RefAttributes<HTMLDivElement>>;
70
+ /**
71
+ * Full table placeholder matching the Table component's visual grid.
72
+ * Renders a configurable number of column headers and body rows.
73
+ */
74
+ declare const SkeletonTable: React.ForwardRefExoticComponent<SkeletonTableProps & React.RefAttributes<HTMLDivElement>>;
75
+
76
+ export { Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, type SkeletonShape, SkeletonTable, type SkeletonTableProps, SkeletonText, type SkeletonTextProps, type SkeletonVariant };
@@ -0,0 +1,76 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ type SkeletonVariant = 'default' | 'wave' | 'pulse';
4
+ type SkeletonShape = 'rectangle' | 'circle' | 'rounded';
5
+ interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
6
+ /** Animation style of the skeleton. Defaults to 'wave'. */
7
+ variant?: SkeletonVariant;
8
+ /** Shape of the skeleton block. Defaults to 'rectangle'. */
9
+ shape?: SkeletonShape;
10
+ /** Explicit width (e.g. '100%', '200px'). Falls back to the element's natural width. */
11
+ width?: string | number;
12
+ /** Explicit height (e.g. '1rem', 48). Falls back to the element's natural height. */
13
+ height?: string | number;
14
+ }
15
+ interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {
16
+ /** Number of text lines to render. Defaults to 3. */
17
+ lines?: number;
18
+ /** Animation variant forwarded to each line. Defaults to 'wave'. */
19
+ variant?: SkeletonVariant;
20
+ /** When true the last line is shorter (≈ 60 %) to look like natural prose. Defaults to true. */
21
+ shortLast?: boolean;
22
+ }
23
+ interface SkeletonAvatarProps extends HTMLAttributes<HTMLDivElement> {
24
+ /** Diameter of the avatar circle in pixels. Defaults to 40. */
25
+ size?: number;
26
+ /** Animation variant. Defaults to 'wave'. */
27
+ variant?: SkeletonVariant;
28
+ }
29
+ interface SkeletonCardProps extends HTMLAttributes<HTMLDivElement> {
30
+ /** Show a header image placeholder at the top of the card. Defaults to true. */
31
+ showImage?: boolean;
32
+ /** Height of the image placeholder in pixels. Defaults to 160. */
33
+ imageHeight?: number;
34
+ /** Number of text-line skeletons in the body. Defaults to 3. */
35
+ lines?: number;
36
+ /** Animation variant forwarded to all children. Defaults to 'wave'. */
37
+ variant?: SkeletonVariant;
38
+ }
39
+ interface SkeletonTableProps extends HTMLAttributes<HTMLDivElement> {
40
+ /** Number of rows to render. Defaults to 5. */
41
+ rows?: number;
42
+ /** Number of columns to render. Defaults to 4. */
43
+ columns?: number;
44
+ /** Animation variant. Defaults to 'wave'. */
45
+ variant?: SkeletonVariant;
46
+ /** Show a header row above the body rows. Defaults to true. */
47
+ showHeader?: boolean;
48
+ }
49
+
50
+ /**
51
+ * Primitive skeleton block. Use this as the building brick for any custom
52
+ * layout skeleton you need.
53
+ */
54
+ declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
55
+ /**
56
+ * Multi-line text placeholder. The last line is intentionally shorter to
57
+ * mimic natural prose paragraph endings.
58
+ */
59
+ declare const SkeletonText: React.ForwardRefExoticComponent<SkeletonTextProps & React.RefAttributes<HTMLDivElement>>;
60
+ /**
61
+ * Circular avatar placeholder. Pairs naturally with SkeletonText to build
62
+ * user-card or comment-thread loaders.
63
+ */
64
+ declare const SkeletonAvatar: React.ForwardRefExoticComponent<SkeletonAvatarProps & React.RefAttributes<HTMLDivElement>>;
65
+ /**
66
+ * Pre-composed card skeleton mirroring the Card component structure:
67
+ * optional hero image → title → description lines → action bar.
68
+ */
69
+ declare const SkeletonCard: React.ForwardRefExoticComponent<SkeletonCardProps & React.RefAttributes<HTMLDivElement>>;
70
+ /**
71
+ * Full table placeholder matching the Table component's visual grid.
72
+ * Renders a configurable number of column headers and body rows.
73
+ */
74
+ declare const SkeletonTable: React.ForwardRefExoticComponent<SkeletonTableProps & React.RefAttributes<HTMLDivElement>>;
75
+
76
+ export { Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, type SkeletonShape, SkeletonTable, type SkeletonTableProps, SkeletonText, type SkeletonTextProps, type SkeletonVariant };
@@ -0,0 +1 @@
1
+ import {forwardRef}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';function l(...p){return twMerge(clsx(p))}var g={default:"animate-pulse bg-skeleton",wave:"skeleton-wave bg-skeleton",pulse:"animate-pulse bg-skeleton-shine"},x={rectangle:"rounded-sm",circle:"rounded-full",rounded:"rounded-md"},s=forwardRef(function({className:r,variant:a="wave",shape:n="rectangle",width:e,height:o,style:d,...f},m){return jsx("div",{ref:m,role:"status","aria-busy":"true","aria-label":"Loading",style:{width:e!==void 0?typeof e=="number"?`${String(e)}px`:e:void 0,height:o!==void 0?typeof o=="number"?`${String(o)}px`:o:void 0,...d},className:l("overflow-hidden",g[a],x[n],r),...f})});s.displayName="Skeleton";var k=forwardRef(function({lines:r=3,variant:a="wave",shortLast:n=true,className:e,...o},d){return jsx("div",{ref:d,className:l("flex flex-col gap-2",e),role:"status","aria-busy":"true","aria-label":"Loading",...o,children:Array.from({length:r}).map((f,m)=>{let i=m===r-1;return jsx(s,{variant:a,height:14,className:l(i&&n?"w-3/5":"w-full")},m)})})});k.displayName="SkeletonText";var h=forwardRef(function({size:r=40,variant:a="wave",className:n,...e},o){return jsx(s,{ref:o,variant:a,shape:"circle",width:r,height:r,className:l("shrink-0",n),...e})});h.displayName="SkeletonAvatar";var y=forwardRef(function({showImage:r=true,imageHeight:a=160,lines:n=3,variant:e="wave",className:o,...d},f){return jsxs("div",{ref:f,className:l("rounded-lg border border-border bg-surface overflow-hidden flex flex-col",o),role:"status","aria-busy":"true","aria-label":"Loading",...d,children:[r&&jsx(s,{variant:e,shape:"rectangle",height:a,className:"w-full rounded-none"}),jsxs("div",{className:"flex flex-col gap-2 p-4",children:[jsx(s,{variant:e,height:20,className:"w-2/3"}),jsx(k,{lines:n,variant:e,className:"mt-1"}),jsxs("div",{className:"flex items-center gap-2 mt-2",children:[jsx(s,{variant:e,width:80,height:32,shape:"rounded"}),jsx(s,{variant:e,width:80,height:32,shape:"rounded"})]})]})]})});y.displayName="SkeletonCard";var w=forwardRef(function({rows:r=5,columns:a=4,variant:n="wave",showHeader:e=true,className:o,...d},f){return jsxs("div",{ref:f,className:l("w-full rounded-lg border border-border overflow-hidden bg-surface",o),role:"status","aria-busy":"true","aria-label":"Loading",...d,children:[e&&jsx("div",{className:"flex items-center gap-4 border-b border-border px-4 py-2 bg-surface-secondary",children:Array.from({length:a}).map((m,i)=>jsx(s,{variant:n,height:14,className:l(i===0?"w-1/4":i===a-1?"w-16":"flex-1")},i))}),Array.from({length:r}).map((m,i)=>jsx("div",{className:l("flex items-center gap-4 px-4 py-2",i<r-1&&"border-b border-border"),children:Array.from({length:a}).map((R,v)=>jsx(s,{variant:n,height:14,className:l(v===0?"w-1/4":v===a-1?"w-16":"flex-1")},v))},i))]})});w.displayName="SkeletonTable";export{s as Skeleton,h as SkeletonAvatar,y as SkeletonCard,w as SkeletonTable,k as SkeletonText};