@ssa-ui-kit/core 3.21.3 → 3.22.1

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.
Files changed (62) hide show
  1. package/dist/ai/source-map.md +2243 -0
  2. package/dist/components/ButtonGroup/ButtonGroup.d.ts +7 -3
  3. package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +15 -5
  4. package/dist/components/ButtonGroup/ButtonGroupButtonBase.d.ts +17 -1
  5. package/dist/components/ButtonGroup/styles.d.ts +22 -0
  6. package/dist/components/ButtonGroup/types.d.ts +45 -7
  7. package/dist/components/Card/Card.d.ts +60 -0
  8. package/dist/components/Card/types.d.ts +13 -0
  9. package/dist/components/CardContent/CardContent.d.ts +46 -0
  10. package/dist/components/CardHeader/CardHeader.d.ts +42 -0
  11. package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +35 -2
  12. package/dist/components/CollapsibleNavBar/components/NavHeader.d.ts +18 -0
  13. package/dist/components/CollapsibleNavBar/components/NavPopoverContent.d.ts +12 -0
  14. package/dist/components/CollapsibleNavBar/components/NavTree.d.ts +22 -0
  15. package/dist/components/CollapsibleNavBar/components/index.d.ts +3 -3
  16. package/dist/components/CollapsibleNavBar/navItems.d.ts +57 -0
  17. package/dist/components/CollapsibleNavBar/styles.d.ts +34 -0
  18. package/dist/components/CollapsibleNavBar/types.d.ts +40 -3
  19. package/dist/components/DatePicker/DatePicker.d.ts +57 -0
  20. package/dist/components/Drawer/DrawerRoot.d.ts +70 -0
  21. package/dist/components/DropdownOption/DropdownOption.d.ts +43 -0
  22. package/dist/components/Form/Form.d.ts +40 -0
  23. package/dist/components/Icon/Icon.d.ts +47 -0
  24. package/dist/components/Icon/icons/Columns.d.ts +3 -0
  25. package/dist/components/Icon/icons/List.d.ts +3 -0
  26. package/dist/components/Icon/icons/all.d.ts +2 -0
  27. package/dist/components/Icon/icons/iconsList.d.ts +1 -1
  28. package/dist/components/Icon/types.d.ts +13 -0
  29. package/dist/components/Input/Input.d.ts +94 -0
  30. package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +73 -0
  31. package/dist/components/NestedTable/WithNestedTableRow.d.ts +39 -0
  32. package/dist/components/NestedTable/components/NestedTable.d.ts +57 -0
  33. package/dist/components/NestedTable/components/NestedTableCell.d.ts +33 -0
  34. package/dist/components/NestedTable/components/NestedTableRow.d.ts +44 -0
  35. package/dist/components/NestedTable/types.d.ts +17 -0
  36. package/dist/components/TableRow/TableRow.d.ts +51 -0
  37. package/dist/components/Tooltip/Tooltip.d.ts +10 -6
  38. package/dist/components/Tooltip/types.d.ts +20 -7
  39. package/dist/components/TooltipContent/TooltipContent.d.ts +7 -3
  40. package/dist/components/TreeView/TreeView.d.ts +62 -0
  41. package/dist/components/TreeView/TreeViewItem.d.ts +32 -0
  42. package/dist/components/TreeView/index.d.ts +2 -0
  43. package/dist/components/TreeView/styles.d.ts +18 -0
  44. package/dist/components/TreeView/types.d.ts +162 -0
  45. package/dist/components/TreeView/useTreeViewState.d.ts +21 -0
  46. package/dist/components/TreeView/utils.d.ts +42 -0
  47. package/dist/components/Wrapper/Wrapper.d.ts +6 -6
  48. package/dist/components/index.d.ts +1 -0
  49. package/dist/index.js +2336 -679
  50. package/dist/index.mjs +2337 -681
  51. package/dist/tsbuildcache +1 -1
  52. package/package.json +4 -4
  53. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/AccordionContent.d.ts +0 -11
  54. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/AccordionContentItem.d.ts +0 -8
  55. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/CollapsibleNavBarItem.d.ts +0 -6
  56. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/ItemAccordionTitle.d.ts +0 -9
  57. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/ItemWithSubMenu.d.ts +0 -7
  58. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/index.d.ts +0 -5
  59. package/dist/components/CollapsibleNavBar/components/ItemWithSubmenu/styles.d.ts +0 -6
  60. package/dist/components/CollapsibleNavBar/components/ItemWithoutSubmenu/ItemWithoutSubMenu.d.ts +0 -5
  61. package/dist/components/CollapsibleNavBar/components/ItemWithoutSubmenu/index.d.ts +0 -1
  62. package/dist/components/CollapsibleNavBar/components/NavBarItem.d.ts +0 -8
