@erxes/ui 4.0.0-v2.0 → 4.0.0-v2.2

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 (318) hide show
  1. package/README.md +11 -8
  2. package/dist/base.css +17 -4
  3. package/dist/components/accordion.d.ts +6 -7
  4. package/dist/components/accordion.js +8 -13
  5. package/dist/components/alert-dialog.d.ts +12 -11
  6. package/dist/components/alert-dialog.js +26 -29
  7. package/dist/components/alert.js +2 -2
  8. package/dist/components/avatar.d.ts +7 -5
  9. package/dist/components/avatar.js +30 -19
  10. package/dist/components/background-gradient-animation.d.ts +2 -11
  11. package/dist/components/background-gradient-animation.js +21 -50
  12. package/dist/components/badge.d.ts +3 -2
  13. package/dist/components/badge.js +36 -21
  14. package/dist/components/breadcrumb.d.ts +6 -4
  15. package/dist/components/breadcrumb.js +18 -14
  16. package/dist/components/button.d.ts +15 -7
  17. package/dist/components/button.js +46 -23
  18. package/dist/components/calendar.js +1 -1
  19. package/dist/components/card.js +1 -1
  20. package/dist/components/chart-config.d.ts +4 -18
  21. package/dist/components/chart-config.js +1 -6
  22. package/dist/components/charts.d.ts +1 -1
  23. package/dist/components/charts.js +20 -28
  24. package/dist/components/checkbox.d.ts +2 -3
  25. package/dist/components/checkbox.js +4 -6
  26. package/dist/components/choicebox-group.d.ts +1 -1
  27. package/dist/components/choicebox-group.js +5 -9
  28. package/dist/components/collapsible.d.ts +5 -9
  29. package/dist/components/collapsible.js +8 -25
  30. package/dist/components/color-picker.js +9 -8
  31. package/dist/components/combobox.d.ts +6 -6
  32. package/dist/components/combobox.js +19 -18
  33. package/dist/components/command-bar.js +22 -19
  34. package/dist/components/command.d.ts +18 -8
  35. package/dist/components/command.js +62 -26
  36. package/dist/components/context-menu.d.ts +17 -29
  37. package/dist/components/context-menu.js +20 -66
  38. package/dist/components/copy-text.js +7 -11
  39. package/dist/components/date-picker.js +21 -18
  40. package/dist/components/date-text-input.js +3 -3
  41. package/dist/components/date-time-input.d.ts +12 -0
  42. package/dist/components/date-time-input.js +21 -0
  43. package/dist/components/dialog.d.ts +17 -12
  44. package/dist/components/dialog.js +36 -32
  45. package/dist/components/drag-handle.d.ts +2 -2
  46. package/dist/components/drag-handle.js +0 -1
  47. package/dist/components/dropdown-menu.d.ts +35 -16
  48. package/dist/components/dropdown-menu.js +78 -37
  49. package/dist/components/empty.js +2 -2
  50. package/dist/components/form.d.ts +15 -6
  51. package/dist/components/form.js +34 -17
  52. package/dist/components/hover-card.d.ts +6 -5
  53. package/dist/components/hover-card.js +18 -9
  54. package/dist/components/info-card.js +5 -6
  55. package/dist/components/input-group.d.ts +22 -0
  56. package/dist/components/input-group.js +42 -0
  57. package/dist/components/input.d.ts +11 -2
  58. package/dist/components/input.js +21 -8
  59. package/dist/components/kbd.js +2 -2
  60. package/dist/components/label.d.ts +3 -3
  61. package/dist/components/label.js +9 -6
  62. package/dist/components/multiselect.d.ts +21 -6
  63. package/dist/components/multiselect.js +81 -127
  64. package/dist/components/on-demand.d.ts +17 -0
  65. package/dist/components/on-demand.js +42 -0
  66. package/dist/components/popover.d.ts +18 -9
  67. package/dist/components/popover.js +38 -13
  68. package/dist/components/radio-group.d.ts +5 -5
  69. package/dist/components/radio-group.js +23 -29
  70. package/dist/components/resizable.d.ts +8 -21
  71. package/dist/components/resizable.js +5 -10
  72. package/dist/components/scroll-area.d.ts +12 -7
  73. package/dist/components/scroll-area.js +18 -18
  74. package/dist/components/select.d.ts +22 -14
  75. package/dist/components/select.js +90 -51
  76. package/dist/components/separator.d.ts +3 -3
  77. package/dist/components/separator.js +8 -12
  78. package/dist/components/sheet.d.ts +15 -11
  79. package/dist/components/sheet.js +66 -50
  80. package/dist/components/sidebar/context.js +4 -4
  81. package/dist/components/sidebar/group.d.ts +9 -8
  82. package/dist/components/sidebar/group.js +18 -13
  83. package/dist/components/sidebar/layout.d.ts +7 -2
  84. package/dist/components/sidebar/layout.js +11 -3
  85. package/dist/components/sidebar/menu-sub.d.ts +4 -3
  86. package/dist/components/sidebar/menu-sub.js +13 -13
  87. package/dist/components/sidebar/menu.d.ts +6 -6
  88. package/dist/components/sidebar/menu.js +28 -40
  89. package/dist/components/sidebar/panel.js +38 -21
  90. package/dist/components/sidebar/root.d.ts +1 -2
  91. package/dist/components/sidebar/root.js +7 -8
  92. package/dist/components/sidebar/trigger.js +1 -1
  93. package/dist/components/sidebar-tree-indicator.js +4 -4
  94. package/dist/components/skeleton.d.ts +7 -1
  95. package/dist/components/skeleton.js +18 -2
  96. package/dist/components/slider.d.ts +5 -5
  97. package/dist/components/slider.js +20 -11
  98. package/dist/components/spinner.d.ts +2 -2
  99. package/dist/components/spinner.js +24 -188
  100. package/dist/components/string-array.js +2 -2
  101. package/dist/components/switch.d.ts +2 -3
  102. package/dist/components/switch.js +6 -8
  103. package/dist/components/table.d.ts +14 -3
  104. package/dist/components/table.js +33 -9
  105. package/dist/components/tabs.d.ts +34 -8
  106. package/dist/components/tabs.js +96 -23
  107. package/dist/components/text-overflow.d.ts +8 -10
  108. package/dist/components/text-overflow.js +33 -39
  109. package/dist/components/textarea.d.ts +8 -1
  110. package/dist/components/textarea.js +24 -3
  111. package/dist/components/toaster.d.ts +1 -0
  112. package/dist/components/toaster.js +41 -20
  113. package/dist/components/toggle-group.d.ts +5 -3
  114. package/dist/components/toggle-group.js +11 -12
  115. package/dist/components/toggle.d.ts +3 -4
  116. package/dist/components/toggle.js +6 -6
  117. package/dist/components/tooltip.d.ts +7 -6
  118. package/dist/components/tooltip.js +18 -8
  119. package/dist/components/upload.d.ts +7 -2
  120. package/dist/components/upload.js +28 -7
  121. package/dist/components.css +325 -0
  122. package/dist/constants/CountryPhoneCodes.d.ts +1 -1
  123. package/dist/constants/CountryPhoneCodes.js +2 -2
  124. package/dist/federation.d.ts +13 -0
  125. package/dist/federation.js +28 -0
  126. package/dist/fonts.css +1 -1
  127. package/dist/hooks/use-confirm.js +17 -19
  128. package/dist/hooks/use-toast.d.ts +14 -16
  129. package/dist/hooks/use-toast.js +13 -108
  130. package/dist/index.d.ts +13 -8
  131. package/dist/index.js +11 -7
  132. package/dist/lib/cn-tables.d.ts +27 -0
  133. package/dist/lib/cn-tables.js +128 -0
  134. package/dist/lib/utils.d.ts +14 -2
  135. package/dist/lib/utils.js +14 -6
  136. package/dist/modules/attachments/attachment-media.js +56 -56
  137. package/dist/modules/blocks/components/BarcodeAttribute.js +11 -8
  138. package/dist/modules/blocks/components/BarcodeSizeSettings.js +5 -6
  139. package/dist/modules/blocks/components/BlockEditor.js +14 -4
  140. package/dist/modules/blocks/components/BlockEditorInlineContent.d.ts +26 -36
  141. package/dist/modules/blocks/components/BlockEditorInlineContent.js +2 -2
  142. package/dist/modules/blocks/components/BlockToolbar.d.ts +6 -0
  143. package/dist/modules/blocks/components/BlockToolbar.js +19 -4
  144. package/dist/modules/blocks/components/CustomFileBlock.d.ts +13 -39
  145. package/dist/modules/blocks/components/CustomFileBlock.js +8 -9
  146. package/dist/modules/blocks/components/CustomImageBlock.d.ts +28 -78
  147. package/dist/modules/blocks/components/CustomImageBlock.js +20 -99
  148. package/dist/modules/blocks/components/CustomVideoBlock.d.ts +26 -63
  149. package/dist/modules/blocks/components/CustomVideoBlock.js +10 -8
  150. package/dist/modules/blocks/components/DocumentPlaceholderBlock.d.ts +13 -39
  151. package/dist/modules/blocks/components/DocumentPlaceholderBlock.js +1 -2
  152. package/dist/modules/blocks/components/Editor.d.ts +1 -1
  153. package/dist/modules/blocks/components/Editor.js +5 -4
  154. package/dist/modules/blocks/components/FontFamilyButton.js +25 -21
  155. package/dist/modules/blocks/components/FontSizeButton.js +26 -22
  156. package/dist/modules/blocks/components/GalleryBlock.d.ts +7 -25
  157. package/dist/modules/blocks/components/GalleryBlock.js +2 -35
  158. package/dist/modules/blocks/components/GalleryBlockContent.js +8 -3
  159. package/dist/modules/blocks/components/GalleryBlockParts.js +23 -21
  160. package/dist/modules/blocks/components/GalleryExternalHtml.d.ts +2 -0
  161. package/dist/modules/blocks/components/GalleryExternalHtml.js +36 -0
  162. package/dist/modules/blocks/components/ImageExternalHtml.d.ts +2 -0
  163. package/dist/modules/blocks/components/ImageExternalHtml.js +51 -0
  164. package/dist/modules/blocks/components/ImageStyleButton.js +22 -18
  165. package/dist/modules/blocks/components/LazyEditor.d.ts +9 -0
  166. package/dist/modules/blocks/components/LazyEditor.js +14 -0
  167. package/dist/modules/blocks/components/MediaBlockWrapper.d.ts +24 -0
  168. package/dist/modules/blocks/components/MediaBlockWrapper.js +98 -0
  169. package/dist/modules/blocks/components/SlashMenu.js +2 -2
  170. package/dist/modules/blocks/components/SuggestionMenu.js +5 -6
  171. package/dist/modules/blocks/components/TableColorPicker.d.ts +1 -1
  172. package/dist/modules/blocks/components/TableColorPicker.js +20 -27
  173. package/dist/modules/blocks/components/TableHandleWithRemove.js +34 -50
  174. package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.d.ts +2 -2
  175. package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.js +3 -4
  176. package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.d.ts +2 -2
  177. package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +3 -4
  178. package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.d.ts +3 -0
  179. package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.js +8 -0
  180. package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.js +1 -1
  181. package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.d.ts +2 -2
  182. package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +5 -16
  183. package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.d.ts +1 -1
  184. package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.js +24 -20
  185. package/dist/modules/blocks/constant/blockEditorSchema.d.ts +268 -653
  186. package/dist/modules/blocks/constant/blockEditorSchema.js +33 -41
  187. package/dist/modules/blocks/constant/galleryBlockConfig.d.ts +1 -2
  188. package/dist/modules/blocks/constant/imageBlockConfig.d.ts +46 -0
  189. package/dist/modules/blocks/constant/imageBlockConfig.js +39 -0
  190. package/dist/modules/blocks/constant/toolbar/editorUIComponents.d.ts +2 -3
  191. package/dist/modules/blocks/constant/toolbar/editorUIComponents.js +7 -9
  192. package/dist/modules/blocks/hooks/toolbar/useCodeActive.js +5 -7
  193. package/dist/modules/blocks/hooks/toolbar/useStringStyle.d.ts +9 -0
  194. package/dist/modules/blocks/hooks/toolbar/useStringStyle.js +27 -0
  195. package/dist/modules/blocks/hooks/useBlockEditor.d.ts +2 -0
  196. package/dist/modules/blocks/hooks/useBlockEditor.js +9 -3
  197. package/dist/modules/blocks/hooks/useEditorValue.d.ts +2 -1
  198. package/dist/modules/blocks/hooks/useEditorValue.js +8 -19
  199. package/dist/modules/blocks/types/TextEditor.d.ts +3 -1
  200. package/dist/modules/blocks/types/toolbar/ImageStyleOption.d.ts +1 -1
  201. package/dist/modules/blocks/utils/getSlashMenuItems.js +0 -15
  202. package/dist/modules/blocks/utils/parseBlocks.d.ts +3 -1
  203. package/dist/modules/blocks/utils/parseBlocks.js +14 -1
  204. package/dist/modules/display/components/EmailDisplay.js +26 -27
  205. package/dist/modules/display/components/PhoneDisplay.js +2 -2
  206. package/dist/modules/display/components/RelativeDateDisplay.d.ts +2 -2
  207. package/dist/modules/display/components/RelativeDateDisplay.js +7 -10
  208. package/dist/modules/filter/components/FilterBar.js +6 -6
  209. package/dist/modules/filter/components/FilterDialog.js +13 -20
  210. package/dist/modules/filter/components/FilterPopover.js +20 -28
  211. package/dist/modules/hotkey/components/PopoverScoped.d.ts +5 -4
  212. package/dist/modules/hotkey/components/PopoverScoped.js +5 -5
  213. package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +3 -3
  214. package/dist/modules/hotkey/hooks/useScopedHotkeys.js +15 -24
  215. package/dist/modules/icons/components/IconComponent.d.ts +1 -1
  216. package/dist/modules/icons/components/IconPicker.js +15 -14
  217. package/dist/modules/inputs/components/ContactFieldParts.js +13 -14
  218. package/dist/modules/inputs/components/EmailFieldForm.js +2 -3
  219. package/dist/modules/inputs/components/FullNameField.js +6 -4
  220. package/dist/modules/inputs/components/PhoneFieldForm.js +2 -1
  221. package/dist/modules/layout/components/AppLayout.js +18 -20
  222. package/dist/modules/layout/components/AppLayoutPageSlot.js +1 -1
  223. package/dist/modules/layout/components/AppLayoutResizeHandle.js +1 -1
  224. package/dist/modules/layout/components/Page.d.ts +6 -1
  225. package/dist/modules/layout/components/Page.js +11 -3
  226. package/dist/modules/layout/components/PageHeader.d.ts +10 -3
  227. package/dist/modules/layout/components/PageHeader.js +23 -5
  228. package/dist/modules/navigation-menu/components/NavigationMenu.js +12 -15
  229. package/dist/modules/pickers/EntityPicker.d.ts +30 -0
  230. package/dist/modules/pickers/EntityPicker.js +60 -0
  231. package/dist/modules/pickers/SelectMember.d.ts +41 -0
  232. package/dist/modules/pickers/SelectMember.js +122 -0
  233. package/dist/modules/pickers/members.d.ts +30 -0
  234. package/dist/modules/pickers/members.js +18 -0
  235. package/dist/modules/record-field/components/NumberField.d.ts +2 -2
  236. package/dist/modules/record-field/components/NumberField.js +22 -25
  237. package/dist/modules/record-field/components/TextField.d.ts +3 -3
  238. package/dist/modules/record-field/components/TextField.js +25 -28
  239. package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +3 -1
  240. package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +18 -12
  241. package/dist/modules/record-table/components/CheckboxColumn.d.ts +4 -3
  242. package/dist/modules/record-table/components/CheckboxColumn.js +52 -35
  243. package/dist/modules/record-table/components/MoreColumn.js +4 -3
  244. package/dist/modules/record-table/components/RecordTable.d.ts +3 -2
  245. package/dist/modules/record-table/components/RecordTable.js +2 -1
  246. package/dist/modules/record-table/components/RecordTableCell.d.ts +6 -3
  247. package/dist/modules/record-table/components/RecordTableCell.js +17 -11
  248. package/dist/modules/record-table/components/RecordTableCellInline.d.ts +15 -4
  249. package/dist/modules/record-table/components/RecordTableCellInline.js +48 -24
  250. package/dist/modules/record-table/components/RecordTableColumnSelector.d.ts +1 -2
  251. package/dist/modules/record-table/components/RecordTableColumnSelector.js +48 -45
  252. package/dist/modules/record-table/components/RecordTableContainer.d.ts +8 -3
  253. package/dist/modules/record-table/components/RecordTableContainer.js +28 -16
  254. package/dist/modules/record-table/components/RecordTableCursor.js +4 -4
  255. package/dist/modules/record-table/components/RecordTableHead.d.ts +9 -4
  256. package/dist/modules/record-table/components/RecordTableHead.js +40 -34
  257. package/dist/modules/record-table/components/RecordTableHeader.js +24 -15
  258. package/dist/modules/record-table/components/RecordTableProvider.d.ts +30 -7
  259. package/dist/modules/record-table/components/RecordTableProvider.js +32 -22
  260. package/dist/modules/record-table/components/RecordTableRoot.d.ts +2 -1
  261. package/dist/modules/record-table/components/RecordTableRoot.js +7 -12
  262. package/dist/modules/record-table/components/RecordTableRow.d.ts +8 -1
  263. package/dist/modules/record-table/components/RecordTableRow.js +13 -12
  264. package/dist/modules/record-table/components/RecordTableRowList.d.ts +6 -1
  265. package/dist/modules/record-table/components/RecordTableRowList.js +28 -20
  266. package/dist/modules/record-table/components/RecordTableRowSkeleton.js +8 -12
  267. package/dist/modules/record-table/hooks/useColumnLayout.d.ts +2 -2
  268. package/dist/modules/record-table/hooks/useColumnLayout.js +8 -5
  269. package/dist/modules/record-table/hooks/useTablePreferences.d.ts +5 -5
  270. package/dist/modules/record-table/hooks/useTablePreferences.js +3 -3
  271. package/dist/modules/record-table/utils/columnLayout.d.ts +4 -4
  272. package/dist/modules/record-table/utils/columnLayout.js +7 -7
  273. package/dist/modules/record-table/utils/columnUtils.d.ts +3 -2
  274. package/dist/modules/record-table/utils/rowFields.d.ts +1 -0
  275. package/dist/modules/record-table/utils/rowFields.js +10 -9
  276. package/dist/state/sidebarPanelState.d.ts +5 -1
  277. package/dist/state/sidebarPanelState.js +4 -1
  278. package/dist/styles.css +3 -0
  279. package/dist/theme.css +104 -70
  280. package/dist/utils/file-storage.d.ts +1 -1
  281. package/dist/utils/plugin-runtime.d.ts +1 -1
  282. package/dist/utils/plugin-styles.d.ts +6 -0
  283. package/dist/utils/plugin-styles.js +53 -0
  284. package/dist/utils/record-timeline.d.ts +1 -1
  285. package/dist/utils/record-timeline.js +1 -1
  286. package/package.json +27 -22
  287. package/dist/components/multiselect-options.d.ts +0 -16
  288. package/dist/components/multiselect-options.js +0 -13
  289. package/dist/components/multiselect-parts.d.ts +0 -23
  290. package/dist/components/multiselect-parts.js +0 -62
  291. package/dist/components/multiselect-state.d.ts +0 -66
  292. package/dist/components/multiselect-state.js +0 -131
  293. package/dist/components/time-picker.d.ts +0 -10
  294. package/dist/components/time-picker.js +0 -33
  295. package/dist/components/toasts.d.ts +0 -21
  296. package/dist/components/toasts.js +0 -69
  297. package/dist/modules/blocks/hooks/toolbar/useFontFamily.d.ts +0 -2
  298. package/dist/modules/blocks/hooks/toolbar/useFontFamily.js +0 -24
  299. package/dist/modules/blocks/hooks/toolbar/useFontSize.d.ts +0 -2
  300. package/dist/modules/blocks/hooks/toolbar/useFontSize.js +0 -24
  301. package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.d.ts +0 -6
  302. package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.js +0 -0
  303. package/dist/modules/blocks/types/toolbar/FontFamily.d.ts +0 -5
  304. package/dist/modules/blocks/types/toolbar/FontFamily.js +0 -0
  305. package/dist/modules/blocks/types/toolbar/FontSize.d.ts +0 -5
  306. package/dist/modules/blocks/types/toolbar/FontSize.js +0 -0
  307. package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.d.ts +0 -4
  308. package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.js +0 -0
  309. package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.d.ts +0 -3
  310. package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.js +0 -0
  311. package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.d.ts +0 -2
  312. package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.js +0 -30
  313. package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.d.ts +0 -2
  314. package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.js +0 -41
  315. package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.d.ts +0 -9
  316. package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.js +0 -15
  317. package/dist/modules/hotkey/states/internal/pendingHotkeyState.d.ts +0 -4
  318. package/dist/modules/hotkey/states/internal/pendingHotkeyState.js +0 -4
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # @erxes/ui
2
2
 
