@fibery/ui-kit 1.36.2 → 1.38.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 +20 -0
- package/package.json +8 -5
- package/src/action-badge.tsx +5 -4
- package/src/actions-menu/actions-menu-confirmation.tsx +1 -12
- package/src/actions-menu/actions-menu-item.tsx +19 -7
- package/src/actions-menu/actions-menu-props.tsx +4 -0
- package/src/actions-menu/actions-menu-sub-command-menu.tsx +7 -4
- package/src/actions-menu/actions-menu-sub-menu.tsx +9 -3
- package/src/actions-menu/actions-menu.tsx +24 -8
- package/src/actions-panel.tsx +12 -2
- package/src/antd/ant-modal.tsx +17 -2
- package/src/antd/input.tsx +4 -3
- package/src/app-icon-with-fallback.tsx +5 -8
- package/src/app-icon-wrapper.tsx +4 -4
- package/src/appIcons.json +20 -0
- package/src/axis-header.tsx +136 -76
- package/src/badge.tsx +14 -7
- package/src/beta-badge.tsx +12 -8
- package/src/box.tsx +1 -1
- package/src/breadcrumb.tsx +78 -0
- package/src/button/actions-button-compact.tsx +5 -2
- package/src/button/base-button.tsx +7 -4
- package/src/button/button-group.tsx +1 -1
- package/src/button/button.tsx +120 -2
- package/src/button/icon-button.tsx +13 -2
- package/src/button/select-button.tsx +27 -8
- package/src/card-container.tsx +36 -69
- package/src/card-hidden-link.tsx +52 -0
- package/src/collapsible-section.tsx +13 -3
- package/src/color-picker/index.js +65 -60
- package/src/color-picker/swatch.tsx +29 -14
- package/src/command-menu/index.tsx +5 -5
- package/src/context-menu/index.tsx +10 -1
- package/src/count-badge.tsx +57 -0
- package/src/date-picker/date-range-input.tsx +1 -1
- package/src/date-picker/date-range-picker.tsx +6 -3
- package/src/date-picker/fake-date-input.tsx +1 -1
- package/src/date-picker/relative-date-picker.tsx +7 -3
- package/src/date-picker/single-date-input.tsx +1 -1
- package/src/date-picker/single-date-picker.tsx +8 -5
- package/src/date-picker/styles.ts +32 -26
- package/src/date-picker/types.ts +3 -1
- package/src/date-picker/utils.ts +9 -2
- package/src/day-select/day-select.tsx +21 -75
- package/src/day-select/iso-week-day-select.tsx +1 -1
- package/src/day-select/mount-day-select.tsx +2 -2
- package/src/day-select/week-day-select.tsx +1 -5
- package/src/design-system.ts +91 -51
- package/src/dropdown-menu/index.tsx +8 -1
- package/src/emoji-picker/app-icon-picker.tsx +6 -4
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +3 -9
- package/src/emoji-picker/emoji-picker-preview-footer.tsx +1 -1
- package/src/emoji-picker/emoji-picker.tsx +3 -0
- package/src/emoji-picker/emoji.tsx +2 -1
- package/src/emoji-picker/icon-emoji-picker.tsx +83 -68
- package/src/emoji-picker/primitives/footer.tsx +0 -1
- package/src/emoji-picker/primitives/header.tsx +1 -0
- package/src/emoji-picker/primitives/search.tsx +12 -13
- package/src/emoji-picker/primitives/skin-tone.tsx +1 -0
- package/src/emoji-picker/use-responsive-emoji-size.ts +11 -0
- package/src/emoji-picker/utils/emoji-set.ts +2 -1
- package/src/empty-state/empty-state.tsx +6 -0
- package/src/error-alert/error-alert.tsx +19 -7
- package/src/field-app-icon.tsx +29 -0
- package/src/field-container.tsx +4 -2
- package/src/field-icon.tsx +29 -0
- package/src/field-type-icon.tsx +82 -0
- package/src/file-item.tsx +164 -47
- package/src/guide-link.tsx +4 -3
- package/src/hint.tsx +10 -1
- package/src/html-styles.ts +23 -13
- package/src/icons/ast/ActivityFilled.ts +8 -0
- package/src/icons/ast/AiAssistantFilled.ts +8 -0
- package/src/icons/ast/AiFiberyBuild.ts +8 -0
- package/src/icons/ast/Anthropic.ts +1 -1
- package/src/icons/ast/Apple.ts +8 -0
- package/src/icons/ast/ArrowBottom.ts +1 -1
- package/src/icons/ast/ArrowForward.ts +1 -1
- package/src/icons/ast/ArrowLeft.ts +1 -1
- package/src/icons/ast/ArrowRight.ts +1 -1
- package/src/icons/ast/ArrowTop.ts +1 -1
- package/src/icons/ast/CollapseAllHorizontal.ts +8 -0
- package/src/icons/ast/Crosshair.ts +8 -0
- package/src/icons/ast/DateRange.ts +1 -1
- package/src/icons/ast/Document.ts +8 -0
- package/src/icons/ast/EntityCreate.ts +8 -0
- package/src/icons/ast/EntityCreateFilled.ts +8 -0
- package/src/icons/ast/ExpandAll.ts +8 -0
- package/src/icons/ast/ExpandAllHorizontal.ts +8 -0
- package/src/icons/ast/FiberyDesktopApp.ts +8 -0
- package/src/icons/ast/FileDownload.ts +8 -0
- package/src/icons/ast/GlobeUnpublish.ts +8 -0
- package/src/icons/ast/GraduationCapFilled.ts +8 -0
- package/src/icons/ast/Home.ts +1 -1
- package/src/icons/ast/HomeFilled.ts +8 -0
- package/src/icons/ast/ImportFilled.ts +8 -0
- package/src/icons/ast/IntegrationsFilled.ts +8 -0
- package/src/icons/ast/KeyboardHideDown.ts +8 -0
- package/src/icons/ast/LayoutMultiple.ts +8 -0
- package/src/icons/ast/LocationEdit.ts +8 -0
- package/src/icons/ast/MessagePlus.ts +8 -0
- package/src/icons/ast/OpenAi.ts +1 -1
- package/src/icons/ast/RicheditorHistoryRedo.ts +1 -1
- package/src/icons/ast/RicheditorHistoryUndo.ts +1 -1
- package/src/icons/ast/RicheditorMarkHighlight.ts +8 -0
- package/src/icons/ast/RicheditorMarkStrike.ts +1 -1
- package/src/icons/ast/RicheditorMarkUnderline.ts +1 -1
- package/src/icons/ast/SearchFilled.ts +8 -0
- package/src/icons/ast/SettingsFilled.ts +8 -0
- package/src/icons/ast/SlideMenuFilled.ts +8 -0
- package/src/icons/ast/SpaceApp.ts +8 -0
- package/src/icons/ast/SpaceGenerate.ts +8 -0
- package/src/icons/ast/SpaceScratch.ts +8 -0
- package/src/icons/ast/SpaceTemplate.ts +8 -0
- package/src/icons/ast/TableLayout.ts +8 -0
- package/src/icons/ast/TemplatesFilled.ts +8 -0
- package/src/icons/ast/ThumbsDown.ts +8 -0
- package/src/icons/ast/ThumbsUp.ts +8 -0
- package/src/icons/ast/TypeDate.ts +1 -1
- package/src/icons/ast/ViewDashboard.ts +8 -0
- package/src/icons/ast/WarningTriangleFilled.ts +8 -0
- package/src/icons/ast/Windows.ts +8 -0
- package/src/icons/ast/index.tsx +37 -0
- package/src/icons/react/ActivityFilled.tsx +13 -0
- package/src/icons/react/AiAssistantFilled.tsx +13 -0
- package/src/icons/react/AiFiberyBuild.tsx +13 -0
- package/src/icons/react/Apple.tsx +13 -0
- package/src/icons/react/CollapseAllHorizontal.tsx +13 -0
- package/src/icons/react/Crosshair.tsx +13 -0
- package/src/icons/react/Document.tsx +13 -0
- package/src/icons/react/EntityCreate.tsx +13 -0
- package/src/icons/react/EntityCreateFilled.tsx +13 -0
- package/src/icons/react/ExpandAll.tsx +13 -0
- package/src/icons/react/ExpandAllHorizontal.tsx +13 -0
- package/src/icons/react/FiberyDesktopApp.tsx +13 -0
- package/src/icons/react/FileDownload.tsx +13 -0
- package/src/icons/react/GlobeUnpublish.tsx +13 -0
- package/src/icons/react/GraduationCapFilled.tsx +13 -0
- package/src/icons/react/HomeFilled.tsx +13 -0
- package/src/icons/react/ImportFilled.tsx +13 -0
- package/src/icons/react/IntegrationsFilled.tsx +13 -0
- package/src/icons/react/KeyboardHideDown.tsx +13 -0
- package/src/icons/react/LayoutMultiple.tsx +13 -0
- package/src/icons/react/LocationEdit.tsx +13 -0
- package/src/icons/react/MessagePlus.tsx +13 -0
- package/src/icons/react/RicheditorMarkHighlight.tsx +13 -0
- package/src/icons/react/SearchFilled.tsx +13 -0
- package/src/icons/react/SettingsFilled.tsx +13 -0
- package/src/icons/react/SlideMenuFilled.tsx +13 -0
- package/src/icons/react/SpaceApp.tsx +13 -0
- package/src/icons/react/SpaceGenerate.tsx +13 -0
- package/src/icons/react/SpaceScratch.tsx +13 -0
- package/src/icons/react/SpaceTemplate.tsx +13 -0
- package/src/icons/react/TableLayout.tsx +13 -0
- package/src/icons/react/TemplatesFilled.tsx +13 -0
- package/src/icons/react/ThumbsDown.tsx +13 -0
- package/src/icons/react/ThumbsUp.tsx +13 -0
- package/src/icons/react/ViewDashboard.tsx +13 -0
- package/src/icons/react/WarningTriangleFilled.tsx +13 -0
- package/src/icons/react/Windows.tsx +13 -0
- package/src/icons/react/index.tsx +37 -0
- package/src/icons/svg/activity-filled.svg +4 -0
- package/src/icons/svg/ai-assistant-filled.svg +3 -0
- package/src/icons/svg/ai-fibery-build.svg +24 -0
- package/src/icons/svg/anthropic.svg +2 -14
- package/src/icons/svg/apple.svg +4 -0
- package/src/icons/svg/arrow-bottom.svg +1 -1
- package/src/icons/svg/arrow-forward.svg +1 -1
- package/src/icons/svg/arrow-left.svg +1 -1
- package/src/icons/svg/arrow-right.svg +1 -1
- package/src/icons/svg/arrow-top.svg +1 -1
- package/src/icons/svg/collapse-all-horizontal.svg +3 -0
- package/src/icons/svg/crosshair.svg +4 -0
- package/src/icons/svg/date-range.svg +3 -3
- package/src/icons/svg/document.svg +4 -0
- package/src/icons/svg/entity-create-filled.svg +4 -0
- package/src/icons/svg/entity-create.svg +3 -0
- package/src/icons/svg/expand-all-horizontal.svg +3 -0
- package/src/icons/svg/expand-all.svg +3 -0
- package/src/icons/svg/fibery-desktop-app.svg +101 -0
- package/src/icons/svg/file-download.svg +4 -0
- package/src/icons/svg/globe-unpublish.svg +4 -0
- package/src/icons/svg/go-to.svg +1 -3
- package/src/icons/svg/graduation-cap-filled.svg +4 -0
- package/src/icons/svg/home-filled.svg +3 -0
- package/src/icons/svg/home.svg +4 -2
- package/src/icons/svg/import-filled.svg +4 -0
- package/src/icons/svg/integrations-filled.svg +4 -0
- package/src/icons/svg/keyboard-hide-down.svg +1 -0
- package/src/icons/svg/layout-multiple.svg +3 -0
- package/src/icons/svg/location-edit.svg +13 -0
- package/src/icons/svg/message-plus.svg +4 -0
- package/src/icons/svg/open-ai.svg +2 -7
- package/src/icons/svg/open-as-page.svg +2 -3
- package/src/icons/svg/richeditor/history/redo.svg +3 -2
- package/src/icons/svg/richeditor/history/undo.svg +3 -2
- package/src/icons/svg/richeditor/mark/code.svg +4 -5
- package/src/icons/svg/richeditor/mark/em.svg +3 -2
- package/src/icons/svg/richeditor/mark/highlight.svg +3 -0
- package/src/icons/svg/richeditor/mark/strike.svg +3 -2
- package/src/icons/svg/richeditor/mark/strong.svg +3 -2
- package/src/icons/svg/richeditor/mark/underline.svg +4 -2
- package/src/icons/svg/search-filled.svg +3 -0
- package/src/icons/svg/settings-filled.svg +3 -0
- package/src/icons/svg/slide-menu-filled.svg +1 -0
- package/src/icons/svg/space-app.svg +3 -0
- package/src/icons/svg/space-generate.svg +3 -0
- package/src/icons/svg/space-scratch.svg +3 -0
- package/src/icons/svg/space-template.svg +3 -0
- package/src/icons/svg/table-layout.svg +3 -0
- package/src/icons/svg/templates-filled.svg +6 -0
- package/src/icons/svg/thumbs-down.svg +3 -0
- package/src/icons/svg/thumbs-up.svg +3 -0
- package/src/icons/svg/type/date.svg +3 -2
- package/src/icons/svg/view-dashboard.svg +5 -0
- package/src/icons/svg/warning-triangle-filled.svg +3 -0
- package/src/icons/svg/windows.svg +15 -0
- package/src/images-gallery/images-gallery.tsx +254 -0
- package/src/images-gallery/zoom.tsx +112 -0
- package/src/integration-compact-info-button.tsx +3 -1
- package/src/is-in-popup.ts +1 -1
- package/src/layout-styles.ts +43 -0
- package/src/lists/actions-menu-row-surface.tsx +3 -1
- package/src/lists/list-row-surface.tsx +9 -2
- package/src/loaders.tsx +6 -6
- package/src/logo.tsx +16 -9
- package/src/mobile-keyboard-aware-popup.tsx +87 -0
- package/src/mobile-styles.ts +10 -0
- package/src/modal-menu/contexts/modal-menu-context.tsx +22 -0
- package/src/modal-menu/contexts/modal-submenu-context.tsx +16 -0
- package/src/modal-menu/index.tsx +14 -0
- package/src/modal-menu/modal-menu-content.tsx +68 -0
- package/src/modal-menu/modal-menu-group.tsx +10 -0
- package/src/modal-menu/modal-menu-item.tsx +37 -0
- package/src/modal-menu/modal-menu-label.tsx +24 -0
- package/src/modal-menu/modal-menu-root.tsx +57 -0
- package/src/modal-menu/modal-menu-separator.tsx +14 -0
- package/src/modal-menu/modal-menu-trigger.tsx +37 -0
- package/src/modal-menu/modal-submenu-content.tsx +49 -0
- package/src/modal-menu/modal-submenu-trigger.tsx +34 -0
- package/src/modal-menu/modal-submenu.tsx +17 -0
- package/src/new-badge.tsx +4 -7
- package/src/number-input/text-area-auto-sized.tsx +47 -0
- package/src/number-input/text-input-auto-sized.tsx +49 -0
- package/src/online-users.tsx +3 -3
- package/src/palette.ts +50 -50
- package/src/popover/index.tsx +687 -0
- package/src/popover/mobile-popup-context.tsx +29 -0
- package/src/{popup → popover}/modifiers.tsx +0 -7
- package/src/{popup → popover}/popup-modifiers-context.ts +3 -3
- package/src/reactions/reaction-button.tsx +30 -45
- package/src/reactions/reaction-picker.tsx +39 -45
- package/src/rich-text-embed-error.tsx +2 -2
- package/src/select/{custom-select-partials → components}/menu.tsx +13 -7
- package/src/select/{custom-select-partials → components}/no-option-message.tsx +0 -1
- package/src/select/constants.ts +1 -0
- package/src/select/index.tsx +143 -148
- package/src/select/select-in-popover.tsx +119 -138
- package/src/select/styles.ts +60 -24
- package/src/shortcut-badge.tsx +1 -0
- package/src/tab-nav/tab-nav.tsx +47 -28
- package/src/theme-provider.tsx +9 -1
- package/src/toast/primitives.tsx +8 -1
- package/src/toggle-button/round-toggle-button.tsx +23 -0
- package/src/toggle-button/toggle-button-group.tsx +34 -0
- package/src/toggle-button/toggle-button.tsx +164 -0
- package/src/toggle.tsx +3 -3
- package/src/tooltip-if-overflown.tsx +9 -3
- package/src/tooltip.tsx +2 -2
- package/src/unit/index.tsx +9 -1
- package/src/unit/loading-unit-value.tsx +1 -0
- package/src/unit/maybe-unit-value.tsx +3 -3
- package/src/unit/primitive.tsx +58 -42
- package/src/unit/styles.ts +10 -14
- package/src/unit/types.ts +4 -2
- package/src/unit/unit-button-group.tsx +6 -11
- package/src/unit/unit-content.tsx +13 -5
- package/src/unit/unit-with-title.tsx +6 -1
- package/src/unit/unit-with-tooltip.tsx +24 -9
- package/src/use-is-phone.tsx +37 -0
- package/src/use-is-support-hover.ts +1 -1
- package/src/use-on-screen-keyboard-data.tsx +66 -0
- package/src/workflow-progress-icon.tsx +17 -23
- package/src/number-input/text-area-with-autosize.tsx +0 -91
- package/src/number-input/text-inline-input-with-autosize.tsx +0 -60
- package/src/popup/index.tsx +0 -382
- package/src/use-is-phone.ts +0 -5
- /package/src/{popup → popover}/popup-stack-context.tsx +0 -0
- /package/src/{popup → popover}/reference.ts +0 -0
- /package/src/{popup → popover}/styles.ts +0 -0
- /package/src/{popup → popover}/use-click-outside.ts +0 -0
- /package/src/select/{custom-select-partials → components}/clear-indicator.tsx +0 -0
- /package/src/select/{custom-select-partials → components}/drop-down-indicator.tsx +0 -0
- /package/src/select/{custom-select-partials → components}/group-heading.tsx +0 -0
- /package/src/select/{custom-select-partials → components}/menu-list-virtualized.tsx +0 -0
- /package/src/select/{custom-select-partials → components}/option.tsx +0 -0
package/src/axis-header.tsx
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import {
|
|
3
|
-
import cn from "classnames";
|
|
2
|
+
import {default as cn, default as cx} from "classnames";
|
|
4
3
|
import {FC, ReactNode} from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const axisItemStyle = css`
|
|
9
|
-
${{
|
|
10
|
-
display: "grid",
|
|
11
|
-
gridGap: space.s6,
|
|
12
|
-
minHeight: layout.itemHeight,
|
|
13
|
-
alignItems: "center",
|
|
14
|
-
paddingLeft: space.s8,
|
|
15
|
-
paddingRight: space.s8,
|
|
16
|
-
borderRadius: border.radius6,
|
|
17
|
-
width: "100%",
|
|
18
|
-
...textStyles.heading5,
|
|
19
|
-
}}
|
|
20
|
-
`;
|
|
21
|
-
|
|
4
|
+
import {CountBadge} from "./count-badge";
|
|
5
|
+
import {border, opacity, space, textStyles, themeVars} from "./design-system";
|
|
22
6
|
const axisItemStyleX = css`
|
|
23
7
|
grid-template-columns: auto 1fr auto;
|
|
24
8
|
`;
|
|
@@ -31,11 +15,23 @@ const axisItemHighlightedStyle = css`
|
|
|
31
15
|
|
|
32
16
|
const dimensionToItemStyle = {x: axisItemStyleX, y: axisItemStyleY};
|
|
33
17
|
|
|
18
|
+
const wrapperStyle = css`
|
|
19
|
+
${textStyles.regular};
|
|
20
|
+
display: grid;
|
|
21
|
+
width: 100%;
|
|
22
|
+
grid-template-columns: 1fr auto;
|
|
23
|
+
gap: ${space.s6}px;
|
|
24
|
+
padding: ${space.s6}px;
|
|
25
|
+
`;
|
|
26
|
+
|
|
34
27
|
const axisItemStyleCollapsed = css`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
writing-mode: vertical-rl;
|
|
29
|
+
display: flex;
|
|
30
|
+
position: sticky;
|
|
31
|
+
top: 0;
|
|
32
|
+
&.${wrapperStyle} {
|
|
33
|
+
padding-block: 0;
|
|
34
|
+
}
|
|
39
35
|
`;
|
|
40
36
|
|
|
41
37
|
function getAdditionalClassName({
|
|
@@ -56,33 +52,61 @@ function getAdditionalClassName({
|
|
|
56
52
|
return dimensionToItemStyle[dimension];
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
const mainContainerWrapperStyle =
|
|
60
|
-
overflow:
|
|
61
|
-
|
|
62
|
-
cursor:
|
|
63
|
-
|
|
64
|
-
opacity: 1
|
|
65
|
-
};
|
|
66
|
-
const mainContainerWrapperClassName = css`
|
|
67
|
-
${mainContainerWrapperStyle}
|
|
55
|
+
const mainContainerWrapperStyle = css`
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
opacity: 1;
|
|
68
61
|
`;
|
|
69
62
|
|
|
70
|
-
const mainContainerWrapperCollapsedClassName =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
const mainContainerWrapperCollapsedClassName = cx(
|
|
64
|
+
mainContainerWrapperStyle,
|
|
65
|
+
css`
|
|
66
|
+
opacity: ${opacity.opacity40};
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: flex-start;
|
|
70
|
+
gap: ${space.s12}px;
|
|
71
|
+
`
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const collapsedTextStyle = css`
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
flex-shrink: 1;
|
|
76
80
|
`;
|
|
77
81
|
|
|
78
82
|
const leftContainerWrapperStyle = css`
|
|
79
83
|
cursor: pointer;
|
|
80
84
|
`;
|
|
81
85
|
|
|
82
|
-
const
|
|
86
|
+
export const leftMainContainerWrapperStyle = css``;
|
|
87
|
+
|
|
88
|
+
export const axisHeaderClassName = css`
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
min-height: ${space.s36}px;
|
|
83
91
|
display: flex;
|
|
92
|
+
justify-content: center;
|
|
84
93
|
flex-direction: column;
|
|
85
|
-
|
|
94
|
+
border-radius: ${border.radius6}px;
|
|
95
|
+
.right-container {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
background-color: var(--board-bg, ${themeVars.boardBg});
|
|
99
|
+
&:hover {
|
|
100
|
+
background-color: ${themeVars.boardAxisBgHover};
|
|
101
|
+
z-index: 20;
|
|
102
|
+
& .${leftMainContainerWrapperStyle} {
|
|
103
|
+
background-color: transparent;
|
|
104
|
+
}
|
|
105
|
+
.right-container {
|
|
106
|
+
visibility: visible;
|
|
107
|
+
opacity: 1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
86
110
|
`;
|
|
87
111
|
|
|
88
112
|
interface AxisHeaderProps {
|
|
@@ -90,12 +114,12 @@ interface AxisHeaderProps {
|
|
|
90
114
|
dimension: "x" | "y";
|
|
91
115
|
collapsed?: boolean;
|
|
92
116
|
highlighted?: boolean;
|
|
93
|
-
showLeftContainerWhenCollapsed?: boolean;
|
|
94
117
|
bottomContainer?: ReactNode;
|
|
95
118
|
leftContainer?: ReactNode;
|
|
96
119
|
rightContainer?: ReactNode;
|
|
97
120
|
children: ReactNode;
|
|
98
121
|
onCollapse?: () => void;
|
|
122
|
+
count?: number;
|
|
99
123
|
}
|
|
100
124
|
|
|
101
125
|
export const AxisHeader: FC<AxisHeaderProps> = ({
|
|
@@ -107,54 +131,90 @@ export const AxisHeader: FC<AxisHeaderProps> = ({
|
|
|
107
131
|
bottomContainer,
|
|
108
132
|
collapsed,
|
|
109
133
|
highlighted,
|
|
110
|
-
showLeftContainerWhenCollapsed,
|
|
111
134
|
onCollapse,
|
|
135
|
+
count,
|
|
112
136
|
}) => {
|
|
113
|
-
const
|
|
114
|
-
const backgroundColor = getThemeValue(theme.mode, {
|
|
115
|
-
dark: themeVars.panelContentBg,
|
|
116
|
-
light: themeVars.panelContentBg,
|
|
117
|
-
});
|
|
137
|
+
const leftContainerWrapper = <div className={leftContainerWrapperStyle}>{leftContainer}</div>;
|
|
118
138
|
|
|
119
|
-
const
|
|
120
|
-
<div
|
|
121
|
-
{
|
|
139
|
+
const rightContainerWrapper = (
|
|
140
|
+
<div
|
|
141
|
+
className={cn(
|
|
142
|
+
"right-container",
|
|
143
|
+
css`
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
`
|
|
147
|
+
)}
|
|
148
|
+
>
|
|
149
|
+
{rightContainer}
|
|
122
150
|
</div>
|
|
123
151
|
);
|
|
124
152
|
|
|
125
|
-
const rightContainerWrapper = <div>{rightContainer}</div>;
|
|
126
|
-
|
|
127
153
|
const mainContainerWrapper = (
|
|
128
|
-
<div
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
154
|
+
<div className={collapsed ? mainContainerWrapperCollapsedClassName : mainContainerWrapperStyle}>
|
|
155
|
+
{collapsed ? <div className={collapsedTextStyle}>{children}</div> : children}
|
|
156
|
+
{count !== undefined && collapsed && (
|
|
157
|
+
<CountBadge
|
|
158
|
+
count={count}
|
|
159
|
+
className={css`
|
|
160
|
+
writing-mode: horizontal-tb;
|
|
161
|
+
`}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
133
164
|
</div>
|
|
134
165
|
);
|
|
135
166
|
return (
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
167
|
+
<div
|
|
168
|
+
data-testid={`axis-header-${dimension}`}
|
|
169
|
+
onClick={onCollapse}
|
|
170
|
+
className={cn(
|
|
171
|
+
className,
|
|
172
|
+
axisHeaderClassName,
|
|
173
|
+
dimension === "y" &&
|
|
174
|
+
css`
|
|
175
|
+
position: sticky;
|
|
176
|
+
left: 0;
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
z-index: 3;
|
|
179
|
+
background-color: transparent;
|
|
180
|
+
`,
|
|
181
|
+
dimension === "y" &&
|
|
182
|
+
highlighted &&
|
|
183
|
+
css`
|
|
184
|
+
display: flex;
|
|
185
|
+
width: 100%;
|
|
186
|
+
`,
|
|
187
|
+
collapsed &&
|
|
188
|
+
dimension === "x" &&
|
|
189
|
+
css`
|
|
190
|
+
position: sticky;
|
|
191
|
+
top: 0;
|
|
192
|
+
z-index: 2;
|
|
193
|
+
background-color: transparent;
|
|
194
|
+
`
|
|
195
|
+
)}
|
|
196
|
+
>
|
|
197
|
+
<div className={cn(wrapperStyle, getAdditionalClassName({dimension, highlighted, collapsed}))}>
|
|
198
|
+
<>
|
|
199
|
+
<div
|
|
200
|
+
className={cn(
|
|
201
|
+
leftMainContainerWrapperStyle,
|
|
202
|
+
css`
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-columns: auto 1fr;
|
|
205
|
+
gap: ${space.s8}px;
|
|
206
|
+
padding-inline: ${space.s4}px;
|
|
207
|
+
align-items: center;
|
|
208
|
+
`
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
151
211
|
{leftContainerWrapper}
|
|
152
212
|
{mainContainerWrapper}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
213
|
+
</div>
|
|
214
|
+
{rightContainerWrapper}
|
|
215
|
+
</>
|
|
156
216
|
</div>
|
|
157
217
|
{bottomContainer}
|
|
158
|
-
</
|
|
218
|
+
</div>
|
|
159
219
|
);
|
|
160
220
|
};
|
package/src/badge.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {ReactNode, forwardRef} from "react";
|
|
2
1
|
import {css, cx} from "@linaria/core";
|
|
3
|
-
import {
|
|
2
|
+
import {ReactNode, forwardRef} from "react";
|
|
3
|
+
import {space, textStyles, themeVars} from "./design-system";
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
children: ReactNode;
|
|
7
|
-
kind?: "success" | "error" | "default";
|
|
7
|
+
kind?: "success" | "error" | "default" | "warning";
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const Badge = forwardRef<HTMLSpanElement, Props>(({children, kind, ...otherProps}, ref) => {
|
|
@@ -14,12 +14,14 @@ export const Badge = forwardRef<HTMLSpanElement, Props>(({children, kind, ...oth
|
|
|
14
14
|
{...otherProps}
|
|
15
15
|
className={cx(
|
|
16
16
|
css`
|
|
17
|
-
${textStyles.
|
|
17
|
+
${textStyles.heading8}
|
|
18
18
|
position: relative;
|
|
19
|
-
|
|
20
|
-
padding: ${space.s2}px ${space.s6}px;
|
|
19
|
+
padding: ${space.s2}px 5px;
|
|
21
20
|
background: ${themeVars.badgeBgColor};
|
|
22
|
-
border-radius: ${
|
|
21
|
+
border-radius: ${space.s4}px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: ${space.s2}px;
|
|
23
25
|
`,
|
|
24
26
|
kind === "success" &&
|
|
25
27
|
css`
|
|
@@ -30,6 +32,11 @@ export const Badge = forwardRef<HTMLSpanElement, Props>(({children, kind, ...oth
|
|
|
30
32
|
css`
|
|
31
33
|
color: ${themeVars.colorTextBadgeError};
|
|
32
34
|
background: ${themeVars.colorBgBadgeError};
|
|
35
|
+
`,
|
|
36
|
+
kind === "warning" &&
|
|
37
|
+
css`
|
|
38
|
+
color: ${themeVars.colorTextBadgeWarning};
|
|
39
|
+
background: ${themeVars.colorBgBadgeWarning};
|
|
33
40
|
`
|
|
34
41
|
)}
|
|
35
42
|
>
|
package/src/beta-badge.tsx
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
|
-
import {
|
|
2
|
+
import {space, textStyles, themeVars} from "./design-system";
|
|
3
3
|
|
|
4
4
|
const betaBadgeStyle = css`
|
|
5
|
-
${textStyles.
|
|
6
|
-
text-transform: none;
|
|
7
|
-
font-weight: ${fontWeight.medium};
|
|
5
|
+
${textStyles.heading8}
|
|
8
6
|
display: inline-block;
|
|
9
|
-
padding: ${space.s2}px
|
|
7
|
+
padding: ${space.s2}px 5px;
|
|
10
8
|
color: ${themeVars.colorAI};
|
|
11
9
|
background-color: ${themeVars.colorBgAI};
|
|
12
10
|
vertical-align: text-top;
|
|
13
|
-
border-radius:
|
|
11
|
+
border-radius: ${space.s4}px;
|
|
14
12
|
`;
|
|
15
13
|
|
|
16
|
-
type Props = {
|
|
17
|
-
|
|
14
|
+
type Props = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const BetaBadge: React.FC<Props> = ({children, className}) => (
|
|
20
|
+
<span className={`${betaBadgeStyle} ${className ?? ""}`}>{children}</span>
|
|
21
|
+
);
|
package/src/box.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import {styled} from "@linaria/react";
|
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import {CSSProperties, forwardRef, HTMLProps, ReactNode, Ref, useCallback, useMemo, useState} from "react";
|
|
5
5
|
import {border, getLinearGradient, getOpacities, space, textStyles, themeVars, transition} from "./design-system";
|
|
6
|
-
import {useClickOutside} from "./
|
|
6
|
+
import {useClickOutside} from "./popover/use-click-outside";
|
|
7
7
|
|
|
8
8
|
export const getBg = (backgroundColors: string[]) => {
|
|
9
9
|
if (backgroundColors) {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {css, cx} from "@linaria/core";
|
|
2
|
+
import {themeVars, transition} from "./design-system";
|
|
3
|
+
import ArrowRight from "./icons/react/ArrowRight";
|
|
4
|
+
import {ComponentPropsWithoutRef, ElementType, forwardRef} from "react";
|
|
5
|
+
import More from "./icons/react/More";
|
|
6
|
+
|
|
7
|
+
export const Breadcrumb = ({...props}: React.ComponentProps<"nav">) => {
|
|
8
|
+
return <nav aria-label="breadcrumb" {...props} />;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const olReset = css`
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const listCss = css`
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
color: ${themeVars.colorTextButtonGhostNeutral};
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const BreadcrumbList = ({className, ...props}: React.ComponentProps<"ol">) => {
|
|
27
|
+
return <ol className={cx(olReset, listCss, className)} {...props} />;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const itemCss = css`
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const BreadcrumbItem = forwardRef<HTMLLIElement, React.ComponentProps<"li">>(({className, ...props}, ref) => {
|
|
36
|
+
return <li ref={ref} className={cx(itemCss, className)} {...props} />;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const linkCss = css`
|
|
40
|
+
color: ${themeVars.colorTextButtonGhostNeutral};
|
|
41
|
+
&:hover {
|
|
42
|
+
color: ${themeVars.textColor};
|
|
43
|
+
}
|
|
44
|
+
transition: color ${transition};
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
type BreadcrumbLinkProps<C extends ElementType = "a"> = {
|
|
48
|
+
as?: C;
|
|
49
|
+
className?: string;
|
|
50
|
+
} & ComponentPropsWithoutRef<C>;
|
|
51
|
+
|
|
52
|
+
export const BreadcrumbLink = <C extends ElementType = "a">({className, as, ...props}: BreadcrumbLinkProps<C>) => {
|
|
53
|
+
const Component = as || "a";
|
|
54
|
+
return <Component className={cx(linkCss, className)} {...props} />;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const liReset = css`
|
|
58
|
+
margin: 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
export const BreadcrumbSeparator = ({children, className, ...props}: React.ComponentProps<"li">) => {
|
|
63
|
+
return (
|
|
64
|
+
<li role="presentation" aria-hidden="true" className={cx(liReset, className)} {...props}>
|
|
65
|
+
{children ?? <ArrowRight color={themeVars.colorTextButtonGhostNeutral} containerSize={16} iconSize={16} />}
|
|
66
|
+
</li>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const BreadcrumbEllipsis = forwardRef<HTMLSpanElement, React.ComponentProps<"span">>(
|
|
71
|
+
({className, ...props}, ref) => {
|
|
72
|
+
return (
|
|
73
|
+
<span ref={ref} role="presentation" aria-hidden="true" className={cx(className)} {...props}>
|
|
74
|
+
<More color={themeVars.colorTextButtonGhostNeutral} containerSize={16} iconSize={16} />
|
|
75
|
+
</span>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {forwardRef} from "react";
|
|
2
2
|
import {IconButton, IconButtonProps} from "./icon-button";
|
|
3
3
|
import MoreCompactIcon from "../icons/react/MoreCompact";
|
|
4
|
+
import MoreIcon from "../icons/react/More";
|
|
5
|
+
import {useIsPhone} from "../use-is-phone";
|
|
4
6
|
|
|
5
7
|
export const ActionsButtonCompact = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
6
8
|
function ActionsButtonCompactComponent({...rest}, ref) {
|
|
9
|
+
const isPhone = useIsPhone();
|
|
7
10
|
return (
|
|
8
|
-
<IconButton ref={ref} size="small" {...rest}>
|
|
9
|
-
<MoreCompactIcon />
|
|
11
|
+
<IconButton supportMobile={true} ref={ref} size="small" {...rest}>
|
|
12
|
+
{isPhone ? <MoreIcon iconSize={20} /> : <MoreCompactIcon />}
|
|
10
13
|
</IconButton>
|
|
11
14
|
);
|
|
12
15
|
}
|
|
@@ -3,7 +3,7 @@ import {forwardRef} from "react";
|
|
|
3
3
|
import {themeVars} from "../design-system";
|
|
4
4
|
import {iconColorVar} from "../icons/Icon";
|
|
5
5
|
|
|
6
|
-
export type ButtonSize = "tiny" | "small" | "medium" | "large";
|
|
6
|
+
export type ButtonSize = "tiny" | "small" | "medium" | "large" | "xLarge";
|
|
7
7
|
export type ButtonVariant = "solid" | "outline" | "soft" | "ghost";
|
|
8
8
|
export type ButtonColor = "accent" | "neutral" | "error";
|
|
9
9
|
|
|
@@ -11,6 +11,7 @@ export type BaseButtonProps = {
|
|
|
11
11
|
variant?: ButtonVariant;
|
|
12
12
|
color?: ButtonColor;
|
|
13
13
|
pressed?: boolean;
|
|
14
|
+
supportMobile?: boolean;
|
|
14
15
|
} & React.ComponentPropsWithRef<"button">;
|
|
15
16
|
|
|
16
17
|
export const baseButton = css`
|
|
@@ -29,10 +30,12 @@ export const baseButton = css`
|
|
|
29
30
|
|
|
30
31
|
background-color: var(--fibery-button-color);
|
|
31
32
|
|
|
32
|
-
box-shadow:
|
|
33
|
+
box-shadow: inset 0 0 0 1px var(--fibery-button-border-color);
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
@media (any-hover: hover) {
|
|
36
|
+
&:hover:not(:disabled) {
|
|
37
|
+
background-color: var(--fibery-button-hover-color);
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
&:active {
|
|
38
41
|
color: var(--fibery-button-text-active-color);
|
package/src/button/button.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import {iconSizeVar} from "../icons/Icon";
|
|
|
5
5
|
import SpinnerIcon from "../icons/react/Spinner";
|
|
6
6
|
import {BaseButton, BaseButtonProps, ButtonSize} from "./base-button";
|
|
7
7
|
import {useIsSupportHardwareKeyboard} from "../use-is-support-hardware-keyboard";
|
|
8
|
+
import {useIsPhone} from "../use-is-phone";
|
|
8
9
|
|
|
9
10
|
export type ButtonProps = {
|
|
10
11
|
size?: ButtonSize;
|
|
@@ -15,6 +16,10 @@ export type ButtonProps = {
|
|
|
15
16
|
iconEnd?: React.ReactNode;
|
|
16
17
|
} & BaseButtonProps;
|
|
17
18
|
|
|
19
|
+
const withIconStart = css``;
|
|
20
|
+
const withIconEnd = css``;
|
|
21
|
+
const withoutChildren = css``;
|
|
22
|
+
|
|
18
23
|
const button = css`
|
|
19
24
|
display: flex;
|
|
20
25
|
align-items: center;
|
|
@@ -24,6 +29,7 @@ const button = css`
|
|
|
24
29
|
`;
|
|
25
30
|
|
|
26
31
|
const shortcutContainer = css`
|
|
32
|
+
display: flex;
|
|
27
33
|
font-size: ${textStyles.small.fontSize}px;
|
|
28
34
|
font-weight: ${fontWeight.regular};
|
|
29
35
|
opacity: 0.7;
|
|
@@ -39,6 +45,21 @@ const buttonSize = {
|
|
|
39
45
|
gap: ${space.s2}px;
|
|
40
46
|
|
|
41
47
|
${iconSizeVar}: 14px;
|
|
48
|
+
|
|
49
|
+
&.${withIconStart} {
|
|
50
|
+
padding-left: ${space.s4}px;
|
|
51
|
+
padding-right: ${space.s6}px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.${withIconEnd} {
|
|
55
|
+
padding-left: ${space.s6}px;
|
|
56
|
+
padding-right: ${space.s4}px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.${withoutChildren} {
|
|
60
|
+
padding-left: ${space.s3}px;
|
|
61
|
+
padding-right: ${space.s3}px;
|
|
62
|
+
}
|
|
42
63
|
`,
|
|
43
64
|
small: css`
|
|
44
65
|
font-size: ${textStyles.small.fontSize}px;
|
|
@@ -49,6 +70,21 @@ const buttonSize = {
|
|
|
49
70
|
gap: ${space.s4}px;
|
|
50
71
|
|
|
51
72
|
${iconSizeVar}: 16px;
|
|
73
|
+
|
|
74
|
+
&.${withIconStart} {
|
|
75
|
+
padding-left: ${space.s6}px;
|
|
76
|
+
padding-right: ${space.s8}px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.${withIconEnd} {
|
|
80
|
+
padding-left: ${space.s8}px;
|
|
81
|
+
padding-right: ${space.s6}px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.${withoutChildren} {
|
|
85
|
+
padding-left: ${space.s4}px;
|
|
86
|
+
padding-right: ${space.s4}px;
|
|
87
|
+
}
|
|
52
88
|
`,
|
|
53
89
|
medium: css`
|
|
54
90
|
font-size: ${textStyles.regular.fontSize}px;
|
|
@@ -61,6 +97,21 @@ const buttonSize = {
|
|
|
61
97
|
gap: ${space.s4}px;
|
|
62
98
|
|
|
63
99
|
${iconSizeVar}: 18px;
|
|
100
|
+
|
|
101
|
+
&.${withIconStart} {
|
|
102
|
+
padding-left: ${space.s8}px;
|
|
103
|
+
padding-right: ${space.s10}px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.${withIconEnd} {
|
|
107
|
+
padding-left: ${space.s10}px;
|
|
108
|
+
padding-right: ${space.s8}px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.${withoutChildren} {
|
|
112
|
+
padding-left: ${space.s6 - space.s1}px;
|
|
113
|
+
padding-right: ${space.s6 - space.s1}px;
|
|
114
|
+
}
|
|
64
115
|
`,
|
|
65
116
|
large: css`
|
|
66
117
|
font-size: ${textStyles.regular.fontSize}px;
|
|
@@ -74,6 +125,52 @@ const buttonSize = {
|
|
|
74
125
|
|
|
75
126
|
${iconSizeVar}: 18px;
|
|
76
127
|
|
|
128
|
+
&.${withIconStart} {
|
|
129
|
+
padding-left: ${space.s10}px;
|
|
130
|
+
padding-right: ${space.s12}px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.${withIconEnd} {
|
|
134
|
+
padding-left: ${space.s12}px;
|
|
135
|
+
padding-right: ${space.s10}px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.${withoutChildren} {
|
|
139
|
+
padding-left: ${space.s8 - space.s1}px;
|
|
140
|
+
padding-right: ${space.s8 - space.s1}px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
& > .${shortcutContainer} {
|
|
144
|
+
font-size: ${textStyles.regular.fontSize}px;
|
|
145
|
+
}
|
|
146
|
+
`,
|
|
147
|
+
xLarge: css`
|
|
148
|
+
font-size: ${textStyles.heading3.fontSize}px;
|
|
149
|
+
line-height: 20px;
|
|
150
|
+
letter-spacing: ${textStyles.heading3.letterSpacing};
|
|
151
|
+
|
|
152
|
+
border-radius: ${border.radius6}px;
|
|
153
|
+
min-height: 44px;
|
|
154
|
+
padding: ${space.s6}px ${space.s12}px;
|
|
155
|
+
gap: ${space.s6}px;
|
|
156
|
+
|
|
157
|
+
${iconSizeVar}: 24px;
|
|
158
|
+
|
|
159
|
+
&.${withIconStart} {
|
|
160
|
+
padding-left: ${space.s10}px;
|
|
161
|
+
padding-right: ${space.s12}px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.${withIconEnd} {
|
|
165
|
+
padding-left: ${space.s12}px;
|
|
166
|
+
padding-right: ${space.s10}px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.${withoutChildren} {
|
|
170
|
+
padding-left: ${space.s8 - space.s1}px;
|
|
171
|
+
padding-right: ${space.s8 - space.s1}px;
|
|
172
|
+
}
|
|
173
|
+
|
|
77
174
|
& > .${shortcutContainer} {
|
|
78
175
|
font-size: ${textStyles.regular.fontSize}px;
|
|
79
176
|
}
|
|
@@ -86,15 +183,36 @@ const fullWidthMod = css`
|
|
|
86
183
|
|
|
87
184
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
88
185
|
(
|
|
89
|
-
{
|
|
186
|
+
{
|
|
187
|
+
size = "medium",
|
|
188
|
+
iconStart,
|
|
189
|
+
supportMobile,
|
|
190
|
+
iconEnd,
|
|
191
|
+
className,
|
|
192
|
+
children,
|
|
193
|
+
pending,
|
|
194
|
+
disabled,
|
|
195
|
+
shortcut,
|
|
196
|
+
fullWidth,
|
|
197
|
+
...buttonProps
|
|
198
|
+
},
|
|
90
199
|
ref
|
|
91
200
|
) => {
|
|
92
201
|
const isSupportHardwareKeyboard = useIsSupportHardwareKeyboard();
|
|
202
|
+
const isPhone = useIsPhone();
|
|
93
203
|
return (
|
|
94
204
|
<BaseButton
|
|
95
205
|
ref={ref}
|
|
96
206
|
disabled={disabled || pending}
|
|
97
|
-
className={cx(
|
|
207
|
+
className={cx(
|
|
208
|
+
className,
|
|
209
|
+
button,
|
|
210
|
+
buttonSize[supportMobile && isPhone ? "large" : size],
|
|
211
|
+
fullWidth && fullWidthMod,
|
|
212
|
+
iconStart && withIconStart,
|
|
213
|
+
iconEnd && withIconEnd,
|
|
214
|
+
!children && withoutChildren
|
|
215
|
+
)}
|
|
98
216
|
{...buttonProps}
|
|
99
217
|
>
|
|
100
218
|
{pending ? <SpinnerIcon /> : iconStart}
|