@payfit/unity-components 2.60.8 → 2.60.10
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/components/action-bar/ActionBar.d.ts +4 -0
- package/dist/esm/components/actionable/Actionable.d.ts +4 -0
- package/dist/esm/components/alert/Alert.d.ts +5 -0
- package/dist/esm/components/alert/parts/AlertContent.d.ts +2 -2
- package/dist/esm/components/app-menu/parts/AppMenuFooter.d.ts +8 -33
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +14 -180
- package/dist/esm/components/app-profile-menu-button/AppProfileMenuButton.d.ts +25 -0
- package/dist/esm/components/app-profile-menu-button/AppProfileMenuButton.js +70 -0
- package/dist/esm/components/app-profile-menu-button/parts/AppProfileAvatar.d.ts +18 -0
- package/dist/esm/components/app-profile-menu-button/parts/AppProfileAvatar.js +79 -0
- package/dist/esm/components/app-profile-menu-button/parts/AppProfileMenuHeader.d.ts +14 -0
- package/dist/esm/components/app-profile-menu-button/parts/AppProfileMenuHeader.js +88 -0
- package/dist/esm/components/avatar/Avatar.d.ts +12 -27
- package/dist/esm/components/badge/Badge.d.ts +4 -0
- package/dist/esm/components/carousel/Carousel.d.ts +4 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.d.ts +1 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.d.ts +1 -0
- package/dist/esm/components/icon/Icon.d.ts +3 -0
- package/dist/esm/components/link/RawLink.d.ts +3 -0
- package/dist/esm/components/payfit-brand/PayFitBrand.d.ts +3 -0
- package/dist/esm/components/radio-button-group/RadioButtonGroup.d.ts +3 -0
- package/dist/esm/components/skip-links/SkipLinks.d.ts +3 -0
- package/dist/esm/components/spinner/Spinner.d.ts +7 -0
- package/dist/esm/components/timeline/Timeline.d.ts +4 -0
- package/dist/esm/docs/reference/catalog/catalog.generated.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +215 -214
- package/i18n/en-GB.json +1 -0
- package/i18n/es-ES.json +1 -0
- package/i18n/fr-FR.json +1 -0
- package/package.json +7 -7
- package/src/agent-references/component-catalog.json +29 -0
|
@@ -163,6 +163,13 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
163
163
|
primary: string;
|
|
164
164
|
};
|
|
165
165
|
}, undefined, undefined, unknown, unknown, undefined>>>;
|
|
166
|
+
type AvatarAccessibleName = {
|
|
167
|
+
'aria-label': string;
|
|
168
|
+
'aria-labelledby'?: string;
|
|
169
|
+
} | {
|
|
170
|
+
'aria-label'?: string;
|
|
171
|
+
'aria-labelledby': string;
|
|
172
|
+
};
|
|
166
173
|
export type AvatarProps = PropsWithChildren<{
|
|
167
174
|
/** Additional class names to apply to the avatar */
|
|
168
175
|
className?: string;
|
|
@@ -172,17 +179,13 @@ export type AvatarProps = PropsWithChildren<{
|
|
|
172
179
|
size?: VariantProps<typeof avatarRoot>['size'];
|
|
173
180
|
/** Color variant for icon avatars. One of: teal, plum, purple, orange, neutral, warning, success, info, danger, promo, primary */
|
|
174
181
|
color?: VariantProps<typeof avatarRoot>['color'];
|
|
175
|
-
/** Accessible label for the avatar */
|
|
176
|
-
'aria-label': string;
|
|
177
|
-
/** ID of the element that labels the avatar */
|
|
178
|
-
'aria-labelledby'?: string;
|
|
179
182
|
/** ID of the element that describes the avatar */
|
|
180
183
|
'aria-describedby'?: string;
|
|
181
184
|
/** Additional details for the avatar */
|
|
182
185
|
'aria-details'?: string;
|
|
183
186
|
/** Indicates if the avatar is hidden from assistive technologies */
|
|
184
187
|
'aria-hidden'?: boolean;
|
|
185
|
-
}>;
|
|
188
|
+
} & AvatarAccessibleName>;
|
|
186
189
|
/**
|
|
187
190
|
* The Avatar component displays visual or text content for representing people or entities.
|
|
188
191
|
* It supports images, initials, placeholders, and icons with customizable colors and sizes.
|
|
@@ -215,32 +218,14 @@ export type AvatarProps = PropsWithChildren<{
|
|
|
215
218
|
* - Use the `square` variant for representing companies or organizations
|
|
216
219
|
* - The `color` prop applies background and text color variants for icon avatars
|
|
217
220
|
* - Always provide an `aria-label` or `aria-labelledby` for accessibility
|
|
221
|
+
* - Use `aria-description` when a short additional description helps screen reader users
|
|
222
|
+
* - Use `aria-labelledby` and `aria-describedby` to associate the avatar with visible text that identifies the represented person or entity
|
|
223
|
+
* - The avatar has `role="img"` by default and should not be used as an interactive element directly; wrap it in a button or Actionable when it triggers an action
|
|
218
224
|
* @see {@link AvatarProps} for all available props
|
|
219
225
|
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/avatar GitHub}
|
|
220
226
|
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=19-3741 Figma}
|
|
221
227
|
* @see Design docs in {@link https://www.payfit.design/24f360409/p/69c10a-avatar Payfit.design}
|
|
222
228
|
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-avatar unity-components.payfit.io}
|
|
223
229
|
*/
|
|
224
|
-
declare const Avatar: React.ForwardRefExoticComponent<
|
|
225
|
-
/** Additional class names to apply to the avatar */
|
|
226
|
-
className?: string;
|
|
227
|
-
/** The avatar's variant. One of: circle or square */
|
|
228
|
-
variant?: VariantProps<typeof avatarRoot>["variant"];
|
|
229
|
-
/** Size of the avatar. One of: xs, sm, md, lg, xl */
|
|
230
|
-
size?: VariantProps<typeof avatarRoot>["size"];
|
|
231
|
-
/** Color variant for icon avatars. One of: teal, plum, purple, orange, neutral, warning, success, info, danger, promo, primary */
|
|
232
|
-
color?: VariantProps<typeof avatarRoot>["color"];
|
|
233
|
-
/** Accessible label for the avatar */
|
|
234
|
-
'aria-label': string;
|
|
235
|
-
/** ID of the element that labels the avatar */
|
|
236
|
-
'aria-labelledby'?: string;
|
|
237
|
-
/** ID of the element that describes the avatar */
|
|
238
|
-
'aria-describedby'?: string;
|
|
239
|
-
/** Additional details for the avatar */
|
|
240
|
-
'aria-details'?: string;
|
|
241
|
-
/** Indicates if the avatar is hidden from assistive technologies */
|
|
242
|
-
'aria-hidden'?: boolean;
|
|
243
|
-
} & {
|
|
244
|
-
children?: React.ReactNode | undefined;
|
|
245
|
-
} & React.RefAttributes<HTMLSpanElement>>;
|
|
230
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
246
231
|
export { Avatar };
|
|
@@ -121,6 +121,10 @@ export type BadgeProps = PropsWithChildren<{
|
|
|
121
121
|
}>;
|
|
122
122
|
/**
|
|
123
123
|
* The Badge component is a visual label or indicator used to convey status or highlight content.
|
|
124
|
+
* @remarks
|
|
125
|
+
* - The badge role is auto-calculated from the `variant`: `warning`, `danger`, and `attention` use `alert`; other variants use `status`.
|
|
126
|
+
* - Override the role with `role="status"` or `role="alert"` only when the surrounding context needs a different announcement behavior.
|
|
127
|
+
* - Use `aria-label` when the visible badge text is too short or when no nearby content explains the badge's purpose.
|
|
124
128
|
*/
|
|
125
129
|
declare const Badge: import('react').ForwardRefExoticComponent<{
|
|
126
130
|
/**
|
|
@@ -55,6 +55,10 @@ export interface CarouselProps {
|
|
|
55
55
|
* </Carousel>
|
|
56
56
|
* ```
|
|
57
57
|
* ## Accessibility
|
|
58
|
+
* - The carousel region is labelled by `CarouselHeader` by default, or by `aria-label` when provided
|
|
59
|
+
* - Tab moves focus into `CarouselContent` on the first visible slide
|
|
60
|
+
* - Only visible `CarouselSlide`s can receive focus; hidden slides are removed from assistive technologies and keyboard navigation
|
|
61
|
+
* - Carousel slides use roving tabindex so only the current slide has `tabindex=0`
|
|
58
62
|
* - Arrow keys navigate between individual slides
|
|
59
63
|
* - PageUp/PageDown jump to the first slide of the next/previous page
|
|
60
64
|
* - Home/End keys jump to the first/last slide
|
|
@@ -53,6 +53,7 @@ export interface DataTableBulkActionsProps<TData> {
|
|
|
53
53
|
* - Use F6 keyboard shortcut to focus the action bar when it's visible and has actions
|
|
54
54
|
* - The keyboard shortcut provides quick access to bulk actions for users with disabilities
|
|
55
55
|
* - When triggered, focus moves to the first focusable element in the action bar (typically the first action button)
|
|
56
|
+
* - Once focused, use Tab to move between actions and Escape to return focus to the previously focused element
|
|
56
57
|
* - The shortcut only works when rows are selected and the action bar is visible
|
|
57
58
|
* - The selection count and clear button are rendered automatically via `prefixContent`
|
|
58
59
|
* @see {@link DataTableBulkActionsProps} for all available props
|
|
@@ -95,6 +95,7 @@ export declare const filterToolbar: import('tailwind-variants').TVReturnType<{
|
|
|
95
95
|
* - Each filter definition must include a unique `id`, `label`, and `renderControl` function to render the filter UI
|
|
96
96
|
* - The `renderLabel` function customizes how selected values appear in the filter button
|
|
97
97
|
* - Newly added filters automatically open their popover to guide users through configuration
|
|
98
|
+
* - Filters supplied through `initialValue` do not open automatically; their popover opens only after user interaction
|
|
98
99
|
* - All filters can be cleared at once using the "Clear filters" button
|
|
99
100
|
* - The component is uncontrolled by default but notifies parent components of state changes via callbacks
|
|
100
101
|
* @see {@link FilterToolbarProps} for all available props
|
|
@@ -257,6 +257,9 @@ export type IconProps = VariantProps<typeof icon> & Pick<HTMLAttributes<HTMLSpan
|
|
|
257
257
|
};
|
|
258
258
|
/**
|
|
259
259
|
* The `Icon` component displays an icon from the Unity icon set.
|
|
260
|
+
* @remarks
|
|
261
|
+
* - Provide `alt` when the icon has no visible label; it is exposed as the icon's `aria-label`.
|
|
262
|
+
* - When a visible label exists, use `aria-labelledby` to reference it instead. In that case, `alt` is not exposed as an additional `aria-label`.
|
|
260
263
|
*/
|
|
261
264
|
export declare function Icon({ alt, color, size, src, role, display, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
262
265
|
export {};
|
|
@@ -212,6 +212,9 @@ export type RawLinkProps = Omit<AriaLinkProps, 'style' | 'className'> & {
|
|
|
212
212
|
};
|
|
213
213
|
/**
|
|
214
214
|
* Links allow users to navigate to different pages or sections.
|
|
215
|
+
* @remarks
|
|
216
|
+
* - Links support mouse and touch interactions, keyboard navigation, and activation with Enter or Space.
|
|
217
|
+
* - Use a link when an action navigates or changes the URL. Use a button for actions without a meaningful destination.
|
|
215
218
|
*/
|
|
216
219
|
declare const RawLink: import('react').ForwardRefExoticComponent<Omit<AriaLinkProps, "style" | "className"> & {
|
|
217
220
|
/**
|
|
@@ -44,5 +44,8 @@ export type PayFitBrandProps = {
|
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* The PayFitBrand component represents the PayFit logo with several properties that follow our brand guidelines.
|
|
47
|
+
* @remarks
|
|
48
|
+
* - Provide a meaningful `label` and, when useful, a `description` so screen readers can announce the brand in context.
|
|
49
|
+
* - The brand is not focusable by default, but can be part of a focusable element such as a link, so these accessible texts should always be provided.
|
|
47
50
|
*/
|
|
48
51
|
export declare const PayFitBrand: import('react').ForwardRefExoticComponent<PayFitBrandProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -7,6 +7,9 @@ export type RadioButtonGroupProps = Omit<RadioGroupProps, 'className' | 'style'>
|
|
|
7
7
|
/**
|
|
8
8
|
* The `RadioButtonGroup` component enables users to select a single option from a set of mutually exclusive choices.
|
|
9
9
|
* It manages the selection state, keyboard navigation, focus handling, and accessibility features for a group of RadioButton components.
|
|
10
|
+
* @remarks
|
|
11
|
+
* - Arrow keys move focus between options and select the focused option.
|
|
12
|
+
* - Disabled options are skipped automatically during keyboard navigation.
|
|
10
13
|
* @example
|
|
11
14
|
* ```tsx
|
|
12
15
|
* import { RadioButton, RadioButtonGroup } from '@payfit/unity-components'
|
|
@@ -44,6 +44,9 @@ export interface SkipLinkProps extends PropsWithChildren<HTMLAttributes<HTMLAnch
|
|
|
44
44
|
* @remarks
|
|
45
45
|
* - Skip links are visually hidden by default and become visible when focused
|
|
46
46
|
* - Each link should target an element with a valid ID and tabIndex={-1}
|
|
47
|
+
* - The component exposes navigation and list semantics labelled through `aria-labelledby`
|
|
48
|
+
* - Links follow the normal tab order and can be activated with Enter or Space
|
|
49
|
+
* - Place skip links where they should occur in the page tab order and avoid fixed or absolute positioning that could conflict with other skip links
|
|
47
50
|
* - The component follows WCAG 2.1 guidelines for skip navigation
|
|
48
51
|
* @see {@link SkipLinksProps} for all available props
|
|
49
52
|
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/skip-links GitHub}
|
|
@@ -7,6 +7,13 @@ export type SpinnerProps = Pick<HTMLAttributes<HTMLDivElement>, 'aria-hidden' |
|
|
|
7
7
|
/** Te spinner's color, can be 'primary', 'inverted', or 'inherit', which will make it take the element's `currentColor` */
|
|
8
8
|
color?: 'primary' | 'inverted' | 'inherit';
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* The Spinner component indicates that content is loading or an action is being processed.
|
|
12
|
+
* @remarks
|
|
13
|
+
* - It uses `role="status"` and an `aria-live="polite"` region by default.
|
|
14
|
+
* - It is not included in the keyboard tab order.
|
|
15
|
+
* - Always provide a `label` for assistive technologies, even though it is only visible at the medium size.
|
|
16
|
+
*/
|
|
10
17
|
export declare const Spinner: import('react').ForwardRefExoticComponent<Pick<HTMLAttributes<HTMLDivElement>, "role" | "aria-hidden"> & {
|
|
11
18
|
/** The label text for the spinner */
|
|
12
19
|
label: string;
|
|
@@ -34,6 +34,10 @@ export type TimelineProps = {
|
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Timeline component displays chronological events in vertical or horizontal orientation
|
|
37
|
+
* @remarks
|
|
38
|
+
* - Provide an `aria-label` that identifies the timeline for screen reader users.
|
|
39
|
+
* - Use `customProgressLabel` when the overall progress needs additional context.
|
|
40
|
+
* - Step titles and state descriptions are associated through ARIA attributes, while visual status badges are hidden from assistive technologies to avoid duplicate announcements.
|
|
37
41
|
* @example
|
|
38
42
|
* ```tsx
|
|
39
43
|
* <Timeline orientation="vertical" type="numbered">
|
|
@@ -103,7 +103,7 @@ export declare const catalogEntries: ({
|
|
|
103
103
|
};
|
|
104
104
|
related: never[];
|
|
105
105
|
section: "patterns";
|
|
106
|
-
tags: ("type:pattern" | "category:navigation")[];
|
|
106
|
+
tags: ("type:pattern" | "category:content" | "category:navigation" | "behavior:disclosure" | "behavior:editing")[];
|
|
107
107
|
title: string;
|
|
108
108
|
principal?: undefined;
|
|
109
109
|
} | {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './components/app-top-bar/AppTopBar.js';
|
|
|
13
13
|
export * from './components/app-menu/AppMenu.js';
|
|
14
14
|
export * from './components/app-menu/parts/AppMenu.context.js';
|
|
15
15
|
export * from './components/app-menu/parts/AppMenuFooter.js';
|
|
16
|
+
export * from './components/app-profile-menu-button/AppProfileMenuButton.js';
|
|
16
17
|
export * from './components/app-menu/parts/AppMenuHeader.js';
|
|
17
18
|
export * from './components/app-menu/parts/AppMenuNavContent.js';
|
|
18
19
|
export * from './components/autocomplete/Autocomplete.js';
|