@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.
Files changed (234) hide show
  1. package/README.md +20 -0
  2. package/dist/cjs/index.js +2 -2
  3. package/dist/cjs/index.js.map +3 -3
  4. package/dist/esm/index.js +2 -2
  5. package/dist/esm/index.js.map +3 -3
  6. package/dist/types/ActionBar/context.d.ts +6 -1
  7. package/dist/types/Chip/Chip.d.ts +8 -0
  8. package/dist/types/Chip/ChipAdornment.d.ts +6 -0
  9. package/dist/types/Chip/ChipMovable.d.ts +5 -0
  10. package/dist/types/Chip/ChipRemovable.d.ts +6 -0
  11. package/dist/types/Chip/ChipSwatch.d.ts +7 -0
  12. package/dist/types/Chip/ColorSwatch.d.ts +6 -0
  13. package/dist/types/Chip/common/ChipMovable.d.ts +5 -0
  14. package/dist/types/Chip/common/ChipRemovable.d.ts +6 -0
  15. package/dist/types/Chip/common/ChipSwatch.d.ts +7 -0
  16. package/dist/types/Chip/common/index.d.ts +3 -0
  17. package/dist/types/Chip/index.d.ts +5 -0
  18. package/dist/types/Chip/private/ColorSwatch.d.ts +6 -0
  19. package/dist/{ActionBar → types/Chip}/styles.d.ts +1 -1
  20. package/dist/types/CircleIndicator/index.d.ts +1 -1
  21. package/dist/types/IconButton/styles.d.ts +1 -1
  22. package/dist/types/Sidebar/MenuItem.d.ts +9 -3
  23. package/dist/types/Sidebar/types.d.ts +8 -0
  24. package/dist/types/Sidebar/utils.d.ts +12 -0
  25. package/dist/types/SidebarDrawer/MenuItemBtn.d.ts +2 -1
  26. package/dist/types/utils/guideStyles.d.ts +1 -1
  27. package/package.json +2 -8
  28. package/src/ActionBar/context.tsx +14 -2
  29. package/src/Chip/.DS_Store +0 -0
  30. package/src/Chip/Chip.tsx +52 -0
  31. package/src/Chip/ChipAdornment.tsx +53 -0
  32. package/src/Chip/ChipMovable.tsx +40 -0
  33. package/src/Chip/ChipRemovable.tsx +29 -0
  34. package/src/Chip/ChipSwatch.tsx +42 -0
  35. package/src/Chip/index.ts +5 -0
  36. package/src/Chip/private/ColorSwatch.tsx +21 -0
  37. package/src/Chip/styles.ts +45 -0
  38. package/src/CircleIndicator/CircleIndicator.stories.tsx +6 -6
  39. package/src/CircleIndicator/index.ts +1 -1
  40. package/src/Filter/FilterField/MultipleSelectFilterField.tsx +4 -2
  41. package/src/IconButton/IconButton.tsx +7 -5
  42. package/src/IconButton/styles.ts +34 -14
  43. package/src/Sidebar/MenuItem.tsx +35 -14
  44. package/src/Sidebar/Sidebar.tsx +27 -11
  45. package/src/Sidebar/types.ts +9 -0
  46. package/src/Sidebar/utils.ts +23 -0
  47. package/src/SidebarDrawer/MenuItemBtn.tsx +12 -6
  48. package/src/SidebarDrawer/SidebarDrawer.tsx +8 -2
  49. package/src/index.tsx +1 -1
  50. package/src/theme/createSaleorTheme/overrides/inputs.ts +1 -1
  51. package/src/theme/themes.ts +1 -1
  52. package/src/utils/guideStyles.ts +5 -0
  53. package/dist/ActionBar/ActionBar.d.ts +0 -8
  54. package/dist/ActionBar/ActionBar.stories.d.ts +0 -4
  55. package/dist/ActionBar/context.d.ts +0 -9
  56. package/dist/ActionBar/index.d.ts +0 -2
  57. package/dist/Alert/Alert.d.ts +0 -8
  58. package/dist/Alert/Alert.stories.d.ts +0 -12
  59. package/dist/Alert/AlertBase.d.ts +0 -8
  60. package/dist/Alert/index.d.ts +0 -2
  61. package/dist/Alert/styles.d.ts +0 -2
  62. package/dist/Backlink/Backlink.d.ts +0 -8
  63. package/dist/Backlink/Backlink.stories.d.ts +0 -5
  64. package/dist/Backlink/context.d.ts +0 -5
  65. package/dist/Backlink/index.d.ts +0 -2
  66. package/dist/Backlink/styles.d.ts +0 -2
  67. package/dist/BaseList/BaseList.d.ts +0 -26
  68. package/dist/BaseList/context.d.ts +0 -7
  69. package/dist/BaseList/index.d.ts +0 -1
  70. package/dist/BaseList/styles.d.ts +0 -5
  71. package/dist/Button/Button.d.ts +0 -16
  72. package/dist/Button/index.d.ts +0 -1
  73. package/dist/Button/styles.d.ts +0 -2
  74. package/dist/ConfirmButton/ConfirmButton.d.ts +0 -11
  75. package/dist/ConfirmButton/ConfirmButton.stories.d.ts +0 -8
  76. package/dist/ConfirmButton/index.d.ts +0 -1
  77. package/dist/ConfirmButton/styles.d.ts +0 -2
  78. package/dist/DialogHeader/DialogHeader.d.ts +0 -6
  79. package/dist/DialogHeader/index.d.ts +0 -1
  80. package/dist/DialogHeader/styles.d.ts +0 -1
  81. package/dist/DialogTable/DialogTable.d.ts +0 -6
  82. package/dist/DialogTable/index.d.ts +0 -1
  83. package/dist/DialogTable/styles.d.ts +0 -1
  84. package/dist/Filter/Filter.d.ts +0 -10
  85. package/dist/Filter/Filter.stories.d.ts +0 -5
  86. package/dist/Filter/FilterBar.d.ts +0 -11
  87. package/dist/Filter/FilterContent.d.ts +0 -7
  88. package/dist/Filter/FilterField/MultipleSelectFilterField.d.ts +0 -6
  89. package/dist/Filter/FilterField/RangeFilterField.d.ts +0 -7
  90. package/dist/Filter/FilterField/SelectFilterField.d.ts +0 -6
  91. package/dist/Filter/FilterField/TextFilterField.d.ts +0 -6
  92. package/dist/Filter/FilterMenu.d.ts +0 -9
  93. package/dist/Filter/context.d.ts +0 -4
  94. package/dist/Filter/index.d.ts +0 -4
  95. package/dist/Filter/styles.d.ts +0 -2
  96. package/dist/Filter/types.d.ts +0 -49
  97. package/dist/Filter/utils.d.ts +0 -8
  98. package/dist/IconButton/IconButton.d.ts +0 -8
  99. package/dist/IconButton/index.d.ts +0 -1
  100. package/dist/IconButton/partials.d.ts +0 -14
  101. package/dist/IconButton/styles.d.ts +0 -2
  102. package/dist/LayoutButton/LayoutButton.d.ts +0 -7
  103. package/dist/LayoutButton/index.d.ts +0 -1
  104. package/dist/LayoutButton/styles.d.ts +0 -2
  105. package/dist/List/List.d.ts +0 -13
  106. package/dist/List/List.stories.d.ts +0 -5
  107. package/dist/List/context.d.ts +0 -8
  108. package/dist/List/index.d.ts +0 -1
  109. package/dist/List/styles.d.ts +0 -1
  110. package/dist/Notification/Notification.d.ts +0 -3
  111. package/dist/Notification/Notification.stories.d.ts +0 -10
  112. package/dist/Notification/index.d.ts +0 -2
  113. package/dist/Notification/styles.d.ts +0 -2
  114. package/dist/Notification/types.d.ts +0 -16
  115. package/dist/OffsettedList/OffsettedList.d.ts +0 -12
  116. package/dist/OffsettedList/OffsettedList.stories.d.ts +0 -5
  117. package/dist/OffsettedList/index.d.ts +0 -1
  118. package/dist/OffsettedList/styles.d.ts +0 -2
  119. package/dist/PageTabs/PageTab.d.ts +0 -3
  120. package/dist/PageTabs/PageTab.stories.d.ts +0 -4
  121. package/dist/PageTabs/PageTabPanel.d.ts +0 -4
  122. package/dist/PageTabs/PageTabs.d.ts +0 -5
  123. package/dist/PageTabs/index.d.ts +0 -3
  124. package/dist/PageTabs/styles.d.ts +0 -2
  125. package/dist/Pagination/Pagination.d.ts +0 -10
  126. package/dist/Pagination/PaginationActions.d.ts +0 -11
  127. package/dist/Pagination/PaginationRowNumberSelect.d.ts +0 -11
  128. package/dist/Pagination/TablePagination.d.ts +0 -6
  129. package/dist/Pagination/index.d.ts +0 -4
  130. package/dist/Pagination/styles.d.ts +0 -2
  131. package/dist/PillLink/PillLink.d.ts +0 -15
  132. package/dist/PillLink/index.d.ts +0 -1
  133. package/dist/PillLink/styles.d.ts +0 -2
  134. package/dist/ResponsiveTable/ResponsiveTable.d.ts +0 -8
  135. package/dist/ResponsiveTable/index.d.ts +0 -1
  136. package/dist/ResponsiveTable/styles.d.ts +0 -2
  137. package/dist/Savebar/ButtonTooltipDecorator.d.ts +0 -6
  138. package/dist/Savebar/Savebar.d.ts +0 -14
  139. package/dist/Savebar/Savebar.stories.d.ts +0 -6
  140. package/dist/Savebar/index.d.ts +0 -1
  141. package/dist/Savebar/styles.d.ts +0 -2
  142. package/dist/ScrollShadow/ScrollShadow.d.ts +0 -6
  143. package/dist/ScrollShadow/index.d.ts +0 -1
  144. package/dist/ScrollShadow/styles.d.ts +0 -1
  145. package/dist/Sidebar/ExpandButton.d.ts +0 -6
  146. package/dist/Sidebar/MenuItem.d.ts +0 -11
  147. package/dist/Sidebar/Sidebar.d.ts +0 -6
  148. package/dist/Sidebar/Sidebar.stories.d.ts +0 -6
  149. package/dist/Sidebar/fixtures.d.ts +0 -2
  150. package/dist/Sidebar/index.d.ts +0 -4
  151. package/dist/Sidebar/types.d.ts +0 -16
  152. package/dist/SidebarDrawer/MenuItemBtn.d.ts +0 -7
  153. package/dist/SidebarDrawer/SidebarDrawer.d.ts +0 -4
  154. package/dist/SidebarDrawer/SidebarDrawer.stories.d.ts +0 -4
  155. package/dist/SidebarDrawer/index.d.ts +0 -2
  156. package/dist/SidebarDrawer/styles.d.ts +0 -2
  157. package/dist/SquareButton/SquareButton.d.ts +0 -3
  158. package/dist/SquareButton/SquareButton.stories.d.ts +0 -5
  159. package/dist/SquareButton/index.d.ts +0 -1
  160. package/dist/StatusChip/StatusChip.d.ts +0 -3
  161. package/dist/StatusChip/StatusChip.stories.d.ts +0 -8
  162. package/dist/StatusChip/index.d.ts +0 -2
  163. package/dist/StatusChip/styles.d.ts +0 -3
  164. package/dist/StatusChip/types.d.ts +0 -8
  165. package/dist/Tooltip/Tooltip.d.ts +0 -6
  166. package/dist/Tooltip/Tooltip.stories.d.ts +0 -7
  167. package/dist/Tooltip/index.d.ts +0 -1
  168. package/dist/Tooltip/styles.d.ts +0 -3
  169. package/dist/UserChipMenu/UserChipMenu.d.ts +0 -9
  170. package/dist/UserChipMenu/UserChipMenu.stories.d.ts +0 -6
  171. package/dist/UserChipMenu/UserChipMenuItem.d.ts +0 -6
  172. package/dist/UserChipMenu/context.d.ts +0 -4
  173. package/dist/UserChipMenu/index.d.ts +0 -2
  174. package/dist/UserChipMenu/styles.d.ts +0 -2
  175. package/dist/extensions/index.d.ts +0 -3
  176. package/dist/extensions/sendMessage.d.ts +0 -3
  177. package/dist/extensions/types.d.ts +0 -22
  178. package/dist/extensions/useExtensionMessage.d.ts +0 -2
  179. package/dist/icons/ArrowDropdownIcon.d.ts +0 -2
  180. package/dist/icons/ArrowRightIcon.d.ts +0 -1
  181. package/dist/icons/CheckboxCheckedIcon.d.ts +0 -1
  182. package/dist/icons/CheckboxIcon.d.ts +0 -1
  183. package/dist/icons/CheckboxIndeterminateIcon.d.ts +0 -1
  184. package/dist/icons/CloseIcon.d.ts +0 -1
  185. package/dist/icons/CompleteIcon.d.ts +0 -2
  186. package/dist/icons/DeleteIcon.d.ts +0 -1
  187. package/dist/icons/EditIcon.d.ts +0 -1
  188. package/dist/icons/FilteringIcon.d.ts +0 -1
  189. package/dist/icons/ImageIcon.d.ts +0 -1
  190. package/dist/icons/InfoIcon.d.ts +0 -2
  191. package/dist/icons/Logo.d.ts +0 -2
  192. package/dist/icons/LogoLight.d.ts +0 -2
  193. package/dist/icons/MoreIcon.d.ts +0 -1
  194. package/dist/icons/NavigatorIcon.d.ts +0 -1
  195. package/dist/icons/NotAllowedIcon.d.ts +0 -2
  196. package/dist/icons/NotAllowedInvertedIcon.d.ts +0 -2
  197. package/dist/icons/PlusIcon.d.ts +0 -1
  198. package/dist/icons/RadioCheckedIcon.d.ts +0 -1
  199. package/dist/icons/RadioIcon.d.ts +0 -1
  200. package/dist/icons/SearchIcon.d.ts +0 -1
  201. package/dist/icons/WarningIcon.d.ts +0 -2
  202. package/dist/icons/index.d.ts +0 -18
  203. package/dist/index.d.ts +0 -29
  204. package/dist/index.js +0 -2
  205. package/dist/index.js.map +0 -7
  206. package/dist/localStorageKeys.d.ts +0 -4
  207. package/dist/mjs/index.js +0 -5
  208. package/dist/mjs/index.js.map +0 -7
  209. package/dist/theme/Baseline.d.ts +0 -2
  210. package/dist/theme/ThemeProvider.d.ts +0 -17
  211. package/dist/theme/context.d.ts +0 -3
  212. package/dist/theme/createSaleorTheme/createSaleorTheme.d.ts +0 -3
  213. package/dist/theme/createSaleorTheme/index.d.ts +0 -2
  214. package/dist/theme/createSaleorTheme/overrides/buttons.d.ts +0 -3
  215. package/dist/theme/createSaleorTheme/overrides/controls.d.ts +0 -3
  216. package/dist/theme/createSaleorTheme/overrides/index.d.ts +0 -3
  217. package/dist/theme/createSaleorTheme/overrides/inputs.d.ts +0 -3
  218. package/dist/theme/createSaleorTheme/overrides/tables.d.ts +0 -3
  219. package/dist/theme/createSaleorTheme/palette.d.ts +0 -2
  220. package/dist/theme/createSaleorTheme/shadows.d.ts +0 -2
  221. package/dist/theme/createSaleorTheme/types.d.ts +0 -51
  222. package/dist/theme/index.d.ts +0 -4
  223. package/dist/theme/styles.d.ts +0 -5
  224. package/dist/theme/themes.d.ts +0 -3
  225. package/dist/theme/types.d.ts +0 -6
  226. package/dist/theme/utils.d.ts +0 -1
  227. package/dist/theme/utils.test.d.ts +0 -1
  228. package/dist/tools/index.d.ts +0 -2
  229. package/dist/tools/useElementScroll.d.ts +0 -12
  230. package/dist/tools/useLocalStorage.d.ts +0 -5
  231. package/dist/tools/useWindowScroll.d.ts +0 -4
  232. package/dist/types/StatusChip/styles.d.ts +0 -3
  233. package/dist/utils/Decorator.d.ts +0 -4
  234. 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: React.RefObject<HTMLDivElement>;
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,6 @@
1
+ import React from "react";
2
+ export interface ChipAdornmentProps {
3
+ className?: string;
4
+ inheirtCursor?: boolean;
5
+ }
6
+ export declare const ChipAdornment: React.FC<ChipAdornmentProps>;
@@ -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,6 @@
1
+ /// <reference types="react" />
2
+ export interface ColorSwatchProps {
3
+ color: string;
4
+ className?: string;
5
+ }
6
+ export declare const ColorSwatch: ({ color, className }: ColorSwatchProps) => JSX.Element;
@@ -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>>;
@@ -0,0 +1,3 @@
1
+ export * from "./ChipMovable";
2
+ export * from "./ChipRemovable";
3
+ export * from "./ChipSwatch";
@@ -0,0 +1,5 @@
1
+ export * from "./Chip";
2
+ export * from "./ChipAdornment";
3
+ export * from "./ChipMovable";
4
+ export * from "./ChipRemovable";
5
+ export * from "./ChipSwatch";
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface ColorSwatchProps {
3
+ color: string;
4
+ className?: string;
5
+ }
6
+ export declare const ColorSwatch: ({ color, className }: ColorSwatchProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"paper" | "root" | "content">;
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 './CircleIndicator';
1
+ export * from "./CircleIndicator";
@@ -1,2 +1,2 @@
1
- declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"error" | "active" | "hover" | "secondary" | "disabledError" | "hoverOutline">;
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 MenuItemProps {
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.3.3",
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": "^6.0.0",
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: React.RefObject<HTMLDivElement>;
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 anchor = React.useRef<HTMLDivElement | null>(null);
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,5 @@
1
+ export * from "./Chip";
2
+ export * from "./ChipAdornment";
3
+ export * from "./ChipMovable";
4
+ export * from "./ChipRemovable";
5
+ export * from "./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
+ };