3
3
  Published as `@erxes/ui` under the `v2-next` dist-tag and imported as `erxes-ui`: plugins install
4
- `"erxes-ui": "npm:@erxes/ui@v2-next"`, `apps/core-ui` depends on `"erxes-ui": "workspace:@erxes/ui@*"`,
4
+ `"erxes-ui": "npm:@erxes/ui@v2-next"`, `apps/web` depends on `"erxes-ui": "workspace:@erxes/ui@*"`,
5
5
  and the Module Federation shared key is `erxes-ui`. The `latest` and `next` tags belong to old
6
6
  erxes's 3.x.
7
7
 
8
- The design system core-ui and plugin UIs share: UI primitives, layout, record tables, filters,
8
+ The design system web and plugin UIs share: UI primitives, layout, record tables, filters,
9
9
  the block editor, hooks and shared state. In the workspace `exports` point at `src/` and
10
- `apps/core-ui` compiles it. `pnpm build` (tsdown) writes the publishable `dist/`, one module and
10
+ `apps/web` compiles it. `pnpm build` (tsdown) writes the publishable `dist/`, one module and
11
11
  `.d.ts` per source file, and checks the packed package with publint and attw; `publishConfig`
12
12
  holds the `exports` a published copy uses.
13
13
 
14
14
  ## Who imports it
