pixelize-design-library 2.3.19 → 2.3.20

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 (43) hide show
  1. package/.cursor/modules/overlays/MODULE.md +9 -1
  2. package/.cursor/modules/utils-hooks/MODULE.md +12 -2
  3. package/dist/Components/ToolTip/OverflowToolTip.d.ts +18 -0
  4. package/dist/Components/ToolTip/OverflowToolTip.d.ts.map +1 -0
  5. package/dist/Components/ToolTip/OverflowToolTip.js +26 -0
  6. package/dist/Components/ToolTip/ToolTip.d.ts +1 -1
  7. package/dist/Components/ToolTip/ToolTip.d.ts.map +1 -1
  8. package/dist/Components/ToolTip/ToolTip.js +21 -3
  9. package/dist/Components/ToolTip/ToolTipProps.d.ts +9 -0
  10. package/dist/Components/ToolTip/ToolTipProps.d.ts.map +1 -1
  11. package/dist/Hooks/useIsTruncated.d.ts +36 -0
  12. package/dist/Hooks/useIsTruncated.d.ts.map +1 -0
  13. package/dist/Hooks/useIsTruncated.js +57 -0
  14. package/dist/Utils/mergeRefs.d.ts +11 -0
  15. package/dist/Utils/mergeRefs.d.ts.map +1 -0
  16. package/dist/Utils/mergeRefs.js +20 -0
  17. package/dist/index.d.ts +3 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +5 -1
  20. package/package.json +1 -1
  21. package/dist/Assets/defaultLogo.tsx +0 -30
  22. package/dist/Components/Input/textInputIconSize.test.d.ts +0 -1
  23. package/dist/Components/Input/textInputIconSize.test.js +0 -27
  24. package/dist/Components/KanbanBoard/AccountCard.test.d.ts +0 -1
  25. package/dist/Components/KanbanBoard/AccountCard.test.js +0 -68
  26. package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.test.d.ts +0 -1
  27. package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.test.js +0 -49
  28. package/dist/Components/KanbanBoard/KanbanBoard.test.d.ts +0 -1
  29. package/dist/Components/KanbanBoard/KanbanBoard.test.js +0 -185
  30. package/dist/Components/SearchSelect/searchSelectSize.test.d.ts +0 -1
  31. package/dist/Components/SearchSelect/searchSelectSize.test.js +0 -22
  32. package/dist/Components/SideBar/components/OtherApps.test.d.ts +0 -1
  33. package/dist/Components/SideBar/components/OtherApps.test.js +0 -111
  34. package/dist/Components/Table/components/TableBody.virtualize.test.d.ts +0 -1
  35. package/dist/Components/Table/components/TableBody.virtualize.test.js +0 -93
  36. package/dist/Components/Table/settings/ManageColumns.test.d.ts +0 -1
  37. package/dist/Components/Table/settings/ManageColumns.test.js +0 -146
  38. package/dist/Theme/buildBrandTokens.test.d.ts +0 -1
  39. package/dist/Theme/buildBrandTokens.test.js +0 -31
  40. package/dist/Theme/chartColorsFromTheme.test.d.ts +0 -1
  41. package/dist/Theme/chartColorsFromTheme.test.js +0 -35
  42. package/dist/Utils/tableNormalizeCellValue.test.d.ts +0 -1
  43. package/dist/Utils/tableNormalizeCellValue.test.js +0 -41
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Modal, AlertDialog, ToolTip, Toaster (+ `useToaster` hook).
5
+ Modal, AlertDialog, ToolTip / OverflowToolTip, Toaster (+ `useToaster` hook).
6
6
 
7
7
  ## Key paths
8
8
 
@@ -11,3 +11,11 @@ Modal, AlertDialog, ToolTip, Toaster (+ `useToaster` hook).
11
11
  ## Key rules
12
12
 
13
13
  - Modal exports ModalHeader, ModalBody, ModalFooter subcomponents
14
+ - **ToolTip `overflowOnly`:** pass `overflowOnly` to show the tooltip **only**
15
+ when the child text is actually truncated (ellipsis active) — no tooltip when
16
+ it fits. The child must be the single clamping element (e.g. `Text` with
17
+ `noOfLines`); its ref is managed internally. Works for single- and multi-line
18
+ clamps and combines with `isDisabled`. **`OverflowToolTip`** is sugar for
19
+ `<ToolTip overflowOnly>`. Powered by the `useIsTruncated` hook (see
20
+ `utils-hooks`). Inert unless `overflowOnly` is set — no measurement/observer
21
+ for ordinary tooltips, and it never measures on hover/scroll.
@@ -2,12 +2,22 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Shared utilities and hooks: debounce, table helpers, preferences.
5
+ Shared utilities and hooks: debounce, table helpers, preferences, ref merging,
6
+ truncation detection.
6
7
 
7
8
  ## Key paths
8
9
 
9
- - `src/Utils/table.ts`, `src/Hooks/usePreferences.ts`, `src/services/feedback.ts`
10
+ - `src/Utils/table.ts`, `src/Utils/mergeRefs.ts`, `src/Hooks/usePreferences.ts`,
11
+ `src/Hooks/useIsTruncated.ts`, `src/services/feedback.ts`
10
12
 
