@salutejs/plasma-new-hope 0.327.0-canary.2010.15752302924.0 → 0.327.0-canary.2016.15703018170.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/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/Mask/Mask.js +3 -3
- package/cjs/components/Mask/Mask.js.map +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 +2 -5
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +1 -2
- 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/TextField/TextField.js +2 -10
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.tokens.js +1 -2
- 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_uulqii.css +1 -0
- package/cjs/index.css +1 -8
- package/cjs/index.js +0 -6
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Mask/Mask.js +3 -3
- package/emotion/cjs/components/TextArea/TextArea.js +3 -6
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +1 -2
- package/emotion/cjs/components/TextArea/variations/_size/base.js +1 -2
- package/emotion/cjs/components/TextField/TextField.js +3 -11
- package/emotion/cjs/components/TextField/TextField.tokens.js +1 -2
- package/emotion/cjs/components/TextField/variations/_size/base.js +1 -1
- package/emotion/cjs/index.js +0 -11
- package/emotion/es/components/Mask/Mask.js +3 -3
- package/emotion/es/components/TextArea/TextArea.js +3 -6
- package/emotion/es/components/TextArea/TextArea.tokens.js +1 -2
- package/emotion/es/components/TextArea/variations/_size/base.js +1 -2
- package/emotion/es/components/TextField/TextField.js +3 -11
- package/emotion/es/components/TextField/TextField.tokens.js +1 -2
- package/emotion/es/components/TextField/variations/_size/base.js +1 -1
- package/emotion/es/index.js +1 -2
- package/es/components/Autocomplete/Autocomplete.css +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/Mask/Mask.js +3 -3
- package/es/components/Mask/Mask.js.map +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 +2 -5
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +1 -2
- 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/TextField/TextField.js +2 -10
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.tokens.js +1 -2
- 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_uulqii.css +1 -0
- package/es/index.css +1 -8
- package/es/index.js +0 -2
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Mask/Mask.js +3 -3
- package/styled-components/cjs/components/TextArea/TextArea.js +2 -5
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +1 -2
- package/styled-components/cjs/components/TextArea/variations/_size/base.js +1 -2
- package/styled-components/cjs/components/TextField/TextField.js +2 -10
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -2
- package/styled-components/cjs/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/cjs/index.js +0 -11
- package/styled-components/es/components/Mask/Mask.js +3 -3
- package/styled-components/es/components/TextArea/TextArea.js +2 -5
- package/styled-components/es/components/TextArea/TextArea.tokens.js +1 -2
- package/styled-components/es/components/TextArea/variations/_size/base.js +1 -2
- package/styled-components/es/components/TextField/TextField.js +2 -10
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -2
- package/styled-components/es/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/es/index.js +1 -2
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +0 -1
- 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 +0 -1
- 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/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/cjs/components/TextArea/variations/_size/base_1mq4sb2.css +0 -1
- package/cjs/components/TextField/variations/_size/base_ryad12.css +0 -1
- package/cjs/components/Tour/Tour.css +0 -4
- package/cjs/components/Tour/Tour.js +0 -231
- package/cjs/components/Tour/Tour.js.map +0 -1
- package/cjs/components/Tour/Tour.styles.js +0 -58
- package/cjs/components/Tour/Tour.styles.js.map +0 -1
- package/cjs/components/Tour/Tour.styles_hmd79i.css +0 -4
- package/cjs/components/Tour/Tour.tokens.js +0 -21
- package/cjs/components/Tour/Tour.tokens.js.map +0 -1
- package/cjs/components/Tour/utils/index.js +0 -113
- package/cjs/components/Tour/utils/index.js.map +0 -1
- package/cjs/components/Tour/variatoins/_size/base.js +0 -9
- package/cjs/components/Tour/variatoins/_size/base.js.map +0 -1
- package/cjs/components/Tour/variatoins/_view/base.js +0 -9
- package/cjs/components/Tour/variatoins/_view/base.js.map +0 -1
- package/emotion/cjs/components/Tour/Tour.js +0 -240
- package/emotion/cjs/components/Tour/Tour.styles.js +0 -50
- package/emotion/cjs/components/Tour/Tour.tokens.js +0 -19
- package/emotion/cjs/components/Tour/Tour.types.js +0 -5
- package/emotion/cjs/components/Tour/index.js +0 -31
- package/emotion/cjs/components/Tour/utils/index.js +0 -110
- package/emotion/cjs/components/Tour/variatoins/_size/base.js +0 -8
- package/emotion/cjs/components/Tour/variatoins/_size/tokens.json +0 -1
- package/emotion/cjs/components/Tour/variatoins/_view/base.js +0 -8
- package/emotion/cjs/components/Tour/variatoins/_view/tokens.json +0 -1
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +0 -22
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.js +0 -11
- package/emotion/cjs/examples/plasma_b2c/components/Tour/Tour.stories.tsx +0 -299
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.config.js +0 -22
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.js +0 -11
- package/emotion/cjs/examples/plasma_web/components/Tour/Tour.stories.tsx +0 -242
- package/emotion/es/components/Tour/Tour.js +0 -232
- package/emotion/es/components/Tour/Tour.styles.js +0 -43
- package/emotion/es/components/Tour/Tour.tokens.js +0 -13
- package/emotion/es/components/Tour/Tour.types.js +0 -1
- package/emotion/es/components/Tour/index.js +0 -2
- package/emotion/es/components/Tour/utils/index.js +0 -104
- package/emotion/es/components/Tour/variatoins/_size/base.js +0 -2
- package/emotion/es/components/Tour/variatoins/_size/tokens.json +0 -1
- package/emotion/es/components/Tour/variatoins/_view/base.js +0 -2
- package/emotion/es/components/Tour/variatoins/_view/tokens.json +0 -1
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.config.js +0 -16
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.js +0 -5
- package/emotion/es/examples/plasma_b2c/components/Tour/Tour.stories.tsx +0 -299
- package/emotion/es/examples/plasma_web/components/Tour/Tour.config.js +0 -16
- package/emotion/es/examples/plasma_web/components/Tour/Tour.js +0 -5
- package/emotion/es/examples/plasma_web/components/Tour/Tour.stories.tsx +0 -242
- package/es/components/TextArea/variations/_size/base_1mq4sb2.css +0 -1
- package/es/components/TextField/variations/_size/base_ryad12.css +0 -1
- package/es/components/Tour/Tour.css +0 -4
- package/es/components/Tour/Tour.js +0 -222
- package/es/components/Tour/Tour.js.map +0 -1
- package/es/components/Tour/Tour.styles.js +0 -51
- package/es/components/Tour/Tour.styles.js.map +0 -1
- package/es/components/Tour/Tour.styles_hmd79i.css +0 -4
- package/es/components/Tour/Tour.tokens.js +0 -16
- package/es/components/Tour/Tour.tokens.js.map +0 -1
- package/es/components/Tour/utils/index.js +0 -107
- package/es/components/Tour/utils/index.js.map +0 -1
- package/es/components/Tour/variatoins/_size/base.js +0 -5
- package/es/components/Tour/variatoins/_size/base.js.map +0 -1
- package/es/components/Tour/variatoins/_size/base_x642ct.css +0 -1
- package/es/components/Tour/variatoins/_view/base.js +0 -5
- package/es/components/Tour/variatoins/_view/base.js.map +0 -1
- package/es/components/Tour/variatoins/_view/base_x642ct.css +0 -1
- package/styled-components/cjs/components/Tour/Tour.js +0 -240
- package/styled-components/cjs/components/Tour/Tour.styles.js +0 -29
- package/styled-components/cjs/components/Tour/Tour.tokens.js +0 -19
- package/styled-components/cjs/components/Tour/Tour.types.js +0 -5
- package/styled-components/cjs/components/Tour/index.js +0 -31
- package/styled-components/cjs/components/Tour/utils/index.js +0 -110
- package/styled-components/cjs/components/Tour/variatoins/_size/base.js +0 -8
- package/styled-components/cjs/components/Tour/variatoins/_size/tokens.json +0 -1
- package/styled-components/cjs/components/Tour/variatoins/_view/base.js +0 -8
- package/styled-components/cjs/components/Tour/variatoins/_view/tokens.json +0 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.config.js +0 -22
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/Tour/Tour.stories.tsx +0 -299
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.config.js +0 -22
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.js +0 -11
- package/styled-components/cjs/examples/plasma_web/components/Tour/Tour.stories.tsx +0 -242
- package/styled-components/es/components/Tour/Tour.js +0 -232
- package/styled-components/es/components/Tour/Tour.styles.js +0 -22
- package/styled-components/es/components/Tour/Tour.tokens.js +0 -13
- package/styled-components/es/components/Tour/Tour.types.js +0 -1
- package/styled-components/es/components/Tour/index.js +0 -2
- package/styled-components/es/components/Tour/utils/index.js +0 -104
- package/styled-components/es/components/Tour/variatoins/_size/base.js +0 -2
- package/styled-components/es/components/Tour/variatoins/_size/tokens.json +0 -1
- package/styled-components/es/components/Tour/variatoins/_view/base.js +0 -2
- package/styled-components/es/components/Tour/variatoins/_view/tokens.json +0 -1
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.config.js +0 -16
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/Tour/Tour.stories.tsx +0 -299
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.config.js +0 -16
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.js +0 -5
- package/styled-components/es/examples/plasma_web/components/Tour/Tour.stories.tsx +0 -242
- package/types/components/Tour/Tour.d.ts +0 -23
- package/types/components/Tour/Tour.d.ts.map +0 -1
- package/types/components/Tour/Tour.styles.d.ts +0 -10
- package/types/components/Tour/Tour.styles.d.ts.map +0 -1
- package/types/components/Tour/Tour.tokens.d.ts +0 -14
- package/types/components/Tour/Tour.tokens.d.ts.map +0 -1
- package/types/components/Tour/Tour.types.d.ts +0 -86
- package/types/components/Tour/Tour.types.d.ts.map +0 -1
- package/types/components/Tour/index.d.ts +0 -4
- package/types/components/Tour/index.d.ts.map +0 -1
- package/types/components/Tour/utils/index.d.ts +0 -4
- package/types/components/Tour/utils/index.d.ts.map +0 -1
- package/types/components/Tour/variatoins/_size/base.d.ts +0 -2
- package/types/components/Tour/variatoins/_size/base.d.ts.map +0 -1
- package/types/components/Tour/variatoins/_view/base.d.ts +0 -2
- package/types/components/Tour/variatoins/_view/base.d.ts.map +0 -1
- /package/cjs/components/{Tour/variatoins → TextArea/variations}/_size/base_x642ct.css +0 -0
- /package/{cjs/components/Tour/variatoins/_view → es/components/TextArea/variations/_size}/base_x642ct.css +0 -0
@@ -1,242 +0,0 @@
|
|
1
|
-
import React, { useRef, useState } from 'react';
|
2
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
-
import styled from '@emotion/styled';
|
4
|
-
|
5
|
-
import { linkConfig } from '../../../../components/Link';
|
6
|
-
import { mergeConfig } from '../../../../engines';
|
7
|
-
import { WithTheme, argTypesFromConfig } from '../../../_helpers';
|
8
|
-
import { Button } from '../Button/Button';
|
9
|
-
|
10
|
-
import { config } from './Tour.config';
|
11
|
-
import { Tour } from './Tour';
|
12
|
-
|
13
|
-
const meta: Meta<typeof Tour> = {
|
14
|
-
title: 'web/Navigation/Tour',
|
15
|
-
decorators: [WithTheme],
|
16
|
-
component: Tour,
|
17
|
-
argTypes: {
|
18
|
-
...argTypesFromConfig(mergeConfig(linkConfig, config)),
|
19
|
-
withOverlay: {
|
20
|
-
type: 'boolean',
|
21
|
-
},
|
22
|
-
overlayColor: {
|
23
|
-
control: {
|
24
|
-
type: 'color',
|
25
|
-
},
|
26
|
-
},
|
27
|
-
},
|
28
|
-
};
|
29
|
-
|
30
|
-
export default meta;
|
31
|
-
|
32
|
-
const Card = styled.div`
|
33
|
-
padding: 1rem;
|
34
|
-
background: #fff;
|
35
|
-
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
|
36
|
-
border-radius: 0.75rem;
|
37
|
-
max-width: 20rem;
|
38
|
-
display: flex;
|
39
|
-
flex-direction: column;
|
40
|
-
gap: 0.75rem;
|
41
|
-
`;
|
42
|
-
|
43
|
-
const Title = styled.h4`
|
44
|
-
margin: 0;
|
45
|
-
font-size: 1rem;
|
46
|
-
font-weight: 600;
|
47
|
-
color: #000;
|
48
|
-
`;
|
49
|
-
|
50
|
-
const Description = styled.p`
|
51
|
-
margin: 0;
|
52
|
-
font-size: 0.875rem;
|
53
|
-
line-height: 1.5;
|
54
|
-
color: #666;
|
55
|
-
`;
|
56
|
-
|
57
|
-
const Footer = styled.div`
|
58
|
-
display: flex;
|
59
|
-
justify-content: space-between;
|
60
|
-
align-items: center;
|
61
|
-
gap: 1.5rem;
|
62
|
-
margin-top: 0.5rem;
|
63
|
-
|
64
|
-
> div {
|
65
|
-
display: flex;
|
66
|
-
gap: 0.5rem;
|
67
|
-
}
|
68
|
-
|
69
|
-
small {
|
70
|
-
color: #666;
|
71
|
-
white-space: nowrap;
|
72
|
-
}
|
73
|
-
`;
|
74
|
-
|
75
|
-
const TourCard: React.FC<{
|
76
|
-
title: string;
|
77
|
-
description: string;
|
78
|
-
index: number;
|
79
|
-
last: boolean;
|
80
|
-
total: number;
|
81
|
-
onPrev: () => void;
|
82
|
-
onNext: () => void;
|
83
|
-
onClose: () => void;
|
84
|
-
}> = ({ title, description, index, last, total, onPrev, onNext, onClose }) => {
|
85
|
-
return (
|
86
|
-
<Card>
|
87
|
-
{title && <Title>{title}</Title>}
|
88
|
-
{description && <Description>{description}</Description>}
|
89
|
-
<Footer>
|
90
|
-
<div>
|
91
|
-
{index > 0 && (
|
92
|
-
<Button size="xs" type="button" onClick={onPrev}>
|
93
|
-
Назад
|
94
|
-
</Button>
|
95
|
-
)}
|
96
|
-
{!last && (
|
97
|
-
<Button size="xs" type="button" onClick={onNext}>
|
98
|
-
Далее
|
99
|
-
</Button>
|
100
|
-
)}
|
101
|
-
{last && (
|
102
|
-
<Button size="xs" type="button" onClick={onClose}>
|
103
|
-
Закрыть
|
104
|
-
</Button>
|
105
|
-
)}
|
106
|
-
</div>
|
107
|
-
<small>
|
108
|
-
Шаг {index + 1} / {total}
|
109
|
-
</small>
|
110
|
-
</Footer>
|
111
|
-
</Card>
|
112
|
-
);
|
113
|
-
};
|
114
|
-
|
115
|
-
const StoryDefault = (args) => {
|
116
|
-
const ref1 = useRef<HTMLButtonElement>(null);
|
117
|
-
const ref2 = useRef<HTMLButtonElement>(null);
|
118
|
-
const ref3 = useRef<HTMLButtonElement>(null);
|
119
|
-
const ref4 = useRef<HTMLButtonElement>(null);
|
120
|
-
const [open, setOpen] = useState(false);
|
121
|
-
const [current, setCurrent] = useState(0);
|
122
|
-
|
123
|
-
const onNext = () => setCurrent(current + 1);
|
124
|
-
const onPrev = () => setCurrent(current - 1);
|
125
|
-
const onClose = () => setOpen(false);
|
126
|
-
|
127
|
-
const steps = [
|
128
|
-
{
|
129
|
-
target: ref1,
|
130
|
-
renderItem: () => (
|
131
|
-
<TourCard
|
132
|
-
title="Первый шаг"
|
133
|
-
description="Нажмите кнопку, чтобы продолжить"
|
134
|
-
index={0}
|
135
|
-
last={current === steps.length - 1}
|
136
|
-
total={steps.length}
|
137
|
-
onNext={onNext}
|
138
|
-
onPrev={onPrev}
|
139
|
-
onClose={onClose}
|
140
|
-
/>
|
141
|
-
),
|
142
|
-
placement: 'right',
|
143
|
-
},
|
144
|
-
{
|
145
|
-
target: ref2,
|
146
|
-
renderItem: () => (
|
147
|
-
<TourCard
|
148
|
-
title="Первый шаг"
|
149
|
-
description="Нажмите кнопку, чтобы продолжить"
|
150
|
-
index={1}
|
151
|
-
last={current === steps.length - 1}
|
152
|
-
total={steps.length}
|
153
|
-
onNext={onNext}
|
154
|
-
onPrev={onPrev}
|
155
|
-
onClose={onClose}
|
156
|
-
/>
|
157
|
-
),
|
158
|
-
},
|
159
|
-
{
|
160
|
-
target: ref3,
|
161
|
-
renderItem: () => (
|
162
|
-
<TourCard
|
163
|
-
title="Первый шаг"
|
164
|
-
description="Нажмите кнопку, чтобы продолжить"
|
165
|
-
index={2}
|
166
|
-
last={current === steps.length - 1}
|
167
|
-
total={steps.length}
|
168
|
-
onNext={onNext}
|
169
|
-
onPrev={onPrev}
|
170
|
-
onClose={onClose}
|
171
|
-
/>
|
172
|
-
),
|
173
|
-
},
|
174
|
-
{
|
175
|
-
target: ref4,
|
176
|
-
renderItem: () => (
|
177
|
-
<TourCard
|
178
|
-
title="Первый шаг"
|
179
|
-
description="Нажмите кнопку, чтобы продолжить"
|
180
|
-
index={3}
|
181
|
-
last={current === steps.length - 1}
|
182
|
-
total={steps.length}
|
183
|
-
onNext={onNext}
|
184
|
-
onPrev={onPrev}
|
185
|
-
onClose={onClose}
|
186
|
-
/>
|
187
|
-
),
|
188
|
-
placement: 'left',
|
189
|
-
},
|
190
|
-
];
|
191
|
-
|
192
|
-
return (
|
193
|
-
<div
|
194
|
-
style={{
|
195
|
-
width: '100%',
|
196
|
-
height: '110vh',
|
197
|
-
display: 'flex',
|
198
|
-
justifyContent: 'space-between',
|
199
|
-
flexDirection: 'column',
|
200
|
-
alignItems: 'center',
|
201
|
-
}}
|
202
|
-
>
|
203
|
-
<div
|
204
|
-
style={{
|
205
|
-
width: '100%',
|
206
|
-
display: 'flex',
|
207
|
-
justifyContent: 'space-between',
|
208
|
-
}}
|
209
|
-
>
|
210
|
-
<Button ref={ref1}>Блок 1</Button>
|
211
|
-
<Button ref={ref2}>Блок 2</Button>
|
212
|
-
</div>
|
213
|
-
<Button onClick={() => setOpen(true)}>Запуск тура</Button>
|
214
|
-
|
215
|
-
<div
|
216
|
-
style={{
|
217
|
-
width: '100%',
|
218
|
-
display: 'flex',
|
219
|
-
justifyContent: 'space-between',
|
220
|
-
}}
|
221
|
-
>
|
222
|
-
<Button ref={ref3}>Блок 3</Button>
|
223
|
-
<Button ref={ref4}>Блок 4</Button>
|
224
|
-
</div>
|
225
|
-
|
226
|
-
<Tour
|
227
|
-
{...args}
|
228
|
-
open={open}
|
229
|
-
current={current}
|
230
|
-
onClose={() => {
|
231
|
-
setCurrent(0);
|
232
|
-
setOpen(false);
|
233
|
-
}}
|
234
|
-
steps={steps}
|
235
|
-
/>
|
236
|
-
</div>
|
237
|
-
);
|
238
|
-
};
|
239
|
-
|
240
|
-
export const Default: StoryObj = {
|
241
|
-
render: (args) => <StoryDefault {...args} />,
|
242
|
-
};
|
@@ -1,232 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var _Mask;
|
3
|
-
var _excluded = ["steps", "current", "defaultCurrent", "open", "defaultOpen", "onClose", "withOverlay", "overlayColor", "zIndex", "view", "size", "shift", "offset", "highlightOffset", "className"];
|
4
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
5
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
6
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
9
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
10
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
11
|
-
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."); }
|
12
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
13
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
14
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
15
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
16
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
17
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
18
|
-
import React, { forwardRef, useCallback, useEffect, useState, useRef, useMemo } from 'react';
|
19
|
-
import { createPortal } from 'react-dom';
|
20
|
-
import { useFloating, offset, flip, shift, autoUpdate } from '@floating-ui/react-dom';
|
21
|
-
import { canUseDOM } from "../../utils";
|
22
|
-
import { getHTMLElement, getIncreasedRadius, findRootElement } from "./utils";
|
23
|
-
import { MaskContainer, Mask, Highlight, TourPortal } from "./Tour.styles";
|
24
|
-
import { base as viewCSS } from "./variatoins/_view/base";
|
25
|
-
import { base as sizeCSS } from "./variatoins/_size/base";
|
26
|
-
import { classes, tokens } from "./Tour.tokens";
|
27
|
-
var TOUR_PORTAL_ID = 'plasma-tour-portal';
|
28
|
-
export var tourRoot = function tourRoot(Root) {
|
29
|
-
return /*#__PURE__*/forwardRef(function (_ref, outerRef) {
|
30
|
-
var steps = _ref.steps,
|
31
|
-
current = _ref.current,
|
32
|
-
_ref$defaultCurrent = _ref.defaultCurrent,
|
33
|
-
defaultCurrent = _ref$defaultCurrent === void 0 ? 0 : _ref$defaultCurrent,
|
34
|
-
open = _ref.open,
|
35
|
-
_ref$defaultOpen = _ref.defaultOpen,
|
36
|
-
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
|
37
|
-
onClose = _ref.onClose,
|
38
|
-
_ref$withOverlay = _ref.withOverlay,
|
39
|
-
withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay,
|
40
|
-
overlayColor = _ref.overlayColor,
|
41
|
-
_ref$zIndex = _ref.zIndex,
|
42
|
-
zIndex = _ref$zIndex === void 0 ? 9300 : _ref$zIndex,
|
43
|
-
view = _ref.view,
|
44
|
-
size = _ref.size,
|
45
|
-
_ref$shift = _ref.shift,
|
46
|
-
shiftProp = _ref$shift === void 0 ? 12 : _ref$shift,
|
47
|
-
_ref$offset = _ref.offset,
|
48
|
-
offsetProp = _ref$offset === void 0 ? 12 : _ref$offset,
|
49
|
-
_ref$highlightOffset = _ref.highlightOffset,
|
50
|
-
highlightOffset = _ref$highlightOffset === void 0 ? 4 : _ref$highlightOffset,
|
51
|
-
className = _ref.className,
|
52
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
53
|
-
var controlled = typeof current === 'number';
|
54
|
-
var controlledOpen = typeof open === 'boolean';
|
55
|
-
var _useState = useState(defaultCurrent),
|
56
|
-
_useState2 = _slicedToArray(_useState, 2),
|
57
|
-
innerCurrent = _useState2[0],
|
58
|
-
setInnerCurrent = _useState2[1];
|
59
|
-
var _useState3 = useState(defaultOpen),
|
60
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
61
|
-
innerOpen = _useState4[0],
|
62
|
-
setInnerOpen = _useState4[1];
|
63
|
-
var _useState5 = useState(null),
|
64
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
65
|
-
highlightRect = _useState6[0],
|
66
|
-
setHighlightRect = _useState6[1];
|
67
|
-
var _useState7 = useState(null),
|
68
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
69
|
-
highlightBorderRadius = _useState8[0],
|
70
|
-
setHighlightBorderRadius = _useState8[1];
|
71
|
-
var _useState9 = useState(null),
|
72
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
73
|
-
targetElement = _useState10[0],
|
74
|
-
setTargetElement = _useState10[1];
|
75
|
-
var portalRef = useRef(null);
|
76
|
-
var floatingRef = useRef(null);
|
77
|
-
var active = controlled ? current : innerCurrent;
|
78
|
-
var isOpen = controlledOpen ? open : innerOpen;
|
79
|
-
var currentStep = steps[active];
|
80
|
-
var placement = useMemo(function () {
|
81
|
-
if (!currentStep) return 'bottom';
|
82
|
-
if (Array.isArray(currentStep.placement)) {
|
83
|
-
return currentStep.placement[0] || 'bottom';
|
84
|
-
}
|
85
|
-
return currentStep.placement || 'bottom';
|
86
|
-
}, [currentStep]);
|
87
|
-
var middleware = useMemo(function () {
|
88
|
-
return [offset(offsetProp), flip({
|
89
|
-
fallbackPlacements: Array.isArray(currentStep === null || currentStep === void 0 ? void 0 : currentStep.placement) ? currentStep.placement : undefined
|
90
|
-
}), shift({
|
91
|
-
padding: shiftProp
|
92
|
-
})];
|
93
|
-
}, [currentStep === null || currentStep === void 0 ? void 0 : currentStep.placement]);
|
94
|
-
var _useFloating = useFloating({
|
95
|
-
placement: placement,
|
96
|
-
middleware: middleware,
|
97
|
-
whileElementsMounted: autoUpdate
|
98
|
-
}),
|
99
|
-
refs = _useFloating.refs,
|
100
|
-
floatingStyles = _useFloating.floatingStyles,
|
101
|
-
calculatedPlacement = _useFloating.placement;
|
102
|
-
useEffect(function () {
|
103
|
-
refs.setReference(targetElement);
|
104
|
-
}, [refs, targetElement]);
|
105
|
-
var setOpen = useCallback(function (val) {
|
106
|
-
if (!controlledOpen) {
|
107
|
-
setInnerOpen(val);
|
108
|
-
}
|
109
|
-
if (!val) {
|
110
|
-
onClose === null || onClose === void 0 || onClose();
|
111
|
-
setInnerCurrent(0);
|
112
|
-
setHighlightRect(null);
|
113
|
-
setTargetElement(null);
|
114
|
-
}
|
115
|
-
}, [controlledOpen, onClose]);
|
116
|
-
var handleClose = function handleClose() {
|
117
|
-
return setOpen(false);
|
118
|
-
};
|
119
|
-
var updateHighlight = useCallback(function () {
|
120
|
-
if (!isOpen || !currentStep) return;
|
121
|
-
var rootItem = findRootElement(currentStep.target);
|
122
|
-
var highlightElement = getHTMLElement(rootItem);
|
123
|
-
var borderRadius = currentStep.borderRadius === 'fixed' ? "var(".concat(tokens.highlightRadius, ")") : getIncreasedRadius(rootItem, highlightOffset);
|
124
|
-
setHighlightBorderRadius(borderRadius);
|
125
|
-
if (highlightElement) {
|
126
|
-
var rect = highlightElement.getBoundingClientRect();
|
127
|
-
setHighlightRect(rect);
|
128
|
-
setTargetElement(highlightElement);
|
129
|
-
} else {
|
130
|
-
setHighlightRect(null);
|
131
|
-
setTargetElement(null);
|
132
|
-
}
|
133
|
-
}, [isOpen, currentStep]);
|
134
|
-
useEffect(function () {
|
135
|
-
if (!canUseDOM) return;
|
136
|
-
var portal = document.getElementById(TOUR_PORTAL_ID);
|
137
|
-
if (!portal) {
|
138
|
-
portal = document.createElement('div');
|
139
|
-
portal.setAttribute('id', TOUR_PORTAL_ID);
|
140
|
-
document.body.appendChild(portal);
|
141
|
-
}
|
142
|
-
portalRef.current = portal;
|
143
|
-
return function () {
|
144
|
-
if (portal && portal.childNodes.length === 0) {
|
145
|
-
portal.remove();
|
146
|
-
}
|
147
|
-
};
|
148
|
-
}, []);
|
149
|
-
useEffect(function () {
|
150
|
-
updateHighlight();
|
151
|
-
var handleUpdate = function handleUpdate() {
|
152
|
-
updateHighlight();
|
153
|
-
};
|
154
|
-
window.addEventListener('resize', handleUpdate);
|
155
|
-
window.addEventListener('scroll', handleUpdate, true);
|
156
|
-
return function () {
|
157
|
-
window.removeEventListener('resize', handleUpdate);
|
158
|
-
window.removeEventListener('scroll', handleUpdate, true);
|
159
|
-
};
|
160
|
-
}, [updateHighlight]);
|
161
|
-
useEffect(function () {
|
162
|
-
if (!isOpen || !currentStep || !targetElement) return;
|
163
|
-
targetElement.scrollIntoView({
|
164
|
-
block: 'center',
|
165
|
-
inline: 'center',
|
166
|
-
behavior: 'smooth'
|
167
|
-
});
|
168
|
-
}, [isOpen, active, currentStep, targetElement]);
|
169
|
-
useEffect(function () {
|
170
|
-
var handleKeyDown = function handleKeyDown(e) {
|
171
|
-
if (e.key === 'Escape') {
|
172
|
-
handleClose();
|
173
|
-
}
|
174
|
-
};
|
175
|
-
if (isOpen) {
|
176
|
-
window.addEventListener('keydown', handleKeyDown);
|
177
|
-
}
|
178
|
-
return function () {
|
179
|
-
window.removeEventListener('keydown', handleKeyDown);
|
180
|
-
};
|
181
|
-
}, [isOpen]);
|
182
|
-
if (!currentStep || !canUseDOM || !portalRef.current) return null;
|
183
|
-
var tourContent = /*#__PURE__*/React.createElement(Root, _extends({
|
184
|
-
steps: steps,
|
185
|
-
ref: outerRef,
|
186
|
-
className: className,
|
187
|
-
view: view,
|
188
|
-
size: size
|
189
|
-
}, rest), isOpen && withOverlay && /*#__PURE__*/React.createElement(MaskContainer, {
|
190
|
-
className: classes.mask,
|
191
|
-
zIndex: zIndex,
|
192
|
-
"data-plasma-tour-mask": true
|
193
|
-
}, _Mask || (_Mask = /*#__PURE__*/React.createElement(Mask, null)), highlightRect && /*#__PURE__*/React.createElement(Highlight, {
|
194
|
-
overlayColor: overlayColor,
|
195
|
-
borderRadius: highlightBorderRadius,
|
196
|
-
style: {
|
197
|
-
left: highlightRect.left - highlightOffset,
|
198
|
-
top: highlightRect.top - highlightOffset,
|
199
|
-
width: highlightRect.width + highlightOffset * 2,
|
200
|
-
height: highlightRect.height + highlightOffset * 2
|
201
|
-
}
|
202
|
-
})), isOpen && targetElement && /*#__PURE__*/React.createElement(TourPortal, {
|
203
|
-
ref: function ref(node) {
|
204
|
-
refs.setFloating(node);
|
205
|
-
floatingRef.current = node;
|
206
|
-
},
|
207
|
-
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
208
|
-
zIndex: Number(zIndex)
|
209
|
-
}),
|
210
|
-
"data-placement": calculatedPlacement
|
211
|
-
}, currentStep.renderItem()));
|
212
|
-
return /*#__PURE__*/createPortal(tourContent, portalRef.current);
|
213
|
-
});
|
214
|
-
};
|
215
|
-
export var tourConfig = {
|
216
|
-
name: 'Tour',
|
217
|
-
tag: 'div',
|
218
|
-
layout: tourRoot,
|
219
|
-
base: '',
|
220
|
-
variations: {
|
221
|
-
view: {
|
222
|
-
css: viewCSS
|
223
|
-
},
|
224
|
-
size: {
|
225
|
-
css: sizeCSS
|
226
|
-
}
|
227
|
-
},
|
228
|
-
defaults: {
|
229
|
-
view: 'default',
|
230
|
-
size: 'm'
|
231
|
-
}
|
232
|
-
};
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
3
|
-
export var MaskContainer = /*#__PURE__*/_styled("div", {
|
4
|
-
target: "e1a1dgq93",
|
5
|
-
label: "plasma-new-hope__MaskContainer"
|
6
|
-
})("z-index:", function (_ref) {
|
7
|
-
var zIndex = _ref.zIndex;
|
8
|
-
return zIndex;
|
9
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRW9FIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBjb25zdCBNYXNrQ29udGFpbmVyID0gc3R5bGVkLmRpdjx7IHpJbmRleDogc3RyaW5nIHwgbnVtYmVyIH0+YFxuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleH07XG5gO1xuXG5leHBvcnQgY29uc3QgTWFzayA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGZpeGVkO1xuICAgIGluc2V0OiAwO1xuICAgIHBvaW50ZXItZXZlbnRzOiBhbGw7XG5gO1xuXG5leHBvcnQgY29uc3QgSGlnaGxpZ2h0ID0gc3R5bGVkLmRpdjx7IG92ZXJsYXlDb2xvcj86IHN0cmluZzsgYm9yZGVyUmFkaXVzPzogc3RyaW5nIHwgbnVsbCB9PmBcbiAgICAtLXByaXZhdGUtbWFzay1jb2xvcjogJHsoeyBvdmVybGF5Q29sb3IgfSkgPT4gYCR7b3ZlcmxheUNvbG9yIHx8ICdyZ2JhKDAsIDAsIDAsIDAuNDUpJ31gfTtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG4gICAgYm9yZGVyLXJhZGl1czogJHsoeyBib3JkZXJSYWRpdXMgfSkgPT4gYm9yZGVyUmFkaXVzID8/IDB9O1xuICAgIGJveC1zaGFkb3c6IDAgMCAwIDk5OTlweCB2YXIoLS1wcml2YXRlLW1hc2stY29sb3IpO1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICAgIHRyYW5zaXRpb246IGFsbCAwLjNzIGN1YmljLWJlemllcigwLjQsIDAsIDAuMiwgMSk7XG5gO1xuXG5leHBvcnQgY29uc3QgVG91clBvcnRhbCA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuYDtcbiJdfQ== */"));
|
10
|
-
export var Mask = /*#__PURE__*/_styled("div", {
|
11
|
-
target: "e1a1dgq92",
|
12
|
-
label: "plasma-new-hope__Mask"
|
13
|
-
})(process.env.NODE_ENV === "production" ? {
|
14
|
-
name: "xzntb4",
|
15
|
-
styles: "position:fixed;inset:0;pointer-events:all"
|
16
|
-
} : {
|
17
|
-
name: "xzntb4",
|
18
|
-
styles: "position:fixed;inset:0;pointer-events:all",
|
19
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTThCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBjb25zdCBNYXNrQ29udGFpbmVyID0gc3R5bGVkLmRpdjx7IHpJbmRleDogc3RyaW5nIHwgbnVtYmVyIH0+YFxuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleH07XG5gO1xuXG5leHBvcnQgY29uc3QgTWFzayA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGZpeGVkO1xuICAgIGluc2V0OiAwO1xuICAgIHBvaW50ZXItZXZlbnRzOiBhbGw7XG5gO1xuXG5leHBvcnQgY29uc3QgSGlnaGxpZ2h0ID0gc3R5bGVkLmRpdjx7IG92ZXJsYXlDb2xvcj86IHN0cmluZzsgYm9yZGVyUmFkaXVzPzogc3RyaW5nIHwgbnVsbCB9PmBcbiAgICAtLXByaXZhdGUtbWFzay1jb2xvcjogJHsoeyBvdmVybGF5Q29sb3IgfSkgPT4gYCR7b3ZlcmxheUNvbG9yIHx8ICdyZ2JhKDAsIDAsIDAsIDAuNDUpJ31gfTtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG4gICAgYm9yZGVyLXJhZGl1czogJHsoeyBib3JkZXJSYWRpdXMgfSkgPT4gYm9yZGVyUmFkaXVzID8/IDB9O1xuICAgIGJveC1zaGFkb3c6IDAgMCAwIDk5OTlweCB2YXIoLS1wcml2YXRlLW1hc2stY29sb3IpO1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICAgIHRyYW5zaXRpb246IGFsbCAwLjNzIGN1YmljLWJlemllcigwLjQsIDAsIDAuMiwgMSk7XG5gO1xuXG5leHBvcnQgY29uc3QgVG91clBvcnRhbCA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuYDtcbiJdfQ== */",
|
20
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
21
|
-
});
|
22
|
-
export var Highlight = /*#__PURE__*/_styled("div", {
|
23
|
-
target: "e1a1dgq91",
|
24
|
-
label: "plasma-new-hope__Highlight"
|
25
|
-
})("--private-mask-color:", function (_ref2) {
|
26
|
-
var overlayColor = _ref2.overlayColor;
|
27
|
-
return "".concat(overlayColor || 'rgba(0, 0, 0, 0.45)');
|
28
|
-
}, ";position:fixed;background:transparent;border-radius:", function (_ref3) {
|
29
|
-
var borderRadius = _ref3.borderRadius;
|
30
|
-
return borderRadius !== null && borderRadius !== void 0 ? borderRadius : 0;
|
31
|
-
}, ";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);" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWTRGIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBjb25zdCBNYXNrQ29udGFpbmVyID0gc3R5bGVkLmRpdjx7IHpJbmRleDogc3RyaW5nIHwgbnVtYmVyIH0+YFxuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleH07XG5gO1xuXG5leHBvcnQgY29uc3QgTWFzayA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGZpeGVkO1xuICAgIGluc2V0OiAwO1xuICAgIHBvaW50ZXItZXZlbnRzOiBhbGw7XG5gO1xuXG5leHBvcnQgY29uc3QgSGlnaGxpZ2h0ID0gc3R5bGVkLmRpdjx7IG92ZXJsYXlDb2xvcj86IHN0cmluZzsgYm9yZGVyUmFkaXVzPzogc3RyaW5nIHwgbnVsbCB9PmBcbiAgICAtLXByaXZhdGUtbWFzay1jb2xvcjogJHsoeyBvdmVybGF5Q29sb3IgfSkgPT4gYCR7b3ZlcmxheUNvbG9yIHx8ICdyZ2JhKDAsIDAsIDAsIDAuNDUpJ31gfTtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG4gICAgYm9yZGVyLXJhZGl1czogJHsoeyBib3JkZXJSYWRpdXMgfSkgPT4gYm9yZGVyUmFkaXVzID8/IDB9O1xuICAgIGJveC1zaGFkb3c6IDAgMCAwIDk5OTlweCB2YXIoLS1wcml2YXRlLW1hc2stY29sb3IpO1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICAgIHRyYW5zaXRpb246IGFsbCAwLjNzIGN1YmljLWJlemllcigwLjQsIDAsIDAuMiwgMSk7XG5gO1xuXG5leHBvcnQgY29uc3QgVG91clBvcnRhbCA9IHN0eWxlZC5kaXZgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuYDtcbiJdfQ== */"));
|
32
|
-
export var TourPortal = /*#__PURE__*/_styled("div", {
|
33
|
-
target: "e1a1dgq90",
|
34
|
-
label: "plasma-new-hope__TourPortal"
|
35
|
-
})(process.env.NODE_ENV === "production" ? {
|
36
|
-
name: "a4hmbt",
|
37
|
-
styles: "position:absolute"
|
38
|
-
} : {
|
39
|
-
name: "a4hmbt",
|
40
|
-
styles: "position:absolute",
|
41
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci9Ub3VyLnN0eWxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0JvQyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1RvdXIvVG91ci5zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5leHBvcnQgY29uc3QgTWFza0NvbnRhaW5lciA9IHN0eWxlZC5kaXY8eyB6SW5kZXg6IHN0cmluZyB8IG51bWJlciB9PmBcbiAgICB6LWluZGV4OiAkeyh7IHpJbmRleCB9KSA9PiB6SW5kZXh9O1xuYDtcblxuZXhwb3J0IGNvbnN0IE1hc2sgPSBzdHlsZWQuZGl2YFxuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICBpbnNldDogMDtcbiAgICBwb2ludGVyLWV2ZW50czogYWxsO1xuYDtcblxuZXhwb3J0IGNvbnN0IEhpZ2hsaWdodCA9IHN0eWxlZC5kaXY8eyBvdmVybGF5Q29sb3I/OiBzdHJpbmc7IGJvcmRlclJhZGl1cz86IHN0cmluZyB8IG51bGwgfT5gXG4gICAgLS1wcml2YXRlLW1hc2stY29sb3I6ICR7KHsgb3ZlcmxheUNvbG9yIH0pID0+IGAke292ZXJsYXlDb2xvciB8fCAncmdiYSgwLCAwLCAwLCAwLjQ1KSd9YH07XG4gICAgcG9zaXRpb246IGZpeGVkO1xuICAgIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50O1xuICAgIGJvcmRlci1yYWRpdXM6ICR7KHsgYm9yZGVyUmFkaXVzIH0pID0+IGJvcmRlclJhZGl1cyA/PyAwfTtcbiAgICBib3gtc2hhZG93OiAwIDAgMCA5OTk5cHggdmFyKC0tcHJpdmF0ZS1tYXNrLWNvbG9yKTtcbiAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICB0cmFuc2l0aW9uOiBhbGwgMC4zcyBjdWJpYy1iZXppZXIoMC40LCAwLCAwLjIsIDEpO1xuYDtcblxuZXhwb3J0IGNvbnN0IFRvdXJQb3J0YWwgPSBzdHlsZWQuZGl2YFxuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbmA7XG4iXX0= */",
|
42
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
43
|
-
});
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export var classes = {
|
2
|
-
mask: 'tour-mask'
|
3
|
-
};
|
4
|
-
export var tokens = {
|
5
|
-
cardPadding: '--plasma-tour-card-padding',
|
6
|
-
cardRadius: '--plasma-tour-card-radius',
|
7
|
-
cardBgColor: '--plasma-tour-card-bg',
|
8
|
-
cardShadow: '--plasma-tour-card-shadow',
|
9
|
-
maskBgColor: '--plasma-tour-mask-bg',
|
10
|
-
titleColor: '--plasma-tour-title-color',
|
11
|
-
descriptionColor: '--plasma-tour-description-color',
|
12
|
-
highlightRadius: '--plasma-tour-highlight-radius'
|
13
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,104 +0,0 @@
|
|
1
|
-
export var getHTMLElement = function getHTMLElement(target) {
|
2
|
-
if (!target) {
|
3
|
-
return null;
|
4
|
-
}
|
5
|
-
if (typeof target === 'string') {
|
6
|
-
return document.querySelector(target);
|
7
|
-
}
|
8
|
-
if ('current' in target) {
|
9
|
-
return target.current;
|
10
|
-
}
|
11
|
-
return target;
|
12
|
-
};
|
13
|
-
export var getIncreasedRadius = function getIncreasedRadius(ref, offset) {
|
14
|
-
if (!ref.current) {
|
15
|
-
return '';
|
16
|
-
}
|
17
|
-
var element = ref.current;
|
18
|
-
var computedStyle = getComputedStyle(element);
|
19
|
-
var borderRadiusComponent = computedStyle.getPropertyValue('--plasma-tour__border-radius');
|
20
|
-
var currentRadius = computedStyle.borderRadius !== undefined && computedStyle.borderRadius !== null && computedStyle.borderRadius !== '0px' ? computedStyle.borderRadius : borderRadiusComponent;
|
21
|
-
var parseValue = function parseValue(value, context) {
|
22
|
-
var num = parseFloat(value);
|
23
|
-
if (Number.isNaN(num)) return 0;
|
24
|
-
if (value.endsWith('px')) return num;
|
25
|
-
if (value.endsWith('%')) return num / 100 * context.width;
|
26
|
-
if (value.endsWith('em')) return num * parseFloat(computedStyle.fontSize);
|
27
|
-
if (value.endsWith('rem')) {
|
28
|
-
return num * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
29
|
-
}
|
30
|
-
if (value.endsWith('vw')) return num / 100 * window.innerWidth;
|
31
|
-
if (value.endsWith('vh')) return num / 100 * window.innerHeight;
|
32
|
-
if (value.endsWith('vmin')) return num / 100 * Math.min(window.innerWidth, window.innerHeight);
|
33
|
-
if (value.endsWith('vmax')) return num / 100 * Math.max(window.innerWidth, window.innerHeight);
|
34
|
-
return num;
|
35
|
-
};
|
36
|
-
var context = {
|
37
|
-
width: element.offsetWidth,
|
38
|
-
height: element.offsetHeight
|
39
|
-
};
|
40
|
-
var parseRadius = function parseRadius(radius) {
|
41
|
-
var parts = radius.split('/').map(function (part) {
|
42
|
-
return part.trim();
|
43
|
-
});
|
44
|
-
var horizontal = parts[0].split(/\s+/).map(function (val) {
|
45
|
-
return parseValue(val, context);
|
46
|
-
});
|
47
|
-
var normalize = function normalize(values) {
|
48
|
-
if (values.length === 1) return [values[0], values[0], values[0], values[0]];
|
49
|
-
if (values.length === 2) return [values[0], values[1], values[0], values[1]];
|
50
|
-
if (values.length === 3) return [values[0], values[1], values[2], values[1]];
|
51
|
-
return values.slice(0, 4);
|
52
|
-
};
|
53
|
-
return {
|
54
|
-
horizontal: normalize(horizontal),
|
55
|
-
vertical: parts[1] ? normalize(parts[1].split(/\s+/).map(function (val) {
|
56
|
-
return parseValue(val, context);
|
57
|
-
})) : normalize(horizontal)
|
58
|
-
};
|
59
|
-
};
|
60
|
-
try {
|
61
|
-
var parsed = parseRadius(currentRadius);
|
62
|
-
var newHorizontal = parsed.horizontal.map(function (val) {
|
63
|
-
return val !== 0 ? Math.max(0, val + offset) : 0;
|
64
|
-
});
|
65
|
-
var newVertical = parsed.vertical.map(function (val) {
|
66
|
-
return val !== 0 ? Math.max(0, val + offset) : 0;
|
67
|
-
});
|
68
|
-
var format = function format(values) {
|
69
|
-
return values.map(function (v) {
|
70
|
-
return "".concat(v, "px");
|
71
|
-
}).join(' ');
|
72
|
-
};
|
73
|
-
var horizontalStr = format(newHorizontal);
|
74
|
-
var verticalStr = format(newVertical);
|
75
|
-
return horizontalStr === verticalStr ? horizontalStr : "".concat(horizontalStr, " / ").concat(verticalStr);
|
76
|
-
} catch (error) {
|
77
|
-
return '';
|
78
|
-
}
|
79
|
-
};
|
80
|
-
export var findRootElement = function findRootElement(ref) {
|
81
|
-
var _currentElement;
|
82
|
-
if (!ref.current) {
|
83
|
-
return '';
|
84
|
-
}
|
85
|
-
var currentElement = ref.current;
|
86
|
-
while (currentElement !== null && currentElement !== document.documentElement) {
|
87
|
-
if (currentElement.hasAttribute('data-root')) {
|
88
|
-
return {
|
89
|
-
current: currentElement
|
90
|
-
};
|
91
|
-
}
|
92
|
-
var parent = currentElement.parentElement;
|
93
|
-
if (parent === null) {
|
94
|
-
break;
|
95
|
-
}
|
96
|
-
currentElement = parent;
|
97
|
-
}
|
98
|
-
if ((_currentElement = currentElement) !== null && _currentElement !== void 0 && _currentElement.hasAttribute('data-root')) {
|
99
|
-
return {
|
100
|
-
current: currentElement
|
101
|
-
};
|
102
|
-
}
|
103
|
-
return ref;
|
104
|
-
};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import { css } from '@emotion/react';
|
2
|
-
export var base = /*#__PURE__*/css(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci92YXJpYXRvaW5zL19zaXplL2Jhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRXVCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci92YXJpYXRvaW5zL19zaXplL2Jhc2UudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYGA7XG4iXX0= */"));
|
@@ -1 +0,0 @@
|
|
1
|
-
[]
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import { css } from '@emotion/react';
|
2
|
-
export var base = /*#__PURE__*/css(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci92YXJpYXRvaW5zL192aWV3L2Jhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRXVCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVG91ci92YXJpYXRvaW5zL192aWV3L2Jhc2UudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYGA7XG4iXX0= */"));
|
@@ -1 +0,0 @@
|
|
1
|
-
[]
|