@deskpro/deskpro-ui 3.0.1 → 3.1.2

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 (52) hide show
  1. package/dist/cjs/components/Drilldown/Drilldown.js +91 -38
  2. package/dist/cjs/components/Drilldown/Drilldown.js.map +1 -1
  3. package/dist/cjs/components/Drilldown/DrilldownResetButton.js +1 -1
  4. package/dist/cjs/components/Drilldown/DrilldownResetButton.js.map +1 -1
  5. package/dist/cjs/components/Drilldown/index.js +3 -3
  6. package/dist/cjs/components/Drilldown/index.js.map +1 -1
  7. package/dist/cjs/components/Drilldown/storyDataFlat.js +1108 -0
  8. package/dist/cjs/components/Drilldown/storyDataFlat.js.map +1 -0
  9. package/dist/cjs/components/Drilldown/{storyData.js → storyDataTree.js} +3 -3
  10. package/dist/cjs/components/Drilldown/storyDataTree.js.map +1 -0
  11. package/dist/cjs/components/Drilldown/styles.js +3 -2
  12. package/dist/cjs/components/Drilldown/styles.js.map +1 -1
  13. package/dist/cjs/components/Drilldown/types.js +31 -3
  14. package/dist/cjs/components/Drilldown/types.js.map +1 -1
  15. package/dist/cjs/components/Drilldown/useUpdateItems.js +42 -13
  16. package/dist/cjs/components/Drilldown/useUpdateItems.js.map +1 -1
  17. package/dist/cjs/components/Drilldown/utility.js +50 -17
  18. package/dist/cjs/components/Drilldown/utility.js.map +1 -1
  19. package/dist/cjs/components/Dropdown/Dropdown.js +9 -9
  20. package/dist/cjs/components/Dropdown/Dropdown.js.map +1 -1
  21. package/dist/cjs/components/LabelTag/TagCircle.js +1 -3
  22. package/dist/cjs/components/LabelTag/TagCircle.js.map +1 -1
  23. package/dist/cjs/components/index.js +1 -0
  24. package/dist/cjs/components/index.js.map +1 -1
  25. package/dist/deskpro-ui.d.ts +514 -0
  26. package/dist/esm/components/Drilldown/Drilldown.js +93 -40
  27. package/dist/esm/components/Drilldown/Drilldown.js.map +1 -1
  28. package/dist/esm/components/Drilldown/DrilldownResetButton.js +1 -1
  29. package/dist/esm/components/Drilldown/DrilldownResetButton.js.map +1 -1
  30. package/dist/esm/components/Drilldown/index.js +2 -2
  31. package/dist/esm/components/Drilldown/index.js.map +1 -1
  32. package/dist/esm/components/Drilldown/storyDataFlat.js +1105 -0
  33. package/dist/esm/components/Drilldown/storyDataFlat.js.map +1 -0
  34. package/dist/esm/components/Drilldown/{storyData.js → storyDataTree.js} +3 -3
  35. package/dist/esm/components/Drilldown/storyDataTree.js.map +1 -0
  36. package/dist/esm/components/Drilldown/styles.js +3 -2
  37. package/dist/esm/components/Drilldown/styles.js.map +1 -1
  38. package/dist/esm/components/Drilldown/types.js +22 -1
  39. package/dist/esm/components/Drilldown/types.js.map +1 -1
  40. package/dist/esm/components/Drilldown/useUpdateItems.js +42 -14
  41. package/dist/esm/components/Drilldown/useUpdateItems.js.map +1 -1
  42. package/dist/esm/components/Drilldown/utility.js +44 -13
  43. package/dist/esm/components/Drilldown/utility.js.map +1 -1
  44. package/dist/esm/components/Dropdown/Dropdown.js +9 -9
  45. package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
  46. package/dist/esm/components/LabelTag/TagCircle.js +2 -4
  47. package/dist/esm/components/LabelTag/TagCircle.js.map +1 -1
  48. package/dist/esm/components/index.js +1 -0
  49. package/dist/esm/components/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/dist/cjs/components/Drilldown/storyData.js.map +0 -1
  52. package/dist/esm/components/Drilldown/storyData.js.map +0 -1
