@saleor/macaw-ui 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +3 -3
- package/dist/types/ActionBar/ActionBar.d.ts +1 -0
- package/dist/types/ActionBar/context.d.ts +6 -3
- package/dist/types/Autocomplete/Autocomplete.d.ts +23 -0
- package/dist/types/Autocomplete/Autocomplete.stories.d.ts +5 -0
- package/dist/types/Autocomplete/fixtures.d.ts +4 -0
- package/dist/types/Autocomplete/index.d.ts +1 -0
- package/dist/types/Autocomplete/styles.d.ts +2 -0
- package/dist/types/Chip/Chip.d.ts +8 -0
- package/dist/types/Chip/ChipAdornment.d.ts +6 -0
- package/dist/types/Chip/ChipMovable.d.ts +5 -0
- package/dist/types/Chip/ChipRemovable.d.ts +6 -0
- package/dist/types/Chip/ChipSwatch.d.ts +7 -0
- package/dist/types/Chip/index.d.ts +5 -0
- package/dist/types/Chip/private/ColorSwatch.d.ts +6 -0
- package/dist/types/Chip/styles.d.ts +2 -0
- package/dist/types/CircleIndicator/index.d.ts +1 -1
- package/dist/types/Filter/FilterField/AutocompleteFilterField.d.ts +6 -0
- package/dist/types/Filter/FilterField/MultipleValueAutocompleteFilterField.d.ts +6 -0
- package/dist/types/Filter/stories/Filter.stories.d.ts +5 -0
- package/dist/types/Filter/stories/FilterInteractive.stories.d.ts +4 -0
- package/dist/types/Filter/stories/labels.d.ts +8 -0
- package/dist/types/Filter/styles.d.ts +1 -1
- package/dist/types/Filter/types.d.ts +8 -2
- package/dist/types/Filter/utils.d.ts +4 -1
- package/dist/types/IconButton/IconButton.d.ts +2 -0
- package/dist/types/IconButton/partials.d.ts +1 -1
- package/dist/types/IconButton/styles.d.ts +1 -1
- package/dist/types/MultipleValueAutocomplete/MultipleValueAutocomplete.d.ts +26 -0
- package/dist/types/MultipleValueAutocomplete/MultipleValueAutocomplete.stories.d.ts +6 -0
- package/dist/types/MultipleValueAutocomplete/fixtures.d.ts +4 -0
- package/dist/types/MultipleValueAutocomplete/index.d.ts +1 -0
- package/dist/types/MultipleValueAutocomplete/styles.d.ts +2 -0
- package/dist/types/MultipleValueAutocomplete/useMultipleValueAutocomplete.d.ts +32 -0
- package/dist/types/Savebar/Savebar.d.ts +1 -0
- package/dist/types/Sidebar/MenuItem.d.ts +9 -3
- package/dist/types/Sidebar/types.d.ts +8 -0
- package/dist/types/Sidebar/utils.d.ts +12 -0
- package/dist/types/SidebarDrawer/MenuItemBtn.d.ts +2 -1
- package/dist/types/SwitchSelector/SwitchSelector.d.ts +2 -0
- package/dist/types/SwitchSelector/SwitchSelector.stories.d.ts +4 -0
- package/dist/types/SwitchSelector/SwitchSelectorButton.d.ts +8 -0
- package/dist/types/SwitchSelector/index.d.ts +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/theme/ThemeProvider.d.ts +4 -0
- package/dist/types/theme/types.d.ts +1 -0
- package/dist/types/tools/useTextWidth.d.ts +2 -0
- package/dist/types/utils/guideStyles.d.ts +1 -1
- package/dist/types/utils/mergeRefs.d.ts +2 -0
- package/dist/types/utils/useMockAutocomplete.d.ts +10 -0
- package/package.json +11 -13
- package/src/ActionBar/ActionBar.tsx +8 -11
- package/src/ActionBar/context.tsx +15 -6
- package/src/ActionBar/styles.ts +1 -1
- package/src/Autocomplete/Autocomplete.stories.tsx +43 -0
- package/src/Autocomplete/Autocomplete.tsx +187 -0
- package/src/Autocomplete/fixtures.ts +122 -0
- package/src/Autocomplete/index.ts +1 -0
- package/src/Autocomplete/styles.ts +19 -0
- package/src/Backlink/Backlink.tsx +3 -1
- package/src/Chip/Chip.tsx +52 -0
- package/src/Chip/ChipAdornment.tsx +53 -0
- package/src/Chip/ChipMovable.tsx +40 -0
- package/src/Chip/ChipRemovable.tsx +29 -0
- package/src/Chip/ChipSwatch.tsx +42 -0
- package/src/Chip/index.ts +5 -0
- package/src/Chip/private/ColorSwatch.tsx +21 -0
- package/src/Chip/styles.ts +46 -0
- package/src/CircleIndicator/CircleIndicator.stories.tsx +6 -6
- package/src/CircleIndicator/index.ts +1 -1
- package/src/Filter/Filter.tsx +88 -44
- package/src/Filter/FilterBar.tsx +15 -9
- package/src/Filter/FilterContent.tsx +8 -1
- package/src/Filter/FilterField/AutocompleteFilterField.tsx +61 -0
- package/src/Filter/FilterField/MultipleSelectFilterField.tsx +9 -3
- package/src/Filter/FilterField/MultipleValueAutocompleteFilterField.tsx +60 -0
- package/src/Filter/context.tsx +1 -1
- package/src/Filter/{Filter.stories.tsx → stories/Filter.stories.tsx} +47 -13
- package/src/Filter/stories/FilterInteractive.stories.tsx +97 -0
- package/src/Filter/stories/labels.ts +8 -0
- package/src/Filter/styles.ts +37 -6
- package/src/Filter/types.ts +8 -1
- package/src/Filter/utils.ts +71 -5
- package/src/IconButton/IconButton.tsx +17 -2
- package/src/IconButton/partials.ts +1 -1
- package/src/IconButton/styles.ts +38 -16
- package/src/MultipleValueAutocomplete/MultipleValueAutocomplete.stories.tsx +76 -0
- package/src/MultipleValueAutocomplete/MultipleValueAutocomplete.tsx +185 -0
- package/src/MultipleValueAutocomplete/fixtures.ts +122 -0
- package/src/MultipleValueAutocomplete/index.ts +1 -0
- package/src/MultipleValueAutocomplete/styles.ts +39 -0
- package/src/MultipleValueAutocomplete/useMultipleValueAutocomplete.ts +172 -0
- package/src/Savebar/Savebar.tsx +3 -4
- package/src/Sidebar/MenuItem.tsx +35 -14
- package/src/Sidebar/Sidebar.tsx +27 -11
- package/src/Sidebar/types.ts +9 -0
- package/src/Sidebar/utils.ts +23 -0
- package/src/SidebarDrawer/MenuItemBtn.tsx +12 -6
- package/src/SidebarDrawer/SidebarDrawer.tsx +8 -2
- package/src/SwitchSelector/SwitchSelector.stories.tsx +63 -0
- package/src/SwitchSelector/SwitchSelector.tsx +19 -0
- package/src/SwitchSelector/SwitchSelectorButton.tsx +59 -0
- package/src/SwitchSelector/index.ts +2 -0
- package/src/index.tsx +4 -1
- package/src/theme/ThemeProvider.tsx +6 -0
- package/src/theme/createSaleorTheme/createSaleorTheme.tsx +2 -1
- package/src/theme/createSaleorTheme/overrides/controls.ts +4 -1
- package/src/theme/createSaleorTheme/overrides/inputs.ts +1 -1
- package/src/theme/themes.ts +1 -1
- package/src/theme/types.ts +1 -0
- package/src/tools/useTextWidth.ts +20 -0
- package/src/utils/guideStyles.ts +5 -0
- package/src/utils/mergeRefs.ts +14 -0
- package/src/utils/useMockAutocomplete.ts +37 -0
|
@@ -3,6 +3,7 @@ import { ConfirmButtonTransitionState } from "../ConfirmButton";
|
|
|
3
3
|
export interface ActionBarProps {
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
state: ConfirmButtonTransitionState;
|
|
6
|
+
className?: string;
|
|
6
7
|
children: React.ReactNode[] | React.ReactNode;
|
|
7
8
|
}
|
|
8
9
|
export declare const ActionBar: React.FC<ActionBarProps>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
declare type AnchorFunction = {
|
|
3
|
+
(el: HTMLDivElement): void;
|
|
4
|
+
current: HTMLDivElement | null;
|
|
5
|
+
};
|
|
2
6
|
export interface ActionBarContextType {
|
|
3
|
-
anchor:
|
|
4
|
-
docked: boolean;
|
|
5
|
-
setDocked: (docked: boolean) => void;
|
|
7
|
+
anchor: AnchorFunction;
|
|
6
8
|
}
|
|
7
9
|
export declare const ActionBarContext: React.Context<ActionBarContextType | undefined>;
|
|
8
10
|
export declare const useActionBar: () => ActionBarContextType;
|
|
9
11
|
export declare const ActionBarProvider: React.FC;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PopperPlacementType } from "@material-ui/core/Popper";
|
|
2
|
+
import { StandardTextFieldProps } from "@material-ui/core/TextField";
|
|
3
|
+
import { UseComboboxGetItemPropsOptions } from "downshift";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { SyntheticChangeEvent } from "../../types/utils";
|
|
6
|
+
import { Choice } from "../Filter";
|
|
7
|
+
export interface AutocompleteProps extends StandardTextFieldProps {
|
|
8
|
+
children: (data: {
|
|
9
|
+
getItemProps: (opts: UseComboboxGetItemPropsOptions<Choice>) => any;
|
|
10
|
+
highlightedIndex: number;
|
|
11
|
+
inputValue: string;
|
|
12
|
+
}) => React.ReactNode | React.ReactNodeArray;
|
|
13
|
+
className?: string;
|
|
14
|
+
styles?: React.CSSProperties;
|
|
15
|
+
choices: Choice[];
|
|
16
|
+
label?: string;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
popperPlacement?: PopperPlacementType;
|
|
19
|
+
onChange?: (event: SyntheticChangeEvent) => void;
|
|
20
|
+
onInputChange?: (value: string) => void;
|
|
21
|
+
onScrollToBottom?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const Autocomplete: React.FC<AutocompleteProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Autocomplete";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ChipProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
3
|
+
startAdornment?: React.ReactElement;
|
|
4
|
+
startAdornmentClassName?: string;
|
|
5
|
+
endAdornment?: React.ReactElement;
|
|
6
|
+
endAdornmnetClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Chip: React.ForwardRefExoticComponent<Pick<ChipProps, "children" | "slot" | "style" | "title" | "dir" | "color" | "translate" | "hidden" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "key" | "endAdornment" | "startAdornment" | "startAdornmentClassName" | "endAdornmnetClassName"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChipProps } from "./Chip";
|
|
3
|
+
export interface ChipMovableProps extends ChipProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const ChipMovable: React.ForwardRefExoticComponent<Pick<ChipMovableProps, "children" | "slot" | "style" | "title" | "dir" | "color" | "translate" | "hidden" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "key" | "endAdornment" | "startAdornment" | "startAdornmentClassName" | "endAdornmnetClassName"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChipProps } from "./Chip";
|
|
3
|
+
export interface ChipRemovableProps extends ChipProps {
|
|
4
|
+
onRemove: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ChipRemovable: React.ForwardRefExoticComponent<Pick<ChipRemovableProps, "children" | "slot" | "style" | "title" | "dir" | "color" | "translate" | "hidden" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "key" | "endAdornment" | "startAdornment" | "startAdornmentClassName" | "endAdornmnetClassName" | "onRemove"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChipProps } from "./Chip";
|
|
3
|
+
export interface ChipSwatchProps extends Omit<ChipProps, "startAdornment"> {
|
|
4
|
+
onRemove?: () => void;
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChipSwatch: React.ForwardRefExoticComponent<Pick<ChipSwatchProps, "children" | "slot" | "style" | "title" | "dir" | "color" | "translate" | "hidden" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "key" | "endAdornment" | "startAdornmentClassName" | "endAdornmnetClassName" | "onRemove"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./CircleIndicator";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"filter" | "bar" | "menuContent" | "menuHeader" | "menuPaper" | "filterChip" | "filterChipContainer" | "filterDelete" | "filterName" | "filterValue" | "filterRange" | "filterInputInner" | "filterConjunction" | "filterValueCheckbox" | "filterValueSelected" | "filterRangeLabel" | "filterRangeValueContainer" | "selectPaper">;
|
|
1
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"filter" | "bar" | "menuContent" | "menuHeader" | "menuPaper" | "filterOptions" | "filterChip" | "filterChipContainer" | "filterDeleteContainer" | "filterDelete" | "filterName" | "filterValue" | "filterRange" | "filterInputInner" | "filterMultipleValueInputInner" | "filterConjunction" | "filterValueCheckbox" | "filterValueSelected" | "filterRangeLabel" | "filterRangeValueContainer" | "barAddBtn" | "selectPaper">;
|
|
2
2
|
export default useStyles;
|
|
@@ -2,14 +2,19 @@ import { TextFieldProps } from "@material-ui/core/TextField";
|
|
|
2
2
|
export declare enum FilterType {
|
|
3
3
|
Text = 0,
|
|
4
4
|
Choice = 1,
|
|
5
|
-
Range = 2
|
|
5
|
+
Range = 2,
|
|
6
|
+
Autocomplete = 3
|
|
6
7
|
}
|
|
8
|
+
export declare type Choice = Record<"label" | "value", string>;
|
|
7
9
|
export interface FilterDetailedOptions {
|
|
8
10
|
type: FilterType;
|
|
9
|
-
choices?:
|
|
11
|
+
choices?: Choice[];
|
|
10
12
|
default?: string;
|
|
11
13
|
multiple?: boolean;
|
|
12
14
|
InputProps?: Partial<TextFieldProps>;
|
|
15
|
+
group?: Record<"label" | "name", string>;
|
|
16
|
+
displayValues?: Choice[];
|
|
17
|
+
onInputChange?: (value: string) => void;
|
|
13
18
|
}
|
|
14
19
|
export interface FilterOptions {
|
|
15
20
|
name: string;
|
|
@@ -40,6 +45,7 @@ export interface FilterContextType {
|
|
|
40
45
|
toggle: (name: string) => void;
|
|
41
46
|
toggleRange: (name: string) => void;
|
|
42
47
|
unregister: (name: string) => void;
|
|
48
|
+
swap: (previousFilterName: string, nextFilterName: string) => void;
|
|
43
49
|
onChange: (name: string, value: string | string[], opts?: OnFilterChangeOpts) => void;
|
|
44
50
|
}
|
|
45
51
|
export declare type FilterLabels = Record<"where" | "and" | "is" | "range", string>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { FilterData, FilterDetailedOptions, FilterInput, OnFilterChangeOpts } from "./types";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function getFilterName(name: string, options: FilterDetailedOptions): string;
|
|
3
|
+
export declare function getAvailableFilterGroups(filterData: FilterData[]): Array<Record<"name" | "label", string>>;
|
|
4
|
+
export declare function getAvailableFilters(filterData: FilterData[]): Array<Record<"name" | "label", string>>;
|
|
3
5
|
export declare function getActiveFilters(filterData: FilterData[]): FilterData[];
|
|
4
6
|
export declare function validate(filterData: FilterData[]): void;
|
|
5
7
|
export declare function register(filterData: FilterData[], name: string, label: string, initial: FilterInput[], options: FilterDetailedOptions): FilterData[];
|
|
6
8
|
export declare function change(filterData: FilterData[], name: string, value: string | string[], opts?: OnFilterChangeOpts): FilterData[];
|
|
7
9
|
export declare function toggle(filterData: FilterData[], name: string): FilterData[];
|
|
8
10
|
export declare function toggleRange(filterData: FilterData[], name: string): FilterData[];
|
|
11
|
+
export declare function swap(filterData: FilterData[], previousFilterName: string, nextFilterName: string): FilterData[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IconButtonProps as MuiIconButtonProps } from "@material-ui/core/IconButton";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { UserInteraction } from "../../types/utils";
|
|
3
4
|
export declare type IconButtonProps<T extends React.ElementType = "button"> = Omit<MuiIconButtonProps<T>, "variant"> & {
|
|
4
5
|
error?: boolean;
|
|
5
6
|
hoverOutline?: boolean;
|
|
7
|
+
state?: UserInteraction;
|
|
6
8
|
variant?: "primary" | "secondary";
|
|
7
9
|
};
|
|
8
10
|
export declare const IconButton: React.FC<IconButtonProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"error" | "
|
|
1
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"error" | "active" | "hover" | "primary" | "secondary" | "hoverOutline" | "disabledError">;
|
|
2
2
|
export default useStyles;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PopperPlacementType } from "@material-ui/core/Popper";
|
|
2
|
+
import { StandardTextFieldProps } from "@material-ui/core/TextField";
|
|
3
|
+
import { UseComboboxGetItemPropsOptions } from "downshift";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { SyntheticChangeEvent } from "../../types/utils";
|
|
6
|
+
import { Choice } from "../Filter";
|
|
7
|
+
export interface MultipleValueAutocompleteProps extends Omit<StandardTextFieldProps, "onChange"> {
|
|
8
|
+
children: (data: {
|
|
9
|
+
getItemProps: (opts: UseComboboxGetItemPropsOptions<Choice>) => any;
|
|
10
|
+
highlightedIndex: number;
|
|
11
|
+
inputValue: string;
|
|
12
|
+
choices: Choice[];
|
|
13
|
+
}) => React.ReactNode | React.ReactNodeArray;
|
|
14
|
+
className?: string;
|
|
15
|
+
enableReinitialize?: boolean;
|
|
16
|
+
styles?: React.CSSProperties;
|
|
17
|
+
choices: Choice[];
|
|
18
|
+
label?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
popperPlacement?: PopperPlacementType;
|
|
21
|
+
initialValue?: Choice[];
|
|
22
|
+
onChange?: (event: SyntheticChangeEvent<string[]>) => void;
|
|
23
|
+
onInputChange?: (value: string) => void;
|
|
24
|
+
onScrollToBottom?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const MultipleValueAutocomplete: React.FC<MultipleValueAutocompleteProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./MultipleValueAutocomplete";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseComboboxGetItemPropsOptions } from "downshift";
|
|
3
|
+
import { SyntheticChangeEvent } from "../../types/utils";
|
|
4
|
+
import { Choice } from "../Filter";
|
|
5
|
+
export interface UseMultipleValueAutocomplete {
|
|
6
|
+
choices: Choice[];
|
|
7
|
+
enableReinitialize?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
initialValue: Choice[];
|
|
10
|
+
onChange?: (event: SyntheticChangeEvent<string[]>) => void;
|
|
11
|
+
onInputChange?: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function useMultipleValueAutocomplete({ choices, enableReinitialize, initialValue, name, onChange, onInputChange, }: UseMultipleValueAutocomplete): {
|
|
14
|
+
anchor: import("react").MutableRefObject<HTMLDivElement | undefined>;
|
|
15
|
+
comboboxProps: any;
|
|
16
|
+
filteredChoices: Choice[];
|
|
17
|
+
getItemProps: (options: UseComboboxGetItemPropsOptions<Choice>) => any;
|
|
18
|
+
getSelectedItemProps: (options: import("downshift").UseMultipleSelectionGetSelectedItemPropsOptions<Choice>) => any;
|
|
19
|
+
getToggleButtonProps: (options?: import("downshift").UseComboboxGetToggleButtonPropsOptions | undefined) => any;
|
|
20
|
+
highlightedIndex: number;
|
|
21
|
+
inputProps: any;
|
|
22
|
+
inputRef: (node: HTMLInputElement | undefined) => void;
|
|
23
|
+
inputValue: string;
|
|
24
|
+
inputWidth: number;
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
labelProps: any;
|
|
27
|
+
menuProps: any;
|
|
28
|
+
ref: (node: HTMLDivElement | undefined) => void;
|
|
29
|
+
removeSelectedItem: (item: Choice) => void;
|
|
30
|
+
selectedItems: Choice[];
|
|
31
|
+
};
|
|
32
|
+
export default useMultipleValueAutocomplete;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SidebarMenuItem } from "./types";
|
|
3
|
-
export interface
|
|
2
|
+
import { CustomLinkComponent, SidebarMenuItem } from "./types";
|
|
3
|
+
export interface MenuItemCommonProps {
|
|
4
4
|
activeId: string;
|
|
5
5
|
isMenuShrunk: boolean;
|
|
6
6
|
menuItem: SidebarMenuItem;
|
|
7
|
-
onClick: (menuItem: SidebarMenuItem) => void;
|
|
8
7
|
}
|
|
8
|
+
export declare type MenuItemProps = MenuItemCommonProps & ({
|
|
9
|
+
onClick: (menuItem: SidebarMenuItem) => void;
|
|
10
|
+
linkComponent?: never;
|
|
11
|
+
} | {
|
|
12
|
+
onClick?: never;
|
|
13
|
+
linkComponent: CustomLinkComponent;
|
|
14
|
+
});
|
|
9
15
|
export declare const menuWidth = 210;
|
|
10
16
|
export declare const shrunkMenuWidth = 72;
|
|
11
17
|
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
@@ -7,10 +7,18 @@ export interface SidebarMenuItem {
|
|
|
7
7
|
iconSrc?: string;
|
|
8
8
|
url?: string;
|
|
9
9
|
external?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
10
11
|
}
|
|
12
|
+
export declare type CustomLinkComponent = React.ForwardRefExoticComponent<{
|
|
13
|
+
href?: string;
|
|
14
|
+
onClick?: (...params: any) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
11
17
|
export interface BaseSidebarProps {
|
|
12
18
|
className?: string;
|
|
13
19
|
menuItems: SidebarMenuItem[];
|
|
14
20
|
toolbar?: React.ReactNode;
|
|
15
21
|
onMenuItemClick: (menuItem: SidebarMenuItem) => void;
|
|
22
|
+
linkComponent?: CustomLinkComponent;
|
|
23
|
+
logoHref?: string;
|
|
16
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomLinkComponent, SidebarMenuItem } from "./types";
|
|
2
|
+
export declare const getLinkProps: (menuItem: SidebarMenuItem) => {
|
|
3
|
+
href: string | undefined;
|
|
4
|
+
target: string;
|
|
5
|
+
} | {
|
|
6
|
+
href: string;
|
|
7
|
+
target?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
href?: undefined;
|
|
10
|
+
target?: undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const getLinkComponent: (menuItem: SidebarMenuItem, customComponent?: CustomLinkComponent | undefined) => "a" | "button" | CustomLinkComponent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SidebarMenuItem } from "../Sidebar/types";
|
|
2
|
+
import { CustomLinkComponent, SidebarMenuItem } from "../Sidebar/types";
|
|
3
3
|
export interface MenuItemBtnProps {
|
|
4
4
|
menuItem: SidebarMenuItem;
|
|
5
5
|
onClick: (menuItem: SidebarMenuItem) => void;
|
|
6
|
+
linkComponent?: CustomLinkComponent;
|
|
6
7
|
}
|
|
7
8
|
export declare const MenuItemBtn: React.FC<MenuItemBtnProps>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"code" | "border" | "grid" | "cell" | "paragraph" | "headline" | "sectionHeader">;
|
|
1
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"code" | "border" | "grid" | "cell" | "paragraph" | "headline" | "sectionHeader" | "gridCell">;
|
|
2
2
|
export default useStyles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare function useMockAutocomplete(choices: Array<Record<"label" | "value", string>>): {
|
|
3
|
+
search: (query: string) => NodeJS.Timeout;
|
|
4
|
+
results: {
|
|
5
|
+
score: number;
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
more: () => void;
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.5.0",
|
|
3
3
|
"license": "CC-BY-4.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -52,12 +52,6 @@
|
|
|
52
52
|
"react": "^16.8.0 || ^17.0.0",
|
|
53
53
|
"react-helmet": "^6.1.0"
|
|
54
54
|
},
|
|
55
|
-
"husky": {
|
|
56
|
-
"hooks": {
|
|
57
|
-
"pre-commit": "npm run lint",
|
|
58
|
-
"pre-push": "npm run lint"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
55
|
"np": {
|
|
62
56
|
"yarn": false
|
|
63
57
|
},
|
|
@@ -92,11 +86,12 @@
|
|
|
92
86
|
"@material-ui/icons": "^4.11.2",
|
|
93
87
|
"@material-ui/lab": "^4.0.0-alpha.58",
|
|
94
88
|
"@size-limit/preset-small-lib": "^4.10.2",
|
|
95
|
-
"@storybook/addon-essentials": "^6.
|
|
89
|
+
"@storybook/addon-essentials": "^6.4.22",
|
|
96
90
|
"@storybook/addon-info": "^5.3.21",
|
|
97
|
-
"@storybook/addon-links": "^6.
|
|
98
|
-
"@storybook/addons": "^6.
|
|
99
|
-
"@storybook/react": "^6.
|
|
91
|
+
"@storybook/addon-links": "^6.4.22",
|
|
92
|
+
"@storybook/addons": "^6.4.22",
|
|
93
|
+
"@storybook/react": "^6.4.22",
|
|
94
|
+
"@types/fuzzaldrin": "^2.1.4",
|
|
100
95
|
"@types/jest": "^27.0.2",
|
|
101
96
|
"@types/lodash": "^4.14.170",
|
|
102
97
|
"@types/lodash-es": "^4.17.5",
|
|
@@ -112,8 +107,10 @@
|
|
|
112
107
|
"esbuild-jest": "^0.5.0",
|
|
113
108
|
"eslint": "^7.32.0",
|
|
114
109
|
"eslint-plugin-simple-import-sort": "^5.0.3",
|
|
110
|
+
"eslint-plugin-storybook": "^0.5.10",
|
|
115
111
|
"faker": "^5.5.3",
|
|
116
|
-
"husky": "^
|
|
112
|
+
"husky": "^7.0.0",
|
|
113
|
+
"fuzzaldrin": "^2.1.0",
|
|
117
114
|
"hygen": "^6.1.0",
|
|
118
115
|
"jest": "^27.2.4",
|
|
119
116
|
"jest-file": "^1.0.0",
|
|
@@ -123,13 +120,14 @@
|
|
|
123
120
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
124
121
|
"react-is": "^17.0.2",
|
|
125
122
|
"size-limit": "^4.10.2",
|
|
126
|
-
"storybook-dark-mode": "^1.0.
|
|
123
|
+
"storybook-dark-mode": "^1.0.9",
|
|
127
124
|
"tslib": "^2.3.1",
|
|
128
125
|
"typescript": "^4.2.4",
|
|
129
126
|
"yargs": "^17.2.1"
|
|
130
127
|
},
|
|
131
128
|
"dependencies": {
|
|
132
129
|
"clsx": "^1.1.1",
|
|
130
|
+
"downshift": "^6.1.7",
|
|
133
131
|
"lodash": "^4.17.21",
|
|
134
132
|
"lodash-es": "^4.17.21",
|
|
135
133
|
"react-inlinesvg": "^2.3.0"
|