@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,136 +0,0 @@
1
- import type { FC } from 'react';
2
- import { useMemo } from 'react';
3
- import styled from 'styled-components';
4
-
5
- import { ChevronLeftIcon, ChevronRightIcon } from '@apify/ui-icons';
6
-
7
- import { theme } from '../../design_system/theme.js';
8
- import { Box } from '../box.js';
9
- import { Button } from '../button.js';
10
-
11
- const LEADING_THREE_DOTS_PAGE_KEY = -1;
12
- const TRAILING_THREE_DOTS_PAGE_KEY = -2;
13
-
14
- const PaginationButtonBase = styled(Button).attrs({ variant: 'text' })`
15
- padding: 0;
16
- height: 28px;
17
- min-width: 28px;
18
- font-weight: 400 !important; /* default for button is medium, force regular to all page selection buttons */
19
-
20
- &:disabled {
21
- background: transparent;
22
- }
23
-
24
- &.currentPage {
25
- background-color: ${theme.color.neutral.chipBackground};
26
-
27
- &:hover {
28
- background-color: ${theme.color.neutral.hover};
29
- }
30
- }
31
- `;
32
-
33
- const StyledPageSelectionButtons = styled(Box)`
34
- display: inline-flex;
35
- gap: ${theme.space.space8};
36
- `;
37
-
38
- export type PaginationButtonsProps = {
39
- page: number;
40
- totalPages: number;
41
- onPageChange: (page: number) => void;
42
- }
43
-
44
- // TODO: Consolidate and move to /library
45
- export const PaginationButtons: FC<PaginationButtonsProps> = ({
46
- page,
47
- totalPages,
48
- onPageChange,
49
- }) => {
50
- // Pages to display buttons for (counting from 0, -1 and -2 will mean a special '...' disabled button)
51
- const pagesToDisplay = useMemo(() => {
52
- const result = [];
53
- if (totalPages <= 8) {
54
- for (let i = 0; i < totalPages; i++) {
55
- result.push(i);
56
- }
57
- } else if (page < 5) {
58
- for (let i = 0; i < 7; i++) {
59
- result.push(i);
60
- }
61
- result.push(TRAILING_THREE_DOTS_PAGE_KEY);
62
- } else if (page < totalPages - 4) {
63
- result.push(0);
64
- result.push(LEADING_THREE_DOTS_PAGE_KEY);
65
- for (let i = page - 2; i <= page + 2; i++) {
66
- result.push(i);
67
- }
68
- result.push(TRAILING_THREE_DOTS_PAGE_KEY);
69
- } else {
70
- result.push(0);
71
- result.push(LEADING_THREE_DOTS_PAGE_KEY);
72
- for (let i = totalPages - 6; i < totalPages; i++) {
73
- result.push(i);
74
- }
75
- }
76
- return result;
77
- }, [page, totalPages]);
78
-
79
- return (
80
- <StyledPageSelectionButtons>
81
- <PaginationButtonBase
82
- data-test='page-prev-button'
83
- disabled={page <= 0}
84
- onClick={() => onPageChange(page - 1)}
85
- trackingId='PaginationPrevPage'
86
- >
87
- <ChevronLeftIcon size="16" />
88
- </PaginationButtonBase>
89
- {pagesToDisplay.map((pageToDisplay) => {
90
- if (pageToDisplay === LEADING_THREE_DOTS_PAGE_KEY || pageToDisplay === TRAILING_THREE_DOTS_PAGE_KEY) {
91
- return (
92
- <PaginationButtonBase
93
- trackingId='ThreeDots'
94
- key={pageToDisplay}
95
- onClick={() => undefined}
96
- disabled
97
- >
98
- ...
99
- </PaginationButtonBase>
100
- );
101
- }
102
- if (pageToDisplay === page) {
103
- return (
104
- <PaginationButtonBase
105
- key={pageToDisplay}
106
- data-test='current-page-button'
107
- trackingId='PaginationCurrentPage'
108
- className='currentPage'
109
- onClick={() => undefined}
110
- >
111
- {pageToDisplay + 1}
112
- </PaginationButtonBase>
113
- );
114
- }
115
- return (
116
- <PaginationButtonBase
117
- key={pageToDisplay}
118
- data-test='page-number-button'
119
- onClick={() => onPageChange(pageToDisplay)}
120
- trackingId='PaginationNumberedPage'
121
- >
122
- {pageToDisplay + 1}
123
- </PaginationButtonBase>
124
- );
125
- })}
126
- <PaginationButtonBase
127
- data-test='page-next-button'
128
- disabled={page >= totalPages - 1}
129
- onClick={() => onPageChange(page + 1)}
130
- trackingId='PaginationNextPage'
131
- >
132
- <ChevronRightIcon size="16" />
133
- </PaginationButtonBase>
134
- </StyledPageSelectionButtons>
135
- );
136
- };
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { theme } from '../../design_system/theme.js';
5
- import { Text } from '../text/index.js';
6
-
7
- const StyledChip = styled(Text)`
8
- color: ${theme.color.neutral.text};
9
- background-color: ${theme.color.neutral.chipBackground};
10
- line-height: 1;
11
- padding: ${theme.space.space2} ${theme.space.space4};
12
- border-radius: ${theme.radius.radius8};
13
-
14
- ._disabled & {
15
- background-color: ${theme.color.neutral.backgroundSubtle};
16
- color: ${theme.color.neutral.textDisabled};
17
- }
18
- `;
19
-
20
- interface ChipProps {
21
- children: React.ReactNode;
22
- }
23
-
24
- export const TabNumberChip: React.FC<ChipProps> = ({ children, ...rest }) => {
25
- return <StyledChip
26
- size='small'
27
- {...rest}
28
- >
29
- {children}
30
- </StyledChip>;
31
- };
@@ -1,175 +0,0 @@
1
- import StyleDictionary from 'style-dictionary';
2
-
3
- const DO_NOT_EXPORT_COMMENT = `/**
4
- * Do not edit directly, this file was auto-generated.
5
- */
6
- `;
7
-
8
- function toCamelCase(str) {
9
- return str
10
- .toLowerCase()
11
- .replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
12
- }
13
-
14
- /**
15
- * Converts an object to a TypeScript literal representation with proper indentation
16
- * that can be written to a TypeScript file.
17
- */
18
- function objectToTSLiteral(obj, indentLevel = 0) {
19
- const indent = (level) => ' '.repeat(level); // 2-space indent
20
-
21
- if (obj && typeof obj === 'object') {
22
- const entries = Object.entries(obj);
23
- if (entries.length === 0) return '{}';
24
- return `{\n${entries
25
- .map(
26
- ([key, value]) => `${indent(indentLevel + 1)}${key}: ${objectToTSLiteral(value, indentLevel + 1)}`,
27
- )
28
- .join('\n')}\n${indent(indentLevel)}}${indentLevel > 0 ? ',' : ''}`;
29
- } if (typeof obj === 'string') {
30
- return `'${obj}',`;
31
- }
32
- return String(obj);
33
- }
34
-
35
- /**
36
- * Build color tokens for a given theme.
37
- * @param theme {string} - The theme to build tokens, 'light' or 'dark'.
38
- */
39
- async function buildTheme(theme) {
40
- // Transform to replace 'semantic' and 'decorative' with 'color' in token names
41
- // Example: 'semantic-neutral-text' becomes 'color-neutral-text'
42
- StyleDictionary.registerTransform({
43
- name: 'name/prefix-color-name',
44
- type: 'name',
45
- transform: (prop) => {
46
- return prop.name
47
- .replace(/^semantic/, 'color')
48
- .replace(/^decorative/, 'color');
49
- },
50
- });
51
-
52
- // Format to generate typescript file that exports CSS variables as a string
53
- // Example: export const tokens = `--color-neutral-text: #000; --color-primary: #fff;`
54
- StyleDictionary.registerFormat({
55
- name: 'typescript/css-variables-string',
56
- format: ({ dictionary, options }) => {
57
- const lines = dictionary.allTokens.map((token) => ` --${token.name}: ${token.$value};`);
58
- return `${DO_NOT_EXPORT_COMMENT}\nexport const ${options.varName ?? 'tokens'} = \`\n${lines.join('\n')}\n\`;\n`;
59
- },
60
- });
61
-
62
- // Format to generate typescript file that exports CSS properties as an object
63
- // Example: export const tokens = { colorNeutralText: 'var(--color-neutral-text)', colorPrimary: 'var(--color-primary)' };
64
- StyleDictionary.registerFormat({
65
- name: 'typescript/css-properties',
66
- format: ({ dictionary, options }) => {
67
- const properties = {};
68
- dictionary.allTokens.forEach((token) => {
69
- const path = token.path.slice(1).map(toCamelCase);
70
- let current = properties;
71
- for (let i = 0; i < path.length - 1; i++) {
72
- const key = path[i];
73
- if (!(key in current)) {
74
- current[key] = {};
75
- }
76
- current = current[key];
77
- }
78
- current[path[path.length - 1]] = `var(--${token.name})`;
79
- });
80
-
81
- return `${DO_NOT_EXPORT_COMMENT}\nexport const ${options.varName ?? 'tokens'} = ${objectToTSLiteral(properties)} as const;\n`;
82
- },
83
- });
84
-
85
- // Format to generate typescript file that exports CSS colors as an object
86
- // Example: export const tokens = { colorNeutralText: '#000', colorPrimary: '#fff' };
87
- StyleDictionary.registerFormat({
88
- name: 'typescript/css-colors',
89
- format: ({ dictionary, options }) => {
90
- const properties = {};
91
- dictionary.allTokens.forEach((token) => {
92
- const path = token.path.slice(1);
93
- const name = toCamelCase(path.join(' '));
94
- properties[name] = token.$value;
95
- });
96
-
97
- return `${DO_NOT_EXPORT_COMMENT}\nexport const ${options.varName ?? 'tokens'} = ${objectToTSLiteral(properties)} as const;\n`;
98
- },
99
- });
100
-
101
- // Select only tokens for semantic and decorative colors
102
- StyleDictionary.registerFilter({
103
- name: 'only-colors',
104
- filter: (token) => ['Semantic', 'Decorative'].includes(token.path[0]),
105
- });
106
-
107
- // Select only tokens for palette colors
108
- StyleDictionary.registerFilter({
109
- name: 'only-palette',
110
- filter: (token) => ['Palette'].includes(token.path[0]),
111
- });
112
-
113
- // Select only tokens for theme colors (Decorative and Palette)
114
- StyleDictionary.registerFilter({
115
- name: 'only-theme',
116
- filter: (token) => ['Decorative', 'Palette'].includes(token.path[0]),
117
- });
118
-
119
- const sd = await (new StyleDictionary()).extend({
120
- source: [`src/design_system/colors/figma_color_tokens.${theme}.json`],
121
- platforms: {
122
- main: {
123
- transformGroup: 'scss',
124
- transforms: ['name/prefix-color-name'],
125
- buildPath: 'src/design_system/colors/generated/',
126
- files: [
127
- {
128
- destination: `${theme}.scss`,
129
- format: 'scss/map-flat',
130
- mapName: 'tokens',
131
- filter: 'only-colors',
132
- },
133
- {
134
- destination: `palette.${theme}.scss`,
135
- format: 'scss/map-flat',
136
- mapName: 'tokens',
137
- filter: 'only-palette',
138
- },
139
- {
140
- destination: `${theme}.ts`,
141
- format: 'typescript/css-variables-string',
142
- filter: 'only-colors',
143
- },
144
- {
145
- destination: `palette.${theme}.ts`,
146
- format: 'typescript/css-variables-string',
147
- filter: 'only-palette',
148
- },
149
- {
150
- destination: `properties_theme.ts`,
151
- format: 'typescript/css-properties',
152
- filter: 'only-colors',
153
- options: {
154
- varName: 'colorProperties',
155
- },
156
- },
157
- {
158
- destination: `colors_theme.${theme}.ts`,
159
- format: 'typescript/css-colors',
160
- filter: 'only-theme',
161
- options: {
162
- varName: `${theme}Theme`,
163
- },
164
- },
165
- ],
166
- },
167
- },
168
- });
169
- await sd.buildPlatform('main');
170
- }
171
-
172
- await Promise.all([
173
- buildTheme('light'),
174
- buildTheme('dark'),
175
- ]);