@payfit/unity-components 2.60.8 → 2.60.9

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.
@@ -84,6 +84,10 @@ export type { ActionBarActionItem, ActionBarActionItemBase, ActionBarBaseProps,
84
84
  * - Actions support `type: 'button'` (default) or `type: 'icon-button'` for icon-only buttons
85
85
  * - All action-specific props (onPress, prefixIcon, icon, isDisabled, isLoading) go in the `meta` object
86
86
  * - Includes proper ARIA labels and live regions for accessibility
87
+ * - Uses `role="toolbar"` to expose the toolbar semantics to assistive technologies
88
+ * - Groups related actions with `role="group"` inside the toolbar
89
+ * - Provide a concise `aria-label` when the default "Actions toolbar" label is not specific enough
90
+ * - Supports keyboard navigation between actions with Tab and the left and right arrow keys
87
91
  * @see {@link ActionBarProps} for all available props
88
92
  * @see {@link ActionBarActionItem} for action item structure
89
93
  * @see Source code in [Github](https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/action-bar)
@@ -53,6 +53,10 @@ export interface ActionableProps extends AriaButtonProps {
53
53
  * - Supports both static children and render prop pattern for dynamic content
54
54
  * - Use data attributes (`data-hovered`, `data-pressed`, `data-focused`, `data-disabled`, `data-focus-visible`) for styling non-button elements
55
55
  * - Marked as `uy:group` for styling child elements based on parent state
56
+ * - Provide an accessible name for every actionable surface
57
+ * - Use `aria-labelledby` when a visible label already exists, and `aria-describedby` when extra context describes the action
58
+ * - Use `aria-label`, `aria-description`, or `aria-details` when no visible label or description is available
59
+ * - Add relationship attributes such as `aria-controls`, `aria-expanded`, or `aria-haspopup` when the actionable surface controls another element
56
60
  * @see {@link ActionableProps} for all available props
57
61
  * @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/actionable GitHub}
58
62
  * @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/primitives-actionable--docs unity-components.payfit.io}
@@ -50,6 +50,11 @@ export type AlertProps = BaseAlertProps & DismissableConfig & VariantConfig;
50
50
  * <AlertTitle>Pro Tip</AlertTitle>
51
51
  * <AlertContent>Use keyboard shortcuts to navigate faster.</AlertContent>
52
52
  * </Alert>
53
+ * @remarks
54
+ * - Uses `role="status"` with polite announcements for non-critical variants
55
+ * - Uses `role="alert"` with assertive announcements for the `danger` variant
56
+ * - Sets `aria-atomic` so assistive technologies announce the alert as a whole
57
+ * - Follow the WAI-ARIA alert guidance when deciding whether content should interrupt the user
53
58
  */
54
59
  declare const Alert: import('react').ForwardRefExoticComponent<AlertProps & import('react').RefAttributes<HTMLDivElement>>;
55
60
  export { Alert };
@@ -2,14 +2,14 @@ import { TextProps } from '../../text/Text.js';
2
2
  type ContentElements = 'div' | 'p' | 'span';
3
3
  export type AlertContentProps = Omit<TextProps, 'variant' | 'color' | 'className'> & {
4
4
  /**
5
- * The underlying HTML element to render the title as.
5
+ * The underlying HTML element to render the content as.
6
6
  * @default 'p'
7
7
  */
8
8
  asElement?: ContentElements;
9
9
  };
10
10
  declare const AlertContent: import('react').ForwardRefExoticComponent<Omit<TextProps, "color" | "className" | "variant"> & {
11
11
  /**
12
- * The underlying HTML element to render the title as.
12
+ * The underlying HTML element to render the content as.
13
13
  * @default 'p'
14
14
  */
15
15
  asElement?: ContentElements;
@@ -178,6 +178,8 @@ export type AvatarProps = PropsWithChildren<{
178
178
  'aria-labelledby'?: string;
179
179
  /** ID of the element that describes the avatar */
180
180
  'aria-describedby'?: string;
181
+ /** Additional accessible description for the avatar */
182
+ 'aria-description'?: string;
181
183
  /** Additional details for the avatar */
182
184
  'aria-details'?: string;
183
185
  /** Indicates if the avatar is hidden from assistive technologies */
@@ -215,6 +217,9 @@ export type AvatarProps = PropsWithChildren<{
215
217
  * - Use the `square` variant for representing companies or organizations
216
218
  * - The `color` prop applies background and text color variants for icon avatars
217
219
  * - Always provide an `aria-label` or `aria-labelledby` for accessibility
220
+ * - Use `aria-description` when a short additional description helps screen reader users
221
+ * - Use `aria-labelledby` and `aria-describedby` to associate the avatar with visible text that identifies the represented person or entity
222
+ * - 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
223
  * @see {@link AvatarProps} for all available props
219
224
  * @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/avatar GitHub}
220
225
  * @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=19-3741 Figma}
@@ -236,6 +241,8 @@ declare const Avatar: React.ForwardRefExoticComponent<{
236
241
  'aria-labelledby'?: string;
237
242
  /** ID of the element that describes the avatar */
238
243
  'aria-describedby'?: string;
244
+ /** Additional accessible description for the avatar */
245
+ 'aria-description'?: string;
239
246
  /** Additional details for the avatar */
240
247
  'aria-details'?: string;
241
248
  /** Indicates if the avatar is hidden from assistive technologies */
@@ -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">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-components",
3
- "version": "2.60.8",
3
+ "version": "2.60.9",
4
4
  "module": "./dist/esm/index.js",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -96,7 +96,7 @@
96
96
  "tailwind-variants": "3.2.2",
97
97
  "usehooks-ts": "3.1.1",
98
98
  "zod": "4.4.3",
99
- "@payfit/unity-illustrations": "2.60.8"
99
+ "@payfit/unity-illustrations": "2.60.9"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "@hookform/devtools": "^4",
@@ -108,8 +108,8 @@
108
108
  "react-hook-form": "^7",
109
109
  "react-router-dom": "^5",
110
110
  "zod": "^3 || ^4",
111
- "@payfit/unity-icons": "2.60.8",
112
- "@payfit/unity-themes": "2.60.8"
111
+ "@payfit/unity-icons": "2.60.9",
112
+ "@payfit/unity-themes": "2.60.9"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@figma/code-connect": "1.4.9",
@@ -159,10 +159,10 @@
159
159
  "@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
160
160
  "@payfit/storybook-addon-console-errors": "0.0.0-use.local",
161
161
  "@payfit/storybook-config": "0.0.0-use.local",
162
- "@payfit/unity-icons": "2.60.8",
163
- "@payfit/unity-themes": "2.60.8",
164
- "@payfit/vite-configs": "0.0.0-use.local",
165
- "@payfit/unity-illustrations": "2.60.8"
162
+ "@payfit/unity-icons": "2.60.9",
163
+ "@payfit/unity-illustrations": "2.60.9",
164
+ "@payfit/unity-themes": "2.60.9",
165
+ "@payfit/vite-configs": "0.0.0-use.local"
166
166
  },
167
167
  "peerDependenciesMeta": {
168
168
  "@hookform/devtools": {