@@ -3,9 +3,13 @@ import { ButtonGroupProps } from './types';
3
3
  * ButtonGroup - A row of mutually exclusive buttons.
4
4
  *
5
5
  * Two ways to declare the buttons:
6
- * - **Composed** — `ButtonGroupButton` children. Use when a button needs an
7
- * icon or custom markup.
8
- * - **Data-driven** — the `items` prop. Compact, but limited to plain labels.
6
+ * - **Composed** — `ButtonGroupButton` children. Use when a button needs
7
+ * custom markup.
8
+ * - **Data-driven** — the `items` prop. Compact, and enough for a label, an
9
+ * icon, or both.
10
+ *
11
+ * A button shows whatever it is given: `text` alone, `icon` alone (square, and
12
+ * labelled by `ariaLabel`), or the two together.
9
13
  *
10
14
  * Selection can be controlled (`value`) or left to the group (`defaultValue`).
11
15
  * Either accepts a bare `id` or a whole item.
@@ -3,8 +3,8 @@ import { ButtonGroupButtonProps } from './types';
3
3
  * ButtonGroupButton - One button inside a composed `ButtonGroup`.
4
4
  *
5
5
  * Reads selection state from the enclosing group, so it only needs an `id`.
6
- * Use this instead of the group's `items` prop when a button needs an icon,
7
- * custom markup, or anything else `ButtonGroupItem` cannot express.
6
+ * Use this instead of the group's `items` prop when a button needs custom
7
+ * markup or anything else `ButtonGroupItem` cannot express.
8
8
  *
9
9
  * @category Form Controls
10
10
  * @subcategory Action
