@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {space, textStyles, themeVars} from "../design-system";
|
|
3
3
|
import {SingleRowSelect as SingleRowReactSelect, SingleValue} from "../select";
|
|
4
|
-
import {AlwaysVisibleDropdownIndicator} from "../select/
|
|
4
|
+
import {AlwaysVisibleDropdownIndicator} from "../select/components/drop-down-indicator";
|
|
5
5
|
import {RelativeDateValue} from "./types";
|
|
6
6
|
import {useCallback, useMemo, useState} from "react";
|
|
7
7
|
import {$TSFixMe} from "../tsfixme";
|
|
@@ -143,7 +143,7 @@ export const SingleDateInput = forwardRef<
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
const [result] = getLocaleSpecificChrono().parse(inputValue);
|
|
146
|
+
const [result] = getLocaleSpecificChrono(dateFormat).parse(inputValue);
|
|
147
147
|
if (result && result.start) {
|
|
148
148
|
const newValue = result.start.date();
|
|
149
149
|
onChange(newValue);
|
package/src/date-picker/utils.ts
CHANGED
|
@@ -7,9 +7,16 @@ import {
|
|
|
7
7
|
dateTimeFormat as defaultDateTimeFormat,
|
|
8
8
|
} from "../design-system";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const isMonthBeforeDay = (format: string) => {
|
|
11
|
+
// Hacky way to get rid of ddd specifier, which does not matter for us here
|
|
12
|
+
const sanitizedFormat = format.replace("ddd", "").toLowerCase();
|
|
13
|
+
return sanitizedFormat.indexOf("m") < sanitizedFormat.indexOf("d");
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getLocaleSpecificChrono = (dateFormat: string | undefined) => {
|
|
17
|
+
const weirdFormat = dateFormat && isMonthBeforeDay(dateFormat);
|
|
11
18
|
// We use a single exception here - to support US date order, like m/d/y
|
|
12
|
-
if (
|
|
19
|
+
if (weirdFormat) {
|
|
13
20
|
return chrono.en;
|
|
14
21
|
}
|
|
15
22
|
// Otherwise, use european-style d/m/y
|
package/src/design-system.ts
CHANGED
|
@@ -27,6 +27,7 @@ export const typeSizes = [30, 24, 18, 16, 14, 12, 10, 8] as const;
|
|
|
27
27
|
export const fontWeight = {
|
|
28
28
|
light: 310, // 300 basic, 310 experiment with a variable Inter
|
|
29
29
|
regular: 410, // 400 basic, 410 experiment with a variable Inter
|
|
30
|
+
mediumLight: 450,
|
|
30
31
|
medium: 500,
|
|
31
32
|
semibold: 600,
|
|
32
33
|
bold: 700,
|
|
@@ -34,6 +35,8 @@ export const fontWeight = {
|
|
|
34
35
|
|
|
35
36
|
const transparent = "rgba(255, 255, 255, 0)";
|
|
36
37
|
|
|
38
|
+
export const minPanelWidth = 490;
|
|
39
|
+
|
|
37
40
|
export const opacity = {
|
|
38
41
|
opacity100: 1,
|
|
39
42
|
opacity95: 0.95,
|
|
@@ -127,7 +130,7 @@ const stateColors = {
|
|
|
127
130
|
const brandColors = {
|
|
128
131
|
red: "#FF5400",
|
|
129
132
|
green: "#08BD9F",
|
|
130
|
-
blue: "#
|
|
133
|
+
blue: "#4978D4",
|
|
131
134
|
} as const;
|
|
132
135
|
|
|
133
136
|
export const getDarkenColor = _.memoize((color: string): string => {
|
|
@@ -139,58 +142,55 @@ export const themeColors = {
|
|
|
139
142
|
brandColors: [brandColors, brandColors],
|
|
140
143
|
stateColors: [stateColors, stateColors],
|
|
141
144
|
colorAI: ["hsla(271, 57%, 61%, 1)", "hsla(272, 43%, 50%, 1)"],
|
|
142
|
-
colorBgAI: ["hsla(271, 57%, 61%, 0.
|
|
145
|
+
colorBgAI: ["hsla(271, 57%, 61%, 0.09)", "hsla(272, 43%, 50%, 0.2)"],
|
|
143
146
|
colorSubtleBgAI: ["hsla(271, 57%, 61%, 0.05)", "hsla(272, 43%, 50%, 0.1)"],
|
|
144
147
|
|
|
148
|
+
// Elevations
|
|
149
|
+
surfaceElevationS: [`0 2px 4px 0 ${blackA.blackA3}`, `0 2px 4px 0 ${whiteA.whiteA3}`],
|
|
150
|
+
surfaceElevationM: [`0 4px 8px 0 ${blackA.blackA5}`, `0 4px 8px 0 ${whiteA.whiteA5}`],
|
|
151
|
+
surfaceElevationL: [`0 8px 12px 0 ${blackA.blackA5}`, `0 8px 12px 0 ${whiteA.whiteA5}`],
|
|
152
|
+
|
|
145
153
|
// Shadows and effects / Elevation
|
|
146
154
|
shadow50: [
|
|
147
|
-
`
|
|
148
|
-
0px 0px 0px 0.5px ${getOpacities(slate.slate12).opacity5}
|
|
149
|
-
`,
|
|
155
|
+
`0px 0px 0px 0.5px ${getOpacities(slate.slate12).opacity5}`,
|
|
150
156
|
`0px 0px 0px 0.5px ${getOpacities(slateDark.slate12).opacity15}`,
|
|
151
157
|
],
|
|
152
158
|
shadow100: [
|
|
153
|
-
`
|
|
154
|
-
0px 1px 4px 0px ${getOpacities(slate.slate12).opacity5}
|
|
155
|
-
`,
|
|
159
|
+
`0px 1px 4px 0px ${getOpacities(slate.slate12).opacity5}`,
|
|
156
160
|
`0px 1px 4px 0px ${getOpacities(slate.slate12).opacity10}`,
|
|
157
161
|
],
|
|
158
162
|
shadow200: [
|
|
159
|
-
`
|
|
160
|
-
0px 2px 6px 0px ${getOpacities(slate.slate12).opacity5}
|
|
161
|
-
`,
|
|
163
|
+
`0px 2px 6px 0px ${getOpacities(slate.slate12).opacity5}`,
|
|
162
164
|
`0px 2px 6px 0px ${getOpacities(slate.slate12).opacity10}`,
|
|
163
165
|
],
|
|
164
166
|
shadow300: [
|
|
165
|
-
`
|
|
166
|
-
0px 3px 6px -3px ${getOpacities(slate.slate12).opacity10}, 0px 8px 20px -4px ${
|
|
167
|
+
`0px 3px 6px -3px ${getOpacities(slate.slate12).opacity10}, 0px 8px 20px -4px ${
|
|
167
168
|
getOpacities(slate.slate12).opacity15
|
|
168
|
-
}
|
|
169
|
-
`,
|
|
169
|
+
}`,
|
|
170
170
|
`0px 3px 6px -3px ${getOpacities(slate.slate12).opacity10}, 0px 8px 20px -4px ${
|
|
171
171
|
getOpacities(slate.slate12).opacity15
|
|
172
172
|
}`,
|
|
173
173
|
],
|
|
174
174
|
shadow400: [
|
|
175
|
-
`
|
|
176
|
-
|
|
177
|
-
`,
|
|
175
|
+
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 16px 40px 0px ${
|
|
176
|
+
getOpacities(slate.slate12).opacity15
|
|
177
|
+
}`,
|
|
178
178
|
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 16px 40px 0px ${
|
|
179
179
|
getOpacities(slate.slate12).opacity15
|
|
180
180
|
}`,
|
|
181
181
|
],
|
|
182
182
|
shadow500: [
|
|
183
|
-
`
|
|
184
|
-
|
|
185
|
-
`,
|
|
183
|
+
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 20px 50px 0px ${
|
|
184
|
+
getOpacities(slate.slate12).opacity15
|
|
185
|
+
}`,
|
|
186
186
|
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 20px 50px 0px ${
|
|
187
187
|
getOpacities(slate.slate12).opacity15
|
|
188
188
|
}`,
|
|
189
189
|
],
|
|
190
190
|
shadow600: [
|
|
191
|
-
`
|
|
192
|
-
|
|
193
|
-
`,
|
|
191
|
+
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 26px 80px 0px ${
|
|
192
|
+
getOpacities(slate.slate12).opacity20
|
|
193
|
+
}`,
|
|
194
194
|
`0px 0px 1px 0px ${getOpacities(slate.slate12).opacity20}, 0px 26px 80px 0px ${
|
|
195
195
|
getOpacities(slate.slate12).opacity20
|
|
196
196
|
}`,
|
|
@@ -211,10 +211,6 @@ export const themeColors = {
|
|
|
211
211
|
getOpacities(slateDark.slate1).opacity5
|
|
212
212
|
}, 0px 10px 26px 0px ${getOpacities(slateDark.slate1).opacity15}`,
|
|
213
213
|
],
|
|
214
|
-
shadowModal: [
|
|
215
|
-
`${getOpacities(slate.slate10).opacity20} 0px 16px 70px`,
|
|
216
|
-
`${getOpacities(slateDark.slate1).opacity40} 0px 16px 70px`,
|
|
217
|
-
],
|
|
218
214
|
shadowSidebar: [
|
|
219
215
|
`-3px 0px 10px 0px ${getOpacities(slate.slate10).opacity10}`,
|
|
220
216
|
`-3px 0px 10px 0px ${getOpacities(slateDark.slate1).opacity80}`,
|
|
@@ -246,7 +242,7 @@ export const themeColors = {
|
|
|
246
242
|
menuSelectedTextColor: [slate.slate2, slate.slate2],
|
|
247
243
|
menuFooterColor: [getOpacities(whiteA.whiteA0).opacity20, getOpacities(slateDark.slate3).opacity40],
|
|
248
244
|
menuFooterHoverColor: [getOpacities(whiteA.whiteA0).opacity60, slateDark.slate4],
|
|
249
|
-
menuIconColor: [getOpacities(slate.
|
|
245
|
+
menuIconColor: [getOpacities(slate.slate12).opacity70, getOpacities(slateDark.slate12).opacity70],
|
|
250
246
|
menuSelectedIconColor: [getOpacities(slate.slate1).opacity90, getOpacities(slate.slate1).opacity90],
|
|
251
247
|
textColor: [slateDark.slate5, slate.slate6],
|
|
252
248
|
textSelectionColor: [getOpacities(blue.blue10).opacity20, getOpacities(blueDark.blue10).opacity40],
|
|
@@ -254,15 +250,15 @@ export const themeColors = {
|
|
|
254
250
|
disabledTextColor: [slate.slate9, slateDark.slate9],
|
|
255
251
|
inversedTextColor: [slate.slate3, slateDark.slate6],
|
|
256
252
|
colorTextSecondary: [getOpacities(slate.slate12).opacity70, getOpacities(slateDark.slate12).opacity65],
|
|
257
|
-
linkColor: [indigoDark.indigo10, indigoDark.
|
|
253
|
+
linkColor: [indigoDark.indigo10, indigoDark.indigo10],
|
|
258
254
|
linkBorder: [
|
|
259
|
-
`
|
|
260
|
-
`
|
|
255
|
+
`0.5px solid ${getOpacities(indigoDark.indigo10).opacity40}`,
|
|
256
|
+
`0.5px solid ${getOpacities(indigoDark.indigo11).opacity40}`,
|
|
261
257
|
],
|
|
262
|
-
linkHoverColor: [indigo.indigo10, indigoDark.
|
|
258
|
+
linkHoverColor: [indigo.indigo10, indigoDark.indigo11],
|
|
263
259
|
linkBorderHover: [
|
|
264
|
-
`
|
|
265
|
-
`
|
|
260
|
+
`0.5px solid ${getOpacities(indigo.indigo10).opacity80}`,
|
|
261
|
+
`0.5px solid ${getOpacities(indigoDark.indigo10).opacity70}`,
|
|
266
262
|
],
|
|
267
263
|
codeColor: [red.red9, red.red8],
|
|
268
264
|
codeBgColor: [slate.slate3, slateDark.slate4],
|
|
@@ -271,13 +267,13 @@ export const themeColors = {
|
|
|
271
267
|
// Entity
|
|
272
268
|
entityNodeColor: [slateDark.slate3, slate.slate8],
|
|
273
269
|
entityNodeBorder: [
|
|
274
|
-
`
|
|
275
|
-
`
|
|
270
|
+
`0.5px solid ${getOpacities(slateDark.slate3).opacity30}`,
|
|
271
|
+
`0.5px solid ${getOpacities(slate.slate8).opacity40}`,
|
|
276
272
|
],
|
|
277
273
|
entityNodeHoverColor: [slateDark.slate7, slate.slate7],
|
|
278
274
|
entityNodeBorderHover: [
|
|
279
|
-
`
|
|
280
|
-
`
|
|
275
|
+
`0.5px solid ${getOpacities(slate.slate11).opacity80}`,
|
|
276
|
+
`0.5px solid ${getOpacities(slate.slate7).opacity80}`,
|
|
281
277
|
],
|
|
282
278
|
entityNodeBgColor: [slate.slate2, slateDark.slate3],
|
|
283
279
|
shortcutTextColor: [slate.slate9, slateDark.slate11],
|
|
@@ -324,7 +320,7 @@ export const themeColors = {
|
|
|
324
320
|
buttonPrimaryColor: [indigo.indigo9, indigoDark.indigo9],
|
|
325
321
|
buttonColor: [slate.slate10, slateDark.slate10],
|
|
326
322
|
buttonPrimaryTextColor: [slate.slate2, slate.slate6],
|
|
327
|
-
checkboxColor: [slate.
|
|
323
|
+
checkboxColor: [getOpacities(slate.slate12).opacity70, getOpacities(slateDark.slate12).opacity70],
|
|
328
324
|
colorBorderBlockQuote: [slate.slate11, slateDark.slate11],
|
|
329
325
|
|
|
330
326
|
// Actions menu
|
|
@@ -354,8 +350,9 @@ export const themeColors = {
|
|
|
354
350
|
],
|
|
355
351
|
actionMenuSeparatorColor: [getOpacities(blackA.blackA0).opacity10, getOpacities(whiteA.whiteA0).opacity15],
|
|
356
352
|
separatorColor: [getOpacities(blackA.blackA0).opacity10, getOpacities(whiteA.whiteA0).opacity10],
|
|
353
|
+
separatorColorDimmed: [getOpacities(blackA.blackA0).opacity5, getOpacities(whiteA.whiteA0).opacity5],
|
|
357
354
|
separatorBreadcrumbsColor: [slate.slate8, slateDark.slate8],
|
|
358
|
-
iconColor: [slate.
|
|
355
|
+
iconColor: [getOpacities(slate.slate12).opacity70, getOpacities(slateDark.slate12).opacity70],
|
|
359
356
|
appIconColor: [getOpacities(slate.slate2).opacity90, getOpacities(slate.slate2).opacity70],
|
|
360
357
|
appIconBgColor: [getOpacities(slate.slate1).opacity90, getOpacities(slate.slate2).opacity50],
|
|
361
358
|
mentionBgColor: [getOpacities(slate.slate7).opacity30, getOpacities(slateDark.slate7).opacity40],
|
|
@@ -456,10 +453,10 @@ export const themeColors = {
|
|
|
456
453
|
`0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${getOpacities(slate.slate10).opacity20}`,
|
|
457
454
|
`0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${getOpacities(slateDark.slate2).opacity20}`,
|
|
458
455
|
],
|
|
459
|
-
|
|
456
|
+
colorBgSegmentedControl: [getOpacities(slate.slate5).opacity80, getOpacities(slateDark.slate3).opacity80],
|
|
460
457
|
colorBgMenuHeaderAvatar: [whiteA.whiteA0, slateDark.slate2],
|
|
461
458
|
shadowMenuHeaderAvatar: [
|
|
462
|
-
`0px 1px 4px ${getOpacities(slate.slate11).opacity10}, 0 0 0
|
|
459
|
+
`0px 1px 4px ${getOpacities(slate.slate11).opacity10}, 0 0 0 0.5px ${getOpacities(slate.slate5).opacity50}`,
|
|
463
460
|
`0 0 0 1px ${getOpacities(slateDark.slate9).opacity20}`,
|
|
464
461
|
],
|
|
465
462
|
// Main Menu Items Styles and States
|
|
@@ -474,9 +471,9 @@ export const themeColors = {
|
|
|
474
471
|
// :focus
|
|
475
472
|
colorBgMenuItemFocus: [slate.slate6, slateDark.slate5],
|
|
476
473
|
// Selected
|
|
477
|
-
colorBgMenuItemSelected: [indigo.indigo5, indigoDark.indigo3],
|
|
474
|
+
colorBgMenuItemSelected: [getOpacities(indigo.indigo5).opacity80, indigoDark.indigo3],
|
|
478
475
|
// :hover
|
|
479
|
-
colorBgMenuItemSelectedHover: [indigo.indigo6, indigoDark.indigo5],
|
|
476
|
+
colorBgMenuItemSelectedHover: [getOpacities(indigo.indigo6).opacity70, indigoDark.indigo5],
|
|
480
477
|
// :focus, :focus:hover
|
|
481
478
|
colorBgPinnedFieldsLabel: [slate.slate11, slateDark.slate11],
|
|
482
479
|
colorBgObjectEditorSeparator: [slate.slate12, slateDark.slate12],
|
|
@@ -498,9 +495,11 @@ export const themeColors = {
|
|
|
498
495
|
unitBgHover: [slate.slate4, slateDark.slate7],
|
|
499
496
|
|
|
500
497
|
// Badges
|
|
498
|
+
colorBgBadgeNeutral: [getOpacities(indigo.indigo5).opacity70, getOpacities(indigoDark.indigo4).opacity80],
|
|
501
499
|
colorBgBadgeSuccess: [teal.teal5, tealDark.teal5],
|
|
502
500
|
colorBgBadgeWarning: [yellow.yellow5, yellowDark.yellow5],
|
|
503
501
|
colorBgBadgeError: [red.red5, redDark.red5],
|
|
502
|
+
colorTextBadgeNeutral: [indigo.indigo11, indigoDark.indigo11],
|
|
504
503
|
colorTextBadgeSuccess: [teal.teal11, tealDark.teal11],
|
|
505
504
|
colorTextBadgeWarning: [yellow.yellow11, yellowDark.yellow11],
|
|
506
505
|
colorTextBadgeError: [red.red11, redDark.red11],
|
|
@@ -528,8 +527,8 @@ export const themeColors = {
|
|
|
528
527
|
appCardHoverColor: [getOpacities(slate.slate1).opacity95, slateDark.slate2],
|
|
529
528
|
modalBg: [getOpacities(slate.slate11).opacity20, getOpacities(slateDark.slate2).opacity50],
|
|
530
529
|
modalContentBg: [whiteA.whiteA0, slateDark.slate3],
|
|
531
|
-
progressIconBg: [
|
|
532
|
-
progressIconFill: [
|
|
530
|
+
progressIconBg: [blackA.blackA7, whiteA.whiteA7],
|
|
531
|
+
progressIconFill: [blackA.blackA11, whiteA.whiteA11],
|
|
533
532
|
selectedColorBorder: [getOpacities(slate.slate6).opacity25, getOpacities(slate.slate6).opacity25],
|
|
534
533
|
formBg: [slate.slate2, slateDark.slate2],
|
|
535
534
|
formHeaderShadow: [
|
|
@@ -569,6 +568,9 @@ export const themeColors = {
|
|
|
569
568
|
colorBorderRichTextMedia: [blackA.blackA7, blackA.blackA7],
|
|
570
569
|
richTextTableBorder: [blackA.blackA5, whiteA.whiteA7],
|
|
571
570
|
|
|
571
|
+
// Drag and drop
|
|
572
|
+
colorBgDropLine: [indigo.indigo7, indigoDark.indigo7],
|
|
573
|
+
|
|
572
574
|
// Grid
|
|
573
575
|
gridHeaderBgColor: [slate.slate2, slateDark.slate3],
|
|
574
576
|
gridHeaderHoverBgColor: [slate.slate3, slateDark.slate4],
|
|
@@ -590,7 +592,8 @@ export const themeColors = {
|
|
|
590
592
|
timelineDependencyOverlapHoverBgColor: [red.red11, redDark.red11],
|
|
591
593
|
timelineCellBgColor: [slate.slate1, slateDark.slate1],
|
|
592
594
|
timelineCellWeekendBgColor: [slate.slate2, slateDark.slate2],
|
|
593
|
-
timelineCellTodayBgColor: [indigo.
|
|
595
|
+
timelineCellTodayBgColor: [indigo.indigo4, indigoDark.indigo2],
|
|
596
|
+
timelineCreateEntityPlaceholderBgColor: [getOpacities(slate.slate11).opacity20, slateDark.slate7],
|
|
594
597
|
|
|
595
598
|
// #region buttons
|
|
596
599
|
// solid
|
|
@@ -695,7 +698,7 @@ export const themeColors = {
|
|
|
695
698
|
colorBgTabHover: [getOpacities(slate.slate11).opacity10, getOpacities(slateDark.slate11).opacity10],
|
|
696
699
|
|
|
697
700
|
// Chat
|
|
698
|
-
colorBgMessageContainer: [
|
|
701
|
+
colorBgMessageContainer: [blackA.blackA3, slateDark.slate6],
|
|
699
702
|
colorBgMessageContainerHover: [slate.slate2, slateDark.slate3],
|
|
700
703
|
colorBgEntityAvatarDefault: [indigo.indigo1, indigoDark.indigo1],
|
|
701
704
|
colorBgEntityAvatarHover: [indigo.indigo3, indigoDark.indigo3],
|
|
@@ -908,6 +911,10 @@ export const getEnumBackgroundColor = _.memoize(
|
|
|
908
911
|
(themeMode, color) => `${themeMode}-${color}`
|
|
909
912
|
);
|
|
910
913
|
|
|
914
|
+
export const getEnumTextColor = (color: string) => {
|
|
915
|
+
return `color-mix(in srgb, ${color} 25%, ${themeVars.textColor} 75%)`;
|
|
916
|
+
};
|
|
917
|
+
|
|
911
918
|
// TODO: fix color for light2. It should same as 'dark' only on dark menu but same as 'light' on other parts of application
|
|
912
919
|
export const getAppIconBackgroundColor = (mode: ThemeMode, color: string) =>
|
|
913
920
|
getThemeValue(mode, {
|
|
@@ -970,8 +977,10 @@ export const space = {
|
|
|
970
977
|
export const spaceNestedTreeLevel = 12;
|
|
971
978
|
export const spaceNestedTreeInterval = 0;
|
|
972
979
|
export const layout = {
|
|
973
|
-
logoSize:
|
|
980
|
+
logoSize: 18,
|
|
974
981
|
menuDefaultWidth: 243,
|
|
982
|
+
fiberyAiSidebarDefaultWidth: 420,
|
|
983
|
+
fiberyAiSidebarMaxWidth: 920,
|
|
975
984
|
desktopToolbarHeight: 32,
|
|
976
985
|
desktopMenuMinWidth: 240,
|
|
977
986
|
collapsedMenuMinWidth: 47,
|
|
@@ -987,7 +996,9 @@ export const layout = {
|
|
|
987
996
|
enumItemHeight: 32,
|
|
988
997
|
menuItemHeight: 32,
|
|
989
998
|
newMenuItemHeight: 28, // I'm ok
|
|
999
|
+
mobileSidebarMenuItemHeight: 44,
|
|
990
1000
|
newMenuIconSize: 18,
|
|
1001
|
+
mobileSidebarIconSize: 20,
|
|
991
1002
|
viewHeaderHeight: space.s12 * 7,
|
|
992
1003
|
viewHeaderCompactHeight: 52,
|
|
993
1004
|
columnMinWidth: 240,
|
|
@@ -1015,6 +1026,16 @@ export const layout = {
|
|
|
1015
1026
|
unitHeight: 18,
|
|
1016
1027
|
} as const;
|
|
1017
1028
|
|
|
1029
|
+
export const sidebarMenuItemHeightVar = `--${varPrefix}-layout-sidebarMenuItemHeight`;
|
|
1030
|
+
export const sidebarMenuIconSizeVar = `--${varPrefix}-layout-sidebarMenuIconSize`;
|
|
1031
|
+
export const listRowSurfaceFontSizeVar = `--${varPrefix}-layout-listRowSurfaceFontSize`;
|
|
1032
|
+
|
|
1033
|
+
export const layoutVars = {
|
|
1034
|
+
sidebarMenuItemHeight: `var(${sidebarMenuItemHeightVar})`,
|
|
1035
|
+
sidebarMenuIconSize: `var(${sidebarMenuIconSizeVar})`,
|
|
1036
|
+
listRowSurfaceFontSize: `var(${listRowSurfaceFontSizeVar})`,
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1018
1039
|
export const border = {
|
|
1019
1040
|
radius0: 0,
|
|
1020
1041
|
radius1: 1,
|
|
@@ -1193,6 +1214,13 @@ export const textStyles = {
|
|
|
1193
1214
|
fontWeight: fontWeight.regular,
|
|
1194
1215
|
color: themeVars.textColor,
|
|
1195
1216
|
},
|
|
1217
|
+
heading8: {
|
|
1218
|
+
fontFamily,
|
|
1219
|
+
fontSize: typeSizes[6],
|
|
1220
|
+
lineHeight: lineHeight.heading,
|
|
1221
|
+
fontWeight: fontWeight.medium,
|
|
1222
|
+
color: themeVars.textColor,
|
|
1223
|
+
},
|
|
1196
1224
|
big: {
|
|
1197
1225
|
fontFamily,
|
|
1198
1226
|
fontSize: typeSizes[3],
|
|
@@ -1264,4 +1292,11 @@ export const textStyles = {
|
|
|
1264
1292
|
fontFeatureSettings: '"tnum" 0',
|
|
1265
1293
|
},
|
|
1266
1294
|
},
|
|
1295
|
+
inherit: {
|
|
1296
|
+
fontFamily: "inherit",
|
|
1297
|
+
fontSize: "inherit",
|
|
1298
|
+
lineHeight: "inherit",
|
|
1299
|
+
fontWeight: "inherit",
|
|
1300
|
+
color: "inherit",
|
|
1301
|
+
},
|
|
1267
1302
|
} as const;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import {css} from "@linaria/core";
|
|
2
2
|
import {useRef, useState} from "react";
|
|
3
|
-
import {IconButton} from "../button/icon-button";
|
|
4
3
|
import {CollapsibleContent, CollapsibleRoot, CollapsibleTrigger} from "../collapsible";
|
|
5
4
|
import {ColorPicker} from "../color-picker";
|
|
6
|
-
import {getIconColor, space} from "../design-system";
|
|
7
|
-
import ColorCoding from "../icons/react/ColorCoding";
|
|
8
|
-
import ColorCodingFilled from "../icons/react/ColorCodingFilled";
|
|
5
|
+
import {getIconColor, space, themeVars} from "../design-system";
|
|
9
6
|
import {useThemeMode} from "../theme-provider";
|
|
10
7
|
import {Tooltip} from "../tooltip";
|
|
11
8
|
import {$TSFixMe} from "../tsfixme";
|
|
12
9
|
import {EmojiPickerGrid, type EmojiPickerGridHandle, EmojiPickerGridProps} from "./primitives/grid";
|
|
13
10
|
import {EmojiPickerHeader} from "./primitives/header";
|
|
14
11
|
import {EmojiPickerSearch} from "./primitives/search";
|
|
12
|
+
import {Swatch} from "../color-picker/swatch";
|
|
15
13
|
|
|
16
14
|
const colorPickerWrapperCss = css`
|
|
17
15
|
padding-top: ${space.s12}px;
|
|
@@ -23,16 +21,12 @@ const ColorPickerCollapsibleTrigger: React.FC<ColorPickerCollapsibleTrigger> = (
|
|
|
23
21
|
const themeMode = useThemeMode();
|
|
24
22
|
const iconColor = color ? getIconColor(themeMode, color) : undefined;
|
|
25
23
|
|
|
26
|
-
const Icon = opened ? ColorCoding : ColorCodingFilled;
|
|
27
|
-
|
|
28
24
|
const label = opened ? "Hide color picker" : "Show color picker";
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
27
|
<CollapsibleTrigger asChild>
|
|
32
28
|
<Tooltip title={label}>
|
|
33
|
-
<
|
|
34
|
-
<Icon color={iconColor} />
|
|
35
|
-
</IconButton>
|
|
29
|
+
<Swatch data-testid="emoji-picker-color-trigger" size="small" color={iconColor || themeVars.iconColor} />
|
|
36
30
|
</Tooltip>
|
|
37
31
|
</CollapsibleTrigger>
|
|
38
32
|
);
|
|
@@ -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,75 @@ 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
|
+
color={color}
|
|
73
|
+
onColorSelect={showColorPickerOnTabs.includes("icons") ? onColorSelect : undefined}
|
|
74
|
+
getHoverColor={getHoverColor}
|
|
75
|
+
onSelect={onIconSelect}
|
|
76
|
+
/>
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
]);
|
|
80
|
+
|
|
81
|
+
const firstTab = items[0];
|
|
82
|
+
const [activeTab, setActiveTab] = useState(defaultTab || firstTab?.key);
|
|
83
|
+
|
|
52
84
|
return (
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
& .ant-tabs-content,
|
|
58
|
-
& .ant-tabs-tabpane,
|
|
59
|
-
& .ant-tabs-content-holder {
|
|
60
|
-
height: 100%;
|
|
61
|
-
}
|
|
85
|
+
<div
|
|
86
|
+
className={css`
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
62
89
|
`}
|
|
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
|
-
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
|
-
/>
|
|
90
|
+
>
|
|
91
|
+
<TabNavRoot className={tabNavRootStyle}>
|
|
92
|
+
<div
|
|
93
|
+
className={css`
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
`}
|
|
97
|
+
>
|
|
98
|
+
<TabNavList>
|
|
99
|
+
{items.map((item) => {
|
|
100
|
+
return (
|
|
101
|
+
<TabNavLink key={item.key} active={item.key === activeTab} onSelect={() => setActiveTab(item.key)}>
|
|
102
|
+
{item.label}
|
|
103
|
+
</TabNavLink>
|
|
104
|
+
);
|
|
105
|
+
})}
|
|
106
|
+
</TabNavList>
|
|
107
|
+
{onReset && (
|
|
108
|
+
<TabNavItem>
|
|
109
|
+
<Button size="small" variant="ghost" color="neutral" iconStart={<EmojiDelete />} onClick={onReset}>
|
|
110
|
+
{resetLabel}
|
|
111
|
+
</Button>
|
|
112
|
+
</TabNavItem>
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</TabNavRoot>
|
|
116
|
+
{items.find((item) => item.key === activeTab)?.children}
|
|
117
|
+
</div>
|
|
112
118
|
);
|
|
113
119
|
};
|
|
@@ -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
|
);
|