@salutejs/plasma-new-hope 0.74.1-canary.1180.8686460436.0 → 0.75.0-canary.1170.8685945511.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Avatar/Avatar.js +1 -7
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/es/components/Avatar/Avatar.js +1 -7
- package/es/components/Avatar/Avatar.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Avatar/Avatar.js +1 -7
- package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +0 -1
- package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -34
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Header/Header.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Header/Header.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Link/Link.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Toast/Toast.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Button/Button.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/cjs/examples/plasma_web/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Header/Header.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Header/Header.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Link/Link.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Toast/Toast.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Badge/Badge.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Button/Button.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Button/Button.stories.tsx +1 -1
- package/styled-components/cjs/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/cjs/examples/sds_engineer/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/cjs/examples/sds_engineer/components/Counter/Counter.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Link/Link.config.js +1 -1
- package/styled-components/cjs/examples/sds_engineer/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/cjs/examples/sds_engineer/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/cjs/examples/sds_engineer/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Toast/Toast.config.js +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/es/components/Avatar/Avatar.js +1 -7
- package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +0 -1
- package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -34
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Button/Button.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Button/Button.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/es/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Header/Header.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Header/Header.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Link/Link.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Toast/Toast.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_web/components/Button/Button.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/es/examples/plasma_web/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_web/components/Header/Header.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Header/Header.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/Link/Link.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_web/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Toast/Toast.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/es/examples/sds_engineer/components/Badge/Badge.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Badge/Badge.stories.tsx +2 -2
- package/styled-components/es/examples/sds_engineer/components/Button/Button.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Button/Button.stories.tsx +1 -1
- package/styled-components/es/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.js +11 -8
- package/styled-components/es/examples/sds_engineer/components/ButtonGroup/ButtonGroup.stories.tsx +4 -4
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarBase.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Checkbox/Checkbox.config.js +1 -1
- package/styled-components/es/examples/sds_engineer/components/Counter/Counter.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Counter/Counter.stories.tsx +2 -2
- package/styled-components/es/examples/sds_engineer/components/Link/Link.config.js +1 -1
- package/styled-components/es/examples/sds_engineer/components/Radiobox/Radiobox.config.js +1 -1
- package/styled-components/es/examples/sds_engineer/components/Spinner/Spinner.config.js +1 -1
- package/styled-components/es/examples/sds_engineer/components/TextArea/TextArea.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Toast/Toast.config.js +2 -2
- package/styled-components/es/examples/sds_engineer/components/Toast/Toast.stories.tsx +2 -2
- package/styled-components/es/index.js +0 -1
- package/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +1 -1
- package/types/components/Counter/Counter.types.d.ts +1 -1
- package/types/components/Indicator/Indicator.d.ts +4 -4
- package/types/components/Indicator/Indicator.types.d.ts +12 -2
- package/types/components/Indicator/Indicator.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Button/Button.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Button/Button.d.ts +1 -1
- package/types/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.d.ts +4 -1
- package/types/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.d.ts +4 -1
- package/types/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/Calendar.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Calendar/CalendarBase.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Calendar/CalendarDouble.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Checkbox/Checkbox.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Checkbox/Checkbox.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Header/Header.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Header/Header.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Indicator/Indicator.d.ts +4 -4
- package/types/examples/plasma_b2c/components/Link/Link.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Link/Link.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Pagination/Pagination.config.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Pagination/Pagination.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Radiobox/Radiobox.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Radiobox/Radiobox.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Spinner/Spinner.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Spinner/Spinner.d.ts +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Toast/Toast.config.d.ts +1 -1
- package/types/examples/plasma_b2c/components/Toast/Toast.d.ts +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +1 -1
- package/types/examples/plasma_web/components/Button/Button.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Button/Button.d.ts +1 -1
- package/types/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.d.ts +4 -1
- package/types/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/ButtonGroup/ButtonGroup.d.ts +4 -1
- package/types/examples/plasma_web/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/Calendar.d.ts +2 -2
- package/types/examples/plasma_web/components/Calendar/CalendarBase.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Calendar/CalendarDouble.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Checkbox/Checkbox.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Checkbox/Checkbox.d.ts +1 -1
- package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Counter/Counter.d.ts +1 -1
- package/types/examples/plasma_web/components/Header/Header.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Header/Header.d.ts +1 -1
- package/types/examples/plasma_web/components/Indicator/Indicator.d.ts +4 -4
- package/types/examples/plasma_web/components/Link/Link.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Link/Link.d.ts +1 -1
- package/types/examples/plasma_web/components/Pagination/Pagination.config.d.ts +2 -2
- package/types/examples/plasma_web/components/Pagination/Pagination.d.ts +2 -2
- package/types/examples/plasma_web/components/Radiobox/Radiobox.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Radiobox/Radiobox.d.ts +1 -1
- package/types/examples/plasma_web/components/Spinner/Spinner.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Spinner/Spinner.d.ts +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +1 -1
- package/types/examples/plasma_web/components/Toast/Toast.config.d.ts +1 -1
- package/types/examples/plasma_web/components/Toast/Toast.d.ts +1 -1
- package/types/examples/sds_engineer/components/Badge/Badge.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Badge/Badge.d.ts +1 -1
- package/types/examples/sds_engineer/components/Button/Button.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Button/Button.d.ts +1 -1
- package/types/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.d.ts +4 -1
- package/types/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/ButtonGroup/ButtonGroup.d.ts +4 -1
- package/types/examples/sds_engineer/components/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/Calendar.d.ts +2 -2
- package/types/examples/sds_engineer/components/Calendar/CalendarBase.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Calendar/CalendarDouble.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Checkbox/Checkbox.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Checkbox/Checkbox.d.ts +1 -1
- package/types/examples/sds_engineer/components/Counter/Counter.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Counter/Counter.d.ts +1 -1
- package/types/examples/sds_engineer/components/Link/Link.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Link/Link.d.ts +1 -1
- package/types/examples/sds_engineer/components/Radiobox/Radiobox.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Radiobox/Radiobox.d.ts +1 -1
- package/types/examples/sds_engineer/components/Spinner/Spinner.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Spinner/Spinner.d.ts +1 -1
- package/types/examples/sds_engineer/components/TextArea/TextArea.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/TextArea/TextArea.d.ts +1 -1
- package/types/examples/sds_engineer/components/Toast/Toast.config.d.ts +1 -1
- package/types/examples/sds_engineer/components/Toast/Toast.d.ts +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
@@ -16,7 +16,7 @@ var base = require('./variations/_size/base.js');
|
|
16
16
|
var base$1 = require('./variations/_focused/base.js');
|
17
17
|
var getInitialsForName = require('./utils/getInitialsForName.js');
|
18
18
|
|
19
|
-
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"
|
19
|
+
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
|
20
20
|
var getAvatarContent = function getAvatarContent(_ref) {
|
21
21
|
var customText = _ref.customText,
|
22
22
|
url = _ref.url,
|
@@ -63,20 +63,14 @@ var avatarRoot = function avatarRoot(Root) {
|
|
63
63
|
_props$focused = props.focused,
|
64
64
|
focused = _props$focused === void 0 ? true : _props$focused,
|
65
65
|
isScalable = props.isScalable,
|
66
|
-
ariaLabelProp = props['aria-label'],
|
67
66
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
68
67
|
var initials = React.useMemo(function () {
|
69
68
|
return getInitialsForName.getInitialsForName(name);
|
70
69
|
}, [name]);
|
71
|
-
var ariaLabel = ariaLabelProp;
|
72
|
-
if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button') {
|
73
|
-
ariaLabel = !ariaLabel || ariaLabel.trim() === '' ? name : ariaLabel;
|
74
|
-
}
|
75
70
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
76
71
|
ref: ref,
|
77
72
|
size: avatarSize,
|
78
73
|
className: index.cx(Avatar_tokens.classes.avatarItem, className),
|
79
|
-
"aria-label": ariaLabel,
|
80
74
|
focused: focused
|
81
75
|
}, rest), /*#__PURE__*/React.createElement(Avatar_styles.Wrapper, {
|
82
76
|
isScalable: isScalable
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n\n return (\n <Root ref={ref} size={avatarSize} className={cx(classes.avatarItem, className)} focused={focused} {...rest}>\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","rest","_excluded","useMemo","getInitialsForName","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKiD;AAAA,EAAA,IAJnEC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA;AAEA,EAAA,IAAIH,UAAU,EAAE;AACZ,IAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,kBAAI,EAAA,IAAA,EAAEN,UAAiB,CAAC,CAAA;AACpC,GAAA;AAEA,EAAA,IAAIC,GAAG,EAAE;AACL,IAAA,oBAAOG,KAAA,CAAAC,aAAA,CAACE,mBAAK,EAAA;AAACC,MAAAA,GAAG,EAAEP,GAAI;AAACQ,MAAAA,GAAG,EAAEN,IAAAA;AAAK,KAAG,CAAA,CAAA;AACzC,GAAA;AAEA,EAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACC,kBAAI,EAAA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AQ;AACd+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEvB,UAAU;AAClBwB,EAAAA,IAAI,EAAJA,kBAAI;AACJC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDlB,IAAAA,OAAO,EAAE;AACLiB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvB,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -12,7 +12,7 @@ import { base as base$1 } from './variations/_size/base.js';
|
|
12
12
|
import { base as base$2 } from './variations/_focused/base.js';
|
13
13
|
import { getInitialsForName } from './utils/getInitialsForName.js';
|
14
14
|
|
15
|
-
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"
|
15
|
+
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
|
16
16
|
var getAvatarContent = function getAvatarContent(_ref) {
|
17
17
|
var customText = _ref.customText,
|
18
18
|
url = _ref.url,
|
@@ -59,20 +59,14 @@ var avatarRoot = function avatarRoot(Root) {
|
|
59
59
|
_props$focused = props.focused,
|
60
60
|
focused = _props$focused === void 0 ? true : _props$focused,
|
61
61
|
isScalable = props.isScalable,
|
62
|
-
ariaLabelProp = props['aria-label'],
|
63
62
|
rest = _objectWithoutProperties(props, _excluded);
|
64
63
|
var initials = useMemo(function () {
|
65
64
|
return getInitialsForName(name);
|
66
65
|
}, [name]);
|
67
|
-
var ariaLabel = ariaLabelProp;
|
68
|
-
if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button') {
|
69
|
-
ariaLabel = !ariaLabel || ariaLabel.trim() === '' ? name : ariaLabel;
|
70
|
-
}
|
71
66
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
72
67
|
ref: ref,
|
73
68
|
size: avatarSize,
|
74
69
|
className: cx(classes.avatarItem, className),
|
75
|
-
"aria-label": ariaLabel,
|
76
70
|
focused: focused
|
77
71
|
}, rest), /*#__PURE__*/React.createElement(Wrapper, {
|
78
72
|
isScalable: isScalable
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n\n return (\n <Root ref={ref} size={avatarSize} className={cx(classes.avatarItem, className)} focused={focused} {...rest}>\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","rest","_excluded","useMemo","getInitialsForName","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;AAcA,IAAMA,g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OAAO,EAAEA,OAAAA;AAAQ,KAAA,EAAKE,IAAI,CACtGnC,eAAAA,KAAA,CAAAC,aAAA,CAAC0C,OAAO,EAAA;AAACT,MAAAA,UAAU,EAAEA,UAAAA;AAAW,KAAA,EAAExC,gBAAgB,CAAC;AAAEE,MAAAA,UAAU,EAAVA,UAAU;AAAEC,MAAAA,GAAG,EAAHA,GAAG;AAAEC,MAAAA,QAAQ,EAARA,QAAQ;AAAEC,MAAAA,IAAAA,EAAAA,IAAAA;AAAK,KAAC,CAAW,CAAA,EAEhGe,MAAM,iBACHd,KAAA,CAAAC,aAAA,CAAC2C,UAAU,EACP5C,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACkB,eAAe,EAAA;AAACL,MAAAA,MAAM,EAAEA,MAAAA;KAAO,CACxB,CAEd,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AACN,EAAC;AAEM,IAAM+B,YAAY,GAAG;AACxB9C,EAAAA,IAAI,EAAE,QAAQ;AACd+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEvB,UAAU;AAClBwB,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDlB,IAAAA,OAAO,EAAE;AACLiB,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvB,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.75.0-canary.1170.8685945511.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -102,5 +102,5 @@
|
|
102
102
|
"react-popper": "2.3.0",
|
103
103
|
"storeon": "3.1.5"
|
104
104
|
},
|
105
|
-
"gitHead": "
|
105
|
+
"gitHead": "6131b96ded619f5739e46add0b158bd94b5e7f77"
|
106
106
|
}
|
@@ -15,7 +15,7 @@ var _Avatar2 = /*#__PURE__*/require("./Avatar.styles");
|
|
15
15
|
var _base = /*#__PURE__*/require("./variations/_size/base");
|
16
16
|
var _base2 = /*#__PURE__*/require("./variations/_focused/base");
|
17
17
|
var _utils2 = /*#__PURE__*/require("./utils");
|
18
|
-
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"
|
18
|
+
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
@@ -57,20 +57,14 @@ var avatarRoot = exports.avatarRoot = function avatarRoot(Root) {
|
|
57
57
|
_props$focused = props.focused,
|
58
58
|
focused = _props$focused === void 0 ? true : _props$focused,
|
59
59
|
isScalable = props.isScalable,
|
60
|
-
ariaLabelProp = props['aria-label'],
|
61
60
|
rest = _objectWithoutProperties(props, _excluded);
|
62
61
|
var initials = (0, _react.useMemo)(function () {
|
63
62
|
return (0, _utils2.getInitialsForName)(name);
|
64
63
|
}, [name]);
|
65
|
-
var ariaLabel = ariaLabelProp;
|
66
|
-
if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button') {
|
67
|
-
ariaLabel = !ariaLabel || ariaLabel.trim() === '' ? name : ariaLabel;
|
68
|
-
}
|
69
64
|
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
70
65
|
ref: ref,
|
71
66
|
size: avatarSize,
|
72
67
|
className: (0, _utils.cx)(_Avatar.classes.avatarItem, className),
|
73
|
-
"aria-label": ariaLabel,
|
74
68
|
focused: focused
|
75
69
|
}, rest), /*#__PURE__*/_react["default"].createElement(_Avatar2.Wrapper, {
|
76
70
|
isScalable: isScalable
|
package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx
CHANGED
@@ -33,56 +33,40 @@ export const Default: Story = {
|
|
33
33
|
|
34
34
|
export const DynamicSize: Story = {
|
35
35
|
args: { totalCount: 10, visibleCount: 3 },
|
36
|
-
render: (
|
37
|
-
const itemLength = totalCount;
|
36
|
+
render: (args: ComponentProps<typeof AvatarGroup>) => {
|
37
|
+
const itemLength = args.totalCount;
|
38
38
|
|
39
39
|
return (
|
40
40
|
<AvatarGroup {...args}>
|
41
|
-
{Array(visibleCount)
|
41
|
+
{Array(args.visibleCount)
|
42
42
|
.fill(true)
|
43
43
|
.map((_, index) => (
|
44
|
-
<Avatar size="xxl"
|
44
|
+
<Avatar size="xxl" customText={index + 1} />
|
45
45
|
))}
|
46
46
|
|
47
|
-
{itemLength > visibleCount &&
|
47
|
+
{itemLength > args.visibleCount && (
|
48
|
+
<Avatar size="xxl" customText={`+${itemLength - args.visibleCount}`} />
|
49
|
+
)}
|
48
50
|
</AvatarGroup>
|
49
51
|
);
|
50
52
|
},
|
51
53
|
};
|
52
54
|
|
53
|
-
const list = [
|
54
|
-
{
|
55
|
-
name: 'Илья Муромец',
|
56
|
-
},
|
57
|
-
{
|
58
|
-
name: 'Алеша Попович',
|
59
|
-
},
|
60
|
-
{
|
61
|
-
name: 'Добрыня Никитич',
|
62
|
-
},
|
63
|
-
{
|
64
|
-
name: 'Микула Селянинович',
|
65
|
-
},
|
66
|
-
{
|
67
|
-
name: 'Ставр Годинович',
|
68
|
-
},
|
69
|
-
];
|
70
|
-
|
71
55
|
export const Accessibility: Story = {
|
72
56
|
render: (args: ComponentProps<typeof AvatarGroup>) => {
|
73
57
|
return (
|
74
58
|
<AvatarGroup {...args}>
|
75
|
-
{
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
59
|
+
{Array(5)
|
60
|
+
.fill(true)
|
61
|
+
.map(() => (
|
62
|
+
<Avatar
|
63
|
+
role="button"
|
64
|
+
tabIndex={0}
|
65
|
+
focused
|
66
|
+
size="xxl"
|
67
|
+
url="https://avatars.githubusercontent.com/u/1813468?v=4"
|
68
|
+
/>
|
69
|
+
))}
|
86
70
|
</AvatarGroup>
|
87
71
|
);
|
88
72
|
},
|
@@ -8,12 +8,12 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Badge = /*#__PURE__*/require("../../../../components/Badge");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-transparent-secondary);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent),
|
17
17
|
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-transparent-accent);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent),
|
18
18
|
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--text-positive);", ":var(--surface-transparent-positive);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent),
|
19
19
|
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--text-warning);", ":var(--surface-transparent-warning);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent),
|
@@ -18,7 +18,7 @@ const meta: Meta<typeof Badge> = {
|
|
18
18
|
},
|
19
19
|
},
|
20
20
|
view: {
|
21
|
-
options: ['
|
21
|
+
options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
|
22
22
|
control: {
|
23
23
|
type: 'select',
|
24
24
|
},
|
@@ -43,7 +43,7 @@ const BellIcon = (props) => (
|
|
43
43
|
export const Default: Story = {
|
44
44
|
args: {
|
45
45
|
text: 'Hello',
|
46
|
-
view: '
|
46
|
+
view: 'default',
|
47
47
|
size: 'm',
|
48
48
|
pilled: false,
|
49
49
|
transparent: false,
|
@@ -8,13 +8,13 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Button = /*#__PURE__*/require("../../../../components/Button");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
focused: 'true',
|
13
13
|
size: 'm'
|
14
14
|
},
|
15
15
|
variations: {
|
16
16
|
view: {
|
17
|
-
|
17
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], _Button.buttonTokens.buttonColor, _Button.buttonTokens.buttonBackgroundColor, _Button.buttonTokens.buttonColorHover, _Button.buttonTokens.buttonBackgroundColorHover, _Button.buttonTokens.buttonColorActive, _Button.buttonTokens.buttonBackgroundColorActive),
|
18
18
|
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], _Button.buttonTokens.buttonColor, _Button.buttonTokens.buttonBackgroundColor, _Button.buttonTokens.buttonColorHover, _Button.buttonTokens.buttonBackgroundColorHover, _Button.buttonTokens.buttonColorActive, _Button.buttonTokens.buttonBackgroundColorActive),
|
19
19
|
secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], _Button.buttonTokens.buttonColor, _Button.buttonTokens.buttonBackgroundColor, _Button.buttonTokens.buttonColorHover, _Button.buttonTokens.buttonBackgroundColorHover, _Button.buttonTokens.buttonColorActive, _Button.buttonTokens.buttonBackgroundColorActive),
|
20
20
|
clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], _Button.buttonTokens.buttonColor, _Button.buttonTokens.buttonBackgroundColor, _Button.buttonTokens.buttonColorHover, _Button.buttonTokens.buttonBackgroundColorHover, _Button.buttonTokens.buttonColorActive, _Button.buttonTokens.buttonBackgroundColorActive),
|
package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.js
CHANGED
@@ -8,18 +8,21 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _ButtonGroup = /*#__PURE__*/require("../../../../components/ButtonGroup");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
17
|
-
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":
|
18
|
-
secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":
|
19
|
-
clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary);", ":
|
20
|
-
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":
|
21
|
-
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":
|
22
|
-
negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
17
|
+
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
18
|
+
secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
19
|
+
clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
20
|
+
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
21
|
+
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
22
|
+
negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
23
|
+
dark: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
24
|
+
black: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive),
|
25
|
+
white: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], _ButtonGroup.buttonGroupTokens.buttonColor, _ButtonGroup.buttonGroupTokens.buttonBackgroundColor, _ButtonGroup.buttonGroupTokens.buttonColorHover, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorHover, _ButtonGroup.buttonGroupTokens.buttonColorActive, _ButtonGroup.buttonGroupTokens.buttonBackgroundColorActive)
|
23
26
|
},
|
24
27
|
size: {
|
25
28
|
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.875rem;", ":0.375rem;", ":0.875rem;", ":3.5rem;", ":1.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], _ButtonGroup.buttonGroupTokens.buttonDefaultRadius, _ButtonGroup.buttonGroupTokens.buttonSegmentedRadius, _ButtonGroup.buttonGroupTokens.buttonSideRadius, _ButtonGroup.buttonGroupTokens.buttonHeight, _ButtonGroup.buttonGroupTokens.buttonPadding, _ButtonGroup.buttonGroupTokens.buttonFontFamily, _ButtonGroup.buttonGroupTokens.buttonFontSize, _ButtonGroup.buttonGroupTokens.buttonFontStyle, _ButtonGroup.buttonGroupTokens.buttonFontWeight, _ButtonGroup.buttonGroupTokens.buttonLetterSpacing, _ButtonGroup.buttonGroupTokens.buttonLineHeight),
|
package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.stories.tsx
CHANGED
@@ -11,7 +11,7 @@ import { ButtonGroup } from './ButtonGroup';
|
|
11
11
|
type StoryProps = ComponentProps<typeof ButtonGroup> & { itemsCount?: number };
|
12
12
|
type Story = StoryObj<StoryProps>;
|
13
13
|
|
14
|
-
const views = ['accent', '
|
14
|
+
const views = ['accent', 'default', 'secondary', 'success', 'warning', 'critical', 'clear'];
|
15
15
|
const sizes = ['l', 'm', 's', 'xs', 'xxs'];
|
16
16
|
const orientationValues = ['horizontal', 'vertical'];
|
17
17
|
const gapValues = ['none', 'dense', 'wide'];
|
@@ -65,7 +65,7 @@ export default meta;
|
|
65
65
|
|
66
66
|
export const Default: Story = {
|
67
67
|
args: {
|
68
|
-
view: '
|
68
|
+
view: 'default',
|
69
69
|
size: 'm',
|
70
70
|
gap: 'dense',
|
71
71
|
orientation: 'horizontal',
|
@@ -99,7 +99,7 @@ export const CustomButtons: Story = {
|
|
99
99
|
<>
|
100
100
|
<h3>Группа кнопок с разными темами</h3>
|
101
101
|
<ButtonGroup {...args}>
|
102
|
-
<Button text="Primary" view="
|
102
|
+
<Button text="Primary" view="default" />
|
103
103
|
<Button text="Negative" view="negative" />
|
104
104
|
<Button text="Positive" view="positive" />
|
105
105
|
<Button text="Clear" view="clear" />
|
@@ -107,7 +107,7 @@ export const CustomButtons: Story = {
|
|
107
107
|
|
108
108
|
<h3>Группа кнопок с разными размерами</h3>
|
109
109
|
<ButtonGroup {...args}>
|
110
|
-
<Button text="Primary" view="
|
110
|
+
<Button text="Primary" view="default" size="l" />
|
111
111
|
<Button text="Negative" view="negative" size="m" />
|
112
112
|
<Button text="Positive" view="positive" size="s" />
|
113
113
|
<Button text="Clear" view="clear" size="l" />
|
package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarBase.config.js
CHANGED
@@ -8,12 +8,12 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Calendar = /*#__PURE__*/require("../../../../components/Calendar/Calendar.tokens");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":transparent;", ":var(--plasma-colors-primary);", ":var(--plasma-colors-background-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-primary);", ":transparent;", ":var(--plasma-colors-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-surface-solid03);", ":var(--plasma-colors-accent);", ":var(--plasma-colors-background-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-button-focused);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-secondary);"], _Calendar.tokens.calendarBackgroundColor, _Calendar.tokens.calendarSelectedItemBackground, _Calendar.tokens.calendarSelectedItemColor, _Calendar.tokens.calendarSelectableItemBackgroundHover, _Calendar.tokens.calendarCurrentItemBorderColor, _Calendar.tokens.calendarCurrentItemBackgroundHover, _Calendar.tokens.calendarCurrentItemColorHover, _Calendar.tokens.calendarCurrentItemChildBackgroundHover, _Calendar.tokens.calendarActiveItemBackground, _Calendar.tokens.calendarActiveItemColor, _Calendar.tokens.calendarHoveredItemBackground, _Calendar.tokens.calendarHoveredItemColor, _Calendar.tokens.calendarRangeBackground, _Calendar.tokens.calendarOutlineFocusColor, _Calendar.tokens.calendarContentPrimaryColor, _Calendar.tokens.calendarContentSecondaryColor)
|
17
17
|
},
|
18
18
|
size: {
|
19
19
|
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":5.5rem;", ":0.5rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-bold-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);"], _Calendar.tokens.calendarHeaderArrowContainerWidth, _Calendar.tokens.calendarItemBorderRadius, _Calendar.tokens.calendarHeaderFontFamily, _Calendar.tokens.calendarHeaderFontSize, _Calendar.tokens.calendarHeaderFontStyle, _Calendar.tokens.calendarHeaderFontLetterSpacing, _Calendar.tokens.calendarHeaderFontLineHeight, _Calendar.tokens.calendarHeaderFontWeight, _Calendar.tokens.calendarHeaderFontWeightBold, _Calendar.tokens.calendarYearFontFamily, _Calendar.tokens.calendarYearFontSize, _Calendar.tokens.calendarYearFontStyle, _Calendar.tokens.calendarYearFontLetterSpacing, _Calendar.tokens.calendarYearFontLineHeight, _Calendar.tokens.calendarYearFontWeight, _Calendar.tokens.calendarMonthFontFamily, _Calendar.tokens.calendarMonthFontSize, _Calendar.tokens.calendarMonthFontStyle, _Calendar.tokens.calendarMonthFontLetterSpacing, _Calendar.tokens.calendarMonthFontLineHeight, _Calendar.tokens.calendarMonthFontWeight, _Calendar.tokens.calendarDayFontFamily, _Calendar.tokens.calendarDayFontSize, _Calendar.tokens.calendarDayFontStyle, _Calendar.tokens.calendarDayFontLetterSpacing, _Calendar.tokens.calendarDayFontLineHeight, _Calendar.tokens.calendarDayFontWeight)
|
package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js
CHANGED
@@ -8,12 +8,12 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Calendar = /*#__PURE__*/require("../../../../components/Calendar/Calendar.tokens");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":transparent;", ":var(--plasma-colors-primary);", ":var(--plasma-colors-background-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-primary);", ":transparent;", ":var(--plasma-colors-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-surface-solid03);", ":var(--plasma-colors-accent);", ":var(--plasma-colors-background-primary);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-surface-liquid02);", ":var(--plasma-colors-button-focused);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-secondary);"], _Calendar.tokens.calendarBackgroundColor, _Calendar.tokens.calendarSelectedItemBackground, _Calendar.tokens.calendarSelectedItemColor, _Calendar.tokens.calendarSelectableItemBackgroundHover, _Calendar.tokens.calendarCurrentItemBorderColor, _Calendar.tokens.calendarCurrentItemBackgroundHover, _Calendar.tokens.calendarCurrentItemColorHover, _Calendar.tokens.calendarCurrentItemChildBackgroundHover, _Calendar.tokens.calendarActiveItemBackground, _Calendar.tokens.calendarActiveItemColor, _Calendar.tokens.calendarHoveredItemBackground, _Calendar.tokens.calendarHoveredItemColor, _Calendar.tokens.calendarSeparatorBackground, _Calendar.tokens.calendarRangeBackground, _Calendar.tokens.calendarOutlineFocusColor, _Calendar.tokens.calendarContentPrimaryColor, _Calendar.tokens.calendarContentSecondaryColor)
|
17
17
|
},
|
18
18
|
size: {
|
19
19
|
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-bold-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-weight);"], _Calendar.tokens.calendarItemBorderRadius, _Calendar.tokens.calendarHeaderFontFamily, _Calendar.tokens.calendarHeaderFontSize, _Calendar.tokens.calendarHeaderFontStyle, _Calendar.tokens.calendarHeaderFontLetterSpacing, _Calendar.tokens.calendarHeaderFontLineHeight, _Calendar.tokens.calendarHeaderFontWeight, _Calendar.tokens.calendarHeaderFontWeightBold, _Calendar.tokens.calendarYearFontFamily, _Calendar.tokens.calendarYearFontSize, _Calendar.tokens.calendarYearFontStyle, _Calendar.tokens.calendarYearFontLetterSpacing, _Calendar.tokens.calendarYearFontLineHeight, _Calendar.tokens.calendarYearFontWeight, _Calendar.tokens.calendarMonthFontFamily, _Calendar.tokens.calendarMonthFontSize, _Calendar.tokens.calendarMonthFontStyle, _Calendar.tokens.calendarMonthFontLetterSpacing, _Calendar.tokens.calendarMonthFontLineHeight, _Calendar.tokens.calendarMonthFontWeight, _Calendar.tokens.calendarDayFontFamily, _Calendar.tokens.calendarDayFontSize, _Calendar.tokens.calendarDayFontStyle, _Calendar.tokens.calendarDayFontLetterSpacing, _Calendar.tokens.calendarDayFontLineHeight, _Calendar.tokens.calendarDayFontWeight)
|
@@ -22,7 +22,7 @@ var config = exports.config = {
|
|
22
22
|
* Вид контрола.
|
23
23
|
*/
|
24
24
|
view: {
|
25
|
-
|
25
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["--plasma-checkbox-fill-color:var(--text-primary);--plasma-checkbox-icon-color:var(--inverse-text-primary);--plasma-checkbox-description-color:var(--text-secondary);--plasma-checkbox-trigger-border-color:var(--text-secondary);"]),
|
26
26
|
secondary: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-checkbox-fill-color:var(--text-secondary);--plasma-checkbox-icon-color:var(--inverse-text-primary);--plasma-checkbox-description-color:var(--text-secondary);--plasma-checkbox-trigger-border-color:var(--text-secondary);"]),
|
27
27
|
tertiary: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-checkbox-fill-color:var(--text-tertiary);--plasma-checkbox-icon-color:var(--inverse-text-primary);--plasma-checkbox-description-color:var(--text-secondary);--plasma-checkbox-trigger-border-color:var(--text-secondary);"]),
|
28
28
|
paragraph: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-checkbox-fill-color:var(--text-paragraph);--plasma-checkbox-icon-color:var(--inverse-text-primary);--plasma-checkbox-description-color:var(--text-secondary);--plasma-checkbox-trigger-border-color:var(--text-secondary);"]),
|
@@ -8,12 +8,12 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Counter = /*#__PURE__*/require("../../../../components/Counter");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'xs'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background),
|
17
17
|
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);"], _Counter.counterTokens.color, _Counter.counterTokens.background),
|
18
18
|
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);"], _Counter.counterTokens.color, _Counter.counterTokens.background),
|
19
19
|
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);"], _Counter.counterTokens.color, _Counter.counterTokens.background),
|
@@ -18,7 +18,7 @@ const meta: Meta<typeof Counter> = {
|
|
18
18
|
},
|
19
19
|
},
|
20
20
|
view: {
|
21
|
-
options: ['
|
21
|
+
options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
|
22
22
|
control: {
|
23
23
|
type: 'select',
|
24
24
|
},
|
@@ -35,7 +35,7 @@ export const Default: Story = {
|
|
35
35
|
args: {
|
36
36
|
count: 25,
|
37
37
|
maxCount: 100,
|
38
|
-
view: '
|
38
|
+
view: 'default',
|
39
39
|
size: 'xs',
|
40
40
|
},
|
41
41
|
};
|
@@ -8,12 +8,12 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Header = /*#__PURE__*/require("../../../../components/Header");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm'
|
13
13
|
},
|
14
14
|
variations: {
|
15
15
|
view: {
|
16
|
-
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-clear);", ":transform 0.15s ease-in-out;", ":var(--plasma-colors-primary);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-primary);", ":var(--plasma-colors-secondary);", ":var(--plasma-colors-secondary);", ":var(--plasma-colors-secondary);"], _Header.headerTokens.headerArrowButtonColor, _Header.headerTokens.headerArrowButtonBackgroundColor, _Header.headerTokens.headerArrowTransition, _Header.headerTokens.headerTitleColor, _Header.headerTokens.headerBigTitleColor, _Header.headerTokens.headerBiggerTitleColor, _Header.headerTokens.headerLabelColor, _Header.headerTokens.headerSubTitleColor, _Header.headerTokens.headerCaptionColor)
|
17
17
|
},
|
18
18
|
size: {
|
19
19
|
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.25rem;", ":1.625rem;", ":0.625rem;", ":0.75rem;", ":1rem;", ":1.5rem;", ":0.125rem 0;", ":0.5rem 0;", ":0.5rem 0;", ":0.375rem 0;", ":0.125rem 0;", ":0.25rem 0;", ":2.25rem;", ":0.5rem;"], _Header.headerTokens.headerHeight, _Header.headerTokens.headerPaddingTop, _Header.headerTokens.headerPaddingBottom, _Header.headerTokens.headerLogoMarginRight, _Header.headerTokens.headerArrowMarginRight, _Header.headerTokens.headerArrowIconSize, _Header.headerTokens.headerTitleMargin, _Header.headerTokens.headerBigTitleMargin, _Header.headerTokens.headerBiggerTitleMargin, _Header.headerTokens.headerLabelMargin, _Header.headerTokens.headerSubTitleMargin, _Header.headerTokens.headerCaptionMargin, _Header.headerTokens.headerArrowHeight, _Header.headerTokens.headerArrowPadding)
|
@@ -114,7 +114,7 @@ export const CustomAssembly: StoryObj<CustomAssemblyProps & ContentComponentProp
|
|
114
114
|
...argTypesFromConfig(mergeConfig(headerRootConfig, config)),
|
115
115
|
},
|
116
116
|
args: {
|
117
|
-
view: '
|
117
|
+
view: 'default',
|
118
118
|
size: 'm',
|
119
119
|
variant: 'title+subtitle',
|
120
120
|
title: 'Header title text',
|
@@ -12,7 +12,7 @@ var config = exports.config = {
|
|
12
12
|
},
|
13
13
|
variations: {
|
14
14
|
view: {
|
15
|
-
|
15
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["--plasma-link-font-family:var(--plasma-typo-text-m-font-family);--plasma-link-color:var(--text-primary);--plasma-link-color-hover:var(--text-primary-hover);--plasma-link-color-active:var(--text-primary-active);--plasma-link-color-visited:var(--text-primary);--plasma-link-color-visited-hover:var(--text-primary-hover);--plasma-link-color-visited-active:var(--text-primary-active);--plasma-link-underline-border:0;"]),
|
16
16
|
secondary: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-link-font-family:var(--plasma-typo-text-m-font-family);--plasma-link-color:var(--text-secondary);--plasma-link-color-hover:var(--text-secondary-hover);--plasma-link-color-active:var(--text-secondary-active);--plasma-link-color-visited:var(--text-secondary);--plasma-link-color-visited-hover:var(--text-secondary-hover);--plasma-link-color-visited-active:var(--text-secondary-active);--plasma-link-underline-border:0;"]),
|
17
17
|
tertiary: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-link-font-family:var(--plasma-typo-text-m-font-family);--plasma-link-color:var(--text-tertiary);--plasma-link-color-hover:var(--text-tertiary-hover);--plasma-link-color-active:var(--text-tertiary-active);--plasma-link-color-visited:var(--text-tertiary);--plasma-link-color-visited-hover:var(--text-tertiary-hover);--plasma-link-color-visited-active:var(--text-tertiary-active);--plasma-link-underline-border:0;"]),
|
18
18
|
paragraph: /*#__PURE__*/(0, _styledComponents.css)(["--plasma-link-font-family:var(--plasma-typo-text-m-font-family);--plasma-link-color:var(--text-paragraph);--plasma-link-color-hover:var(--text-paragraph-hover);--plasma-link-color-active:var(--text-paragraph-active);--plasma-link-color-visited:var(--text-paragraph);--plasma-link-color-visited-hover:var(--text-paragraph-hover);--plasma-link-color-visited-active:var(--text-paragraph-active);--plasma-link-underline-border:0;"]),
|