@nofinite/nui 1.0.2 → 1.1.0

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 (359) hide show
  1. package/dist/CHANGELOG.md +19 -0
  2. package/dist/LICENSE +201 -0
  3. package/dist/README.md +48 -0
  4. package/dist/dist/components/select/Select.cjs +2 -0
  5. package/dist/dist/components/select/Select.cjs.map +1 -0
  6. package/dist/dist/components/select/Select.js +165 -0
  7. package/dist/dist/components/select/Select.js.map +1 -0
  8. package/dist/dist/index.cjs +2 -0
  9. package/dist/dist/index.js +111 -0
  10. package/dist/{index.js.map → dist/index.js.map} +1 -1
  11. package/dist/{styles → dist/styles}/index.css +1 -1
  12. package/dist/{types → dist/types}/index.d.ts +1 -0
  13. package/dist/dist/types/index.d.ts.map +1 -0
  14. package/dist/package.json +33 -0
  15. package/package.json +33 -33
  16. package/dist/index.cjs +0 -2
  17. package/dist/index.js +0 -109
  18. package/dist/types/index.d.ts.map +0 -1
  19. /package/dist/{components → dist/components}/accordion/Accordion.cjs +0 -0
  20. /package/dist/{components → dist/components}/accordion/Accordion.cjs.map +0 -0
  21. /package/dist/{components → dist/components}/accordion/Accordion.js +0 -0
  22. /package/dist/{components → dist/components}/accordion/Accordion.js.map +0 -0
  23. /package/dist/{components → dist/components}/alert/Alert.cjs +0 -0
  24. /package/dist/{components → dist/components}/alert/Alert.cjs.map +0 -0
  25. /package/dist/{components → dist/components}/alert/Alert.js +0 -0
  26. /package/dist/{components → dist/components}/alert/Alert.js.map +0 -0
  27. /package/dist/{components → dist/components}/avatar/Avatar.cjs +0 -0
  28. /package/dist/{components → dist/components}/avatar/Avatar.cjs.map +0 -0
  29. /package/dist/{components → dist/components}/avatar/Avatar.js +0 -0
  30. /package/dist/{components → dist/components}/avatar/Avatar.js.map +0 -0
  31. /package/dist/{components → dist/components}/avatar/AvatarGroup.cjs +0 -0
  32. /package/dist/{components → dist/components}/avatar/AvatarGroup.cjs.map +0 -0
  33. /package/dist/{components → dist/components}/avatar/AvatarGroup.js +0 -0
  34. /package/dist/{components → dist/components}/avatar/AvatarGroup.js.map +0 -0
  35. /package/dist/{components → dist/components}/badge/Badge.cjs +0 -0
  36. /package/dist/{components → dist/components}/badge/Badge.cjs.map +0 -0
  37. /package/dist/{components → dist/components}/badge/Badge.js +0 -0
  38. /package/dist/{components → dist/components}/badge/Badge.js.map +0 -0
  39. /package/dist/{components → dist/components}/badge/BadgeGroup.cjs +0 -0
  40. /package/dist/{components → dist/components}/badge/BadgeGroup.cjs.map +0 -0
  41. /package/dist/{components → dist/components}/badge/BadgeGroup.js +0 -0
  42. /package/dist/{components → dist/components}/badge/BadgeGroup.js.map +0 -0
  43. /package/dist/{components → dist/components}/breadcrumbs/Breadcrumbs.cjs +0 -0
  44. /package/dist/{components → dist/components}/breadcrumbs/Breadcrumbs.cjs.map +0 -0
  45. /package/dist/{components → dist/components}/breadcrumbs/Breadcrumbs.js +0 -0
  46. /package/dist/{components → dist/components}/breadcrumbs/Breadcrumbs.js.map +0 -0
  47. /package/dist/{components → dist/components}/button/Button.cjs +0 -0
  48. /package/dist/{components → dist/components}/button/Button.cjs.map +0 -0
  49. /package/dist/{components → dist/components}/button/Button.js +0 -0
  50. /package/dist/{components → dist/components}/button/Button.js.map +0 -0
  51. /package/dist/{components → dist/components}/card/Card.cjs +0 -0
  52. /package/dist/{components → dist/components}/card/Card.cjs.map +0 -0
  53. /package/dist/{components → dist/components}/card/Card.js +0 -0
  54. /package/dist/{components → dist/components}/card/Card.js.map +0 -0
  55. /package/dist/{components → dist/components}/checkbox/Checkbox.cjs +0 -0
  56. /package/dist/{components → dist/components}/checkbox/Checkbox.cjs.map +0 -0
  57. /package/dist/{components → dist/components}/checkbox/Checkbox.js +0 -0
  58. /package/dist/{components → dist/components}/checkbox/Checkbox.js.map +0 -0
  59. /package/dist/{components → dist/components}/chip/Chip.cjs +0 -0
  60. /package/dist/{components → dist/components}/chip/Chip.cjs.map +0 -0
  61. /package/dist/{components → dist/components}/chip/Chip.js +0 -0
  62. /package/dist/{components → dist/components}/chip/Chip.js.map +0 -0
  63. /package/dist/{components → dist/components}/combobox/Combobox.cjs +0 -0
  64. /package/dist/{components → dist/components}/combobox/Combobox.cjs.map +0 -0
  65. /package/dist/{components → dist/components}/combobox/Combobox.js +0 -0
  66. /package/dist/{components → dist/components}/combobox/Combobox.js.map +0 -0
  67. /package/dist/{components → dist/components}/commandpalette/CommandPalette.cjs +0 -0
  68. /package/dist/{components → dist/components}/commandpalette/CommandPalette.cjs.map +0 -0
  69. /package/dist/{components → dist/components}/commandpalette/CommandPalette.js +0 -0
  70. /package/dist/{components → dist/components}/commandpalette/CommandPalette.js.map +0 -0
  71. /package/dist/{components → dist/components}/contextmenu/ContextMenu.cjs +0 -0
  72. /package/dist/{components → dist/components}/contextmenu/ContextMenu.cjs.map +0 -0
  73. /package/dist/{components → dist/components}/contextmenu/ContextMenu.js +0 -0
  74. /package/dist/{components → dist/components}/contextmenu/ContextMenu.js.map +0 -0
  75. /package/dist/{components → dist/components}/datagrid/DataGrid.cjs +0 -0
  76. /package/dist/{components → dist/components}/datagrid/DataGrid.cjs.map +0 -0
  77. /package/dist/{components → dist/components}/datagrid/DataGrid.js +0 -0
  78. /package/dist/{components → dist/components}/datagrid/DataGrid.js.map +0 -0
  79. /package/dist/{components → dist/components}/datepicker/DatePicker.cjs +0 -0
  80. /package/dist/{components → dist/components}/datepicker/DatePicker.cjs.map +0 -0
  81. /package/dist/{components → dist/components}/datepicker/DatePicker.js +0 -0
  82. /package/dist/{components → dist/components}/datepicker/DatePicker.js.map +0 -0
  83. /package/dist/{components → dist/components}/daterangepicker/DateRangePicker.cjs +0 -0
  84. /package/dist/{components → dist/components}/daterangepicker/DateRangePicker.cjs.map +0 -0
  85. /package/dist/{components → dist/components}/daterangepicker/DateRangePicker.js +0 -0
  86. /package/dist/{components → dist/components}/daterangepicker/DateRangePicker.js.map +0 -0
  87. /package/dist/{components → dist/components}/drawer/Drawer.cjs +0 -0
  88. /package/dist/{components → dist/components}/drawer/Drawer.cjs.map +0 -0
  89. /package/dist/{components → dist/components}/drawer/Drawer.js +0 -0
  90. /package/dist/{components → dist/components}/drawer/Drawer.js.map +0 -0
  91. /package/dist/{components → dist/components}/dropdown/Dropdown.cjs +0 -0
  92. /package/dist/{components → dist/components}/dropdown/Dropdown.cjs.map +0 -0
  93. /package/dist/{components → dist/components}/dropdown/Dropdown.js +0 -0
  94. /package/dist/{components → dist/components}/dropdown/Dropdown.js.map +0 -0
  95. /package/dist/{components → dist/components}/fileuploader/FileUploader.cjs +0 -0
  96. /package/dist/{components → dist/components}/fileuploader/FileUploader.cjs.map +0 -0
  97. /package/dist/{components → dist/components}/fileuploader/FileUploader.js +0 -0
  98. /package/dist/{components → dist/components}/fileuploader/FileUploader.js.map +0 -0
  99. /package/dist/{components → dist/components}/hovercard/HoverCard.cjs +0 -0
  100. /package/dist/{components → dist/components}/hovercard/HoverCard.cjs.map +0 -0
  101. /package/dist/{components → dist/components}/hovercard/HoverCard.js +0 -0
  102. /package/dist/{components → dist/components}/hovercard/HoverCard.js.map +0 -0
  103. /package/dist/{components → dist/components}/input/Input.cjs +0 -0
  104. /package/dist/{components → dist/components}/input/Input.cjs.map +0 -0
  105. /package/dist/{components → dist/components}/input/Input.js +0 -0
  106. /package/dist/{components → dist/components}/input/Input.js.map +0 -0
  107. /package/dist/{components → dist/components}/layout/Container.cjs +0 -0
  108. /package/dist/{components → dist/components}/layout/Container.cjs.map +0 -0
  109. /package/dist/{components → dist/components}/layout/Container.js +0 -0
  110. /package/dist/{components → dist/components}/layout/Container.js.map +0 -0
  111. /package/dist/{components → dist/components}/layout/Flex.cjs +0 -0
  112. /package/dist/{components → dist/components}/layout/Flex.cjs.map +0 -0
  113. /package/dist/{components → dist/components}/layout/Flex.js +0 -0
  114. /package/dist/{components → dist/components}/layout/Flex.js.map +0 -0
  115. /package/dist/{components → dist/components}/layout/Grid.cjs +0 -0
  116. /package/dist/{components → dist/components}/layout/Grid.cjs.map +0 -0
  117. /package/dist/{components → dist/components}/layout/Grid.js +0 -0
  118. /package/dist/{components → dist/components}/layout/Grid.js.map +0 -0
  119. /package/dist/{components → dist/components}/layout/HStack.cjs +0 -0
  120. /package/dist/{components → dist/components}/layout/HStack.cjs.map +0 -0
  121. /package/dist/{components → dist/components}/layout/HStack.js +0 -0
  122. /package/dist/{components → dist/components}/layout/HStack.js.map +0 -0
  123. /package/dist/{components → dist/components}/layout/Stack.cjs +0 -0
  124. /package/dist/{components → dist/components}/layout/Stack.cjs.map +0 -0
  125. /package/dist/{components → dist/components}/layout/Stack.js +0 -0
  126. /package/dist/{components → dist/components}/layout/Stack.js.map +0 -0
  127. /package/dist/{components → dist/components}/megamenu/MegaMenu.cjs +0 -0
  128. /package/dist/{components → dist/components}/megamenu/MegaMenu.cjs.map +0 -0
  129. /package/dist/{components → dist/components}/megamenu/MegaMenu.js +0 -0
  130. /package/dist/{components → dist/components}/megamenu/MegaMenu.js.map +0 -0
  131. /package/dist/{components → dist/components}/modal/Modal.cjs +0 -0
  132. /package/dist/{components → dist/components}/modal/Modal.cjs.map +0 -0
  133. /package/dist/{components → dist/components}/modal/Modal.js +0 -0
  134. /package/dist/{components → dist/components}/modal/Modal.js.map +0 -0
  135. /package/dist/{components → dist/components}/pagination/Pagination.cjs +0 -0
  136. /package/dist/{components → dist/components}/pagination/Pagination.cjs.map +0 -0
  137. /package/dist/{components → dist/components}/pagination/Pagination.js +0 -0
  138. /package/dist/{components → dist/components}/pagination/Pagination.js.map +0 -0
  139. /package/dist/{components → dist/components}/popover/Popover.cjs +0 -0
  140. /package/dist/{components → dist/components}/popover/Popover.cjs.map +0 -0
  141. /package/dist/{components → dist/components}/popover/Popover.js +0 -0
  142. /package/dist/{components → dist/components}/popover/Popover.js.map +0 -0
  143. /package/dist/{components → dist/components}/progress/Progress.cjs +0 -0
  144. /package/dist/{components → dist/components}/progress/Progress.cjs.map +0 -0
  145. /package/dist/{components → dist/components}/progress/Progress.js +0 -0
  146. /package/dist/{components → dist/components}/progress/Progress.js.map +0 -0
  147. /package/dist/{components → dist/components}/radiogroup/RadioGroup.cjs +0 -0
  148. /package/dist/{components → dist/components}/radiogroup/RadioGroup.cjs.map +0 -0
  149. /package/dist/{components → dist/components}/radiogroup/RadioGroup.js +0 -0
  150. /package/dist/{components → dist/components}/radiogroup/RadioGroup.js.map +0 -0
  151. /package/dist/{components → dist/components}/rating/Rating.cjs +0 -0
  152. /package/dist/{components → dist/components}/rating/Rating.cjs.map +0 -0
  153. /package/dist/{components → dist/components}/rating/Rating.js +0 -0
  154. /package/dist/{components → dist/components}/rating/Rating.js.map +0 -0
  155. /package/dist/{components → dist/components}/skeleton/Skeleton.cjs +0 -0
  156. /package/dist/{components → dist/components}/skeleton/Skeleton.cjs.map +0 -0
  157. /package/dist/{components → dist/components}/skeleton/Skeleton.js +0 -0
  158. /package/dist/{components → dist/components}/skeleton/Skeleton.js.map +0 -0
  159. /package/dist/{components → dist/components}/slider/Slider.cjs +0 -0
  160. /package/dist/{components → dist/components}/slider/Slider.cjs.map +0 -0
  161. /package/dist/{components → dist/components}/slider/Slider.js +0 -0
  162. /package/dist/{components → dist/components}/slider/Slider.js.map +0 -0
  163. /package/dist/{components → dist/components}/spinner/Spinner.cjs +0 -0
  164. /package/dist/{components → dist/components}/spinner/Spinner.cjs.map +0 -0
  165. /package/dist/{components → dist/components}/spinner/Spinner.js +0 -0
  166. /package/dist/{components → dist/components}/spinner/Spinner.js.map +0 -0
  167. /package/dist/{components → dist/components}/stepper/Stepper.cjs +0 -0
  168. /package/dist/{components → dist/components}/stepper/Stepper.cjs.map +0 -0
  169. /package/dist/{components → dist/components}/stepper/Stepper.js +0 -0
  170. /package/dist/{components → dist/components}/stepper/Stepper.js.map +0 -0
  171. /package/dist/{components → dist/components}/switch/Switch.cjs +0 -0
  172. /package/dist/{components → dist/components}/switch/Switch.cjs.map +0 -0
  173. /package/dist/{components → dist/components}/switch/Switch.js +0 -0
  174. /package/dist/{components → dist/components}/switch/Switch.js.map +0 -0
  175. /package/dist/{components → dist/components}/table/Table.cjs +0 -0
  176. /package/dist/{components → dist/components}/table/Table.cjs.map +0 -0
  177. /package/dist/{components → dist/components}/table/Table.js +0 -0
  178. /package/dist/{components → dist/components}/table/Table.js.map +0 -0
  179. /package/dist/{components → dist/components}/tabs/Tabs.cjs +0 -0
  180. /package/dist/{components → dist/components}/tabs/Tabs.cjs.map +0 -0
  181. /package/dist/{components → dist/components}/tabs/Tabs.js +0 -0
  182. /package/dist/{components → dist/components}/tabs/Tabs.js.map +0 -0
  183. /package/dist/{components → dist/components}/textarea/Textarea.cjs +0 -0
  184. /package/dist/{components → dist/components}/textarea/Textarea.cjs.map +0 -0
  185. /package/dist/{components → dist/components}/textarea/Textarea.js +0 -0
  186. /package/dist/{components → dist/components}/textarea/Textarea.js.map +0 -0
  187. /package/dist/{components → dist/components}/toast/Toast.cjs +0 -0
  188. /package/dist/{components → dist/components}/toast/Toast.cjs.map +0 -0
  189. /package/dist/{components → dist/components}/toast/Toast.js +0 -0
  190. /package/dist/{components → dist/components}/toast/Toast.js.map +0 -0
  191. /package/dist/{components → dist/components}/tooltip/Tooltip.cjs +0 -0
  192. /package/dist/{components → dist/components}/tooltip/Tooltip.cjs.map +0 -0
  193. /package/dist/{components → dist/components}/tooltip/Tooltip.js +0 -0
  194. /package/dist/{components → dist/components}/tooltip/Tooltip.js.map +0 -0
  195. /package/dist/{components → dist/components}/treeview/TreeView.cjs +0 -0
  196. /package/dist/{components → dist/components}/treeview/TreeView.cjs.map +0 -0
  197. /package/dist/{components → dist/components}/treeview/TreeView.js +0 -0
  198. /package/dist/{components → dist/components}/treeview/TreeView.js.map +0 -0
  199. /package/dist/{components → dist/components}/virtuallist/VirtualList.cjs +0 -0
  200. /package/dist/{components → dist/components}/virtuallist/VirtualList.cjs.map +0 -0
  201. /package/dist/{components → dist/components}/virtuallist/VirtualList.js +0 -0
  202. /package/dist/{components → dist/components}/virtuallist/VirtualList.js.map +0 -0
  203. /package/dist/{index.cjs.map → dist/index.cjs.map} +0 -0
  204. /package/dist/{theme → dist/theme}/NUIProvider.cjs +0 -0
  205. /package/dist/{theme → dist/theme}/NUIProvider.cjs.map +0 -0
  206. /package/dist/{theme → dist/theme}/NUIProvider.js +0 -0
  207. /package/dist/{theme → dist/theme}/NUIProvider.js.map +0 -0
  208. /package/dist/{theme → dist/theme}/useTheme.cjs +0 -0
  209. /package/dist/{theme → dist/theme}/useTheme.cjs.map +0 -0
  210. /package/dist/{theme → dist/theme}/useTheme.js +0 -0
  211. /package/dist/{theme → dist/theme}/useTheme.js.map +0 -0
  212. /package/dist/{types → dist/types}/components/accordion/Accordion.d.ts +0 -0
  213. /package/dist/{types → dist/types}/components/accordion/Accordion.d.ts.map +0 -0
  214. /package/dist/{types → dist/types}/components/alert/Alert.d.ts +0 -0
  215. /package/dist/{types → dist/types}/components/alert/Alert.d.ts.map +0 -0
  216. /package/dist/{types → dist/types}/components/avatar/Avatar.d.ts +0 -0
  217. /package/dist/{types → dist/types}/components/avatar/Avatar.d.ts.map +0 -0
  218. /package/dist/{types → dist/types}/components/avatar/AvatarGroup.d.ts +0 -0
  219. /package/dist/{types → dist/types}/components/avatar/AvatarGroup.d.ts.map +0 -0
  220. /package/dist/{types → dist/types}/components/badge/Badge.d.ts +0 -0
  221. /package/dist/{types → dist/types}/components/badge/Badge.d.ts.map +0 -0
  222. /package/dist/{types → dist/types}/components/badge/BadgeGroup.d.ts +0 -0
  223. /package/dist/{types → dist/types}/components/badge/BadgeGroup.d.ts.map +0 -0
  224. /package/dist/{types → dist/types}/components/breadcrumbs/Breadcrumbs.d.ts +0 -0
  225. /package/dist/{types → dist/types}/components/breadcrumbs/Breadcrumbs.d.ts.map +0 -0
  226. /package/dist/{types → dist/types}/components/button/Button.d.ts +0 -0
  227. /package/dist/{types → dist/types}/components/button/Button.d.ts.map +0 -0
  228. /package/dist/{types → dist/types}/components/card/Card.d.ts +0 -0
  229. /package/dist/{types → dist/types}/components/card/Card.d.ts.map +0 -0
  230. /package/dist/{types → dist/types}/components/checkbox/Checkbox.d.ts +0 -0
  231. /package/dist/{types → dist/types}/components/checkbox/Checkbox.d.ts.map +0 -0
  232. /package/dist/{types → dist/types}/components/chip/Chip.d.ts +0 -0
  233. /package/dist/{types → dist/types}/components/chip/Chip.d.ts.map +0 -0
  234. /package/dist/{types → dist/types}/components/combobox/Combobox.d.ts +0 -0
  235. /package/dist/{types → dist/types}/components/combobox/Combobox.d.ts.map +0 -0
  236. /package/dist/{types → dist/types}/components/commandpalette/CommandPalette.d.ts +0 -0
  237. /package/dist/{types → dist/types}/components/commandpalette/CommandPalette.d.ts.map +0 -0
  238. /package/dist/{types → dist/types}/components/contextmenu/ContextMenu.d.ts +0 -0
  239. /package/dist/{types → dist/types}/components/contextmenu/ContextMenu.d.ts.map +0 -0
  240. /package/dist/{types → dist/types}/components/datagrid/DataGrid.d.ts +0 -0
  241. /package/dist/{types → dist/types}/components/datagrid/DataGrid.d.ts.map +0 -0
  242. /package/dist/{types → dist/types}/components/datepicker/DatePicker.d.ts +0 -0
  243. /package/dist/{types → dist/types}/components/datepicker/DatePicker.d.ts.map +0 -0
  244. /package/dist/{types → dist/types}/components/daterangepicker/DateRangePicker.d.ts +0 -0
  245. /package/dist/{types → dist/types}/components/daterangepicker/DateRangePicker.d.ts.map +0 -0
  246. /package/dist/{types → dist/types}/components/drawer/Drawer.d.ts +0 -0
  247. /package/dist/{types → dist/types}/components/drawer/Drawer.d.ts.map +0 -0
  248. /package/dist/{types → dist/types}/components/dropdown/Dropdown.d.ts +0 -0
  249. /package/dist/{types → dist/types}/components/dropdown/Dropdown.d.ts.map +0 -0
  250. /package/dist/{types → dist/types}/components/fileuploader/FileUploader.d.ts +0 -0
  251. /package/dist/{types → dist/types}/components/fileuploader/FileUploader.d.ts.map +0 -0
  252. /package/dist/{types → dist/types}/components/hovercard/HoverCard.d.ts +0 -0
  253. /package/dist/{types → dist/types}/components/hovercard/HoverCard.d.ts.map +0 -0
  254. /package/dist/{types → dist/types}/components/input/Input.d.ts +0 -0
  255. /package/dist/{types → dist/types}/components/input/Input.d.ts.map +0 -0
  256. /package/dist/{types → dist/types}/components/layout/Container.d.ts +0 -0
  257. /package/dist/{types → dist/types}/components/layout/Container.d.ts.map +0 -0
  258. /package/dist/{types → dist/types}/components/layout/Flex.d.ts +0 -0
  259. /package/dist/{types → dist/types}/components/layout/Flex.d.ts.map +0 -0
  260. /package/dist/{types → dist/types}/components/layout/Grid.d.ts +0 -0
  261. /package/dist/{types → dist/types}/components/layout/Grid.d.ts.map +0 -0
  262. /package/dist/{types → dist/types}/components/layout/HStack.d.ts +0 -0
  263. /package/dist/{types → dist/types}/components/layout/HStack.d.ts.map +0 -0
  264. /package/dist/{types → dist/types}/components/layout/Stack.d.ts +0 -0
  265. /package/dist/{types → dist/types}/components/layout/Stack.d.ts.map +0 -0
  266. /package/dist/{types → dist/types}/components/megamenu/MegaMenu.d.ts +0 -0
  267. /package/dist/{types → dist/types}/components/megamenu/MegaMenu.d.ts.map +0 -0
  268. /package/dist/{types → dist/types}/components/modal/Modal.d.ts +0 -0
  269. /package/dist/{types → dist/types}/components/modal/Modal.d.ts.map +0 -0
  270. /package/dist/{types → dist/types}/components/pagination/Pagination.d.ts +0 -0
  271. /package/dist/{types → dist/types}/components/pagination/Pagination.d.ts.map +0 -0
  272. /package/dist/{types → dist/types}/components/popover/Popover.d.ts +0 -0
  273. /package/dist/{types → dist/types}/components/popover/Popover.d.ts.map +0 -0
  274. /package/dist/{types → dist/types}/components/progress/Progress.d.ts +0 -0
  275. /package/dist/{types → dist/types}/components/progress/Progress.d.ts.map +0 -0
  276. /package/dist/{types → dist/types}/components/radiogroup/RadioGroup.d.ts +0 -0
  277. /package/dist/{types → dist/types}/components/radiogroup/RadioGroup.d.ts.map +0 -0
  278. /package/dist/{types → dist/types}/components/rating/Rating.d.ts +0 -0
  279. /package/dist/{types → dist/types}/components/rating/Rating.d.ts.map +0 -0
  280. /package/dist/{types → dist/types}/components/select/Select.d.ts +0 -0
  281. /package/dist/{types → dist/types}/components/select/Select.d.ts.map +0 -0
  282. /package/dist/{types → dist/types}/components/skeleton/Skeleton.d.ts +0 -0
  283. /package/dist/{types → dist/types}/components/skeleton/Skeleton.d.ts.map +0 -0
  284. /package/dist/{types → dist/types}/components/slider/Slider.d.ts +0 -0
  285. /package/dist/{types → dist/types}/components/slider/Slider.d.ts.map +0 -0
  286. /package/dist/{types → dist/types}/components/spinner/Spinner.d.ts +0 -0
  287. /package/dist/{types → dist/types}/components/spinner/Spinner.d.ts.map +0 -0
  288. /package/dist/{types → dist/types}/components/stepper/Stepper.d.ts +0 -0
  289. /package/dist/{types → dist/types}/components/stepper/Stepper.d.ts.map +0 -0
  290. /package/dist/{types → dist/types}/components/switch/Switch.d.ts +0 -0
  291. /package/dist/{types → dist/types}/components/switch/Switch.d.ts.map +0 -0
  292. /package/dist/{types → dist/types}/components/table/Table.d.ts +0 -0
  293. /package/dist/{types → dist/types}/components/table/Table.d.ts.map +0 -0
  294. /package/dist/{types → dist/types}/components/tabs/Tabs.d.ts +0 -0
  295. /package/dist/{types → dist/types}/components/tabs/Tabs.d.ts.map +0 -0
  296. /package/dist/{types → dist/types}/components/textarea/Textarea.d.ts +0 -0
  297. /package/dist/{types → dist/types}/components/textarea/Textarea.d.ts.map +0 -0
  298. /package/dist/{types → dist/types}/components/toast/Toast.d.ts +0 -0
  299. /package/dist/{types → dist/types}/components/toast/Toast.d.ts.map +0 -0
  300. /package/dist/{types → dist/types}/components/tooltip/Tooltip.d.ts +0 -0
  301. /package/dist/{types → dist/types}/components/tooltip/Tooltip.d.ts.map +0 -0
  302. /package/dist/{types → dist/types}/components/treeview/TreeView.d.ts +0 -0
  303. /package/dist/{types → dist/types}/components/treeview/TreeView.d.ts.map +0 -0
  304. /package/dist/{types → dist/types}/components/virtuallist/VirtualList.d.ts +0 -0
  305. /package/dist/{types → dist/types}/components/virtuallist/VirtualList.d.ts.map +0 -0
  306. /package/dist/{types → dist/types}/theme/NUIProvider.d.ts +0 -0
  307. /package/dist/{types → dist/types}/theme/NUIProvider.d.ts.map +0 -0
  308. /package/dist/{types → dist/types}/theme/useTheme.d.ts +0 -0
  309. /package/dist/{types → dist/types}/theme/useTheme.d.ts.map +0 -0
  310. /package/dist/{types → dist/types}/utils/generateid/generateId.d.ts +0 -0
  311. /package/dist/{types → dist/types}/utils/generateid/generateId.d.ts.map +0 -0
  312. /package/dist/{types → dist/types}/utils/index.d.ts +0 -0
  313. /package/dist/{types → dist/types}/utils/index.d.ts.map +0 -0
  314. /package/dist/{types → dist/types}/utils/inertmanager/inertManager.d.ts +0 -0
  315. /package/dist/{types → dist/types}/utils/inertmanager/inertManager.d.ts.map +0 -0
  316. /package/dist/{types → dist/types}/utils/keyboardnav/keyboardNav.d.ts +0 -0
  317. /package/dist/{types → dist/types}/utils/keyboardnav/keyboardNav.d.ts.map +0 -0
  318. /package/dist/{types → dist/types}/utils/onclickoutside/onClickOutside.d.ts +0 -0
  319. /package/dist/{types → dist/types}/utils/onclickoutside/onClickOutside.d.ts.map +0 -0
  320. /package/dist/{types → dist/types}/utils/portal/portal.d.ts +0 -0
  321. /package/dist/{types → dist/types}/utils/portal/portal.d.ts.map +0 -0
  322. /package/dist/{types → dist/types}/utils/restorefocus/restoreFocus.d.ts +0 -0
  323. /package/dist/{types → dist/types}/utils/restorefocus/restoreFocus.d.ts.map +0 -0
  324. /package/dist/{types → dist/types}/utils/scrolllock/scrollLock.d.ts +0 -0
  325. /package/dist/{types → dist/types}/utils/scrolllock/scrollLock.d.ts.map +0 -0
  326. /package/dist/{types → dist/types}/utils/trapfocus/trapFocus.d.ts +0 -0
  327. /package/dist/{types → dist/types}/utils/trapfocus/trapFocus.d.ts.map +0 -0
  328. /package/dist/{utils → dist/utils}/generateid/generateId.cjs +0 -0
  329. /package/dist/{utils → dist/utils}/generateid/generateId.cjs.map +0 -0
  330. /package/dist/{utils → dist/utils}/generateid/generateId.js +0 -0
  331. /package/dist/{utils → dist/utils}/generateid/generateId.js.map +0 -0
  332. /package/dist/{utils → dist/utils}/inertmanager/inertManager.cjs +0 -0
  333. /package/dist/{utils → dist/utils}/inertmanager/inertManager.cjs.map +0 -0
  334. /package/dist/{utils → dist/utils}/inertmanager/inertManager.js +0 -0
  335. /package/dist/{utils → dist/utils}/inertmanager/inertManager.js.map +0 -0
  336. /package/dist/{utils → dist/utils}/keyboardnav/keyboardNav.cjs +0 -0
  337. /package/dist/{utils → dist/utils}/keyboardnav/keyboardNav.cjs.map +0 -0
  338. /package/dist/{utils → dist/utils}/keyboardnav/keyboardNav.js +0 -0
  339. /package/dist/{utils → dist/utils}/keyboardnav/keyboardNav.js.map +0 -0
  340. /package/dist/{utils → dist/utils}/onclickoutside/onClickOutside.cjs +0 -0
  341. /package/dist/{utils → dist/utils}/onclickoutside/onClickOutside.cjs.map +0 -0
  342. /package/dist/{utils → dist/utils}/onclickoutside/onClickOutside.js +0 -0
  343. /package/dist/{utils → dist/utils}/onclickoutside/onClickOutside.js.map +0 -0
  344. /package/dist/{utils → dist/utils}/portal/portal.cjs +0 -0
  345. /package/dist/{utils → dist/utils}/portal/portal.cjs.map +0 -0
  346. /package/dist/{utils → dist/utils}/portal/portal.js +0 -0
  347. /package/dist/{utils → dist/utils}/portal/portal.js.map +0 -0
  348. /package/dist/{utils → dist/utils}/restorefocus/restoreFocus.cjs +0 -0
  349. /package/dist/{utils → dist/utils}/restorefocus/restoreFocus.cjs.map +0 -0
  350. /package/dist/{utils → dist/utils}/restorefocus/restoreFocus.js +0 -0
  351. /package/dist/{utils → dist/utils}/restorefocus/restoreFocus.js.map +0 -0
  352. /package/dist/{utils → dist/utils}/scrolllock/scrollLock.cjs +0 -0
  353. /package/dist/{utils → dist/utils}/scrolllock/scrollLock.cjs.map +0 -0
  354. /package/dist/{utils → dist/utils}/scrolllock/scrollLock.js +0 -0
  355. /package/dist/{utils → dist/utils}/scrolllock/scrollLock.js.map +0 -0
  356. /package/dist/{utils → dist/utils}/trapfocus/trapFocus.cjs +0 -0
  357. /package/dist/{utils → dist/utils}/trapfocus/trapFocus.cjs.map +0 -0
  358. /package/dist/{utils → dist/utils}/trapfocus/trapFocus.js +0 -0
  359. /package/dist/{utils → dist/utils}/trapfocus/trapFocus.js.map +0 -0