15
15
 
16
- - `apps/core-ui` imports `erxes-ui` and, for a few files, `erxes-ui/<path>` (the `./*` export).
16
+ - `apps/web` imports `erxes-ui` and, for a few files, `erxes-ui/<path>` (the `./*` export).
17
17
  - Plugin UIs get `erxes-ui` from the host as a Module Federation singleton and import only the
18
18
  root, `src/index.ts`. A removed export breaks them at runtime, not at build time.
19
19
 
@@ -21,12 +21,15 @@ holds the `exports` a published copy uses.
21
21
 
22
22
  Only what something uses:
23
23
 
24
- - what core-ui imports,
24
+ - what web imports,
25
25
  - what plugin UIs import (the HR plugin is the first consumer),
26
26
  - the plugin API in the plugin skills: `getPluginRuntime`, `pluginFetch`, `pluginJson`,
27
- `useLiveSignal`, `RecordTimeline`, `getPluginAssetsUrl` and the `IUIConfig` types,
27
+ `useLiveSignal`, `RecordTimeline`, `getPluginAssetsUrl`, `addPluginStyles` and the `IUIConfig` types,
28
28
  - the design-system primitives in `src/components` (Accordion, Card, Slider …), even unused,
29
- because plugins build on them.
29
+ because plugins build on them,
30
+ - the pickers in `src/modules/pickers`: `EntityPicker`, and `SelectMember`, `MemberInline` and
31
+ `useMembersById`, which take `memberQueries` from `@erxes/core-contract/client`. They read
32
+ through TanStack query options, so erxes-ui imports nothing from core.
30
33
 
