@ahrowe/ui 0.20.0 → 0.22.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/dist/esm/common/actionIcon/actionIcon.mjs +1 -1
- package/dist/esm/common/actionIcon/actionIcon.mjs.map +1 -1
- package/dist/esm/common/alert/alert.mjs +1 -1
- package/dist/esm/common/alert/alert.mjs.map +1 -1
- package/dist/esm/common/alert/alert.types.mjs.map +1 -1
- package/dist/esm/common/avatar/avatar.mjs +1 -1
- package/dist/esm/common/avatar/avatar.mjs.map +1 -1
- package/dist/esm/common/breadcrumb/breadcrumb.mjs +1 -1
- package/dist/esm/common/breadcrumb/breadcrumb.mjs.map +1 -1
- package/dist/esm/common/button/button.mjs +1 -1
- package/dist/esm/common/button/button.mjs.map +1 -1
- package/dist/esm/common/button/button.types.mjs.map +1 -1
- package/dist/esm/common/emptyState/emptyState.mjs +1 -1
- package/dist/esm/common/emptyState/emptyState.mjs.map +1 -1
- package/dist/esm/common/fab/fab.mjs +1 -1
- package/dist/esm/common/fab/fab.mjs.map +1 -1
- package/dist/esm/common/rating/rating.mjs +1 -1
- package/dist/esm/common/rating/rating.mjs.map +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.mjs +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.mjs.map +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.module.mjs +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.module.mjs.map +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.types.mjs.map +1 -1
- package/dist/esm/common/splitButton/splitButton.mjs +1 -1
- package/dist/esm/common/splitButton/splitButton.mjs.map +1 -1
- package/dist/esm/common/stepper/stepper.mjs +1 -1
- package/dist/esm/common/stepper/stepper.mjs.map +1 -1
- package/dist/esm/common/stepper/stepper.module.mjs.map +1 -1
- package/dist/esm/common/stepper/stepper.types.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/common/timeline/timeline.mjs +1 -1
- package/dist/esm/common/timeline/timeline.mjs.map +1 -1
- package/dist/esm/common/timeline/timeline.module.mjs +1 -1
- package/dist/esm/common/timeline/timeline.module.mjs.map +1 -1
- package/dist/esm/common/timeline/timeline.types.mjs.map +1 -1
- package/dist/esm/common/utils/renderIcon.mjs +2 -0
- package/dist/esm/common/utils/renderIcon.mjs.map +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/package/common/actionButtons/actionButtons.types.d.ts +3 -3
- package/dist/types/package/common/actionIcon/actionIcon.types.d.ts +2 -2
- package/dist/types/package/common/alert/alert.types.d.ts +2 -2
- package/dist/types/package/common/avatar/avatar.types.d.ts +2 -2
- package/dist/types/package/common/breadcrumb/breadcrumb.types.d.ts +2 -2
- package/dist/types/package/common/button/button.types.d.ts +2 -2
- package/dist/types/package/common/emptyState/emptyState.types.d.ts +2 -2
- package/dist/types/package/common/fab/fab.types.d.ts +2 -2
- package/dist/types/package/common/rating/rating.types.d.ts +2 -2
- package/dist/types/package/common/sectionHeader/sectionHeader.types.d.ts +3 -3
- package/dist/types/package/common/splitButton/splitButton.types.d.ts +2 -2
- package/dist/types/package/common/stepper/stepper.types.d.ts +3 -3
- package/dist/types/package/common/tabHeader/tabHeader.types.d.ts +2 -2
- package/dist/types/package/common/timeline/timeline.types.d.ts +3 -3
- package/dist/types/package/common/types/actions.types.d.ts +2 -2
- package/dist/types/package/common/types/icon.types.d.ts +17 -0
- package/dist/types/package/common/utils/renderIcon.d.ts +29 -0
- package/docs/ActionIcon.md +1 -1
- package/docs/Alert.md +1 -1
- package/docs/Avatar.md +1 -1
- package/docs/Breadcrumb.md +1 -1
- package/docs/Button.md +1 -1
- package/docs/CLAUDE.md +22 -0
- package/docs/EmptyState.md +1 -1
- package/docs/Rating.md +1 -1
- package/docs/SectionHeader.md +5 -5
- package/docs/Stepper.md +1 -1
- package/docs/TabHeader.md +1 -1
- package/docs/Timeline.md +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
export interface BreadcrumbItem {
|
|
5
5
|
id?: string;
|
|
6
6
|
label: ReactNode;
|
|
7
7
|
href?: string;
|
|
8
|
-
icon?:
|
|
8
|
+
icon?: IconContent;
|
|
9
9
|
onClick?: (event: MouseEvent) => void;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
export declare enum ButtonStyleType {
|
|
5
5
|
Primary = "primary",
|
|
@@ -26,7 +26,7 @@ export interface ButtonProps extends HtmlProps {
|
|
|
26
26
|
size?: ButtonSize;
|
|
27
27
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void;
|
|
28
28
|
children?: React.ReactNode;
|
|
29
|
-
icon?:
|
|
29
|
+
icon?: IconContent;
|
|
30
30
|
isLoading?: boolean;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
title?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { HtmlProps } from '../types/slots.types';
|
|
4
4
|
export interface EmptyStateProps extends HtmlProps {
|
|
5
5
|
className?: string;
|
|
6
|
-
icon?:
|
|
6
|
+
icon?: IconContent;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { HtmlProps } from '../types/slots.types';
|
|
4
4
|
export type FabSize = 'default' | 'mini';
|
|
5
5
|
export interface FabMenuEntry {
|
|
6
6
|
id: string;
|
|
7
|
-
icon:
|
|
7
|
+
icon: IconContent;
|
|
8
8
|
label?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface FabProps extends HtmlProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
export type RatingSlots = 'root' | 'item' | 'iconEmpty' | 'iconFilled';
|
|
5
5
|
export interface RatingProps extends HtmlProps {
|
|
@@ -11,7 +11,7 @@ export interface RatingProps extends HtmlProps {
|
|
|
11
11
|
allowClear?: boolean;
|
|
12
12
|
readOnly?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
icon?:
|
|
14
|
+
icon?: IconContent;
|
|
15
15
|
className?: string;
|
|
16
16
|
style?: CSSProperties;
|
|
17
17
|
classNames?: SlotClassNames<RatingSlots>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
import { IconAction } from '../types/actions.types';
|
|
5
5
|
export declare enum SectionHeaderSize {
|
|
@@ -8,11 +8,11 @@ export declare enum SectionHeaderSize {
|
|
|
8
8
|
Large = "large"
|
|
9
9
|
}
|
|
10
10
|
export type SectionHeaderAction = IconAction;
|
|
11
|
-
export type SectionHeaderSlots = 'root' | 'leading' | 'titles' | 'title' | 'subtitle' | 'trailing' | 'left' | 'center' | 'actions';
|
|
11
|
+
export type SectionHeaderSlots = 'root' | 'identity' | 'leading' | 'titles' | 'title' | 'subtitle' | 'trailing' | 'left' | 'center' | 'actions';
|
|
12
12
|
export interface SectionHeaderProps extends HtmlProps {
|
|
13
13
|
title?: ReactNode;
|
|
14
14
|
subtitle?: ReactNode;
|
|
15
|
-
icon?:
|
|
15
|
+
icon?: IconContent;
|
|
16
16
|
thumbnail?: string | ReactNode;
|
|
17
17
|
left?: ReactNode;
|
|
18
18
|
center?: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { ButtonStyleType, ButtonSize } from '../button/button.types';
|
|
4
4
|
import { Align } from '../floatingMenu/floatingMenu.types';
|
|
5
5
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
@@ -8,7 +8,7 @@ export interface SplitButtonAction {
|
|
|
8
8
|
label: ReactNode;
|
|
9
9
|
onClick: () => void;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
icon?:
|
|
11
|
+
icon?: IconContent;
|
|
12
12
|
}
|
|
13
13
|
export type SplitButtonSlots = 'root' | 'primaryButton' | 'triggerButton' | 'menu' | 'menuItem';
|
|
14
14
|
export interface SplitButtonProps extends HtmlProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
/** Layout direction of the stepper. */
|
|
5
5
|
export declare enum StepperAlignment {
|
|
@@ -46,8 +46,8 @@ export interface StepperStep {
|
|
|
46
46
|
description?: React.ReactNode;
|
|
47
47
|
/** Collapsible body content, rendered under the label (vertical only). */
|
|
48
48
|
content?: React.ReactNode;
|
|
49
|
-
/**
|
|
50
|
-
icon?:
|
|
49
|
+
/** Icon shown in the marker instead of the step number — a FontAwesome icon or any node. */
|
|
50
|
+
icon?: IconContent;
|
|
51
51
|
/** Marks the step as errored, recolouring the marker with `--stepper-error-color`. */
|
|
52
52
|
error?: boolean;
|
|
53
53
|
/** `true` renders an "Optional" hint; a node renders custom hint text. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
export type TabHeaderSlots = 'root' | 'tab' | 'icon' | 'labels' | 'title' | 'subtitle';
|
|
5
5
|
export interface TabHeaderTab {
|
|
6
6
|
id: string;
|
|
7
|
-
icon:
|
|
7
|
+
icon: IconContent;
|
|
8
8
|
title?: string;
|
|
9
9
|
subtitle?: string;
|
|
10
10
|
disabled?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconContent } from '../types/icon.types';
|
|
3
3
|
import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
|
|
4
4
|
/** Layout of entries relative to the connecting line. */
|
|
5
5
|
export declare enum TimelineAlignment {
|
|
@@ -28,8 +28,8 @@ export interface TimelineItem {
|
|
|
28
28
|
description?: React.ReactNode;
|
|
29
29
|
/** Rendered next to the title, e.g. a date or relative time ("2 hours ago"). */
|
|
30
30
|
timestamp?: React.ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
icon?:
|
|
31
|
+
/** Icon shown in the marker instead of a plain dot — a FontAwesome icon or any node. */
|
|
32
|
+
icon?: IconContent;
|
|
33
33
|
/** Semantic marker colour (default `Default`). */
|
|
34
34
|
status?: TimelineItemStatus;
|
|
35
35
|
/** Extra content rendered under the description, e.g. a diff, an attachment, an actor avatar. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconContent } from './icon.types';
|
|
2
2
|
/** A single icon-triggered action, rendered as an `ActionIcon` */
|
|
3
3
|
export interface IconAction {
|
|
4
4
|
title?: string;
|
|
5
5
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
6
|
-
icon:
|
|
6
|
+
icon: IconContent;
|
|
7
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Anything a component will accept for an `icon` prop: either a FontAwesome
|
|
5
|
+
* `IconDefinition` (rendered through `FontAwesomeIcon`) or an arbitrary React
|
|
6
|
+
* element (rendered as-is) — an `<img>`, an inline `<svg>`, another icon
|
|
7
|
+
* library's component, …
|
|
8
|
+
*
|
|
9
|
+
* Deliberately `ReactElement` rather than `ReactNode`: `ReactNode` also covers
|
|
10
|
+
* strings, numbers and booleans, so a required icon prop would stop catching
|
|
11
|
+
* `icon="star"` at compile time and silently render the text instead. Matches
|
|
12
|
+
* what `Input` has always accepted for its own icon prop.
|
|
13
|
+
*
|
|
14
|
+
* Render one with `renderIcon` from `components/common/utils/renderIcon`, which
|
|
15
|
+
* picks the right branch.
|
|
16
|
+
*/
|
|
17
|
+
export type IconContent = IconDefinition | ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { IconContent } from '../types/icon.types';
|
|
4
|
+
interface RenderIconOptions {
|
|
5
|
+
/** Class applied to the rendered icon (or to the wrapper span for a custom element). */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Inline style applied to the rendered icon (or to the wrapper span for a custom element). */
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Narrows an `IconContent` to a FontAwesome `IconDefinition`.
|
|
12
|
+
*
|
|
13
|
+
* Both halves of the union are plain objects (a React element is one too), so
|
|
14
|
+
* they can only be told apart structurally: an icon definition always carries
|
|
15
|
+
* `prefix`, `iconName` and the `icon` tuple.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isIconDefinition(icon: IconContent | null | undefined): icon is IconDefinition;
|
|
18
|
+
/**
|
|
19
|
+
* Renders an `icon` prop that may be either a FontAwesome `IconDefinition` or an
|
|
20
|
+
* arbitrary React element.
|
|
21
|
+
*
|
|
22
|
+
* A definition goes through `FontAwesomeIcon`; an element is returned untouched
|
|
23
|
+
* unless a `className`/`style` was given, in which case it is wrapped in a
|
|
24
|
+
* `<span>` carrying them so component and consumer slot styling still lands
|
|
25
|
+
* somewhere. Note that a custom element is not sized by FontAwesome's `1em`
|
|
26
|
+
* geometry — size it yourself if the surrounding layout expects a square icon.
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderIcon(icon: IconContent | null | undefined, options?: RenderIconOptions): ReactNode;
|
|
29
|
+
export {};
|
package/docs/ActionIcon.md
CHANGED
|
@@ -23,7 +23,7 @@ import { faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
|
23
23
|
|
|
24
24
|
| Prop | Type | Description |
|
|
25
25
|
|------|------|-------------|
|
|
26
|
-
| `icon` | `IconDefinition` | FontAwesome icon (required) |
|
|
26
|
+
| `icon` | `IconDefinition \| ReactElement` | FontAwesome icon or any React element (required) |
|
|
27
27
|
| `title` | `string` | Tooltip / accessible label |
|
|
28
28
|
| `onClick` | `(event: MouseEvent) => void` | Click handler |
|
|
29
29
|
| `className` | `string` | Root element class |
|
package/docs/Alert.md
CHANGED
|
@@ -57,7 +57,7 @@ import { faRocket } from '@fortawesome/free-solid-svg-icons';
|
|
|
57
57
|
| `title` | `ReactNode` | Optional bold heading above the description |
|
|
58
58
|
| `children` | `ReactNode` | The message body |
|
|
59
59
|
| `styleType` | `AlertStyleType` | Colour variant and default icon (default `Default`) |
|
|
60
|
-
| `icon` | `IconDefinition` | Overrides the default
|
|
60
|
+
| `icon` | `IconDefinition \| ReactElement` | Overrides the default icon for `styleType` — FontAwesome icon or any React element |
|
|
61
61
|
| `hideIcon` | `boolean` | Hide the leading icon entirely |
|
|
62
62
|
| `onClose` | `() => void` | Shows a close button and is called when it's clicked. `Alert` doesn't hide itself, so stop rendering it (or update your own state) in the handler |
|
|
63
63
|
|
package/docs/Avatar.md
CHANGED
|
@@ -46,7 +46,7 @@ import { Avatar, AvatarGroup } from '@ahrowe/ui';
|
|
|
46
46
|
| `src` | `string` | Image URL |
|
|
47
47
|
| `alt` | `string` | Image alt text (falls back to `name`) |
|
|
48
48
|
| `name` | `string` | Used to derive fallback initials, and as `alt` text when `alt` isn't given |
|
|
49
|
-
| `icon` | `IconDefinition` |
|
|
49
|
+
| `icon` | `IconDefinition \| ReactElement` | Icon shown when there's no `src` and no `name` — FontAwesome icon or any React element (default a person icon) |
|
|
50
50
|
| `content` | `ReactNode` | Custom fallback content overriding the computed initials/icon (e.g. `"+3"` — what `AvatarGroup` uses for its overflow indicator) |
|
|
51
51
|
| `status` | `'online' \| 'away' \| 'busy' \| 'offline'` | Small status dot on the bottom-right corner, rendered via `Badge` |
|
|
52
52
|
| `className` / `style` | | Root element — sizing is `em`-based, so `style={{ fontSize }}` scales the whole avatar. Shape defaults to `var(--default-border-radius)`; override via the `--avatar-radius` custom property (e.g. `'50%'` for fully circular) |
|
package/docs/Breadcrumb.md
CHANGED
|
@@ -89,7 +89,7 @@ function Example() {
|
|
|
89
89
|
| `id` | `string` | Optional stable key; falls back to the item's index |
|
|
90
90
|
| `label` | `ReactNode` | The crumb's text |
|
|
91
91
|
| `href` | `string` | Renders the crumb as a real `<a>`. Omit to render a plain clickable element (with `onClick`) or static text |
|
|
92
|
-
| `icon` | `IconDefinition` | Optional leading FontAwesome icon |
|
|
92
|
+
| `icon` | `IconDefinition \| ReactElement` | Optional leading icon — FontAwesome icon or any React element |
|
|
93
93
|
| `onClick` | `(event: MouseEvent) => void` | Click handler. Works alongside `href`: call `event.preventDefault()` to stop the native navigation and hand off to a client-side router's own navigate function (see the react-router example above). Also works on its own, with no `href` |
|
|
94
94
|
| `disabled` | `boolean` | Dims the crumb and makes it non-interactive, regardless of `href`/`onClick` |
|
|
95
95
|
|
package/docs/Button.md
CHANGED
|
@@ -46,7 +46,7 @@ import { faSave } from '@fortawesome/free-solid-svg-icons';
|
|
|
46
46
|
| `styleType` | `ButtonStyleType` | Visual variant |
|
|
47
47
|
| `size` | `ButtonSize` | Size variant |
|
|
48
48
|
| `type` | `ButtonType` | HTML button type |
|
|
49
|
-
| `icon` | `IconDefinition` | FontAwesome icon shown before label |
|
|
49
|
+
| `icon` | `IconDefinition \| ReactElement` | FontAwesome icon or any React element, shown before label |
|
|
50
50
|
| `isLoading` | `boolean` | Replaces content with a spinner |
|
|
51
51
|
| `disabled` | `boolean` | |
|
|
52
52
|
| `onClick` | `(e: MouseEvent) => void \| Promise<void>` | |
|
package/docs/CLAUDE.md
CHANGED
|
@@ -90,6 +90,28 @@ Most components expose `classNames` and `styles` props for styling inner element
|
|
|
90
90
|
|
|
91
91
|
Slot keys per component are documented in each component's doc file below.
|
|
92
92
|
|
|
93
|
+
## Icon props (`IconDefinition | ReactElement`)
|
|
94
|
+
|
|
95
|
+
Every `icon` prop (and every icon field inside an item/action object) accepts either a
|
|
96
|
+
FontAwesome `IconDefinition` or an arbitrary React node — an inline `<svg>`, an `<img>`,
|
|
97
|
+
or another icon library's component.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { faPen } from '@fortawesome/free-solid-svg-icons';
|
|
101
|
+
|
|
102
|
+
<Button icon={faPen}>Edit</Button> // FontAwesome
|
|
103
|
+
<Button icon={<MyIcon />}>Edit</Button> // any React node
|
|
104
|
+
<Button icon={<img src="/pen.svg" alt="" />}>Edit</Button>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
A definition is rendered through `FontAwesomeIcon`; an element is rendered as-is, wrapped in a
|
|
108
|
+
`<span>` carrying the component's icon class when that slot is styled. A custom element is not
|
|
109
|
+
sized by FontAwesome's `1em` geometry, so give it its own width/height if the surrounding
|
|
110
|
+
layout expects a square icon.
|
|
111
|
+
|
|
112
|
+
`IconPicker` and the internal `AnimatedIcon` are the exceptions — their behaviour depends on
|
|
113
|
+
FontAwesome internals, so they still take an `IconDefinition` only.
|
|
114
|
+
|
|
93
115
|
## Component docs
|
|
94
116
|
|
|
95
117
|
@Accordion.md
|
package/docs/EmptyState.md
CHANGED
|
@@ -25,6 +25,6 @@ import { faInbox } from '@fortawesome/free-solid-svg-icons';
|
|
|
25
25
|
|
|
26
26
|
| Prop | Type | Description |
|
|
27
27
|
|------|------|-------------|
|
|
28
|
-
| `icon` | `IconDefinition` |
|
|
28
|
+
| `icon` | `IconDefinition \| ReactElement` | Icon shown above the message — FontAwesome icon or any React element |
|
|
29
29
|
| `children` | `ReactNode` | Message body (defaults to `"No entries available"`) |
|
|
30
30
|
| `className` | `string` | Root element class |
|
package/docs/Rating.md
CHANGED
|
@@ -55,7 +55,7 @@ import { faHeart } from '@fortawesome/free-solid-svg-icons';
|
|
|
55
55
|
| `allowClear` | `boolean` | Clicking the currently-selected star resets the value to `0` (default `true`) |
|
|
56
56
|
| `readOnly` | `boolean` | Display only, not focusable or interactive |
|
|
57
57
|
| `disabled` | `boolean` | Dims the control and disables interaction |
|
|
58
|
-
| `icon` | `IconDefinition` | Overrides the default star icon |
|
|
58
|
+
| `icon` | `IconDefinition \| ReactElement` | Overrides the default star icon — FontAwesome icon or any React element |
|
|
59
59
|
| `aria-label` | `string` | Accessible label (default `'Rating'`) |
|
|
60
60
|
|
|
61
61
|
**Accessibility:** renders `role="slider"` with `aria-valuemin`/`aria-valuemax`/`aria-valuenow`/`aria-valuetext`, matching `Slider`'s pattern.
|
package/docs/SectionHeader.md
CHANGED
|
@@ -62,7 +62,7 @@ import { faFolder, faPen, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
|
62
62
|
|------|------|-------------|
|
|
63
63
|
| `title` | `ReactNode` | Main heading |
|
|
64
64
|
| `subtitle` | `ReactNode` | Secondary text below the title |
|
|
65
|
-
| `icon` | `IconDefinition` |
|
|
65
|
+
| `icon` | `IconDefinition \| ReactElement` | Icon shown on the left (FontAwesome icon or any React element); ignored when `thumbnail` is set |
|
|
66
66
|
| `thumbnail` | `string \| ReactNode` | URL → background image; any other ReactNode → rendered inside the leading circle |
|
|
67
67
|
| `left` | `ReactNode` | Leftmost content of the trailing block (title stays fixed to the left of it) |
|
|
68
68
|
| `center` | `ReactNode` | Center content of the trailing block, e.g. a search box or tabs |
|
|
@@ -76,7 +76,7 @@ import { faFolder, faPen, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
|
76
76
|
```ts
|
|
77
77
|
interface SectionHeaderAction {
|
|
78
78
|
title?: string;
|
|
79
|
-
icon: IconDefinition;
|
|
79
|
+
icon: IconDefinition | ReactElement;
|
|
80
80
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
81
81
|
}
|
|
82
82
|
```
|
|
@@ -85,8 +85,8 @@ interface SectionHeaderAction {
|
|
|
85
85
|
|
|
86
86
|
**Theming:** title size/weight per `size` variant come from the theme, with local fallbacks — `SectionHeaderSize.Large` uses `--header-font-size` (falls back `24px`), `Medium` uses `--header-medium-font-size` (falls back `18px`), `Small` uses `--header-small-font-size` (falls back `16px`); all three use `--header-font-weight` for the title's font weight (falls back `600`). The leading icon/thumbnail is sized at `2.2×` the title size, so it scales automatically with the theme; the subtitle size is fixed per `size` variant (not derived), since it doesn't track the title proportionally at the `Large` size. See [ThemeProvider.md](ThemeProvider.md).
|
|
87
87
|
|
|
88
|
-
**Layout:** the title
|
|
88
|
+
**Layout:** the title and its leading icon/thumbnail sit together in an `identity` wrapper that is fixed to the left and only takes the width its content needs; they never wrap apart from each other. The title itself renders on a single line and truncates with an ellipsis (a plain-string `title` is also set as the element's `title` attribute, so the full text is available on hover); the subtitle is clamped to two lines. Everything after it — `left`, `center`, `actions` — lives in a separate `trailing` flex block laid out with `space-between`, so `center` is centered within that block (not the whole header) regardless of how wide `left`/`actions` are.
|
|
89
89
|
|
|
90
|
-
**Responsive:** the header wraps — if `trailing` (`left`/`center`/`actions`) doesn't fit next to the
|
|
90
|
+
**Responsive:** the header wraps — if `trailing` (`left`/`center`/`actions`) doesn't fit next to the `identity` block, it drops to its own row; if `trailing` itself doesn't fit as one row, its own children wrap too. Below `640px` viewport width, `center` additionally takes a full-width row of its own, so a wide `center` element (e.g. a `SearchInput`) isn't squeezed alongside `left`/`actions` on small screens.
|
|
91
91
|
|
|
92
|
-
**Slots:** `root` `leading` `titles` `title` `subtitle` `trailing` `left` `center` `actions`
|
|
92
|
+
**Slots:** `root` `identity` `leading` `titles` `title` `subtitle` `trailing` `left` `center` `actions`
|
package/docs/Stepper.md
CHANGED
|
@@ -69,7 +69,7 @@ const steps = [
|
|
|
69
69
|
| `label` | `ReactNode` | Primary step label |
|
|
70
70
|
| `description` | `ReactNode` | Secondary line under the label |
|
|
71
71
|
| `content` | `ReactNode` | Collapsible body under the label (vertical only) |
|
|
72
|
-
| `icon` | `IconDefinition` |
|
|
72
|
+
| `icon` | `IconDefinition \| ReactElement` | Icon in the marker, replacing the number — FontAwesome icon or any React element |
|
|
73
73
|
| `error` | `boolean` | Recolours the marker with `--stepper-error-color`; suppresses the checkmark |
|
|
74
74
|
| `optional` | `boolean \| ReactNode` | `true` → an "Optional" hint; a node → custom hint text |
|
|
75
75
|
| `disabled` | `boolean` | Never clickable, dimmed |
|
package/docs/TabHeader.md
CHANGED
|
@@ -56,7 +56,7 @@ function Example() {
|
|
|
56
56
|
| Field | Type | Description |
|
|
57
57
|
|-------|------|-------------|
|
|
58
58
|
| `id` | `string` | Unique identifier, matched against `currentTab` |
|
|
59
|
-
| `icon` | `IconDefinition` | FontAwesome icon (always visible, incl. mobile) |
|
|
59
|
+
| `icon` | `IconDefinition \| ReactElement` | FontAwesome icon or any React element (always visible, incl. mobile) |
|
|
60
60
|
| `title` | `string` | Optional title next to the icon |
|
|
61
61
|
| `subtitle` | `string` | Optional subtitle beneath the title |
|
|
62
62
|
| `disabled` | `boolean` | Dim the tab and prevent selection |
|
package/docs/Timeline.md
CHANGED
|
@@ -87,7 +87,7 @@ function AuditLog() {
|
|
|
87
87
|
| `title` | `ReactNode` | Primary label for the entry |
|
|
88
88
|
| `description` | `ReactNode` | Secondary line under the title |
|
|
89
89
|
| `timestamp` | `ReactNode` | Rendered next to the title, e.g. a date or relative time ("2 hours ago") |
|
|
90
|
-
| `icon` | `IconDefinition` |
|
|
90
|
+
| `icon` | `IconDefinition \| ReactElement` | Icon shown in the marker instead of a plain dot — FontAwesome icon or any React element |
|
|
91
91
|
| `status` | `TimelineItemStatus` | Semantic marker colour (default `Default`) |
|
|
92
92
|
| `content` | `ReactNode` | Extra content rendered under the description, e.g. a diff, an attachment, an actor avatar |
|
|
93
93
|
| `onClick` | `(event: MouseEvent<HTMLDivElement>) => void` | Makes the whole entry clickable, rendering it as an accessible button (`role="button"`, focusable, click and Enter both fire it). Omit to render a plain, non-interactive row |
|