@@ -0,0 +1,19 @@
1
+ # @nofinite/nui
2
+
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Select component added
8
+
9
+ ## 1.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: ensure build output is included in npm package
14
+
15
+ ## 1.0.1
16
+
17
+ ### Patch Changes
18
+
19
+ - fix: ensure build output is included in npm package
package/dist/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Nofinite
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/README.md ADDED
@@ -0,0 +1,48 @@
1
+ <div align="center">
2
+
3
+ # NUI
4
+
5
+ **A robust, accessible, and lightweight React component library designed for modern web applications.**
6
+
7
+ [![npm](https://img.shields.io/npm/v/@nofinite/nui?style=flat-square&color=3b82f6)](https://www.npmjs.com/package/@nofinite/nui)
8
+ [![License](https://img.shields.io/npm/l/@nofinite/nui?style=flat-square&color=3b82f6)](LICENSE)
9
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@nofinite/nui?style=flat-square&color=3b82f6)](https://bundlephobia.com/package/@nofinite/nui)
10
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Yes-3b82f6?style=flat-square)](https://www.typescriptlang.org/)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## Overview
17
+
18
+ NUI provides a set of accessible, production-ready components to help you build modern web applications faster. It handles the complex details—like focus management and accessibility—so you can focus on building your product.
19
+
20
+ * **Accessible:** WAI-ARIA compliant out of the box.
21
+ * **Type-Safe:** Built with TypeScript for a great developer experience.
22
+ * **Lightweight:** Modular design with zero heavy dependencies.
23
+
24
+ ---
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ # pnpm
30
+ pnpm add @nofinite/nui
31
+
32
+ # npm
33
+ npm install @nofinite/nui
34
+
35
+ # yarn
36
+ yarn add @nofinite/nui
37
+ ```
38
+
39
+ ## Documentation
40
+
41
+ For full setup guides, component examples, and API references, [read documentation](https://opensource.nofinite.com/docs/nui).
42
+
43
+ ## License
44
+
45
+ This project is licensed under the
46
+ [Apache License, Version 2.0](./LICENSE).
47
+
48
+ Feel free to use, modify, and share this project in your applications, products, and services. Attribution is welcome and appreciated, but never required.
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),l=require("react");;/* empty css */const z=require("../../utils/restorefocus/restoreFocus.cjs"),G=require("../../utils/onclickoutside/onClickOutside.cjs"),J=require("../../utils/portal/portal.cjs");function L(s,h,g){const o=s.length;let d=h;for(let r=0;r<o;r++)if(d=(d+g+o)%o,!s[d].disabled)return d;return-1}function Q({options:s,value:h,defaultValue:g,onChange:o,placeholder:d="Select...",disabled:r=!1,name:C,id:O,className:T=""}){const I=h!==void 0,[$,K]=l.useState(g),b=I?h:$,S=s.find(e=>e.value===b)??null,[i,x]=l.useState(!1),[a,f]=l.useState(()=>s.findIndex(e=>!e.disabled)),v=l.useRef({buffer:"",lastTime:0}),p=l.useRef(null),m=l.useRef(null),P=l.useId(),R=O??P,y=`${R}-listbox`,E=`${R}-label`,V=l.useCallback(()=>{r||x(!0)},[r]),F=l.useCallback(()=>{x(!1),z.restoreFocus(p.current)},[]),M=l.useCallback(()=>{r||x(e=>!e)},[r]);l.useEffect(()=>{if(i)return G.onClickOutside(m,()=>x(!1))},[i]),l.useEffect(()=>{if(!i)return;const e=s.findIndex(n=>n.value===b&&!n.disabled),t=e>=0?e:s.findIndex(n=>!n.disabled);f(t>=0?t:-1),setTimeout(()=>{m.current?.focus()},0)},[i,s,b]);const N=l.useCallback(e=>{if(e<0||e>=s.length)return;const t=s[e];t.disabled||(I||K(t.value),o?.(t.value),x(!1),p.current?.focus())},[I,s,o]),U=e=>{r||["ArrowDown","ArrowUp"," ","Enter"].includes(e.key)&&(e.preventDefault(),V())},B=e=>{const t=e.key;if(t==="ArrowDown"){e.preventDefault();const n=L(s,a,1);n>=0&&f(n)}else if(t==="ArrowUp"){e.preventDefault();const n=L(s,a,-1);n>=0&&f(n)}else if(t==="Home"){e.preventDefault();const n=s.findIndex(u=>!u.disabled);n>=0&&f(n)}else if(t==="End"){e.preventDefault();const n=s.length-1-[...s].reverse().findIndex(u=>!u.disabled);n>=0&&f(n)}else if(t==="Enter"||t===" ")e.preventDefault(),a>=0&&N(a);else if(t==="Escape")e.preventDefault(),F();else if(t.length===1&&t.match(/\S/)){const n=Date.now();n-v.current.lastTime>700&&(v.current.buffer=""),v.current.buffer+=t.toLowerCase(),v.current.lastTime=n;const u=v.current.buffer,w=a>=0?a+1:0,A=s.length;for(let k=0;k<A;k++){const j=(w+k)%A,W=String(s[j].label).toLowerCase();if(!s[j].disabled&&W.startsWith(u)){f(j);break}}}},H=e=>{N(e)},[D,q]=l.useState(null);return l.useEffect(()=>{if(!i||!p.current){q(null);return}const e=p.current.getBoundingClientRect(),t=e.bottom+6,n=e.left;q({top:t,left:n})},[i]),c.jsxs("div",{className:`ui-select ${T}`,children:[C&&c.jsx("input",{type:"hidden",name:C,value:b??""}),c.jsxs("button",{ref:p,id:E,type:"button",className:"ui-select-trigger","aria-haspopup":"listbox","aria-expanded":i,"aria-controls":i?y:void 0,"aria-disabled":r||void 0,onClick:()=>M(),onKeyDown:U,disabled:r,children:[c.jsx("span",{children:S?c.jsx("span",{children:S.label}):c.jsx("span",{className:"ui-select-placeholder",children:d})}),c.jsx("span",{className:"ui-select-chevron","aria-hidden":!0,children:"▾"})]}),i&&D&&c.jsx(J.Portal,{children:c.jsx("div",{id:y,ref:m,className:"ui-select-listbox",role:"listbox","aria-labelledby":E,tabIndex:0,style:{top:D.top,left:D.left},onKeyDown:B,children:s.map((e,t)=>{const n=b===e.value,u=a===t;return c.jsx("div",{id:`${y}-option-${t}`,role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,className:"ui-select-option",tabIndex:-1,onMouseDown:w=>w.preventDefault(),onClick:()=>!e.disabled&&H(t),style:{outline:u?"2px solid var(--color-primary)":void 0},children:e.label},e.value)})})})]})}exports.Select=Q;
2
+ //# sourceMappingURL=Select.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.cjs","sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["/**\r\n * Select.tsx\r\n * ----------\r\n * Accessible single-select (listbox) component.\r\n *\r\n * Features:\r\n * - WAI-ARIA listbox pattern\r\n * - Keyboard navigation (ArrowUp/ArrowDown, Home, End, Enter, Space, Esc)\r\n * - Typeahead support\r\n * - Controlled + uncontrolled modes\r\n * - Portal rendering for the listbox\r\n * - Click outside to close\r\n * - Proper ARIA attributes and relationships\r\n * - Hidden input for form compatibility (optional name prop)\r\n *\r\n * Usage:\r\n * <Select\r\n * options={[{ value: 'a', label: 'Apple' }, { value: 'b', label: 'Banana' }]}\r\n * value={value} // optional controlled value\r\n * onChange={(v) => setValue(v)} // required if controlled\r\n * placeholder=\"Select fruit\"\r\n * name=\"fruit\" // optional, adds hidden input\r\n * />\r\n */\r\n\r\nimport React, {\r\n useState,\r\n useRef,\r\n useEffect,\r\n useCallback,\r\n KeyboardEvent,\r\n} from 'react';\r\nimport './Select.css';\r\nimport { Portal, onClickOutside, restoreFocus } from '../../utils/index';\r\n\r\ntype Option = {\r\n value: string;\r\n label: React.ReactNode;\r\n disabled?: boolean;\r\n};\r\n\r\ninterface SelectProps {\r\n options: Option[];\r\n value?: string; // controlled value\r\n defaultValue?: string; // uncontrolled initial\r\n onChange?: (value: string) => void;\r\n placeholder?: string;\r\n disabled?: boolean;\r\n name?: string; // if provided, render hidden input for forms\r\n id?: string;\r\n className?: string;\r\n}\r\n\r\n/* Helper: find next enabled index given direction */\r\nfunction findNextEnabled(options: Option[], start: number, direction: 1 | -1) {\r\n const len = options.length;\r\n let i = start;\r\n for (let step = 0; step < len; step++) {\r\n i = (i + direction + len) % len;\r\n if (!options[i].disabled) return i;\r\n }\r\n return -1;\r\n}\r\n\r\nexport function Select({\r\n options,\r\n value,\r\n defaultValue,\r\n onChange,\r\n placeholder = 'Select...',\r\n disabled = false,\r\n name,\r\n id,\r\n className = '',\r\n}: SelectProps) {\r\n // Controlled vs uncontrolled\r\n const isControlled = value !== undefined;\r\n const [internalValue, setInternalValue] = useState<string | undefined>(\r\n defaultValue\r\n );\r\n const selectedValue = isControlled ? value : internalValue;\r\n\r\n const selectedOption = options.find((o) => o.value === selectedValue) ?? null;\r\n\r\n const [open, setOpen] = useState(false);\r\n const [activeIndex, setActiveIndex] = useState<number>(() =>\r\n options.findIndex((o) => !o.disabled)\r\n );\r\n\r\n // Typeahead buffer\r\n const typeaheadRef = useRef({ buffer: '', lastTime: 0 });\r\n\r\n // Refs\r\n const triggerRef = useRef<HTMLButtonElement | null>(null);\r\n const listRef = useRef<HTMLDivElement | null>(null);\r\n\r\n // Unique ids\r\n const reactId = React.useId();\r\n const baseId = id ?? reactId;\r\n const listboxId = `${baseId}-listbox`;\r\n const labelId = `${baseId}-label`;\r\n\r\n // Open/close helpers\r\n const openList = useCallback(() => {\r\n if (disabled) return;\r\n setOpen(true);\r\n }, [disabled]);\r\n\r\n const closeList = useCallback(() => {\r\n setOpen(false);\r\n // restore focus to trigger\r\n restoreFocus(triggerRef.current);\r\n }, []);\r\n\r\n // Toggle\r\n const toggleList = useCallback(() => {\r\n if (disabled) return;\r\n setOpen((s) => !s);\r\n }, [disabled]);\r\n\r\n // Click outside to close\r\n useEffect(() => {\r\n if (!open) return;\r\n return onClickOutside(listRef, () => setOpen(false));\r\n }, [open]);\r\n\r\n // Ensure that when opening, activeIndex is valid and focus moves to listbox\r\n useEffect(() => {\r\n if (!open) return;\r\n // set active to selected or first enabled\r\n const selIndex = options.findIndex(\r\n (o) => o.value === selectedValue && !o.disabled\r\n );\r\n const idx =\r\n selIndex >= 0 ? selIndex : options.findIndex((o) => !o.disabled);\r\n setActiveIndex(idx >= 0 ? idx : -1);\r\n\r\n // focus the list container so keyboard events are captured\r\n setTimeout(() => {\r\n listRef.current?.focus();\r\n }, 0);\r\n }, [open, options, selectedValue]);\r\n\r\n // Selection handler\r\n const selectIndex = useCallback(\r\n (i: number) => {\r\n if (i < 0 || i >= options.length) return;\r\n const opt = options[i];\r\n if (opt.disabled) return;\r\n if (!isControlled) setInternalValue(opt.value);\r\n onChange?.(opt.value);\r\n setOpen(false);\r\n // restore focus\r\n triggerRef.current?.focus();\r\n },\r\n [isControlled, options, onChange]\r\n );\r\n\r\n // Keyboard handling when trigger has focus\r\n const onTriggerKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\r\n if (disabled) return;\r\n if (['ArrowDown', 'ArrowUp', ' ', 'Enter'].includes(e.key)) {\r\n e.preventDefault();\r\n openList();\r\n }\r\n };\r\n\r\n // Keyboard handling when listbox has focus\r\n const onListKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\r\n const key = e.key;\r\n if (key === 'ArrowDown') {\r\n e.preventDefault();\r\n const next = findNextEnabled(options, activeIndex, 1);\r\n if (next >= 0) setActiveIndex(next);\r\n } else if (key === 'ArrowUp') {\r\n e.preventDefault();\r\n const prev = findNextEnabled(options, activeIndex, -1);\r\n if (prev >= 0) setActiveIndex(prev);\r\n } else if (key === 'Home') {\r\n e.preventDefault();\r\n const first = options.findIndex((o) => !o.disabled);\r\n if (first >= 0) setActiveIndex(first);\r\n } else if (key === 'End') {\r\n e.preventDefault();\r\n const last =\r\n options.length -\r\n 1 -\r\n [...options].reverse().findIndex((o) => !o.disabled);\r\n if (last >= 0) setActiveIndex(last);\r\n } else if (key === 'Enter' || key === ' ') {\r\n e.preventDefault();\r\n if (activeIndex >= 0) selectIndex(activeIndex);\r\n } else if (key === 'Escape') {\r\n e.preventDefault();\r\n closeList();\r\n } else if (key.length === 1 && key.match(/\\S/)) {\r\n // typeahead: accumulate buffer of characters\r\n const now = Date.now();\r\n if (now - typeaheadRef.current.lastTime > 700) {\r\n typeaheadRef.current.buffer = '';\r\n }\r\n typeaheadRef.current.buffer += key.toLowerCase();\r\n typeaheadRef.current.lastTime = now;\r\n\r\n const buf = typeaheadRef.current.buffer;\r\n const start = activeIndex >= 0 ? activeIndex + 1 : 0;\r\n const len = options.length;\r\n // search forward from next item, wrapping\r\n for (let i = 0; i < len; i++) {\r\n const idx = (start + i) % len;\r\n const lab = String(options[idx].label).toLowerCase();\r\n if (!options[idx].disabled && lab.startsWith(buf)) {\r\n setActiveIndex(idx);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Click on option\r\n const onOptionClick = (i: number) => {\r\n selectIndex(i);\r\n };\r\n\r\n // compute listbox position based on trigger\r\n const [pos, setPos] = useState<{ top: number; left: number } | null>(null);\r\n useEffect(() => {\r\n if (!open || !triggerRef.current) {\r\n setPos(null);\r\n return;\r\n }\r\n const rect = triggerRef.current.getBoundingClientRect();\r\n const top = rect.bottom + 6;\r\n const left = rect.left;\r\n setPos({ top, left });\r\n }, [open]);\r\n\r\n // render\r\n return (\r\n <div className={`ui-select ${className}`}>\r\n {/* Hidden input for form compatibility */}\r\n {name && <input type=\"hidden\" name={name} value={selectedValue ?? ''} />}\r\n\r\n <button\r\n ref={triggerRef}\r\n id={labelId}\r\n type=\"button\"\r\n className=\"ui-select-trigger\"\r\n aria-haspopup=\"listbox\"\r\n aria-expanded={open}\r\n aria-controls={open ? listboxId : undefined}\r\n aria-disabled={disabled || undefined}\r\n onClick={() => toggleList()}\r\n onKeyDown={onTriggerKeyDown}\r\n disabled={disabled}\r\n >\r\n <span>\r\n {selectedOption ? (\r\n <span>{selectedOption.label}</span>\r\n ) : (\r\n <span className=\"ui-select-placeholder\">{placeholder}</span>\r\n )}\r\n </span>\r\n <span className=\"ui-select-chevron\" aria-hidden>\r\n ▾\r\n </span>\r\n </button>\r\n\r\n {open && pos && (\r\n <Portal>\r\n <div\r\n id={listboxId}\r\n ref={listRef}\r\n className=\"ui-select-listbox\"\r\n role=\"listbox\"\r\n aria-labelledby={labelId}\r\n tabIndex={0}\r\n style={{\r\n top: pos.top,\r\n left: pos.left,\r\n }}\r\n onKeyDown={onListKeyDown}\r\n >\r\n {options.map((opt, i) => {\r\n const isSelected = selectedValue === opt.value;\r\n const isActive = activeIndex === i;\r\n return (\r\n <div\r\n key={opt.value}\r\n id={`${listboxId}-option-${i}`}\r\n role=\"option\"\r\n aria-selected={isSelected}\r\n aria-disabled={opt.disabled || undefined}\r\n className=\"ui-select-option\"\r\n tabIndex={-1}\r\n onMouseDown={(e) => e.preventDefault()} /* prevent blur */\r\n onClick={() => !opt.disabled && onOptionClick(i)}\r\n // Visual focus when active (not moving DOM focus)\r\n style={{\r\n outline: isActive\r\n ? '2px solid var(--color-primary)'\r\n : undefined,\r\n }}\r\n >\r\n {opt.label}\r\n </div>\r\n );\r\n })}\r\n </div>\r\n </Portal>\r\n )}\r\n </div>\r\n );\r\n}\r\n"],"names":["findNextEnabled","options","start","direction","len","i","step","Select","value","defaultValue","onChange","placeholder","disabled","name","id","className","isControlled","internalValue","setInternalValue","useState","selectedValue","selectedOption","o","open","setOpen","activeIndex","setActiveIndex","typeaheadRef","useRef","triggerRef","listRef","reactId","React","baseId","listboxId","labelId","openList","useCallback","closeList","restoreFocus","toggleList","s","useEffect","onClickOutside","selIndex","idx","selectIndex","opt","onTriggerKeyDown","onListKeyDown","key","next","prev","first","last","now","buf","lab","onOptionClick","pos","setPos","rect","top","left","jsxs","jsx","Portal","isSelected","isActive","e"],"mappings":"uUAsDA,SAASA,EAAgBC,EAAmBC,EAAeC,EAAmB,CAC5E,MAAMC,EAAMH,EAAQ,OACpB,IAAII,EAAIH,EACR,QAASI,EAAO,EAAGA,EAAOF,EAAKE,IAE7B,GADAD,GAAKA,EAAIF,EAAYC,GAAOA,EACxB,CAACH,EAAQI,CAAC,EAAE,SAAU,OAAOA,EAEnC,MAAO,EACT,CAEO,SAASE,EAAO,CACrB,QAAAN,EACA,MAAAO,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AAI,KAAA,CAmBf,CAAC,CAAA,CAAA,CACH,CACF,CAAA,EAEJ,CAEJ"}
@@ -0,0 +1,165 @@
1
+ import { jsxs as V, jsx as i } from "react/jsx-runtime";
2
+ import X, { useState as x, useRef as A, useCallback as h, useEffect as E } from "react";
3
+ /* empty css */
4
+ import { restoreFocus as Y } from "../../utils/restorefocus/restoreFocus.js";
5
+ import { onClickOutside as Z } from "../../utils/onclickoutside/onClickOutside.js";
6
+ import { Portal as _ } from "../../utils/portal/portal.js";
7
+ function j(l, m, I) {
8
+ const o = l.length;
9
+ let f = m;
10
+ for (let r = 0; r < o; r++)
11
+ if (f = (f + I + o) % o, !l[f].disabled) return f;
12
+ return -1;
13
+ }
14
+ function ie({
15
+ options: l,
16
+ value: m,
17
+ defaultValue: I,
18
+ onChange: o,
19
+ placeholder: f = "Select...",
20
+ disabled: r = !1,
21
+ name: L,
22
+ id: P,
23
+ className: U = ""
24
+ }) {
25
+ const D = m !== void 0, [B, F] = x(
26
+ I
27
+ ), d = D ? m : B, R = l.find((e) => e.value === d) ?? null, [s, b] = x(!1), [c, u] = x(
28
+ () => l.findIndex((e) => !e.disabled)
29
+ ), v = A({ buffer: "", lastTime: 0 }), p = A(null), g = A(null), H = X.useId(), S = P ?? H, w = `${S}-listbox`, T = `${S}-label`, M = h(() => {
30
+ r || b(!0);
31
+ }, [r]), W = h(() => {
32
+ b(!1), Y(p.current);
33
+ }, []), q = h(() => {
34
+ r || b((e) => !e);
35
+ }, [r]);
36
+ E(() => {
37
+ if (s)
38
+ return Z(g, () => b(!1));
39
+ }, [s]), E(() => {
40
+ if (!s) return;
41
+ const e = l.findIndex(
42
+ (n) => n.value === d && !n.disabled
43
+ ), t = e >= 0 ? e : l.findIndex((n) => !n.disabled);
44
+ u(t >= 0 ? t : -1), setTimeout(() => {
45
+ g.current?.focus();
46
+ }, 0);
47
+ }, [s, l, d]);
48
+ const $ = h(
49
+ (e) => {
50
+ if (e < 0 || e >= l.length) return;
51
+ const t = l[e];
52
+ t.disabled || (D || F(t.value), o?.(t.value), b(!1), p.current?.focus());
53
+ },
54
+ [D, l, o]
55
+ ), z = (e) => {
56
+ r || ["ArrowDown", "ArrowUp", " ", "Enter"].includes(e.key) && (e.preventDefault(), M());
57
+ }, G = (e) => {
58
+ const t = e.key;
59
+ if (t === "ArrowDown") {
60
+ e.preventDefault();
61
+ const n = j(l, c, 1);
62
+ n >= 0 && u(n);
63
+ } else if (t === "ArrowUp") {
64
+ e.preventDefault();
65
+ const n = j(l, c, -1);
66
+ n >= 0 && u(n);
67
+ } else if (t === "Home") {
68
+ e.preventDefault();
69
+ const n = l.findIndex((a) => !a.disabled);
70
+ n >= 0 && u(n);
71
+ } else if (t === "End") {
72
+ e.preventDefault();
73
+ const n = l.length - 1 - [...l].reverse().findIndex((a) => !a.disabled);
74
+ n >= 0 && u(n);
75
+ } else if (t === "Enter" || t === " ")
76
+ e.preventDefault(), c >= 0 && $(c);
77
+ else if (t === "Escape")
78
+ e.preventDefault(), W();
79
+ else if (t.length === 1 && t.match(/\S/)) {
80
+ const n = Date.now();
81
+ n - v.current.lastTime > 700 && (v.current.buffer = ""), v.current.buffer += t.toLowerCase(), v.current.lastTime = n;
82
+ const a = v.current.buffer, k = c >= 0 ? c + 1 : 0, O = l.length;
83
+ for (let C = 0; C < O; C++) {
84
+ const N = (k + C) % O, Q = String(l[N].label).toLowerCase();
85
+ if (!l[N].disabled && Q.startsWith(a)) {
86
+ u(N);
87
+ break;
88
+ }
89
+ }
90
+ }
91
+ }, J = (e) => {
92
+ $(e);
93
+ }, [y, K] = x(null);
94
+ return E(() => {
95
+ if (!s || !p.current) {
96
+ K(null);
97
+ return;
98
+ }
99
+ const e = p.current.getBoundingClientRect(), t = e.bottom + 6, n = e.left;
100
+ K({ top: t, left: n });
101
+ }, [s]), /* @__PURE__ */ V("div", { className: `ui-select ${U}`, children: [
102
+ L && /* @__PURE__ */ i("input", { type: "hidden", name: L, value: d ?? "" }),
103
+ /* @__PURE__ */ V(
104
+ "button",
105
+ {
106
+ ref: p,
107
+ id: T,
108
+ type: "button",
109
+ className: "ui-select-trigger",
110
+ "aria-haspopup": "listbox",
111
+ "aria-expanded": s,
112
+ "aria-controls": s ? w : void 0,
113
+ "aria-disabled": r || void 0,
114
+ onClick: () => q(),
115
+ onKeyDown: z,
116
+ disabled: r,
117
+ children: [
118
+ /* @__PURE__ */ i("span", { children: R ? /* @__PURE__ */ i("span", { children: R.label }) : /* @__PURE__ */ i("span", { className: "ui-select-placeholder", children: f }) }),
119
+ /* @__PURE__ */ i("span", { className: "ui-select-chevron", "aria-hidden": !0, children: "▾" })
120
+ ]
121
+ }
122
+ ),
123
+ s && y && /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
124
+ "div",
125
+ {
126
+ id: w,
127
+ ref: g,
128
+ className: "ui-select-listbox",
129
+ role: "listbox",
130
+ "aria-labelledby": T,
131
+ tabIndex: 0,
132
+ style: {
133
+ top: y.top,
134
+ left: y.left
135
+ },
136
+ onKeyDown: G,
137
+ children: l.map((e, t) => {
138
+ const n = d === e.value, a = c === t;
139
+ return /* @__PURE__ */ i(
140
+ "div",
141
+ {
142
+ id: `${w}-option-${t}`,
143
+ role: "option",
144
+ "aria-selected": n,
145
+ "aria-disabled": e.disabled || void 0,
146
+ className: "ui-select-option",
147
+ tabIndex: -1,
148
+ onMouseDown: (k) => k.preventDefault(),
149
+ onClick: () => !e.disabled && J(t),
150
+ style: {
151
+ outline: a ? "2px solid var(--color-primary)" : void 0
152
+ },
153
+ children: e.label
154
+ },
155
+ e.value
156
+ );
157
+ })
158
+ }
159
+ ) })
160
+ ] });
161
+ }
162
+ export {
163
+ ie as Select
164
+ };
165
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.js","sources":["../../../../src/components/select/Select.tsx"],"sourcesContent":["/**\r\n * Select.tsx\r\n * ----------\r\n * Accessible single-select (listbox) component.\r\n *\r\n * Features:\r\n * - WAI-ARIA listbox pattern\r\n * - Keyboard navigation (ArrowUp/ArrowDown, Home, End, Enter, Space, Esc)\r\n * - Typeahead support\r\n * - Controlled + uncontrolled modes\r\n * - Portal rendering for the listbox\r\n * - Click outside to close\r\n * - Proper ARIA attributes and relationships\r\n * - Hidden input for form compatibility (optional name prop)\r\n *\r\n * Usage:\r\n * <Select\r\n * options={[{ value: 'a', label: 'Apple' }, { value: 'b', label: 'Banana' }]}\r\n * value={value} // optional controlled value\r\n * onChange={(v) => setValue(v)} // required if controlled\r\n * placeholder=\"Select fruit\"\r\n * name=\"fruit\" // optional, adds hidden input\r\n * />\r\n */\r\n\r\nimport React, {\r\n useState,\r\n useRef,\r\n useEffect,\r\n useCallback,\r\n KeyboardEvent,\r\n} from 'react';\r\nimport './Select.css';\r\nimport { Portal, onClickOutside, restoreFocus } from '../../utils/index';\r\n\r\ntype Option = {\r\n value: string;\r\n label: React.ReactNode;\r\n disabled?: boolean;\r\n};\r\n\r\ninterface SelectProps {\r\n options: Option[];\r\n value?: string; // controlled value\r\n defaultValue?: string; // uncontrolled initial\r\n onChange?: (value: string) => void;\r\n placeholder?: string;\r\n disabled?: boolean;\r\n name?: string; // if provided, render hidden input for forms\r\n id?: string;\r\n className?: string;\r\n}\r\n\r\n/* Helper: find next enabled index given direction */\r\nfunction findNextEnabled(options: Option[], start: number, direction: 1 | -1) {\r\n const len = options.length;\r\n let i = start;\r\n for (let step = 0; step < len; step++) {\r\n i = (i + direction + len) % len;\r\n if (!options[i].disabled) return i;\r\n }\r\n return -1;\r\n}\r\n\r\nexport function Select({\r\n options,\r\n value,\r\n defaultValue,\r\n onChange,\r\n placeholder = 'Select...',\r\n disabled = false,\r\n name,\r\n id,\r\n className = '',\r\n}: SelectProps) {\r\n // Controlled vs uncontrolled\r\n const isControlled = value !== undefined;\r\n const [internalValue, setInternalValue] = useState<string | undefined>(\r\n defaultValue\r\n );\r\n const selectedValue = isControlled ? value : internalValue;\r\n\r\n const selectedOption = options.find((o) => o.value === selectedValue) ?? null;\r\n\r\n const [open, setOpen] = useState(false);\r\n const [activeIndex, setActiveIndex] = useState<number>(() =>\r\n options.findIndex((o) => !o.disabled)\r\n );\r\n\r\n // Typeahead buffer\r\n const typeaheadRef = useRef({ buffer: '', lastTime: 0 });\r\n\r\n // Refs\r\n const triggerRef = useRef<HTMLButtonElement | null>(null);\r\n const listRef = useRef<HTMLDivElement | null>(null);\r\n\r\n // Unique ids\r\n const reactId = React.useId();\r\n const baseId = id ?? reactId;\r\n const listboxId = `${baseId}-listbox`;\r\n const labelId = `${baseId}-label`;\r\n\r\n // Open/close helpers\r\n const openList = useCallback(() => {\r\n if (disabled) return;\r\n setOpen(true);\r\n }, [disabled]);\r\n\r\n const closeList = useCallback(() => {\r\n setOpen(false);\r\n // restore focus to trigger\r\n restoreFocus(triggerRef.current);\r\n }, []);\r\n\r\n // Toggle\r\n const toggleList = useCallback(() => {\r\n if (disabled) return;\r\n setOpen((s) => !s);\r\n }, [disabled]);\r\n\r\n // Click outside to close\r\n useEffect(() => {\r\n if (!open) return;\r\n return onClickOutside(listRef, () => setOpen(false));\r\n }, [open]);\r\n\r\n // Ensure that when opening, activeIndex is valid and focus moves to listbox\r\n useEffect(() => {\r\n if (!open) return;\r\n // set active to selected or first enabled\r\n const selIndex = options.findIndex(\r\n (o) => o.value === selectedValue && !o.disabled\r\n );\r\n const idx =\r\n selIndex >= 0 ? selIndex : options.findIndex((o) => !o.disabled);\r\n setActiveIndex(idx >= 0 ? idx : -1);\r\n\r\n // focus the list container so keyboard events are captured\r\n setTimeout(() => {\r\n listRef.current?.focus();\r\n }, 0);\r\n }, [open, options, selectedValue]);\r\n\r\n // Selection handler\r\n const selectIndex = useCallback(\r\n (i: number) => {\r\n if (i < 0 || i >= options.length) return;\r\n const opt = options[i];\r\n if (opt.disabled) return;\r\n if (!isControlled) setInternalValue(opt.value);\r\n onChange?.(opt.value);\r\n setOpen(false);\r\n // restore focus\r\n triggerRef.current?.focus();\r\n },\r\n [isControlled, options, onChange]\r\n );\r\n\r\n // Keyboard handling when trigger has focus\r\n const onTriggerKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\r\n if (disabled) return;\r\n if (['ArrowDown', 'ArrowUp', ' ', 'Enter'].includes(e.key)) {\r\n e.preventDefault();\r\n openList();\r\n }\r\n };\r\n\r\n // Keyboard handling when listbox has focus\r\n const onListKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\r\n const key = e.key;\r\n if (key === 'ArrowDown') {\r\n e.preventDefault();\r\n const next = findNextEnabled(options, activeIndex, 1);\r\n if (next >= 0) setActiveIndex(next);\r\n } else if (key === 'ArrowUp') {\r\n e.preventDefault();\r\n const prev = findNextEnabled(options, activeIndex, -1);\r\n if (prev >= 0) setActiveIndex(prev);\r\n } else if (key === 'Home') {\r\n e.preventDefault();\r\n const first = options.findIndex((o) => !o.disabled);\r\n if (first >= 0) setActiveIndex(first);\r\n } else if (key === 'End') {\r\n e.preventDefault();\r\n const last =\r\n options.length -\r\n 1 -\r\n [...options].reverse().findIndex((o) => !o.disabled);\r\n if (last >= 0) setActiveIndex(last);\r\n } else if (key === 'Enter' || key === ' ') {\r\n e.preventDefault();\r\n if (activeIndex >= 0) selectIndex(activeIndex);\r\n } else if (key === 'Escape') {\r\n e.preventDefault();\r\n closeList();\r\n } else if (key.length === 1 && key.match(/\\S/)) {\r\n // typeahead: accumulate buffer of characters\r\n const now = Date.now();\r\n if (now - typeaheadRef.current.lastTime > 700) {\r\n typeaheadRef.current.buffer = '';\r\n }\r\n typeaheadRef.current.buffer += key.toLowerCase();\r\n typeaheadRef.current.lastTime = now;\r\n\r\n const buf = typeaheadRef.current.buffer;\r\n const start = activeIndex >= 0 ? activeIndex + 1 : 0;\r\n const len = options.length;\r\n // search forward from next item, wrapping\r\n for (let i = 0; i < len; i++) {\r\n const idx = (start + i) % len;\r\n const lab = String(options[idx].label).toLowerCase();\r\n if (!options[idx].disabled && lab.startsWith(buf)) {\r\n setActiveIndex(idx);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Click on option\r\n const onOptionClick = (i: number) => {\r\n selectIndex(i);\r\n };\r\n\r\n // compute listbox position based on trigger\r\n const [pos, setPos] = useState<{ top: number; left: number } | null>(null);\r\n useEffect(() => {\r\n if (!open || !triggerRef.current) {\r\n setPos(null);\r\n return;\r\n }\r\n const rect = triggerRef.current.getBoundingClientRect();\r\n const top = rect.bottom + 6;\r\n const left = rect.left;\r\n setPos({ top, left });\r\n }, [open]);\r\n\r\n // render\r\n return (\r\n <div className={`ui-select ${className}`}>\r\n {/* Hidden input for form compatibility */}\r\n {name && <input type=\"hidden\" name={name} value={selectedValue ?? ''} />}\r\n\r\n <button\r\n ref={triggerRef}\r\n id={labelId}\r\n type=\"button\"\r\n className=\"ui-select-trigger\"\r\n aria-haspopup=\"listbox\"\r\n aria-expanded={open}\r\n aria-controls={open ? listboxId : undefined}\r\n aria-disabled={disabled || undefined}\r\n onClick={() => toggleList()}\r\n onKeyDown={onTriggerKeyDown}\r\n disabled={disabled}\r\n >\r\n <span>\r\n {selectedOption ? (\r\n <span>{selectedOption.label}</span>\r\n ) : (\r\n <span className=\"ui-select-placeholder\">{placeholder}</span>\r\n )}\r\n </span>\r\n <span className=\"ui-select-chevron\" aria-hidden>\r\n ▾\r\n </span>\r\n </button>\r\n\r\n {open && pos && (\r\n <Portal>\r\n <div\r\n id={listboxId}\r\n ref={listRef}\r\n className=\"ui-select-listbox\"\r\n role=\"listbox\"\r\n aria-labelledby={labelId}\r\n tabIndex={0}\r\n style={{\r\n top: pos.top,\r\n left: pos.left,\r\n }}\r\n onKeyDown={onListKeyDown}\r\n >\r\n {options.map((opt, i) => {\r\n const isSelected = selectedValue === opt.value;\r\n const isActive = activeIndex === i;\r\n return (\r\n <div\r\n key={opt.value}\r\n id={`${listboxId}-option-${i}`}\r\n role=\"option\"\r\n aria-selected={isSelected}\r\n aria-disabled={opt.disabled || undefined}\r\n className=\"ui-select-option\"\r\n tabIndex={-1}\r\n onMouseDown={(e) => e.preventDefault()} /* prevent blur */\r\n onClick={() => !opt.disabled && onOptionClick(i)}\r\n // Visual focus when active (not moving DOM focus)\r\n style={{\r\n outline: isActive\r\n ? '2px solid var(--color-primary)'\r\n : undefined,\r\n }}\r\n >\r\n {opt.label}\r\n </div>\r\n );\r\n })}\r\n </div>\r\n </Portal>\r\n )}\r\n </div>\r\n );\r\n}\r\n"],"names":["findNextEnabled","options","start","direction","len","i","step","Select","value","defaultValue","onChange","placeholder","disabled","name","id","className","isControlled","internalValue","setInternalValue","useState","selectedValue","selectedOption","o","open","setOpen","activeIndex","setActiveIndex","typeaheadRef","useRef","triggerRef","listRef","reactId","React","baseId","listboxId","labelId","openList","useCallback","closeList","restoreFocus","toggleList","s","useEffect","onClickOutside","selIndex","idx","selectIndex","opt","onTriggerKeyDown","onListKeyDown","key","next","prev","first","last","now","buf","lab","onOptionClick","pos","setPos","rect","top","left","jsxs","jsx","Portal","isSelected","isActive","e"],"mappings":";;;;;;AAsDA,SAASA,EAAgBC,GAAmBC,GAAeC,GAAmB;AAC5E,QAAMC,IAAMH,EAAQ;AACpB,MAAII,IAAIH;AACR,WAASI,IAAO,GAAGA,IAAOF,GAAKE;AAE7B,QADAD,KAAKA,IAAIF,IAAYC,KAAOA,GACxB,CAACH,EAAQI,CAAC,EAAE,SAAU,QAAOA;AAEnC,SAAO;AACT;AAEO,SAASE,GAAO;AAAA,EACrB,SAAAN;AAAA,EACA,OAAAO;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,IAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAgB;AAEd,QAAMC,IAAeR,MAAU,QACzB,CAACS,GAAeC,CAAgB,IAAIC;AAAA,IACxCV;AAAA,EAAA,GAEIW,IAAgBJ,IAAeR,IAAQS,GAEvCI,IAAiBpB,EAAQ,KAAK,CAACqB,MAAMA,EAAE,UAAUF,CAAa,KAAK,MAEnE,CAACG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ACV,UAAU;AAAA,cACV,aAAa,CAACsB,MAAMA,EAAE,eAAA;AAAA,cACtB,SAAS,MAAM,CAACtB,EAAI,YAAYW,EAAcrD,CAAC;AAAA,cAE/C,OAAO;AAAA,gBACL,SAAS+D,IACL,mCACA;AAAA,cAAA;AAAA,cAGL,UAAArB,EAAI;AAAA,YAAA;AAAA,YAhBAA,EAAI;AAAA,UAAA;AAAA,QAmBf,CAAC;AAAA,MAAA;AAAA,IAAA,EACH,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const i=require("./components/button/Button.cjs"),n=require("./components/modal/Modal.cjs"),e=require("./components/dropdown/Dropdown.cjs"),a=require("./components/input/Input.cjs"),u=require("./components/tabs/Tabs.cjs"),c=require("./components/tooltip/Tooltip.cjs"),o=require("./components/toast/Toast.cjs"),s=require("./components/accordion/Accordion.cjs"),d=require("./components/skeleton/Skeleton.cjs"),q=require("./components/slider/Slider.cjs"),p=require("./components/checkbox/Checkbox.cjs"),l=require("./components/radiogroup/RadioGroup.cjs"),T=require("./components/switch/Switch.cjs"),g=require("./components/datepicker/DatePicker.cjs"),C=require("./components/daterangepicker/DateRangePicker.cjs"),P=require("./components/drawer/Drawer.cjs"),S=require("./components/card/Card.cjs"),v=require("./components/alert/Alert.cjs"),D=require("./components/table/Table.cjs"),b=require("./components/badge/Badge.cjs"),m=require("./components/badge/BadgeGroup.cjs"),k=require("./components/avatar/Avatar.cjs"),w=require("./components/avatar/AvatarGroup.cjs"),x=require("./components/select/Select.cjs"),G=require("./components/combobox/Combobox.cjs"),M=require("./components/megamenu/MegaMenu.cjs"),h=require("./components/layout/Container.cjs"),A=require("./components/layout/Grid.cjs"),B=require("./components/layout/Flex.cjs"),R=require("./components/layout/Stack.cjs"),I=require("./components/layout/HStack.cjs"),F=require("./components/textarea/Textarea.cjs"),r=require("./components/popover/Popover.cjs"),H=require("./components/pagination/Pagination.cjs"),U=require("./components/breadcrumbs/Breadcrumbs.cjs"),V=require("./components/progress/Progress.cjs"),L=require("./components/spinner/Spinner.cjs"),N=require("./components/stepper/Stepper.cjs"),y=require("./components/chip/Chip.cjs"),f=require("./components/rating/Rating.cjs"),j=require("./components/hovercard/HoverCard.cjs"),O=require("./components/fileuploader/FileUploader.cjs"),z=require("./components/contextmenu/ContextMenu.cjs"),E=require("./components/commandpalette/CommandPalette.cjs"),J=require("./components/treeview/TreeView.cjs"),K=require("./components/datagrid/DataGrid.cjs"),Q=require("./components/virtuallist/VirtualList.cjs"),t=require("./theme/NUIProvider.cjs"),W=require("./theme/useTheme.cjs");exports.Button=i.Button;exports.Modal=n.Modal;exports.Dropdown=e.Dropdown;exports.DropdownItem=e.DropdownItem;exports.DropdownMenu=e.DropdownMenu;exports.DropdownTrigger=e.DropdownTrigger;exports.Input=a.Input;exports.Tabs=u.Tabs;exports.Tooltip=c.Tooltip;exports.Toast=o.Toast;exports.ToastProvider=o.ToastProvider;exports.useToast=o.useToast;exports.Accordion=s.Accordion;exports.Skeleton=d.Skeleton;exports.Slider=q.Slider;exports.Checkbox=p.Checkbox;exports.RadioGroup=l.RadioGroup;exports.Switch=T.Switch;exports.DatePicker=g.DatePicker;exports.DateRangePicker=C.DateRangePicker;exports.Drawer=P.Drawer;exports.Card=S.Card;exports.Alert=v.Alert;exports.Table=D.Table;exports.Badge=b.Badge;exports.BadgeGroup=m.BadgeGroup;exports.Avatar=k.Avatar;exports.AvatarGroup=w.AvatarGroup;exports.Select=x.Select;exports.Combobox=G.Combobox;exports.MegaMenu=M.MegaMenu;exports.Container=h.Container;exports.Grid=A.Grid;exports.Flex=B.Flex;exports.Stack=R.Stack;exports.HStack=I.HStack;exports.Textarea=F.Textarea;exports.Popover=r.Popover;exports.PopoverClose=r.PopoverClose;exports.PopoverContent=r.PopoverContent;exports.PopoverTrigger=r.PopoverTrigger;exports.Pagination=H.Pagination;exports.Breadcrumbs=U.Breadcrumbs;exports.Progress=V.Progress;exports.Spinner=L.Spinner;exports.Stepper=N.Stepper;exports.Chip=y.Chip;exports.Rating=f.Rating;exports.HoverCard=j.HoverCard;exports.FileUploader=O.FileUploader;exports.ContextMenu=z.ContextMenu;exports.CommandPalette=E.CommandPalette;exports.TreeView=J.TreeView;exports.DataGrid=K.DataGrid;exports.VirtualList=Q.VirtualList;exports.NUIProvider=t.NUIProvider;exports.ThemeContext=t.ThemeContext;exports.useTheme=W.useTheme;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,111 @@
1
+ /* empty css */
2
+ import { Button as t } from "./components/button/Button.js";
3
+ import { Modal as m } from "./components/modal/Modal.js";
4
+ import { Dropdown as f, DropdownItem as a, DropdownMenu as i, DropdownTrigger as n } from "./components/dropdown/Dropdown.js";
5
+ import { Input as l } from "./components/input/Input.js";
6
+ import { Tabs as T } from "./components/tabs/Tabs.js";
7
+ import { Tooltip as s } from "./components/tooltip/Tooltip.js";
8
+ import { Toast as P, ToastProvider as c, useToast as v } from "./components/toast/Toast.js";
9
+ import { Accordion as S } from "./components/accordion/Accordion.js";
10
+ import { Skeleton as b } from "./components/skeleton/Skeleton.js";
11
+ import { Slider as h } from "./components/slider/Slider.js";
12
+ import { Checkbox as M } from "./components/checkbox/Checkbox.js";
13
+ import { RadioGroup as B } from "./components/radiogroup/RadioGroup.js";
14
+ import { Switch as R } from "./components/switch/Switch.js";
15
+ import { DatePicker as H } from "./components/datepicker/DatePicker.js";
16
+ import { DateRangePicker as V } from "./components/daterangepicker/DateRangePicker.js";
17
+ import { Drawer as N } from "./components/drawer/Drawer.js";
18
+ import { Card as q } from "./components/card/Card.js";
19
+ import { Alert as z } from "./components/alert/Alert.js";
20
+ import { Table as J } from "./components/table/Table.js";
21
+ import { Badge as O } from "./components/badge/Badge.js";
22
+ import { BadgeGroup as W } from "./components/badge/BadgeGroup.js";
23
+ import { Avatar as Y } from "./components/avatar/Avatar.js";
24
+ import { AvatarGroup as _ } from "./components/avatar/AvatarGroup.js";
25
+ import { Select as oo } from "./components/select/Select.js";
26
+ import { Combobox as eo } from "./components/combobox/Combobox.js";
27
+ import { MegaMenu as po } from "./components/megamenu/MegaMenu.js";
28
+ import { Container as xo } from "./components/layout/Container.js";
29
+ import { Grid as ao } from "./components/layout/Grid.js";
30
+ import { Flex as no } from "./components/layout/Flex.js";
31
+ import { Stack as uo } from "./components/layout/Stack.js";
32
+ import { HStack as go } from "./components/layout/HStack.js";
33
+ import { Textarea as Co } from "./components/textarea/Textarea.js";
34
+ import { Popover as co, PopoverClose as vo, PopoverContent as Do, PopoverTrigger as So } from "./components/popover/Popover.js";
35
+ import { Pagination as bo } from "./components/pagination/Pagination.js";
36
+ import { Breadcrumbs as ho } from "./components/breadcrumbs/Breadcrumbs.js";
37
+ import { Progress as Mo } from "./components/progress/Progress.js";
38
+ import { Spinner as Bo } from "./components/spinner/Spinner.js";
39
+ import { Stepper as Ro } from "./components/stepper/Stepper.js";
40
+ import { Chip as Ho } from "./components/chip/Chip.js";
41
+ import { Rating as Vo } from "./components/rating/Rating.js";
42
+ import { HoverCard as No } from "./components/hovercard/HoverCard.js";
43
+ import { FileUploader as qo } from "./components/fileuploader/FileUploader.js";
44
+ import { ContextMenu as zo } from "./components/contextmenu/ContextMenu.js";
45
+ import { CommandPalette as Jo } from "./components/commandpalette/CommandPalette.js";
46
+ import { TreeView as Oo } from "./components/treeview/TreeView.js";
47
+ import { DataGrid as Wo } from "./components/datagrid/DataGrid.js";
48
+ import { VirtualList as Yo } from "./components/virtuallist/VirtualList.js";
49
+ import { NUIProvider as _o, ThemeContext as $o } from "./theme/NUIProvider.js";
50
+ import { useTheme as rr } from "./theme/useTheme.js";
51
+ export {
52
+ S as Accordion,
53
+ z as Alert,
54
+ Y as Avatar,
55
+ _ as AvatarGroup,
56
+ O as Badge,
57
+ W as BadgeGroup,
58
+ ho as Breadcrumbs,
59
+ t as Button,
60
+ q as Card,
61
+ M as Checkbox,
62
+ Ho as Chip,
63
+ eo as Combobox,
64
+ Jo as CommandPalette,
65
+ xo as Container,
66
+ zo as ContextMenu,
67
+ Wo as DataGrid,
68
+ H as DatePicker,
69
+ V as DateRangePicker,
70
+ N as Drawer,
71
+ f as Dropdown,
72
+ a as DropdownItem,
73
+ i as DropdownMenu,
74
+ n as DropdownTrigger,
75
+ qo as FileUploader,
76
+ no as Flex,
77
+ ao as Grid,
78
+ go as HStack,
79
+ No as HoverCard,
80
+ l as Input,
81
+ po as MegaMenu,
82
+ m as Modal,
83
+ _o as NUIProvider,
84
+ bo as Pagination,
85
+ co as Popover,
86
+ vo as PopoverClose,
87
+ Do as PopoverContent,
88
+ So as PopoverTrigger,
89
+ Mo as Progress,
90
+ B as RadioGroup,
91
+ Vo as Rating,
92
+ oo as Select,
93
+ b as Skeleton,
94
+ h as Slider,
95
+ Bo as Spinner,
96
+ uo as Stack,
97
+ Ro as Stepper,
98
+ R as Switch,
99
+ J as Table,
100
+ T as Tabs,
101
+ Co as Textarea,
102
+ $o as ThemeContext,
103
+ P as Toast,
104
+ c as ToastProvider,
105
+ s as Tooltip,
106
+ Oo as TreeView,
107
+ Yo as VirtualList,
108
+ rr as useTheme,
109
+ v as useToast
110
+ };
111
+ //# sourceMappingURL=index.js.map