@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.
Files changed (296) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +8 -5
  3. package/src/action-badge.tsx +5 -4
  4. package/src/actions-menu/actions-menu-confirmation.tsx +1 -12
  5. package/src/actions-menu/actions-menu-item.tsx +19 -7
  6. package/src/actions-menu/actions-menu-props.tsx +4 -0
  7. package/src/actions-menu/actions-menu-sub-command-menu.tsx +7 -4
  8. package/src/actions-menu/actions-menu-sub-menu.tsx +9 -3
  9. package/src/actions-menu/actions-menu.tsx +24 -8
  10. package/src/actions-panel.tsx +12 -2
  11. package/src/antd/ant-modal.tsx +17 -2
  12. package/src/antd/input.tsx +4 -3
  13. package/src/app-icon-with-fallback.tsx +5 -8
  14. package/src/app-icon-wrapper.tsx +4 -4
  15. package/src/appIcons.json +20 -0
  16. package/src/axis-header.tsx +136 -76
  17. package/src/badge.tsx +14 -7
  18. package/src/beta-badge.tsx +12 -8
  19. package/src/box.tsx +1 -1
  20. package/src/breadcrumb.tsx +78 -0
  21. package/src/button/actions-button-compact.tsx +5 -2
  22. package/src/button/base-button.tsx +7 -4
  23. package/src/button/button-group.tsx +1 -1
  24. package/src/button/button.tsx +120 -2
  25. package/src/button/icon-button.tsx +13 -2
  26. package/src/button/select-button.tsx +27 -8
  27. package/src/card-container.tsx +36 -69
  28. package/src/card-hidden-link.tsx +52 -0
  29. package/src/collapsible-section.tsx +13 -3
  30. package/src/color-picker/index.js +65 -60
  31. package/src/color-picker/swatch.tsx +29 -14
  32. package/src/command-menu/index.tsx +5 -5
  33. package/src/context-menu/index.tsx +10 -1
  34. package/src/count-badge.tsx +57 -0
  35. package/src/date-picker/date-range-input.tsx +1 -1
  36. package/src/date-picker/date-range-picker.tsx +6 -3
  37. package/src/date-picker/fake-date-input.tsx +1 -1
  38. package/src/date-picker/relative-date-picker.tsx +7 -3
  39. package/src/date-picker/single-date-input.tsx +1 -1
  40. package/src/date-picker/single-date-picker.tsx +8 -5
  41. package/src/date-picker/styles.ts +32 -26
  42. package/src/date-picker/types.ts +3 -1
  43. package/src/date-picker/utils.ts +9 -2
  44. package/src/day-select/day-select.tsx +21 -75
  45. package/src/day-select/iso-week-day-select.tsx +1 -1
  46. package/src/day-select/mount-day-select.tsx +2 -2
  47. package/src/day-select/week-day-select.tsx +1 -5
  48. package/src/design-system.ts +91 -51
  49. package/src/dropdown-menu/index.tsx +8 -1
  50. package/src/emoji-picker/app-icon-picker.tsx +6 -4
  51. package/src/emoji-picker/emoji-picker-content-with-color.tsx +3 -9
  52. package/src/emoji-picker/emoji-picker-preview-footer.tsx +1 -1
  53. package/src/emoji-picker/emoji-picker.tsx +3 -0
  54. package/src/emoji-picker/emoji.tsx +2 -1
  55. package/src/emoji-picker/icon-emoji-picker.tsx +83 -68
  56. package/src/emoji-picker/primitives/footer.tsx +0 -1
  57. package/src/emoji-picker/primitives/header.tsx +1 -0
  58. package/src/emoji-picker/primitives/search.tsx +12 -13
  59. package/src/emoji-picker/primitives/skin-tone.tsx +1 -0
  60. package/src/emoji-picker/use-responsive-emoji-size.ts +11 -0
  61. package/src/emoji-picker/utils/emoji-set.ts +2 -1
  62. package/src/empty-state/empty-state.tsx +6 -0
  63. package/src/error-alert/error-alert.tsx +19 -7
  64. package/src/field-app-icon.tsx +29 -0
  65. package/src/field-container.tsx +4 -2
  66. package/src/field-icon.tsx +29 -0
  67. package/src/field-type-icon.tsx +82 -0
  68. package/src/file-item.tsx +164 -47
  69. package/src/guide-link.tsx +4 -3
  70. package/src/hint.tsx +10 -1
  71. package/src/html-styles.ts +23 -13
  72. package/src/icons/ast/ActivityFilled.ts +8 -0
  73. package/src/icons/ast/AiAssistantFilled.ts +8 -0
  74. package/src/icons/ast/AiFiberyBuild.ts +8 -0
  75. package/src/icons/ast/Anthropic.ts +1 -1
  76. package/src/icons/ast/Apple.ts +8 -0
  77. package/src/icons/ast/ArrowBottom.ts +1 -1
  78. package/src/icons/ast/ArrowForward.ts +1 -1
  79. package/src/icons/ast/ArrowLeft.ts +1 -1
  80. package/src/icons/ast/ArrowRight.ts +1 -1
  81. package/src/icons/ast/ArrowTop.ts +1 -1
  82. package/src/icons/ast/CollapseAllHorizontal.ts +8 -0
  83. package/src/icons/ast/Crosshair.ts +8 -0
  84. package/src/icons/ast/DateRange.ts +1 -1
  85. package/src/icons/ast/Document.ts +8 -0
  86. package/src/icons/ast/EntityCreate.ts +8 -0
  87. package/src/icons/ast/EntityCreateFilled.ts +8 -0
  88. package/src/icons/ast/ExpandAll.ts +8 -0
  89. package/src/icons/ast/ExpandAllHorizontal.ts +8 -0
  90. package/src/icons/ast/FiberyDesktopApp.ts +8 -0
  91. package/src/icons/ast/FileDownload.ts +8 -0
  92. package/src/icons/ast/GlobeUnpublish.ts +8 -0
  93. package/src/icons/ast/GraduationCapFilled.ts +8 -0
  94. package/src/icons/ast/Home.ts +1 -1
  95. package/src/icons/ast/HomeFilled.ts +8 -0
  96. package/src/icons/ast/ImportFilled.ts +8 -0
  97. package/src/icons/ast/IntegrationsFilled.ts +8 -0
  98. package/src/icons/ast/KeyboardHideDown.ts +8 -0
  99. package/src/icons/ast/LayoutMultiple.ts +8 -0
  100. package/src/icons/ast/LocationEdit.ts +8 -0
  101. package/src/icons/ast/MessagePlus.ts +8 -0
  102. package/src/icons/ast/OpenAi.ts +1 -1
  103. package/src/icons/ast/RicheditorHistoryRedo.ts +1 -1
  104. package/src/icons/ast/RicheditorHistoryUndo.ts +1 -1
  105. package/src/icons/ast/RicheditorMarkHighlight.ts +8 -0
  106. package/src/icons/ast/RicheditorMarkStrike.ts +1 -1
  107. package/src/icons/ast/RicheditorMarkUnderline.ts +1 -1
  108. package/src/icons/ast/SearchFilled.ts +8 -0
  109. package/src/icons/ast/SettingsFilled.ts +8 -0
  110. package/src/icons/ast/SlideMenuFilled.ts +8 -0
  111. package/src/icons/ast/SpaceApp.ts +8 -0
  112. package/src/icons/ast/SpaceGenerate.ts +8 -0
  113. package/src/icons/ast/SpaceScratch.ts +8 -0
  114. package/src/icons/ast/SpaceTemplate.ts +8 -0
  115. package/src/icons/ast/TableLayout.ts +8 -0
  116. package/src/icons/ast/TemplatesFilled.ts +8 -0
  117. package/src/icons/ast/ThumbsDown.ts +8 -0
  118. package/src/icons/ast/ThumbsUp.ts +8 -0
  119. package/src/icons/ast/TypeDate.ts +1 -1
  120. package/src/icons/ast/ViewDashboard.ts +8 -0
  121. package/src/icons/ast/WarningTriangleFilled.ts +8 -0
  122. package/src/icons/ast/Windows.ts +8 -0
  123. package/src/icons/ast/index.tsx +37 -0
  124. package/src/icons/react/ActivityFilled.tsx +13 -0
  125. package/src/icons/react/AiAssistantFilled.tsx +13 -0
  126. package/src/icons/react/AiFiberyBuild.tsx +13 -0
  127. package/src/icons/react/Apple.tsx +13 -0
  128. package/src/icons/react/CollapseAllHorizontal.tsx +13 -0
  129. package/src/icons/react/Crosshair.tsx +13 -0
  130. package/src/icons/react/Document.tsx +13 -0
  131. package/src/icons/react/EntityCreate.tsx +13 -0
  132. package/src/icons/react/EntityCreateFilled.tsx +13 -0
  133. package/src/icons/react/ExpandAll.tsx +13 -0
  134. package/src/icons/react/ExpandAllHorizontal.tsx +13 -0
  135. package/src/icons/react/FiberyDesktopApp.tsx +13 -0
  136. package/src/icons/react/FileDownload.tsx +13 -0
  137. package/src/icons/react/GlobeUnpublish.tsx +13 -0
  138. package/src/icons/react/GraduationCapFilled.tsx +13 -0
  139. package/src/icons/react/HomeFilled.tsx +13 -0
  140. package/src/icons/react/ImportFilled.tsx +13 -0
  141. package/src/icons/react/IntegrationsFilled.tsx +13 -0
  142. package/src/icons/react/KeyboardHideDown.tsx +13 -0
  143. package/src/icons/react/LayoutMultiple.tsx +13 -0
  144. package/src/icons/react/LocationEdit.tsx +13 -0
  145. package/src/icons/react/MessagePlus.tsx +13 -0
  146. package/src/icons/react/RicheditorMarkHighlight.tsx +13 -0
  147. package/src/icons/react/SearchFilled.tsx +13 -0
  148. package/src/icons/react/SettingsFilled.tsx +13 -0
  149. package/src/icons/react/SlideMenuFilled.tsx +13 -0
  150. package/src/icons/react/SpaceApp.tsx +13 -0
  151. package/src/icons/react/SpaceGenerate.tsx +13 -0
  152. package/src/icons/react/SpaceScratch.tsx +13 -0
  153. package/src/icons/react/SpaceTemplate.tsx +13 -0
  154. package/src/icons/react/TableLayout.tsx +13 -0
  155. package/src/icons/react/TemplatesFilled.tsx +13 -0
  156. package/src/icons/react/ThumbsDown.tsx +13 -0
  157. package/src/icons/react/ThumbsUp.tsx +13 -0
  158. package/src/icons/react/ViewDashboard.tsx +13 -0
  159. package/src/icons/react/WarningTriangleFilled.tsx +13 -0
  160. package/src/icons/react/Windows.tsx +13 -0
  161. package/src/icons/react/index.tsx +37 -0
  162. package/src/icons/svg/activity-filled.svg +4 -0
  163. package/src/icons/svg/ai-assistant-filled.svg +3 -0
  164. package/src/icons/svg/ai-fibery-build.svg +24 -0
  165. package/src/icons/svg/anthropic.svg +2 -14
  166. package/src/icons/svg/apple.svg +4 -0
  167. package/src/icons/svg/arrow-bottom.svg +1 -1
  168. package/src/icons/svg/arrow-forward.svg +1 -1
  169. package/src/icons/svg/arrow-left.svg +1 -1
  170. package/src/icons/svg/arrow-right.svg +1 -1
  171. package/src/icons/svg/arrow-top.svg +1 -1
  172. package/src/icons/svg/collapse-all-horizontal.svg +3 -0
  173. package/src/icons/svg/crosshair.svg +4 -0
  174. package/src/icons/svg/date-range.svg +3 -3
  175. package/src/icons/svg/document.svg +4 -0
  176. package/src/icons/svg/entity-create-filled.svg +4 -0
  177. package/src/icons/svg/entity-create.svg +3 -0
  178. package/src/icons/svg/expand-all-horizontal.svg +3 -0
  179. package/src/icons/svg/expand-all.svg +3 -0
  180. package/src/icons/svg/fibery-desktop-app.svg +101 -0
  181. package/src/icons/svg/file-download.svg +4 -0
  182. package/src/icons/svg/globe-unpublish.svg +4 -0
  183. package/src/icons/svg/go-to.svg +1 -3
  184. package/src/icons/svg/graduation-cap-filled.svg +4 -0
  185. package/src/icons/svg/home-filled.svg +3 -0
  186. package/src/icons/svg/home.svg +4 -2
  187. package/src/icons/svg/import-filled.svg +4 -0
  188. package/src/icons/svg/integrations-filled.svg +4 -0
  189. package/src/icons/svg/keyboard-hide-down.svg +1 -0
  190. package/src/icons/svg/layout-multiple.svg +3 -0
  191. package/src/icons/svg/location-edit.svg +13 -0
  192. package/src/icons/svg/message-plus.svg +4 -0
  193. package/src/icons/svg/open-ai.svg +2 -7
  194. package/src/icons/svg/open-as-page.svg +2 -3
  195. package/src/icons/svg/richeditor/history/redo.svg +3 -2
  196. package/src/icons/svg/richeditor/history/undo.svg +3 -2
  197. package/src/icons/svg/richeditor/mark/code.svg +4 -5
  198. package/src/icons/svg/richeditor/mark/em.svg +3 -2
  199. package/src/icons/svg/richeditor/mark/highlight.svg +3 -0
  200. package/src/icons/svg/richeditor/mark/strike.svg +3 -2
  201. package/src/icons/svg/richeditor/mark/strong.svg +3 -2
  202. package/src/icons/svg/richeditor/mark/underline.svg +4 -2
  203. package/src/icons/svg/search-filled.svg +3 -0
  204. package/src/icons/svg/settings-filled.svg +3 -0
  205. package/src/icons/svg/slide-menu-filled.svg +1 -0
  206. package/src/icons/svg/space-app.svg +3 -0
  207. package/src/icons/svg/space-generate.svg +3 -0
  208. package/src/icons/svg/space-scratch.svg +3 -0
  209. package/src/icons/svg/space-template.svg +3 -0
  210. package/src/icons/svg/table-layout.svg +3 -0
  211. package/src/icons/svg/templates-filled.svg +6 -0
  212. package/src/icons/svg/thumbs-down.svg +3 -0
  213. package/src/icons/svg/thumbs-up.svg +3 -0
  214. package/src/icons/svg/type/date.svg +3 -2
  215. package/src/icons/svg/view-dashboard.svg +5 -0
  216. package/src/icons/svg/warning-triangle-filled.svg +3 -0
  217. package/src/icons/svg/windows.svg +15 -0
  218. package/src/images-gallery/images-gallery.tsx +254 -0
  219. package/src/images-gallery/zoom.tsx +112 -0
  220. package/src/integration-compact-info-button.tsx +3 -1
  221. package/src/is-in-popup.ts +1 -1
  222. package/src/layout-styles.ts +43 -0
  223. package/src/lists/actions-menu-row-surface.tsx +3 -1
  224. package/src/lists/list-row-surface.tsx +9 -2
  225. package/src/loaders.tsx +6 -6
  226. package/src/logo.tsx +16 -9
  227. package/src/mobile-keyboard-aware-popup.tsx +87 -0
  228. package/src/mobile-styles.ts +10 -0
  229. package/src/modal-menu/contexts/modal-menu-context.tsx +22 -0
  230. package/src/modal-menu/contexts/modal-submenu-context.tsx +16 -0
  231. package/src/modal-menu/index.tsx +14 -0
  232. package/src/modal-menu/modal-menu-content.tsx +68 -0
  233. package/src/modal-menu/modal-menu-group.tsx +10 -0
  234. package/src/modal-menu/modal-menu-item.tsx +37 -0
  235. package/src/modal-menu/modal-menu-label.tsx +24 -0
  236. package/src/modal-menu/modal-menu-root.tsx +57 -0
  237. package/src/modal-menu/modal-menu-separator.tsx +14 -0
  238. package/src/modal-menu/modal-menu-trigger.tsx +37 -0
  239. package/src/modal-menu/modal-submenu-content.tsx +49 -0
  240. package/src/modal-menu/modal-submenu-trigger.tsx +34 -0
  241. package/src/modal-menu/modal-submenu.tsx +17 -0
  242. package/src/new-badge.tsx +4 -7
  243. package/src/number-input/text-area-auto-sized.tsx +47 -0
  244. package/src/number-input/text-input-auto-sized.tsx +49 -0
  245. package/src/online-users.tsx +3 -3
  246. package/src/palette.ts +50 -50
  247. package/src/popover/index.tsx +687 -0
  248. package/src/popover/mobile-popup-context.tsx +29 -0
  249. package/src/{popup → popover}/modifiers.tsx +0 -7
  250. package/src/{popup → popover}/popup-modifiers-context.ts +3 -3
  251. package/src/reactions/reaction-button.tsx +30 -45
  252. package/src/reactions/reaction-picker.tsx +39 -45
  253. package/src/rich-text-embed-error.tsx +2 -2
  254. package/src/select/{custom-select-partials → components}/menu.tsx +13 -7
  255. package/src/select/{custom-select-partials → components}/no-option-message.tsx +0 -1
  256. package/src/select/constants.ts +1 -0
  257. package/src/select/index.tsx +143 -148
  258. package/src/select/select-in-popover.tsx +119 -138
  259. package/src/select/styles.ts +60 -24
  260. package/src/shortcut-badge.tsx +1 -0
  261. package/src/tab-nav/tab-nav.tsx +47 -28
  262. package/src/theme-provider.tsx +9 -1
  263. package/src/toast/primitives.tsx +8 -1
  264. package/src/toggle-button/round-toggle-button.tsx +23 -0
  265. package/src/toggle-button/toggle-button-group.tsx +34 -0
  266. package/src/toggle-button/toggle-button.tsx +164 -0
  267. package/src/toggle.tsx +3 -3
  268. package/src/tooltip-if-overflown.tsx +9 -3
  269. package/src/tooltip.tsx +2 -2
  270. package/src/unit/index.tsx +9 -1
  271. package/src/unit/loading-unit-value.tsx +1 -0
  272. package/src/unit/maybe-unit-value.tsx +3 -3
  273. package/src/unit/primitive.tsx +58 -42
  274. package/src/unit/styles.ts +10 -14
  275. package/src/unit/types.ts +4 -2
  276. package/src/unit/unit-button-group.tsx +6 -11
  277. package/src/unit/unit-content.tsx +13 -5
  278. package/src/unit/unit-with-title.tsx +6 -1
  279. package/src/unit/unit-with-tooltip.tsx +24 -9
  280. package/src/use-is-phone.tsx +37 -0
  281. package/src/use-is-support-hover.ts +1 -1
  282. package/src/use-on-screen-keyboard-data.tsx +66 -0
  283. package/src/workflow-progress-icon.tsx +17 -23
  284. package/src/number-input/text-area-with-autosize.tsx +0 -91
  285. package/src/number-input/text-inline-input-with-autosize.tsx +0 -60
  286. package/src/popup/index.tsx +0 -382
  287. package/src/use-is-phone.ts +0 -5
  288. /package/src/{popup → popover}/popup-stack-context.tsx +0 -0
  289. /package/src/{popup → popover}/reference.ts +0 -0
  290. /package/src/{popup → popover}/styles.ts +0 -0
  291. /package/src/{popup → popover}/use-click-outside.ts +0 -0
  292. /package/src/select/{custom-select-partials → components}/clear-indicator.tsx +0 -0
  293. /package/src/select/{custom-select-partials → components}/drop-down-indicator.tsx +0 -0
  294. /package/src/select/{custom-select-partials → components}/group-heading.tsx +0 -0
  295. /package/src/select/{custom-select-partials → components}/menu-list-virtualized.tsx +0 -0
  296. /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 {space, textStyles} from "../design-system";
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 TabHeader: React.FC<React.PropsWithChildren> = ({children}) => (
12
- <div
13
- className={css`
14
- ${textStyles.heading5}
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
- <AntTabs
54
- wrapClassName={css`
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
- animated={false}
64
- destroyInactiveTabPane
65
- defaultActiveKey={defaultTab}
66
- items={compact([
67
- onEmojiSelect && {
68
- key: "emojis",
69
- label: <TabHeader>Emojis</TabHeader>,
70
- children: (
71
- <>
72
- <EmojiPicker
73
- emojiSize={emojiSize}
74
- color={color}
75
- onColorSelect={showColorPickerOnTabs.includes("emojis") ? onColorSelect : undefined}
76
- onCustomCategorySettings={onCustomEmojisSettings}
77
- onAddCustomEmoji={onCreateClick}
78
- getHoverColor={getHoverColor}
79
- onSelect={onEmojiSelect}
80
- showSkinTones
81
- />
82
- </>
83
- ),
84
- },
85
- onIconSelect && {
86
- key: "icons",
87
- label: <TabHeader>Icons</TabHeader>,
88
- children: (
89
- <AppIconPicker
90
- color={color}
91
- onColorSelect={showColorPickerOnTabs.includes("icons") ? onColorSelect : undefined}
92
- getHoverColor={getHoverColor}
93
- onSelect={onIconSelect}
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
  };
@@ -5,7 +5,6 @@ const footerCss = css`
5
5
  position: relative;
6
6
  border-top: 1px solid var(--fibery-color-separatorColor);
7
7
  padding: ${space.s6}px ${space.s12}px;
8
- height: 40px;
9
8
 
10
9
  display: flex;
11
10
  align-items: center;
@@ -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-left: ${space.s8}px;
28
- gap: ${space.s2}px;
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
- {foundEmojis ? (
161
- <IconButton size="small" onClick={clearSearch}>
162
- <Close />
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
  );
@@ -82,6 +82,7 @@ export const EmojiPickerSkinTone: React.FC<EmojiPickerSkinToneProps> = ({classNa
82
82
  }
83
83
  setOpened(!opened);
84
84
  }}
85
+ supportMobile
85
86
  className={css`
86
87
  &:hover:not(:disabled),
87
88
  &:focus-visible {
@@ -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 WarningIcon from "../icons/react/WarningTriangle";
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.s8}px ${space.s8}px ${space.s8}px ${space.s12}px;
11
+ padding: ${space.s12}px;
12
12
  min-height: ${layout.itemHeight}px;
13
- border-radius: ${border.radius6}px;
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
- ${textStyles.regular};
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
- ${textStyles.small};
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
- <WarningIcon color={theme.errorButtonColor} iconSize={16} containerSize={16} />
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
+ }
@@ -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.s2,
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;