@orfium/ictinus 4.9.4 → 4.10.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.
|
@@ -24,6 +24,6 @@ export declare type Props = {
|
|
|
24
24
|
className?: string;
|
|
25
25
|
};
|
|
26
26
|
export declare type AvatarSizes = 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
27
|
-
export declare type AvatarShapes = '
|
|
27
|
+
export declare type AvatarShapes = '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;
|
|
@@ -42,8 +42,6 @@ var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
42
42
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
43
43
|
_ref$color = _ref.color,
|
|
44
44
|
color = _ref$color === void 0 ? 'lightGrey-600' : _ref$color,
|
|
45
|
-
_ref$shape = _ref.shape,
|
|
46
|
-
shape = _ref$shape === void 0 ? 'circular' : _ref$shape,
|
|
47
45
|
children = _ref.children,
|
|
48
46
|
className = _ref.className;
|
|
49
47
|
var calculatedColor = (0, _themeFunctions.calculateActualColorFromComponentProp)(color);
|
|
@@ -51,7 +49,6 @@ var Avatar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
51
49
|
ref: ref,
|
|
52
50
|
className: className,
|
|
53
51
|
css: (0, _Avatar.avatarStyle)({
|
|
54
|
-
shape: shape,
|
|
55
52
|
size: size,
|
|
56
53
|
fill: calculatedColor.color,
|
|
57
54
|
fillShade: calculatedColor.shade
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SerializedStyles } from '@emotion/react';
|
|
2
2
|
import { Theme } from '../../theme';
|
|
3
3
|
import { colorShades, flatColors } from '../../theme/palette';
|
|
4
|
-
import {
|
|
5
|
-
export declare const avatarStyle: ({
|
|
6
|
-
shape: AvatarShapes;
|
|
4
|
+
import { AvatarSizes } from './Avatar';
|
|
5
|
+
export declare const avatarStyle: ({ size, fill, fillShade, }: {
|
|
7
6
|
size: AvatarSizes;
|
|
8
7
|
fill: typeof flatColors[number];
|
|
9
8
|
fillShade: typeof colorShades[number];
|
|
@@ -33,19 +33,6 @@ var sizeBasedOnProp = function sizeBasedOnProp(size) {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
var shapeBasedOnProp = function shapeBasedOnProp(shape) {
|
|
37
|
-
switch (shape) {
|
|
38
|
-
case 'rounded':
|
|
39
|
-
return (0, _utils.rem)(4);
|
|
40
|
-
|
|
41
|
-
case 'circular':
|
|
42
|
-
return '100%';
|
|
43
|
-
|
|
44
|
-
default:
|
|
45
|
-
return (0, _utils.rem)(8);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
36
|
var fontSizeBasedOnProp = function fontSizeBasedOnProp(theme, size) {
|
|
50
37
|
switch (size) {
|
|
51
38
|
case 'sm':
|
|
@@ -66,8 +53,7 @@ var fontSizeBasedOnProp = function fontSizeBasedOnProp(theme, size) {
|
|
|
66
53
|
};
|
|
67
54
|
|
|
68
55
|
var avatarStyle = function avatarStyle(_ref) {
|
|
69
|
-
var
|
|
70
|
-
size = _ref.size,
|
|
56
|
+
var size = _ref.size,
|
|
71
57
|
fill = _ref.fill,
|
|
72
58
|
fillShade = _ref.fillShade;
|
|
73
59
|
return function (theme) {
|
|
@@ -75,7 +61,7 @@ var avatarStyle = function avatarStyle(_ref) {
|
|
|
75
61
|
/*#__PURE__*/
|
|
76
62
|
|
|
77
63
|
/*#__PURE__*/
|
|
78
|
-
(0, _react.css)(_functions.flex, ";width:", sizeBasedOnProp(size), ";height:", sizeBasedOnProp(size), ";border-radius:
|
|
64
|
+
(0, _react.css)(_functions.flex, ";width:", sizeBasedOnProp(size), ";height:", sizeBasedOnProp(size), ";border-radius:100%;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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0F2YXRhci9BdmF0YXIuc3R5bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0Q2QyIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9BdmF0YXIvQXZhdGFyLnN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtIH0gZnJvbSAndGhlbWUvdXRpbHMnO1xuXG5pbXBvcnQgeyBUaGVtZSB9IGZyb20gJy4uLy4uL3RoZW1lJztcbmltcG9ydCB7IGZsZXggfSBmcm9tICcuLi8uLi90aGVtZS9mdW5jdGlvbnMnO1xuaW1wb3J0IHsgY29sb3JTaGFkZXMsIGZsYXRDb2xvcnMsIHBpY2tUZXh0Q29sb3JGcm9tU3dhdGNoZXMgfSBmcm9tICcuLi8uLi90aGVtZS9wYWxldHRlJztcbmltcG9ydCB7IEF2YXRhclNpemVzIH0gZnJvbSAnLi9BdmF0YXInO1xuXG5jb25zdCBzaXplQmFzZWRPblByb3AgPSAoc2l6ZTogQXZhdGFyU2l6ZXMpID0+IHtcbiAgc3dpdGNoIChzaXplKSB7XG4gICAgY2FzZSAnc20nOlxuICAgICAgcmV0dXJuIHJlbSgzNik7XG4gICAgY2FzZSAnbWQnOlxuICAgICAgcmV0dXJuIHJlbSg0Nik7XG4gICAgY2FzZSAneHMnOlxuICAgICAgcmV0dXJuIHJlbSgyNCk7XG4gICAgY2FzZSAneHhzJzpcbiAgICAgIHJldHVybiByZW0oMjApO1xuICAgIGNhc2UgJ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