@fibery/ui-kit 1.36.1 → 1.37.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 +15 -0
- package/package.json +3 -3
- package/scripts/generate-icons.mjs +15 -1
- 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 +3 -3
- package/src/actions-menu/actions-menu-sub-command-menu.tsx +3 -0
- 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/badge.tsx +14 -7
- package/src/beta-badge.tsx +21 -0
- package/src/button/actions-button-compact.tsx +1 -1
- package/src/button/base-button.tsx +4 -3
- package/src/button/button.tsx +89 -2
- package/src/button/icon-button.tsx +4 -2
- package/src/button/select-button.tsx +23 -8
- package/src/card-container.tsx +29 -65
- 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 +28 -14
- package/src/command-menu/index.tsx +16 -11
- package/src/command-menu/nested-command-menu.tsx +8 -1
- package/src/context-menu/index.tsx +3 -3
- package/src/count-badge.tsx +57 -0
- package/src/date-picker/date-range-input.tsx +1 -1
- package/src/date-picker/fake-date-input.tsx +1 -1
- package/src/date-picker/relative-date-picker.tsx +1 -1
- package/src/date-picker/single-date-input.tsx +1 -1
- package/src/date-picker/utils.ts +9 -2
- package/src/design-system.ts +85 -50
- package/src/dropdown-menu/index.tsx +1 -1
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +3 -9
- package/src/emoji-picker/icon-emoji-picker.tsx +75 -69
- package/src/emoji-picker/primitives/header.tsx +1 -0
- package/src/emoji-picker/primitives/search.tsx +12 -13
- 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 +26 -0
- package/src/field-type-icon.tsx +82 -0
- package/src/format-date-from-now.ts +1 -1
- package/src/guide-link.tsx +4 -3
- package/src/hint.tsx +10 -1
- package/src/html-styles.ts +15 -13
- package/src/icons/ast/AiFiberyBuild.ts +8 -0
- package/src/icons/ast/Anthropic.ts +8 -0
- 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/Crosshair.ts +8 -0
- package/src/icons/ast/Csv.ts +8 -0
- package/src/icons/ast/Document.ts +8 -0
- package/src/icons/ast/EntityCreate.ts +8 -0
- package/src/icons/ast/ExpandAll.ts +8 -0
- package/src/icons/ast/FiberyDesktopApp.ts +8 -0
- package/src/icons/ast/FiberyMono.ts +1 -1
- package/src/icons/ast/FileDownload.ts +8 -0
- package/src/icons/ast/GraduationCapFilled.ts +8 -0
- package/src/icons/ast/Home.ts +1 -1
- package/src/icons/ast/ImportFilled.ts +8 -0
- package/src/icons/ast/IntegrationsFilled.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 +8 -0
- 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/SpaceApp.ts +8 -0
- package/src/icons/ast/SpaceGenerate.ts +8 -0
- package/src/icons/ast/SpaceList.ts +8 -0
- package/src/icons/ast/SpaceScratch.ts +8 -0
- package/src/icons/ast/SpaceTemplate.ts +8 -0
- package/src/icons/ast/SuggestIntegration.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/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 +30 -0
- package/src/icons/react/AiFiberyBuild.tsx +13 -0
- package/src/icons/react/Anthropic.tsx +13 -0
- package/src/icons/react/Apple.tsx +13 -0
- package/src/icons/react/Crosshair.tsx +13 -0
- package/src/icons/react/Csv.tsx +13 -0
- package/src/icons/react/Document.tsx +13 -0
- package/src/icons/react/EntityCreate.tsx +13 -0
- package/src/icons/react/ExpandAll.tsx +13 -0
- package/src/icons/react/FiberyDesktopApp.tsx +13 -0
- package/src/icons/react/FileDownload.tsx +13 -0
- package/src/icons/react/GraduationCapFilled.tsx +13 -0
- package/src/icons/react/ImportFilled.tsx +13 -0
- package/src/icons/react/IntegrationsFilled.tsx +13 -0
- package/src/icons/react/LocationEdit.tsx +13 -0
- package/src/icons/react/MessagePlus.tsx +13 -0
- package/src/icons/react/OpenAi.tsx +13 -0
- package/src/icons/react/RicheditorMarkHighlight.tsx +13 -0
- package/src/icons/react/SpaceApp.tsx +13 -0
- package/src/icons/react/SpaceGenerate.tsx +13 -0
- package/src/icons/react/SpaceList.tsx +13 -0
- package/src/icons/react/SpaceScratch.tsx +13 -0
- package/src/icons/react/SpaceTemplate.tsx +13 -0
- package/src/icons/react/SuggestIntegration.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 +30 -0
- package/src/icons/svg/ai-fibery-build.svg +24 -0
- package/src/icons/svg/anthropic.svg +3 -0
- 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/crosshair.svg +4 -0
- package/src/icons/svg/csv.svg +3 -0
- package/src/icons/svg/document.svg +4 -0
- package/src/icons/svg/entity-create.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/fibery-mono.svg +6 -1
- package/src/icons/svg/file-download.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.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/location-edit.svg +13 -0
- package/src/icons/svg/message-plus.svg +4 -0
- package/src/icons/svg/open-ai.svg +3 -0
- package/src/icons/svg/open-as-page.svg +2 -3
- 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/space-app.svg +3 -0
- package/src/icons/svg/space-generate.svg +3 -0
- package/src/icons/svg/space-list.svg +4 -0
- package/src/icons/svg/space-scratch.svg +3 -0
- package/src/icons/svg/space-template.svg +3 -0
- package/src/icons/svg/suggest-integration.svg +4 -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/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/icons/types.ts +2 -2
- package/src/integration-compact-info-button.tsx +3 -1
- package/src/layout-styles.ts +23 -0
- package/src/lists/list-row-surface.tsx +2 -1
- package/src/loaders.tsx +6 -6
- package/src/logo.tsx +23 -48
- package/src/mobile-styles.ts +2 -0
- package/src/new-badge.tsx +5 -6
- package/src/number-input/text-area-auto-sized.tsx +47 -0
- package/src/number-input/text-input-auto-sized.tsx +49 -0
- package/src/palette.ts +50 -50
- package/src/popup/index.tsx +1 -0
- 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 +136 -145
- package/src/select/select-in-popover.tsx +103 -108
- package/src/select/styles.ts +60 -24
- package/src/shortcut-badge.tsx +1 -0
- package/src/tab-nav/tab-nav.tsx +12 -19
- package/src/theme-provider.tsx +9 -1
- package/src/toast/utils/toastify-item-name.ts +1 -1
- package/src/tooltip-if-overflown.tsx +9 -3
- package/src/type-badge-box.tsx +4 -2
- package/src/type-badge.tsx +20 -12
- 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 +60 -41
- package/src/unit/styles.ts +12 -12
- package/src/unit/types.ts +5 -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 +12 -0
- package/src/workflow-progress-icon.tsx +1 -1
- 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/use-is-phone.ts +0 -5
- /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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @fibery/ui-kit
|
|
2
2
|
|
|
3
|
+
## 1.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aba5c58: update colors palette
|
|
8
|
+
|
|
9
|
+
## 1.36.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 651e6f2: add noColor option to TypeBadge
|
|
14
|
+
- Updated dependencies [7976d88]
|
|
15
|
+
- @fibery/helpers@1.3.3
|
|
16
|
+
- @fibery/react@1.4.4
|
|
17
|
+
|
|
3
18
|
## 1.36.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"dependencies": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"tabbable": "5.2.1",
|
|
45
45
|
"ua-parser-js": "1.0.39",
|
|
46
46
|
"@fibery/emoji-data": "2.6.1",
|
|
47
|
-
"@fibery/helpers": "1.3.
|
|
48
|
-
"@fibery/react": "1.4.
|
|
47
|
+
"@fibery/helpers": "1.3.3",
|
|
48
|
+
"@fibery/react": "1.4.4"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "^18.2.0",
|
|
@@ -82,7 +82,21 @@ for (const iconPath of iconPaths) {
|
|
|
82
82
|
const {class: className, xmlns, ...rest} = node.properties ?? {};
|
|
83
83
|
return {
|
|
84
84
|
...node,
|
|
85
|
-
properties: Object.fromEntries(
|
|
85
|
+
properties: Object.fromEntries(
|
|
86
|
+
Object.entries(rest).map(([key, value]) => {
|
|
87
|
+
if (key === "style") {
|
|
88
|
+
const style = {};
|
|
89
|
+
value.split(";").forEach((styleItem) => {
|
|
90
|
+
const [styleKey, styleValue] = styleItem.split(":").map((s) => s.trim());
|
|
91
|
+
if (styleKey && styleValue) {
|
|
92
|
+
style[_.camelCase(styleKey)] = styleValue;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return [_.camelCase(key), style];
|
|
96
|
+
}
|
|
97
|
+
return [_.camelCase(key), value];
|
|
98
|
+
})
|
|
99
|
+
),
|
|
86
100
|
};
|
|
87
101
|
}),
|
|
88
102
|
name: _.kebabCase(name),
|
package/src/action-badge.tsx
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {css, cx} from "@linaria/core";
|
|
2
2
|
import {forwardRef, ReactNode} from "react";
|
|
3
3
|
import {BaseButton, BaseButtonProps} from "./button/base-button";
|
|
4
|
-
import {space, themeVars, typeSizes} from "./design-system";
|
|
4
|
+
import {fontWeight, space, themeVars, typeSizes} from "./design-system";
|
|
5
5
|
import {iconSizeVar} from "./icons/Icon";
|
|
6
6
|
|
|
7
7
|
const containerStyle = css`
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
vertical-align: text-top;
|
|
10
10
|
height: 18px;
|
|
11
|
+
margin-top: ${space.s1}px;
|
|
11
12
|
align-items: center;
|
|
12
|
-
padding:
|
|
13
|
-
border-radius:
|
|
13
|
+
padding: 2.5px ${space.s4}px;
|
|
14
|
+
border-radius: ${space.s4}px;
|
|
14
15
|
|
|
15
16
|
font-size: ${typeSizes[6]}px;
|
|
16
|
-
|
|
17
|
+
font-weight: ${fontWeight.medium};
|
|
17
18
|
|
|
18
19
|
&:is(:disabled) {
|
|
19
20
|
color: ${themeVars.accentTextColor};
|
|
@@ -2,19 +2,9 @@ import {css} from "@linaria/core";
|
|
|
2
2
|
import {ActionsPanel} from "../actions-panel";
|
|
3
3
|
import {AntModal} from "../antd/ant-modal";
|
|
4
4
|
import {Button} from "../button/button";
|
|
5
|
-
import {
|
|
5
|
+
import {space, themeVars} from "../design-system";
|
|
6
6
|
import {useActionsMenuContext} from "./contexts/actions-menu-context";
|
|
7
7
|
|
|
8
|
-
const modalClass = css`
|
|
9
|
-
& .ant-modal-content {
|
|
10
|
-
box-shadow: ${themeVars.shadowModal};
|
|
11
|
-
margin-left: ${space.s6}px;
|
|
12
|
-
margin-right: ${space.s6}px;
|
|
13
|
-
background-color: ${themeVars.modalContentBg};
|
|
14
|
-
border-radius: ${border.radius6}px;
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
8
|
export type ActionsMenuConfirmationProps = {
|
|
19
9
|
message: string;
|
|
20
10
|
onCancel?: () => void;
|
|
@@ -32,7 +22,6 @@ export const ActionsMenuConfirmation: React.FC<ActionsMenuConfirmationProps> = (
|
|
|
32
22
|
closable={false}
|
|
33
23
|
footer={null}
|
|
34
24
|
maskStyle={{backgroundColor: themeVars.modalBg}}
|
|
35
|
-
className={modalClass}
|
|
36
25
|
maskClosable
|
|
37
26
|
onCancel={() => showConfirmation(null)}
|
|
38
27
|
>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {stopPropagation} from "@fibery/react/src/stop-propagation";
|
|
2
2
|
import {useCallbackRef} from "@fibery/react/src/use-callback-ref";
|
|
3
|
-
import CheckedIcon from "../icons/react/Checked";
|
|
4
3
|
import {css, cx} from "@linaria/core";
|
|
5
4
|
import {FunctionComponent, memo, ReactNode, useId} from "react";
|
|
6
5
|
import {border, colors, layout, lineHeight, space, textStyles, themeVars} from "../design-system";
|
|
6
|
+
import CheckedIcon from "../icons/react/Checked";
|
|
7
7
|
import {IconBaseProps} from "../icons/types";
|
|
8
8
|
import {Spinner} from "../loaders";
|
|
9
9
|
import {ShortcutBadge} from "../shortcut-badge";
|
|
10
10
|
import {useTheme} from "../theme-provider";
|
|
11
|
-
import {useActiveDangerousRow, useSetActiveDangerousRow} from "./contexts/actions-menu-dangerous-rows";
|
|
12
11
|
import {useActionsMenuContext} from "./contexts/actions-menu-context";
|
|
12
|
+
import {useActiveDangerousRow, useSetActiveDangerousRow} from "./contexts/actions-menu-dangerous-rows";
|
|
13
13
|
|
|
14
14
|
const hiddenTextCss = css`
|
|
15
15
|
visibility: hidden;
|
|
@@ -90,7 +90,7 @@ const RightCorner = ({shortcut, loading, checked}: {shortcut?: string; loading?:
|
|
|
90
90
|
|
|
91
91
|
return loading || shortcut || checked ? (
|
|
92
92
|
<div className={cornerCss}>
|
|
93
|
-
{loading ? <Spinner color={theme.primary}
|
|
93
|
+
{loading ? <Spinner color={theme.primary} iconSize={16} containerSize={16} /> : null}
|
|
94
94
|
{shortcut ? <ShortcutBadge shortcut={shortcut} /> : null}
|
|
95
95
|
{checked ? <CheckedIcon iconSize={18} color={themeVars.textColor} /> : null}
|
|
96
96
|
</div>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
CommandMenuItem,
|
|
11
11
|
CommandMenuList,
|
|
12
12
|
CommandMenuRoot,
|
|
13
|
+
CommandMenuSeparator,
|
|
13
14
|
} from "../command-menu";
|
|
14
15
|
import {ActionsMenuSubMenu} from "./actions-menu-sub-menu";
|
|
15
16
|
import {useActionsMenuContext} from "./contexts/actions-menu-context";
|
|
@@ -159,3 +160,5 @@ export const ActionsMenuSubCommandMenuItem: React.FC<React.ComponentPropsWithout
|
|
|
159
160
|
export const ActionsMenuSubCommandMenuEmpty = CommandMenuEmpty;
|
|
160
161
|
|
|
161
162
|
export const ActionsMenuSubCommandMenuGroup = CommandMenuGroup;
|
|
163
|
+
|
|
164
|
+
export const ActionsMenuSubCommandMenuSeparator = CommandMenuSeparator;
|
package/src/antd/ant-modal.tsx
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import Modal from "antd/lib/modal";
|
|
2
2
|
import {ModalProps} from "antd/lib/modal/Modal";
|
|
3
3
|
import "antd/lib/modal/style/css";
|
|
4
|
-
import {createInlineTheme} from "../design-system";
|
|
4
|
+
import {border, createInlineTheme, space, themeVars} from "../design-system";
|
|
5
5
|
import {useTheme} from "../theme-provider";
|
|
6
|
+
import {css, cx} from "@linaria/core";
|
|
7
|
+
|
|
8
|
+
const modalCss = css`
|
|
9
|
+
& .ant-modal-content {
|
|
10
|
+
box-shadow: ${themeVars.shadowPopup};
|
|
11
|
+
margin-left: ${space.s6}px;
|
|
12
|
+
margin-right: ${space.s6}px;
|
|
13
|
+
background-color: ${themeVars.modalContentBg};
|
|
14
|
+
border-radius: ${border.radius8}px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& .ant-modal-body {
|
|
18
|
+
padding: ${space.s20}px;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
6
21
|
|
|
7
22
|
export function AntModal({bodyStyle = {}, className, ...restProps}: ModalProps) {
|
|
8
23
|
const theme = useTheme();
|
|
9
24
|
const inlineTheme = createInlineTheme(theme);
|
|
10
|
-
return <Modal bodyStyle={{...bodyStyle, ...inlineTheme}} className={className} {...restProps} />;
|
|
25
|
+
return <Modal bodyStyle={{...bodyStyle, ...inlineTheme}} className={cx(className, modalCss)} {...restProps} />;
|
|
11
26
|
}
|
package/src/antd/input.tsx
CHANGED
|
@@ -11,6 +11,9 @@ const TextArea = Input.TextArea;
|
|
|
11
11
|
|
|
12
12
|
export const transparentInputStyle = css`
|
|
13
13
|
${{
|
|
14
|
+
display: "flex",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
|
|
14
17
|
"& input, & textarea, & .ant-input-affix-wrapper": {
|
|
15
18
|
padding: 0,
|
|
16
19
|
border: "none",
|
|
@@ -43,14 +46,12 @@ export const transparentInputStyle = css`
|
|
|
43
46
|
const InputWrapper = getWrapper(inputStyles);
|
|
44
47
|
|
|
45
48
|
export const StyledInput = wrapWith(InputWrapper, Input);
|
|
46
|
-
|
|
47
49
|
export const StyledTextArea = wrapWith(InputWrapper, TextArea);
|
|
48
50
|
|
|
49
51
|
export const TransparentInputWrapper = getWrapper(transparentInputStyle);
|
|
50
|
-
export const StyledTransparentInput = wrapWith(TransparentInputWrapper, Input);
|
|
51
52
|
|
|
52
53
|
export type TextAreaRef = React.ElementRef<typeof TextArea>;
|
|
53
54
|
export const AntTransparentTextArea = wrapWith(TransparentInputWrapper, TextArea);
|
|
54
55
|
|
|
55
56
|
export type InputRef = React.ElementRef<typeof Input>;
|
|
56
|
-
export const AntTransparentInput =
|
|
57
|
+
export const AntTransparentInput = wrapWith(TransparentInputWrapper, Input);
|
|
@@ -6,6 +6,7 @@ import {AppIconWrapper} from "./app-icon-wrapper";
|
|
|
6
6
|
import {getAppIconBackgroundColor, getOpacities, getThemeValue, iconSize, layout} from "./design-system";
|
|
7
7
|
import {Icon} from "./icons/Icon";
|
|
8
8
|
import {useTheme} from "./theme-provider";
|
|
9
|
+
import {useIsPhone} from "./use-is-phone";
|
|
9
10
|
|
|
10
11
|
type AppIcon = {
|
|
11
12
|
name: string;
|
|
@@ -122,15 +123,11 @@ interface AppIconProps {
|
|
|
122
123
|
containerSize?: number;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
export const AppIcon: FC<AppIconProps> = ({
|
|
126
|
-
icon,
|
|
127
|
-
iconSize = 18,
|
|
128
|
-
color,
|
|
129
|
-
isSelected,
|
|
130
|
-
containerSize = layout.newMenuIconSize,
|
|
131
|
-
}) => {
|
|
126
|
+
export const AppIcon: FC<AppIconProps> = ({icon, color, isSelected, ...rest}) => {
|
|
132
127
|
const theme = useTheme();
|
|
133
|
-
|
|
128
|
+
const isPhone = useIsPhone();
|
|
129
|
+
const defaultIconSize = isPhone ? layout.mobileSidebarIconSize : layout.newMenuIconSize;
|
|
130
|
+
const {iconSize = defaultIconSize, containerSize = defaultIconSize} = rest;
|
|
134
131
|
const iconColor = getThemeValue(theme.mode, {
|
|
135
132
|
dark: a11yColor(getOpacities(color).opacity95, theme.menuBg, 5),
|
|
136
133
|
light: a11yColor(getOpacities(color).opacity95, theme.whiteColor, 3),
|
package/src/app-icon-wrapper.tsx
CHANGED
|
@@ -3,8 +3,7 @@ import cn from "classnames";
|
|
|
3
3
|
import {ReactNode} from "react";
|
|
4
4
|
import {border, getThemeValue, layout} from "./design-system";
|
|
5
5
|
import {useTheme} from "./theme-provider";
|
|
6
|
-
|
|
7
|
-
export const appIconSize = layout.newMenuIconSize;
|
|
6
|
+
import {useIsPhone} from "./use-is-phone";
|
|
8
7
|
|
|
9
8
|
const appIconContainerStyle = css`
|
|
10
9
|
border-radius: ${border.radius4}px;
|
|
@@ -20,7 +19,7 @@ export const AppIconWrapper = ({
|
|
|
20
19
|
children,
|
|
21
20
|
color,
|
|
22
21
|
borderless,
|
|
23
|
-
|
|
22
|
+
...rest
|
|
24
23
|
}: {
|
|
25
24
|
children?: ReactNode;
|
|
26
25
|
color: string;
|
|
@@ -28,7 +27,8 @@ export const AppIconWrapper = ({
|
|
|
28
27
|
containerSize?: number;
|
|
29
28
|
}) => {
|
|
30
29
|
const theme = useTheme();
|
|
31
|
-
|
|
30
|
+
const isPhone = useIsPhone();
|
|
31
|
+
const {containerSize = isPhone ? layout.mobileSidebarIconSize : layout.newMenuIconSize} = rest;
|
|
32
32
|
return (
|
|
33
33
|
<div
|
|
34
34
|
style={{backgroundColor: borderless ? "transparent" : color, width: containerSize, height: containerSize}}
|
package/src/appIcons.json
CHANGED
|
@@ -13023,6 +13023,26 @@
|
|
|
13023
13023
|
"imageUrl": "https://images-temp.fibery.io/ui/appIcons/airtable.svg",
|
|
13024
13024
|
"file": "airtable.svg"
|
|
13025
13025
|
},
|
|
13026
|
+
{
|
|
13027
|
+
"name": "Asana",
|
|
13028
|
+
"short_names": ["asana"],
|
|
13029
|
+
"customCategory": "Integrations",
|
|
13030
|
+
"text": "",
|
|
13031
|
+
"emoticons": [],
|
|
13032
|
+
"keywords": ["logo", "brand", "integration", "asana"],
|
|
13033
|
+
"imageUrl": "https://images-temp.fibery.io/ui/appIcons/asana.svg",
|
|
13034
|
+
"file": "asana.svg"
|
|
13035
|
+
},
|
|
13036
|
+
{
|
|
13037
|
+
"name": "Fibery",
|
|
13038
|
+
"short_names": ["fibery"],
|
|
13039
|
+
"customCategory": "Integrations",
|
|
13040
|
+
"text": "",
|
|
13041
|
+
"emoticons": [],
|
|
13042
|
+
"keywords": ["logo", "brand", "integration", "fibery"],
|
|
13043
|
+
"imageUrl": "https://images-temp.fibery.io/ui/appIcons/fibery-logo.svg",
|
|
13044
|
+
"file": "fibery-logo.svg"
|
|
13045
|
+
},
|
|
13026
13046
|
{
|
|
13027
13047
|
"name": "Readwise",
|
|
13028
13048
|
"short_names": ["readwise"],
|
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
|
>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
import {space, textStyles, themeVars} from "./design-system";
|
|
3
|
+
|
|
4
|
+
const betaBadgeStyle = css`
|
|
5
|
+
${textStyles.heading8}
|
|
6
|
+
display: inline-block;
|
|
7
|
+
padding: ${space.s2}px 5px;
|
|
8
|
+
color: ${themeVars.colorAI};
|
|
9
|
+
background-color: ${themeVars.colorBgAI};
|
|
10
|
+
vertical-align: text-top;
|
|
11
|
+
border-radius: ${space.s4}px;
|
|
12
|
+
`;
|
|
13
|
+
|
|
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
|
+
);
|
|
@@ -5,7 +5,7 @@ import MoreCompactIcon from "../icons/react/MoreCompact";
|
|
|
5
5
|
export const ActionsButtonCompact = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
6
6
|
function ActionsButtonCompactComponent({...rest}, ref) {
|
|
7
7
|
return (
|
|
8
|
-
<IconButton ref={ref} size="small" {...rest}>
|
|
8
|
+
<IconButton supportMobile={true} ref={ref} size="small" {...rest}>
|
|
9
9
|
<MoreCompactIcon />
|
|
10
10
|
</IconButton>
|
|
11
11
|
);
|
|
@@ -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`
|
|
@@ -21,7 +22,7 @@ export const baseButton = css`
|
|
|
21
22
|
cursor: pointer;
|
|
22
23
|
user-select: none;
|
|
23
24
|
|
|
24
|
-
transition-property: border, background-color, color, opacity;
|
|
25
|
+
transition-property: border, background-color, color, opacity, box-shadow;
|
|
25
26
|
transition-duration: 0.15s;
|
|
26
27
|
|
|
27
28
|
color: var(--fibery-button-text-color);
|
|
@@ -29,7 +30,7 @@ export const baseButton = css`
|
|
|
29
30
|
|
|
30
31
|
background-color: var(--fibery-button-color);
|
|
31
32
|
|
|
32
|
-
box-shadow: inset 0 0 0
|
|
33
|
+
box-shadow: inset 0 0 0 1px var(--fibery-button-border-color);
|
|
33
34
|
|
|
34
35
|
&:hover:not(:disabled) {
|
|
35
36
|
background-color: var(--fibery-button-hover-color);
|
|
@@ -90,7 +91,7 @@ const getColors = (variant: ButtonVariant, color: ButtonColor) => {
|
|
|
90
91
|
|
|
91
92
|
if (variantMod === "Outline") {
|
|
92
93
|
borderColors = {
|
|
93
|
-
"--fibery-button-border-color": themeVars[`colorBorderButton${variantMod}${colorMod}Default`
|
|
94
|
+
"--fibery-button-border-color": themeVars[`colorBorderButton${variantMod}${colorMod}Default`],
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
|
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,21 @@ 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
|
+
|
|
77
143
|
& > .${shortcutContainer} {
|
|
78
144
|
font-size: ${textStyles.regular.fontSize}px;
|
|
79
145
|
}
|
|
@@ -86,15 +152,36 @@ const fullWidthMod = css`
|
|
|
86
152
|
|
|
87
153
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
88
154
|
(
|
|
89
|
-
{
|
|
155
|
+
{
|
|
156
|
+
size = "medium",
|
|
157
|
+
iconStart,
|
|
158
|
+
supportMobile,
|
|
159
|
+
iconEnd,
|
|
160
|
+
className,
|
|
161
|
+
children,
|
|
162
|
+
pending,
|
|
163
|
+
disabled,
|
|
164
|
+
shortcut,
|
|
165
|
+
fullWidth,
|
|
166
|
+
...buttonProps
|
|
167
|
+
},
|
|
90
168
|
ref
|
|
91
169
|
) => {
|
|
92
170
|
const isSupportHardwareKeyboard = useIsSupportHardwareKeyboard();
|
|
171
|
+
const isPhone = useIsPhone();
|
|
93
172
|
return (
|
|
94
173
|
<BaseButton
|
|
95
174
|
ref={ref}
|
|
96
175
|
disabled={disabled || pending}
|
|
97
|
-
className={cx(
|
|
176
|
+
className={cx(
|
|
177
|
+
className,
|
|
178
|
+
button,
|
|
179
|
+
buttonSize[supportMobile && isPhone ? "large" : size],
|
|
180
|
+
fullWidth && fullWidthMod,
|
|
181
|
+
iconStart && withIconStart,
|
|
182
|
+
iconEnd && withIconEnd,
|
|
183
|
+
!children && withoutChildren
|
|
184
|
+
)}
|
|
98
185
|
{...buttonProps}
|
|
99
186
|
>
|
|
100
187
|
{pending ? <SpinnerIcon /> : iconStart}
|
|
@@ -4,6 +4,7 @@ import {border, space} from "../design-system";
|
|
|
4
4
|
import {iconSizeVar} from "../icons/Icon";
|
|
5
5
|
import Spinner from "../icons/react/Spinner";
|
|
6
6
|
import {BaseButton, BaseButtonProps, ButtonSize} from "./base-button";
|
|
7
|
+
import {useIsPhone} from "../use-is-phone";
|
|
7
8
|
|
|
8
9
|
export type IconButtonProps = {
|
|
9
10
|
size?: ButtonSize;
|
|
@@ -54,13 +55,14 @@ export const iconButtonSizes = {
|
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(
|
|
57
|
-
{size = "medium", className, variant = "ghost", color = "neutral", pending, children, ...rest},
|
|
58
|
+
{size = "medium", supportMobile, className, variant = "ghost", color = "neutral", pending, children, ...rest},
|
|
58
59
|
ref
|
|
59
60
|
) {
|
|
61
|
+
const isPhone = useIsPhone();
|
|
60
62
|
return (
|
|
61
63
|
<BaseButton
|
|
62
64
|
ref={ref}
|
|
63
|
-
className={cx(className, iconButton, iconButtonSizes[size])}
|
|
65
|
+
className={cx(className, iconButton, iconButtonSizes[supportMobile && isPhone ? "large" : size])}
|
|
64
66
|
variant={variant}
|
|
65
67
|
color={color}
|
|
66
68
|
{...rest}
|
|
@@ -4,10 +4,24 @@ import {space} from "../design-system";
|
|
|
4
4
|
import ArrowBottom from "../icons/react/ArrowBottom";
|
|
5
5
|
import {Button, ButtonProps} from "./button";
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const iconSize = {
|
|
8
|
+
tiny: css`
|
|
9
|
+
margin-left: -${space.s2}px;
|
|
10
|
+
margin-right: -${space.s2}px;
|
|
11
|
+
`,
|
|
12
|
+
small: css`
|
|
13
|
+
margin-left: -${space.s3}px;
|
|
14
|
+
margin-right: -${space.s3}px;
|
|
15
|
+
`,
|
|
16
|
+
medium: css`
|
|
17
|
+
margin-left: -${space.s4}px;
|
|
18
|
+
margin-right: -${space.s4}px;
|
|
19
|
+
`,
|
|
20
|
+
large: css`
|
|
21
|
+
margin-left: -${space.s4}px;
|
|
22
|
+
margin-right: -${space.s4}px;
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
11
25
|
|
|
12
26
|
export type SelectButtonProps = {
|
|
13
27
|
/**
|
|
@@ -19,16 +33,17 @@ export type SelectButtonProps = {
|
|
|
19
33
|
} & Omit<ButtonProps, "iconEnd">;
|
|
20
34
|
|
|
21
35
|
export const SelectButton = forwardRef<HTMLButtonElement, SelectButtonProps>(function SelectButton(
|
|
22
|
-
{className, open, ...rest},
|
|
36
|
+
{size = "medium", className, open, variant = "ghost", color = "neutral", ...rest},
|
|
23
37
|
forwardedRef
|
|
24
38
|
) {
|
|
25
39
|
return (
|
|
26
40
|
<Button
|
|
27
41
|
ref={forwardedRef}
|
|
28
42
|
aria-expanded={open}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
size={size}
|
|
44
|
+
iconEnd={<ArrowBottom className={iconSize[size]} />}
|
|
45
|
+
variant={variant}
|
|
46
|
+
color={color}
|
|
32
47
|
className={className}
|
|
33
48
|
{...rest}
|
|
34
49
|
/>
|