@salutejs/plasma-new-hope 0.328.0-canary.2047.15885229046.0 → 0.328.0-canary.2048.15921758556.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Autocomplete/Autocomplete.css +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js +2 -2
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +1 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +1 -1
- package/cjs/components/Pagination/Pagination.css +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
- package/cjs/components/Range/Range.css +1 -1
- package/cjs/components/Select/Select.css +1 -1
- package/cjs/components/Select/ui/Target/Target.css +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
- package/cjs/components/Slider/Slider.css +1 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
- package/cjs/components/Table/Table.css +1 -1
- package/cjs/components/Table/ui/Cell/Cell.css +1 -1
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +1 -1
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +1 -1
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +1 -1
- package/cjs/components/TextArea/TextArea.js +7 -3
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +4 -1
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/variations/_size/base.js +1 -1
- package/cjs/components/TextArea/variations/_size/base.js.map +1 -1
- package/cjs/components/TextArea/variations/_size/base_1mq4sb2.css +1 -0
- package/cjs/components/TextField/TextField.js +12 -3
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.tokens.js +4 -1
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base.js.map +1 -1
- package/cjs/components/TextField/variations/_size/base_1oec4lw.css +1 -0
- package/cjs/components/Tour/Tour.css +4 -0
- package/cjs/components/Tour/Tour.js +223 -0
- package/cjs/components/Tour/Tour.js.map +1 -0
- package/cjs/components/Tour/Tour.styles.js +58 -0
- package/cjs/components/Tour/Tour.styles.js.map +1 -0
- package/cjs/components/Tour/Tour.styles_hmd79i.css +4 -0
- package/cjs/components/Tour/Tour.tokens.js +21 -0
- package/cjs/components/Tour/Tour.tokens.js.map +1 -0
- package/cjs/components/Tour/utils/index.js +126 -0
- package/cjs/components/Tour/utils/index.js.map +1 -0
- package/cjs/components/Tour/variatoins/_size/base.js +9 -0
- package/cjs/components/Tour/variatoins/_size/base.js.map +1 -0
- package/cjs/components/Tour/variatoins/_view/base.js +9 -0
- package/cjs/components/Tour/variatoins/_view/base.js.map +1 -0
- package/cjs/index.css +8 -1
- package/cjs/index.js +6 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +2 -2
- package/emotion/cjs/components/TextArea/TextArea.js +8 -4
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +3 -1
- package/emotion/cjs/components/TextArea/variations/_size/base.js +2 -1
- package/emotion/cjs/components/TextField/TextField.js +13 -4
- package/emotion/cjs/components/TextField/TextField.tokens.js +3 -1
- package/emotion/cjs/components/TextField/variations/_size/base.js +1 -1
- package/emotion/cjs/components/Tour/Tour.js +387 -0
- package/emotion/cjs/components/Tour/Tour.styles.js +55 -0
- package/emotion/cjs/components/Tour/Tour.tokens.js +31 -0
- package/emotion/cjs/components/Tour/Tour.types.js +4 -0
- package/emotion/cjs/components/Tour/index.js +26 -0
- package/emotion/cjs/components/Tour/utils/index.js +157 -0
- package/emotion/cjs/components/Tour/variatoins/_size/base.js +12 -0
- package/emotion/cjs/components/Tour/variatoins/_view/base.js +12 -0
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +26 -0
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.js +15 -0
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.config.js +26 -0
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.js +15 -0
- package/emotion/cjs/index.js +1 -0
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +2 -2
- package/emotion/es/components/TextArea/TextArea.js +8 -4
- package/emotion/es/components/TextArea/TextArea.tokens.js +3 -1
- package/emotion/es/components/TextArea/variations/_size/base.js +2 -1
- package/emotion/es/components/TextField/TextField.js +13 -4
- package/emotion/es/components/TextField/TextField.tokens.js +3 -1
- package/emotion/es/components/TextField/variations/_size/base.js +1 -1
- package/emotion/es/components/Tour/Tour.js +328 -0
- package/emotion/es/components/Tour/Tour.styles.js +26 -0
- package/emotion/es/components/Tour/Tour.tokens.js +13 -0
- package/emotion/es/components/Tour/Tour.types.js +1 -0
- package/emotion/es/components/Tour/index.js +2 -0
- package/emotion/es/components/Tour/utils/index.js +127 -0
- package/emotion/es/components/Tour/variatoins/_size/base.js +2 -0
- package/emotion/es/components/Tour/variatoins/_view/base.js +2 -0
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.config.js +16 -0
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.js +5 -0
- package/emotion/es/examples/plasma_web/components/Tour/Tour.config.js +16 -0
- package/emotion/es/examples/plasma_web/components/Tour/Tour.js +5 -0
- package/emotion/es/index.js +1 -0
- package/es/components/Autocomplete/Autocomplete.css +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js +2 -2
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +1 -1
- package/es/components/DatePicker/SingleDate/SingleDate.css +1 -1
- package/es/components/Pagination/Pagination.css +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
- package/es/components/Range/Range.css +1 -1
- package/es/components/Select/Select.css +1 -1
- package/es/components/Select/ui/Target/Target.css +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
- package/es/components/Slider/Slider.css +1 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
- package/es/components/Table/Table.css +1 -1
- package/es/components/Table/ui/Cell/Cell.css +1 -1
- package/es/components/Table/ui/EditableCell/EditableCell.css +1 -1
- package/es/components/Table/ui/HeadCell/HeadCell.css +1 -1
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +1 -1
- package/es/components/TextArea/TextArea.js +7 -3
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +4 -1
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/variations/_size/base.js +1 -1
- package/es/components/TextArea/variations/_size/base.js.map +1 -1
- package/es/components/TextArea/variations/_size/base_1mq4sb2.css +1 -0
- package/es/components/TextField/TextField.js +12 -3
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.tokens.js +4 -1
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base.js.map +1 -1
- package/es/components/TextField/variations/_size/base_1oec4lw.css +1 -0
- package/es/components/Tour/Tour.css +4 -0
- package/es/components/Tour/Tour.js +214 -0
- package/es/components/Tour/Tour.js.map +1 -0
- package/es/components/Tour/Tour.styles.js +51 -0
- package/es/components/Tour/Tour.styles.js.map +1 -0
- package/es/components/Tour/Tour.styles_hmd79i.css +4 -0
- package/es/components/Tour/Tour.tokens.js +16 -0
- package/es/components/Tour/Tour.tokens.js.map +1 -0
- package/es/components/Tour/utils/index.js +117 -0
- package/es/components/Tour/utils/index.js.map +1 -0
- package/es/components/Tour/variatoins/_size/base.js +5 -0
- package/es/components/Tour/variatoins/_size/base.js.map +1 -0
- package/es/components/Tour/variatoins/_size/base_x642ct.css +1 -0
- package/es/components/Tour/variatoins/_view/base.js +5 -0
- package/es/components/Tour/variatoins/_view/base.js.map +1 -0
- package/es/components/Tour/variatoins/_view/base_x642ct.css +1 -0
- package/es/index.css +8 -1
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +2 -2
- package/styled-components/cjs/components/TextArea/TextArea.js +7 -3
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +3 -1
- package/styled-components/cjs/components/TextArea/variations/_size/base.js +5 -2
- package/styled-components/cjs/components/TextField/TextField.js +12 -3
- package/styled-components/cjs/components/TextField/TextField.tokens.js +3 -1
- package/styled-components/cjs/components/TextField/variations/_size/base.js +3 -1
- package/styled-components/cjs/components/Tour/Tour.js +387 -0
- package/styled-components/cjs/components/Tour/Tour.styles.js +66 -0
- package/styled-components/cjs/components/Tour/Tour.tokens.js +31 -0
- package/styled-components/cjs/components/Tour/Tour.types.js +4 -0
- package/styled-components/cjs/components/Tour/index.js +26 -0
- package/styled-components/cjs/components/Tour/utils/index.js +157 -0
- package/styled-components/cjs/components/Tour/variatoins/_size/base.js +14 -0
- package/styled-components/cjs/components/Tour/variatoins/_view/base.js +14 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +33 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.js +15 -0
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.config.js +33 -0
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.js +15 -0
- package/styled-components/cjs/index.js +1 -0
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +2 -2
- package/styled-components/es/components/TextArea/TextArea.js +7 -3
- package/styled-components/es/components/TextArea/TextArea.tokens.js +3 -1
- package/styled-components/es/components/TextArea/variations/_size/base.js +5 -2
- package/styled-components/es/components/TextField/TextField.js +12 -3
- package/styled-components/es/components/TextField/TextField.tokens.js +3 -1
- package/styled-components/es/components/TextField/variations/_size/base.js +3 -1
- package/styled-components/es/components/Tour/Tour.js +328 -0
- package/styled-components/es/components/Tour/Tour.styles.js +37 -0
- package/styled-components/es/components/Tour/Tour.tokens.js +13 -0
- package/styled-components/es/components/Tour/Tour.types.js +1 -0
- package/styled-components/es/components/Tour/index.js +2 -0
- package/styled-components/es/components/Tour/utils/index.js +127 -0
- package/styled-components/es/components/Tour/variatoins/_size/base.js +4 -0
- package/styled-components/es/components/Tour/variatoins/_view/base.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.config.js +23 -0
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.js +5 -0
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.config.js +23 -0
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.js +5 -0
- package/styled-components/es/index.js +1 -0
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +1 -0
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/variations/_size/base.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +1 -0
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -1
- package/types/components/Tour/Tour.d.ts +23 -0
- package/types/components/Tour/Tour.d.ts.map +1 -0
- package/types/components/Tour/Tour.styles.d.ts +11 -0
- package/types/components/Tour/Tour.styles.d.ts.map +1 -0
- package/types/components/Tour/Tour.tokens.d.ts +14 -0
- package/types/components/Tour/Tour.tokens.d.ts.map +1 -0
- package/types/components/Tour/Tour.types.d.ts +86 -0
- package/types/components/Tour/Tour.types.d.ts.map +1 -0
- package/types/components/Tour/index.d.ts +4 -0
- package/types/components/Tour/index.d.ts.map +1 -0
- package/types/components/Tour/utils/index.d.ts +7 -0
- package/types/components/Tour/utils/index.d.ts.map +1 -0
- package/types/components/Tour/variatoins/_size/base.d.ts +2 -0
- package/types/components/Tour/variatoins/_size/base.d.ts.map +1 -0
- package/types/components/Tour/variatoins/_view/base.d.ts +2 -0
- package/types/components/Tour/variatoins/_view/base.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/cjs/components/TextField/variations/_size/base_uulqii.css +0 -1
- package/es/components/TextField/variations/_size/base_uulqii.css +0 -1
- /package/cjs/components/{TextArea/variations → Tour/variatoins}/_size/base_x642ct.css +0 -0
- /package/{es/components/TextArea/variations/_size → cjs/components/Tour/variatoins/_view}/base_x642ct.css +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "base", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return base;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _styledcomponents = require("styled-components");
|
12
|
+
var base = (0, _styledcomponents.css)([
|
13
|
+
""
|
14
|
+
]);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "config", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return config;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _styledcomponents = require("styled-components");
|
12
|
+
var _Tourtokens = require("../../../../components/Tour/Tour.tokens");
|
13
|
+
var config = {
|
14
|
+
defaults: {
|
15
|
+
view: 'accent',
|
16
|
+
size: 's'
|
17
|
+
},
|
18
|
+
variations: {
|
19
|
+
view: {
|
20
|
+
default: (0, _styledcomponents.css)([
|
21
|
+
""
|
22
|
+
])
|
23
|
+
},
|
24
|
+
size: {
|
25
|
+
s: (0, _styledcomponents.css)([
|
26
|
+
"",
|
27
|
+
":0.75rem;",
|
28
|
+
":0.75rem;",
|
29
|
+
":0.75rem;"
|
30
|
+
], _Tourtokens.tokens.cardPadding, _Tourtokens.tokens.cardRadius, _Tourtokens.tokens.highlightRadius)
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "Tour", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return Tour;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _Tour = require("../../../../components/Tour");
|
12
|
+
var _engines = require("../../../../engines");
|
13
|
+
var _Tourconfig = require("./Tour.config");
|
14
|
+
var mergedConfig = (0, _engines.mergeConfig)(_Tour.tourConfig, _Tourconfig.config);
|
15
|
+
var Tour = (0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "config", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return config;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _styledcomponents = require("styled-components");
|
12
|
+
var _Tourtokens = require("../../../../components/Tour/Tour.tokens");
|
13
|
+
var config = {
|
14
|
+
defaults: {
|
15
|
+
view: 'accent',
|
16
|
+
size: 's'
|
17
|
+
},
|
18
|
+
variations: {
|
19
|
+
view: {
|
20
|
+
default: (0, _styledcomponents.css)([
|
21
|
+
""
|
22
|
+
])
|
23
|
+
},
|
24
|
+
size: {
|
25
|
+
s: (0, _styledcomponents.css)([
|
26
|
+
"",
|
27
|
+
":0.75rem;",
|
28
|
+
":0.75rem;",
|
29
|
+
":0.75rem;"
|
30
|
+
], _Tourtokens.tokens.cardPadding, _Tourtokens.tokens.cardRadius, _Tourtokens.tokens.highlightRadius)
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "Tour", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return Tour;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _Tour = require("../../../../components/Tour");
|
12
|
+
var _engines = require("../../../../engines");
|
13
|
+
var _Tourconfig = require("./Tour.config");
|
14
|
+
var mergedConfig = (0, _engines.mergeConfig)(_Tour.tourConfig, _Tourconfig.config);
|
15
|
+
var Tour = (0, _engines.component)(mergedConfig);
|
@@ -82,6 +82,7 @@ _export_star(require("./components/Carousel"), exports);
|
|
82
82
|
_export_star(require("./components/PaginationDots"), exports);
|
83
83
|
_export_star(require("./components/CodeInput"), exports);
|
84
84
|
_export_star(require("./components/CodeField"), exports);
|
85
|
+
_export_star(require("./components/Tour"), exports);
|
85
86
|
function _export_star(from, to) {
|
86
87
|
Object.keys(from).forEach(function(k) {
|
87
88
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
@@ -52,7 +52,7 @@ var isDisabledNextDate = function(param, type, max, includeEdgeDates) {
|
|
52
52
|
var currentDate = new Date(year, monthIndex, day);
|
53
53
|
dateOperationHandler[type].add(currentDate);
|
54
54
|
var isOut = true;
|
55
|
-
while(isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate){
|
55
|
+
while(isOut && (includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate)){
|
56
56
|
isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;
|
57
57
|
dateOperationHandler[type].add(currentDate);
|
58
58
|
}
|
@@ -68,7 +68,7 @@ var isDisabledPreviousDate = function(param, type, min, includeEdgeDates) {
|
|
68
68
|
var currentDate = new Date(year, monthIndex, day);
|
69
69
|
dateOperationHandler[type].subtract(currentDate);
|
70
70
|
var isOut = true;
|
71
|
-
while(isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate){
|
71
|
+
while(isOut && (includeEdgeDates ? currentDate > minDate : currentDate >= minDate)){
|
72
72
|
isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;
|
73
73
|
dateOperationHandler[type].subtract(currentDate);
|
74
74
|
}
|
@@ -314,7 +314,8 @@ export var textAreaRoot = function(Root) {
|
|
314
314
|
width: helperWidth
|
315
315
|
}, style),
|
316
316
|
className: cx(clearClass, hasDividerClass, hasHintClass, className),
|
317
|
-
onClick: handleTextAreaFocus
|
317
|
+
onClick: handleTextAreaFocus,
|
318
|
+
"data-root": true
|
318
319
|
}, hintText && {
|
319
320
|
hintView: hintView,
|
320
321
|
hintSize: hintSize
|
@@ -386,7 +387,8 @@ export var textAreaRoot = function(Root) {
|
|
386
387
|
cols: cols,
|
387
388
|
resize: resize,
|
388
389
|
defaultValue: defaultValue,
|
389
|
-
onChange: onChangeHandler
|
390
|
+
onChange: onChangeHandler,
|
391
|
+
"data-tour": true
|
390
392
|
}, rest)), applyAutoResize && /*#__PURE__*/ React.createElement(StyledHiddenTextArea, {
|
391
393
|
"aria-hidden": true,
|
392
394
|
ref: hiddenRef,
|
@@ -396,7 +398,9 @@ export var textAreaRoot = function(Root) {
|
|
396
398
|
})), hasHelper && /*#__PURE__*/ React.createElement(StyledHelpers, {
|
397
399
|
className: styledHelpers,
|
398
400
|
id: textareaHelperId
|
399
|
-
}, isInnerLeftHelperPlacement && (leftHelper || helperText) && /*#__PURE__*/ React.createElement(StyledLeftHelper, null, leftHelper || helperText), rightHelper && /*#__PURE__*/ React.createElement(StyledRightHelper,
|
401
|
+
}, isInnerLeftHelperPlacement && (leftHelper || helperText) && /*#__PURE__*/ React.createElement(StyledLeftHelper, null, leftHelper || helperText), rightHelper && /*#__PURE__*/ React.createElement(StyledRightHelper, {
|
402
|
+
"data-root": true
|
403
|
+
}, rightHelper)), placeholderLabel && /*#__PURE__*/ React.createElement(StyledPlaceholder, {
|
400
404
|
hasContentRight: Boolean(contentRight),
|
401
405
|
className: styledPlaceholder,
|
402
406
|
htmlFor: id
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TOUR_BORDER_RADIUS_TOKEN } from "../Tour/utils";
|
1
2
|
export var classes = {
|
2
3
|
/** Класс отвечающий за поднятие и уменьшение плейсхолдера */ innerPlaceholderUp: 'inner-placeholder-up',
|
3
4
|
/** Класс отвечающий за изменение цвета плейсхолдера при фокусе */ focusedOuterPlaceholderColor: 'focused-outer-placeholder-color',
|
@@ -165,5 +166,6 @@ export var tokens = {
|
|
165
166
|
tooltipArrowMaskImage: '--plasma-textarea__tooltip-arrow-mask-image',
|
166
167
|
tooltipArrowHeight: '--plasma-textarea__tooltip-arrow-height',
|
167
168
|
tooltipArrowEdgeMargin: '--plasma-textarea__tooltip-arrow-edge-margin',
|
168
|
-
tooltipArrowBackground: '--plasma-textarea__tooltip-arrow-background'
|
169
|
+
tooltipArrowBackground: '--plasma-textarea__tooltip-arrow-background',
|
170
|
+
tourBorderRadius: TOUR_BORDER_RADIUS_TOKEN
|
169
171
|
};
|
@@ -380,6 +380,7 @@ export var textFieldRoot = function(Root) {
|
|
380
380
|
readOnly: !disabled && readOnly,
|
381
381
|
labelPlacement: innerLabelPlacementValue,
|
382
382
|
onClick: handleInputFocus,
|
383
|
+
"data-root": true,
|
383
384
|
className: cx(labelPlacementClass, clearClass, hasDividerClass, hasInnerHintClass, classes.textFieldGroupItem, className),
|
384
385
|
style: style
|
385
386
|
}, hintText && {
|
@@ -406,7 +407,9 @@ export var textFieldRoot = function(Root) {
|
|
406
407
|
handleHintClick: handleHintClick
|
407
408
|
})), required && hasRequiredIndicator && /*#__PURE__*/ React.createElement(StyledIndicator, {
|
408
409
|
className: cx(classes.outerLabelPlacement, requiredPlacementClass, hasHintClass)
|
409
|
-
}), optionalTextNode), titleCaption && /*#__PURE__*/ React.createElement(TitleCaption,
|
410
|
+
}), optionalTextNode), titleCaption && /*#__PURE__*/ React.createElement(TitleCaption, {
|
411
|
+
"data-root": true
|
412
|
+
}, titleCaption)), /*#__PURE__*/ React.createElement(InputWrapper, {
|
410
413
|
// Ref для внутреннего использования. Не отдается наружу.
|
411
414
|
ref: rest.inputWrapperRef,
|
412
415
|
// TODO: #1544, и после убрать classes.inputWrapper
|
@@ -432,6 +435,7 @@ export var textFieldRoot = function(Root) {
|
|
432
435
|
handleHintClick: handleHintClick,
|
433
436
|
isInnerLabel: true
|
434
437
|
}))), contentLeft && /*#__PURE__*/ React.createElement(StyledContentLeft, {
|
438
|
+
"data-root": true,
|
435
439
|
isClear: clear,
|
436
440
|
isDefaultView: isDefaultView
|
437
441
|
}, contentLeft), /*#__PURE__*/ React.createElement(InputLabelWrapper, {
|
@@ -487,8 +491,10 @@ export var textFieldRoot = function(Root) {
|
|
487
491
|
onChange: handleChange,
|
488
492
|
onKeyDown: handleOnKeyDown,
|
489
493
|
onFocus: handleFocus,
|
490
|
-
onBlur: handleBlur
|
494
|
+
onBlur: handleBlur,
|
495
|
+
"data-tour": true
|
491
496
|
}, rest)), hasInnerLabel && /*#__PURE__*/ React.createElement(Label, {
|
497
|
+
"data-root": true,
|
492
498
|
id: labelId,
|
493
499
|
htmlFor: innerId
|
494
500
|
}, innerLabelValue, optionalTextNode), placeholderShown && !hasValue && /*#__PURE__*/ React.createElement(InputPlaceholder, {
|
@@ -497,7 +503,9 @@ export var textFieldRoot = function(Root) {
|
|
497
503
|
isHidden: true
|
498
504
|
}, textBefore), innerPlaceholderValue, hasPlaceholderOptional && optionalTextNode), hasTextAfter && /*#__PURE__*/ React.createElement(StyledTextAfter, null, textAfter))), /*#__PURE__*/ React.createElement(StyledContentRightWrapper, {
|
499
505
|
className: cx(contentRightCompensationMargin)
|
500
|
-
}, contentRight && /*#__PURE__*/ React.createElement(StyledContentRight,
|
506
|
+
}, contentRight && /*#__PURE__*/ React.createElement(StyledContentRight, {
|
507
|
+
"data-root": true
|
508
|
+
}, contentRight), !hasOuterLabel && hintText && hintTargetPlacement === 'inner' && /*#__PURE__*/ React.createElement(HintComponent, {
|
501
509
|
ref: hintForkRef,
|
502
510
|
hintText: hintText,
|
503
511
|
hintTrigger: hintTrigger,
|
@@ -514,6 +522,7 @@ export var textFieldRoot = function(Root) {
|
|
514
522
|
handleHintClick: handleHintClick,
|
515
523
|
isInnerLabel: true
|
516
524
|
}))), leftHelper && /*#__PURE__*/ React.createElement(LeftHelper, {
|
525
|
+
"data-root": true,
|
517
526
|
id: helperTextId
|
518
527
|
}, leftHelper));
|
519
528
|
});
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TOUR_BORDER_RADIUS_TOKEN } from "../Tour/utils";
|
1
2
|
export var classes = {
|
2
3
|
hasChips: 'has-chips',
|
3
4
|
chipsWrapper: 'chips-wrapper',
|
@@ -176,5 +177,6 @@ export var tokens = {
|
|
176
177
|
indicatorLabelPlacementHintOuterRight: '--plasma-textfield__indicator-hint-placement-outer-right',
|
177
178
|
clearIndicatorLabelPlacementInner: '--plasma-textfield__clear-indicator-placement-inner',
|
178
179
|
clearIndicatorLabelPlacementInnerRight: '--plasma-textfield__clear-indicator-placement-inner-right',
|
179
|
-
clearIndicatorHintInnerRight: '--plasma-textfield__clear-indicator-hint-placement-inner-right'
|
180
|
+
clearIndicatorHintInnerRight: '--plasma-textfield__clear-indicator-hint-placement-inner-right',
|
181
|
+
tourBorderRadius: TOUR_BORDER_RADIUS_TOKEN
|
180
182
|
};
|
@@ -3,6 +3,8 @@ import { classes, tokens } from "../../TextField.tokens";
|
|
3
3
|
import { HintTargetWrapper, Input, InputContainer, InputWrapper, Label, LeftHelper, StyledContentRight, StyledContentRightWrapper, StyledHintWrapper, StyledOptionalText, StyledTextAfter, StyledTextBefore, TitleCaption } from "../../TextField.styles";
|
4
4
|
export var base = css([
|
5
5
|
"",
|
6
|
+
":var(",
|
7
|
+
");",
|
6
8
|
"{width:100%;font:inherit;letter-spacing:inherit;line-height:inherit;}",
|
7
9
|
"{width:100%;font-family:var(",
|
8
10
|
");font-size:var(",
|
@@ -71,4 +73,4 @@ export var base = css([
|
|
71
73
|
");",
|
72
74
|
"{margin:var(",
|
73
75
|
");}}"
|
74
|
-
], Input, InputContainer, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, InputWrapper, tokens.height, tokens.borderRadius, tokens.padding, classes.hasChips, tokens.paddingWithChips, tokens.paddingWithChips, classes.hasEmptyContentLeft, tokens.paddingWithChips, classes.hasEmptyContentRight, tokens.paddingWithChips, Label, classes.innerLabelPlacement, StyledOptionalText, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, StyledHintWrapper, tokens.hintMargin, tokens.hintTargetSize, tokens.hintTargetSize, HintTargetWrapper, tokens.hintTargetSize, tokens.hintTargetSize, TitleCaption, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, LeftHelper, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, StyledTextBefore, StyledTextAfter, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, StyledTextBefore, tokens.textBeforeMargin, StyledTextAfter, tokens.textAfterMargin, StyledContentRightWrapper, classes.contentRightCompensationMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, StyledContentRight, tokens.rightContentWithHintMargin);
|
76
|
+
], tokens.tourBorderRadius, tokens.borderRadius, Input, InputContainer, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, InputWrapper, tokens.height, tokens.borderRadius, tokens.padding, classes.hasChips, tokens.paddingWithChips, tokens.paddingWithChips, classes.hasEmptyContentLeft, tokens.paddingWithChips, classes.hasEmptyContentRight, tokens.paddingWithChips, Label, classes.innerLabelPlacement, StyledOptionalText, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, StyledHintWrapper, tokens.hintMargin, tokens.hintTargetSize, tokens.hintTargetSize, HintTargetWrapper, tokens.hintTargetSize, tokens.hintTargetSize, TitleCaption, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, LeftHelper, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, StyledTextBefore, StyledTextAfter, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, StyledTextBefore, tokens.textBeforeMargin, StyledTextAfter, tokens.textAfterMargin, StyledContentRightWrapper, classes.contentRightCompensationMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, StyledContentRight, tokens.rightContentWithHintMargin);
|
@@ -0,0 +1,328 @@
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
4
|
+
return arr2;
|
5
|
+
}
|
6
|
+
function _array_with_holes(arr) {
|
7
|
+
if (Array.isArray(arr)) return arr;
|
8
|
+
}
|
9
|
+
function _define_property(obj, key, value) {
|
10
|
+
if (key in obj) {
|
11
|
+
Object.defineProperty(obj, key, {
|
12
|
+
value: value,
|
13
|
+
enumerable: true,
|
14
|
+
configurable: true,
|
15
|
+
writable: true
|
16
|
+
});
|
17
|
+
} else {
|
18
|
+
obj[key] = value;
|
19
|
+
}
|
20
|
+
return obj;
|
21
|
+
}
|
22
|
+
function _iterable_to_array_limit(arr, i) {
|
23
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
24
|
+
if (_i == null) return;
|
25
|
+
var _arr = [];
|
26
|
+
var _n = true;
|
27
|
+
var _d = false;
|
28
|
+
var _s, _e;
|
29
|
+
try {
|
30
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
31
|
+
_arr.push(_s.value);
|
32
|
+
if (i && _arr.length === i) break;
|
33
|
+
}
|
34
|
+
} catch (err) {
|
35
|
+
_d = true;
|
36
|
+
_e = err;
|
37
|
+
} finally{
|
38
|
+
try {
|
39
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
40
|
+
} finally{
|
41
|
+
if (_d) throw _e;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return _arr;
|
45
|
+
}
|
46
|
+
function _non_iterable_rest() {
|
47
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
48
|
+
}
|
49
|
+
function _object_spread(target) {
|
50
|
+
for(var i = 1; i < arguments.length; i++){
|
51
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
52
|
+
var ownKeys = Object.keys(source);
|
53
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
54
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
55
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
56
|
+
}));
|
57
|
+
}
|
58
|
+
ownKeys.forEach(function(key) {
|
59
|
+
_define_property(target, key, source[key]);
|
60
|
+
});
|
61
|
+
}
|
62
|
+
return target;
|
63
|
+
}
|
64
|
+
function ownKeys(object, enumerableOnly) {
|
65
|
+
var keys = Object.keys(object);
|
66
|
+
if (Object.getOwnPropertySymbols) {
|
67
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
68
|
+
if (enumerableOnly) {
|
69
|
+
symbols = symbols.filter(function(sym) {
|
70
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
71
|
+
});
|
72
|
+
}
|
73
|
+
keys.push.apply(keys, symbols);
|
74
|
+
}
|
75
|
+
return keys;
|
76
|
+
}
|
77
|
+
function _object_spread_props(target, source) {
|
78
|
+
source = source != null ? source : {};
|
79
|
+
if (Object.getOwnPropertyDescriptors) {
|
80
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
81
|
+
} else {
|
82
|
+
ownKeys(Object(source)).forEach(function(key) {
|
83
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84
|
+
});
|
85
|
+
}
|
86
|
+
return target;
|
87
|
+
}
|
88
|
+
function _object_without_properties(source, excluded) {
|
89
|
+
if (source == null) return {};
|
90
|
+
var target = _object_without_properties_loose(source, excluded);
|
91
|
+
var key, i;
|
92
|
+
if (Object.getOwnPropertySymbols) {
|
93
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
94
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
95
|
+
key = sourceSymbolKeys[i];
|
96
|
+
if (excluded.indexOf(key) >= 0) continue;
|
97
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
98
|
+
target[key] = source[key];
|
99
|
+
}
|
100
|
+
}
|
101
|
+
return target;
|
102
|
+
}
|
103
|
+
function _object_without_properties_loose(source, excluded) {
|
104
|
+
if (source == null) return {};
|
105
|
+
var target = {};
|
106
|
+
var sourceKeys = Object.keys(source);
|
107
|
+
var key, i;
|
108
|
+
for(i = 0; i < sourceKeys.length; i++){
|
109
|
+
key = sourceKeys[i];
|
110
|
+
if (excluded.indexOf(key) >= 0) continue;
|
111
|
+
target[key] = source[key];
|
112
|
+
}
|
113
|
+
return target;
|
114
|
+
}
|
115
|
+
function _sliced_to_array(arr, i) {
|
116
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
117
|
+
}
|
118
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
119
|
+
if (!o) return;
|
120
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
121
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
122
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
123
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
124
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
125
|
+
}
|
126
|
+
import React, { forwardRef, useEffect, useState, useRef } from "react";
|
127
|
+
import { createPortal } from "react-dom";
|
128
|
+
import { useFloating, offset, flip, shift, autoUpdate } from "@floating-ui/react-dom";
|
129
|
+
import { canUseDOM } from "../../utils";
|
130
|
+
import { getHTMLElement, getIncreasedRadius, findRootElement } from "./utils";
|
131
|
+
import { MaskContainer, Mask, Highlight, TourPortal } from "./Tour.styles";
|
132
|
+
import { base as viewCSS } from "./variatoins/_view/base";
|
133
|
+
import { base as sizeCSS } from "./variatoins/_size/base";
|
134
|
+
import { classes } from "./Tour.tokens";
|
135
|
+
export var tourRoot = function(Root) {
|
136
|
+
return /*#__PURE__*/ forwardRef(function(_param, outerRef) {
|
137
|
+
var steps = _param.steps, current = _param.current, _param_defaultCurrent = _param.defaultCurrent, defaultCurrent = _param_defaultCurrent === void 0 ? 0 : _param_defaultCurrent, open = _param.open, _param_defaultOpen = _param.defaultOpen, defaultOpen = _param_defaultOpen === void 0 ? false : _param_defaultOpen, onClose = _param.onClose, _param_withOverlay = _param.withOverlay, withOverlay = _param_withOverlay === void 0 ? true : _param_withOverlay, overlayColor = _param.overlayColor, _param_zIndex = _param.zIndex, zIndex = _param_zIndex === void 0 ? 9000 : _param_zIndex, view = _param.view, size = _param.size, tmp = _param.offset, offsetProp = tmp === void 0 ? [
|
138
|
+
12,
|
139
|
+
12
|
140
|
+
] : tmp, _param_highlightOffset = _param.highlightOffset, highlightOffset = _param_highlightOffset === void 0 ? 4 : _param_highlightOffset, renderStep = _param.renderStep, rest = _object_without_properties(_param, [
|
141
|
+
"steps",
|
142
|
+
"current",
|
143
|
+
"defaultCurrent",
|
144
|
+
"open",
|
145
|
+
"defaultOpen",
|
146
|
+
"onClose",
|
147
|
+
"withOverlay",
|
148
|
+
"overlayColor",
|
149
|
+
"zIndex",
|
150
|
+
"view",
|
151
|
+
"size",
|
152
|
+
"offset",
|
153
|
+
"highlightOffset",
|
154
|
+
"renderStep"
|
155
|
+
]);
|
156
|
+
var TOUR_PORTAL_ID = "plasma-tour-portal-".concat(Date.now());
|
157
|
+
var isCurrentControlled = typeof current === 'number';
|
158
|
+
var isOpenControlled = typeof open === 'boolean';
|
159
|
+
var _useState = _sliced_to_array(useState(defaultCurrent), 2), innerCurrent = _useState[0], setInnerCurrent = _useState[1];
|
160
|
+
var _useState1 = _sliced_to_array(useState(defaultOpen), 2), innerOpen = _useState1[0], setInnerOpen = _useState1[1];
|
161
|
+
var _useState2 = _sliced_to_array(useState(null), 2), highlightRect = _useState2[0], setHighlightRect = _useState2[1];
|
162
|
+
var _useState3 = _sliced_to_array(useState(null), 2), highlightBorderRadius = _useState3[0], setHighlightBorderRadius = _useState3[1];
|
163
|
+
var _useState4 = _sliced_to_array(useState(null), 2), targetElement = _useState4[0], setTargetElement = _useState4[1];
|
164
|
+
var portalRef = useRef(null);
|
165
|
+
var active = isCurrentControlled ? current : innerCurrent;
|
166
|
+
var isOpen = isOpenControlled ? open : innerOpen;
|
167
|
+
var currentStep = steps[active];
|
168
|
+
var rawPlacement = currentStep === null || currentStep === void 0 ? void 0 : currentStep.placement;
|
169
|
+
var placement = (Array.isArray(rawPlacement) ? rawPlacement[0] : rawPlacement) || 'bottom';
|
170
|
+
var middleware = [
|
171
|
+
offset(offsetProp[0]),
|
172
|
+
flip({
|
173
|
+
fallbackPlacements: Array.isArray(currentStep === null || currentStep === void 0 ? void 0 : currentStep.placement) ? currentStep.placement : undefined
|
174
|
+
}),
|
175
|
+
shift({
|
176
|
+
padding: offsetProp[1]
|
177
|
+
})
|
178
|
+
];
|
179
|
+
var _useFloating = useFloating({
|
180
|
+
placement: placement,
|
181
|
+
middleware: middleware,
|
182
|
+
whileElementsMounted: autoUpdate
|
183
|
+
}), refs = _useFloating.refs, floatingStyles = _useFloating.floatingStyles, calculatedPlacement = _useFloating.placement;
|
184
|
+
var handleSetOpen = function(value) {
|
185
|
+
if (!isOpenControlled) {
|
186
|
+
setInnerOpen(value);
|
187
|
+
}
|
188
|
+
if (!value) {
|
189
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
190
|
+
setInnerCurrent(0);
|
191
|
+
setHighlightRect(null);
|
192
|
+
setTargetElement(null);
|
193
|
+
}
|
194
|
+
};
|
195
|
+
var handleClose = function() {
|
196
|
+
handleSetOpen(false);
|
197
|
+
};
|
198
|
+
var updateHighlight = function() {
|
199
|
+
if (!isOpen || !currentStep) {
|
200
|
+
return;
|
201
|
+
}
|
202
|
+
var rootItem = findRootElement(currentStep.target);
|
203
|
+
var highlightElement = getHTMLElement(rootItem);
|
204
|
+
if (highlightElement) {
|
205
|
+
var rect = highlightElement.getBoundingClientRect();
|
206
|
+
setHighlightRect(rect);
|
207
|
+
setTargetElement(highlightElement);
|
208
|
+
var _currentStep_borderRadius;
|
209
|
+
var borderRadius = currentStep.borderRadius === 'auto' || currentStep.borderRadius === undefined || currentStep.borderRadius === null ? getIncreasedRadius(rootItem, highlightOffset) : (_currentStep_borderRadius = currentStep === null || currentStep === void 0 ? void 0 : currentStep.borderRadius) !== null && _currentStep_borderRadius !== void 0 ? _currentStep_borderRadius : '0px';
|
210
|
+
setHighlightBorderRadius(borderRadius);
|
211
|
+
} else {
|
212
|
+
setHighlightRect(null);
|
213
|
+
setTargetElement(null);
|
214
|
+
}
|
215
|
+
};
|
216
|
+
useEffect(function() {
|
217
|
+
refs.setReference(targetElement);
|
218
|
+
}, [
|
219
|
+
refs,
|
220
|
+
targetElement
|
221
|
+
]);
|
222
|
+
useEffect(function() {
|
223
|
+
if (!canUseDOM) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
var portal = document.getElementById(TOUR_PORTAL_ID);
|
227
|
+
if (!portal) {
|
228
|
+
portal = document.createElement('div');
|
229
|
+
portal.setAttribute('id', TOUR_PORTAL_ID);
|
230
|
+
document.body.appendChild(portal);
|
231
|
+
}
|
232
|
+
portalRef.current = portal;
|
233
|
+
return function() {
|
234
|
+
if (portal) {
|
235
|
+
portal.remove();
|
236
|
+
}
|
237
|
+
};
|
238
|
+
}, []);
|
239
|
+
useEffect(function() {
|
240
|
+
updateHighlight();
|
241
|
+
window.addEventListener('resize', updateHighlight);
|
242
|
+
window.addEventListener('scroll', updateHighlight, true);
|
243
|
+
return function() {
|
244
|
+
window.removeEventListener('resize', updateHighlight);
|
245
|
+
window.removeEventListener('scroll', updateHighlight, true);
|
246
|
+
};
|
247
|
+
}, [
|
248
|
+
currentStep
|
249
|
+
]);
|
250
|
+
useEffect(function() {
|
251
|
+
if (isOpen && targetElement) {
|
252
|
+
targetElement.scrollIntoView({
|
253
|
+
block: 'center',
|
254
|
+
inline: 'center',
|
255
|
+
behavior: 'smooth'
|
256
|
+
});
|
257
|
+
}
|
258
|
+
}, [
|
259
|
+
isOpen,
|
260
|
+
active,
|
261
|
+
targetElement
|
262
|
+
]);
|
263
|
+
useEffect(function() {
|
264
|
+
var handleKeyDown = function(e) {
|
265
|
+
if (e.key === 'Escape') {
|
266
|
+
handleClose();
|
267
|
+
}
|
268
|
+
};
|
269
|
+
if (isOpen) {
|
270
|
+
window.addEventListener('keydown', handleKeyDown);
|
271
|
+
}
|
272
|
+
return function() {
|
273
|
+
window.removeEventListener('keydown', handleKeyDown);
|
274
|
+
};
|
275
|
+
}, [
|
276
|
+
isOpen,
|
277
|
+
handleClose
|
278
|
+
]);
|
279
|
+
if (!currentStep || !canUseDOM || !portalRef.current) {
|
280
|
+
return null;
|
281
|
+
}
|
282
|
+
var _highlightRect_left, _highlightRect_top, _highlightRect_width, _highlightRect_height;
|
283
|
+
var tourContent = /*#__PURE__*/ React.createElement(Root, _object_spread({
|
284
|
+
renderStep: renderStep,
|
285
|
+
steps: steps,
|
286
|
+
ref: outerRef,
|
287
|
+
view: view,
|
288
|
+
size: size
|
289
|
+
}, rest), isOpen && withOverlay && /*#__PURE__*/ React.createElement(MaskContainer, {
|
290
|
+
className: classes.mask,
|
291
|
+
zIndex: zIndex
|
292
|
+
}, /*#__PURE__*/ React.createElement(Mask, null), Boolean(highlightRect) && /*#__PURE__*/ React.createElement(Highlight, {
|
293
|
+
overlayColor: overlayColor,
|
294
|
+
borderRadius: highlightBorderRadius,
|
295
|
+
style: {
|
296
|
+
left: ((_highlightRect_left = highlightRect === null || highlightRect === void 0 ? void 0 : highlightRect.left) !== null && _highlightRect_left !== void 0 ? _highlightRect_left : 0) - highlightOffset,
|
297
|
+
top: ((_highlightRect_top = highlightRect === null || highlightRect === void 0 ? void 0 : highlightRect.top) !== null && _highlightRect_top !== void 0 ? _highlightRect_top : 0) - highlightOffset,
|
298
|
+
width: ((_highlightRect_width = highlightRect === null || highlightRect === void 0 ? void 0 : highlightRect.width) !== null && _highlightRect_width !== void 0 ? _highlightRect_width : 0) + highlightOffset * 2,
|
299
|
+
height: ((_highlightRect_height = highlightRect === null || highlightRect === void 0 ? void 0 : highlightRect.height) !== null && _highlightRect_height !== void 0 ? _highlightRect_height : 0) + highlightOffset * 2
|
300
|
+
}
|
301
|
+
})), isOpen && Boolean(targetElement) && /*#__PURE__*/ React.createElement(TourPortal, {
|
302
|
+
ref: refs.setFloating,
|
303
|
+
style: _object_spread_props(_object_spread({}, floatingStyles), {
|
304
|
+
zIndex: Number(zIndex)
|
305
|
+
}),
|
306
|
+
"data-placement": calculatedPlacement
|
307
|
+
}, renderStep && renderStep(active, steps.length, active === steps.length - 1, steps[active])));
|
308
|
+
return /*#__PURE__*/ createPortal(tourContent, portalRef.current);
|
309
|
+
});
|
310
|
+
};
|
311
|
+
export var tourConfig = {
|
312
|
+
name: 'Tour',
|
313
|
+
tag: 'div',
|
314
|
+
layout: tourRoot,
|
315
|
+
base: '',
|
316
|
+
variations: {
|
317
|
+
view: {
|
318
|
+
css: viewCSS
|
319
|
+
},
|
320
|
+
size: {
|
321
|
+
css: sizeCSS
|
322
|
+
}
|
323
|
+
},
|
324
|
+
defaults: {
|
325
|
+
view: 'default',
|
326
|
+
size: 'm'
|
327
|
+
}
|
328
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import styled from "styled-components";
|
2
|
+
export var MaskContainer = styled.div.withConfig({
|
3
|
+
displayName: "Tour.styles__MaskContainer",
|
4
|
+
componentId: "sc-d6b8d03d-0"
|
5
|
+
})([
|
6
|
+
"z-index:",
|
7
|
+
";"
|
8
|
+
], function(param) {
|
9
|
+
var zIndex = param.zIndex;
|
10
|
+
return zIndex || 9000;
|
11
|
+
});
|
12
|
+
export var Mask = styled.div.withConfig({
|
13
|
+
displayName: "Tour.styles__Mask",
|
14
|
+
componentId: "sc-d6b8d03d-1"
|
15
|
+
})([
|
16
|
+
"position:fixed;inset:0;pointer-events:all;"
|
17
|
+
]);
|
18
|
+
export var Highlight = styled.div.withConfig({
|
19
|
+
displayName: "Tour.styles__Highlight",
|
20
|
+
componentId: "sc-d6b8d03d-2"
|
21
|
+
})([
|
22
|
+
"--private-mask-color:",
|
23
|
+
";position:fixed;background:transparent;border-radius:",
|
24
|
+
";box-shadow:0 0 0 9999px var(--private-mask-color);pointer-events:none;transition:all 0.3s cubic-bezier(0.4,0,0.2,1);"
|
25
|
+
], function(param) {
|
26
|
+
var overlayColor = param.overlayColor;
|
27
|
+
return "".concat(overlayColor || 'rgba(0, 0, 0, 0.45)');
|
28
|
+
}, function(param) {
|
29
|
+
var borderRadius = param.borderRadius;
|
30
|
+
return borderRadius !== null && borderRadius !== void 0 ? borderRadius : 0;
|
31
|
+
});
|
32
|
+
export var TourPortal = styled.div.withConfig({
|
33
|
+
displayName: "Tour.styles__TourPortal",
|
34
|
+
componentId: "sc-d6b8d03d-3"
|
35
|
+
})([
|
36
|
+
"position:absolute;"
|
37
|
+
]);
|