@gooddata/sdk-ui-kit 11.61.0 → 11.62.0-alpha.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 (41) hide show
  1. package/esm/@ui/@types/icon.d.ts +1 -1
  2. package/esm/@ui/@types/icon.d.ts.map +1 -1
  3. package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
  4. package/esm/@ui/UiIcon/icons.js +3 -0
  5. package/esm/@ui/UiModalDialog/UiModalDialog.js +2 -2
  6. package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.d.ts +46 -0
  7. package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.d.ts.map +1 -0
  8. package/esm/@ui/UiResizableSidebar/UiResizableSidebarNavigation.js +212 -0
  9. package/esm/@ui/UiResizableSidebar/types.d.ts +61 -0
  10. package/esm/@ui/UiResizableSidebar/types.d.ts.map +1 -1
  11. package/esm/@ui/UiToolbarInput/UiToolbarInput.d.ts +71 -0
  12. package/esm/@ui/UiToolbarInput/UiToolbarInput.d.ts.map +1 -0
  13. package/esm/@ui/UiToolbarInput/UiToolbarInput.js +78 -0
  14. package/esm/@ui/UiToolbarPagination/UiToolbarPagination.d.ts +58 -0
  15. package/esm/@ui/UiToolbarPagination/UiToolbarPagination.d.ts.map +1 -0
  16. package/esm/@ui/UiToolbarPagination/UiToolbarPagination.js +56 -0
  17. package/esm/@ui/UiToolbarStepper/UiToolbarStepper.d.ts +7 -11
  18. package/esm/@ui/UiToolbarStepper/UiToolbarStepper.d.ts.map +1 -1
  19. package/esm/@ui/UiToolbarStepper/UiToolbarStepper.js +6 -10
  20. package/esm/Overlay/Overlay.d.ts.map +1 -1
  21. package/esm/Overlay/Overlay.js +2 -2
  22. package/esm/Overlay/OverlayContext.d.ts +15 -0
  23. package/esm/Overlay/OverlayContext.d.ts.map +1 -1
  24. package/esm/Overlay/OverlayContext.js +18 -1
  25. package/esm/index.d.ts +5 -2
  26. package/esm/index.d.ts.map +1 -1
  27. package/esm/index.js +4 -1
  28. package/esm/sdk-ui-kit.d.ts +263 -12
  29. package/package.json +11 -11
  30. package/src/@ui/UiButtonSegmentedControl/UiButtonSegmentedControl.scss +13 -1
  31. package/src/@ui/UiIconButton/UiIconButton.scss +8 -1
  32. package/src/@ui/UiResizableSidebar/UiResizableSidebarNavigation.scss +178 -0
  33. package/src/@ui/UiToolbar/UiToolbar.scss +1 -1
  34. package/src/@ui/UiToolbar/toolbarItem.scss +9 -1
  35. package/src/@ui/UiToolbarInput/UiToolbarInput.scss +82 -0
  36. package/src/@ui/UiToolbarPagination/UiToolbarPagination.scss +63 -0
  37. package/src/@ui/UiToolbarStepper/UiToolbarStepper.scss +25 -10
  38. package/src/@ui/defaultTheme.scss +4 -1
  39. package/src/@ui/index.scss +3 -0
  40. package/styles/css/main.css +295 -18
  41. package/styles/css/main.css.map +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @internal
3
3
  */
