@apify/ui-library 0.71.1-featcolortokens-178953.55 → 0.71.1-featcolortokens-178953.58

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 (99) hide show
  1. package/dist/tsconfig.build.tsbuildinfo +1 -0
  2. package/package.json +7 -5
  3. package/.stylelintrc +0 -12
  4. package/CHANGELOG.md +0 -3334
  5. package/CODEOWNERS +0 -7
  6. package/eslint.config.mjs +0 -44
  7. package/src/codemods/generate_typograpy_tokens_files.mjs +0 -137
  8. package/src/components/action_link.tsx +0 -60
  9. package/src/components/actor_template_card.tsx +0 -116
  10. package/src/components/badge.tsx +0 -148
  11. package/src/components/banner.tsx +0 -94
  12. package/src/components/blog_article.tsx +0 -85
  13. package/src/components/box.tsx +0 -127
  14. package/src/components/button.tsx +0 -305
  15. package/src/components/chip.tsx +0 -128
  16. package/src/components/code/action_button.tsx +0 -96
  17. package/src/components/code/code_block/code_block.styled.tsx +0 -180
  18. package/src/components/code/code_block/code_block.tsx +0 -224
  19. package/src/components/code/code_block/code_block_with_tabs.tsx +0 -257
  20. package/src/components/code/code_block/utils.tsx +0 -67
  21. package/src/components/code/index.ts +0 -5
  22. package/src/components/code/inline_code/inline_code.tsx +0 -62
  23. package/src/components/code/one_line_code/one_line_code.tsx +0 -228
  24. package/src/components/code/prism_highlighter.tsx +0 -180
  25. package/src/components/color_wheel_gradient.tsx +0 -31
  26. package/src/components/floating/index.ts +0 -3
  27. package/src/components/floating/menu.tsx +0 -189
  28. package/src/components/floating/menu_common.tsx +0 -31
  29. package/src/components/floating/menu_components.tsx +0 -99
  30. package/src/components/image.tsx +0 -24
  31. package/src/components/index.ts +0 -22
  32. package/src/components/link.tsx +0 -114
  33. package/src/components/message.tsx +0 -153
  34. package/src/components/rating.tsx +0 -106
  35. package/src/components/readme_renderer/index.ts +0 -3
  36. package/src/components/readme_renderer/pythonize_value.ts +0 -76
  37. package/src/components/readme_renderer/table_of_contents.tsx +0 -272
  38. package/src/components/readme_renderer/utils.tsx +0 -46
  39. package/src/components/simple_markdown/index.ts +0 -2
  40. package/src/components/simple_markdown/simple_markdown.tsx +0 -214
  41. package/src/components/simple_markdown/simple_markdown_components.tsx +0 -293
  42. package/src/components/tabs/index.ts +0 -2
  43. package/src/components/tabs/tab.tsx +0 -217
  44. package/src/components/tabs/tabs.tsx +0 -169
  45. package/src/components/tag.tsx +0 -196
  46. package/src/components/text/heading_content.tsx +0 -56
  47. package/src/components/text/heading_marketing.tsx +0 -55
  48. package/src/components/text/heading_shared.tsx +0 -55
  49. package/src/components/text/index.ts +0 -19
  50. package/src/components/text/text_base.tsx +0 -52
  51. package/src/components/text/text_content.tsx +0 -104
  52. package/src/components/text/text_marketing.tsx +0 -152
  53. package/src/components/text/text_shared.tsx +0 -95
  54. package/src/components/tile/horizontal_tile.tsx +0 -77
  55. package/src/components/tile/index.ts +0 -2
  56. package/src/components/tile/shared.ts +0 -27
  57. package/src/components/tile/vertical_tile.tsx +0 -59
  58. package/src/components/to_consolidate/card.tsx +0 -141
  59. package/src/components/to_consolidate/index.ts +0 -4
  60. package/src/components/to_consolidate/markdown.tsx +0 -609
  61. package/src/components/to_consolidate/pagination.tsx +0 -136
  62. package/src/components/to_consolidate/tab_number_chip.tsx +0 -31
  63. package/src/design_system/colors/build_color_tokens.js +0 -169
  64. package/src/design_system/colors/figma_color_tokens.dark.json +0 -886
  65. package/src/design_system/colors/figma_color_tokens.light.json +0 -886
  66. package/src/design_system/colors/generated/colors_theme.dark.ts +0 -110
  67. package/src/design_system/colors/generated/colors_theme.light.ts +0 -110
  68. package/src/design_system/colors/generated/dark.ts +0 -147
  69. package/src/design_system/colors/generated/light.ts +0 -147
  70. package/src/design_system/colors/generated/palette.dark.ts +0 -74
  71. package/src/design_system/colors/generated/palette.light.ts +0 -74
  72. package/src/design_system/colors/generated/properties_theme.ts +0 -179
  73. package/src/design_system/colors/index.ts +0 -7
  74. package/src/design_system/colors_theme.ts +0 -213
  75. package/src/design_system/properties_theme.ts +0 -453
  76. package/src/design_system/supernova_typography_tokens.json +0 -657
  77. package/src/design_system/theme.ts +0 -25
  78. package/src/design_system/tokens/index.ts +0 -5
  79. package/src/design_system/tokens/layouts.ts +0 -29
  80. package/src/design_system/tokens/radiuses.ts +0 -22
  81. package/src/design_system/tokens/shadows.ts +0 -22
  82. package/src/design_system/tokens/spaces.ts +0 -15
  83. package/src/design_system/tokens/transitions.ts +0 -19
  84. package/src/design_system/typography_theme.ts +0 -197
  85. package/src/index.ts +0 -8
  86. package/src/type_utils.ts +0 -7
  87. package/src/ui_dependency_provider.tsx +0 -58
  88. package/src/utils/copy_to_clipboard.ts +0 -24
  89. package/src/utils/image_color.ts +0 -42
  90. package/src/utils/index.ts +0 -4
  91. package/src/utils/resize_observer.ts +0 -18
  92. package/src/utils/sanitization.ts +0 -14
  93. package/style-dictionary.config.json +0 -29
  94. package/tsconfig.build.json +0 -17
  95. package/tsconfig.json +0 -10
  96. /package/{src/design_system/colors/generated → style/colors}/dark.scss +0 -0
  97. /package/{src/design_system/colors/generated → style/colors}/light.scss +0 -0
  98. /package/{src/design_system/colors/generated → style/colors}/palette.dark.scss +0 -0
  99. /package/{src/design_system/colors/generated → style/colors}/palette.light.scss +0 -0