@@ -97,9 +97,7 @@ const TagCircleLetter = ({ color, name, size, className }) => {
97
97
  displayBorderColor = randomColors.borderColor;
98
98
  displayBackgroundColor = randomColors.backgroundColor;
99
99
  }
100
- return (React.createElement(CircleLetterContainer, { title: name, backgroundColor: displayBackgroundColor, borderColor: displayBorderColor, size: size, className: className },
101
- size < 20 && React.createElement(Typography_1.P10, null, letterDisplay),
102
- size >= 20 && React.createElement(Typography_1.P6, null, letterDisplay)));
100
+ return (React.createElement(CircleLetterContainer, { title: name, backgroundColor: displayBackgroundColor, borderColor: displayBorderColor, size: size, className: className }, size < 26 ? (React.createElement(Typography_1.TSpan, { overflow: "ellipsis", type: "p12" }, letterDisplay)) : (React.createElement(Typography_1.TSpan, { type: "p6", overflow: "ellipsis" }, letterDisplay))));
103
101
  };
104
102
  exports.TagCircleLetter = TagCircleLetter;
105
103
  //# sourceMappingURL=TagCircle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TagCircle.js","sourceRoot":"","sources":["../../../../src/components/LabelTag/TagCircle.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,yDAAqD;AACrD,kCAAwC;AAGxC,8CAAwC;AACxC,+DAAiE;AACjE,+CAAgD;AAEhD,MAAM,mBAAmB,GAAG,2BAAM,CAAC,GAAG,CAKpC;;aAEW,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;;WAGlD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;sBAIjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe;sBAChC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;gBAElC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;eACnB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;YACrB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;WACnB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;;CAE5B,CAAC;AAEF,MAAM,qBAAqB,GAAG,2BAAM,CAAC,GAAG,CAItC;;;;;WAKS,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;sBAIjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe;sBAChC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;YAEtC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CAAC,CAAC,CACF,oBAAC,kBAAK,IAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAC,UAAU,IACjC,aAAa,CACR,CACT,CACqB,CACzB,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,eAAe,mBAyC1B"}
@@ -24,6 +24,7 @@ __exportStar(require("./CCUserTag"), exports);
24
24
  __exportStar(require("./Checkbox"), exports);
25
25
  __exportStar(require("./Dialog"), exports);
26
26
  __exportStar(require("./Divider"), exports);
27
+ __exportStar(require("./Drilldown"), exports);
27
28
  __exportStar(require("./Dropdown"), exports);
28
29
  __exportStar(require("./Formik"), exports);