4
- export type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "levelUp" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "alignLeft" | "alignCenter" | "alignRight" | "alignTop" | "alignMiddle" | "alignBottom" | "bold" | "italic" | "imageContain" | "imageCover" | "imageFill" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart" | "timezone" | "sidePanelCollapse" | "sidePanel" | "sidePanelExpand" | "lineStyle" | "lineStyleSolid" | "lineStyleDashed" | "lineStyleDotted" | "lineWidth1" | "lineWidth2" | "lineWidth3" | "lineWidth4";
4
+ export type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "levelUp" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "alignLeft" | "alignCenter" | "alignRight" | "alignTop" | "alignMiddle" | "alignBottom" | "bold" | "italic" | "imageContain" | "imageCover" | "imageFill" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart" | "timezone" | "sidePanelCollapse" | "sidePanel" | "sidePanelExpand" | "lineStyle" | "lineStyleSolid" | "lineStyleDashed" | "lineStyleDotted" | "lineWidth1" | "lineWidth2" | "lineWidth3" | "lineWidth4" | "linear" | "spline" | "stepped";
5
5
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/@ui/@types/icon.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GACd,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,eAAe,GACf,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,OAAO,GACP,MAAM,GACN,aAAa,GACb,UAAU,GACV,WAAW,GACX,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,YAAY,GACZ,cAAc,GACd,eAAe,GACf,cAAc,GACd,UAAU,GACV,OAAO,GACP,QAAQ,GACR,mBAAmB,GACnB,YAAY,GACZ,MAAM,GACN,SAAS,GACT,WAAW,GACX,MAAM,GACN,QAAQ,GACR,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,GACX,OAAO,GACP,aAAa,GACb,cAAc,GACd,QAAQ,GACR,iBAAiB,GACjB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,KAAK,GACL,aAAa,GACb,QAAQ,GACR,OAAO,GACP,MAAM,GACN,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,eAAe,GACf,qBAAqB,GACrB,UAAU,GACV,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa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ACZ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,CAAC"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/@ui/@types/icon.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GACd,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,eAAe,GACf,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,OAAO,GACP,MAAM,GACN,aAAa,GACb,UAAU,GACV,WAAW,GACX,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,YAAY,GACZ,cAAc,GACd,eAAe,GACf,cAAc,GACd,UAAU,GACV,OAAO,GACP,QAAQ,GACR,mBAAmB,GACnB,YAAY,GACZ,MAAM,GACN,SAAS,GACT,WAAW,GACX,MAAM,GACN,QAAQ,GACR,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,GACX,OAAO,GACP,aAAa,GACb,cAAc,GACd,QAAQ,GACR,iBAAiB,GACjB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,KAAK,GACL,aAAa,GACb,QAAQ,GACR,OAAO,GACP,MAAM,GACN,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,eAAe,GACf,qBAAqB,GACrB,UAAU,GACV,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,OAAO,GACP,SAAS,GACT,YAAY,GACZ,WAAW,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P,cAAc,GACd,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiIcon/icons.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,CAwoCjD,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiIcon/icons.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,CAipCjD,CAAC"}
@@ -204,4 +204,7 @@ export const iconPaths = {
204
204
  lineWidth2: _jsx("rect", { x: "0", y: "8.5714", width: "20", height: "2.8571" }),
205
205
  lineWidth3: _jsx("rect", { x: "0", y: "7.8571", width: "20", height: "4.2857" }),
206
206
  lineWidth4: _jsx("rect", { x: "0", y: "7.1429", width: "20", height: "5.7143" }),
207
+ linear: (_jsx("path", { d: "M17.7578 7.03029C18.2935 6.89649 18.8358 7.22211 18.9697 7.75783C19.1035 8.29355 18.7779 8.83581 18.2422 8.96974L2.2422 12.9697C1.70648 13.1035 1.16422 12.7779 1.03029 12.2422C0.896491 11.7065 1.22211 11.1642 1.75783 11.0303L17.7578 7.03029Z" })),
208
+ spline: (_jsx("path", { d: "M13.2804 6.44281C14.9219 5.76102 16.7805 5.85276 19.0001 7.13421C19.4783 7.41038 19.6424 8.02217 19.3663 8.50042C19.0901 8.97853 18.4783 9.14175 18.0001 8.86566C16.2198 7.83784 15.0158 7.8885 14.0479 8.29046C12.9649 8.74029 12.0332 9.67558 10.8956 10.8149C9.82993 11.8821 8.57092 13.1393 6.96396 13.7338C5.26024 14.364 3.3241 14.2074 1.00009 12.8657C0.522054 12.5896 0.358094 11.9786 0.633881 11.5004C0.910021 11.0221 1.5218 10.8581 2.00009 11.1342C3.92588 12.246 5.24004 12.2391 6.2706 11.8578C7.39781 11.4407 8.35795 10.5251 9.47958 9.40179C10.5294 8.35041 11.7541 7.07675 13.2804 6.44281Z" })),
209
+ stepped: (_jsx("path", { d: "M18.5 6C19.0523 6 19.5 6.44772 19.5 7C19.5 7.55228 19.0523 8 18.5 8H13.3125V11H7.875V14H1.5C0.947716 14 0.500001 13.5523 0.5 13C0.5 12.4477 0.947715 12 1.5 12H5.875V9H11.3125V6H18.5Z" })),
207
210
  };
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { createContext, useCallback, useContext, useId, useMemo, useRef, useState, } from "react";
4
4
  import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useDismiss, useFloating, useInteractions, } from "@floating-ui/react";
5
5
  import { ConditionalScopedThemeProvider } from "@gooddata/sdk-ui-theme-provider";
6
- import { useOverlayZIndexWithRegister } from "../../Overlay/OverlayContext.js";
6
+ import { OverlayZIndexContext, useOverlayZIndexWithRegister } from "../../Overlay/OverlayContext.js";
7
7
  import { bem } from "../@utils/bem.js";
8
8
  import { markModalOwnedEvent } from "../UiFocusManager/modalOwnedEvents.js";
9
9
  const { b, e } = bem("gd-ui-kit-modal-dialog");