31
34
  Anything else is removed, not kept "in case". Before you remove an export, check the HR plugin
32
35
  UI and `.agents/skills/plugin-contract/SKILL.md`.
@@ -35,4 +38,4 @@ UI and `.agents/skills/plugin-contract/SKILL.md`.
35
38
 
36
39
  `styles.css` builds Tailwind from this package's sources and imports `theme.css` (tokens) and
37
40
  `base.css` (page defaults, light and dark theme). `fonts.css` loads Inter and Roboto Mono for an
38
- app not hosted by core-ui.
41
+ app not hosted by web.
package/dist/base.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Default erxes theme and page defaults, shared by every app that hosts erxes
3
- UI: core-ui, standalone product apps and the published erxes-ui styles.
3
+ UI: web, standalone product apps and the published erxes-ui styles.
4
4
  theme.css maps Tailwind utilities to these tokens; plugin remotes import only
5
5
  theme.css, because the host page already declares the values below.
6
6
  Import after Tailwind and theme.css, so `@apply` resolves.
@@ -15,13 +15,16 @@
15
15
 
16
16
  --primary: oklch(0.514 0.2276 276.98);
17
17
  --primary-foreground: oklch(0.9848 0 0);
18
+ /* Primary as text (links, active items): dark mode's --primary reads at 2.6:1 on dark surfaces. */
19
+ --primary-text: var(--primary);
18
20
 
19
21
  --secondary: oklch(0.8372 0.0563 288.17);
20
22
  --muted: oklch(0.9619 0 0);
21
- --muted-foreground: oklch(0.5509 0.0057 17.33);
23
+ --muted-foreground: oklch(0.52 0.0057 17.33);
22
24
 
23
25
  --accent: oklch(0.9688 0.0008 286.38);
24
- --accent-foreground: oklch(0.7258 0.0074 286.21);
26
+ /* Field labels, placeholders and table heads use it as text: 4.5:1 on white and on --muted (WCAG AA). */
27
+ --accent-foreground: oklch(0.52 0.0074 286.21);
25
28
 
26
29
  --destructive: oklch(0.6368 0.2078 25.33);
27
30
  --destructive-foreground: oklch(0.9848 0 0);
@@ -29,6 +32,11 @@
29
32
  --success: oklch(0.7205 0.192 149.49);
30
33
  --warning: oklch(0.7453 0.1322 54.63);
31
34
  --info: oklch(0.6261 0.1859 259.6);
35
+ /* Status colours as text on their own 10% tint (badges): 4.5:1 or more. */
36
+ --success-text: oklch(0.47 0.14 149.49);
37
+ --warning-text: oklch(0.5 0.12 54.63);
38
+ --destructive-text: oklch(0.5 0.19 25.33);
39
+ --info-text: oklch(0.5 0.17 259.6);
32
40
 
33
41
  --scroll: oklch(0.8634 0.0059 286.27);
34
42
  --border: oklch(0.9197 0.0041 286.32);
@@ -66,13 +74,14 @@
66
74
 
67
75
  --primary: oklch(0.514 0.2276 276.98);
68
76
  --primary-foreground: oklch(0.9848 0 0);
77
+ --primary-text: oklch(0.7 0.15 276.98);
69
78
 
70
79
  --secondary: oklch(0.2219 0.0798 280.68);
71
80
  --muted: oklch(0.2591 0 0);
