@qoretechnologies/reqore 0.78.6-pr.715.gdfefa70 → 0.78.7-pr.717.gae33bdc
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/.claude/CLAUDE.md +14 -0
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +73 -23
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +344 -44
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/item.js +6 -2
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +20 -43
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +75 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +324 -110
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ButtonRail/index.d.ts.map +1 -1
- package/dist/components/ButtonRail/index.js +3 -2
- package/dist/components/ButtonRail/index.js.map +1 -1
- package/dist/components/Callout/index.d.ts +4 -3
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +78 -27
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +120 -44
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.d.ts.map +1 -1
- package/dist/components/Collapse/index.js +7 -36
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +11 -39
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.js +3 -3
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +4 -4
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.d.ts.map +1 -1
- package/dist/components/Columns/column.js +6 -35
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Columns/index.js +3 -35
- package/dist/components/Columns/index.js.map +1 -1
- package/dist/components/Comment/index.js +8 -8
- package/dist/components/Comment/index.js.map +1 -1
- package/dist/components/CommentFeed/index.js +2 -2
- package/dist/components/CommentFeed/index.js.map +1 -1
- package/dist/components/Content/index.d.ts.map +1 -1
- package/dist/components/Content/index.js +3 -35
- package/dist/components/Content/index.js.map +1 -1
- package/dist/components/Content/wrapper.js +2 -2
- package/dist/components/Content/wrapper.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +52 -19
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/ControlGroup/item.d.ts.map +1 -1
- package/dist/components/ControlGroup/item.js +35 -6
- package/dist/components/ControlGroup/item.js.map +1 -1
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +35 -65
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +40 -8
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +36 -42
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts.map +1 -1
- package/dist/components/Drawer/backdrop.js +35 -6
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +77 -66
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +3 -1
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +90 -19
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +37 -6
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +216 -49
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts +19 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +139 -44
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/FadeScroller/index.d.ts.map +1 -1
- package/dist/components/FadeScroller/index.js +14 -64
- package/dist/components/FadeScroller/index.js.map +1 -1
- package/dist/components/FeatureCard/index.d.ts +7 -1
- package/dist/components/FeatureCard/index.d.ts.map +1 -1
- package/dist/components/FeatureCard/index.js +82 -27
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +8 -5
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +39 -19
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconPicker/index.js +2 -2
- package/dist/components/IconPicker/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +44 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +96 -30
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +7 -2
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +47 -8
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +56 -19
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +3 -3
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Layout/content.js +2 -2
- package/dist/components/Layout/content.js.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +3 -35
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +12 -39
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +11 -6
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +40 -22
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +35 -5
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Menu/section.d.ts.map +1 -1
- package/dist/components/Menu/section.js +11 -6
- package/dist/components/Menu/section.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +20 -4
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +2 -0
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +136 -46
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Navbar/divider.d.ts.map +1 -1
- package/dist/components/Navbar/divider.js +35 -6
- package/dist/components/Navbar/divider.js.map +1 -1
- package/dist/components/Navbar/group.js +3 -3
- package/dist/components/Navbar/group.js.map +1 -1
- package/dist/components/Navbar/index.js +3 -3
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Navbar/item.js +3 -3
- package/dist/components/Navbar/item.js.map +1 -1
- package/dist/components/Notifications/index.d.ts.map +1 -1
- package/dist/components/Notifications/index.js +6 -35
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts +6 -2
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +95 -60
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +20 -0
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +45 -17
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Paging/index.d.ts.map +1 -1
- package/dist/components/Paging/index.js +19 -19
- package/dist/components/Paging/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +15 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +513 -202
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts +6 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +65 -13
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +8 -0
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +169 -21
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +11 -43
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Rating/index.js +33 -47
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +130 -52
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/RowActionsMenu/index.d.ts +80 -0
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -0
- package/dist/components/RowActionsMenu/index.js +182 -0
- package/dist/components/RowActionsMenu/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +92 -77
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/valuePreview.js +2 -2
- package/dist/components/Select/valuePreview.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts +20 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +58 -15
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -35
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.js +9 -9
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Spacer/index.js +7 -7
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Span/index.d.ts.map +1 -1
- package/dist/components/Span/index.js +43 -11
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/StackedBar/index.d.ts.map +1 -1
- package/dist/components/StackedBar/index.js +48 -47
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts +0 -8
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +44 -45
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +12 -44
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +76 -52
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +15 -12
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +8 -38
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +20 -0
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +52 -1
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +57 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +154 -59
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +3 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +44 -13
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/scrollbar.js +3 -3
- package/dist/components/Table/scrollbar.js.map +1 -1
- package/dist/components/Tabs/content.js +2 -2
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +8 -6
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +6 -4
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +3 -35
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +77 -3
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +315 -83
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.d.ts +6 -1
- package/dist/components/Testimonial/index.d.ts.map +1 -1
- package/dist/components/Testimonial/index.js +59 -23
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +16 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +178 -33
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/group.d.ts.map +1 -1
- package/dist/components/Tier/group.js +9 -8
- package/dist/components/Tier/group.js.map +1 -1
- package/dist/components/Tier/index.d.ts +5 -0
- package/dist/components/Tier/index.d.ts.map +1 -1
- package/dist/components/Tier/index.js +14 -10
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +73 -28
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/TooltipComponent/index.d.ts.map +1 -1
- package/dist/components/TooltipComponent/index.js +6 -7
- package/dist/components/TooltipComponent/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +27 -23
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/components/Tree/modal.d.ts.map +1 -1
- package/dist/components/Tree/modal.js +3 -1
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/sizes.d.ts +5 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +6 -1
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.d.ts +0 -21
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +27 -13
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +10 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +34 -36
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/SurfaceContext.d.ts +18 -0
- package/dist/context/SurfaceContext.d.ts.map +1 -0
- package/dist/context/SurfaceContext.js +39 -0
- package/dist/context/SurfaceContext.js.map +1 -0
- package/dist/helpers/colors.d.ts +183 -11
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +736 -100
- package/dist/helpers/colors.js.map +1 -1
- package/dist/helpers/hoveringPointer.d.ts +54 -0
- package/dist/helpers/hoveringPointer.d.ts.map +1 -0
- package/dist/helpers/hoveringPointer.js +66 -0
- package/dist/helpers/hoveringPointer.js.map +1 -0
- package/dist/helpers/iconProps.d.ts +14 -0
- package/dist/helpers/iconProps.d.ts.map +1 -0
- package/dist/helpers/iconProps.js +33 -0
- package/dist/helpers/iconProps.js.map +1 -0
- package/dist/helpers/styled.d.ts +39 -26
- package/dist/helpers/styled.d.ts.map +1 -1
- package/dist/helpers/styled.js +156 -4
- package/dist/helpers/styled.js.map +1 -1
- package/dist/helpers/surface.d.ts +31 -0
- package/dist/helpers/surface.d.ts.map +1 -0
- package/dist/helpers/surface.js +87 -0
- package/dist/helpers/surface.js.map +1 -0
- package/dist/hooks/useAutoFocus.d.ts.map +1 -1
- package/dist/hooks/useAutoFocus.js +11 -1
- package/dist/hooks/useAutoFocus.js.map +1 -1
- package/dist/hooks/useCloneThroughFragments.d.ts.map +1 -1
- package/dist/hooks/useCloneThroughFragments.js +51 -18
- package/dist/hooks/useCloneThroughFragments.js.map +1 -1
- package/dist/hooks/useCombinedRefs.d.ts +16 -6
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -1
- package/dist/hooks/useCombinedRefs.js +34 -27
- package/dist/hooks/useCombinedRefs.js.map +1 -1
- package/dist/hooks/useDragToScroll.d.ts +58 -0
- package/dist/hooks/useDragToScroll.d.ts.map +1 -0
- package/dist/hooks/useDragToScroll.js +262 -0
- package/dist/hooks/useDragToScroll.js.map +1 -0
- package/dist/hooks/useDrawnSurface.d.ts +38 -0
- package/dist/hooks/useDrawnSurface.d.ts.map +1 -0
- package/dist/hooks/useDrawnSurface.js +48 -0
- package/dist/hooks/useDrawnSurface.js.map +1 -0
- package/dist/hooks/useMarqueeOnHover.d.ts.map +1 -1
- package/dist/hooks/useMarqueeOnHover.js +10 -0
- package/dist/hooks/useMarqueeOnHover.js.map +1 -1
- package/dist/hooks/usePaging.d.ts +9 -4
- package/dist/hooks/usePaging.d.ts.map +1 -1
- package/dist/hooks/usePaging.js +21 -32
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/hooks/usePointerDrag.d.ts.map +1 -1
- package/dist/hooks/usePointerDrag.js +13 -3
- package/dist/hooks/usePointerDrag.js.map +1 -1
- package/dist/hooks/useReqoreMedia.d.ts +22 -7
- package/dist/hooks/useReqoreMedia.d.ts.map +1 -1
- package/dist/hooks/useReqoreMedia.js +33 -9
- package/dist/hooks/useReqoreMedia.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.js +6 -6
- package/dist/styles.js.map +1 -1
- package/package.json +3 -4
- package/vitest.config.ts +115 -31
|
@@ -58,38 +58,48 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
}
|
|
59
59
|
return t;
|
|
60
60
|
};
|
|
61
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
+
if (ar || !(i in from)) {
|
|
64
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
+
ar[i] = from[i];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
+
};
|
|
61
70
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
71
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
72
|
};
|
|
64
73
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.ButtonBadge = exports.StyledButtonContent = exports.StyledButton = exports.StyledAnimatedTextWrapper = exports.StyledButtonIndicator = void 0;
|
|
74
|
+
exports.ButtonBadge = exports.StyledButtonContent = exports.StyledButton = exports.REQORE_BUTTON_STYLE_PROPS = exports.StyledAnimatedTextWrapper = exports.getButtonPaint = exports.getButtonStateColors = exports.getButtonIconLook = exports.getButtonColors = exports.StyledButtonIndicator = void 0;
|
|
66
75
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
67
76
|
var useMarqueeOnHover_1 = require("../../hooks/useMarqueeOnHover");
|
|
68
77
|
var lodash_1 = require("lodash");
|
|
69
|
-
var polished_1 = require("polished");
|
|
70
78
|
var react_1 = require("react");
|
|
71
79
|
var react_hotkeys_hook_1 = require("react-hotkeys-hook");
|
|
72
|
-
var styled_components_1 =
|
|
80
|
+
var styled_components_1 = require("styled-components");
|
|
73
81
|
var colors_1 = require("../../constants/colors");
|
|
74
82
|
var sizes_1 = require("../../constants/sizes");
|
|
75
83
|
var colors_2 = require("../../helpers/colors");
|
|
76
84
|
var shortcuts_1 = require("../../helpers/shortcuts");
|
|
77
|
-
var styled_1 = require("../../helpers/styled");
|
|
85
|
+
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
78
86
|
var utils_1 = require("../../helpers/utils");
|
|
79
87
|
var useCombinedRefs_1 = require("../../hooks/useCombinedRefs");
|
|
80
88
|
var useReqoreContext_1 = require("../../hooks/useReqoreContext");
|
|
81
89
|
var useReqoreEffect_1 = require("../../hooks/useReqoreEffect");
|
|
82
90
|
var useTheme_1 = require("../../hooks/useTheme");
|
|
91
|
+
var SurfaceContext_1 = require("../../context/SurfaceContext");
|
|
83
92
|
var styles_1 = require("../../styles");
|
|
84
93
|
var Effect_1 = require("../Effect");
|
|
85
94
|
var Icon_1 = __importDefault(require("../Icon"));
|
|
95
|
+
var iconProps_1 = require("../../helpers/iconProps");
|
|
86
96
|
var KeyboardShortcut_1 = require("../KeyboardShortcut");
|
|
87
97
|
var Spacer_1 = require("../Spacer");
|
|
88
98
|
var Tag_1 = __importDefault(require("../Tag"));
|
|
89
99
|
var group_1 = __importDefault(require("../Tag/group"));
|
|
90
100
|
var TooltipComponent_1 = require("../TooltipComponent");
|
|
91
101
|
var indicatorPulseKeyframes = (0, styled_components_1.keyframes)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n transform: scale(1);\n opacity: 0.55;\n }\n 70% {\n opacity: 0;\n }\n 100% {\n transform: scale(2.6);\n opacity: 0;\n }\n"], ["\n 0% {\n transform: scale(1);\n opacity: 0.55;\n }\n 70% {\n opacity: 0;\n }\n 100% {\n transform: scale(2.6);\n opacity: 0;\n }\n"])));
|
|
92
|
-
exports.StyledButtonIndicator =
|
|
102
|
+
exports.StyledButtonIndicator = styled_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n z-index: 2;\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n background-color: ", ";\n pointer-events: none;\n\n ", "\n\n ", ";\n"], ["\n position: absolute;\n z-index: 2;\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n background-color: ", ";\n pointer-events: none;\n\n ", "\n\n ", ";\n"])), function (_a) {
|
|
93
103
|
var $diameter = _a.$diameter;
|
|
94
104
|
return $diameter;
|
|
95
105
|
}, function (_a) {
|
|
@@ -117,30 +127,217 @@ var getButtonMainColor = function (theme, color, effect) {
|
|
|
117
127
|
}
|
|
118
128
|
return theme.main;
|
|
119
129
|
};
|
|
120
|
-
|
|
121
|
-
|
|
130
|
+
/**
|
|
131
|
+
* What a button is drawn on and in, in a state. The background as it is drawn: a minimal button's wash and a
|
|
132
|
+
* translucent color (the muted intent) blended over the theme the button sits on, a transparent button as that
|
|
133
|
+
* theme, a gradient as each of its colors. The text is picked against that, and stands out from all of it by 4.5:1;
|
|
134
|
+
* a minimal or transparent button with a color of its own keeps the color in its text, in a shade that reads.
|
|
135
|
+
*/
|
|
136
|
+
var getButtonColors = function (_a, state) {
|
|
137
|
+
var theme = _a.theme, color = _a.color, minimal = _a.minimal, transparent = _a.transparent, effect = _a.effect, $surface = _a.$surface;
|
|
138
|
+
if (state === void 0) { state = 'rest'; }
|
|
139
|
+
var main = getButtonMainColor(theme, color, effect);
|
|
140
|
+
// what the button is drawn on: one color, or each color of a gradient
|
|
141
|
+
var unders = (0, colors_2.getThemeSurfaces)(theme, $surface);
|
|
142
|
+
var outlined = minimal || transparent;
|
|
143
|
+
var gradient = (0, Effect_1.getPrimaryGradient)(effect === null || effect === void 0 ? void 0 : effect.gradient);
|
|
144
|
+
// an outlined button's text starts from a light tint of its color, lighter hovered
|
|
145
|
+
var tintAmount = state === 'hover' ? 0.9 : 0.8;
|
|
146
|
+
var fills;
|
|
147
|
+
if (gradient && !transparent) {
|
|
148
|
+
var stops = (0, colors_2.getGradientColorList)(theme, gradient.colors);
|
|
149
|
+
if (minimal) {
|
|
150
|
+
// as a minimal gradient is painted: a translucent fill over a translucent ring over the button's wash
|
|
151
|
+
var painted = unders.flatMap(function (under) {
|
|
152
|
+
return (0, Effect_1.getEffectGradientBackgrounds)(theme, gradient.colors, true, (0, colors_2.getColorAtAlpha)(main, 0.2), under);
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
backgrounds: painted,
|
|
156
|
+
text: (0, colors_2.isAchromatic)(main)
|
|
157
|
+
? (0, colors_2.getReadableColorOn)(painted, state === 'rest')
|
|
158
|
+
: (0, colors_2.getReadableAccentColorOn)((0, colors_2.getSaturatedTint)(main, tintAmount), painted),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// as the effect draws it: its colors at rest, each a step lighter hovered or pressed
|
|
162
|
+
fills = state === 'rest' ? stops : stops.map(function (stop) { return (0, colors_2.changeLightness)(stop, 0.05); });
|
|
163
|
+
}
|
|
164
|
+
else if (state === 'active') {
|
|
165
|
+
fills = [(0, colors_2.changeLightness)(main, 0.1)];
|
|
166
|
+
}
|
|
167
|
+
else if (state === 'hover') {
|
|
168
|
+
fills = [getButtonHoverFill(theme, color, main, minimal, transparent)];
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
fills = [getButtonRestFill(color, main, minimal, transparent)];
|
|
172
|
+
}
|
|
173
|
+
var backgrounds = unders.flatMap(function (under) {
|
|
174
|
+
return fills.map(function (fill) { return (fill === 'transparent' ? under : (0, colors_2.getDrawnColor)(fill, under)); });
|
|
175
|
+
});
|
|
176
|
+
var dim = state === 'rest';
|
|
177
|
+
var text;
|
|
178
|
+
if (outlined && state !== 'active' && !(0, colors_2.isAchromatic)(main)) {
|
|
179
|
+
// a color the helpers cannot read (a CSS variable) is as it is given: the text is written in it
|
|
180
|
+
text = (0, colors_2.getReadableAccentColorOn)((0, colors_2.getSaturatedTint)(main, tintAmount), backgrounds);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
text = (0, colors_2.getReadableColorOn)(backgrounds, dim);
|
|
184
|
+
}
|
|
185
|
+
return { backgrounds: backgrounds, text: text };
|
|
186
|
+
};
|
|
187
|
+
exports.getButtonColors = getButtonColors;
|
|
188
|
+
/**
|
|
189
|
+
* The fill a button paints at rest: nothing when transparent, a wash of its color when minimal (one the helpers
|
|
190
|
+
* cannot read, a CSS variable, is washed by the browser), else its color.
|
|
191
|
+
*/
|
|
192
|
+
var getButtonRestFill = function (color, main, minimal, transparent) { return (transparent ? 'transparent' : minimal ? (0, colors_2.getColorAtAlpha)(main, 0.2) : color || main); };
|
|
193
|
+
/** The fill a button paints hovered: a stronger wash when minimal or transparent, else its color a step lighter. */
|
|
194
|
+
var getButtonHoverFill = function (theme, color, main, minimal, transparent) {
|
|
122
195
|
return minimal || transparent
|
|
123
|
-
? (0, colors_2.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
196
|
+
? (0, colors_2.getColorAtAlpha)((0, colors_2.changeLightness)(main, 0.1), transparent ? 0.2 : 0.4)
|
|
197
|
+
: (0, colors_2.changeLightness)(getButtonMainColor(theme, color), 0.05);
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* How a button draws an icon, at rest and hovered alike: in its own color (`color`, in a shade that stands out by
|
|
201
|
+
* 3:1) or the button's text color, at `CONTROL_ICON_OPACITY` or as much more as it needs to stand out by 3:1.
|
|
202
|
+
*/
|
|
203
|
+
var getButtonIconLook = function (style, color, active) {
|
|
204
|
+
return getButtonIconLookIn(style.theme, (0, exports.getButtonStateColors)(style, active), color);
|
|
205
|
+
};
|
|
206
|
+
exports.getButtonIconLook = getButtonIconLook;
|
|
207
|
+
/** `getButtonIconLook`, from the button's colors worked out already (`IReqoreButtonStateColors`). */
|
|
208
|
+
var getButtonIconLookIn = function (theme, states, color) {
|
|
209
|
+
var _a, _b, _c;
|
|
210
|
+
// an active button (a selected menu item) is drawn in its fill, hovered or not
|
|
211
|
+
var rest = (_a = states.active) !== null && _a !== void 0 ? _a : states.rest;
|
|
212
|
+
var hover = (_c = (_b = states.active) !== null && _b !== void 0 ? _b : states.hover) !== null && _c !== void 0 ? _c : rest;
|
|
213
|
+
var look = (0, colors_2.getReadableIconLook)(theme, __spreadArray(__spreadArray([], rest.backgrounds, true), hover.backgrounds, true), rest.text, colors_1.CONTROL_ICON_OPACITY, color);
|
|
214
|
+
// hovered, the text (which an icon without a color of its own is drawn in) may be another color
|
|
215
|
+
return look.color
|
|
216
|
+
? look
|
|
217
|
+
: {
|
|
218
|
+
opacity: Math.max(look.opacity, (0, colors_2.getReadableAlpha)(hover.text, hover.backgrounds, colors_1.CONTROL_ICON_OPACITY, colors_2.READABLE_ICON_CONTRAST)),
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* A button's colors in the states it is drawn in (`IReqoreButtonStateColors`): at rest, and hovered or - when it
|
|
223
|
+
* is `active` - active.
|
|
224
|
+
*/
|
|
225
|
+
var getButtonStateColors = function (style, active) { return ({
|
|
226
|
+
rest: (0, exports.getButtonColors)(style),
|
|
227
|
+
hover: active ? undefined : (0, exports.getButtonColors)(style, 'hover'),
|
|
228
|
+
active: active ? (0, exports.getButtonColors)(style, 'active') : undefined,
|
|
229
|
+
}); };
|
|
230
|
+
exports.getButtonStateColors = getButtonStateColors;
|
|
231
|
+
/**
|
|
232
|
+
* Everything a button is painted with (`IReqoreButtonPaint`), from its colors in each state. `description`: whether
|
|
233
|
+
* it has one, whose color is then worked out too.
|
|
234
|
+
*/
|
|
235
|
+
var getButtonPaint = function (style, states, description) {
|
|
236
|
+
var _a, _b, _c;
|
|
237
|
+
var theme = style.theme, color = style.color, minimal = style.minimal, transparent = style.transparent, effect = style.effect;
|
|
238
|
+
var main = getButtonMainColor(theme, color, effect);
|
|
239
|
+
var drawn = (_a = states.active) !== null && _a !== void 0 ? _a : states.rest;
|
|
240
|
+
return {
|
|
241
|
+
background: transparent ? 'transparent' : minimal ? (0, colors_2.getColorAtAlpha)(main, 0.2) : color,
|
|
242
|
+
text: states.rest.text,
|
|
243
|
+
edge: (0, colors_2.changeLightness)(main, 0.1),
|
|
244
|
+
ring: (0, colors_2.changeLightness)(main, 0.25),
|
|
245
|
+
hoverBackground: states.hover
|
|
246
|
+
? getButtonHoverFill(theme, color, main, minimal, transparent)
|
|
247
|
+
: undefined,
|
|
248
|
+
hoverText: (_b = states.hover) === null || _b === void 0 ? void 0 : _b.text,
|
|
249
|
+
activeText: (_c = states.active) === null || _c === void 0 ? void 0 : _c.text,
|
|
250
|
+
activeEdge: (0, colors_2.changeLightness)(main, 0.175),
|
|
251
|
+
activeHoverEdge: (0, colors_2.changeLightness)(main, 0.275),
|
|
252
|
+
// on the button as it is drawn: at rest, or filled when active (a selected menu item)
|
|
253
|
+
description: description
|
|
254
|
+
? (0, colors_2.getReadableFadedColor)(drawn.text, drawn.backgrounds, 0.7)
|
|
255
|
+
: undefined,
|
|
256
|
+
/* hovered, the description is on the hover fill, in the hovered text: faded as far as it reads there. Faded for
|
|
257
|
+
the resting fill, it fell to 3.8:1 on an info button's lighter hover fill (qorus#646) */
|
|
258
|
+
hoverDescription: description && states.hover
|
|
259
|
+
? (0, colors_2.getReadableFadedColor)(states.hover.text, states.hover.backgrounds, 0.7)
|
|
260
|
+
: undefined,
|
|
261
|
+
};
|
|
127
262
|
};
|
|
128
|
-
exports.
|
|
263
|
+
exports.getButtonPaint = getButtonPaint;
|
|
264
|
+
/**
|
|
265
|
+
* What a styled button is painted with: what the button worked out for this render, or - a `StyledButton`
|
|
266
|
+
* rendered on its own - worked out from its props.
|
|
267
|
+
*/
|
|
268
|
+
var getStyledButtonPaint = function (props) {
|
|
269
|
+
var _a;
|
|
270
|
+
return (_a = props.$paint) !== null && _a !== void 0 ? _a : (0, exports.getButtonPaint)(props, (0, exports.getButtonStateColors)(props, props.active), !!props.description);
|
|
271
|
+
};
|
|
272
|
+
exports.StyledAnimatedTextWrapper = styled_1.default.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-width: 5px;\n overflow: hidden;\n position: relative;\n text-align: ", ";\n display: flex;\n flex-flow: column;\n align-items: ", ";\n"], ["\n min-width: 5px;\n overflow: hidden;\n position: relative;\n text-align: ", ";\n display: flex;\n flex-flow: column;\n align-items: ", ";\n"])), function (_a) {
|
|
129
273
|
var textAlign = _a.textAlign;
|
|
130
274
|
return textAlign;
|
|
131
275
|
}, function (_a) {
|
|
132
276
|
var textAlign = _a.textAlign;
|
|
133
277
|
return (0, utils_1.alignToFlexAlign)(textAlign);
|
|
134
278
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Every button prop that only styles the button. None of them reaches the rendered element —
|
|
281
|
+
* the `<button>`, the `<a>`, or a component given as `as` (a router link writes every prop it does
|
|
282
|
+
* not know onto its `<a>`). The compiler checks the record against `IReqoreButtonStyle`, so a new
|
|
283
|
+
* styling prop that is not added here fails the build instead of leaking.
|
|
284
|
+
*/
|
|
285
|
+
exports.REQORE_BUTTON_STYLE_PROPS = (0, styled_1.listReqoreStyleProps)({
|
|
286
|
+
active: true,
|
|
287
|
+
alignSelf: true,
|
|
288
|
+
animate: true,
|
|
289
|
+
animated: true,
|
|
290
|
+
badge: true,
|
|
291
|
+
circle: true,
|
|
292
|
+
compact: true,
|
|
293
|
+
customTheme: true,
|
|
294
|
+
description: true,
|
|
295
|
+
descriptionEffect: true,
|
|
296
|
+
effect: true,
|
|
297
|
+
fixed: true,
|
|
298
|
+
flat: true,
|
|
299
|
+
fluid: true,
|
|
300
|
+
grow: true,
|
|
301
|
+
icon: true,
|
|
302
|
+
iconColor: true,
|
|
303
|
+
iconsAlign: true,
|
|
304
|
+
indicator: true,
|
|
305
|
+
intent: true,
|
|
306
|
+
label: true,
|
|
307
|
+
labelEffect: true,
|
|
308
|
+
leftIconColor: true,
|
|
309
|
+
leftIconProps: true,
|
|
310
|
+
loading: true,
|
|
311
|
+
loadingIconType: true,
|
|
312
|
+
maxWidth: true,
|
|
313
|
+
minimal: true,
|
|
314
|
+
pill: true,
|
|
315
|
+
radiusSize: true,
|
|
316
|
+
raised: true,
|
|
317
|
+
readOnly: true,
|
|
318
|
+
rightIcon: true,
|
|
319
|
+
rightIconColor: true,
|
|
320
|
+
rightIconProps: true,
|
|
321
|
+
rounded: true,
|
|
322
|
+
shortcut: true,
|
|
323
|
+
shortcutHint: true,
|
|
324
|
+
shrink: true,
|
|
325
|
+
size: true,
|
|
326
|
+
skeleton: true,
|
|
327
|
+
square: true,
|
|
328
|
+
textAlign: true,
|
|
329
|
+
theme: true,
|
|
330
|
+
tooltip: true,
|
|
331
|
+
transparent: true,
|
|
332
|
+
verticalPadding: true,
|
|
333
|
+
wrap: true,
|
|
334
|
+
});
|
|
335
|
+
exports.StyledButton = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
336
|
+
// Its own styling props, and the layout flags a containing ControlGroup hands it (`fill`, its
|
|
337
|
+
// place in a stack, ...); `color` is the button's colour, read by its styles.
|
|
338
|
+
shouldForwardProp: styled_1.omitStyleProps.apply(void 0, __spreadArray(__spreadArray(__spreadArray([], exports.REQORE_BUTTON_STYLE_PROPS, false), styled_1.REQORE_CONTROL_GROUP_CHILD_PROPS, false), ['color'], false)),
|
|
339
|
+
})(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: flex;\n flex-flow: column;\n justify-content: center;\n /* The page's font (or the theme's, which the layout sets), not the browser's control font:\n a button left to the user-agent stylesheet renders in the platform's form-control face\n whatever font the text around it is in. */\n font-family: inherit;\n font-weight: 570;\n position: relative;\n overflow: hidden;\n vertical-align: middle;\n border: ", ";\n padding: ", ";\n font-size: ", "px;\n outline-offset: -2px;\n\n min-height: ", "px;\n min-width: ", "px;\n ", "\n max-width: ", ";\n\n ", "\n\n flex: ", ";\n flex-shrink: ", ";\n flex-grow: ", ";\n align-self: ", ";\n\n border-radius: ", ";\n\n background-color: ", ";\n\n color: ", ";\n\n ", ";\n\n ", "\n\n ", ";\n\n ", ";\n\n &:disabled {\n ", ";\n }\n\n ", "\n\n &:focus,\n &:active {\n outline: 2px solid ", ";\n border-color: ", ";\n }\n\n .reqore-button-description {\n padding-top: ", "px;\n /* on the button as it is drawn: at rest, or filled when active (a selected menu item) */\n color: ", ";\n }\n"], ["\n display: flex;\n flex-flow: column;\n justify-content: center;\n /* The page's font (or the theme's, which the layout sets), not the browser's control font:\n a button left to the user-agent stylesheet renders in the platform's form-control face\n whatever font the text around it is in. */\n font-family: inherit;\n font-weight: 570;\n position: relative;\n overflow: hidden;\n vertical-align: middle;\n border: ", ";\n padding: ", ";\n font-size: ", "px;\n outline-offset: -2px;\n\n min-height: ", "px;\n min-width: ", "px;\n ", "\n max-width: ", ";\n\n ", "\n\n flex: ", ";\n flex-shrink: ", ";\n flex-grow: ", ";\n align-self: ", ";\n\n border-radius: ", ";\n\n background-color: ", ";\n\n color: ", ";\n\n ", ";\n\n ", "\n\n ", ";\n\n ", ";\n\n &:disabled {\n ", ";\n }\n\n ", "\n\n &:focus,\n &:active {\n outline: 2px solid ", ";\n border-color: ", ";\n }\n\n .reqore-button-description {\n padding-top: ", "px;\n /* on the button as it is drawn: at rest, or filled when active (a selected menu item) */\n color: ", ";\n }\n"])), function (props) {
|
|
340
|
+
return !props.flat ? "1px solid ".concat(getStyledButtonPaint(props).edge) : 0;
|
|
144
341
|
}, function (_a) {
|
|
145
342
|
var size = _a.size, compact = _a.compact, _b = _a.verticalPadding, verticalPadding = _b === void 0 ? 'normal' : _b, square = _a.square;
|
|
146
343
|
return "".concat(sizes_1.CONTROL_VERTICAL_PADDING_FROM_SIZE[size] +
|
|
@@ -196,79 +393,43 @@ exports.StyledButton = (0, styled_components_1.default)(Effect_1.StyledEffect).w
|
|
|
196
393
|
: circle
|
|
197
394
|
? '9999px'
|
|
198
395
|
: "".concat((0, sizes_1.resolveRadius)(size, radiusSize) * (pill ? sizes_1.PILL_RADIUS_MODIFIER : 1), "px");
|
|
199
|
-
}, function (_a) {
|
|
200
|
-
var minimal = _a.minimal, color = _a.color, theme = _a.theme, transparent = _a.transparent, effect = _a.effect;
|
|
201
|
-
if (transparent) {
|
|
202
|
-
return 'transparent';
|
|
203
|
-
}
|
|
204
|
-
if (minimal) {
|
|
205
|
-
return (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), (0, polished_1.rgba)(getButtonMainColor(theme, color, effect), 0.2));
|
|
206
|
-
}
|
|
207
|
-
return color;
|
|
208
|
-
}, function (_a) {
|
|
209
|
-
var color = _a.color, minimal = _a.minimal, transparent = _a.transparent, theme = _a.theme, effect = _a.effect;
|
|
210
|
-
var finalColor = getButtonMainColor(theme, color, effect);
|
|
211
|
-
return getButtonTextColor({ minimal: minimal, transparent: transparent, color: finalColor, theme: theme });
|
|
212
|
-
}, styles_1.InactiveIconScale, function (_a) {
|
|
396
|
+
}, function (props) { return getStyledButtonPaint(props).background; }, function (props) { return getStyledButtonPaint(props).text; }, styles_1.InactiveIconScale, function (_a) {
|
|
213
397
|
var raised = _a.raised, flat = _a.flat, transparent = _a.transparent;
|
|
214
398
|
return raised && flat && !transparent && styles_1.RaisedElement;
|
|
215
|
-
}, function (
|
|
216
|
-
var readOnly =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return minimal || transparent
|
|
230
|
-
? (0, colors_2.isAchromatic)(finalColor)
|
|
231
|
-
? (0, colors_2.getReadableColorFrom)(theme.originalMain)
|
|
232
|
-
: (0, polished_1.saturate)(1, (0, polished_1.tint)(0.9, finalColor))
|
|
233
|
-
: (0, colors_2.getReadableColorFrom)(finalColor);
|
|
234
|
-
}, animate
|
|
235
|
-
? (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n cursor: pointer;\n\n ", " {\n transform: translateY(150%);\n filter: blur(10px);\n opacity: 0;\n }\n\n ", " {\n transform: translateY(0px);\n filter: blur(0);\n opacity: 1;\n }\n "], ["\n cursor: pointer;\n\n ", " {\n transform: translateY(150%);\n filter: blur(10px);\n opacity: 0;\n }\n\n ", " {\n transform: translateY(0px);\n filter: blur(0);\n opacity: 1;\n }\n "])), styles_1.StyledInActiveContent, styles_1.StyledActiveContent) : undefined) : readOnly
|
|
236
|
-
? (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", ";\n "], ["\n ", ";\n "])), styles_1.ReadOnlyElement) : undefined;
|
|
237
|
-
}, function (_a) {
|
|
238
|
-
var active = _a.active, flat = _a.flat, theme = _a.theme, color = _a.color, effect = _a.effect;
|
|
239
|
-
if (active) {
|
|
240
|
-
return (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n &:hover,\n &:active,\n &:focus {\n border-color: ", ";\n }\n\n ", "\n "], ["\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n &:hover,\n &:active,\n &:focus {\n border-color: ", ";\n }\n\n ", "\n "])), (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.1), (0, colors_2.getReadableColor)({ main: (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.1) }, undefined, undefined), flat
|
|
241
|
-
? undefined
|
|
242
|
-
: (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.175), flat
|
|
243
|
-
? undefined
|
|
244
|
-
: (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.275), styles_1.ActiveIconScale);
|
|
399
|
+
}, function (props) {
|
|
400
|
+
var readOnly = props.readOnly, animate = props.animate, active = props.active, flat = props.flat;
|
|
401
|
+
if (readOnly || active) {
|
|
402
|
+
return readOnly
|
|
403
|
+
? (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", ";\n "], ["\n ", ";\n "])), styles_1.ReadOnlyElement) : undefined;
|
|
404
|
+
}
|
|
405
|
+
var _a = getStyledButtonPaint(props), ring = _a.ring, hoverBackground = _a.hoverBackground, hoverText = _a.hoverText, hoverDescription = _a.hoverDescription;
|
|
406
|
+
return (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n &:not(:disabled) {\n ", "\n\n cursor: pointer;\n transition: all 0.2s ease-out;\n\n &:active {\n outline: 3px solid ", ";\n outline-offset: -3px;\n transition: none;\n }\n\n &:hover:not(:active) {\n outline: 2px solid ", ";\n transition: none;\n }\n\n &:hover,\n &:active {\n border-color: ", ";\n background-color: ", ";\n /* Ended here: the animated content's rules below ran on into this declaration, which the\n browser then dropped - a hovered button kept its resting text on its hovered fill. */\n color: ", ";\n\n .reqore-button-description {\n color: ", ";\n }\n\n ", ";\n }\n }\n "], ["\n &:not(:disabled) {\n ", "\n\n cursor: pointer;\n transition: all 0.2s ease-out;\n\n &:active {\n outline: 3px solid ", ";\n outline-offset: -3px;\n transition: none;\n }\n\n &:hover:not(:active) {\n outline: 2px solid ", ";\n transition: none;\n }\n\n &:hover,\n &:active {\n border-color: ", ";\n background-color: ", ";\n /* Ended here: the animated content's rules below ran on into this declaration, which the\n browser then dropped - a hovered button kept its resting text on its hovered fill. */\n color: ", ";\n\n .reqore-button-description {\n color: ", ";\n }\n\n ", ";\n }\n }\n "])), styles_1.ScaleIconOnHover, ring, ring, flat ? undefined : ring, hoverBackground, hoverText, hoverDescription, animate
|
|
407
|
+
? (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n cursor: pointer;\n\n ", " {\n transform: translateY(150%);\n filter: blur(10px);\n opacity: 0;\n }\n\n ", " {\n transform: translateY(0px);\n filter: blur(0);\n opacity: 1;\n }\n "], ["\n cursor: pointer;\n\n ", " {\n transform: translateY(150%);\n filter: blur(10px);\n opacity: 0;\n }\n\n ", " {\n transform: translateY(0px);\n filter: blur(0);\n opacity: 1;\n }\n "])), styles_1.StyledInActiveContent, styles_1.StyledActiveContent) : undefined);
|
|
408
|
+
}, function (props) {
|
|
409
|
+
if (props.active) {
|
|
410
|
+
var flat = props.flat;
|
|
411
|
+
var _a = getStyledButtonPaint(props), edge = _a.edge, activeText = _a.activeText, activeEdge = _a.activeEdge, activeHoverEdge = _a.activeHoverEdge;
|
|
412
|
+
return (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n &:hover,\n &:active,\n &:focus {\n border-color: ", ";\n }\n\n ", "\n "], ["\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n &:hover,\n &:active,\n &:focus {\n border-color: ", ";\n }\n\n ", "\n "])), edge, activeText, flat ? undefined : activeEdge, flat ? undefined : activeHoverEdge, styles_1.ActiveIconScale);
|
|
245
413
|
}
|
|
246
414
|
}, styles_1.DisabledElement, function (_a) {
|
|
247
415
|
var $isLink = _a.$isLink;
|
|
248
416
|
return $isLink
|
|
249
|
-
? (0, styled_components_1.css)(
|
|
250
|
-
}, function (
|
|
251
|
-
|
|
252
|
-
return (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.1);
|
|
253
|
-
}, function (_a) {
|
|
254
|
-
var minimal = _a.minimal, theme = _a.theme, color = _a.color, effect = _a.effect;
|
|
255
|
-
return minimal ? undefined : (0, colors_2.changeLightness)(getButtonMainColor(theme, color, effect), 0.1);
|
|
417
|
+
? (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n text-decoration: none;\n\n /* A link has no :disabled; a disabled one says so with aria-disabled. */\n &[aria-disabled='true'] {\n ", ";\n }\n "], ["\n text-decoration: none;\n\n /* A link has no :disabled; a disabled one says so with aria-disabled. */\n &[aria-disabled='true'] {\n ", ";\n }\n "])), styles_1.DisabledElement) : undefined;
|
|
418
|
+
}, function (props) { return getStyledButtonPaint(props).edge; }, function (props) {
|
|
419
|
+
return props.minimal ? undefined : getStyledButtonPaint(props).edge;
|
|
256
420
|
}, function (_a) {
|
|
257
421
|
var size = _a.size;
|
|
258
422
|
return sizes_1.PADDING_FROM_SIZE[size] / 2;
|
|
259
|
-
}, function (
|
|
260
|
-
|
|
261
|
-
return (0, polished_1.rgba)(getButtonTextColor({ minimal: minimal, transparent: transparent, color: color, theme: theme }), 0.7);
|
|
262
|
-
});
|
|
263
|
-
exports.StyledButtonContent = styled_components_1.default.div.withConfig({
|
|
423
|
+
}, function (props) { return getStyledButtonPaint(props).description; });
|
|
424
|
+
exports.StyledButtonContent = styled_1.default.div.withConfig({
|
|
264
425
|
shouldForwardProp: (0, styled_1.omitStyleProps)('wrap'),
|
|
265
|
-
})(
|
|
426
|
+
})(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n min-width: ", "px;\n flex: 1;\n flex-shrink: 0;\n\n ", "\n"], ["\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n min-width: ", "px;\n flex: 1;\n flex-shrink: 0;\n\n ", "\n"])), function (_a) {
|
|
266
427
|
var size = _a.size;
|
|
267
428
|
return sizes_1.ICON_FROM_SIZE[size];
|
|
268
429
|
}, function (_a) {
|
|
269
430
|
var wrap = _a.wrap, description = _a.description;
|
|
270
431
|
return !wrap && !description
|
|
271
|
-
? (0, styled_components_1.css)(
|
|
432
|
+
? (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n max-height: ", "px;\n "], ["\n max-height: ", "px;\n "])), function (_a) {
|
|
272
433
|
var size = _a.size;
|
|
273
434
|
return sizes_1.SIZE_TO_PX[size];
|
|
274
435
|
}) : null;
|
|
@@ -321,13 +482,14 @@ exports.ButtonBadge = (0, react_1.memo)(function (_a) {
|
|
|
321
482
|
* Primary Reqore button component that supports intents, icons, and badges.
|
|
322
483
|
*/
|
|
323
484
|
var ReqoreButton = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, ref) {
|
|
324
|
-
var _b, _c, _d;
|
|
325
|
-
var icon = _a.icon,
|
|
485
|
+
var _b, _c, _d, _e, _f, _g;
|
|
486
|
+
var icon = _a.icon, _h = _a.size, size = _h === void 0 ? 'normal' : _h, minimal = _a.minimal, transparent = _a.transparent, children = _a.children, tooltip = _a.tooltip, className = _a.className, fluid = _a.fluid, fixed = _a.fixed, alignSelf = _a.alignSelf, intent = _a.intent, active = _a.active, flat = _a.flat, rightIcon = _a.rightIcon, customTheme = _a.customTheme, wrap = _a.wrap, readOnly = _a.readOnly, badge = _a.badge, indicator = _a.indicator, description = _a.description, maxWidth = _a.maxWidth, textAlignProp = _a.textAlign, effect = _a.effect, labelEffect = _a.labelEffect, descriptionEffect = _a.descriptionEffect, leftIconColor = _a.leftIconColor, rightIconColor = _a.rightIconColor, iconColor = _a.iconColor, iconsAlignProp = _a.iconsAlign, leftIconProps = _a.leftIconProps, rightIconProps = _a.rightIconProps, label = _a.label, compact = _a.compact, square = _a.square, as = _a.as, animated = _a.animated, loading = _a.loading, shortcut = _a.shortcut, shortcutHint = _a.shortcutHint, loadingIconType = _a.loadingIconType, href = _a.href, type = _a.type, rest = __rest(_a, ["icon", "size", "minimal", "transparent", "children", "tooltip", "className", "fluid", "fixed", "alignSelf", "intent", "active", "flat", "rightIcon", "customTheme", "wrap", "readOnly", "badge", "indicator", "description", "maxWidth", "textAlign", "effect", "labelEffect", "descriptionEffect", "leftIconColor", "rightIconColor", "iconColor", "iconsAlign", "leftIconProps", "rightIconProps", "label", "compact", "square", "as", "animated", "loading", "shortcut", "shortcutHint", "loadingIconType", "href", "type"]);
|
|
326
487
|
var animations = (0, useReqoreContext_1.useReqoreProperty)('animations');
|
|
327
488
|
var shortcutHintsEnabled = (0, useReqoreContext_1.useReqoreProperty)('shortcutHints');
|
|
328
489
|
var theme = (0, useTheme_1.useReqoreTheme)('main', customTheme, intent);
|
|
490
|
+
var surface = (0, SurfaceContext_1.useReqoreSurface)();
|
|
329
491
|
var fixedEffect = (0, useReqoreEffect_1.useReqoreEffect)('buttons', theme, effect);
|
|
330
|
-
var
|
|
492
|
+
var _j = (0, useCombinedRefs_1.useCombinedRefs)(ref), targetRef = _j.targetRef, setRef = _j.setRef;
|
|
331
493
|
// Square chips have no horizontal padding, so the content would
|
|
332
494
|
// stick to the left edge if we kept `textAlign`'s usual `'left'`
|
|
333
495
|
// default. Default `textAlign` and `iconsAlign` to `'center'` for
|
|
@@ -366,6 +528,17 @@ var ReqoreButton = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, ref)
|
|
|
366
528
|
var customColor = (0, react_1.useMemo)(function () { return (intent ? theme.main : (0, colors_2.changeLightness)(theme.main, 0.07)); }, [intent, theme.main]);
|
|
367
529
|
var _flat = minimal ? flat : flat === true;
|
|
368
530
|
var _children = (0, react_1.useMemo)(function () { return label || children; }, [label, children]);
|
|
531
|
+
/* An icon alone names nothing: a button with no label of its own and no `aria-label` was read as
|
|
532
|
+
"button", and a test that finds buttons by name found nothing to test (qorus#646). Its tooltip, when
|
|
533
|
+
that is a string, is the words it would say, so it names it. A tooltip that is a node or an object is
|
|
534
|
+
left to the caller, and a button that has a label, or is named already, is not named twice. */
|
|
535
|
+
var tooltipName = !_children &&
|
|
536
|
+
!rest['aria-label'] &&
|
|
537
|
+
!rest['aria-labelledby'] &&
|
|
538
|
+
typeof tooltip === 'string' &&
|
|
539
|
+
tooltip.trim()
|
|
540
|
+
? tooltip
|
|
541
|
+
: undefined;
|
|
369
542
|
var _compact = (_c = compact !== null && compact !== void 0 ? compact : (_b = theme.buttons) === null || _b === void 0 ? void 0 : _b.compact) !== null && _c !== void 0 ? _c : !children;
|
|
370
543
|
var hasLeftIcon = icon || (leftIconProps === null || leftIconProps === void 0 ? void 0 : leftIconProps.image);
|
|
371
544
|
var hasRightIcon = rightIcon || (rightIconProps === null || rightIconProps === void 0 ? void 0 : rightIconProps.image);
|
|
@@ -382,6 +555,46 @@ var ReqoreButton = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, ref)
|
|
|
382
555
|
? "Loader".concat(loadingIconType || '', "Line")
|
|
383
556
|
: icon || (leftIconProps === null || leftIconProps === void 0 ? void 0 : leftIconProps.icon);
|
|
384
557
|
var memoEffect = (0, react_1.useMemo)(function () { return (__assign(__assign({ interactive: !readOnly && !rest.disabled }, fixedEffect), { gradient: intent ? undefined : fixedEffect === null || fixedEffect === void 0 ? void 0 : fixedEffect.gradient })); }, [fixedEffect, intent, readOnly, rest.disabled]);
|
|
558
|
+
/* The button's colors depend on its gradient alone of its effect: an effect the caller writes inline (a new
|
|
559
|
+
object each render) with the same gradient keeps them. */
|
|
560
|
+
var gradientKey = (memoEffect === null || memoEffect === void 0 ? void 0 : memoEffect.gradient) ? JSON.stringify(memoEffect.gradient) : undefined;
|
|
561
|
+
// The icons stand out from what the button is drawn on, as its text does.
|
|
562
|
+
var colorProps = (0, react_1.useMemo)(function () { return ({
|
|
563
|
+
theme: theme,
|
|
564
|
+
color: customColor,
|
|
565
|
+
minimal: minimal,
|
|
566
|
+
transparent: transparent,
|
|
567
|
+
effect: memoEffect,
|
|
568
|
+
$surface: surface,
|
|
569
|
+
}); }, [theme, customColor, minimal, transparent, gradientKey, surface]);
|
|
570
|
+
/* Its colors in the states it is drawn in, and what its styles paint it with, worked out once per render
|
|
571
|
+
rather than in each of its style rules. */
|
|
572
|
+
var states = (0, react_1.useMemo)(function () { return (0, exports.getButtonStateColors)(colorProps, active); }, [colorProps, active]);
|
|
573
|
+
// whether it has a description, not the description: a node given inline is new each render
|
|
574
|
+
var hasDescription = !!description;
|
|
575
|
+
var paint = (0, react_1.useMemo)(function () { return (0, exports.getButtonPaint)(colorProps, states, hasDescription); }, [colorProps, states, hasDescription]);
|
|
576
|
+
// an icon's own color: in its props (which win, as they are spread over the rest), else the button's
|
|
577
|
+
var _k = (0, iconProps_1.splitIconColor)(leftIconProps), leftIconPropsColor = _k[0], leftIconRest = _k[1];
|
|
578
|
+
var _l = (0, iconProps_1.splitIconColor)(rightIconProps), rightIconPropsColor = _l[0], rightIconRest = _l[1];
|
|
579
|
+
var leftIconOwn = leftIconPropsColor || leftIconColor || iconColor;
|
|
580
|
+
var rightIconOwn = rightIconPropsColor || rightIconColor || iconColor;
|
|
581
|
+
// only for the icons the button draws
|
|
582
|
+
var leftIconLook = (0, react_1.useMemo)(function () { return (hasLeftIcon ? getButtonIconLookIn(theme, states, leftIconOwn) : undefined); }, [hasLeftIcon, theme, states, leftIconOwn]);
|
|
583
|
+
var rightIconLook = (0, react_1.useMemo)(function () { return (hasRightIcon ? getButtonIconLookIn(theme, states, rightIconOwn) : undefined); }, [hasRightIcon, theme, states, rightIconOwn]);
|
|
584
|
+
/* What the button holds (its badges, a label given as a node) is drawn on the button: at rest, or in its
|
|
585
|
+
fill when it is active (a selected menu item, whose badges were picked for the resting wash). */
|
|
586
|
+
var restingBackground = ((_d = states.active) !== null && _d !== void 0 ? _d : states.rest).backgrounds;
|
|
587
|
+
/* Its effect's color is written on its own fill, at rest and hovered (or active), not on the surface
|
|
588
|
+
around it: an info text on a success button was read on the page, 2.7:1 on the green. */
|
|
589
|
+
var fillBackgrounds = (0, react_1.useMemo)(function () {
|
|
590
|
+
var _a, _b;
|
|
591
|
+
return states.active
|
|
592
|
+
? states.active.backgrounds
|
|
593
|
+
: __spreadArray(__spreadArray([], states.rest.backgrounds, true), ((_b = (_a = states.hover) === null || _a === void 0 ? void 0 : _a.backgrounds) !== null && _b !== void 0 ? _b : []), true);
|
|
594
|
+
}, [states]);
|
|
595
|
+
// one object for as long as the opacity holds: an icon is a memo component
|
|
596
|
+
var leftIconEffect = (0, react_1.useMemo)(function () { return ({ opacity: leftIconLook === null || leftIconLook === void 0 ? void 0 : leftIconLook.opacity }); }, [leftIconLook === null || leftIconLook === void 0 ? void 0 : leftIconLook.opacity]);
|
|
597
|
+
var rightIconEffect = (0, react_1.useMemo)(function () { return ({ opacity: rightIconLook === null || rightIconLook === void 0 ? void 0 : rightIconLook.opacity }); }, [rightIconLook === null || rightIconLook === void 0 ? void 0 : rightIconLook.opacity]);
|
|
385
598
|
var indicatorConfig = (0, react_1.useMemo)(function () {
|
|
386
599
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
387
600
|
if (!indicator) {
|
|
@@ -397,37 +610,38 @@ var ReqoreButton = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, ref)
|
|
|
397
610
|
pulse: (_g = config.pulse) !== null && _g !== void 0 ? _g : false,
|
|
398
611
|
};
|
|
399
612
|
}, [indicator, size, theme.intents]);
|
|
400
|
-
return ((0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, rest, { effect: memoEffect,
|
|
613
|
+
return ((0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, rest, (tooltipName ? { 'aria-label': tooltipName } : {}), { effect: memoEffect,
|
|
401
614
|
// The caller's tab stop wins — a grid or a diagram keeps one of its
|
|
402
615
|
// buttons in the tab order and moves it — except that a disabled
|
|
403
616
|
// button is never one.
|
|
404
|
-
tabIndex: rest.disabled ? -1 : ((
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
? {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
617
|
+
tabIndex: rest.disabled ? -1 : ((_e = rest.tabIndex) !== null && _e !== void 0 ? _e : 0) }, elementProps, { as: element, theme: theme, fluid: fluid, fixed: fixed, alignSelf: alignSelf, maxWidth: maxWidth, minimal: minimal, transparent: transparent, size: size, intent: intent, color: customColor,
|
|
618
|
+
$surface: surface,
|
|
619
|
+
$backgrounds: fillBackgrounds,
|
|
620
|
+
$paint: paint, animate: animate, flat: _flat, active: active, readOnly: readOnly || loading, wrap: wrap, description: description, className: "".concat(className || '', " reqore-control reqore-button"),
|
|
621
|
+
compact: _compact, square: square, tooltip: tooltip }, useMarqueeOnHover_1.REQORE_MARQUEE_HOST, { Component: exports.StyledButton, ref: setRef, children: [(0, jsx_runtime_1.jsxs)(SurfaceContext_1.ReqoreSurfaceProvider, { color: restingBackground, children: [(0, jsx_runtime_1.jsxs)(exports.StyledButtonContent, { size: size, wrap: wrap, description: description, flat: _flat, children: [hasLeftIcon ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ size: size, color: (_f = leftIconLook === null || leftIconLook === void 0 ? void 0 : leftIconLook.color) !== null && _f !== void 0 ? _f : leftIconOwn, compact: true, effect: leftIconEffect }, leftIconRest, { style: textAlign !== 'left' || iconsAlign === 'center' || !_children
|
|
622
|
+
? {
|
|
623
|
+
marginRight: iconsAlign !== 'center' || !_children ? 'auto' : undefined,
|
|
624
|
+
marginLeft: iconsAlign === 'center' ||
|
|
625
|
+
!_children ||
|
|
626
|
+
(textAlign === 'center' && !_children)
|
|
627
|
+
? 'auto'
|
|
628
|
+
: undefined,
|
|
629
|
+
}
|
|
630
|
+
: undefined, animation: loading ? 'spin' : leftIconProps === null || leftIconProps === void 0 ? void 0 : leftIconProps.animation, icon: leftIcon })), _children || hasRightIcon ? ((0, jsx_runtime_1.jsx)(Spacer_1.ReqoreSpacer, { width: sizes_1.PADDING_FROM_SIZE[size] / 2 })) : null] })) : _children ? ((0, jsx_runtime_1.jsx)(Spacer_1.ReqoreHorizontalSpacer, { width: 1, style: textAlign !== 'left' ? { marginRight: 'auto' } : undefined })) : null, _children && ((0, jsx_runtime_1.jsxs)(exports.StyledAnimatedTextWrapper, { textAlign: textAlign, style: textAlign === 'center' && iconsAlign !== 'center'
|
|
631
|
+
? { margin: 'auto' }
|
|
632
|
+
: undefined, children: [!animate && ((0, jsx_runtime_1.jsx)(styles_1.StyledContent, __assign({ wrap: wrap, effect: labelEffect, className: 'reqore-button-text-content' }, useMarqueeOnHover_1.REQORE_MARQUEE_TEXT, { children: _children }))), animate && ((0, jsx_runtime_1.jsx)(styles_1.StyledActiveContent, __assign({ wrap: wrap, effect: labelEffect, className: 'reqore-button-text-content reqore-animated reqore-active' }, useMarqueeOnHover_1.REQORE_MARQUEE_TEXT, { children: _children }))), animate && ((0, jsx_runtime_1.jsx)(styles_1.StyledInActiveContent, __assign({ wrap: wrap, effect: labelEffect, className: 'reqore-button-text-content reqore-animated reqore-inactive' }, useMarqueeOnHover_1.REQORE_MARQUEE_TEXT, { "aria-hidden": 'true', children: _children }))), animate && ((0, jsx_runtime_1.jsx)(styles_1.StyledInvisibleContent, { wrap: wrap, effect: labelEffect, className: 'reqore-button-text-content reqore-animated reqore-invisible', "aria-hidden": 'true', children: _children })), (badge || badge === 0) && wrap ? ((0, jsx_runtime_1.jsx)(exports.ButtonBadge, { content: badge, size: size, wrap: true, active: active })) : null] })), (badge || badge === 0) && !wrap ? ((0, jsx_runtime_1.jsx)(exports.ButtonBadge, { content: badge, size: size, compact: _compact, wrapGroup: false, wrap: false, active: active })) : null, !hasRightIcon ? (_children ? ((0, jsx_runtime_1.jsx)(Spacer_1.ReqoreHorizontalSpacer, { width: 1, style: textAlign !== 'right' && !hasRightAlignedBadge
|
|
633
|
+
? { marginLeft: 'auto' }
|
|
634
|
+
: undefined })) : null) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [_children || badge ? (0, jsx_runtime_1.jsx)(Spacer_1.ReqoreSpacer, { width: sizes_1.PADDING_FROM_SIZE[size] / 2 }) : null, (0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ icon: rightIcon, size: size, color: (_g = rightIconLook === null || rightIconLook === void 0 ? void 0 : rightIconLook.color) !== null && _g !== void 0 ? _g : rightIconOwn, effect: rightIconEffect }, rightIconRest, { style: textAlign !== 'right' || iconsAlign === 'center'
|
|
635
|
+
? {
|
|
636
|
+
marginLeft: !hasRightAlignedBadge && (iconsAlign !== 'center' || !_children)
|
|
637
|
+
? 'auto'
|
|
638
|
+
: undefined,
|
|
639
|
+
marginRight: iconsAlign === 'center' || (textAlign === 'center' && !_children)
|
|
640
|
+
? 'auto'
|
|
641
|
+
: undefined,
|
|
642
|
+
}
|
|
643
|
+
: undefined }))] })), showShortcutHint ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacer_1.ReqoreSpacer, { width: sizes_1.PADDING_FROM_SIZE[size] / 2 }), (0, jsx_runtime_1.jsx)(KeyboardShortcut_1.ReqoreKeyboardShortcut, { shortcut: shortcut, size: size, compact: _compact })] })) : null] }), description && ((0, jsx_runtime_1.jsx)(Effect_1.ReqoreTextEffect, { className: 'reqore-button-description', effect: __assign({ textSize: (0, utils_1.getOneLessSize)(size), weight: 'light', textAlign: textAlign }, descriptionEffect), children: description }))] }), indicatorConfig && ((0, jsx_runtime_1.jsx)(exports.StyledButtonIndicator, { className: 'reqore-button-indicator', "$color": indicatorConfig.color, "$diameter": indicatorConfig.diameter, "$offset": indicatorConfig.offset, "$position": indicatorConfig.position, "$pulse": indicatorConfig.pulse, "aria-hidden": 'true' }))] })));
|
|
430
644
|
}));
|
|
431
645
|
exports.default = ReqoreButton;
|
|
432
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15
|
|
646
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
433
647
|
//# sourceMappingURL=index.js.map
|