@aereamart/design-system 0.3.5 → 0.4.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 (260) hide show
  1. package/dist/cn.d.ts +2 -1
  2. package/dist/cn.js +4 -2
  3. package/dist/hooks/use-mobile.d.ts +1 -0
  4. package/dist/hooks/use-mobile.js +15 -0
  5. package/dist/index.d.ts +48 -37
  6. package/dist/index.js +48 -37
  7. package/dist/ui/accordion.d.ts +7 -0
  8. package/dist/ui/accordion.js +17 -0
  9. package/dist/ui/alert-dialog.d.ts +18 -0
  10. package/dist/ui/alert-dialog.js +42 -0
  11. package/dist/ui/alert.d.ts +9 -0
  12. package/dist/ui/alert.js +24 -0
  13. package/dist/ui/aspect-ratio.d.ts +3 -0
  14. package/dist/ui/aspect-ratio.js +6 -0
  15. package/dist/ui/avatar.d.ts +11 -0
  16. package/dist/ui/avatar.js +23 -0
  17. package/dist/ui/badge.d.ts +9 -0
  18. package/dist/ui/badge.js +24 -0
  19. package/dist/ui/breadcrumb.d.ts +11 -0
  20. package/dist/ui/breadcrumb.js +27 -0
  21. package/dist/ui/button.d.ts +10 -0
  22. package/dist/ui/button.js +35 -0
  23. package/dist/ui/calendar.d.ts +8 -0
  24. package/dist/ui/calendar.js +75 -0
  25. package/dist/ui/card.d.ts +9 -0
  26. package/dist/ui/card.js +24 -0
  27. package/dist/ui/carousel.d.ts +19 -0
  28. package/dist/ui/carousel.js +91 -0
  29. package/dist/ui/chart.d.ts +44 -0
  30. package/dist/ui/chart.js +132 -0
  31. package/dist/ui/checkbox.d.ts +4 -0
  32. package/dist/ui/checkbox.js +8 -0
  33. package/dist/ui/collapsible.d.ts +5 -0
  34. package/dist/ui/collapsible.js +13 -0
  35. package/dist/ui/command.d.ts +18 -0
  36. package/dist/ui/command.js +34 -0
  37. package/dist/ui/context-menu.d.ts +25 -0
  38. package/dist/ui/context-menu.js +51 -0
  39. package/dist/ui/dialog.d.ts +17 -0
  40. package/dist/ui/dialog.js +36 -0
  41. package/dist/ui/drawer.d.ts +13 -0
  42. package/dist/ui/drawer.js +35 -0
  43. package/dist/ui/dropdown-menu.d.ts +25 -0
  44. package/dist/ui/dropdown-menu.js +50 -0
  45. package/dist/ui/form.d.ts +24 -0
  46. package/dist/ui/form.js +58 -0
  47. package/dist/ui/hover-card.d.ts +6 -0
  48. package/dist/ui/hover-card.js +13 -0
  49. package/dist/ui/input-otp.d.ts +11 -0
  50. package/dist/ui/input-otp.js +21 -0
  51. package/dist/ui/input.d.ts +3 -0
  52. package/dist/ui/input.js +6 -0
  53. package/dist/ui/label.d.ts +4 -0
  54. package/dist/ui/label.js +8 -0
  55. package/dist/ui/menubar.d.ts +26 -0
  56. package/dist/ui/menubar.js +53 -0
  57. package/dist/ui/navigation-menu.d.ts +14 -0
  58. package/dist/ui/navigation-menu.js +31 -0
  59. package/dist/ui/pagination.d.ts +13 -0
  60. package/dist/ui/pagination.js +29 -0
  61. package/dist/ui/popover.d.ts +10 -0
  62. package/dist/ui/popover.js +26 -0
  63. package/dist/ui/progress.d.ts +4 -0
  64. package/dist/ui/progress.js +7 -0
  65. package/dist/ui/radio-group.d.ts +5 -0
  66. package/dist/ui/radio-group.js +12 -0
  67. package/dist/ui/resizable.d.ts +7 -0
  68. package/dist/ui/resizable.js +14 -0
  69. package/dist/ui/scroll-area.d.ts +5 -0
  70. package/dist/ui/scroll-area.js +12 -0
  71. package/dist/ui/select.d.ts +15 -0
  72. package/dist/ui/select.js +38 -0
  73. package/dist/ui/separator.d.ts +4 -0
  74. package/dist/ui/separator.js +7 -0
  75. package/dist/ui/sheet.d.ts +14 -0
  76. package/dist/ui/sheet.js +40 -0
  77. package/dist/ui/sidebar.d.ts +69 -0
  78. package/dist/ui/sidebar.js +211 -0
  79. package/dist/ui/skeleton.d.ts +2 -0
  80. package/dist/ui/skeleton.js +6 -0
  81. package/dist/ui/slider.d.ts +4 -0
  82. package/dist/ui/slider.js +13 -0
  83. package/dist/ui/sonner.d.ts +3 -0
  84. package/dist/ui/sonner.js +21 -0
  85. package/dist/ui/switch.d.ts +6 -0
  86. package/dist/ui/switch.js +7 -0
  87. package/dist/ui/table.d.ts +10 -0
  88. package/dist/ui/table.js +28 -0
  89. package/dist/ui/tabs.d.ts +11 -0
  90. package/dist/ui/tabs.js +28 -0
  91. package/dist/ui/textarea.d.ts +3 -0
  92. package/dist/ui/textarea.js +6 -0
  93. package/dist/ui/toggle-group.d.ts +9 -0
  94. package/dist/ui/toggle-group.js +22 -0
  95. package/dist/ui/toggle.d.ts +9 -0
  96. package/dist/ui/toggle.js +26 -0
  97. package/dist/ui/tooltip.d.ts +7 -0
  98. package/dist/ui/tooltip.js +16 -0
  99. package/package.json +28 -4
  100. package/src/cn.ts +5 -2
  101. package/src/hooks/use-mobile.ts +19 -0
  102. package/src/index.css +140 -0
  103. package/src/index.ts +48 -37
  104. package/src/ui/accordion.tsx +63 -0
  105. package/src/ui/alert-dialog.tsx +196 -0
  106. package/src/ui/alert.tsx +65 -0
  107. package/src/ui/aspect-ratio.tsx +9 -0
  108. package/src/ui/avatar.tsx +108 -0
  109. package/src/ui/badge.tsx +47 -0
  110. package/src/ui/breadcrumb.tsx +108 -0
  111. package/src/ui/button.tsx +63 -0
  112. package/src/ui/calendar.tsx +218 -0
  113. package/src/ui/card.tsx +91 -0
  114. package/src/ui/carousel.tsx +241 -0
  115. package/src/ui/chart.tsx +371 -0
  116. package/src/ui/checkbox.tsx +29 -0
  117. package/src/ui/collapsible.tsx +33 -0
  118. package/src/ui/command.tsx +184 -0
  119. package/src/ui/context-menu.tsx +251 -0
  120. package/src/ui/dialog.tsx +156 -0
  121. package/src/ui/drawer.tsx +134 -0
  122. package/src/ui/dropdown-menu.tsx +254 -0
  123. package/src/ui/form.tsx +165 -0
  124. package/src/ui/hover-card.tsx +41 -0
  125. package/src/ui/input-otp.tsx +76 -0
  126. package/src/ui/input.tsx +20 -0
  127. package/src/ui/label.tsx +23 -0
  128. package/src/ui/menubar.tsx +273 -0
  129. package/src/ui/navigation-menu.tsx +167 -0
  130. package/src/ui/pagination.tsx +127 -0
  131. package/src/ui/popover.tsx +88 -0
  132. package/src/ui/progress.tsx +28 -0
  133. package/src/ui/radio-group.tsx +44 -0
  134. package/src/ui/resizable.tsx +50 -0
  135. package/src/ui/scroll-area.tsx +55 -0
  136. package/src/ui/select.tsx +189 -0
  137. package/src/ui/separator.tsx +25 -0
  138. package/src/ui/sheet.tsx +142 -0
  139. package/src/ui/sidebar.tsx +724 -0
  140. package/src/ui/skeleton.tsx +13 -0
  141. package/src/ui/slider.tsx +60 -0
  142. package/src/ui/sonner.tsx +40 -0
  143. package/src/ui/switch.tsx +32 -0
  144. package/src/ui/table.tsx +115 -0
  145. package/src/ui/tabs.tsx +88 -0
  146. package/src/ui/textarea.tsx +17 -0
  147. package/src/ui/toggle-group.tsx +83 -0
  148. package/src/ui/toggle.tsx +46 -0
  149. package/src/ui/tooltip.tsx +54 -0
  150. package/dist/Accordion.d.ts +0 -10
  151. package/dist/Accordion.js +0 -12
  152. package/dist/AlertBanner.d.ts +0 -9
  153. package/dist/AlertBanner.js +0 -21
  154. package/dist/AppBar.d.ts +0 -7
  155. package/dist/AppBar.js +0 -5
  156. package/dist/Avatar.d.ts +0 -6
  157. package/dist/Avatar.js +0 -20
  158. package/dist/Badge.d.ts +0 -6
  159. package/dist/Badge.js +0 -11
  160. package/dist/BottomSheet.d.ts +0 -8
  161. package/dist/BottomSheet.js +0 -24
  162. package/dist/Breadcrumb.d.ts +0 -8
  163. package/dist/Breadcrumb.js +0 -9
  164. package/dist/Button.d.ts +0 -9
  165. package/dist/Button.js +0 -18
  166. package/dist/Card.d.ts +0 -7
  167. package/dist/Card.js +0 -6
  168. package/dist/Checkbox.d.ts +0 -5
  169. package/dist/Checkbox.js +0 -5
  170. package/dist/Chip.d.ts +0 -7
  171. package/dist/Chip.js +0 -15
  172. package/dist/DataTable.d.ts +0 -15
  173. package/dist/DataTable.js +0 -7
  174. package/dist/DatePicker.d.ts +0 -5
  175. package/dist/DatePicker.js +0 -11
  176. package/dist/Divider.d.ts +0 -5
  177. package/dist/Divider.js +0 -11
  178. package/dist/Drawer.d.ts +0 -10
  179. package/dist/Drawer.js +0 -24
  180. package/dist/EmptyState.d.ts +0 -7
  181. package/dist/EmptyState.js +0 -6
  182. package/dist/Input.d.ts +0 -5
  183. package/dist/Input.js +0 -7
  184. package/dist/Link.d.ts +0 -4
  185. package/dist/Link.js +0 -6
  186. package/dist/Menu.d.ts +0 -14
  187. package/dist/Menu.js +0 -29
  188. package/dist/Modal.d.ts +0 -9
  189. package/dist/Modal.js +0 -24
  190. package/dist/NavigationBar.d.ts +0 -14
  191. package/dist/NavigationBar.js +0 -22
  192. package/dist/Pagination.d.ts +0 -7
  193. package/dist/Pagination.js +0 -24
  194. package/dist/Popover.d.ts +0 -7
  195. package/dist/Popover.js +0 -9
  196. package/dist/Progress.d.ts +0 -8
  197. package/dist/Progress.js +0 -15
  198. package/dist/Radio.d.ts +0 -15
  199. package/dist/Radio.js +0 -8
  200. package/dist/SegmentedControl.d.ts +0 -13
  201. package/dist/SegmentedControl.js +0 -18
  202. package/dist/Select.d.ts +0 -5
  203. package/dist/Select.js +0 -7
  204. package/dist/Sidebar.d.ts +0 -16
  205. package/dist/Sidebar.js +0 -19
  206. package/dist/Slider.d.ts +0 -5
  207. package/dist/Slider.js +0 -5
  208. package/dist/Snackbar.d.ts +0 -12
  209. package/dist/Snackbar.js +0 -20
  210. package/dist/Spinner.d.ts +0 -3
  211. package/dist/Spinner.js +0 -5
  212. package/dist/Switch.d.ts +0 -4
  213. package/dist/Switch.js +0 -5
  214. package/dist/Tabs.d.ts +0 -14
  215. package/dist/Tabs.js +0 -24
  216. package/dist/Tag.d.ts +0 -6
  217. package/dist/Tag.js +0 -11
  218. package/dist/Textarea.d.ts +0 -5
  219. package/dist/Textarea.js +0 -7
  220. package/dist/Tooltip.d.ts +0 -7
  221. package/dist/Tooltip.js +0 -5
  222. package/dist/TreeView.d.ts +0 -12
  223. package/dist/TreeView.js +0 -34
  224. package/src/Accordion.tsx +0 -58
  225. package/src/AlertBanner.tsx +0 -62
  226. package/src/AppBar.tsx +0 -29
  227. package/src/Avatar.tsx +0 -42
  228. package/src/Badge.tsx +0 -27
  229. package/src/BottomSheet.tsx +0 -60
  230. package/src/Breadcrumb.tsx +0 -48
  231. package/src/Button.tsx +0 -54
  232. package/src/Card.tsx +0 -39
  233. package/src/Checkbox.tsx +0 -31
  234. package/src/Chip.tsx +0 -44
  235. package/src/DataTable.tsx +0 -64
  236. package/src/DatePicker.tsx +0 -44
  237. package/src/Divider.tsx +0 -33
  238. package/src/Drawer.tsx +0 -71
  239. package/src/EmptyState.tsx +0 -37
  240. package/src/Input.tsx +0 -30
  241. package/src/Link.tsx +0 -22
  242. package/src/Menu.tsx +0 -73
  243. package/src/Modal.tsx +0 -62
  244. package/src/NavigationBar.tsx +0 -68
  245. package/src/Pagination.tsx +0 -69
  246. package/src/Popover.tsx +0 -34
  247. package/src/Progress.tsx +0 -53
  248. package/src/Radio.tsx +0 -49
  249. package/src/SegmentedControl.tsx +0 -63
  250. package/src/Select.tsx +0 -32
  251. package/src/Sidebar.tsx +0 -73
  252. package/src/Slider.tsx +0 -33
  253. package/src/Snackbar.tsx +0 -72
  254. package/src/Spinner.tsx +0 -19
  255. package/src/Switch.tsx +0 -40
  256. package/src/Tabs.tsx +0 -77
  257. package/src/Tag.tsx +0 -29
  258. package/src/Textarea.tsx +0 -30
  259. package/src/Tooltip.tsx +0 -25
  260. package/src/TreeView.tsx +0 -105