72
81
  --muted-foreground: oklch(0.7132 0.0043 17.26);
73
82
 
74
83
  --accent: oklch(0.245 0.0037 286.12);
75
- --accent-foreground: oklch(0.5278 0.0102 286.05);
84
+ --accent-foreground: oklch(0.7132 0.0102 286.05);
76
85
 
77
86
  --destructive: oklch(0.6368 0.2078 25.33);
78
87
  --destructive-foreground: oklch(0.98 0.01 257);
@@ -80,6 +89,10 @@
80
89
  --success: oklch(0.7205 0.192 149.49);
81
90
  --warning: oklch(0.7453 0.1322 54.63);
82
91
  --info: oklch(0.6261 0.1859 259.6);
92
+ --success-text: var(--success);
93
+ --warning-text: var(--warning);
94
+ --destructive-text: oklch(0.72 0.17 25.33);
95
+ --info-text: oklch(0.72 0.15 259.6);
83
96
 
84
97
  --scroll: oklch(0.3701 0.0113 285.84);
85
98
  --border: oklch(0.28 0.0104 285.76);
@@ -1,11 +1,10 @@
1
- import React from "react";
2
- import { Accordion as Accordion$1 } from "radix-ui";
3
- declare const AccordionItem: ({ ref, className, ...props }: React.ComponentProps<typeof Accordion$1.Item>) => React.JSX.Element;
4
- declare const AccordionTrigger: ({ ref, className, children, ...props }: React.ComponentProps<typeof Accordion$1.Trigger>) => React.JSX.Element;
5
- declare const AccordionContent: ({ ref, className, children, ...props }: React.ComponentProps<typeof Accordion$1.Content>) => React.JSX.Element;
6
- export declare const Accordion: React.ForwardRefExoticComponent<(Accordion$1.AccordionMultipleProps | Accordion$1.AccordionSingleProps) & React.RefAttributes<HTMLDivElement>> & {
1
+ import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
2
+ declare const AccordionItem: ({ className, ...props }: Accordion$1.Item.Props) => import("react").JSX.Element;
3
+ declare const AccordionTrigger: ({ className, children, ...props }: Accordion$1.Trigger.Props) => import("react").JSX.Element;
4
+ declare const AccordionPanel: ({ className, children, ...props }: Accordion$1.Panel.Props) => import("react").JSX.Element;
5
+ export declare const Accordion: (<Value = any>(props: Accordion$1.Root.Props<Value>) => React.JSX.Element) & {
7
6
  Item: typeof AccordionItem;
8
7
  Trigger: typeof AccordionTrigger;
9
- Content: typeof AccordionContent;
8
+ Panel: typeof AccordionPanel;
10
9
  };
11
10
  export {};
@@ -1,20 +1,16 @@
1
1
  import { cn } from "../lib/utils.js";
2
- import "react";
3
- import { Accordion as Accordion$1 } from "radix-ui";
2
+ import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
4
3
  import { IconChevronDown } from "@tabler/icons-react";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
6
5
  // src/components/accordion.tsx
7
- const AccordionRoot = Accordion$1.Root;
8
- const AccordionItem = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
9
- ref,
6
+ const AccordionItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
10
7
  className: cn("border-b border-border", className),
11
8
  ...props
12
9
  });
13
- const AccordionTrigger = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
10
+ const AccordionTrigger = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
14
11
  className: "flex",
15
12
  children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
16
- ref,
17
- className: cn("flex flex-1 items-center justify-between py-4 text-left font-semibold transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className),
13
+ className: cn("flex flex-1 items-center justify-between py-4 text-left font-semibold transition-all hover:underline [&[data-panel-open]>svg]:rotate-180", className),
18
14
  ...props,
19
15
  children: [children, /* @__PURE__ */ jsx(IconChevronDown, {
20
16
  className: "shrink-0 opacity-60 transition-transform duration-200 size-4",
@@ -22,18 +18,17 @@ const AccordionTrigger = ({ ref, className, children, ...props }) => /* @__PURE_
22
18
  })]
23
19
  })
24
20
  });
25
- const AccordionContent = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Content, {
26
- ref,
27
- className: "overflow-y-clip text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
21
+ const AccordionPanel = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Panel, {
22
+ className: "overflow-y-clip text-sm transition-all data-closed:animate-accordion-up data-open:animate-accordion-down",
28
23
  ...props,
29
24
  children: /* @__PURE__ */ jsx("div", {
30
25
  className: cn("pb-4 pt-0", className),
31
26
  children
32
27
  })
33
28
  });
34
- const Accordion = Object.assign(AccordionRoot, {
29
+ const Accordion = Object.assign(Accordion$1.Root, {
35
30
  Item: AccordionItem,
36
31
  Trigger: AccordionTrigger,
37
- Content: AccordionContent
32
+ Panel: AccordionPanel
38
33
  });
39
34
  export { Accordion };
@@ -1,23 +1,24 @@
1
+ import { buttonVariants } from "./button.js";
1
2
  import React from "react";
2
- import { AlertDialog as AlertDialog$1 } from "radix-ui";
3
- declare const AlertDialogOverlay: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Overlay>) => React.JSX.Element;
4
- declare const AlertDialogContent: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Content>) => React.JSX.Element;
3
+ import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
4
+ import { VariantProps } from "class-variance-authority";
5
+ declare const AlertDialogContent: ({ className, initialFocus, ...props }: AlertDialog$1.Popup.Props) => React.JSX.Element;
5
6
  declare const AlertDialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
6
7
  declare const AlertDialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
7
- declare const AlertDialogTitle: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>) => React.JSX.Element;
8
- declare const AlertDialogDescription: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>) => React.JSX.Element;
9
- declare const AlertDialogAction: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Action>) => React.JSX.Element;
10
- declare const AlertDialogCancel: ({ ref, className, ...props }: React.ComponentProps<typeof AlertDialog$1.Cancel>) => React.JSX.Element;
11
- export declare const AlertDialog: React.FC<AlertDialog$1.AlertDialogProps> & {
8
+ declare const AlertDialogTitle: ({ className, ...props }: AlertDialog$1.Title.Props) => React.JSX.Element;
9
+ declare const AlertDialogDescription: ({ className, ...props }: AlertDialog$1.Description.Props) => React.JSX.Element;
10
+ /** Both buttons close the dialog; Action is the primary one. */
11
+ type AlertDialogButtonProps = AlertDialog$1.Close.Props & Pick<VariantProps<typeof buttonVariants>, 'variant'>;
12
+ declare const AlertDialogAction: ({ className, variant, ...props }: AlertDialogButtonProps) => React.JSX.Element;
13
+ declare const AlertDialogCancel: ({ className, variant, ...props }: AlertDialogButtonProps) => React.JSX.Element;
14
+ export declare const AlertDialog: typeof AlertDialog$1.Root & {
12
15
  Action: typeof AlertDialogAction;
13
16
  Cancel: typeof AlertDialogCancel;
14
17
  Content: typeof AlertDialogContent;
15
18
  Description: typeof AlertDialogDescription;
16
19
  Footer: typeof AlertDialogFooter;
17
20
  Header: typeof AlertDialogHeader;
18
- Overlay: typeof AlertDialogOverlay;
19
- Portal: React.FC<AlertDialog$1.AlertDialogPortalProps>;
20
21
  Title: typeof AlertDialogTitle;
21
- Trigger: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
22
+ Trigger: AlertDialog$1.Trigger;
22
23
  };
23
24
  export {};
@@ -1,22 +1,24 @@
1
1
  import { buttonVariants } from "./button.js";
2
2
  import { cn } from "../lib/utils.js";
3
- import "react";
4
- import { AlertDialog as AlertDialog$1 } from "radix-ui";
5
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { createContext, use, useRef } from "react";
5
+ import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
6
6
  // src/components/alert-dialog.tsx
7
- const AlertDialogRoot = AlertDialog$1.Root;
8
- const AlertDialogTrigger = AlertDialog$1.Trigger;
9
- const AlertDialogPortal = AlertDialog$1.Portal;
10
- const AlertDialogOverlay = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
11
- className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className),
12
- ...props,
13
- ref
14
- });
15
- const AlertDialogContent = ({ ref, className, ...props }) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
16
- ref,
17
- className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg", className),
18
- ...props
19
- })] });
7
+ const CancelRefContext = createContext(null);
8
+ const AlertDialogContent = ({ className, initialFocus, ...props }) => {
9
+ const cancelRef = useRef(null);
10
+ return /* @__PURE__ */ jsx(CancelRefContext, {
11
+ value: cancelRef,
12
+ children: /* @__PURE__ */ jsxs(AlertDialog$1.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
13
+ forceRender: true,
14
+ className: "fixed inset-0 z-50 bg-black/80 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0"
15
+ }), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
16
+ initialFocus: initialFocus ?? cancelRef,
17
+ className: cn("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-closed:slide-out-to-top-1/2 data-open:slide-in-from-top-1/2 sm:rounded-lg", className),
18
+ ...props
19
+ })] })
20
+ });
21
+ };
20
22
  const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
