@salutejs/plasma-new-hope 0.195.0-canary.1572.11914481185.0 → 0.195.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +4 -4
- package/cjs/components/Badge/Badge.js +17 -7
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +10 -5
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/cjs/components/Badge/variations/_size/base.js +1 -1
- package/cjs/components/Badge/variations/_size/base.js.map +1 -1
- package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
- package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/cjs/components/Badge/variations/_view/base.js +1 -1
- package/cjs/components/Badge/variations/_view/base.js.map +1 -1
- package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/store/reducer.js +2 -2
- package/cjs/components/Calendar/store/reducer.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +18 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
- package/cjs/components/Dropdown/Dropdown.css +5 -4
- package/cjs/components/Dropdown/Dropdown.js +4 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
- package/cjs/components/Select/Select.js +0 -1
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +18 -3
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/index.css +9 -8
- package/emotion/cjs/components/Badge/Badge.js +17 -7
- package/emotion/cjs/components/Badge/Badge.template-doc.mdx +40 -16
- package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
- package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
- package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
- package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/cjs/components/Calendar/store/reducer.js +2 -2
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/cjs/components/Dropdown/Dropdown.js +4 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
- package/emotion/cjs/components/Select/Select.js +0 -1
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/emotion/es/components/Badge/Badge.js +18 -8
- package/emotion/es/components/Badge/Badge.template-doc.mdx +40 -16
- package/emotion/es/components/Badge/Badge.tokens.js +9 -5
- package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
- package/emotion/es/components/Badge/variations/_size/base.js +3 -2
- package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
- package/emotion/es/components/Badge/variations/_view/base.js +2 -2
- package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/emotion/es/components/Calendar/store/reducer.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/es/components/Dropdown/Dropdown.js +4 -2
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
- package/emotion/es/components/Select/Select.js +0 -1
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
- package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/es/components/Badge/Badge.css +4 -4
- package/es/components/Badge/Badge.js +20 -10
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +10 -6
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Badge/variations/_clear/base.js +1 -1
- package/es/components/Badge/variations/_clear/base.js.map +1 -1
- package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
- package/es/components/Badge/variations/_size/base.js +1 -1
- package/es/components/Badge/variations/_size/base.js.map +1 -1
- package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
- package/es/components/Badge/variations/_transparent/base.js +1 -1
- package/es/components/Badge/variations/_transparent/base.js.map +1 -1
- package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
- package/es/components/Badge/variations/_view/base.js +1 -1
- package/es/components/Badge/variations/_view/base.js.map +1 -1
- package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
- package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/store/reducer.js +2 -2
- package/es/components/Calendar/store/reducer.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +19 -5
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
- package/es/components/Dropdown/Dropdown.css +5 -4
- package/es/components/Dropdown/Dropdown.js +4 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -2
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
- package/es/components/Select/Select.js +0 -1
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +19 -4
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/index.css +9 -8
- package/package.json +3 -2
- package/styled-components/cjs/components/Badge/Badge.js +17 -7
- package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +40 -16
- package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
- package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
- package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
- package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/cjs/components/Calendar/store/reducer.js +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
- package/styled-components/cjs/components/Select/Select.js +0 -1
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/styled-components/es/components/Badge/Badge.js +18 -8
- package/styled-components/es/components/Badge/Badge.template-doc.mdx +40 -16
- package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
- package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
- package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
- package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
- package/styled-components/es/components/Calendar/store/reducer.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/es/components/Dropdown/Dropdown.js +4 -2
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
- package/styled-components/es/components/Select/Select.js +0 -1
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
- package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +8 -4
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +18 -5
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
- package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
- package/types/components/Calendar/store/reducer.d.ts +1 -1
- package/types/components/Calendar/store/reducer.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +1 -2
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +50 -2
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +11 -6
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +1 -0
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +1 -2
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +25 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +25 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
- package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
- package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
- package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
@@ -2,7 +2,12 @@ export var classes = {
|
|
2
2
|
badgePilled: 'badge-pilled',
|
3
3
|
badgeTransparent: 'badge-transparent',
|
4
4
|
badgeClear: 'badge-clear',
|
5
|
-
badgeTruncate: 'badge-truncate'
|
5
|
+
badgeTruncate: 'badge-truncate',
|
6
|
+
iconOnly: 'badge-icon-only'
|
7
|
+
};
|
8
|
+
export var privateTokens = {
|
9
|
+
customBackground: '--plasma-badge-custom-background',
|
10
|
+
customColor: '--plasma-badge-custom-color'
|
6
11
|
};
|
7
12
|
export var tokens = {
|
8
13
|
background: '--plasma-badge-background',
|
@@ -10,13 +15,12 @@ export var tokens = {
|
|
10
15
|
backgroundTransparent: '--plasma-badge-background-transparent',
|
11
16
|
colorTransparent: '--plasma-badge-color-transparent',
|
12
17
|
colorClear: '--plasma-badge-color-clear',
|
18
|
+
backgroundClear: '--plasma-badge-background-clear',
|
13
19
|
borderRadius: '--plasma-badge-border-radius',
|
14
20
|
pilledBorderRadius: '--plasma-badge-pilled-border-radius',
|
15
21
|
height: '--plasma-badge-height',
|
16
|
-
|
17
|
-
|
18
|
-
paddingBottom: '--plasma-badge-padding-bottom',
|
19
|
-
paddingLeft: '--plasma-badge-padding-left',
|
22
|
+
padding: '--plasma-badge-padding',
|
23
|
+
paddingIconOnly: '--plasma-badge-padding-icon-only',
|
20
24
|
fontFamily: '--plasma-badge-font-family',
|
21
25
|
fontSize: '--plasma-badge-font-size',
|
22
26
|
fontStyle: '--plasma-badge-font-style',
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { classes, tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["&.", "{color:var(", ");background-color:
|
2
|
+
import { classes, privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["&.", "{color:var(", ",var(", "));background-color:var(", ",var(", "));}"], classes.badgeClear, privateTokens.customColor, tokens.colorClear, privateTokens.customBackground, tokens.backgroundClear);
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { tokens } from '../../Badge.tokens';
|
3
|
-
|
2
|
+
import { classes, tokens } from '../../Badge.tokens';
|
3
|
+
import { StyledContentLeft } from '../../Badge.styles';
|
4
|
+
export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding:var(", ");&.", "{padding:var(", ");", "{margin:0;}}"], tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.borderRadius, tokens.height, tokens.padding, classes.iconOnly, tokens.paddingIconOnly, StyledContentLeft);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { classes, tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["&.", "{color:var(", ");background-color:var(", ");}"], classes.badgeTransparent, tokens.colorTransparent, tokens.backgroundTransparent);
|
2
|
+
import { classes, privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["&.", "{color:var(", ",var(", "));background-color:var(", ",var(", "));}"], classes.badgeTransparent, privateTokens.customColor, tokens.colorTransparent, privateTokens.customBackground, tokens.backgroundTransparent);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import { tokens } from '../../Badge.tokens';
|
3
|
-
export var base = /*#__PURE__*/css(["color:var(", ");background-color:var(", ");"], tokens.color, tokens.background);
|
2
|
+
import { privateTokens, tokens } from '../../Badge.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["color:var(", ",var(", "));background-color:var(", ",var(", "));"], privateTokens.customColor, tokens.color, privateTokens.customBackground, tokens.background);
|
@@ -63,7 +63,7 @@ export var calendarBaseRoot = function calendarBaseRoot(Root) {
|
|
63
63
|
_useState8 = _slicedToArray(_useState7, 2),
|
64
64
|
outOfRangeKey = _useState8[0],
|
65
65
|
setOutOfRangeKey = _useState8[1];
|
66
|
-
var _useReducer = useReducer(reducer, getInitialState(value,
|
66
|
+
var _useReducer = useReducer(reducer, getInitialState(value, type)),
|
67
67
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
68
68
|
state = _useReducer2[0],
|
69
69
|
dispatch = _useReducer2[1];
|
@@ -64,7 +64,7 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
64
64
|
_useState8 = _slicedToArray(_useState7, 2),
|
65
65
|
outOfRangeKey = _useState8[0],
|
66
66
|
setOutOfRangeKey = _useState8[1];
|
67
|
-
var _useReducer = useReducer(reducer, getInitialState(value,
|
67
|
+
var _useReducer = useReducer(reducer, getInitialState(value, type, true)),
|
68
68
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
69
69
|
state = _useReducer2[0],
|
70
70
|
dispatch = _useReducer2[1];
|
@@ -30,8 +30,8 @@ export var sizeMap = {
|
|
30
30
|
"double": [3, 1]
|
31
31
|
}
|
32
32
|
};
|
33
|
-
export var getInitialState = function getInitialState(value,
|
34
|
-
var initDate = value ||
|
33
|
+
export var getInitialState = function getInitialState(value, calendarState, isDouble) {
|
34
|
+
var initDate = value || new Date();
|
35
35
|
var date = getDateFromValue(initDate);
|
36
36
|
var resSize = isDouble ? sizeMap[calendarState]["double"] : sizeMap[calendarState].single;
|
37
37
|
return {
|
@@ -1,5 +1,9 @@
|
|
1
1
|
var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
3
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
5
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
@@ -177,9 +181,24 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
177
181
|
|
178
182
|
// Обработчик чипов
|
179
183
|
var handleChipsChange = function handleChipsChange(chipLabels) {
|
180
|
-
|
181
|
-
|
182
|
-
|
184
|
+
if (!Array.isArray(value)) return;
|
185
|
+
|
186
|
+
// TODO: #1564
|
187
|
+
// Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
|
188
|
+
if (renderValue && !isTargetAmount) {
|
189
|
+
var resultValues = _toConsumableArray(value);
|
190
|
+
value.forEach(function (_, index) {
|
191
|
+
var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
|
192
|
+
if (!chipLabels.includes(labelAfterRenderValue)) {
|
193
|
+
resultValues.splice(index, 1);
|
194
|
+
}
|
195
|
+
});
|
196
|
+
onChange(resultValues);
|
197
|
+
} else {
|
198
|
+
onChange(chipLabels.map(function (chipLabel) {
|
199
|
+
return labelToItemMap.get(chipLabel).value;
|
200
|
+
}));
|
201
|
+
}
|
183
202
|
};
|
184
203
|
|
185
204
|
// Обработчик открытия/закрытия выпадающего списка
|
@@ -348,7 +367,6 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
348
367
|
handleItemClick: handleItemClick,
|
349
368
|
variant: variant,
|
350
369
|
renderItem: renderItem,
|
351
|
-
valueToItemMap: valueToItemMap,
|
352
370
|
treeId: treeId
|
353
371
|
}
|
354
372
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
@@ -31,7 +31,6 @@ export var Item = function Item(_ref) {
|
|
31
31
|
handleItemClick = _useContext.handleItemClick,
|
32
32
|
variant = _useContext.variant,
|
33
33
|
renderItem = _useContext.renderItem,
|
34
|
-
valueToItemMap = _useContext.valueToItemMap,
|
35
34
|
treeId = _useContext.treeId;
|
36
35
|
var disabledClassName = disabled ? classes.dropdownItemIsDisabled : undefined;
|
37
36
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
|
@@ -85,7 +84,7 @@ export var Item = function Item(_ref) {
|
|
85
84
|
}))), !multiple && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
86
85
|
size: sizeToIconSize(size, variant),
|
87
86
|
color: "inherit"
|
88
|
-
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(
|
87
|
+
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(item)) : /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
89
88
|
view: "default",
|
90
89
|
size: "l",
|
91
90
|
contentLeft: contentLeft,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal"];
|
1
|
+
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal", "renderItem"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -60,6 +60,7 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
60
60
|
_ref$alwaysOpened = _ref.alwaysOpened,
|
61
61
|
alwaysOpened = _ref$alwaysOpened === void 0 ? false : _ref$alwaysOpened,
|
62
62
|
portal = _ref.portal,
|
63
|
+
renderItem = _ref.renderItem,
|
63
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
64
65
|
var _useReducer = useReducer(pathReducer, []),
|
65
66
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
@@ -135,7 +136,8 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
135
136
|
onItemClick: onItemClick,
|
136
137
|
onItemSelect: onItemSelect,
|
137
138
|
hasArrow: hasArrow,
|
138
|
-
treeId: treeId
|
139
|
+
treeId: treeId,
|
140
|
+
renderItem: renderItem
|
139
141
|
}
|
140
142
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
141
143
|
ref: floatingPopoverRef,
|
@@ -4,7 +4,7 @@ import { cx } from '../../../../utils';
|
|
4
4
|
import { IconDisclosureRight } from '../../../_Icon';
|
5
5
|
import { Context } from '../../Dropdown';
|
6
6
|
import { getItemId } from '../../utils';
|
7
|
-
import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';
|
7
|
+
import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell, RenderItemWrapper } from './DropdownItem.styles';
|
8
8
|
export var DropdownItem = function DropdownItem(_ref) {
|
9
9
|
var item = _ref.item,
|
10
10
|
path = _ref.path,
|
@@ -34,7 +34,8 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
34
34
|
onItemSelect = _useContext.onItemSelect,
|
35
35
|
onItemClick = _useContext.onItemClick,
|
36
36
|
hasArrow = _useContext.hasArrow,
|
37
|
-
treeId = _useContext.treeId
|
37
|
+
treeId = _useContext.treeId,
|
38
|
+
renderItem = _useContext.renderItem;
|
38
39
|
var hasDescendants = Boolean(item.items);
|
39
40
|
var disclosureIconSize = size === 'xs' ? 'xs' : 's';
|
40
41
|
var isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;
|
@@ -85,7 +86,7 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
85
86
|
"aria-expanded": ariaExpanded,
|
86
87
|
"aria-level": ariaLevel,
|
87
88
|
"aria-label": ariaLabel
|
88
|
-
}, /*#__PURE__*/React.createElement(CellWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
89
|
+
}, renderItem ? /*#__PURE__*/React.createElement(RenderItemWrapper, null, renderItem(item)) : /*#__PURE__*/React.createElement(CellWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
89
90
|
contentLeft: contentLeft,
|
90
91
|
contentRight: contentRight,
|
91
92
|
alignContentLeft: "center",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import { classes, tokens, constants } from '../../Dropdown.tokens';
|
3
|
-
import { addFocus } from '../../../../mixins';
|
3
|
+
import { addFocus, applyEllipsis } from '../../../../mixins';
|
4
4
|
import { cellConfig, cellTokens } from '../../../Cell';
|
5
5
|
import { component, mergeConfig } from '../../../../engines';
|
6
6
|
var mergedCellConfig = /*#__PURE__*/mergeConfig(cellConfig);
|
@@ -35,4 +35,7 @@ export var Wrapper = /*#__PURE__*/styled.li.withConfig({
|
|
35
35
|
outlineRadius: /*#__PURE__*/"var(".concat(tokens.itemBorderRadius, ")"),
|
36
36
|
hasTransition: false,
|
37
37
|
customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(constants.focusColor, ");\n }\n ")
|
38
|
-
}));
|
38
|
+
}));
|
39
|
+
export var RenderItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
40
|
+
componentId: "plasma-new-hope__sc-hs0ek1-5"
|
41
|
+
})(["", ";flex:1;"], /*#__PURE__*/applyEllipsis());
|
@@ -272,7 +272,6 @@ export var selectRoot = function selectRoot(Root) {
|
|
272
272
|
handleItemClick: handleItemClick,
|
273
273
|
variant: variant,
|
274
274
|
renderItem: renderItem,
|
275
|
-
valueToItemMap: valueToItemMap,
|
276
275
|
treeId: treeId
|
277
276
|
}
|
278
277
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
@@ -32,7 +32,6 @@ export var Item = function Item(_ref) {
|
|
32
32
|
handleItemClick = _useContext.handleItemClick,
|
33
33
|
variant = _useContext.variant,
|
34
34
|
renderItem = _useContext.renderItem,
|
35
|
-
valueToItemMap = _useContext.valueToItemMap,
|
36
35
|
treeId = _useContext.treeId;
|
37
36
|
var itemDisabled = Boolean(disabled || isDisabled);
|
38
37
|
var disabledClassName = itemDisabled ? classes.dropdownItemIsDisabled : undefined;
|
@@ -87,7 +86,7 @@ export var Item = function Item(_ref) {
|
|
87
86
|
}))), !multiselect && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
88
87
|
size: sizeToIconSize(size, variant),
|
89
88
|
color: "inherit"
|
90
|
-
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(
|
89
|
+
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(item)) : /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
91
90
|
contentLeft: contentLeft,
|
92
91
|
contentRight: contentRight
|
93
92
|
// TODO: #1548
|
@@ -1,4 +1,10 @@
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
2
8
|
import React, { forwardRef } from 'react';
|
3
9
|
import { sizeToIconSize, getItemId } from '../../../../utils';
|
4
10
|
import { classes } from '../../../../Select.tokens';
|
@@ -47,9 +53,24 @@ export var Textfield = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
47
53
|
|
48
54
|
// Обработчик чипов
|
49
55
|
var handleChipsChange = function handleChipsChange(chipLabels) {
|
50
|
-
|
51
|
-
|
52
|
-
|
56
|
+
if (!Array.isArray(value)) return;
|
57
|
+
|
58
|
+
// TODO: #1564
|
59
|
+
// Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
|
60
|
+
if (renderValue && !isTargetAmount) {
|
61
|
+
var resultValues = _toConsumableArray(value);
|
62
|
+
value.forEach(function (_, index) {
|
63
|
+
var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
|
64
|
+
if (!chipLabels.includes(labelAfterRenderValue)) {
|
65
|
+
resultValues.splice(index, 1);
|
66
|
+
}
|
67
|
+
});
|
68
|
+
onChange(resultValues);
|
69
|
+
} else {
|
70
|
+
onChange(chipLabels.map(function (chipLabel) {
|
71
|
+
return labelToItemMap.get(chipLabel).value;
|
72
|
+
}));
|
73
|
+
}
|
53
74
|
};
|
54
75
|
return /*#__PURE__*/React.createElement(StyledTextField, _extends({
|
55
76
|
ref: ref,
|
@@ -16,10 +16,10 @@ export var config = {
|
|
16
16
|
light: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], badgeTokens.color, badgeTokens.background, badgeTokens.colorTransparent, badgeTokens.backgroundTransparent, badgeTokens.colorClear)
|
17
17
|
},
|
18
18
|
size: {
|
19
|
-
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.
|
20
|
-
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.
|
21
|
-
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.
|
22
|
-
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.
|
19
|
+
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":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-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
20
|
+
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
21
|
+
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
22
|
+
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight)
|
23
23
|
},
|
24
24
|
pilled: {
|
25
25
|
"true": /*#__PURE__*/css(["", ":1.25rem;"], badgeTokens.pilledBorderRadius)
|
@@ -28,7 +28,7 @@ export var config = {
|
|
28
28
|
"true": /*#__PURE__*/css([""])
|
29
29
|
},
|
30
30
|
clear: {
|
31
|
-
"true": /*#__PURE__*/css([""])
|
31
|
+
"true": /*#__PURE__*/css(["", ":var(--surface-clear);"], badgeTokens.backgroundClear)
|
32
32
|
},
|
33
33
|
truncate: {
|
34
34
|
"true": /*#__PURE__*/css([""])
|
@@ -34,6 +34,10 @@ const meta: Meta<typeof Badge> = {
|
|
34
34
|
maxWidth: {
|
35
35
|
control: { type: 'text' },
|
36
36
|
},
|
37
|
+
text: {
|
38
|
+
control: { type: 'text' },
|
39
|
+
if: { arg: 'enableText', truthy: true },
|
40
|
+
},
|
37
41
|
...disableProps(['contentLeft', 'contentRight']),
|
38
42
|
},
|
39
43
|
};
|
@@ -43,6 +47,7 @@ export default meta;
|
|
43
47
|
type StoryProps = ComponentProps<typeof Badge> & {
|
44
48
|
enableContentLeft: boolean;
|
45
49
|
enableContentRight: boolean;
|
50
|
+
enableText: boolean;
|
46
51
|
};
|
47
52
|
type Story = StoryObj<StoryProps>;
|
48
53
|
|
@@ -63,13 +68,14 @@ export const Default: Story = {
|
|
63
68
|
},
|
64
69
|
enableContentRight: {
|
65
70
|
control: { type: 'boolean' },
|
66
|
-
if: { arg: '
|
71
|
+
if: { arg: 'enableText', truthy: true },
|
67
72
|
},
|
68
73
|
},
|
69
74
|
args: {
|
70
|
-
text: 'Hello Kitty',
|
71
75
|
view: 'default',
|
72
76
|
size: 'm',
|
77
|
+
enableText: true,
|
78
|
+
text: 'Hello',
|
73
79
|
enableContentLeft: false,
|
74
80
|
enableContentRight: false,
|
75
81
|
clear: false,
|
@@ -77,13 +83,24 @@ export const Default: Story = {
|
|
77
83
|
transparent: false,
|
78
84
|
maxWidth: '',
|
79
85
|
},
|
80
|
-
render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
|
81
|
-
const iconSize =
|
86
|
+
render: ({ enableContentLeft, enableContentRight, enableText, size, ...rest }: StoryProps) => {
|
87
|
+
const iconSize = () => {
|
88
|
+
switch (size) {
|
89
|
+
case 'l':
|
90
|
+
return '1rem';
|
91
|
+
case 'xs':
|
92
|
+
return '0.625rem';
|
93
|
+
default:
|
94
|
+
return '0.75rem';
|
95
|
+
}
|
96
|
+
};
|
82
97
|
|
83
98
|
return (
|
84
99
|
<Badge
|
85
|
-
contentLeft={
|
86
|
-
|
100
|
+
contentLeft={
|
101
|
+
enableContentLeft || !enableText ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined
|
102
|
+
}
|
103
|
+
contentRight={enableContentRight ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined}
|
87
104
|
size={size}
|
88
105
|
{...rest}
|
89
106
|
/>
|
@@ -16,10 +16,10 @@ export var config = {
|
|
16
16
|
light: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], badgeTokens.color, badgeTokens.background, badgeTokens.colorTransparent, badgeTokens.backgroundTransparent, badgeTokens.colorClear)
|
17
17
|
},
|
18
18
|
size: {
|
19
|
-
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.
|
20
|
-
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.
|
21
|
-
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.
|
22
|
-
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.
|
19
|
+
l: /*#__PURE__*/css(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":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-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
20
|
+
m: /*#__PURE__*/css(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
21
|
+
s: /*#__PURE__*/css(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight),
|
22
|
+
xs: /*#__PURE__*/css(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], badgeTokens.borderRadius, badgeTokens.height, badgeTokens.padding, badgeTokens.paddingIconOnly, badgeTokens.fontFamily, badgeTokens.fontSize, badgeTokens.fontStyle, badgeTokens.fontWeight, badgeTokens.letterSpacing, badgeTokens.lineHeight, badgeTokens.leftContentMarginLeft, badgeTokens.leftContentMarginRight, badgeTokens.rightContentMarginLeft, badgeTokens.rightContentMarginRight)
|
23
23
|
},
|
24
24
|
pilled: {
|
25
25
|
"true": /*#__PURE__*/css(["", ":1.25rem;"], badgeTokens.pilledBorderRadius)
|
@@ -28,7 +28,7 @@ export var config = {
|
|
28
28
|
"true": /*#__PURE__*/css([""])
|
29
29
|
},
|
30
30
|
clear: {
|
31
|
-
"true": /*#__PURE__*/css([""])
|
31
|
+
"true": /*#__PURE__*/css(["", ":var(--surface-clear);"], badgeTokens.backgroundClear)
|
32
32
|
}
|
33
33
|
}
|
34
34
|
};
|
@@ -31,6 +31,13 @@ const meta: Meta<typeof Badge> = {
|
|
31
31
|
control: { type: 'boolean' },
|
32
32
|
if: { arg: 'clear', truthy: false },
|
33
33
|
},
|
34
|
+
maxWidth: {
|
35
|
+
control: { type: 'text' },
|
36
|
+
},
|
37
|
+
text: {
|
38
|
+
control: { type: 'text' },
|
39
|
+
if: { arg: 'enableText', truthy: true },
|
40
|
+
},
|
34
41
|
...disableProps(['contentLeft', 'contentRight']),
|
35
42
|
},
|
36
43
|
};
|
@@ -40,6 +47,7 @@ export default meta;
|
|
40
47
|
type StoryProps = ComponentProps<typeof Badge> & {
|
41
48
|
enableContentLeft: boolean;
|
42
49
|
enableContentRight: boolean;
|
50
|
+
enableText: boolean;
|
43
51
|
};
|
44
52
|
type Story = StoryObj<StoryProps>;
|
45
53
|
|
@@ -60,26 +68,39 @@ export const Default: Story = {
|
|
60
68
|
},
|
61
69
|
enableContentRight: {
|
62
70
|
control: { type: 'boolean' },
|
63
|
-
if: { arg: '
|
71
|
+
if: { arg: 'enableText', truthy: true },
|
64
72
|
},
|
65
73
|
},
|
66
74
|
args: {
|
67
|
-
text: 'Hello',
|
68
75
|
view: 'default',
|
69
76
|
size: 'm',
|
77
|
+
enableText: true,
|
78
|
+
text: 'Hello',
|
70
79
|
enableContentLeft: false,
|
71
80
|
enableContentRight: false,
|
72
81
|
clear: false,
|
73
82
|
pilled: false,
|
74
83
|
transparent: false,
|
84
|
+
maxWidth: '',
|
75
85
|
},
|
76
|
-
render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
|
77
|
-
const iconSize =
|
86
|
+
render: ({ enableContentLeft, enableContentRight, enableText, size, ...rest }: StoryProps) => {
|
87
|
+
const iconSize = () => {
|
88
|
+
switch (size) {
|
89
|
+
case 'l':
|
90
|
+
return '1rem';
|
91
|
+
case 'xs':
|
92
|
+
return '0.625rem';
|
93
|
+
default:
|
94
|
+
return '0.75rem';
|
95
|
+
}
|
96
|
+
};
|
78
97
|
|
79
98
|
return (
|
80
99
|
<Badge
|
81
|
-
contentLeft={
|
82
|
-
|
100
|
+
contentLeft={
|
101
|
+
enableContentLeft || !enableText ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined
|
102
|
+
}
|
103
|
+
contentRight={enableContentRight ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined}
|
83
104
|
size={size}
|
84
105
|
{...rest}
|
85
106
|
/>
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIhE,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,cAAc,CAAC,sFAoEnE,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBAtEQ,UAAU,cAAc,EAAE,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGxE,CAAC"}
|
@@ -3,6 +3,11 @@ export declare const classes: {
|
|
3
3
|
badgeTransparent: string;
|
4
4
|
badgeClear: string;
|
5
5
|
badgeTruncate: string;
|
6
|
+
iconOnly: string;
|
7
|
+
};
|
8
|
+
export declare const privateTokens: {
|
9
|
+
customBackground: string;
|
10
|
+
customColor: string;
|
6
11
|
};
|
7
12
|
export declare const tokens: {
|
8
13
|
background: string;
|
@@ -10,13 +15,12 @@ export declare const tokens: {
|
|
10
15
|
backgroundTransparent: string;
|
11
16
|
colorTransparent: string;
|
12
17
|
colorClear: string;
|
18
|
+
backgroundClear: string;
|
13
19
|
borderRadius: string;
|
14
20
|
pilledBorderRadius: string;
|
15
21
|
height: string;
|
16
|
-
|
17
|
-
|
18
|
-
paddingBottom: string;
|
19
|
-
paddingLeft: string;
|
22
|
+
padding: string;
|
23
|
+
paddingIconOnly: string;
|
20
24
|
fontFamily: string;
|
21
25
|
fontSize: string;
|
22
26
|
fontStyle: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO
|
1
|
+
{"version":3,"file":"Badge.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC;AAEF,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC"}
|
@@ -45,19 +45,32 @@ declare type ClearViewProps = {
|
|
45
45
|
*/
|
46
46
|
clear?: false;
|
47
47
|
};
|
48
|
+
declare type IconContentProps = {
|
49
|
+
/**
|
50
|
+
* Слот для контента слева, например `Icon`
|
51
|
+
*/
|
52
|
+
contentLeft?: ReactNode;
|
53
|
+
/**
|
54
|
+
* Слот для контента справа, например `Icon`
|
55
|
+
*/
|
56
|
+
contentRight?: never;
|
57
|
+
} | {
|
58
|
+
contentLeft?: never;
|
59
|
+
contentRight?: ReactNode;
|
60
|
+
};
|
48
61
|
declare type CustomBadgeProps = {
|
49
62
|
/**
|
50
63
|
* Текстовая надпись
|
51
64
|
*/
|
52
65
|
text?: string;
|
53
66
|
/**
|
54
|
-
*
|
67
|
+
* Пользовательский цвет текста и иконок
|
55
68
|
*/
|
56
|
-
|
69
|
+
customColor?: string;
|
57
70
|
/**
|
58
|
-
*
|
71
|
+
* Пользовательский цвет фона
|
59
72
|
*/
|
60
|
-
|
73
|
+
customBackgroundColor?: string;
|
61
74
|
/**
|
62
75
|
* Обрезает контент по максимальной ширине и добавляет ...
|
63
76
|
* @default 'auto'
|
@@ -75,7 +88,7 @@ declare type CustomBadgeProps = {
|
|
75
88
|
* default
|
76
89
|
*/
|
77
90
|
view?: string;
|
78
|
-
} & PropsWithChildren;
|
91
|
+
} & IconContentProps & PropsWithChildren;
|
79
92
|
export declare type BadgeProps = HTMLAttributes<HTMLDivElement> & CustomBadgeProps & ClearViewProps;
|
80
93
|
export declare type BadgeRootProps = HTMLAttributes<HTMLDivElement> & CustomBadgeProps & {
|
81
94
|
pilled?: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,aAAK,cAAc,GACb;IACI;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACI;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACI;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAER,aAAK,gBAAgB,GAAG;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"Badge.types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,aAAK,cAAc,GACb;IACI;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACI;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACI;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAER,aAAK,gBAAgB,GACf;IACI;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACxB,GACD;IACI,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC5B,CAAC;AAER,aAAK,gBAAgB,GAAG;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,oBAAY,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAC5F,oBAAY,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GACvD,gBAAgB,GAAG;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/components/Badge/variations/_clear/base.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/components/Badge/variations/_clear/base.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,0CAKhB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/components/Badge/variations/_size/base.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/components/Badge/variations/_size/base.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,0CAqBhB,CAAC"}
|