@saleor/macaw-ui 0.3.3 → 0.4.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/context.d.ts +6 -1
- 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/ColorSwatch.d.ts +6 -0
- package/dist/types/Chip/common/ChipMovable.d.ts +5 -0
- package/dist/types/Chip/common/ChipRemovable.d.ts +6 -0
- package/dist/types/Chip/common/ChipSwatch.d.ts +7 -0
- package/dist/types/Chip/common/index.d.ts +3 -0
- package/dist/types/Chip/index.d.ts +5 -0
- package/dist/types/Chip/private/ColorSwatch.d.ts +6 -0
- package/dist/{ActionBar → types/Chip}/styles.d.ts +1 -1
- package/dist/types/CircleIndicator/index.d.ts +1 -1
- package/dist/types/IconButton/styles.d.ts +1 -1
- 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/utils/guideStyles.d.ts +1 -1
- package/package.json +2 -8
- package/src/ActionBar/context.tsx +14 -2
- package/src/Chip/.DS_Store +0 -0
- 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 +45 -0
- package/src/CircleIndicator/CircleIndicator.stories.tsx +6 -6
- package/src/CircleIndicator/index.ts +1 -1
- package/src/Filter/FilterField/MultipleSelectFilterField.tsx +4 -2
- package/src/IconButton/IconButton.tsx +7 -5
- package/src/IconButton/styles.ts +34 -14
- 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/index.tsx +1 -1
- package/src/theme/createSaleorTheme/overrides/inputs.ts +1 -1
- package/src/theme/themes.ts +1 -1
- package/src/utils/guideStyles.ts +5 -0
- package/dist/ActionBar/ActionBar.d.ts +0 -8
- package/dist/ActionBar/ActionBar.stories.d.ts +0 -4
- package/dist/ActionBar/context.d.ts +0 -9
- package/dist/ActionBar/index.d.ts +0 -2
- package/dist/Alert/Alert.d.ts +0 -8
- package/dist/Alert/Alert.stories.d.ts +0 -12
- package/dist/Alert/AlertBase.d.ts +0 -8
- package/dist/Alert/index.d.ts +0 -2
- package/dist/Alert/styles.d.ts +0 -2
- package/dist/Backlink/Backlink.d.ts +0 -8
- package/dist/Backlink/Backlink.stories.d.ts +0 -5
- package/dist/Backlink/context.d.ts +0 -5
- package/dist/Backlink/index.d.ts +0 -2
- package/dist/Backlink/styles.d.ts +0 -2
- package/dist/BaseList/BaseList.d.ts +0 -26
- package/dist/BaseList/context.d.ts +0 -7
- package/dist/BaseList/index.d.ts +0 -1
- package/dist/BaseList/styles.d.ts +0 -5
- package/dist/Button/Button.d.ts +0 -16
- package/dist/Button/index.d.ts +0 -1
- package/dist/Button/styles.d.ts +0 -2
- package/dist/ConfirmButton/ConfirmButton.d.ts +0 -11
- package/dist/ConfirmButton/ConfirmButton.stories.d.ts +0 -8
- package/dist/ConfirmButton/index.d.ts +0 -1
- package/dist/ConfirmButton/styles.d.ts +0 -2
- package/dist/DialogHeader/DialogHeader.d.ts +0 -6
- package/dist/DialogHeader/index.d.ts +0 -1
- package/dist/DialogHeader/styles.d.ts +0 -1
- package/dist/DialogTable/DialogTable.d.ts +0 -6
- package/dist/DialogTable/index.d.ts +0 -1
- package/dist/DialogTable/styles.d.ts +0 -1
- package/dist/Filter/Filter.d.ts +0 -10
- package/dist/Filter/Filter.stories.d.ts +0 -5
- package/dist/Filter/FilterBar.d.ts +0 -11
- package/dist/Filter/FilterContent.d.ts +0 -7
- package/dist/Filter/FilterField/MultipleSelectFilterField.d.ts +0 -6
- package/dist/Filter/FilterField/RangeFilterField.d.ts +0 -7
- package/dist/Filter/FilterField/SelectFilterField.d.ts +0 -6
- package/dist/Filter/FilterField/TextFilterField.d.ts +0 -6
- package/dist/Filter/FilterMenu.d.ts +0 -9
- package/dist/Filter/context.d.ts +0 -4
- package/dist/Filter/index.d.ts +0 -4
- package/dist/Filter/styles.d.ts +0 -2
- package/dist/Filter/types.d.ts +0 -49
- package/dist/Filter/utils.d.ts +0 -8
- package/dist/IconButton/IconButton.d.ts +0 -8
- package/dist/IconButton/index.d.ts +0 -1
- package/dist/IconButton/partials.d.ts +0 -14
- package/dist/IconButton/styles.d.ts +0 -2
- package/dist/LayoutButton/LayoutButton.d.ts +0 -7
- package/dist/LayoutButton/index.d.ts +0 -1
- package/dist/LayoutButton/styles.d.ts +0 -2
- package/dist/List/List.d.ts +0 -13
- package/dist/List/List.stories.d.ts +0 -5
- package/dist/List/context.d.ts +0 -8
- package/dist/List/index.d.ts +0 -1
- package/dist/List/styles.d.ts +0 -1
- package/dist/Notification/Notification.d.ts +0 -3
- package/dist/Notification/Notification.stories.d.ts +0 -10
- package/dist/Notification/index.d.ts +0 -2
- package/dist/Notification/styles.d.ts +0 -2
- package/dist/Notification/types.d.ts +0 -16
- package/dist/OffsettedList/OffsettedList.d.ts +0 -12
- package/dist/OffsettedList/OffsettedList.stories.d.ts +0 -5
- package/dist/OffsettedList/index.d.ts +0 -1
- package/dist/OffsettedList/styles.d.ts +0 -2
- package/dist/PageTabs/PageTab.d.ts +0 -3
- package/dist/PageTabs/PageTab.stories.d.ts +0 -4
- package/dist/PageTabs/PageTabPanel.d.ts +0 -4
- package/dist/PageTabs/PageTabs.d.ts +0 -5
- package/dist/PageTabs/index.d.ts +0 -3
- package/dist/PageTabs/styles.d.ts +0 -2
- package/dist/Pagination/Pagination.d.ts +0 -10
- package/dist/Pagination/PaginationActions.d.ts +0 -11
- package/dist/Pagination/PaginationRowNumberSelect.d.ts +0 -11
- package/dist/Pagination/TablePagination.d.ts +0 -6
- package/dist/Pagination/index.d.ts +0 -4
- package/dist/Pagination/styles.d.ts +0 -2
- package/dist/PillLink/PillLink.d.ts +0 -15
- package/dist/PillLink/index.d.ts +0 -1
- package/dist/PillLink/styles.d.ts +0 -2
- package/dist/ResponsiveTable/ResponsiveTable.d.ts +0 -8
- package/dist/ResponsiveTable/index.d.ts +0 -1
- package/dist/ResponsiveTable/styles.d.ts +0 -2
- package/dist/Savebar/ButtonTooltipDecorator.d.ts +0 -6
- package/dist/Savebar/Savebar.d.ts +0 -14
- package/dist/Savebar/Savebar.stories.d.ts +0 -6
- package/dist/Savebar/index.d.ts +0 -1
- package/dist/Savebar/styles.d.ts +0 -2
- package/dist/ScrollShadow/ScrollShadow.d.ts +0 -6
- package/dist/ScrollShadow/index.d.ts +0 -1
- package/dist/ScrollShadow/styles.d.ts +0 -1
- package/dist/Sidebar/ExpandButton.d.ts +0 -6
- package/dist/Sidebar/MenuItem.d.ts +0 -11
- package/dist/Sidebar/Sidebar.d.ts +0 -6
- package/dist/Sidebar/Sidebar.stories.d.ts +0 -6
- package/dist/Sidebar/fixtures.d.ts +0 -2
- package/dist/Sidebar/index.d.ts +0 -4
- package/dist/Sidebar/types.d.ts +0 -16
- package/dist/SidebarDrawer/MenuItemBtn.d.ts +0 -7
- package/dist/SidebarDrawer/SidebarDrawer.d.ts +0 -4
- package/dist/SidebarDrawer/SidebarDrawer.stories.d.ts +0 -4
- package/dist/SidebarDrawer/index.d.ts +0 -2
- package/dist/SidebarDrawer/styles.d.ts +0 -2
- package/dist/SquareButton/SquareButton.d.ts +0 -3
- package/dist/SquareButton/SquareButton.stories.d.ts +0 -5
- package/dist/SquareButton/index.d.ts +0 -1
- package/dist/StatusChip/StatusChip.d.ts +0 -3
- package/dist/StatusChip/StatusChip.stories.d.ts +0 -8
- package/dist/StatusChip/index.d.ts +0 -2
- package/dist/StatusChip/styles.d.ts +0 -3
- package/dist/StatusChip/types.d.ts +0 -8
- package/dist/Tooltip/Tooltip.d.ts +0 -6
- package/dist/Tooltip/Tooltip.stories.d.ts +0 -7
- package/dist/Tooltip/index.d.ts +0 -1
- package/dist/Tooltip/styles.d.ts +0 -3
- package/dist/UserChipMenu/UserChipMenu.d.ts +0 -9
- package/dist/UserChipMenu/UserChipMenu.stories.d.ts +0 -6
- package/dist/UserChipMenu/UserChipMenuItem.d.ts +0 -6
- package/dist/UserChipMenu/context.d.ts +0 -4
- package/dist/UserChipMenu/index.d.ts +0 -2
- package/dist/UserChipMenu/styles.d.ts +0 -2
- package/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/sendMessage.d.ts +0 -3
- package/dist/extensions/types.d.ts +0 -22
- package/dist/extensions/useExtensionMessage.d.ts +0 -2
- package/dist/icons/ArrowDropdownIcon.d.ts +0 -2
- package/dist/icons/ArrowRightIcon.d.ts +0 -1
- package/dist/icons/CheckboxCheckedIcon.d.ts +0 -1
- package/dist/icons/CheckboxIcon.d.ts +0 -1
- package/dist/icons/CheckboxIndeterminateIcon.d.ts +0 -1
- package/dist/icons/CloseIcon.d.ts +0 -1
- package/dist/icons/CompleteIcon.d.ts +0 -2
- package/dist/icons/DeleteIcon.d.ts +0 -1
- package/dist/icons/EditIcon.d.ts +0 -1
- package/dist/icons/FilteringIcon.d.ts +0 -1
- package/dist/icons/ImageIcon.d.ts +0 -1
- package/dist/icons/InfoIcon.d.ts +0 -2
- package/dist/icons/Logo.d.ts +0 -2
- package/dist/icons/LogoLight.d.ts +0 -2
- package/dist/icons/MoreIcon.d.ts +0 -1
- package/dist/icons/NavigatorIcon.d.ts +0 -1
- package/dist/icons/NotAllowedIcon.d.ts +0 -2
- package/dist/icons/NotAllowedInvertedIcon.d.ts +0 -2
- package/dist/icons/PlusIcon.d.ts +0 -1
- package/dist/icons/RadioCheckedIcon.d.ts +0 -1
- package/dist/icons/RadioIcon.d.ts +0 -1
- package/dist/icons/SearchIcon.d.ts +0 -1
- package/dist/icons/WarningIcon.d.ts +0 -2
- package/dist/icons/index.d.ts +0 -18
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -7
- package/dist/localStorageKeys.d.ts +0 -4
- package/dist/mjs/index.js +0 -5
- package/dist/mjs/index.js.map +0 -7
- package/dist/theme/Baseline.d.ts +0 -2
- package/dist/theme/ThemeProvider.d.ts +0 -17
- package/dist/theme/context.d.ts +0 -3
- package/dist/theme/createSaleorTheme/createSaleorTheme.d.ts +0 -3
- package/dist/theme/createSaleorTheme/index.d.ts +0 -2
- package/dist/theme/createSaleorTheme/overrides/buttons.d.ts +0 -3
- package/dist/theme/createSaleorTheme/overrides/controls.d.ts +0 -3
- package/dist/theme/createSaleorTheme/overrides/index.d.ts +0 -3
- package/dist/theme/createSaleorTheme/overrides/inputs.d.ts +0 -3
- package/dist/theme/createSaleorTheme/overrides/tables.d.ts +0 -3
- package/dist/theme/createSaleorTheme/palette.d.ts +0 -2
- package/dist/theme/createSaleorTheme/shadows.d.ts +0 -2
- package/dist/theme/createSaleorTheme/types.d.ts +0 -51
- package/dist/theme/index.d.ts +0 -4
- package/dist/theme/styles.d.ts +0 -5
- package/dist/theme/themes.d.ts +0 -3
- package/dist/theme/types.d.ts +0 -6
- package/dist/theme/utils.d.ts +0 -1
- package/dist/theme/utils.test.d.ts +0 -1
- package/dist/tools/index.d.ts +0 -2
- package/dist/tools/useElementScroll.d.ts +0 -12
- package/dist/tools/useLocalStorage.d.ts +0 -5
- package/dist/tools/useWindowScroll.d.ts +0 -4
- package/dist/types/StatusChip/styles.d.ts +0 -3
- package/dist/utils/Decorator.d.ts +0 -4
- package/dist/utils/useListStory.d.ts +0 -21
|
@@ -1,7 +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:
|
|
7
|
+
anchor: AnchorFunction;
|
|
4
8
|
}
|
|
5
9
|
export declare const ActionBarContext: React.Context<ActionBarContextType | undefined>;
|
|
6
10
|
export declare const useActionBar: () => ActionBarContextType;
|
|
7
11
|
export declare const ActionBarProvider: React.FC;
|
|
12
|
+
export {};
|
|
@@ -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>>;
|
|
@@ -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"> & 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" | "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" | "onRemove"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"
|
|
1
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"endAdornment" | "startAdornment" | "chip" | "swatch">;
|
|
2
2
|
export default useStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./CircleIndicator";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"error" | "active" | "hover" | "
|
|
1
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"error" | "active" | "hover" | "primary" | "secondary" | "hoverOutline" | "disabledError">;
|
|
2
2
|
export default useStyles;
|
|
@@ -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>;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.4.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
|
},
|
|
@@ -113,7 +107,7 @@
|
|
|
113
107
|
"eslint": "^7.32.0",
|
|
114
108
|
"eslint-plugin-simple-import-sort": "^5.0.3",
|
|
115
109
|
"faker": "^5.5.3",
|
|
116
|
-
"husky": "^
|
|
110
|
+
"husky": "^7.0.0",
|
|
117
111
|
"hygen": "^6.1.0",
|
|
118
112
|
"jest": "^27.2.4",
|
|
119
113
|
"jest-file": "^1.0.0",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
// Imitate object returned from useRef
|
|
4
|
+
type AnchorFunction = {
|
|
5
|
+
(el: HTMLDivElement): void;
|
|
6
|
+
current: HTMLDivElement | null;
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
export interface ActionBarContextType {
|
|
4
|
-
anchor:
|
|
10
|
+
anchor: AnchorFunction;
|
|
5
11
|
}
|
|
6
12
|
|
|
7
13
|
export const ActionBarContext = React.createContext<
|
|
@@ -19,7 +25,13 @@ export const useActionBar = () => {
|
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
export const ActionBarProvider: React.FC = ({ children }) => {
|
|
22
|
-
const
|
|
28
|
+
const [anchorState, setAnchor] = React.useState<HTMLDivElement | null>(null);
|
|
29
|
+
|
|
30
|
+
const anchor = React.useMemo(() => {
|
|
31
|
+
const fn = setAnchor as AnchorFunction;
|
|
32
|
+
fn.current = anchorState;
|
|
33
|
+
return fn;
|
|
34
|
+
}, [anchorState]);
|
|
23
35
|
|
|
24
36
|
return (
|
|
25
37
|
<ActionBarContext.Provider value={{ anchor }}>
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import useStyles from "./styles";
|
|
5
|
+
|
|
6
|
+
export interface ChipProps
|
|
7
|
+
extends React.DetailedHTMLProps<
|
|
8
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
9
|
+
HTMLDivElement
|
|
10
|
+
> {
|
|
11
|
+
startAdornment?: React.ReactElement;
|
|
12
|
+
startAdornmentClassName?: string;
|
|
13
|
+
endAdornment?: React.ReactElement;
|
|
14
|
+
endAdornmnetClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Chip = React.forwardRef<HTMLDivElement, ChipProps>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
startAdornment,
|
|
21
|
+
startAdornmentClassName,
|
|
22
|
+
endAdornment,
|
|
23
|
+
endAdornmnetClassName,
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: ChipProps,
|
|
28
|
+
ref
|
|
29
|
+
) => {
|
|
30
|
+
const classes = useStyles();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={clsx(classes.chip, className)} ref={ref} {...props}>
|
|
34
|
+
{startAdornment && (
|
|
35
|
+
<span
|
|
36
|
+
className={clsx(classes.startAdornment, startAdornmentClassName)}
|
|
37
|
+
>
|
|
38
|
+
{startAdornment}
|
|
39
|
+
</span>
|
|
40
|
+
)}
|
|
41
|
+
<span>{children}</span>
|
|
42
|
+
{endAdornment && (
|
|
43
|
+
<span className={clsx(classes.endAdornment, endAdornmnetClassName)}>
|
|
44
|
+
{endAdornment}
|
|
45
|
+
</span>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
Chip.displayName = "Chip";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { makeStyles } from "../theme";
|
|
5
|
+
|
|
6
|
+
const useStyles = makeStyles(
|
|
7
|
+
(theme) => ({
|
|
8
|
+
adornment: {
|
|
9
|
+
color: theme.palette.primary.contrastText,
|
|
10
|
+
opacity: 0.6,
|
|
11
|
+
cursor: "pointer",
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
transition: theme.transitions.create("opacity", {
|
|
15
|
+
duration: theme.transitions.duration.short,
|
|
16
|
+
easing: theme.transitions.easing.easeOut,
|
|
17
|
+
}),
|
|
18
|
+
lineHeight: 0,
|
|
19
|
+
"&:hover": {
|
|
20
|
+
opacity: 1,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultCursor: {
|
|
24
|
+
cursor: "inherit",
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
{ name: "ChipAdornment" }
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export interface ChipAdornmentProps {
|
|
31
|
+
className?: string;
|
|
32
|
+
inheirtCursor?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const ChipAdornment: React.FC<ChipAdornmentProps> = ({
|
|
36
|
+
className,
|
|
37
|
+
inheirtCursor,
|
|
38
|
+
children,
|
|
39
|
+
}) => {
|
|
40
|
+
const classes = useStyles();
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<span
|
|
44
|
+
className={clsx(
|
|
45
|
+
classes.adornment,
|
|
46
|
+
inheirtCursor && classes.defaultCursor,
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</span>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { DragIcon } from "../icons";
|
|
5
|
+
import { makeStyles } from "../theme";
|
|
6
|
+
import { Chip, ChipProps } from "./Chip";
|
|
7
|
+
import { ChipAdornment } from "./ChipAdornment";
|
|
8
|
+
|
|
9
|
+
export interface ChipMovableProps extends ChipProps {}
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles(
|
|
12
|
+
() => ({
|
|
13
|
+
root: {
|
|
14
|
+
cursor: "move",
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
{ name: "ChipMovable" }
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const ChipMovable = React.forwardRef<HTMLDivElement, ChipMovableProps>(
|
|
21
|
+
({ startAdornment, className, ...props }, ref) => {
|
|
22
|
+
const classes = useStyles();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Chip
|
|
26
|
+
className={clsx(classes.root, className)}
|
|
27
|
+
startAdornment={
|
|
28
|
+
<ChipAdornment inheirtCursor>
|
|
29
|
+
<DragIcon aria-hidden="true" />
|
|
30
|
+
{startAdornment}
|
|
31
|
+
</ChipAdornment>
|
|
32
|
+
}
|
|
33
|
+
{...props}
|
|
34
|
+
ref={ref}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
ChipMovable.displayName = "ChipMovable";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CloseIcon } from "../icons";
|
|
4
|
+
import { Chip, ChipProps } from "./Chip";
|
|
5
|
+
import { ChipAdornment } from "./ChipAdornment";
|
|
6
|
+
|
|
7
|
+
export interface ChipRemovableProps extends ChipProps {
|
|
8
|
+
onRemove: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ChipRemovable = React.forwardRef<
|
|
12
|
+
HTMLDivElement,
|
|
13
|
+
ChipRemovableProps
|
|
14
|
+
>(({ endAdornment, onRemove, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<Chip
|
|
17
|
+
endAdornment={
|
|
18
|
+
<ChipAdornment>
|
|
19
|
+
<CloseIcon role="button" onClick={() => onRemove()} />
|
|
20
|
+
{endAdornment}
|
|
21
|
+
</ChipAdornment>
|
|
22
|
+
}
|
|
23
|
+
{...props}
|
|
24
|
+
ref={ref}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
ChipRemovable.displayName = "ChipRemovable";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CloseIcon } from "../icons";
|
|
4
|
+
import { makeStyles } from "../theme";
|
|
5
|
+
import { Chip, ChipProps } from "./Chip";
|
|
6
|
+
import { ChipAdornment } from "./ChipAdornment";
|
|
7
|
+
import { ColorSwatch } from "./private/ColorSwatch";
|
|
8
|
+
|
|
9
|
+
export interface ChipSwatchProps extends Omit<ChipProps, "startAdornment"> {
|
|
10
|
+
onRemove?: () => void;
|
|
11
|
+
color: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const useStyles = makeStyles({
|
|
15
|
+
swatchPosition: {
|
|
16
|
+
marginLeft: "-10px",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const ChipSwatch = React.forwardRef<HTMLDivElement, ChipSwatchProps>(
|
|
21
|
+
({ endAdornment, color, onRemove, ...props }, ref) => {
|
|
22
|
+
const classes = useStyles();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Chip
|
|
26
|
+
startAdornment={<ColorSwatch color={color} />}
|
|
27
|
+
startAdornmentClassName={classes.swatchPosition}
|
|
28
|
+
endAdornment={
|
|
29
|
+
onRemove && (
|
|
30
|
+
<ChipAdornment>
|
|
31
|
+
<CloseIcon role="button" onClick={() => onRemove()} />
|
|
32
|
+
</ChipAdornment>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
{...props}
|
|
36
|
+
ref={ref}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
ChipSwatch.displayName = "ChipSwatch";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import useStyles from "../styles";
|
|
5
|
+
|
|
6
|
+
export interface ColorSwatchProps {
|
|
7
|
+
color: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ColorSwatch = ({ color, className }: ColorSwatchProps) => {
|
|
12
|
+
const classes = useStyles();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={clsx(classes.swatch, className)}
|
|
17
|
+
style={{ background: color }}
|
|
18
|
+
aria-hidden="true"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|