intergalactic 15.82.2-prerelease.6 → 15.83.0-prerelease.1
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/CHANGELOG.md +9 -1
- package/accordion/lib/cjs/Accordion.js +7 -7
- package/accordion/lib/es6/Accordion.js +7 -7
- package/animation/lib/cjs/Animation.js +11 -11
- package/animation/lib/cjs/Collapse.js +28 -28
- package/animation/lib/cjs/FadeInOut.js +28 -28
- package/animation/lib/cjs/Scale.js +28 -28
- package/animation/lib/cjs/Slide.js +28 -28
- package/animation/lib/cjs/Transform.js +28 -28
- package/animation/lib/es6/Animation.js +11 -11
- package/animation/lib/es6/Collapse.js +28 -28
- package/animation/lib/es6/FadeInOut.js +28 -28
- package/animation/lib/es6/Scale.js +28 -28
- package/animation/lib/es6/Slide.js +28 -28
- package/animation/lib/es6/Transform.js +28 -28
- package/badge/lib/cjs/Badge.js +6 -6
- package/badge/lib/es6/Badge.js +6 -6
- package/base-trigger/lib/cjs/BaseTrigger.js +18 -18
- package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
- package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
- package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
- package/base-trigger/lib/es6/BaseTrigger.js +18 -18
- package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
- package/base-trigger/lib/es6/FilterTrigger.js +7 -7
- package/base-trigger/lib/es6/LinkTrigger.js +12 -12
- package/breadcrumbs/lib/cjs/Breadcrumbs.js +6 -6
- package/breadcrumbs/lib/es6/Breadcrumbs.js +6 -6
- package/button/lib/cjs/Button.js +26 -26
- package/button/lib/es6/Button.js +26 -26
- package/card/lib/cjs/Card.js +8 -8
- package/card/lib/es6/Card.js +8 -8
- package/carousel/lib/cjs/Carousel.js +19 -19
- package/carousel/lib/es6/Carousel.js +19 -19
- package/checkbox/lib/cjs/Checkbox.js +18 -18
- package/checkbox/lib/es6/Checkbox.js +18 -18
- package/color-picker/lib/cjs/ColorPicker.js +23 -23
- package/color-picker/lib/cjs/PaletteManager.js +23 -23
- package/color-picker/lib/cjs/components/InputColor.js +23 -23
- package/color-picker/lib/es6/ColorPicker.js +23 -23
- package/color-picker/lib/es6/PaletteManager.js +23 -23
- package/color-picker/lib/es6/components/InputColor.js +23 -23
- package/components.json +72 -72
- package/counter/lib/cjs/Counter.js +10 -10
- package/counter/lib/es6/Counter.js +10 -10
- package/data-table/lib/cjs/DataTable.js +37 -37
- package/data-table/lib/es6/DataTable.js +37 -37
- package/date-picker/lib/cjs/components/Calendar.js +21 -21
- package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/cjs/components/InputTrigger.js +29 -29
- package/date-picker/lib/cjs/components/PickerAbstract.js +29 -29
- package/date-picker/lib/cjs/components/RangePickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/Calendar.js +21 -21
- package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/es6/components/InputTrigger.js +29 -29
- package/date-picker/lib/es6/components/PickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/RangePickerAbstract.js +29 -29
- package/divider/lib/cjs/Divider.js +9 -9
- package/divider/lib/es6/Divider.js +9 -9
- package/dot/lib/cjs/Dot.js +10 -10
- package/dot/lib/es6/Dot.js +10 -10
- package/drag-and-drop/lib/cjs/DragAndDrop.js +16 -16
- package/drag-and-drop/lib/es6/DragAndDrop.js +16 -16
- package/dropdown/lib/cjs/Dropdown.js +2 -2
- package/dropdown/lib/es6/Dropdown.js +2 -2
- package/dropdown-menu/lib/cjs/DropdownMenu.js +18 -16
- package/dropdown-menu/lib/cjs/DropdownMenu.js.map +1 -1
- package/dropdown-menu/lib/cjs/styleScrollArea.js +6 -6
- package/dropdown-menu/lib/es6/DropdownMenu.js +18 -16
- package/dropdown-menu/lib/es6/DropdownMenu.js.map +1 -1
- package/dropdown-menu/lib/es6/styleScrollArea.js +6 -6
- package/ellipsis/lib/cjs/Ellipsis.js +10 -10
- package/ellipsis/lib/es6/Ellipsis.js +10 -10
- package/errors/lib/cjs/Error.js +9 -9
- package/errors/lib/es6/Error.js +9 -9
- package/feature-popover/lib/cjs/FeaturePopover.js +10 -10
- package/feature-popover/lib/es6/FeaturePopover.js +10 -10
- package/feedback-form/lib/cjs/FeedbackForm.js +7 -7
- package/feedback-form/lib/es6/FeedbackForm.js +7 -7
- package/flags/lib/cjs/Flags.js +3 -3
- package/flags/lib/es6/Flags.js +3 -3
- package/flags/lib/sprites/sprite@1x.css +256 -256
- package/flags/lib/sprites/sprite@2x.css +257 -257
- package/flex-box/lib/cjs/Box/useBox.js +3 -3
- package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
- package/flex-box/lib/cjs/invalid-state-box/InvalidStateBox.js +2 -2
- package/flex-box/lib/es6/Box/useBox.js +3 -3
- package/flex-box/lib/es6/Flex/useFlex.js +3 -3
- package/flex-box/lib/es6/invalid-state-box/InvalidStateBox.js +2 -2
- package/format-text/lib/cjs/FormatText.js +5 -5
- package/format-text/lib/es6/FormatText.js +5 -5
- package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
- package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
- package/grid/lib/cjs/Grid.js +114 -114
- package/grid/lib/es6/Grid.js +114 -114
- package/icon/color/Confluence/l/index.js +4 -4
- package/icon/color/Confluence/l/index.mjs +4 -4
- package/icon/color/Confluence/m/index.js +4 -4
- package/icon/color/Confluence/m/index.mjs +4 -4
- package/icon/color/MicrosoftOffice/l/index.js +10 -10
- package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
- package/icon/color/MicrosoftOffice/m/index.js +10 -10
- package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
- package/icon/lib/cjs/Icon.js +5 -5
- package/icon/lib/es6/Icon.js +5 -5
- package/icon/pay/Discover/l/index.js +1 -1
- package/icon/pay/Discover/l/index.mjs +1 -1
- package/icon/pay/Discover/m/index.js +1 -1
- package/icon/pay/Discover/m/index.mjs +1 -1
- package/icon/pay/JCB/l/index.js +10 -10
- package/icon/pay/JCB/l/index.mjs +10 -10
- package/icon/pay/JCB/m/index.js +10 -10
- package/icon/pay/JCB/m/index.mjs +10 -10
- package/icon/pay/Visa/l/index.js +2 -2
- package/icon/pay/Visa/l/index.mjs +2 -2
- package/icon/pay/Visa/m/index.js +2 -2
- package/icon/pay/Visa/m/index.mjs +2 -2
- package/illustration/lib/cjs/index.js +1 -1
- package/illustration/lib/es6/index.js +1 -1
- package/inline-edit/lib/cjs/InlineEdit.js +4 -4
- package/inline-edit/lib/es6/InlineEdit.js +4 -4
- package/inline-input/lib/cjs/InlineInput.js +18 -18
- package/inline-input/lib/es6/InlineInput.js +18 -18
- package/input/lib/cjs/Input.js +17 -17
- package/input/lib/es6/Input.js +17 -17
- package/input-mask/lib/cjs/InputMask.js +6 -6
- package/input-mask/lib/es6/InputMask.js +6 -6
- package/input-number/lib/cjs/InputNumber.js +9 -9
- package/input-number/lib/es6/InputNumber.js +9 -9
- package/input-tags/lib/cjs/InputTags.js +12 -12
- package/input-tags/lib/es6/InputTags.js +12 -12
- package/link/lib/cjs/Link.js +12 -12
- package/link/lib/es6/Link.js +12 -12
- package/mini-chart/lib/cjs/component/score/Donut.js +9 -9
- package/mini-chart/lib/cjs/component/score/Line.js +17 -17
- package/mini-chart/lib/cjs/component/trend/Bar.js +7 -7
- package/mini-chart/lib/cjs/component/trend/Line.js +7 -7
- package/mini-chart/lib/es6/component/score/Donut.js +9 -9
- package/mini-chart/lib/es6/component/score/Line.js +17 -17
- package/mini-chart/lib/es6/component/trend/Bar.js +7 -7
- package/mini-chart/lib/es6/component/trend/Line.js +7 -7
- package/modal/lib/cjs/Modal.js +9 -9
- package/modal/lib/es6/Modal.js +9 -9
- package/notice/lib/cjs/Notice.js +13 -13
- package/notice/lib/es6/Notice.js +13 -13
- package/notice-bubble/lib/cjs/NoticeBubble.js +12 -12
- package/notice-bubble/lib/es6/NoticeBubble.js +12 -12
- package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
- package/notice-global/lib/es6/NoticeGlobal.js +11 -11
- package/package.json +1 -1
- package/pagination/lib/cjs/Pagination.js +10 -10
- package/pagination/lib/es6/Pagination.js +10 -10
- package/pills/lib/cjs/Pills.js +13 -13
- package/pills/lib/es6/Pills.js +13 -13
- package/popper/lib/cjs/Popper.js +6 -6
- package/popper/lib/es6/Popper.js +6 -6
- package/product-head/lib/cjs/Info.js +4 -4
- package/product-head/lib/cjs/ProductHead.js +5 -5
- package/product-head/lib/cjs/Title.js +4 -4
- package/product-head/lib/es6/Info.js +4 -4
- package/product-head/lib/es6/ProductHead.js +5 -5
- package/product-head/lib/es6/Title.js +4 -4
- package/progress-bar/lib/cjs/ProgressBar.js +15 -15
- package/progress-bar/lib/es6/ProgressBar.js +15 -15
- package/radio/lib/cjs/Radio.js +16 -16
- package/radio/lib/es6/Radio.js +16 -16
- package/scroll-area/lib/cjs/ScrollArea.js +21 -21
- package/scroll-area/lib/cjs/ScrollBar.js +6 -6
- package/scroll-area/lib/es6/ScrollArea.js +21 -21
- package/scroll-area/lib/es6/ScrollBar.js +6 -6
- package/select/lib/cjs/InputSearch.js +6 -6
- package/select/lib/cjs/Select.js +8 -8
- package/select/lib/es6/InputSearch.js +6 -6
- package/select/lib/es6/Select.js +8 -8
- package/side-panel/lib/cjs/SidePanel.js +15 -15
- package/side-panel/lib/es6/SidePanel.js +15 -15
- package/skeleton/lib/cjs/Charts/Area.js +9 -9
- package/skeleton/lib/cjs/Charts/Bar.js +9 -9
- package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
- package/skeleton/lib/cjs/Charts/Donut.js +9 -9
- package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
- package/skeleton/lib/cjs/Charts/Line.js +9 -9
- package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
- package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/cjs/Charts/Venn.js +9 -9
- package/skeleton/lib/cjs/Skeleton.js +8 -8
- package/skeleton/lib/es6/Charts/Area.js +9 -9
- package/skeleton/lib/es6/Charts/Bar.js +9 -9
- package/skeleton/lib/es6/Charts/Bubble.js +9 -9
- package/skeleton/lib/es6/Charts/Donut.js +9 -9
- package/skeleton/lib/es6/Charts/Histogram.js +9 -9
- package/skeleton/lib/es6/Charts/Line.js +9 -9
- package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
- package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/es6/Charts/Venn.js +9 -9
- package/skeleton/lib/es6/Skeleton.js +8 -8
- package/slider/lib/cjs/Slider.js +8 -8
- package/slider/lib/es6/Slider.js +8 -8
- package/spin/lib/cjs/Spin.js +13 -13
- package/spin/lib/es6/Spin.js +13 -13
- package/spin-container/lib/cjs/SpinContainer.js +8 -8
- package/spin-container/lib/es6/SpinContainer.js +8 -8
- package/sticky/lib/cjs/Sticky.js +2 -2
- package/sticky/lib/es6/Sticky.js +2 -2
- package/switch/lib/cjs/Switch.js +21 -21
- package/switch/lib/es6/Switch.js +21 -21
- package/tab-line/lib/cjs/TabLine.js +13 -13
- package/tab-line/lib/es6/TabLine.js +13 -13
- package/tab-panel/lib/cjs/TabPanel.js +8 -8
- package/tab-panel/lib/es6/TabPanel.js +8 -8
- package/tag/lib/cjs/Tag.js +20 -20
- package/tag/lib/es6/Tag.js +20 -20
- package/textarea/lib/cjs/Textarea.js +8 -8
- package/textarea/lib/es6/Textarea.js +8 -8
- package/time-picker/lib/cjs/TimePicker.js +12 -12
- package/time-picker/lib/es6/TimePicker.js +12 -12
- package/tooltip/lib/cjs/Tooltip.js +9 -9
- package/tooltip/lib/es6/Tooltip.js +9 -9
- package/typography/lib/cjs/Blockquote.js +4 -4
- package/typography/lib/cjs/Hint.js +7 -7
- package/typography/lib/cjs/List.js +5 -5
- package/typography/lib/cjs/Text.js +34 -34
- package/typography/lib/es6/Blockquote.js +4 -4
- package/typography/lib/es6/Hint.js +7 -7
- package/typography/lib/es6/List.js +5 -5
- package/typography/lib/es6/Text.js +34 -34
- package/utils/lib/ThemeProvider.js +2 -2
- package/utils/lib/ThemeProvider.js.map +1 -1
- package/utils/lib/ThemeProvider.mjs +1 -1
- package/utils/lib/ThemeProvider.mjs.map +1 -1
- package/utils/lib/addonTextChildren.js +4 -4
- package/utils/lib/addonTextChildren.js.map +1 -1
- package/utils/lib/addonTextChildren.mjs +1 -1
- package/utils/lib/addonTextChildren.mjs.map +1 -1
- package/utils/lib/assignProps.js +2 -2
- package/utils/lib/assignProps.js.map +1 -1
- package/utils/lib/assignProps.mjs +1 -1
- package/utils/lib/assignProps.mjs.map +1 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +2 -2
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +2 -2
- package/utils/lib/core/enhancement/style.js +2 -2
- package/utils/lib/core/enhancement/style.js.map +1 -1
- package/utils/lib/core/enhancement/style.mjs +1 -1
- package/utils/lib/core/enhancement/style.mjs.map +1 -1
- package/utils/lib/core/index.d.ts +2 -2
- package/utils/lib/core/index.js +8 -8
- package/utils/lib/core/index.js.map +1 -1
- package/utils/lib/core/index.mjs +2 -2
- package/utils/lib/core/index.mjs.map +1 -1
- package/utils/lib/core/types/Component.d.ts +1 -1
- package/utils/lib/core/types/Component.js.map +1 -1
- package/utils/lib/core/types/Component.mjs.map +1 -1
- package/utils/lib/findComponent.js +6 -6
- package/utils/lib/findComponent.js.map +1 -1
- package/utils/lib/findComponent.mjs +1 -1
- package/utils/lib/findComponent.mjs.map +1 -1
- package/utils/lib/getOriginChildren.js +2 -2
- package/utils/lib/getOriginChildren.js.map +1 -1
- package/utils/lib/getOriginChildren.mjs +1 -1
- package/utils/lib/getOriginChildren.mjs.map +1 -1
- package/utils/lib/if.d.ts +1 -1
- package/utils/lib/if.js.map +1 -1
- package/utils/lib/if.mjs.map +1 -1
- package/utils/lib/injectStyle.js +1 -1
- package/utils/lib/injectStyle.mjs +1 -1
- package/utils/lib/uniqueID.d.ts +1 -1
- package/utils/lib/uniqueID.js +3 -3
- package/utils/lib/uniqueID.js.map +1 -1
- package/utils/lib/uniqueID.mjs +1 -1
- package/utils/lib/uniqueID.mjs.map +1 -1
- package/widget-empty/lib/cjs/WidgetEmpty.js +5 -5
- package/widget-empty/lib/es6/WidgetEmpty.js +5 -5
- package/wizard/lib/cjs/Wizard.js +11 -11
- package/wizard/lib/es6/Wizard.js +11 -11
@@ -5,40 +5,40 @@ import React from 'react';
|
|
5
5
|
import { createBaseComponent, Root, sstyled } from 'intergalactic/core';
|
6
6
|
import { Box } from 'intergalactic/flex-box';
|
7
7
|
/*__reshadow-styles__:"./style/text.shadow.css"*/
|
8
|
-
var styles = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
9
|
-
"__SText": "
|
10
|
-
"_size_100": "
|
11
|
-
"_size_200": "
|
12
|
-
"_size_300": "
|
13
|
-
"_size_400": "
|
14
|
-
"_size_500": "
|
15
|
-
"_size_600": "
|
16
|
-
"_size_700": "
|
17
|
-
"_size_800": "
|
18
|
-
"_noWrap": "
|
19
|
-
"_medium": "
|
20
|
-
"_semibold": "
|
21
|
-
"_bold": "
|
22
|
-
"_italic": "
|
23
|
-
"_monospace": "
|
24
|
-
"_uppercase": "
|
25
|
-
"_lowercase": "
|
26
|
-
"_capitalize": "
|
27
|
-
"_decoration": "
|
28
|
-
"--decoration": "--
|
29
|
-
"_color": "
|
30
|
-
"--color": "--
|
31
|
-
"_fontSize": "
|
32
|
-
"--fontSize": "--
|
33
|
-
"_lineHeight": "
|
34
|
-
"--lineHeight": "--
|
35
|
-
"_fontWeight": "
|
36
|
-
"--fontWeight": "--
|
37
|
-
"_textAlign": "
|
38
|
-
"--textAlign": "--
|
39
|
-
"_use_primary": "
|
40
|
-
"_use_secondary": "
|
41
|
-
"_disabled": "
|
8
|
+
var styles = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SText_1ipgq_gg_{padding:0;margin:0}.___SText_1ipgq_gg_._size_100_1ipgq_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%)}.___SText_1ipgq_gg_._size_200_1ipgq_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SText_1ipgq_gg_._size_300_1ipgq_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SText_1ipgq_gg_._size_400_1ipgq_gg_{font-size:var(--intergalactic-fs-400, 20px);line-height:var(--intergalactic-lh-400, 120%)}.___SText_1ipgq_gg_._size_500_1ipgq_gg_{font-size:var(--intergalactic-fs-500, 24px);line-height:var(--intergalactic-lh-500, 117%)}.___SText_1ipgq_gg_._size_600_1ipgq_gg_{font-size:var(--intergalactic-fs-600, 32px);line-height:var(--intergalactic-lh-600, 125%)}.___SText_1ipgq_gg_._size_700_1ipgq_gg_{font-size:var(--intergalactic-fs-700, 36px);line-height:var(--intergalactic-lh-700, 110%)}.___SText_1ipgq_gg_._size_800_1ipgq_gg_{font-size:var(--intergalactic-fs-800, 48px);line-height:var(--intergalactic-lh-800, 117%)}.___SText_1ipgq_gg_.__noWrap_1ipgq_gg_{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SText_1ipgq_gg_.__medium_1ipgq_gg_{font-weight:var(--intergalactic-medium, 500)}.___SText_1ipgq_gg_.__semibold_1ipgq_gg_{font-weight:var(--intergalactic-semi-bold, 600)}.___SText_1ipgq_gg_.__bold_1ipgq_gg_{font-weight:var(--intergalactic-bold, 700)}.___SText_1ipgq_gg_.__italic_1ipgq_gg_{font-style:italic}.___SText_1ipgq_gg_.__monospace_1ipgq_gg_{font-family:Consolas,\"Roboto Mono\",Menlo,Courier,monospace}.___SText_1ipgq_gg_.__uppercase_1ipgq_gg_{text-transform:uppercase}.___SText_1ipgq_gg_.__lowercase_1ipgq_gg_{text-transform:lowercase}.___SText_1ipgq_gg_.__capitalize_1ipgq_gg_{text-transform:capitalize}.___SText_1ipgq_gg_.__decoration_1ipgq_gg_{-webkit-text-decoration:var(--decoration_1ipgq);text-decoration:var(--decoration_1ipgq)}.___SText_1ipgq_gg_.__color_1ipgq_gg_{color:var(--color_1ipgq)}.___SText_1ipgq_gg_.__fontSize_1ipgq_gg_{font-size:var(--fontSize_1ipgq)}.___SText_1ipgq_gg_.__lineHeight_1ipgq_gg_{line-height:var(--lineHeight_1ipgq)}.___SText_1ipgq_gg_.__fontWeight_1ipgq_gg_{font-weight:var(--fontWeight_1ipgq)}.___SText_1ipgq_gg_.__textAlign_1ipgq_gg_{text-align:var(--textAlign_1ipgq)}.___SText_1ipgq_gg_._use_primary_1ipgq_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SText_1ipgq_gg_._use_secondary_1ipgq_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SText_1ipgq_gg_.__disabled_1ipgq_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3)}" /*__inner_css_end__*/, "1ipgq_gg_") /*__reshadow_css_end__*/, {
|
9
|
+
"__SText": "___SText_1ipgq_gg_",
|
10
|
+
"_size_100": "_size_100_1ipgq_gg_",
|
11
|
+
"_size_200": "_size_200_1ipgq_gg_",
|
12
|
+
"_size_300": "_size_300_1ipgq_gg_",
|
13
|
+
"_size_400": "_size_400_1ipgq_gg_",
|
14
|
+
"_size_500": "_size_500_1ipgq_gg_",
|
15
|
+
"_size_600": "_size_600_1ipgq_gg_",
|
16
|
+
"_size_700": "_size_700_1ipgq_gg_",
|
17
|
+
"_size_800": "_size_800_1ipgq_gg_",
|
18
|
+
"_noWrap": "__noWrap_1ipgq_gg_",
|
19
|
+
"_medium": "__medium_1ipgq_gg_",
|
20
|
+
"_semibold": "__semibold_1ipgq_gg_",
|
21
|
+
"_bold": "__bold_1ipgq_gg_",
|
22
|
+
"_italic": "__italic_1ipgq_gg_",
|
23
|
+
"_monospace": "__monospace_1ipgq_gg_",
|
24
|
+
"_uppercase": "__uppercase_1ipgq_gg_",
|
25
|
+
"_lowercase": "__lowercase_1ipgq_gg_",
|
26
|
+
"_capitalize": "__capitalize_1ipgq_gg_",
|
27
|
+
"_decoration": "__decoration_1ipgq_gg_",
|
28
|
+
"--decoration": "--decoration_1ipgq",
|
29
|
+
"_color": "__color_1ipgq_gg_",
|
30
|
+
"--color": "--color_1ipgq",
|
31
|
+
"_fontSize": "__fontSize_1ipgq_gg_",
|
32
|
+
"--fontSize": "--fontSize_1ipgq",
|
33
|
+
"_lineHeight": "__lineHeight_1ipgq_gg_",
|
34
|
+
"--lineHeight": "--lineHeight_1ipgq",
|
35
|
+
"_fontWeight": "__fontWeight_1ipgq_gg_",
|
36
|
+
"--fontWeight": "--fontWeight_1ipgq",
|
37
|
+
"_textAlign": "__textAlign_1ipgq_gg_",
|
38
|
+
"--textAlign": "--textAlign_1ipgq",
|
39
|
+
"_use_primary": "_use_primary_1ipgq_gg_",
|
40
|
+
"_use_secondary": "_use_secondary_1ipgq_gg_",
|
41
|
+
"_disabled": "__disabled_1ipgq_gg_"
|
42
42
|
});
|
43
43
|
import { useColorResolver } from 'intergalactic/utils/lib/use/useColorResolver';
|
44
44
|
function getTextDecoration(underline, lineThrough) {
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.useContextTokens = exports.useContextTheme = exports.contextThemeEnhance = exports.ThemeProvider = void 0;
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
|
-
var
|
10
|
+
var _index = require("./core/index");
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
12
12
|
var _ref4 = require("./ref");
|
13
13
|
var _useEnhancedEffect = _interopRequireDefault(require("./use/useEnhancedEffect"));
|
@@ -65,7 +65,7 @@ var ThemeProvider = function ThemeProvider(_ref3) {
|
|
65
65
|
}, [contextTokens, providedTokens]);
|
66
66
|
return /*#__PURE__*/_react["default"].createElement(themeContext.Provider, {
|
67
67
|
value: tokens
|
68
|
-
}, (0,
|
68
|
+
}, (0, _index.sstyled)()( /*#__PURE__*/_react["default"].createElement(SThemeProvider, {
|
69
69
|
style: tokens
|
70
70
|
}, children)));
|
71
71
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","names":["
|
1
|
+
{"version":3,"file":"ThemeProvider.js","names":["_index","require","_react","_interopRequireDefault","_ref4","_useEnhancedEffect","useContextTokens","React","useContext","themeContext","exports","useContextTheme","ref","available","tokens","tokensKey","useMemo","Object","entries","map","_ref","_ref2","_slicedToArray2","key","value","concat","join","useEnhancedEffect","undefined","current","style","setProperty","token","contextThemeEnhance","getAvailable","props","existingRef","values","enhanceRef","useRef","refArr","useForkRef","_objectSpread2","createContext","ThemeProvider","_ref3","_ref3$tokens","providedTokens","children","SThemeProvider","contextTokens","createElement","Provider","sstyled"],"sources":["../src/ThemeProvider.tsx"],"sourcesContent":["import { sstyled } from './core/index';\nimport React from 'react';\nimport { useForkRef } from './ref';\nimport useEnhancedEffect from './use/useEnhancedEffect';\n\ntype Tokens = { [tokenName: string]: string };\nexport type ThemeProviderProps = {\n tokens: Tokens;\n children: React.ReactNode;\n};\n\nexport const useContextTokens = () => React.useContext(themeContext);\n\nexport const useContextTheme = (ref: React.RefObject<HTMLElement>, available?: boolean) => {\n const tokens = useContextTokens();\n const tokensKey = React.useMemo(() => {\n if (!tokens) return '';\n return Object.entries(tokens)\n .map(([key, value]) => `${key}-${value}`)\n .join('/');\n }, [tokens]);\n useEnhancedEffect(() => {\n if (available !== undefined && !available) return;\n if (!ref.current || !ref.current.style || !ref.current.style.setProperty) return;\n for (const token in tokens) {\n ref.current.style.setProperty(token, tokens[token]);\n }\n }, [tokensKey, available]);\n};\nexport const contextThemeEnhance = (getAvailable?: (props: any) => boolean | undefined) => {\n return (props: any) => {\n const existingRef = props.ref;\n const available = React.useMemo(() => getAvailable?.(props), Object.values(props));\n const enhanceRef: any = React.useRef();\n const refArr: any = React.useMemo(\n () => (existingRef ? [existingRef, enhanceRef] : [enhanceRef]),\n [existingRef, enhanceRef],\n );\n const ref = useForkRef(refArr);\n useContextTheme(enhanceRef, available);\n\n return { ...props, ref };\n };\n};\n\nconst themeContext = React.createContext<Tokens | null>(null);\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n tokens: providedTokens = {},\n children,\n}) => {\n const SThemeProvider = 'div';\n const contextTokens = React.useContext(themeContext);\n const tokens = React.useMemo(\n () => (contextTokens === null ? providedTokens : { ...contextTokens, ...providedTokens }),\n [contextTokens, providedTokens],\n );\n\n return (\n <themeContext.Provider value={tokens}>\n {sstyled()(<SThemeProvider style={tokens}>{children}</SThemeProvider>)}\n </themeContext.Provider>\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAQO,IAAMK,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAA;EAAA,OAASC,iBAAK,CAACC,UAAU,CAACC,YAAY,CAAC;AAAA;AAACC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA;AAE9D,IAAMK,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAiC,EAAEC,SAAmB,EAAK;EACzF,IAAMC,MAAM,GAAGR,gBAAgB,EAAE;EACjC,IAAMS,SAAS,GAAGR,iBAAK,CAACS,OAAO,CAAC,YAAM;IACpC,IAAI,CAACF,MAAM,EAAE,OAAO,EAAE;IACtB,OAAOG,MAAM,CAACC,OAAO,CAACJ,MAAM,CAAC,CAC1BK,GAAG,CAAC,UAAAC,IAAA;MAAA,IAAAC,KAAA,OAAAC,eAAA,aAAAF,IAAA;QAAEG,GAAG,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MAAA,UAAAI,MAAA,C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EAACD,MAAM,CAAC;IAC9B7B,eAAe,CAAC2B,UAAU,EAAEzB,SAAS,CAAC;IAEtC,WAAA6B,cAAA,iBAAAA,cAAA,iBAAYP,KAAK;MAAEvB,GAAG,EAAHA;IAAG;EACxB,CAAC;AACH,CAAC;AAACF,OAAA,CAAAuB,mBAAA,GAAAA,mBAAA;AAEF,IAAMxB,YAAY,gBAAGF,iBAAK,CAACoC,aAAa,CAAgB,IAAI,CAAC;AAEtD,IAAMC,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,KAAA,EAGlD;EAAA,IAAAC,YAAA,GAAAD,KAAA,CAFJ/B,MAAM;IAAEiC,cAAc,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;IAC3BE,QAAQ,GAAAH,KAAA,CAARG,QAAQ;EAER,IAAMC,cAAc,GAAG,KAAK;EAC5B,IAAMC,aAAa,GAAG3C,iBAAK,CAACC,UAAU,CAACC,YAAY,CAAC;EACpD,IAAMK,MAAM,GAAGP,iBAAK,CAACS,OAAO,CAC1B;IAAA,OAAOkC,aAAa,KAAK,IAAI,GAAGH,cAAc,OAAAL,cAAA,iBAAAA,cAAA,iBAAQQ,aAAa,GAAKH,cAAc,CAAE;EAAA,CAAC,EACzF,CAACG,aAAa,EAAEH,cAAc,CAAC,CAChC;EAED,oBACE7C,MAAA,YAAAiD,aAAA,CAAC1C,YAAY,CAAC2C,QAAQ;IAAC5B,KAAK,EAAEV;EAAO,GAClC,IAAAuC,cAAO,GAAE,eAACnD,MAAA,YAAAiD,aAAA,CAACF,cAAc;IAACnB,KAAK,EAAEhB;EAAO,GAAEkC,QAAQ,CAAkB,CAAC,CAChD;AAE5B,CAAC;AAACtC,OAAA,CAAAkC,aAAA,GAAAA,aAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
import { sstyled } from "./core.mjs";
|
3
|
+
import { sstyled } from "./core/index.mjs";
|
4
4
|
import React from 'react';
|
5
5
|
import { useForkRef } from "./ref.mjs";
|
6
6
|
import useEnhancedEffect from "./use/useEnhancedEffect.mjs";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ThemeProvider.mjs","names":["sstyled","React","useForkRef","useEnhancedEffect","useContextTokens","useContext","themeContext","useContextTheme","ref","available","tokens","tokensKey","useMemo","Object","entries","map","_ref","_ref2","_slicedToArray","key","value","concat","join","undefined","current","style","setProperty","token","contextThemeEnhance","getAvailable","props","existingRef","values","enhanceRef","useRef","refArr","_objectSpread","createContext","ThemeProvider","_ref3","_ref3$tokens","providedTokens","children","SThemeProvider","contextTokens","createElement","Provider"],"sources":["../src/ThemeProvider.tsx"],"sourcesContent":["import { sstyled } from './core';\nimport React from 'react';\nimport { useForkRef } from './ref';\nimport useEnhancedEffect from './use/useEnhancedEffect';\n\ntype Tokens = { [tokenName: string]: string };\nexport type ThemeProviderProps = {\n tokens: Tokens;\n children: React.ReactNode;\n};\n\nexport const useContextTokens = () => React.useContext(themeContext);\n\nexport const useContextTheme = (ref: React.RefObject<HTMLElement>, available?: boolean) => {\n const tokens = useContextTokens();\n const tokensKey = React.useMemo(() => {\n if (!tokens) return '';\n return Object.entries(tokens)\n .map(([key, value]) => `${key}-${value}`)\n .join('/');\n }, [tokens]);\n useEnhancedEffect(() => {\n if (available !== undefined && !available) return;\n if (!ref.current || !ref.current.style || !ref.current.style.setProperty) return;\n for (const token in tokens) {\n ref.current.style.setProperty(token, tokens[token]);\n }\n }, [tokensKey, available]);\n};\nexport const contextThemeEnhance = (getAvailable?: (props: any) => boolean | undefined) => {\n return (props: any) => {\n const existingRef = props.ref;\n const available = React.useMemo(() => getAvailable?.(props), Object.values(props));\n const enhanceRef: any = React.useRef();\n const refArr: any = React.useMemo(\n () => (existingRef ? [existingRef, enhanceRef] : [enhanceRef]),\n [existingRef, enhanceRef],\n );\n const ref = useForkRef(refArr);\n useContextTheme(enhanceRef, available);\n\n return { ...props, ref };\n };\n};\n\nconst themeContext = React.createContext<Tokens | null>(null);\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n tokens: providedTokens = {},\n children,\n}) => {\n const SThemeProvider = 'div';\n const contextTokens = React.useContext(themeContext);\n const tokens = React.useMemo(\n () => (contextTokens === null ? providedTokens : { ...contextTokens, ...providedTokens }),\n [contextTokens, providedTokens],\n );\n\n return (\n <themeContext.Provider value={tokens}>\n {sstyled()(<SThemeProvider style={tokens}>{children}</SThemeProvider>)}\n </themeContext.Provider>\n ) as any;\n};\n"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,
|
1
|
+
{"version":3,"file":"ThemeProvider.mjs","names":["sstyled","React","useForkRef","useEnhancedEffect","useContextTokens","useContext","themeContext","useContextTheme","ref","available","tokens","tokensKey","useMemo","Object","entries","map","_ref","_ref2","_slicedToArray","key","value","concat","join","undefined","current","style","setProperty","token","contextThemeEnhance","getAvailable","props","existingRef","values","enhanceRef","useRef","refArr","_objectSpread","createContext","ThemeProvider","_ref3","_ref3$tokens","providedTokens","children","SThemeProvider","contextTokens","createElement","Provider"],"sources":["../src/ThemeProvider.tsx"],"sourcesContent":["import { sstyled } from './core/index';\nimport React from 'react';\nimport { useForkRef } from './ref';\nimport useEnhancedEffect from './use/useEnhancedEffect';\n\ntype Tokens = { [tokenName: string]: string };\nexport type ThemeProviderProps = {\n tokens: Tokens;\n children: React.ReactNode;\n};\n\nexport const useContextTokens = () => React.useContext(themeContext);\n\nexport const useContextTheme = (ref: React.RefObject<HTMLElement>, available?: boolean) => {\n const tokens = useContextTokens();\n const tokensKey = React.useMemo(() => {\n if (!tokens) return '';\n return Object.entries(tokens)\n .map(([key, value]) => `${key}-${value}`)\n .join('/');\n }, [tokens]);\n useEnhancedEffect(() => {\n if (available !== undefined && !available) return;\n if (!ref.current || !ref.current.style || !ref.current.style.setProperty) return;\n for (const token in tokens) {\n ref.current.style.setProperty(token, tokens[token]);\n }\n }, [tokensKey, available]);\n};\nexport const contextThemeEnhance = (getAvailable?: (props: any) => boolean | undefined) => {\n return (props: any) => {\n const existingRef = props.ref;\n const available = React.useMemo(() => getAvailable?.(props), Object.values(props));\n const enhanceRef: any = React.useRef();\n const refArr: any = React.useMemo(\n () => (existingRef ? [existingRef, enhanceRef] : [enhanceRef]),\n [existingRef, enhanceRef],\n );\n const ref = useForkRef(refArr);\n useContextTheme(enhanceRef, available);\n\n return { ...props, ref };\n };\n};\n\nconst themeContext = React.createContext<Tokens | null>(null);\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n tokens: providedTokens = {},\n children,\n}) => {\n const SThemeProvider = 'div';\n const contextTokens = React.useContext(themeContext);\n const tokens = React.useMemo(\n () => (contextTokens === null ? providedTokens : { ...contextTokens, ...providedTokens }),\n [contextTokens, providedTokens],\n );\n\n return (\n <themeContext.Provider value={tokens}>\n {sstyled()(<SThemeProvider style={tokens}>{children}</SThemeProvider>)}\n </themeContext.Provider>\n ) as any;\n};\n"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,kBAAc;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,WAAO;AAClC,OAAOC,iBAAiB,MAAM,6BAAyB;AAQvD,OAAO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAA;EAAA,OAASH,KAAK,CAACI,UAAU,CAACC,YAAY,CAAC;AAAA;AAEpE,OAAO,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAiC,EAAEC,SAAmB,EAAK;EACzF,IAAMC,MAAM,GAAGN,gBAAgB,EAAE;EACjC,IAAMO,SAAS,GAAGV,KAAK,CAACW,OAAO,CAAC,YAAM;IACpC,IAAI,CAACF,MAAM,EAAE,OAAO,EAAE;IACtB,OAAOG,MAAM,CAACC,OAAO,CAACJ,MAAM,CAAC,CAC1BK,GAAG,CAAC,UAAAC,IAAA;MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;QAAEG,G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AG,GAAGN,UAAU,CAACiC,MAAM,CAAC;IAC9B5B,eAAe,CAAC0B,UAAU,EAAExB,SAAS,CAAC;IAEtC,OAAA2B,aAAA,CAAAA,aAAA,KAAYN,KAAK;MAAEtB,GAAG,EAAHA;IAAG;EACxB,CAAC;AACH,CAAC;AAED,IAAMF,YAAY,gBAAGL,KAAK,CAACoC,aAAa,CAAgB,IAAI,CAAC;AAE7D,OAAO,IAAMC,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,KAAA,EAGlD;EAAA,IAAAC,YAAA,GAAAD,KAAA,CAFJ7B,MAAM;IAAE+B,cAAc,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;IAC3BE,QAAQ,GAAAH,KAAA,CAARG,QAAQ;EAER,IAAMC,cAAc,GAAG,KAAK;EAC5B,IAAMC,aAAa,GAAG3C,KAAK,CAACI,UAAU,CAACC,YAAY,CAAC;EACpD,IAAMI,MAAM,GAAGT,KAAK,CAACW,OAAO,CAC1B;IAAA,OAAOgC,aAAa,KAAK,IAAI,GAAGH,cAAc,GAAAL,aAAA,CAAAA,aAAA,KAAQQ,aAAa,GAAKH,cAAc,CAAE;EAAA,CAAC,EACzF,CAACG,aAAa,EAAEH,cAAc,CAAC,CAChC;EAED,oBACExC,KAAA,CAAA4C,aAAA,CAACvC,YAAY,CAACwC,QAAQ;IAAC1B,KAAK,EAAEV;EAAO,GAClCV,OAAO,EAAE,eAACC,KAAA,CAAA4C,aAAA,CAACF,cAAc;IAAClB,KAAK,EAAEf;EAAO,GAAEgC,QAAQ,CAAkB,CAAC,CAChD;AAE5B,CAAC"}
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports["default"] = void 0;
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
10
|
-
var
|
10
|
+
var _index = require("./core/index");
|
11
11
|
var _getOriginChildren = _interopRequireDefault(require("./getOriginChildren"));
|
12
12
|
var _isNode = _interopRequireDefault(require("./isNode"));
|
13
13
|
function addonTextChildren(Children, Text, Addon) {
|
@@ -22,16 +22,16 @@ function addonTextChildren(Children, Text, Addon) {
|
|
22
22
|
return _react["default"].Children.toArray(children).some(function (element) {
|
23
23
|
if (! /*#__PURE__*/_react["default"].isValidElement(element)) return false;
|
24
24
|
if (element.type === _react["default"].Fragment) return true;
|
25
|
-
if (element.type[
|
25
|
+
if (element.type[_index.CHILDREN_COMPONENT]) {
|
26
26
|
var wrapChildren = addonTextChildren(element.type, Text, Addon);
|
27
|
-
if (wrapChildren.type[
|
27
|
+
if (wrapChildren.type[_index.CHILDREN_COMPONENT]) {
|
28
28
|
return true;
|
29
29
|
} else {
|
30
30
|
element = wrapChildren;
|
31
31
|
}
|
32
32
|
}
|
33
33
|
// @ts-ignore
|
34
|
-
var inheritedNames = element.type[
|
34
|
+
var inheritedNames = element.type[_index.INHERITED_NAME] || [element.type.displayName];
|
35
35
|
var addonNames = Array.isArray(Addon) ? Addon.map(function (Component) {
|
36
36
|
return Component.displayName;
|
37
37
|
}) : [Addon.displayName];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addonTextChildren.js","names":["_react","_interopRequireDefault","require","
|
1
|
+
{"version":3,"file":"addonTextChildren.js","names":["_react","_interopRequireDefault","require","_index","_getOriginChildren","_isNode","addonTextChildren","Children","Text","Addon","isTextWrapIfEmptyChildren","arguments","length","undefined","children","getOriginChildren","createElement","isNode","React","toArray","some","element","isValidElement","type","Fragment","CHILDREN_COMPONENT","wrapChildren","inheritedNames","INHERITED_NAME","displayName","addonNames","Array","isArray","map","Component","concat","_toConsumableArray2","find","name","includes","_default","exports"],"sources":["../src/addonTextChildren.tsx"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core/index';\nimport getOriginChildren from './getOriginChildren';\nimport isNode from './isNode';\n\nfunction addonTextChildren(\n Children: any,\n Text: React.ComponentType<any>,\n Addon: React.ComponentType | React.ComponentType[],\n isTextWrapIfEmptyChildren = false,\n) {\n const children = getOriginChildren(Children);\n if (typeof children === 'function') {\n return <Children />;\n }\n\n if (!isTextWrapIfEmptyChildren && !isNode(children)) {\n return null;\n }\n return React.Children.toArray(children).some((element: any) => {\n if (!React.isValidElement(element)) return false;\n if (element.type === React.Fragment) return true;\n if ((element.type as any)[CHILDREN_COMPONENT]) {\n const wrapChildren: any = addonTextChildren(element.type, Text, Addon);\n if (wrapChildren.type[CHILDREN_COMPONENT]) {\n return true;\n } else {\n element = wrapChildren;\n }\n }\n // @ts-ignore\n const inheritedNames = element.type[INHERITED_NAME] || [element.type.displayName];\n const addonNames = Array.isArray(Addon)\n ? Addon.map((Component) => Component.displayName)\n : [Addon.displayName];\n return [Text.displayName, ...addonNames].find((name) => inheritedNames.includes(name));\n }) ? (\n <Children />\n ) : (\n <Text>\n <Children />\n </Text>\n );\n}\n\nexport default addonTextChildren;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,SAASI,iBAAiBA,CACxBC,QAAa,EACbC,IAA8B,EAC9BC,KAAkD,EAElD;EAAA,IADAC,yBAAyB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEjC,IAAMG,QAAQ,GAAG,IAAAC,6BAAiB,EAACR,QAAQ,CAAC;EAC5C,IAAI,OAAOO,QAAQ,KAAK,UAAU,EAAE;IAClC,oBAAOd,MAAA,YAAAgB,aAAA,CAACT,QAAQ,OAAG;EACrB;EAEA,IAAI,CAACG,yBAAyB,IAAI,CAAC,IAAAO,kBAAM,EAACH,QAAQ,CAAC,EAAE;IACnD,OAAO,IAAI;EACb;EAC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AD,QAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
2
2
|
import React from 'react';
|
3
|
-
import { CHILDREN_COMPONENT, INHERITED_NAME } from "./core.mjs";
|
3
|
+
import { CHILDREN_COMPONENT, INHERITED_NAME } from "./core/index.mjs";
|
4
4
|
import getOriginChildren from "./getOriginChildren.mjs";
|
5
5
|
import isNode from "./isNode.mjs";
|
6
6
|
function addonTextChildren(Children, Text, Addon) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addonTextChildren.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","isNode","addonTextChildren","Children","Text","Addon","isTextWrapIfEmptyChildren","arguments","length","undefined","children","createElement","toArray","some","element","isValidElement","type","Fragment","wrapChildren","inheritedNames","displayName","addonNames","Array","isArray","map","Component","concat","_toConsumableArray","find","name","includes"],"sources":["../src/addonTextChildren.tsx"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core';\nimport getOriginChildren from './getOriginChildren';\nimport isNode from './isNode';\n\nfunction addonTextChildren(\n Children: any,\n Text: React.ComponentType<any>,\n Addon: React.ComponentType | React.ComponentType[],\n isTextWrapIfEmptyChildren = false,\n) {\n const children = getOriginChildren(Children);\n if (typeof children === 'function') {\n return <Children />;\n }\n\n if (!isTextWrapIfEmptyChildren && !isNode(children)) {\n return null;\n }\n return React.Children.toArray(children).some((element: any) => {\n if (!React.isValidElement(element)) return false;\n if (element.type === React.Fragment) return true;\n if ((element.type as any)[CHILDREN_COMPONENT]) {\n const wrapChildren: any = addonTextChildren(element.type, Text, Addon);\n if (wrapChildren.type[CHILDREN_COMPONENT]) {\n return true;\n } else {\n element = wrapChildren;\n }\n }\n // @ts-ignore\n const inheritedNames = element.type[INHERITED_NAME] || [element.type.displayName];\n const addonNames = Array.isArray(Addon)\n ? Addon.map((Component) => Component.displayName)\n : [Addon.displayName];\n return [Text.displayName, ...addonNames].find((name) => inheritedNames.includes(name));\n }) ? (\n <Children />\n ) : (\n <Text>\n <Children />\n </Text>\n );\n}\n\nexport default addonTextChildren;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,
|
1
|
+
{"version":3,"file":"addonTextChildren.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","isNode","addonTextChildren","Children","Text","Addon","isTextWrapIfEmptyChildren","arguments","length","undefined","children","createElement","toArray","some","element","isValidElement","type","Fragment","wrapChildren","inheritedNames","displayName","addonNames","Array","isArray","map","Component","concat","_toConsumableArray","find","name","includes"],"sources":["../src/addonTextChildren.tsx"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core/index';\nimport getOriginChildren from './getOriginChildren';\nimport isNode from './isNode';\n\nfunction addonTextChildren(\n Children: any,\n Text: React.ComponentType<any>,\n Addon: React.ComponentType | React.ComponentType[],\n isTextWrapIfEmptyChildren = false,\n) {\n const children = getOriginChildren(Children);\n if (typeof children === 'function') {\n return <Children />;\n }\n\n if (!isTextWrapIfEmptyChildren && !isNode(children)) {\n return null;\n }\n return React.Children.toArray(children).some((element: any) => {\n if (!React.isValidElement(element)) return false;\n if (element.type === React.Fragment) return true;\n if ((element.type as any)[CHILDREN_COMPONENT]) {\n const wrapChildren: any = addonTextChildren(element.type, Text, Addon);\n if (wrapChildren.type[CHILDREN_COMPONENT]) {\n return true;\n } else {\n element = wrapChildren;\n }\n }\n // @ts-ignore\n const inheritedNames = element.type[INHERITED_NAME] || [element.type.displayName];\n const addonNames = Array.isArray(Addon)\n ? Addon.map((Component) => Component.displayName)\n : [Addon.displayName];\n return [Text.displayName, ...addonNames].find((name) => inheritedNames.includes(name));\n }) ? (\n <Children />\n ) : (\n <Text>\n <Children />\n </Text>\n );\n}\n\nexport default addonTextChildren;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAC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AAO,CAAClB,KAAK,CAAC,GACnCA,KAAK,CAACmB,GAAG,CAAC,UAACC,SAAS;MAAA,OAAKA,SAAS,CAACL,WAAW;IAAA,EAAC,GAC/C,CAACf,KAAK,CAACe,WAAW,CAAC;IACvB,OAAO,CAAChB,IAAI,CAACgB,WAAW,EAAAM,MAAA,CAAAC,kBAAA,CAAKN,UAAU,GAAEO,IAAI,CAAC,UAACC,IAAI;MAAA,OAAKV,cAAc,CAACW,QAAQ,CAACD,IAAI,CAAC;IAAA,EAAC;EACxF,CAAC,CAAC,gBACAhC,KAAA,CAAAc,aAAA,CAACR,QAAQ,OAAG,gBAEZN,KAAA,CAAAc,aAAA,CAACP,IAAI,qBACHP,KAAA,CAAAc,aAAA,CAACR,QAAQ,OAAG,CAEf;AACH;AAEA,eAAeD,iBAAiB"}
|
package/utils/lib/assignProps.js
CHANGED
@@ -9,7 +9,7 @@ exports.callAllEventHandlers = callAllEventHandlers;
|
|
9
9
|
exports["default"] = assignProps;
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
12
|
-
var
|
12
|
+
var _index = require("./core/index");
|
13
13
|
var _ref = require("./ref");
|
14
14
|
function callAllEventHandlers() {
|
15
15
|
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
@@ -86,7 +86,7 @@ function assignProps() {
|
|
86
86
|
newProps.className = (0, _classnames["default"])(props.className, source.className);
|
87
87
|
}
|
88
88
|
if (source.styles && props.styles) {
|
89
|
-
newProps.styles =
|
89
|
+
newProps.styles = _index.sstyled.merge(source.styles, props.styles);
|
90
90
|
}
|
91
91
|
return newProps;
|
92
92
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"assignProps.js","names":["_classnames","_interopRequireDefault","require","
|
1
|
+
{"version":3,"file":"assignProps.js","names":["_classnames","_interopRequireDefault","require","_index","_ref","callAllEventHandlers","_len","arguments","length","fns","Array","_key","_len2","args","_key2","some","fn","result","apply","assignHandlers","props","source","Object","keys","reduce","proxySource","propName","startsWith","assignHandlersInner","assignProps","undefined","newProps","_objectSpread2","key","originalKey","slice","sourceDescriptorRef","getOwnPropertyDescriptor","propsDescriptorRef","configurable","ref","forkRef","forwardRef","style","className","cn","styles","sstyled","merge"],"sources":["../src/assignProps.ts"],"sourcesContent":["import { CSSProperties, Ref } from 'react';\nimport cn from 'classnames';\nimport { sstyled } from './core/index';\nimport { forkRef } from './ref';\n\nexport function callAllEventHandlers(...fns: Array<Function | undefined>) {\n return (...args: any[]) =>\n !fns.some((fn) => {\n let result;\n if (fn) {\n result = fn(...args);\n }\n return typeof result === 'boolean' && !result;\n });\n}\n\nexport function assignHandlers(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (typeof source[propName] === 'function' && propName.startsWith('on')) {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n }\n return proxySource;\n }, {});\n}\n\nfunction assignHandlersInner(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (propName !== 'ref' && propName.startsWith('on')) {\n if (typeof source[propName] === 'function' && typeof props[propName] === 'function') {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n } else if (typeof source[propName] === 'function') {\n proxySource[propName] = source[propName];\n } else if (typeof props[propName] === 'function') {\n proxySource[propName] = props[propName];\n }\n }\n return proxySource;\n }, {});\n}\n\nexport interface AssignableProps {\n ref?: Ref<any>;\n style?: CSSProperties;\n className?: string;\n styles?: { [key: string]: string };\n\n [key: string]: any;\n}\n\nexport default function assignProps<P extends AssignableProps, S extends AssignableProps>(\n props: P = {} as P,\n source: S = {} as S,\n) {\n // @ts-ignore\n if (props === source) return props;\n const newProps = {\n ...source,\n ...props,\n ...assignHandlersInner(props, source),\n };\n for (const key in source) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = source[key];\n }\n }\n for (const key in props) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = props[key];\n }\n }\n\n // because react set getter for ref\n const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, 'ref');\n const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, 'ref');\n if (sourceDescriptorRef?.configurable && propsDescriptorRef?.configurable) {\n newProps.ref = forkRef(source.ref as any, props.ref as any);\n }\n\n if (props.forwardRef) {\n newProps.ref = forkRef(newProps.ref as any, props.forwardRef as any);\n newProps.forwardRef = newProps.ref;\n }\n\n if (source.style && props.style) {\n newProps.style = {\n ...source.style,\n ...props.style,\n };\n }\n\n if (source.className) {\n newProps.className = cn(props.className, source.className);\n }\n\n if (source.styles && props.styles) {\n newProps.styles = sstyled.merge(source.styles, props.styles);\n }\n\n return newProps;\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEO,SAASG,oBAAoBA,CAAA,EAAsC;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAlCC,GAAG,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAHF,GAAG,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EACzC,OAAO;IAAA,SAAAC,KAAA,GAAAL,SAAA,CAAAC,MAAA,EAAIK,IAAI,OAAAH,KAAA,CAAAE,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;MAAJD,IAAI,CAAAC,KAAA,IAAAP,SAAA,CAAAO,KAAA;IAAA;IAAA,OACb,CAACL,GAAG,CAACM,IAAI,CAAC,UAACC,EAAE,EAAK;MAChB,IAAIC,MAAM;MACV,IAAID,EAAE,EAAE;QACNC,MAAM,GAAGD,EAAE,CAAAE,KAAA,SAAIL,IAAI,CAAC;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AAC;EACxE,IAAIgB,mBAAmB,aAAnBA,mBAAmB,eAAnBA,mBAAmB,CAAEG,YAAY,IAAID,kBAAkB,aAAlBA,kBAAkB,eAAlBA,kBAAkB,CAAEC,YAAY,EAAE;IACzER,QAAQ,CAACS,GAAG,GAAG,IAAAC,YAAO,EAACpB,MAAM,CAACmB,GAAG,EAASpB,KAAK,CAACoB,GAAG,CAAQ;EAC7D;EAEA,IAAIpB,KAAK,CAACsB,UAAU,EAAE;IACpBX,QAAQ,CAACS,GAAG,GAAG,IAAAC,YAAO,EAACV,QAAQ,CAACS,GAAG,EAASpB,KAAK,CAACsB,UAAU,CAAQ;IACpEX,QAAQ,CAACW,UAAU,GAAGX,QAAQ,CAACS,GAAG;EACpC;EAEA,IAAInB,MAAM,CAACsB,KAAK,IAAIvB,KAAK,CAACuB,KAAK,EAAE;IAC/BZ,QAAQ,CAACY,KAAK,OAAAX,cAAA,iBAAAA,cAAA,iBACTX,MAAM,CAACsB,KAAK,GACZvB,KAAK,CAACuB,KAAK,CACf;EACH;EAEA,IAAItB,MAAM,CAACuB,SAAS,EAAE;IACpBb,QAAQ,CAACa,SAAS,GAAG,IAAAC,sBAAE,EAACzB,KAAK,CAACwB,SAAS,EAAEvB,MAAM,CAACuB,SAAS,CAAC;EAC5D;EAEA,IAAIvB,MAAM,CAACyB,MAAM,IAAI1B,KAAK,CAAC0B,MAAM,EAAE;IACjCf,QAAQ,CAACe,MAAM,GAAGC,cAAO,CAACC,KAAK,CAAC3B,MAAM,CAACyB,MAAM,EAAE1B,KAAK,CAAC0B,MAAM,CAAC;EAC9D;EAEA,OAAOf,QAAQ;AACjB"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
2
2
|
import cn from 'classnames';
|
3
|
-
import { sstyled } from "./core.mjs";
|
3
|
+
import { sstyled } from "./core/index.mjs";
|
4
4
|
import { forkRef } from "./ref.mjs";
|
5
5
|
export function callAllEventHandlers() {
|
6
6
|
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"assignProps.mjs","names":["cn","sstyled","forkRef","callAllEventHandlers","_len","arguments","length","fns","Array","_key","_len2","args","_key2","some","fn","result","apply","assignHandlers","props","source","Object","keys","reduce","proxySource","propName","startsWith","assignHandlersInner","assignProps","undefined","newProps","_objectSpread","key","originalKey","slice","sourceDescriptorRef","getOwnPropertyDescriptor","propsDescriptorRef","configurable","ref","forwardRef","style","className","styles","merge"],"sources":["../src/assignProps.ts"],"sourcesContent":["import { CSSProperties, Ref } from 'react';\nimport cn from 'classnames';\nimport { sstyled } from './core';\nimport { forkRef } from './ref';\n\nexport function callAllEventHandlers(...fns: Array<Function | undefined>) {\n return (...args: any[]) =>\n !fns.some((fn) => {\n let result;\n if (fn) {\n result = fn(...args);\n }\n return typeof result === 'boolean' && !result;\n });\n}\n\nexport function assignHandlers(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (typeof source[propName] === 'function' && propName.startsWith('on')) {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n }\n return proxySource;\n }, {});\n}\n\nfunction assignHandlersInner(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (propName !== 'ref' && propName.startsWith('on')) {\n if (typeof source[propName] === 'function' && typeof props[propName] === 'function') {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n } else if (typeof source[propName] === 'function') {\n proxySource[propName] = source[propName];\n } else if (typeof props[propName] === 'function') {\n proxySource[propName] = props[propName];\n }\n }\n return proxySource;\n }, {});\n}\n\nexport interface AssignableProps {\n ref?: Ref<any>;\n style?: CSSProperties;\n className?: string;\n styles?: { [key: string]: string };\n\n [key: string]: any;\n}\n\nexport default function assignProps<P extends AssignableProps, S extends AssignableProps>(\n props: P = {} as P,\n source: S = {} as S,\n) {\n // @ts-ignore\n if (props === source) return props;\n const newProps = {\n ...source,\n ...props,\n ...assignHandlersInner(props, source),\n };\n for (const key in source) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = source[key];\n }\n }\n for (const key in props) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = props[key];\n }\n }\n\n // because react set getter for ref\n const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, 'ref');\n const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, 'ref');\n if (sourceDescriptorRef?.configurable && propsDescriptorRef?.configurable) {\n newProps.ref = forkRef(source.ref as any, props.ref as any);\n }\n\n if (props.forwardRef) {\n newProps.ref = forkRef(newProps.ref as any, props.forwardRef as any);\n newProps.forwardRef = newProps.ref;\n }\n\n if (source.style && props.style) {\n newProps.style = {\n ...source.style,\n ...props.style,\n };\n }\n\n if (source.className) {\n newProps.className = cn(props.className, source.className);\n }\n\n if (source.styles && props.styles) {\n newProps.styles = sstyled.merge(source.styles, props.styles);\n }\n\n return newProps;\n}\n"],"mappings":";AACA,OAAOA,EAAE,MAAM,YAAY;AAC3B,SAASC,OAAO,QAAQ,
|
1
|
+
{"version":3,"file":"assignProps.mjs","names":["cn","sstyled","forkRef","callAllEventHandlers","_len","arguments","length","fns","Array","_key","_len2","args","_key2","some","fn","result","apply","assignHandlers","props","source","Object","keys","reduce","proxySource","propName","startsWith","assignHandlersInner","assignProps","undefined","newProps","_objectSpread","key","originalKey","slice","sourceDescriptorRef","getOwnPropertyDescriptor","propsDescriptorRef","configurable","ref","forwardRef","style","className","styles","merge"],"sources":["../src/assignProps.ts"],"sourcesContent":["import { CSSProperties, Ref } from 'react';\nimport cn from 'classnames';\nimport { sstyled } from './core/index';\nimport { forkRef } from './ref';\n\nexport function callAllEventHandlers(...fns: Array<Function | undefined>) {\n return (...args: any[]) =>\n !fns.some((fn) => {\n let result;\n if (fn) {\n result = fn(...args);\n }\n return typeof result === 'boolean' && !result;\n });\n}\n\nexport function assignHandlers(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (typeof source[propName] === 'function' && propName.startsWith('on')) {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n }\n return proxySource;\n }, {});\n}\n\nfunction assignHandlersInner(props: any, source: any) {\n return Object.keys(source).reduce((proxySource: any, propName) => {\n if (propName !== 'ref' && propName.startsWith('on')) {\n if (typeof source[propName] === 'function' && typeof props[propName] === 'function') {\n proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);\n } else if (typeof source[propName] === 'function') {\n proxySource[propName] = source[propName];\n } else if (typeof props[propName] === 'function') {\n proxySource[propName] = props[propName];\n }\n }\n return proxySource;\n }, {});\n}\n\nexport interface AssignableProps {\n ref?: Ref<any>;\n style?: CSSProperties;\n className?: string;\n styles?: { [key: string]: string };\n\n [key: string]: any;\n}\n\nexport default function assignProps<P extends AssignableProps, S extends AssignableProps>(\n props: P = {} as P,\n source: S = {} as S,\n) {\n // @ts-ignore\n if (props === source) return props;\n const newProps = {\n ...source,\n ...props,\n ...assignHandlersInner(props, source),\n };\n for (const key in source) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = source[key];\n }\n }\n for (const key in props) {\n if (key.startsWith('use:')) {\n const originalKey = key.slice('use:'.length);\n newProps[originalKey] = props[key];\n }\n }\n\n // because react set getter for ref\n const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, 'ref');\n const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, 'ref');\n if (sourceDescriptorRef?.configurable && propsDescriptorRef?.configurable) {\n newProps.ref = forkRef(source.ref as any, props.ref as any);\n }\n\n if (props.forwardRef) {\n newProps.ref = forkRef(newProps.ref as any, props.forwardRef as any);\n newProps.forwardRef = newProps.ref;\n }\n\n if (source.style && props.style) {\n newProps.style = {\n ...source.style,\n ...props.style,\n };\n }\n\n if (source.className) {\n newProps.className = cn(props.className, source.className);\n }\n\n if (source.styles && props.styles) {\n newProps.styles = sstyled.merge(source.styles, props.styles);\n }\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AK,CAACsB,KAAK,EAAE;IAC/BX,QAAQ,CAACW,KAAK,GAAAV,aAAA,CAAAA,aAAA,KACTX,MAAM,CAACqB,KAAK,GACZtB,KAAK,CAACsB,KAAK,CACf;EACH;EAEA,IAAIrB,MAAM,CAACsB,SAAS,EAAE;IACpBZ,QAAQ,CAACY,SAAS,GAAGzC,EAAE,CAACkB,KAAK,CAACuB,SAAS,EAAEtB,MAAM,CAACsB,SAAS,CAAC;EAC5D;EAEA,IAAItB,MAAM,CAACuB,MAAM,IAAIxB,KAAK,CAACwB,MAAM,EAAE;IACjCb,QAAQ,CAACa,MAAM,GAAGzC,OAAO,CAAC0C,KAAK,CAACxB,MAAM,CAACuB,MAAM,EAAExB,KAAK,CAACwB,MAAM,CAAC;EAC9D;EAEA,OAAOb,QAAQ;AACjB"}
|
@@ -10,8 +10,8 @@ var _core = require("intergalactic/core");
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
11
|
var _core2 = _interopRequireWildcard(require("../../core"));
|
12
12
|
/*__reshadow-styles__:"./invalidStatePattern.shadow.css"*/
|
13
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
14
|
-
"__SPattern": "
|
13
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPattern_23it5_gg_{width:6px;height:100%;position:absolute;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px)}" /*__inner_css_end__*/, "23it5_gg_") /*__reshadow_css_end__*/, {
|
14
|
+
"__SPattern": "___SPattern_23it5_gg_"
|
15
15
|
});
|
16
16
|
var InvalidStatePatternComponent = function InvalidStatePatternComponent() {
|
17
17
|
var SPattern = _core2.Root;
|
@@ -2,8 +2,8 @@ import { sstyled as _sstyled } from 'intergalactic/core';
|
|
2
2
|
import React from 'react';
|
3
3
|
import createComponent, { sstyled, Root } from "../../core.mjs";
|
4
4
|
/*__reshadow-styles__:"./invalidStatePattern.shadow.css"*/
|
5
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
6
|
-
"__SPattern": "
|
5
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPattern_23it5_gg_{width:6px;height:100%;position:absolute;background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px)}" /*__inner_css_end__*/, "23it5_gg_") /*__reshadow_css_end__*/, {
|
6
|
+
"__SPattern": "___SPattern_23it5_gg_"
|
7
7
|
});
|
8
8
|
var InvalidStatePatternComponent = function InvalidStatePatternComponent() {
|
9
9
|
var SPattern = Root;
|
@@ -9,7 +9,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
10
|
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
12
|
-
var
|
12
|
+
var _index = require("../styled/index");
|
13
13
|
var _staticChildren = require("./staticChildren");
|
14
14
|
var _excluded = ["_styles", "styles"],
|
15
15
|
_excluded2 = ["styles"];
|
@@ -26,7 +26,7 @@ function Enhancement(childComponents, Context) {
|
|
26
26
|
this[STYLES_SELF] = props.styles;
|
27
27
|
}
|
28
28
|
if (WrapperComponent.style) {
|
29
|
-
this[STYLES_SELF] =
|
29
|
+
this[STYLES_SELF] = _index.sstyled.merge(WrapperComponent.style, props._styles);
|
30
30
|
}
|
31
31
|
},
|
32
32
|
context: function context(_context) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style.js","names":["_react","_interopRequireDefault","require","
|
1
|
+
{"version":3,"file":"style.js","names":["_react","_interopRequireDefault","require","_index","_staticChildren","_excluded","_excluded2","STYLES_CONTEXT","Symbol","exports","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","STATIC_COMPONENT","init","props","WrapperComponent","styles","sstyled","merge","_styles","context","Object","keys","length","_objectSpread3","_defineProperty2","asProps","_ref","_objectWithoutProperties2","wrapperProps","_ref2","React","useContext","_default"],"sources":["../../../src/core/enhancement/style.tsx"],"sourcesContent":["import React from 'react';\nimport { sstyled } from '../styled/index';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (this: any, context: any): any {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n\n asProps: function (this: any, { _styles, styles, ...props }: any) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function (this: any, { styles, ...props }: any) {\n const context: any = React.useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,G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AAA,CAANX,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAD,IAAA,EAAA5B,SAAA;MACvD,WAAAyB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRE,MAAM,EAAE,IAAI,CAACZ,WAAW;MAAC;IAE7B,CAAC;IACDyB,YAAY,EAAE,SAAAA,aAAAC,KAAA,EAAgD;MAAA,IAAzBd,MAAM,GAAAc,KAAA,CAANd,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAE,KAAA,EAAA9B,UAAA;MACnD,IAAMoB,OAAY,GAAGW,iBAAK,CAACC,UAAU,CAACzB,OAAO,CAAC;MAC9C,WAAAiB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRK,OAAO,EAAEH,MAAM;QACfA,MAAM,EAAEI,OAAO,CAACnB,cAAc;MAAC;IAEnC;EACF,CAAC;AACH;AAAC,IAAAgC,QAAA,GAEc5B,WAAW;AAAAF,OAAA,cAAA8B,QAAA"}
|
@@ -4,7 +4,7 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
4
|
var _excluded = ["_styles", "styles"],
|
5
5
|
_excluded2 = ["styles"];
|
6
6
|
import React from 'react';
|
7
|
-
import { sstyled } from "../styled.mjs";
|
7
|
+
import { sstyled } from "../styled/index.mjs";
|
8
8
|
import { STATIC_COMPONENT } from "./staticChildren.mjs";
|
9
9
|
export var STYLES_CONTEXT = Symbol('STYLES_CONTEXT');
|
10
10
|
var STYLES_SELF = Symbol('STYLES_SELF');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style.mjs","names":["React","sstyled","STATIC_COMPONENT","STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","init","props","WrapperComponent","styles","merge","_styles","context","Object","keys","length","_objectSpread","_defineProperty","asProps","_ref","_objectWithoutProperties","_excluded","wrapperProps","_ref2","_excluded2","useContext"],"sources":["../../../src/core/enhancement/style.tsx"],"sourcesContent":["import React from 'react';\nimport { sstyled } from '../styled';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (this: any, context: any): any {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n\n asProps: function (this: any, { _styles, styles, ...props }: any) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function (this: any, { styles, ...props }: any) {\n const context: any = React.useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,
|
1
|
+
{"version":3,"file":"style.mjs","names":["React","sstyled","STATIC_COMPONENT","STYLES_CONTEXT","Symbol","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","init","props","WrapperComponent","styles","merge","_styles","context","Object","keys","length","_objectSpread","_defineProperty","asProps","_ref","_objectWithoutProperties","_excluded","wrapperProps","_ref2","_excluded2","useContext"],"sources":["../../../src/core/enhancement/style.tsx"],"sourcesContent":["import React from 'react';\nimport { sstyled } from '../styled/index';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (this: any, context: any): any {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n\n asProps: function (this: any, { _styles, styles, ...props }: any) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function (this: any, { styles, ...props }: any) {\n const context: any = React.useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,qBAAiB;AACzC,SAASC,gBAAgB,QAAQ,sBAAkB;AAEnD,OAAO,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AACtD,IAAMC,WAAW,GAAGD,MAAM,CAAC,aAAa,CAAC;AAEzC,SAASE,WAAWA,CAACC,eAAoB,EAAEC,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAK,IAAIF,SAAS,CAACR,gBAAgB,CAAC,CAAC;IAChE,CAAC;IACDW,IAAI,EAAE,SAAAA,KAAqBC,KAAU,EAAEC,gBAAqB,EAAE;MAC5D,IAAID,KAAK,CAACE,MAAM,EAAE;QAChB,IAAI,CAACX,WAAW,CAAC,GAAGS,KAAK,CAACE,MAAM;MAClC;MACA,IAAID,gBAAgB,CAACH,KAAK,EAAE;QAC1B,IAAI,CAACP,WAAW,CAAC,GAAGJ,OAAO,CAACgB,KAAK,CAACF,gBAAgB,CAACH,KAAK,EAAEE,KAAK,CAACI,OAAO,CAAC;MAC1E;IACF,CAAC;IACDC,OAAO,EAAE,SAAAA,QAAqBA,QAAY,EAAO;MAC/C;MACA,IAAI,CAAC,IAAI,CAACd,WAAW,CAAC,IAAI,CAACe,MAAM,CAACC,IAAI,CAACd,eAAe,CAAC,CAACe,MAAM,EAAE;QAC9D,OAAOH,QAAO;MAChB;MACA,OAAAI,aAAA,CAAAA,aAAA,KACKJ,QAAO,OAAAK,eAAA,KACTrB,cAAc,EAAG,IAAI,CAACE,WAAW,CAAC;IAEvC,CAAC;IAEDoB,OAAO,EAAE,SAAAA,QAAAC,IAAA,EAAyD;MAAA,IAAlCR,OAAO,GAAAQ,IAAA,CAAPR,OAAO;QAAEF,MAAM,GAAAU,IAAA,CAANV,MAAM;QAAKF,KAAK,GAAAa,wBAAA,CAAAD,IAAA,EAAAE,SAAA;MACvD,OAAAL,aAAA,CAAAA,aAAA,KACKT,KAAK;QACRE,MAAM,EAAE,IAAI,CAACX,WAAW;MAAC;IAE7B,CAAC;IACDwB,YAAY,EAAE,SAAAA,aAAAC,KAAA,EAAgD;MAAA,IAAzBd,MAAM,GAAAc,KAAA,CAANd,MAAM;QAAKF,KAAK,GAAAa,wBAAA,CAAAG,KAAA,EAAAC,UAAA;MACnD,IAAMZ,OAAY,GAAGnB,KAAK,CAACgC,UAAU,CAACxB,OAAO,CAAC;MAC9C,OAAAe,aAAA,CAAAA,aAAA,KACKT,KAAK;QACRI,OAAO,EAAEF,MAAM;QACfA,MAAM,EAAEG,OAAO,CAAChB,cAAc;MAAC;IAEnC;EACF,CAAC;AACH;AAEA,eAAeG,WAAW"}
|
@@ -28,8 +28,8 @@ declare function createComponent<ComponentProps, ChildComponentProps = {}, Conte
|
|
28
28
|
[key: string]: (arg: unknown) => void;
|
29
29
|
}, FNType>;
|
30
30
|
declare function createBaseComponent<ComponentProps>(OriginComponent: any): ComponentType<ComponentProps>;
|
31
|
-
export * from './types';
|
32
|
-
export * from './styled';
|
31
|
+
export * from './types/index';
|
32
|
+
export * from './styled/index';
|
33
33
|
export * from './register';
|
34
34
|
export { createBaseComponent, register, CREATE_COMPONENT, CORE_INSTANCE, CONTEXT_COMPONENT, CHILDREN_COMPONENT, INHERITED_NAME, CORE_COMPONENT, STATIC_COMPONENT, ROOT_COMPONENT, assignProps, };
|
35
35
|
export default createComponent;
|
package/utils/lib/core/index.js
CHANGED
@@ -118,27 +118,27 @@ var _style = _interopRequireDefault(require("./enhancement/style"));
|
|
118
118
|
var _bindHandler = _interopRequireDefault(require("./enhancement/bindHandler"));
|
119
119
|
var _i18n = _interopRequireDefault(require("./enhancement/i18n"));
|
120
120
|
var _symbols = require("./types/symbols");
|
121
|
-
var
|
122
|
-
Object.keys(
|
121
|
+
var _index = require("./types/index");
|
122
|
+
Object.keys(_index).forEach(function (key) {
|
123
123
|
if (key === "default" || key === "__esModule") return;
|
124
124
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
125
|
-
if (key in exports && exports[key] ===
|
125
|
+
if (key in exports && exports[key] === _index[key]) return;
|
126
126
|
Object.defineProperty(exports, key, {
|
127
127
|
enumerable: true,
|
128
128
|
get: function get() {
|
129
|
-
return
|
129
|
+
return _index[key];
|
130
130
|
}
|
131
131
|
});
|
132
132
|
});
|
133
|
-
var
|
134
|
-
Object.keys(
|
133
|
+
var _index2 = require("./styled/index");
|
134
|
+
Object.keys(_index2).forEach(function (key) {
|
135
135
|
if (key === "default" || key === "__esModule") return;
|
136
136
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
137
|
-
if (key in exports && exports[key] ===
|
137
|
+
if (key in exports && exports[key] === _index2[key]) return;
|
138
138
|
Object.defineProperty(exports, key, {
|
139
139
|
enumerable: true,
|
140
140
|
get: function get() {
|
141
|
-
return
|
141
|
+
return _index2[key];
|
142
142
|
}
|
143
143
|
});
|
144
144
|
});
|