@salutejs/plasma-core 1.227.0-next-sbcom.0 → 1.227.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/__helpers/IconPlaceholder.js +6 -9
- package/__helpers/index.js +1 -1
- package/collectPackageInfo.js +4 -4
- package/components/Badge/Badge.js +30 -103
- package/components/Badge/index.js +1 -1
- package/components/Basebox/Basebox.js +33 -42
- package/components/Basebox/index.js +1 -1
- package/components/Button/Button.js +28 -67
- package/components/Button/Button.mixins.js +22 -76
- package/components/Button/Button.props.js +5 -5
- package/components/Button/createButton.js +14 -145
- package/components/Button/index.js +4 -4
- package/components/Card/Card.js +34 -162
- package/components/Card/CardBody.js +4 -4
- package/components/Card/CardContent.js +14 -23
- package/components/Card/CardMedia.js +20 -91
- package/components/Card/CardPrice.js +18 -60
- package/components/Card/CardTypography.js +43 -52
- package/components/Card/index.js +5 -5
- package/components/Carousel/Carousel.js +46 -64
- package/components/Carousel/CarouselItem.js +21 -93
- package/components/Carousel/hooks.js +62 -121
- package/components/Carousel/index.js +3 -3
- package/components/Carousel/utils.js +59 -73
- package/components/Fade/Fade.js +6 -9
- package/components/Fade/index.js +1 -1
- package/components/Field/Field.js +48 -63
- package/components/Field/Field.statuses.js +3 -3
- package/components/Field/index.js +2 -2
- package/components/Image/Image.js +34 -115
- package/components/Image/index.js +1 -1
- package/components/Input/Input.js +7 -7
- package/components/Input/Input.mixins.js +9 -12
- package/components/Input/index.js +1 -1
- package/components/ModalBase/ModalBase.js +22 -100
- package/components/ModalBase/ModalBaseContext.js +6 -9
- package/components/ModalBase/ModalOverlay.js +28 -111
- package/components/ModalBase/hooks.js +15 -43
- package/components/ModalBase/index.js +2 -2
- package/components/PaginationDots/PaginationDot.js +11 -17
- package/components/PaginationDots/PaginationDots.js +4 -7
- package/components/PaginationDots/index.js +3 -3
- package/components/PaginationDots/usePaginationDots.js +10 -11
- package/components/Popup/Popup.js +52 -205
- package/components/Popup/index.js +1 -1
- package/components/PopupBase/PopupBase.js +35 -169
- package/components/PopupBase/PopupBaseContext.js +26 -86
- package/components/PopupBase/PopupBaseRoot.js +31 -169
- package/components/PopupBase/hooks.js +23 -97
- package/components/PopupBase/index.js +3 -3
- package/components/PopupBase/utils.js +32 -78
- package/components/Price/Price.js +15 -90
- package/components/Price/index.js +1 -1
- package/components/RadioGroup/RadioGroup.js +6 -127
- package/components/RadioGroup/index.js +1 -1
- package/components/SSRProvider/SSRProvider.js +4 -5
- package/components/SSRProvider/index.js +1 -1
- package/components/Skeleton/LineSkeleton.js +23 -95
- package/components/Skeleton/RectSkeleton.js +20 -93
- package/components/Skeleton/Skeleton.js +2 -2
- package/components/Skeleton/TextSkeleton.js +11 -55
- package/components/Skeleton/index.js +3 -3
- package/components/Slider/Double.js +52 -203
- package/components/Slider/Handle.js +28 -158
- package/components/Slider/Single.js +29 -177
- package/components/Slider/Slider.js +5 -7
- package/components/Slider/SliderBase.js +39 -48
- package/components/Slider/ThumbBase.js +19 -95
- package/components/Slider/index.js +3 -3
- package/components/Slider/utils.js +2 -2
- package/components/Spinner/Spinner.js +28 -100
- package/components/Spinner/SpinnerSvg.js +9 -78
- package/components/Spinner/index.js +1 -1
- package/components/Switch/Switch.js +49 -220
- package/components/Switch/index.js +1 -1
- package/components/Tabs/TabItem.js +33 -168
- package/components/Tabs/Tabs.js +32 -170
- package/components/Tabs/TabsContext.js +12 -42
- package/components/Tabs/createTabsController.js +33 -168
- package/components/Tabs/index.js +4 -4
- package/components/TextArea/TextArea.js +20 -30
- package/components/TextArea/index.js +1 -1
- package/components/TextField/index.js +3 -3
- package/components/Toast/Toast.js +15 -16
- package/components/Toast/ToastContext.js +4 -8
- package/components/Toast/ToastController.js +44 -101
- package/components/Toast/ToastProvider.js +37 -142
- package/components/Toast/index.js +3 -3
- package/components/Toast/useToast.js +6 -6
- package/components/Typography/Body.js +18 -18
- package/components/Typography/Button.js +13 -13
- package/components/Typography/Caption.js +8 -8
- package/components/Typography/Display.js +18 -18
- package/components/Typography/Footnote.js +13 -13
- package/components/Typography/Headline.js +43 -43
- package/components/Typography/Paragraph.js +24 -24
- package/components/Typography/Underline.js +8 -8
- package/es/__helpers/IconPlaceholder.js +5 -8
- package/es/collectPackageInfo.js +3 -3
- package/es/components/Badge/Badge.js +27 -100
- package/es/components/Basebox/Basebox.js +28 -37
- package/es/components/Button/Button.js +24 -63
- package/es/components/Button/Button.mixins.js +19 -73
- package/es/components/Button/Button.props.js +3 -3
- package/es/components/Button/createButton.js +12 -143
- package/es/components/Card/Card.js +29 -157
- package/es/components/Card/CardBody.js +2 -2
- package/es/components/Card/CardContent.js +12 -21
- package/es/components/Card/CardMedia.js +17 -88
- package/es/components/Card/CardPrice.js +13 -55
- package/es/components/Card/CardTypography.js +43 -52
- package/es/components/Carousel/Carousel.js +45 -63
- package/es/components/Carousel/CarouselItem.js +18 -90
- package/es/components/Carousel/hooks.js +58 -117
- package/es/components/Carousel/utils.js +58 -72
- package/es/components/Fade/Fade.js +5 -8
- package/es/components/Field/Field.js +44 -59
- package/es/components/Field/Field.statuses.js +4 -4
- package/es/components/Image/Image.js +31 -112
- package/es/components/Input/Input.js +4 -4
- package/es/components/Input/Input.mixins.js +6 -9
- package/es/components/ModalBase/ModalBase.js +16 -94
- package/es/components/ModalBase/ModalBaseContext.js +6 -9
- package/es/components/ModalBase/ModalOverlay.js +23 -106
- package/es/components/ModalBase/hooks.js +12 -40
- package/es/components/PaginationDots/PaginationDot.js +9 -15
- package/es/components/PaginationDots/PaginationDots.js +3 -6
- package/es/components/PaginationDots/usePaginationDots.js +9 -10
- package/es/components/Popup/Popup.js +48 -201
- package/es/components/PopupBase/PopupBase.js +27 -161
- package/es/components/PopupBase/PopupBaseContext.js +25 -85
- package/es/components/PopupBase/PopupBaseRoot.js +26 -164
- package/es/components/PopupBase/hooks.js +21 -95
- package/es/components/PopupBase/utils.js +31 -77
- package/es/components/Price/Price.js +12 -87
- package/es/components/RadioGroup/RadioGroup.js +5 -126
- package/es/components/SSRProvider/SSRProvider.js +3 -4
- package/es/components/Skeleton/LineSkeleton.js +18 -90
- package/es/components/Skeleton/RectSkeleton.js +16 -89
- package/es/components/Skeleton/Skeleton.js +2 -2
- package/es/components/Skeleton/TextSkeleton.js +7 -51
- package/es/components/Slider/Double.js +49 -200
- package/es/components/Slider/Handle.js +23 -153
- package/es/components/Slider/Single.js +26 -174
- package/es/components/Slider/Slider.js +2 -4
- package/es/components/Slider/SliderBase.js +36 -45
- package/es/components/Slider/ThumbBase.js +16 -92
- package/es/components/Slider/index.js +1 -1
- package/es/components/Slider/utils.js +2 -2
- package/es/components/Spinner/Spinner.js +23 -95
- package/es/components/Spinner/SpinnerSvg.js +8 -77
- package/es/components/Switch/Switch.js +45 -216
- package/es/components/Tabs/TabItem.js +28 -163
- package/es/components/Tabs/Tabs.js +28 -166
- package/es/components/Tabs/TabsContext.js +11 -41
- package/es/components/Tabs/createTabsController.js +28 -163
- package/es/components/TextArea/TextArea.js +18 -28
- package/es/components/Toast/Toast.js +10 -11
- package/es/components/Toast/ToastContext.js +3 -7
- package/es/components/Toast/ToastController.js +38 -95
- package/es/components/Toast/ToastProvider.js +34 -139
- package/es/components/Toast/useToast.js +4 -4
- package/es/components/Typography/Body.js +15 -15
- package/es/components/Typography/Button.js +10 -10
- package/es/components/Typography/Caption.js +5 -5
- package/es/components/Typography/Display.js +15 -15
- package/es/components/Typography/Footnote.js +10 -10
- package/es/components/Typography/Headline.js +40 -40
- package/es/components/Typography/Paragraph.js +21 -21
- package/es/components/Typography/Underline.js +5 -5
- package/es/hocs/withAutoFocus.js +8 -78
- package/es/hocs/withSkeleton.js +5 -10
- package/es/hooks/useDebouncedFunction.js +4 -36
- package/es/hooks/useFocusTrap.js +18 -21
- package/es/hooks/useForkRef.js +3 -3
- package/es/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/es/hooks/useResizeObserver.js +8 -8
- package/es/hooks/useUniqId.js +6 -52
- package/es/mixins/addFocus.js +17 -22
- package/es/mixins/applyDisabled.js +6 -9
- package/es/mixins/applyEllipsis.js +2 -4
- package/es/mixins/applyMaxLines.js +3 -6
- package/es/mixins/applyNoSelect.js +2 -4
- package/es/mixins/applyOutline.js +2 -4
- package/es/mixins/applyRoundness.js +4 -7
- package/es/mixins/applyScrollSnap.js +4 -7
- package/es/mixins/applySkeletonGradient.js +6 -9
- package/es/mixins/applyView.js +2 -5
- package/es/mixins/blur.js +2 -5
- package/es/mixins/shadows.js +1 -1
- package/es/tokens/colors.js +48 -48
- package/es/tokens/typography.js +18 -18
- package/es/utils/__tests__/formatters.test.js +2 -2
- package/es/utils/animatedScrollTo.js +24 -34
- package/es/utils/canUseDOM.js +1 -1
- package/es/utils/extractTextFrom.js +3 -7
- package/es/utils/focusManager.js +40 -47
- package/es/utils/formatCurrency.js +4 -4
- package/es/utils/formatters.js +6 -14
- package/es/utils/react.js +4 -4
- package/es/utils/roundness.js +2 -4
- package/es/utils/scopeTab.js +5 -5
- package/es/utils/setRef.js +1 -1
- package/es/utils/tabbable.js +16 -25
- package/es/utils/toCssSize.js +1 -3
- package/es/utils/transformStyles.js +5 -60
- package/hocs/index.js +2 -2
- package/hocs/withAutoFocus.js +9 -79
- package/hocs/withSkeleton.js +8 -13
- package/hooks/index.js +6 -6
- package/hooks/useDebouncedFunction.js +5 -37
- package/hooks/useFocusTrap.js +22 -25
- package/hooks/useForkRef.js +5 -5
- package/hooks/useIsomorphicLayoutEffect.js +3 -3
- package/hooks/useResizeObserver.js +9 -9
- package/hooks/useUniqId.js +8 -54
- package/mixins/addFocus.js +19 -24
- package/mixins/applyDisabled.js +7 -10
- package/mixins/applyEllipsis.js +3 -5
- package/mixins/applyMaxLines.js +4 -7
- package/mixins/applyNoSelect.js +3 -5
- package/mixins/applyOutline.js +3 -5
- package/mixins/applyRoundness.js +5 -8
- package/mixins/applyScrollSnap.js +5 -8
- package/mixins/applySkeletonGradient.js +8 -11
- package/mixins/applyView.js +3 -6
- package/mixins/blur.js +2 -5
- package/mixins/index.js +11 -11
- package/mixins/shadows.js +1 -1
- package/package.json +13 -18
- package/tokens/colors.js +48 -48
- package/tokens/typography.js +18 -18
- package/utils/__tests__/formatters.test.js +3 -3
- package/utils/animatedScrollTo.js +24 -34
- package/utils/canUseDOM.js +1 -1
- package/utils/extractTextFrom.js +4 -8
- package/utils/focusManager.js +41 -48
- package/utils/formatCurrency.js +4 -4
- package/utils/formatters.js +6 -14
- package/utils/index.js +10 -10
- package/utils/react.js +7 -7
- package/utils/roundness.js +2 -4
- package/utils/scopeTab.js +6 -6
- package/utils/setRef.js +1 -1
- package/utils/tabbable.js +16 -25
- package/utils/toCssSize.js +1 -3
- package/utils/transformStyles.js +5 -60
|
@@ -8,26 +8,23 @@ Object.defineProperty(exports, "IconPlaceholder", {
|
|
|
8
8
|
return IconPlaceholder;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
11
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
|
|
12
12
|
function _interop_require_default(obj) {
|
|
13
13
|
return obj && obj.__esModule ? obj : {
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const sizes = {
|
|
18
18
|
xs: 'width: 1rem;height: 1rem;',
|
|
19
19
|
s: 'width: 1.5rem;height: 1.5rem;',
|
|
20
20
|
m: 'width: 2.25rem;height: 2.25rem;',
|
|
21
21
|
l: 'width: 3rem;height: 3rem;',
|
|
22
22
|
xl: 'width: 3.5rem;height: 3.5rem;'
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
const IconPlaceholder = _styledcomponents.default.div.withConfig({
|
|
25
25
|
displayName: "IconPlaceholder",
|
|
26
26
|
componentId: "sc-c34b6bd1-0"
|
|
27
27
|
})([
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
],
|
|
31
|
-
var size = param.size;
|
|
32
|
-
return sizes[size || 's'];
|
|
33
|
-
});
|
|
28
|
+
``,
|
|
29
|
+
`;border-radius:50%;background:rgba(0,0,0,0.32);`
|
|
30
|
+
], ({ size })=>sizes[size || 's']);
|
package/__helpers/index.js
CHANGED
package/collectPackageInfo.js
CHANGED
|
@@ -9,23 +9,23 @@ Object.defineProperty(exports, "collectPackageInfo", {
|
|
|
9
9
|
return collectPackageInfo;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
const _pkg = /*#__PURE__*/ _interop_require_default(require("@pkg"));
|
|
13
13
|
function _interop_require_default(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : {
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const collectPackageInfo = (entityName)=>{
|
|
19
19
|
if (typeof window === 'undefined') {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
const { name, version } = _pkg.default;
|
|
23
23
|
if (!window.__PLASMA_INFO__) {
|
|
24
24
|
window.__PLASMA_INFO__ = {};
|
|
25
25
|
}
|
|
26
26
|
if (!window.__PLASMA_INFO__[name]) {
|
|
27
27
|
window.__PLASMA_INFO__[name] = {
|
|
28
|
-
version
|
|
28
|
+
version,
|
|
29
29
|
entities: [
|
|
30
30
|
entityName
|
|
31
31
|
]
|
|
@@ -19,22 +19,9 @@ _export(exports, {
|
|
|
19
19
|
return badgeSizes;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function _define_property(obj, key, value) {
|
|
26
|
-
if (key in obj) {
|
|
27
|
-
Object.defineProperty(obj, key, {
|
|
28
|
-
value: value,
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true
|
|
32
|
-
});
|
|
33
|
-
} else {
|
|
34
|
-
obj[key] = value;
|
|
35
|
-
}
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
22
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
23
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
24
|
+
const _tokens = require("../../tokens");
|
|
38
25
|
function _interop_require_default(obj) {
|
|
39
26
|
return obj && obj.__esModule ? obj : {
|
|
40
27
|
default: obj
|
|
@@ -81,58 +68,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
81
68
|
}
|
|
82
69
|
return newObj;
|
|
83
70
|
}
|
|
84
|
-
|
|
85
|
-
for(var i = 1; i < arguments.length; i++){
|
|
86
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
87
|
-
var ownKeys = Object.keys(source);
|
|
88
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
89
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
90
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
ownKeys.forEach(function(key) {
|
|
94
|
-
_define_property(target, key, source[key]);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
return target;
|
|
98
|
-
}
|
|
99
|
-
function _object_without_properties(source, excluded) {
|
|
100
|
-
if (source == null) return {};
|
|
101
|
-
var target = {}, sourceKeys, key, i;
|
|
102
|
-
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
103
|
-
sourceKeys = Reflect.ownKeys(source);
|
|
104
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
105
|
-
key = sourceKeys[i];
|
|
106
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
107
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
108
|
-
target[key] = source[key];
|
|
109
|
-
}
|
|
110
|
-
return target;
|
|
111
|
-
}
|
|
112
|
-
target = _object_without_properties_loose(source, excluded);
|
|
113
|
-
if (Object.getOwnPropertySymbols) {
|
|
114
|
-
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
115
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
116
|
-
key = sourceKeys[i];
|
|
117
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
118
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
119
|
-
target[key] = source[key];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return target;
|
|
123
|
-
}
|
|
124
|
-
function _object_without_properties_loose(source, excluded) {
|
|
125
|
-
if (source == null) return {};
|
|
126
|
-
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
127
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
128
|
-
key = sourceKeys[i];
|
|
129
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
130
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
131
|
-
target[key] = source[key];
|
|
132
|
-
}
|
|
133
|
-
return target;
|
|
134
|
-
}
|
|
135
|
-
var badgeSizes = {
|
|
71
|
+
const badgeSizes = {
|
|
136
72
|
l: {
|
|
137
73
|
textMarginX: '0.25rem',
|
|
138
74
|
textMarginLeftAfterContent: '0.25rem'
|
|
@@ -142,7 +78,7 @@ var badgeSizes = {
|
|
|
142
78
|
textMarginLeftAfterContent: '0.125rem'
|
|
143
79
|
}
|
|
144
80
|
};
|
|
145
|
-
|
|
81
|
+
const badgeRootSizes = {
|
|
146
82
|
l: {
|
|
147
83
|
height: '1.5rem',
|
|
148
84
|
padding: '0.25rem',
|
|
@@ -158,49 +94,40 @@ var badgeRootSizes = {
|
|
|
158
94
|
fontSize: '0.625rem'
|
|
159
95
|
}
|
|
160
96
|
};
|
|
161
|
-
|
|
97
|
+
const StyledText = _styledcomponents.default.span.withConfig({
|
|
162
98
|
displayName: "Badge__StyledText",
|
|
163
99
|
componentId: "sc-4f989aef-0"
|
|
164
100
|
})([
|
|
165
|
-
|
|
101
|
+
``
|
|
166
102
|
]);
|
|
167
|
-
|
|
103
|
+
const StyledContent = _styledcomponents.default.div.withConfig({
|
|
168
104
|
displayName: "Badge__StyledContent",
|
|
169
105
|
componentId: "sc-4f989aef-1"
|
|
170
106
|
})([
|
|
171
|
-
|
|
107
|
+
`display:flex;`
|
|
172
108
|
]);
|
|
173
|
-
|
|
109
|
+
const StyledBadge = _styledcomponents.default.div.withConfig({
|
|
174
110
|
displayName: "Badge__StyledBadge",
|
|
175
111
|
componentId: "sc-4f989aef-2"
|
|
176
112
|
})([
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
], _tokens.caption,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
"{margin-left:",
|
|
191
|
-
";}"
|
|
113
|
+
``,
|
|
114
|
+
`;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;width:max-content;`,
|
|
115
|
+
`;`
|
|
116
|
+
], _tokens.caption, ({ size, circled })=>(0, _styledcomponents.css)([
|
|
117
|
+
``,
|
|
118
|
+
`;`,
|
|
119
|
+
` `,
|
|
120
|
+
`{margin-left:`,
|
|
121
|
+
`;margin-right:`,
|
|
122
|
+
`;}`,
|
|
123
|
+
` ~ `,
|
|
124
|
+
`{margin-left:`,
|
|
125
|
+
`;}`
|
|
192
126
|
], badgeRootSizes[size], circled && (0, _styledcomponents.css)([
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
], badgeRootSizes[size].minWidth), StyledText, badgeSizes[size].textMarginX, badgeSizes[size].textMarginX, StyledContent, StyledText, badgeSizes[size].textMarginLeftAfterContent);
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"text",
|
|
201
|
-
"contentLeft"
|
|
202
|
-
]);
|
|
203
|
-
return /*#__PURE__*/ _react.default.createElement(StyledBadge, _object_spread({
|
|
204
|
-
size: size
|
|
205
|
-
}, rest), contentLeft && /*#__PURE__*/ _react.default.createElement(StyledContent, null, contentLeft), text && /*#__PURE__*/ _react.default.createElement(StyledText, null, text));
|
|
206
|
-
};
|
|
127
|
+
`width:`,
|
|
128
|
+
`;padding-left:0;padding-right:0;`
|
|
129
|
+
], badgeRootSizes[size].minWidth), StyledText, badgeSizes[size].textMarginX, badgeSizes[size].textMarginX, StyledContent, StyledText, badgeSizes[size].textMarginLeftAfterContent));
|
|
130
|
+
const Badge = ({ size = 'l', text, contentLeft, ...rest })=>/*#__PURE__*/ _react.default.createElement(StyledBadge, {
|
|
131
|
+
size: size,
|
|
132
|
+
...rest
|
|
133
|
+
}, contentLeft && /*#__PURE__*/ _react.default.createElement(StyledContent, null, contentLeft), text && /*#__PURE__*/ _react.default.createElement(StyledText, null, text));
|
|
@@ -31,11 +31,11 @@ _export(exports, {
|
|
|
31
31
|
return StyledTrigger;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
35
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
36
|
+
const _Typography = require("../Typography");
|
|
37
|
+
const _mixins = require("../../mixins");
|
|
38
|
+
const _tokens = require("../../tokens");
|
|
39
39
|
function _interop_require_default(obj) {
|
|
40
40
|
return obj && obj.__esModule ? obj : {
|
|
41
41
|
default: obj
|
|
@@ -82,65 +82,56 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
82
82
|
}
|
|
83
83
|
return newObj;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
const StyledRoot = _styledcomponents.default.div.withConfig({
|
|
86
86
|
displayName: "Basebox__StyledRoot",
|
|
87
87
|
componentId: "sc-a5c1d526-0"
|
|
88
88
|
})([
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
``,
|
|
90
|
+
` position:relative;align-items:flex-start;display:flex;cursor:pointer;`
|
|
91
91
|
], _mixins.applyNoSelect);
|
|
92
|
-
|
|
92
|
+
const StyledContentWrapper = _styledcomponents.default.label.withConfig({
|
|
93
93
|
displayName: "Basebox__StyledContentWrapper",
|
|
94
94
|
componentId: "sc-a5c1d526-1"
|
|
95
95
|
})([
|
|
96
|
-
|
|
96
|
+
`position:relative;align-items:flex-start;display:flex;width:100%;cursor:inherit;`
|
|
97
97
|
]);
|
|
98
|
-
|
|
98
|
+
const StyledInput = _styledcomponents.default.input.withConfig({
|
|
99
99
|
displayName: "Basebox__StyledInput",
|
|
100
100
|
componentId: "sc-a5c1d526-2"
|
|
101
101
|
})([
|
|
102
|
-
|
|
102
|
+
`position:absolute;&:focus{outline:0 none;}`
|
|
103
103
|
]);
|
|
104
|
-
|
|
104
|
+
const StyledTrigger = _styledcomponents.default.div.withConfig({
|
|
105
105
|
displayName: "Basebox__StyledTrigger",
|
|
106
106
|
componentId: "sc-a5c1d526-3"
|
|
107
107
|
})([
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
|
|
112
|
-
return theme.lowPerformance ? 'unset' : 'all 0.1s ease-in-out';
|
|
113
|
-
});
|
|
114
|
-
var StyledContent = _styledcomponents.default.div.withConfig({
|
|
108
|
+
`box-sizing:border-box;position:relative;transition:`,
|
|
109
|
+
`;`
|
|
110
|
+
], ({ theme })=>theme.lowPerformance ? 'unset' : 'all 0.1s ease-in-out');
|
|
111
|
+
const StyledContent = _styledcomponents.default.div.withConfig({
|
|
115
112
|
displayName: "Basebox__StyledContent",
|
|
116
113
|
componentId: "sc-a5c1d526-4"
|
|
117
114
|
})([
|
|
118
|
-
|
|
115
|
+
`display:flex;flex-direction:column;margin-left:0.75rem;`
|
|
119
116
|
]);
|
|
120
|
-
|
|
117
|
+
const StyledLabel = (0, _styledcomponents.default)(_Typography.Body1).withConfig({
|
|
121
118
|
displayName: "Basebox__StyledLabel",
|
|
122
119
|
componentId: "sc-a5c1d526-5"
|
|
123
120
|
})([
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
], _mixins.applyEllipsis);
|
|
132
|
-
});
|
|
133
|
-
var StyledDescription = (0, _styledcomponents.default)(_Typography.Footnote1).withConfig({
|
|
121
|
+
``,
|
|
122
|
+
``
|
|
123
|
+
], ({ singleLine })=>singleLine && (0, _styledcomponents.css)([
|
|
124
|
+
``,
|
|
125
|
+
``
|
|
126
|
+
], _mixins.applyEllipsis));
|
|
127
|
+
const StyledDescription = (0, _styledcomponents.default)(_Typography.Footnote1).withConfig({
|
|
134
128
|
displayName: "Basebox__StyledDescription",
|
|
135
129
|
componentId: "sc-a5c1d526-6"
|
|
136
130
|
})([
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
], _tokens.secondary,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
""
|
|
145
|
-
], _mixins.applyEllipsis);
|
|
146
|
-
});
|
|
131
|
+
`color:`,
|
|
132
|
+
`;`,
|
|
133
|
+
``
|
|
134
|
+
], _tokens.secondary, ({ singleLine })=>singleLine && (0, _styledcomponents.css)([
|
|
135
|
+
``,
|
|
136
|
+
``
|
|
137
|
+
], _mixins.applyEllipsis));
|
|
@@ -28,96 +28,57 @@ _export(exports, {
|
|
|
28
28
|
return StyledSpinner;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function _define_property(obj, key, value) {
|
|
36
|
-
if (key in obj) {
|
|
37
|
-
Object.defineProperty(obj, key, {
|
|
38
|
-
value: value,
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true
|
|
42
|
-
});
|
|
43
|
-
} else {
|
|
44
|
-
obj[key] = value;
|
|
45
|
-
}
|
|
46
|
-
return obj;
|
|
47
|
-
}
|
|
31
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
32
|
+
const _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
|
|
33
|
+
const _mixins = require("../../mixins");
|
|
34
|
+
const _Spinner = require("../Spinner");
|
|
48
35
|
function _interop_require_default(obj) {
|
|
49
36
|
return obj && obj.__esModule ? obj : {
|
|
50
37
|
default: obj
|
|
51
38
|
};
|
|
52
39
|
}
|
|
53
|
-
|
|
54
|
-
for(var i = 1; i < arguments.length; i++){
|
|
55
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
56
|
-
var ownKeys = Object.keys(source);
|
|
57
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
58
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
59
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
ownKeys.forEach(function(key) {
|
|
63
|
-
_define_property(target, key, source[key]);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
var ButtonRoot = _styledcomponents.default.button.withConfig({
|
|
40
|
+
const ButtonRoot = _styledcomponents.default.button.withConfig({
|
|
69
41
|
displayName: "Button__ButtonRoot",
|
|
70
42
|
componentId: "sc-b39b3537-0"
|
|
71
43
|
})([
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
],
|
|
76
|
-
|
|
77
|
-
return !isLoading && _mixins.applyDisabled;
|
|
78
|
-
}, _mixins.applyBlur);
|
|
79
|
-
var ButtonLoader = _styledcomponents.default.div.withConfig({
|
|
44
|
+
`position:relative;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);a&{text-decoration:none;}&:focus{outline:none;}`,
|
|
45
|
+
` `,
|
|
46
|
+
``
|
|
47
|
+
], ({ $isLoading: isLoading })=>!isLoading && _mixins.applyDisabled, _mixins.applyBlur);
|
|
48
|
+
const ButtonLoader = _styledcomponents.default.div.withConfig({
|
|
80
49
|
displayName: "Button__ButtonLoader",
|
|
81
50
|
componentId: "sc-b39b3537-1"
|
|
82
51
|
})([
|
|
83
|
-
|
|
52
|
+
`position:absolute;`
|
|
84
53
|
]);
|
|
85
|
-
|
|
54
|
+
const StyledSpinner = (0, _styledcomponents.default)(_Spinner.Spinner).withConfig({
|
|
86
55
|
displayName: "Button__StyledSpinner",
|
|
87
56
|
componentId: "sc-b39b3537-2"
|
|
88
57
|
})([
|
|
89
|
-
|
|
58
|
+
`width:1.375rem;`
|
|
90
59
|
]);
|
|
91
|
-
|
|
60
|
+
const ButtonContentWrapper = _styledcomponents.default.span.withConfig({
|
|
92
61
|
displayName: "Button__ButtonContentWrapper",
|
|
93
62
|
componentId: "sc-b39b3537-3"
|
|
94
63
|
})([
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
],
|
|
98
|
-
|
|
99
|
-
return isLoading && 'opacity: 0;';
|
|
100
|
-
});
|
|
101
|
-
var ButtonText = _styledcomponents.default.span.withConfig({
|
|
64
|
+
`display:flex;align-items:inherit;justify-content:inherit;width:100%;`,
|
|
65
|
+
``
|
|
66
|
+
], ({ $isLoading: isLoading })=>isLoading && 'opacity: 0;');
|
|
67
|
+
const ButtonText = _styledcomponents.default.span.withConfig({
|
|
102
68
|
displayName: "Button__ButtonText",
|
|
103
69
|
componentId: "sc-b39b3537-4"
|
|
104
70
|
})([
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
], _mixins.applyEllipsis,
|
|
110
|
-
|
|
111
|
-
return isContentLeft && 'margin-left: 0.375rem;';
|
|
112
|
-
}, function(param) {
|
|
113
|
-
var isContentRight = param.$isContentRight;
|
|
114
|
-
return isContentRight && 'margin-right: 0.375rem;';
|
|
115
|
-
});
|
|
116
|
-
var Button = /*#__PURE__*/ _react.default.forwardRef(// eslint-disable-next-line prefer-arrow-callback
|
|
71
|
+
`box-sizing:border-box;`,
|
|
72
|
+
` `,
|
|
73
|
+
` `,
|
|
74
|
+
``
|
|
75
|
+
], _mixins.applyEllipsis, ({ $isContentLeft: isContentLeft })=>isContentLeft && 'margin-left: 0.375rem;', ({ $isContentRight: isContentRight })=>isContentRight && 'margin-right: 0.375rem;');
|
|
76
|
+
const Button = /*#__PURE__*/ _react.default.forwardRef(// eslint-disable-next-line prefer-arrow-callback
|
|
117
77
|
function Button(props, ref) {
|
|
118
|
-
return /*#__PURE__*/ _react.default.createElement(ButtonRoot,
|
|
119
|
-
ref: ref
|
|
120
|
-
|
|
78
|
+
return /*#__PURE__*/ _react.default.createElement(ButtonRoot, {
|
|
79
|
+
ref: ref,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
121
82
|
});
|
|
122
83
|
Button.defaultProps = {
|
|
123
84
|
pin: 'square-square',
|
|
@@ -8,65 +8,11 @@ Object.defineProperty(exports, "getButtonSizesMixin", {
|
|
|
8
8
|
return getButtonSizesMixin;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Object.defineProperty(obj, key, {
|
|
17
|
-
value: value,
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
obj[key] = value;
|
|
24
|
-
}
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
function _object_spread(target) {
|
|
28
|
-
for(var i = 1; i < arguments.length; i++){
|
|
29
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
30
|
-
var ownKeys = Object.keys(source);
|
|
31
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
32
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
33
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
ownKeys.forEach(function(key) {
|
|
37
|
-
_define_property(target, key, source[key]);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
function ownKeys(object, enumerableOnly) {
|
|
43
|
-
var keys = Object.keys(object);
|
|
44
|
-
if (Object.getOwnPropertySymbols) {
|
|
45
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
46
|
-
if (enumerableOnly) {
|
|
47
|
-
symbols = symbols.filter(function(sym) {
|
|
48
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
keys.push.apply(keys, symbols);
|
|
52
|
-
}
|
|
53
|
-
return keys;
|
|
54
|
-
}
|
|
55
|
-
function _object_spread_props(target, source) {
|
|
56
|
-
source = source != null ? source : {};
|
|
57
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
58
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
59
|
-
} else {
|
|
60
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
61
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return target;
|
|
65
|
-
}
|
|
66
|
-
var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
|
|
67
|
-
return function(param) {
|
|
68
|
-
var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
|
|
69
|
-
var paddingX = sizes[size].paddingX;
|
|
11
|
+
const _styledcomponents = require("styled-components");
|
|
12
|
+
const _mixins = require("../../mixins");
|
|
13
|
+
const _utils = require("../../utils");
|
|
14
|
+
const getButtonSizesMixin = (sizes, typos)=>({ size, pin, outlined, focused, $isContentLeft: isContentLeft, $isContentRight: isContentRight, shiftLeft, shiftRight, square, stretch, theme })=>{
|
|
15
|
+
let { paddingX } = sizes[size];
|
|
70
16
|
if (square) {
|
|
71
17
|
paddingX = sizes[size].paddingY;
|
|
72
18
|
} else if (stretch) {
|
|
@@ -75,21 +21,21 @@ var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
|
|
|
75
21
|
paddingX = sizes[size].paddingContentX;
|
|
76
22
|
}
|
|
77
23
|
return (0, _styledcomponents.css)([
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
], sizes[size].height, sizes[size].paddingY, paddingX, (0, _utils.convertRoundnessMatrix)(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square &&
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
24
|
+
`height:`,
|
|
25
|
+
`;padding:`,
|
|
26
|
+
` `,
|
|
27
|
+
`;border-radius:`,
|
|
28
|
+
`;`,
|
|
29
|
+
` `,
|
|
30
|
+
` `,
|
|
31
|
+
` `,
|
|
32
|
+
` `,
|
|
33
|
+
` `,
|
|
34
|
+
``
|
|
35
|
+
], sizes[size].height, sizes[size].paddingY, paddingX, (0, _utils.convertRoundnessMatrix)(pin, sizes[size].radius, sizes[size].radiusCircle), stretch && 'width: 100%;', square && ` width: ${sizes[size].height};`, shiftLeft && `margin-left: calc(-1 * ${paddingX});`, shiftRight && `margin-right: calc(-1 * ${paddingX});`, typos[size], (0, _mixins.addFocus)({
|
|
36
|
+
...theme,
|
|
37
|
+
focused,
|
|
38
|
+
outlined,
|
|
39
|
+
outlineRadius: (0, _utils.convertRoundnessMatrix)(pin, `calc(${sizes[size].radius} + var(--plasma-outline-size))`, `calc(${sizes[size].radiusCircle} + var(--plasma-outline-size))`)
|
|
40
|
+
}));
|
|
94
41
|
};
|
|
95
|
-
};
|
|
@@ -19,9 +19,9 @@ _export(exports, {
|
|
|
19
19
|
return buttonViews;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const _mixins = require("../../mixins");
|
|
23
|
+
const _tokens = require("../../tokens");
|
|
24
|
+
const buttonViews = {
|
|
25
25
|
primary: _mixins.views.primary,
|
|
26
26
|
secondary: _mixins.views.secondary,
|
|
27
27
|
success: _mixins.views.success,
|
|
@@ -31,7 +31,7 @@ var buttonViews = {
|
|
|
31
31
|
overlay: _mixins.views.overlay,
|
|
32
32
|
clear: _mixins.views.clear
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
const buttonSizes = {
|
|
35
35
|
l: {
|
|
36
36
|
height: 'var(--plasma-button-l-height)',
|
|
37
37
|
paddingY: 'var(--plasma-button-l-padding-y)',
|
|
@@ -60,7 +60,7 @@ var buttonSizes = {
|
|
|
60
60
|
radiusCircle: 'var(--plasma-button-s-radius-circle)'
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
const buttonTypography = {
|
|
64
64
|
l: _tokens.button1,
|
|
65
65
|
m: _tokens.button1,
|
|
66
66
|
s: _tokens.button2
|