@decisiv/ui-components 2.0.1-alpha.160 → 2.0.1-alpha.162
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/lib/components/Loading/Loading.d.ts +12 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +70 -0
- package/lib/components/Loading/index.d.ts +4 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +33 -0
- package/lib/components/Loading/index.test.js +55 -0
- package/lib/components/Loading/schema.d.ts +4 -0
- package/lib/components/Loading/schema.d.ts.map +1 -0
- package/lib/components/Loading/schema.js +31 -0
- package/lib/components/Loading/styles.d.ts +211 -0
- package/lib/components/Loading/styles.d.ts.map +1 -0
- package/lib/components/Loading/styles.js +77 -0
- package/lib/components/Loading/types.d.ts +10 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/index.d.ts +13 -0
- package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/index.js +88 -0
- package/lib/components/Tabs/{schema.tab.d.ts → Tab/schema.d.ts} +1 -1
- package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.d.ts +7 -0
- package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.js +37 -0
- package/lib/components/Tabs/context.d.ts +2 -2
- package/lib/components/Tabs/context.d.ts.map +1 -1
- package/lib/components/Tabs/context.js +1 -1
- package/lib/components/Tabs/index.d.ts +17 -6
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +94 -163
- package/lib/components/Tabs/styles.d.ts +4 -0
- package/lib/components/Tabs/styles.d.ts.map +1 -0
- package/lib/components/Tabs/styles.js +35 -0
- package/lib/components/Typography/withColors.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts.map +1 -1
- package/lib/components/Typography/withColors.js +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +58 -0
- package/package.json +2 -2
- package/lib/components/Tabs/Tab.d.ts +0 -5
- package/lib/components/Tabs/Tab.d.ts.map +0 -1
- package/lib/components/Tabs/Tab.js +0 -109
- package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
- package/lib/components/Tabs/types.d.ts +0 -27
- package/lib/components/Tabs/types.d.ts.map +0 -1
- /package/lib/components/{Tabs → Loading}/types.js +0 -0
- /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _assignRef = _interopRequireDefault(require("../../../utils/assignRef"));
|
|
13
|
+
|
|
14
|
+
var _context = require("../context");
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
var Tab = (0, _react.forwardRef)(function (_ref, ref) {
|
|
29
|
+
var id = _ref.id,
|
|
30
|
+
children = _ref.children,
|
|
31
|
+
icon = _ref.icon,
|
|
32
|
+
title = _ref.title,
|
|
33
|
+
onClick = _ref.onClick,
|
|
34
|
+
disabled = _ref.disabled,
|
|
35
|
+
rest = _objectWithoutProperties(_ref, ["id", "children", "icon", "title", "onClick", "disabled"]);
|
|
36
|
+
|
|
37
|
+
var tabs = (0, _context.useTabs)();
|
|
38
|
+
var Icon = icon;
|
|
39
|
+
var isActive = id === tabs.activeId;
|
|
40
|
+
var internalRef = (0, _react.useRef)(null);
|
|
41
|
+
var handleClick = (0, _react.useCallback)(function (e) {
|
|
42
|
+
!disabled && tabs.activate(id);
|
|
43
|
+
onClick && onClick(e);
|
|
44
|
+
}, [id, tabs, disabled, onClick]);
|
|
45
|
+
|
|
46
|
+
var assignRefs = function assignRefs(node) {
|
|
47
|
+
(0, _assignRef.default)(ref, node);
|
|
48
|
+
(0, _assignRef.default)(internalRef, node);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
(0, _react.useEffect)(function () {
|
|
52
|
+
var unregister = tabs.register(id, {
|
|
53
|
+
isDisabled: !!disabled,
|
|
54
|
+
content: children,
|
|
55
|
+
ref: internalRef
|
|
56
|
+
});
|
|
57
|
+
return unregister;
|
|
58
|
+
}, [id, disabled, children, internalRef, tabs]);
|
|
59
|
+
return _react.default.createElement(_styles.TabContainer, _extends({}, rest, {
|
|
60
|
+
"aria-controls": "tab-panel-".concat(id),
|
|
61
|
+
"aria-selected": isActive,
|
|
62
|
+
disabled: !!disabled,
|
|
63
|
+
id: "tab-".concat(id),
|
|
64
|
+
onClick: handleClick,
|
|
65
|
+
onKeyDown: tabs.onKeyDown,
|
|
66
|
+
ref: assignRefs,
|
|
67
|
+
role: "tab",
|
|
68
|
+
size: tabs.size || 'normal',
|
|
69
|
+
tabIndex: isActive ? 0 : -1,
|
|
70
|
+
type: "button"
|
|
71
|
+
}), Icon && _react.default.createElement(Icon, {
|
|
72
|
+
size: "medium"
|
|
73
|
+
}), _react.default.createElement("span", null, title));
|
|
74
|
+
}); // @ts-ignore
|
|
75
|
+
|
|
76
|
+
Tab.propTypes = {
|
|
77
|
+
id: _propTypes.default.string.isRequired,
|
|
78
|
+
title: _propTypes.default.string.isRequired,
|
|
79
|
+
icon: _propTypes.default.elementType,
|
|
80
|
+
disabled: _propTypes.default.bool
|
|
81
|
+
};
|
|
82
|
+
Tab.displayName = 'Tab';
|
|
83
|
+
Tab.defaultProps = {
|
|
84
|
+
icon: undefined,
|
|
85
|
+
disabled: false
|
|
86
|
+
};
|
|
87
|
+
var _default = Tab;
|
|
88
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAmC,CAAC;AAqBhD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TabProps } from '.';
|
|
2
|
+
interface StyledTabProps extends Omit<TabProps, 'title'> {
|
|
3
|
+
size: 'normal' | 'large';
|
|
4
|
+
}
|
|
5
|
+
export declare const TabContainer: import("styled-components").StyledComponent<"button", any, StyledTabProps, never>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/styles.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,UAAU,cAAe,SAAQ,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;IACtD,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAMD,eAAO,MAAM,YAAY,mFAgFxB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabContainer = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
11
|
+
|
|
12
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
13
|
+
|
|
14
|
+
var _designTokens = require("@decisiv/design-tokens");
|
|
15
|
+
|
|
16
|
+
var _BaseButton = _interopRequireDefault(require("../../../atoms/BaseButton"));
|
|
17
|
+
|
|
18
|
+
var _styleModifiers = require("../../../utils/styleModifiers");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
23
|
+
|
|
24
|
+
/* eslint-disable import/prefer-default-export */
|
|
25
|
+
var base = _designTokens.color.base,
|
|
26
|
+
interaction = _designTokens.color.interaction,
|
|
27
|
+
opacity = _designTokens.color.opacity;
|
|
28
|
+
var shadowColor = (0, _toColorString.default)(interaction.pacificOcean40);
|
|
29
|
+
var yPaddingBySize = {
|
|
30
|
+
normal: 5,
|
|
31
|
+
large: 10
|
|
32
|
+
};
|
|
33
|
+
var TabContainer = (0, _styledComponents.default)(_BaseButton.default).withConfig({
|
|
34
|
+
displayName: "styles__TabContainer",
|
|
35
|
+
componentId: "sc-3l38e9-0"
|
|
36
|
+
})(["color:", ";align-items:center;background:", ";border-radius:2px 2px 0 0;border:1px solid transparent;cursor:default;display:flex;font-size:", ";line-height:1.4;margin:0;outline:none;padding-top:", ";padding-right:", ";padding-bottom:", ";padding-left:", ";position:relative;font-weight:", ";&::after{background:", ";bottom:-1px;content:'';height:3px;left:2px;opacity:0;position:absolute;right:2px;}&:hover{color:", ";}&[aria-selected='true']{border-color:", ";border-bottom-color:transparent;color:", ";margin-bottom:-1px;padding-bottom:", ";&:focus{border-color:", ";border-bottom-color:", ";box-shadow:inset 0 0 0 2px ", ";&::after{opacity:1;}}}&:disabled{color:", ";cursor:not-allowed;}> *:not(span){margin-top:-1px;}> * + span{margin-left:", ";}", ";"], (0, _toColorString.default)(interaction.pacificOcean), (0, _toColorString.default)(base.snowWhite), (0, _rem.default)(_designTokens.typography.size.scale[1]), (0, _rem.default)(yPaddingBySize.normal + 3), (0, _rem.default)(15), (0, _rem.default)(yPaddingBySize.normal - 1), (0, _rem.default)(15), _designTokens.typography.weight.alias.medium, (0, _toColorString.default)(base.snowWhite), (0, _toColorString.default)(interaction.indianOcean), (0, _toColorString.default)(base.quarterMoon), (0, _toColorString.default)(base.alaskanHusky), (0, _rem.default)(yPaddingBySize.normal), (0, _toColorString.default)(interaction.pacificOcean), shadowColor, shadowColor, (0, _toColorString.default)(opacity.charcoal40), (0, _rem.default)(8), (0, _styleModifiers.when)('size', 'large', (0, _styledComponents.css)(["font-size:", ";line-height:1.2;padding-bottom:", ";padding-top:", ";&[aria-selected='true']{padding-bottom:", ";}"], (0, _rem.default)(_designTokens.typography.size.scale[2]), (0, _rem.default)(yPaddingBySize.large - 1), (0, _rem.default)(yPaddingBySize.large + 3), (0, _rem.default)(yPaddingBySize.large))));
|
|
37
|
+
exports.TabContainer = TabContainer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { KeyboardEvent } from 'react';
|
|
2
|
-
import { TabData } from '
|
|
2
|
+
import { TabData } from '.';
|
|
3
3
|
declare const defaultCtxValue: {
|
|
4
4
|
activeId: string;
|
|
5
5
|
register(id: string, data: TabData): void;
|
|
6
6
|
onKeyDown(e: KeyboardEvent<HTMLButtonElement>): void;
|
|
7
|
-
|
|
7
|
+
activate(id: string): void;
|
|
8
8
|
};
|
|
9
9
|
export declare type CtxValue = typeof defaultCtxValue & {
|
|
10
10
|
size?: 'normal' | 'large';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAc,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,aAAa,EAAc,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAG5B,QAAA,MAAM,eAAe;;;;;CAKpB,CAAC;AAEF,oBAAY,QAAQ,GAAG,OAAO,eAAe,GAAG;IAC9C,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC3B,CAAC;AAGF,QAAA,MAAM,mBAAmB,kFAAuB,CAAC;AAEjD,QAAA,MAAM,OAAO,gBAAiE,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -12,7 +12,7 @@ var defaultCtxValue = {
|
|
|
12
12
|
activeId: '',
|
|
13
13
|
register: function register(id, data) {},
|
|
14
14
|
onKeyDown: function onKeyDown(e) {},
|
|
15
|
-
|
|
15
|
+
activate: function activate(id) {}
|
|
16
16
|
};
|
|
17
17
|
var TabsContext = (0, _react.createContext)(defaultCtxValue);
|
|
18
18
|
var TabsContextProvider = TabsContext.Provider;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React, { Ref, HTMLAttributes, RefObject, ReactNode } from 'react';
|
|
2
|
+
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
size?: 'normal' | 'large';
|
|
5
|
+
onChange?: (id: string) => void;
|
|
6
|
+
selectedId?: string;
|
|
7
|
+
defaultSelectedId?: string;
|
|
8
|
+
renderHiddenTabsContent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TabData {
|
|
11
|
+
ref: RefObject<HTMLButtonElement>;
|
|
12
|
+
content: ReactNode;
|
|
13
|
+
isDisabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Tabs: React.ForwardRefExoticComponent<Pick<TabsProps, "title" | "style" | "onDragEnd" | "size" | "id" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "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" | "selectedId" | "defaultSelectedId" | "renderHiddenTabsContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { default as Tab, TabProps, TabIcon } from './Tab';
|
|
17
|
+
export default Tabs;
|
|
7
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,GAAG,EAIH,cAAc,EACd,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAClC,OAAO,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,IAAI,koJAoIT,CAAC;AAqBF,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1D,eAAe,IAAI,CAAC"}
|
|
@@ -3,45 +3,35 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
Tab: true
|
|
8
|
-
};
|
|
9
6
|
Object.defineProperty(exports, "Tab", {
|
|
10
7
|
enumerable: true,
|
|
11
8
|
get: function get() {
|
|
12
9
|
return _Tab.default;
|
|
13
10
|
}
|
|
14
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "TabProps", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Tab.TabProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TabIcon", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Tab.TabIcon;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
15
24
|
exports.default = void 0;
|
|
16
25
|
|
|
17
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
27
|
|
|
19
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
20
|
-
|
|
21
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
29
|
|
|
23
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
24
|
-
|
|
25
|
-
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
26
|
-
|
|
27
|
-
var _usePrevious = _interopRequireDefault(require("../../utils/usePrevious"));
|
|
28
|
-
|
|
29
30
|
var _context = require("./context");
|
|
30
31
|
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
Object.keys(_types).forEach(function (key) {
|
|
34
|
-
if (key === "default" || key === "__esModule") return;
|
|
35
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
36
|
-
Object.defineProperty(exports, key, {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _types[key];
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
32
|
+
var _styles = require("./styles");
|
|
43
33
|
|
|
44
|
-
var _Tab =
|
|
34
|
+
var _Tab = _interopRequireWildcard(require("./Tab"));
|
|
45
35
|
|
|
46
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
37
|
|
|
@@ -49,14 +39,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
49
39
|
|
|
50
40
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
51
41
|
|
|
52
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
53
|
-
|
|
54
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
55
|
-
|
|
56
|
-
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
57
|
-
|
|
58
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
59
|
-
|
|
60
42
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
61
43
|
|
|
62
44
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
@@ -69,110 +51,77 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
69
51
|
|
|
70
52
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
71
53
|
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var TabContent = _styledComponents.default.div.withConfig({
|
|
83
|
-
displayName: "Tabs__TabContent",
|
|
84
|
-
componentId: "tlr0dr-2"
|
|
85
|
-
})(["&:active,&:focus{outline:none;}"]);
|
|
86
|
-
|
|
87
|
-
var Tabs = function Tabs(props, ref) {
|
|
88
|
-
var _props$size = props.size,
|
|
89
|
-
size = _props$size === void 0 ? 'normal' : _props$size,
|
|
90
|
-
children = props.children,
|
|
91
|
-
onChange = props.onChange,
|
|
92
|
-
selectedId = props.selectedId,
|
|
93
|
-
defaultSelectedId = props.defaultSelectedId,
|
|
94
|
-
_props$renderHiddenTa = props.renderHiddenTabsContent,
|
|
95
|
-
renderHiddenTabsContent = _props$renderHiddenTa === void 0 ? true : _props$renderHiddenTa,
|
|
96
|
-
rest = _objectWithoutProperties(props, ["size", "children", "onChange", "selectedId", "defaultSelectedId", "renderHiddenTabsContent"]);
|
|
97
|
-
|
|
98
|
-
var prevChildren = (0, _usePrevious.default)(children);
|
|
99
|
-
var prevSelectedId = (0, _usePrevious.default)(selectedId);
|
|
100
|
-
var initialActiveId = selectedId || defaultSelectedId || '';
|
|
101
|
-
var autoSelectActiveId = (0, _react.useRef)(!initialActiveId);
|
|
54
|
+
var Tabs = (0, _react.forwardRef)(function (_ref, ref) {
|
|
55
|
+
var _ref$size = _ref.size,
|
|
56
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
57
|
+
children = _ref.children,
|
|
58
|
+
onChange = _ref.onChange,
|
|
59
|
+
selectedId = _ref.selectedId,
|
|
60
|
+
defaultSelectedId = _ref.defaultSelectedId,
|
|
61
|
+
_ref$renderHiddenTabs = _ref.renderHiddenTabsContent,
|
|
62
|
+
renderHiddenTabsContent = _ref$renderHiddenTabs === void 0 ? true : _ref$renderHiddenTabs,
|
|
63
|
+
rest = _objectWithoutProperties(_ref, ["size", "children", "onChange", "selectedId", "defaultSelectedId", "renderHiddenTabsContent"]);
|
|
102
64
|
|
|
103
65
|
var _useState = (0, _react.useState)(new Map()),
|
|
104
|
-
_useState2 = _slicedToArray(_useState,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
registeredTabs = _useState2[0],
|
|
68
|
+
setRegisteredTabs = _useState2[1];
|
|
69
|
+
|
|
70
|
+
var enabledIds = (0, _react.useMemo)(function () {
|
|
71
|
+
return Array.from(registeredTabs).filter(function (_ref2) {
|
|
72
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
73
|
+
_id = _ref3[0],
|
|
74
|
+
data = _ref3[1];
|
|
75
|
+
|
|
76
|
+
return data.isDisabled === false;
|
|
77
|
+
}).map(function (_ref4) {
|
|
78
|
+
var _ref5 = _slicedToArray(_ref4, 1),
|
|
79
|
+
id = _ref5[0];
|
|
80
|
+
|
|
81
|
+
return id;
|
|
82
|
+
});
|
|
83
|
+
}, [registeredTabs]);
|
|
84
|
+
|
|
85
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
86
|
+
return enabledIds;
|
|
87
|
+
}, [enabledIds]),
|
|
88
|
+
_useMemo2 = _slicedToArray(_useMemo, 1),
|
|
89
|
+
firstTabId = _useMemo2[0];
|
|
90
|
+
|
|
91
|
+
var _useState3 = (0, _react.useState)(defaultSelectedId),
|
|
108
92
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
setTabsOrder = _useState6[1];
|
|
116
|
-
|
|
117
|
-
var _useState7 = (0, _react.useState)([]),
|
|
118
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
119
|
-
enabledIds = _useState8[0],
|
|
120
|
-
setEnabledIds = _useState8[1]; // If "children" changes, we start all over
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
(0, _react.useEffect)(function () {
|
|
124
|
-
if (prevChildren && children !== prevChildren) {
|
|
125
|
-
autoSelectActiveId.current = !initialActiveId;
|
|
126
|
-
setActiveId(initialActiveId);
|
|
127
|
-
setTabsOrder([]);
|
|
128
|
-
setEnabledIds([]);
|
|
129
|
-
}
|
|
130
|
-
}, [initialActiveId, prevChildren, children]);
|
|
131
|
-
(0, _react.useEffect)(function () {
|
|
132
|
-
if (selectedId !== prevSelectedId) {
|
|
133
|
-
setActiveId(selectedId || '');
|
|
134
|
-
}
|
|
135
|
-
}, [tabs, prevSelectedId, selectedId]);
|
|
93
|
+
uncontrolledActiveId = _useState4[0],
|
|
94
|
+
setUncontrolledActiveId = _useState4[1];
|
|
95
|
+
|
|
96
|
+
var activeId = (0, _react.useMemo)(function () {
|
|
97
|
+
return selectedId || uncontrolledActiveId || firstTabId;
|
|
98
|
+
}, [selectedId, uncontrolledActiveId, firstTabId]);
|
|
136
99
|
var register = (0, _react.useCallback)(function (id, data) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
!data.isDisabled && setEnabledIds(function (ids) {
|
|
148
|
-
return [].concat(_toConsumableArray(ids), [id]);
|
|
100
|
+
setRegisteredTabs(function (oldState) {
|
|
101
|
+
var newMap = new Map(oldState);
|
|
102
|
+
newMap.set(id, data);
|
|
103
|
+
return newMap;
|
|
104
|
+
});
|
|
105
|
+
return function () {
|
|
106
|
+
setRegisteredTabs(function (oldState) {
|
|
107
|
+
var newMap = new Map(oldState);
|
|
108
|
+
newMap.delete(id);
|
|
109
|
+
return newMap;
|
|
149
110
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var activateById = (0, _react.useCallback)(function (id) {
|
|
156
|
-
var tabData = tabs.get(id);
|
|
157
|
-
/* istanbul ignore else */
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
var activate = (0, _react.useCallback)(function (id) {
|
|
114
|
+
onChange && onChange(id);
|
|
115
|
+
var tabData = registeredTabs.get(id);
|
|
158
116
|
|
|
159
117
|
if (tabData && tabData.ref.current) {
|
|
160
118
|
tabData.ref.current.focus();
|
|
161
119
|
}
|
|
162
|
-
/* istanbul ignore else */
|
|
163
120
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// Only activate if we are not a controlled component
|
|
167
|
-
if (selectedId !== undefined) {
|
|
168
|
-
onChange && onChange(id);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
setActiveId(id);
|
|
173
|
-
onChange && onChange(id);
|
|
121
|
+
if (!selectedId) {
|
|
122
|
+
setUncontrolledActiveId(id);
|
|
174
123
|
}
|
|
175
|
-
}, [
|
|
124
|
+
}, [selectedId, registeredTabs, onChange]);
|
|
176
125
|
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
177
126
|
var totalIds = enabledIds.length;
|
|
178
127
|
var activeIdx = enabledIds.indexOf(activeId);
|
|
@@ -195,49 +144,31 @@ var Tabs = function Tabs(props, ref) {
|
|
|
195
144
|
newActiveIdx = totalIds - 1;
|
|
196
145
|
break;
|
|
197
146
|
}
|
|
198
|
-
/* istanbul ignore else */
|
|
199
|
-
|
|
200
147
|
|
|
201
148
|
if (newActiveIdx !== activeIdx) {
|
|
202
|
-
|
|
203
|
-
var tabData = tabs.get(newActiveId);
|
|
204
|
-
|
|
205
|
-
if (selectedId !== undefined) {
|
|
206
|
-
onChange && onChange(newActiveId);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
/* istanbul ignore else */
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (tabData && tabData.ref.current) {
|
|
213
|
-
tabData.ref.current.focus();
|
|
214
|
-
}
|
|
215
|
-
/* istanbul ignore else */
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (newActiveId !== activeId) {
|
|
219
|
-
setActiveId(newActiveId);
|
|
220
|
-
onChange && onChange(newActiveId);
|
|
221
|
-
}
|
|
149
|
+
activate(enabledIds[newActiveIdx]);
|
|
222
150
|
}
|
|
223
|
-
}, [
|
|
224
|
-
var
|
|
151
|
+
}, [activeId, enabledIds, activate]);
|
|
152
|
+
var values = (0, _react.useMemo)(function () {
|
|
225
153
|
return {
|
|
226
|
-
size: size,
|
|
227
|
-
activeId: activeId,
|
|
228
154
|
register: register,
|
|
229
|
-
|
|
155
|
+
activeId: activeId,
|
|
156
|
+
activate: activate,
|
|
157
|
+
size: size,
|
|
230
158
|
onKeyDown: onKeyDown
|
|
231
159
|
};
|
|
232
|
-
}, [
|
|
160
|
+
}, [register, activeId, activate, size, onKeyDown]);
|
|
233
161
|
return _react.default.createElement(_context.TabsContextProvider, {
|
|
234
|
-
value:
|
|
235
|
-
}, _react.default.createElement(Container, _extends({}, rest, {
|
|
162
|
+
value: values
|
|
163
|
+
}, _react.default.createElement(_styles.Container, _extends({}, rest, {
|
|
236
164
|
ref: ref
|
|
237
|
-
}), _react.default.createElement(TabList, null, children),
|
|
238
|
-
var
|
|
165
|
+
}), _react.default.createElement(_styles.TabList, null, children), Array.from(registeredTabs, function (_ref6, index) {
|
|
166
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
167
|
+
id = _ref7[0],
|
|
168
|
+
data = _ref7[1];
|
|
169
|
+
|
|
239
170
|
var isActive = id === activeId || !activeId && index === 0;
|
|
240
|
-
return _react.default.createElement(TabContent, {
|
|
171
|
+
return _react.default.createElement(_styles.TabContent, {
|
|
241
172
|
key: id,
|
|
242
173
|
id: "tab-panel-".concat(id),
|
|
243
174
|
"aria-hidden": !isActive || !data,
|
|
@@ -247,22 +178,22 @@ var Tabs = function Tabs(props, ref) {
|
|
|
247
178
|
tabIndex: isActive ? 0 : -1
|
|
248
179
|
}, (isActive || renderHiddenTabsContent) && data && data.content);
|
|
249
180
|
})));
|
|
250
|
-
};
|
|
181
|
+
});
|
|
182
|
+
Tabs.displayName = 'Tabs'; // @ts-ignore
|
|
251
183
|
|
|
252
|
-
|
|
253
|
-
TabsWithRef.propTypes = {
|
|
184
|
+
Tabs.propTypes = {
|
|
254
185
|
size: _propTypes.default.oneOf(['normal', 'large']),
|
|
255
186
|
selectedId: _propTypes.default.string,
|
|
256
187
|
defaultSelectedId: _propTypes.default.string,
|
|
257
188
|
renderHiddenTabsContent: _propTypes.default.bool,
|
|
258
189
|
onChange: _propTypes.default.func
|
|
259
190
|
};
|
|
260
|
-
|
|
191
|
+
Tabs.defaultProps = {
|
|
261
192
|
size: 'normal',
|
|
262
193
|
selectedId: undefined,
|
|
263
194
|
defaultSelectedId: undefined,
|
|
264
195
|
renderHiddenTabsContent: true,
|
|
265
196
|
onChange: undefined
|
|
266
197
|
};
|
|
267
|
-
var _default =
|
|
198
|
+
var _default = Tabs;
|
|
268
199
|
exports.default = _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const TabList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const TabContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,oEAGrB,CAAC;AAEF,eAAO,MAAM,OAAO,oEAInB,CAAC;AAEF,eAAO,MAAM,UAAU,oEAKtB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabContent = exports.TabList = exports.Container = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
11
|
+
|
|
12
|
+
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div.withConfig({
|
|
17
|
+
displayName: "styles__Container",
|
|
18
|
+
componentId: "sc-1o82gsh-0"
|
|
19
|
+
})(["display:flex;flex-direction:column;"]);
|
|
20
|
+
|
|
21
|
+
exports.Container = Container;
|
|
22
|
+
|
|
23
|
+
var TabList = _styledComponents.default.div.withConfig({
|
|
24
|
+
displayName: "styles__TabList",
|
|
25
|
+
componentId: "sc-1o82gsh-1"
|
|
26
|
+
})(["align-items:flex-end;border-bottom:1px solid ", ";display:flex;"], (0, _toColorString.default)(_color.default.base.quarterMoon));
|
|
27
|
+
|
|
28
|
+
exports.TabList = TabList;
|
|
29
|
+
|
|
30
|
+
var TabContent = _styledComponents.default.div.withConfig({
|
|
31
|
+
displayName: "styles__TabContent",
|
|
32
|
+
componentId: "sc-1o82gsh-2"
|
|
33
|
+
})(["&:active,&:focus{outline:none;}"]);
|
|
34
|
+
|
|
35
|
+
exports.TabContent = TabContent;
|
|
@@ -8,7 +8,7 @@ declare const enabledBaseColors: Pick<{
|
|
|
8
8
|
blackSheep: Color;
|
|
9
9
|
midnight: Color;
|
|
10
10
|
charcoal: Color;
|
|
11
|
-
}, "charcoal" | "alaskanHusky" | "snowWhite" | "quarterMoon" | "halfMoon">;
|
|
11
|
+
}, "charcoal" | "alaskanHusky" | "snowWhite" | "quarterMoon" | "halfMoon" | "fullMoon">;
|
|
12
12
|
declare type EnabledBaseColorKeys = keyof typeof enabledBaseColors;
|
|
13
13
|
declare type StatusColorsKeys = Exclude<keyof typeof color.status, 'default'>;
|
|
14
14
|
declare const passThroughColors: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withColors.d.ts","sourceRoot":"","sources":["../../../src/components/Typography/withColors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAShE,QAAA,MAAM,iBAAiB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"withColors.d.ts","sourceRoot":"","sources":["../../../src/components/Typography/withColors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAShE,QAAA,MAAM,iBAAiB;;;;;;;;;uFAOrB,CAAC;AAEH,aAAK,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE3D,aAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,OAAO,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAGtE,QAAA,MAAM,iBAAiB;;CAAyB,CAAC;AACjD,aAAK,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE3D,oBAAY,mBAAmB,GAC3B,oBAAoB,GACpB,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,oBAAY,gBAAgB,GAAG;KAAG,CAAC,IAAI,mBAAmB,GAAG,KAAK,GAAG,MAAM;CAAE,CAAC;AAgB9E,eAAO,MAAM,mBAAmB,UAI/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAI9B,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;CAIZ,CAAC;AAYX,aAAK,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,eAEN,CAAC;AAoC3B,QAAA,MAAM,UAAU,+FAGf,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -33,7 +33,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
33
33
|
|
|
34
34
|
var base = _color.default.base,
|
|
35
35
|
status = _color.default.status;
|
|
36
|
-
var enabledBaseColors = (0, _pick.default)(base, ['charcoal', 'alaskanHusky', 'snowWhite', 'quarterMoon', 'halfMoon']);
|
|
36
|
+
var enabledBaseColors = (0, _pick.default)(base, ['charcoal', 'alaskanHusky', 'snowWhite', 'quarterMoon', 'halfMoon', 'fullMoon']);
|
|
37
37
|
var passThroughColors = {
|
|
38
38
|
inherit: 'inherit'
|
|
39
39
|
};
|