@fibery/ui-kit 1.42.0 → 2.0.1
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/.oxlintrc.json +24 -0
- package/CHANGELOG.md +20 -0
- package/eslint.config.mjs +1 -1
- package/jest.config.cjs +36 -0
- package/package.json +12 -52
- package/src/@types/css.d.ts +1 -0
- package/src/actions-menu/actions-menu-checkbox-item.tsx +74 -0
- package/src/actions-menu/contexts/actions-menu-context.tsx +1 -0
- package/src/actions-menu/index.tsx +1 -0
- package/src/animated-number.tsx +2 -2
- package/src/antd/AutoComplete.d.ts +1 -0
- package/src/app-icon-with-fallback.tsx +4 -4
- package/src/app-icon.tsx +4 -4
- package/src/appIcons.json +1227 -1227
- package/src/avatar.tsx +44 -5
- package/src/box.tsx +10 -17
- package/src/button/make-button-colors.ts +13 -13
- package/src/checkbox.tsx +3 -3
- package/src/collapsible-section.tsx +1 -1
- package/src/context-menu/index.tsx +4 -0
- package/src/date-picker/date-range-picker.tsx +1 -1
- package/src/date-picker/relative-date-picker.tsx +3 -0
- package/src/date-picker/single-date-picker.tsx +10 -9
- package/src/design-system/alpha.ts +9 -0
- package/src/design-system/colors-css.test.ts +1 -9
- package/src/design-system/colors-css.ts +1 -1
- package/src/design-system/colors.ts +351 -313
- package/src/design-system/layout.ts +1 -1
- package/src/design-system/theme.ts +4 -1
- package/src/design-system/vars.test.ts +4 -0
- package/src/design-system.test.ts +1 -0
- package/src/design-system.ts +1 -1
- package/src/dropdown-menu/index.tsx +4 -0
- package/src/emoji-picker/primitives/emoji.tsx +12 -0
- package/src/emoji-picker/primitives/grid.tsx +100 -104
- package/src/emoji.tsx +1 -0
- package/src/file-item.tsx +308 -265
- package/src/icons/ast/AddDatabase.ts +1 -1
- package/src/icons/ast/AddIntegration.ts +1 -1
- package/src/icons/ast/ArrowsRightLeft.ts +1 -1
- package/src/icons/ast/ChatBubble.ts +1 -1
- package/src/icons/ast/ChatFloat.ts +1 -1
- package/src/icons/ast/ChatSidebar.ts +1 -1
- package/src/icons/ast/Clean.ts +1 -1
- package/src/icons/ast/Create.ts +1 -1
- package/src/icons/ast/ItemsTimeline.ts +1 -1
- package/src/icons/ast/Key.ts +1 -1
- package/src/icons/ast/NetworkAdd.ts +1 -1
- package/src/icons/ast/Print.ts +1 -1
- package/src/icons/ast/Success.ts +1 -1
- package/src/icons/ast/SuggestIntegration.ts +1 -1
- package/src/icons/ast/WarningTriangle.ts +1 -1
- package/src/icons/ast/Windows.ts +1 -1
- package/src/icons/svg/add-database.svg +1 -1
- package/src/icons/svg/add-integration.svg +1 -1
- package/src/icons/svg/arrows-right-left.svg +1 -1
- package/src/icons/svg/chat-bubble.svg +1 -1
- package/src/icons/svg/chat-float.svg +1 -1
- package/src/icons/svg/chat-sidebar.svg +3 -3
- package/src/icons/svg/clean.svg +1 -1
- package/src/icons/svg/create.svg +1 -1
- package/src/icons/svg/items-timeline.svg +1 -1
- package/src/icons/svg/key.svg +1 -1
- package/src/icons/svg/network-add.svg +1 -1
- package/src/icons/svg/print.svg +1 -1
- package/src/icons/svg/success.svg +1 -1
- package/src/icons/svg/suggest-integration.svg +1 -1
- package/src/icons/svg/warning-triangle.svg +1 -1
- package/src/icons/svg/windows.svg +1 -1
- package/src/images-gallery/images-gallery.tsx +24 -0
- package/src/lists/actions-menu-row-surface.tsx +2 -1
- package/src/logo.tsx +14 -13
- package/src/modal-menu/index.tsx +1 -0
- package/src/modal-menu/modal-menu-checkbox-item.tsx +50 -0
- package/src/online-users.tsx +45 -46
- package/src/palettes/slate-arch.colors-snapshot.test.ts +7 -7
- package/src/palettes/slate-user.colors-snapshot.test.ts +11 -11
- package/src/palettes/warm-arch.colors-snapshot.test.ts +7 -7
- package/src/palettes/warm-user.colors-snapshot.test.ts +7 -7
- package/src/popover/index.tsx +91 -203
- package/src/popover/popover-old.tsx +113 -0
- package/src/popover/popup-modifiers-context.ts +1 -1
- package/src/scale-generator.ts +2 -2
- package/src/select/components/clear-indicator.tsx +1 -1
- package/src/select/components/drop-down-indicator.tsx +2 -2
- package/src/select/components/group-heading.tsx +2 -2
- package/src/select/components/menu-list-virtualized.tsx +1 -1
- package/src/select/components/option.tsx +1 -1
- package/src/select/index.tsx +34 -37
- package/src/select/select-in-popover.tsx +34 -202
- package/src/select/select.tsx +5 -4
- package/src/select/styles.ts +3 -0
- package/src/thematic-state.ts +1 -1
- package/src/theme-provider.tsx +14 -2
- package/src/theme-styles.ts +14 -7
- package/src/toggle-button/toggle-button.tsx +48 -35
- package/src/tree-utils.test.ts +166 -0
- package/src/tree-utils.ts +107 -0
- package/src/file-item/use-register-in-image-gallery.tsx +0 -70
- package/src/file-item-2.tsx +0 -357
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Colors, makeThemeDefs, pickColors, pickFns, ThemeDefs} from "./colors";
|
|
1
|
+
import {cardTypeColors, Colors, makeThemeDefs, pickColors, pickFns, ThemeDefs} from "./colors";
|
|
2
2
|
import {getTypeColors, TypeColors} from "./colors-js";
|
|
3
3
|
import {ThemeMode} from "../theme-settings";
|
|
4
4
|
import {defaultPaletteKey, makeDefaultPalette, ThemePalette} from "../palette-generator";
|
|
@@ -16,6 +16,9 @@ export function makeThemeApi(palette: ThemePalette, defs: ThemeDefs, mode: Theme
|
|
|
16
16
|
}
|
|
17
17
|
return values.light;
|
|
18
18
|
},
|
|
19
|
+
get defaultCardTypeColorUppercaseHex() {
|
|
20
|
+
return palette.key.includes("arch") ? cardTypeColors[14] : cardTypeColors[10];
|
|
21
|
+
},
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -6,6 +6,10 @@ import {defaultPalette} from "../theme-styles";
|
|
|
6
6
|
test("makeThemeVars", () => {
|
|
7
7
|
expect(Object.entries(makeThemeVars(getThemeColors(null, "light2", defaultPalette)))).toMatchInlineSnapshot(`
|
|
8
8
|
[
|
|
9
|
+
[
|
|
10
|
+
"defaultCardTypeColorUppercaseHex",
|
|
11
|
+
"var(--fibery-color-defaultCardTypeColorUppercaseHex)",
|
|
12
|
+
],
|
|
9
13
|
[
|
|
10
14
|
"primary",
|
|
11
15
|
"var(--fibery-color-primary)",
|
package/src/design-system.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {opacity, getOpacities} from "./design-system/alpha";
|
|
1
|
+
export {opacity, getOpacities, alpha} from "./design-system/alpha";
|
|
2
2
|
export {transition, easing, duration, tooltipDelay} from "./design-system/animation";
|
|
3
3
|
export {cardTypeColors} from "./design-system/colors";
|
|
4
4
|
export {getLinearGradient, getEnumTextColor, dropCursorColor, shadows} from "./design-system/colors-css";
|
|
@@ -178,6 +178,10 @@ export const Item = styled(DropdownMenuPrimitive.Item)`
|
|
|
178
178
|
${rowItemStyles}
|
|
179
179
|
`;
|
|
180
180
|
|
|
181
|
+
export const CheckboxItem = styled(DropdownMenuPrimitive.CheckboxItem)`
|
|
182
|
+
${rowItemStyles}
|
|
183
|
+
`;
|
|
184
|
+
|
|
181
185
|
export const Separator = styled(DropdownMenuPrimitive.Separator)`
|
|
182
186
|
${{
|
|
183
187
|
backgroundColor: themeVars.actionMenuSeparatorColor,
|
|
@@ -4,6 +4,7 @@ import {css, cx} from "@linaria/core";
|
|
|
4
4
|
import {themeVars} from "../../design-system";
|
|
5
5
|
import {useEmojiDataStoreSelector} from "../stores/emoji-data-store";
|
|
6
6
|
import {useEmojiRenderConfig} from "./render-config-provider";
|
|
7
|
+
import {traceError} from "@fibery/helpers/utils/trace";
|
|
7
8
|
|
|
8
9
|
const emojiWrapperCss = css`
|
|
9
10
|
color: ${themeVars.textColor};
|
|
@@ -62,6 +63,17 @@ export const Emoji = forwardRef<HTMLSpanElement, EmojiProps>(
|
|
|
62
63
|
{className, emoji: idOrColons, size, version = 14, fallback = "hidden", skin, native, showTitle = false, ...rest},
|
|
63
64
|
ref
|
|
64
65
|
) => {
|
|
66
|
+
// remove after investigation of FIBERY-UI-36GW
|
|
67
|
+
if (typeof idOrColons !== "string") {
|
|
68
|
+
traceError(
|
|
69
|
+
new Error(
|
|
70
|
+
`Assign to misha-erm. Emoji key must be a string, received: ${typeof idOrColons}. Stringified: ${JSON.stringify(
|
|
71
|
+
idOrColons
|
|
72
|
+
)}`
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
65
77
|
const emoji = useEmojiDataStoreSelector((store) => store.get(idOrColons, {skin}));
|
|
66
78
|
const config = useEmojiRenderConfig();
|
|
67
79
|
if (!emoji) {
|
|
@@ -160,36 +160,78 @@ export const EmojiPickerGrid = forwardRef<EmojiPickerGridHandle, EmojiPickerGrid
|
|
|
160
160
|
|
|
161
161
|
const emojiPreview = useEmojiPreview();
|
|
162
162
|
|
|
163
|
-
useImperativeHandle(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
163
|
+
useImperativeHandle(ref, () => {
|
|
164
|
+
return {
|
|
165
|
+
scrollToTop: () => {
|
|
166
|
+
virtuosoRef.current?.scrollToIndex(0);
|
|
167
|
+
},
|
|
168
|
+
navigate(direction) {
|
|
169
|
+
const virtuoso = virtuosoRef.current;
|
|
170
|
+
if (!virtuoso) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// TODO: not optimal. Probably better to lift up in context and store focused index separately instead of calculating it every time
|
|
175
|
+
let colIdx = -1;
|
|
176
|
+
let rowIdx = emojiPreview
|
|
177
|
+
? dataByRows.findIndex(
|
|
178
|
+
({categoryId, emojis}) =>
|
|
179
|
+
categoryId === emojiPreview.categoryId &&
|
|
180
|
+
(colIdx = emojis.findIndex((id) => id === emojiPreview.emoji.id)) > -1
|
|
181
|
+
)
|
|
182
|
+
: -1;
|
|
183
|
+
|
|
184
|
+
switch (direction) {
|
|
185
|
+
case "down": {
|
|
186
|
+
rowIdx++;
|
|
187
|
+
const nextRow = dataByRows[rowIdx];
|
|
188
|
+
if (nextRow) {
|
|
189
|
+
colIdx = Math.min(Math.max(colIdx, 0), nextRow.emojis.length - 1);
|
|
190
|
+
|
|
191
|
+
virtuoso.scrollIntoView({
|
|
192
|
+
index: rowIdx,
|
|
193
|
+
done: () =>
|
|
194
|
+
setEmojiPreview({
|
|
195
|
+
categoryId: nextRow.categoryId,
|
|
196
|
+
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
break;
|
|
174
203
|
}
|
|
204
|
+
case "up": {
|
|
205
|
+
rowIdx--;
|
|
206
|
+
const nextRow = dataByRows[rowIdx];
|
|
207
|
+
if (nextRow) {
|
|
208
|
+
colIdx = Math.min(Math.max(colIdx, 0), nextRow.emojis.length - 1);
|
|
209
|
+
|
|
210
|
+
virtuoso.scrollIntoView({
|
|
211
|
+
index: rowIdx,
|
|
212
|
+
calculateViewLocation: calculateViewLocation,
|
|
213
|
+
done: () =>
|
|
214
|
+
setEmojiPreview({
|
|
215
|
+
categoryId: nextRow.categoryId,
|
|
216
|
+
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
175
222
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
)
|
|
184
|
-
: -1;
|
|
185
|
-
|
|
186
|
-
switch (direction) {
|
|
187
|
-
case "down": {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
case "right": {
|
|
226
|
+
let nextRow = dataByRows[rowIdx];
|
|
227
|
+
colIdx++;
|
|
228
|
+
|
|
229
|
+
if (!nextRow?.emojis[colIdx]) {
|
|
188
230
|
rowIdx++;
|
|
189
|
-
|
|
190
|
-
if (nextRow) {
|
|
191
|
-
colIdx = Math.min(Math.max(colIdx, 0), nextRow.emojis.length - 1);
|
|
231
|
+
nextRow = dataByRows[rowIdx];
|
|
192
232
|
|
|
233
|
+
if (nextRow) {
|
|
234
|
+
colIdx = 0;
|
|
193
235
|
virtuoso.scrollIntoView({
|
|
194
236
|
index: rowIdx,
|
|
195
237
|
done: () =>
|
|
@@ -199,102 +241,56 @@ export const EmojiPickerGrid = forwardRef<EmojiPickerGridHandle, EmojiPickerGrid
|
|
|
199
241
|
}),
|
|
200
242
|
});
|
|
201
243
|
return true;
|
|
244
|
+
} else {
|
|
245
|
+
return false;
|
|
202
246
|
}
|
|
203
|
-
|
|
204
|
-
break;
|
|
205
247
|
}
|
|
206
|
-
|
|
248
|
+
|
|
249
|
+
setEmojiPreview({
|
|
250
|
+
categoryId: nextRow.categoryId,
|
|
251
|
+
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
252
|
+
});
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
case "left": {
|
|
256
|
+
const row = dataByRows[rowIdx];
|
|
257
|
+
colIdx--;
|
|
258
|
+
|
|
259
|
+
if (!row?.emojis[colIdx]) {
|
|
207
260
|
rowIdx--;
|
|
208
261
|
const nextRow = dataByRows[rowIdx];
|
|
209
|
-
if (nextRow) {
|
|
210
|
-
colIdx = Math.min(Math.max(colIdx, 0), nextRow.emojis.length - 1);
|
|
211
262
|
|
|
263
|
+
if (nextRow) {
|
|
264
|
+
colIdx = nextRow.emojis.length - 1;
|
|
212
265
|
virtuoso.scrollIntoView({
|
|
213
266
|
index: rowIdx,
|
|
214
|
-
calculateViewLocation
|
|
267
|
+
calculateViewLocation,
|
|
215
268
|
done: () =>
|
|
216
269
|
setEmojiPreview({
|
|
217
270
|
categoryId: nextRow.categoryId,
|
|
218
271
|
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
219
272
|
}),
|
|
220
273
|
});
|
|
221
|
-
|
|
222
274
|
return true;
|
|
275
|
+
} else {
|
|
276
|
+
return false;
|
|
223
277
|
}
|
|
224
|
-
|
|
225
|
-
break;
|
|
226
278
|
}
|
|
227
|
-
case "right": {
|
|
228
|
-
let nextRow = dataByRows[rowIdx];
|
|
229
|
-
colIdx++;
|
|
230
|
-
|
|
231
|
-
if (!nextRow?.emojis[colIdx]) {
|
|
232
|
-
rowIdx++;
|
|
233
|
-
nextRow = dataByRows[rowIdx];
|
|
234
|
-
|
|
235
|
-
if (nextRow) {
|
|
236
|
-
colIdx = 0;
|
|
237
|
-
virtuoso.scrollIntoView({
|
|
238
|
-
index: rowIdx,
|
|
239
|
-
done: () =>
|
|
240
|
-
setEmojiPreview({
|
|
241
|
-
categoryId: nextRow.categoryId,
|
|
242
|
-
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
243
|
-
}),
|
|
244
|
-
});
|
|
245
|
-
return true;
|
|
246
|
-
} else {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
279
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
case "left": {
|
|
258
|
-
const row = dataByRows[rowIdx];
|
|
259
|
-
colIdx--;
|
|
260
|
-
|
|
261
|
-
if (!row?.emojis[colIdx]) {
|
|
262
|
-
rowIdx--;
|
|
263
|
-
const nextRow = dataByRows[rowIdx];
|
|
264
|
-
|
|
265
|
-
if (nextRow) {
|
|
266
|
-
colIdx = nextRow.emojis.length - 1;
|
|
267
|
-
virtuoso.scrollIntoView({
|
|
268
|
-
index: rowIdx,
|
|
269
|
-
calculateViewLocation,
|
|
270
|
-
done: () =>
|
|
271
|
-
setEmojiPreview({
|
|
272
|
-
categoryId: nextRow.categoryId,
|
|
273
|
-
emoji: emojiData.get(nextRow.emojis[colIdx]) as EmojiItem,
|
|
274
|
-
}),
|
|
275
|
-
});
|
|
276
|
-
return true;
|
|
277
|
-
} else {
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
setEmojiPreview({
|
|
283
|
-
categoryId: row.categoryId,
|
|
284
|
-
emoji: emojiData.get(row.emojis[colIdx]) as EmojiItem,
|
|
285
|
-
});
|
|
286
|
-
return true;
|
|
287
|
-
}
|
|
288
|
-
default:
|
|
289
|
-
break;
|
|
280
|
+
setEmojiPreview({
|
|
281
|
+
categoryId: row.categoryId,
|
|
282
|
+
emoji: emojiData.get(row.emojis[colIdx]) as EmojiItem,
|
|
283
|
+
});
|
|
284
|
+
return true;
|
|
290
285
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
286
|
+
default:
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return false;
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
}, [dataByRows, emojiData, emojiPreview, setEmojiPreview]);
|
|
298
294
|
|
|
299
295
|
return (
|
|
300
296
|
<div
|
package/src/emoji.tsx
CHANGED
|
@@ -17,6 +17,7 @@ const StyledEmoji = styled.span<{size: number; inline: boolean}>`
|
|
|
17
17
|
cursor: ${(props) => (props.onClick ? "pointer" : "inherit")};
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
|
+
/** @deprecated Use Emoji from emoji-picker instead */
|
|
20
21
|
export const Emoji = ({symbol, label = "", size = 1.4, inline = true, onClick}: Props): JSX.Element => {
|
|
21
22
|
const ariaLabelProps = {
|
|
22
23
|
...(label && {label: label}),
|