@atlaskit/dropdown-menu 10.1.8 → 11.0.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.
- package/CHANGELOG.md +148 -0
- package/__perf__/default.tsx +1 -1
- package/__perf__/dropdown-menu.tsx +216 -0
- package/codemods/11.0.0-lite-mode.tsx +39 -0
- package/codemods/__tests__/11.0.0-lite-mode.test.tsx +48 -0
- package/codemods/__tests__/convert-position.test.tsx +88 -0
- package/codemods/__tests__/convert-triggerType.test.tsx +100 -0
- package/codemods/__tests__/deprecate-items.test.tsx +108 -0
- package/codemods/__tests__/deprecate-onItemActivated.test.tsx +108 -0
- package/codemods/__tests__/deprecate-onPositioned.test.tsx +108 -0
- package/codemods/__tests__/deprecate-shouldFitContainer.tsx +108 -0
- package/codemods/__tests__/rename-imports.tsx +136 -0
- package/codemods/__tests__/replace-position-to-placement.test.tsx +84 -0
- package/codemods/__tests__/replace-shouldAllowMultipleLine.test.tsx +122 -0
- package/codemods/__tests__/update-component-callsites.tsx +66 -0
- package/codemods/migrates/convert-trigger-type.tsx +57 -0
- package/codemods/migrates/deprecate-items.tsx +9 -0
- package/codemods/migrates/deprecate-onItemActivated.tsx +9 -0
- package/codemods/migrates/deprecate-onPositioned.tsx +9 -0
- package/codemods/migrates/deprecate-shouldFitContainer.tsx +9 -0
- package/codemods/migrates/rename-imports.tsx +22 -0
- package/codemods/migrates/replace-position-to-placement.tsx +38 -0
- package/codemods/migrates/replace-shouldAllowMultiline.tsx +47 -0
- package/codemods/migrates/update-component-callsites.tsx +13 -0
- package/codemods/utils/convert-position.tsx +24 -0
- package/codemods/utils/create-rename-import.tsx +41 -0
- package/codemods/utils/create-update-callsite.tsx +32 -0
- package/dist/cjs/checkbox/dropdown-item-checkbox-group.js +31 -0
- package/dist/cjs/checkbox/dropdown-item-checkbox.js +108 -0
- package/dist/cjs/dropdown-menu-item-group.js +22 -0
- package/dist/cjs/dropdown-menu-item.js +67 -0
- package/dist/cjs/dropdown-menu.js +194 -0
- package/dist/cjs/index.js +21 -29
- package/dist/cjs/{components/item/DropdownItemRadio.js → internal/components/focus-manager.js} +40 -9
- package/dist/cjs/internal/components/menu-wrapper.js +68 -0
- package/dist/cjs/internal/context/checkbox-group-context.js +14 -0
- package/dist/cjs/internal/context/selection-store.js +76 -0
- package/dist/cjs/internal/hooks/use-checkbox-state.js +68 -0
- package/dist/cjs/internal/hooks/use-radio-state.js +84 -0
- package/dist/cjs/internal/hooks/use-register-item-with-focus-manager.js +29 -0
- package/dist/cjs/internal/utils/get-icon-colors.js +25 -0
- package/dist/cjs/internal/utils/handle-focus.js +58 -0
- package/dist/cjs/internal/utils/is-checkbox-item.js +11 -0
- package/dist/cjs/internal/utils/is-radio-item.js +11 -0
- package/dist/cjs/internal/utils/is-voice-over-supported.js +23 -0
- package/dist/cjs/internal/utils/reset-options-in-group.js +23 -0
- package/dist/cjs/radio/dropdown-item-radio-group.js +89 -0
- package/dist/cjs/radio/dropdown-item-radio.js +108 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/checkbox/dropdown-item-checkbox-group.js +21 -0
- package/dist/es2019/checkbox/dropdown-item-checkbox.js +67 -0
- package/dist/es2019/dropdown-menu-item-group.js +11 -0
- package/dist/es2019/dropdown-menu-item.js +49 -0
- package/dist/es2019/dropdown-menu.js +151 -0
- package/dist/es2019/index.js +7 -11
- package/dist/es2019/internal/components/focus-manager.js +40 -0
- package/dist/es2019/internal/components/menu-wrapper.js +44 -0
- package/dist/es2019/internal/context/checkbox-group-context.js +6 -0
- package/dist/es2019/internal/context/selection-store.js +54 -0
- package/dist/es2019/internal/hooks/use-checkbox-state.js +45 -0
- package/dist/es2019/internal/hooks/use-radio-state.js +56 -0
- package/dist/es2019/internal/hooks/use-register-item-with-focus-manager.js +19 -0
- package/dist/es2019/internal/utils/get-icon-colors.js +17 -0
- package/dist/es2019/internal/utils/handle-focus.js +48 -0
- package/dist/es2019/internal/utils/is-checkbox-item.js +4 -0
- package/dist/es2019/internal/utils/is-radio-item.js +4 -0
- package/dist/es2019/internal/utils/is-voice-over-supported.js +11 -0
- package/dist/es2019/internal/utils/reset-options-in-group.js +7 -0
- package/dist/es2019/radio/dropdown-item-radio-group.js +56 -0
- package/dist/es2019/radio/dropdown-item-radio.js +67 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/checkbox/dropdown-item-checkbox-group.js +19 -0
- package/dist/esm/checkbox/dropdown-item-checkbox.js +81 -0
- package/dist/esm/dropdown-menu-item-group.js +11 -0
- package/dist/esm/dropdown-menu-item.js +52 -0
- package/dist/esm/dropdown-menu.js +168 -0
- package/dist/esm/index.js +7 -11
- package/dist/esm/internal/components/focus-manager.js +39 -0
- package/dist/esm/internal/components/menu-wrapper.js +45 -0
- package/dist/esm/internal/context/checkbox-group-context.js +6 -0
- package/dist/esm/internal/context/selection-store.js +58 -0
- package/dist/esm/internal/hooks/use-checkbox-state.js +55 -0
- package/dist/esm/internal/hooks/use-radio-state.js +70 -0
- package/dist/esm/internal/hooks/use-register-item-with-focus-manager.js +19 -0
- package/dist/esm/internal/utils/get-icon-colors.js +17 -0
- package/dist/esm/internal/utils/handle-focus.js +47 -0
- package/dist/esm/internal/utils/is-checkbox-item.js +4 -0
- package/dist/esm/internal/utils/is-radio-item.js +4 -0
- package/dist/esm/internal/utils/is-voice-over-supported.js +15 -0
- package/dist/esm/internal/utils/reset-options-in-group.js +13 -0
- package/dist/esm/radio/dropdown-item-radio-group.js +66 -0
- package/dist/esm/radio/dropdown-item-radio.js +81 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/checkbox/dropdown-item-checkbox-group.d.ts +16 -0
- package/dist/types/checkbox/dropdown-item-checkbox.d.ts +13 -0
- package/dist/types/dropdown-menu-item-group.d.ts +11 -0
- package/dist/types/dropdown-menu-item.d.ts +13 -0
- package/dist/types/dropdown-menu.d.ts +13 -0
- package/dist/types/index.d.ts +8 -10
- package/dist/types/internal/components/focus-manager.d.ts +19 -0
- package/dist/types/internal/components/menu-wrapper.d.ts +11 -0
- package/dist/types/internal/context/checkbox-group-context.d.ts +5 -0
- package/dist/types/internal/context/selection-store.d.ts +27 -0
- package/dist/types/internal/hooks/use-checkbox-state.d.ts +14 -0
- package/dist/types/internal/hooks/use-radio-state.d.ts +9 -0
- package/dist/types/internal/hooks/use-register-item-with-focus-manager.d.ts +4 -0
- package/dist/types/internal/utils/get-icon-colors.d.ts +8 -0
- package/dist/types/internal/utils/handle-focus.d.ts +2 -0
- package/dist/types/internal/utils/is-checkbox-item.d.ts +1 -0
- package/dist/types/internal/utils/is-radio-item.d.ts +1 -0
- package/dist/types/internal/utils/is-voice-over-supported.d.ts +2 -0
- package/dist/types/internal/utils/reset-options-in-group.d.ts +4 -0
- package/dist/types/radio/dropdown-item-radio-group.d.ts +25 -0
- package/dist/types/radio/dropdown-item-radio.d.ts +13 -0
- package/dist/types/types.d.ts +254 -79
- package/package.json +39 -23
- package/dist/cjs/components/DropdownMenu.js +0 -230
- package/dist/cjs/components/DropdownMenuStateless.js +0 -523
- package/dist/cjs/components/context/DropdownItemClickManager.js +0 -72
- package/dist/cjs/components/context/DropdownItemFocusManager.js +0 -178
- package/dist/cjs/components/context/DropdownItemSelectionCache.js +0 -131
- package/dist/cjs/components/context/DropdownItemSelectionManager.js +0 -185
- package/dist/cjs/components/group/DropdownItemGroup.js +0 -61
- package/dist/cjs/components/group/DropdownItemGroupCheckbox.js +0 -16
- package/dist/cjs/components/group/DropdownItemGroupRadio.js +0 -16
- package/dist/cjs/components/group/ert-group-selection.js +0 -8
- package/dist/cjs/components/hoc/withItemSelectionManager.js +0 -66
- package/dist/cjs/components/hoc/withToggleInteraction.js +0 -175
- package/dist/cjs/components/item/DropdownItem.js +0 -19
- package/dist/cjs/components/item/DropdownItemCheckbox.js +0 -28
- package/dist/cjs/components/item/ert-item-checkbox.js +0 -8
- package/dist/cjs/components/item/ert-item-radio.js +0 -8
- package/dist/cjs/components/item/ert-item.js +0 -8
- package/dist/cjs/styled/WidthConstrainer.js +0 -21
- package/dist/cjs/util/contextNamespace.js +0 -19
- package/dist/cjs/util/getDisplayName.js +0 -14
- package/dist/cjs/util/keys.js +0 -18
- package/dist/cjs/util/safeContextCall.js +0 -27
- package/dist/cjs/util/supportsVoiceover.js +0 -17
- package/dist/es2019/components/DropdownMenu.js +0 -156
- package/dist/es2019/components/DropdownMenuStateless.js +0 -459
- package/dist/es2019/components/context/DropdownItemClickManager.js +0 -31
- package/dist/es2019/components/context/DropdownItemFocusManager.js +0 -134
- package/dist/es2019/components/context/DropdownItemSelectionCache.js +0 -68
- package/dist/es2019/components/context/DropdownItemSelectionManager.js +0 -140
- package/dist/es2019/components/group/DropdownItemGroup.js +0 -17
- package/dist/es2019/components/group/DropdownItemGroupCheckbox.js +0 -3
- package/dist/es2019/components/group/DropdownItemGroupRadio.js +0 -3
- package/dist/es2019/components/group/ert-group-selection.js +0 -1
- package/dist/es2019/components/hoc/withItemSelectionManager.js +0 -20
- package/dist/es2019/components/hoc/withToggleInteraction.js +0 -119
- package/dist/es2019/components/item/DropdownItem.js +0 -3
- package/dist/es2019/components/item/DropdownItemCheckbox.js +0 -5
- package/dist/es2019/components/item/DropdownItemRadio.js +0 -5
- package/dist/es2019/components/item/ert-item-checkbox.js +0 -1
- package/dist/es2019/components/item/ert-item-radio.js +0 -1
- package/dist/es2019/components/item/ert-item.js +0 -1
- package/dist/es2019/styled/WidthConstrainer.js +0 -6
- package/dist/es2019/util/contextNamespace.js +0 -6
- package/dist/es2019/util/getDisplayName.js +0 -4
- package/dist/es2019/util/keys.js +0 -6
- package/dist/es2019/util/safeContextCall.js +0 -10
- package/dist/es2019/util/supportsVoiceover.js +0 -5
- package/dist/esm/components/DropdownMenu.js +0 -215
- package/dist/esm/components/DropdownMenuStateless.js +0 -516
- package/dist/esm/components/context/DropdownItemClickManager.js +0 -59
- package/dist/esm/components/context/DropdownItemFocusManager.js +0 -164
- package/dist/esm/components/context/DropdownItemSelectionCache.js +0 -113
- package/dist/esm/components/context/DropdownItemSelectionManager.js +0 -174
- package/dist/esm/components/group/DropdownItemGroup.js +0 -43
- package/dist/esm/components/group/DropdownItemGroupCheckbox.js +0 -3
- package/dist/esm/components/group/DropdownItemGroupRadio.js +0 -3
- package/dist/esm/components/group/ert-group-selection.js +0 -1
- package/dist/esm/components/hoc/withItemSelectionManager.js +0 -47
- package/dist/esm/components/hoc/withToggleInteraction.js +0 -155
- package/dist/esm/components/item/DropdownItem.js +0 -3
- package/dist/esm/components/item/DropdownItemCheckbox.js +0 -7
- package/dist/esm/components/item/DropdownItemRadio.js +0 -7
- package/dist/esm/components/item/ert-item-checkbox.js +0 -1
- package/dist/esm/components/item/ert-item-radio.js +0 -1
- package/dist/esm/components/item/ert-item.js +0 -1
- package/dist/esm/styled/WidthConstrainer.js +0 -9
- package/dist/esm/util/contextNamespace.js +0 -8
- package/dist/esm/util/getDisplayName.js +0 -6
- package/dist/esm/util/keys.js +0 -6
- package/dist/esm/util/safeContextCall.js +0 -18
- package/dist/esm/util/supportsVoiceover.js +0 -9
- package/dist/types/components/DropdownMenu.d.ts +0 -36
- package/dist/types/components/DropdownMenuStateless.d.ts +0 -82
- package/dist/types/components/context/DropdownItemClickManager.d.ts +0 -19
- package/dist/types/components/context/DropdownItemFocusManager.d.ts +0 -35
- package/dist/types/components/context/DropdownItemSelectionCache.d.ts +0 -31
- package/dist/types/components/context/DropdownItemSelectionManager.d.ts +0 -34
- package/dist/types/components/group/DropdownItemGroup.d.ts +0 -12
- package/dist/types/components/group/DropdownItemGroupCheckbox.d.ts +0 -55
- package/dist/types/components/group/DropdownItemGroupRadio.d.ts +0 -55
- package/dist/types/components/group/ert-group-selection.d.ts +0 -6
- package/dist/types/components/hoc/withItemSelectionManager.d.ts +0 -63
- package/dist/types/components/hoc/withToggleInteraction.d.ts +0 -98
- package/dist/types/components/item/DropdownItem.d.ts +0 -65
- package/dist/types/components/item/DropdownItemCheckbox.d.ts +0 -80
- package/dist/types/components/item/DropdownItemRadio.d.ts +0 -80
- package/dist/types/components/item/ert-item-checkbox.d.ts +0 -2
- package/dist/types/components/item/ert-item-radio.d.ts +0 -2
- package/dist/types/components/item/ert-item.d.ts +0 -2
- package/dist/types/styled/WidthConstrainer.d.ts +0 -7
- package/dist/types/util/contextNamespace.d.ts +0 -4
- package/dist/types/util/getDisplayName.d.ts +0 -3
- package/dist/types/util/keys.d.ts +0 -6
- package/dist/types/util/safeContextCall.d.ts +0 -6
- package/dist/types/util/supportsVoiceover.d.ts +0 -2
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { ComponentType } from 'react';
|
|
2
|
-
import { Behaviors } from '../../types';
|
|
3
|
-
export interface WithDropdownItemSelectionManagerProps {
|
|
4
|
-
/**
|
|
5
|
-
* Unique `id` used to enable selections.
|
|
6
|
-
* When using multiple groups make sure they each have a unique `id`.
|
|
7
|
-
*/
|
|
8
|
-
id: string;
|
|
9
|
-
}
|
|
10
|
-
declare const withDropdownItemSelectionManager: <BaseProps extends {}>(WrappedComponent: React.ComponentType<BaseProps>, selectionBehavior: Behaviors) => {
|
|
11
|
-
new (props: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>): {
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
context: any;
|
|
14
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
15
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
16
|
-
readonly props: Readonly<BaseProps & WithDropdownItemSelectionManagerProps> & Readonly<{
|
|
17
|
-
children?: React.ReactNode;
|
|
18
|
-
}>;
|
|
19
|
-
state: Readonly<{}>;
|
|
20
|
-
refs: {
|
|
21
|
-
[key: string]: React.ReactInstance;
|
|
22
|
-
};
|
|
23
|
-
componentDidMount?(): void;
|
|
24
|
-
shouldComponentUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
25
|
-
componentWillUnmount?(): void;
|
|
26
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
27
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, prevState: Readonly<{}>): any;
|
|
28
|
-
componentDidUpdate?(prevProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
29
|
-
componentWillMount?(): void;
|
|
30
|
-
UNSAFE_componentWillMount?(): void;
|
|
31
|
-
componentWillReceiveProps?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextContext: any): void;
|
|
32
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextContext: any): void;
|
|
33
|
-
componentWillUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
34
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
-
};
|
|
36
|
-
new (props: BaseProps & WithDropdownItemSelectionManagerProps, context?: any): {
|
|
37
|
-
render(): JSX.Element;
|
|
38
|
-
context: any;
|
|
39
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
40
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
41
|
-
readonly props: Readonly<BaseProps & WithDropdownItemSelectionManagerProps> & Readonly<{
|
|
42
|
-
children?: React.ReactNode;
|
|
43
|
-
}>;
|
|
44
|
-
state: Readonly<{}>;
|
|
45
|
-
refs: {
|
|
46
|
-
[key: string]: React.ReactInstance;
|
|
47
|
-
};
|
|
48
|
-
componentDidMount?(): void;
|
|
49
|
-
shouldComponentUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
50
|
-
componentWillUnmount?(): void;
|
|
51
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
52
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, prevState: Readonly<{}>): any;
|
|
53
|
-
componentDidUpdate?(prevProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
54
|
-
componentWillMount?(): void;
|
|
55
|
-
UNSAFE_componentWillMount?(): void;
|
|
56
|
-
componentWillReceiveProps?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextContext: any): void;
|
|
57
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextContext: any): void;
|
|
58
|
-
componentWillUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
59
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<BaseProps & WithDropdownItemSelectionManagerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
60
|
-
};
|
|
61
|
-
contextType?: React.Context<any> | undefined;
|
|
62
|
-
};
|
|
63
|
-
export default withDropdownItemSelectionManager;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React, { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { IconProps } from '@atlaskit/icon';
|
|
4
|
-
import { Behaviors } from '../../types';
|
|
5
|
-
export interface Props {
|
|
6
|
-
/** Content to be displayed inside the item. Same as `@atlaskit/item` `children` prop. */
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/** Unique identifier for the item, so that selection state can be tracked when the dropdown
|
|
9
|
-
* is opened/closed. */
|
|
10
|
-
id: string;
|
|
11
|
-
/** Set at mount to make the item appear checked. The user may interact with the
|
|
12
|
-
* item after mount. See `isSelected` if you want to control the item state manually. */
|
|
13
|
-
defaultSelected?: boolean;
|
|
14
|
-
/** Causes the item to appear visually checked. Can be set at mount time, and updated after
|
|
15
|
-
* mount. Changing the value will not cause `onClick` to be called. */
|
|
16
|
-
isSelected?: boolean;
|
|
17
|
-
/** Standard optional `onClick` handler */
|
|
18
|
-
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
19
|
-
}
|
|
20
|
-
declare const withToggleInteraction: (WrappedComponent: ComponentType, SelectionIcon: ComponentType<IconProps>, getAriaRole: () => Behaviors) => {
|
|
21
|
-
new (props: Readonly<Props>): {
|
|
22
|
-
componentDidMount(): void;
|
|
23
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
24
|
-
getIconColors: (isSelected?: boolean) => {
|
|
25
|
-
primary: string;
|
|
26
|
-
secondary: string;
|
|
27
|
-
};
|
|
28
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
29
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
30
|
-
handleKeyboard: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
31
|
-
handleItemActivated: (event: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement>) => void;
|
|
32
|
-
isSelectedInDropdown: () => string | null;
|
|
33
|
-
render(): JSX.Element;
|
|
34
|
-
context: any;
|
|
35
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
36
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
37
|
-
readonly props: Readonly<Props> & Readonly<{
|
|
38
|
-
children?: React.ReactNode;
|
|
39
|
-
}>;
|
|
40
|
-
state: Readonly<{}>;
|
|
41
|
-
refs: {
|
|
42
|
-
[key: string]: React.ReactInstance;
|
|
43
|
-
};
|
|
44
|
-
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
45
|
-
componentWillUnmount?(): void;
|
|
46
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
47
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<{}>): any;
|
|
48
|
-
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
49
|
-
componentWillMount?(): void;
|
|
50
|
-
UNSAFE_componentWillMount?(): void;
|
|
51
|
-
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
|
|
52
|
-
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
53
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
54
|
-
};
|
|
55
|
-
new (props: Props, context?: any): {
|
|
56
|
-
componentDidMount(): void;
|
|
57
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
58
|
-
getIconColors: (isSelected?: boolean) => {
|
|
59
|
-
primary: string;
|
|
60
|
-
secondary: string;
|
|
61
|
-
};
|
|
62
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
63
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
64
|
-
handleKeyboard: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
65
|
-
handleItemActivated: (event: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement>) => void;
|
|
66
|
-
isSelectedInDropdown: () => string | null;
|
|
67
|
-
render(): JSX.Element;
|
|
68
|
-
context: any;
|
|
69
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
70
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
71
|
-
readonly props: Readonly<Props> & Readonly<{
|
|
72
|
-
children?: React.ReactNode;
|
|
73
|
-
}>;
|
|
74
|
-
state: Readonly<{}>;
|
|
75
|
-
refs: {
|
|
76
|
-
[key: string]: React.ReactInstance;
|
|
77
|
-
};
|
|
78
|
-
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
79
|
-
componentWillUnmount?(): void;
|
|
80
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
81
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<{}>): any;
|
|
82
|
-
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
83
|
-
componentWillMount?(): void;
|
|
84
|
-
UNSAFE_componentWillMount?(): void;
|
|
85
|
-
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void;
|
|
86
|
-
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
87
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
88
|
-
};
|
|
89
|
-
displayName: string;
|
|
90
|
-
defaultProps: {
|
|
91
|
-
onClick: () => void;
|
|
92
|
-
};
|
|
93
|
-
contextTypes: {
|
|
94
|
-
[x: string]: PropTypes.Validator<any>;
|
|
95
|
-
};
|
|
96
|
-
contextType?: React.Context<any> | undefined;
|
|
97
|
-
};
|
|
98
|
-
export default withToggleInteraction;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
-
export interface DropdownItemProps {
|
|
3
|
-
/**
|
|
4
|
-
* Primary content for the item.
|
|
5
|
-
*/
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Description of the item.
|
|
9
|
-
* This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
|
|
10
|
-
*/
|
|
11
|
-
description?: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Will focus to the item when it is initially mounted.
|
|
14
|
-
*/
|
|
15
|
-
autoFocus?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Displays the item in a compact look.
|
|
18
|
-
*/
|
|
19
|
-
isCompact?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Makes the element appear disabled as well as removing interactivity.
|
|
22
|
-
*/
|
|
23
|
-
isDisabled?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Hides the item.
|
|
26
|
-
*/
|
|
27
|
-
isHidden?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Enables the primary content passed in through `children` to wrap over multiple lines.
|
|
30
|
-
*/
|
|
31
|
-
shouldAllowMultiline?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Event that is triggered when the element is clicked.
|
|
34
|
-
*/
|
|
35
|
-
onClick?: (e: MouseEvent | KeyboardEvent) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Makes the element appear selected.
|
|
38
|
-
*/
|
|
39
|
-
isSelected?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Link to another page.
|
|
42
|
-
*/
|
|
43
|
-
href?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Where to display the linked URL,
|
|
46
|
-
* see [anchor information](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) on mdn for more information.
|
|
47
|
-
*/
|
|
48
|
-
target?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Adds a title attribute to the root item element.
|
|
51
|
-
*/
|
|
52
|
-
title?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Element to render before the item text.
|
|
55
|
-
* Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
|
|
56
|
-
*/
|
|
57
|
-
elemBefore?: React.ReactNode;
|
|
58
|
-
/**
|
|
59
|
-
* Element to render after the item text.
|
|
60
|
-
* Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
|
|
61
|
-
*/
|
|
62
|
-
elemAfter?: React.ReactNode;
|
|
63
|
-
}
|
|
64
|
-
declare const _default: any;
|
|
65
|
-
export default _default;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const _default: {
|
|
3
|
-
new (props: Readonly<import("../hoc/withToggleInteraction").Props>): {
|
|
4
|
-
componentDidMount(): void;
|
|
5
|
-
UNSAFE_componentWillReceiveProps(nextProps: import("../hoc/withToggleInteraction").Props): void;
|
|
6
|
-
getIconColors: (isSelected?: boolean) => {
|
|
7
|
-
primary: string;
|
|
8
|
-
secondary: string;
|
|
9
|
-
};
|
|
10
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
11
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
12
|
-
handleKeyboard: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
13
|
-
handleItemActivated: (event: import("react").KeyboardEvent<HTMLElement> | import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
-
isSelectedInDropdown: () => string | null;
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
context: any;
|
|
17
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../hoc/withToggleInteraction").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
19
|
-
readonly props: Readonly<import("../hoc/withToggleInteraction").Props> & Readonly<{
|
|
20
|
-
children?: import("react").ReactNode;
|
|
21
|
-
}>;
|
|
22
|
-
state: Readonly<{}>;
|
|
23
|
-
refs: {
|
|
24
|
-
[key: string]: import("react").ReactInstance;
|
|
25
|
-
};
|
|
26
|
-
shouldComponentUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
27
|
-
componentWillUnmount?(): void;
|
|
28
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
29
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>): any;
|
|
30
|
-
componentDidUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
31
|
-
componentWillMount?(): void;
|
|
32
|
-
UNSAFE_componentWillMount?(): void;
|
|
33
|
-
componentWillReceiveProps?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextContext: any): void;
|
|
34
|
-
componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
36
|
-
};
|
|
37
|
-
new (props: import("../hoc/withToggleInteraction").Props, context?: any): {
|
|
38
|
-
componentDidMount(): void;
|
|
39
|
-
UNSAFE_componentWillReceiveProps(nextProps: import("../hoc/withToggleInteraction").Props): void;
|
|
40
|
-
getIconColors: (isSelected?: boolean) => {
|
|
41
|
-
primary: string;
|
|
42
|
-
secondary: string;
|
|
43
|
-
};
|
|
44
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
45
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
46
|
-
handleKeyboard: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
47
|
-
handleItemActivated: (event: import("react").KeyboardEvent<HTMLElement> | import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
48
|
-
isSelectedInDropdown: () => string | null;
|
|
49
|
-
render(): JSX.Element;
|
|
50
|
-
context: any;
|
|
51
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../hoc/withToggleInteraction").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
52
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
53
|
-
readonly props: Readonly<import("../hoc/withToggleInteraction").Props> & Readonly<{
|
|
54
|
-
children?: import("react").ReactNode;
|
|
55
|
-
}>;
|
|
56
|
-
state: Readonly<{}>;
|
|
57
|
-
refs: {
|
|
58
|
-
[key: string]: import("react").ReactInstance;
|
|
59
|
-
};
|
|
60
|
-
shouldComponentUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
61
|
-
componentWillUnmount?(): void;
|
|
62
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
63
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>): any;
|
|
64
|
-
componentDidUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
65
|
-
componentWillMount?(): void;
|
|
66
|
-
UNSAFE_componentWillMount?(): void;
|
|
67
|
-
componentWillReceiveProps?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextContext: any): void;
|
|
68
|
-
componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
69
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
70
|
-
};
|
|
71
|
-
displayName: string;
|
|
72
|
-
defaultProps: {
|
|
73
|
-
onClick: () => void;
|
|
74
|
-
};
|
|
75
|
-
contextTypes: {
|
|
76
|
-
[x: string]: import("prop-types").Validator<any>;
|
|
77
|
-
};
|
|
78
|
-
contextType?: import("react").Context<any> | undefined;
|
|
79
|
-
};
|
|
80
|
-
export default _default;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const _default: {
|
|
3
|
-
new (props: Readonly<import("../hoc/withToggleInteraction").Props>): {
|
|
4
|
-
componentDidMount(): void;
|
|
5
|
-
UNSAFE_componentWillReceiveProps(nextProps: import("../hoc/withToggleInteraction").Props): void;
|
|
6
|
-
getIconColors: (isSelected?: boolean) => {
|
|
7
|
-
primary: string;
|
|
8
|
-
secondary: string;
|
|
9
|
-
};
|
|
10
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
11
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
12
|
-
handleKeyboard: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
13
|
-
handleItemActivated: (event: import("react").KeyboardEvent<HTMLElement> | import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
-
isSelectedInDropdown: () => string | null;
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
context: any;
|
|
17
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../hoc/withToggleInteraction").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
19
|
-
readonly props: Readonly<import("../hoc/withToggleInteraction").Props> & Readonly<{
|
|
20
|
-
children?: import("react").ReactNode;
|
|
21
|
-
}>;
|
|
22
|
-
state: Readonly<{}>;
|
|
23
|
-
refs: {
|
|
24
|
-
[key: string]: import("react").ReactInstance;
|
|
25
|
-
};
|
|
26
|
-
shouldComponentUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
27
|
-
componentWillUnmount?(): void;
|
|
28
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
29
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>): any;
|
|
30
|
-
componentDidUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
31
|
-
componentWillMount?(): void;
|
|
32
|
-
UNSAFE_componentWillMount?(): void;
|
|
33
|
-
componentWillReceiveProps?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextContext: any): void;
|
|
34
|
-
componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
36
|
-
};
|
|
37
|
-
new (props: import("../hoc/withToggleInteraction").Props, context?: any): {
|
|
38
|
-
componentDidMount(): void;
|
|
39
|
-
UNSAFE_componentWillReceiveProps(nextProps: import("../hoc/withToggleInteraction").Props): void;
|
|
40
|
-
getIconColors: (isSelected?: boolean) => {
|
|
41
|
-
primary: string;
|
|
42
|
-
secondary: string;
|
|
43
|
-
};
|
|
44
|
-
warnIfUseControlledAndUncontrolledState: () => void;
|
|
45
|
-
callContextFn: (fnToCall: string, ...args: any[]) => string | null;
|
|
46
|
-
handleKeyboard: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
47
|
-
handleItemActivated: (event: import("react").KeyboardEvent<HTMLElement> | import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
48
|
-
isSelectedInDropdown: () => string | null;
|
|
49
|
-
render(): JSX.Element;
|
|
50
|
-
context: any;
|
|
51
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../hoc/withToggleInteraction").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
52
|
-
forceUpdate(callBack?: (() => void) | undefined): void;
|
|
53
|
-
readonly props: Readonly<import("../hoc/withToggleInteraction").Props> & Readonly<{
|
|
54
|
-
children?: import("react").ReactNode;
|
|
55
|
-
}>;
|
|
56
|
-
state: Readonly<{}>;
|
|
57
|
-
refs: {
|
|
58
|
-
[key: string]: import("react").ReactInstance;
|
|
59
|
-
};
|
|
60
|
-
shouldComponentUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
61
|
-
componentWillUnmount?(): void;
|
|
62
|
-
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
63
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>): any;
|
|
64
|
-
componentDidUpdate?(prevProps: Readonly<import("../hoc/withToggleInteraction").Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
65
|
-
componentWillMount?(): void;
|
|
66
|
-
UNSAFE_componentWillMount?(): void;
|
|
67
|
-
componentWillReceiveProps?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextContext: any): void;
|
|
68
|
-
componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
69
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../hoc/withToggleInteraction").Props>, nextState: Readonly<{}>, nextContext: any): void;
|
|
70
|
-
};
|
|
71
|
-
displayName: string;
|
|
72
|
-
defaultProps: {
|
|
73
|
-
onClick: () => void;
|
|
74
|
-
};
|
|
75
|
-
contextTypes: {
|
|
76
|
-
[x: string]: import("prop-types").Validator<any>;
|
|
77
|
-
};
|
|
78
|
-
contextType?: import("react").Context<any> | undefined;
|
|
79
|
-
};
|
|
80
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
shouldFitContainer: boolean;
|
|
4
|
-
}, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
5
|
-
shouldFitContainer: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare type ContextKey = string;
|
|
2
|
-
interface Instance {
|
|
3
|
-
context: Record<string, Record<string, (...args: any[]) => string>>;
|
|
4
|
-
}
|
|
5
|
-
declare const _default: (instance: Instance, contextKey: ContextKey) => (fnToCall: string, ...args: Array<any>) => string | null;
|
|
6
|
-
export default _default;
|