@apify/ui-library 0.71.1-featcolortokens-178953.56 → 0.71.1-featcolortokens-178953.63

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 (134) hide show
  1. package/dist/src/design_system/colors/generated/{dark.d.ts → css_variables.dark.d.ts} +1 -1
  2. package/dist/src/design_system/colors/generated/css_variables.dark.d.ts.map +1 -0
  3. package/dist/src/design_system/colors/generated/{dark.js → css_variables.dark.js} +1 -1
  4. package/dist/src/design_system/colors/generated/css_variables.dark.js.map +1 -0
  5. package/dist/src/design_system/colors/generated/{light.d.ts → css_variables.light.d.ts} +1 -1
  6. package/dist/src/design_system/colors/generated/css_variables.light.d.ts.map +1 -0
  7. package/{src/design_system/colors/generated/light.ts → dist/src/design_system/colors/generated/css_variables.light.js} +1 -1
  8. package/dist/src/design_system/colors/generated/css_variables.light.js.map +1 -0
  9. package/dist/src/design_system/colors/generated/{palette.dark.d.ts → css_variables_palette.dark.d.ts} +1 -1
  10. package/dist/src/design_system/colors/generated/css_variables_palette.dark.d.ts.map +1 -0
  11. package/dist/src/design_system/colors/generated/{palette.dark.js → css_variables_palette.dark.js} +1 -1
  12. package/dist/src/design_system/colors/generated/css_variables_palette.dark.js.map +1 -0
  13. package/dist/src/design_system/colors/generated/{palette.light.d.ts → css_variables_palette.light.d.ts} +1 -1
  14. package/dist/src/design_system/colors/generated/css_variables_palette.light.d.ts.map +1 -0
  15. package/{src/design_system/colors/generated/palette.light.ts → dist/src/design_system/colors/generated/css_variables_palette.light.js} +1 -1
  16. package/dist/src/design_system/colors/generated/css_variables_palette.light.js.map +1 -0
  17. package/dist/src/design_system/colors/index.d.ts +4 -4
  18. package/dist/src/design_system/colors/index.d.ts.map +1 -1
  19. package/dist/src/design_system/colors/index.js +4 -4
  20. package/dist/src/design_system/colors/index.js.map +1 -1
  21. package/dist/tsconfig.build.tsbuildinfo +1 -0
  22. package/package.json +7 -5
  23. package/.stylelintrc +0 -12
  24. package/CHANGELOG.md +0 -3334
  25. package/CODEOWNERS +0 -7
  26. package/dist/src/design_system/colors/generated/dark.d.ts.map +0 -1
  27. package/dist/src/design_system/colors/generated/dark.js.map +0 -1
  28. package/dist/src/design_system/colors/generated/light.d.ts.map +0 -1
  29. package/dist/src/design_system/colors/generated/light.js +0 -147
  30. package/dist/src/design_system/colors/generated/light.js.map +0 -1
  31. package/dist/src/design_system/colors/generated/palette.dark.d.ts.map +0 -1
  32. package/dist/src/design_system/colors/generated/palette.dark.js.map +0 -1
  33. package/dist/src/design_system/colors/generated/palette.light.d.ts.map +0 -1
  34. package/dist/src/design_system/colors/generated/palette.light.js +0 -74
  35. package/dist/src/design_system/colors/generated/palette.light.js.map +0 -1
  36. package/dist/src/design_system/colors_theme.d.ts +0 -213
  37. package/dist/src/design_system/colors_theme.d.ts.map +0 -1
  38. package/dist/src/design_system/colors_theme.js +0 -213
  39. package/dist/src/design_system/colors_theme.js.map +0 -1
  40. package/dist/src/design_system/properties_theme.d.ts +0 -175
  41. package/dist/src/design_system/properties_theme.d.ts.map +0 -1
  42. package/dist/src/design_system/properties_theme.js +0 -315
  43. package/dist/src/design_system/properties_theme.js.map +0 -1
  44. package/eslint.config.mjs +0 -44
  45. package/src/codemods/generate_typograpy_tokens_files.mjs +0 -137
  46. package/src/components/action_link.tsx +0 -60
  47. package/src/components/actor_template_card.tsx +0 -116
  48. package/src/components/badge.tsx +0 -148
  49. package/src/components/banner.tsx +0 -94
  50. package/src/components/blog_article.tsx +0 -85
  51. package/src/components/box.tsx +0 -127
  52. package/src/components/button.tsx +0 -305
  53. package/src/components/chip.tsx +0 -128
  54. package/src/components/code/action_button.tsx +0 -96
  55. package/src/components/code/code_block/code_block.styled.tsx +0 -180
  56. package/src/components/code/code_block/code_block.tsx +0 -224
  57. package/src/components/code/code_block/code_block_with_tabs.tsx +0 -257
  58. package/src/components/code/code_block/utils.tsx +0 -67
  59. package/src/components/code/index.ts +0 -5
  60. package/src/components/code/inline_code/inline_code.tsx +0 -62
  61. package/src/components/code/one_line_code/one_line_code.tsx +0 -228
  62. package/src/components/code/prism_highlighter.tsx +0 -180
  63. package/src/components/color_wheel_gradient.tsx +0 -31
  64. package/src/components/floating/index.ts +0 -3
  65. package/src/components/floating/menu.tsx +0 -189
  66. package/src/components/floating/menu_common.tsx +0 -31
  67. package/src/components/floating/menu_components.tsx +0 -99
  68. package/src/components/image.tsx +0 -24
  69. package/src/components/index.ts +0 -22
  70. package/src/components/link.tsx +0 -114
  71. package/src/components/message.tsx +0 -153
  72. package/src/components/rating.tsx +0 -106
  73. package/src/components/readme_renderer/index.ts +0 -3
  74. package/src/components/readme_renderer/pythonize_value.ts +0 -76
  75. package/src/components/readme_renderer/table_of_contents.tsx +0 -272
  76. package/src/components/readme_renderer/utils.tsx +0 -46
  77. package/src/components/simple_markdown/index.ts +0 -2
  78. package/src/components/simple_markdown/simple_markdown.tsx +0 -214
  79. package/src/components/simple_markdown/simple_markdown_components.tsx +0 -293
  80. package/src/components/tabs/index.ts +0 -2
  81. package/src/components/tabs/tab.tsx +0 -217
  82. package/src/components/tabs/tabs.tsx +0 -169
  83. package/src/components/tag.tsx +0 -196
  84. package/src/components/text/heading_content.tsx +0 -56
  85. package/src/components/text/heading_marketing.tsx +0 -55
  86. package/src/components/text/heading_shared.tsx +0 -55
  87. package/src/components/text/index.ts +0 -19
  88. package/src/components/text/text_base.tsx +0 -52
  89. package/src/components/text/text_content.tsx +0 -104
  90. package/src/components/text/text_marketing.tsx +0 -152
  91. package/src/components/text/text_shared.tsx +0 -95
  92. package/src/components/tile/horizontal_tile.tsx +0 -77
  93. package/src/components/tile/index.ts +0 -2
  94. package/src/components/tile/shared.ts +0 -27
  95. package/src/components/tile/vertical_tile.tsx +0 -59
  96. package/src/components/to_consolidate/card.tsx +0 -141
  97. package/src/components/to_consolidate/index.ts +0 -4
  98. package/src/components/to_consolidate/markdown.tsx +0 -609
  99. package/src/components/to_consolidate/pagination.tsx +0 -136
  100. package/src/components/to_consolidate/tab_number_chip.tsx +0 -31
  101. package/src/design_system/colors/build_color_tokens.js +0 -175
  102. package/src/design_system/colors/figma_color_tokens.dark.json +0 -886
  103. package/src/design_system/colors/figma_color_tokens.light.json +0 -886
  104. package/src/design_system/colors/generated/colors_theme.dark.ts +0 -110
  105. package/src/design_system/colors/generated/colors_theme.light.ts +0 -110
  106. package/src/design_system/colors/generated/dark.ts +0 -147
  107. package/src/design_system/colors/generated/palette.dark.ts +0 -74
  108. package/src/design_system/colors/generated/properties_theme.ts +0 -179
  109. package/src/design_system/colors/index.ts +0 -7
  110. package/src/design_system/colors_theme.ts +0 -213
  111. package/src/design_system/properties_theme.ts +0 -453
  112. package/src/design_system/supernova_typography_tokens.json +0 -657
  113. package/src/design_system/theme.ts +0 -25
  114. package/src/design_system/tokens/index.ts +0 -5
  115. package/src/design_system/tokens/layouts.ts +0 -29
  116. package/src/design_system/tokens/radiuses.ts +0 -22
  117. package/src/design_system/tokens/shadows.ts +0 -22
  118. package/src/design_system/tokens/spaces.ts +0 -15
  119. package/src/design_system/tokens/transitions.ts +0 -19
  120. package/src/design_system/typography_theme.ts +0 -197
  121. package/src/index.ts +0 -8
  122. package/src/type_utils.ts +0 -7
  123. package/src/ui_dependency_provider.tsx +0 -58
  124. package/src/utils/copy_to_clipboard.ts +0 -24
  125. package/src/utils/image_color.ts +0 -42
  126. package/src/utils/index.ts +0 -4
  127. package/src/utils/resize_observer.ts +0 -18
  128. package/src/utils/sanitization.ts +0 -14
  129. package/tsconfig.build.json +0 -17
  130. package/tsconfig.json +0 -10
  131. /package/{src/design_system/colors/generated → style/colors}/dark.scss +0 -0
  132. /package/{src/design_system/colors/generated → style/colors}/light.scss +0 -0
  133. /package/{src/design_system/colors/generated → style/colors}/palette.dark.scss +0 -0
  134. /package/{src/design_system/colors/generated → style/colors}/palette.light.scss +0 -0
