@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.
Files changed (174) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/eslint.config.mjs +16 -0
  3. package/package.json +11 -13
  4. package/src/a11y-color.test.ts +162 -0
  5. package/src/a11y-color.ts +13 -20
  6. package/src/actions-menu/actions-menu-item.tsx +9 -12
  7. package/src/actions-menu/context-actions-menu.tsx +8 -3
  8. package/src/ai/model.tsx +0 -1
  9. package/src/ai/temperature.tsx +0 -1
  10. package/src/animated-height-container.tsx +3 -3
  11. package/src/antd/ant-modal.tsx +10 -5
  12. package/src/antd/index.tsx +3 -0
  13. package/src/antd/input.tsx +0 -1
  14. package/src/antd/styles.ts +15 -15
  15. package/src/app-icon-with-fallback.tsx +6 -6
  16. package/src/app-icon-wrapper.tsx +2 -3
  17. package/src/app-icon.tsx +4 -4
  18. package/src/avatar.tsx +3 -3
  19. package/src/button/base-button.tsx +0 -1
  20. package/src/button/button.tsx +1 -0
  21. package/src/button/make-button-colors.ts +5 -13
  22. package/src/checkbox.tsx +2 -2
  23. package/src/collapsible-section.tsx +11 -1
  24. package/src/color-picker/ColorPickerOrLoader.js +2 -2
  25. package/src/color-utils.test.ts +307 -0
  26. package/src/color-utils.ts +215 -0
  27. package/src/command-menu/index.tsx +1 -0
  28. package/src/comment.tsx +3 -2
  29. package/src/context-menu/index.tsx +12 -7
  30. package/src/date-picker/contexts.ts +2 -2
  31. package/src/date-picker/date-range-picker.tsx +3 -4
  32. package/src/date-picker/single-date-picker.tsx +147 -119
  33. package/src/date-picker/types.ts +4 -3
  34. package/src/day-select/iso-week-day-select.tsx +2 -2
  35. package/src/day-select/week-day-select.tsx +2 -2
  36. package/src/delayed.tsx +0 -1
  37. package/src/design-system/alpha.test.ts +59 -0
  38. package/src/design-system/alpha.ts +41 -0
  39. package/src/design-system/animation.ts +10 -0
  40. package/src/design-system/colors-css.test.ts +39 -0
  41. package/src/design-system/colors-css.ts +25 -0
  42. package/src/design-system/colors-js.test.ts +232 -0
  43. package/src/design-system/colors-js.ts +107 -0
  44. package/src/design-system/colors.test.ts +74 -0
  45. package/src/design-system/colors.ts +759 -0
  46. package/src/design-system/date.ts +3 -0
  47. package/src/design-system/layout.ts +106 -0
  48. package/src/design-system/theme.test.ts +94 -0
  49. package/src/design-system/theme.ts +93 -0
  50. package/src/design-system/typography.ts +179 -0
  51. package/src/design-system/vars.test.ts +1679 -0
  52. package/src/design-system/vars.ts +52 -0
  53. package/src/design-system.test.ts +45 -22
  54. package/src/design-system.ts +25 -1339
  55. package/src/dropdown-menu/index.tsx +21 -16
  56. package/src/emoji-picker/app-icon-picker.tsx +5 -5
  57. package/src/emoji-picker/emoji-picker-content-with-color.tsx +4 -4
  58. package/src/emoji-picker/icon-emoji-picker.tsx +3 -3
  59. package/src/favorites-icon.tsx +1 -1
  60. package/src/fibermoji-placeholder.tsx +3 -3
  61. package/src/field-container.tsx +11 -2
  62. package/src/file-item/file-icon.tsx +169 -0
  63. package/src/file-item/file-menu-items.tsx +68 -0
  64. package/src/file-item/file-preview-actions.tsx +38 -0
  65. package/src/file-item/file-title.tsx +48 -0
  66. package/src/file-item/types.ts +27 -0
  67. package/src/file-item/use-register-in-image-gallery.tsx +70 -0
  68. package/src/file-item-2.tsx +32 -348
  69. package/src/file-item.tsx +6 -3
  70. package/src/hue-shift.test.ts +91 -0
  71. package/src/icons/ast/ChatBubble.ts +8 -0
  72. package/src/icons/ast/ChatFloat.ts +8 -0
  73. package/src/icons/ast/ChatSidebar.ts +8 -0
  74. package/src/icons/ast/FileCounter.ts +8 -0
  75. package/src/icons/ast/FileMultiple.ts +8 -0
  76. package/src/icons/ast/FileOther.ts +8 -0
  77. package/src/icons/ast/NoBorder.ts +8 -0
  78. package/src/icons/ast/NoFill.ts +8 -0
  79. package/src/icons/ast/ValueEdit.ts +8 -0
  80. package/src/icons/ast/index.tsx +9 -0
  81. package/src/icons/react/ChatBubble.tsx +13 -0
  82. package/src/icons/react/ChatFloat.tsx +13 -0
  83. package/src/icons/react/ChatSidebar.tsx +13 -0
  84. package/src/icons/react/FileCounter.tsx +13 -0
  85. package/src/icons/react/FileMultiple.tsx +13 -0
  86. package/src/icons/react/FileOther.tsx +13 -0
  87. package/src/icons/react/NoBorder.tsx +13 -0
  88. package/src/icons/react/NoFill.tsx +13 -0
  89. package/src/icons/react/ValueEdit.tsx +13 -0
  90. package/src/icons/react/index.tsx +9 -0
  91. package/src/icons/svg/chat-bubble.svg +4 -0
  92. package/src/icons/svg/chat-float.svg +4 -0
  93. package/src/icons/svg/chat-sidebar.svg +4 -0
  94. package/src/icons/svg/file-counter.svg +3 -0
  95. package/src/icons/svg/file-multiple.svg +3 -0
  96. package/src/icons/svg/file-other.svg +3 -0
  97. package/src/icons/svg/no-border.svg +17 -0
  98. package/src/icons/svg/no-fill.svg +4 -0
  99. package/src/icons/svg/value-edit.svg +3 -0
  100. package/src/images-gallery/images-gallery.tsx +8 -6
  101. package/src/images-gallery/slide-buttons.tsx +4 -11
  102. package/src/is-iOS.ts +0 -1
  103. package/src/is-in-popup.ts +2 -1
  104. package/src/lists/actions-menu-row-surface.tsx +7 -7
  105. package/src/loading-sausage.tsx +2 -2
  106. package/src/media-query-utils.ts +1 -2
  107. package/src/mobile-keyboard-aware-popup.tsx +6 -5
  108. package/src/modal-menu/modal-menu-content.tsx +2 -2
  109. package/src/number-input/decimal.js +9 -7
  110. package/src/number-input/{number-inline-input-with-autosize.tsx → number-input-inline-with-autosize.tsx} +20 -41
  111. package/src/number-input/number-input-inline.tsx +118 -0
  112. package/src/number-input/{index.test.js → number-input.test.tsx} +38 -43
  113. package/src/number-input/number-input.tsx +63 -121
  114. package/src/number-input/types.ts +19 -0
  115. package/src/number-input/utils.ts +61 -0
  116. package/src/online-users.tsx +2 -2
  117. package/src/palette-generator.test.ts +309 -0
  118. package/src/palette-generator.ts +160 -0
  119. package/src/palettes/_.ts +72 -0
  120. package/src/palettes/slate-arch.colors-snapshot.test.ts +1689 -0
  121. package/src/palettes/slate-arch.ts +188 -0
  122. package/src/palettes/slate-user.colors-snapshot.test.ts +1689 -0
  123. package/src/palettes/slate-user.ts +187 -0
  124. package/src/palettes/warm-arch.colors-snapshot.test.ts +1689 -0
  125. package/src/palettes/warm-arch.ts +222 -0
  126. package/src/palettes/warm-user.colors-snapshot.test.ts +1689 -0
  127. package/src/palettes/warm-user.ts +222 -0
  128. package/src/platform.ts +0 -3
  129. package/src/popover/get-element-ref.ts +28 -0
  130. package/src/popover/index.tsx +236 -339
  131. package/src/popover/{mobile-popup-context.tsx → mobile-popover-context.tsx} +7 -7
  132. package/src/popover/mobile-popover.tsx +169 -0
  133. package/src/popover/modifiers.tsx +2 -2
  134. package/src/popover/popup-stack-context.tsx +8 -9
  135. package/src/progress.tsx +2 -2
  136. package/src/reactions/reaction-button.tsx +12 -6
  137. package/src/root-theme-provider.test.tsx +411 -0
  138. package/src/scale-generator.ts +356 -0
  139. package/src/select/components/menu-list-virtualized.tsx +12 -25
  140. package/src/select/components/menu.tsx +12 -2
  141. package/src/select/index.tsx +6 -5
  142. package/src/select/select.tsx +38 -39
  143. package/src/select/styles.ts +0 -1
  144. package/src/select/util.ts +1 -1
  145. package/src/static-palettes.ts +356 -0
  146. package/src/thematic-color-picker.tsx +266 -0
  147. package/src/thematic-constants.tsx +27 -0
  148. package/src/thematic-controls.tsx +144 -0
  149. package/src/thematic-scales.tsx +122 -0
  150. package/src/thematic-state.ts +370 -0
  151. package/src/thematic.tsx +386 -0
  152. package/src/theme-provider.test.tsx +820 -0
  153. package/src/theme-provider.tsx +158 -92
  154. package/src/theme-settings.ts +67 -12
  155. package/src/theme-styles.ts +58 -6
  156. package/src/toast/toast-action.tsx +1 -1
  157. package/src/toast/toast.tsx +1 -2
  158. package/src/toggle-on-off.tsx +2 -2
  159. package/src/toggle.tsx +7 -8
  160. package/src/tooltip.tsx +14 -10
  161. package/src/type-badge.tsx +7 -14
  162. package/src/unit/styles.ts +2 -25
  163. package/src/unit/unit-with-tooltip.tsx +3 -2
  164. package/src/use-is-phone.tsx +7 -2
  165. package/src/use-long-press.tsx +2 -2
  166. package/src/use-on-screen-keyboard-data.tsx +2 -2
  167. package/src/with-data.tsx +4 -3
  168. package/src/workflow-progress-icon.tsx +2 -2
  169. package/.eslintignore +0 -3
  170. package/.eslintrc +0 -14
  171. package/src/__mocks__/createInlineTheme.js +0 -3
  172. package/src/create-inline-theme.ts +0 -66
  173. package/src/number-input/index.js +0 -191
  174. package/src/palette.ts +0 -237