11
13
  ## Key rules
12
14
 
13
15
  - `debounce` exported from index.ts
16
+ - **`useIsTruncated(content?, enabled?)`** (exported) — returns `{ ref, isTruncated }`;
17
+ attach `ref` to a clamped element to detect real overflow (`scrollWidth/Height`
18
+ vs `clientWidth/Height`, single- and multi-line). Re-measures on mount, element
19
+ resize (`ResizeObserver`), and `content` change — never on hover/scroll. Pass
20
+ `enabled=false` to make it fully inert. Powers `ToolTip overflowOnly` (see
21
+ `overlays`).
22
+ - **`mergeRefs(...refs)`** (internal) — combine a caller ref with an injected one
23
+ when cloning an element.
@@ -0,0 +1,18 @@
1
+ import { ToolTipProps } from "./ToolTipProps";
2
+ /**
3
+ * A tooltip that only appears when its child text is actually truncated
4
+ * (ellipsis active) — no tooltip when the text fully fits. Thin sugar over
5
+ * `<ToolTip overflowOnly>`; use it wherever you clamp text with `noOfLines` /
6
+ * ellipsis and want the full text revealed only when it's cut off.
7
+ *
8
+ * The child must be the single element that clamps the text (e.g. a Chakra
9
+ * `Text` with `noOfLines`); its ref is managed internally. Works for both
10
+ * single-line and multi-line clamps.
11
+ *
12
+ * @example
13
+ * <OverflowToolTip label={title}>
14
+ * <Text noOfLines={1}>{title}</Text>
15
+ * </OverflowToolTip>
16
+ */
17
+ export default function OverflowToolTip(props: ToolTipProps): import("react/jsx-runtime").JSX.Element;
18
+ //# sourceMappingURL=OverflowToolTip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverflowToolTip.d.ts","sourceRoot":"","sources":["../../../src/Components/ToolTip/OverflowToolTip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,YAAY,2CAE1D"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = OverflowToolTip;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const ToolTip_1 = __importDefault(require("./ToolTip"));
9
+ /**
10
+ * A tooltip that only appears when its child text is actually truncated
11
+ * (ellipsis active) — no tooltip when the text fully fits. Thin sugar over
12
+ * `<ToolTip overflowOnly>`; use it wherever you clamp text with `noOfLines` /
13
+ * ellipsis and want the full text revealed only when it's cut off.
14
+ *
15
+ * The child must be the single element that clamps the text (e.g. a Chakra
16
+ * `Text` with `noOfLines`); its ref is managed internally. Works for both
17
+ * single-line and multi-line clamps.
18
+ *
19
+ * @example
20
+ * <OverflowToolTip label={title}>
21
+ * <Text noOfLines={1}>{title}</Text>
22
+ * </OverflowToolTip>
23
+ */
24
+ function OverflowToolTip(props) {
25
+ return (0, jsx_runtime_1.jsx)(ToolTip_1.default, { ...props, overflowOnly: true });
26
+ }
@@ -1,3 +1,3 @@
1
1
  import { ToolTipProps } from "./ToolTipProps";
