@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.
- package/CHANGELOG.md +25 -0
- package/README.md +4 -1
- package/dist/cjs-types/common/chatComposer/chatComposer.d.ts +4 -0
- package/dist/cjs-types/common/chatComposer/chatComposer.types.d.ts +40 -0
- package/dist/cjs-types/common/chatComposer/index.d.ts +2 -0
- package/dist/cjs-types/common/chatMessage/chatMessage.d.ts +4 -0
- package/dist/cjs-types/common/chatMessage/chatMessage.types.d.ts +60 -0
- package/dist/cjs-types/common/chatMessage/index.d.ts +2 -0
- package/dist/cjs-types/common/chatMessageList/chatMessageList.d.ts +4 -0
- package/dist/cjs-types/common/chatMessageList/chatMessageList.types.d.ts +27 -0
- package/dist/cjs-types/common/chatMessageList/index.d.ts +2 -0
- package/dist/cjs-types/common/configProvider/configProvider.types.d.ts +6 -0
- package/dist/cjs-types/common/dropdown/dropdown.types.d.ts +3 -2
- package/dist/cjs-types/common/hooks/useAutoGrow.d.ts +12 -0
- package/dist/cjs-types/common/infiniteBlock/useInfiniteScroll.d.ts +1 -1
- package/dist/cjs-types/common/tabHeader/tabHeader.types.d.ts +5 -3
- package/dist/cjs-types/index.d.ts +6 -0
- package/dist/esm/common/chatComposer/chatComposer.mjs +2 -0
- package/dist/esm/common/chatComposer/chatComposer.mjs.map +1 -0
- package/dist/esm/common/chatComposer/chatComposer.module.mjs +2 -0
- package/dist/esm/common/chatComposer/chatComposer.module.mjs.map +1 -0
- package/dist/esm/common/chatMessage/chatMessage.mjs +2 -0
- package/dist/esm/common/chatMessage/chatMessage.mjs.map +1 -0
- package/dist/esm/common/chatMessage/chatMessage.module.mjs +2 -0
- package/dist/esm/common/chatMessage/chatMessage.module.mjs.map +1 -0
- package/dist/esm/common/chatMessage/chatMessage.types.mjs +2 -0
- package/dist/esm/common/chatMessage/chatMessage.types.mjs.map +1 -0
- package/dist/esm/common/chatMessageList/chatMessageList.mjs +2 -0
- package/dist/esm/common/chatMessageList/chatMessageList.mjs.map +1 -0
- package/dist/esm/common/chatMessageList/chatMessageList.module.mjs +2 -0
- package/dist/esm/common/chatMessageList/chatMessageList.module.mjs.map +1 -0
- package/dist/esm/common/dropdown/dropdown.mjs +1 -1
- package/dist/esm/common/dropdown/dropdown.mjs.map +1 -1
- package/dist/esm/common/dropdown/dropdown.module.mjs +1 -1
- package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
- package/dist/esm/common/hooks/useAutoGrow.mjs +2 -0
- package/dist/esm/common/hooks/useAutoGrow.mjs.map +1 -0
- package/dist/esm/common/infiniteBlock/useInfiniteScroll.mjs +1 -1
- package/dist/esm/common/infiniteBlock/useInfiniteScroll.mjs.map +1 -1
- package/dist/esm/common/input/input.mjs +1 -1
- package/dist/esm/common/input/input.mjs.map +1 -1
- package/dist/esm/common/loader/loader.module.mjs.map +1 -1
- package/dist/esm/common/tabHeader/tabHeader.mjs +1 -1
- package/dist/esm/common/tabHeader/tabHeader.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/common/chatComposer/chatComposer.d.ts +4 -0
- package/dist/types/common/chatComposer/chatComposer.types.d.ts +40 -0
- package/dist/types/common/chatComposer/index.d.ts +2 -0
- package/dist/types/common/chatMessage/chatMessage.d.ts +4 -0
- package/dist/types/common/chatMessage/chatMessage.types.d.ts +60 -0
- package/dist/types/common/chatMessage/index.d.ts +2 -0
- package/dist/types/common/chatMessageList/chatMessageList.d.ts +4 -0
- package/dist/types/common/chatMessageList/chatMessageList.types.d.ts +27 -0
- package/dist/types/common/chatMessageList/index.d.ts +2 -0
- package/dist/types/common/configProvider/configProvider.types.d.ts +6 -0
- package/dist/types/common/dropdown/dropdown.types.d.ts +3 -2
- package/dist/types/common/hooks/useAutoGrow.d.ts +12 -0
- package/dist/types/common/infiniteBlock/useInfiniteScroll.d.ts +1 -1
- package/dist/types/common/tabHeader/tabHeader.types.d.ts +5 -3
- package/dist/types/index.d.ts +6 -0
- package/docs/CLAUDE.md +6 -3
- package/docs/ChatComposer.md +100 -0
- package/docs/ChatMessage.md +88 -0
- package/docs/ChatMessageList.md +113 -0
- package/docs/ConfigProvider.md +1 -0
- package/docs/Dropdown.md +17 -3
- package/docs/TabHeader.md +19 -8
- 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
|
|
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
|
|
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` | `
|
|
61
|
-
| `subtitle` | `
|
|
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`
|