@ssa-ui-kit/core 3.24.1 → 3.25.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.
@@ -4,7 +4,7 @@ Generated from the TypeScript program at build time — do not edit by hand.
4
4
 
5
5
  **Everything below is imported from the package root:** `import { X } from '@ssa-ui-kit/core'`
6
6
 
7
- 190 components · 20 contexts · 23 hooks · 17 functions · 16 constants · 315 exported types
7
+ 192 components · 20 contexts · 23 hooks · 17 functions · 16 constants · 325 exported types
8
8
 
9
9
  ## Reading this file
10
10
 
@@ -16,13 +16,13 @@ Generated from the TypeScript program at build time — do not edit by hand.
16
16
 
17
17
  ## Component roster
18
18
 
19
- **Action & Form Controls** — BreadcrumbMenu, Breadcrumbs, Button, ButtonGroup, ButtonGroupButton, Checkbox, ColorPicker, DatePicker, DateRangePicker, DateRangePickerFormBridge, Dropdown, DropdownArrow, DropdownBase, DropdownOption, DropdownOptions, DropdownToggle, FileAttachment, FileUpload, IconButton, Input, MultipleDropdown, MultipleDropdownNotification, MultipleDropdownOptions, NumberField, Radio, RadioGroup, SearchBox, SearchBoxCrossIcon, SearchBoxInput, SearchBoxWrapper, Slider, SliderInputsRow, SliderLabel, SliderMarkItem, SliderMarkLabel, SliderMarksRow, SliderMarkTick, SliderNumberInput, SliderRangeInput, SliderRoot, SliderTrackBg, SliderTrackFill, SliderTrackRow, SliderTrackWrapper, SliderValueLabel, SliderValueLabelsContainer, Switch, Textarea, TextField, Typeahead, TypeaheadItemIcon, TypeaheadItemImage, TypeaheadOption, TypeaheadOptions
19
+ **Action & Form Controls** — BreadcrumbMenu, Breadcrumbs, Button, ButtonGroup, ButtonGroupButton, Checkbox, ColorPicker, DatePicker, DateRangePicker, DateRangePickerFormBridge, Dropdown, DropdownArrow, DropdownBase, DropdownOption, DropdownOptions, DropdownToggle, FileAttachment, FileUpload, FloatingActionButton, IconButton, Input, MultipleDropdown, MultipleDropdownNotification, MultipleDropdownOptions, NumberField, Radio, RadioGroup, SearchBox, SearchBoxCrossIcon, SearchBoxInput, SearchBoxWrapper, Slider, SliderInputsRow, SliderLabel, SliderMarkItem, SliderMarkLabel, SliderMarksRow, SliderMarkTick, SliderNumberInput, SliderRangeInput, SliderRoot, SliderTrackBg, SliderTrackFill, SliderTrackRow, SliderTrackWrapper, SliderValueLabel, SliderValueLabelsContainer, Switch, Textarea, TextField, Typeahead, TypeaheadItemIcon, TypeaheadItemImage, TypeaheadOption, TypeaheadOptions
20
20
 
21
21
  **Form Structure** — Filters, FiltersMultiSelect, FiltersMultiSelectEmpty, FiltersMultiSelectOption, FiltersMultiSelectOptions, Form, FormAction, FormCheckbox, FormGroup, FormHelperText, FormRadioGroup
22
22
 
23
23
  **Data Display** — Avatar, Badge, BarGaugeChart, BarGaugeChartComponent, BarLineComplexChart, BigNumberChart, BigNumberChartComponent, Calendar, CalendarEventDetails, CandlestickChart, CandlestickChartComponent, Card, CardBase, CardContent, CardHeader, CardList, Carousel, ChartBackground, Chip, ColumnFreezeMenu, ColumnResizeHandle, Counter, FunnelChart, GaugeChart, ImageItem, Indicator, Label, NestedTable, NestedTableCell, NestedTableCellHeader, NestedTableCellSubHeader, NestedTableRow, PieChart, PieChartComponent, PieChartLegend, Progress, ProgressBar, ProgressCircle, ProgressInfo, ProgressInfoTotals, ProgressLegend, ProgressLegendItem, ProgressVertical, ResponsiveImage, SegmentedPieChart, SegmentedPieChartComponent, Table, TableBody, TableCell, TableCellHeader, TableContainer, TableFilterCheckbox, TableFilters, TableFiltersAccordion, TableFiltersAccordionContent, TableFiltersButtons, TableFiltersCancelButton, TableFiltersClearButton, TableFilterTrigger, TableFilterTriggerWithNotification, TableHead, TableRow, Tag, TreeMapChart, TreeMapChartComponent, TreeMapTooltipBase, Typography, WithNestedTableRow
24
24
 