@@ -13,10 +13,20 @@ import { ButtonGroupButtonProps } from './types';
13
13
  * ```tsx
14
14
  * <ButtonGroup value={period} onClick={({ id }) => setPeriod(id)}>
15
15
  * <ButtonGroupButton id="24h">24h</ButtonGroupButton>
16
- * <ButtonGroupButton id="7d">
17
- * <Icon name="calendar" size={14} /> 7 days
16
+ * <ButtonGroupButton id="7d" icon={<Icon name="calendar" size={24} />}>
17
+ * 7 days
18
18
  * </ButtonGroupButton>
19
19
  * </ButtonGroup>
20
20
  * ```
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * // Icon-only. `aria-label` is the button's only accessible name.
25
+ * <ButtonGroupButton
26
+ * id="list"
27
+ * icon={<Icon name="bulleted-list" size={24} />}
28
+ * aria-label="List view"
29
+ * />
30
+ * ```
21
31
  */
22
- export declare const ButtonGroupButton: ({ id, children, text, disabled, onClick, className, }: ButtonGroupButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
32
+ export declare const ButtonGroupButton: ({ id, children, icon, text, "aria-label": ariaLabel, disabled, onClick, className, }: ButtonGroupButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -7,7 +7,18 @@ interface ButtonGroupButtonBaseProps {
7
7
  buttonStyles?: SerializedStyles;
8
8
  className?: string;
9
9
  children?: ReactNode;
10
+ icon?: ReactNode;
11
+ ariaLabel?: string;
10
12
  }
13
+ /**
14
+ * Whether this button shows a label at all. `false` and `null` are what a
15
+ * `cond && <span/>` child collapses to, and an empty string is what the `items`
16
+ * path passes for an item with no `text` — none of them are a label.
17
+ *
18
+ * Exported so the `items` path decides what counts as a label the same way this
19
+ * one does: a button that renders as icon-only must also report itself as one.
20
+ */
21
+ export declare const hasLabel: (children: ReactNode) => boolean;
11
22
  /**
12
23
  * The button markup shared by both of `ButtonGroup`'s APIs.
13
24
  *
@@ -17,7 +28,12 @@ interface ButtonGroupButtonBaseProps {
17
28
  * variant, the `active` class the styles key off, `aria-pressed` — lives here
18
29
  * once.
19
30
  *
31
+ * The three content modes are derived here, from which props are set rather
32
+ * than by inspecting what `children` renders to: an opaque `ReactNode` cannot
33
+ * be told apart from a label, so a component that happens to render an icon
34
+ * would otherwise silently change the button's shape.
35
+ *
20
36
  * Internal: not exported from the package.
21
37
  */
22
- export declare const ButtonGroupButtonBase: ({ isActive, disabled, onClick, buttonStyles, className, children, }: ButtonGroupButtonBaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
38
+ export declare const ButtonGroupButtonBase: ({ isActive, disabled, onClick, buttonStyles, className, children, icon, ariaLabel, }: ButtonGroupButtonBaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
23
39
  export {};
@@ -1,2 +1,24 @@
1
1
  import { Theme } from '@emotion/react';
2
+ /**
3
+ * Figma: PeopleOps → Competency Wizard (node 11999:36608 / 11999:36625).
4
+ *
5
+ * The group is one flat 40px-tall strip: 8px radius on the outer corners only,
6
+ * 1px seams between buttons, and two greys — `secondary.light` at rest,
7
+ * `secondary.main` for the selected button. Hover/focus go one step darker
8
+ * (`secondary.dark`) in both states; the design has no hover spec, so this
9
+ * keeps the variant's own behaviour rather than inventing a colour.
10
+ *
11
+ * Selection is marked by colour alone. The Figma layers also carry a larger,
12
+ * heavier face on the selected label (14px/600 against 13.33px/500), but
13
+ * applying it resizes the button as the selection moves, so the strip visibly
14
+ * jumps — and at this size the states read as a colour difference anyway.
15
+ */
2
16
  export declare const ButtonItem: (theme: Theme) => import("@emotion/react").SerializedStyles;
17
+ /**
18
+ * Icon-only: the label padding collapses to the symmetric 8px of the design,
19
+ * leaving `min-width` above to square the box off.
20
+ */
21
+ export declare const IconOnlyItem: import("@emotion/react").SerializedStyles;
22
+ export declare const IconSlot: import("@emotion/react").SerializedStyles;
23
+ /** 6px, matching `Button`'s own icon slots. */
24
+ export declare const IconSlotWithLabel: import("@emotion/react").SerializedStyles;
@@ -2,7 +2,18 @@ import { ReactNode } from 'react';
2
2
  import { SerializedStyles } from '@emotion/react';
3
3
  export type ButtonGroupItem = {
4
4
  id: string | number;
5
+ /** Visible label. */
5
6
  text: string;
7
+ /**
8
+ * Leading icon, rendered before the label. An item with an `icon` and no
9
+ * `text` is an icon-only button: square, and labelled by `ariaLabel`.
10
+ */
11
+ icon?: ReactNode;
12
+ /**
13
+ * Accessible name. Only needed for an icon-only item, which has no text for
14
+ * a screen reader to announce.
15
+ */
16
+ ariaLabel?: string;
6
17
  /** Renders this item's button as disabled. */
7
18
  disabled?: boolean;
8
19
  /**
@@ -10,17 +21,29 @@ export type ButtonGroupItem = {
10
21
  */
11
22
  isDisabled?: boolean;
12
23
  };
24
+ /**
25
+ * What the `items` prop accepts: a `ButtonGroupItem` whose `text` may be
26
+ * omitted — but only meaningfully so when `icon` is set, which is what makes
27
+ * the button icon-only.
28
+ *
29
+ * `onClick` still reports a full `ButtonGroupItem`, so handlers never have to
30
+ * narrow: an item without `text` comes back with its `ariaLabel` in that slot
31
+ * (or `''`), and every other field is passed through untouched.
32
+ */
33
+ export type ButtonGroupItemInput = Omit<ButtonGroupItem, 'text'> & {
34
+ text?: string;
35
+ };
13
36
  /**
14
37
  * A selection, expressed either as the item itself or — usually more
15
38
  * convenient — as just its `id`. The group only ever compares ids, so the two
16
39
  * forms are equivalent.
17
40
  */
18
- export type ButtonGroupValue = ButtonGroupItem | ButtonGroupItem['id'];
41
+ export type ButtonGroupValue = ButtonGroupItemInput | ButtonGroupItem['id'];
19
42
  export interface ButtonGroupProps {
20
43
  /**
21
44
  * Buttons to render, as `ButtonGroupButton` children. When provided, `items`
22
- * is ignored — use this when a button needs an icon, custom markup, or
23
- * anything else `ButtonGroupItem` cannot express.
45
+ * is ignored — use this when a button needs custom markup or anything else
46
+ * `ButtonGroupItem` cannot express.
24
47
  *
25
48
  * Note that an uncontrolled group in children mode starts with **nothing**
26
49
  * selected; pass `defaultValue` to preselect. (The `items` API preselects the
@@ -30,7 +53,7 @@ export interface ButtonGroupProps {
30
53
  /**
31
54
  * Buttons to render, as data. Ignored when `children` are provided.
32
55
  */
33
- items?: Array<ButtonGroupItem>;
56
+ items?: Array<ButtonGroupItemInput>;
34
57
  /**
35
58
  * Active selection, for the controlled pattern. When provided, the parent
36
59
  * owns the selection and the group only reports intent through `onClick`.
@@ -68,8 +91,8 @@ export interface ButtonGroupProps {
68
91
  * In children mode the group cannot see an item list, so it reports
69
92
  * `{ id, text, disabled }` assembled from the clicked `ButtonGroupButton`'s
70
93
  * props — `id` is always accurate, `text` is only populated when the button's
71
- * content is a plain string or its `text` prop is set. Prefer reading `id`,
72
- * or give each button its own `onClick`.
94
+ * content is a plain string, or its `text` / `aria-label` prop is set. Prefer
95
+ * reading `id`, or give each button its own `onClick`.
73
96
  */
74
97
  onClick?: (item: ButtonGroupItem) => void;
75
98
  buttonStyles?: SerializedStyles;
@@ -77,13 +100,28 @@ export interface ButtonGroupProps {
77
100
  export interface ButtonGroupButtonProps {
78
101
  /** Identifies this button within the group; matched against `value`. */
79
102
  id: ButtonGroupItem['id'];
80
- /** Button content — text, an icon, or any markup. */
103
+ /** Button content — text or any markup. Omit it for an icon-only button. */
81
104
  children?: ReactNode;
105
+ /**
106
+ * Leading icon, rendered before `children`. On its own — no children — it
107
+ * makes the button icon-only: square, and labelled by `aria-label`.
108
+ *
109
+ * Prefer this over passing an icon inside `children`, which the group cannot
110
+ * tell apart from a label and so lays out as text.
111
+ */
112
+ icon?: ReactNode;
82
113
  /**
83
114
  * Plain-text label for this button, used when the group reports the clicked
84
115
  * item through its `onClick`. Only needed when `children` is not a string.
116
+ * Not rendered — pass visible text as `children`.
85
117
  */
86
118
  text?: string;
119
+ /**
120
+ * Accessible name. Required for an icon-only button, which has no text for a
121
+ * screen reader to announce; also used as the `onClick` label when `text`
122
+ * and a string child are both absent.
123
+ */
124
+ 'aria-label'?: string;
87
125
  /** Renders this button as disabled. */
88
126
  disabled?: boolean;
89
127
  /**
@@ -1,3 +1,63 @@
1
1
  import { CardProps } from './types';
2
+ /**
3
+ * Card - Elevated surface that groups related content.
4
+ *
5
+ * ### Composition
6
+ * `Card` provides the surface, 20px padding and a white rounded background, and
7
+ * stacks its children in a centred column. It renders no title of its own —
8
+ * build the inside from the sibling components:
9
+ *
10
+ * ```
11
+ * Card
12
+ * ├── CardHeader — title row, optional overhanging icon
13
+ * └── CardContent — padded body, row or column
14
+ * ```
15
+ *
16
+ * All three are separate top-level exports rather than `Card.Header`-style
17
+ * statics, so import each one you use. Both are optional — a `Card` wrapping
18
+ * plain children is valid.
19
+ *
20
+ * ### `onClick` changes the rendered element
21
+ * Without `onClick` a `Card` is a `div`. **With `onClick` it renders a
22
+ * `button`**, so it becomes focusable and Enter/Space activate it. That is the
23
+ * accessible behaviour for a clickable card, but it also means button UA styles
24
+ * apply and the card can no longer legally contain another button or link.
25
+ * If you need interactive controls inside the card, leave `onClick` off and put
26
+ * the handler on a control within it.
27
+ *
28
+ * ### Elevation
29
+ * Cards carry a shadow by default; `noShadow` flattens it. There is no numeric
30
+ * elevation scale and no outlined variant — for a bordered look, apply a border
31
+ * through `css`.
32
+ *
33
+ * @category Components
34
+ * @subcategory Layout
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <Card>
39
+ * <CardHeader>Team capacity</CardHeader>
40
+ * <CardContent>
41
+ * <Typography variant="body1">14 of 20 seats filled</Typography>
42
+ * </CardContent>
43
+ * </Card>
44
+ * ```
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * // Activatable card — renders as a <button>, so no controls inside
49
+ * <Card onClick={() => navigate(`/people/${id}`)}>
50
+ * <CardContent>{fullName}</CardContent>
51
+ * </Card>
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * // Flat card sitting inside an already-elevated panel
57
+ * <Card noShadow css={{ width: '100%' }}>
58
+ * <CardContent direction="column">{fields}</CardContent>
59
+ * </Card>
60
+ * ```
61
+ */
2
62
  declare const Card: ({ children, onClick, ...props }: CardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
63
  export default Card;
@@ -1,7 +1,20 @@
1
1
  import { CommonProps } from '../../types/emotion';
2
2
  export interface CardProps extends CommonProps {
3
+ /**
4
+ * Drops the drop shadow, leaving a flat surface. Cards are elevated by
5
+ * default — there is no numeric elevation scale.
6
+ */
3
7
  noShadow?: boolean;
8
+ /**
9
+ * Card body. Usually `CardHeader` followed by `CardContent`, but any content
10
+ * is accepted.
11
+ */
4
12
  children: React.ReactNode;
5
13
  className?: string;
14
+ /**
15
+ * Makes the whole card activatable. Passing this **changes the rendered
16
+ * element from `div` to `button`**, which brings focus and keyboard
17
+ * activation with it — see the note on the component.
18
+ */
6
19
  onClick?: () => void;
7
20
  }
@@ -1,7 +1,12 @@
1
1
  import { CommonProps } from '../../types/emotion';
2
2
  export interface CardProps extends CommonProps {
3
+ /** Body content of the card. */
3
4
  children: React.ReactNode;
4
5
  style?: React.CSSProperties;
6
+ /**
7
+ * `flex-direction` for the body. Defaults to a row, so vertically stacked
8
+ * content needs `"column"`.
9
+ */
5
10
  direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
6
11
  className?: string;
7
12
  /** Id of the element labelling this content region. */
@@ -15,5 +20,46 @@ export interface CardProps extends CommonProps {
15
20
  ariaLabelledby?: string;
16
21
  role?: string;
17
22
  }
23
+ /**
24
+ * CardContent - Padded body region of a `Card`.
25
+ *
26
+ * Place it inside a `Card`, after `CardHeader` when there is one. The padding
27
+ * comes from the `Card` itself; what `CardContent` adds is the layout.
28
+ *
29
+ * ### It spreads its children apart
30
+ * The body is a flex container with `justify-content: space-between`, so two
31
+ * children sit at opposite ends rather than next to each other — handy for a
32
+ * label/value row, surprising if you expected them adjacent. `direction` maps
33
+ * to `flex-direction` and defaults to `row`, so stacked content needs
34
+ * `direction="column"` (which also switches `align-items` from `center` to
35
+ * `normal`, letting children stretch to full width).
36
+ *
37
+ * ### Labelling
38
+ * When you give the region a `role`, name it with `aria-labelledby` pointing at
39
+ * the id of the heading in `CardHeader`. (`ariaLabelledby` is the deprecated
40
+ * spelling and is removed next major.)
41
+ *
42
+ * @category Components
43
+ * @subcategory Layout
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <Card>
48
+ * <CardHeader>Recent activity</CardHeader>
49
+ * <CardContent direction="column">{rows}</CardContent>
50
+ * </Card>
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * // Named region, labelled by the header's heading
56
+ * <Card>
57
+ * <CardHeader><h3 id="capacity-title">Capacity</h3></CardHeader>
58
+ * <CardContent role="region" aria-labelledby="capacity-title">
59
+ * {chart}
60
+ * </CardContent>
61
+ * </Card>
62
+ * ```
63
+ */
18
64
  declare const CardContent: ({ children, "aria-labelledby": ariaLabelledbyNative, ariaLabelledby, ...props }: CardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
19
65
  export default CardContent;
@@ -1,8 +1,50 @@
1
1
  import { CommonProps } from '../../types/emotion';
2
2
  export interface CardProps extends CommonProps {
3
+ /** Header content — normally the card title. */
3
4
  children: React.ReactNode;
5
+ /**
6
+ * Badge rendered overhanging the header's top-left corner, outside the card
7
+ * bounds. For an icon inline with the title, put it in `children` instead.
8
+ */
4
9
  icon?: React.ReactNode;
10
+ /** Removes the header's background fill. */
5
11
  transparent?: boolean;
6
12
  }
13
+ /**
14
+ * CardHeader - Title row for a `Card`.
15
+ *
16
+ * Place it as the first child of a `Card`, above `CardContent`.
17
+ *
18
+ * ### The `icon` slot overhangs the card
19
+ * `icon` is positioned outside the header's top-left corner, so it deliberately
20
+ * bleeds past the card edge as a badge. It is not an inline leading icon — for
21
+ * that, put an `Icon` in `children` alongside the title text. Because it
22
+ * overhangs, a `Card` with `overflow: hidden` will clip it.
23
+ *
24
+ * @category Components
25
+ * @subcategory Layout
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <Card>
30
+ * <CardHeader>Upcoming events</CardHeader>
31
+ * <CardContent>{list}</CardContent>
32
+ * </Card>
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * // Overhanging badge; the parent Card must not clip its overflow
38
+ * <CardHeader icon={<Icon name="calendar" size={24} />}>This week</CardHeader>
39
+ * ```
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * // Inline icon next to the title — plain children, not the icon slot
44
+ * <CardHeader>
45
+ * <Icon name="information" size={16} /> Payroll notes
46
+ * </CardHeader>
47
+ * ```
48
+ */
7
49
  declare const CardHeader: ({ children, icon, transparent, ...props }: CardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
50
  export default CardHeader;
@@ -1,5 +1,38 @@
1
1
  import { CollapsibleNavBarExtendedProps } from './types';
2
2
  /**
3
- * UI Component that shows the collapsible navigation bar
3
+ * CollapsibleNavBar — the app sidebar: a logo, a menu, and three layouts.
4
+ *
5
+ * Below `md` it is a full-screen overlay behind a hamburger; from `md` it is
6
+ * an 85px rail of icons whose sub-routes open as popover flyouts; from `lg` it
7
+ * expands to full rows. Which layout is showing is CSS, driven by a hidden
8
+ * checkbox, so the DOM is the same in all three.
9
+ *
10
+ * The menu itself is a {@link TreeView} in `list` semantics — this component
11
+ * supplies the routing: resolving each item's `to`, deriving the active row
12
+ * from the current location, and closing the mobile overlay on navigation.
13
+ * Items are one or two levels; a group is an item with `items`.
14
+ *
15
+ * Must be rendered inside a react-router router.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <CollapsibleNavBar
20
+ * renderLogo={<Logo />}
21
+ * items={[
22
+ * { path: '', iconName: 'home', iconSize: 20, title: 'Dashboard' },
23
+ * {
24
+ * prefix: 'statistics/',
25
+ * iconName: 'chart',
26
+ * iconSize: 22,
27
+ * title: 'Statistics',
28
+ * items: [
29
+ * { path: 'balance', title: 'Balance' },
30
+ * { path: 'orders', title: 'Orders' },
31
+ * ],
32
+ * },
33
+ * ]}
34
+ * onChange={(isExpanded) => console.log(isExpanded)}
35
+ * />
36
+ * ```
4
37
  */
5
- export declare const CollapsibleNavBar: ({ items, renderLogo, theme, subMenuMaxWidth, showIconTooltip, className, useMatchPattern, onChange, exactMatch, defaultExpanded, }: CollapsibleNavBarExtendedProps) => import("@emotion/react/jsx-runtime").JSX.Element;
38
+ export declare const CollapsibleNavBar: ({ items, renderLogo, header, theme, activeColor, subMenuMaxWidth, showIconTooltip, className, useMatchPattern, onChange, exactMatch, defaultExpanded, }: CollapsibleNavBarExtendedProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { CollapsibleNavBarHeader } from '../types';
2
+ /**
3
+ * The panel's header: a headline, and optionally a picture and a person.
4
+ *
5
+ * Covers the three variants in the design — headline only, headline with a
6
+ * large picture above the name, and headline with a small avatar inline
7
+ * beside it — from one shape, by leaving out whichever parts aren't given.
8
+ * The whole block is hidden in the collapsed rail, where there is no room
9
+ * for it.
10
+ */
11
+ /**
12
+ * Whether a header has anything to show. Shared with `CollapsibleNavBar`,
13
+ * which drops the logo's top margin off the menu only when the header is
14
+ * actually rendered — `header={{}}`, or one whose fields are all conditionally
15
+ * undefined, must leave the spacing alone.
16
+ */
17
+ export declare const hasHeaderContent: (header?: CollapsibleNavBarHeader) => boolean;
18
+ export declare const NavHeader: ({ title, name, avatar, image, }: CollapsibleNavBarHeader) => import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import type { TreeItemLevel2 } from '../../TreeView';
2
+ import { NavItemMeta } from '../navItems';
3
+ /**
4
+ * A group's children, as shown in the collapsed rail's flyout.
5
+ *
6
+ * The rail hides the in-place subtree, so this is the only way to reach a
7
+ * sub-route while the nav is collapsed.
8
+ */
9
+ export declare const NavPopoverContent: ({ items, onClick, }: {
10
+ items: TreeItemLevel2<NavItemMeta>[];
11
+ onClick?: () => void;
12
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { NavTreeItem } from '../navItems';
2
+ import { CollapsibleNavBarExtendedProps } from '../types';
3
+ /**
4
+ * The nav's menu, rendered by `TreeView`.
5
+ *
6
+ * `TreeView` owns structure, indentation, expansion and the `li`s; this module
7
+ * owns everything routing-shaped — resolving `to`, deriving the active rows
8
+ * from the location, and the collapsed-rail popover.
9
+ */
10
+ export declare const NavTree: ({ items, activeColor, useMatchPattern, onNavigate, expandedIds, onExpandedIdsChange, }: {
11
+ items: NavTreeItem[];
12
+ activeColor?: string;
13
+ useMatchPattern?: CollapsibleNavBarExtendedProps["useMatchPattern"];
14
+ onNavigate: () => void;
15
+ /**
16
+ * Expansion is controlled from the nav bar, which owns it across layout
17
+ * changes; the auto-expand that `TreeView` does for an uncontrolled tree is
18
+ * reproduced below.
19
+ */
20
+ expandedIds: string[];
21
+ onExpandedIdsChange: (ids: string[]) => void;
22
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,5 +1,3 @@
1
- export * as ItemWithSubMenu from './ItemWithSubmenu';
2
- export * as ItemWithoutSubmenu from './ItemWithoutSubmenu';
3
1
  export * from './CollapsibleNavBarBase';
4
2
  export * from './CollapsibleNavBarLink';
5
3
  export * from './CollapsibleNavBarList';
@@ -7,6 +5,8 @@ export * from './CollapsibleNavBarWrapper';
7
5
  export * from './CollapsibleNavContentToggle';
8
6
  export * from './CollapsibleNavToggle';
9
7
  export * from './CollapsibleNavToggleWrapper';
10
- export * from './NavBarItem';
8
+ export * from './NavHeader';
9
+ export * from './NavTree';
10
+ export * from './NavPopoverContent';
11
11
  export * from './NavBarPopover';
12
12
  export * from './TriggerIcon';
@@ -0,0 +1,57 @@
1
+ import { CSSObject } from '@emotion/react';
2
+ import { PathPattern } from 'react-router-dom';
3
+ import { CustomIconProps } from '../NavBar/types';
4
+ import { TreeItem } from '../TreeView';
5
+ import { CollapsibleNavBarExtendedProps, CollapsibleNavBarItem } from './types';
6
+ /**
7
+ * What a nav row needs beyond a label — carried on each `TreeView` node so the
8
+ * tree itself stays free of routing concepts.
9
+ */
10
+ export interface NavItemMeta {
11
+ /** Resolved `to` for the row's link. Absent on groups, which don't navigate. */
12
+ to?: string;
13
+ /**
14
+ * Taken from the nav item's own type rather than restated as
15
+ * `keyof MapIconsType`. `CollapsibleNavBarItem` reaches that union through
16
+ * the package index, where it has already widened to `string`; restating it
17
+ * here would put the two sides of the mapping in disagreement.
18
+ */
19
+ iconName?: CollapsibleNavBarItem['iconName'];
20
+ iconSize?: number;
21
+ css?: CSSObject;
22
+ CustomIcon?: CustomIconProps;
23
+ /** Group prefix, used to build sub-item paths and to match the active route. */
24
+ prefix?: string;
25
+ /** A group's children, kept flat for the collapsed-rail popover. */
26
+ subItems?: Array<{
27
+ path: string;
28
+ title: string;
29
+ }>;
30
+ }
31
+ export type NavTreeItem = TreeItem<NavItemMeta>;
32
+ /** External links pass through untouched; everything else is app-absolute. */
33
+ export declare const resolveTo: (path: string) => string;
34
+ /**
35
+ * Turns the nav bar's flat `items` prop into `TreeView` nodes.
36
+ *
37
+ * Ids are the resolved paths (prefix for a group), which makes them stable
38
+ * across renders and directly comparable with the current location.
39
+ */
40
+ export declare const toTreeItems: (items: CollapsibleNavBarExtendedProps["items"]) => NavTreeItem[];
41
+ /**
42
+ * Ids of the nodes the current location activates — the row itself plus, for a
43
+ * sub-route, its group.
44
+ *
45
+ * This replaces the old approach of reading the `active` class back off the
46
+ * rendered `NavLink`, which needed an effect per row and a render to settle.
47
+ *
48
+ * `groupPatterns` is supplied by the caller because `useMatchPattern` may be a
49
+ * hook: it has to be called from the component, once per group, in a stable
50
+ * order.
51
+ */
52
+ export declare const getActiveIds: ({ items, pathname, exactMatch, groupPatterns, }: {
53
+ items: NavTreeItem[];
54
+ pathname: string;
55
+ exactMatch: boolean;
56
+ groupPatterns: Record<string, string | PathPattern<string>>;
57
+ }) => string[];
@@ -2,3 +2,37 @@ import { Theme } from '@emotion/react';
2
2
  import { CollapsibleNavBarExtendedProps } from './types';
3
3
  export declare const LogoWrapper: (theme: Theme) => import("@emotion/react").SerializedStyles;
4
4
  export declare const ContentToggle: (navBarTheme: CollapsibleNavBarExtendedProps["theme"], isChecked: boolean) => (theme: Theme) => import("@emotion/react").SerializedStyles;
5
+ /**
6
+ * The nav's own layer on top of `TreeView`.
7
+ *
8
+ * Everything here hangs off `TreeView`'s stable class names rather than the
9
+ * DOM's shape. The old rules were positional (`& > div > div > div >
10
+ * div:nth-of-type(2)`) and carried two `TODO: refactor this` markers; they
11
+ * broke whenever a wrapper moved.
12
+ *
13
+ * Three layouts share these rows:
14
+ *
15
+ * - **mobile** (below `md`) — the nav is a full-screen overlay: icon, label,
16
+ * chevron and the in-place subtree are all visible, the rail popover is not.
17
+ * - **rail** (`md` and up, closed) — 85px of icons. Only the popover trigger
18
+ * shows; it carries the icon and reveals the subtree as a flyout.
19
+ * - **expanded** (`lg` and up, `.opened`) — back to the full rows.
20
+ */
21
+ export declare const NavTreeStyles: (theme: Theme) => import("@emotion/react").SerializedStyles;
22
+ export declare const NavToggle: (isExpanded: boolean) => import("@emotion/react").SerializedStyles;
23
+ /** The rail flyout's list of sub-routes. */
24
+ export declare const PopoverList: (theme: Theme) => import("@emotion/react").SerializedStyles;
25
+ /** Holds the icon column open on rows that have no icon of their own. */
26
+ export declare const IconSpacer: import("@emotion/react").SerializedStyles;
27
+ /**
28
+ * Header block — headline, optional picture, optional person.
29
+ *
30
+ * Measurements come from the design's Type5 variant: an 8px stack inside the
31
+ * 216px content column — headline at Title 2 Bold (20/28), the name a size up
32
+ * at 24/24 on a 30px row, the picture square with a 12px radius.
33
+ */
34
+ export declare const Header: (theme: Theme) => import("@emotion/react").SerializedStyles;
35
+ export declare const HeaderTitle: (theme: Theme) => import("@emotion/react").SerializedStyles;
36
+ export declare const HeaderPerson: import("@emotion/react").SerializedStyles;
37
+ export declare const HeaderImage: import("@emotion/react").SerializedStyles;
38
+ export declare const HeaderName: (theme: Theme) => import("@emotion/react").SerializedStyles;