@databricks/design-system 2.0.2 → 2.0.4
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.
- package/CHANGELOG.md +37 -0
- package/dist/{WizardStepContentWrapper-DnwQIMN1.js → WizardStepContentWrapper-8bs2FwRi.js} +706 -533
- package/dist/WizardStepContentWrapper-8bs2FwRi.js.map +1 -0
- package/dist/fonts/dm-mono/DMMono-Regular.woff2 +0 -0
- package/dist/fonts/dm-mono/dm-mono.css +11 -0
- package/dist/index-dark.css +323 -225
- package/dist/index-dark.mitigated.css +323 -225
- package/dist/index.css +539 -427
- package/dist/index.js +259 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mitigated.css +548 -436
- package/dist/patterns.js +3 -2
- package/dist/patterns.js.map +1 -1
- package/dist/test-utils/rtl.js +1 -1
- package/dist/test-utils/rtl.js.map +1 -1
- package/dist-types/design-system/Alert/Alert.d.ts +1 -1
- package/dist-types/design-system/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist-types/design-system/DesignSystemProvider/DesignSystemProvider.d.ts +66 -0
- package/dist-types/design-system/DesignSystemProvider/DesignTokenScopeWithEmotionTheme.d.ts +23 -0
- package/dist-types/design-system/DesignSystemProvider/index.d.ts +1 -0
- package/dist-types/design-system/Grid/Col.d.ts +1 -3
- package/dist-types/design-system/Grid/NativeCol.d.ts +10 -0
- package/dist-types/design-system/Grid/NativeGridContext.d.ts +11 -0
- package/dist-types/design-system/Grid/NativeRow.d.ts +13 -0
- package/dist-types/design-system/Grid/Row.d.ts +3 -4
- package/dist-types/design-system/Grid/grid-styling.d.ts +22 -0
- package/dist-types/design-system/Grid/gridConstants.d.ts +2 -0
- package/dist-types/design-system/Grid/index.d.ts +1 -0
- package/dist-types/design-system/Grid/rowConstants.d.ts +7 -0
- package/dist-types/design-system/Grid/types.d.ts +49 -0
- package/dist-types/design-system/Hooks/index.d.ts +1 -1
- package/dist-types/design-system/Hooks/useDesignSystemTheme.d.ts +7 -7
- package/dist-types/design-system/Icon/LegacyAntDIcon.d.ts +21 -0
- package/dist-types/design-system/Icon/index.d.ts +0 -1
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxAddButton.d.ts +4 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxCheckboxItem.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxFooter.d.ts +12 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxInput.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMenu.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMenuItem.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMultiSelectInput.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxRoot.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSectionHeader.d.ts +4 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSelectedItem.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSeparator.d.ts +4 -0
- package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxToggleButton.d.ts +8 -0
- package/dist-types/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts +8 -0
- package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useComboboxState.d.ts +6 -0
- package/dist-types/design-system/TypeaheadComboboxV2/hooks/useRestoreHighlightedOption.d.ts +18 -0
- package/dist-types/design-system/TypeaheadComboboxV2/hooks/useTypeaheadComboboxContext.d.ts +2 -0
- package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/providers/TypeaheadComboboxContext.d.ts +6 -4
- package/dist-types/design-system/_shared_/Menu/index.d.ts +1 -1
- package/dist-types/design-system/fonts.d.ts +1 -0
- package/dist-types/design-system/index.d.ts +1 -1
- package/dist-types/test-utils/rtl/buttonVariants.d.ts +11 -0
- package/package.json +9 -2
- package/dist/WizardStepContentWrapper-DnwQIMN1.js.map +0 -1
- package/dist-types/design-system/Icon/AntdIcon.d.ts +0 -114
- package/dist-types/design-system/TypeaheadComboboxReactAria/hooks/useTypeaheadComboboxContext.d.ts +0 -2
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/CountBadge.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxAddButton.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxCheckboxItem.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxControls.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxFooter.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxInput.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxMenu.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxMenuItem.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxMultiSelectInput.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxRoot.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxSectionHeader.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxSelectedItem.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxSeparator.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/TypeaheadComboboxToggleButton.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/footerFocus.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/index.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useComboboxItems.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useComboboxStateProps.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useMultipleSelectionState.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useScrollOptionIntoView.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/hooks/useVirtualizedComboboxScroll.d.ts +0 -0
- /package/dist-types/design-system/{TypeaheadComboboxReactAria → TypeaheadComboboxV2}/index.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EllipsisOutlined as AntEllipsisOutlined } from "@ant-design/icons";
|
|
2
|
+
import type { ComponentType } from "react";
|
|
3
|
+
/** Props type for all the antd built-in icons are the same, so pick any one */
|
|
4
|
+
type AntdIconProps = React.ComponentProps<typeof AntEllipsisOutlined>;
|
|
5
|
+
/**
|
|
6
|
+
* The icon components' props are picked from React's HTMLProps, which, in React 17, include
|
|
7
|
+
* `onPointerEnterCapture` and `onPointerLeaveCapture`, but in React 18 do not. Hence, instead of
|
|
8
|
+
* these props being optional, they are now `unknown` and thus must be declared on a component
|
|
9
|
+
* instance, unless we specifically remove them from the props interface.
|
|
10
|
+
*/
|
|
11
|
+
type IconPropsWithoutPointerEvents = Omit<AntdIconProps, "onPointerEnterCapture" | "onPointerLeaveCapture">;
|
|
12
|
+
/**
|
|
13
|
+
* Antd built-in icons used by the design system's own legacy components, with an interface that has
|
|
14
|
+
* been made compatible with the React 18 types by removing the props that are no longer present on
|
|
15
|
+
* the React DOM types.
|
|
16
|
+
*
|
|
17
|
+
* These are deliberately NOT reëxported from the design system's public API: product code should
|
|
18
|
+
* use Du Bois icons from `__generated/icons`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LegacyEllipsisOutlined: ComponentType<IconPropsWithoutPointerEvents>;
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
2
2
|
import type { ButtonProps } from "../Button";
|
|
3
|
+
/**
|
|
4
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
3
7
|
export declare const TypeaheadComboboxAddButton: ForwardRefExoticComponent<PropsWithoutRef<ButtonProps> & RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { UseComboboxReturnValue } from "downshift";
|
|
2
2
|
import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
3
3
|
import { type TypeaheadComboboxMenuItemProps } from "./TypeaheadComboboxMenuItem";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeaheadComboboxCheckboxItemProps<T> extends TypeaheadComboboxMenuItemProps<T> {
|
|
5
9
|
comboboxState: UseComboboxReturnValue<T>;
|
|
6
10
|
selectedItems: T[];
|
|
7
11
|
selectedMatcher?: (a: T, b: T) => boolean;
|
|
8
12
|
_type?: string;
|
|
9
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
10
18
|
export declare const TypeaheadComboboxCheckboxItem: ForwardRefExoticComponent<PropsWithoutRef<TypeaheadComboboxCheckboxItemProps<any>> & RefAttributes<HTMLLIElement>>;
|
|
11
19
|
export default TypeaheadComboboxCheckboxItem;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { FunctionComponent } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
2
6
|
export interface TypeaheadComboboxFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
7
|
/**
|
|
4
8
|
* DO NOT USE, INTERNAL USE ONLY
|
|
5
9
|
*/
|
|
6
10
|
_type?: string;
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
14
|
+
* @deprecated
|
|
15
|
+
*/
|
|
8
16
|
export declare const DuboisTypeaheadComboboxFooter: FunctionComponent<TypeaheadComboboxFooterProps>;
|
|
17
|
+
/**
|
|
18
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
9
21
|
export declare const TypeaheadComboboxFooter: FunctionComponent<TypeaheadComboboxFooterProps>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
2
2
|
import type { ComboboxStateAnalyticsReturnValue } from "./hooks";
|
|
3
3
|
import type { InputProps } from "../Input";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeaheadComboboxInputProps<T> extends Omit<InputProps, "componentId" | "analyticsEvents"> {
|
|
5
9
|
comboboxState: ComboboxStateAnalyticsReturnValue<T>;
|
|
6
10
|
allowClear?: boolean;
|
|
@@ -10,4 +14,8 @@ export interface TypeaheadComboboxInputProps<T> extends Omit<InputProps, "compon
|
|
|
10
14
|
/** When true, replaces the dropdown toggle button with a spinner to indicate async loading. */
|
|
11
15
|
loading?: boolean;
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
13
21
|
export declare const TypeaheadComboboxInput: ForwardRefExoticComponent<PropsWithoutRef<Omit<TypeaheadComboboxInputProps<any>, "componentId" | "analyticsEvents">> & RefAttributes<HTMLDivElement | null>>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { UseComboboxReturnValue } from "downshift";
|
|
2
2
|
import type { ForwardRefExoticComponent, HTMLAttributes, PropsWithoutRef, ReactNode, RefAttributes } from "react";
|
|
3
3
|
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeaheadComboboxMenuProps<T> extends HTMLAttributes<HTMLUListElement> {
|
|
5
9
|
comboboxState: UseComboboxReturnValue<T>;
|
|
6
10
|
loading?: boolean;
|
|
@@ -15,4 +19,8 @@ export interface TypeaheadComboboxMenuProps<T> extends HTMLAttributes<HTMLUListE
|
|
|
15
19
|
children?: ReactNode;
|
|
16
20
|
matchTriggerWidth?: boolean;
|
|
17
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
18
26
|
export declare const TypeaheadComboboxMenu: ForwardRefExoticComponent<PropsWithoutRef<TypeaheadComboboxMenuProps<any>> & RefAttributes<HTMLElement | null>>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { css } from "@emotion/react";
|
|
2
2
|
import type { UseComboboxReturnValue } from "downshift";
|
|
3
3
|
import type { Theme } from "../../theme";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeaheadComboboxMenuItemProps<T> extends React.HTMLAttributes<HTMLElement> {
|
|
5
9
|
item: T;
|
|
6
10
|
/**
|
|
@@ -22,6 +26,10 @@ export interface TypeaheadComboboxMenuItemProps<T> extends React.HTMLAttributes<
|
|
|
22
26
|
_type?: string;
|
|
23
27
|
}
|
|
24
28
|
export declare const getMenuItemStyles: (theme: Theme, isHighlighted: boolean, disabled?: boolean) => ReturnType<typeof css>;
|
|
29
|
+
/**
|
|
30
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
25
33
|
export declare const TypeaheadComboboxMenuItem: <T>(props: TypeaheadComboboxMenuItemProps<T> & {
|
|
26
34
|
ref?: React.Ref<HTMLLIElement>;
|
|
27
35
|
}) => JSX.Element;
|
|
@@ -2,6 +2,10 @@ import type { UseMultipleSelectionReturnValue } from "downshift";
|
|
|
2
2
|
import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
3
3
|
import type { TypeaheadComboboxInputProps } from "./TypeaheadComboboxInput";
|
|
4
4
|
import type { ComboboxStateAnalyticsReturnValue } from "./hooks";
|
|
5
|
+
/**
|
|
6
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
7
|
+
* @deprecated
|
|
8
|
+
*/
|
|
5
9
|
export interface TypeaheadComboboxMultiSelectInputProps<T> extends TypeaheadComboboxInputProps<T> {
|
|
6
10
|
comboboxState: ComboboxStateAnalyticsReturnValue<T>;
|
|
7
11
|
multipleSelectionState: UseMultipleSelectionReturnValue<T>;
|
|
@@ -28,4 +32,8 @@ export interface TypeaheadComboboxMultiSelectInputProps<T> extends TypeaheadComb
|
|
|
28
32
|
*/
|
|
29
33
|
size?: "middle";
|
|
30
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
37
|
+
* @deprecated
|
|
38
|
+
*/
|
|
31
39
|
export declare const TypeaheadComboboxMultiSelectInput: ForwardRefExoticComponent<PropsWithoutRef<TypeaheadComboboxMultiSelectInputProps<any>> & RefAttributes<HTMLInputElement>>;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ComboboxStateAnalyticsReturnValue } from "./hooks";
|
|
3
|
+
/**
|
|
4
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
3
7
|
export interface TypeaheadComboboxRootProps<T> extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
8
|
comboboxState: ComboboxStateAnalyticsReturnValue<T>;
|
|
5
9
|
multiSelect?: boolean;
|
|
6
10
|
floatingStrategy?: "absolute" | "fixed";
|
|
7
11
|
children: React.ReactNode;
|
|
8
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
9
17
|
export declare const TypeaheadComboboxRoot: React.FC<React.PropsWithChildren<TypeaheadComboboxRootProps<any>>>;
|
|
10
18
|
export default TypeaheadComboboxRoot;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type SerializedStyles } from "@emotion/react";
|
|
2
2
|
import type { UseMultipleSelectionGetSelectedItemPropsOptions } from "downshift";
|
|
3
3
|
import type { Theme } from "../../theme";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeaheadComboboxSelectedItemProps<T> {
|
|
5
9
|
label: React.ReactNode;
|
|
6
10
|
item: any;
|
|
@@ -9,4 +13,8 @@ export interface TypeaheadComboboxSelectedItemProps<T> {
|
|
|
9
13
|
disabled?: boolean;
|
|
10
14
|
}
|
|
11
15
|
export declare const getSelectedItemStyles: (theme: Theme, disabled?: boolean) => SerializedStyles;
|
|
16
|
+
/**
|
|
17
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
12
20
|
export declare const TypeaheadComboboxSelectedItem: React.FC<React.PropsWithChildren<any>>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
3
7
|
export interface DownshiftToggleButtonProps {
|
|
4
8
|
id: string;
|
|
5
9
|
onClick: (e: React.SyntheticEvent) => void;
|
|
@@ -8,5 +12,9 @@ export interface DownshiftToggleButtonProps {
|
|
|
8
12
|
interface TypeaheadComboboxToggleButtonProps extends DownshiftToggleButtonProps {
|
|
9
13
|
disabled?: boolean;
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
11
19
|
export declare const TypeaheadComboboxToggleButton: ForwardRefExoticComponent<PropsWithoutRef<TypeaheadComboboxToggleButtonProps> & RefAttributes<HTMLButtonElement>>;
|
|
12
20
|
export {};
|
|
@@ -43,9 +43,17 @@ export type ComboboxStateAnalyticsReturnValue<T> = UseComboboxReturnValue<T> & A
|
|
|
43
43
|
onView: (value: any) => void;
|
|
44
44
|
firstOnViewValue?: string;
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
46
50
|
export declare function useComboboxState<T>({ allItems, items, itemToString, onIsOpenChange, allowNewValue, formValue, formOnChange, formOnBlur, componentId, valueHasNoPii, analyticsEvents, matcher, preventUnsetOnBlur, selectedMatcher, ...props }: UseComboboxStateProps<T>): ComboboxStateAnalyticsReturnValue<T>;
|
|
47
51
|
interface AnalyticsConfig extends AnalyticsEventValueChangeNoPiiFlagProps<DesignSystemEventProviderAnalyticsEventTypes.OnValueChange | DesignSystemEventProviderAnalyticsEventTypes.OnView> {
|
|
48
52
|
itemToString?: (item: any) => string;
|
|
49
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Deprecated in favor of `TypeaheadComboboxV2`.
|
|
56
|
+
* @deprecated
|
|
57
|
+
*/
|
|
50
58
|
export declare function useMultipleSelectionState<T>(selectedItems: T[], setSelectedItems: React.Dispatch<React.SetStateAction<T[]>>, { componentId, analyticsEvents, valueHasNoPii, itemToString }: AnalyticsConfig): UseMultipleSelectionReturnValue<T>;
|
|
51
59
|
export {};
|
|
@@ -15,6 +15,11 @@ interface BaseComboboxStateProps<T> extends AnalyticsEventValueChangeNoPiiFlagPr
|
|
|
15
15
|
*/
|
|
16
16
|
isItemDisabled?: (item: T) => boolean;
|
|
17
17
|
allowNewValue?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Single-select only: open the menu showing the full option list (even with a value selected), and
|
|
20
|
+
* filter only once the user types. Multi-select clears the input on select, so it is unaffected.
|
|
21
|
+
*/
|
|
22
|
+
showAllOptionsOnOpen?: boolean;
|
|
18
23
|
initialInputValue?: string;
|
|
19
24
|
initialSelectedItem?: T;
|
|
20
25
|
formValue?: T;
|
|
@@ -63,6 +68,7 @@ export interface ComboboxStateValue<T> {
|
|
|
63
68
|
onView: (value: any) => void;
|
|
64
69
|
firstOnViewValue?: string;
|
|
65
70
|
multiSelect: boolean;
|
|
71
|
+
showAllOptionsOnOpen: boolean;
|
|
66
72
|
}
|
|
67
73
|
/**
|
|
68
74
|
* Backs the Du Bois TypeaheadCombobox (react-aria variant) by wrapping react-aria's
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComboBoxState, SelectionMode } from "@react-stately/combobox";
|
|
2
|
+
import type { WrappedItem } from "./useComboboxItems";
|
|
3
|
+
/**
|
|
4
|
+
* Keeps an option highlighted while the menu is open so Enter commits it, matching the original
|
|
5
|
+
* downshift variant's `defaultHighlightedIndex: 0`. react-aria clears the focused key on every input
|
|
6
|
+
* change (useComboBoxState: "Clear focused key when input value changes"), and its `commit()` only
|
|
7
|
+
* selects when `focusedKey != null` — so without this, typing leaves nothing highlighted and Enter
|
|
8
|
+
* falls through to commitValue(), selecting nothing.
|
|
9
|
+
*
|
|
10
|
+
* Only re-focuses when nothing is focused, so arrowing or hovering to another option sticks and we
|
|
11
|
+
* merely restore the default after react-aria drops it. Keyed on the collection so it re-runs as
|
|
12
|
+
* filtering narrows the list. Skipped when `allowNewValue`: there Enter commits the typed text, so
|
|
13
|
+
* pre-highlighting an option would hijack it and select the option instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useRestoreHighlightedOption<T>(state: ComboBoxState<WrappedItem<T>, SelectionMode>, { allowNewValue, showAllOptionsOnOpen }: {
|
|
16
|
+
allowNewValue: boolean;
|
|
17
|
+
showAllOptionsOnOpen: boolean;
|
|
18
|
+
}): void;
|
|
@@ -6,9 +6,11 @@ import { type InputHTMLAttributes, type MutableRefObject, type RefObject } from
|
|
|
6
6
|
import type { DesignSystemEventProviderAnalyticsEventTypes } from "../../DesignSystemEventProvider/DesignSystemEventProvider";
|
|
7
7
|
import type { AnalyticsEventProps } from "../../types";
|
|
8
8
|
import type { WrappedItem } from "../hooks/useComboboxItems";
|
|
9
|
-
export interface
|
|
9
|
+
export interface TypeaheadComboboxV2ContextType extends AnalyticsEventProps<DesignSystemEventProviderAnalyticsEventTypes.OnValueChange | DesignSystemEventProviderAnalyticsEventTypes.OnView> {
|
|
10
10
|
isInsideTypeaheadCombobox: boolean;
|
|
11
11
|
multiSelect: boolean;
|
|
12
|
+
/** Single-select only: whether the menu opens showing all options (filtering begins on type). */
|
|
13
|
+
showAllOptionsOnOpen: boolean;
|
|
12
14
|
/** Null outside of a Root. */
|
|
13
15
|
comboBoxState: ComboBoxState<WrappedItem<unknown>, SelectionMode> | null;
|
|
14
16
|
inputProps: InputHTMLAttributes<HTMLInputElement>;
|
|
@@ -36,10 +38,10 @@ export interface TypeaheadComboboxReactAriaContextType extends AnalyticsEventPro
|
|
|
36
38
|
removeByKey: (key: Key) => void;
|
|
37
39
|
clearSelection: () => void;
|
|
38
40
|
}
|
|
39
|
-
export declare const
|
|
41
|
+
export declare const TypeaheadComboboxV2Context: React.Context<TypeaheadComboboxV2ContextType>;
|
|
40
42
|
interface ProviderProps {
|
|
41
43
|
children: React.ReactNode;
|
|
42
|
-
value: Omit<
|
|
44
|
+
value: Omit<TypeaheadComboboxV2ContextType, "triggerWidth" | "setTriggerWidth">;
|
|
43
45
|
}
|
|
44
|
-
export declare const
|
|
46
|
+
export declare const TypeaheadComboboxV2ContextProvider: ({ children, value }: ProviderProps) => JSX.Element;
|
|
45
47
|
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export declare const DM_SANS_FONT_FAMILY = "'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif";
|
|
2
|
+
export declare const DM_MONO_FONT_FAMILY = "'DM Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace";
|
|
@@ -74,6 +74,6 @@ export * from "./Tooltip";
|
|
|
74
74
|
export * from "./Tree";
|
|
75
75
|
export * from "./TreeGrid";
|
|
76
76
|
export * from "./TypeaheadCombobox";
|
|
77
|
-
export * as
|
|
77
|
+
export * as TypeaheadComboboxV2 from "./TypeaheadComboboxV2";
|
|
78
78
|
export * from "./Typography";
|
|
79
79
|
export * from "./utils";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const BUTTON_VARIANT_CLASS_TOKENS: {
|
|
2
|
+
readonly primary: readonly ["du-bois-light-btn-primary", "du-bois-dark-btn-primary", "ant-btn-primary", "ds-btn-primary"];
|
|
3
|
+
readonly dangerous: readonly ["du-bois-light-btn-dangerous", "du-bois-dark-btn-dangerous", "ant-btn-dangerous", "ds-btn-danger"];
|
|
4
|
+
readonly block: readonly ["du-bois-light-btn-block", "du-bois-dark-btn-block", "ant-btn-block", "ds-btn-block"];
|
|
5
|
+
readonly link: readonly ["du-bois-light-btn-link", "du-bois-dark-btn-link", "ant-btn-link", "ds-btn-link"];
|
|
6
|
+
};
|
|
7
|
+
export type ButtonVariant = keyof typeof BUTTON_VARIANT_CLASS_TOKENS;
|
|
8
|
+
export declare const isPrimaryButton: (button: Element) => boolean;
|
|
9
|
+
export declare const isDangerousButton: (button: Element) => boolean;
|
|
10
|
+
export declare const isBlockButton: (button: Element) => boolean;
|
|
11
|
+
export declare const isLinkButton: (button: Element) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "DuBois Design System",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "ISC",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"import": "./dist/patterns.js",
|
|
27
27
|
"require": "./dist/patterns.js"
|
|
28
28
|
},
|
|
29
|
+
"./test-utils/rtl/buttonVariants": {
|
|
30
|
+
"types": "./dist-types/test-utils/rtl/buttonVariants.d.ts",
|
|
31
|
+
"import": "./dist/test-utils/rtl/buttonVariants.js",
|
|
32
|
+
"require": "./dist/test-utils/rtl/buttonVariants.js"
|
|
33
|
+
},
|
|
29
34
|
"./test-utils/*": {
|
|
30
35
|
"types": "./dist-types/test-utils/*/index.d.ts",
|
|
31
36
|
"import": "./dist/test-utils/*",
|
|
@@ -40,7 +45,8 @@
|
|
|
40
45
|
"./dist/index.mitigated.css": "./dist/index.mitigated.css",
|
|
41
46
|
"./dist/index-dark.mitigated.css": "./dist/index-dark.mitigated.css",
|
|
42
47
|
"./dist/dubois-colors.less": "./dist/dubois-colors.less",
|
|
43
|
-
"./fonts/dm-sans.css": "./dist/fonts/dm-sans/dm-sans.css"
|
|
48
|
+
"./fonts/dm-sans.css": "./dist/fonts/dm-sans/dm-sans.css",
|
|
49
|
+
"./fonts/dm-mono.css": "./dist/fonts/dm-mono/dm-mono.css"
|
|
44
50
|
},
|
|
45
51
|
"sideEffects": [
|
|
46
52
|
"*.css"
|
|
@@ -131,6 +137,7 @@
|
|
|
131
137
|
},
|
|
132
138
|
"dependencies": {
|
|
133
139
|
"@ant-design/icons": "^4.7.0",
|
|
140
|
+
"@databricks/testing-library": "1.0.0",
|
|
134
141
|
"@emotion/unitless": "^0.8.1",
|
|
135
142
|
"@floating-ui/dom": "^1.6.12",
|
|
136
143
|
"@floating-ui/react": "^0.26.25",
|