2
- export default function ToolTip({ placement, label, children, hasArrow, fontSize, bg, color, isDisabled, isOpen, defaultIsOpen, openDelay, closeDelay, arrowSize, closeOnClick, size, width, height, arrowPadding, arrowShadowColor, direction, gutter, onClose, modifiers, closeOnPointerDown, styles, }: ToolTipProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function ToolTip({ placement, label, children, hasArrow, fontSize, bg, color, isDisabled, overflowOnly, isOpen, defaultIsOpen, openDelay, closeDelay, arrowSize, closeOnClick, size, width, height, arrowPadding, arrowShadowColor, direction, gutter, onClose, modifiers, closeOnPointerDown, styles, }: ToolTipProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=ToolTip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolTip.d.ts","sourceRoot":"","sources":["../../../src/Components/ToolTip/ToolTip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,SAAiB,EACjB,KAAK,EACL,QAAQ,EACR,QAAe,EACf,QAAiB,EACjB,EAAc,EACd,KAAe,EACf,UAAU,EACV,MAAM,EACN,aAAa,EACb,SAAa,EACb,UAAc,EACd,SAAc,EACd,YAAoB,EACpB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,MAAU,EACV,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,MAAM,GACP,EAAE,YAAY,2CAqCd"}
1
+ {"version":3,"file":"ToolTip.d.ts","sourceRoot":"","sources":["../../../src/Components/ToolTip/ToolTip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,SAAiB,EACjB,KAAK,EACL,QAAQ,EACR,QAAe,EACf,QAAiB,EACjB,EAAc,EACd,KAAe,EACf,UAAU,EACV,YAAoB,EACpB,MAAM,EACN,aAAa,EACb,SAAa,EACb,UAAc,EACd,SAAc,EACd,YAAoB,EACpB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,MAAU,EACV,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,MAAM,GACP,EAAE,YAAY,2CA4Dd"}
@@ -2,7 +2,25 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = ToolTip;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("@chakra-ui/react");
6
- function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize = "14px", bg = "#12161B", color = "white", isDisabled, isOpen, defaultIsOpen, openDelay = 0, closeDelay = 0, arrowSize = 10, closeOnClick = false, size, width, height, arrowPadding, arrowShadowColor, direction, gutter = 8, onClose, modifiers, closeOnPointerDown, styles, }) {
7
- return ((0, jsx_runtime_1.jsx)(react_1.Tooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg: bg, color: color, isDisabled: isDisabled, isOpen: isOpen, defaultIsOpen: defaultIsOpen, openDelay: openDelay, closeDelay: closeDelay, arrowSize: arrowSize, closeOnClick: closeOnClick, size: size, width: width, height: height, arrowPadding: arrowPadding, arrowShadowColor: arrowShadowColor, direction: direction, gutter: gutter, onClose: onClose, modifiers: modifiers, closeOnPointerDown: closeOnPointerDown, style: styles, px: 3, py: 2, borderRadius: "8px", fontWeight: "400", lineHeight: "1.5", maxW: "300px", children: children }));
5
+ const react_1 = require("react");
6
+ const react_2 = require("@chakra-ui/react");
7
+ const useIsTruncated_1 = require("../../Hooks/useIsTruncated");
8
+ const mergeRefs_1 = require("../../Utils/mergeRefs");
9
+ function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize = "14px", bg = "#12161B", color = "white", isDisabled, overflowOnly = false, isOpen, defaultIsOpen, openDelay = 0, closeDelay = 0, arrowSize = 10, closeOnClick = false, size, width, height, arrowPadding, arrowShadowColor, direction, gutter = 8, onClose, modifiers, closeOnPointerDown, styles, }) {
10
+ // Measure the child for `overflowOnly`. The hook is always called (Rules of
11
+ // Hooks) but is fully inert unless `overflowOnly` is set — no layout reads,
12
+ // no ResizeObserver, no re-renders for ordinary tooltips. Measurement never
13
+ // runs on hover/scroll, so showing the tooltip stays as cheap as before.
14
+ const { ref, isTruncated } = (0, useIsTruncated_1.useIsTruncated)(label, overflowOnly && (0, react_1.isValidElement)(children));
15
+ let content = children;
16
+ let effectiveDisabled = isDisabled;
17
+ if (overflowOnly && (0, react_1.isValidElement)(children)) {
18
+ const child = children;
19
+ const childRef = child.ref;
20
+ content = (0, react_1.cloneElement)(child, {
21
+ ref: (0, mergeRefs_1.mergeRefs)(ref, childRef),
22
+ });
23
+ effectiveDisabled = Boolean(isDisabled) || !isTruncated;
24
+ }
25
+ return ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg: bg, color: color, isDisabled: effectiveDisabled, isOpen: isOpen, defaultIsOpen: defaultIsOpen, openDelay: openDelay, closeDelay: closeDelay, arrowSize: arrowSize, closeOnClick: closeOnClick, size: size, width: width, height: height, arrowPadding: arrowPadding, arrowShadowColor: arrowShadowColor, direction: direction, gutter: gutter, onClose: onClose, modifiers: modifiers, closeOnPointerDown: closeOnPointerDown, style: styles, px: 3, py: 2, borderRadius: "8px", fontWeight: "400", lineHeight: "1.5", maxW: "300px", children: content }));
8
26
  }
@@ -2,6 +2,15 @@ import { TooltipProps as ChakraTooltip } from "@chakra-ui/react";
2
2
  export type ToolTipProps = Pick<ChakraTooltip, "placement" | "label" | "hasArrow" | "fontSize" | "bg" | "color" | "isDisabled" | "isOpen" | "defaultIsOpen" | "openDelay" | "closeDelay" | "arrowSize" | "closeOnClick" | "size" | "width" | "height" | "arrowPadding" | "arrowShadowColor" | "direction" | "gutter" | "onClose" | "modifiers" | "closeOnPointerDown"> & {
3
3
  children: React.ReactNode;
4
4
  styles?: React.CSSProperties;
5
+ /**
6
+ * When `true`, the tooltip is shown **only** while its child is actually
7
+ * truncated (ellipsis active) — no tooltip when the text fully fits. The
8
+ * child must be the single element that clamps the text (e.g. a `Text` with
9
+ * `noOfLines` / `isTruncated`); its ref is managed internally. Combines with
10
+ * `isDisabled` (either disabling condition hides the tooltip). Works for both
11
+ * single-line and multi-line clamps.
12
+ */
13
+ overflowOnly?: boolean;
5
14
  placement?: "auto" | "auto-start" | "auto-end" | "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
6
15
  };
