@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
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {compact} from "lodash";
|
|
3
|
-
import {AntTabs} from "../antd/Tabs";
|
|
4
3
|
import {Button} from "../button/button";
|
|
5
|
-
import {
|
|
4
|
+
import {colors, space} from "../design-system";
|
|
6
5
|
import EmojiDelete from "../icons/react/EmojiDelete";
|
|
7
6
|
import {$TSFixMe} from "../tsfixme";
|
|
8
7
|
import {AppIconPicker, AppIconPickerProps} from "./app-icon-picker";
|
|
9
8
|
import {EmojiPicker, EmojiPickerProps} from "./emoji-picker";
|
|
9
|
+
import {TabNavItem, TabNavLink, TabNavList, TabNavRoot} from "../tab-nav/tab-nav";
|
|
10
|
+
import {useState} from "react";
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`}
|
|
16
|
-
>
|
|
17
|
-
{children}
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
12
|
+
const tabNavRootStyle = css`
|
|
13
|
+
padding: ${space.s4}px ${space.s12}px 0 ${space.s12}px;
|
|
14
|
+
box-shadow: inset 0 -1px ${colors.shades.opacity5};
|
|
15
|
+
`;
|
|
20
16
|
|
|
21
17
|
type TabKey = "icons" | "emojis";
|
|
22
18
|
|
|
@@ -49,65 +45,84 @@ export const IconEmojiPicker: React.FC<IconEmojiPickerProps> = ({
|
|
|
49
45
|
color,
|
|
50
46
|
getHoverColor,
|
|
51
47
|
}) => {
|
|
48
|
+
const items = compact([
|
|
49
|
+
onEmojiSelect && {
|
|
50
|
+
key: "emojis" as const,
|
|
51
|
+
label: "Emojis",
|
|
52
|
+
children: (
|
|
53
|
+
<>
|
|
54
|
+
<EmojiPicker
|
|
55
|
+
emojiSize={emojiSize}
|
|
56
|
+
color={color}
|
|
57
|
+
onColorSelect={showColorPickerOnTabs.includes("emojis") ? onColorSelect : undefined}
|
|
58
|
+
onCustomCategorySettings={onCustomEmojisSettings}
|
|
59
|
+
onAddCustomEmoji={onCreateClick}
|
|
60
|
+
getHoverColor={getHoverColor}
|
|
61
|
+
onSelect={onEmojiSelect}
|
|
62
|
+
showSkinTones
|
|
63
|
+
/>
|
|
64
|
+
</>
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
onIconSelect && {
|
|
68
|
+
key: "icons" as const,
|
|
69
|
+
label: "Icons",
|
|
70
|
+
children: (
|
|
71
|
+
<AppIconPicker
|
|
72
|
+
emojiSize={emojiSize}
|
|
73
|
+
color={color}
|
|
74
|
+
onColorSelect={showColorPickerOnTabs.includes("icons") ? onColorSelect : undefined}
|
|
75
|
+
getHoverColor={getHoverColor}
|
|
76
|
+
onSelect={onIconSelect}
|
|
77
|
+
/>
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
const firstTab = items[0];
|
|
83
|
+
const [activeTab, setActiveTab] = useState(defaultTab || firstTab?.key);
|
|
84
|
+
|
|
52
85
|
return (
|
|
53
|
-
<
|
|
54
|
-
|
|
86
|
+
<div
|
|
87
|
+
className={css`
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
55
90
|
height: 100%;
|
|
56
|
-
& .ant-tabs,
|
|
57
|
-
& .ant-tabs-content,
|
|
58
|
-
& .ant-tabs-tabpane,
|
|
59
|
-
& .ant-tabs-content-holder {
|
|
60
|
-
height: 100%;
|
|
61
|
-
}
|
|
62
91
|
`}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
tabBarExtraContent={
|
|
99
|
-
onReset ? (
|
|
100
|
-
<div
|
|
101
|
-
className={css`
|
|
102
|
-
padding-right: ${space.s12}px;
|
|
103
|
-
`}
|
|
104
|
-
>
|
|
105
|
-
<Button variant="outline" color="neutral" iconStart={<EmojiDelete />} size={"small"} onClick={onReset}>
|
|
106
|
-
{resetLabel}
|
|
107
|
-
</Button>
|
|
108
|
-
</div>
|
|
109
|
-
) : null
|
|
110
|
-
}
|
|
111
|
-
/>
|
|
92
|
+
>
|
|
93
|
+
<TabNavRoot className={tabNavRootStyle}>
|
|
94
|
+
<div
|
|
95
|
+
className={css`
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
`}
|
|
99
|
+
>
|
|
100
|
+
<TabNavList>
|
|
101
|
+
{items.map((item) => {
|
|
102
|
+
return (
|
|
103
|
+
<TabNavLink key={item.key} active={item.key === activeTab} onSelect={() => setActiveTab(item.key)}>
|
|
104
|
+
{item.label}
|
|
105
|
+
</TabNavLink>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</TabNavList>
|
|
109
|
+
{onReset && (
|
|
110
|
+
<TabNavItem>
|
|
111
|
+
<Button
|
|
112
|
+
size="small"
|
|
113
|
+
variant="ghost"
|
|
114
|
+
color="neutral"
|
|
115
|
+
iconStart={<EmojiDelete />}
|
|
116
|
+
onClick={onReset}
|
|
117
|
+
supportMobile
|
|
118
|
+
>
|
|
119
|
+
{resetLabel}
|
|
120
|
+
</Button>
|
|
121
|
+
</TabNavItem>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
</TabNavRoot>
|
|
125
|
+
{items.find((item) => item.key === activeTab)?.children}
|
|
126
|
+
</div>
|
|
112
127
|
);
|
|
113
128
|
};
|
|
@@ -6,6 +6,7 @@ const pickerHeader = css`
|
|
|
6
6
|
padding: ${space.s12}px ${contentHorizontalPadding}px ${space.s6}px ${contentHorizontalPadding}px;
|
|
7
7
|
position: relative;
|
|
8
8
|
`;
|
|
9
|
+
|
|
9
10
|
export const EmojiPickerHeader: React.FC<React.PropsWithChildren> = ({children}) => {
|
|
10
11
|
return <div className={pickerHeader}>{children}</div>;
|
|
11
12
|
};
|
|
@@ -4,7 +4,6 @@ import {css, cx} from "@linaria/core";
|
|
|
4
4
|
import {startTransition, useId, useRef} from "react";
|
|
5
5
|
import {IconButton} from "../../button/icon-button";
|
|
6
6
|
import {border, space, textStyles, themeVars} from "../../design-system";
|
|
7
|
-
import Close from "../../icons/react/Close";
|
|
8
7
|
import Search from "../../icons/react/Search";
|
|
9
8
|
import {useEmojiDataStore} from "../stores/emoji-data-store";
|
|
10
9
|
import type {EmojiPickerGridHandle} from "./grid";
|
|
@@ -12,6 +11,7 @@ import {useEmojiPreview, useSetEmojiPreview} from "./preview-provider";
|
|
|
12
11
|
import {useEmojiPickerCtx, useEmojiPickerI18N} from "./root";
|
|
13
12
|
import {useFoundEmojis, useSetFoundEmojis} from "./search-provider";
|
|
14
13
|
import {useEmojiSkin} from "./skin-provider";
|
|
14
|
+
import ClearInputFilled from "../../icons/react/ClearInputFilled";
|
|
15
15
|
|
|
16
16
|
const searchCss = css`
|
|
17
17
|
${textStyles.regular}
|
|
@@ -24,8 +24,8 @@ const searchCss = css`
|
|
|
24
24
|
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
|
-
padding
|
|
28
|
-
gap: ${space.
|
|
27
|
+
padding: 0 ${space.s4}px;
|
|
28
|
+
gap: ${space.s4}px;
|
|
29
29
|
|
|
30
30
|
/* For screenreaders only, via https://stackoverflow.com/a/19758620 */
|
|
31
31
|
& .sr-only {
|
|
@@ -64,7 +64,6 @@ const searchIconCss = css`
|
|
|
64
64
|
const extraActionSlotCss = css`
|
|
65
65
|
background-color: var(--fibery-emoji-hover-color, ${themeVars.inputCopyBgColor});
|
|
66
66
|
border-radius: ${border.radius5}px;
|
|
67
|
-
margin-right: ${space.s4}px;
|
|
68
67
|
`;
|
|
69
68
|
|
|
70
69
|
export type EmojiPickerSearchProps = {
|
|
@@ -157,15 +156,9 @@ export const EmojiPickerSearch: React.FC<EmojiPickerSearchProps> = ({
|
|
|
157
156
|
|
|
158
157
|
return (
|
|
159
158
|
<section className={cx(searchCss, className)} aria-label={i18n.search}>
|
|
160
|
-
{
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
</IconButton>
|
|
164
|
-
) : (
|
|
165
|
-
<span className={searchIconCss}>
|
|
166
|
-
<Search iconSize={16} />
|
|
167
|
-
</span>
|
|
168
|
-
)}
|
|
159
|
+
<span className={searchIconCss}>
|
|
160
|
+
<Search iconSize={16} />
|
|
161
|
+
</span>
|
|
169
162
|
|
|
170
163
|
<input
|
|
171
164
|
ref={setRefs}
|
|
@@ -189,6 +182,12 @@ export const EmojiPickerSearch: React.FC<EmojiPickerSearchProps> = ({
|
|
|
189
182
|
{i18n.search}
|
|
190
183
|
</label>
|
|
191
184
|
|
|
185
|
+
{foundEmojis && (
|
|
186
|
+
<IconButton size="small" onClick={clearSearch}>
|
|
187
|
+
<ClearInputFilled />
|
|
188
|
+
</IconButton>
|
|
189
|
+
)}
|
|
190
|
+
|
|
192
191
|
{extraAction ? <div className={extraActionSlotCss}>{extraAction}</div> : null}
|
|
193
192
|
</section>
|
|
194
193
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {useMemo} from "react";
|
|
2
|
+
import {measureScrollbar} from "@fibery/helpers/utils/measure-scrollbar";
|
|
3
|
+
import {useIsPhone} from "../use-is-phone";
|
|
4
|
+
|
|
5
|
+
export const useResponsiveEmojiSize = () => {
|
|
6
|
+
const isPhone = useIsPhone();
|
|
7
|
+
return useMemo(
|
|
8
|
+
() => (isPhone ? Math.min(Math.floor((document.body.clientWidth - 24 - measureScrollbar() - 9 * 12) / 9), 40) : 20),
|
|
9
|
+
[isPhone]
|
|
10
|
+
);
|
|
11
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {SpritesheetSet} from "@fibery/emoji-data";
|
|
2
|
+
import {isAndroid} from "../../is-android";
|
|
2
3
|
|
|
3
4
|
export const isApple = () => /Mac|iPhone|iPad/.test(navigator.userAgent);
|
|
4
5
|
|
|
5
|
-
export const getEmojiSet = (): SpritesheetSet => (isApple() ? "apple" : "twitter");
|
|
6
|
+
export const getEmojiSet = (): SpritesheetSet => (isApple() ? "apple" : isAndroid() ? "google" : "twitter");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {css, cx} from "@linaria/core";
|
|
2
2
|
import {fontWeight, space, textStyles, themeVars} from "../design-system";
|
|
3
|
+
import {mobileRootSelector} from "../mobile-styles";
|
|
3
4
|
|
|
4
5
|
const emptyStateCss = css`
|
|
5
6
|
display: flex;
|
|
@@ -31,7 +32,12 @@ const headingCss = css`
|
|
|
31
32
|
font-weight: ${fontWeight.semibold};
|
|
32
33
|
color: ${themeVars.textColor};
|
|
33
34
|
margin: 0;
|
|
35
|
+
|
|
36
|
+
${mobileRootSelector} & {
|
|
37
|
+
${textStyles.heading4}
|
|
38
|
+
}
|
|
34
39
|
`;
|
|
40
|
+
|
|
35
41
|
const descriptionCss = css`
|
|
36
42
|
${textStyles.regular};
|
|
37
43
|
color: ${themeVars.accentTextColor};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {IconButton} from "../button/icon-button";
|
|
3
|
-
import {border, layout, space, textStyles, themeVars} from "../design-system";
|
|
3
|
+
import {border, fontWeight, layout, space, textStyles, themeVars, typeSizes} from "../design-system";
|
|
4
4
|
import CloseIcon from "../icons/react/Close";
|
|
5
|
-
import
|
|
5
|
+
import WarningFilledIcon from "../icons/react/WarningTriangleFilled";
|
|
6
6
|
import {useTheme} from "../theme-provider";
|
|
7
7
|
import {ErrorAlertActionElement} from "./error-alert-action";
|
|
8
8
|
|
|
9
9
|
const errorAlert = css`
|
|
10
10
|
background-color: ${themeVars.errorBgColor};
|
|
11
|
-
padding: ${space.
|
|
11
|
+
padding: ${space.s12}px;
|
|
12
12
|
min-height: ${layout.itemHeight}px;
|
|
13
|
-
border-radius: ${border.
|
|
13
|
+
border-radius: ${border.radius8}px;
|
|
14
14
|
display: flex;
|
|
15
15
|
gap: ${space.s8}px;
|
|
16
16
|
align-items: center;
|
|
@@ -22,14 +22,26 @@ const infoStyle = css`
|
|
|
22
22
|
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
|
+
gap: ${space.s4}px;
|
|
26
|
+
padding: 0 ${space.s4}px;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: flex-start;
|
|
25
29
|
`;
|
|
26
30
|
|
|
27
31
|
const messageStyle = css`
|
|
28
|
-
${
|
|
32
|
+
${{
|
|
33
|
+
...textStyles.regular,
|
|
34
|
+
fontSize: typeSizes[5],
|
|
35
|
+
fontWeight: fontWeight.medium,
|
|
36
|
+
color: themeVars.errorTextColor,
|
|
37
|
+
}};
|
|
29
38
|
`;
|
|
30
39
|
|
|
31
40
|
const descriptionStyle = css`
|
|
32
|
-
${
|
|
41
|
+
${{
|
|
42
|
+
...textStyles.small,
|
|
43
|
+
color: themeVars.errorTextColor,
|
|
44
|
+
}};
|
|
33
45
|
`;
|
|
34
46
|
|
|
35
47
|
export type ErrorAlertProps = {
|
|
@@ -43,7 +55,7 @@ export const ErrorAlert: React.FC<ErrorAlertProps> = ({message, description, act
|
|
|
43
55
|
|
|
44
56
|
return (
|
|
45
57
|
<div className={errorAlert}>
|
|
46
|
-
<
|
|
58
|
+
<WarningFilledIcon color={theme.errorButtonColor} iconSize={16} containerSize={16} />
|
|
47
59
|
<div className={infoStyle}>
|
|
48
60
|
<span className={messageStyle}>{message}</span>
|
|
49
61
|
{description ? <span className={descriptionStyle}>{description}</span> : null}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {AppIconWithFallback} from "./app-icon-with-fallback";
|
|
2
|
+
|
|
3
|
+
const appIconPrefix = ":app-icon/";
|
|
4
|
+
|
|
5
|
+
export const makeFieldAppIcon = (iconName: string) => appIconPrefix + iconName;
|
|
6
|
+
|
|
7
|
+
export const isAppIcon = (name: string) => name.startsWith(appIconPrefix);
|
|
8
|
+
export const getAppIconName = (appIconName: string) => appIconName.slice(appIconPrefix.length);
|
|
9
|
+
|
|
10
|
+
export function FieldAppIcon({
|
|
11
|
+
iconName,
|
|
12
|
+
color,
|
|
13
|
+
containerSize,
|
|
14
|
+
iconSize,
|
|
15
|
+
}: {
|
|
16
|
+
iconName: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
containerSize?: number;
|
|
19
|
+
iconSize?: number;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<AppIconWithFallback
|
|
23
|
+
name={getAppIconName(iconName)}
|
|
24
|
+
color={color}
|
|
25
|
+
containerSize={containerSize}
|
|
26
|
+
iconSize={iconSize}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
package/src/field-container.tsx
CHANGED
|
@@ -21,10 +21,11 @@ type Props = {
|
|
|
21
21
|
collapsible?: boolean;
|
|
22
22
|
collapsed?: boolean;
|
|
23
23
|
onCollapseChange?: (collapsed: boolean) => void;
|
|
24
|
+
badge?: ReactNode;
|
|
24
25
|
children: ReactNode;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
|
-
export const FieldContainer = ({label, collapsible = false, collapsed, onCollapseChange, children}: Props) => {
|
|
28
|
+
export const FieldContainer = ({label, collapsible = false, collapsed, onCollapseChange, badge, children}: Props) => {
|
|
28
29
|
return (
|
|
29
30
|
<CollapsibleSection
|
|
30
31
|
label={label ? <div className={labelStyle}>{label}</div> : undefined}
|
|
@@ -32,6 +33,7 @@ export const FieldContainer = ({label, collapsible = false, collapsed, onCollaps
|
|
|
32
33
|
collapsed={collapsed}
|
|
33
34
|
collapsedDefault={true}
|
|
34
35
|
onCollapsedChange={onCollapseChange}
|
|
36
|
+
badge={badge}
|
|
35
37
|
>
|
|
36
38
|
<div
|
|
37
39
|
className={
|
|
@@ -192,7 +194,7 @@ const checkboxFieldContainerStyle = css`
|
|
|
192
194
|
const checkboxFieldLabelStyle = css`
|
|
193
195
|
${{
|
|
194
196
|
...textStyles.heading6,
|
|
195
|
-
paddingTop: space.
|
|
197
|
+
paddingTop: space.s1,
|
|
196
198
|
}}
|
|
197
199
|
`;
|
|
198
200
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {FieldAppIcon, isAppIcon} from "./field-app-icon";
|
|
2
|
+
import {iconSize as defaultIconSize} from "./design-system";
|
|
3
|
+
import {lazy, Suspense} from "react";
|
|
4
|
+
|
|
5
|
+
const FieldTypeIconLazy = lazy(() => import("./field-type-icon"));
|
|
6
|
+
|
|
7
|
+
export function FieldIcon({
|
|
8
|
+
iconName,
|
|
9
|
+
color,
|
|
10
|
+
containerSize,
|
|
11
|
+
iconSize = defaultIconSize,
|
|
12
|
+
}: {
|
|
13
|
+
iconName?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
containerSize?: number;
|
|
16
|
+
iconSize?: number;
|
|
17
|
+
}): JSX.Element {
|
|
18
|
+
if (iconName && isAppIcon(iconName)) {
|
|
19
|
+
return <FieldAppIcon iconName={iconName} color={color} containerSize={containerSize} iconSize={iconSize} />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const defaultSize = containerSize || iconSize;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Suspense fallback={<div style={{width: defaultSize, height: defaultSize}} />}>
|
|
26
|
+
<FieldTypeIconLazy iconName={iconName} color={color} containerSize={containerSize} iconSize={iconSize} />
|
|
27
|
+
</Suspense>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import AppIcon from "./icons/react/App";
|
|
2
|
+
import TypeText from "./icons/react/TypeText";
|
|
3
|
+
import TypeRichText from "./icons/react/TypeRichText";
|
|
4
|
+
import TypeNumber from "./icons/react/TypeNumber";
|
|
5
|
+
import TypeSingleSelect from "./icons/react/TypeSingleSelect";
|
|
6
|
+
import TypeMultiSelect from "./icons/react/TypeMultiSelect";
|
|
7
|
+
import TypeDate from "./icons/react/TypeDate";
|
|
8
|
+
import TypeCheckbox from "./icons/react/TypeCheckbox";
|
|
9
|
+
import TypeUrl from "./icons/react/TypeUrl";
|
|
10
|
+
import TypeEmail from "./icons/react/TypeEmail";
|
|
11
|
+
import TypeLocation from "./icons/react/TypeLocation";
|
|
12
|
+
import TypeRelation from "./icons/react/TypeRelation";
|
|
13
|
+
import TypeLookup from "./icons/react/TypeLookup";
|
|
14
|
+
import TypeFormula from "./icons/react/TypeFormula";
|
|
15
|
+
import ExtensionReferences from "./icons/react/ExtensionReferences";
|
|
16
|
+
import ExtensionAssignments from "./icons/react/ExtensionAssignments";
|
|
17
|
+
import ExtensionAvatar from "./icons/react/ExtensionAvatar";
|
|
18
|
+
import ExtensionComments from "./icons/react/ExtensionComments";
|
|
19
|
+
import ViewDocument from "./icons/react/ViewDocument";
|
|
20
|
+
import ExtensionFiles from "./icons/react/ExtensionFiles";
|
|
21
|
+
import ViewCanvas from "./icons/react/ViewCanvas";
|
|
22
|
+
import ExtensionWorkflow from "./icons/react/ExtensionWorkflow";
|
|
23
|
+
import TypeMoney from "./icons/react/TypeMoney";
|
|
24
|
+
import TypePercent from "./icons/react/TypePercent";
|
|
25
|
+
import TypeButton from "./icons/react/TypeButton";
|
|
26
|
+
import Delete from "./icons/react/Delete";
|
|
27
|
+
import TypePhone from "./icons/react/TypePhone";
|
|
28
|
+
import TypeEmoji from "./icons/react/TypeEmoji";
|
|
29
|
+
import UserRole from "./icons/react/UserRole";
|
|
30
|
+
import DatabaseStroke from "./icons/react/DatabaseStroke";
|
|
31
|
+
import {IconBaseProps} from "./icons/types";
|
|
32
|
+
|
|
33
|
+
const iconNameToComponent: Record<string, React.FC<IconBaseProps>> = {
|
|
34
|
+
":icon/type/database": DatabaseStroke,
|
|
35
|
+
":icon/type/text": TypeText,
|
|
36
|
+
":icon/type/button": TypeButton,
|
|
37
|
+
":icon/type/rich-text": TypeRichText,
|
|
38
|
+
":icon/type/number": TypeNumber,
|
|
39
|
+
":icon/type/single-select": TypeSingleSelect,
|
|
40
|
+
":icon/type/multi-select": TypeMultiSelect,
|
|
41
|
+
":icon/type/date": TypeDate,
|
|
42
|
+
":icon/type/checkbox": TypeCheckbox,
|
|
43
|
+
":icon/type/url": TypeUrl,
|
|
44
|
+
":icon/type/email": TypeEmail,
|
|
45
|
+
":icon/type/phone": TypePhone,
|
|
46
|
+
":icon/type/emoji": TypeEmoji,
|
|
47
|
+
":icon/type/location": TypeLocation,
|
|
48
|
+
":icon/type/relation": TypeRelation,
|
|
49
|
+
":icon/type/lookup": TypeLookup,
|
|
50
|
+
":icon/type/formula": TypeFormula,
|
|
51
|
+
":icon/extension/references": ExtensionReferences,
|
|
52
|
+
":icon/extension/assignments": ExtensionAssignments,
|
|
53
|
+
":icon/extension/avatar": ExtensionAvatar,
|
|
54
|
+
":icon/extension/icon": TypeEmoji,
|
|
55
|
+
":icon/extension/comments": ExtensionComments,
|
|
56
|
+
":icon/view-document": ViewDocument,
|
|
57
|
+
":icon/extension/files": ExtensionFiles,
|
|
58
|
+
":icon/view-canvas": ViewCanvas,
|
|
59
|
+
":icon/extension/workflow": ExtensionWorkflow,
|
|
60
|
+
":icon/type/money": TypeMoney,
|
|
61
|
+
":icon/type/percent": TypePercent,
|
|
62
|
+
":icon/type/deleted-field": Delete,
|
|
63
|
+
":icon/type/user-role": UserRole,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function getFieldIconComponent(iconName?: string) {
|
|
67
|
+
return (iconName && iconNameToComponent[iconName]) || AppIcon;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
type Props = {
|
|
71
|
+
iconName?: string;
|
|
72
|
+
color?: string;
|
|
73
|
+
containerSize?: number;
|
|
74
|
+
iconSize?: number;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
function FieldTypeIcon({iconName, color, containerSize, iconSize}: Props): JSX.Element {
|
|
78
|
+
const Icon = getFieldIconComponent(iconName);
|
|
79
|
+
return <Icon color={color} containerSize={containerSize} iconSize={iconSize} />;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default FieldTypeIcon;
|