@voxel51/voodo 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/components/Button/Button.d.ts +15 -1
  2. package/dist/components/Button/Button.d.ts.map +1 -1
  3. package/dist/components/DataTable/DataTable.d.ts +115 -0
  4. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  5. package/dist/components/DataTable/index.d.ts +2 -0
  6. package/dist/components/DataTable/index.d.ts.map +1 -0
  7. package/dist/components/Drawer/Drawer.d.ts +24 -8
  8. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  9. package/dist/components/Drawer/index.d.ts +1 -1
  10. package/dist/components/Drawer/index.d.ts.map +1 -1
  11. package/dist/components/Dropdown/DropdownTrigger.d.ts +25 -9
  12. package/dist/components/Dropdown/DropdownTrigger.d.ts.map +1 -1
  13. package/dist/components/Icons/Icon.d.ts.map +1 -1
  14. package/dist/components/Icons/icons.d.ts +1 -0
  15. package/dist/components/Icons/icons.d.ts.map +1 -1
  16. package/dist/components/OverflowRow/OverflowRow.d.ts +49 -0
  17. package/dist/components/OverflowRow/OverflowRow.d.ts.map +1 -0
  18. package/dist/components/OverflowRow/index.d.ts +2 -0
  19. package/dist/components/OverflowRow/index.d.ts.map +1 -0
  20. package/dist/components/Popover/Popover.d.ts +7 -0
  21. package/dist/components/Popover/Popover.d.ts.map +1 -1
  22. package/dist/components/Sheet/Sheet.d.ts +6 -0
  23. package/dist/components/Sheet/Sheet.d.ts.map +1 -1
  24. package/dist/components/Stack/Stack.d.ts +15 -2
  25. package/dist/components/Stack/Stack.d.ts.map +1 -1
  26. package/dist/components/Table/Table.d.ts +6 -2
  27. package/dist/components/Table/Table.d.ts.map +1 -1
  28. package/dist/components/Text/Text.d.ts +9 -0
  29. package/dist/components/Text/Text.d.ts.map +1 -1
  30. package/dist/components/TextAction/TextAction.d.ts +18 -1
  31. package/dist/components/TextAction/TextAction.d.ts.map +1 -1
  32. package/dist/components/Tooltip/ActionTooltip.d.ts +17 -0
  33. package/dist/components/Tooltip/ActionTooltip.d.ts.map +1 -0
  34. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  35. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  36. package/dist/components/Tooltip/TooltipLabel.d.ts +28 -0
  37. package/dist/components/Tooltip/TooltipLabel.d.ts.map +1 -0
  38. package/dist/components/Tooltip/index.d.ts +1 -0
  39. package/dist/components/Tooltip/index.d.ts.map +1 -1
  40. package/dist/components/index.d.ts +2 -0
  41. package/dist/components/index.d.ts.map +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.ts +9 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +5122 -4383
  47. package/dist/index.js.map +1 -1
  48. package/dist/styles/collapse.d.ts +13 -0
  49. package/dist/styles/collapse.d.ts.map +1 -0
  50. package/dist/types/icons.d.ts +2 -0
  51. package/dist/types/icons.d.ts.map +1 -1
  52. package/dist/util/breakpoints.d.ts +37 -0
  53. package/dist/util/breakpoints.d.ts.map +1 -0
  54. package/dist/util/compact.d.ts +31 -0
  55. package/dist/util/compact.d.ts.map +1 -0
  56. package/dist/util/useClippedItems.d.ts +31 -0
  57. package/dist/util/useClippedItems.d.ts.map +1 -0
  58. package/dist/util/useCompactRow.d.ts +40 -0
  59. package/dist/util/useCompactRow.d.ts.map +1 -0
  60. package/dist/util/useElementSize.d.ts.map +1 -1
  61. package/dist/util/useMediaQuery.d.ts +17 -0
  62. package/dist/util/useMediaQuery.d.ts.map +1 -0
  63. package/dist/util/useOverflowFit.d.ts +57 -0
  64. package/dist/util/useOverflowFit.d.ts.map +1 -0
  65. package/dist/util/useScrollEdges.d.ts +12 -0
  66. package/dist/util/useScrollEdges.d.ts.map +1 -0
  67. package/dist/voodo.css +1 -1
  68. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Hides a control's label below a breakpoint: `true` or `"lg"` below 1024px,