@@ -137,5 +137,5 @@ function OpenModalDialog({ children, variant = "default", onClose, width = 540,
137
137
  return (_jsx(FloatingPortal, { children: _jsx(ConditionalScopedThemeProvider, { children: _jsx(FloatingOverlay, { lockScroll: true, className: b(), "data-testid": dataTestId, style: { zIndex },
138
138
  // The card, the focus guards and the menus portaled from the card all bubble
139
139
  // through here before reaching a focus trap around the opener.
140
- onKeyDown: markModalKeyDown, children: _jsx(FloatingFocusManager, { context: context, initialFocus: initialFocus ?? (hasAutofocusTarget ? initialFocusRef : undefined), getInsideElements: getInsideElements, children: _jsx("div", { ref: setFloatingRef, className: e("card", { variant }), style: { width }, role: accessibilityConfig?.role ?? "dialog", "aria-modal": "true", "aria-label": accessibilityConfig?.ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": hasBody ? descriptionId : undefined, ...getFloatingProps(), onKeyDown: onCardKeyDown, children: _jsx(UiDialogContext.Provider, { value: dialogContextValue, children: children }) }) }) }) }) }));
140
+ onKeyDown: markModalKeyDown, children: _jsx(FloatingFocusManager, { context: context, initialFocus: initialFocus ?? (hasAutofocusTarget ? initialFocusRef : undefined), getInsideElements: getInsideElements, children: _jsx("div", { ref: setFloatingRef, className: e("card", { variant }), style: { width }, role: accessibilityConfig?.role ?? "dialog", "aria-modal": "true", "aria-label": accessibilityConfig?.ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": hasBody ? descriptionId : undefined, ...getFloatingProps(), onKeyDown: onCardKeyDown, children: _jsx(UiDialogContext.Provider, { value: dialogContextValue, children: _jsx(OverlayZIndexContext.Provider, { value: zIndex, children: children }) }) }) }) }) }) }));
141
141
  }
@@ -0,0 +1,46 @@
1
+ import { type KeyboardEvent, type MouseEvent, type ReactElement } from "react";
2
+ import { type IUiResizableSidebarNavigationItem, type IUiResizableSidebarNavigationSubItem, type UiResizableSidebarNavigationNamingConfig } from "./types.js";
3
+ /**
4
+ * @internal
5
+ */
6
+ export type UiResizableSidebarNavigationItem = IUiResizableSidebarNavigationItem | IUiResizableSidebarNavigationSubItem;
7
+ /**
8
+ * @internal
9
+ */
10
+ export interface IUiResizableSidebarNavigationProps {
11
+ items: IUiResizableSidebarNavigationItem[];
12
+ /**
13
+ * Called when the user activates an item. A link item is not prevented from following its `href`;
14
+ * call `event.preventDefault()` to route it in the application instead. A click with Alt, Ctrl, Meta
15
+ * or Shift on a link item is left to the browser (new tab, window or download) and does not call
16
+ * this.
17
+ *
18
+ * A group with an `href` calls this only while it is not active. Activating an active group toggles
19
+ * its sub-items, so its own `href` is then reached only by a modified click; list a group page that
20
+ * must stay reachable as one of its sub-items. In rail mode every top-level item calls this,
21
+ * including a group without an `href`, whose sub-items the consumer can reach by expanding the
22
+ * sidebar.
23
+ */
24
+ onSelect?: (item: UiResizableSidebarNavigationItem, event: MouseEvent | KeyboardEvent) => void;
25
+ accessibilityConfig: UiResizableSidebarNavigationNamingConfig;
26
+ /**
27
+ * Rail mode lists only the icons of the top-level items, each with a tooltip, and no sub-items.
28
+ * Defaults to whether the nearest {@link UiResizableSidebarProvider} is collapsed to a rail.
29
+ */
30
+ isRail?: boolean;
31
+ dataTestId?: string;
32
+ }
33
+ /**
34
+ * Item list of a sidebar: top-level pages and expandable groups of sub-pages. A group expands by itself
35
+ * when it or one of its sub-items is selected, and the user can expand and collapse it with its chevron
36
+ * or the Left and Right arrow keys. The list is one tab stop: Up and Down move between the listed items,
37
+ * Home and End jump to the ends.
38
+ *
39
+ * @remarks
40
+ * Selection is driven by the `isSelected` flags of the items; the list does not keep a selection of its
41
+ * own. A group with a selected sub-item is highlighted together with the sub-item.
42
+ *
43
+ * @internal
44
+ */
45
+ export declare function UiResizableSidebarNavigation({ items, onSelect, accessibilityConfig, isRail: isRailProp, dataTestId, }: IUiResizableSidebarNavigationProps): ReactElement;
46
+ //# sourceMappingURL=UiResizableSidebarNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiResizableSidebarNavigation.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiResizableSidebar/UiResizableSidebarNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,YAAY,EAOpB,MAAM,OAAO,CAAC;AAWf,OAAO,EAEH,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EACzC,KAAK,wCAAwC,EAChD,MAAM,YAAY,CAAC;AAQpB;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACtC,iCAAiC,GACjC,oCAAoC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAC/C,KAAK,EAAE,iCAAiC,EAAE,CAAC;IAC3C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gCAAgC,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;IAC/F,mBAAmB,EAAE,wCAAwC,CAAC;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,EACzC,KAAK,EACL,QAAQ,EACR,mBAAmB,EACnB,MAAM,EAAE,UAAU,EAClB,UAAU,GACb,EAAE,kCAAkC,GAAG,YAAY,CAoNnD"}
@@ -0,0 +1,212 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // (C) 2026 GoodData Corporation
3
+ import { useCallback, useId, useMemo, useRef, useState, } from "react";
4
+ import { accessibilityConfigToAttributes } from "../../typings/utilities.js";
5
+ import { bem } from "../@utils/bem.js";
6
+ import { makeGridKeyboardNavigation } from "../@utils/keyboardNavigation.js";
7
+ import { iconPaths } from "../UiIcon/icons.js";
8
+ import { UiIcon } from "../UiIcon/UiIcon.js";
9
+ import { hasSystemModifier } from "../UiToolbar/rovingFocusUtils.js";
10
+ import { UiTooltip } from "../UiTooltip/UiTooltip.js";
11
+ import { useOptionalUiResizableSidebar } from "./UiResizableSidebarContext.js";
12
+ const { b, e } = bem("gd-ui-kit-resizable-sidebar-navigation");
13
+ const ICON_SIZE = 18;
14
+ const CHEVRON_SIZE = 14;
15
+ function makeRow(item, parent) {
16
+ return { item, parent, key: JSON.stringify(parent ? [parent.id, item.id] : [item.id]) };
17
+ }
18
+ const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
19
+ // A label can start with an emoji or a combined character that spans several UTF-16 code units.
20
+ function getFirstGrapheme(label) {
21
+ return graphemeSegmenter.segment(label)[Symbol.iterator]().next().value?.segment ?? "";
22
+ }
23
+ // Any supplied href, even an empty one, makes the item a link.
24
+ function isLink(item) {
25
+ return item.href !== undefined;
26
+ }
27
+ function isIconType(icon) {
28
+ return typeof icon === "string" && icon in iconPaths;
29
+ }
30
+ function isGroup(item) {
31
+ return (item.children?.length ?? 0) > 0;
32
+ }
33
+ function isActive(item) {
34
+ return !!item.isSelected || !!item.children?.some((child) => child.isSelected);
35
+ }
36
+ function getSelectionKey(items) {
37
+ return items
38
+ .flatMap((item) => [makeRow(item), ...(item.children ?? []).map((child) => makeRow(child, item))])
39
+ .filter((row) => row.item.isSelected)
40
+ .map((row) => row.key)
41
+ .join();
42
+ }
43
+ /**
44
+ * Item list of a sidebar: top-level pages and expandable groups of sub-pages. A group expands by itself
45
+ * when it or one of its sub-items is selected, and the user can expand and collapse it with its chevron
46
+ * or the Left and Right arrow keys. The list is one tab stop: Up and Down move between the listed items,
47
+ * Home and End jump to the ends.
48
+ *
49
+ * @remarks
50
+ * Selection is driven by the `isSelected` flags of the items; the list does not keep a selection of its
51
+ * own. A group with a selected sub-item is highlighted together with the sub-item.
52
+ *
53
+ * @internal
54
+ */
55
+ export function UiResizableSidebarNavigation({ items, onSelect, accessibilityConfig, isRail: isRailProp, dataTestId, }) {
56
+ const sidebar = useOptionalUiResizableSidebar();
57
+ const isRail = isRailProp ?? (!!sidebar && sidebar.isCollapsed && sidebar.hasRail);
58
+ const idPrefix = useId();
59
+ const selectionKey = getSelectionKey(items);
60
+ const [expansion, setExpansion] = useState({ selectionKey, toggles: new Map() });
61
+ // A change of selection forgets the manual toggles, so the group of the new page always opens.
62
+ if (expansion.selectionKey !== selectionKey) {
63
+ setExpansion({ selectionKey, toggles: new Map() });
64
+ }
65
+ const isExpanded = useCallback((item) => !isRail && isGroup(item) && (expansion.toggles.get(item.id) ?? isActive(item)), [expansion.toggles, isRail]);
66
+ const setExpanded = useCallback((id, expanded) => {
67
+ setExpansion((current) => ({
68
+ ...current,
69
+ toggles: new Map(current.toggles).set(id, expanded),
70
+ }));
71
+ }, []);
72
+ const rows = useMemo(() => items.flatMap((item) => {
73
+ const own = makeRow(item);
74
+ return isExpanded(item)
75
+ ? [own, ...(item.children ?? []).map((child) => makeRow(child, item))]
76
+ : [own];
77
+ }), [items, isExpanded]);
78
+ const [focusedKey, setFocusedKey] = useState(null);
79
+ const tabStopKey = useMemo(() => {
80
+ if (rows.some((row) => row.key === focusedKey)) {
81
+ return focusedKey;
82
+ }
83
+ const selected = rows.find((row) => row.item.isSelected) ?? rows.find((row) => isActive(row.item));
84
+ return (selected ?? rows[0])?.key ?? null;
85
+ }, [rows, focusedKey]);
86
+ const elementsRef = useRef(new Map());
87
+ const focusRow = useCallback((key) => {
88
+ if (key !== undefined) {
89
+ elementsRef.current.get(key)?.focus();
90
+ }
91
+ }, []);
92
+ const getRowIndex = useCallback((target) => {
93
+ const entry = [...elementsRef.current.entries()].find(([, element]) => element.contains(target));
94
+ return entry ? rows.findIndex((row) => row.key === entry[0]) : -1;
95
+ }, [rows]);
96
+ const onKeyDown = useMemo(() => {
97
+ // Enter and Space stay unhandled, so links and buttons keep their native activation.
98
+ const handleKey = makeGridKeyboardNavigation({
99
+ onFocusUp: (event) => {
100
+ const index = getRowIndex(event.target);
101
+ focusRow(rows[Math.max(0, index - 1)]?.key);
102
+ },
103
+ onFocusDown: (event) => {
104
+ const index = getRowIndex(event.target);
105
+ focusRow(rows[Math.min(rows.length - 1, index + 1)]?.key);
106
+ },
107
+ onFocusFirst: () => focusRow(rows[0]?.key),
108
+ onFocusLast: () => focusRow(rows[rows.length - 1]?.key),
109
+ onFocusRight: (event) => {
110
+ const row = rows[getRowIndex(event.target)];
111
+ const item = row?.item;
112
+ if (!item || row.parent || !isGroup(item) || isRail) {
113
+ return;
114
+ }
115
+ if (isExpanded(item)) {
116
+ const firstChild = item.children?.[0];
117
+ focusRow(firstChild ? makeRow(firstChild, item).key : undefined);
118
+ }
119
+ else {
120
+ setExpanded(item.id, true);
121
+ }
122
+ },
123
+ onFocusLeft: (event) => {
124
+ const row = rows[getRowIndex(event.target)];
125
+ if (!row) {
126
+ return;
127
+ }
128
+ if (row.parent) {
129
+ focusRow(makeRow(row.parent).key);
130
+ }
131
+ else if (isExpanded(row.item)) {
132
+ setExpanded(row.item.id, false);
133
+ }
134
+ },
135
+ });
136
+ // Modified keys stay with the browser, e.g. Alt+Left for history navigation.
137
+ return (event) => {
138
+ if (!hasSystemModifier(event)) {
139
+ handleKey(event);
140
+ }
141
+ };
142
+ }, [rows, getRowIndex, focusRow, isExpanded, setExpanded, isRail]);
143
+ const registerElement = useCallback((key, element) => {
144
+ if (element) {
145
+ elementsRef.current.set(key, element);
146
+ }
147
+ else {
148
+ elementsRef.current.delete(key);
149
+ }
150
+ }, []);
151
+ const onActivate = useCallback((row, event) => {
152
+ const item = row.item;
153
+ if (isLink(item) && (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)) {
154
+ return;
155
+ }
156
+ if (row.parent || isRail || !isGroup(item)) {
157
+ onSelect?.(item, event);
158
+ return;
159
+ }
160
+ if (!isLink(item) || isActive(item)) {
161
+ event.preventDefault();
162
+ setExpanded(item.id, !isExpanded(item));
163
+ return;
164
+ }
165
+ setExpanded(item.id, true);
166
+ onSelect?.(item, event);
167
+ }, [onSelect, isRail, isExpanded, setExpanded]);
168
+ const renderRow = (row) => {
169
+ const item = row.item;
170
+ const group = !row.parent && isGroup(item);
171
+ const expanded = isExpanded(item);
172
+ const childrenId = `${idPrefix}-${encodeURIComponent(item.id)}`;
173
+ // A collapsed group shows the badge of a sub-page, so the marker stays visible from outside.
174
+ const badge = item.badge ??
175
+ (group && !expanded ? item.children?.find((child) => child.badge)?.badge : undefined);
176
+ const element = (_jsx(NavigationRow, { item: item, badge: badge, rowKey: row.key, isChild: !!row.parent, isRail: isRail, isActive: !row.parent && isActive(item), isExpanded: group && !isRail ? expanded : undefined, childrenId: group ? childrenId : undefined, tabIndex: row.key === tabStopKey ? 0 : -1, onFocus: () => setFocusedKey(row.key), onActivate: (event) => onActivate(row, event), registerElement: registerElement }));
177
+ return (_jsxs("li", { className: e("row", { rail: isRail }), children: [isRail ? (_jsx(UiTooltip, { anchor: element, content: item.label, arrowPlacement: "left", triggerBy: ["hover", "focus"], accessibilityHidden: true, closeOnAnchorClick: true })) : (element), group && expanded ? (_jsx("ul", { id: childrenId, className: e("children"), children: item.children?.map((child) => renderRow(makeRow(child, item))) })) : null] }, row.key));
178
+ };
179
+ return (_jsx("nav", { className: b({ rail: isRail }), ...accessibilityConfigToAttributes(accessibilityConfig), "data-testid": dataTestId, onKeyDown: onKeyDown, children: _jsx("ul", { className: e("list"), children: items.map((item) => renderRow(makeRow(item))) }) }));
180
+ }
181
+ function NavigationRow({ item, badge, rowKey, isChild, isRail, isActive, isExpanded, childrenId, tabIndex, onFocus, onActivate, registerElement, }) {
182
+ const showIcon = !isChild;
183
+ const showChevron = isExpanded !== undefined;
184
+ // A group whose current sub-page is not rendered (collapsed, or in the rail) stands in for it.
185
+ const holdsHiddenCurrentPage = isActive && !item.isSelected && isExpanded !== true;
186
+ const ariaCurrent = item.isSelected
187
+ ? "page"
188
+ : holdsHiddenCurrentPage
189
+ ? "true"
190
+ : undefined;
191
+ const badgeElement = badge ? (_jsx("span", { className: e("badge", { kind: badge.kind }), children: _jsx("span", { className: e("sr-only"), children: badge.label }) })) : null;
192
+ const content = (_jsxs(_Fragment, { children: [showIcon ? (_jsx("span", { className: e("icon"), "aria-hidden": "true", children: isIconType(item.icon) ? (_jsx(UiIcon, { type: item.icon, size: ICON_SIZE, color: "currentColor", layout: "block" })) : ((item.icon ?? getFirstGrapheme(item.label))) })) : null, _jsx("span", { className: e(isRail ? "sr-only" : "label"), children: item.label }), badgeElement, showChevron ? (_jsx("span", { className: e("chevron", { expanded: !!isExpanded }), "aria-hidden": "true", children: _jsx(UiIcon, { type: "chevronRight", size: CHEVRON_SIZE, color: "currentColor", layout: "block" }) })) : null] }));
193
+ const sharedProps = {
194
+ className: e("item", {
195
+ selected: !!item.isSelected,
196
+ active: isActive,
197
+ child: isChild,
198
+ rail: isRail,
199
+ }),
200
+ tabIndex,
201
+ "aria-current": ariaCurrent,
202
+ "aria-expanded": isExpanded,
203
+ "aria-controls": isExpanded ? childrenId : undefined,
204
+ "data-testid": item.dataTestId,
205
+ onFocus,
206
+ onClick: onActivate,
207
+ };
208
+ if (isLink(item)) {
209
+ return (_jsx("a", { ref: (element) => registerElement(rowKey, element), href: item.href, ...sharedProps, children: content }));
210
+ }
211
+ return (_jsx("button", { ref: (element) => registerElement(rowKey, element), type: "button", ...sharedProps, children: content }));
212
+ }
@@ -1,3 +1,6 @@
1
+ import { type ReactNode } from "react";
2
+ import { type IAccessibilityConfigBase } from "../../typings/accessibility.js";
3
+ import { type IconType } from "../@types/icon.js";
1
4
  /**
2
5
  * Width state of a resizable, collapsible sidebar, shared between the sidebar and controls rendered
3
6
  * elsewhere (for example a restore control in a header).
@@ -77,4 +80,62 @@ export interface IUiResizableSidebarStateOptions {
77
80
  */
78
81
  onUserChange?: (property: "collapsed" | "width") => void;
79
82
  }
83
+ /**
84
+ * @internal
85
+ */
86
+ export interface IUiResizableSidebarNavigationBadge {
87
+ kind: "dot";
88
+ label: string;
89
+ }
90
+ /**
91
+ * A page listed in a {@link UiResizableSidebarNavigation}: a sub-item of a group, or the base of a
92
+ * top-level item.
93
+ *
94
+ * @internal
95
+ */
96
+ export interface IUiResizableSidebarNavigationSubItem {
97
+ id: string;
98
+ label: string;
99
+ /**
100
+ * Renders the item as a link. An item without `href` renders as a button.
101
+ */
102
+ href?: string;
103
+ /**
104
+ * Marks the page the user is on; rendered as `aria-current="page"`.
105
+ */
106
+ isSelected?: boolean;
107
+ /**
108
+ * A dot next to the label that marks the item as needing attention. The label is its accessible
109
+ * text, e.g. "Needs attention". A collapsed group, and a group in the rail, shows the badge of its
110
+ * first badged sub-page.
111
+ */
112
+ badge?: IUiResizableSidebarNavigationBadge;
113
+ dataTestId?: string;
114
+ }
115
+ /**
116
+ * A top-level item of a {@link UiResizableSidebarNavigation}. With `children` it is an expandable group
117
+ * whose sub-items are listed while the group is expanded.
118
+ *
119
+ * @internal
120
+ */
121
+ export interface IUiResizableSidebarNavigationItem extends IUiResizableSidebarNavigationSubItem {
122
+ /**
123
+ * Icon shown before the label, and alone in rail mode: a kit icon name, or a custom node that
124
+ * paints itself in `currentColor`.
125
+ */
126
+ icon?: IconType | ReactNode;
127
+ children?: IUiResizableSidebarNavigationSubItem[];
128
+ }
129
+ /**
130
+ * The navigation needs an accessible name.
131
+ *
132
+ * @internal
133
+ */
134
+ export type UiResizableSidebarNavigationNamingConfig = {
135
+ ariaLabel: NonNullable<IAccessibilityConfigBase["ariaLabel"]>;
136
+ ariaLabelledBy?: IAccessibilityConfigBase["ariaLabelledBy"];
137
+ } | {
138
+ ariaLabel?: IAccessibilityConfigBase["ariaLabel"];
139
+ ariaLabelledBy: NonNullable<IAccessibilityConfigBase["ariaLabelledBy"]>;
140
+ };
80
141
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiResizableSidebar/types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,W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AQ,oCAAoC;IAC3F;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,oCAAoC,EAAE,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,GAC9C;IACI,SAAS,EAAE,WAAW,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9D,cAAc,CAAC,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CAC/D,GACD;IACI,SAAS,CAAC,EAAE,wBAAwB,CAAC,WAAW,CAAC,CAAC;IAClD,cAAc,EAAE,WAAW,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC,CAAC;CAC3E,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { type Ref } from "react";
2
+ import { type IconType } from "../@types/icon.js";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface IUiToolbarInputAccessibilityConfig {
7
+ /**
8
+ * Name of the value, for example "Width". Always the full name, never only the prefix letter.
9
+ */
10
+ ariaLabel: string;
11
+ /**
12
+ * Spoken form of the unit, for example "pixels". Defaults to `unit`.
13
+ */
14
+ unitLabel?: string;
15
+ }
16
+ /**
17
+ * @internal
18
+ */
19
+ export interface IUiToolbarInputProps {
20
+ /**
21
+ * The committed value as text, for example "120".
22
+ */
23
+ value: string;
24
+ /**
25
+ * Called with the typed text on Enter and on blur. Escape reverts the typed text instead.
26
+ * After a commit the field shows `value` again, so a parent that clamps or rejects the text
27
+ * only has to keep `value` as it wants it. While `isInvalid` is true, the typed text stays.
28
+ */
29
+ onCommit: (value: string) => void;
30
+ /**
31
+ * Called on ArrowUp and ArrowDown. `isLargeStep` is true while Shift is held.
32
+ */
33
+ onStep?: (direction: 1 | -1, isLargeStep: boolean) => void;
34
+ /**
35
+ * A short text before the value that names it, for example "W". Use either `prefix` or
36
+ * `prefixIcon`, not both.
37
+ */
38
+ prefix?: string;
39
+ /**
40
+ * A 14px icon before the value that names it. Never a generic icon such as search.
41
+ */
42
+ prefixIcon?: IconType;
43
+ /**
44
+ * The unit after the value, for example "px", "%" or "°".
45
+ */
46
+ unit?: string;
47
+ /**
48
+ * Width of the field in pixels. Size it for the longest value in its range so the toolbar does
49
+ * not move while typing.
50
+ * @defaultValue 64
51
+ */
52
+ width?: number;
53
+ isDisabled?: boolean;
54
+ /**
55
+ * Marks the typed text as not acceptable.
56
+ * @defaultValue false
57
+ */
58
+ isInvalid?: boolean;
59
+ placeholder?: string;
60
+ accessibilityConfig: IUiToolbarInputAccessibilityConfig;
61
+ inputRef?: Ref<HTMLInputElement>;
62
+ dataTestId?: string;
63
+ }
64
+ /**
65
+ * A typable number field with an optional prefix and unit. The prefix stays on the left; the value
66
+ * and the unit are aligned to the right.
67
+ *
68
+ * @internal
69
+ */
70
+ export declare const UiToolbarInput: import("react").ForwardRefExoticComponent<IUiToolbarInputProps & import("react").RefAttributes<HTMLLabelElement>>;
71
+ //# sourceMappingURL=UiToolbarInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiToolbarInput.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiToolbarInput/UiToolbarInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAEpG,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKlD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAC/C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,kCAAkC,CAAC;IACxD,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,mHAiIzB,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // (C) 2026 GoodData Corporation
3
+ import { forwardRef, useId, useState } from "react";
4
+ import { bem } from "../@utils/bem.js";
5
+ import { UiIcon } from "../UiIcon/UiIcon.js";
6
+ import { hasSystemModifier } from "../UiToolbar/rovingFocusUtils.js";
7
+ const { b, e } = bem("gd-ui-kit-toolbar-input");
8
+ const DEFAULT_WIDTH = 64;
9
+ /**
10
+ * A typable number field with an optional prefix and unit. The prefix stays on the left; the value
11
+ * and the unit are aligned to the right.
12
+ *
13
+ * @internal
14
+ */
15
+ export const UiToolbarInput = forwardRef(function UiToolbarInput({ value, onCommit, onStep, prefix, prefixIcon, unit, width = DEFAULT_WIDTH, isDisabled = false, isInvalid = false, placeholder, accessibilityConfig, inputRef, dataTestId, }, ref) {
16
+ const unitId = useId();
17
+ const [draft, setDraft] = useState(value);
18
+ const [committed, setCommitted] = useState(value);
19
+ // The text last typed, while it may still come back as `value`.
20
+ const [typed, setTyped] = useState();
21
+ // What the status region says. A value that merely echoes the typed text is left out: the
22
+ // input reads the keystrokes itself, and a second reading of each one would talk over it.
23
+ const [announced, setAnnounced] = useState(value);
24
+ // The text last sent to onCommit, so Enter followed by blur commits it only once.
25
+ const [sent, setSent] = useState();
26
+ // Set by a commit. On the next render the field shows `value` again, which also covers a
27
+ // parent that clamps or rejects the text and so keeps `value` as it was. A parent that marks
28
+ // the text invalid keeps it in the field instead, so the user can correct it.
29
+ const [isCommitPending, setIsCommitPending] = useState(false);
30
+ if (committed !== value) {
31
+ setCommitted(value);
32
+ setDraft(value);
33
+ if (value !== typed) {
34
+ setAnnounced(value);
35
+ }
36
+ }
37
+ if (isCommitPending) {
38
+ setIsCommitPending(false);
39
+ if (!isInvalid) {
40
+ setDraft(value);
41
+ }
42
+ }
43
+ const commitDraft = () => {
44
+ if (draft !== value && draft !== sent) {
45
+ setTyped(undefined);
46
+ setSent(draft);
47
+ setIsCommitPending(true);
48
+ onCommit(draft);
49
+ }
50
+ };
51
+ const handleKeyDown = (event) => {
52
+ // While an IME is composing, the arrows and Enter belong to the input method.
53
+ if (isDisabled || event.nativeEvent.isComposing) {
54
+ return;
55
+ }
56
+ if ((event.code === "ArrowUp" || event.code === "ArrowDown") && !hasSystemModifier(event)) {
57
+ if (onStep) {
58
+ event.preventDefault();
59
+ setTyped(undefined);
60
+ onStep(event.code === "ArrowUp" ? 1 : -1, event.shiftKey);
61
+ }
62
+ }
63
+ else if (event.code === "Enter") {
64
+ event.preventDefault();
65
+ commitDraft();
66
+ }
67
+ else if (event.code === "Escape") {
68
+ setTyped(undefined);
69
+ setDraft(value);
70
+ }
71
+ };
72
+ const unitLabel = unit ? (accessibilityConfig.unitLabel ?? unit) : undefined;
73
+ return (_jsxs("label", { ref: ref, className: b({ isDisabled, isInvalid }), style: { width }, "data-testid": dataTestId, children: [prefixIcon ? (_jsx("span", { className: e("prefix"), children: _jsx(UiIcon, { type: prefixIcon, size: 14, color: "currentColor", accessibilityConfig: { ariaHidden: true } }) })) : prefix ? (_jsx("span", { className: e("prefix"), "aria-hidden": true, children: prefix })) : null, _jsx("input", { ref: inputRef, className: e("value"), type: "text", inputMode: "decimal", value: draft, placeholder: placeholder, "aria-label": accessibilityConfig.ariaLabel, "aria-describedby": unit ? unitId : undefined, "aria-disabled": isDisabled || undefined, "aria-invalid": isInvalid || undefined, readOnly: isDisabled, onChange: (event) => {
74
+ setDraft(event.target.value);
75
+ setTyped(event.target.value);
76
+ setSent(undefined);
77
+ }, onBlur: isDisabled ? undefined : commitDraft, onKeyDown: handleKeyDown }), unit ? (_jsxs(_Fragment, { children: [_jsx("span", { className: e("unit"), "aria-hidden": true, children: unit }), _jsx("span", { id: unitId, className: "sr-only", children: unitLabel })] })) : null, _jsx("span", { className: "sr-only", role: "status", children: [accessibilityConfig.ariaLabel, announced, unitLabel].filter(Boolean).join(" ") })] }));
78
+ });
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export interface IUiToolbarPaginationAccessibilityConfig {
5
+ /**
6
+ * Name of the current page, for example "Page".
7
+ */
8
+ ariaLabel: string;
9
+ /**
10
+ * Name of the previous control, for example "Previous page".
11
+ */
12
+ previousLabel: string;
13
+ /**
14
+ * Name of the next control, for example "Next page".
15
+ */
16
+ nextLabel: string;
17
+ /**
18
+ * Spoken form of the position, for example "Page 3 of 12". Announced when the page changes.
19
+ * Defaults to the label followed by the visible text.
20
+ */
21
+ valueText?: string;
22
+ /**
23
+ * Spoken form of the total next to the editable page, for example "of 12".
24
+ * Defaults to the visible text.
25
+ */
26
+ totalLabel?: string;
27
+ }
28
+ /**
29
+ * @internal
30
+ */
31
+ export interface IUiToolbarPaginationProps {
32
+ /**
33
+ * The current page, starting at 1.
34
+ */
35
+ currentPage: number;
36
+ totalPages: number;
37
+ /**
38
+ * Called with the page to move to. A typed page is clamped to the range from 1 to `totalPages`.
39
+ */
40
+ onPageChange: (page: number) => void;
41
+ /**
42
+ * Makes the current page a field the user can type a page into. Enter and blur go to the typed
43
+ * page, Escape reverts it.
44
+ * @defaultValue false
45
+ */
46
+ isValueEditable?: boolean;
47
+ isDisabled?: boolean;
48
+ accessibilityConfig: IUiToolbarPaginationAccessibilityConfig;
49
+ dataTestId?: string;
50
+ }
51
+ /**
52
+ * Previous and next controls around the current page and the total, for example "1 / 12". Each
53
+ * control is its own toolbar stop.
54
+ *
55
+ * @internal
56
+ */
57
+ export declare const UiToolbarPagination: import("react").ForwardRefExoticComponent<IUiToolbarPaginationProps & import("react").RefAttributes<HTMLDivElement>>;
58
+ //# sourceMappingURL=UiToolbarPagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiToolbarPagination.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiToolbarPagination/UiToolbarPagination.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACpD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,uCAAuC,CAAC;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAYD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sHAsG/B,CAAC"}