@orfium/ictinus 4.6.1 → 4.9.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/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +17 -1
- package/dist/components/Avatar/Avatar.style.js +7 -1
- package/dist/components/Chip/Chip.d.ts +22 -20
- package/dist/components/Chip/Chip.js +55 -20
- package/dist/components/Chip/Chip.style.d.ts +2 -2
- package/dist/components/Chip/Chip.style.js +25 -53
- package/dist/components/Chip/components/Badge/Badge.d.ts +8 -0
- package/dist/components/Chip/components/Badge/Badge.js +31 -0
- package/dist/components/Chip/components/Badge/Badge.style.d.ts +4 -0
- package/dist/components/Chip/components/Badge/Badge.style.js +26 -0
- package/dist/components/Chip/components/Badge/index.d.ts +1 -0
- package/dist/components/Chip/components/Badge/index.js +10 -0
- package/dist/components/List/List.d.ts +5 -3
- package/dist/components/List/List.js +10 -2
- package/dist/components/List/List.style.d.ts +5 -0
- package/dist/components/List/List.style.js +21 -3
- package/dist/components/List/ListItem/ListItem.d.ts +3 -1
- package/dist/components/List/ListItem/ListItem.js +6 -33
- package/dist/components/List/ListItem/ListItem.style.d.ts +2 -1
- package/dist/components/List/ListItem/ListItem.style.js +4 -3
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.d.ts +14 -0
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.js +36 -0
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.style.d.ts +8 -0
- package/dist/components/List/ListItemGroup/ListGroupTitle/ListGroupTitle.style.js +41 -0
- package/dist/components/List/ListItemGroup/ListGroupTitle/index.d.ts +1 -0
- package/dist/components/List/ListItemGroup/ListGroupTitle/index.js +10 -0
- package/dist/components/List/ListItemGroup/ListItemGroup.d.ts +18 -0
- package/dist/components/List/ListItemGroup/ListItemGroup.js +64 -0
- package/dist/components/List/ListItemGroup/index.d.ts +1 -0
- package/dist/components/List/ListItemGroup/index.js +10 -0
- package/dist/components/List/NormalList/NormalList.d.ts +1 -0
- package/dist/components/List/NormalList/NormalList.js +22 -21
- package/dist/components/List/NormalList/NormalList.style.d.ts +0 -7
- package/dist/components/List/NormalList/NormalList.style.js +1 -24
- package/dist/components/List/VirtualizedList/VirtualizedList.js +45 -14
- package/dist/components/List/utils.d.ts +1 -0
- package/dist/components/List/utils.js +26 -2
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/Select/Select.js +14 -2
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/components/RenderRowOrNestedRow/RenderRowOrNestedRow.js +5 -1
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.d.ts +1 -0
- package/dist/components/Table/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.js +9 -2
- package/dist/components/TruncatedContent/TruncatedContent.d.ts +11 -0
- package/dist/components/TruncatedContent/TruncatedContent.js +69 -0
- package/dist/components/TruncatedContent/TruncatedContent.style.d.ts +4 -0
- package/dist/components/TruncatedContent/TruncatedContent.style.js +26 -0
- package/dist/components/TruncatedContent/index.d.ts +1 -0
- package/dist/components/TruncatedContent/index.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/dist/theme/typography.d.ts +1 -0
- package/dist/theme/typography.js +1 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare type Props = {
|
|
|
23
23
|
/** The class name of the avatar component if its styled **/
|
|
24
24
|
className?: string;
|
|
25
25
|
};
|
|
26
|
-
export declare type AvatarSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
26
|
+
export declare type AvatarSizes = 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
27
27
|
export declare type AvatarShapes = 'regular' | 'rounded' | 'circular';
|
|
28
28
|
declare const Avatar: React.ForwardRefExoticComponent<Pick<Props & DivProps, "children" | "onChange" | "onBlur" | "onClick" | "type" | "autoFocus" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "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" | "onBlurCapture" | "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" | "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" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "download" | "encType" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "sizes" | "span" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "width" | "wmode" | "wrap" | "key" | keyof Props> & React.RefAttributes<HTMLDivElement>>;
|
|
29
29
|
export default Avatar;
|
|
@@ -17,6 +17,22 @@ var _react2 = require("@emotion/react");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
+
var iconSizeBasedOnAvatar = function iconSizeBasedOnAvatar(size) {
|
|
21
|
+
switch (size) {
|
|
22
|
+
case 'xs':
|
|
23
|
+
return 18;
|
|
24
|
+
|
|
25
|
+
case 'xxs':
|
|
26
|
+
return 18;
|
|
27
|
+
|
|
28
|
+
case 'xxxs':
|
|
29
|
+
return 10;
|
|
30
|
+
|
|
31
|
+
default:
|
|
32
|
+
return 20;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
20
36
|
var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
21
37
|
var _ref$src = _ref.src,
|
|
22
38
|
src = _ref$src === void 0 ? '' : _ref$src,
|
|
@@ -45,7 +61,7 @@ var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
45
61
|
}), !src && !children && iconName && (0, _react2.jsx)(_Icon["default"], {
|
|
46
62
|
color: (0, _palette.pickTextColorFromSwatches)(calculatedColor.color, calculatedColor.shade),
|
|
47
63
|
name: iconName,
|
|
48
|
-
size: size
|
|
64
|
+
size: iconSizeBasedOnAvatar(size)
|
|
49
65
|
}), !src && children);
|
|
50
66
|
});
|
|
51
67
|
|
|
@@ -25,6 +25,9 @@ var sizeBasedOnProp = function sizeBasedOnProp(size) {
|
|
|
25
25
|
case 'xxs':
|
|
26
26
|
return (0, _utils.rem)(20);
|
|
27
27
|
|
|
28
|
+
case 'xxxs':
|
|
29
|
+
return (0, _utils.rem)(16);
|
|
30
|
+
|
|
28
31
|
default:
|
|
29
32
|
return (0, _utils.rem)(56);
|
|
30
33
|
}
|
|
@@ -54,6 +57,9 @@ var fontSizeBasedOnProp = function fontSizeBasedOnProp(theme, size) {
|
|
|
54
57
|
case 'xxs':
|
|
55
58
|
return theme.typography.fontSizes['11'];
|
|
56
59
|
|
|
60
|
+
case 'xxxs':
|
|
61
|
+
return theme.typography.fontSizes['8'];
|
|
62
|
+
|
|
57
63
|
default:
|
|
58
64
|
return theme.typography.fontSizes['18'];
|
|
59
65
|
}
|
|
@@ -69,7 +75,7 @@ var avatarStyle = function avatarStyle(_ref) {
|
|
|
69
75
|
/*#__PURE__*/
|
|
70
76
|
|
|
71
77
|
/*#__PURE__*/
|
|
72
|
-
(0, _react.css)(_functions.flex, ";width:", sizeBasedOnProp(size), ";height:", sizeBasedOnProp(size), ";border-radius:", shapeBasedOnProp(shape), ";background:", theme.utils.getColor(fill, fillShade), ";overflow:hidden;position:relative;font-size:", fontSizeBasedOnProp(theme, size), ";align-items:center;flex-shrink:0;line-height:1;user-select:none;justify-content:center;color:", (0, _palette.pickTextColorFromSwatches)(fill, fillShade), ";img{border-radius:100%;width:100%;height:100%;}" + (process.env.NODE_ENV === "production" ? "" : ";label:avatarStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
78
|
+
(0, _react.css)(_functions.flex, ";width:", sizeBasedOnProp(size), ";height:", sizeBasedOnProp(size), ";border-radius:", shapeBasedOnProp(shape), ";background:", theme.utils.getColor(fill, fillShade), ";overflow:hidden;position:relative;font-size:", fontSizeBasedOnProp(theme, size), ";align-items:center;flex-shrink:0;line-height:1;user-select:none;justify-content:center;color:", (0, _palette.pickTextColorFromSwatches)(fill, fillShade), ";img{border-radius:100%;width:100%;height:100%;}" + (process.env.NODE_ENV === "production" ? "" : ";label:avatarStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0F2YXRhci9BdmF0YXIuc3R5bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNkQ2QyIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9BdmF0YXIvQXZhdGFyLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWx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kOiAke3RoZW1lLnV0aWxzLmdldENvbG9yKGZpbGwsIGZpbGxTaGFkZSl9O1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIGZvbnQtc2l6ZTogJHtmb250U2l6ZUJhc2VkT25Qcm9wKHRoZW1lLCBzaXplKX07XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGZsZXgtc2hyaW5rOiAwO1xuICBsaW5lLWhlaWdodDogMTtcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBjb2xvcjogJHtwaWNrVGV4dENvbG9yRnJvbVN3YXRjaGVzKGZpbGwsIGZpbGxTaGFkZSl9O1xuXG4gIGltZyB7XG4gICAgYm9yZGVyLXJhZGl1czogMTAwJTtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBoZWlnaHQ6IDEwMCU7XG4gIH1cbmA7XG4iXX0= */", process.env.NODE_ENV === "production" ? "" : ";label:avatarStyle;")
|
|
73
79
|
);
|
|
74
80
|
};
|
|
75
81
|
};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
+
import { ClickEvent } from 'hooks/useLoading';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
+
import { flatColors } from 'theme/palette';
|
|
3
4
|
import { TestId } from 'utils/types';
|
|
4
5
|
import { DivProps } from '../../utils/common';
|
|
5
6
|
export declare type Props = {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @default
|
|
8
|
+
* Determines whether the chip should be read-only or interactive.
|
|
9
|
+
* @default read-only
|
|
9
10
|
*/
|
|
10
|
-
styleType?: '
|
|
11
|
-
/**
|
|
12
|
-
* @default md
|
|
13
|
-
* */
|
|
14
|
-
size?: 'md' | 'sm';
|
|
15
|
-
/** Defines the fill color of the component, if filled */
|
|
11
|
+
styleType?: 'read-only' | 'interactive';
|
|
12
|
+
/** Defines the fill color of the component, if filled. */
|
|
16
13
|
fill?: typeof flatColors[number];
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
/** An optional thumbnail to show to the left. */
|
|
15
|
+
thumbnail?: {
|
|
16
|
+
src?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Boolean defining if the chip is selected. */
|
|
20
|
+
isSelected?: boolean;
|
|
21
|
+
/** Boolean defining if the check icon is shown. */
|
|
22
|
+
isChecked?: boolean;
|
|
23
|
+
/** Defines the number value of the badge */
|
|
24
|
+
badgeNumber?: number;
|
|
25
|
+
/** Callback function for onClick. */
|
|
26
|
+
onClick?: (event: ClickEvent) => void;
|
|
27
|
+
/** A callback that is being triggered when type is interactive and you press the X icon. */
|
|
28
|
+
onClear?: () => void;
|
|
27
29
|
};
|
|
28
30
|
declare type TestProps = {
|
|
29
31
|
dataTestId?: TestId;
|
|
30
32
|
};
|
|
31
|
-
declare const Chip: React.ForwardRefExoticComponent<Pick<Props & TestProps & DivProps, "children" | "onChange" | "color" | "onBlur" | "
|
|
33
|
+
declare const Chip: React.ForwardRefExoticComponent<Pick<Props & TestProps & DivProps, "children" | "onChange" | "color" | "onBlur" | "type" | "autoFocus" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "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" | "onBlurCapture" | "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" | "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" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "download" | "encType" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "width" | "wmode" | "wrap" | "key" | "dataTestId" | keyof Props> & React.RefAttributes<HTMLDivElement>>;
|
|
32
34
|
export default Chip;
|
|
@@ -7,44 +7,79 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _helpers = require("../../utils/helpers");
|
|
9
9
|
|
|
10
|
+
var _palette = require("../../theme/palette");
|
|
11
|
+
|
|
10
12
|
var _Chip = require("./Chip.style");
|
|
11
13
|
|
|
14
|
+
var _Badge = _interopRequireDefault(require("./components/Badge"));
|
|
15
|
+
|
|
16
|
+
var _Avatar = _interopRequireDefault(require("../Avatar"));
|
|
17
|
+
|
|
18
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
19
|
+
|
|
12
20
|
var _react2 = require("@emotion/react");
|
|
13
21
|
|
|
14
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
23
|
|
|
16
24
|
var Chip = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
17
25
|
var _ref$styleType = _ref.styleType,
|
|
18
|
-
styleType = _ref$styleType === void 0 ? '
|
|
19
|
-
_ref$size = _ref.size,
|
|
20
|
-
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
26
|
+
styleType = _ref$styleType === void 0 ? 'read-only' : _ref$styleType,
|
|
21
27
|
fill = _ref.fill,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
thumbnail = _ref.thumbnail,
|
|
29
|
+
isSelected = _ref.isSelected,
|
|
30
|
+
isChecked = _ref.isChecked,
|
|
31
|
+
badgeNumber = _ref.badgeNumber,
|
|
32
|
+
onClick = _ref.onClick,
|
|
33
|
+
onClear = _ref.onClear,
|
|
27
34
|
_ref$dataTestId = _ref.dataTestId,
|
|
28
35
|
dataTestId = _ref$dataTestId === void 0 ? '' : _ref$dataTestId,
|
|
29
36
|
children = _ref.children;
|
|
37
|
+
|
|
38
|
+
if (styleType === 'read-only' && (isSelected || isChecked || badgeNumber)) {
|
|
39
|
+
throw new Error('The properties isSelected, isChecked and badgeNumber are only for Interactive style type Chips.');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (styleType === 'interactive' && thumbnail) {
|
|
43
|
+
throw new Error('The property thumbnail is only for Read-Only style type Chips.');
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
return (0, _react2.jsx)("div", {
|
|
31
47
|
ref: ref,
|
|
32
48
|
"data-testid": (0, _helpers.generateTestDataId)('chip', dataTestId),
|
|
33
|
-
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
css: (0, _Chip.chipStyle)({
|
|
34
51
|
styleType: styleType,
|
|
35
|
-
size: size,
|
|
36
52
|
fill: fill,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
isSelected: isSelected,
|
|
54
|
+
onClear: onClear,
|
|
55
|
+
onClick: onClick
|
|
40
56
|
})
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
}, isChecked && (0, _react2.jsx)(_Icon["default"], {
|
|
58
|
+
size: 14,
|
|
59
|
+
name: 'checkmark',
|
|
60
|
+
color: 'darkGrey',
|
|
61
|
+
variant: 850
|
|
62
|
+
}), thumbnail && (0, _react2.jsx)("div", null, (0, _react2.jsx)(_Avatar["default"], {
|
|
63
|
+
size: 'xxxs',
|
|
64
|
+
color: fill + "-" + _palette.BASE_SHADE,
|
|
65
|
+
src: thumbnail.src
|
|
66
|
+
}, thumbnail.name)), (0, _react2.jsx)("div", null, children), badgeNumber && (0, _react2.jsx)(_Badge["default"], {
|
|
67
|
+
fill: fill,
|
|
68
|
+
badgeNumber: badgeNumber,
|
|
69
|
+
isSelected: isSelected,
|
|
70
|
+
dataTestId: dataTestId
|
|
71
|
+
}), onClear && (0, _react2.jsx)("div", {
|
|
72
|
+
css: (0, _Chip.closeIconWrapperStyle)()
|
|
73
|
+
}, (0, _react2.jsx)(_Icon["default"], {
|
|
74
|
+
size: 14,
|
|
75
|
+
name: 'close',
|
|
76
|
+
color: 'darkGrey',
|
|
77
|
+
variant: 850,
|
|
78
|
+
onClick: function onClick(e) {
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
onClear();
|
|
81
|
+
}
|
|
82
|
+
})));
|
|
48
83
|
});
|
|
49
84
|
|
|
50
85
|
Chip.displayName = 'Chip';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SerializedStyles } from '@emotion/react';
|
|
2
2
|
import { Theme } from '../../theme';
|
|
3
3
|
import { Props } from './Chip';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const chipStyle: ({ styleType, fill, isSelected, onClear, onClick, }: Props) => (theme: Theme) => SerializedStyles;
|
|
5
|
+
export declare const closeIconWrapperStyle: () => () => SerializedStyles;
|
|
@@ -1,77 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.closeIconWrapperStyle = exports.chipStyle = void 0;
|
|
5
5
|
|
|
6
6
|
var _react = require("@emotion/react");
|
|
7
7
|
|
|
8
|
-
var _polished = require("polished");
|
|
9
|
-
|
|
10
8
|
var _functions = require("../../theme/functions");
|
|
11
9
|
|
|
12
|
-
var _palette = require("../../theme/palette");
|
|
13
|
-
|
|
14
10
|
var _utils = require("../../theme/utils");
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
* These sizes are specific to this component thus these are placed here and not in the config **/
|
|
18
|
-
var styleBasedOnSize = function styleBasedOnSize(theme, size, leftIcon, rightIcon) {
|
|
19
|
-
var hasIcon = leftIcon !== undefined || rightIcon !== undefined;
|
|
20
|
-
|
|
21
|
-
switch (size) {
|
|
22
|
-
case 'sm':
|
|
23
|
-
return "\n height: " + (0, _utils.rem)(20) + ";\n border-radius: " + (0, _utils.rem)(16.5) + ";\n font-size: " + theme.typography.fontSizes['10'] + ";\n ";
|
|
24
|
-
|
|
25
|
-
default:
|
|
26
|
-
return "\n height: " + (0, _utils.rem)(24) + ";\n border-radius: " + (0, _utils.rem)(12.5) + ";\n font-size: " + theme.typography.fontSizes['12'] + ";\n ";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var wrapperStyleSwitch = function wrapperStyleSwitch(theme, styleType, fill, shade) {
|
|
31
|
-
if (shade === void 0) {
|
|
32
|
-
shade = _palette.BASE_SHADE;
|
|
33
|
-
}
|
|
12
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
34
13
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
case 'filled':
|
|
44
|
-
default:
|
|
45
|
-
return "\n background-color: " + (fill ? theme.utils.getColor(fill, shade) : theme.utils.getColor('lightGrey', 50)) + ";\n color: " + (fill ? (0, _palette.pickTextColorFromSwatches)(fill, shade) : '#232323') + ";\n border: " + (0, _utils.rem)(1) + " solid " + (fill ? theme.utils.getColor(fill, shade) : theme.utils.getColor('lightGrey', 50)) + ";\n ";
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
var wrapperStyle = function wrapperStyle(_ref) {
|
|
50
|
-
var styleType = _ref.styleType,
|
|
51
|
-
size = _ref.size,
|
|
52
|
-
fill = _ref.fill,
|
|
53
|
-
shade = _ref.shade,
|
|
54
|
-
leftIcon = _ref.leftIcon,
|
|
55
|
-
rightIcon = _ref.rightIcon;
|
|
14
|
+
var chipStyle = function chipStyle(_ref2) {
|
|
15
|
+
var styleType = _ref2.styleType,
|
|
16
|
+
_ref2$fill = _ref2.fill,
|
|
17
|
+
fill = _ref2$fill === void 0 ? 'greyScale' : _ref2$fill,
|
|
18
|
+
isSelected = _ref2.isSelected,
|
|
19
|
+
onClear = _ref2.onClear,
|
|
20
|
+
onClick = _ref2.onClick;
|
|
56
21
|
return function (theme) {
|
|
57
22
|
return (
|
|
58
23
|
/*#__PURE__*/
|
|
59
24
|
|
|
60
25
|
/*#__PURE__*/
|
|
61
|
-
(0, _react.css)(_functions.flexCenterVertical, ";",
|
|
26
|
+
(0, _react.css)(_functions.flexCenterVertical, ";height:", theme.spacing.lg, ";border-radius:", theme.spacing.lg, ";font-size:", theme.typography.fontSizes['12'], ";font-weight:", theme.typography.weights.medium, ";line-height:normal;box-sizing:border-box;padding:", theme.spacing.xsm, " ", theme.spacing.sm, ";background-color:", styleType === 'read-only' || onClear || isSelected ? theme.utils.getColor(fill, 50) : theme.palette.white, ";color:", theme.utils.getColor('darkGrey', 850), ";border:", (0, _utils.rem)(1), " solid ", styleType === 'read-only' || onClear || isSelected ? theme.utils.getColor(fill, 550) : theme.utils.getColor('lightGrey', 200), ";cursor:", onClick ? 'pointer' : 'auto', ";width:fit-content;transition:background-color 150ms linear;&:hover{background:", styleType === 'read-only' || onClear || isSelected ? theme.utils.getColor(fill, 100) : theme.utils.getColor('lightGrey', null, 'pale'), ";}>:not(:last-child){margin-right:", theme.spacing.xsm, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:chipStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvQ2hpcC5zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhb0QiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvQ2hpcC9DaGlwLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgZmxleENlbnRlclZlcnRpY2FsIH0gZnJvbSAndGhlbWUvZnVuY3Rpb25zJztcbmltcG9ydCB7IHJlbSB9IGZyb20gJ3RoZW1lL3V0aWxzJztcblxuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICcuLi8uLi90aGVtZSc7XG5pbXBvcnQgeyBQcm9wcyB9IGZyb20gJy4vQ2hpcCc7XG5cbmV4cG9ydCBjb25zdCBjaGlwU3R5bGUgPSAoe1xuICBzdHlsZVR5cGUsXG4gIGZpbGwgPSAnZ3JleVNjYWxlJyxcbiAgaXNTZWxlY3RlZCxcbiAgb25DbGVhcixcbiAgb25DbGljayxcbn06IFByb3BzKSA9PiAodGhlbWU6IFRoZW1lKTogU2VyaWFsaXplZFN0eWxlcyA9PiBjc3NgXG4gICR7ZmxleENlbnRlclZlcnRpY2FsfTtcbiAgaGVpZ2h0OiAke3R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VsZWN0ZWRcbiAgICAgID8gdGhlbWUudXRpbHMuZ2V0Q29sb3IoZmlsbCwgMTAwKVxuICAgICAgOiB0aGVtZS51dGlscy5nZXRDb2xvcignbGlnaHRHcmV5JywgbnVsbCwgJ3BhbGUnKX07XG4gIH1cblxuICA+IDpub3QoOmxhc3QtY2hpbGQpIHtcbiAgICBtYXJnaW4tcmlnaHQ6ICR7dGhlbWUuc3BhY2luZy54c219O1xuICB9XG5gO1xuXG5leHBvcnQgY29uc3QgY2xvc2VJY29uV3JhcHBlclN0eWxlID0gKCkgPT4gKCk6IFNlcmlhbGl6ZWRTdHlsZXMgPT4gY3NzYFxuICBjdXJzb3I6IHBvaW50ZXI7XG5gO1xuIl19 */", process.env.NODE_ENV === "production" ? "" : ";label:chipStyle;")
|
|
62
27
|
);
|
|
63
28
|
};
|
|
64
29
|
};
|
|
65
30
|
|
|
66
|
-
exports.
|
|
31
|
+
exports.chipStyle = chipStyle;
|
|
67
32
|
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
33
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
34
|
+
name: "e0dnmk",
|
|
35
|
+
styles: "cursor:pointer"
|
|
36
|
+
} : {
|
|
37
|
+
name: "uvczt0-closeIconWrapperStyle",
|
|
38
|
+
styles: "cursor:pointer;label:closeIconWrapperStyle;",
|
|
39
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvQ2hpcC5zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2Q3NFIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvQ2hpcC5zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcywgU2VyaWFsaXplZFN0eWxlcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN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ldENvbG9yKCdkYXJrR3JleScsIDg1MCl9O1xuICBib3JkZXI6ICR7cmVtKDEpfSBzb2xpZFxuICAgICR7c3R5bGVUeXBlID09PSAncmVhZC1vbmx5JyB8fCBvbkNsZWFyIHx8IGlzU2VsZWN0ZWRcbiAgICAgID8gdGhlbWUudXRpbHMuZ2V0Q29sb3IoZmlsbCwgNTUwKVxuICAgICAgOiB0aGVtZS51dGlscy5nZXRDb2xvcignbGlnaHRHcmV5JywgMjAwKX07XG4gIGN1cnNvcjogJHtvbkNsaWNrID8gJ3BvaW50ZXInIDogJ2F1dG8nfTtcbiAgd2lkdGg6IGZpdC1jb250ZW50O1xuICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDE1MG1zIGxpbmVhcjtcblxuICAmOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kOiAke3N0eWxlVHlwZSA9PT0gJ3JlYWQtb25seScgfHwgb25DbGVhciB8fCBpc1NlbGVjdGVkXG4gICAgICA/IHRoZW1lLnV0aWxzLmdldENvbG9yKGZpbGwsIDEwMClcbiAgICAgIDogdGhlbWUudXRpbHMuZ2V0Q29sb3IoJ2xpZ2h0R3JleScsIG51bGwsICdwYWxlJyl9O1xuICB9XG5cbiAgPiA6bm90KDpsYXN0LWNoaWxkKSB7XG4gICAgbWFyZ2luLXJpZ2h0OiAke3RoZW1lLnNwYWNpbmcueHNtfTtcbiAgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGNsb3NlSWNvbldyYXBwZXJTdHlsZSA9ICgpID0+ICgpOiBTZXJpYWxpemVkU3R5bGVzID0+IGNzc2BcbiAgY3Vyc29yOiBwb2ludGVyO1xuYDtcbiJdfQ== */",
|
|
40
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
41
|
+
};
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
43
|
+
var closeIconWrapperStyle = function closeIconWrapperStyle() {
|
|
44
|
+
return function () {
|
|
45
|
+
return _ref;
|
|
46
|
+
};
|
|
75
47
|
};
|
|
76
48
|
|
|
77
|
-
exports.
|
|
49
|
+
exports.closeIconWrapperStyle = closeIconWrapperStyle;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _helpers = require("../../../../utils/helpers");
|
|
9
|
+
|
|
10
|
+
var _Badge = require("./Badge.style");
|
|
11
|
+
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var Badge = function Badge(_ref) {
|
|
17
|
+
var fill = _ref.fill,
|
|
18
|
+
isSelected = _ref.isSelected,
|
|
19
|
+
badgeNumber = _ref.badgeNumber,
|
|
20
|
+
dataTestId = _ref.dataTestId;
|
|
21
|
+
return (0, _react2.jsx)("div", {
|
|
22
|
+
"data-testid": (0, _helpers.generateTestDataId)('badge', dataTestId),
|
|
23
|
+
css: (0, _Badge.badgeStyle)({
|
|
24
|
+
fill: fill,
|
|
25
|
+
isSelected: isSelected
|
|
26
|
+
})
|
|
27
|
+
}, badgeNumber);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _default = Badge;
|
|
31
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.badgeStyle = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("@emotion/react");
|
|
7
|
+
|
|
8
|
+
var _functions = require("../../../../theme/functions");
|
|
9
|
+
|
|
10
|
+
var _palette = require("../../../../theme/palette");
|
|
11
|
+
|
|
12
|
+
var badgeStyle = function badgeStyle(_ref) {
|
|
13
|
+
var _ref$fill = _ref.fill,
|
|
14
|
+
fill = _ref$fill === void 0 ? 'greyScale' : _ref$fill,
|
|
15
|
+
isSelected = _ref.isSelected;
|
|
16
|
+
return function (theme) {
|
|
17
|
+
return (
|
|
18
|
+
/*#__PURE__*/
|
|
19
|
+
|
|
20
|
+
/*#__PURE__*/
|
|
21
|
+
(0, _react.css)(_functions.flex, ";width:", theme.spacing.md, ";height:", theme.spacing.md, ";border-radius:100%;background:", isSelected ? theme.utils.getColor(fill, 550) : theme.utils.getColor('lightGrey', 200), ";font-size:", theme.typography.fontSizes['10'], ";font-weight:", theme.typography.weights.medium, ";align-items:center;flex-shrink:0;line-height:normal;justify-content:center;color:", isSelected ? (0, _palette.pickTextColorFromSwatches)(fill, 550) : (0, _palette.pickTextColorFromSwatches)('lightGrey', 200), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:badgeStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0NoaXAvY29tcG9uZW50cy9CYWRnZS9CYWRnZS5zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTMEIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvQ2hpcC9jb21wb25lbnRzL0JhZGdlL0JhZGdlLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICd0aGVtZSc7XG5pbXBvcnQgeyBmbGV4IH0gZnJvbSAndGhlbWUvZnVuY3Rpb25zJztcbmltcG9ydCB7IHBpY2tUZXh0Q29sb3JGcm9tU3dhdGNoZXMgfSBmcm9tICd0aGVtZS9wYWxldHRlJztcblxuaW1wb3J0IHsgUHJvcHMgfSBmcm9tICcuLi8uLi9DaGlwJztcblxuZXhwb3J0IGNvbnN0IGJhZGdlU3R5bGUgPSAoeyBmaWxsID0gJ2dyZXlTY2FsZScsIGlzU2VsZWN0ZWQgfTogUHJvcHMpID0+IChcbiAgdGhlbWU6IFRoZW1lXG4pOiBTZXJpYWxpemVkU3R5bGVzID0+IGNzc2BcbiAgJHtmbGV4fTtcbiAgd2lkdGg6ICR7dGhlbWUuc3BhY2luZy5tZH07XG4gIGhlaWdodDogJHt0aGVtZS5zcGFjaW5nLm1kfTtcbiAgYm9yZGVyLXJhZGl1czogMTAwJTtcbiAgYmFja2dyb3VuZDogJHtpc1NlbGVjdGVkXG4gICAgPyB0aGVtZS51dGlscy5nZXRDb2xvcihmaWxsLCA1NTApXG4gICAgOiB0aGVtZS51dGlscy5nZXRDb2xvcignbGlnaHRHcmV5JywgMjAwKX07XG4gIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LmZvbnRTaXplc1snMTAnXX07XG4gIGZvbnQtd2VpZ2h0OiAke3RoZW1lLnR5cG9ncmFwaHkud2VpZ2h0cy5tZWRpdW19O1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuICBmbGV4LXNocmluazogMDtcbiAgbGluZS1oZWlnaHQ6IG5vcm1hbDtcbiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gIGNvbG9yOiAke2lzU2VsZWN0ZWRcbiAgICA/IHBpY2tUZXh0Q29sb3JGcm9tU3dhdGNoZXMoZmlsbCwgNTUwKVxuICAgIDogcGlja1RleHRDb2xvckZyb21Td2F0Y2hlcygnbGlnaHRHcmV5JywgMjAwKX07XG5gO1xuIl19 */", process.env.NODE_ENV === "production" ? "" : ";label:badgeStyle;")
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.badgeStyle = badgeStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Badge';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _Badge = _interopRequireDefault(require("./Badge"));
|
|
7
|
+
|
|
8
|
+
exports["default"] = _Badge["default"];
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -20,9 +20,10 @@ export declare type ListProps = {
|
|
|
20
20
|
searchTerm?: string;
|
|
21
21
|
/** Option Click handler for SelectOption[] data case */
|
|
22
22
|
handleOptionClick?: SelectHandlerType;
|
|
23
|
+
/** Defines if this is searchable list or not **/
|
|
23
24
|
isSearchable?: boolean;
|
|
24
25
|
} & TestProps;
|
|
25
|
-
declare const
|
|
26
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
26
27
|
/** Data for the list */
|
|
27
28
|
data: ListItemType[];
|
|
28
29
|
/** Size of the list's row (height of ListItem Component) */
|
|
@@ -41,6 +42,7 @@ declare const List: React.ForwardRefExoticComponent<{
|
|
|
41
42
|
searchTerm?: string | undefined;
|
|
42
43
|
/** Option Click handler for SelectOption[] data case */
|
|
43
44
|
handleOptionClick?: SelectHandlerType | undefined;
|
|
45
|
+
/** Defines if this is searchable list or not **/
|
|
44
46
|
isSearchable?: boolean | undefined;
|
|
45
|
-
} & TestProps & React.RefAttributes<HTMLDivElement
|
|
46
|
-
export default
|
|
47
|
+
} & TestProps & React.RefAttributes<HTMLDivElement>>>;
|
|
48
|
+
export default _default;
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
7
9
|
|
|
8
10
|
var _List = require("./List.style");
|
|
9
11
|
|
|
@@ -15,6 +17,10 @@ var _react2 = require("@emotion/react");
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
19
|
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
18
24
|
var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
19
25
|
var data = _ref.data,
|
|
20
26
|
rowSize = _ref.rowSize,
|
|
@@ -60,5 +66,7 @@ var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
List.displayName = 'List';
|
|
63
|
-
|
|
69
|
+
|
|
70
|
+
var _default = /*#__PURE__*/(0, _react.memo)(List, _reactFastCompare["default"]);
|
|
71
|
+
|
|
64
72
|
exports["default"] = _default;
|
|
@@ -4,3 +4,8 @@ export declare const wrapperStyle: ({ width, isSearchable, }: {
|
|
|
4
4
|
width: number | undefined;
|
|
5
5
|
isSearchable?: boolean | undefined;
|
|
6
6
|
}) => (theme: Theme) => SerializedStyles;
|
|
7
|
+
export declare const listStyle: ({ width, height, isSearchable, }: {
|
|
8
|
+
width?: number | undefined;
|
|
9
|
+
height?: number | undefined;
|
|
10
|
+
isSearchable?: boolean | undefined;
|
|
11
|
+
}) => (theme: Theme) => SerializedStyles;
|