intergalactic 15.82.2-prerelease.6 → 15.83.0-prerelease.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/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/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,CAASF,GAAG,OAAAE,MAAA,CAAID,KAAK;IAAA,CAAE,CAAC,CACxCE,IAAI,CAAC,GAAG,CAAC;EACd,CAAC,EAAE,CAACZ,MAAM,CAAC,CAAC;EACZ,IAAAa,6BAAiB,EAAC,YAAM;IACtB,IAAId,SAAS,KAAKe,SAAS,IAAI,CAACf,SAAS,EAAE;IAC3C,IAAI,CAACD,GAAG,CAACiB,OAAO,IAAI,CAACjB,GAAG,CAACiB,OAAO,CAACC,KAAK,IAAI,CAAClB,GAAG,CAACiB,OAAO,CAACC,KAAK,CAACC,WAAW,E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,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,GAAG,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MAAA,UAAAI,MAAA,CAASF,GAAG,OAAAE,MAAA,CAAID,KAAK;IAAA,CAAE,CAAC,CACxCE,IAAI,CAAC,GAAG,CAAC;EACd,CAAC,EAAE,CAACZ,MAAM,CAAC,CAAC;EACZP,iBAAiB,CAAC,YAAM;IACtB,IAAIM,SAAS,KAAKc,SAAS,IAAI,CAACd,SAAS,EAAE;IAC3C,IAAI,CAACD,GAAG,CAACgB,OAAO,IAAI,CAAChB,GAAG,CAACgB,OAAO,CAACC,KAAK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7B,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;EACA,OAAOI,iBAAK,CAACX,QAAQ,CAACY,OAAO,CAACL,QAAQ,CAAC,CAACM,IAAI,CAAC,UAACC,OAAY,EAAK;IAC7D,IAAI,eAACH,iBAAK,CAACI,cAAc,CAACD,OAAO,CAAC,EAAE,OAAO,KAAK;IAChD,IAAIA,OAAO,CAACE,IAAI,KAAKL,iBAAK,CAACM,QAAQ,EAAE,OAAO,IAAI;IAChD,IAAKH,OAAO,CAACE,IAAI,CAASE,yBAAkB,CAAC,EAAE;MAC7C,IAAMC,YAAiB,GAAGpB,iBAAiB,CAACe,OAAO,CAACE,IAAI,EAAEf,IAAI,EAAEC,KAAK,CAAC;MACtE,IAAIiB,YAAY,CAACH,IAAI,CAACE,yBAAkB,CAAC,EAAE;QACzC,OAAO,IAAI;MACb,CAAC,MAAM;QACLJ,OAAO,GAAGK,YAAY;MACxB;IACF;IACA;IACA,IAAMC,cAAc,GAAGN,OAAO,CAACE,IAAI,CAACK,qBAAc,CAAC,IAAI,CAACP,OAAO,CAACE,IAAI,CAACM,WAAW,CAAC;IACjF,IAAMC,UAAU,GAAGC,KAAK,CAACC,OAAO,CAACvB,KAAK,CAAC,GACnCA,KAAK,CAACwB,GAAG,CAAC,UAACC,SAAS;MAAA,OAAKA,SAAS,CAACL,WAAW;IAAA,EAAC,GAC/C,CAACpB,KAAK,CAACoB,WAAW,CAAC;IACvB,OAAO,CAACrB,IAAI,CAACqB,WAAW,EAAAM,MAAA,KAAAC,mBAAA,aAAKN,UAAU,GAAEO,IAAI,CAAC,UAACC,IAAI;MAAA,OAAKX,cAAc,CAACY,QAAQ,CAACD,IAAI,CAAC;IAAA,EAAC;EACxF,CAAC,CAAC,gBACAtC,MAAA,YAAAgB,aAAA,CAACT,QAAQ,OAAG,gBAEZP,MAAA,YAAAgB,aAAA,CAACR,IAAI,qBACHR,MAAA,YAAAgB,aAAA,CAACT,QAAQ,OAAG,CAEf;AACH;AAAC,IAAAiC,QAAA,GAEclC,iBAAiB;AAAAmC,OAAA,cAAAD,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;AACzB,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,kBAAc;AACjE,OAAOC,iBAAiB,MAAM,yBAAqB;AACnD,OAAOC,MAAM,MAAM,cAAU;AAE7B,SAASC,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,GAAGV,iBAAiB,CAACG,QAAQ,CAAC;EAC5C,IAAI,OAAO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AAc,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;MACtB;MACA,OAAO,OAAOI,MAAM,KAAK,SAAS,IAAI,CAACA,MAAM;IAC/C,CAAC,CAAC;EAAA;AACN;AAEO,SAASE,cAAcA,CAACC,KAAU,EAAEC,MAAW,EAAE;EACtD,OAAOC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACG,MAAM,CAAC,UAACC,WAAgB,EAAEC,QAAQ,EAAK;IAChE,IAAI,OAAOL,MAAM,CAACK,QAAQ,CAAC,KAAK,UAAU,IAAIA,QAAQ,CAACC,UAAU,CAAC,IAAI,CAAC,EAAE;MACvEF,W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,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 }\n\n return newProps;\n}\n"],"mappings":";AACA,OAAOA,EAAE,MAAM,YAAY;AAC3B,SAASC,OAAO,QAAQ,kBAAc;AACtC,SAASC,OAAO,QAAQ,WAAO;AAE/B,OAAO,SAASC,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;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Cb,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;
|
@@ -8,18 +8,18 @@ exports["default"] = void 0;
|
|
8
8
|
exports.findAllComponents = findAllComponents;
|
9
9
|
exports.isAdvanceMode = isAdvanceMode;
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
|
-
var
|
11
|
+
var _index = require("./core/index");
|
12
12
|
var _getOriginChildren = _interopRequireDefault(require("./getOriginChildren"));
|
13
13
|
function findComponent(Children, names, recursively) {
|
14
14
|
var limit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
15
|
-
var children = Children[
|
15
|
+
var children = Children[_index.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
|
16
16
|
return _react["default"].Children.toArray(children).find(function (child) {
|
17
17
|
if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
|
18
18
|
if (child.type === _react["default"].Fragment) {
|
19
19
|
return findComponent(child.props.children, names, recursively, limit);
|
20
20
|
}
|
21
21
|
// @ts-ignore
|
22
|
-
var inheritedNames = child.type[
|
22
|
+
var inheritedNames = child.type[_index.INHERITED_NAME] || [child.type.displayName];
|
23
23
|
var result = !!inheritedNames.find(function (name) {
|
24
24
|
return names.includes(name);
|
25
25
|
});
|
@@ -31,7 +31,7 @@ function findComponent(Children, names, recursively) {
|
|
31
31
|
});
|
32
32
|
}
|
33
33
|
function isAdvanceMode(Children, name, recursively) {
|
34
|
-
var children = Children[
|
34
|
+
var children = Children[_index.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
|
35
35
|
if (!children) return false;
|
36
36
|
if (typeof children === 'function') {
|
37
37
|
return true;
|
@@ -41,14 +41,14 @@ function isAdvanceMode(Children, name, recursively) {
|
|
41
41
|
function findAllComponents(Children, names) {
|
42
42
|
var result = [];
|
43
43
|
var findAllAndAdd = function findAllAndAdd(Children) {
|
44
|
-
var children = Children[
|
44
|
+
var children = Children[_index.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
|
45
45
|
_react["default"].Children.toArray(children).forEach(function (child) {
|
46
46
|
if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
|
47
47
|
if (child.type === _react["default"].Fragment) {
|
48
48
|
findAllAndAdd(child.props.children);
|
49
49
|
} else {
|
50
50
|
// @ts-ignore
|
51
|
-
var inheritedNames = child.type[
|
51
|
+
var inheritedNames = child.type[_index.INHERITED_NAME] || [child.type.displayName];
|
52
52
|
var component = !!inheritedNames.find(function (name) {
|
53
53
|
return names.includes(name);
|
54
54
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findComponent.js","names":["_react","_interopRequireDefault","require","
|
1
|
+
{"version":3,"file":"findComponent.js","names":["_react","_interopRequireDefault","require","_index","_getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","_default","exports"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core/index';\nimport getOriginChildren from './getOriginChildren';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\nexport function findAllComponents(Children: any, names: string[]): ReactElement[] {\n const result: ReactElement[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\nexport default findComponent;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,SAASG,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEuC;EAAA,IAD5DC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACQ,yBAAkB,CAAC,GAAG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AAD,QAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { CHILDREN_COMPONENT, INHERITED_NAME } from "./core.mjs";
|
2
|
+
import { CHILDREN_COMPONENT, INHERITED_NAME } from "./core/index.mjs";
|
3
3
|
import getOriginChildren from "./getOriginChildren.mjs";
|
4
4
|
function findComponent(Children, names, recursively) {
|
5
5
|
var limit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findComponent.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core';\nimport getOriginChildren from './getOriginChildren';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\nexport function findAllComponents(Children: any, names: string[]): ReactElement[] {\n const result: ReactElement[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\nexport default findComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAmC,OAAO;AACtD,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,
|
1
|
+
{"version":3,"file":"findComponent.mjs","names":["React","CHILDREN_COMPONENT","INHERITED_NAME","getOriginChildren","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push"],"sources":["../src/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from './core/index';\nimport getOriginChildren from './getOriginChildren';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\nexport function findAllComponents(Children: any, names: string[]): ReactElement[] {\n const result: ReactElement[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\nexport default findComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAmC,OAAO;AACtD,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,kBAAc;AACjE,OAAOC,iBAAiB,MAAM,yBAAqB;AAEnD,SAASC,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEuC;EAAA,IAD5DC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACJ,kBAAkB,CAAC,GAAGE,iBAAiB,CAACE,QAAQ,CAAC,GAAGA,QAAQ;EACtF,OAAOL,KAAK,CAACK,QAAQ,CAACQ,OAAO,CAACD,QAAQ,CAAC,CAACE,IAAI,CAAC,UAACC,KAAK,EAAK;IACtD,kBAAIf,KAAK,CAACgB,cAAc,CAACD,KAAK,CAAC,EAAE;MAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKjB,KAAK,CAACkB,QAAQ,EAAE;QACjC,OAAOd,aAAa,CAACW,KAAK,CAACI,KAAK,CAACP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IACtFL,KAAK,CAACK,QAAQ,CAACQ,OAAO,CAACD,QAAQ,CAAC,CAACgB,OAAO,CAAC,UAACb,KAAK,EAAK;MAClD,kBAAIf,KAAK,CAACgB,cAAc,CAACD,KAAK,CAAC,EAAE;QAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKjB,KAAK,CAACkB,QAAQ,EAAE;UACjCS,aAAa,CAACZ,KAAK,CAACI,KAAK,CAACP,QAAQ,CAAC;QACrC,CAAC,MAAM;UACL;UACA,IAAMQ,cAAc,GAAGL,KAAK,CAACE,IAAI,CAACf,cAAc,CAAC,IAAI,CAACa,KAAK,CAACE,IAAI,CAACI,WAAW,CAAC;UAC7E,IAAMQ,SAAS,GAAG,CAAC,CAACT,cAAc,CAACN,IAAI,CAAC,UAACS,IAAY;YAAA,OAAKjB,KAAK,CAACkB,QAAQ,CAACD,IAAI,CAAC;UAAA,EAAC;UAE/E,IAAIM,SAAS,EAAE;YACbP,MAAM,CAACQ,IAAI,CAACf,KAAK,CAAC;UACpB;UAEA,IAAIA,KAAK,CAACI,KAAK,CAACP,QAAQ,EAAE;YACxB,OAAOe,aAAa,CAACZ,KAAK,CAACI,KAAK,CAACP,QAAQ,CAAC;UAC5C;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAEDe,aAAa,CAACtB,QAAQ,CAAC;EAEvB,OAAOiB,MAAM;AACf;AAEA,eAAelB,aAAa"}
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports["default"] = void 0;
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
var
|
9
|
+
var _index = require("./core/index");
|
10
10
|
function getOriginChildren(Children) {
|
11
|
-
if ( /*#__PURE__*/_react["default"].isValidElement(Children.origin) && Children.origin.type[
|
11
|
+
if ( /*#__PURE__*/_react["default"].isValidElement(Children.origin) && Children.origin.type[_index.CHILDREN_COMPONENT]) {
|
12
12
|
return getOriginChildren(Children.origin.type);
|
13
13
|
}
|
14
14
|
return Children.origin;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getOriginChildren.js","names":["_react","_interopRequireDefault","require","
|
1
|
+
{"version":3,"file":"getOriginChildren.js","names":["_react","_interopRequireDefault","require","_index","getOriginChildren","Children","React","isValidElement","origin","type","CHILDREN_COMPONENT","_default","exports"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT } from './core/index';\n\nfunction getOriginChildren(Children: any): any {\n if (React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {\n return getOriginChildren(Children.origin.type);\n }\n return Children.origin;\n}\n\nexport default getOriginChildren;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,SAASE,iBAAiBA,CAACC,QAAa,EAAO;EAC7C,IAAI,cAAAC,iBAAK,CAACC,cAAc,CAACF,QAAQ,CAACG,MAAM,CAAC,IAAIH,QAAQ,CAACG,MAAM,CAACC,IAAI,CAACC,yBAAkB,CAAC,EAAE;IACrF,OAAON,iBAAiB,CAACC,QAAQ,CAACG,MAAM,CAACC,IAAI,CAAC;EAChD;EACA,OAAOJ,QAAQ,CAACG,MAAM;AACxB;AAAC,IAAAG,QAAA,GAEcP,iBAAiB;AAAAQ,OAAA,cAAAD,QAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { CHILDREN_COMPONENT } from "./core.mjs";
|
2
|
+
import { CHILDREN_COMPONENT } from "./core/index.mjs";
|
3
3
|
function getOriginChildren(Children) {
|
4
4
|
if ( /*#__PURE__*/React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {
|
5
5
|
return getOriginChildren(Children.origin.type);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getOriginChildren.mjs","names":["React","CHILDREN_COMPONENT","getOriginChildren","Children","isValidElement","origin","type"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT } from './core';\n\nfunction getOriginChildren(Children: any): any {\n if (React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {\n return getOriginChildren(Children.origin.type);\n }\n return Children.origin;\n}\n\nexport default getOriginChildren;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,
|
1
|
+
{"version":3,"file":"getOriginChildren.mjs","names":["React","CHILDREN_COMPONENT","getOriginChildren","Children","isValidElement","origin","type"],"sources":["../src/getOriginChildren.ts"],"sourcesContent":["import React from 'react';\nimport { CHILDREN_COMPONENT } from './core/index';\n\nfunction getOriginChildren(Children: any): any {\n if (React.isValidElement(Children.origin) && Children.origin.type[CHILDREN_COMPONENT]) {\n return getOriginChildren(Children.origin.type);\n }\n return Children.origin;\n}\n\nexport default getOriginChildren;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,kBAAc;AAEjD,SAASC,iBAAiBA,CAACC,QAAa,EAAO;EAC7C,IAAI,cAAAH,KAAK,CAACI,cAAc,CAACD,QAAQ,CAACE,MAAM,CAAC,IAAIF,QAAQ,CAACE,MAAM,CAACC,IAAI,CAACL,kBAAkB,CAAC,EAAE;IACrF,OAAOC,iBAAiB,CAACC,QAAQ,CAACE,MAAM,CAACC,IAAI,CAAC;EAChD;EACA,OAAOH,QAAQ,CAACE,MAAM;AACxB;AAEA,eAAeH,iBAAiB"}
|
package/utils/lib/if.d.ts
CHANGED
package/utils/lib/if.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"if.js","names":["If","props","condition","children","_default","exports"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":";;;;;;AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAAC,IAAAC,QAAA,GAEaJ,EAAE;AAAAK,OAAA,cAAAD,QAAA"}
|
1
|
+
{"version":3,"file":"if.js","names":["If","props","condition","children","_default","exports"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core/index';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":";;;;;;AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAAC,IAAAC,QAAA,GAEaJ,EAAE;AAAAK,OAAA,cAAAD,QAAA"}
|
package/utils/lib/if.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"if.mjs","names":["If","props","condition","children"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":"AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAED,eAAeH,EAAE"}
|
1
|
+
{"version":3,"file":"if.mjs","names":["If","props","condition","children"],"sources":["../src/if.tsx"],"sourcesContent":["import { UnknownProperties } from './core/index';\nimport { FC, ReactNode } from 'react';\n\n/** @deprecated */\nexport interface IIfProps extends IfProps, UnknownProperties {}\nexport type IfProps = {\n condition: boolean;\n children?: ReactNode;\n};\n\nconst If: FC<IIfProps> = (props) => {\n const { condition, children } = props;\n return (condition ? children : null) as ReturnType<FC>;\n};\n\nexport default If;\n"],"mappings":"AAGA;;AAOA,IAAMA,EAAgB,GAAG,SAAnBA,EAAgBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,SAAS,GAAeD,KAAK,CAA7BC,SAAS;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EAC3B,OAAQD,SAAS,GAAGC,QAAQ,GAAG,IAAI;AACrC,CAAC;AAED,eAAeH,EAAE"}
|