7
16
  //# sourceMappingURL=ToolTipProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolTipProps.d.ts","sourceRoot":"","sources":["../../../src/Components/ToolTip/ToolTipProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,aAAa,EACX,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,IAAI,GACJ,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,eAAe,GACf,WAAW,GACX,YAAY,GACZ,WAAW,GACX,cAAc,GACd,MAAM,GACN,OAAO,GACP,QAAQ,GACR,cAAc,GACd,kBAAkB,GAClB,WAAW,GACX,QAAQ,GACR,SAAS,GACT,WAAW,GACX,oBAAoB,CACvB,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,SAAS,CAAC,EACN,MAAM,GACN,YAAY,GACZ,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,CAAC;CAChB,CAAC"}
1
+ {"version":3,"file":"ToolTipProps.d.ts","sourceRoot":"","sources":["../../../src/Components/ToolTip/ToolTipProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,aAAa,EACX,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,IAAI,GACJ,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,eAAe,GACf,WAAW,GACX,YAAY,GACZ,WAAW,GACX,cAAc,GACd,MAAM,GACN,OAAO,GACP,QAAQ,GACR,cAAc,GACd,kBAAkB,GAClB,WAAW,GACX,QAAQ,GACR,SAAS,GACT,WAAW,GACX,oBAAoB,CACvB,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EACN,MAAM,GACN,YAAY,GACZ,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,CAAC;CAChB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Detects whether an element's text is *actually* visually truncated — i.e. the
3
+ * ellipsis is active. Works for both single-line clamps
4
+ * (`overflow: hidden; white-space: nowrap; text-overflow: ellipsis`) and
5
+ * multi-line clamps (`-webkit-line-clamp` / Chakra `noOfLines`), by comparing
6
+ * the scroll size against the visible client size.
7
+ *
8
+ * Attach the returned `ref` to the element that clamps the text, then read
9
+ * `isTruncated` to decide whether a tooltip is worth showing. Re-measures on
10
+ * element resize (via `ResizeObserver`) and whenever `content` changes.
11
+ *
12
+ * @param content Pass the rendered text (or anything that changes with it) so
13
+ * the measurement re-runs when the content changes — the clamp box can keep
14
+ * the same size while the text length changes, which a `ResizeObserver` alone
15
+ * would not catch.
16
+ * @param enabled Set to `false` to fully disable measurement — no layout reads,
17
+ * no `ResizeObserver`, no state updates. Use it to keep the hook cheap when
18
+ * the caller isn't in truncation mode (`isTruncated` stays `false`).
19
+ *
20
+ * Performance: measurement runs only on mount, on element **resize**, and when
21
+ * `content` changes — never on hover, scroll, or re-render. Each run does a
22
+ * single batched layout read (four properties) on one element. When `enabled`
23
+ * is `false` the hook does nothing at all.
24
+ *
25
+ * @example
26
+ * const { ref, isTruncated } = useIsTruncated(title);
27
+ * <ToolTip label={title} isDisabled={!isTruncated}>
28
+ * <Text ref={ref} noOfLines={1}>{title}</Text>
29
+ * </ToolTip>
30
+ */
31
+ export declare function useIsTruncated<T extends HTMLElement = HTMLElement>(content?: unknown, enabled?: boolean): {
32
+ ref: React.MutableRefObject<T | null>;
33
+ isTruncated: boolean;
34
+ };
35
+ export default useIsTruncated;
36
+ //# sourceMappingURL=useIsTruncated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsTruncated.d.ts","sourceRoot":"","sources":["../../src/Hooks/useIsTruncated.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAChE,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,GAAE,OAAc,GACtB;IAAE,GAAG,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAuBjE;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useIsTruncated = useIsTruncated;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Detects whether an element's text is *actually* visually truncated — i.e. the
7
+ * ellipsis is active. Works for both single-line clamps
8
+ * (`overflow: hidden; white-space: nowrap; text-overflow: ellipsis`) and
9
+ * multi-line clamps (`-webkit-line-clamp` / Chakra `noOfLines`), by comparing
10
+ * the scroll size against the visible client size.
11
+ *
12
+ * Attach the returned `ref` to the element that clamps the text, then read
13
+ * `isTruncated` to decide whether a tooltip is worth showing. Re-measures on
14
+ * element resize (via `ResizeObserver`) and whenever `content` changes.
15
+ *
16
+ * @param content Pass the rendered text (or anything that changes with it) so
17
+ * the measurement re-runs when the content changes — the clamp box can keep
18
+ * the same size while the text length changes, which a `ResizeObserver` alone
19
+ * would not catch.
20
+ * @param enabled Set to `false` to fully disable measurement — no layout reads,
21
+ * no `ResizeObserver`, no state updates. Use it to keep the hook cheap when
22
+ * the caller isn't in truncation mode (`isTruncated` stays `false`).
23
+ *
24
+ * Performance: measurement runs only on mount, on element **resize**, and when
25
+ * `content` changes — never on hover, scroll, or re-render. Each run does a
26
+ * single batched layout read (four properties) on one element. When `enabled`
27
+ * is `false` the hook does nothing at all.
28
+ *
29
+ * @example
30
+ * const { ref, isTruncated } = useIsTruncated(title);
31
+ * <ToolTip label={title} isDisabled={!isTruncated}>
32
+ * <Text ref={ref} noOfLines={1}>{title}</Text>
33
+ * </ToolTip>
34
+ */
35
+ function useIsTruncated(content, enabled = true) {
36
+ const ref = (0, react_1.useRef)(null);
37
+ const [isTruncated, setIsTruncated] = (0, react_1.useState)(false);
38
+ const measure = (0, react_1.useCallback)(() => {
39
+ const el = ref.current;
40
+ if (!el)
41
+ return;
42
+ setIsTruncated(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight);
43
+ }, []);
44
+ (0, react_1.useEffect)(() => {
45
+ if (!enabled)
46
+ return;
47
+ measure();
48
+ const el = ref.current;
49
+ if (!el || typeof ResizeObserver === "undefined")
50
+ return;
51
+ const observer = new ResizeObserver(measure);
52
+ observer.observe(el);
53
+ return () => observer.disconnect();
54
+ }, [measure, content, enabled]);
55
+ return { ref, isTruncated };
56
+ }
57
+ exports.default = useIsTruncated;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ /** Assign a value to a callback ref or a ref object. */
3
+ export declare function setRef<T>(ref: React.Ref<T> | undefined, value: T | null): void;
4
+ /**
5
+ * Combine multiple refs into a single callback ref, so a value flows to all of
6
+ * them. Useful when cloning an element to attach an internal ref while
7
+ * preserving a ref the caller already set.
8
+ */
9
+ export declare function mergeRefs<T>(...refs: Array<React.Ref<T> | undefined>): (value: T | null) => void;
10
+ export default mergeRefs;
11
+ //# sourceMappingURL=mergeRefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeRefs.d.ts","sourceRoot":"","sources":["../../src/Utils/mergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wDAAwD;AACxD,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,QAIvE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,GAAG,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GACvC,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAE3B;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setRef = setRef;
4
+ exports.mergeRefs = mergeRefs;
5
+ /** Assign a value to a callback ref or a ref object. */
6
+ function setRef(ref, value) {
7
+ if (typeof ref === "function")
8
+ ref(value);
9
+ else if (ref && typeof ref === "object")
10
+ ref.current = value;
11
+ }
12
+ /**
13
+ * Combine multiple refs into a single callback ref, so a value flows to all of
14
+ * them. Useful when cloning an element to attach an internal ref while
15
+ * preserving a ref the caller already set.
16
+ */
17
+ function mergeRefs(...refs) {
18
+ return (value) => refs.forEach((r) => setRef(r, value));
19
+ }
20
+ exports.default = mergeRefs;
package/dist/index.d.ts CHANGED
@@ -45,11 +45,13 @@ import TextInput from "./Components/Input/TextInput";
45
45
  import Timeline from "./Components/Timeline/Timeline";
46
46
  import Toaster, { useToaster } from "./Components/Toaster/Toaster";
47
47
  import ToolTip from "./Components/ToolTip/ToolTip";
48
+ import OverflowToolTip from "./Components/ToolTip/OverflowToolTip";
48
49
  import VerifyEmailOtp from "./Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp";
49
50
  import TableToggle from "./Components/Toggle/TableToggle";
50
51
  import withTheme from "./withTheme";
51
52
  import { useCustomTheme } from "./Theme/useCustomTheme";
52
53
  import { useSidebarPrefs } from "./Hooks/useSidebarPrefs";
54
+ import { useIsTruncated } from "./Hooks/useIsTruncated";
53
55
  import { ThemesList } from "./Theme";
54
56
  import { debounce } from "./Utils/table";
55
57
  import ProductCard from "./Components/ProductCard/ProductCard";
@@ -78,7 +80,7 @@ import RolesPermission from "./Components/RolesPermission/RolesPermission";
78
80
  import CustomModulesTable from "./Components/CustomModulesTable/CustomModulesTable";
79
81
  import SignInActivityTable from "./Components/SignInActivityTable/SignInActivityTable";
80
82
  import OrganizationDetails from "./Components/OrganizationDetails/OrganizationDetails";
81
- export { Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, UpgradeButton, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SearchSelect, SelectSearch, SideBar, Slider, Skeletons, Switch, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, useToaster, VerifyEmailOtp, useSidebarPrefs, useCustomTheme, ThemesList, debounce, };
83
+ export { Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, UpgradeButton, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SearchSelect, SelectSearch, SideBar, Slider, Skeletons, Switch, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp, useSidebarPrefs, useIsTruncated, useCustomTheme, ThemesList, debounce, };
82
84
  export default withTheme;
83
85
  export type { UserDetailsProps, UserDetailsLabels, UserListItem, SelectedUserDetail, UserDetailRow, RoleOption, AddUserFormValues, ChangeRoleSubmitPayload, } from "./Components/UserDetails/UserDetailsProps";
84
86
  export type { RolesPermissionProps, RolesPermissionLabels, RolesPermissionView, RolesPermissionMode, Permission, PermissionKey, RoleData, } from "./Components/RolesPermission/RolesPermissionProps";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAC/D,OAAO,YAAY,MAAM,mDAAmD,CAAC;AAC7E,OAAO,YAAY,MAAM,mDAAmD,CAAC;AAC7E,OAAO,cA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b,QAAQ,GACX,MAAM,mDAAmD,CAAC;AAE3D,YAAY,EACR,uBAAuB,EACvB,wBAAwB,EACxB,UAAU,EACV,mBAAmB,GACtB,MAAM,yDAAyD,CAAC;AAEjE,YAAY,EACR,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,GACf,MAAM,2DAA2D,CAAC;AAEnE,YAAY,EACR,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACtB,MAAM,2DAA2D,CAAC;AAEnE,YAAY,EACR,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,GACxB,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.ModalBody = exports.ModalHeader = exports.Modal = exports.Loading = exports.KanbanBoard = exports.InputSwitch = exports.InputTextArea = exports.HeaderActions = exports.Header = exports.OrganizationDetails = exports.SignInActivityTable = exports.CustomModulesTable = exports.RolesPermission = exports.UserDetails = exports.UpgradeButton = exports.OrgSwitcher = exports.StageItem = exports.StageProgress = exports.CopyButton = exports.ScrollToTop = exports.PdfViewer = exports.MoreItems = exports.LazyWrapper = exports.FormWrapper = exports.FilterSidebar = exports.FileUploader = exports.FileUpload = exports.FilePreviewTrigger = exports.FilePreview = exports.FieldSelectModal = exports.EmptyState = exports.Editor = exports.Dropdown = exports.DrawerFooter = exports.DrawerBody = exports.DrawerHeader = exports.Drawer = exports.DatePicker = exports.ContactForm = exports.Checkbox = exports.Card = exports.ButtonGroupIcon = exports.Button = exports.Breadcrumbs = exports.ApexLineChart = exports.ApexPolarChart = exports.ApexPieChart = exports.ApexBarChart = exports.AlertDialog = exports.Accordian = void 0;
41
- exports.debounce = exports.ThemesList = exports.useCustomTheme = exports.useSidebarPrefs = exports.VerifyEmailOtp = exports.useToaster = exports.ToolTip = exports.Toaster = exports.Timeline = exports.TextInput = exports.Tag = exports.TableToggle = exports.Table = exports.Switch = exports.Skeletons = exports.Slider = exports.SideBar = exports.SelectSearch = exports.SearchSelect = exports.Select = exports.Search = exports.Reorder = exports.RadioButtonGroup = exports.RadioButton = exports.ProgressBar = exports.ProfilePhotoViewer = exports.ProfileCardFooter = exports.ProfileCardBody = exports.ProfileCardHeader = exports.ProfileCard = exports.ProductDetails = exports.ProductCard = exports.PinInput = exports.PhoneNumberInput = exports.PaymentCard = exports.NumberInput = exports.MultiSelect = exports.NoteTextArea = exports.Notification = exports.NavigationBar = exports.ModalFooter = void 0;
41
+ exports.debounce = exports.ThemesList = exports.useCustomTheme = exports.useIsTruncated = exports.useSidebarPrefs = exports.VerifyEmailOtp = exports.useToaster = exports.OverflowToolTip = exports.ToolTip = exports.Toaster = exports.Timeline = exports.TextInput = exports.Tag = exports.TableToggle = exports.Table = exports.Switch = exports.Skeletons = exports.Slider = exports.SideBar = exports.SelectSearch = exports.SearchSelect = exports.Select = exports.Search = exports.Reorder = exports.RadioButtonGroup = exports.RadioButton = exports.ProgressBar = exports.ProfilePhotoViewer = exports.ProfileCardFooter = exports.ProfileCardBody = exports.ProfileCardHeader = exports.ProfileCard = exports.ProductDetails = exports.ProductCard = exports.PinInput = exports.PhoneNumberInput = exports.PaymentCard = exports.NumberInput = exports.MultiSelect = exports.NoteTextArea = exports.Notification = exports.NavigationBar = exports.ModalFooter = void 0;
42
42
  const Accordion_1 = __importDefault(require("./Components/Accordion/Accordion"));
43
43
  exports.Accordian = Accordion_1.default;
44
44
  const AlertDialog_1 = __importDefault(require("./Components/AlertDialog/AlertDialog"));
@@ -145,6 +145,8 @@ exports.Toaster = Toaster_1.default;
145
145
  Object.defineProperty(exports, "useToaster", { enumerable: true, get: function () { return Toaster_1.useToaster; } });
146
146
  const ToolTip_1 = __importDefault(require("./Components/ToolTip/ToolTip"));
147
147
  exports.ToolTip = ToolTip_1.default;
148
+ const OverflowToolTip_1 = __importDefault(require("./Components/ToolTip/OverflowToolTip"));
149
+ exports.OverflowToolTip = OverflowToolTip_1.default;
148
150
  const VerifyEmailOtp_1 = __importDefault(require("./Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp"));
149
151
  exports.VerifyEmailOtp = VerifyEmailOtp_1.default;
150
152
  const TableToggle_1 = __importDefault(require("./Components/Toggle/TableToggle"));
@@ -154,6 +156,8 @@ const useCustomTheme_1 = require("./Theme/useCustomTheme");
154
156
  Object.defineProperty(exports, "useCustomTheme", { enumerable: true, get: function () { return useCustomTheme_1.useCustomTheme; } });
155
157
  const useSidebarPrefs_1 = require("./Hooks/useSidebarPrefs");
156
158
  Object.defineProperty(exports, "useSidebarPrefs", { enumerable: true, get: function () { return useSidebarPrefs_1.useSidebarPrefs; } });
159
+ const useIsTruncated_1 = require("./Hooks/useIsTruncated");
160
+ Object.defineProperty(exports, "useIsTruncated", { enumerable: true, get: function () { return useIsTruncated_1.useIsTruncated; } });
157
161
  const Theme_1 = require("./Theme");
158
162
  Object.defineProperty(exports, "ThemesList", { enumerable: true, get: function () { return Theme_1.ThemesList; } });
159
163
  const table_1 = require("./Utils/table");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.3.19",
3
+ "version": "2.3.20",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,30 +0,0 @@
1
- import { useCustomTheme } from "../Theme/useCustomTheme";
2
-
3
- const DefaultLogo = () => {
4
- const theme = useCustomTheme();
5
- return (
6
- <svg
7
- width="12.09"
8
- height="15.95"
9
- viewBox="0 0 31 29"
10
- fill="none"
11
- xmlns="http://www.w3.org/2000/svg"
12
- >
13
- <path
14
- d="M30.4999 6.26137V7.81058H15.9761H14.8787V22.8508V28.8862H12.5226C9.6824 28.8862 7.32632 26.4656 7.06812 23.3995C7.06812 23.2381 7.06812 23.0444 7.06812 22.8508V18.3323C7.06812 18.2677 7.06812 18.2032 7.06812 18.1063V15.5889V6.2291C7.06812 2.80793 9.84378 -5.72205e-06 13.2972 -5.72205e-06H24.8517C28.0147 0.355021 30.4676 3.00158 30.4676 6.2291L30.4999 6.26137Z"
15
- fill={theme.colors.black}
16
- />
17
- <path
18
- d="M7.10053 23.3672H7.03598C5.16402 23.2381 3.48571 22.4635 2.25926 21.3338C0.871428 20.0428 0 18.2677 0 16.3312V15.6211H7.06825V18.1386C7.06825 18.2032 7.06825 18.2677 7.06825 18.3645V22.883C7.06825 23.0767 7.06825 23.2381 7.06825 23.4317L7.10053 23.3672Z"
19
- fill={theme.colors.black}
20
- />
21
- <path
22
- d="M30.4678 12.0063V15.6211V17.1703C30.4678 20.6238 26.272 23.3994 21.0757 23.3994H14.8789V22.8508V15.6211H22.6572V7.81056C22.6895 7.81056 30.5001 7.81056 30.5001 7.81056V11.5868C30.5001 11.7159 30.5001 11.8772 30.5001 12.0063H30.4678Z"
23
- fill={theme.colors.black}
24
- />
25
- </svg>
26
-
27
- )
28
- };
29
-
30
- export default DefaultLogo;
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var textInputIconSize_1 = require("./textInputIconSize");
4
- describe("getTextInputIconSizePx", function () {
5
- it("maps Chakra input sizes to increasing pixel values", function () {
6
- var xs = (0, textInputIconSize_1.getTextInputIconSizePx)("xs");
7
- var sm = (0, textInputIconSize_1.getTextInputIconSizePx)("sm");
8
- var md = (0, textInputIconSize_1.getTextInputIconSizePx)("md");
9
- var lg = (0, textInputIconSize_1.getTextInputIconSizePx)("lg");
10
- expect(xs).toBeLessThan(sm);
11
- expect(sm).toBeLessThan(md);
12
- expect(md).toBeLessThan(lg);
13
- });
14
- it("defaults to md for missing or unknown size", function () {
15
- expect((0, textInputIconSize_1.getTextInputIconSizePx)(undefined)).toBe(18);
16
- expect((0, textInputIconSize_1.getTextInputIconSizePx)("nope")).toBe(18);
17
- });
18
- });
19
- describe("getTextInputIconWrapperSx", function () {
20
- it("includes the resolved pixel size in svg rules for xs", function () {
21
- var sx = (0, textInputIconSize_1.getTextInputIconWrapperSx)("xs");
22
- var svg = sx["& > svg, & > * svg, & svg"];
23
- expect(svg).toBeDefined();
24
- expect(svg === null || svg === void 0 ? void 0 : svg.width).toContain("14");
25
- expect(svg === null || svg === void 0 ? void 0 : svg.height).toContain("14");
26
- });
27
- });
@@ -1 +0,0 @@
1
- import "@testing-library/jest-dom";
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var react_2 = require("@testing-library/react");
19
- require("@testing-library/jest-dom");
20
- var react_3 = require("@chakra-ui/react");
21
- var AccountCard_1 = __importDefault(require("./AccountCard"));
22
- jest.mock("../../Theme/useCustomTheme", function () { return ({
23
- useCustomTheme: function () { return ({
24
- colors: {
25
- background: { 50: "#fafafa", 100: "#f5f5f5", 500: "#fff" },
26
- boxborder: { 300: "#e2e8f0" },
27
- gray: { 200: "#eee", 700: "#333" },
28
- primary: { 300: "#90cdf4", 500: "#3182ce" },
29
- red: { 600: "#e53e3e" },
30
- blue: { 600: "#3182ce" },
31
- text: {},
32
- },
33
- }); },
34
- }); });
35
- var mockAccount = {
36
- id: "1",
37
- name: "Test Account",
38
- email: "test@example.com",
39
- };
40
- var defaultProps = {
41
- account: mockAccount,
42
- index: 0,
43
- onDelete: jest.fn(),
44
- onOpen: jest.fn(),
45
- };
46
- var renderCard = function (ui) {
47
- return (0, react_2.render)(react_1.default.createElement(react_3.ChakraProvider, null, ui));
48
- };
49
- describe("AccountCard – permissions", function () {
50
- it("renders the delete icon when isDeletable is true (default)", function () {
51
- renderCard(react_1.default.createElement(AccountCard_1.default, __assign({}, defaultProps)));
52
- expect(react_2.screen.getByLabelText("Delete")).toBeInTheDocument();
53
- });
54
- it("hides the delete icon when isDeletable is false", function () {
55
- renderCard(react_1.default.createElement(AccountCard_1.default, __assign({}, defaultProps, { isDeletable: false })));
56
- expect(react_2.screen.queryByLabelText("Delete")).not.toBeInTheDocument();
57
- });
58
- it("renders the open (ExternalLink) icon regardless of isDeletable", function () {
59
- renderCard(react_1.default.createElement(AccountCard_1.default, __assign({}, defaultProps, { isDeletable: false })));
60
- expect(react_2.screen.getByLabelText("Open")).toBeInTheDocument();
61
- });
62
- it("calls onDelete when delete icon is clicked and isDeletable is true", function () {
63
- var onDelete = jest.fn();
64
- renderCard(react_1.default.createElement(AccountCard_1.default, __assign({}, defaultProps, { onDelete: onDelete, isDeletable: true })));
65
- react_2.fireEvent.click(react_2.screen.getByLabelText("Delete"));
66
- expect(onDelete).toHaveBeenCalledWith(mockAccount);
67
- });
68
- });
@@ -1 +0,0 @@
1
- import "@testing-library/jest-dom";
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var react_2 = require("@testing-library/react");
8
- require("@testing-library/jest-dom");
9
- var react_3 = require("@chakra-ui/react");
10
- var KanbanActions_1 = __importDefault(require("./KanbanActions"));
11
- jest.mock("../../../Theme/useCustomTheme", function () { return ({
12
- useCustomTheme: function () { return ({
13
- colors: {
14
- text: { 500: "#555" },
15
- primary: { 500: "#3182ce" },
16
- },
17
- }); },
18
- }); });
19
- jest.mock("../../Select/Select", function () { return ({
20
- __esModule: true,
21
- default: function (_a) {
22
- var placeholder = _a.placeholder;
23
- return react_1.default.createElement("div", { "data-testid": "mock-select" }, placeholder);
24
- },
25
- }); });
26
- jest.mock("../../Divider/Divider", function () { return ({
27
- __esModule: true,
28
- default: function () { return react_1.default.createElement("div", { "data-testid": "mock-divider" }); },
29
- }); });
30
- var options = [{ id: "1", label: "Open" }];
31
- var renderActions = function (ui) {
32
- return (0, react_2.render)(react_1.default.createElement(react_3.ChakraProvider, null, ui));
33
- };
34
- describe("KanbanActions", function () {
35
- it("renders Edit Layout and Create New as buttons", function () {
36
- renderActions(react_1.default.createElement(KanbanActions_1.default, { options: options, onEdit: jest.fn(), onCreate: jest.fn() }));
37
- expect(react_2.screen.getByRole("button", { name: /edit layout/i })).toBeInTheDocument();
38
- expect(react_2.screen.getByRole("button", { name: /create new/i })).toBeInTheDocument();
39
- });
40
- it("invokes onEdit and onCreate when buttons are clicked", function () {
41
- var onEdit = jest.fn();
42
- var onCreate = jest.fn();
43
- renderActions(react_1.default.createElement(KanbanActions_1.default, { options: options, onEdit: onEdit, onCreate: onCreate }));
44
- react_2.fireEvent.click(react_2.screen.getByRole("button", { name: /edit layout/i }));
45
- react_2.fireEvent.click(react_2.screen.getByRole("button", { name: /create new/i }));
46
- expect(onEdit).toHaveBeenCalledTimes(1);
47
- expect(onCreate).toHaveBeenCalledTimes(1);
48
- });
49
- });
@@ -1 +0,0 @@
1
- import "@testing-library/jest-dom";