@@ -0,0 +1,3 @@
1
+ export const dateFormat = "MMM D, YYYY";
2
+ export const dateTimeFormat = "MMM D, YYYY HH:mm";
3
+ export const timeFormat = "HH:mm";
@@ -0,0 +1,106 @@
1
+ export const iconSize = 20;
2
+ export const viewBoxSize = "0 0 20 20";
3
+
4
+ export const minPanelWidth = 490;
5
+
6
+ /** Token for nested items spacing in nested trees */
7
+ export const spaceNestedTreeLevel = 12;
8
+ export const spaceNestedTreeInterval = 0;
9
+
10
+ export const space = {
11
+ spaceAuto: "auto",
12
+ s0: 0,
13
+ s1: 1,
14
+ s2: 2,
15
+ s3: 3,
16
+ s4: 4,
17
+ s5: 5,
18
+ s6: 6,
19
+ s8: 8,
20
+ s10: 10,
21
+ s12: 12,
22
+ s14: 14,
23
+ s16: 16,
24
+ s18: 18,
25
+ s20: 20,
26
+ s24: 24,
27
+ s28: 28,
28
+ s32: 32,
29
+ s36: 36,
30
+ s40: 40,
31
+ s44: 44,
32
+ s48: 48,
33
+ s56: 56,
34
+ s60: 60,
35
+ s64: 64,
36
+ s80: 80,
37
+ s96: 96,
38
+ s112: 112,
39
+ s128: 128,
40
+ } as const;
41
+
42
+ export const layout = {
43
+ logoSize: 18,
44
+ menuDefaultWidth: 243,
45
+ fiberyAiSidebarDefaultWidth: 420,
46
+ fiberyAiSidebarMaxWidth: 920,
47
+ desktopToolbarHeight: 32,
48
+ desktopMenuMinWidth: 240,
49
+ collapsedMenuMinWidth: 47,
50
+ menuMinWidth: 284,
51
+ menuMaxWidth: 480,
52
+ menuItemMinWidth: 80,
53
+ menuGroupHeaderIndent: 28, // I'm ok
54
+ menuItemLevelIndent: 24,
55
+ listItemHeight: 38,
56
+ mobileListItemHeight: 44,
57
+ itemHeight: 36,
58
+ itemWithSubtitleHeight: 52,
59
+ groupTitleHeight: 30,
60
+ enumItemHeight: 32,
61
+ menuItemHeight: 32,
62
+ mobileMenuItemHeight: 44,
63
+ newMenuItemHeight: 28, // I'm ok
64
+ mobileSidebarMenuItemHeight: 44,
65
+ newMenuIconSize: 18,
66
+ mobileSidebarIconSize: 20,
67
+ viewHeaderHeight: space.s12 * 7,
68
+ viewHeaderCompactHeight: 52,
69
+ columnMinWidth: 240,
70
+ columnWidths: {compact: 200, default: 240, list: 280, full: 320},
71
+ objectEditorMinWidth: 480,
72
+ typeEditorWidth: "30vw",
73
+ typeEditorMinWidth: 480,
74
+ viewSetupWidth: "30vw",
75
+ viewSetupMinWidth: 380,
76
+ inputHeight: 36, //TODO: merge input and item height?
77
+ timelineToolbarHeight: 48,
78
+ timelineLineHeight: 40,
79
+ timelineItemHeight: 32,
80
+ timelineGroupPadding: 0,
81
+ timelineHeaderHeight: 48,
82
+ calendarEventHeight: 30,
83
+ calendarHeaderHeight: 30,
84
+ calendarToolbarHeight: 48,
85
+ checkboxSize: 15,
86
+ fakeBoardWidth: 260,
87
+ fakeBoardHeight: 160,
88
+ inlineInputHeight: 32,
89
+ menuHeight: 32,
90
+ popupTopMargin: 48,
91
+ unitHeight: 18,
92
+ } as const;
93
+
94
+ export const border = {
95
+ radius0: 0,
96
+ radius1: 1,
97
+ radius2: 2,
98
+ radius4: 4,
99
+ radius5: 5,
100
+ radius6: 6,
101
+ radius8: 8,
102
+ radius10: 10,
103
+ radius12: 12,
104
+ radius16: 16,
105
+ radius9999: 9999,
106
+ } as const;
@@ -0,0 +1,94 @@
1
+ import {createInlineStyles, getThemeColors, makeThemeApi, ThemeColors} from "./theme";
2
+ import {ThemePalette} from "../palette-generator";
3
+ import {ThemeDefs} from "./colors";
4
+ import {ThemeMode, themeModes} from "../theme-settings";
5
+ import {typedObjectEntries} from "@fibery/helpers/utils/object";
6
+
7
+ describe("select", () => {
8
+ function makeSelect(mode: ThemeMode) {
9
+ return makeThemeApi({key: "smth"} as ThemePalette, {fns: {}} as ThemeDefs, mode).select;
10
+ }
11
+
12
+ test("light theme", () => {
13
+ expect(
14
+ makeSelect("light")({light: "light-value", light2: "light2-value", dark: "dark-value"})
15
+ ).toMatchInlineSnapshot(`"light-value"`);
16
+ });
17
+
18
+ test("dark theme", () => {
19
+ expect(
20
+ makeSelect("dark")({light: "light-value", light2: "light2-value", dark: "dark-value"})
21
+ ).toMatchInlineSnapshot(`"dark-value"`);
22
+ });
23
+
24
+ test("light2 theme", () => {
25
+ expect(
26
+ makeSelect("dark")({light: "light-value", light2: "light2-value", dark: "dark-value"})
27
+ ).toMatchInlineSnapshot(`"dark-value"`);
28
+ });
29
+
30
+ test("light2 theme falls back to light when key is not defined", () => {
31
+ expect(makeSelect("light2")({light: "fallback", dark: "dark"})).toMatchInlineSnapshot(`"fallback"`);
32
+ });
33
+ });
34
+
35
+ test("getThemeColors memoization", () => {
36
+ function getKeys(colors: ThemeColors) {
37
+ const keys = [];
38
+ for (const [key, value] of typedObjectEntries(colors)) {
39
+ // LINT.IfChange("skipMetaKeys")
40
+ if (key === "key" || key === "fns" || key === "select") {
41
+ // LINT.ThenChange(["./theme.ts#skipMetaKeys", "./vars.ts#skipMetaKeys")
42
+ continue;
43
+ }
44
+ if (typeof value === "string") {
45
+ keys.push(key);
46
+ } else {
47
+ const nestedKeys: Record<string, string[]> = {[key]: []};
48
+ for (const [nestedKey] of typedObjectEntries(value)) {
49
+ nestedKeys[key].push(nestedKey);
50
+ }
51
+ keys.push(nestedKeys);
52
+ }
53
+ }
54
+ return keys.sort();
55
+ }
56
+
57
+ const themes = themeModes.map((mode) => getThemeColors(null, mode));
58
+
59
+ // same input → same reference
60
+ themeModes.forEach((mode, i) => {
61
+ expect(getThemeColors(null, mode)).toBe(themes[i]);
62
+ });
63
+
64
+ // different modes → different references
65
+ expect(new Set(themes)).toMatchObject({size: themeModes.length});
66
+
67
+ // different modes → same keys
68
+ expect(new Set(themes.map((theme) => getKeys(theme).join(",")))).toMatchObject({size: 1});
69
+ });
70
+
71
+ describe("createInlineStyles", () => {
72
+ it("maps provided theme to css props", () => {
73
+ const theme = {
74
+ key: "key",
75
+ mode: "light2",
76
+ fns: {getIconColor: (_: string) => "IconColor"} satisfies Partial<ThemeColors["fns"]> as ThemeColors["fns"],
77
+ lights: {opacity5: "light5"} as ThemeColors["lights"],
78
+ shades: {opacity5: "shade5"} as ThemeColors["shades"],
79
+ separators: {opacity5: "separator5"} as ThemeColors["separators"],
80
+ transparent: "rgba(255, 255, 255, 0)",
81
+ colorAI: "rgb(157, 99, 212)",
82
+ } satisfies Partial<ThemeColors> as ThemeColors;
83
+ expect(createInlineStyles(theme)).toMatchInlineSnapshot(`
84
+ {
85
+ "--fibery-color-colorAI": "rgb(157, 99, 212)",
86
+ "--fibery-color-mode": "light2",
87
+ "--fibery-color-transparent": "rgba(255, 255, 255, 0)",
88
+ "--fibery-lights-opacity5": "light5",
89
+ "--fibery-separator-opacity5": "separator5",
90
+ "--fibery-shades-opacity5": "shade5",
91
+ }
92
+ `);
93
+ });
94
+ });
@@ -0,0 +1,93 @@
1
+ import {Colors, makeThemeDefs, pickColors, pickFns, ThemeDefs} from "./colors";
2
+ import {getTypeColors, TypeColors} from "./colors-js";
3
+ import {ThemeMode} from "../theme-settings";
4
+ import {defaultPaletteKey, makeDefaultPalette, ThemePalette} from "../palette-generator";
5
+ import memoize from "lodash/memoize";
6
+ import {makeThemeVars, varPrefix} from "./vars";
7
+ import {typedObjectEntries} from "@fibery/helpers/utils/object";
8
+
9
+ export function makeThemeApi(palette: ThemePalette, defs: ThemeDefs, mode: ThemeMode) {
10
+ return {
11
+ key: `${palette.key}-${mode}`,
12
+ fns: pickFns(defs.fns, mode),
13
+ select<T>(values: {light: T; light2?: T; dark: T}): T {
14
+ if (mode in values) {
15
+ return values[mode]!;
16
+ }
17
+ return values.light;
18
+ },
19
+ };
20
+ }
21
+
22
+ type ThemeApi = ReturnType<typeof makeThemeApi>;
23
+
24
+ // TODO rename into Theme
25
+ export type ThemeColors = ThemeApi & TypeColors & Colors;
26
+
27
+ /**
28
+ * @deprecated do NOT add new consumers in production code.
29
+ * Your helpers from now on are:
30
+ * themeVars (for CSS statics) and
31
+ * useTheme() (for dynamic calculations in js, for canvas)
32
+ */
33
+ export const getThemeColors = memoize(
34
+ (_: string | null, mode: ThemeMode, palette: ThemePalette = makeDefaultPalette()): ThemeColors => {
35
+ const defs = makeThemeDefs(palette);
36
+
37
+ return {
38
+ ...makeThemeApi(palette, defs, mode),
39
+ ...getTypeColors(palette.accent[9], mode),
40
+ ...pickColors(defs, mode),
41
+ };
42
+ },
43
+ (_, mode, palette) => `${palette?.key ?? defaultPaletteKey}-${mode}`
44
+ );
45
+
46
+ export const themeVars = makeThemeVars(getThemeColors(null, "light"));
47
+
48
+ export type ThemeStyles = Record<string, string>;
49
+
50
+ function createInlineStylesImpl(themes: ThemeColors): ThemeStyles {
51
+ return typedObjectEntries(themes).reduce<ThemeStyles>((inlineTheme, [key, value]) => {
52
+ // LINT.IfChange("skipMetaKeys")
53
+ if (key === "key" || key === "fns" || key === "select") {
54
+ // LINT.ThenChange(["./vars.ts#skipMetaKeys", "./theme.test.ts#skipMetaKeys"])
55
+ return inlineTheme;
56
+ }
57
+ if (key === "opacity") {
58
+ Object.entries(themes.opacity as Record<string, string>).forEach(([opacityKey, opacityValue]) => {
59
+ inlineTheme[`--${varPrefix}-opacity-${opacityKey}`] = opacityValue;
60
+ }, "");
61
+
62
+ return inlineTheme;
63
+ }
64
+ if (key === "shades") {
65
+ Object.entries(themes.shades as Record<string, string>).forEach(([shadeKey, shadeValue]) => {
66
+ inlineTheme[`--${varPrefix}-shades-${shadeKey}`] = shadeValue;
67
+ }, "");
68
+
69
+ return inlineTheme;
70
+ }
71
+ if (key === "lights") {
72
+ Object.entries(themes.lights as Record<string, string>).forEach(([lightKey, lightValue]) => {
73
+ inlineTheme[`--${varPrefix}-lights-${lightKey}`] = lightValue;
74
+ }, "");
75
+
76
+ return inlineTheme;
77
+ }
78
+ if (key === "separators") {
79
+ Object.entries(themes.separators as Record<string, string>).forEach(([separatorKey, separatorValue]) => {
80
+ inlineTheme[`--${varPrefix}-separator-${separatorKey}`] = separatorValue;
81
+ }, "");
82
+
83
+ return inlineTheme;
84
+ }
85
+ inlineTheme[`--${varPrefix}-color-${key}`] = value;
86
+ return inlineTheme;
87
+ }, {});
88
+ }
89
+
90
+ export const createInlineStyles = memoize(
91
+ (theme: ThemeColors) => createInlineStylesImpl(theme),
92
+ (theme) => theme.key
93
+ );
@@ -0,0 +1,179 @@
1
+ import {themeVars} from "./theme";
2
+ import {transition} from "./animation";
3
+ import {border} from "./layout";
4
+
5
+ export const lineHeight = {
6
+ text: 1.6,
7
+ regular: 1.5,
8
+ narrow: 1.4,
9
+ heading: 1.3,
10
+ nowrap: 1,
11
+ } as const;
12
+
13
+ export const typeSizes = [30, 24, 18, 16, 14, 12, 10, 8] as const;
14
+
15
+ // 300 basic, 310 experiment with a variable Inter
16
+ export const fontSize = {
17
+ xxl: 30,
18
+ xl: 24,
19
+ lg: 18,
20
+ md: 16,
21
+ sm: 15,
22
+ xs: 14,
23
+ xxs: 13,
24
+ xxxs: 12,
25
+ tiny: 11,
26
+ mini: 10,
27
+ micro: 9,
28
+ nano: 8,
29
+ } as const;
30
+
31
+ export const fontFamily =
32
+ '"Inter Variable", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif';
33
+
34
+ export const fontWeight = {
35
+ light: 310, // 300 basic, 310 experiment with a variable Inter
36
+ regular: 410, // 400 basic, 410 experiment with a variable Inter
37
+ mediumLight: 450,
38
+ medium: 500,
39
+ semibold: 600,
40
+ bold: 700,
41
+ } as const;
42
+
43
+ export const textStyles = {
44
+ heading1: {
45
+ fontFamily,
46
+ fontSize: typeSizes[0],
47
+ letterSpacing: "-0.01em",
48
+ lineHeight: lineHeight.heading,
49
+ fontWeight: fontWeight.semibold,
50
+ color: themeVars.textColor,
51
+ },
52
+ heading2: {
53
+ fontFamily,
54
+ fontSize: typeSizes[1],
55
+ letterSpacing: "-0.002em",
56
+ lineHeight: lineHeight.heading,
57
+ fontWeight: fontWeight.semibold,
58
+ color: themeVars.textColor,
59
+ },
60
+ heading3: {
61
+ fontFamily,
62
+ fontSize: typeSizes[2],
63
+ letterSpacing: "-0.002em",
64
+ lineHeight: lineHeight.heading,
65
+ fontWeight: fontWeight.semibold,
66
+ color: themeVars.textColor,
67
+ },
68
+ heading4: {
69
+ fontFamily,
70
+ fontSize: typeSizes[3],
71
+ lineHeight: lineHeight.heading,
72
+ fontWeight: fontWeight.semibold,
73
+ color: themeVars.textColor,
74
+ },
75
+ heading5: {
76
+ fontFamily,
77
+ fontSize: typeSizes[4],
78
+ lineHeight: lineHeight.heading,
79
+ fontWeight: fontWeight.semibold,
80
+ color: themeVars.textColor,
81
+ },
82
+ heading6: {
83
+ fontFamily,
84
+ fontSize: typeSizes[5],
85
+ lineHeight: lineHeight.heading,
86
+ letterSpacing: 0.6,
87
+ textTransform: "uppercase",
88
+ fontWeight: fontWeight.regular,
89
+ color: themeVars.textColor,
90
+ },
91
+ heading7: {
92
+ fontFamily,
93
+ fontSize: typeSizes[6],
94
+ lineHeight: lineHeight.heading,
95
+ letterSpacing: 0.6,
96
+ textTransform: "uppercase",
97
+ fontWeight: fontWeight.regular,
98
+ color: themeVars.textColor,
99
+ },
100
+ heading8: {
101
+ fontFamily,
102
+ fontSize: typeSizes[6],
103
+ lineHeight: lineHeight.heading,
104
+ fontWeight: fontWeight.medium,
105
+ color: themeVars.textColor,
106
+ },
107
+ big: {
108
+ fontFamily,
109
+ fontSize: typeSizes[3],
110
+ lineHeight: lineHeight.regular,
111
+ fontWeight: fontWeight.regular,
112
+ color: themeVars.textColor,
113
+ },
114
+ regular: {
115
+ fontFamily,
116
+ fontSize: typeSizes[4],
117
+ lineHeight: lineHeight.regular,
118
+ fontWeight: fontWeight.regular,
119
+ color: themeVars.textColor,
120
+ textTransform: "none",
121
+ letterSpacing: "normal",
122
+ },
123
+ small: {
124
+ fontFamily,
125
+ fontSize: typeSizes[5],
126
+ lineHeight: lineHeight.regular,
127
+ fontWeight: fontWeight.regular,
128
+ color: themeVars.textColor,
129
+ textTransform: "none",
130
+ },
131
+ code: {
132
+ fontFamily: '"SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace',
133
+ fontSize: typeSizes[4],
134
+ lineHeight: lineHeight.regular,
135
+ fontWeight: fontWeight.regular,
136
+ color: themeVars.textColor,
137
+ },
138
+ link: {
139
+ color: themeVars.linkColor,
140
+ borderBottom: themeVars.linkBorder,
141
+ textDecoration: "none",
142
+ cursor: "pointer",
143
+ transition: `border ${transition}`,
144
+ },
145
+ note: {
146
+ fontFamily,
147
+ fontSize: typeSizes[3],
148
+ lineHeight: lineHeight.regular,
149
+ fontWeight: fontWeight.regular,
150
+ color: themeVars.textColor,
151
+ borderRadius: border.radius6,
152
+ },
153
+ important: {
154
+ fontFamily,
155
+ fontSize: typeSizes[3],
156
+ lineHeight: lineHeight.regular,
157
+ fontWeight: fontWeight.regular,
158
+ color: themeVars.textColor,
159
+ border: `1px solid ${themeVars.active}`,
160
+ borderRadius: border.radius6,
161
+ },
162
+ numeric: {
163
+ tabularOn: {
164
+ fontVariantNumeric: "tabular-nums",
165
+ fontFeatureSettings: '"tnum" 1',
166
+ },
167
+ tabularOff: {
168
+ fontVariantNumeric: "normal",
169
+ fontFeatureSettings: '"tnum" 0',
170
+ },
171
+ },
172
+ inherit: {
173
+ fontFamily: "inherit",
174
+ fontSize: "inherit",
175
+ lineHeight: "inherit",
176
+ fontWeight: "inherit",
177
+ color: "inherit",
178
+ },
179
+ } as const;