@ahrowe/ui 0.49.0 → 0.51.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 (71) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +4 -1
  3. package/dist/cjs-types/common/chatComposer/chatComposer.d.ts +4 -0
  4. package/dist/cjs-types/common/chatComposer/chatComposer.types.d.ts +40 -0
  5. package/dist/cjs-types/common/chatComposer/index.d.ts +2 -0
  6. package/dist/cjs-types/common/chatMessage/chatMessage.d.ts +4 -0
  7. package/dist/cjs-types/common/chatMessage/chatMessage.types.d.ts +60 -0
  8. package/dist/cjs-types/common/chatMessage/index.d.ts +2 -0
  9. package/dist/cjs-types/common/chatMessageList/chatMessageList.d.ts +4 -0
  10. package/dist/cjs-types/common/chatMessageList/chatMessageList.types.d.ts +27 -0
  11. package/dist/cjs-types/common/chatMessageList/index.d.ts +2 -0
  12. package/dist/cjs-types/common/configProvider/configProvider.types.d.ts +6 -0
  13. package/dist/cjs-types/common/dropdown/dropdown.types.d.ts +3 -2
  14. package/dist/cjs-types/common/hooks/useAutoGrow.d.ts +12 -0
  15. package/dist/cjs-types/common/infiniteBlock/useInfiniteScroll.d.ts +1 -1
  16. package/dist/cjs-types/common/tabHeader/tabHeader.types.d.ts +5 -3
  17. package/dist/cjs-types/index.d.ts +6 -0
  18. package/dist/esm/common/chatComposer/chatComposer.mjs +2 -0
  19. package/dist/esm/common/chatComposer/chatComposer.mjs.map +1 -0
  20. package/dist/esm/common/chatComposer/chatComposer.module.mjs +2 -0
  21. package/dist/esm/common/chatComposer/chatComposer.module.mjs.map +1 -0
  22. package/dist/esm/common/chatMessage/chatMessage.mjs +2 -0
  23. package/dist/esm/common/chatMessage/chatMessage.mjs.map +1 -0
  24. package/dist/esm/common/chatMessage/chatMessage.module.mjs +2 -0
  25. package/dist/esm/common/chatMessage/chatMessage.module.mjs.map +1 -0
  26. package/dist/esm/common/chatMessage/chatMessage.types.mjs +2 -0
  27. package/dist/esm/common/chatMessage/chatMessage.types.mjs.map +1 -0
  28. package/dist/esm/common/chatMessageList/chatMessageList.mjs +2 -0
  29. package/dist/esm/common/chatMessageList/chatMessageList.mjs.map +1 -0
  30. package/dist/esm/common/chatMessageList/chatMessageList.module.mjs +2 -0
  31. package/dist/esm/common/chatMessageList/chatMessageList.module.mjs.map +1 -0
  32. package/dist/esm/common/dropdown/dropdown.mjs +1 -1
  33. package/dist/esm/common/dropdown/dropdown.mjs.map +1 -1
  34. package/dist/esm/common/dropdown/dropdown.module.mjs +1 -1
  35. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  36. package/dist/esm/common/hooks/useAutoGrow.mjs +2 -0
  37. package/dist/esm/common/hooks/useAutoGrow.mjs.map +1 -0
  38. package/dist/esm/common/infiniteBlock/useInfiniteScroll.mjs +1 -1
  39. package/dist/esm/common/infiniteBlock/useInfiniteScroll.mjs.map +1 -1
  40. package/dist/esm/common/input/input.mjs +1 -1
  41. package/dist/esm/common/input/input.mjs.map +1 -1
  42. package/dist/esm/common/loader/loader.module.mjs.map +1 -1
  43. package/dist/esm/common/tabHeader/tabHeader.mjs +1 -1
  44. package/dist/esm/common/tabHeader/tabHeader.mjs.map +1 -1
  45. package/dist/esm/index.mjs +1 -1
  46. package/dist/index.cjs +3 -3
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/style.css +1 -1
  49. package/dist/types/common/chatComposer/chatComposer.d.ts +4 -0
  50. package/dist/types/common/chatComposer/chatComposer.types.d.ts +40 -0
  51. package/dist/types/common/chatComposer/index.d.ts +2 -0
  52. package/dist/types/common/chatMessage/chatMessage.d.ts +4 -0
  53. package/dist/types/common/chatMessage/chatMessage.types.d.ts +60 -0
  54. package/dist/types/common/chatMessage/index.d.ts +2 -0
  55. package/dist/types/common/chatMessageList/chatMessageList.d.ts +4 -0
  56. package/dist/types/common/chatMessageList/chatMessageList.types.d.ts +27 -0
  57. package/dist/types/common/chatMessageList/index.d.ts +2 -0
  58. package/dist/types/common/configProvider/configProvider.types.d.ts +6 -0
  59. package/dist/types/common/dropdown/dropdown.types.d.ts +3 -2
  60. package/dist/types/common/hooks/useAutoGrow.d.ts +12 -0
  61. package/dist/types/common/infiniteBlock/useInfiniteScroll.d.ts +1 -1
  62. package/dist/types/common/tabHeader/tabHeader.types.d.ts +5 -3
  63. package/dist/types/index.d.ts +6 -0
  64. package/docs/CLAUDE.md +6 -3
  65. package/docs/ChatComposer.md +100 -0
  66. package/docs/ChatMessage.md +88 -0
  67. package/docs/ChatMessageList.md +113 -0
  68. package/docs/ConfigProvider.md +1 -0
  69. package/docs/Dropdown.md +17 -3
  70. package/docs/TabHeader.md +19 -8
  71. package/package.json +1 -1
