@ksojecki/purpose-ui 0.3.1 → 0.3.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.
- package/dist/actions/Button.d.ts +2 -0
- package/dist/actions/IconActionButtons.d.ts +2 -0
- package/dist/data/Avatar.d.ts +10 -2
- package/dist/data/DataTable.d.ts +5 -1
- package/dist/data/Metric.d.ts +15 -3
- package/dist/data/Table.d.ts +6 -1
- package/dist/feedback/Alert.d.ts +11 -2
- package/dist/feedback/Badge.d.ts +7 -1
- package/dist/feedback/ConfirmDeletePanel.d.ts +5 -1
- package/dist/feedback/EmptyState.d.ts +5 -1
- package/dist/feedback/Progress.d.ts +10 -2
- package/dist/feedback/Spinner.d.ts +1 -0
- package/dist/feedback/Toast.d.ts +6 -1
- package/dist/feedback/Tooltip.d.ts +1 -0
- package/dist/forms/Checkbox.d.ts +1 -0
- package/dist/forms/Field.d.ts +1 -0
- package/dist/forms/FileInput.d.ts +6 -1
- package/dist/forms/FilterRow.d.ts +1 -0
- package/dist/forms/FormActions.d.ts +5 -1
- package/dist/forms/Input.d.ts +6 -1
- package/dist/forms/Radio.d.ts +2 -0
- package/dist/forms/Range.d.ts +2 -0
- package/dist/forms/SegmentedControl.d.ts +5 -1
- package/dist/forms/Select.d.ts +6 -1
- package/dist/forms/Textarea.d.ts +6 -1
- package/dist/forms/TimePicker.d.ts +1 -0
- package/dist/layout/BottomSheet.d.ts +5 -1
- package/dist/layout/Card.d.ts +6 -1
- package/dist/layout/Disclosure.d.ts +1 -0
- package/dist/layout/Divider.d.ts +6 -1
- package/dist/layout/PageContainer.d.ts +1 -0
- package/dist/layout/PageHeader.d.ts +5 -1
- package/dist/layout/Section.d.ts +5 -1
- package/dist/navigation/Dropdown.d.ts +13 -2
- package/dist/navigation/Link.d.ts +7 -1
- package/dist/navigation/Menu.d.ts +9 -1
- package/dist/overlays/ModalWindow/ModalWindow.d.ts +7 -1
- package/dist/typography/Heading/Heading.d.ts +5 -1
- package/dist/typography/Paragraph.d.ts +1 -0
- package/package.json +2 -1
package/dist/actions/Button.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export type ButtonVariant = 'solid' | 'soft' | 'outline';
|
|
|
5
5
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
6
6
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
7
|
children: ReactNode;
|
|
8
|
+
/** @default false */
|
|
8
9
|
fullWidth?: boolean;
|
|
10
|
+
/** @default false */
|
|
9
11
|
isLoading?: boolean;
|
|
10
12
|
/** Semantic action meaning. Apps should prefer `purpose` over `tone`. */
|
|
11
13
|
purpose?: ActionPurpose;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type IconButtonProps } from './IconButton';
|
|
2
2
|
import type { ButtonTone } from './Button';
|
|
3
3
|
type IconActionButtonProps = Omit<IconButtonProps, 'icon' | 'tone' | 'variant'> & {
|
|
4
|
+
/** @default 'neutral' for EditButton, 'error' for DeleteButton, 'primary' for NewButton */
|
|
4
5
|
tone?: ButtonTone;
|
|
6
|
+
/** @default 'soft', or 'solid' when tone is 'ghost' */
|
|
5
7
|
variant?: IconButtonProps['variant'];
|
|
6
8
|
};
|
|
7
9
|
/**
|
package/dist/data/Avatar.d.ts
CHANGED
|
@@ -4,9 +4,17 @@ export interface AvatarProps {
|
|
|
4
4
|
name: string;
|
|
5
5
|
/** An optional image URL. Missing or failed images fall back to initials or a person icon. */
|
|
6
6
|
src?: string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Frame size, from 24px (xs) to 96px (xl). Defaults to md (40px).
|
|
9
|
+
*
|
|
10
|
+
* @default 'md'
|
|
11
|
+
*/
|
|
8
12
|
size?: AvatarSize;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Hide the avatar from assistive technology when nearby text already names the person.
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
10
18
|
decorative?: boolean;
|
|
11
19
|
/** Additional classes for the avatar frame. */
|
|
12
20
|
className?: string;
|
package/dist/data/DataTable.d.ts
CHANGED
|
@@ -22,7 +22,11 @@ export interface DataTableProps<T extends object> extends Omit<TableProps, 'chil
|
|
|
22
22
|
rows: readonly T[];
|
|
23
23
|
/** One column per property of the first row when omitted. */
|
|
24
24
|
columns?: ReadonlyArray<DataTableColumn<T>>;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Defaults to `row.id`, then the row index.
|
|
27
|
+
*
|
|
28
|
+
* @default (row, index) => row.id ?? index
|
|
29
|
+
*/
|
|
26
30
|
getRowKey?: (row: T, index: number) => Key;
|
|
27
31
|
/** Rendered instead of the table when there are no rows. */
|
|
28
32
|
empty?: ReactNode;
|
package/dist/data/Metric.d.ts
CHANGED
|
@@ -3,9 +3,17 @@ import type { StatusPurpose } from '../internal/purpose';
|
|
|
3
3
|
export interface MetricGroupProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Stacks the stats vertically. Default is horizontal, as daisyUI does.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
7
11
|
vertical?: boolean;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Stacks the stats below the `sm` breakpoint and lays them out in a row from `sm` up. Wins over `vertical`.
|
|
14
|
+
*
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
9
17
|
responsive?: boolean;
|
|
10
18
|
}
|
|
11
19
|
export type MetricAppearance = 'default' | 'boxed';
|
|
@@ -14,7 +22,11 @@ export interface MetricProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
14
22
|
value: ReactNode;
|
|
15
23
|
description?: ReactNode;
|
|
16
24
|
figure?: ReactNode;
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* `boxed` draws a bordered card around the figure. Default has no frame.
|
|
27
|
+
*
|
|
28
|
+
* @default 'default'
|
|
29
|
+
*/
|
|
18
30
|
appearance?: MetricAppearance;
|
|
19
31
|
/** Colour of the value. Omit for the default text colour. */
|
|
20
32
|
tone?: StatusPurpose;
|
package/dist/data/Table.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
2
|
export type TableSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface TableProps extends ComponentPropsWithRef<'table'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Density of rows and cells.
|
|
6
|
+
*
|
|
7
|
+
* @default 'sm'
|
|
8
|
+
*/
|
|
5
9
|
tableSize?: TableSize;
|
|
10
|
+
/** @default false */
|
|
6
11
|
zebra?: boolean;
|
|
7
12
|
/** Classes for the scrolling wrapper `div`. */
|
|
8
13
|
wrapperClassName?: string;
|
package/dist/feedback/Alert.d.ts
CHANGED
|
@@ -2,11 +2,20 @@ import type { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
import type { StatusPurpose } from '../internal/purpose';
|
|
3
3
|
export type AlertVariant = 'solid' | 'soft';
|
|
4
4
|
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Set to false for static notices: no live region is rendered and no role is set.
|
|
7
|
+
*
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
6
10
|
announce?: boolean;
|
|
7
11
|
children: ReactNode;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Semantic meaning of the alert. Colour and default live region role are derived from it.
|
|
14
|
+
*
|
|
15
|
+
* @default 'info'
|
|
16
|
+
*/
|
|
9
17
|
purpose?: StatusPurpose;
|
|
18
|
+
/** @default 'solid' */
|
|
10
19
|
variant?: AlertVariant;
|
|
11
20
|
}
|
|
12
21
|
/**
|
package/dist/feedback/Badge.d.ts
CHANGED
|
@@ -5,9 +5,15 @@ export type BadgeSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
5
5
|
export type BadgeVariant = 'solid' | 'soft' | 'outline';
|
|
6
6
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Semantic meaning of the badge. Colour is derived from it.
|
|
10
|
+
*
|
|
11
|
+
* @default 'neutral'
|
|
12
|
+
*/
|
|
9
13
|
purpose?: BadgePurpose;
|
|
14
|
+
/** @default 'md' */
|
|
10
15
|
size?: BadgeSize;
|
|
16
|
+
/** @default 'soft' */
|
|
11
17
|
variant?: BadgeVariant;
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
@@ -7,7 +7,11 @@ export interface ConfirmDeletePanelProps {
|
|
|
7
7
|
warning?: ReactNode;
|
|
8
8
|
/** Error from the last attempt, announced as an alert. */
|
|
9
9
|
error?: ReactNode;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Disables both buttons while the delete request runs.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
11
15
|
saving?: boolean;
|
|
12
16
|
cancelLabel: string;
|
|
13
17
|
confirmLabel: string;
|
|
@@ -5,7 +5,11 @@ export interface EmptyStateProps {
|
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
/** Optional call to action rendered below the message. */
|
|
7
7
|
action?: ReactNode;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* `sm` for small inline lists and charts.
|
|
10
|
+
*
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
9
13
|
size?: 'sm' | 'md';
|
|
10
14
|
className?: string;
|
|
11
15
|
}
|
|
@@ -4,11 +4,19 @@ export type ProgressPurpose = StatusPurpose | 'neutral';
|
|
|
4
4
|
export interface ProgressProps extends Omit<ComponentPropsWithoutRef<'progress'>, 'value' | 'max'> {
|
|
5
5
|
/** Accessible name announced with the value. Required. */
|
|
6
6
|
label: string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Upper bound of the meter.
|
|
9
|
+
*
|
|
10
|
+
* @default 100
|
|
11
|
+
*/
|
|
8
12
|
max?: number;
|
|
9
13
|
/** Position of a thin tick over the bar, in the same unit as `max`. Clamped into [0, max]. */
|
|
10
14
|
marker?: number;
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Semantic meaning of the meter. Colour is derived from it.
|
|
17
|
+
*
|
|
18
|
+
* @default 'neutral'
|
|
19
|
+
*/
|
|
12
20
|
purpose?: ProgressPurpose;
|
|
13
21
|
/** Current amount. Clamped into [0, max]. */
|
|
14
22
|
value: number;
|
|
@@ -3,6 +3,7 @@ export type SpinnerSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
3
3
|
export interface SpinnerProps extends ComponentPropsWithoutRef<'span'> {
|
|
4
4
|
/** Announced text. Without it the spinner is decorative and hidden from assistive tech. */
|
|
5
5
|
label?: string;
|
|
6
|
+
/** @default 'md' */
|
|
6
7
|
size?: SpinnerSize;
|
|
7
8
|
}
|
|
8
9
|
/**
|
package/dist/feedback/Toast.d.ts
CHANGED
|
@@ -4,11 +4,16 @@ export type ToastPosition = 'top-end' | 'bottom-end' | 'bottom-center';
|
|
|
4
4
|
export interface ToastRegionProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Corner or edge the toasts stack in.
|
|
9
|
+
*
|
|
10
|
+
* @default 'bottom-end'
|
|
11
|
+
*/
|
|
8
12
|
position?: ToastPosition;
|
|
9
13
|
}
|
|
10
14
|
interface ToastBaseProps {
|
|
11
15
|
children: ReactNode;
|
|
16
|
+
/** @default 'info' */
|
|
12
17
|
purpose?: StatusPurpose;
|
|
13
18
|
}
|
|
14
19
|
/** A dismissable toast needs both the handler and the accessible name of its button. */
|
package/dist/forms/Checkbox.d.ts
CHANGED
package/dist/forms/Field.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare function fieldDescribedBy(controlId: string, hint?: string, error
|
|
|
34
34
|
export declare function FieldMessage({ children, id, tone, }: {
|
|
35
35
|
children: ReactNode;
|
|
36
36
|
id?: string;
|
|
37
|
+
/** @default 'hint' */
|
|
37
38
|
tone?: 'hint' | 'error';
|
|
38
39
|
}): import("react").JSX.Element;
|
|
39
40
|
/**
|
|
@@ -4,8 +4,13 @@ export interface FileInputProps extends Omit<ComponentPropsWithRef<'input'>, 'si
|
|
|
4
4
|
label?: string;
|
|
5
5
|
hint?: string;
|
|
6
6
|
error?: string;
|
|
7
|
+
/** @default 'md' */
|
|
7
8
|
controlSize?: ControlSize;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Stretches to the container width.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
9
14
|
fullWidth?: boolean;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
@@ -2,7 +2,11 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
export interface FormActionsProps {
|
|
3
3
|
/** Shown above the buttons as an assertive error alert. */
|
|
4
4
|
error?: ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Disables both buttons and switches the save label to `savingLabel`.
|
|
7
|
+
*
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
6
10
|
saving?: boolean;
|
|
7
11
|
saveLabel: ReactNode;
|
|
8
12
|
savingLabel?: ReactNode;
|
package/dist/forms/Input.d.ts
CHANGED
|
@@ -4,8 +4,13 @@ export interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size'>
|
|
|
4
4
|
label?: string;
|
|
5
5
|
hint?: string;
|
|
6
6
|
error?: string;
|
|
7
|
+
/** @default 'md' */
|
|
7
8
|
controlSize?: ControlSize;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Stretches to the container width.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
9
14
|
fullWidth?: boolean;
|
|
10
15
|
}
|
|
11
16
|
/**
|
package/dist/forms/Radio.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface RadioProps extends Omit<ComponentPropsWithRef<'input'>, 'size'
|
|
|
4
4
|
label: string;
|
|
5
5
|
hint?: string;
|
|
6
6
|
error?: string;
|
|
7
|
+
/** @default 'md' */
|
|
7
8
|
controlSize?: ControlSize;
|
|
8
9
|
}
|
|
9
10
|
export interface RadioOption {
|
|
@@ -16,6 +17,7 @@ export interface RadioGroupProps {
|
|
|
16
17
|
name: string;
|
|
17
18
|
onChange: (value: string) => void;
|
|
18
19
|
options: RadioOption[];
|
|
20
|
+
/** @default 'vertical' */
|
|
19
21
|
orientation?: 'vertical' | 'horizontal';
|
|
20
22
|
value: string;
|
|
21
23
|
hint?: string;
|
package/dist/forms/Range.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export interface RangeProps extends Pick<ComponentPropsWithoutRef<'input'>, 'dis
|
|
|
8
8
|
max: number;
|
|
9
9
|
min: number;
|
|
10
10
|
onChange: (value: number) => void;
|
|
11
|
+
/** @default 'primary' */
|
|
11
12
|
purpose?: RangePurpose;
|
|
13
|
+
/** @default 'md' */
|
|
12
14
|
size?: ControlSize;
|
|
13
15
|
step?: number;
|
|
14
16
|
value: number;
|
|
@@ -7,7 +7,11 @@ export interface SegmentedOption {
|
|
|
7
7
|
export interface SegmentedControlProps {
|
|
8
8
|
/** Accessible name of the group. */
|
|
9
9
|
label: string;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Stretch to the container width and share it equally between options.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
11
15
|
fullWidth?: boolean;
|
|
12
16
|
onChange: (value: string) => void;
|
|
13
17
|
options: SegmentedOption[];
|
package/dist/forms/Select.d.ts
CHANGED
|
@@ -4,8 +4,13 @@ export interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, 'size
|
|
|
4
4
|
label?: string;
|
|
5
5
|
hint?: string;
|
|
6
6
|
error?: string;
|
|
7
|
+
/** @default 'md' */
|
|
7
8
|
controlSize?: ControlSize;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Stretches to the container width.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
9
14
|
fullWidth?: boolean;
|
|
10
15
|
}
|
|
11
16
|
/**
|
package/dist/forms/Textarea.d.ts
CHANGED
|
@@ -4,8 +4,13 @@ export interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
hint?: string;
|
|
6
6
|
error?: string;
|
|
7
|
+
/** @default 'md' */
|
|
7
8
|
controlSize?: ControlSize;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Stretches to the container width.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
9
14
|
fullWidth?: boolean;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
2
|
export interface BottomSheetProps extends Omit<ComponentPropsWithoutRef<'section'>, 'title'> {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Uncontrolled initial state. Ignored when `open` is set.
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
5
9
|
defaultOpen?: boolean;
|
|
6
10
|
className?: string;
|
|
7
11
|
/** Controlled open state. */
|
package/dist/layout/Card.d.ts
CHANGED
|
@@ -2,10 +2,15 @@ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
2
2
|
export type CardSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface CardProps extends Omit<ComponentPropsWithoutRef<'section'>, 'title'> {
|
|
4
4
|
actions?: ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Use `article` for a self-contained item in a list, such as an account.
|
|
7
|
+
*
|
|
8
|
+
* @default 'section'
|
|
9
|
+
*/
|
|
6
10
|
as?: 'section' | 'article';
|
|
7
11
|
children: ReactNode;
|
|
8
12
|
className?: string;
|
|
13
|
+
/** @default 'md' */
|
|
9
14
|
size?: CardSize;
|
|
10
15
|
title?: ReactNode;
|
|
11
16
|
}
|
package/dist/layout/Divider.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
export interface DividerProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
+
/** @default false */
|
|
4
5
|
vertical?: boolean;
|
|
5
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* For a flex-row parent: draws a vertical separator between items.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
6
11
|
row?: boolean;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
@@ -2,7 +2,11 @@ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
2
2
|
export interface PageHeaderProps extends Omit<ComponentPropsWithoutRef<'header'>, 'title'> {
|
|
3
3
|
actions?: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Use a compact, unboxed presentation when the header sits directly on the page.
|
|
7
|
+
*
|
|
8
|
+
* @default 'default'
|
|
9
|
+
*/
|
|
6
10
|
appearance?: 'default' | 'plain';
|
|
7
11
|
description?: ReactNode;
|
|
8
12
|
eyebrow?: ReactNode;
|
package/dist/layout/Section.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
export interface SectionProps extends Omit<ComponentPropsWithoutRef<'section'>, 'title'> {
|
|
3
3
|
actions?: ReactNode;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Use a compact, unboxed presentation when the section is part of the page flow.
|
|
6
|
+
*
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
5
9
|
appearance?: 'default' | 'plain';
|
|
6
10
|
children: ReactNode;
|
|
7
11
|
className?: string;
|
|
@@ -6,12 +6,21 @@ export interface DropdownProps {
|
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
/** Extra panel classes, such as a width. */
|
|
8
8
|
contentClassName?: string;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Hide the panel after a click on a link or button inside it.
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
10
14
|
closeOnSelect?: boolean;
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Disables the trigger.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
12
20
|
disabled?: boolean;
|
|
13
21
|
/** Alias of `triggerClassName`: both are joined onto the trigger. `ButtonGroup` adds `join-item` through it. */
|
|
14
22
|
className?: string;
|
|
23
|
+
/** @default 'start' */
|
|
15
24
|
align?: DropdownAlign;
|
|
16
25
|
/** Fires from the popover `toggle` event with the new open state. */
|
|
17
26
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -24,10 +33,12 @@ export interface DropdownProps {
|
|
|
24
33
|
triggerLabel?: string;
|
|
25
34
|
/** Id of the trigger button, for a `<label htmlFor>`. */
|
|
26
35
|
triggerId?: string;
|
|
36
|
+
/** @default 'neutral' */
|
|
27
37
|
triggerPurpose?: ActionPurpose;
|
|
28
38
|
/** Explicit trigger tone; wins over the tone of `triggerPurpose`. */
|
|
29
39
|
triggerTone?: ButtonTone;
|
|
30
40
|
triggerSize?: ButtonSize;
|
|
41
|
+
/** @default false */
|
|
31
42
|
triggerSquare?: boolean;
|
|
32
43
|
}
|
|
33
44
|
/**
|
|
@@ -6,13 +6,19 @@ export type LinkTone = ButtonTone;
|
|
|
6
6
|
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
to: To;
|
|
9
|
+
/** @default false */
|
|
9
10
|
asButton?: boolean;
|
|
11
|
+
/** @default false */
|
|
10
12
|
fullWidth?: boolean;
|
|
11
13
|
/** Semantic action meaning. Colour comes from it unless `tone` is set. */
|
|
12
14
|
purpose?: ActionPurpose;
|
|
13
15
|
/** Button size; only applies with `asButton`. */
|
|
14
16
|
size?: ButtonSize;
|
|
15
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Square icon-only button; only applies with `asButton`.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
16
22
|
square?: boolean;
|
|
17
23
|
tone?: LinkTone;
|
|
18
24
|
variant?: ButtonVariant;
|
|
@@ -5,7 +5,9 @@ export type MenuSize = ButtonSize;
|
|
|
5
5
|
export interface MenuProps {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
+
/** @default false */
|
|
8
9
|
horizontal?: boolean;
|
|
10
|
+
/** @default 'md' */
|
|
9
11
|
size?: MenuSize;
|
|
10
12
|
}
|
|
11
13
|
export interface MenuItemProps {
|
|
@@ -14,12 +16,18 @@ export interface MenuItemProps {
|
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
to?: To;
|
|
16
18
|
}>;
|
|
19
|
+
/** @default false */
|
|
17
20
|
active?: boolean;
|
|
21
|
+
/** @default false */
|
|
18
22
|
disabled?: boolean;
|
|
19
23
|
}
|
|
20
24
|
export interface MenuNavLinkProps {
|
|
21
25
|
children: ReactNode;
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Match the route only when it is exactly `to`.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
23
31
|
end?: boolean;
|
|
24
32
|
to: To;
|
|
25
33
|
}
|
|
@@ -11,16 +11,22 @@ export type ModalWindowProps = {
|
|
|
11
11
|
title: string;
|
|
12
12
|
onClose?: () => void;
|
|
13
13
|
closeLabel?: string;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Dialog width. Default `lg`.
|
|
16
|
+
*
|
|
17
|
+
* @default 'lg'
|
|
18
|
+
*/
|
|
15
19
|
size?: DialogSize;
|
|
16
20
|
};
|
|
17
21
|
export type NativeDialogProps = {
|
|
18
22
|
children: ReactNode;
|
|
19
23
|
api?: RefObject<ModalWindowApi | null>;
|
|
20
24
|
open?: boolean;
|
|
25
|
+
/** @default false */
|
|
21
26
|
saving?: boolean;
|
|
22
27
|
onClose?: () => void;
|
|
23
28
|
backdropLabel?: string;
|
|
29
|
+
/** @default 'modal-box' */
|
|
24
30
|
boxClassName?: string;
|
|
25
31
|
labelledBy?: string;
|
|
26
32
|
/** Dialog width. Omit to keep the daisyUI default width of `boxClassName`. */
|
|
@@ -4,7 +4,11 @@ export interface HeadingProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
6
|
level: HeadingLevel;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Visual size when it differs from the level, so the tag can keep the document outline. `label` is a small bold section label.
|
|
9
|
+
*
|
|
10
|
+
* @default level
|
|
11
|
+
*/
|
|
8
12
|
size?: HeadingLevel | 'label';
|
|
9
13
|
id?: string;
|
|
10
14
|
/** Full text shown on hover, for truncated headings. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ksojecki/purpose-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "React UI components and daisyUI themes with semantic purpose props.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
"oxfmt": "0.79.0",
|
|
116
116
|
"oxlint": "1.94.0",
|
|
117
117
|
"react": "19.3.1",
|
|
118
|
+
"react-docgen": "8.0.4",
|
|
118
119
|
"react-dom": "19.3.1",
|
|
119
120
|
"react-hook-form": "7.92.0",
|
|
120
121
|
"react-router": "8.5.2",
|