@salutejs/plasma-new-hope 0.328.0-canary.2047.15880698675.0 → 0.328.0-canary.2047.15976223953.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 +5 -5
- 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/Autocomplete/Autocomplete.d.ts +1 -1
- package/types/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/types/components/Carousel/CarouselNew/Carousel.d.ts +1 -1
- package/types/components/Carousel/CarouselOld/Carousel.d.ts +1 -1
- package/types/components/Carousel/CarouselOld/Carousel.types.d.ts +1 -1
- package/types/components/CodeField/CodeField.d.ts +1 -1
- package/types/components/CodeInput/CodeInput.d.ts +1 -1
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts +1 -1
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.d.ts +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +2 -2
- package/types/components/Drawer/Drawer.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +1 -1
- package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts +1 -1
- package/types/components/Modal/Modal.d.ts +1 -1
- package/types/components/Popup/Popup.d.ts +1 -1
- package/types/components/Radiobox/Radiobox.d.ts +2 -2
- package/types/components/Segment/ui/SegmentGroup/SegmentGroup.d.ts +1 -1
- package/types/components/Segment/ui/SegmentItem/SegmentItem.d.ts +1 -1
- package/types/components/Select/Select.d.ts +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.styles.d.ts +1 -1
- package/types/components/Select/ui/Target/ui/Button/Button.styles.d.ts +2 -2
- package/types/components/Spinner/Spinner.d.ts +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.d.ts +1 -1
- 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 +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/Toast/ToastNew/ToastNew.d.ts +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
@@ -1,4 +1,4 @@
|
|
1
1
|
import { css } from "@emotion/react";
|
2
2
|
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
|
-
export var base = /*#__PURE__*/ css(Input, "{width:100%;font:inherit;letter-spacing:inherit;line-height:inherit;}", InputContainer, "{width:100%;font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");}", InputWrapper, "{height:var(", tokens.height, ");border-radius:var(", tokens.borderRadius, ");padding:var(", tokens.padding, ");&.", classes.hasChips, "{padding-top:var(", tokens.paddingWithChips, ");padding-bottom:var(", tokens.paddingWithChips, ");}&.", classes.hasEmptyContentLeft, "{padding-left:var(", tokens.paddingWithChips, ");}&.", classes.hasEmptyContentRight, "{padding-right:var(", tokens.paddingWithChips, ");}}", Label, ",&:not(.", classes.innerLabelPlacement, ") ", StyledOptionalText, "{font-family:var(", tokens.labelFontFamily, ");font-size:var(", tokens.labelFontSize, ");font-style:var(", tokens.labelFontStyle, ");font-weight:var(", tokens.labelFontWeight, ");letter-spacing:var(", tokens.labelLetterSpacing, ");line-height:var(", tokens.labelLineHeight, ");}", StyledHintWrapper, "{margin:var(", tokens.hintMargin, ");width:var(", tokens.hintTargetSize, ");height:var(", tokens.hintTargetSize, ");}", HintTargetWrapper, "{width:var(", tokens.hintTargetSize, ");height:var(", tokens.hintTargetSize, ");}", TitleCaption, "{font-family:var(", tokens.titleCaptionFontFamily, ");font-size:var(", tokens.titleCaptionFontSize, ");font-style:var(", tokens.titleCaptionFontStyle, ");font-weight:var(", tokens.titleCaptionFontWeight, ");letter-spacing:var(", tokens.titleCaptionLetterSpacing, ");line-height:var(", tokens.titleCaptionLineHeight, ");}", LeftHelper, "{margin-top:var(", tokens.leftHelperOffset, ");font-family:var(", tokens.leftHelperFontFamily, ");font-size:var(", tokens.leftHelperFontSize, ");font-style:var(", tokens.leftHelperFontStyle, ");font-weight:var(", tokens.leftHelperFontWeight, ");letter-spacing:var(", tokens.leftHelperLetterSpacing, ");line-height:var(", tokens.leftHelperLineHeight, ");}", StyledTextBefore, ",", StyledTextAfter, "{font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");}", StyledTextBefore, "{margin:var(", tokens.textBeforeMargin, ");}", StyledTextAfter, "{margin:var(", tokens.textAfterMargin, ");}", StyledContentRightWrapper, ".", classes.contentRightCompensationMargin, "{gap:var(", tokens.contentRightWrapperGap, ");margin:var(", tokens.contentRightWrapperMargin, ");", StyledContentRight, "{margin:var(", tokens.rightContentWithHintMargin, ");}}", "base", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
4
|
+
export var base = /*#__PURE__*/ css(tokens.tourBorderRadius, ":var(", tokens.borderRadius, ");", Input, "{width:100%;font:inherit;letter-spacing:inherit;line-height:inherit;}", InputContainer, "{width:100%;font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");}", InputWrapper, "{height:var(", tokens.height, ");border-radius:var(", tokens.borderRadius, ");padding:var(", tokens.padding, ");&.", classes.hasChips, "{padding-top:var(", tokens.paddingWithChips, ");padding-bottom:var(", tokens.paddingWithChips, ");}&.", classes.hasEmptyContentLeft, "{padding-left:var(", tokens.paddingWithChips, ");}&.", classes.hasEmptyContentRight, "{padding-right:var(", tokens.paddingWithChips, ");}}", Label, ",&:not(.", classes.innerLabelPlacement, ") ", StyledOptionalText, "{font-family:var(", tokens.labelFontFamily, ");font-size:var(", tokens.labelFontSize, ");font-style:var(", tokens.labelFontStyle, ");font-weight:var(", tokens.labelFontWeight, ");letter-spacing:var(", tokens.labelLetterSpacing, ");line-height:var(", tokens.labelLineHeight, ");}", StyledHintWrapper, "{margin:var(", tokens.hintMargin, ");width:var(", tokens.hintTargetSize, ");height:var(", tokens.hintTargetSize, ");}", HintTargetWrapper, "{width:var(", tokens.hintTargetSize, ");height:var(", tokens.hintTargetSize, ");}", TitleCaption, "{font-family:var(", tokens.titleCaptionFontFamily, ");font-size:var(", tokens.titleCaptionFontSize, ");font-style:var(", tokens.titleCaptionFontStyle, ");font-weight:var(", tokens.titleCaptionFontWeight, ");letter-spacing:var(", tokens.titleCaptionLetterSpacing, ");line-height:var(", tokens.titleCaptionLineHeight, ");}", LeftHelper, "{margin-top:var(", tokens.leftHelperOffset, ");font-family:var(", tokens.leftHelperFontFamily, ");font-size:var(", tokens.leftHelperFontSize, ");font-style:var(", tokens.leftHelperFontStyle, ");font-weight:var(", tokens.leftHelperFontWeight, ");letter-spacing:var(", tokens.leftHelperLetterSpacing, ");line-height:var(", tokens.leftHelperLineHeight, ");}", StyledTextBefore, ",", StyledTextAfter, "{font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");}", StyledTextBefore, "{margin:var(", tokens.textBeforeMargin, ");}", StyledTextAfter, "{margin:var(", tokens.textAfterMargin, ");}", StyledContentRightWrapper, ".", classes.contentRightCompensationMargin, "{gap:var(", tokens.contentRightWrapperGap, ");margin:var(", tokens.contentRightWrapperMargin, ");", StyledContentRight, "{margin:var(", tokens.rightContentWithHintMargin, ");}}", "base", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9UZXh0RmllbGQvdmFyaWF0aW9ucy9fc2l6ZS9iYXNlLnRzIiwic291cmNlcyI6WyJzcmMtZW1vdGlvbi9jb21wb25lbnRzL1RleHRGaWVsZC92YXJpYXRpb25zL19zaXplL2Jhc2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBjbGFzc2VzLCB0b2tlbnMgfSBmcm9tICcuLi8uLi9UZXh0RmllbGQudG9rZW5zJztcbmltcG9ydCB7XG4gICAgSGludFRhcmdldFdyYXBwZXIsXG4gICAgSW5wdXQsXG4gICAgSW5wdXRDb250YWluZXIsXG4gICAgSW5wdXRXcmFwcGVyLFxuICAgIExhYmVsLFxuICAgIExlZnRIZWxwZXIsXG4gICAgU3R5bGVkQ29udGVudFJpZ2h0LFxuICAgIFN0eWxlZENvbnRlbnRSaWdodFdyYXBwZXIsXG4gICAgU3R5bGVkSGludFdyYXBwZXIsXG4gICAgU3R5bGVkT3B0aW9uYWxUZXh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XG4gICAgfVxuXG4gICAgJHtTdHlsZWRDb250ZW50UmlnaHRXcmFwcGVyfS4ke2NsYXNzZXMuY29udGVudFJpZ2h0Q29tcGVuc2F0aW9uTWFyZ2lufSB7XG4gICAgICAgIGdhcDogdmFyKCR7dG9rZW5zLmNvbnRlbnRSaWdodFdyYXBwZXJHYXB9KTtcbiAgICAgICAgbWFyZ2luOiB2YXIoJHt0b2tlbnMuY29udGVudFJpZ2h0V3JhcHBlck1hcmdpbn0pO1xuXG4gICAgICAgICR7U3R5bGVkQ29udGVudFJpZ2h0fSB7XG4gICAgICAgICAgICBtYXJnaW46IHZhcigke3Rva2Vucy5yaWdodENvbnRlbnRXaXRoSGludE1hcmdpbn0pO1xuICAgICAgICB9XG4gICAgfVxuYDtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQm9CIn0= */");
|
@@ -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,26 @@
|
|
1
|
+
import styled from "@emotion/styled";
|
2
|
+
export var MaskContainer = /*#__PURE__*/ styled("div", {
|
3
|
+
target: "e21u2800",
|
4
|
+
label: "MaskContainer"
|
5
|
+
})("z-index:", function(param) {
|
6
|
+
var zIndex = param.zIndex;
|
7
|
+
return zIndex || 9000;
|
8
|
+
}, ";", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBDU1NQcm9wZXJ0aWVzIH0gZnJvbSAncmVhY3QnO1xuXG5leHBvcnQgY29uc3QgTWFza0NvbnRhaW5lciA9IHN0eWxlZC5kaXY8eyB6SW5kZXg6IENTU1Byb3BlcnRpZXNbJ3pJbmRleCddIH0+YFxuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleCB8fCA5MDAwfTtcbmA7XG5cbmV4cG9ydCBjb25zdCBNYXNrID0gc3R5bGVkLmRpdmBcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgaW5zZXQ6IDA7XG4gICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbmA7XG5cbmV4cG9ydCBjb25zdCBIaWdobGlnaHQgPSBzdHlsZWQuZGl2PHtcbiAgICBvdmVybGF5Q29sb3I/OiBDU1NQcm9wZXJ0aWVzWydjb2xvciddO1xuICAgIGJvcmRlclJhZGl1cz86IENTU1Byb3BlcnRpZXNbJ2JvcmRlclJhZGl1cyddIHwgbnVsbDtcbn0+YFxuICAgIC0tcHJpdmF0ZS1tYXNrLWNvbG9yOiAkeyh7IG92ZXJsYXlDb2xvciB9KSA9PiBgJHtvdmVybGF5Q29sb3IgfHwgJ3JnYmEoMCwgMCwgMCwgMC40NSknfWB9O1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICBiYWNrZ3JvdW5kOiB0cmFuc3BhcmVudDtcbiAgICBib3JkZXItcmFkaXVzOiAkeyh7IGJvcmRlclJhZGl1cyB9KSA9PiBib3JkZXJSYWRpdXMgPz8gMH07XG4gICAgYm94LXNoYWRvdzogMCAwIDAgOTk5OXB4IHZhcigtLXByaXZhdGUtbWFzay1jb2xvcik7XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgdHJhbnNpdGlvbjogYWxsIDAuM3MgY3ViaWMtYmV6aWVyKDAuNCwgMCwgMC4yLCAxKTtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb3VyUG9ydGFsID0gc3R5bGVkLmRpdmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG5gO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUc2QiJ9 */");
|
9
|
+
export var Mask = /*#__PURE__*/ styled("div", {
|
10
|
+
target: "e21u2801",
|
11
|
+
label: "Mask"
|
12
|
+
})("position:fixed;inset:0;pointer-events:all;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBDU1NQcm9wZXJ0aWVzIH0gZnJvbSAncmVhY3QnO1xuXG5leHBv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hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9vQiJ9 */");
|
13
|
+
export var Highlight = /*#__PURE__*/ styled("div", {
|
14
|
+
target: "e21u2802",
|
15
|
+
label: "Highlight"
|
16
|
+
})("--private-mask-color:", function(param) {
|
17
|
+
var overlayColor = param.overlayColor;
|
18
|
+
return "".concat(overlayColor || 'rgba(0, 0, 0, 0.45)');
|
19
|
+
}, ";position:fixed;background:transparent;border-radius:", function(param) {
|
20
|
+
var borderRadius = param.borderRadius;
|
21
|
+
return borderRadius !== null && borderRadius !== void 0 ? borderRadius : 0;
|
22
|
+
}, ";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);", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBDU1NQcm9wZXJ0aWVzIH0gZnJvbSAncmVhY3QnO1xuXG5leHBvcnQgY29uc3QgTWFza0NvbnRhaW5lciA9IHN0eWxlZC5kaXY8eyB6SW5kZXg6IENTU1Byb3BlcnRpZXNbJ3pJbmRleCddIH0+YFxuICAgIHotaW5kZXg6ICR7KHsgekluZGV4IH0pID0+IHpJbmRleCB8fCA5MDAwfTtcbmA7XG5cbmV4cG9ydCBjb25zdCBNYXNrID0gc3R5bGVkLmRpdmBcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgaW5zZXQ6IDA7XG4gICAgcG9pbnRlci1ldmVudHM6IGFsbDtcbmA7XG5cbmV4cG9ydCBjb25zdCBIaWdobGlnaHQgPSBzdHlsZWQuZGl2PHtcbiAgICBvdmVybGF5Q29sb3I/OiBDU1NQcm9wZXJ0aWVzWydjb2xvciddO1xuICAgIGJvcmRlclJhZGl1cz86IENTU1Byb3BlcnRpZXNbJ2JvcmRlclJhZGl1cyddIHwgbnVsbDtcbn0+YFxuICAgIC0tcHJpdmF0ZS1tYXNrLWNvbG9yOiAkeyh7IG92ZXJsYXlDb2xvciB9KSA9PiBgJHtvdmVybGF5Q29sb3IgfHwgJ3JnYmEoMCwgMCwgMCwgMC40NSknfWB9O1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICBiYWNrZ3JvdW5kOiB0cmFuc3BhcmVudDtcbiAgICBib3JkZXItcmFkaXVzOiAkeyh7IGJvcmRlclJhZGl1cyB9KSA9PiBib3JkZXJSYWRpdXMgPz8gMH07XG4gICAgYm94LXNoYWRvdzogMCAwIDAgOTk5OXB4IHZhcigtLXByaXZhdGUtbWFzay1jb2xvcik7XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgdHJhbnNpdGlvbjogYWxsIDAuM3MgY3ViaWMtYmV6aWVyKDAuNCwgMCwgMC4yLCAxKTtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb3VyUG9ydGFsID0gc3R5bGVkLmRpdmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG5gO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWF5QiJ9 */");
|
23
|
+
export var TourPortal = /*#__PURE__*/ styled("div", {
|
24
|
+
target: "e21u2803",
|
25
|
+
label: "TourPortal"
|
26
|
+
})("position:absolute;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL1RvdXIuc3R5bGVzLnRzeCJdLCJzb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aWVyKDAuNCwgMCwgMC4yLCAxKTtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb3VyUG9ydGFsID0gc3R5bGVkLmRpdmBcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG5gO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCMEIifQ== */");
|
@@ -0,0 +1,13 @@
|
|
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
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { };
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { canUseDOM } from "../../../utils";
|
2
|
+
export var TOUR_FINDER_MARK = 'data-tour';
|
3
|
+
export var ROOT_COMPONENT = 'data-root';
|
4
|
+
export var TOUR_BORDER_RADIUS_TOKEN = '--plasma-tour__border-radius';
|
5
|
+
export var getHTMLElement = function(target) {
|
6
|
+
if (!target || !canUseDOM) {
|
7
|
+
return null;
|
8
|
+
}
|
9
|
+
if (typeof target === 'string') {
|
10
|
+
return document.querySelector(target);
|
11
|
+
}
|
12
|
+
if ('current' in target) {
|
13
|
+
return target.current;
|
14
|
+
}
|
15
|
+
return target;
|
16
|
+
};
|
17
|
+
export var getIncreasedRadius = function(ref, offset) {
|
18
|
+
if (!ref.current) {
|
19
|
+
return '';
|
20
|
+
}
|
21
|
+
var element = ref.current;
|
22
|
+
var computedStyle = getComputedStyle(element);
|
23
|
+
var borderRadiusComponent = computedStyle.getPropertyValue(TOUR_BORDER_RADIUS_TOKEN);
|
24
|
+
var currentRadius = computedStyle.borderRadius !== undefined && computedStyle.borderRadius !== null && computedStyle.borderRadius !== '0px' ? computedStyle.borderRadius : borderRadiusComponent;
|
25
|
+
var parseValue = function(value, context) {
|
26
|
+
var num = parseFloat(value);
|
27
|
+
if (Number.isNaN(num)) return 0;
|
28
|
+
if (value.endsWith('px')) return num;
|
29
|
+
if (value.endsWith('%')) return num / 100 * context.width;
|
30
|
+
if (value.endsWith('em')) return num * parseFloat(computedStyle.fontSize);
|
31
|
+
if (value.endsWith('rem')) {
|
32
|
+
return num * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
33
|
+
}
|
34
|
+
if (value.endsWith('vw')) return num / 100 * window.innerWidth;
|
35
|
+
if (value.endsWith('vh')) return num / 100 * window.innerHeight;
|
36
|
+
if (value.endsWith('vmin')) return num / 100 * Math.min(window.innerWidth, window.innerHeight);
|
37
|
+
if (value.endsWith('vmax')) return num / 100 * Math.max(window.innerWidth, window.innerHeight);
|
38
|
+
return num;
|
39
|
+
};
|
40
|
+
var context = {
|
41
|
+
width: element.offsetWidth,
|
42
|
+
height: element.offsetHeight
|
43
|
+
};
|
44
|
+
var parseRadius = function(radius) {
|
45
|
+
var parts = radius.split('/').map(function(part) {
|
46
|
+
return part.trim();
|
47
|
+
});
|
48
|
+
var horizontal = parts[0].split(/\s+/).map(function(val) {
|
49
|
+
return parseValue(val, context);
|
50
|
+
});
|
51
|
+
var normalize = function(values) {
|
52
|
+
if (values.length === 1) return [
|
53
|
+
values[0],
|
54
|
+
values[0],
|
55
|
+
values[0],
|
56
|
+
values[0]
|
57
|
+
];
|
58
|
+
if (values.length === 2) return [
|
59
|
+
values[0],
|
60
|
+
values[1],
|
61
|
+
values[0],
|
62
|
+
values[1]
|
63
|
+
];
|
64
|
+
if (values.length === 3) return [
|
65
|
+
values[0],
|
66
|
+
values[1],
|
67
|
+
values[2],
|
68
|
+
values[1]
|
69
|
+
];
|
70
|
+
return values.slice(0, 4);
|
71
|
+
};
|
72
|
+
return {
|
73
|
+
horizontal: normalize(horizontal),
|
74
|
+
vertical: parts[1] ? normalize(parts[1].split(/\s+/).map(function(val) {
|
75
|
+
return parseValue(val, context);
|
76
|
+
})) : normalize(horizontal)
|
77
|
+
};
|
78
|
+
};
|
79
|
+
try {
|
80
|
+
var parsed = parseRadius(currentRadius);
|
81
|
+
var newHorizontal = parsed.horizontal.map(function(val) {
|
82
|
+
return val !== 0 ? Math.max(0, val + offset) : 0;
|
83
|
+
});
|
84
|
+
var newVertical = parsed.vertical.map(function(val) {
|
85
|
+
return val !== 0 ? Math.max(0, val + offset) : 0;
|
86
|
+
});
|
87
|
+
var format = function(values) {
|
88
|
+
return values.map(function(v) {
|
89
|
+
return "".concat(v, "px");
|
90
|
+
}).join(' ');
|
91
|
+
};
|
92
|
+
var horizontalStr = format(newHorizontal);
|
93
|
+
var verticalStr = format(newVertical);
|
94
|
+
return horizontalStr === verticalStr ? horizontalStr : "".concat(horizontalStr, " / ").concat(verticalStr);
|
95
|
+
} catch (error) {
|
96
|
+
return '';
|
97
|
+
}
|
98
|
+
};
|
99
|
+
export var findRootElement = function(ref) {
|
100
|
+
if (!ref.current) {
|
101
|
+
return '';
|
102
|
+
}
|
103
|
+
var currentElement = ref.current;
|
104
|
+
if (!(currentElement === null || currentElement === void 0 ? void 0 : currentElement.hasAttribute(TOUR_FINDER_MARK))) {
|
105
|
+
return {
|
106
|
+
current: currentElement
|
107
|
+
};
|
108
|
+
}
|
109
|
+
while(currentElement !== null && currentElement !== document.documentElement){
|
110
|
+
if (currentElement.hasAttribute(ROOT_COMPONENT)) {
|
111
|
+
return {
|
112
|
+
current: currentElement
|
113
|
+
};
|
114
|
+
}
|
115
|
+
var parent = currentElement.parentElement;
|
116
|
+
if (parent === null) {
|
117
|
+
break;
|
118
|
+
}
|
119
|
+
currentElement = parent;
|
120
|
+
}
|
121
|
+
if (currentElement === null || currentElement === void 0 ? void 0 : currentElement.hasAttribute(ROOT_COMPONENT)) {
|
122
|
+
return {
|
123
|
+
current: currentElement
|
124
|
+
};
|
125
|
+
}
|
126
|
+
return ref;
|
127
|
+
};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { css } from "@emotion/react";
|
2
|
+
export var base = /*#__PURE__*/ css("base", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL3ZhcmlhdG9pbnMvX3NpemUvYmFzZS50cyIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL3ZhcmlhdG9pbnMvX3NpemUvYmFzZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYGA7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRW9CIn0= */");
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { css } from "@emotion/react";
|
2
|
+
export var base = /*#__PURE__*/ css("base", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL3ZhcmlhdG9pbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXMiOlsic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub3VyL3ZhcmlhdG9pbnMvX3ZpZXcvYmFzZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYGA7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRW9CIn0= */");
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { css } from "@emotion/react";
|
2
|
+
import { tokens } from "../../../../components/Tour/Tour.tokens";
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'accent',
|
6
|
+
size: 's'
|
7
|
+
},
|
8
|
+
variations: {
|
9
|
+
view: {
|
10
|
+
default: /*#__PURE__*/ css("default", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vZXhhbXBsZXMvcGxhc21hX2IyYy9jb21wb25lbnRzL1RvdXIvVG91ci5jb25maWcudHMiLCJzb3VyY2VzIjpbInNyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9Ub3VyL1RvdXIuY29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vLi4vLi4vY29tcG9uZW50cy9Ub3VyL1RvdXIudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnYWNjZW50JyxcbiAgICAgICAgc2l6ZTogJ3MnLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmNhcmRQYWRkaW5nfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5jYXJkUmFkaXVzfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5oaWdobGlnaHRSYWRpdXN9OiAwLjc1cmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXcUIifQ== */")
|
11
|
+
},
|
12
|
+
size: {
|
13
|
+
s: /*#__PURE__*/ css(tokens.cardPadding, ":0.75rem;", tokens.cardRadius, ":0.75rem;", tokens.highlightRadius, ":0.75rem;", "s", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vZXhhbXBsZXMvcGxhc21hX2IyYy9jb21wb25lbnRzL1RvdXIvVG91ci5jb25maWcudHMiLCJzb3VyY2VzIjpbInNyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV9iMmMvY29tcG9uZW50cy9Ub3VyL1RvdXIuY29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vLi4vLi4vY29tcG9uZW50cy9Ub3VyL1RvdXIudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnYWNjZW50JyxcbiAgICAgICAgc2l6ZTogJ3MnLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmNhcmRQYWRkaW5nfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5jYXJkUmFkaXVzfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5oaWdobGlnaHRSYWRpdXN9OiAwLjc1cmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjZSJ9 */")
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { css } from "@emotion/react";
|
2
|
+
import { tokens } from "../../../../components/Tour/Tour.tokens";
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'accent',
|
6
|
+
size: 's'
|
7
|
+
},
|
8
|
+
variations: {
|
9
|
+
view: {
|
10
|
+
default: /*#__PURE__*/ css("default", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vZXhhbXBsZXMvcGxhc21hX3dlYi9jb21wb25lbnRzL1RvdXIvVG91ci5jb25maWcudHMiLCJzb3VyY2VzIjpbInNyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9Ub3VyL1RvdXIuY29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vLi4vLi4vY29tcG9uZW50cy9Ub3VyL1RvdXIudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnYWNjZW50JyxcbiAgICAgICAgc2l6ZTogJ3MnLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmNhcmRQYWRkaW5nfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5jYXJkUmFkaXVzfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5oaWdobGlnaHRSYWRpdXN9OiAwLjc1cmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXcUIifQ== */")
|
11
|
+
},
|
12
|
+
size: {
|
13
|
+
s: /*#__PURE__*/ css(tokens.cardPadding, ":0.75rem;", tokens.cardRadius, ":0.75rem;", tokens.highlightRadius, ":0.75rem;", "s", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vZXhhbXBsZXMvcGxhc21hX3dlYi9jb21wb25lbnRzL1RvdXIvVG91ci5jb25maWcudHMiLCJzb3VyY2VzIjpbInNyYy1lbW90aW9uL2V4YW1wbGVzL3BsYXNtYV93ZWIvY29tcG9uZW50cy9Ub3VyL1RvdXIuY29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vLi4vLi4vY29tcG9uZW50cy9Ub3VyL1RvdXIudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGNvbmZpZyA9IHtcbiAgICBkZWZhdWx0czoge1xuICAgICAgICB2aWV3OiAnYWNjZW50JyxcbiAgICAgICAgc2l6ZTogJ3MnLFxuICAgIH0sXG4gICAgdmFyaWF0aW9uczoge1xuICAgICAgICB2aWV3OiB7XG4gICAgICAgICAgICBkZWZhdWx0OiBjc3NgYCxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgczogY3NzYFxuICAgICAgICAgICAgICAgICR7dG9rZW5zLmNhcmRQYWRkaW5nfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5jYXJkUmFkaXVzfTogMC43NXJlbTtcbiAgICAgICAgICAgICAgICAke3Rva2Vucy5oaWdobGlnaHRSYWRpdXN9OiAwLjc1cmVtO1xuICAgICAgICAgICAgYCxcbiAgICAgICAgfSxcbiAgICB9LFxufTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjZSJ9 */")
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
package/emotion/es/index.js
CHANGED