@ringcentral/juno 2.30.0 → 2.31.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/components/Forms/TextField/styles/TextFieldStyle.js +3 -3
- package/components/Presence/Presence.js +7 -11
- package/components/Presence/styles/StyledDND.d.ts +13 -0
- package/components/Presence/styles/StyledDND.js +12 -0
- package/components/Presence/styles/StyledPresence.js +3 -3
- package/components/Presence/styles/index.d.ts +1 -0
- package/components/Presence/styles/index.js +1 -0
- package/components/Presence/utils/RcPresenceUtils.d.ts +1 -2
- package/components/Presence/utils/RcPresenceUtils.js +4 -16
- package/es6/components/Forms/TextField/styles/TextFieldStyle.js +4 -4
- package/es6/components/Presence/Presence.js +9 -13
- package/es6/components/Presence/styles/StyledDND.js +10 -0
- package/es6/components/Presence/styles/StyledPresence.js +4 -4
- package/es6/components/Presence/styles/index.js +1 -0
- package/es6/components/Presence/utils/RcPresenceUtils.js +4 -16
- package/package.json +1 -1
|
@@ -23,9 +23,9 @@ exports.TextFieldStyle = function (props) {
|
|
|
23
23
|
var labelRootColor = foundation_1.getParsePaletteColor(colorProp, idleColor);
|
|
24
24
|
var underlineColor = foundation_1.getParsePaletteColor(colorProp, foundation_1.palette2('neutral', 'f02'));
|
|
25
25
|
var underlineFocusColor = foundation_1.getParsePaletteColor(colorProp, foundation_1.palette2('neutral', 'f06'));
|
|
26
|
-
return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n ", ";\n\n width: ", ";\n\n ", ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ", ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "], ["\n ", ";\n\n width: ", ";\n\n ",
|
|
27
|
-
";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ",
|
|
28
|
-
";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), utils_2.belowIconButtonSpacing(foundation_1.spacing(3)), !fullWidth && exports.RcDefaultTextFieldWidth, gutterBottom && foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), utils_2.RcTextFieldClasses.root, foundation_1.spacing(4)), utils_2.RcTextFieldInputLabelClasses.root, foundation_1.typography('caption2'), labelRootColor, utils_2.RcTextFieldInputLabelClasses.focused, color, utils_2.RcTextFieldInputClasses.root, exports.textColor, ClearIconButton_1.ClearIconButton, showClean && exports.clearBtnInactiveStyle, utils_2.RcTextFieldInputClasses.input, foundation_1.typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, exports.placeholderColor, clearBtn &&
|
|
26
|
+
return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n ", ";\n\n width: ", ";\n\n ", ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n &:placeholder-shown {\n ", "\n }\n\n ", ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "], ["\n ", ";\n\n width: ", ";\n\n ",
|
|
27
|
+
";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n &:placeholder-shown {\n ", "\n }\n\n ",
|
|
28
|
+
";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), utils_2.belowIconButtonSpacing(foundation_1.spacing(3)), !fullWidth && exports.RcDefaultTextFieldWidth, gutterBottom && foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), utils_2.RcTextFieldClasses.root, foundation_1.spacing(4)), utils_2.RcTextFieldInputLabelClasses.root, foundation_1.typography('caption2'), labelRootColor, utils_2.RcTextFieldInputLabelClasses.focused, color, utils_2.RcTextFieldInputClasses.root, exports.textColor, ClearIconButton_1.ClearIconButton, showClean && exports.clearBtnInactiveStyle, utils_2.RcTextFieldInputClasses.input, foundation_1.typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, exports.placeholderColor, foundation_1.ellipsis, clearBtn &&
|
|
29
29
|
align &&
|
|
30
30
|
align !== 'left' && foundation_1.css(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n width: calc(100% - ", ");\n "], ["\n width: calc(100% - ", ");\n "])), foundation_1.px(utils_1.RcIconButtonSizes[size])), utils_2.RcTextFieldInputClasses.underline, underlineColor, foundation_1.nonTouchHoverMedia, utils_2.RcTextFieldInputClasses.disabled, underlineFocusColor, color, utils_2.RcTextFieldInputClasses.error, errorColor, utils_2.RcTextFieldInputClasses.disabled, exports.disabledColor, exports.disabledColor, exports.disabledColor, exports.disabledColor, utils_2.RcTextFieldFormHelperTextClasses.root, foundation_1.typography('caption1'), idleColor, utils_2.RcTextFieldFormHelperTextClasses.error, utils_2.RcTextFieldInputLabelClasses.error, errorTextColor, utils_2.RcTextFieldFormHelperTextClasses.disabled, utils_2.RcTextFieldInputLabelClasses.disabled, exports.disabledColor, variant === 'outline' && OutlineTextFieldStyle_1.OutlineTextFieldStyle);
|
|
31
31
|
};
|
|
@@ -6,26 +6,22 @@ var foundation_1 = require("../../foundation");
|
|
|
6
6
|
var Icon_1 = require("../Icon");
|
|
7
7
|
var assets_1 = require("./assets");
|
|
8
8
|
var styles_1 = require("./styles");
|
|
9
|
-
var juno_icon_1 = require("@ringcentral/juno-icon");
|
|
10
9
|
var _RcPresence = react_1.forwardRef(function (inProps, ref) {
|
|
11
10
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcPresence' });
|
|
12
|
-
var type = props.type;
|
|
13
|
-
var
|
|
11
|
+
var type = props.type, size = props.size;
|
|
12
|
+
var innerChildren = react_1.useMemo(function () {
|
|
14
13
|
switch (type) {
|
|
15
14
|
case 'DND':
|
|
16
|
-
return
|
|
17
|
-
case 'available':
|
|
18
|
-
return juno_icon_1.PresenceAvailable;
|
|
15
|
+
return react_1.default.createElement(styles_1.StyledDND, { size: size });
|
|
19
16
|
case 'attended':
|
|
20
|
-
return assets_1.Attended;
|
|
17
|
+
return react_1.default.createElement(Icon_1.RcIcon, { symbol: assets_1.Attended, color: "neutral.f01", size: "inherit" });
|
|
21
18
|
case 'unAttended':
|
|
22
|
-
return assets_1.Unattended;
|
|
19
|
+
return (react_1.default.createElement(Icon_1.RcIcon, { symbol: assets_1.Unattended, color: "neutral.f01", size: "inherit" }));
|
|
23
20
|
default:
|
|
24
21
|
return null;
|
|
25
22
|
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
return (react_1.default.createElement(styles_1.StyledPresence, tslib_1.__assign({ ref: ref }, props), symbolElm));
|
|
23
|
+
}, [size, type]);
|
|
24
|
+
return (react_1.default.createElement(styles_1.StyledPresence, tslib_1.__assign({ ref: ref }, props), innerChildren));
|
|
29
25
|
});
|
|
30
26
|
/** @release */
|
|
31
27
|
var RcPresence = foundation_1.styled(_RcPresence)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="styled-jsx" />
|
|
3
|
+
export declare const StyledDND: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
type?: "notReady" | "unavailable" | "available" | "onCall" | "DND" | "inMeeting" | "busy" | "offline" | "attended" | "unAttended" | undefined;
|
|
5
|
+
size?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
6
|
+
borderSize?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
7
|
+
color?: (string & Record<never, never>) | "action.grayDark" | "action.grayLight" | "action.primary" | "avatar.ash" | "avatar.blueberry" | "avatar.brass" | "avatar.global" | "avatar.gold" | "avatar.lake" | "avatar.oasis" | "avatar.pear" | "avatar.persimmon" | "avatar.sage" | "avatar.tomato" | "content.brand" | "danger.b01" | "danger.b02" | "danger.b03" | "danger.b04" | "danger.f01" | "danger.f02" | "danger.f11" | "dialHeader.avatarBg" | "dialHeader.avatarIcon" | "dialHeader.bg" | "dialHeader.focusBorder" | "dialHeader.icon" | "dialHeader.text" | "dialHeader.textHint" | "disabled.b01" | "disabled.f01" | "disabled.f02" | "header.bgLeft" | "header.bgOverlay" | "header.bgOverlayDisabled" | "header.bgRight" | "header.border" | "header.divider" | "header.fabBg" | "header.fabIcon" | "header.focusBorder" | "header.icon" | "header.iconDisabled" | "header.text" | "header.textHint" | "highContrast" | "highlight.b01" | "highlight.b02" | "highlight.b03" | "highlight.f01" | "highlight.f02" | "informative.b01" | "informative.f01" | "informative.f02" | "interactive.b01" | "interactive.b02" | "interactive.f01" | "label.black02" | "label.blue01" | "label.blue02" | "label.green01" | "label.green02" | "label.orange01" | "label.orange02" | "label.purple01" | "label.purple02" | "label.red01" | "label.red02" | "label.teal01" | "label.teal02" | "label.yellow01" | "label.yellow02" | "nav.b01" | "nav.b02" | "nav.bookmark" | "nav.ctlDefault" | "nav.ctlSelected" | "nav.f01" | "nav.f02" | "nav.f03" | "nav.f04" | "nav.iconDefault" | "nav.iconSelected" | "nav.line" | "nav.mention" | "nav.menuBg" | "nav.menuText" | "neutral.b01" | "neutral.b02" | "neutral.b03" | "neutral.b04" | "neutral.b05" | "neutral.b06" | "neutral.elevation" | "neutral.f01" | "neutral.f02" | "neutral.f03" | "neutral.f04" | "neutral.f05" | "neutral.f06" | "neutral.f07" | "neutral.f11" | "neutral.l01" | "neutral.l02" | "neutral.l03" | "neutral.l04" | "neutral.transparent" | "presence.available" | "presence.busy" | "presence.invisible" | "subAction" | "success.b01" | "success.b02" | "success.b03" | "success.b04" | "success.b05" | "success.f01" | "success.f02" | "success.f11" | "tab.default" | "tab.selected" | "umi.bg" | "umi.mentioned" | "umi.text" | "warning.b01" | "warning.b02" | "warning.b03" | "warning.f01" | "warning.f02" | "warning.f11" | string[] | import("../../../foundation/styles/newPalette").PaletteReturnType | undefined;
|
|
8
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "className" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "children" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, import("../../../foundation").RcTheme, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
type?: "notReady" | "unavailable" | "available" | "onCall" | "DND" | "inMeeting" | "busy" | "offline" | "attended" | "unAttended" | undefined;
|
|
10
|
+
size?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
11
|
+
borderSize?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
12
|
+
color?: (string & Record<never, never>) | "action.grayDark" | "action.grayLight" | "action.primary" | "avatar.ash" | "avatar.blueberry" | "avatar.brass" | "avatar.global" | "avatar.gold" | "avatar.lake" | "avatar.oasis" | "avatar.pear" | "avatar.persimmon" | "avatar.sage" | "avatar.tomato" | "content.brand" | "danger.b01" | "danger.b02" | "danger.b03" | "danger.b04" | "danger.f01" | "danger.f02" | "danger.f11" | "dialHeader.avatarBg" | "dialHeader.avatarIcon" | "dialHeader.bg" | "dialHeader.focusBorder" | "dialHeader.icon" | "dialHeader.text" | "dialHeader.textHint" | "disabled.b01" | "disabled.f01" | "disabled.f02" | "header.bgLeft" | "header.bgOverlay" | "header.bgOverlayDisabled" | "header.bgRight" | "header.border" | "header.divider" | "header.fabBg" | "header.fabIcon" | "header.focusBorder" | "header.icon" | "header.iconDisabled" | "header.text" | "header.textHint" | "highContrast" | "highlight.b01" | "highlight.b02" | "highlight.b03" | "highlight.f01" | "highlight.f02" | "informative.b01" | "informative.f01" | "informative.f02" | "interactive.b01" | "interactive.b02" | "interactive.f01" | "label.black02" | "label.blue01" | "label.blue02" | "label.green01" | "label.green02" | "label.orange01" | "label.orange02" | "label.purple01" | "label.purple02" | "label.red01" | "label.red02" | "label.teal01" | "label.teal02" | "label.yellow01" | "label.yellow02" | "nav.b01" | "nav.b02" | "nav.bookmark" | "nav.ctlDefault" | "nav.ctlSelected" | "nav.f01" | "nav.f02" | "nav.f03" | "nav.f04" | "nav.iconDefault" | "nav.iconSelected" | "nav.line" | "nav.mention" | "nav.menuBg" | "nav.menuText" | "neutral.b01" | "neutral.b02" | "neutral.b03" | "neutral.b04" | "neutral.b05" | "neutral.b06" | "neutral.elevation" | "neutral.f01" | "neutral.f02" | "neutral.f03" | "neutral.f04" | "neutral.f05" | "neutral.f06" | "neutral.f07" | "neutral.f11" | "neutral.l01" | "neutral.l02" | "neutral.l03" | "neutral.l04" | "neutral.transparent" | "presence.available" | "presence.busy" | "presence.invisible" | "subAction" | "success.b01" | "success.b02" | "success.b03" | "success.b04" | "success.b05" | "success.f01" | "success.f02" | "success.f11" | "tab.default" | "tab.selected" | "umi.bg" | "umi.mentioned" | "umi.text" | "warning.b01" | "warning.b02" | "warning.b03" | "warning.f01" | "warning.f02" | "warning.f11" | string[] | import("../../../foundation/styles/newPalette").PaletteReturnType | undefined;
|
|
13
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "className" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "children" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var foundation_1 = require("../../../foundation");
|
|
5
|
+
var utils_1 = require("../utils");
|
|
6
|
+
exports.StyledDND = foundation_1.styled.div(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", ";\n background: ", ";\n"], ["\n ",
|
|
7
|
+
";\n background: ", ";\n"])), function (_a) {
|
|
8
|
+
var size = _a.size;
|
|
9
|
+
var value = utils_1.RcPresenceInnerIconSizes[size];
|
|
10
|
+
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n "], ["\n width: ", "px;\n height: ", "px;\n "])), value[0], value[1]);
|
|
11
|
+
}, foundation_1.palette2('neutral', 'f01'));
|
|
12
|
+
var templateObject_1, templateObject_2;
|
|
@@ -13,9 +13,9 @@ exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(templateOb
|
|
|
13
13
|
";\n"])), function (_a) {
|
|
14
14
|
var size = _a.size, borderSize = _a.borderSize, type = _a.type, color = _a.color;
|
|
15
15
|
var sizeValue = foundation_1.px(utils_1.RcPresenceSizes[size][0]);
|
|
16
|
-
var
|
|
17
|
-
var iconSizeValue = foundation_1.px(
|
|
18
|
-
var scaleRate =
|
|
16
|
+
var availableSize = utils_1.RcPresenceAvailableIconSizes[size];
|
|
17
|
+
var iconSizeValue = foundation_1.px(availableSize[0]);
|
|
18
|
+
var scaleRate = availableSize[1];
|
|
19
19
|
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ", ";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "], ["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ",
|
|
20
20
|
";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "])), sizeValue, sizeValue, utils_1.RcPresenceSizes[borderSize || size][1], foundation_1.palette2('neutral', 'l01'), color
|
|
21
21
|
? foundation_1.getParsePaletteColor(color)
|
|
@@ -2,6 +2,5 @@ import { UnitMap } from '../../../foundation';
|
|
|
2
2
|
import { RcPresenceSize, RcPresenceType } from '../Presence';
|
|
3
3
|
export declare const RcPresenceSizes: UnitMap<RcPresenceSize, [number, number]>;
|
|
4
4
|
export declare const RcPresenceInnerIconSizes: UnitMap<RcPresenceSize, [number, number]>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const UnAvailableIconType: UnitMap<RcPresenceType, boolean>;
|
|
5
|
+
export declare const RcPresenceAvailableIconSizes: UnitMap<RcPresenceSize, [number, number | undefined]>;
|
|
7
6
|
export declare const RcPresenceColors: UnitMap<RcPresenceType>;
|
|
@@ -6,9 +6,9 @@ exports.RcPresenceSizes = {
|
|
|
6
6
|
xxsmall: [8, 1],
|
|
7
7
|
xsmall: [8, 2],
|
|
8
8
|
small: [10, 2],
|
|
9
|
-
medium: [10,
|
|
10
|
-
large: [14,
|
|
11
|
-
xlarge: [18,
|
|
9
|
+
medium: [10, 3],
|
|
10
|
+
large: [14, 3],
|
|
11
|
+
xlarge: [18, 3],
|
|
12
12
|
};
|
|
13
13
|
// width, height
|
|
14
14
|
exports.RcPresenceInnerIconSizes = {
|
|
@@ -21,7 +21,7 @@ exports.RcPresenceInnerIconSizes = {
|
|
|
21
21
|
};
|
|
22
22
|
// use scale rate to make that be odd value
|
|
23
23
|
// width, scaleRate
|
|
24
|
-
exports.
|
|
24
|
+
exports.RcPresenceAvailableIconSizes = {
|
|
25
25
|
xxsmall: [10, 0.5],
|
|
26
26
|
xsmall: [10, 0.5],
|
|
27
27
|
small: [6, undefined],
|
|
@@ -29,18 +29,6 @@ exports.RcPresenceIconSizes = {
|
|
|
29
29
|
large: [10, undefined],
|
|
30
30
|
xlarge: [12, undefined],
|
|
31
31
|
};
|
|
32
|
-
exports.UnAvailableIconType = {
|
|
33
|
-
notReady: true,
|
|
34
|
-
unavailable: true,
|
|
35
|
-
offline: true,
|
|
36
|
-
available: false,
|
|
37
|
-
onCall: false,
|
|
38
|
-
DND: false,
|
|
39
|
-
inMeeting: false,
|
|
40
|
-
busy: false,
|
|
41
|
-
attended: false,
|
|
42
|
-
unAttended: false,
|
|
43
|
-
};
|
|
44
32
|
var presenceOn = foundation_1.palette2('presence', 'available');
|
|
45
33
|
var presenceBusy = foundation_1.palette2('presence', 'busy');
|
|
46
34
|
var presenceOff = foundation_1.palette2('presence', 'invisible');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css, getParsePaletteColor, isFilled, nonTouchHoverMedia, palette2, px, spacing, typography, } from '../../../../foundation';
|
|
2
|
+
import { css, getParsePaletteColor, isFilled, nonTouchHoverMedia, palette2, px, ellipsis, spacing, typography, } from '../../../../foundation';
|
|
3
3
|
import { RcIconButtonSizes } from '../../../Buttons/IconButton/utils';
|
|
4
4
|
import { belowIconButtonSpacing, RcTextFieldClasses, RcTextFieldFormHelperTextClasses, RcTextFieldInputClasses, RcTextFieldInputLabelClasses, } from '../utils';
|
|
5
5
|
import { ClearIconButton } from './ClearIconButton';
|
|
@@ -21,9 +21,9 @@ export var TextFieldStyle = function (props) {
|
|
|
21
21
|
var labelRootColor = getParsePaletteColor(colorProp, idleColor);
|
|
22
22
|
var underlineColor = getParsePaletteColor(colorProp, palette2('neutral', 'f02'));
|
|
23
23
|
var underlineFocusColor = getParsePaletteColor(colorProp, palette2('neutral', 'f06'));
|
|
24
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n\n width: ", ";\n\n ", ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ", ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "], ["\n ", ";\n\n width: ", ";\n\n ",
|
|
25
|
-
";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ",
|
|
26
|
-
";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), belowIconButtonSpacing(spacing(3)), !fullWidth && RcDefaultTextFieldWidth, gutterBottom && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), RcTextFieldClasses.root, spacing(4)), RcTextFieldInputLabelClasses.root, typography('caption2'), labelRootColor, RcTextFieldInputLabelClasses.focused, color, RcTextFieldInputClasses.root, textColor, ClearIconButton, showClean && clearBtnInactiveStyle, RcTextFieldInputClasses.input, typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, placeholderColor, clearBtn &&
|
|
24
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n\n width: ", ";\n\n ", ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n &:placeholder-shown {\n ", "\n }\n\n ", ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "], ["\n ", ";\n\n width: ", ";\n\n ",
|
|
25
|
+
";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n &:placeholder-shown {\n ", "\n }\n\n ",
|
|
26
|
+
";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), belowIconButtonSpacing(spacing(3)), !fullWidth && RcDefaultTextFieldWidth, gutterBottom && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), RcTextFieldClasses.root, spacing(4)), RcTextFieldInputLabelClasses.root, typography('caption2'), labelRootColor, RcTextFieldInputLabelClasses.focused, color, RcTextFieldInputClasses.root, textColor, ClearIconButton, showClean && clearBtnInactiveStyle, RcTextFieldInputClasses.input, typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, placeholderColor, ellipsis, clearBtn &&
|
|
27
27
|
align &&
|
|
28
28
|
align !== 'left' && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: calc(100% - ", ");\n "], ["\n width: calc(100% - ", ");\n "])), px(RcIconButtonSizes[size])), RcTextFieldInputClasses.underline, underlineColor, nonTouchHoverMedia, RcTextFieldInputClasses.disabled, underlineFocusColor, color, RcTextFieldInputClasses.error, errorColor, RcTextFieldInputClasses.disabled, disabledColor, disabledColor, disabledColor, disabledColor, RcTextFieldFormHelperTextClasses.root, typography('caption1'), idleColor, RcTextFieldFormHelperTextClasses.error, RcTextFieldInputLabelClasses.error, errorTextColor, RcTextFieldFormHelperTextClasses.disabled, RcTextFieldInputLabelClasses.disabled, disabledColor, variant === 'outline' && OutlineTextFieldStyle);
|
|
29
29
|
};
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { styled, useThemeProps, } from '../../foundation';
|
|
4
4
|
import { RcIcon } from '../Icon';
|
|
5
5
|
import { Attended, Unattended } from './assets';
|
|
6
|
-
import { StyledPresence } from './styles';
|
|
7
|
-
import { PresenceAvailable, PresenceDnd } from '@ringcentral/juno-icon';
|
|
6
|
+
import { StyledDND, StyledPresence } from './styles';
|
|
8
7
|
var _RcPresence = forwardRef(function (inProps, ref) {
|
|
9
8
|
var props = useThemeProps({ props: inProps, name: 'RcPresence' });
|
|
10
|
-
var type = props.type;
|
|
11
|
-
var
|
|
9
|
+
var type = props.type, size = props.size;
|
|
10
|
+
var innerChildren = useMemo(function () {
|
|
12
11
|
switch (type) {
|
|
13
12
|
case 'DND':
|
|
14
|
-
return
|
|
15
|
-
case 'available':
|
|
16
|
-
return PresenceAvailable;
|
|
13
|
+
return React.createElement(StyledDND, { size: size });
|
|
17
14
|
case 'attended':
|
|
18
|
-
return Attended;
|
|
15
|
+
return React.createElement(RcIcon, { symbol: Attended, color: "neutral.f01", size: "inherit" });
|
|
19
16
|
case 'unAttended':
|
|
20
|
-
return Unattended;
|
|
17
|
+
return (React.createElement(RcIcon, { symbol: Unattended, color: "neutral.f01", size: "inherit" }));
|
|
21
18
|
default:
|
|
22
19
|
return null;
|
|
23
20
|
}
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return (React.createElement(StyledPresence, __assign({ ref: ref }, props), symbolElm));
|
|
21
|
+
}, [size, type]);
|
|
22
|
+
return (React.createElement(StyledPresence, __assign({ ref: ref }, props), innerChildren));
|
|
27
23
|
});
|
|
28
24
|
/** @release */
|
|
29
25
|
var RcPresence = styled(_RcPresence)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css, palette2, styled } from '../../../foundation';
|
|
3
|
+
import { RcPresenceInnerIconSizes } from '../utils';
|
|
4
|
+
export var StyledDND = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n background: ", ";\n"], ["\n ",
|
|
5
|
+
";\n background: ", ";\n"])), function (_a) {
|
|
6
|
+
var size = _a.size;
|
|
7
|
+
var value = RcPresenceInnerIconSizes[size];
|
|
8
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n "], ["\n width: ", "px;\n height: ", "px;\n "])), value[0], value[1]);
|
|
9
|
+
}, palette2('neutral', 'f01'));
|
|
10
|
+
var templateObject_1, templateObject_2;
|
|
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { css, getParsePaletteColor, palette2, px, styled, } from '../../../foundation';
|
|
4
4
|
import { RcIcon } from '../../Icon';
|
|
5
|
-
import {
|
|
5
|
+
import { RcPresenceAvailableIconSizes, RcPresenceColors, RcPresenceSizes, } from '../utils';
|
|
6
6
|
export var _StyledPresence = forwardRef(function (_a, ref) {
|
|
7
7
|
var color = _a.color, borderSize = _a.borderSize, type = _a.type, size = _a.size, rest = __rest(_a, ["color", "borderSize", "type", "size"]);
|
|
8
8
|
return (React.createElement("div", __assign({ ref: ref }, rest)));
|
|
@@ -11,9 +11,9 @@ export var StyledPresence = styled(_StyledPresence)(templateObject_2 || (templat
|
|
|
11
11
|
";\n"])), function (_a) {
|
|
12
12
|
var size = _a.size, borderSize = _a.borderSize, type = _a.type, color = _a.color;
|
|
13
13
|
var sizeValue = px(RcPresenceSizes[size][0]);
|
|
14
|
-
var
|
|
15
|
-
var iconSizeValue = px(
|
|
16
|
-
var scaleRate =
|
|
14
|
+
var availableSize = RcPresenceAvailableIconSizes[size];
|
|
15
|
+
var iconSizeValue = px(availableSize[0]);
|
|
16
|
+
var scaleRate = availableSize[1];
|
|
17
17
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ", ";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "], ["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ",
|
|
18
18
|
";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "])), sizeValue, sizeValue, RcPresenceSizes[borderSize || size][1], palette2('neutral', 'l01'), color
|
|
19
19
|
? getParsePaletteColor(color)
|
|
@@ -4,9 +4,9 @@ export var RcPresenceSizes = {
|
|
|
4
4
|
xxsmall: [8, 1],
|
|
5
5
|
xsmall: [8, 2],
|
|
6
6
|
small: [10, 2],
|
|
7
|
-
medium: [10,
|
|
8
|
-
large: [14,
|
|
9
|
-
xlarge: [18,
|
|
7
|
+
medium: [10, 3],
|
|
8
|
+
large: [14, 3],
|
|
9
|
+
xlarge: [18, 3],
|
|
10
10
|
};
|
|
11
11
|
// width, height
|
|
12
12
|
export var RcPresenceInnerIconSizes = {
|
|
@@ -19,7 +19,7 @@ export var RcPresenceInnerIconSizes = {
|
|
|
19
19
|
};
|
|
20
20
|
// use scale rate to make that be odd value
|
|
21
21
|
// width, scaleRate
|
|
22
|
-
export var
|
|
22
|
+
export var RcPresenceAvailableIconSizes = {
|
|
23
23
|
xxsmall: [10, 0.5],
|
|
24
24
|
xsmall: [10, 0.5],
|
|
25
25
|
small: [6, undefined],
|
|
@@ -27,18 +27,6 @@ export var RcPresenceIconSizes = {
|
|
|
27
27
|
large: [10, undefined],
|
|
28
28
|
xlarge: [12, undefined],
|
|
29
29
|
};
|
|
30
|
-
export var UnAvailableIconType = {
|
|
31
|
-
notReady: true,
|
|
32
|
-
unavailable: true,
|
|
33
|
-
offline: true,
|
|
34
|
-
available: false,
|
|
35
|
-
onCall: false,
|
|
36
|
-
DND: false,
|
|
37
|
-
inMeeting: false,
|
|
38
|
-
busy: false,
|
|
39
|
-
attended: false,
|
|
40
|
-
unAttended: false,
|
|
41
|
-
};
|
|
42
30
|
var presenceOn = palette2('presence', 'available');
|
|
43
31
|
var presenceBusy = palette2('presence', 'busy');
|
|
44
32
|
var presenceOff = palette2('presence', 'invisible');
|