3
+ * `"sm"` below 640px, `"always"` at every width, `"auto"` while the enclosing
4
+ * row is compact (see `useOverflowRowCompact`).
5
+ */
6
+ export type Collapse = boolean | "sm" | "lg" | "always" | "auto";
7
+ /** Classes for a collapsible label; `undefined` is a label always shown. */
8
+ export default function collapseStyles(collapse: true | "sm" | "lg" | "always" | undefined): string;
9
+ /** A collapse with `"auto"` settled by whether its row is compact. */
10
+ export declare function resolveCollapse(collapse: Collapse | undefined, compact: boolean): Exclude<Collapse, "auto"> | undefined;
11
+ /** Whether a settled collapse hides its label at the current window width. */
12
+ export declare function useLabelHidden(collapse: Exclude<Collapse, "auto"> | undefined): boolean;
13
+ //# sourceMappingURL=collapse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapse.d.ts","sourceRoot":"","sources":["../../src/styles/collapse.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAYjE,4EAA4E;AAC5E,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,GAClD,MAAM,CAIR;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,CAEvC;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,GAC9C,OAAO,CAQT"}
@@ -28,6 +28,7 @@ export declare const IconName: {
28
28
  readonly ChevronRight: "ChevronRight";
29
29
  readonly ChevronTop: "ChevronTop";
30
30
  readonly Circle: "Circle";
31
+ readonly CirclePlay: "CirclePlay";
31
32
  readonly CircleUser: "CircleUser";
32
33
  readonly Close: "Close";
33
34
  readonly Cloud: "Cloud";
@@ -142,6 +143,7 @@ export declare namespace IconName {
142
143
  type ChevronRight = typeof IconName.ChevronRight;
143
144
  type ChevronTop = typeof IconName.ChevronTop;
144
145
  type Circle = typeof IconName.Circle;
146
+ type CirclePlay = typeof IconName.CirclePlay;
145
147
  type CircleUser = typeof IconName.CircleUser;
146
148
  type Close = typeof IconName.Close;
147
149
  type Cloud = typeof IconName.Cloud;
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/types/icons.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHX,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,EAAE,CAAC;AAErE,yBAAiB,QAAQ,CAAC;IACxB,KAAY,QAAQ,GAAG,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAChD,KAAY,GAAG,GAAG,OAAO,QAAQ,CAAC,GAAG,CAAC;IACtC,KAAY,EAAE,GAAG,OAAO,QAAQ,CAAC,EAAE,CAAC;IACpC,KAAY,QAAQ,GAAG,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAChD,KAAY,SAAS,GAAG,OAAO,QAAQ,CAAC,SAAS,CAAC;IAClD,KAAY,SAAS,GAAG,OAAO,QAAQ,CAAC,SAAS,CAAC;IAClD,KAAY,UAAU,GAAG,OAAO,QAAQ,CAAC,UAAU,CAAC;IACpD,KAAY,OAAO,GAAG,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC9C,KAAY,YAAY,GAAG,OAAO,QAAQ,CAAC,YAAY,CAAC;IACxD,KAAY,UAA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U,GAAG,OAAO,QAAQ,CAAC,UAAU,CAAC;IACpD,KAAY,GAAG,GAAG,OAAO,QAAQ,CAAC,GAAG,CAAC;CACvC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /** The width breakpoints VOODO's responsive props use: Tailwind's. */
2
+ export declare const Breakpoint: {
3
+ readonly Sm: "sm";
4
+ readonly Md: "md";
5
+ readonly Lg: "lg";
6
+ readonly Xl: "xl";
7
+ };
8
+ export type Breakpoint = `${(typeof Breakpoint)[keyof typeof Breakpoint]}`;
9
+ /** Each breakpoint's width in pixels: a window this wide or wider is past it. */
10
+ export declare const BREAKPOINT_WIDTHS: Record<Breakpoint, number>;
11
+ /**
12
+ * The media query for windows narrower than a breakpoint, as CSS writes it:
13
+ * `"sm"` gives `"(max-width: 639.98px)"`, which also fits a CSS-in-JS
14
+ * `@media` key.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const sx = { [`@media ${belowBreakpoint("sm")}`]: { padding: 0 } };
19
+ * ```
20
+ *
21
+ * @param breakpoint `"sm"` (640px), `"md"` (768px), `"lg"` (1024px) or `"xl"` (1280px).
22
+ */
23
+ export declare const belowBreakpoint: (breakpoint: Breakpoint) => string;
24
+ /**
25
+ * Hook that reports whether the window is narrower than a breakpoint, and
26
+ * re-renders when that changes. `useBelowBreakpoint("sm")` is a phone.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * const phone = useBelowBreakpoint("sm");
31
+ * return phone ? <PhoneLayout /> : <Layout />;
32
+ * ```
33
+ *
34
+ * @param breakpoint `"sm"` (640px), `"md"` (768px), `"lg"` (1024px) or `"xl"` (1280px).
35
+ */
36
+ export declare const useBelowBreakpoint: (breakpoint: Breakpoint) => boolean;
37
+ //# sourceMappingURL=breakpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/util/breakpoints.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,EAAE,CAAC;AAE3E,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAKxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,UAAU,KAAG,MACC,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,UAAU,KAAG,OAChB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /** How a row wants its items drawn so they fit: see {@link useOverflowRowFit}. */
2
+ export interface OverflowRowFit {
3
+ /** Items show their icon alone, named by a tooltip. */
4
+ compact: boolean;
5
+ /** Labels are cut to this width with an ellipsis; `null` for no limit. */
6
+ labelMax: number | null;
7
+ }
8
+ /** A row with room for every item as it is. */
9
+ export declare const FULL_FIT: OverflowRowFit;
10
+ /** Marks the label of an action whose row may shorten it. */
11
+ export declare const COLLAPSE_LABEL_ATTR = "data-collapse-label";
12
+ /**
13
+ * How the items of a row should render to fit. {@link OverflowRow} provides
14
+ * it; a row that fits its own items with `useOverflowFit` or `useCompactRow`
15
+ * provides their `context`.
16
+ */
17
+ export declare const OverflowRowCompactContext: import('react').Context<OverflowRowFit>;
18
+ /** How the enclosing row wants its items drawn; full inside an overflow menu. */
19
+ export declare const useOverflowRowFit: () => OverflowRowFit;
20
+ /**
21
+ * Whether the enclosing row wants its items compact (icon-only, with a
22
+ * tooltip) to fit more of them. Always `false` inside an overflow menu.
23
+ */
24
+ export declare const useOverflowRowCompact: () => boolean;
25
+ /**
26
+ * The widest label that still lets a row fit: cutting every label wider than
27
+ * it to that width saves `deficit` pixels, widest labels first. `null` when
28
+ * that width would fall below `min`, where the row goes icon-only instead.
29
+ */
30
+ export declare function capLabels(labels: number[], deficit: number, min: number): number | null;
31
+ //# sourceMappingURL=compact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../src/util/compact.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,+CAA+C;AAC/C,eAAO,MAAM,QAAQ,EAAE,cAAmD,CAAC;AAE3E,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yCACG,CAAC;AAE1C,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,QAAO,cACE,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,OACM,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAWf"}
@@ -0,0 +1,31 @@
1
+ /** Options for {@link useClippedItems}. */
2
+ export interface UseClippedItemsOptions {
3
+ /** Where the visible part of the row ends, if not at its right edge: controls held over its end. */
4
+ end?: HTMLElement | null;
5
+ /** The key of an item to scroll into the visible part first, such as the active tab. */
6
+ activeKey?: string;
7
+ /** Changes when the items do, so they are observed again. */
8
+ count?: number;
9
+ }
10
+ /**
11
+ * Hook that reports which items of a horizontally scrolling row lie outside
12
+ * its visible part, so a menu can offer them, as a browser's tab list does.
13
+ * Items are the row's children with a `data-clip-key` attribute; the active
14
+ * item is scrolled into view first.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const [row, setRow] = useState<HTMLElement | null>(null);
19
+ * const clipped = useClippedItems(row, { activeKey: active, count: tabs.length });
20
+ * return (
21
+ * <div ref={setRow} className="flex overflow-hidden">
22
+ * {tabs.map((t) => <Tab key={t.id} data-clip-key={t.id} />)}
23
+ * </div>
24
+ * );
25
+ * ```
26
+ *
27
+ * @param row The scrolling row, or `null` before it mounts.
28
+ * @param options See {@link UseClippedItemsOptions}.
29
+ */
30
+ export declare function useClippedItems(row: HTMLElement | null, { end, activeKey, count }?: UseClippedItemsOptions): string[];
31
+ //# sourceMappingURL=useClippedItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClippedItems.d.ts","sourceRoot":"","sources":["../../src/util/useClippedItems.ts"],"names":[],"mappings":"AAEA,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,oGAAoG;IACpG,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,WAAW,GAAG,IAAI,EACvB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAE,sBAA2B,GACrD,MAAM,EAAE,CAyCV"}
@@ -0,0 +1,40 @@
1
+ import { OverflowRowFit } from './compact';
2
+ /** Options for {@link useCompactRow}. */
3
+ export interface UseCompactRowOptions {
4
+ /** The narrowest a label is cut to before the row goes compact, in pixels. Default `40`. */
5
+ minLabel?: number;
6
+ }
7
+ /** Return value of {@link useCompactRow}. */
8
+ export interface UseCompactRowReturn {
9
+ /** Callback ref for the row: a single-line flex container. */
10
+ ref: (el: HTMLElement | null) => void;
11
+ /** Whether the row's parts should render compact (icon-only). */
12
+ compact: boolean;
13
+ /** The width labels are cut to, or `null`. */
14
+ labelMax: number | null;
15
+ /** `compact` and `labelMax` together, for `OverflowRowCompactContext`. */
16
+ context: OverflowRowFit;
17
+ }
18
+ /**
19
+ * Hook that works out how a single-line flex row's parts shrink so they do not
20
+ * overlap: first the labels marked `data-collapse-label` (as `collapse="auto"`
21
+ * actions mark theirs) are cut, widest first, down to `minLabel`; past that
22
+ * the parts go compact (icon-only). Back to full once the row is as wide as
23
+ * they need. Unlike `useOverflowFit`, nothing leaves the row. Provide
24
+ * `context` through `OverflowRowCompactContext`. A wrapping row never shrinks.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const row = useCompactRow();
29
+ * return (
30
+ * <Stack ref={row.ref} orientation="row">
31
+ * <Breadcrumb />
32
+ * <OverflowRowCompactContext.Provider value={row.context}>
33
+ * <Actions />
34
+ * </OverflowRowCompactContext.Provider>
35
+ * </Stack>
36
+ * );
37
+ * ```
38
+ */
39
+ export declare function useCompactRow({ minLabel, }?: UseCompactRowOptions): UseCompactRowReturn;
40
+ //# sourceMappingURL=useCompactRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCompactRow.d.ts","sourceRoot":"","sources":["../../src/util/useCompactRow.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0EAA0E;IAC1E,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAa,GACd,GAAE,oBAAyB,GAAG,mBAAmB,CAgFjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useElementSize.d.ts","sourceRoot":"","sources":["../../src/util/useElementSize.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAgBrD"}
1
+ {"version":3,"file":"useElementSize.d.ts","sourceRoot":"","sources":["../../src/util/useElementSize.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAkBrD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Hook that reports whether a CSS media query matches, and re-renders when
3
+ * that changes. `false` where there is no `window` (server rendering), and
4
+ * for a `null` query, which subscribes to nothing.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * function Toolbar() {
9
+ * const narrow = useMediaQuery("(max-width: 639.98px)");
10
+ * return narrow ? <CompactToolbar /> : <FullToolbar />;
11
+ * }
12
+ * ```
13
+ *
14
+ * @param query A media query, as written in CSS, or `null` for none.
15
+ */
16
+ export declare function useMediaQuery(query: string | null): boolean;
17
+ //# sourceMappingURL=useMediaQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../src/util/useMediaQuery.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAoB3D"}
@@ -0,0 +1,57 @@
1
+ import { OverflowRowFit } from './compact';
2
+ /** Options for {@link useOverflowFit}. */
3
+ export interface UseOverflowFitOptions {
4
+ /** Space between items, in pixels. Default `4`. */
5
+ gap?: number;
6
+ /**
7
+ * Room kept for an overflow control when some items do not fit, in pixels.
8
+ * `0` when the control sits outside the measured container. Default `28`.
9
+ */
10
+ reserve?: number;
11
+ /**
12
+ * Lets the items shrink before any leave: their labels (marked
13
+ * `data-collapse-label`, as `collapse="auto"` actions mark theirs) are cut,
14
+ * widest first, down to `minLabel`; past that the items go compact
15
+ * (icon-only). Default `false`.
16
+ */
17
+ compactable?: boolean;
18
+ /** The narrowest a label is cut to before items go compact, in pixels. Default `40`. */
19
+ minLabel?: number;
20
+ }
21
+ /** Return value of {@link useOverflowFit}. */
22
+ export interface UseOverflowFitReturn {
23
+ /** Callback ref for the container whose width the items share. */
24
+ ref: (el: HTMLElement | null) => void;
25
+ /** Callback ref for the rendered item with `key`, which measures it. */
26
+ itemRef: (key: string) => (el: HTMLElement | null) => void;
27
+ /** How many of the items, from the first, fit in the container. */
28
+ fit: number;
29
+ /** Whether the items should render compact; only with `compactable`. */
30
+ compact: boolean;
31
+ /** The width labels are cut to, or `null`; only with `compactable`. */
32
+ labelMax: number | null;
33
+ /** `compact` and `labelMax` together, for `OverflowRowCompactContext`. */
34
+ context: OverflowRowFit;
35
+ }
36
+ /**
37
+ * Hook that works out how many items, in priority order, fit side by side in a
38
+ * container, so the rest can move into a "more" menu. Render the first `fit`
39
+ * items with `itemRef(key)`; every item is rendered once first, to be measured.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * const { ref, itemRef, fit } = useOverflowFit(actions.map((a) => a.id));
44
+ * return (
45
+ * <div ref={ref} className="flex min-w-0 flex-1 gap-1">
46
+ * {actions.slice(0, fit).map((a) => (
47
+ * <div key={a.id} ref={itemRef(a.id)}>{a.button}</div>
48
+ * ))}
49
+ * </div>
50
+ * );
51
+ * ```
52
+ *
53
+ * @param keys The items' keys, in priority order: the last ones leave first.
54
+ * @param options See {@link UseOverflowFitOptions}.
55
+ */
56
+ export declare function useOverflowFit(keys: string[], { gap, reserve, compactable, minLabel, }?: UseOverflowFitOptions): UseOverflowFitReturn;
57
+ //# sourceMappingURL=useOverflowFit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOverflowFit.d.ts","sourceRoot":"","sources":["../../src/util/useOverflowFit.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAGxB,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,wEAAwE;IACxE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0EAA0E;IAC1E,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EAAE,EACd,EACE,GAAO,EACP,OAAY,EACZ,WAAmB,EACnB,QAAa,GACd,GAAE,qBAA0B,GAC5B,oBAAoB,CAqItB"}
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from 'react';
2
+ /**
3
+ * Hook that fades the edge of a sideways-scrolling element on each side which
4
+ * has more content beyond it, so the row shows that it scrolls.
5
+ *
6
+ * @returns `ref` to attach to the scrolling element, and `style` holding the fade.
7
+ */
8
+ export declare function useScrollEdges(): {
9
+ ref: (el: HTMLElement | null) => void;
10
+ style: CSSProperties | undefined;
11
+ };
12
+ //# sourceMappingURL=useScrollEdges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollEdges.d.ts","sourceRoot":"","sources":["../../src/util/useScrollEdges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiC,MAAM,OAAO,CAAC;AAY1E;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI;IAChC,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAClC,CA0CA"}