25
- **Navigation & Layout** — CollapsibleNavBar, CollapsibleNavBarCustomIconSVG, History, LargeTab, Link, LinksTabBar, NavBar, Pagination, Step, StepConnector, StepLabel, Stepper, Tab, TabBar, TreeView, WithLink, WithPagination, WithVisibleLG, WithVisibleMD, WithVisibleSM, WithVisibleUpToLG, Wrapper
25
+ **Navigation & Layout** — CollapsibleNavBar, CollapsibleNavBarCustomIconSVG, Header, History, LargeTab, Link, LinksTabBar, NavBar, Pagination, Step, StepConnector, StepLabel, Stepper, Tab, TabBar, TreeView, WithLink, WithPagination, WithVisibleLG, WithVisibleMD, WithVisibleSM, WithVisibleUpToLG, Wrapper
26
26
 
27
27
  **Overlay & Feedback** — Modal, ModalContent, ModalDialog, ModalDismissButton, ModalOpenButton, NotificationCard, NotificationMenu, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeading, PopoverTrigger, ProgressChartTooltip, SimpleChartTooltip, Tooltip, TooltipContent, TooltipContentBase, TooltipTrigger
28
28
 
@@ -326,6 +326,26 @@ File input component with optional drag-and-drop support
326
326
  - `onChange?: (files: File[]) => void`
327
327
  - `onFileRejected?: (file: File, reason: FileRejectionReason) => void`
328
328
 
