@fibery/ui-kit 1.40.3 → 1.41.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 +14 -0
- package/eslint.config.mjs +16 -0
- package/package.json +11 -13
- package/src/a11y-color.test.ts +162 -0
- package/src/a11y-color.ts +13 -20
- package/src/actions-menu/actions-menu-item.tsx +9 -12
- package/src/actions-menu/context-actions-menu.tsx +8 -3
- package/src/ai/model.tsx +0 -1
- package/src/ai/temperature.tsx +0 -1
- package/src/animated-height-container.tsx +3 -3
- package/src/antd/ant-modal.tsx +10 -5
- package/src/antd/index.tsx +3 -0
- package/src/antd/input.tsx +0 -1
- package/src/antd/styles.ts +15 -15
- package/src/app-icon-with-fallback.tsx +6 -6
- package/src/app-icon-wrapper.tsx +2 -3
- package/src/app-icon.tsx +4 -4
- package/src/avatar.tsx +3 -3
- package/src/button/base-button.tsx +0 -1
- package/src/button/button.tsx +1 -0
- package/src/button/make-button-colors.ts +5 -13
- package/src/checkbox.tsx +2 -2
- package/src/collapsible-section.tsx +11 -1
- package/src/color-picker/ColorPickerOrLoader.js +2 -2
- package/src/color-utils.test.ts +307 -0
- package/src/color-utils.ts +215 -0
- package/src/command-menu/index.tsx +1 -0
- package/src/comment.tsx +3 -2
- package/src/context-menu/index.tsx +12 -7
- package/src/date-picker/contexts.ts +2 -2
- package/src/date-picker/date-range-picker.tsx +3 -4
- package/src/date-picker/single-date-picker.tsx +147 -119
- package/src/date-picker/types.ts +4 -3
- package/src/day-select/iso-week-day-select.tsx +2 -2
- package/src/day-select/week-day-select.tsx +2 -2
- package/src/delayed.tsx +0 -1
- package/src/design-system/alpha.test.ts +59 -0
- package/src/design-system/alpha.ts +41 -0
- package/src/design-system/animation.ts +10 -0
- package/src/design-system/colors-css.test.ts +39 -0
- package/src/design-system/colors-css.ts +25 -0
- package/src/design-system/colors-js.test.ts +232 -0
- package/src/design-system/colors-js.ts +107 -0
- package/src/design-system/colors.test.ts +74 -0
- package/src/design-system/colors.ts +759 -0
- package/src/design-system/date.ts +3 -0
- package/src/design-system/layout.ts +106 -0
- package/src/design-system/theme.test.ts +94 -0
- package/src/design-system/theme.ts +93 -0
- package/src/design-system/typography.ts +179 -0
- package/src/design-system/vars.test.ts +1679 -0
- package/src/design-system/vars.ts +52 -0
- package/src/design-system.test.ts +45 -22
- package/src/design-system.ts +25 -1339
- package/src/dropdown-menu/index.tsx +21 -16
- package/src/emoji-picker/app-icon-picker.tsx +5 -5
- package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
- package/src/emoji-picker/icon-emoji-picker.tsx +3 -3
- package/src/favorites-icon.tsx +1 -1
- package/src/fibermoji-placeholder.tsx +3 -3
- package/src/field-container.tsx +11 -2
- package/src/file-item/file-icon.tsx +169 -0
- package/src/file-item/file-menu-items.tsx +68 -0
- package/src/file-item/file-preview-actions.tsx +38 -0
- package/src/file-item/file-title.tsx +48 -0
- package/src/file-item/types.ts +27 -0
- package/src/file-item/use-register-in-image-gallery.tsx +70 -0
- package/src/file-item-2.tsx +32 -348
- package/src/file-item.tsx +6 -3
- package/src/hue-shift.test.ts +91 -0
- package/src/icons/ast/ChatBubble.ts +8 -0
- package/src/icons/ast/ChatFloat.ts +8 -0
- package/src/icons/ast/ChatSidebar.ts +8 -0
- package/src/icons/ast/FileCounter.ts +8 -0
- package/src/icons/ast/FileMultiple.ts +8 -0
- package/src/icons/ast/FileOther.ts +8 -0
- package/src/icons/ast/NoBorder.ts +8 -0
- package/src/icons/ast/NoFill.ts +8 -0
- package/src/icons/ast/ValueEdit.ts +8 -0
- package/src/icons/ast/index.tsx +9 -0
- package/src/icons/react/ChatBubble.tsx +13 -0
- package/src/icons/react/ChatFloat.tsx +13 -0
- package/src/icons/react/ChatSidebar.tsx +13 -0
- package/src/icons/react/FileCounter.tsx +13 -0
- package/src/icons/react/FileMultiple.tsx +13 -0
- package/src/icons/react/FileOther.tsx +13 -0
- package/src/icons/react/NoBorder.tsx +13 -0
- package/src/icons/react/NoFill.tsx +13 -0
- package/src/icons/react/ValueEdit.tsx +13 -0
- package/src/icons/react/index.tsx +9 -0
- package/src/icons/svg/chat-bubble.svg +4 -0
- package/src/icons/svg/chat-float.svg +4 -0
- package/src/icons/svg/chat-sidebar.svg +4 -0
- package/src/icons/svg/file-counter.svg +3 -0
- package/src/icons/svg/file-multiple.svg +3 -0
- package/src/icons/svg/file-other.svg +3 -0
- package/src/icons/svg/no-border.svg +17 -0
- package/src/icons/svg/no-fill.svg +4 -0
- package/src/icons/svg/value-edit.svg +3 -0
- package/src/images-gallery/images-gallery.tsx +8 -6
- package/src/images-gallery/slide-buttons.tsx +4 -11
- package/src/is-iOS.ts +0 -1
- package/src/is-in-popup.ts +2 -1
- package/src/lists/actions-menu-row-surface.tsx +7 -7
- package/src/loading-sausage.tsx +2 -2
- package/src/media-query-utils.ts +1 -2
- package/src/mobile-keyboard-aware-popup.tsx +6 -5
- package/src/modal-menu/modal-menu-content.tsx +2 -2
- package/src/number-input/decimal.js +9 -7
- package/src/number-input/{number-inline-input-with-autosize.tsx → number-input-inline-with-autosize.tsx} +20 -41
- package/src/number-input/number-input-inline.tsx +118 -0
- package/src/number-input/{index.test.js → number-input.test.tsx} +38 -43
- package/src/number-input/number-input.tsx +63 -121
- package/src/number-input/types.ts +19 -0
- package/src/number-input/utils.ts +61 -0
- package/src/online-users.tsx +2 -2
- package/src/palette-generator.test.ts +309 -0
- package/src/palette-generator.ts +160 -0
- package/src/palettes/_.ts +72 -0
- package/src/palettes/slate-arch.colors-snapshot.test.ts +1689 -0
- package/src/palettes/slate-arch.ts +188 -0
- package/src/palettes/slate-user.colors-snapshot.test.ts +1689 -0
- package/src/palettes/slate-user.ts +187 -0
- package/src/palettes/warm-arch.colors-snapshot.test.ts +1689 -0
- package/src/palettes/warm-arch.ts +222 -0
- package/src/palettes/warm-user.colors-snapshot.test.ts +1689 -0
- package/src/palettes/warm-user.ts +222 -0
- package/src/platform.ts +0 -3
- package/src/popover/get-element-ref.ts +28 -0
- package/src/popover/index.tsx +236 -339
- package/src/popover/{mobile-popup-context.tsx → mobile-popover-context.tsx} +7 -7
- package/src/popover/mobile-popover.tsx +169 -0
- package/src/popover/modifiers.tsx +2 -2
- package/src/popover/popup-stack-context.tsx +8 -9
- package/src/progress.tsx +2 -2
- package/src/reactions/reaction-button.tsx +12 -6
- package/src/root-theme-provider.test.tsx +411 -0
- package/src/scale-generator.ts +356 -0
- package/src/select/components/menu-list-virtualized.tsx +12 -25
- package/src/select/components/menu.tsx +12 -2
- package/src/select/index.tsx +6 -5
- package/src/select/select.tsx +38 -39
- package/src/select/styles.ts +0 -1
- package/src/select/util.ts +1 -1
- package/src/static-palettes.ts +356 -0
- package/src/thematic-color-picker.tsx +266 -0
- package/src/thematic-constants.tsx +27 -0
- package/src/thematic-controls.tsx +144 -0
- package/src/thematic-scales.tsx +122 -0
- package/src/thematic-state.ts +370 -0
- package/src/thematic.tsx +386 -0
- package/src/theme-provider.test.tsx +820 -0
- package/src/theme-provider.tsx +158 -92
- package/src/theme-settings.ts +67 -12
- package/src/theme-styles.ts +58 -6
- package/src/toast/toast-action.tsx +1 -1
- package/src/toast/toast.tsx +1 -2
- package/src/toggle-on-off.tsx +2 -2
- package/src/toggle.tsx +7 -8
- package/src/tooltip.tsx +14 -10
- package/src/type-badge.tsx +7 -14
- package/src/unit/styles.ts +2 -25
- package/src/unit/unit-with-tooltip.tsx +3 -2
- package/src/use-is-phone.tsx +7 -2
- package/src/use-long-press.tsx +2 -2
- package/src/use-on-screen-keyboard-data.tsx +2 -2
- package/src/with-data.tsx +4 -3
- package/src/workflow-progress-icon.tsx +2 -2
- package/.eslintignore +0 -3
- package/.eslintrc +0 -14
- package/src/__mocks__/createInlineTheme.js +0 -3
- package/src/create-inline-theme.ts +0 -66
- package/src/number-input/index.js +0 -191
- package/src/palette.ts +0 -237
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {ThemeColors} from "../design-system";
|
|
2
|
+
import {typedObjectEntries} from "@fibery/helpers/utils/object";
|
|
3
|
+
import type {Assert, Equals} from "@fibery/helpers/utils/types";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
export const varPrefix = process.env.VAR_THEME_PREFIX || "fibery";
|
|
8
|
+
|
|
9
|
+
export type ThemeVars = Omit<ThemeColors, "key" | "fns" | "select">;
|
|
10
|
+
|
|
11
|
+
export function makeThemeVars(sample: ThemeColors) {
|
|
12
|
+
const vars = {} as Record<string, string | {[k: string]: string}>;
|
|
13
|
+
for (const [key, value] of typedObjectEntries(sample)) {
|
|
14
|
+
// LINT.IfChange("skipMetaKeys")
|
|
15
|
+
if (key === "key" || key === "fns" || key === "select") {
|
|
16
|
+
// LINT.ThenChange(["./theme.ts#skipMetaKeys", "./theme.test.ts#skipMetaKeys"])
|
|
17
|
+
} else if (key === "opacity") {
|
|
18
|
+
vars[key] = Object.fromEntries(
|
|
19
|
+
Object.keys(value).map((opacityKey) => [opacityKey, `var(--${varPrefix}-opacity-${opacityKey})`])
|
|
20
|
+
);
|
|
21
|
+
} else if (key === "shades") {
|
|
22
|
+
vars[key] = Object.fromEntries(
|
|
23
|
+
Object.keys(value).map((shadeKey) => [shadeKey, `var(--${varPrefix}-shades-${shadeKey})`])
|
|
24
|
+
);
|
|
25
|
+
} else if (key === "lights") {
|
|
26
|
+
vars[key] = Object.fromEntries(
|
|
27
|
+
Object.keys(value).map((lightKey) => [lightKey, `var(--${varPrefix}-lights-${lightKey})`])
|
|
28
|
+
);
|
|
29
|
+
} else if (key === "separators") {
|
|
30
|
+
vars[key] = Object.fromEntries(
|
|
31
|
+
Object.keys(value).map((separatorKey) => [separatorKey, `var(--${varPrefix}-separator-${separatorKey})`])
|
|
32
|
+
);
|
|
33
|
+
} else {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
type _ = Assert<Equals<typeof value, string>>;
|
|
36
|
+
vars[key] = `var(--${varPrefix}-color-${key})`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return vars as ThemeVars;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const menuItemHeightVar = `--${varPrefix}-layout-menuItemHeight`;
|
|
43
|
+
export const sidebarMenuItemHeightVar = `--${varPrefix}-layout-sidebarMenuItemHeight`;
|
|
44
|
+
export const sidebarMenuIconSizeVar = `--${varPrefix}-layout-sidebarMenuIconSize`;
|
|
45
|
+
export const listRowSurfaceFontSizeVar = `--${varPrefix}-layout-listRowSurfaceFontSize`;
|
|
46
|
+
|
|
47
|
+
export const layoutVars = {
|
|
48
|
+
menuItemHeight: `var(${menuItemHeightVar})`,
|
|
49
|
+
sidebarMenuItemHeight: `var(${sidebarMenuItemHeightVar})`,
|
|
50
|
+
sidebarMenuIconSize: `var(${sidebarMenuIconSizeVar})`,
|
|
51
|
+
listRowSurfaceFontSize: `var(${listRowSurfaceFontSizeVar})`,
|
|
52
|
+
};
|
|
@@ -1,24 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as exports from "./design-system";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
test("exports", () => {
|
|
4
|
+
expect(Object.keys(exports).toSorted()).toEqual(
|
|
5
|
+
[
|
|
6
|
+
"border",
|
|
7
|
+
"cardTypeColors",
|
|
8
|
+
"createInlineStyles",
|
|
9
|
+
"dateFormat",
|
|
10
|
+
"dateTimeFormat",
|
|
11
|
+
"dropCursorColor",
|
|
12
|
+
"duration",
|
|
13
|
+
"easing",
|
|
14
|
+
"fontFamily",
|
|
15
|
+
"fontSize",
|
|
16
|
+
"fontWeight",
|
|
17
|
+
"getDarkenColor",
|
|
18
|
+
"getEnumTextColor",
|
|
19
|
+
"getLinearGradient",
|
|
20
|
+
"getObjectColorMemoized",
|
|
21
|
+
"getOpacities",
|
|
22
|
+
"getTextColor",
|
|
23
|
+
"getThemeColors",
|
|
24
|
+
"iconSize",
|
|
25
|
+
"layout",
|
|
26
|
+
"layoutVars",
|
|
27
|
+
"lineHeight",
|
|
28
|
+
"listRowSurfaceFontSizeVar",
|
|
29
|
+
"menuItemHeightVar",
|
|
30
|
+
"minPanelWidth",
|
|
31
|
+
"opacity",
|
|
32
|
+
"shadows",
|
|
33
|
+
"sidebarMenuIconSizeVar",
|
|
34
|
+
"sidebarMenuItemHeightVar",
|
|
35
|
+
"space",
|
|
36
|
+
"spaceNestedTreeInterval",
|
|
37
|
+
"spaceNestedTreeLevel",
|
|
38
|
+
"textStyles",
|
|
39
|
+
"themeVars",
|
|
40
|
+
"timeFormat",
|
|
41
|
+
"tooltipDelay",
|
|
42
|
+
"transition",
|
|
43
|
+
"typeSizes",
|
|
44
|
+
"viewBoxSize",
|
|
45
|
+
].toSorted()
|
|
46
|
+
);
|
|
24
47
|
});
|