@@ -1,55 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { theme } from '../../design_system/theme.js';
5
- import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.js';
7
- import { TextBaseComponent } from './text_base.js';
8
-
9
- type HeadingSharedType = 'titleXs' | 'titleS' | 'titleM' | 'titleL' | 'titleXl' | 'title2xl' | 'title3xl';
10
-
11
- interface HeadingSharedTransientProps {
12
- type?: HeadingSharedType,
13
- }
14
-
15
- type StyledHeadingSharedProps = WithTransientProps<HeadingSharedTransientProps>;
16
- export type HeadingSharedProps = HeadingSharedTransientProps & TextBaseProps;
17
-
18
- const HEADING_SHARED_DEFAULT_ELEMENTS: { [Type in HeadingSharedType]: string } = {
19
- titleXs: 'h6',
20
- titleS: 'h5',
21
- titleM: 'h4',
22
- titleL: 'h3',
23
- titleXl: 'h2',
24
- title2xl: 'h1',
25
- title3xl: 'h1',
26
- };
27
-
28
- const StyledHeadingShared = styled(TextBaseComponent)<StyledHeadingSharedProps>`
29
- ${(props) => `
30
- ${theme.typography.shared.mobile[props.$type || 'titleL']}
31
-
32
- @media (${theme.device.tablet}) {
33
- ${theme.typography.shared.tablet[props.$type || 'titleL']}
34
- }
35
-
36
- @media (${theme.device.desktop}) {
37
- ${theme.typography.shared.desktop[props.$type || 'titleL']}
38
- }
39
- `}
40
- `;
41
-
42
- export const HeadingShared: React.FC<HeadingSharedProps> = ({
43
- type,
44
- as,
45
- ...rest
46
- }) => {
47
- return (
48
- <StyledHeadingShared
49
- $type={type}
50
- forwardedAs={as || HEADING_SHARED_DEFAULT_ELEMENTS[type || 'titleL']}
51
- m='none'
52
- {...rest}
53
- />
54
- );
55
- };
@@ -1,19 +0,0 @@
1
- import { HeadingShared } from './heading_shared.js';
2
- import type { SharedTextProps } from './text_shared.js';
3
- import { SHARED_TEXT_TYPES, TextShared } from './text_shared.js';
4
-
5
- export * from './text_base.js';
6
- export * from './text_content.js';
7
- export * from './text_marketing.js';
8
- export * from './heading_content.js';
9
- export * from './heading_marketing.js';
10
-
11
- export {
12
- TextShared as Text, // Shared typography is the default
13
- HeadingShared as Heading, // Shared typography is the default
14
- SHARED_TEXT_TYPES,
15
- };
16
-
17
- export type {
18
- SharedTextProps,
19
- };
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
- import styled, { css } from 'styled-components';
3
-
4
- import type { WithTransientProps } from '../../type_utils.js';
5
- import type { BoxProps } from '../box.js';
6
- import { Box } from '../box.js';
7
-
8
- export interface TransientTextBaseProps {
9
- italic?: boolean
10
- uppercase?: boolean
11
- align?: 'left' | 'right' | 'center'
12
- color?: string,
13
- }
14
-
15
- export type StyledTextBaseProps = WithTransientProps<TransientTextBaseProps>;
16
- export type TextBaseProps = TransientTextBaseProps & BoxProps;
17
-
18
- const StyledText = styled(Box)<StyledTextBaseProps>`
19
- ${(props) => props.$italic && css`
20
- font-style: italic;
21
- `}
22
-
23
- ${(props) => props.$uppercase && css`
24
- text-transform: uppercase;
25
- `}
26
-
27
- ${(props) => props.$align && css`
28
- text-align: ${props.$align};
29
- `}
30
-
31
- ${(props) => props.$color && css`
32
- color: ${props.$color};
33
- `}
34
- `;
35
-
36
- export const TextBaseComponent: React.FC<TextBaseProps> = ({
37
- italic,
38
- align,
39
- color,
40
- uppercase,
41
- as,
42
- ...rest
43
- }) => (
44
- <StyledText
45
- $italic={italic}
46
- $align={align}
47
- $color={color}
48
- $uppercase={uppercase}
49
- forwardedAs={as}
50
- {...rest}
51
- />
52
- );
@@ -1,104 +0,0 @@
1
- import { forwardRef } from 'react';
2
- import type { FlattenSimpleInterpolation } from 'styled-components';
3
- import styled, { css } from 'styled-components';
4
-
5
- import { theme } from '../../design_system/theme.js';
6
- import type { WithTransientProps } from '../../type_utils.js';
7
- import type { TextBaseProps } from './text_base.js';
8
- import { TextBaseComponent } from './text_base.js';
9
-
10
- export type ContentTextType = 'paragraph' | 'snippet';
11
- export type ContentTextWeight = 'normal' | 'bold';
12
-
13
- export interface TransientContentTextProps {
14
- type?: ContentTextType,
15
- weight?: ContentTextWeight,
16
- }
17
-
18
- type StyledContentTextProps = WithTransientProps<TransientContentTextProps>;
19
- export type ContentTextProps = TransientContentTextProps & TextBaseProps;
20
-
21
- type TextContentVariants = {
22
- [Type in ContentTextType]: {
23
- [Weight in ContentTextWeight]: FlattenSimpleInterpolation;
24
- };
25
- };
26
-
27
- const TEXT_SHARED_VARIANTS_CSS: TextContentVariants = {
28
- paragraph: {
29
- normal: css`
30
- ${theme.typography.content.mobile.paragraph}
31
-
32
- @media (min-width: ${theme.layout.tablet}) {
33
- ${theme.typography.content.tablet.paragraph}
34
- }
35
-
36
- @media (min-width: ${theme.layout.desktop}) {
37
- ${theme.typography.content.desktop.paragraph}
38
- }
39
- `,
40
- bold: css`
41
- ${theme.typography.content.mobile.paragraphStrong}
42
-
43
- @media (min-width: ${theme.layout.tablet}) {
44
- ${theme.typography.content.tablet.paragraphStrong}
45
- }
46
-
47
- @media (min-width: ${theme.layout.desktop}) {
48
- ${theme.typography.content.desktop.paragraphStrong}
49
- }
50
- `,
51
- },
52
- snippet: {
53
- normal: css`
54
- ${theme.typography.content.mobile.snippet}
55
-
56
- @media (min-width: ${theme.layout.tablet}) {
57
- ${theme.typography.content.tablet.snippet}
58
- }
59
-
60
- @media (min-width: ${theme.layout.desktop}) {
61
- ${theme.typography.content.desktop.snippet}
62
- }
63
- `,
64
- bold: css`
65
- ${theme.typography.content.mobile.snippetStrong}
66
-
67
- @media (min-width: ${theme.layout.tablet}) {
68
- ${theme.typography.content.tablet.snippetStrong}
69
- }
70
-
71
- @media (min-width: ${theme.layout.desktop}) {
72
- ${theme.typography.content.desktop.snippetStrong}
73
- }
74
- `,
75
- },
76
- };
77
-
78
- const StyledTextContent = styled(TextBaseComponent)<StyledContentTextProps>`
79
- ${(props) => TEXT_SHARED_VARIANTS_CSS[props.$type || 'paragraph'][props.$weight || 'normal']}
80
- `;
81
-
82
- export const TextContent = forwardRef<HTMLElement | undefined, ContentTextProps>(({
83
- type,
84
- weight,
85
- as,
86
- ...rest
87
- }, ref) => {
88
- return (
89
- <StyledTextContent
90
- $type={type}
91
- $weight={weight}
92
- forwardedAs={as || 'p'}
93
- ref={ref}
94
- // We have global CSS file that defines margins for p and h to some 'normalized' value
95
- // But at the same time we want to have default margin set to 0 for Text and Headings
96
- // In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
97
- // Until then we have to set default 0 margin here
98
- m='none'
99
- {...rest}
100
- />
101
- );
102
- });
103
-
104
- TextContent.displayName = 'TextContent';
@@ -1,152 +0,0 @@
1
- import { forwardRef } from 'react';
2
- import type { FlattenSimpleInterpolation } from 'styled-components';
3
- import styled, { css } from 'styled-components';
4
-
5
- import { theme } from '../../design_system/theme.js';
6
- import type { WithTransientProps } from '../../type_utils.js';
7
- import type { TextBaseProps } from './text_base.js';
8
- import { TextBaseComponent } from './text_base.js';
9
-
10
- export type MarketingTextSize = 'large' | 'regular' | 'small' | 'extraSmall';
11
- export type MarketingTextWeight = 'normal' | 'bold';
12
-
13
- export interface TransientMarketingTextProps {
14
- size?: MarketingTextSize,
15
- weight?: MarketingTextWeight,
16
- }
17
-
18
- type StyledMarketingTextProps = WithTransientProps<TransientMarketingTextProps>;
19
- export type MarketingTextProps = TransientMarketingTextProps & TextBaseProps;
20
-
21
- type TextMarketingVariants = {
22
- [Size in MarketingTextSize]: {
23
- [Weight in MarketingTextWeight]: FlattenSimpleInterpolation;
24
- };
25
- };
26
-
27
- const TEXT_MARKETING_VARIANTS_CSS: TextMarketingVariants = {
28
- large: {
29
- normal: css`
30
- ${theme.typography.marketing.mobile.bodyL}
31
-
32
- @media (${theme.device.tablet}) {
33
- ${theme.typography.marketing.tablet.bodyL}
34
- }
35
-
36
- @media (${theme.device.desktop}) {
37
- ${theme.typography.marketing.desktop.bodyL}
38
- }
39
- `,
40
- bold: css`
41
- ${theme.typography.marketing.mobile.bodyLStrong}
42
-
43
- @media (${theme.device.tablet}) {
44
- ${theme.typography.marketing.tablet.bodyLStrong}
45
- }
46
-
47
- @media (${theme.device.desktop}) {
48
- ${theme.typography.marketing.desktop.bodyLStrong}
49
- }
50
- `,
51
- },
52
- regular: {
53
- normal: css`
54
- ${theme.typography.marketing.mobile.bodyM}
55
-
56
- @media (${theme.device.tablet}) {
57
- ${theme.typography.marketing.tablet.bodyM}
58
- }
59
-
60
- @media (${theme.device.desktop}) {
61
- ${theme.typography.marketing.desktop.bodyM}
62
- }
63
- `,
64
- bold: css`
65
- ${theme.typography.marketing.mobile.bodyMStrong}
66
-
67
- @media (${theme.device.tablet}) {
68
- ${theme.typography.marketing.tablet.bodyMStrong}
69
- }
70
-
71
- @media (${theme.device.desktop}) {
72
- ${theme.typography.marketing.desktop.bodyMStrong}
73
- }
74
- `,
75
- },
76
- small: {
77
- normal: css`
78
- ${theme.typography.marketing.mobile.bodyS}
79
-
80
- @media (${theme.device.tablet}) {
81
- ${theme.typography.marketing.tablet.bodyS}
82
- }
83
-
84
- @media (${theme.device.desktop}) {
85
- ${theme.typography.marketing.desktop.bodyS}
86
- }
87
- `,
88
- bold: css`
89
- ${theme.typography.marketing.mobile.bodySStrong}
90
-
91
- @media (${theme.device.tablet}) {
92
- ${theme.typography.marketing.tablet.bodySStrong}
93
- }
94
-
95
- @media (${theme.device.desktop}) {
96
- ${theme.typography.marketing.desktop.bodySStrong}
97
- }
98
- `,
99
- },
100
- extraSmall: {
101
- normal: css`
102
- ${theme.typography.marketing.mobile.bodyXs}
103
-
104
- @media (${theme.device.tablet}) {
105
- ${theme.typography.marketing.tablet.bodyXs}
106
- }
107
-
108
- @media (${theme.device.desktop}) {
109
- ${theme.typography.marketing.desktop.bodyXs}
110
- }
111
- `,
112
- bold: css`
113
- ${theme.typography.marketing.mobile.bodyXsStrong}
114
-
115
- @media (${theme.device.tablet}) {
116
- ${theme.typography.marketing.tablet.bodyXsStrong}
117
- }
118
-
119
- @media (${theme.device.desktop}) {
120
- ${theme.typography.marketing.desktop.bodyXsStrong}
121
- }
122
- `,
123
- },
124
- };
125
-
126
- const StyledTextMarketing = styled(TextBaseComponent)<StyledMarketingTextProps>`
127
- ${(props) => TEXT_MARKETING_VARIANTS_CSS[props.$size || 'regular'][props.$weight || 'normal']}
128
- `;
129
-
130
- export const TextMarketing = forwardRef<HTMLElement | undefined, MarketingTextProps>(({
131
- weight,
132
- size,
133
- as,
134
- ...rest
135
- }, ref) => {
136
- return (
137
- <StyledTextMarketing
138
- $weight={weight}
139
- $size={size}
140
- forwardedAs={as || 'p'}
141
- ref={ref}
142
- // We have global CSS file that defines margins for p and h to some 'normalized' value
143
- // But at the same time we want to have default margin set to 0 for Text and Headings
144
- // In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
145
- // Until then we have to set default 0 margin here
146
- m='none'
147
- {...rest}
148
- />
149
- );
150
- });
151
-
152
- TextMarketing.displayName = 'TextMarketing';
@@ -1,95 +0,0 @@
1
- import { forwardRef } from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { theme } from '../../design_system/theme.js';
5
- import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.js';
7
- import { TextBaseComponent } from './text_base.js';
8
-
9
- export const SHARED_TEXT_TYPES = ['body', 'code'] as const;
10
- export type SharedTextType = typeof SHARED_TEXT_TYPES[number];
11
-
12
- export type SharedTextSize = 'regular' | 'small' | 'big';
13
- export type SharedTextWeight = 'normal' | 'medium' | 'bold';
14
-
15
- export interface TransientSharedTextProps {
16
- type?: SharedTextType,
17
- size?: SharedTextSize,
18
- weight?: SharedTextWeight,
19
- }
20
-
21
- type StyledSharedTextProps = WithTransientProps<TransientSharedTextProps>;
22
- export type SharedTextProps = TransientSharedTextProps & TextBaseProps;
23
-
24
- type TextSharedVariants = {
25
- [Type in SharedTextType]: {
26
- [Size in SharedTextSize]: {
27
- [Weight in SharedTextWeight]: string;
28
- };
29
- };
30
- };
31
-
32
- const TEXT_SHARED_VARIANTS_CSS: TextSharedVariants = {
33
- body: {
34
- regular: {
35
- normal: theme.typography.shared.tablet.bodyM,
36
- medium: theme.typography.shared.tablet.bodyMMedium,
37
- bold: theme.typography.shared.tablet.bodyMStrong,
38
- },
39
- small: {
40
- normal: theme.typography.shared.tablet.bodyS,
41
- medium: theme.typography.shared.tablet.bodySMedium,
42
- bold: theme.typography.shared.tablet.bodySStrong,
43
- },
44
- big: {
45
- normal: theme.typography.shared.tablet.bodyL,
46
- medium: theme.typography.shared.tablet.bodyLMedium,
47
- bold: theme.typography.shared.tablet.bodyLStrong,
48
- },
49
- },
50
- code: {
51
- regular: {
52
- normal: theme.typography.shared.tablet.codeM,
53
- medium: theme.typography.shared.tablet.codeMMedium,
54
- bold: theme.typography.shared.tablet.codeMStrong,
55
- },
56
- small: {
57
- normal: theme.typography.shared.tablet.codeS,
58
- medium: theme.typography.shared.tablet.codeSMedium,
59
- bold: theme.typography.shared.tablet.codeSStrong,
60
- },
61
- big: {
62
- normal: theme.typography.shared.tablet.codeL,
63
- medium: theme.typography.shared.tablet.codeLMedium,
64
- bold: theme.typography.shared.tablet.codeLStrong,
65
- },
66
- },
67
- };
68
-
69
- const StyledTextShared = styled(TextBaseComponent)<StyledSharedTextProps>`
70
- ${(props) => TEXT_SHARED_VARIANTS_CSS[props.$type || 'body'][props.$size || 'regular'][props.$weight || 'normal']}
71
- `;
72
-
73
- export const TextShared = forwardRef<HTMLElement | undefined, SharedTextProps>(({
74
- type,
75
- size,
76
- weight,
77
- as,
78
- ...rest
79
- }, ref) => {
80
- return (
81
- <StyledTextShared
82
- $type={type}
83
- $size={size}
84
- $weight={weight}
85
- forwardedAs={as || 'p'}
86
- ref={ref}
87
- // We have global CSS file that defines margins for p and h to some 'normalized' value
88
- // But at the same time we want to have default margin set to 0 for Text and Headings
89
- // In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
90
- // Until then we have to set default 0 margin here
91
- m='none'
92
- {...rest}
93
- />
94
- );
95
- });
@@ -1,77 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { theme } from '../../design_system/theme.js';
5
- import type {
6
- TileSharedProps,
7
- TileSizesType,
8
- } from './shared.js';
9
- import {
10
- TILE_SIZES,
11
- tileStyle,
12
- } from './shared.js';
13
-
14
- interface HorizontalTileProps extends TileSharedProps {
15
- icon?: React.ReactNode;
16
- action?: React.ReactNode;
17
- }
18
-
19
- interface StyledTileWrapperProps {
20
- $hasIcon?: boolean;
21
- $size?: TileSizesType;
22
- }
23
-
24
- const WrapperClasses = {
25
- TILE_CONTENT: 'Tile-Content',
26
- };
27
-
28
- const StyledTileWrapper = styled.div<StyledTileWrapperProps>`
29
- ${tileStyle}
30
- padding: ${({ $size }) => ($size === TILE_SIZES.SMALL ? theme.space.space16 : theme.space.space24)};
31
- display: flex;
32
- flex-direction: row;
33
- align-items: center;
34
-
35
- cursor: pointer;
36
- transition: box-shadow ${theme.transition.smoothEaseOut},
37
- background-color ${theme.transition.smoothEaseOut},
38
- border-color ${theme.transition.smoothEaseOut};
39
-
40
- &:hover {
41
- box-shadow: ${theme.shadow.shadow1};
42
- background-color: ${theme.color.neutral.hover};
43
- }
44
-
45
- &:active,
46
- &:focus {
47
- border-color: ${theme.color.primary.action};
48
- }
49
-
50
- ${({ $hasIcon }) => $hasIcon && `gap: ${theme.space.space8};`}
51
-
52
- .${WrapperClasses.TILE_CONTENT} {
53
- flex-grow: 1;
54
- }
55
- `;
56
-
57
- export const HorizontalTile: React.FC<HorizontalTileProps> = ({
58
- content,
59
- icon,
60
- action,
61
- size = TILE_SIZES.SMALL,
62
- onClick,
63
- ...otherProps
64
- }) => {
65
- return (
66
- <StyledTileWrapper
67
- $hasIcon={!!icon}
68
- $size={size}
69
- onClick={onClick}
70
- {...otherProps}
71
- >
72
- <div>{icon}</div>
73
- <div className={WrapperClasses.TILE_CONTENT}>{content}</div>
74
- <div>{action}</div>
75
- </StyledTileWrapper>
76
- );
77
- };
@@ -1,2 +0,0 @@
1
- export * from './horizontal_tile.js';
2
- export * from './vertical_tile.js';
@@ -1,27 +0,0 @@
1
- import { css } from 'styled-components';
2
-
3
- import { theme } from '../../design_system/theme.js';
4
-
5
- export const TILE_SIZES = {
6
- SMALL: 'S',
7
- LARGE: 'L',
8
- };
9
-
10
- export type TileSizesType = typeof TILE_SIZES[keyof typeof TILE_SIZES];
11
-
12
- export const tileStyle = css`
13
- background-color: ${theme.color.neutral.background};
14
- border: 1px solid ${theme.color.neutral.border};
15
- border-radius: ${theme.radius.radius12};
16
- `;
17
-
18
- export type TileSharedProps = {
19
- content: React.ReactNode,
20
- size?: TileSizesType,
21
- isClickable?: boolean,
22
- onClick?: () => void,
23
- id?: string;
24
- className?: string;
25
- style?: React.CSSProperties;
26
- as?: React.ElementType;
27
- };
@@ -1,59 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { theme } from '../../design_system/theme.js';
5
- import type {
6
- TileSharedProps,
7
- TileSizesType,
8
- } from './shared.js';
9
- import {
10
- TILE_SIZES,
11
- tileStyle,
12
- } from './shared.js';
13
-
14
- interface VerticalTileProps extends TileSharedProps {
15
- content: React.ReactNode;
16
- icon?: React.ReactNode;
17
- action?: React.ReactNode;
18
- }
19
-
20
- interface StyledTileWrapperProps {
21
- $size?: TileSizesType;
22
- }
23
-
24
- const WrapperClasses = {
25
- TILE_CONTENT: 'Tile-Content',
26
- };
27
-
28
- const StyledTileWrapper = styled.div<StyledTileWrapperProps>`
29
- ${tileStyle}
30
- padding: ${({ $size }) => ($size === TILE_SIZES.SMALL ? theme.space.space16 : theme.space.space24)};
31
- width: 100%;
32
- cursor: pointer;
33
- transition: box-shadow ${theme.transition.smoothEaseOut},
34
- background-color ${theme.transition.smoothEaseOut},
35
- border-color ${theme.transition.smoothEaseOut};
36
-
37
- &:hover {
38
- box-shadow: ${theme.shadow.shadow1};
39
- background-color: ${theme.color.neutral.hover};
40
- }
41
-
42
- &:active,
43
- &:focus {
44
- border-color: ${theme.color.primary.action};
45
- }
46
- `;
47
-
48
- export const VerticalTile: React.FC<VerticalTileProps> = ({
49
- content,
50
- size = TILE_SIZES.LARGE,
51
- onClick,
52
- ...otherProps
53
- }) => {
54
- return (
55
- <StyledTileWrapper $size={size} onClick={onClick} {...otherProps}>
56
- <div className={WrapperClasses.TILE_CONTENT}>{content}</div>
57
- </StyledTileWrapper>
58
- );
59
- };