@jacshuo/onyx 0.1.8 → 0.2.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 (154) hide show
  1. package/README.md +66 -2
  2. package/dist/Accordion.cjs +1 -1
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Alert.cjs +1 -1
  5. package/dist/Alert.d.cts +3 -1
  6. package/dist/Alert.d.ts +3 -1
  7. package/dist/Alert.js +1 -1
  8. package/dist/Badge.cjs +1 -1
  9. package/dist/Badge.js +1 -1
  10. package/dist/Button.cjs +1 -1
  11. package/dist/Button.js +1 -1
  12. package/dist/Card.cjs +1 -1
  13. package/dist/Card.js +1 -1
  14. package/dist/Checkbox.cjs +1 -0
  15. package/dist/Checkbox.d.cts +21 -0
  16. package/dist/Checkbox.d.ts +21 -0
  17. package/dist/Checkbox.js +1 -0
  18. package/dist/CodeBlock.cjs +1 -0
  19. package/dist/CodeBlock.d.cts +22 -0
  20. package/dist/CodeBlock.d.ts +22 -0
  21. package/dist/CodeBlock.js +1 -0
  22. package/dist/Dialog.cjs +1 -1
  23. package/dist/Dialog.js +1 -1
  24. package/dist/Dropdown.cjs +1 -1
  25. package/dist/Dropdown.d.cts +8 -0
  26. package/dist/Dropdown.d.ts +8 -0
  27. package/dist/Dropdown.js +1 -1
  28. package/dist/DropdownButton.cjs +1 -1
  29. package/dist/DropdownButton.js +1 -1
  30. package/dist/FileExplorer.cjs +1 -1
  31. package/dist/FileExplorer.js +1 -1
  32. package/dist/Input.cjs +1 -1
  33. package/dist/Input.js +1 -1
  34. package/dist/Label.cjs +1 -1
  35. package/dist/Label.js +1 -1
  36. package/dist/List.cjs +1 -1
  37. package/dist/List.d.cts +6 -2
  38. package/dist/List.d.ts +6 -2
  39. package/dist/List.js +1 -1
  40. package/dist/NavLink.cjs +1 -0
  41. package/dist/NavLink.d.cts +13 -0
  42. package/dist/NavLink.d.ts +13 -0
  43. package/dist/NavLink.js +1 -0
  44. package/dist/Panel.cjs +1 -1
  45. package/dist/Panel.js +1 -1
  46. package/dist/ProgressBar.cjs +1 -0
  47. package/dist/ProgressBar.d.cts +21 -0
  48. package/dist/ProgressBar.d.ts +21 -0
  49. package/dist/ProgressBar.js +1 -0
  50. package/dist/Radio.cjs +1 -0
  51. package/dist/Radio.d.cts +33 -0
  52. package/dist/Radio.d.ts +33 -0
  53. package/dist/Radio.js +1 -0
  54. package/dist/Spin.cjs +1 -0
  55. package/dist/Spin.d.cts +26 -0
  56. package/dist/Spin.d.ts +26 -0
  57. package/dist/Spin.js +1 -0
  58. package/dist/Switch.cjs +1 -0
  59. package/dist/Switch.d.cts +23 -0
  60. package/dist/Switch.d.ts +23 -0
  61. package/dist/Switch.js +1 -0
  62. package/dist/Table.cjs +1 -1
  63. package/dist/Table.d.cts +19 -3
  64. package/dist/Table.d.ts +19 -3
  65. package/dist/Table.js +1 -1
  66. package/dist/Tabs.cjs +1 -1
  67. package/dist/Tabs.js +1 -1
  68. package/dist/TextBox.cjs +1 -0
  69. package/dist/TextBox.d.cts +16 -0
  70. package/dist/TextBox.d.ts +16 -0
  71. package/dist/TextBox.js +1 -0
  72. package/dist/Tooltip.cjs +1 -1
  73. package/dist/Tooltip.js +1 -1
  74. package/dist/Tree.cjs +1 -1
  75. package/dist/Tree.d.cts +3 -1
  76. package/dist/Tree.d.ts +3 -1
  77. package/dist/Tree.js +1 -1
  78. package/dist/chunks/chunk-24YBOQFV.cjs +2 -0
  79. package/dist/chunks/chunk-2TTIBHQ3.js +1 -0
  80. package/dist/chunks/chunk-3B5OL3PD.cjs +2 -0
  81. package/dist/chunks/chunk-64BRBJ5M.js +1 -0
  82. package/dist/chunks/{chunk-NG7F3GCN.js → chunk-6DR7FZ4Y.js} +1 -1
  83. package/dist/chunks/{chunk-N36YROV3.js → chunk-7DM4FEFY.js} +1 -1
  84. package/dist/chunks/{chunk-4BKLB4KV.cjs → chunk-7PD2UMAG.cjs} +1 -1
  85. package/dist/chunks/chunk-7QV2AV32.cjs +1 -0
  86. package/dist/chunks/chunk-A7BECCRP.cjs +1 -0
  87. package/dist/chunks/{chunk-HA5QPLJP.cjs → chunk-A7SZGBY2.cjs} +1 -1
  88. package/dist/chunks/{chunk-ENRXEISR.js → chunk-BGUKKSPF.js} +1 -1
  89. package/dist/chunks/{chunk-VDC7N5TC.js → chunk-DCWKY33F.js} +1 -1
  90. package/dist/chunks/chunk-EQXC34N2.cjs +2 -0
  91. package/dist/chunks/chunk-FROZM2O6.js +1 -0
  92. package/dist/chunks/chunk-GQDGQUKK.js +1 -0
  93. package/dist/chunks/{chunk-BQLPFPCA.cjs → chunk-GT56J65P.cjs} +1 -1
  94. package/dist/chunks/{chunk-MXDZHU6E.cjs → chunk-GW4C7AV6.cjs} +2 -2
  95. package/dist/chunks/chunk-H35HQKON.js +2 -0
  96. package/dist/chunks/chunk-H6MHL66N.js +1 -0
  97. package/dist/chunks/{chunk-EK4BC3WT.cjs → chunk-HFHOE2PH.cjs} +1 -1
  98. package/dist/chunks/{chunk-JAKATE3I.js → chunk-HR4MRHSX.js} +1 -1
  99. package/dist/chunks/{chunk-7NYDMXZT.cjs → chunk-HSLG4VVI.cjs} +1 -1
  100. package/dist/chunks/{chunk-TDI2N27U.cjs → chunk-HSWWY3SE.cjs} +1 -1
  101. package/dist/chunks/{chunk-5PFWPAB6.js → chunk-I327TE7P.js} +1 -1
  102. package/dist/chunks/{chunk-6HZRNHE6.js → chunk-IPPWOV6D.js} +1 -1
  103. package/dist/chunks/chunk-K4UGTWDR.js +1 -0
  104. package/dist/chunks/chunk-KFQVZ2HC.cjs +1 -0
  105. package/dist/chunks/chunk-KG3IXPCM.js +2 -0
  106. package/dist/chunks/chunk-LCLJVRKK.cjs +1 -0
  107. package/dist/chunks/chunk-LZZTFSBF.js +1 -0
  108. package/dist/chunks/{chunk-GAK5OQW4.cjs → chunk-MSBDCLPM.cjs} +1 -1
  109. package/dist/chunks/{chunk-PODSD5UT.js → chunk-MVGDKSBE.js} +1 -1
  110. package/dist/chunks/{chunk-66LIYNLT.cjs → chunk-NFRGBE42.cjs} +1 -1
  111. package/dist/chunks/chunk-NI2HVXR2.js +1 -0
  112. package/dist/chunks/chunk-NXWDOFPX.cjs +1 -0
  113. package/dist/chunks/chunk-NYTZZ5ZX.cjs +1 -0
  114. package/dist/chunks/{chunk-U2ZQHP4I.cjs → chunk-OMBYGQJE.cjs} +1 -1
  115. package/dist/chunks/chunk-PC4PVKTK.js +2 -0
  116. package/dist/chunks/chunk-Q53OOZJ3.cjs +1 -0
  117. package/dist/chunks/chunk-R7ZKMSZ3.js +1 -0
  118. package/dist/chunks/{chunk-XCP37UUA.cjs → chunk-SJ2HIDEM.cjs} +1 -1
  119. package/dist/chunks/{chunk-AAFG7R4U.cjs → chunk-SKZIAHHY.cjs} +1 -1
  120. package/dist/chunks/{chunk-R2K6KI4L.js → chunk-T3WU6A7R.js} +1 -1
  121. package/dist/chunks/{chunk-NCJ5A6VE.js → chunk-VHOOZBWZ.js} +1 -1
  122. package/dist/chunks/chunk-W2JIAB3E.js +1 -0
  123. package/dist/chunks/chunk-WL4AMFUA.cjs +1 -0
  124. package/dist/chunks/chunk-WQA7PVJO.js +1 -0
  125. package/dist/chunks/{chunk-DXXCR4ON.js → chunk-X3PUHNVJ.js} +1 -1
  126. package/dist/chunks/chunk-X4OS5ODF.cjs +1 -0
  127. package/dist/chunks/chunk-XOZYC6XB.cjs +1 -0
  128. package/dist/chunks/{chunk-2DFUB3KN.js → chunk-YWD2VK35.js} +1 -1
  129. package/dist/chunks/chunk-ZEHGTD6Y.cjs +1 -0
  130. package/dist/index.cjs +1 -1
  131. package/dist/index.d.cts +12 -4
  132. package/dist/index.d.ts +12 -4
  133. package/dist/index.js +1 -1
  134. package/dist/styles/base.css +728 -0
  135. package/dist/styles/tailwind.css +21 -0
  136. package/dist/styles/tokens.css +71 -0
  137. package/dist/styles.css +728 -0
  138. package/dist/theme.cjs +1 -1
  139. package/dist/theme.d.cts +32 -1
  140. package/dist/theme.d.ts +32 -1
  141. package/dist/theme.js +1 -1
  142. package/package.json +2 -1
  143. package/dist/chunks/chunk-5XPTHIGM.cjs +0 -1
  144. package/dist/chunks/chunk-63LKYF4D.cjs +0 -1
  145. package/dist/chunks/chunk-6OLB4BUJ.js +0 -1
  146. package/dist/chunks/chunk-ACQOSYBI.js +0 -1
  147. package/dist/chunks/chunk-BW6NCATH.js +0 -1
  148. package/dist/chunks/chunk-DWTXICFN.js +0 -1
  149. package/dist/chunks/chunk-ER2MYWQO.cjs +0 -1
  150. package/dist/chunks/chunk-NBLJWONR.cjs +0 -1
  151. package/dist/chunks/chunk-ORNYPP3O.cjs +0 -1
  152. package/dist/chunks/chunk-PSMWVB3O.js +0 -1
  153. package/dist/chunks/chunk-QLKUAE3R.cjs +0 -1
  154. package/dist/chunks/chunk-SMZQSZH2.js +0 -1
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { radioVariants } from './theme.js';
5
+ import 'class-variance-authority/types';
6
+
7
+ interface RadioGroupProps {
8
+ /** Form field name shared by all radios. */
9
+ name?: string;
10
+ /** Controlled selected value. */
11
+ value?: string;
12
+ /** Default selected value (uncontrolled). */
13
+ defaultValue?: string;
14
+ /** Callback when selection changes. */
15
+ onValueChange?: (value: string) => void;
16
+ /** Shared intent for all child radios. */
17
+ intent?: VariantProps<typeof radioVariants>["intent"];
18
+ /** Shared size for all child radios. */
19
+ size?: VariantProps<typeof radioVariants>["size"];
20
+ disabled?: boolean;
21
+ className?: string;
22
+ children: React.ReactNode;
23
+ }
24
+ declare function RadioGroup({ name: nameProp, value: controlledValue, defaultValue, onValueChange, intent, size, disabled, className, children, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
25
+ type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & Omit<VariantProps<typeof radioVariants>, "checked"> & {
26
+ /** The value of this radio option. */
27
+ value: string;
28
+ /** Accessible label text shown beside the radio. */
29
+ label?: string;
30
+ };
31
+ declare function Radio({ value, intent: intentProp, size: sizeProp, label, id: propId, className, disabled: disabledProp, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
32
+
33
+ export { Radio, RadioGroup, type RadioGroupProps, type RadioProps };
package/dist/Radio.js ADDED
@@ -0,0 +1 @@
1
+ export{b as Radio,a as RadioGroup}from'./chunks/chunk-2TTIBHQ3.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
package/dist/Spin.cjs ADDED
@@ -0,0 +1 @@
1
+ 'use strict';var chunkEQXC34N2_cjs=require('./chunks/chunk-EQXC34N2.cjs');require('./chunks/chunk-NYTZZ5ZX.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Spin",{enumerable:true,get:function(){return chunkEQXC34N2_cjs.a}});Object.defineProperty(exports,"useSpin",{enumerable:true,get:function(){return chunkEQXC34N2_cjs.b}});
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { spinVariants } from './theme.cjs';
5
+ import 'class-variance-authority/types';
6
+
7
+ type SpinProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof spinVariants> & {
8
+ /** Whether the spinner and overlay are active */
9
+ spinning?: boolean;
10
+ /** Tip text shown below the spinner */
11
+ tip?: string;
12
+ };
13
+ /**
14
+ * Inline Spin overlay.
15
+ * Wraps children and covers them with a loading mask when `spinning` is true.
16
+ * Without children it renders a standalone spinner.
17
+ */
18
+ declare function Spin({ spinning, tip, size, className, children, ...props }: SpinProps): react_jsx_runtime.JSX.Element | null;
19
+ declare function addSpin(target: HTMLElement, tip?: string): () => void;
20
+ /**
21
+ * Returns a `setSpin(target, tip?)` function.
22
+ * Each call returns a **close** function to dismiss that specific overlay.
23
+ */
24
+ declare function useSpin(): typeof addSpin;
25
+
26
+ export { Spin, type SpinProps, useSpin };
package/dist/Spin.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { spinVariants } from './theme.js';
5
+ import 'class-variance-authority/types';
6
+
7
+ type SpinProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof spinVariants> & {
8
+ /** Whether the spinner and overlay are active */
9
+ spinning?: boolean;
10
+ /** Tip text shown below the spinner */
11
+ tip?: string;
12
+ };
13
+ /**
14
+ * Inline Spin overlay.
15
+ * Wraps children and covers them with a loading mask when `spinning` is true.
16
+ * Without children it renders a standalone spinner.
17
+ */
18
+ declare function Spin({ spinning, tip, size, className, children, ...props }: SpinProps): react_jsx_runtime.JSX.Element | null;
19
+ declare function addSpin(target: HTMLElement, tip?: string): () => void;
20
+ /**
21
+ * Returns a `setSpin(target, tip?)` function.
22
+ * Each call returns a **close** function to dismiss that specific overlay.
23
+ */
24
+ declare function useSpin(): typeof addSpin;
25
+
26
+ export { Spin, type SpinProps, useSpin };
package/dist/Spin.js ADDED
@@ -0,0 +1 @@
1
+ export{a as Spin,b as useSpin}from'./chunks/chunk-H35HQKON.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkLCLJVRKK_cjs=require('./chunks/chunk-LCLJVRKK.cjs');require('./chunks/chunk-NYTZZ5ZX.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Switch",{enumerable:true,get:function(){return chunkLCLJVRKK_cjs.a}});
@@ -0,0 +1,23 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { switchTrackVariants } from './theme.cjs';
5
+ import 'class-variance-authority/types';
6
+
7
+ type SwitchProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & Omit<VariantProps<typeof switchTrackVariants>, "checked"> & {
8
+ /** Controlled checked state. */
9
+ checked?: boolean;
10
+ /** Default checked state (uncontrolled). */
11
+ defaultChecked?: boolean;
12
+ /** Callback when the switch is toggled. */
13
+ onCheckedChange?: (checked: boolean) => void;
14
+ /** Text/icon shown when checked (inside the track). */
15
+ checkedContent?: React.ReactNode;
16
+ /** Text/icon shown when unchecked (inside the track). */
17
+ uncheckedContent?: React.ReactNode;
18
+ /** Accessible label text shown beside the switch. */
19
+ label?: string;
20
+ };
21
+ declare function Switch({ checked: controlledChecked, defaultChecked, onCheckedChange, checkedContent, uncheckedContent, intent, size, label, id: propId, className, disabled, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
22
+
23
+ export { Switch, type SwitchProps };
@@ -0,0 +1,23 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { switchTrackVariants } from './theme.js';
5
+ import 'class-variance-authority/types';
6
+
7
+ type SwitchProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & Omit<VariantProps<typeof switchTrackVariants>, "checked"> & {
8
+ /** Controlled checked state. */
9
+ checked?: boolean;
10
+ /** Default checked state (uncontrolled). */
11
+ defaultChecked?: boolean;
12
+ /** Callback when the switch is toggled. */
13
+ onCheckedChange?: (checked: boolean) => void;
14
+ /** Text/icon shown when checked (inside the track). */
15
+ checkedContent?: React.ReactNode;
16
+ /** Text/icon shown when unchecked (inside the track). */
17
+ uncheckedContent?: React.ReactNode;
18
+ /** Accessible label text shown beside the switch. */
19
+ label?: string;
20
+ };
21
+ declare function Switch({ checked: controlledChecked, defaultChecked, onCheckedChange, checkedContent, uncheckedContent, intent, size, label, id: propId, className, disabled, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
22
+
23
+ export { Switch, type SwitchProps };
package/dist/Switch.js ADDED
@@ -0,0 +1 @@
1
+ export{a as Switch}from'./chunks/chunk-WQA7PVJO.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
package/dist/Table.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkQLKUAE3R_cjs=require('./chunks/chunk-QLKUAE3R.cjs');require('./chunks/chunk-NBLJWONR.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"DataTable",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.h}});Object.defineProperty(exports,"SortableTable",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.g}});Object.defineProperty(exports,"Table",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.a}});Object.defineProperty(exports,"TableBody",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.c}});Object.defineProperty(exports,"TableCell",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.f}});Object.defineProperty(exports,"TableHead",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.e}});Object.defineProperty(exports,"TableHeader",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.b}});Object.defineProperty(exports,"TableRow",{enumerable:true,get:function(){return chunkQLKUAE3R_cjs.d}});
1
+ 'use strict';var chunkX4OS5ODF_cjs=require('./chunks/chunk-X4OS5ODF.cjs');require('./chunks/chunk-NYTZZ5ZX.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"DataTable",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.i}});Object.defineProperty(exports,"SortableTable",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.h}});Object.defineProperty(exports,"Table",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.a}});Object.defineProperty(exports,"TableBody",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.c}});Object.defineProperty(exports,"TableCell",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.f}});Object.defineProperty(exports,"TableEmpty",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.g}});Object.defineProperty(exports,"TableHead",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.e}});Object.defineProperty(exports,"TableHeader",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.b}});Object.defineProperty(exports,"TableRow",{enumerable:true,get:function(){return chunkX4OS5ODF_cjs.d}});
package/dist/Table.d.cts CHANGED
@@ -11,6 +11,14 @@ declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTab
11
11
  declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): react_jsx_runtime.JSX.Element;
12
12
  declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
13
13
  declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
14
+ type TableEmptyProps = {
15
+ /** Custom icon to display. Defaults to Inbox. */
16
+ icon?: React.ReactNode;
17
+ /** Text shown below the icon. @default "No data" */
18
+ text?: React.ReactNode;
19
+ className?: string;
20
+ };
21
+ declare function TableEmpty({ icon, text, className }: TableEmptyProps): react_jsx_runtime.JSX.Element;
14
22
  type SortDirection = "asc" | "desc";
15
23
  type SortState<K extends string = string> = {
16
24
  column: K;
@@ -43,10 +51,14 @@ type SortableTableProps<T, K extends string = string> = {
43
51
  onSortChange?: (sort: SortState<K>) => void;
44
52
  defaultSort?: SortState<K>;
45
53
  rowKey?: (row: T, index: number) => React.Key;
54
+ /** Render action buttons for each row. Receives the row data object. */
55
+ rowActions?: (row: T) => React.ReactNode;
46
56
  intent?: VariantProps<typeof tableVariants>["intent"];
47
57
  className?: string;
58
+ /** Custom empty state props (icon, text). Shown when data is empty. */
59
+ empty?: TableEmptyProps;
48
60
  };
49
- declare function SortableTable<T, K extends string = string>({ columns, data, sort: controlledSort, onSortChange, defaultSort, rowKey, intent, className, }: SortableTableProps<T, K>): react_jsx_runtime.JSX.Element;
61
+ declare function SortableTable<T, K extends string = string>({ columns, data, sort: controlledSort, onSortChange, defaultSort, rowKey, rowActions, intent, className, empty, }: SortableTableProps<T, K>): react_jsx_runtime.JSX.Element;
50
62
  type SelectionMode = "none" | "single" | "multiple";
51
63
  type DataTableProps<T, K extends string = string> = {
52
64
  /** Column definitions. */
@@ -74,9 +86,13 @@ type DataTableProps<T, K extends string = string> = {
74
86
  onAdd?: () => void;
75
87
  /** Called when Delete is clicked. Receives currently selected keys. */
76
88
  onDelete?: (keys: React.Key[]) => void;
89
+ /** Render action buttons for each row. Receives the row data object. */
90
+ rowActions?: (row: T) => React.ReactNode;
77
91
  intent?: VariantProps<typeof tableVariants>["intent"];
78
92
  className?: string;
93
+ /** Custom empty state props (icon, text). Shown when data is empty. */
94
+ empty?: TableEmptyProps;
79
95
  };
80
- declare function DataTable<T, K extends string = string>({ columns, data, rowKey, sort: controlledSort, onSortChange, defaultSort, selectionMode, selected: controlledSelected, onSelectionChange, editable, onCellEdit, toolbar, onAdd, onDelete, intent, className, }: DataTableProps<T, K>): react_jsx_runtime.JSX.Element;
96
+ declare function DataTable<T, K extends string = string>({ columns, data, rowKey, sort: controlledSort, onSortChange, defaultSort, selectionMode, selected: controlledSelected, onSelectionChange, editable, onCellEdit, toolbar, onAdd, onDelete, rowActions, intent, className, empty, }: DataTableProps<T, K>): react_jsx_runtime.JSX.Element;
81
97
 
82
- export { type ColumnDef, DataTable, type DataTableProps, type SelectionMode, type SortDirection, type SortState, SortableTable, Table, TableBody, TableCell, TableHead, TableHeader, TableRow };
98
+ export { type ColumnDef, DataTable, type DataTableProps, type SelectionMode, type SortDirection, type SortState, SortableTable, Table, TableBody, TableCell, TableEmpty, type TableEmptyProps, TableHead, TableHeader, TableRow };
package/dist/Table.d.ts CHANGED
@@ -11,6 +11,14 @@ declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTab
11
11
  declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): react_jsx_runtime.JSX.Element;
12
12
  declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
13
13
  declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
14
+ type TableEmptyProps = {
15
+ /** Custom icon to display. Defaults to Inbox. */
16
+ icon?: React.ReactNode;
17
+ /** Text shown below the icon. @default "No data" */
18
+ text?: React.ReactNode;
19
+ className?: string;
20
+ };
21
+ declare function TableEmpty({ icon, text, className }: TableEmptyProps): react_jsx_runtime.JSX.Element;
14
22
  type SortDirection = "asc" | "desc";
15
23
  type SortState<K extends string = string> = {
16
24
  column: K;
@@ -43,10 +51,14 @@ type SortableTableProps<T, K extends string = string> = {
43
51
  onSortChange?: (sort: SortState<K>) => void;
44
52
  defaultSort?: SortState<K>;
45
53
  rowKey?: (row: T, index: number) => React.Key;
54
+ /** Render action buttons for each row. Receives the row data object. */
55
+ rowActions?: (row: T) => React.ReactNode;
46
56
  intent?: VariantProps<typeof tableVariants>["intent"];
47
57
  className?: string;
58
+ /** Custom empty state props (icon, text). Shown when data is empty. */
59
+ empty?: TableEmptyProps;
48
60
  };
49
- declare function SortableTable<T, K extends string = string>({ columns, data, sort: controlledSort, onSortChange, defaultSort, rowKey, intent, className, }: SortableTableProps<T, K>): react_jsx_runtime.JSX.Element;
61
+ declare function SortableTable<T, K extends string = string>({ columns, data, sort: controlledSort, onSortChange, defaultSort, rowKey, rowActions, intent, className, empty, }: SortableTableProps<T, K>): react_jsx_runtime.JSX.Element;
50
62
  type SelectionMode = "none" | "single" | "multiple";
51
63
  type DataTableProps<T, K extends string = string> = {
52
64
  /** Column definitions. */
@@ -74,9 +86,13 @@ type DataTableProps<T, K extends string = string> = {
74
86
  onAdd?: () => void;
75
87
  /** Called when Delete is clicked. Receives currently selected keys. */
76
88
  onDelete?: (keys: React.Key[]) => void;
89
+ /** Render action buttons for each row. Receives the row data object. */
90
+ rowActions?: (row: T) => React.ReactNode;
77
91
  intent?: VariantProps<typeof tableVariants>["intent"];
78
92
  className?: string;
93
+ /** Custom empty state props (icon, text). Shown when data is empty. */
94
+ empty?: TableEmptyProps;
79
95
  };
80
- declare function DataTable<T, K extends string = string>({ columns, data, rowKey, sort: controlledSort, onSortChange, defaultSort, selectionMode, selected: controlledSelected, onSelectionChange, editable, onCellEdit, toolbar, onAdd, onDelete, intent, className, }: DataTableProps<T, K>): react_jsx_runtime.JSX.Element;
96
+ declare function DataTable<T, K extends string = string>({ columns, data, rowKey, sort: controlledSort, onSortChange, defaultSort, selectionMode, selected: controlledSelected, onSelectionChange, editable, onCellEdit, toolbar, onAdd, onDelete, rowActions, intent, className, empty, }: DataTableProps<T, K>): react_jsx_runtime.JSX.Element;
81
97
 
82
- export { type ColumnDef, DataTable, type DataTableProps, type SelectionMode, type SortDirection, type SortState, SortableTable, Table, TableBody, TableCell, TableHead, TableHeader, TableRow };
98
+ export { type ColumnDef, DataTable, type DataTableProps, type SelectionMode, type SortDirection, type SortState, SortableTable, Table, TableBody, TableCell, TableEmpty, type TableEmptyProps, TableHead, TableHeader, TableRow };
package/dist/Table.js CHANGED
@@ -1 +1 @@
1
- export{h as DataTable,g as SortableTable,a as Table,c as TableBody,f as TableCell,e as TableHead,b as TableHeader,d as TableRow}from'./chunks/chunk-6OLB4BUJ.js';import'./chunks/chunk-ACQOSYBI.js';import'./chunks/chunk-AXBJKPZZ.js';
1
+ export{i as DataTable,h as SortableTable,a as Table,c as TableBody,f as TableCell,g as TableEmpty,e as TableHead,b as TableHeader,d as TableRow}from'./chunks/chunk-W2JIAB3E.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
package/dist/Tabs.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunk7NYDMXZT_cjs=require('./chunks/chunk-7NYDMXZT.cjs');require('./chunks/chunk-NBLJWONR.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"TabContent",{enumerable:true,get:function(){return chunk7NYDMXZT_cjs.e}});Object.defineProperty(exports,"TabList",{enumerable:true,get:function(){return chunk7NYDMXZT_cjs.b}});Object.defineProperty(exports,"TabPanels",{enumerable:true,get:function(){return chunk7NYDMXZT_cjs.d}});Object.defineProperty(exports,"TabTrigger",{enumerable:true,get:function(){return chunk7NYDMXZT_cjs.c}});Object.defineProperty(exports,"Tabs",{enumerable:true,get:function(){return chunk7NYDMXZT_cjs.a}});
1
+ 'use strict';var chunkHSLG4VVI_cjs=require('./chunks/chunk-HSLG4VVI.cjs');require('./chunks/chunk-NYTZZ5ZX.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"TabContent",{enumerable:true,get:function(){return chunkHSLG4VVI_cjs.e}});Object.defineProperty(exports,"TabList",{enumerable:true,get:function(){return chunkHSLG4VVI_cjs.b}});Object.defineProperty(exports,"TabPanels",{enumerable:true,get:function(){return chunkHSLG4VVI_cjs.d}});Object.defineProperty(exports,"TabTrigger",{enumerable:true,get:function(){return chunkHSLG4VVI_cjs.c}});Object.defineProperty(exports,"Tabs",{enumerable:true,get:function(){return chunkHSLG4VVI_cjs.a}});
package/dist/Tabs.js CHANGED
@@ -1 +1 @@
1
- export{e as TabContent,b as TabList,d as TabPanels,c as TabTrigger,a as Tabs}from'./chunks/chunk-ENRXEISR.js';import'./chunks/chunk-ACQOSYBI.js';import'./chunks/chunk-AXBJKPZZ.js';
1
+ export{e as TabContent,b as TabList,d as TabPanels,c as TabTrigger,a as Tabs}from'./chunks/chunk-BGUKKSPF.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkKFQVZ2HC_cjs=require('./chunks/chunk-KFQVZ2HC.cjs');require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"TextBox",{enumerable:true,get:function(){return chunkKFQVZ2HC_cjs.a}});
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+
4
+ type TextBoxProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & {
5
+ /** Visual state. @default 'default' */
6
+ state?: "default" | "error";
7
+ /** Size variant. @default 'md' */
8
+ size?: "sm" | "md" | "lg";
9
+ /** Show a live word count below the textarea. @default false */
10
+ showWordCount?: boolean;
11
+ /** Maximum number of words. When exceeded the counter turns red. */
12
+ maxWords?: number;
13
+ };
14
+ declare function TextBox({ state, size, showWordCount, maxWords, className, value: controlledValue, defaultValue, onChange, disabled, ...props }: TextBoxProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { TextBox, type TextBoxProps };
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+
4
+ type TextBoxProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & {
5
+ /** Visual state. @default 'default' */
6
+ state?: "default" | "error";
7
+ /** Size variant. @default 'md' */
8
+ size?: "sm" | "md" | "lg";
9
+ /** Show a live word count below the textarea. @default false */
10
+ showWordCount?: boolean;
11
+ /** Maximum number of words. When exceeded the counter turns red. */
12
+ maxWords?: number;
13
+ };
14
+ declare function TextBox({ state, size, showWordCount, maxWords, className, value: controlledValue, defaultValue, onChange, disabled, ...props }: TextBoxProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { TextBox, type TextBoxProps };
@@ -0,0 +1 @@
1
+ export{a as TextBox}from'./chunks/chunk-FROZM2O6.js';import'./chunks/chunk-AXBJKPZZ.js';
package/dist/Tooltip.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkGAK5OQW4_cjs=require('./chunks/chunk-GAK5OQW4.cjs');require('./chunks/chunk-NBLJWONR.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Tooltip",{enumerable:true,get:function(){return chunkGAK5OQW4_cjs.a}});
1
+ 'use strict';var chunkMSBDCLPM_cjs=require('./chunks/chunk-MSBDCLPM.cjs');require('./chunks/chunk-NYTZZ5ZX.cjs'),require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Tooltip",{enumerable:true,get:function(){return chunkMSBDCLPM_cjs.a}});
package/dist/Tooltip.js CHANGED
@@ -1 +1 @@
1
- export{a as Tooltip}from'./chunks/chunk-R2K6KI4L.js';import'./chunks/chunk-ACQOSYBI.js';import'./chunks/chunk-AXBJKPZZ.js';
1
+ export{a as Tooltip}from'./chunks/chunk-T3WU6A7R.js';import'./chunks/chunk-H6MHL66N.js';import'./chunks/chunk-AXBJKPZZ.js';
package/dist/Tree.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkER2MYWQO_cjs=require('./chunks/chunk-ER2MYWQO.cjs');require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Tree",{enumerable:true,get:function(){return chunkER2MYWQO_cjs.a}});Object.defineProperty(exports,"TreeItem",{enumerable:true,get:function(){return chunkER2MYWQO_cjs.b}});
1
+ 'use strict';var chunk7QV2AV32_cjs=require('./chunks/chunk-7QV2AV32.cjs');require('./chunks/chunk-X5YP5TMY.cjs');Object.defineProperty(exports,"Tree",{enumerable:true,get:function(){return chunk7QV2AV32_cjs.a}});Object.defineProperty(exports,"TreeItem",{enumerable:true,get:function(){return chunk7QV2AV32_cjs.b}});
package/dist/Tree.d.cts CHANGED
@@ -22,12 +22,14 @@ type TreeItemProps = {
22
22
  nodeKey?: string;
23
23
  label: React.ReactNode;
24
24
  icon?: React.ReactNode;
25
+ /** Action buttons shown on hover at the right side of the item row. */
26
+ actions?: React.ReactNode;
25
27
  defaultExpanded?: boolean;
26
28
  expanded?: boolean;
27
29
  onToggle?: (expanded: boolean) => void;
28
30
  children?: React.ReactNode;
29
31
  className?: string;
30
32
  };
31
- declare function TreeItem({ nodeKey, label, icon, defaultExpanded, expanded: controlledExpanded, onToggle, children, className, }: TreeItemProps): react_jsx_runtime.JSX.Element;
33
+ declare function TreeItem({ nodeKey, label, icon, actions, defaultExpanded, expanded: controlledExpanded, onToggle, children, className, }: TreeItemProps): react_jsx_runtime.JSX.Element;
32
34
 
33
35
  export { Tree, TreeItem };
package/dist/Tree.d.ts CHANGED
@@ -22,12 +22,14 @@ type TreeItemProps = {
22
22
  nodeKey?: string;
23
23
  label: React.ReactNode;
24
24
  icon?: React.ReactNode;
25
+ /** Action buttons shown on hover at the right side of the item row. */
26
+ actions?: React.ReactNode;
25
27
  defaultExpanded?: boolean;
26
28
  expanded?: boolean;
27
29
  onToggle?: (expanded: boolean) => void;
28
30
  children?: React.ReactNode;
29
31
  className?: string;
30
32
  };
31
- declare function TreeItem({ nodeKey, label, icon, defaultExpanded, expanded: controlledExpanded, onToggle, children, className, }: TreeItemProps): react_jsx_runtime.JSX.Element;
33
+ declare function TreeItem({ nodeKey, label, icon, actions, defaultExpanded, expanded: controlledExpanded, onToggle, children, className, }: TreeItemProps): react_jsx_runtime.JSX.Element;
32
34
 
33
35
  export { Tree, TreeItem };
package/dist/Tree.js CHANGED
@@ -1 +1 @@
1
- export{a as Tree,b as TreeItem}from'./chunks/chunk-SMZQSZH2.js';import'./chunks/chunk-AXBJKPZZ.js';
1
+ export{a as Tree,b as TreeItem}from'./chunks/chunk-R7ZKMSZ3.js';import'./chunks/chunk-AXBJKPZZ.js';
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkNYTZZ5ZX_cjs=require('./chunk-NYTZZ5ZX.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),jsxRuntime=require('react/jsx-runtime');function k(n,r){return !!(r==="_blank"||n&&/^https?:\/\//.test(n))}var m=n=>jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true,...n,children:[jsxRuntime.jsx("path",{d:"M15 3h6v6"}),jsxRuntime.jsx("path",{d:"M10 14 21 3"}),jsxRuntime.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]});function w({intent:n,size:r,underline:f,external:c,className:u,children:d,href:a,target:t,rel:s,...h}){let o=c??k(a,t);return jsxRuntime.jsxs("a",{href:a,target:o&&!t?"_blank":t,rel:o&&!s?"noopener noreferrer":s,className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.n({intent:n,size:r,underline:f}),u),...h,children:[d,o&&jsxRuntime.jsx(m,{})]})}
2
+ exports.a=w;
@@ -0,0 +1 @@
1
+ import {s}from'./chunk-H6MHL66N.js';import {a}from'./chunk-AXBJKPZZ.js';import {createContext,useId,useState,useCallback,useContext}from'react';import {jsx,jsxs}from'react/jsx-runtime';var C=createContext(null);function M({name:t,value:a$1,defaultValue:p,onValueChange:o,intent:u,size:m,disabled:f,className:s,children:g}){let r=useId(),e=t??r,[h,d]=useState(p),v=a$1??h,l=useCallback(c=>{a$1===void 0&&d(c),o?.(c);},[a$1,o]);return jsx(C.Provider,{value:{name:e,value:v,onChange:l,intent:u,size:m,disabled:f},children:jsx("div",{role:"radiogroup",className:a("flex flex-col gap-2",s),children:g})})}var G={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"};function S({value:t,intent:a$1,size:p,label:o,id:u,className:m,disabled:f,...s$1}){let g=useId(),r=u??g,e=useContext(C),h=a$1??e?.intent,d=p??e?.size,v=d??"md",l=f??e?.disabled,c=s$1.name??e?.name,x=e?e.value===t:void 0,b=useCallback(P=>{P.target.checked&&e?.onChange(t);},[e,t]);return jsxs("label",{htmlFor:r,className:a("inline-flex cursor-pointer items-center gap-2 select-none",l&&"pointer-events-none opacity-50",m),children:[jsx("input",{...s$1,id:r,type:"radio",name:c,value:t,className:"sr-only",checked:x,disabled:l,onChange:b}),jsx("span",{className:a(s({intent:h,size:d,checked:x?"on":"off"})),children:jsx("span",{className:a("rounded-full bg-white transition-all duration-200",G[v],x?"scale-100 opacity-100":"scale-0 opacity-0")})}),o&&jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:o})]})}export{M as a,S as b};
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkNYTZZ5ZX_cjs=require('./chunk-NYTZZ5ZX.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var A={name:"onyx-css-vars",type:"dark",settings:[{settings:{foreground:"var(--color-syntax-plain)",background:"var(--color-syntax-bg)"}},{scope:["comment","punctuation.definition.comment"],settings:{foreground:"var(--color-syntax-comment)",fontStyle:"italic"}},{scope:["keyword","keyword.control","keyword.operator.new","keyword.operator.expression","storage.type","storage.modifier"],settings:{foreground:"var(--color-syntax-keyword)"}},{scope:["string","string.quoted","string.template"],settings:{foreground:"var(--color-syntax-string)"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"var(--color-syntax-function)"}},{scope:["variable","variable.other","variable.parameter","meta.definition.variable"],settings:{foreground:"var(--color-syntax-variable)"}},{scope:["constant.numeric","constant.language"],settings:{foreground:"var(--color-syntax-number)"}},{scope:["keyword.operator","keyword.operator.assignment","keyword.operator.comparison","keyword.operator.arithmetic"],settings:{foreground:"var(--color-syntax-operator)"}},{scope:["entity.name.tag","punctuation.definition.tag","support.class.component"],settings:{foreground:"var(--color-syntax-tag)"}},{scope:["entity.other.attribute-name","meta.tag.attributes"],settings:{foreground:"var(--color-syntax-attr)"}},{scope:["punctuation","meta.brace","punctuation.definition.block","punctuation.separator","punctuation.terminator"],settings:{foreground:"var(--color-syntax-punctuation)"}},{scope:["entity.name.type","support.type","support.class","entity.other.inherited-class"],settings:{foreground:"var(--color-syntax-type)"}}]},h=null,T=new Set;function D(){return h||(h=import('shiki').then(n=>n.createHighlighter({themes:[A],langs:[]}))),h}async function F(n,o,s){let i=await D();if(o&&!T.has(o))try{await i.loadLanguage(o),T.add(o);}catch{o="text";}let r=i.codeToHtml(n,{lang:o||"text",theme:"onyx-css-vars"});if(r=r.replace(/(<pre [^>]*style=")/,"$1line-height:1.7;tab-size:2;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;"),s){let l=0;r=r.replace(/<span class="line">/g,()=>(l++,`<span class="line"><span class="line-number" data-line="${l}"></span>`));}return r}function I({code:n,language:o="text",lineNumbers:s=false,editable:i=false,onCodeChange:r,size:l,className:v,...b}){let[c,H]=react.useState(""),u=react.useRef(null),x=react.useRef(null),d=react.useRef(null);react.useEffect(()=>{let e=false;return F(n,o,i?false:s).then(t=>{e||H(t);}),()=>{e=true;}},[n,o,s,i]);let L=react.useCallback(()=>{let e=x.current,t=d.current?.querySelector("pre"),p=u.current?.querySelector("[data-gutter]");e&&t&&(t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft),e&&p&&(p.scrollTop=e.scrollTop);},[]),M=react.useCallback(e=>{r?.(e.target.value);},[r]),S=react.useCallback(e=>{if(e.key==="Tab"){e.preventDefault();let t=e.currentTarget,p=t.selectionStart,R=t.selectionEnd,B=t.value.substring(0,p)+" "+t.value.substring(R);r?.(B),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=p+2;});}},[r]),C=s&&"[&_.line-number]:inline-block [&_.line-number]:w-8 [&_.line-number]:mr-4 [&_.line-number]:text-right [&_.line-number]:text-secondary-400 [&_.line-number]:select-none [&_.line-number]:before:content-[attr(data-line)]",k="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",w=1.7,E=n.split(`
2
+ `).length;return i?jsxRuntime.jsxs("div",{ref:u,className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.o({size:l}),"flex border border-primary-200 dark:border-primary-700",v),style:{background:"var(--color-syntax-bg)"},...b,children:[s&&jsxRuntime.jsx("div",{"data-gutter":true,"aria-hidden":true,className:"shrink-0 select-none overflow-hidden py-4 pl-3 pr-1 text-right text-secondary-400",style:{fontFamily:k,lineHeight:w,width:"3rem"},children:Array.from({length:E},(e,t)=>jsxRuntime.jsx("div",{children:t+1},t))}),jsxRuntime.jsxs("div",{className:"relative min-w-0 flex-1",children:[jsxRuntime.jsx("textarea",{ref:x,value:n,onChange:M,onScroll:L,onKeyDown:S,spellCheck:false,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:"relative z-2 m-0 block h-full w-full resize-none overflow-auto whitespace-pre border-none bg-transparent p-4 text-transparent caret-primary-600 outline-none dark:caret-primary-400",style:{fontFamily:k,lineHeight:w,tabSize:2,minHeight:"6rem"}}),jsxRuntime.jsx("div",{ref:d,"aria-hidden":true,className:"pointer-events-none absolute inset-0 z-1 overflow-hidden [&_pre]:m-0 [&_pre]:h-full [&_pre]:overflow-hidden [&_pre]:p-4 [&_code]:bg-transparent",dangerouslySetInnerHTML:c?{__html:c}:void 0})]})]}):jsxRuntime.jsx("div",{ref:u,className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.o({size:l}),"border border-primary-200 dark:border-primary-700",C,v),...b,children:jsxRuntime.jsx("div",{ref:d,className:"[&_pre]:m-0 [&_pre]:p-4",dangerouslySetInnerHTML:c?{__html:c}:void 0,children:c?void 0:jsxRuntime.jsx("pre",{className:"m-0 p-4",style:{background:"var(--color-syntax-bg)"},children:jsxRuntime.jsx("code",{children:n})})})})}exports.a=I;
@@ -0,0 +1 @@
1
+ import {r}from'./chunk-H6MHL66N.js';import {a}from'./chunk-AXBJKPZZ.js';import {useId,useState,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var M={sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4"};function S({checked:o,defaultChecked:k=false,indeterminate:n=false,onCheckedChange:a$1,intent:m,size:s,label:c,id:u,className:x,disabled:r$1,...f}){let b=useId(),i=u??b,y=s??"md",[C,g]=useState(k),l=o??C,v=useCallback(L=>{let d=L.target.checked;o===void 0&&g(d),a$1?.(d);},[o,a$1]),p=l||n;return jsxs("label",{htmlFor:i,className:a("inline-flex cursor-pointer items-center gap-2 select-none",r$1&&"pointer-events-none opacity-50",x),children:[jsx("input",{...f,id:i,type:"checkbox",className:"sr-only",checked:l,disabled:r$1,onChange:v}),jsx("span",{className:a(r({intent:m,size:s,checked:p?"on":"off"})),children:jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:a("text-white transition-all duration-200",M[y],p?"scale-100 opacity-100":"scale-0 opacity-0"),children:n?jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}):jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),c&&jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:c})]})}export{S as a};
@@ -1,4 +1,4 @@
1
- import {a as a$1,b,c,d,e,f}from'./chunk-NCJ5A6VE.js';import {a as a$2}from'./chunk-N36YROV3.js';import {a}from'./chunk-AXBJKPZZ.js';import ze,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {HardDrive,LayoutGrid,LayoutList,Minus,Minimize2,Maximize2,X,FolderUp,Search,CornerRightDown,Folder,ArrowUp,AlertTriangle,Trash2,FileArchive,Database,FileSpreadsheet,FileText,Terminal,FileCode,Video,Music,Image,File}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function _(o){let f=o.lastIndexOf(".");return f>0?o.slice(f).toLowerCase():""}function Se(o){return o==null?"\u2014":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:o<1024*1024*1024?`${(o/(1024*1024)).toFixed(1)} MB`:`${(o/(1024*1024*1024)).toFixed(2)} GB`}function ue(o){return o?(typeof o=="string"?new Date(o):o).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var ut={".png":Image,".jpg":Image,".jpeg":Image,".gif":Image,".svg":Image,".webp":Image,".ico":Image,".bmp":Image,".mp3":Music,".wav":Music,".flac":Music,".ogg":Music,".aac":Music,".m4a":Music,".mp4":Video,".mkv":Video,".avi":Video,".mov":Video,".wmv":Video,".webm":Video,".ts":FileCode,".tsx":FileCode,".js":FileCode,".jsx":FileCode,".json":FileCode,".html":FileCode,".css":FileCode,".scss":FileCode,".py":FileCode,".rs":FileCode,".go":FileCode,".java":FileCode,".c":FileCode,".cpp":FileCode,".h":FileCode,".sh":Terminal,".bat":Terminal,".ps1":Terminal,".md":FileText,".txt":FileText,".pdf":FileText,".doc":FileText,".docx":FileText,".rtf":FileText,".csv":FileSpreadsheet,".xls":FileSpreadsheet,".xlsx":FileSpreadsheet,".db":Database,".sqlite":Database,".sql":Database,".zip":FileArchive,".tar":FileArchive,".gz":FileArchive,".rar":FileArchive,".7z":FileArchive};function fe(o){if(o.type==="directory")return Folder;let f=o.extension||_(o.name);return ut[f]||File}function Ie(o,f,I){return Math.max(f,Math.min(I,o))}function yt({files:o,title:f$1="File Explorer",accent:I="#8b5cf6",defaultView:Ae="list",initialPosition:Re,initialSize:Te,dockable:je=false,dockSide:Be="right",visible:G=true,onFileOpen:X$1,onSelectionChange:me,onNavigate:$,onDelete:U,onClose:Ve,onMinimize:pe,onPathSubmit:xe,defaultInputMode:Xe="search",actions:$e,resizable:He=true,minSize:L={width:400,height:300},className:Ke}){let[q,Oe]=useState(Ae),[d$1,A]=useState(new Set),[ge,H]=useState(null),[l,Q]=useState(false),[R,W]=useState(false),[w,Pe]=useState(""),[y,Ye]=useState(Xe),[_e,Ge]=useState(G),[Ue,K]=useState(false),J=Te??{width:720,height:520},[x,O]=useState(Re??{x:Math.max(0,Math.round((window.innerWidth-J.width)/2)),y:Math.max(0,Math.round((window.innerHeight-J.height)/2))}),[k,Z]=useState(J),[h,qe]=useState(null),ee=useRef(false),te=useRef({x:0,y:0}),ne=useRef(null),T=useRef(false),P=useRef({x:0,y:0,w:0,h:0,px:0,py:0}),re=G!==void 0?G:_e,oe=useMemo(()=>{let e=o.filter(i=>i.type==="directory"),n=o.filter(i=>i.type==="file");return e.sort((i,s)=>i.name.localeCompare(s.name)),n.sort((i,s)=>i.name.localeCompare(s.name)),[...e,...n]},[o]),u=useMemo(()=>{if(y!=="search"||!w.trim())return oe;let e=w.toLowerCase();return oe.filter(n=>n.name.toLowerCase().includes(e))},[oe,w,y]),a$3=ge!=null?u[ge]:null,he=useCallback((e,n)=>{A(i=>{let s=new Set(i);return n.ctrlKey||n.metaKey?s.has(e)?s.delete(e):s.add(e):(s.clear(),s.add(e)),s}),H(e);},[]);useEffect(()=>{if(!me)return;let e=Array.from(d$1).map(n=>u[n]).filter(Boolean);me(e);},[d$1]);let be=useCallback(e=>{let n=u[e];n&&(n.type==="directory"?$?.(n.path):X$1?.(n));},[u,X$1,$]),Qe=useCallback(e=>{l||e.target.closest("button")||(ee.current=true,te.current={x:e.clientX-x.x,y:e.clientY-x.y},e.preventDefault());},[x,l]);useEffect(()=>{let e=i=>{if(!ee.current)return;let s=window.innerWidth-100,m=window.innerHeight-40;O({x:Ie(i.clientX-te.current.x,0,s),y:Ie(i.clientY-te.current.y,0,m)});},n=()=>{ee.current=false,T.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n);}},[]);let b$1=useCallback((e,n)=>{l||(n.preventDefault(),n.stopPropagation(),T.current=e,P.current={x:n.clientX,y:n.clientY,w:k.width,h:k.height,px:x.x,py:x.y},document.body.style.cursor=e==="e"||e==="w"?"ew-resize":e==="n"||e==="s"?"ns-resize":e==="nw"||e==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[l,k,x]);useEffect(()=>{let e=i=>{if(!T.current)return;let s=T.current,m=i.clientX-P.current.x,N=i.clientY-P.current.y,{w:M,h:D,px:se,py:ae}=P.current;if(s.includes("e")&&(M=Math.max(L.width,M+m)),s.includes("w")){let j=Math.max(L.width,M-m);se=se+(M-j),M=j;}if(s.includes("s")&&(D=Math.max(L.height,D+N)),s.includes("n")){let j=Math.max(L.height,D-N);ae=ae+(D-j),D=j;}Z({width:M,height:D}),O({x:se,y:ae});},n=()=>{T.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n);}},[L]);let ve=useCallback(()=>{l?(h&&(O(h.pos),Z(h.size)),Q(false)):(qe({pos:x,size:k}),Q(true));},[l,x,k,h]),We=useCallback(()=>{R?W(false):(l&&(Q(false),h&&(O(h.pos),Z(h.size))),W(true),pe?.());},[R,l,h,pe]);useEffect(()=>{if(!re||R)return;let e=n=>{if(!(!ne.current?.contains(document.activeElement)&&document.activeElement!==ne.current)){if(n.key==="Escape"&&(H(null),A(new Set)),n.ctrlKey&&n.key==="a"){n.preventDefault();let i=new Set(u.map((s,m)=>m));A(i);}n.key==="Delete"&&d$1.size>0&&U&&(n.preventDefault(),K(true));}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[re,R,u,d$1,U]);let we={"--fe-accent":I};return R?jsx("div",{className:a("fixed z-100 cursor-pointer transition-all duration-300",Be==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:we,onClick:()=>W(false),title:`Restore ${f$1}`,children:jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsx(HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:f$1})]})}):re?jsxs("div",{ref:ne,className:a("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",l&&"rounded-none",Ke),style:{...we,left:l?0:x.x,top:l?0:x.y,width:l?"100vw":k.width,height:l?"100vh":k.height,transition:l?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:Qe,onDoubleClick:ve,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsx(HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:f$1}),jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{className:"fe-btn mr-1",onClick:()=>Oe(e=>e==="list"?"grid":"list"),title:q==="list"?"Grid view":"List view",children:q==="list"?jsx(LayoutGrid,{className:"h-3.5 w-3.5"}):jsx(LayoutList,{className:"h-3.5 w-3.5"})}),je&&jsx("button",{className:"fe-btn",onClick:We,title:"Dock to edge",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn",onClick:ve,title:l?"Restore":"Maximize",children:l?jsx(Minimize2,{className:"h-3.5 w-3.5"}):jsx(Maximize2,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{Ve?.(),Ge(false);},title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsx("button",{className:"fe-btn p-1",onClick:()=>$?.(".."),title:"Go up",children:jsx(FolderUp,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:y==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>Ye(e=>e==="search"?"navigate":"search"),title:y==="search"?"Switch to path navigation":"Switch to file search",children:y==="search"?jsx(Search,{className:"h-3 w-3"}):jsx(CornerRightDown,{className:"h-3 w-3"})}),jsx("div",{className:"relative flex-1",children:jsx("input",{type:"text",value:w,onChange:e=>Pe(e.target.value),onKeyDown:e=>{e.key==="Enter"&&w.trim()&&y==="navigate"&&(xe?xe(w.trim()):$?.(w.trim()));},placeholder:y==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[u.length," item",u.length!==1?"s":"",d$1.size>0&&` \xB7 ${d$1.size} selected`]})]}),jsxs("div",{className:"flex flex-1 min-h-0",children:[jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:e=>{e.target===e.currentTarget&&(A(new Set),H(null));},children:u.length===0?jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsx(Folder,{className:"mb-2 h-10 w-10"}),jsx("span",{className:"text-xs",children:"No files found"})]}):q==="list"?jsx("div",{className:"space-y-px",children:u.map((e,n)=>{let i=fe(e),s=d$1.has(n),m=e.extension||_(e.name);return jsxs("div",{className:a("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",s?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:s?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:N=>he(n,N),onDoubleClick:()=>be(n),children:[jsx(i,{className:a("h-4 w-4 shrink-0",e.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),m&&e.type==="file"&&jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:m}),e.size!=null&&jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:Se(e.size)}),e.modifiedAt&&jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:ue(e.modifiedAt)})]},e.path+n)})}):jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:u.map((e,n)=>{let i=fe(e),s=d$1.has(n),m=e.extension||_(e.name);return jsxs("div",{className:a("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",s?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:N=>he(n,N),onDoubleClick:()=>be(n),children:[jsx(i,{className:a("h-7 w-7",e.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:e.name}),m&&e.type==="file"&&jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:m})]},e.path+n)})})}),jsx("div",{className:a("shrink-0 overflow-hidden transition-[width] duration-300 ease-out",a$3?"w-56":"w-0"),children:a$3&&jsxs("div",{className:"fe-panel flex h-full w-56 flex-col border-l border-(--fe-border) p-4",children:[jsxs("div",{className:"mb-3 flex flex-col items-center",children:[ze.createElement(fe(a$3),{className:a("h-10 w-10 mb-2",a$3.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:a$3.name})]}),jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsx(S,{label:"Type",value:a$3.type==="directory"?"Directory":a$3.mimeType||a$3.extension||_(a$3.name)||"File"}),a$3.size!=null&&jsx(S,{label:"Size",value:Se(a$3.size)}),jsx(S,{label:"Path",value:a$3.path,mono:true}),a$3.extension&&jsx(S,{label:"Extension",value:a$3.extension}),a$3.modifiedAt&&jsx(S,{label:"Modified",value:ue(a$3.modifiedAt)}),a$3.createdAt&&jsx(S,{label:"Created",value:ue(a$3.createdAt)})]}),jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[a$3.type==="file"&&X$1&&jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>X$1(a$3),children:[jsx(ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),$e?.map(e=>jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>e.onClick(a$3),children:[e.icon&&ze.createElement(e.icon,{className:"h-3 w-3"}),e.label]},e.key))]})]})})]}),jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxs("span",{children:[u.length," items"]}),jsxs("div",{className:"flex items-center gap-2",children:[d$1.size>0&&jsxs("span",{className:"text-(--fe-accent)/70",children:[d$1.size," selected"]}),jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),He&&!l&&jsxs(Fragment,{children:[jsx("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>b$1("n",e)}),jsx("div",{className:"absolute bottom-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>b$1("s",e)}),jsx("div",{className:"absolute top-2 left-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>b$1("w",e)}),jsx("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>b$1("e",e)}),jsx("div",{className:"absolute top-0 left-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>b$1("nw",e)}),jsx("div",{className:"absolute top-0 right-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>b$1("ne",e)}),jsx("div",{className:"absolute bottom-0 left-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>b$1("sw",e)}),jsx("div",{className:"absolute bottom-0 right-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>b$1("se",e)})]}),jsx("style",{children:`
1
+ import {a as a$1,b,c,d,e,f}from'./chunk-VHOOZBWZ.js';import {a as a$2}from'./chunk-7DM4FEFY.js';import {a}from'./chunk-AXBJKPZZ.js';import ze,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {HardDrive,LayoutGrid,LayoutList,Minus,Minimize2,Maximize2,X,FolderUp,Search,CornerRightDown,Folder,ArrowUp,AlertTriangle,Trash2,FileArchive,Database,FileSpreadsheet,FileText,Terminal,FileCode,Video,Music,Image,File}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function _(o){let f=o.lastIndexOf(".");return f>0?o.slice(f).toLowerCase():""}function Se(o){return o==null?"\u2014":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:o<1024*1024*1024?`${(o/(1024*1024)).toFixed(1)} MB`:`${(o/(1024*1024*1024)).toFixed(2)} GB`}function ue(o){return o?(typeof o=="string"?new Date(o):o).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var ut={".png":Image,".jpg":Image,".jpeg":Image,".gif":Image,".svg":Image,".webp":Image,".ico":Image,".bmp":Image,".mp3":Music,".wav":Music,".flac":Music,".ogg":Music,".aac":Music,".m4a":Music,".mp4":Video,".mkv":Video,".avi":Video,".mov":Video,".wmv":Video,".webm":Video,".ts":FileCode,".tsx":FileCode,".js":FileCode,".jsx":FileCode,".json":FileCode,".html":FileCode,".css":FileCode,".scss":FileCode,".py":FileCode,".rs":FileCode,".go":FileCode,".java":FileCode,".c":FileCode,".cpp":FileCode,".h":FileCode,".sh":Terminal,".bat":Terminal,".ps1":Terminal,".md":FileText,".txt":FileText,".pdf":FileText,".doc":FileText,".docx":FileText,".rtf":FileText,".csv":FileSpreadsheet,".xls":FileSpreadsheet,".xlsx":FileSpreadsheet,".db":Database,".sqlite":Database,".sql":Database,".zip":FileArchive,".tar":FileArchive,".gz":FileArchive,".rar":FileArchive,".7z":FileArchive};function fe(o){if(o.type==="directory")return Folder;let f=o.extension||_(o.name);return ut[f]||File}function Ie(o,f,I){return Math.max(f,Math.min(I,o))}function yt({files:o,title:f$1="File Explorer",accent:I="#8b5cf6",defaultView:Ae="list",initialPosition:Re,initialSize:Te,dockable:je=false,dockSide:Be="right",visible:G=true,onFileOpen:X$1,onSelectionChange:me,onNavigate:$,onDelete:U,onClose:Ve,onMinimize:pe,onPathSubmit:xe,defaultInputMode:Xe="search",actions:$e,resizable:He=true,minSize:L={width:400,height:300},className:Ke}){let[q,Oe]=useState(Ae),[d$1,A]=useState(new Set),[ge,H]=useState(null),[l,Q]=useState(false),[R,W]=useState(false),[w,Pe]=useState(""),[y,Ye]=useState(Xe),[_e,Ge]=useState(G),[Ue,K]=useState(false),J=Te??{width:720,height:520},[x,O]=useState(Re??{x:Math.max(0,Math.round((window.innerWidth-J.width)/2)),y:Math.max(0,Math.round((window.innerHeight-J.height)/2))}),[k,Z]=useState(J),[h,qe]=useState(null),ee=useRef(false),te=useRef({x:0,y:0}),ne=useRef(null),T=useRef(false),P=useRef({x:0,y:0,w:0,h:0,px:0,py:0}),re=G!==void 0?G:_e,oe=useMemo(()=>{let e=o.filter(i=>i.type==="directory"),n=o.filter(i=>i.type==="file");return e.sort((i,s)=>i.name.localeCompare(s.name)),n.sort((i,s)=>i.name.localeCompare(s.name)),[...e,...n]},[o]),u=useMemo(()=>{if(y!=="search"||!w.trim())return oe;let e=w.toLowerCase();return oe.filter(n=>n.name.toLowerCase().includes(e))},[oe,w,y]),a$3=ge!=null?u[ge]:null,he=useCallback((e,n)=>{A(i=>{let s=new Set(i);return n.ctrlKey||n.metaKey?s.has(e)?s.delete(e):s.add(e):(s.clear(),s.add(e)),s}),H(e);},[]);useEffect(()=>{if(!me)return;let e=Array.from(d$1).map(n=>u[n]).filter(Boolean);me(e);},[d$1]);let be=useCallback(e=>{let n=u[e];n&&(n.type==="directory"?$?.(n.path):X$1?.(n));},[u,X$1,$]),Qe=useCallback(e=>{l||e.target.closest("button")||(ee.current=true,te.current={x:e.clientX-x.x,y:e.clientY-x.y},e.preventDefault());},[x,l]);useEffect(()=>{let e=i=>{if(!ee.current)return;let s=window.innerWidth-100,m=window.innerHeight-40;O({x:Ie(i.clientX-te.current.x,0,s),y:Ie(i.clientY-te.current.y,0,m)});},n=()=>{ee.current=false,T.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n);}},[]);let b$1=useCallback((e,n)=>{l||(n.preventDefault(),n.stopPropagation(),T.current=e,P.current={x:n.clientX,y:n.clientY,w:k.width,h:k.height,px:x.x,py:x.y},document.body.style.cursor=e==="e"||e==="w"?"ew-resize":e==="n"||e==="s"?"ns-resize":e==="nw"||e==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[l,k,x]);useEffect(()=>{let e=i=>{if(!T.current)return;let s=T.current,m=i.clientX-P.current.x,N=i.clientY-P.current.y,{w:M,h:D,px:se,py:ae}=P.current;if(s.includes("e")&&(M=Math.max(L.width,M+m)),s.includes("w")){let j=Math.max(L.width,M-m);se=se+(M-j),M=j;}if(s.includes("s")&&(D=Math.max(L.height,D+N)),s.includes("n")){let j=Math.max(L.height,D-N);ae=ae+(D-j),D=j;}Z({width:M,height:D}),O({x:se,y:ae});},n=()=>{T.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n);}},[L]);let ve=useCallback(()=>{l?(h&&(O(h.pos),Z(h.size)),Q(false)):(qe({pos:x,size:k}),Q(true));},[l,x,k,h]),We=useCallback(()=>{R?W(false):(l&&(Q(false),h&&(O(h.pos),Z(h.size))),W(true),pe?.());},[R,l,h,pe]);useEffect(()=>{if(!re||R)return;let e=n=>{if(!(!ne.current?.contains(document.activeElement)&&document.activeElement!==ne.current)){if(n.key==="Escape"&&(H(null),A(new Set)),n.ctrlKey&&n.key==="a"){n.preventDefault();let i=new Set(u.map((s,m)=>m));A(i);}n.key==="Delete"&&d$1.size>0&&U&&(n.preventDefault(),K(true));}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[re,R,u,d$1,U]);let we={"--fe-accent":I};return R?jsx("div",{className:a("fixed z-100 cursor-pointer transition-all duration-300",Be==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:we,onClick:()=>W(false),title:`Restore ${f$1}`,children:jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsx(HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:f$1})]})}):re?jsxs("div",{ref:ne,className:a("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",l&&"rounded-none",Ke),style:{...we,left:l?0:x.x,top:l?0:x.y,width:l?"100vw":k.width,height:l?"100vh":k.height,transition:l?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:Qe,onDoubleClick:ve,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsx(HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:f$1}),jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{className:"fe-btn mr-1",onClick:()=>Oe(e=>e==="list"?"grid":"list"),title:q==="list"?"Grid view":"List view",children:q==="list"?jsx(LayoutGrid,{className:"h-3.5 w-3.5"}):jsx(LayoutList,{className:"h-3.5 w-3.5"})}),je&&jsx("button",{className:"fe-btn",onClick:We,title:"Dock to edge",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn",onClick:ve,title:l?"Restore":"Maximize",children:l?jsx(Minimize2,{className:"h-3.5 w-3.5"}):jsx(Maximize2,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{Ve?.(),Ge(false);},title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsx("button",{className:"fe-btn p-1",onClick:()=>$?.(".."),title:"Go up",children:jsx(FolderUp,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:y==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>Ye(e=>e==="search"?"navigate":"search"),title:y==="search"?"Switch to path navigation":"Switch to file search",children:y==="search"?jsx(Search,{className:"h-3 w-3"}):jsx(CornerRightDown,{className:"h-3 w-3"})}),jsx("div",{className:"relative flex-1",children:jsx("input",{type:"text",value:w,onChange:e=>Pe(e.target.value),onKeyDown:e=>{e.key==="Enter"&&w.trim()&&y==="navigate"&&(xe?xe(w.trim()):$?.(w.trim()));},placeholder:y==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[u.length," item",u.length!==1?"s":"",d$1.size>0&&` \xB7 ${d$1.size} selected`]})]}),jsxs("div",{className:"flex flex-1 min-h-0",children:[jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:e=>{e.target===e.currentTarget&&(A(new Set),H(null));},children:u.length===0?jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsx(Folder,{className:"mb-2 h-10 w-10"}),jsx("span",{className:"text-xs",children:"No files found"})]}):q==="list"?jsx("div",{className:"space-y-px",children:u.map((e,n)=>{let i=fe(e),s=d$1.has(n),m=e.extension||_(e.name);return jsxs("div",{className:a("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",s?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:s?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:N=>he(n,N),onDoubleClick:()=>be(n),children:[jsx(i,{className:a("h-4 w-4 shrink-0",e.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),m&&e.type==="file"&&jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:m}),e.size!=null&&jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:Se(e.size)}),e.modifiedAt&&jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:ue(e.modifiedAt)})]},e.path+n)})}):jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:u.map((e,n)=>{let i=fe(e),s=d$1.has(n),m=e.extension||_(e.name);return jsxs("div",{className:a("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",s?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:N=>he(n,N),onDoubleClick:()=>be(n),children:[jsx(i,{className:a("h-7 w-7",e.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:e.name}),m&&e.type==="file"&&jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:m})]},e.path+n)})})}),jsx("div",{className:a("shrink-0 overflow-hidden transition-[width] duration-300 ease-out",a$3?"w-56":"w-0"),children:a$3&&jsxs("div",{className:"fe-panel flex h-full w-56 flex-col border-l border-(--fe-border) p-4",children:[jsxs("div",{className:"mb-3 flex flex-col items-center",children:[ze.createElement(fe(a$3),{className:a("h-10 w-10 mb-2",a$3.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:a$3.name})]}),jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsx(S,{label:"Type",value:a$3.type==="directory"?"Directory":a$3.mimeType||a$3.extension||_(a$3.name)||"File"}),a$3.size!=null&&jsx(S,{label:"Size",value:Se(a$3.size)}),jsx(S,{label:"Path",value:a$3.path,mono:true}),a$3.extension&&jsx(S,{label:"Extension",value:a$3.extension}),a$3.modifiedAt&&jsx(S,{label:"Modified",value:ue(a$3.modifiedAt)}),a$3.createdAt&&jsx(S,{label:"Created",value:ue(a$3.createdAt)})]}),jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[a$3.type==="file"&&X$1&&jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>X$1(a$3),children:[jsx(ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),$e?.map(e=>jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>e.onClick(a$3),children:[e.icon&&ze.createElement(e.icon,{className:"h-3 w-3"}),e.label]},e.key))]})]})})]}),jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxs("span",{children:[u.length," items"]}),jsxs("div",{className:"flex items-center gap-2",children:[d$1.size>0&&jsxs("span",{className:"text-(--fe-accent)/70",children:[d$1.size," selected"]}),jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),He&&!l&&jsxs(Fragment,{children:[jsx("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>b$1("n",e)}),jsx("div",{className:"absolute bottom-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>b$1("s",e)}),jsx("div",{className:"absolute top-2 left-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>b$1("w",e)}),jsx("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>b$1("e",e)}),jsx("div",{className:"absolute top-0 left-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>b$1("nw",e)}),jsx("div",{className:"absolute top-0 right-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>b$1("ne",e)}),jsx("div",{className:"absolute bottom-0 left-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>b$1("sw",e)}),jsx("div",{className:"absolute bottom-0 right-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>b$1("se",e)})]}),jsx("style",{children:`
2
2
  .fe-window {
3
3
  background: var(--fe-bg);
4
4
  box-shadow: var(--fe-shadow);
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-ACQOSYBI.js';import {a}from'./chunk-AXBJKPZZ.js';import {jsx}from'react/jsx-runtime';function m({intent:r,size:n,className:p,...a$2}){return jsx("button",{className:a(a$1({intent:r,size:n}),p),...a$2})}export{m as a};
1
+ import {a as a$1}from'./chunk-H6MHL66N.js';import {a}from'./chunk-AXBJKPZZ.js';import {jsx}from'react/jsx-runtime';function m({intent:r,size:n,className:p,...a$2}){return jsx("button",{className:a(a$1({intent:r,size:n}),p),...a$2})}export{m as a};
@@ -1 +1 @@
1
- 'use strict';var chunkNBLJWONR_cjs=require('./chunk-NBLJWONR.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),S=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var S__default=/*#__PURE__*/_interopDefault(S);function z(c,a){return c.key??(typeof c.label=="string"?c.label:String(a))}function X({label:c,items:a,intent:T,size:A,align:B="left",className:F,disabled:g,editable:u=false,onAddItem:w,multiple:n=false,selected:s=[],onSelectionChange:N,...H}){let[i,f]=S.useState(false),[l,p]=S.useState(""),v=S.useRef(null),E=S.useRef(null),K=S.useCallback(()=>{g||f(e=>{let t=!e;return t&&u&&requestAnimationFrame(()=>E.current?.focus()),t||p(""),t});},[g,u]);S.useEffect(()=>{if(!i)return;let e=t=>{v.current&&!v.current.contains(t.target)&&(f(false),p(""));};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),S.useEffect(()=>{if(!i)return;let e=t=>{t.key==="Escape"&&(f(false),p(""));};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let b=l.toLowerCase(),L=S.useMemo(()=>l?a.filter(e=>(typeof e.label=="string"?e.label:e.key??"").toLowerCase().includes(b)):a,[a,b]),y=S.useMemo(()=>!u||!l.trim()?false:!a.some(e=>(typeof e.label=="string"?e.label:e.key??"").toLowerCase()===b),[u,b,a]),h=S.useCallback(()=>{let e=l.trim();e&&(w?.(e),p(""));},[l,w]),P=S.useCallback(e=>{e.key==="Enter"&&y&&(e.preventDefault(),h());},[y,h]),V=S.useCallback(e=>{let t=s.includes(e)?s.filter(m=>m!==e):[...s,e];N?.(t);},[s,N]),q=n&&s.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c," ",jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-white/20 px-1.5 text-xs font-semibold",children:s.length})]}):c;return jsxRuntime.jsxs("div",{ref:v,className:"relative inline-block",children:[jsxRuntime.jsxs("button",{type:"button",onClick:K,disabled:g,className:chunkX5YP5TMY_cjs.a(chunkNBLJWONR_cjs.a({intent:T,size:A}),"inline-flex items-center gap-1",F),"aria-haspopup":n?"listbox":"true","aria-expanded":i?"true":"false",...H,children:[q,jsxRuntime.jsx(lucideReact.ChevronDown,{className:chunkX5YP5TMY_cjs.a("h-3.5 w-3.5 transition-transform",i&&"rotate-180")})]}),i&&jsxRuntime.jsxs("div",{className:chunkX5YP5TMY_cjs.a("absolute z-50 mt-1 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white","animate-fade-in",B==="right"?"right-0":"left-0"),role:n?"listbox":"menu","aria-multiselectable":n||void 0,children:[u&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 border-b px-2 pb-1.5 pt-1",children:jsxRuntime.jsx("input",{ref:E,type:"text",value:l,onChange:e=>p(e.target.value),onKeyDown:P,placeholder:"Type to filter or add\u2026",className:"w-full bg-transparent text-sm text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600"})}),jsxRuntime.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[L.map((e,t)=>{let m=z(e,t),k=n&&s.includes(m);return jsxRuntime.jsxs(S__default.default.Fragment,{children:[e.divider&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 my-1 border-t"}),jsxRuntime.jsxs("button",{type:"button",role:n?"option":"menuitem","aria-selected":n?k:void 0,disabled:e.disabled,className:chunkX5YP5TMY_cjs.a("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",e.disabled&&"pointer-events-none opacity-50"),onClick:()=>{n?V(m):(e.onClick?.(),f(false),p(""));},children:[n&&jsxRuntime.jsx("span",{className:chunkX5YP5TMY_cjs.a("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",k?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:k&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:e.label})]})]},m)}),L.length===0&&!y&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",children:"No matches"}),y&&jsxRuntime.jsxs("button",{type:"button",className:chunkX5YP5TMY_cjs.a("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),onClick:h,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",l.trim(),"\u201D"]})]})]})]})]})}exports.a=X;
1
+ 'use strict';var chunkNYTZZ5ZX_cjs=require('./chunk-NYTZZ5ZX.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),S=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var S__default=/*#__PURE__*/_interopDefault(S);function z(c,a){return c.key??(typeof c.label=="string"?c.label:String(a))}function X({label:c,items:a,intent:T,size:A,align:B="left",className:F,disabled:g,editable:u=false,onAddItem:w,multiple:n=false,selected:s=[],onSelectionChange:N,...H}){let[i,f]=S.useState(false),[l,p]=S.useState(""),v=S.useRef(null),E=S.useRef(null),K=S.useCallback(()=>{g||f(e=>{let t=!e;return t&&u&&requestAnimationFrame(()=>E.current?.focus()),t||p(""),t});},[g,u]);S.useEffect(()=>{if(!i)return;let e=t=>{v.current&&!v.current.contains(t.target)&&(f(false),p(""));};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),S.useEffect(()=>{if(!i)return;let e=t=>{t.key==="Escape"&&(f(false),p(""));};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let b=l.toLowerCase(),L=S.useMemo(()=>l?a.filter(e=>(typeof e.label=="string"?e.label:e.key??"").toLowerCase().includes(b)):a,[a,b]),y=S.useMemo(()=>!u||!l.trim()?false:!a.some(e=>(typeof e.label=="string"?e.label:e.key??"").toLowerCase()===b),[u,b,a]),h=S.useCallback(()=>{let e=l.trim();e&&(w?.(e),p(""));},[l,w]),P=S.useCallback(e=>{e.key==="Enter"&&y&&(e.preventDefault(),h());},[y,h]),V=S.useCallback(e=>{let t=s.includes(e)?s.filter(m=>m!==e):[...s,e];N?.(t);},[s,N]),q=n&&s.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c," ",jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-white/20 px-1.5 text-xs font-semibold",children:s.length})]}):c;return jsxRuntime.jsxs("div",{ref:v,className:"relative inline-block",children:[jsxRuntime.jsxs("button",{type:"button",onClick:K,disabled:g,className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.a({intent:T,size:A}),"inline-flex items-center gap-1",F),"aria-haspopup":n?"listbox":"true","aria-expanded":i?"true":"false",...H,children:[q,jsxRuntime.jsx(lucideReact.ChevronDown,{className:chunkX5YP5TMY_cjs.a("h-3.5 w-3.5 transition-transform",i&&"rotate-180")})]}),i&&jsxRuntime.jsxs("div",{className:chunkX5YP5TMY_cjs.a("absolute z-50 mt-1 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white","animate-fade-in",B==="right"?"right-0":"left-0"),role:n?"listbox":"menu","aria-multiselectable":n||void 0,children:[u&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 border-b px-2 pb-1.5 pt-1",children:jsxRuntime.jsx("input",{ref:E,type:"text",value:l,onChange:e=>p(e.target.value),onKeyDown:P,placeholder:"Type to filter or add\u2026",className:"w-full bg-transparent text-sm text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600"})}),jsxRuntime.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[L.map((e,t)=>{let m=z(e,t),k=n&&s.includes(m);return jsxRuntime.jsxs(S__default.default.Fragment,{children:[e.divider&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 my-1 border-t"}),jsxRuntime.jsxs("button",{type:"button",role:n?"option":"menuitem","aria-selected":n?k:void 0,disabled:e.disabled,className:chunkX5YP5TMY_cjs.a("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",e.disabled&&"pointer-events-none opacity-50"),onClick:()=>{n?V(m):(e.onClick?.(),f(false),p(""));},children:[n&&jsxRuntime.jsx("span",{className:chunkX5YP5TMY_cjs.a("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",k?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:k&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:e.label})]})]},m)}),L.length===0&&!y&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",children:"No matches"}),y&&jsxRuntime.jsxs("button",{type:"button",className:chunkX5YP5TMY_cjs.a("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),onClick:h,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",l.trim(),"\u201D"]})]})]})]})]})}exports.a=X;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),m=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);var C=m.createContext({showLines:true,expandedKeys:null,onToggleKey:()=>{}});function A({showLines:i=true,showRoot:r=true,expandedKeys:e,defaultExpandedKeys:f="all",onExpandedKeysChange:g,className:p,children:c,...u}){let [x,y]=m.useState(()=>f),R=m.useCallback(s=>{if(e){let t=new Set(e);t.has(s)?t.delete(s):t.add(s),g?.(t);}else y(t=>{if(t==="all")return new Set(["__ALL_MINUS__",s]);let a=new Set(t);return a.has(s)?a.delete(s):a.add(s),a});},[e,g]),N=e??(x==="all"?null:x);return jsxRuntime.jsx(C.Provider,{value:{showLines:i,expandedKeys:N,onToggleKey:R},children:r?jsxRuntime.jsx("ul",{className:chunkX5YP5TMY_cjs.a("text-sm",p),role:"tree",...u,children:c}):jsxRuntime.jsx("ul",{className:chunkX5YP5TMY_cjs.a("text-sm",p),role:"tree",...u,children:jsxRuntime.jsx(I,{children:c})})})}function I({children:i}){let r=w(i);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:r.map(e=>m__default.default.isValidElement(e)&&e.props.children?e.props.children:null)})}function w(i){let r=[];return m__default.default.Children.forEach(i,e=>{m__default.default.isValidElement(e)&&e.type===m__default.default.Fragment?r.push(...w(e.props.children)):r.push(e);}),r}function U({nodeKey:i,label:r,icon:e,actions:f,defaultExpanded:g=false,expanded:p,onToggle:c,children:u,className:x}){let{showLines:y,expandedKeys:d,onToggleKey:R}=m.useContext(C),[N,s]=m.useState(g),t=m__default.default.Children.count(u)>0,a=i??(typeof r=="string"?r:""),o;p!=null?o=p:d!=null&&a?d.has("__ALL_MINUS__")?o=!d.has(a):o=d.has(a):o=N;let b=()=>{let h=!o;c?c(h):d!=null&&a?R(a):s(h);};return jsxRuntime.jsxs("li",{className:chunkX5YP5TMY_cjs.a("select-none",x),role:"treeitem","aria-expanded":t?o:void 0,children:[jsxRuntime.jsxs("div",{className:chunkX5YP5TMY_cjs.a("group hover:bg-primary-50 dark:hover:bg-primary-800/50 flex items-center gap-1 rounded-md px-1 py-1",t?"cursor-pointer":"cursor-default"),onClick:t?b:void 0,children:[t?jsxRuntime.jsx(lucideReact.ChevronRight,{className:chunkX5YP5TMY_cjs.a("text-primary-400 h-4 w-4 shrink-0 transition-transform duration-200",o&&"rotate-90")}):jsxRuntime.jsx("span",{className:"w-4 shrink-0"}),e&&jsxRuntime.jsx("span",{className:"shrink-0",children:e}),jsxRuntime.jsx("span",{className:"text-primary-700 dark:text-primary-300 min-w-0 flex-1 truncate",children:r}),f&&jsxRuntime.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",onClick:h=>h.stopPropagation(),children:f})]}),t&&jsxRuntime.jsx("div",{className:chunkX5YP5TMY_cjs.a("grid transition-[grid-template-rows] duration-200 ease-out",o?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("ul",{className:chunkX5YP5TMY_cjs.a("ml-4 pl-2",y&&"border-primary-200 dark:border-primary-700 border-l"),role:"group",children:u})})})]})}exports.a=A;exports.b=U;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkNYTZZ5ZX_cjs=require('./chunk-NYTZZ5ZX.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function L({value:i=0,size:a,intent:l,edge:u,showLabel:m=false,indeterminate:e=false,animated:p=false,duration:f=500,className:d,...c}){let r=Math.max(0,Math.min(100,i)),[h,b]=react.useState(0),s=react.useRef(0);react.useEffect(()=>{if(!e)return s.current=requestAnimationFrame(()=>{b(r);}),()=>{s.current&&cancelAnimationFrame(s.current);}},[r,e]);let g=m&&!e&&a!=="xs"&&a!=="sm";return jsxRuntime.jsx("div",{role:"progressbar","aria-valuenow":e?void 0:r,"aria-valuemin":0,"aria-valuemax":100,className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.p({size:a,intent:l,edge:u}),d),...c,children:e?jsxRuntime.jsx("div",{className:"progress-fill absolute top-0 h-full rounded-full animate-progress-indeterminate"}):jsxRuntime.jsx("div",{className:chunkX5YP5TMY_cjs.a("progress-fill h-full rounded-full transition-[width] ease-out",p&&"animate-progress-shine"),style:{width:`${h}%`,transitionDuration:`${f}ms`},children:g&&jsxRuntime.jsxs("span",{className:"flex h-full items-center justify-end pr-2 text-[10px] font-semibold text-white",children:[Math.round(r),"%"]})})})}exports.a=L;
@@ -1 +1 @@
1
- 'use strict';var chunkNBLJWONR_cjs=require('./chunk-NBLJWONR.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),jsxRuntime=require('react/jsx-runtime');function m({intent:t,size:e,className:o,...l}){return jsxRuntime.jsx("label",{className:chunkX5YP5TMY_cjs.a(chunkNBLJWONR_cjs.d({intent:t,size:e}),o),...l})}exports.a=m;
1
+ 'use strict';var chunkNYTZZ5ZX_cjs=require('./chunk-NYTZZ5ZX.cjs'),chunkX5YP5TMY_cjs=require('./chunk-X5YP5TMY.cjs'),jsxRuntime=require('react/jsx-runtime');function m({intent:t,size:e,className:o,...l}){return jsxRuntime.jsx("label",{className:chunkX5YP5TMY_cjs.a(chunkNYTZZ5ZX_cjs.d({intent:t,size:e}),o),...l})}exports.a=m;
@@ -1 +1 @@
1
- import {j,k as k$1}from'./chunk-ACQOSYBI.js';import {a}from'./chunk-AXBJKPZZ.js';import L,{createContext,useState,useRef,useCallback,useContext,useLayoutEffect,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';var b=createContext(null),y=createContext(false);function N({defaultValue:i="",value:a,onValueChange:t,intent:e,children:n,className:s}){let[r,o]=useState(i),T=a??r,u=useRef(new Map),f=useCallback(c=>{t?t(c):o(c);},[t]),p=useCallback((c,m)=>{m?u.current.set(c,m):u.current.delete(c);},[]);return jsx(b.Provider,{value:{activeValue:T,setActiveValue:f,intent:e,registerTrigger:p},children:jsx("div",{className:s,children:n})})}function B({className:i,...a$1}){let t=useContext(b),e=useRef(null),[n,s]=useState(null),r=useCallback(()=>{if(!t||!e.current)return;let f=e.current.querySelectorAll('[role="tab"][data-active="true"]')[0];if(!f){s(null);return}let p=e.current.getBoundingClientRect(),c=f.getBoundingClientRect();s({left:c.left-p.left,width:c.width});},[t]);useLayoutEffect(r,[t?.activeValue,r]),useEffect(()=>{let u=new ResizeObserver(r);return e.current&&u.observe(e.current),()=>u.disconnect()},[r]);let o=t?.intent??"line",T=n&&(o==="line"||o==="underline");return jsxs("div",{ref:e,className:a(j({intent:t?.intent}),"relative",i),role:"tablist",...a$1,children:[a$1.children,T&&jsx("span",{className:"absolute bottom-0 h-0.5 rounded-full bg-primary-600 dark:bg-primary-400 transition-all duration-300 ease-in-out",style:{left:n.left,width:n.width},"aria-hidden":true})]})}function I({value:i,className:a$1,children:t,...e}){let n=useContext(b),s=n?.activeValue===i,r=useCallback(o=>n?.registerTrigger(i,o),[n,i]);return jsx("button",{ref:r,className:a(k$1({intent:n?.intent}),a$1),role:"tab","data-active":s,"aria-selected":s,onClick:()=>n?.setActiveValue(i),...e,children:t})}function k({className:i,children:a$1,...t}){let e=useContext(b);if(!e)return null;let n=L.Children.toArray(a$1).filter(r=>L.isValidElement(r)),s=Math.max(0,n.findIndex(r=>r.props.value===e.activeValue));return jsx("div",{className:a("overflow-hidden",i),...t,children:jsx(y.Provider,{value:true,children:jsx("div",{className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(-${s*100}%)`},children:n.map((r,o)=>jsx("div",{className:"w-full shrink-0","aria-hidden":o!==s,children:r},r.props.value??o))})})})}function D({value:i,className:a$1,children:t,...e}){let n=useContext(b);return useContext(y)?jsx("div",{className:a("pt-4",a$1),role:"tabpanel",...e,children:t}):n?.activeValue!==i?null:jsx("div",{className:a("pt-4",a$1),role:"tabpanel",...e,children:t})}export{N as a,B as b,I as c,k as d,D as e};
1
+ import {j,k as k$1}from'./chunk-H6MHL66N.js';import {a}from'./chunk-AXBJKPZZ.js';import L,{createContext,useState,useRef,useCallback,useContext,useLayoutEffect,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';var b=createContext(null),y=createContext(false);function N({defaultValue:i="",value:a,onValueChange:t,intent:e,children:n,className:s}){let[r,o]=useState(i),T=a??r,u=useRef(new Map),f=useCallback(c=>{t?t(c):o(c);},[t]),p=useCallback((c,m)=>{m?u.current.set(c,m):u.current.delete(c);},[]);return jsx(b.Provider,{value:{activeValue:T,setActiveValue:f,intent:e,registerTrigger:p},children:jsx("div",{className:s,children:n})})}function B({className:i,...a$1}){let t=useContext(b),e=useRef(null),[n,s]=useState(null),r=useCallback(()=>{if(!t||!e.current)return;let f=e.current.querySelectorAll('[role="tab"][data-active="true"]')[0];if(!f){s(null);return}let p=e.current.getBoundingClientRect(),c=f.getBoundingClientRect();s({left:c.left-p.left,width:c.width});},[t]);useLayoutEffect(r,[t?.activeValue,r]),useEffect(()=>{let u=new ResizeObserver(r);return e.current&&u.observe(e.current),()=>u.disconnect()},[r]);let o=t?.intent??"line",T=n&&(o==="line"||o==="underline");return jsxs("div",{ref:e,className:a(j({intent:t?.intent}),"relative",i),role:"tablist",...a$1,children:[a$1.children,T&&jsx("span",{className:"absolute bottom-0 h-0.5 rounded-full bg-primary-600 dark:bg-primary-400 transition-all duration-300 ease-in-out",style:{left:n.left,width:n.width},"aria-hidden":true})]})}function I({value:i,className:a$1,children:t,...e}){let n=useContext(b),s=n?.activeValue===i,r=useCallback(o=>n?.registerTrigger(i,o),[n,i]);return jsx("button",{ref:r,className:a(k$1({intent:n?.intent}),a$1),role:"tab","data-active":s,"aria-selected":s,onClick:()=>n?.setActiveValue(i),...e,children:t})}function k({className:i,children:a$1,...t}){let e=useContext(b);if(!e)return null;let n=L.Children.toArray(a$1).filter(r=>L.isValidElement(r)),s=Math.max(0,n.findIndex(r=>r.props.value===e.activeValue));return jsx("div",{className:a("overflow-hidden",i),...t,children:jsx(y.Provider,{value:true,children:jsx("div",{className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(-${s*100}%)`},children:n.map((r,o)=>jsx("div",{className:"w-full shrink-0","aria-hidden":o!==s,children:r},r.props.value??o))})})})}function D({value:i,className:a$1,children:t,...e}){let n=useContext(b);return useContext(y)?jsx("div",{className:a("pt-4",a$1),role:"tabpanel",...e,children:t}):n?.activeValue!==i?null:jsx("div",{className:a("pt-4",a$1),role:"tabpanel",...e,children:t})}export{N as a,B as b,I as c,k as d,D as e};
@@ -1 +1 @@
1
- import {f}from'./chunk-ACQOSYBI.js';import {a}from'./chunk-AXBJKPZZ.js';import {jsx}from'react/jsx-runtime';function s({intent:t,size:r,className:n,...o}){return jsx("div",{className:a(f({intent:t,size:r}),n),...o})}function l({className:t,...r}){return jsx("div",{className:a("border-primary-200 text-primary-900 dark:border-primary-700 dark:text-primary-100 mb-3 flex items-center gap-1.5 border-b pb-3 text-sm font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...r})}function c({className:t,...r}){return jsx("div",{className:a("text-primary-700 dark:text-primary-300 text-sm",t),...r})}export{s as a,l as b,c};
1
+ import {f}from'./chunk-H6MHL66N.js';import {a}from'./chunk-AXBJKPZZ.js';import {jsx}from'react/jsx-runtime';function s({intent:t,size:r,className:n,...o}){return jsx("div",{className:a(f({intent:t,size:r}),n),...o})}function l({className:t,...r}){return jsx("div",{className:a("border-primary-200 text-primary-900 dark:border-primary-700 dark:text-primary-100 mb-3 flex items-center gap-1.5 border-b pb-3 text-sm font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...r})}function c({className:t,...r}){return jsx("div",{className:a("text-primary-700 dark:text-primary-300 text-sm",t),...r})}export{s as a,l as b,c};