21
23
  className: cn("flex flex-col space-y-2 text-center sm:text-left", className),
22
24
  ...props
@@ -25,36 +27,31 @@ const AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div"
25
27
  className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
26
28
  ...props
27
29
  });
28
- const AlertDialogTitle = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Title, {
29
- ref,
30
+ const AlertDialogTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Title, {
30
31
  className: cn("text-lg font-semibold", className),
31
32
  ...props
32
33
  });
33
- const AlertDialogDescription = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Description, {
34
- ref,
34
+ const AlertDialogDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Description, {
35
35
  className: cn("text-sm text-muted-foreground", className),
36
36
  ...props
37
37
  });
38
- const AlertDialogAction = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Action, {
39
- ref,
40
- className: cn(buttonVariants(), className),
38
+ const AlertDialogAction = ({ className, variant, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Close, {
39
+ className: cn(buttonVariants({ variant }), className),
41
40
  ...props
42
41
  });
43
- const AlertDialogCancel = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Cancel, {
44
- ref,
45
- className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
42
+ const AlertDialogCancel = ({ className, variant = "outline", ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Close, {
43
+ ref: use(CancelRefContext),
44
+ className: cn(buttonVariants({ variant }), "mt-2 sm:mt-0", className),
46
45
  ...props
47
46
  });
48
- const AlertDialog = Object.assign(AlertDialogRoot, {
47
+ const AlertDialog = Object.assign(AlertDialog$1.Root, {
49
48
  Action: AlertDialogAction,
50
49
  Cancel: AlertDialogCancel,
51
50
  Content: AlertDialogContent,
52
51
  Description: AlertDialogDescription,
53
52
  Footer: AlertDialogFooter,
54
53
  Header: AlertDialogHeader,
55
- Overlay: AlertDialogOverlay,
56
- Portal: AlertDialogPortal,
57
54
  Title: AlertDialogTitle,
58
- Trigger: AlertDialogTrigger
55
+ Trigger: AlertDialog$1.Trigger
59
56
  });
60
57
  export { AlertDialog };
@@ -1,9 +1,9 @@
1
1
  import { cn } from "../lib/utils.js";
2
- import "react";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import "react";
4
4
  import { cva } from "class-variance-authority";
5
5
  // src/components/alert.tsx
6
- const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
6
+ const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid grid-cols-leading has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
7
7
  variants: { variant: {
8
8
  default: "",
9
9
  warning: "text-warning border-warning/50 [&>svg]:text-current data-[slot=alert-description]:*:text-warning/90",
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
- import { Avatar as Avatar$1 } from "radix-ui";
3
2
  import { VariantProps } from "class-variance-authority";
3
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
4
4
  declare const avatarVariants: (props?: ({
5
+ corners?: "circle" | "square" | null | undefined;
6
+ ring?: "lg" | "sm" | null | undefined;
5
7
  size?: "default" | "lg" | "sm" | "xl" | "xs" | null | undefined;
6
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- export type AvatarProps = React.ComponentPropsWithoutRef<typeof Avatar$1.Root> & VariantProps<typeof avatarVariants>;
8
- declare const AvatarRoot: ({ ref, className, size, ...props }: AvatarProps & React.RefAttributes<React.ComponentRef<typeof Avatar$1.Root>>) => React.JSX.Element;
9
- declare const AvatarImage: ({ ref, className, ...props }: React.ComponentProps<typeof Avatar$1.Image>) => React.JSX.Element;
10
- declare const AvatarFallback: ({ ref, className, color, style, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>) => React.JSX.Element;
9
+ export type AvatarProps = React.ComponentProps<typeof Avatar$1.Root> & VariantProps<typeof avatarVariants>;
10
+ declare const AvatarRoot: ({ className, corners, ring, size, ...props }: AvatarProps) => React.JSX.Element;
11
+ declare const AvatarImage: ({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>) => React.JSX.Element;
12
+ declare const AvatarFallback: ({ className, style, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>) => React.JSX.Element;
11
13
  export declare const Avatar: typeof AvatarRoot & {
12
14
  Image: typeof AvatarImage;
13
15
  Fallback: typeof AvatarFallback;
@@ -1,36 +1,47 @@
1
1
  import { cn } from "../lib/utils.js";
2
- import "react";
3
- import { Avatar as Avatar$1 } from "radix-ui";
4
2
  import { jsx } from "react/jsx-runtime";
3
+ import "react";
5
4
  import { cva } from "class-variance-authority";
5
+ import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
6
6
  // src/components/avatar.tsx
7
- const avatarVariants = cva("relative flex shrink-0 overflow-hidden rounded-full border-0", {
8
- variants: { size: {
9
- xs: "size-3 text-[8px]",
10
- sm: "size-3.5 text-[10px]",
11
- default: "size-4 text-xs",
12
- lg: "size-6 text-sm",
13
- xl: "size-8 text-base"
14
- } },
15
- defaultVariants: { size: "default" }
7
+ const avatarVariants = cva("relative flex shrink-0 overflow-hidden border-0", {
8
+ variants: {
9
+ corners: {
10
+ circle: "rounded-full",
11
+ square: "rounded-md"
12
+ },
13
+ ring: {
14
+ sm: "bg-background ring-2 ring-background",
15
+ lg: "bg-background ring-4 ring-background"
16
+ },
17
+ size: {
18
+ xs: "size-3 text-4xs",
19
+ sm: "size-3.5 text-3xs",
20
+ default: "size-4 text-xs",
21
+ lg: "size-6 text-sm",
22
+ xl: "size-8 text-base"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ corners: "circle",
27
+ size: "default"
28
+ }
16
29
  });
17
- const AvatarRoot = ({ ref, className, size, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Root, {
18
- ref,
30
+ const AvatarRoot = ({ className, corners, ring, size, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Root, {
19
31
  className: cn(avatarVariants({
20
- className,
32
+ corners,
33
+ ring,
21
34
  size
22
35
  }), className),
23
36
  ...props
24
37
  });
25
- const AvatarImage = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Image, {
26
- ref,
38
+ const AvatarImage = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Image, {
27
39
  className: cn("aspect-square h-full w-full object-cover", className),
28
40
  ...props
29
41
  });
30
- const AvatarFallback = ({ ref, className, color, style, ...props }) => {
42
+ const AvatarFallback = ({ className, style, ...props }) => {
31
43
  return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
32
- ref,
33
- className: cn("flex h-full w-full items-center justify-center rounded-full uppercase bg-muted text-muted-foreground", className),
44
+ className: cn("flex h-full w-full items-center justify-center uppercase bg-muted text-muted-foreground", className),
34
45
  ...props
35
46
  });
36
47
  };
@@ -1,15 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- /** Slowly moving colour blobs behind `children`; colours are `r, g, b` triples. */
3
- export declare const BackgroundGradientAnimation: ({ gradientBackgroundStart, gradientBackgroundEnd, firstColor, secondColor, thirdColor, fourthColor, fifthColor, size, blendingValue, children, className, containerClassName }: {
4
- gradientBackgroundStart?: string;
5
- gradientBackgroundEnd?: string;
6
- firstColor?: string;
7
- secondColor?: string;
8
- thirdColor?: string;
9
- fourthColor?: string;
10
- fifthColor?: string;
11
- size?: string;
12
- blendingValue?: string;
2
+ /** Slowly moving colour blobs behind `children` (components.css draws them). */
3
+ export declare const BackgroundGradientAnimation: ({ children, className, containerClassName }: {
13
4
  children?: ReactNode;
14
5
  className?: string;
15
6
  containerClassName?: string;
@@ -2,29 +2,13 @@ import { cn } from "../lib/utils.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  // src/components/background-gradient-animation.tsx
4
4
  const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5
- const BLOB_BASE = "absolute top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)] h-[var(--size)] w-[var(--size)] [mix-blend-mode:var(--blending-value)]";
6
- /** The moving colour blobs: their gradient, orbit origin, animation and opacity. */
5
+ /** The moving colour blobs, each with its own orbit animation and opacity. */
7
6
  const BLOBS = [
8
- {
9
- name: "first",
10
- className: "[background:radial-gradient(circle_at_center,_var(--first-color)_0,_var(--first-color)_50%)_no-repeat] [transform-origin:center_center] animate-first opacity-100"
11
- },
12
- {
13
- name: "second",
14
- className: "[background:radial-gradient(circle_at_center,_rgba(var(--second-color),_0.8)_0,_rgba(var(--second-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-400px)] animate-second opacity-100"
15
- },
16
- {
17
- name: "third",
18
- className: "[background:radial-gradient(circle_at_center,_rgba(var(--third-color),_0.8)_0,_rgba(var(--third-color),_0)_50%)_no-repeat] [transform-origin:calc(50%+400px)] animate-third opacity-100"
19
- },
20
- {
21
- name: "fourth",
22
- className: "[background:radial-gradient(circle_at_center,_rgba(var(--fourth-color),_0.8)_0,_rgba(var(--fourth-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-200px)] animate-fourth opacity-70"
23
- },
24
- {
25
- name: "fifth",
26
- className: "[background:radial-gradient(circle_at_center,_rgba(var(--fifth-color),_0.8)_0,_rgba(var(--fifth-color),_0)_50%)_no-repeat] [transform-origin:calc(50%-800px)_calc(50%+800px)] animate-fifth opacity-100"
27
- }
7
+ "gradient-blob-1 animate-first",
8
+ "gradient-blob-2 animate-second",
9
+ "gradient-blob-3 animate-third",
10
+ "gradient-blob-4 animate-fourth opacity-70",
11
+ "gradient-blob-5 animate-fifth"
28
12
  ];
29
13
  const GooFilter = () => /* @__PURE__ */ jsx("svg", {
30
14
  className: "hidden",
@@ -49,32 +33,19 @@ const GooFilter = () => /* @__PURE__ */ jsx("svg", {
49
33
  ]
50
34
  }) })
51
35
  });
52
- /** Slowly moving colour blobs behind `children`; colours are `r, g, b` triples. */
53
- const BackgroundGradientAnimation = ({ gradientBackgroundStart = "rgb(108, 0, 162)", gradientBackgroundEnd = "rgb(0, 17, 82)", firstColor = "18, 113, 255", secondColor = "221, 74, 255", thirdColor = "100, 220, 255", fourthColor = "200, 50, 50", fifthColor = "180, 180, 50", size = "80%", blendingValue = "hard-light", children, className, containerClassName }) => {
54
- return /* @__PURE__ */ jsxs("div", {
55
- style: {
56
- "--gradient-background-start": gradientBackgroundStart,
57
- "--gradient-background-end": gradientBackgroundEnd,
58
- "--first-color": firstColor,
59
- "--second-color": secondColor,
60
- "--third-color": thirdColor,
61
- "--fourth-color": fourthColor,
62
- "--fifth-color": fifthColor,
63
- "--size": size,
64
- "--blending-value": blendingValue
65
- },
66
- className: cn("relative top-0 left-0 flex w-1/2 flex-col overflow-hidden bg-[linear-gradient(40deg,var(--gradient-background-start),var(--gradient-background-end))]", containerClassName),
67
- children: [
68
- /* @__PURE__ */ jsx(GooFilter, {}),
69
- /* @__PURE__ */ jsx("div", {
70
- className: cn("absolute z-10 flex h-full w-full flex-col px-8 py-4", className),
71
- children
72
- }),
73
- /* @__PURE__ */ jsx("div", {
74
- className: cn("gradients-container h-full w-full blur-lg", IS_SAFARI ? "blur-2xl" : "[filter:url(#blurMe)_blur(40px)]"),
75
- children: BLOBS.map((blob) => /* @__PURE__ */ jsx("div", { className: cn(BLOB_BASE, blob.className) }, blob.name))
76
- })
77
- ]
78
- });
79
- };
36
+ /** Slowly moving colour blobs behind `children` (components.css draws them). */
37
+ const BackgroundGradientAnimation = ({ children, className, containerClassName }) => /* @__PURE__ */ jsxs("div", {
38
+ className: cn("gradient-backdrop relative top-0 left-0 flex w-1/2 flex-col overflow-hidden", containerClassName),
39
+ children: [
40
+ /* @__PURE__ */ jsx(GooFilter, {}),
41
+ /* @__PURE__ */ jsx("div", {
42
+ className: cn("absolute z-10 flex h-full w-full flex-col px-8 py-4", className),
43
+ children
44
+ }),
45
+ /* @__PURE__ */ jsx("div", {
46
+ className: cn("h-full w-full", IS_SAFARI ? "blur-2xl" : "goo"),
47
+ children: BLOBS.map((blob) => /* @__PURE__ */ jsx("div", { className: cn("gradient-blob", blob) }, blob))
48
+ })
49
+ ]
50
+ });
80
51
  export { BackgroundGradientAnimation };
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  export declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "ghost" | "info" | "secondary" | "success" | "warning" | null | undefined;
4
+ variant?: "default" | "destructive" | "ghost" | "info" | "muted" | "secondary" | "success" | "warning" | null | undefined;
5
+ size?: "default" | "lg" | "sm" | null | undefined;
5
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
7
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
8
  onClose?: () => void;
8
9
  }
9
- export declare const Badge: ({ ref, className, variant, children, onClose, ...props }: BadgeProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element;
10
+ export declare const Badge: ({ ref, className, variant, size, children, onClose, ...props }: BadgeProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element;
@@ -1,37 +1,52 @@
1
1
  import { cn } from "../lib/utils.js";
2
- import { Button } from "./button.js";
3
- import "react";
2
+ import { buttonVariants } from "./button.js";
4
3
  import { IconX } from "@tabler/icons-react";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import "react";
6
6
  import { cva } from "class-variance-authority";
7
7
  // src/components/badge.tsx
8
- const badgeVariants = cva("inline-flex items-center rounded-sm px-2 transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 whitespace-nowrap font-medium w-fit h-6 text-xs border gap-1", {
9
- variants: { variant: {
10
- default: "bg-primary/10 text-primary border-primary/10",
11
- secondary: "bg-accent",
12
- ghost: "hover:bg-accent border-none hover:shadow-xs",
13
- success: "bg-success/10 text-success border-success/10",
14
- warning: "bg-warning/10 text-warning border-warning/10",
15
- destructive: "bg-destructive/10 text-destructive border-destructive/10",
16
- info: "bg-info/10 text-info border-info/10"
17
- } },
18
- defaultVariants: { variant: "default" }
8
+ const badgeVariants = cva("inline-flex items-center rounded-sm transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 whitespace-nowrap font-medium w-fit border gap-1", {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary/10 text-primary-text border-primary/10",
12
+ secondary: "bg-accent",
13
+ /** A count of what didn't fit ("+3"). */
14
+ muted: "bg-accent text-muted-foreground",
15
+ ghost: "hover:bg-accent border-none hover:shadow-xs",
16
+ success: "bg-success/10 text-(--success-text) border-success/10",
17
+ warning: "bg-warning/10 text-(--warning-text) border-warning/10",
18
+ destructive: "bg-destructive/10 text-(--destructive-text) border-destructive/10",
19
+ info: "bg-info/10 text-(--info-text) border-info/10"
20
+ },
21
+ size: {
22
+ default: "h-6 px-2 text-xs",
23
+ /** A tag inside a line of text: a source, a priority. */
24
+ sm: "h-4 px-1.5 text-3xs",
25
+ lg: "h-7 px-2.5 text-sm"
26
+ }
27
+ },
28
+ defaultVariants: {
29
+ variant: "default",
30
+ size: "default"
31
+ }
19
32
  });
20
- const Badge = ({ ref, className, variant, children, onClose, ...props }) => {
33
+ const Badge = ({ ref, className, variant, size, children, onClose, ...props }) => {
21
34
  return /* @__PURE__ */ jsxs("div", {
22
35
  ref,
23
- className: cn(badgeVariants({ variant }), onClose && "pr-1", className),
36
+ className: cn(badgeVariants({
37
+ variant,
38
+ size
39
+ }), onClose && "pr-1", className),
24
40
  ...props,
25
- children: [children, onClose && /* @__PURE__ */ jsx(Button, {
26
- variant: "ghost",
27
- size: "icon",
41
+ children: [children, onClose && /* @__PURE__ */ jsx(IconX, {
28
42
  onClick: (e) => {
29
43
  e.stopPropagation();
30
44
  onClose();
31
45
  },
32
- className: "size-3.5 p-0 hover:bg-transparent flex-none",
33
- asChild: true,
34
- children: /* @__PURE__ */ jsx(IconX, { className: "size-3.5 flex-none" })
46
+ className: cn(buttonVariants({
47
+ variant: "ghost",
48
+ size: "icon"
49
+ }), "size-3.5 p-0 hover:bg-transparent flex-none")
35
50
  })]
36
51
  });
37
52
  };
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
+ import { VariantProps } from "class-variance-authority";
2
3
  declare const BreadcrumbRoot: ({ ref, ...props }: React.ComponentProps<'nav'> & {
3
4
  separator?: React.ReactNode;
4
5
  }) => React.JSX.Element;
5
6
  declare const BreadcrumbList: ({ ref, className, ...props }: React.ComponentProps<'ol'>) => React.JSX.Element;
6
7
  declare const BreadcrumbItem: ({ ref, className, ...props }: React.ComponentProps<'li'>) => React.JSX.Element;
7
- declare const BreadcrumbLink: ({ ref, asChild, className, ...props }: React.ComponentProps<'a'> & {
8
- asChild?: boolean;
9
- }) => React.JSX.Element;
10
- declare const BreadcrumbPage: ({ ref, className, ...props }: React.ComponentProps<'span'>) => React.JSX.Element;
8
+ declare const BreadcrumbLink: ({ className, children, ...props }: React.ComponentProps<'a'>) => React.JSX.Element;
9
+ declare const breadcrumbPageVariants: (props?: ({
10
+ variant?: "default" | "text" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare const BreadcrumbPage: ({ ref, className, variant, ...props }: React.ComponentProps<'span'> & VariantProps<typeof breadcrumbPageVariants>) => React.JSX.Element;
11
13
  declare const BreadcrumbSeparator: ({ children, className, ...props }: React.ComponentProps<'li'>) => React.JSX.Element;
12
14
  declare const BreadcrumbEllipsis: ({ className, ...props }: React.ComponentProps<'span'>) => React.JSX.Element;
13
15
  export declare const Breadcrumb: typeof BreadcrumbRoot & {