package/docs/TabHeader.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # TabHeader
2
2
 
3
- **When to use:** A horizontal row of tabs to switch between sibling views or sections — settings panels, dashboards, detail pages. Each tab carries an icon plus an optional title and subtitle.
3
+ **When to use:** A horizontal row of tabs to switch between sibling views or sections — settings panels, dashboards, detail pages. Each tab carries an icon plus an optional title, subtitle and end content such as a badge.
4
4
 
5
- **Keywords:** tabs navigation, tab bar
5
+ **Keywords:** tabs navigation, tab bar, pill, counter
6
6
 
7
7
  **Import:** `import { TabHeader } from '@ahrowe/ui'`
8
8
 
9
- **Mobile behaviour:** On narrow screens (≤ 640px) only the active tab keeps its title and subtitle; every other tab collapses to just its icon.
9
+ **Mobile behaviour:** On narrow screens (≤ 640px) only the active tab keeps its title and subtitle; every other tab collapses to its icon and `endContent`.
10
10
 
11
11
  ```tsx
12
12
  import { useState } from 'react';
13
- import { TabHeader } from '@ahrowe/ui';
13
+ import { TabHeader, Badge, ThemeColor } from '@ahrowe/ui';
14
14
  import type { TabHeaderTab } from '@ahrowe/ui';
15
- import { faUser, faBell, faGear } from '@fortawesome/free-solid-svg-icons';
15
+ import { faUser, faBell, faGear, faInbox, faAt } from '@fortawesome/free-solid-svg-icons';
16
16
 
17
17
  const TABS: TabHeaderTab[] = [
18
18
  { id: 'profile', icon: faUser, title: 'Profile', subtitle: 'Your details' },
@@ -32,6 +32,16 @@ function Example() {
32
32
  onChange={setTab}
33
33
  />
34
34
 
35
+ // A count next to the title, still shown when a narrow screen collapses the tab
36
+ <TabHeader
37
+ tabs={[
38
+ { id: 'inbox', icon: faInbox, title: 'Inbox', endContent: <Badge count={12} /> },
39
+ { id: 'mentions', icon: faAt, title: 'Mentions', endContent: <Badge count={3} color={ThemeColor.Error} /> },
40
+ ]}
41
+ currentTab={tab}
42
+ onChange={setTab}
43
+ />
44
+
35
45
  // Disabled tab — dimmed and not selectable
36
46
  <TabHeader
37
47
  tabs={[
@@ -57,8 +67,9 @@ function Example() {
57
67
  |-------|------|-------------|
58
68
  | `id` | `string` | Unique identifier, matched against `currentTab` |
59
69
  | `icon` | `IconDefinition \| ReactElement` | FontAwesome icon or any React element (always visible, incl. mobile) |
60
- | `title` | `string` | Optional title next to the icon |
61
- | `subtitle` | `string` | Optional subtitle beneath the title |
70
+ | `title` | `ReactNode` | Optional title next to the icon |
71
+ | `subtitle` | `ReactNode` | Optional subtitle beneath the title |
72
+ | `endContent` | `ReactNode` | After the labels. Stays visible when a narrow screen collapses the tab, so keep it small: a `Badge`, a dot |
62
73
  | `disabled` | `boolean` | Dim the tab and prevent selection |
63
74
 
64
- **Slots:** `root` `tab` `icon` `labels` `title` `subtitle`
75
+ **Slots:** `root` `tab` `icon` `labels` `title` `subtitle` `endContent`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahrowe/ui",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "description": "A React UI component library with theming, CSS Modules, and TypeScript support",
5
5
  "keywords": [
6
6
  "agent",