@@ -1,29 +0,0 @@
1
- /**
2
- * Layouts (device screen size) tokens - used for media queries.
3
- * Defined in px as we need to know exact size of the screen.
4
- * @typedef {Object} Screen
5
- * @property {'768px'} tablet
6
- * @property {'1024px'} desktop
7
- * @property {'1200px'} mediumDesktop
8
- * @property {'1440px'} largeDesktop
9
- */
10
- /**
11
- * @type {Screen}
12
- * @deprecated - use the 'device' value instead - it includes the `(min-width: xxx)` part
13
- */
14
- export const layouts = {
15
- tablet: '768px',
16
- desktop: '1024px',
17
- mediumDesktop: '1200px',
18
- largeDesktop: '1440px',
19
- } as const;
20
-
21
- /**
22
- * @type {Screen}
23
- */
24
- export const devices = {
25
- tablet: '(min-width: 768px)',
26
- desktop: '(min-width: 1024px)',
27
- mediumDesktop: '(min-width: 1200px)',
28
- largeDesktop: '(min-width: 1440px)',
29
- } as const;
@@ -1,22 +0,0 @@
1
- /**
2
- * Radius tokens - used for border radius.
3
- * Needs to be defined in px as we don't want to scale it with font size.
4
- * @typedef {Object} Radius
5
- * @property {'4px'} radius4
6
- * @property {'6px'} radius6
7
- * @property {'8px'} radius8
8
- * @property {'12px'} radius12
9
- * @property {'16px'} radius16
10
- */
11
- /**
12
- * @type {Radius}
13
- */
14
- export const radiuses = {
15
- radius4: '4px',
16
- radius6: '6px',
17
- radius8: '8px',
18
- radius12: '12px',
19
- radius16: '16px',
20
- radius20: '20px',
21
- radiusFull: '100px',
22
- };
@@ -1,22 +0,0 @@
1
- /**
2
- * Shadow tokens - used box-shadow.
3
- *
4
- * @typedef {Object} Shadow
5
- * @property {string} shadowActive - active shadow.
6
- * @property {string} shadow1 - shadow 1.
7
- * @property {string} shadow2 - shadow 2.
8
- * @property {string} shadow3 - shadow 3.
9
- * @property {string} shadow4 - shadow 4.
10
- * @property {string} shadow5 - shadow 5.
11
- */
12
- /**
13
- * @type {Shadow}
14
- */
15
- export const shadows = {
16
- shadowActive: 'var(--shadow-active)',
17
- shadow1: 'var(--shadow-1)',
18
- shadow2: 'var(--shadow-2)',
19
- shadow3: 'var(--shadow-3)',
20
- shadow4: 'var(--shadow-4)',
21
- shadow5: 'var(--shadow-5)',
22
- };
@@ -1,15 +0,0 @@
1
- export const spaces = {
2
- space2: '0.2rem',
3
- space4: '0.4rem',
4
- space6: '0.6rem',
5
- space8: '0.8rem',
6
- space10: '1rem',
7
- space12: '1.2rem',
8
- space16: '1.6rem',
9
- space24: '2.4rem',
10
- space32: '3.2rem',
11
- space40: '4rem',
12
- space80: '8rem',
13
- } as const;
14
-
15
- export type Size = keyof typeof spaces;
@@ -1,19 +0,0 @@
1
- /**
2
- * Transitions tokens - used for smooth state change.
3
- * @typedef {Object} Transitions
4
- * @property {'0.3s ease-in'} smoothEaseIn
5
- * @property {'0.3s ease-out'} smoothEaseOut
6
- * @property {'0.12s ease-out'} fastEaseOut
7
- * @property {'0.12s ease-in'} fastEaseIn
8
- * @property {'0.12s ease-in-out'} fastEaseInOut
9
- */
10
- /**
11
- * @type {Transitions}
12
- */
13
- export const transitions = {
14
- smoothEaseIn: '0.3s ease-in',
15
- smoothEaseOut: '0.3s ease-out',
16
- fastEaseIn: '0.12s ease-in',
17
- fastEaseOut: '0.12s ease-out',
18
- fastEaseInOut: '0.12s ease-in-out',
19
- };
@@ -1,197 +0,0 @@
1
- /* eslint-disable max-len */
2
- export const typographyTokens = {
3
- shared: {
4
- mobile: {
5
- title3xl: 'font-size: 2.8rem; line-height: 3.2rem; font-weight: 700; font-family: Inter, sans-serif;',
6
- title2xl: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
7
- titleXl: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
8
- titleL: 'font-size: 1.8rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
9
- titleM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
10
- titleS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 650; font-family: Inter, sans-serif;',
11
- titleXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 650; font-family: Inter, sans-serif;',
12
- bodyL: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
13
- bodyLMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
14
- bodyLStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: Inter, sans-serif;',
15
- bodyM: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
16
- bodyMMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
17
- bodyMStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: Inter, sans-serif;',
18
- bodyS: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
19
- bodySMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
20
- bodySStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: Inter, sans-serif;',
21
- codeL: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
22
- codeLMedium: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
23
- codeLStrong: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
24
- codeM: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
25
- codeMMedium: "font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
26
- codeMStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
27
- codeS: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
28
- codeSMedium: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
29
- codeSStrong: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
30
- },
31
-
32
- tablet: {
33
- title3xl: 'font-size: 3.6rem; line-height: 4.4rem; font-weight: 700; font-family: Inter, sans-serif;',
34
- title2xl: 'font-size: 2.8rem; line-height: 3.2rem; font-weight: 700; font-family: Inter, sans-serif;',
35
- titleXl: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
36
- titleL: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
37
- titleM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
38
- titleS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 650; font-family: Inter, sans-serif;',
39
- titleXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 650; font-family: Inter, sans-serif;',
40
- bodyL: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
41
- bodyLMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
42
- bodyLStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: Inter, sans-serif;',
43
- bodyM: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
44
- bodyMMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
45
- bodyMStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: Inter, sans-serif;',
46
- bodyS: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
47
- bodySMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
48
- bodySStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: Inter, sans-serif;',
49
- codeL: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
50
- codeLMedium: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
51
- codeLStrong: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
52
- codeM: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
53
- codeMMedium: "font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
54
- codeMStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
55
- codeS: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
56
- codeSMedium: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
57
- codeSStrong: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
58
- },
59
-
60
- desktop: {
61
- title3xl: 'font-size: 3.6rem; line-height: 4.4rem; font-weight: 700; font-family: Inter, sans-serif;',
62
- title2xl: 'font-size: 2.8rem; line-height: 3.2rem; font-weight: 700; font-family: Inter, sans-serif;',
63
- titleXl: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
64
- titleL: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
65
- titleM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
66
- titleS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 650; font-family: Inter, sans-serif;',
67
- titleXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 650; font-family: Inter, sans-serif;',
68
- bodyL: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
69
- bodyLMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
70
- bodyLStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: Inter, sans-serif;',
71
- bodyM: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
72
- bodyMMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
73
- bodyMStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: Inter, sans-serif;',
74
- bodyS: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
75
- bodySMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
76
- bodySStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: Inter, sans-serif;',
77
- codeL: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
78
- codeLMedium: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
79
- codeLStrong: "font-size: 1.6rem; line-height: 2.4rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
80
- codeM: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
81
- codeMMedium: "font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
82
- codeMStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
83
- codeS: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
84
- codeSMedium: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
85
- codeSStrong: "font-size: 1.2rem; line-height: 1.6rem; font-weight: 600; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
86
- },
87
- },
88
-
89
- marketing: {
90
- mobile: {
91
- title3xl: "font-size: 5.2rem; line-height: 6rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
92
- title2xl: "font-size: 3.6rem; line-height: 4.6rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
93
- titleXl: "font-size: 3.2rem; line-height: 4.2rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
94
- titleL: "font-size: 2.8rem; line-height: 3.6rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
95
- titleM: "font-size: 2.4rem; line-height: 3.2rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
96
- titleS: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
97
- titleXs: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
98
- bodyL: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 400; font-family: Inter, sans-serif;',
99
- bodyLMedium: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 500; font-family: Inter, sans-serif;',
100
- bodyLStrong: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
101
- bodyM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
102
- bodyMMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
103
- bodyMStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
104
- bodyS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
105
- bodySMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
106
- bodySStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
107
- bodyXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
108
- bodyXsMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
109
- bodyXsStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
110
- },
111
-
112
- tablet: {
113
- title3xl: "font-size: 6.6rem; line-height: 7.6rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
114
- title2xl: "font-size: 4.8rem; line-height: 5.8rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
115
- titleXl: "font-size: 4.4rem; line-height: 5.4rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
116
- titleL: "font-size: 3.2rem; line-height: 4.2rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
117
- titleM: "font-size: 2.6rem; line-height: 3rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
118
- titleS: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
119
- titleXs: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
120
- bodyL: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 400; font-family: Inter, sans-serif;',
121
- bodyLMedium: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 500; font-family: Inter, sans-serif;',
122
- bodyLStrong: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
123
- bodyM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
124
- bodyMMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
125
- bodyMStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
126
- bodyS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
127
- bodySMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
128
- bodySStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
129
- bodyXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
130
- bodyXsMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
131
- bodyXsStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
132
- },
133
-
134
- desktop: {
135
- title3xl: "font-size: 7.2rem; line-height: 8.2rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
136
- title2xl: "font-size: 5.8rem; line-height: 6.8rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
137
- titleXl: "font-size: 4.8rem; line-height: 5.8rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
138
- titleL: "font-size: 4rem; line-height: 5rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
139
- titleM: "font-size: 2.6rem; line-height: 3.4rem; font-weight: 400; font-family: 'GT-Walsheim-Regular', sans-serif;",
140
- titleS: 'font-size: 2rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
141
- titleXs: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 650; font-family: Inter, sans-serif;',
142
- bodyL: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 400; font-family: Inter, sans-serif;',
143
- bodyLMedium: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 500; font-family: Inter, sans-serif;',
144
- bodyLStrong: 'font-size: 1.8rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
145
- bodyM: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
146
- bodyMMedium: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 500; font-family: Inter, sans-serif;',
147
- bodyMStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
148
- bodyS: 'font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: Inter, sans-serif;',
149
- bodySMedium: 'font-size: 1.4rem; line-height: 2rem; font-weight: 500; font-family: Inter, sans-serif;',
150
- bodySStrong: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
151
- bodyXs: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 400; font-family: Inter, sans-serif;',
152
- bodyXsMedium: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 500; font-family: Inter, sans-serif;',
153
- bodyXsStrong: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
154
- },
155
- },
156
-
157
- content: {
158
- mobile: {
159
- heading1: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
160
- heading2: 'font-size: 2rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
161
- heading3: 'font-size: 1.8rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
162
- heading4: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
163
- heading5: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
164
- heading6: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
165
- paragraph: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
166
- paragraphStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
167
- snippet: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
168
- snippetStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
169
- },
170
-
171
- tablet: {
172
- heading1: 'font-size: 3.2rem; line-height: 4rem; font-weight: 700; font-family: Inter, sans-serif;',
173
- heading2: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
174
- heading3: 'font-size: 2rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
175
- heading4: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
176
- heading5: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
177
- heading6: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
178
- paragraph: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
179
- paragraphStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
180
- snippet: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
181
- snippetStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
182
- },
183
-
184
- desktop: {
185
- heading1: 'font-size: 3.2rem; line-height: 4rem; font-weight: 700; font-family: Inter, sans-serif;',
186
- heading2: 'font-size: 2.4rem; line-height: 2.8rem; font-weight: 700; font-family: Inter, sans-serif;',
187
- heading3: 'font-size: 2rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
188
- heading4: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
189
- heading5: 'font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: Inter, sans-serif;',
190
- heading6: 'font-size: 1.2rem; line-height: 1.6rem; font-weight: 700; font-family: Inter, sans-serif;',
191
- paragraph: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 400; font-family: Inter, sans-serif;',
192
- paragraphStrong: 'font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; font-family: Inter, sans-serif;',
193
- snippet: "font-size: 1.4rem; line-height: 2rem; font-weight: 400; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
194
- snippetStrong: "font-size: 1.4rem; line-height: 2rem; font-weight: 700; font-family: 'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace;",
195
- },
196
- },
197
- } as const;
package/src/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './components/index.js';
2
- export * from './utils/index.js';
3
- export * from './design_system/tokens/index.js';
4
- export * from './design_system/theme.js';
5
- export * from './ui_dependency_provider.js';
6
- export * from './design_system/colors/index.js';
7
-
8
- export * from './type_utils.js';
package/src/type_utils.ts DELETED
@@ -1,7 +0,0 @@
1
- // This utility will add $ at the beginning of the each interface prop
2
- // We do that in order to tell styled component to not propagate the given prop down to the dom element
3
- // It's called transient props (https://styled-components.com/docs/api#transient-props)
4
- export type WithTransientProps<T> = { [P in keyof T & string as `$${P}`]: T[P] };
5
-
6
- export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>
7
- export type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
@@ -1,58 +0,0 @@
1
- import React, { createContext, useContext } from 'react';
2
-
3
- import type { UiThemeOption } from './design_system/theme.js';
4
-
5
- export interface AgnosticInternalLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
6
- // Here we should add special props that are supported by all Link implementation we use (react-router on console & next.js on web)
7
- // The name or api could differ though - but as long as the functionality is supported we are good to go.
8
- // For example: to is not supported by next.js link but it can be easily mapped. Other example is state which is not supported by next.js
9
- replace?: boolean;
10
- href: string;
11
- }
12
-
13
- export type ImageProxyOptions = {
14
- extension?: string,
15
- resize?: {
16
- width?: number,
17
- height?: number,
18
- }
19
- }
20
-
21
- export interface UiDependencies {
22
- InternalLink: React.ForwardRefExoticComponent<AgnosticInternalLinkProps & React.RefAttributes<HTMLAnchorElement>>,
23
- InternalImage: React.ForwardRefExoticComponent<React.RefAttributes<HTMLImageElement>>,
24
- // We want to use Button from 'ui-components' directly in console before reexport doesn't preserve the typing
25
- // Once console button is in ts, we can just define tracking logic there.
26
- trackClick?: (id: string, data?: object) => void,
27
- // We need to pass the current host from outside to be able to seamlessly use Links with next SSR
28
- windowLocationHost: string,
29
- // whether the href is trusted depends on setting (web/console location)
30
- isHrefTrusted: (href: string) => boolean,
31
- uiTheme?: UiThemeOption, // Optional - as we can just fallback to light theme on the web
32
- // TODO: Make required once we add it on the web
33
- generateProxyImageUrl?: (url: string, options: ImageProxyOptions) => string
34
- }
35
-
36
- interface UiDependencyProviderProps {
37
- children: React.ReactNode,
38
- dependencies: UiDependencies
39
- }
40
-
41
- const DependencyProviderContext = createContext<UiDependencies | null>(null);
42
-
43
- export const useSharedUiDependencies = () => {
44
- const uiDependencies = useContext(DependencyProviderContext);
45
- if (!uiDependencies) throw new Error('Application must be wrapped by UiDependencyProvider');
46
- return uiDependencies;
47
- };
48
-
49
- export const UiDependencyProvider: React.FC<UiDependencyProviderProps> = ({
50
- children,
51
- dependencies,
52
- }) => {
53
- return (
54
- <DependencyProviderContext.Provider value={dependencies}>
55
- {children}
56
- </DependencyProviderContext.Provider>
57
- );
58
- };
@@ -1,24 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
-
3
- interface UseCopyToClipboardProps {
4
- text: string;
5
- transform?: (text: string) => string;
6
- }
7
-
8
- export const useCopyToClipboard = ({ text, transform }: UseCopyToClipboardProps): [boolean, () => void] => {
9
- const [toCopy, setToCopy] = useState(text);
10
- const [isCopied, setCopied] = useState(false);
11
-
12
- const handleClick = async () => {
13
- await navigator.clipboard.writeText(toCopy);
14
- setCopied(true);
15
- setTimeout(() => setCopied(false), 1000);
16
- };
17
-
18
- // Need the useEffect because of SSR on web
19
- useEffect(() => {
20
- setToCopy(transform ? transform(text) : text);
21
- }, [text, transform]);
22
-
23
- return [isCopied, handleClick];
24
- };
@@ -1,42 +0,0 @@
1
- import type { FastAverageColorResult } from 'fast-average-color';
2
- import { FastAverageColor } from 'fast-average-color';
3
- import type { RefCallback } from 'react';
4
- import { useCallback, useState } from 'react';
5
-
6
- // Uses Luma (Y component of YIQ) computed from RGB to determine whether the color is dark.
7
- // See https://en.wikipedia.org/wiki/YIQ
8
- const isDark = (rgb: number[]): boolean => {
9
- const y = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
10
- return y < 200;
11
- };
12
-
13
- // The method used by the fast-average-color library to determine darkness does not fit our needs.
14
- const patchDarknessInfo = (color: FastAverageColorResult): FastAverageColorResult => ({
15
- ...color,
16
- isDark: isDark(color.value),
17
- isLight: !isDark(color.value),
18
- });
19
-
20
- const fac = new FastAverageColor();
21
-
22
- export const useImageColor = () => {
23
- const [color, setColor] = useState<FastAverageColorResult>();
24
-
25
- const refCallback = useCallback<RefCallback<HTMLImageElement>>((element) => {
26
- const updateColor = async () => {
27
- if (!element) {
28
- return;
29
- }
30
-
31
- try {
32
- setColor(patchDarknessInfo(await fac.getColorAsync(element)));
33
- } catch (error) {
34
- console.error('Failed to determine the image color.', { error });
35
- }
36
- };
37
-
38
- void updateColor();
39
- }, []);
40
-
41
- return { color, refCallback };
42
- };
@@ -1,4 +0,0 @@
1
- export * from './copy_to_clipboard.js';
2
- export * from './sanitization.js';
3
- export * from './image_color.js';
4
- export * from './resize_observer.js';
@@ -1,18 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-useless-constructor, @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars */
2
- import type { UseResizeObserverCallback } from '@react-hook/resize-observer';
3
- import useResizeObserver from '@react-hook/resize-observer';
4
-
5
- class ServerSideResizeObserverPolyfill {
6
- constructor(callback: ResizeObserverCallback) {}
7
- observe(target: Element, options?: ResizeObserverOptions) {}
8
- unobserve(target: Element) {}
9
- }
10
-
11
- export const useResizeObserverSsr = <T extends Element>(
12
- target: React.RefObject<T> | React.ForwardedRef<T> | T | null,
13
- callback: UseResizeObserverCallback,
14
- ) => {
15
- return useResizeObserver(target, callback, {
16
- polyfill: typeof window === 'undefined' ? ServerSideResizeObserverPolyfill : null,
17
- });
18
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * This utility function sanitizes a URL by parsing it and returning the string representation of the URL.
3
- * This removed any UTF-8 characters and replaces them with their ASCII equivalents. This is needed because
4
- * otherwise users can use UTF-8 characters to obfuscate URLs and make them look like legitimate URLs.
5
- *
6
- * @param url URL to sanitize
7
- * @returns Sanitized URL or empty string if URL is not a string
8
- * @throws Error if URL is not valid
9
- */
10
- export const sanitizeUrl = (url: string) => {
11
- if (typeof url !== 'string') return '';
12
- const parsedUrl = new URL(url);
13
- return parsedUrl.toString();
14
- };
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "jsx": "react-jsx",
6
- "lib": ["dom", "ES2019"],
7
- "module": "ESNext",
8
- "skipLibCheck": true,
9
- },
10
- "references": [
11
- { "path": "../image-proxy-client/tsconfig.build.json" },
12
- { "path": "../ui-icons/tsconfig.build.json" },
13
- ],
14
- "include": [
15
- "src/**/*"
16
- ]
17
- }
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- "compilerOptions": {
4
- "jsx": "react-jsx",
5
- "lib": ["dom", "ES2019"],
6
- "module": "ES2022",
7
- "skipLibCheck": true,
8
- "outDir": "./dist"
9
- },
10
- }