329
+ #### FloatingActionButton
330
+ A button fixed to a corner of the viewport for the page's primary action, optionally opening a speed-dial menu of related actions.
331
+
332
+ - `icon?: FloatingActionButtonIcon` `= 'plus'` — Icon of the button (of the menu trigger while the menu is closed).
333
+ - `label?: string` — Text shown next to the icon (the "extended" FAB). Without it the FAB is icon-only and needs an `aria-label`.
334
+ - `color?: FloatingActionButtonColor` `= 'primary'` — Background color. Pre-defined `primary` / `secondary`, a theme color key or any CSS color; custom colors get…
335
+ - `shadow?: boolean` `= true` — Draws the elevation shadow under the button.
336
+ - `shape?: 'square' | 'round'` `= 'square'` — Corner shape: `square` keeps the 8px radius, `round` is fully rounded (a circle when icon-only, a pill when…
337
+ - `size?: FloatingActionButtonSize` `= 'medium'` — Size of the button and of its menu items.
338
+ - `disabled?: boolean` `= false` — Disables the button (and, in menu mode, opening the menu).
339
+ - `onClick?: MouseEventHandler<HTMLButtonElement>` — Click handler. In menu mode it also runs, before the menu toggles.
340
+ - `actions?: FloatingActionButtonAction[]` — Items of the speed-dial menu. When given, the button toggles a stack of secondary FABs above it (below it for…
341
+ - `showActionLabels?: boolean` `= true` — Shows each action's `label` next to its icon. When `false` the items are icon-only and the label stays as…
342
+ - `open?: boolean` — Controlled open state of the menu.
343
+ - `defaultOpen?: boolean` `= false` — Initial open state of the menu when uncontrolled.
344
+ - `onOpenChange?: (open: boolean) => void` — Called when the menu opens or closes.
345
+ - `openIcon?: FloatingActionButtonIcon` `= 'cross'` — Icon of the trigger while the menu is open.
346
+ - `position?: FloatingActionButtonPosition` `= 'bottom-right'` — Viewport corner the FAB is fixed to.
347
+ - `offset?: number | { x: number; y: number; }` `= 24` — Distance from the corner in px — one value for both axes, or `{ x, y }`.
348
+
329
349
  #### IconButton
330
350
  Square icon-only button for icon actions
331
351
 
@@ -1543,6 +1563,17 @@ The app sidebar: a logo, a menu, and three layouts.
1543
1563
  _No library-specific props._
1544
1564
  - _plus native element attributes_
1545
1565
 
1566
+ #### Header
1567
+ The application's top bar: logo, main navigation and a free slot on the right for the user profile, notifications or log out.
1568
+
1569
+ - `logo?: ReactNode` — Project logo, placed in a box of fixed height. Leave it out and the box stays empty, so the layout does not…
1570
+ - `items?: HeaderNavItem[]` — Navigation items. Rendered centred; scrolls sideways when it overflows.
1571
+ - `rightSide?: ReactNode` — Right-hand content — user profile, notifications, log out, whatever the app needs. Rendered as-is on every…
1572
+ - `size?: HeaderSize` `= 'small'` — Bar height and logo size
1573
+ - `navLabel?: string` `= 'Main'` — Accessible name of the navigation landmark
1574
+ - `menuButtonLabel?: string` `= 'Open menu'` — Accessible name of the burger button shown below 900px
1575
+ - _plus native element attributes_
1576
+
1546
1577
  #### History
1547
1578
  Vertical timeline component for chronological events.
1548
1579
 
@@ -2375,45 +2406,48 @@ _Names only — read the `.d.ts` for their shape._
2375
2406
  `FieldLabelProps` · `FieldProps` · `FieldSuccessProps` · `FileAttachmentFile`
2376
2407
  `FileAttachmentProps` · `FileRejectionReason` · `FileUploadProgressEntry` · `FileUploadProgress`
2377
2408
  `FileUploadProps` · `Filter` · `FiltersMultiSelectEmptyProps` · `FiltersMultiSelectOptionProps`
2378
- `FiltersMultiSelectProps` · `FloatingSurfaceColor` · `FloatingSurfaceSize` · `Format`
2409
+ `FiltersMultiSelectProps` · `FloatingActionButtonAction` · `FloatingActionButtonColor`
2410
+ `FloatingActionButtonIcon` · `FloatingActionButtonPosition` · `FloatingActionButtonProps`
2411
+ `FloatingActionButtonSize` · `FloatingSurfaceColor` · `FloatingSurfaceSize` · `Format`
2379
2412
  `FrozenColumns` · `FullscreenModeContextType` · `FunnelChartItem` · `FunnelChartProps`
2380
2413
  `FunnelChartRender` · `FunnelChartType` · `GaugeBarProps` · `GaugeBarThreshold`
2381
- `GaugeBarValueFormatter` · `GaugeChartFeature` · `GaugeChartProps` · `HistoryItemType`
2382
- `HistoryProps` · `IFormCheckboxProps` · `IconButtonProps` · `IconProps` · `ImageItemProps`
2383
- `IndicatorProps` · `InputColors` · `InputProps` · `InputStatusColors` · `InteractionsEnabled`
2384
- `Item` · `LabelProps` · `LargeTabProps` · `LastFocusedElement` · `LinkProps` · `LinksTabBarProps`
2385
- `MainColors` · `MainSizes` · `MapIconsType` · `ModalContextProps` · `ModalDialogProps`
2386
- `ModalProps` · `ModalRootProps` · `MountMode` · `MultipleStylesProps` · `NavBarExtendedGroup`
2387
- `NavBarExtendedItem` · `NavBarExtendedProps` · `NavBarExtendedSubItem` · `NavBarProps`
2388
- `NestedTableCellHeaderProps` · `NestedTableContextType` · `NestedTableContextValue`
2389
- `NestedTableProps` · `NestedTableRowContextType` · `NotificationCardProps`
2390
- `NotificationDynamicProps` · `NotificationGlobalSharedProps` · `NotificationMenuProps`
2391
- `NotificationPositions` · `NotificationProps` · `NotificationSharedProps` · `NotificationSizes`
2392
- `NotificationStyleOverrides` · `NotificationType` · `NotificationVariants` · `NumberFieldProps`
2393
- `OpenStateProps` · `OpenedAccordion` · `PageButtonProps` · `PaginationButtonsProps`
2394
- `PaginationContextProps` · `PaginationContextProviderProps` · `PaginationProps` · `PaletteColor`
2395
- `Palette` · `PeriodOption` · `Period` · `PersonInfoAvatarProps` · `PersonInfoCounterProps`
2396
- `PersonInfoCounterTooltipUser` · `PersonInfoCounterTooltip` · `PersonInfoLinkAttributes`
2397
- `PersonInfoProps` · `PersonInfoStyles` · `PersonInfoValueProps` · `PickerType` · `PieChartFeatures`
2398
- `PieChartLegendItem` · `PieChartLegendProps` · `PieChartProps` · `PieChartTooltipProps`
2399
- `PieChartTooltipViewProps` · `PopoverArrowProps` · `PopoverContentProps` · `PopoverOptions`
2400
- `PopoverTriggerProps` · `ProgressBarProps` · `ProgressChartTooltipProps` · `ProgressCircleProps`
2401
- `ProgressInfoItemProps` · `ProgressInfoProps` · `ProgressInfoResp` · `ProgressInfoTotalsProps`
2402
- `ProgressProps` · `RGBString` · `RadioGroupProps` · `RadioProps` · `RangePickerType`
2403
- `RenderContentProps` · `ResizeHandleProps` · `ResolveDeprecatedPropOptions` · `ResolvedOpenState`
2404
- `ResponsiveImageProps` · `SVGProps` · `SearchBoxProps` · `SelectedFilter` · `SetIDs`
2405
- `SimpleChartTooltipProps` · `SizeStyles` · `SliderMark` · `SliderProps` · `SliderSize`
2406
- `SmallTabProps` · `StepperContextType` · `StepperProps` · `SwitchContext` · `SwitchProps`
2407
- `TabBarContextProps` · `TabBarLink` · `TabBarProps` · `TabBaseProps` · `TabProps`
2408
- `TableContainerProps` · `TableProps` · `TagsProps` · `TextFieldProps` · `TextareaProps` · `Theme`
2409
- `ToastProps` · `ToastVariants` · `TooltipArrowProps` · `TooltipColor` · `TooltipContentProps`
2410
- `TooltipContentSizes` · `TooltipContextType` · `TooltipProps` · `TooltipSize`
2411
- `TooltipTriggerProps` · `TranslationContextContent` · `TreeItemBase` · `TreeItemLevel2`
2412
- `TreeItemLevel3` · `TreeItemRenderProps` · `TreeItem` · `TreeLevel` · `TreeMapChartFeature`
2413
- `TreeMapChartProps` · `TreeNode` · `TreeViewProps` · `TypeaheadItemProps`
2414
- `TypeaheadItemsListProps` · `TypeaheadOptionProps` · `TypeaheadProps` · `TypeaheadValue`
2415
- `TypographyProps` · `UseBreadcrumbsOptions` · `UseChartInfo` · `UseColumnResizeOptions`
2416
- `UseDrawerOptions` · `UseFiltersMultiSelectOptions` · `UseFiltersMultiSelectStore` · `UsePopover`
2417
- `UseTooltipArgs` · `UseTooltipContext` · `UseTooltip` · `UseTypeaheadProps` · `UserProfileProps`
2418
- `ValueLabelDisplay` · `VariantStyle` · `WidgetCardProps` · `WithNestedTableRowProps`
2419
- `WithWidgetCardProps` · `WrapperAlignItems` · `WrapperDirection` · `WrapperJustifyContent`
2414
+ `GaugeBarValueFormatter` · `GaugeChartFeature` · `GaugeChartProps` · `HeaderNavItem` · `HeaderProps`
2415
+ `HeaderSize` · `HeaderTheme` · `HistoryItemType` · `HistoryProps` · `IFormCheckboxProps`
2416
+ `IconButtonProps` · `IconProps` · `ImageItemProps` · `IndicatorProps` · `InputColors` · `InputProps`
2417
+ `InputStatusColors` · `InteractionsEnabled` · `Item` · `LabelProps` · `LargeTabProps`
2418
+ `LastFocusedElement` · `LinkProps` · `LinksTabBarProps` · `MainColors` · `MainSizes`
2419
+ `MapIconsType` · `ModalContextProps` · `ModalDialogProps` · `ModalProps` · `ModalRootProps`
2420
+ `MountMode` · `MultipleStylesProps` · `NavBarExtendedGroup` · `NavBarExtendedItem`
2421
+ `NavBarExtendedProps` · `NavBarExtendedSubItem` · `NavBarProps` · `NestedTableCellHeaderProps`
2422
+ `NestedTableContextType` · `NestedTableContextValue` · `NestedTableProps`
2423
+ `NestedTableRowContextType` · `NotificationCardProps` · `NotificationDynamicProps`
2424
+ `NotificationGlobalSharedProps` · `NotificationMenuProps` · `NotificationPositions`
2425
+ `NotificationProps` · `NotificationSharedProps` · `NotificationSizes` · `NotificationStyleOverrides`
2426
+ `NotificationType` · `NotificationVariants` · `NumberFieldProps` · `OpenStateProps`
2427
+ `OpenedAccordion` · `PageButtonProps` · `PaginationButtonsProps` · `PaginationContextProps`
2428
+ `PaginationContextProviderProps` · `PaginationProps` · `PaletteColor` · `Palette` · `PeriodOption`
2429
+ `Period` · `PersonInfoAvatarProps` · `PersonInfoCounterProps` · `PersonInfoCounterTooltipUser`
2430
+ `PersonInfoCounterTooltip` · `PersonInfoLinkAttributes` · `PersonInfoProps` · `PersonInfoStyles`
2431
+ `PersonInfoValueProps` · `PickerType` · `PieChartFeatures` · `PieChartLegendItem`
2432
+ `PieChartLegendProps` · `PieChartProps` · `PieChartTooltipProps` · `PieChartTooltipViewProps`
2433
+ `PopoverArrowProps` · `PopoverContentProps` · `PopoverOptions` · `PopoverTriggerProps`
2434
+ `ProgressBarProps` · `ProgressChartTooltipProps` · `ProgressCircleProps` · `ProgressInfoItemProps`
2435
+ `ProgressInfoProps` · `ProgressInfoResp` · `ProgressInfoTotalsProps` · `ProgressProps` · `RGBString`
2436
+ `RadioGroupProps` · `RadioProps` · `RangePickerType` · `RenderContentProps` · `ResizeHandleProps`
2437
+ `ResolveDeprecatedPropOptions` · `ResolvedOpenState` · `ResponsiveImageProps` · `SVGProps`
2438
+ `SearchBoxProps` · `SelectedFilter` · `SetIDs` · `SimpleChartTooltipProps` · `SizeStyles`
2439
+ `SliderMark` · `SliderProps` · `SliderSize` · `SmallTabProps` · `StepperContextType`
2440
+ `StepperProps` · `SwitchContext` · `SwitchProps` · `TabBarContextProps` · `TabBarLink`
2441
+ `TabBarProps` · `TabBaseProps` · `TabProps` · `TableContainerProps` · `TableProps` · `TagsProps`
2442
+ `TextFieldProps` · `TextareaProps` · `Theme` · `ToastProps` · `ToastVariants` · `TooltipArrowProps`
2443
+ `TooltipColor` · `TooltipContentProps` · `TooltipContentSizes` · `TooltipContextType`
2444
+ `TooltipProps` · `TooltipSize` · `TooltipTriggerProps` · `TranslationContextContent`
2445
+ `TreeItemBase` · `TreeItemLevel2` · `TreeItemLevel3` · `TreeItemRenderProps` · `TreeItem`
2446
+ `TreeLevel` · `TreeMapChartFeature` · `TreeMapChartProps` · `TreeNode` · `TreeViewProps`
2447
+ `TypeaheadItemProps` · `TypeaheadItemsListProps` · `TypeaheadOptionProps` · `TypeaheadProps`
2448
+ `TypeaheadValue` · `TypographyProps` · `UseBreadcrumbsOptions` · `UseChartInfo`
2449
+ `UseColumnResizeOptions` · `UseDrawerOptions` · `UseFiltersMultiSelectOptions`
2450
+ `UseFiltersMultiSelectStore` · `UsePopover` · `UseTooltipArgs` · `UseTooltipContext` · `UseTooltip`
2451
+ `UseTypeaheadProps` · `UserProfileProps` · `ValueLabelDisplay` · `VariantStyle` · `WidgetCardProps`
2452
+ `WithNestedTableRowProps` · `WithWidgetCardProps` · `WrapperAlignItems` · `WrapperDirection`
2453
+ `WrapperJustifyContent`
@@ -0,0 +1,79 @@
1
+ import { FloatingActionButtonIcon, FloatingActionButtonSize } from './types';
2
+ /**
3
+ * FloatingActionButton - A button fixed to a corner of the viewport for the
4
+ * page's primary action, optionally opening a speed-dial menu of related
5
+ * actions.
6
+ *
7
+ * ### Look
8
+ * Icon-only by default; pass `label` for the extended (icon + text) FAB.
9
+ * `color` takes the design's `primary` / `secondary`, a theme color key or
10
+ * any CSS color — for custom colors the icon and label color is chosen for
11
+ * contrast. `shadow` and `shape` are independent of the color.
12
+ *
13
+ * ### Menu
14
+ * Pass `actions` to turn the button into a menu trigger. The items stack
15
+ * away from the corner as secondary FABs of the same size; the trigger
16
+ * switches to `openIcon` while open. Choosing an item, Escape, a click
17
+ * outside or tabbing away closes the menu. Control it with `open` +
18
+ * `onOpenChange`, or leave it uncontrolled (`defaultOpen`).
19
+ *
20
+ * ### Icons
21
+ * A kit icon name is sized for the FAB and painted with its foreground color.
22
+ * Any other node is rendered as-is.
23
+ *
24
+ * @category Components
25
+ * @subcategory Buttons
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <FloatingActionButton aria-label="Add member" onClick={addMember} />
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * // Extended, secondary, bottom-left
35
+ * <FloatingActionButton label="New report" color="secondary" position="bottom-left" />
36
+ * ```
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * // Speed-dial menu
41
+ * <FloatingActionButton
42
+ * aria-label="Create"
43
+ * actions={[
44
+ * { id: 'task', icon: 'plus', label: 'Task', onClick: createTask },
45
+ * { id: 'note', icon: 'edit', label: 'Note', onClick: createNote },
46
+ * ]}
47
+ * />
48
+ * ```
49
+ *
50
+ * @accessibility
51
+ * - Icon-only FABs need an `aria-label` (a dev warning fires without one)
52
+ * - In menu mode the trigger has `aria-haspopup="menu"` and `aria-expanded`;
53
+ * the items are `menuitem`s
54
+ * - Opening the menu from the keyboard focuses its first item; ↑/↓, Home and
55
+ * End move between items (and from the trigger into the menu while it is
56
+ * open); Escape closes it and returns focus to the trigger
57
+ */
58
+ export declare const FloatingActionButton: import("react").ForwardRefExoticComponent<Pick<import("react").AriaAttributes, "aria-label" | "aria-describedby"> & {
59
+ icon?: FloatingActionButtonIcon;
60
+ label?: string;
61
+ color?: import("./types").FloatingActionButtonColor;
62
+ shadow?: boolean;
63
+ shape?: "square" | "round";
64
+ size?: FloatingActionButtonSize;
65
+ disabled?: boolean;
66
+ onClick?: import("react").MouseEventHandler<HTMLButtonElement>;
67
+ actions?: import("./types").FloatingActionButtonAction[];
68
+ showActionLabels?: boolean;
69
+ open?: boolean;
70
+ defaultOpen?: boolean;
71
+ onOpenChange?: (open: boolean) => void;
72
+ openIcon?: FloatingActionButtonIcon;
73
+ position?: import("./types").FloatingActionButtonPosition;
74
+ offset?: number | {
75
+ x: number;
76
+ y: number;
77
+ };
78
+ className?: string;
79
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ export * from './FloatingActionButton';
@@ -0,0 +1,42 @@
1
+ import { Theme } from '@emotion/react';
2
+ import { FloatingActionButtonColor, FloatingActionButtonPosition, FloatingActionButtonSize } from './types';
3
+ type SizeTokens = {
4
+ /** Height, and width when icon-only. */
5
+ box: number;
6
+ /** Glyph size when icon-only. */
7
+ iconOnly: number;
8
+ /** Glyph size next to a label. */
9
+ iconLabelled: number;
10
+ paddingLeft: number;
11
+ paddingRight: number;
12
+ gap: number;
13
+ fontSize: number;
14
+ lineHeight: number;
15
+ };
16
+ /**
17
+ * Figma draws labelled FABs 4px taller than icon-only ones of the same size;
18
+ * that is a design bug, so both use the icon-only height here.
19
+ */
20
+ export declare const SIZES: Record<FloatingActionButtonSize, SizeTokens>;
21
+ export type ColorTokens = {
22
+ background: string;
23
+ hover: string;
24
+ active: string;
25
+ foreground: string;
26
+ };
27
+ /**
28
+ * Resolves `color` to the four colors a FAB paints with. The two named
29
+ * colors follow the design tokens; anything else is a theme key or CSS
30
+ * color whose foreground is picked for contrast.
31
+ */
32
+ export declare const resolveColors: (theme: Theme, color: FloatingActionButtonColor) => ColorTokens;
33
+ export declare const container: (position: FloatingActionButtonPosition, x: number, y: number) => import("@emotion/react").SerializedStyles;
34
+ export declare const menu: (position: FloatingActionButtonPosition) => import("@emotion/react").SerializedStyles;
35
+ export declare const button: (theme: Theme, { size, colors, shadow, round, labelled, }: {
36
+ size: FloatingActionButtonSize;
37
+ colors: ColorTokens;
38
+ shadow: boolean;
39
+ round: boolean;
40
+ labelled: boolean;
41
+ }) => import("@emotion/react").SerializedStyles;
42
+ export {};
@@ -0,0 +1,129 @@
1
+ import { AriaAttributes, MouseEventHandler, ReactNode } from 'react';
2
+ import { ColorsKeys } from '../../types/emotion';
3
+ import { IconProps } from '../Icon/types';
4
+ /**
5
+ * Size scale of a {@link FloatingActionButton}. Icon-only and labelled FABs
6
+ * share one height per size: 32 / 36 / 40 / 44px.
7
+ */
8
+ export type FloatingActionButtonSize = 'extraSmall' | 'small' | 'medium' | 'large';
9
+ /**
10
+ * Corner of the viewport the {@link FloatingActionButton} is fixed to.
11
+ */
12
+ export type FloatingActionButtonPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
13
+ /**
14
+ * Background color of a {@link FloatingActionButton}.
15
+ * - `primary`: theme blue with a white icon (design default)
16
+ * - `secondary`: light grey with a dark icon
17
+ * - any theme color key (e.g. `'green'`) or CSS color string — the icon and
18
+ * label color is picked automatically for contrast
19
+ */
20
+ export type FloatingActionButtonColor = 'primary' | 'secondary' | ColorsKeys | (string & {});
21
+ /**
22
+ * Icon of a FAB or of a menu action: a kit icon name, sized and colored by
23
+ * the FAB, or any node — which then brings its own size and color.
24
+ */
25
+ export type FloatingActionButtonIcon = IconProps['name'] | ReactNode;
26
+ /**
27
+ * A single item of a {@link FloatingActionButton} menu.
28
+ */
29
+ export type FloatingActionButtonAction = {
30
+ /** Stable key for the item. */
31
+ id: string;
32
+ /** Icon of the item. */
33
+ icon: FloatingActionButtonIcon;
34
+ /**
35
+ * Text of the item. Always its accessible name; shown next to the icon
36
+ * unless `showActionLabels` is `false`.
37
+ */
38
+ label: string;
39
+ /** Called when the item is chosen. The menu then closes. */
40
+ onClick: () => void;
41
+ /** Disables the item. */
42
+ disabled?: boolean;
43
+ };
44
+ /**
45
+ * Props of the {@link FloatingActionButton} component.
46
+ */
47
+ export type FloatingActionButtonProps = Pick<AriaAttributes, 'aria-label' | 'aria-describedby'> & {
48
+ /**
49
+ * Icon of the button (of the menu trigger while the menu is closed).
50
+ * @default 'plus'
51
+ */
52
+ icon?: FloatingActionButtonIcon;
53
+ /**
54
+ * Text shown next to the icon (the "extended" FAB). Without it the FAB is
55
+ * icon-only and needs an `aria-label`.
56
+ */
57
+ label?: string;
58
+ /**
59
+ * Background color. Pre-defined `primary` / `secondary`, a theme color key
60
+ * or any CSS color; custom colors get an auto-contrast icon and label.
61
+ * @default 'primary'
62
+ */
63
+ color?: FloatingActionButtonColor;
64
+ /**
65
+ * Draws the elevation shadow under the button.
66
+ * @default true
67
+ */
68
+ shadow?: boolean;
69
+ /**
70
+ * Corner shape: `square` keeps the 8px radius, `round` is fully rounded
71
+ * (a circle when icon-only, a pill when labelled).
72
+ * @default 'square'
73
+ */
74
+ shape?: 'square' | 'round';
75
+ /**
76
+ * Size of the button and of its menu items.
77
+ * @default 'medium'
78
+ */
79
+ size?: FloatingActionButtonSize;
80
+ /**
81
+ * Disables the button (and, in menu mode, opening the menu).
82
+ * @default false
83
+ */
84
+ disabled?: boolean;
85
+ /**
86
+ * Click handler. In menu mode it also runs, before the menu toggles.
87
+ */
88
+ onClick?: MouseEventHandler<HTMLButtonElement>;
89
+ /**
90
+ * Items of the speed-dial menu. When given, the button toggles a stack of
91
+ * secondary FABs above it (below it for `top-*` positions).
92
+ */
93
+ actions?: FloatingActionButtonAction[];
94
+ /**
95
+ * Shows each action's `label` next to its icon. When `false` the items are
96
+ * icon-only and the label stays as their accessible name.
97
+ * @default true
98
+ */
99
+ showActionLabels?: boolean;
100
+ /** Controlled open state of the menu. */
101
+ open?: boolean;
102
+ /**
103
+ * Initial open state of the menu when uncontrolled.
104
+ * @default false
105
+ */
106
+ defaultOpen?: boolean;
107
+ /** Called when the menu opens or closes. */
108
+ onOpenChange?: (open: boolean) => void;
109
+ /**
110
+ * Icon of the trigger while the menu is open.
111
+ * @default 'cross'
112
+ */
113
+ openIcon?: FloatingActionButtonIcon;
114
+ /**
115
+ * Viewport corner the FAB is fixed to.
116
+ * @default 'bottom-right'
117
+ */
118
+ position?: FloatingActionButtonPosition;
119
+ /**
120
+ * Distance from the corner in px — one value for both axes, or `{ x, y }`.
121
+ * @default 24
122
+ */
123
+ offset?: number | {
124
+ x: number;
125
+ y: number;
126
+ };
127
+ /** Class name of the fixed container. */
128
+ className?: string;
129
+ };
@@ -0,0 +1,43 @@
1
+ import { HeaderProps } from './types';
2
+ /**
3
+ * Header - The application's top bar: logo, main navigation and a free slot
4
+ * on the right for the user profile, notifications or log out.
5
+ *
6
+ * ### Navigation
7
+ * `items` render as react-router links, so the Header must sit inside a
8
+ * router. The item matching the current location is highlighted, and so is
9
+ * every group above it. Groups open a dropdown — on hover with a mouse, on
10
+ * tap on touch screens — and a dropdown item can open a flyout one level
11
+ * further. Following a link closes them.
12
+ *
13
+ * ### Layout
14
+ * From 900px the navigation is centred between the logo and the right side,
15
+ * and scrolls sideways when it does not fit. Below 900px it moves into a
16
+ * drawer opened by a burger button, the logo is centred and `rightSide`
17
+ * stays as it is.
18
+ *
19
+ * ### Selected state
20
+ * The design sets the selected item in bold. The kit marks it by color
21
+ * only: a heavier face widens the item and shifts the whole bar whenever the
22
+ * route changes.
23
+ *
24
+ * @category Navigation
25
+ * @example
26
+ * ```tsx
27
+ * <Header
28
+ * logo={<img src="/logo.svg" alt="Acme" height={38} />}
29
+ * items={[
30
+ * { id: 'home', label: 'Home', path: '/' },
31
+ * {
32
+ * id: 'people',
33
+ * label: 'People',
34
+ * children: [
35
+ * { id: 'employees', label: 'Employees', path: '/people/employees' },
36
+ * ],
37
+ * },
38
+ * ]}
39
+ * rightSide={<UserProfile {...profile} />}
40
+ * />
41
+ * ```
42
+ */
43
+ export declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,18 @@
1
+ import { UseDrawerStore } from '../Drawer/useDrawer';
2
+ import { HeaderNavItem, HeaderTheme } from './types';
3
+ import * as S from './styles';
4
+ interface HeaderMobileMenuProps {
5
+ store: UseDrawerStore;
6
+ items: HeaderNavItem[];
7
+ headerTheme: HeaderTheme;
8
+ palette: S.HeaderPalette;
9
+ pathname: string;
10
+ navLabel: string;
11
+ }
12
+ /**
13
+ * The navigation below 900px: a full-width drawer holding a `TreeView`, the
14
+ * same engine as CollapsibleNavBar's menu. The tree owns expansion and opens
15
+ * the group holding the current page; this module owns the routing.
16
+ */
17
+ export declare const HeaderMobileMenu: ({ store, items, headerTheme, palette, pathname, navLabel, }: HeaderMobileMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,17 @@
1
+ import { HeaderNavItem } from './types';
2
+ import * as S from './styles';
3
+ interface NavEntryProps {
4
+ item: HeaderNavItem;
5
+ /** 0 — the bar itself, 1 — dropdown, 2 — flyout */
6
+ depth: number;
7
+ palette: S.HeaderPalette;
8
+ pathname: string;
9
+ /** Closes every menu above this one once a link is followed */
10
+ onNavigate?: () => void;
11
+ }
12
+ /**
13
+ * Top-level entry. Each group roots its own floating tree, so a flyout's
14
+ * hover and dismiss events reach the dropdown that opened it.
15
+ */
16
+ export declare const HeaderNavEntry: (props: NavEntryProps) => import("@emotion/react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,13 @@
1
+ import { HeaderNavItem } from './types';
2
+ /** Submenus nest this deep at most: top level → dropdown → flyout. */
3
+ export declare const MAX_DEPTH = 2;
4
+ /**
5
+ * Same rule as react-router's `NavLink` without `end`: the path itself or
6
+ * anything below it, matched on whole segments — `/people` covers
7
+ * `/people/42` but not `/peoples`. `/` only matches itself, as with NavLink.
8
+ */
9
+ export declare const isPathActive: (pathname: string, path: string) => boolean;
10
+ /** Leaf: its own path. Group: any descendant up to `MAX_DEPTH`. */
11
+ export declare const isItemActive: (item: HeaderNavItem, pathname: string, depth?: number) => boolean;
12
+ export declare const hasSubmenu: (item: HeaderNavItem, depth: number) => boolean;
13
+ export declare const renderItemIcon: (icon: HeaderNavItem["icon"], size: number) => import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from './Header';
@@ -0,0 +1,63 @@
1
+ import { Theme } from '@emotion/react';
2
+ import { HeaderSize, HeaderTheme } from './types';
3
+ export declare const SIZES: Record<HeaderSize, {
4
+ height: number;
5
+ logo: number;
6
+ }>;
7
+ export declare const MENU_WIDTH = 164;
8
+ /** Design: dropdowns sit 6px below their trigger and flyouts 6px aside. */
9
+ export declare const MENU_OFFSET = 6;
10
+ export declare const resolvePalette: (theme: Theme, headerTheme: HeaderTheme) => {
11
+ background: string;
12
+ text: `rgb${string}` | undefined;
13
+ accent: `rgb${string}` | undefined;
14
+ disabled: `rgb${string}` | undefined;
15
+ menuBackground: `rgb${string}` | undefined;
16
+ menuItem: `rgb${string}` | undefined;
17
+ menuItemHover: `rgb${string}` | undefined;
18
+ menuItemOpen: `rgb${string}` | undefined;
19
+ menuText: `rgb${string}` | undefined;
20
+ menuDisabled: `rgb${string}` | undefined;
21
+ drawerBackground: `rgb${string}` | undefined;
22
+ } | {
23
+ background: `rgb${string}` | undefined;
24
+ text: `rgb${string}` | undefined;
25
+ accent: `rgb${string}` | "transparent";
26
+ disabled: `rgb${string}` | undefined;
27
+ menuBackground: `rgb${string}` | undefined;
28
+ menuItem: `rgb${string}` | undefined;
29
+ menuItemHover: `rgb${string}` | undefined;
30
+ menuItemOpen: `rgb${string}` | undefined;
31
+ menuText: `rgb${string}` | undefined;
32
+ menuDisabled: `rgb${string}` | undefined;
33
+ drawerBackground: `rgb${string}` | "transparent";
34
+ };
35
+ export type HeaderPalette = ReturnType<typeof resolvePalette>;
36
+ export declare const root: (theme: Theme, palette: HeaderPalette, size: HeaderSize) => import("@emotion/react").SerializedStyles;
37
+ export declare const burger: (theme: Theme, palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
38
+ /** Holds the burger's column when there is no menu, so the logo stays centred. */
39
+ export declare const burgerPlaceholder: (theme: Theme) => import("@emotion/react").SerializedStyles;
40
+ /**
41
+ * Fixed height from the size; width follows the logo so wordmarks fit, but
42
+ * never drops below a square, so an empty box still holds its place.
43
+ */
44
+ export declare const logo: (size: HeaderSize) => import("@emotion/react").SerializedStyles;
45
+ /**
46
+ * The scroll container. Dropdowns are portalled, so the overflow here does
47
+ * not clip them.
48
+ */
49
+ export declare const nav: (theme: Theme) => import("@emotion/react").SerializedStyles;
50
+ /** `margin: auto` centres the list while it fits and lets it scroll after. */
51
+ export declare const navList: import("@emotion/react").SerializedStyles;
52
+ export declare const rightSide: import("@emotion/react").SerializedStyles;
53
+ /**
54
+ * Selected keeps the regular weight: the design's bold resizes the item and
55
+ * shifts the whole bar as the route changes, so the state is marked by color
56
+ * alone.
57
+ */
58
+ export declare const navItem: (theme: Theme, palette: HeaderPalette, active: boolean) => import("@emotion/react").SerializedStyles;
59
+ export declare const menu: (theme: Theme, palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
60
+ export declare const menuItem: (theme: Theme, palette: HeaderPalette, active: boolean) => import("@emotion/react").SerializedStyles;
61
+ export declare const drawerContent: (palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
62
+ /** Chevron of a mobile group row; flips while the group is open. */
63
+ export declare const mobileToggle: (expanded: boolean) => import("@emotion/react").SerializedStyles;