29
30
  __exportStar(require("./Icon"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,iDAA+B;AAC/B,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,kDAAgC;AAChC,yCAAuB;AACvB,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,iDAA+B;AAC/B,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,kDAAgC;AAChC,yCAAuB;AACvB,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B"}
@@ -1697,6 +1697,475 @@ export declare interface DividerProps {
1697
1697
 
1698
1698
  declare type DpCustomIconsId = "active-call" | "admin" | "advanced-filter" | "agent" | "api" | "apps-zapier" | "arrow" | "column-width" | "community" | "crown" | "deskpro" | "dot" | "drag" | "dual-view" | "email-primary" | "enter" | "export-alt" | "export" | "follow-up" | "glossary" | "google-analytics" | "grip" | "hang-up" | "helping-hand" | "im-outline" | "im-send" | "im" | "inbound-call" | "kanban-view" | "level-down" | "linked-ticket" | "location-arrow" | "merge" | "merge2" | "missed-call" | "mobile-rotate" | "organization-circle" | "outbound-call" | "read" | "record" | "sent" | "sip-address" | "sort" | "transfer-queue" | "triangle" | "warm-add" | "warm-transfer" | "webhook";
1699
1699
 
1700
+ /**
1701
+ * Wraps around any child to upgrade it to a drilldown component. If used in the
1702
+ * render props style you get access to some of the internal state of the drilldown
1703
+ * including the input props used for search
1704
+ * @public
1705
+ * @example
1706
+ * ```
1707
+ * const options = [
1708
+ * {type: "header", label: "Header"},
1709
+ * {type: "value", key: "1", label: "Value"}
1710
+ * ];
1711
+ *
1712
+ * function handleOnSelect(value: DrilldownValueType) {}
1713
+ *
1714
+ * // as children
1715
+ * <Drilldown options={options} onSelectOption={handleOnSelect}>
1716
+ * <button>click here</button>
1717
+ * </Drilldown>
1718
+ *
1719
+ * // as render props with controlled input
1720
+ * <Drilldown options={options} onSelectOption={handleOnSelect}>
1721
+ * {({searchInputProps}) =>
1722
+ * <input {...searchInputProps}/>
1723
+ * }
1724
+ * </Drilldown>
1725
+ * ```
1726
+ */
1727
+ export declare function Drilldown<T, TargetRef extends HTMLElement = any>({ type, children, options, inputValue, searchPlaceholder, placement, showInternalSearch, isLoading, usePortal, closeOnSelect, isOpen: isOpenProp, renderCreateNewOption, hideIcons, iconColumnWidth, containerWidth, containerHeight, onSelectOption, onInputChange, filterItemsCb, onFetchMore, onClear, onClose, onOpen, onInputReturn, tabProps, disabled, fetchMoreText, autoscrollText, externalLinkIcon, selectedIcon, layer, animationDuration, onDrilldown, onDrilldownAnimationEnd, onDrillupAnimationEnd, backText, }: DrilldownProps<T, TargetRef>): JSX.Element;
1728
+
1729
+ declare interface DrilldownBaseProps<T, TargetRef extends HTMLElement> {
1730
+ /** Event handler for when an option is selected */
1731
+ onSelectOption?: (item: DrilldownValueType<T>, keyPathToSelectedItem: string[]) => void;
1732
+ /** Event handler that it called when triggering a drilldown, before animation is run */
1733
+ onDrilldown?: (item: DrilldownValueType<T>, pathToSelectedItem: PathToSelectedItem) => Promise<void>;
1734
+ /** Control over whether the drilldown is open - default uncontrolled */
1735
+ isOpen?: boolean;
1736
+ /** PopperJS placement option. Defaults to "bottom-start" */
1737
+ placement?: Placement;
1738
+ /** Wether to render the drilldown in a portal. Default true */
1739
+ usePortal?: boolean;
1740
+ /** The input value to render in the search box */
1741
+ inputValue?: string;
1742
+ /** Show a loading indicator */
1743
+ isLoading?: boolean;
1744
+ /** Show an internal search input for filtering options. The Drilldown does not
1745
+ * do any filtering itself
1746
+ */
1747
+ showInternalSearch?: boolean;
1748
+ /** Whether to disable the drilldown */
1749
+ disabled?: boolean;
1750
+ /** Whether subitems are rendered in an expanding or non-expanding style */
1751
+ expandingDrillDown?: boolean;
1752
+ /** Placeholder for search input box */
1753
+ searchPlaceholder?: string;
1754
+ /** Whether the drilldown should close on selections. default true */
1755
+ closeOnSelect?: boolean;
1756
+ /** Whether to hide item's icon for the whole list */
1757
+ hideIcons?: boolean;
1758
+ /** The width of the column in which icons are rendered */
1759
+ iconColumnWidth?: number;
1760
+ /** Add in custom width to the drilldown options container */
1761
+ containerWidth?: number;
1762
+ /** Add in custom height to the drilldown options container */
1763
+ containerHeight?: number;
1764
+ /** Event handler for when the user requests more options.
1765
+ * For use with paginated options */
1766
+ onFetchMore?: () => void;
1767
+ /** Event handler for when the drilldown closes */
1768
+ onClose?: () => void;
1769
+ /** Event handler for when the drilldown opens */
1770
+ onOpen?: () => void;
1771
+ /** The target for the drilldown. Either a normal ReactNode or a render
1772
+ * prop with additional state from the drilldown */
1773
+ children: ((props: DrilldownTargetProps<TargetRef>) => JSX.Element) | JSX.Element;
1774
+ /** Render the create new option - no default implementation and renders as a
1775
+ * sticky footer above the normal sticky footer
1776
+ */
1777
+ onCreateNewOption?: () => void;
1778
+ renderCreateNewOption?: (active: boolean, onSelect: () => void) => ReactNode;
1779
+ /** Props for rendering tabs within the drilldown */
1780
+ tabProps?: DrilldownTabProps;
1781
+ /** The text to show for the fetch more button */
1782
+ fetchMoreText: ReactNode;
1783
+ /** The text to show for the autoscroll button */
1784
+ autoscrollText: ReactNode;
1785
+ externalLinkIcon: AnyIcon;
1786
+ selectedIcon: AnyIcon;
1787
+ /** Event handler that returns input value after enter has been pressed */
1788
+ onInputReturn?: (inputValue: string) => void;
1789
+ /** The zIndex Layer that the drilldown will be rendered at. Defaults to: popover */
1790
+ layer?: keyof Layers;
1791
+ /** the time it takes to animate sliding between lists. Defaults to 0.3s */
1792
+ animationDuration?: number;
1793
+ /** Event handler that it called when triggering a drillup, after animation was run */
1794
+ onDrillupAnimationEnd?: (pathToSelectedItem: PathToSelectedItem) => Promise<void>;
1795
+ /** The text to show for the back button */
1796
+ backText: ReactNode;
1797
+ }
1798
+
1799
+ /**
1800
+ * @public
1801
+ */
1802
+ export declare const DrilldownContainer: StyledComponent<ForwardRefComponent<HTMLDivElement, HTMLMotionProps<"div">>, DefaultTheme, {
1803
+ "data-dp-name": string;
1804
+ "data-dp-ident"?: string | undefined;
1805
+ } & {
1806
+ containerWidth?: number | undefined;
1807
+ containerHeight?: number | undefined;
1808
+ layer: keyof Layers;
1809
+ }, keyof {
1810
+ "data-dp-name": string;
1811
+ "data-dp-ident"?: string | undefined;
1812
+ }>;
1813
+
1814
+ /**
1815
+ * @public
1816
+ */
1817
+ export declare const DrilldownCreateNewOption: ({ text, icon, onClick, resetButton, iconColor, active, }: DrilldownCreateNewOptionProps) => JSX.Element;
1818
+
1819
+ /**
1820
+ * @public
1821
+ */
1822
+ export declare interface DrilldownCreateNewOptionProps {
1823
+ text?: ReactNode;
1824
+ icon: AnyIcon;
1825
+ onClick: () => void;
1826
+ resetButton?: boolean;
1827
+ iconColor?: ThemeColorKey;
1828
+ active: boolean;
1829
+ }
1830
+
1831
+ /**
1832
+ * @public
1833
+ */
1834
+ export declare interface DrilldownDivider {
1835
+ type: "divider";
1836
+ }
1837
+
1838
+ /**
1839
+ * @public
1840
+ */
1841
+ export declare interface DrilldownDividerFlat extends DrilldownDivider {
1842
+ /** Unique identifier for the parent option */
1843
+ parentKey: string | undefined;
1844
+ }
1845
+
1846
+ /**
1847
+ * @public
1848
+ */
1849
+ export declare const DrilldownDividerItem: StyledComponent<"div", DefaultTheme, {}, never>;
1850
+
1851
+ /**
1852
+ * @public
1853
+ * Pass in a component to render if the list is empty.
1854
+ * This will usually be a NonIdeal state, see storybook examples
1855
+ */
1856
+ export declare interface DrilldownEmptyList {
1857
+ type: "emptyList";
1858
+ component: ReactNode;
1859
+ }
1860
+
1861
+ /**
1862
+ * @public
1863
+ */
1864
+ export declare interface DrilldownEmptyListFlat extends DrilldownEmptyList {
1865
+ /** Unique identifier for the parent option */
1866
+ parentKey: string | undefined;
1867
+ }
1868
+
1869
+ /**
1870
+ * @public
1871
+ */
1872
+ export declare interface DrilldownFlatProps<T, TargetRef extends HTMLElement> extends DrilldownBaseProps<T, TargetRef> {
1873
+ /** Expects options to be a flat array of type DrilldownItemFlatType<T>[]. This is easier to work with if your response data is also returned as a flat array */
1874
+ type: "flat";
1875
+ /** List of options to render */
1876
+ options: DrilldownItemFlatType<T>[];
1877
+ /** Event handler for when the "active" item changes via keyboard events */
1878
+ onActiveOptionChange?: (item: DrilldownValueFlatType<T> | null) => void;
1879
+ /** Event handler for when the "clear" event is triggered for the search input */
1880
+ onClear?: () => void;
1881
+ /** Event handler for when an option is selected */
1882
+ /** Event handler for when the search input value changes */
1883
+ onInputChange?: (input: string, pathToSelectedItem: PathToSelectedItem) => void;
1884
+ /** Callback for filtering items. This is used on drillup to re-filter the parent list based on the input string */
1885
+ filterItemsCb?: (items: DrilldownItemFlatType<T>[], input: string, prevItemsKey: string | undefined) => DrilldownItemFlatType<T>[];
1886
+ /** Event handler that it called when triggering a drilldown, after animation was run */
1887
+ onDrilldownAnimationEnd?: (item: DrilldownValueFlatType<T> | undefined, pathToSelectedItem: PathToSelectedItem) => Promise<void>;
1888
+ }
1889
+
1890
+ /**
1891
+ * @public
1892
+ */
1893
+ export declare interface DrilldownHeaderFlatType extends DrilldownHeaderType {
1894
+ /** Unique identifier for the parent option */
1895
+ parentKey: string | undefined;
1896
+ }
1897
+
1898
+ /**
1899
+ * @public
1900
+ */
1901
+ export declare const DrilldownHeaderItem: StyledComponent<"div", DefaultTheme, {}, never>;
1902
+
1903
+ /**
1904
+ * @public
1905
+ */
1906
+ export declare interface DrilldownHeaderType {
1907
+ type: "header";
1908
+ label: ReactNode;
1909
+ childLabels?: string[];
1910
+ }
1911
+
1912
+ /**
1913
+ * @public
1914
+ */
1915
+ export declare const DrilldownInternalSearchInputContainer: StyledComponent<"div", DefaultTheme, {}, never>;
1916
+
1917
+ /**
1918
+ * @public
1919
+ */
1920
+ export declare function DrilldownItem<T = unknown>({ value, active, onSelect, onSelectIcon, onClickSubItem, hideIcons, iconColumnWidth, selectedIcon, externalLinkIcon, handleDrilldown, dataKey, subItems, }: DrilldownItemProps<T>): JSX.Element;
1921
+
1922
+ /**
1923
+ * @public
1924
+ */
1925
+ export declare type DrilldownItemFlatType<T = unknown> = DrilldownValueFlatType<T> | DrilldownHeaderFlatType | DrilldownDividerFlat | DrilldownStickyHeaderFlat<T> | DrilldownStickyFooterFlat<T> | DrilldownEmptyListFlat | DrilldownLoadingFlat;
1926
+
1927
+ /**
1928
+ * @public
1929
+ */
1930
+ export declare interface DrilldownItemMeta {
1931
+ /** Whether to render as an "active" element */
1932
+ active: boolean;
1933
+ /** The current search input */
1934
+ input: string;
1935
+ }
1936
+
1937
+ /**
1938
+ * @public
1939
+ */
1940
+ export declare interface DrilldownItemProps<T = unknown> {
1941
+ onSelect?: (value: DrilldownValueType<T>) => void;
1942
+ onSelectIcon?: (value: T) => void;
1943
+ onClickSubItem?: (value: DrilldownValueType<T>) => void;
1944
+ value: DrilldownValueType<T>;
1945
+ meta: DrilldownItemMeta;
1946
+ customLabelRender?: ReactNode;
1947
+ active?: boolean;
1948
+ hideIcons?: boolean;
1949
+ iconColumnWidth?: number;
1950
+ externalLinkIcon: AnyIcon;
1951
+ selectedIcon: AnyIcon;
1952
+ handleDrilldown: (item: DrilldownValueType<T>) => Promise<void>;
1953
+ dataKey: string;
1954
+ subItems: DrilldownItemType<T>[] | undefined;
1955
+ }
1956
+
1957
+ /**
1958
+ * @public
1959
+ */
1960
+ export declare type DrilldownItemTreeType<T = unknown> = DrilldownValueTreeType<T> | DrilldownHeaderType | DrilldownDivider | DrilldownStickyHeader<T> | DrilldownStickyFooter<T> | DrilldownEmptyList | DrilldownLoading;
1961
+
1962
+ /**
1963
+ * @public
1964
+ */
1965
+ export declare type DrilldownItemType<T = unknown> = DrilldownItemTreeType<T> | DrilldownItemFlatType<T>;
1966
+
1967
+ /**
1968
+ * @public
1969
+ * Pass in a component to render if the list is loading.
1970
+ * This will usually be a <Spinner />, see storybook examples
1971
+ */
1972
+ export declare interface DrilldownLoading {
1973
+ type: "loading";
1974
+ component?: ReactNode;
1975
+ }
1976
+
1977
+ /**
1978
+ * @public
1979
+ */
1980
+ export declare interface DrilldownLoadingFlat extends DrilldownLoading {
1981
+ /** Unique identifier for the parent option */
1982
+ parentKey: string | undefined;
1983
+ }
1984
+
1985
+ /**
1986
+ * @public
1987
+ */
1988
+ export declare type DrilldownProps<T, TargetRef extends HTMLElement> = DrilldownTreeProps<T, TargetRef> | DrilldownFlatProps<T, TargetRef>;
1989
+
1990
+ /**
1991
+ * @public
1992
+ */
1993
+ export declare function drilldownRenderOptions<T = string>(options: DrilldownItemType<T>[], handleSelectOption: (value: DrilldownValueType<T>) => void, handleDrilldown: (item: DrilldownValueType<T>) => Promise<void>, handleBack: () => Promise<void>, activeItem: DrilldownValueType<T> | null, fetchMoreText: ReactNode, autoscrollText: ReactNode, selectedIcon: AnyIcon, externalLinkIcon: AnyIcon, hideIcons?: boolean, iconColumnWidth?: number): (value: DrilldownItemType<T>, index: number, array: DrilldownItemType<T>[]) => ReactNode;
1994
+
1995
+ /**
1996
+ * @public
1997
+ */
1998
+ export declare const DrilldownResetButton: ({ onClick, buttonText, undoIcon, }: DrilldownResetButtonProps) => JSX.Element;
1999
+
2000
+ declare interface DrilldownResetButtonProps {
2001
+ onClick: () => void;
2002
+ buttonText: string;
2003
+ undoIcon: AnyIcon;
2004
+ }
2005
+
2006
+ /**
2007
+ * @public
2008
+ * List of options to render as sticky options at the foot of any of the normal options
2009
+ */
2010
+ export declare interface DrilldownStickyFooter<T> {
2011
+ type: "stickyFooter";
2012
+ options: DrilldownItemType<T>[];
2013
+ }
2014
+
2015
+ /**
2016
+ * @public
2017
+ * List of options to render as sticky options at the foot of any of the normal options
2018
+ */
2019
+ export declare interface DrilldownStickyFooterFlat<T> {
2020
+ type: "stickyFooter";
2021
+ options: DrilldownItemFlatType<T>[];
2022
+ /** Unique identifier for the parent option */
2023
+ parentKey: string | undefined;
2024
+ }
2025
+
2026
+ /**
2027
+ * @public
2028
+ * List of options to render as sticky options at the foot of any of the normal options
2029
+ */
2030
+ export declare interface DrilldownStickyFooterTree<T> {
2031
+ type: "stickyFooter";
2032
+ options: DrilldownItemTreeType<T>[];
2033
+ }
2034
+
2035
+ /**
2036
+ * @public
2037
+ * List of options to render as sticky options at the head of any of the normal options
2038
+ */
2039
+ export declare interface DrilldownStickyHeader<T> {
2040
+ type: "stickyHeader";
2041
+ options: DrilldownItemType<T>[];
2042
+ }
2043
+
2044
+ /**
2045
+ * @public
2046
+ * List of options to render as sticky options at the head of any of the normal options
2047
+ */
2048
+ export declare interface DrilldownStickyHeaderFlat<T> {
2049
+ type: "stickyHeader";
2050
+ options: DrilldownItemFlatType<T>[];
2051
+ /** Unique identifier for the parent option */
2052
+ parentKey: string | undefined;
2053
+ }
2054
+
2055
+ /**
2056
+ * @public
2057
+ * List of options to render as sticky options at the head of any of the normal options
2058
+ */
2059
+ export declare interface DrilldownStickyHeaderTree<T> {
2060
+ type: "stickyHeader";
2061
+ options: DrilldownItemTreeType<T>[];
2062
+ }
2063
+
2064
+ /**
2065
+ * @public
2066
+ */
2067
+ export declare interface DrilldownTabProps {
2068
+ tabs: TabBarItemType[];
2069
+ activeTabIndex: number;
2070
+ onTabChange: (index: number) => void;
2071
+ }
2072
+
2073
+ /**
2074
+ * @public
2075
+ */
2076
+ export declare interface DrilldownTargetProps<TargetRef extends HTMLElement> {
2077
+ targetProps: HTMLAttributes<HTMLElement>;
2078
+ targetRef: Ref<TargetRef>;
2079
+ inputProps: InputHTMLAttributes<HTMLInputElement>;
2080
+ inputRef: Ref<HTMLInputElement>;
2081
+ handleOnClear?: () => void;
2082
+ active: boolean;
2083
+ }
2084
+
2085
+ /**
2086
+ * @public
2087
+ */
2088
+ export declare interface DrilldownTreeProps<T, TargetRef extends HTMLElement> extends DrilldownBaseProps<T, TargetRef> {
2089
+ /** Expects options to be a flat array of type DrilldownItemTreeType<T>[] */
2090
+ type: "tree";
2091
+ /** List of options to render */
2092
+ options: DrilldownItemTreeType<T>[];
2093
+ /** Event handler for when the "active" item changes via keyboard events */
2094
+ onActiveOptionChange?: (item: DrilldownValueTreeType<T> | null) => void;
2095
+ /** Event handler for when the "clear" event is triggered for the search input */
2096
+ onClear?: () => void;
2097
+ /** Event handler for when an option is selected */
2098
+ /** Event handler for when the search input value changes */
2099
+ onInputChange?: (input: string, pathToSelectedItem: PathToSelectedItem) => void;
2100
+ /** Callback for filtering items. This is used on drillup to re-filter the parent list based on the input string */
2101
+ filterItemsCb?: (items: DrilldownItemTreeType<T>[], input: string) => DrilldownItemTreeType<T>[];
2102
+ /** Event handler that it called when triggering a drilldown, after animation was run */
2103
+ onDrilldownAnimationEnd?: (item: DrilldownValueTreeType<T> | undefined, pathToSelectedItem: PathToSelectedItem) => Promise<void>;
2104
+ }
2105
+
2106
+ /**
2107
+ * @public
2108
+ */
2109
+ export declare const DrilldownTrigger: StyledComponent<"div", DefaultTheme, {}, never>;
2110
+
2111
+ /**
2112
+ * @public
2113
+ */
2114
+ export declare type DrilldownType = "tree" | "flat";
2115
+
2116
+ declare interface DrilldownValueBaseType<OriginalValue> {
2117
+ /** Unique identifier for the option */
2118
+ key: string;
2119
+ /** Text label for the option*/
2120
+ label: React_2.ReactNode;
2121
+ /** Discriminated union literal */
2122
+ type: "value";
2123
+ /** Show option as disabled*/
2124
+ disabled?: boolean;
2125
+ /** Description to render */
2126
+ description?: string;
2127
+ /** Icon to render */
2128
+ icon?: AnyIcon | IconProps | JSX.Element | null;
2129
+ /** Show option as selected */
2130
+ selected?: boolean;
2131
+ /** Link to render - changes behavior to open link in new browser tab */
2132
+ href?: string;
2133
+ onClickIcon?: (value: unknown) => void;
2134
+ /** Callback fired on clicking the sub menu arrow icon **/
2135
+ onClickSubItem?: (value: unknown) => void;
2136
+ /** The underlying data related to the option, for the convenience of the user */
2137
+ value: OriginalValue;
2138
+ /** The default behaviour will only open submenu on clicking th right arrow icon, this will make the whole item
2139
+ * clickable, overriding the onSelect behaviour
2140
+ */
2141
+ openSubmenuOnSelect?: boolean;
2142
+ /** Callback fired to handle fetch more scrolling for sub items */
2143
+ onFetchMoreSubItems?: () => void;
2144
+ /** Whether to show icon when a href is provided default is true */
2145
+ showHrefIcon?: boolean;
2146
+ }
2147
+
2148
+ /**
2149
+ * @public
2150
+ */
2151
+ export declare interface DrilldownValueFlatType<OriginalValue> extends DrilldownValueBaseType<OriginalValue> {
2152
+ /** Unique identifier for the parent option */
2153
+ parentKey: string | undefined;
2154
+ }
2155
+
2156
+ /**
2157
+ * @public
2158
+ */
2159
+ export declare interface DrilldownValueTreeType<OriginalValue> extends DrilldownValueBaseType<OriginalValue> {
2160
+ /** Sub options to render */
2161
+ subItems?: DrilldownItemTreeType<OriginalValue>[];
2162
+ }
2163
+
2164
+ /**
2165
+ * @public
2166
+ */
2167
+ export declare type DrilldownValueType<OriginalValue> = DrilldownValueTreeType<OriginalValue> | DrilldownValueFlatType<OriginalValue>;
2168
+
1700
2169
  /**
1701
2170
  * Wraps around any child to upgrade it to a dropdown component. If used in the
1702
2171
  * render props style you get access to some of the internal state of the dropdown
@@ -2015,6 +2484,33 @@ export declare interface FaIconAvatarProps {
2015
2484
  iconStyles?: CSSProperties;
2016
2485
  }
2017
2486
 
2487
+ /**
2488
+ * A helper function to make it easier to filter the items at the current depth
2489
+ * e.g. on search input change (see WithSearch story)
2490
+ *
2491
+ * Returns the full items array with only the deepest sub items of the path updated
2492
+ * @public
2493
+ */
2494
+ export declare function filterCurrentTreeItems<T>(items: DrilldownItemTreeType<T>[], pathToSelectedItem: {
2495
+ key: string;
2496
+ searchTerm?: string;
2497
+ }[], input: string, filterItemsCb: FilterItemsTreeCb<T>, depth?: number): DrilldownItemTreeType<T>[];
2498
+
2499
+ /**
2500
+ * @public
2501
+ */
2502
+ export declare type FilterItemsCb<T> = (items: DrilldownItemTreeType<T>[], input: string) => DrilldownItemTreeType<T>[];
2503
+
2504
+ /**
2505
+ * @public
2506
+ */
2507
+ export declare type FilterItemsFlatCb<T> = (items: DrilldownItemFlatType<T>[], input: string, parentKey?: string) => DrilldownItemFlatType<T>[];
2508
+
2509
+ /**
2510
+ * @public
2511
+ */
2512
+ export declare type FilterItemsTreeCb<T> = (items: DrilldownItemTreeType<T>[], input: string) => DrilldownItemTreeType<T>[];
2513
+
2018
2514
  /**
2019
2515
  * Wrapper around Formik's useField hook and ErrorMessage component
2020
2516
  * @public
@@ -3670,6 +4166,14 @@ export declare const paragraphStyled: {
3670
4166
  p16: FlattenInterpolation<ThemeProps<DefaultTheme>>;
3671
4167
  };
3672
4168
 
4169
+ /**
4170
+ * @public
4171
+ */
4172
+ export declare type PathToSelectedItem = {
4173
+ key: string;
4174
+ searchTerm?: string;
4175
+ }[];
4176
+
3673
4177
  /**
3674
4178
  * @public
3675
4179
  */
@@ -4594,6 +5098,16 @@ export declare const UnstyledA: StyledComponent<"a", DefaultTheme, {
4594
5098
  underline?: boolean | undefined;
4595
5099
  }, never>;
4596
5100
 
5101
+ /**
5102
+ * @public
5103
+ */
5104
+ export declare type UpdateItemsTreeCb<T> = (items: DrilldownItemTreeType<T>[]) => DrilldownItemTreeType<T>[];
5105
+
5106
+ /**
5107
+ * @public
5108
+ */
5109
+ export declare type UpdateItemTreeCb<T> = (item: DrilldownValueTreeType<T>, isSelected: boolean) => DrilldownValueTreeType<T>;
5110
+
4597
5111
  /**
4598
5112
  * @public
4599
5113
  */