package/dist/Badge.js DELETED
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- const variantClasses = {
4
- danger: 'bg-red-100 text-red-800',
5
- primary: 'bg-lime-100 text-lime-800',
6
- accent: 'bg-purple-100 text-purple-900',
7
- neutral: 'bg-slate-200 text-slate-700',
8
- };
9
- export function Badge({ variant = 'danger', className, ...props }) {
10
- return (_jsx("span", { className: cn('inline-flex items-center justify-center rounded-full text-[10px] font-bold leading-none', variantClasses[variant], className), ...props }));
11
- }
@@ -1,8 +0,0 @@
1
- export interface BottomSheetProps {
2
- open: boolean;
3
- onClose: () => void;
4
- title?: string;
5
- children?: React.ReactNode;
6
- className?: string;
7
- }
8
- export declare function BottomSheet({ open, onClose, title, children, className }: BottomSheetProps): import("react").ReactPortal | null;
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from 'react';
3
- import { createPortal } from 'react-dom';
4
- import { X } from 'lucide-react';
5
- import { cn } from './cn';
6
- export function BottomSheet({ open, onClose, title, children, className }) {
7
- useEffect(() => {
8
- if (!open)
9
- return;
10
- const onKey = (e) => {
11
- if (e.key === 'Escape')
12
- onClose();
13
- };
14
- document.body.style.overflow = 'hidden';
15
- document.addEventListener('keydown', onKey);
16
- return () => {
17
- document.body.style.overflow = '';
18
- document.removeEventListener('keydown', onKey);
19
- };
20
- }, [open, onClose]);
21
- if (!open)
22
- return null;
23
- return createPortal(_jsxs("div", { className: "fixed inset-0 z-50 flex items-end justify-center", children: [_jsx("div", { className: "absolute inset-0 bg-black/50", onClick: onClose, "aria-hidden": "true" }), _jsxs("section", { role: "dialog", "aria-modal": "true", "aria-label": title, className: cn('relative w-full max-w-lg rounded-t-2xl bg-white p-6 shadow-xl', className), children: [_jsx("div", { "aria-hidden": "true", className: "mx-auto mb-4 h-1 w-10 rounded-full bg-slate-200" }), title && (_jsxs("div", { className: "mb-2 flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-bold text-slate-900", children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-1 text-slate-400 hover:bg-slate-100", "aria-label": "Close", children: _jsx(X, { className: "h-5 w-5" }) })] })), children] })] }), document.body);
24
- }
@@ -1,8 +0,0 @@
1
- export interface Crumb {
2
- label: string;
3
- href?: string;
4
- }
5
- export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
6
- items: Crumb[];
7
- }
8
- export declare function Breadcrumb({ items, className, ...props }: BreadcrumbProps): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronRight } from 'lucide-react';
3
- import { cn } from './cn';
4
- export function Breadcrumb({ items, className, ...props }) {
5
- return (_jsx("nav", { "aria-label": "Breadcrumb", className: className, ...props, children: _jsx("ol", { className: "flex flex-wrap items-center gap-1.5 text-sm", children: items.map((item, i) => {
6
- const last = i === items.length - 1;
7
- return (_jsxs("li", { className: "flex items-center gap-1.5", children: [i > 0 && (_jsx(ChevronRight, { "aria-hidden": "true", className: "h-3.5 w-3.5 text-slate-400" })), last || !item.href ? (_jsx("span", { "aria-current": last ? 'page' : undefined, className: cn('font-medium', last ? 'text-slate-900' : 'text-slate-500'), children: item.label })) : (_jsx("a", { href: item.href, className: "font-medium text-lime-700 hover:text-lime-800 hover:underline", children: item.label }))] }, `${item.label}-${i}`));
8
- }) }) }));
9
- }
package/dist/Button.d.ts DELETED
@@ -1,9 +0,0 @@
1
- type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
2
- type ButtonSize = 'sm' | 'md' | 'lg' | 'full';
3
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
- variant?: ButtonVariant;
5
- size?: ButtonSize;
6
- loading?: boolean;
7
- }
8
- export declare function Button({ variant, size, loading, className, disabled, children, ...props }: ButtonProps): import("react").JSX.Element;
9
- export {};
package/dist/Button.js DELETED
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- import { Spinner } from './Spinner';
4
- const variantClasses = {
5
- primary: 'bg-lime-600 text-white hover:bg-lime-700 focus-visible:ring-lime-500/40',
6
- secondary: 'border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 focus-visible:ring-slate-400/40',
7
- danger: 'bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-500/40',
8
- ghost: 'bg-transparent text-slate-600 hover:bg-slate-100 focus-visible:ring-slate-400/40',
9
- };
10
- const sizeClasses = {
11
- sm: 'px-3 py-1.5 text-xs',
12
- md: 'px-4 py-2.5 text-sm',
13
- lg: 'px-6 py-3 text-base',
14
- full: 'w-full px-4 py-2.5 text-sm',
15
- };
16
- export function Button({ variant = 'primary', size = 'md', loading = false, className, disabled, children, ...props }) {
17
- return (_jsxs("button", { className: cn('inline-flex items-center justify-center gap-2 rounded-lg font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50', variantClasses[variant], sizeClasses[size], className), disabled: disabled || loading, ...props, children: [loading && _jsx(Spinner, { className: "h-4 w-4" }), children] }));
18
- }
package/dist/Card.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
2
- title?: string;
3
- description?: string;
4
- footer?: React.ReactNode;
5
- hoverable?: boolean;
6
- }
7
- export declare function Card({ title, description, footer, hoverable, className, children, ...props }: CardProps): import("react").JSX.Element;
package/dist/Card.js DELETED
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Card({ title, description, footer, hoverable = false, className, children, ...props }) {
4
- return (_jsxs("div", { className: cn('rounded-xl border border-slate-200 bg-white', hoverable &&
5
- 'transition-all hover:-translate-y-0.5 hover:border-lime-300 hover:shadow-md', className), ...props, children: [(title || description) && (_jsxs("div", { className: "border-b border-slate-100 px-5 py-4", children: [title && _jsx("h3", { className: "text-base font-bold text-slate-900", children: title }), description && _jsx("p", { className: "mt-0.5 text-sm text-slate-500", children: description })] })), _jsx("div", { className: "px-5 py-4", children: children }), footer && _jsx("div", { className: "border-t border-slate-100 px-5 py-3", children: footer })] }));
6
- }
@@ -1,5 +0,0 @@
1
- export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
2
- label?: string;
3
- error?: string;
4
- }
5
- export declare function Checkbox({ label, error, id, className, ...props }: CheckboxProps): import("react").JSX.Element;
package/dist/Checkbox.js DELETED
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Checkbox({ label, error, id, className, ...props }) {
4
- return (_jsxs("div", { className: "grid gap-1.5", children: [_jsxs("label", { htmlFor: id, className: cn('inline-flex cursor-pointer items-start gap-2.5 text-sm', className), children: [_jsx("input", { id: id, type: "checkbox", className: "mt-0.5 h-4 w-4 shrink-0 cursor-pointer rounded border-slate-500 text-lime-600 accent-lime-600 focus:outline-none focus:ring-2 focus:ring-lime-500/40", ...props }), label && (_jsx("span", { className: cn('font-medium', error ? 'text-red-700' : 'text-slate-700'), children: label }))] }), error && _jsx("p", { className: "pl-6.5 text-xs text-red-600", children: error })] }));
5
- }
package/dist/Chip.d.ts DELETED
@@ -1,7 +0,0 @@
1
- type ChipVariant = 'primary' | 'accent' | 'neutral' | 'danger';
2
- export interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- variant?: ChipVariant;
4
- onRemove?: () => void;
5
- }
6
- export declare function Chip({ variant, onRemove, className, children, ...props }: ChipProps): import("react").JSX.Element;
7
- export {};
package/dist/Chip.js DELETED
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { X } from 'lucide-react';
3
- import { cn } from './cn';
4
- const variantClasses = {
5
- primary: 'border-lime-300 bg-lime-50 text-lime-800',
6
- accent: 'border-purple-300 bg-purple-50 text-purple-900',
7
- neutral: 'border-slate-300 bg-slate-50 text-slate-700',
8
- danger: 'border-red-300 bg-red-50 text-red-800',
9
- };
10
- export function Chip({ variant = 'neutral', onRemove, className, children, ...props }) {
11
- return (_jsxs("span", { className: cn('inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-sm font-medium', variantClasses[variant], className), ...props, children: [children, onRemove && (_jsx("button", { type: "button", onClick: e => {
12
- e.stopPropagation();
13
- onRemove();
14
- }, "aria-label": `Remove ${typeof children === 'string' ? children : 'chip'}`, className: "-mr-1 rounded-full p-0.5 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current", children: _jsx(X, { "aria-hidden": "true", className: "h-3 w-3" }) }))] }));
15
- }
@@ -1,15 +0,0 @@
1
- export interface Column<T> {
2
- key: string;
3
- label: string;
4
- render?: (row: T) => React.ReactNode;
5
- className?: string;
6
- }
7
- export interface DataTableProps<T> {
8
- columns: Column<T>[];
9
- rows: T[];
10
- rowKey: (row: T) => string;
11
- caption?: string;
12
- emptyText?: string;
13
- className?: string;
14
- }
15
- export declare function DataTable<T>({ columns, rows, rowKey, caption, emptyText, className, }: DataTableProps<T>): import("react").JSX.Element;
package/dist/DataTable.js DELETED
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from 'react';
3
- import { cn } from './cn';
4
- export function DataTable({ columns, rows, rowKey, caption, emptyText = 'No rows to show.', className, }) {
5
- const captionId = useId();
6
- return (_jsx("div", { className: cn('overflow-x-auto rounded-xl border border-slate-200 bg-white', className), children: _jsxs("table", { className: "w-full min-w-[480px] border-collapse text-left text-sm", children: [caption && _jsx("caption", { className: "sr-only", id: captionId, children: caption }), _jsx("thead", { children: _jsx("tr", { className: "border-b border-slate-200 bg-slate-50 text-xs uppercase tracking-wider text-slate-500", children: columns.map(col => (_jsx("th", { scope: "col", className: "px-4 py-3 font-semibold", children: col.label }, col.key))) }) }), _jsxs("tbody", { className: "divide-y divide-slate-100", children: [rows.map(row => (_jsx("tr", { className: "transition-colors hover:bg-slate-50", children: columns.map(col => (_jsx("td", { className: cn('px-4 py-3 align-middle text-slate-700', col.className), children: col.render ? col.render(row) : String(row[col.key] ?? '') }, col.key))) }, rowKey(row)))), rows.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: columns.length, className: "px-4 py-10 text-center text-sm text-slate-400", children: emptyText }) }))] })] }) }));
7
- }
@@ -1,5 +0,0 @@
1
- export interface DatePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
2
- label?: string;
3
- error?: string;
4
- }
5
- export declare function DatePicker({ label, error, id, className, ...props }: DatePickerProps): import("react").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from 'react';
3
- import { CalendarDays } from 'lucide-react';
4
- import { cn } from './cn';
5
- export function DatePicker({ label, error, id, className, ...props }) {
6
- const autoId = useId();
7
- const inputId = id ?? autoId;
8
- return (_jsxs("div", { children: [label && (_jsx("label", { htmlFor: inputId, className: "mb-1 block text-sm font-medium text-slate-700", children: label })), _jsxs("div", { className: "relative", children: [_jsx(CalendarDays, { "aria-hidden": "true", className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400" }), _jsx("input", { id: inputId, type: "date", className: cn('w-full rounded-lg border bg-white py-2.5 pl-9 pr-4 text-sm text-slate-700 shadow-xs', 'focus:outline-none focus:ring-2 focus:ring-lime-500/40 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-400', error
9
- ? 'border-red-400 focus:border-red-500'
10
- : 'border-slate-300 hover:border-slate-400', className), ...props })] }), error && _jsx("p", { className: "mt-1 text-xs text-red-600", children: error })] }));
11
- }
package/dist/Divider.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
2
- orientation?: 'horizontal' | 'vertical';
3
- label?: string;
4
- }
5
- export declare function Divider({ orientation, label, className, ...props }: DividerProps): import("react").JSX.Element;
package/dist/Divider.js DELETED
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Divider({ orientation = 'horizontal', label, className, ...props }) {
4
- if (orientation === 'vertical') {
5
- return (_jsx("div", { role: "separator", "aria-orientation": "vertical", className: cn('mx-3 my-0 h-auto w-px shrink-0 self-stretch bg-slate-200', className), ...props }));
6
- }
7
- if (label) {
8
- return (_jsxs("div", { className: cn('flex items-center gap-3', className), ...props, children: [_jsx("div", { className: "h-px flex-1 bg-slate-200" }), _jsx("span", { className: "text-xs font-medium uppercase tracking-wider text-slate-400", children: label }), _jsx("div", { className: "h-px flex-1 bg-slate-200" })] }));
9
- }
10
- return (_jsx("div", { role: "separator", className: cn('h-px w-full bg-slate-200', className), ...props }));
11
- }
package/dist/Drawer.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export interface DrawerProps {
2
- open: boolean;
3
- onClose: () => void;
4
- title?: string;
5
- side?: 'right' | 'left';
6
- children?: React.ReactNode;
7
- footer?: React.ReactNode;
8
- className?: string;
9
- }
10
- export declare function Drawer({ open, onClose, title, side, children, footer, className, }: DrawerProps): import("react").ReactPortal | null;
package/dist/Drawer.js DELETED
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from 'react';
3
- import { createPortal } from 'react-dom';
4
- import { X } from 'lucide-react';
5
- import { cn } from './cn';
6
- export function Drawer({ open, onClose, title, side = 'right', children, footer, className, }) {
7
- useEffect(() => {
8
- if (!open)
9
- return;
10
- const onKey = (e) => {
11
- if (e.key === 'Escape')
12
- onClose();
13
- };
14
- document.body.style.overflow = 'hidden';
15
- document.addEventListener('keydown', onKey);
16
- return () => {
17
- document.body.style.overflow = '';
18
- document.removeEventListener('keydown', onKey);
19
- };
20
- }, [open, onClose]);
21
- if (!open)
22
- return null;
23
- return createPortal(_jsxs("div", { className: "fixed inset-0 z-50", children: [_jsx("div", { className: "absolute inset-0 bg-black/50", onClick: onClose, "aria-hidden": "true" }), _jsxs("section", { role: "dialog", "aria-modal": "true", "aria-label": title, className: cn('absolute inset-y-0 flex w-full max-w-sm flex-col bg-white shadow-xl', side === 'right' ? 'right-0' : 'left-0', className), children: [title && (_jsxs("div", { className: "flex items-center justify-between border-b border-slate-100 px-6 py-4", children: [_jsx("h2", { className: "text-lg font-bold text-slate-900", children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-1 text-slate-400 hover:bg-slate-100", "aria-label": "Close", children: _jsx(X, { className: "h-5 w-5" }) })] })), _jsx("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: children }), footer && _jsx("div", { className: "border-t border-slate-100 px-6 py-4", children: footer })] })] }), document.body);
24
- }
@@ -1,7 +0,0 @@
1
- export interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
2
- title: string;
3
- description?: string;
4
- icon?: React.ReactNode;
5
- action?: React.ReactNode;
6
- }
7
- export declare function EmptyState({ title, description, icon, action, className, ...props }: EmptyStateProps): import("react").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Inbox } from 'lucide-react';
3
- import { cn } from './cn';
4
- export function EmptyState({ title, description, icon, action, className, ...props }) {
5
- return (_jsxs("div", { className: cn('flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-slate-200 bg-white px-8 py-12 text-center', className), ...props, children: [_jsx("div", { className: "mb-3 rounded-full bg-lime-50 p-3 text-lime-600", children: icon ?? _jsx(Inbox, { "aria-hidden": "true", className: "h-8 w-8" }) }), _jsx("h3", { className: "text-base font-bold text-slate-900", children: title }), description && (_jsx("p", { className: "mt-1 max-w-sm text-sm text-slate-500", children: description })), action && _jsx("div", { className: "mt-5", children: action })] }));
6
- }
package/dist/Input.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
2
- label?: string;
3
- error?: string;
4
- }
5
- export declare function Input({ label, error, className, id, ...props }: InputProps): import("react").JSX.Element;
package/dist/Input.js DELETED
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Input({ label, error, className, id, ...props }) {
4
- return (_jsxs("div", { className: "w-full", children: [label && (_jsx("label", { htmlFor: id, className: "mb-1 block text-sm font-medium text-slate-700", children: label })), _jsx("input", { id: id, className: cn('w-full rounded-lg border bg-white px-4 py-2.5 text-sm text-slate-900 placeholder:text-slate-500 focus:outline-none focus:ring-2', error
5
- ? 'border-red-600 focus:border-red-600 focus:ring-red-500/30'
6
- : 'border-slate-500 focus:border-lime-600 focus:ring-lime-500/30', className), ...props }), error && _jsx("p", { className: "mt-1 text-xs text-red-600", children: error })] }));
7
- }
package/dist/Link.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
2
- external?: boolean;
3
- }
4
- export declare function Link({ external, className, children, ...props }: LinkProps): import("react").JSX.Element;
package/dist/Link.js DELETED
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ExternalLink } from 'lucide-react';
3
- import { cn } from './cn';
4
- export function Link({ external = false, className, children, ...props }) {
5
- return (_jsxs("a", { className: cn('inline-flex items-center gap-1 font-medium text-lime-700 hover:text-lime-800 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-500/40 rounded-sm', className), ...(external ? { target: '_blank', rel: 'noreferrer' } : {}), ...props, children: [children, external && _jsx(ExternalLink, { "aria-hidden": "true", className: "h-3.5 w-3.5" })] }));
6
- }
package/dist/Menu.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export interface MenuItem {
2
- label: string;
3
- onSelect?: () => void;
4
- danger?: boolean;
5
- disabled?: boolean;
6
- icon?: React.ReactNode;
7
- }
8
- export interface MenuProps {
9
- trigger: React.ReactNode;
10
- items: MenuItem[];
11
- align?: 'start' | 'end';
12
- className?: string;
13
- }
14
- export declare function Menu({ trigger, items, align, className }: MenuProps): import("react").JSX.Element;
package/dist/Menu.js DELETED
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from 'react';
3
- import { cn } from './cn';
4
- export function Menu({ trigger, items, align = 'end', className }) {
5
- const [open, setOpen] = useState(false);
6
- const ref = useRef(null);
7
- useEffect(() => {
8
- if (!open)
9
- return;
10
- const onDown = (e) => {
11
- if (ref.current && !ref.current.contains(e.target))
12
- setOpen(false);
13
- };
14
- const onKey = (e) => {
15
- if (e.key === 'Escape')
16
- setOpen(false);
17
- };
18
- document.addEventListener('mousedown', onDown);
19
- document.addEventListener('keydown', onKey);
20
- return () => {
21
- document.removeEventListener('mousedown', onDown);
22
- document.removeEventListener('keydown', onKey);
23
- };
24
- }, [open]);
25
- return (_jsxs("div", { ref: ref, className: cn('relative inline-flex', className), children: [_jsx("div", { onClick: () => setOpen(v => !v), children: trigger }), open && (_jsx("div", { role: "menu", className: cn('absolute z-50 mt-1.5 min-w-40 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-lg', align === 'end' ? 'right-0' : 'left-0'), children: items.map((item, i) => (_jsxs("button", { type: "button", role: "menuitem", disabled: item.disabled, onClick: () => {
26
- setOpen(false);
27
- item.onSelect?.();
28
- }, className: cn('flex w-full items-center gap-2.5 px-4 py-2 text-left text-sm transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:bg-slate-100', item.danger ? 'text-red-700 hover:bg-red-50' : 'text-slate-700 hover:bg-slate-50'), children: [item.icon, _jsx("span", { className: "flex-1", children: item.label })] }, `${item.label}-${i}`))) }))] }));
29
- }
package/dist/Modal.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface ModalProps {
2
- open: boolean;
3
- onClose: () => void;
4
- title?: string;
5
- children?: React.ReactNode;
6
- className?: string;
7
- maxWidth?: string;
8
- }
9
- export declare function Modal({ open, onClose, title, children, className, maxWidth, }: ModalProps): import("react").ReactPortal | null;
package/dist/Modal.js DELETED
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from 'react';
3
- import { createPortal } from 'react-dom';
4
- import { X } from 'lucide-react';
5
- import { cn } from './cn';
6
- export function Modal({ open, onClose, title, children, className, maxWidth = 'max-w-md', }) {
7
- useEffect(() => {
8
- if (!open)
9
- return;
10
- const onKey = (e) => {
11
- if (e.key === 'Escape')
12
- onClose();
13
- };
14
- document.body.style.overflow = 'hidden';
15
- document.addEventListener('keydown', onKey);
16
- return () => {
17
- document.body.style.overflow = '';
18
- document.removeEventListener('keydown', onKey);
19
- };
20
- }, [open, onClose]);
21
- if (!open)
22
- return null;
23
- return createPortal(_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4", children: _jsxs("div", { className: cn('w-full rounded-2xl bg-white shadow-xl', maxWidth, className), role: "dialog", "aria-modal": "true", children: [title && (_jsxs("div", { className: "flex items-center justify-between border-b border-slate-100 px-6 py-4", children: [_jsx("h2", { className: "text-lg font-bold text-slate-900", children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-1 text-slate-400 hover:bg-slate-100", "aria-label": "Close", children: _jsx(X, { className: "h-5 w-5" }) })] })), children] }) }), document.body);
24
- }
@@ -1,14 +0,0 @@
1
- export interface NavItem {
2
- value: string;
3
- label: string;
4
- disabled?: boolean;
5
- }
6
- export interface NavigationBarProps {
7
- items: NavItem[];
8
- value?: string;
9
- defaultValue?: string;
10
- onChange?: (value: string) => void;
11
- variant?: 'pills' | 'links';
12
- className?: string;
13
- }
14
- export declare function NavigationBar({ items, value, defaultValue, onChange, variant, className, }: NavigationBarProps): import("react").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { cn } from './cn';
4
- export function NavigationBar({ items, value, defaultValue, onChange, variant = 'links', className, }) {
5
- const isControlled = value !== undefined;
6
- const [inner, setInner] = useState(defaultValue);
7
- const active = isControlled ? value : inner;
8
- return (_jsx("nav", { "aria-label": "Primary", className: cn('flex items-center gap-1', className), children: items.map(item => {
9
- const selected = active === item.value;
10
- return (_jsx("button", { type: "button", "aria-current": selected ? 'page' : undefined, disabled: item.disabled, onClick: () => {
11
- if (!isControlled)
12
- setInner(item.value);
13
- onChange?.(item.value);
14
- }, className: cn('px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-500/40 disabled:opacity-50', variant === 'pills'
15
- ? cn('rounded-lg', selected
16
- ? 'bg-lime-600 text-white'
17
- : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900')
18
- : cn('border-b-2', selected
19
- ? 'border-lime-600 text-lime-700'
20
- : 'border-transparent text-slate-500 hover:text-slate-900')), children: item.label }, item.value));
21
- }) }));
22
- }
@@ -1,7 +0,0 @@
1
- export interface PaginationProps {
2
- page: number;
3
- totalPages: number;
4
- onChange: (page: number) => void;
5
- className?: string;
6
- }
7
- export declare function Pagination({ page, totalPages, onChange, className }: PaginationProps): import("react").JSX.Element;
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronLeft, ChevronRight } from 'lucide-react';
3
- import { cn } from './cn';
4
- import { Button } from './Button';
5
- function pageList(page, total) {
6
- if (total <= 7)
7
- return Array.from({ length: total }, (_, i) => i + 1);
8
- const pages = [1];
9
- const start = Math.max(2, page - 1);
10
- const end = Math.min(total - 1, page + 1);
11
- if (start > 2)
12
- pages.push('…');
13
- for (let i = start; i <= end; i++)
14
- pages.push(i);
15
- if (end < total - 1)
16
- pages.push('…');
17
- pages.push(total);
18
- return pages;
19
- }
20
- export function Pagination({ page, totalPages, onChange, className }) {
21
- return (_jsxs("nav", { "aria-label": "Pagination", className: cn('flex items-center gap-1', className), children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: page <= 1, onClick: () => onChange(page - 1), "aria-label": "Previous page", children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), pageList(page, totalPages).map((p, i) => p === '…' ? (_jsx("span", { className: "px-1.5 text-sm text-slate-400", children: "\u00E2\u20AC\u00A6" }, `e-${i}`)) : (_jsx("button", { type: "button", onClick: () => onChange(p), "aria-current": p === page ? 'page' : undefined, className: cn('h-8 min-w-8 rounded-lg px-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-500/40', p === page
22
- ? 'bg-lime-600 text-white'
23
- : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900'), children: p }, p))), _jsx(Button, { variant: "ghost", size: "sm", disabled: page >= totalPages, onClick: () => onChange(page + 1), "aria-label": "Next page", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] }));
24
- }
package/dist/Popover.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface PopoverProps {
2
- trigger: React.ReactNode;
3
- content: React.ReactNode;
4
- side?: 'top' | 'bottom' | 'left' | 'right';
5
- className?: string;
6
- }
7
- export declare function Popover({ trigger, content, side, className }: PopoverProps): import("react").JSX.Element;
package/dist/Popover.js DELETED
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Popover({ trigger, content, side = 'bottom', className }) {
4
- const isTop = side === 'top';
5
- const isBottom = side === 'bottom';
6
- const isLeft = side === 'left';
7
- const isRight = side === 'right';
8
- return (_jsxs("span", { className: "group relative inline-flex", children: [trigger, _jsx("span", { role: "tooltip", className: cn('pointer-events-none absolute z-50 w-64 rounded-xl border border-slate-200 bg-white p-4 text-sm text-slate-700 opacity-0 shadow-lg transition-opacity duration-200 group-hover:opacity-100 group-focus-within:opacity-100', isBottom && 'left-1/2 top-full mt-2 -translate-x-1/2', isTop && 'bottom-full left-1/2 mb-2 -translate-x-1/2', isLeft && 'right-full top-1/2 mr-2 -translate-y-1/2', isRight && 'left-full top-1/2 ml-2 -translate-y-1/2', className), children: content })] }));
9
- }
@@ -1,8 +0,0 @@
1
- export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
2
- value: number;
3
- max?: number;
4
- size?: 'sm' | 'md';
5
- tone?: 'primary' | 'accent' | 'danger';
6
- showLabel?: boolean;
7
- }
8
- export declare function Progress({ value, max, size, tone, showLabel, className, ...props }: ProgressProps): import("react").JSX.Element;
package/dist/Progress.js DELETED
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- const track = {
4
- sm: 'h-1.5',
5
- md: 'h-2.5',
6
- };
7
- const fill = {
8
- primary: 'bg-lime-600',
9
- accent: 'bg-purple-600',
10
- danger: 'bg-red-600',
11
- };
12
- export function Progress({ value, max = 100, size = 'md', tone = 'primary', showLabel = false, className, ...props }) {
13
- const pct = max > 0 ? Math.min(100, Math.max(0, (value / max) * 100)) : 0;
14
- return (_jsxs("div", { className: cn('flex items-center gap-3', className), ...props, children: [_jsx("div", { role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: cn('w-full overflow-hidden rounded-full bg-slate-200', track[size]), children: _jsx("div", { className: cn('h-full rounded-full transition-all duration-300', fill[tone]), style: { width: `${pct}%` } }) }), showLabel && (_jsxs("span", { className: "w-10 shrink-0 text-right text-xs font-semibold tabular-nums text-slate-600", children: [Math.round(pct), "%"] }))] }));
15
- }
package/dist/Radio.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
2
- label?: string;
3
- }
4
- export declare function Radio({ label, id, className, ...props }: RadioProps): import("react").JSX.Element;
5
- export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
6
- name: string;
7
- value?: string | number;
8
- onChange?: (value: string) => void;
9
- options: {
10
- value: string;
11
- label: string;
12
- disabled?: boolean;
13
- }[];
14
- }
15
- export declare function RadioGroup({ name, value, onChange, options, className, ...props }: RadioGroupProps): import("react").JSX.Element;
package/dist/Radio.js DELETED
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Radio({ label, id, className, ...props }) {
4
- return (_jsxs("label", { htmlFor: id, className: cn('inline-flex cursor-pointer items-center gap-2.5 text-sm', className), children: [_jsx("input", { id: id, type: "radio", className: "h-4 w-4 shrink-0 cursor-pointer accent-lime-600 focus:outline-none focus:ring-2 focus:ring-lime-500/40", ...props }), label && _jsx("span", { className: "font-medium text-slate-700", children: label })] }));
5
- }
6
- export function RadioGroup({ name, value, onChange, options, className, ...props }) {
7
- return (_jsx("div", { className: cn('flex flex-wrap gap-x-5 gap-y-2.5', className), ...props, children: options.map(opt => (_jsx(Radio, { id: `${name}-${opt.value}`, name: name, value: opt.value, label: opt.label, checked: value === opt.value, disabled: opt.disabled, onChange: e => onChange?.(e.target.value) }, opt.value))) }));
8
- }
@@ -1,13 +0,0 @@
1
- export interface SegmentedOption<T extends string | number> {
2
- value: T;
3
- label: string;
4
- disabled?: boolean;
5
- }
6
- export interface SegmentedControlProps<T extends string | number> {
7
- options: SegmentedOption<T>[];
8
- value?: T;
9
- defaultValue?: T;
10
- onChange?: (value: T) => void;
11
- className?: string;
12
- }
13
- export declare function SegmentedControl<T extends string | number>({ options, value, defaultValue, onChange, className, }: SegmentedControlProps<T>): import("react").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { cn } from './cn';
4
- export function SegmentedControl({ options, value, defaultValue, onChange, className, }) {
5
- const isControlled = value !== undefined;
6
- const [inner, setInner] = useState(defaultValue);
7
- const active = isControlled ? value : inner;
8
- return (_jsx("div", { role: "tablist", className: cn('inline-flex items-center gap-1 rounded-lg border border-slate-200 bg-white p-1', className), children: options.map(opt => {
9
- const selected = active === opt.value;
10
- return (_jsx("button", { type: "button", role: "tab", "aria-selected": selected, disabled: opt.disabled, onClick: () => {
11
- if (!isControlled)
12
- setInner(opt.value);
13
- onChange?.(opt.value);
14
- }, className: cn('rounded-md px-4 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-500/40 disabled:opacity-50', selected
15
- ? 'bg-lime-600 text-white'
16
- : 'text-slate-600 hover:bg-slate-100 hover:text-slate-900'), children: opt.label }, String(opt.value)));
17
- }) }));
18
- }
package/dist/Select.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
2
- label?: string;
3
- error?: string;
4
- }
5
- export declare function Select({ label, error, className, id, children, ...props }: SelectProps): import("react").JSX.Element;
package/dist/Select.js DELETED
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from './cn';
3
- export function Select({ label, error, className, id, children, ...props }) {
4
- return (_jsxs("div", { className: "w-full", children: [label && (_jsx("label", { htmlFor: id, className: "mb-1 block text-sm font-medium text-slate-700", children: label })), _jsx("select", { id: id, className: cn('w-full rounded-lg border bg-white px-3 py-2.5 text-sm text-slate-900 focus:outline-none focus:ring-2', error
5
- ? 'border-red-600 focus:border-red-600 focus:ring-red-500/30'
6
- : 'border-slate-500 focus:border-lime-600 focus:ring-lime-500/30', className), ...props, children: children }), error && _jsx("p", { className: "mt-1 text-xs text-red-600", children: error })] }));
7
- }
package/dist/Sidebar.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export interface SidebarItem {
2
- value: string;
3
- label: string;
4
- icon?: React.ReactNode;
5
- badge?: React.ReactNode;
6
- disabled?: boolean;
7
- }
8
- export interface SidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
9
- items: SidebarItem[];
10
- value?: string;
11
- defaultValue?: string;
12
- onChange?: (value: string) => void;
13
- header?: React.ReactNode;
14
- footer?: React.ReactNode;
15
- }
16
- export declare function Sidebar({ items, value, defaultValue, onChange, header, footer, className, ...props }: SidebarProps): import("react").JSX.Element;