@apify/ui-library 1.118.0 → 1.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.js +23 -6
- package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/card_container.stories.tsx +2 -1
- package/src/components/code/code_block/code_block.stories.jsx +1 -1
- package/src/components/code/inline_code/inline_code.stories.tsx +1 -1
- package/src/components/code/one_line_code/one_line_code.stories.tsx +1 -1
- package/src/components/readme_renderer/table_of_contents.stories.tsx +476 -0
- package/src/components/simple_markdown/simple_markdown.stories.tsx +1 -1
- package/src/components/simple_markdown/simple_markdown_components.tsx +27 -5
- package/src/components/text/heading_content.stories.tsx +167 -0
- package/src/components/text/heading_marketing.stories.tsx +123 -0
- package/src/components/text/heading_shared.stories.tsx +118 -0
- package/src/components/text/text_content.stories.tsx +189 -0
- package/src/components/text/text_marketing.stories.tsx +187 -0
- package/src/components/text/text_shared.stories.tsx +246 -0
- package/src/components/tile/horizontal_tile.stories.tsx +105 -0
- package/src/components/tile/vertical_tile.stories.tsx +167 -0
- package/src/components/to_consolidate/card.stories.tsx +91 -0
- package/src/components/to_consolidate/markdown.stories.tsx +160 -0
- package/src/components/to_consolidate/pagination.stories.tsx +64 -0
- package/src/components/to_consolidate/tab_number_chip.stories.tsx +113 -0
- package/src/components/text/text.stories.tsx +0 -61
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { HeadingContent, type HeadingContentProps } from './heading_content.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Design Tokens/Typography/HeadingContent',
|
|
8
|
+
component: HeadingContent,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: '⚠️ **Internal Component**: This component is specifically designed for use within the SimpleMarkdown component. '
|
|
13
|
+
+ 'It provides content-specific heading styles for markdown rendering. \n'
|
|
14
|
+
+ 'For general heading usage, use HeadingShared or HeadingMarketing instead.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: ['heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6'],
|
|
22
|
+
description: 'The heading level (maps to h1-h6, responsive across mobile/tablet/desktop)',
|
|
23
|
+
},
|
|
24
|
+
as: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'The HTML element to render as (overrides default for each type)',
|
|
27
|
+
},
|
|
28
|
+
children: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'The heading text content',
|
|
31
|
+
},
|
|
32
|
+
color: {
|
|
33
|
+
control: 'color',
|
|
34
|
+
description: 'Custom color for the heading',
|
|
35
|
+
},
|
|
36
|
+
align: {
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
options: ['left', 'center', 'right'],
|
|
39
|
+
description: 'Text alignment',
|
|
40
|
+
},
|
|
41
|
+
italic: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
description: 'Apply italic style',
|
|
44
|
+
},
|
|
45
|
+
uppercase: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'Transform text to uppercase',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
} as Meta<HeadingContentProps>;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<HeadingContentProps>;
|
|
53
|
+
|
|
54
|
+
const StoryWrapper = styled.div`
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 2rem;
|
|
58
|
+
padding: 2rem;
|
|
59
|
+
max-width: 800px;
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const HeadingShowcase = styled.div`
|
|
63
|
+
border-bottom: 1px solid #e0e0e0;
|
|
64
|
+
padding-bottom: 1rem;
|
|
65
|
+
|
|
66
|
+
small {
|
|
67
|
+
display: block;
|
|
68
|
+
color: #666;
|
|
69
|
+
font-size: 0.875rem;
|
|
70
|
+
margin-bottom: 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const WarningBanner = styled.div`
|
|
75
|
+
background: #fff3cd;
|
|
76
|
+
border: 1px solid #ffc107;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
padding: 1rem;
|
|
79
|
+
margin-bottom: 1.5rem;
|
|
80
|
+
|
|
81
|
+
strong {
|
|
82
|
+
color: #856404;
|
|
83
|
+
display: block;
|
|
84
|
+
margin-bottom: 0.5rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
p {
|
|
88
|
+
color: #856404;
|
|
89
|
+
margin: 0;
|
|
90
|
+
font-size: 0.875rem;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Default content heading (used by SimpleMarkdown)
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ This component is for internal use by SimpleMarkdown only
|
|
98
|
+
*/
|
|
99
|
+
export const Default: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
type: 'heading1',
|
|
102
|
+
children: 'Content Heading',
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* All content heading levels as used in SimpleMarkdown component
|
|
108
|
+
*
|
|
109
|
+
* ⚠️ These heading styles are specifically designed for markdown content rendering.
|
|
110
|
+
* For general application headings, use HeadingShared or HeadingMarketing.
|
|
111
|
+
*/
|
|
112
|
+
export const AllVariants: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<StoryWrapper>
|
|
115
|
+
<WarningBanner>
|
|
116
|
+
<strong>⚠️ Internal Component</strong>
|
|
117
|
+
<p>
|
|
118
|
+
HeadingContent is used exclusively by the SimpleMarkdown component for rendering
|
|
119
|
+
markdown headings. For general heading usage in your application, use HeadingShared
|
|
120
|
+
or HeadingMarketing components instead.
|
|
121
|
+
</p>
|
|
122
|
+
</WarningBanner>
|
|
123
|
+
|
|
124
|
+
<HeadingShowcase>
|
|
125
|
+
<small>heading1 (default: h1) - Used for # in markdown</small>
|
|
126
|
+
<HeadingContent type="heading1">
|
|
127
|
+
Heading 1 - Main Document Title
|
|
128
|
+
</HeadingContent>
|
|
129
|
+
</HeadingShowcase>
|
|
130
|
+
|
|
131
|
+
<HeadingShowcase>
|
|
132
|
+
<small>heading2 (default: h2) - Used for ## in markdown</small>
|
|
133
|
+
<HeadingContent type="heading2">
|
|
134
|
+
Heading 2 - Major Section
|
|
135
|
+
</HeadingContent>
|
|
136
|
+
</HeadingShowcase>
|
|
137
|
+
|
|
138
|
+
<HeadingShowcase>
|
|
139
|
+
<small>heading3 (default: h3) - Used for ### in markdown</small>
|
|
140
|
+
<HeadingContent type="heading3">
|
|
141
|
+
Heading 3 - Subsection
|
|
142
|
+
</HeadingContent>
|
|
143
|
+
</HeadingShowcase>
|
|
144
|
+
|
|
145
|
+
<HeadingShowcase>
|
|
146
|
+
<small>heading4 (default: h4) - Used for #### in markdown</small>
|
|
147
|
+
<HeadingContent type="heading4">
|
|
148
|
+
Heading 4 - Minor Section
|
|
149
|
+
</HeadingContent>
|
|
150
|
+
</HeadingShowcase>
|
|
151
|
+
|
|
152
|
+
<HeadingShowcase>
|
|
153
|
+
<small>heading5 (default: h5) - Used for ##### in markdown</small>
|
|
154
|
+
<HeadingContent type="heading5">
|
|
155
|
+
Heading 5 - Sub-minor Section
|
|
156
|
+
</HeadingContent>
|
|
157
|
+
</HeadingShowcase>
|
|
158
|
+
|
|
159
|
+
<HeadingShowcase>
|
|
160
|
+
<small>heading6 (default: h6) - Used for ###### in markdown</small>
|
|
161
|
+
<HeadingContent type="heading6">
|
|
162
|
+
Heading 6 - Smallest Heading
|
|
163
|
+
</HeadingContent>
|
|
164
|
+
</HeadingShowcase>
|
|
165
|
+
</StoryWrapper>
|
|
166
|
+
),
|
|
167
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { HeadingMarketing, type HeadingMarketingProps } from './heading_marketing.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Design Tokens/Typography/HeadingMarketing',
|
|
8
|
+
component: HeadingMarketing,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Marketing headings are designed for promotional and web-facing content. '
|
|
13
|
+
+ 'These typography elements are primarily used for marketing pages, landing pages,'
|
|
14
|
+
+ ' and other web components where a strong visual presence is needed.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: ['titleXs', 'titleS', 'titleM', 'titleMl', 'titleL', 'titleXl', 'title2xl', 'title3xl'],
|
|
22
|
+
description: 'The heading size type (responsive across mobile/tablet/desktop)',
|
|
23
|
+
},
|
|
24
|
+
as: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'The HTML element to render as (overrides default for each type)',
|
|
27
|
+
},
|
|
28
|
+
children: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'The heading text content',
|
|
31
|
+
},
|
|
32
|
+
color: {
|
|
33
|
+
control: 'color',
|
|
34
|
+
description: 'Custom color for the heading',
|
|
35
|
+
},
|
|
36
|
+
align: {
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
options: ['left', 'center', 'right'],
|
|
39
|
+
description: 'Text alignment',
|
|
40
|
+
},
|
|
41
|
+
italic: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
description: 'Apply italic style',
|
|
44
|
+
},
|
|
45
|
+
uppercase: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'Transform text to uppercase',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
} as Meta<HeadingMarketingProps>;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<HeadingMarketingProps>;
|
|
53
|
+
|
|
54
|
+
const StoryWrapper = styled.div`
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 2rem;
|
|
58
|
+
padding: 2rem;
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const HeadingShowcase = styled.div`
|
|
62
|
+
border-bottom: 1px solid #e0e0e0;
|
|
63
|
+
padding-bottom: 1rem;
|
|
64
|
+
|
|
65
|
+
small {
|
|
66
|
+
display: block;
|
|
67
|
+
color: #666;
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
margin-bottom: 0.5rem;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Default marketing heading
|
|
75
|
+
*/
|
|
76
|
+
export const Default: Story = {
|
|
77
|
+
args: {
|
|
78
|
+
type: 'titleL',
|
|
79
|
+
children: 'Marketing Heading',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* All marketing heading sizes displayed together
|
|
85
|
+
*/
|
|
86
|
+
export const AllSizes: Story = {
|
|
87
|
+
render: () => (
|
|
88
|
+
<StoryWrapper>
|
|
89
|
+
<HeadingShowcase>
|
|
90
|
+
<small>title3xl (default: h1)</small>
|
|
91
|
+
<HeadingMarketing type="title3xl">Largest Marketing Title</HeadingMarketing>
|
|
92
|
+
</HeadingShowcase>
|
|
93
|
+
<HeadingShowcase>
|
|
94
|
+
<small>title2xl (default: h1)</small>
|
|
95
|
+
<HeadingMarketing type="title2xl">Extra Large Marketing Title</HeadingMarketing>
|
|
96
|
+
</HeadingShowcase>
|
|
97
|
+
<HeadingShowcase>
|
|
98
|
+
<small>titleXl (default: h2)</small>
|
|
99
|
+
<HeadingMarketing type="titleXl">Very Large Marketing Title</HeadingMarketing>
|
|
100
|
+
</HeadingShowcase>
|
|
101
|
+
<HeadingShowcase>
|
|
102
|
+
<small>titleL (default: h3)</small>
|
|
103
|
+
<HeadingMarketing type="titleL">Large Marketing Title</HeadingMarketing>
|
|
104
|
+
</HeadingShowcase>
|
|
105
|
+
<HeadingShowcase>
|
|
106
|
+
<small>titleMl (default: h4)</small>
|
|
107
|
+
<HeadingMarketing type="titleMl">Medium-Large Marketing Title</HeadingMarketing>
|
|
108
|
+
</HeadingShowcase>
|
|
109
|
+
<HeadingShowcase>
|
|
110
|
+
<small>titleM (default: h4)</small>
|
|
111
|
+
<HeadingMarketing type="titleM">Medium Marketing Title</HeadingMarketing>
|
|
112
|
+
</HeadingShowcase>
|
|
113
|
+
<HeadingShowcase>
|
|
114
|
+
<small>titleS (default: h5)</small>
|
|
115
|
+
<HeadingMarketing type="titleS">Small Marketing Title</HeadingMarketing>
|
|
116
|
+
</HeadingShowcase>
|
|
117
|
+
<HeadingShowcase>
|
|
118
|
+
<small>titleXs (default: h6)</small>
|
|
119
|
+
<HeadingMarketing type="titleXs">Extra Small Marketing Title</HeadingMarketing>
|
|
120
|
+
</HeadingShowcase>
|
|
121
|
+
</StoryWrapper>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { HeadingShared, type HeadingSharedProps } from './heading_shared.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Design Tokens/Typography/HeadingShared',
|
|
8
|
+
component: HeadingShared,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Shared headings are the standard typography component used throughout the console and shared components. '
|
|
13
|
+
+ 'This is the default choice for most heading needs. **If you\'re unsure which heading component to use, choose this one.**',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
type: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: ['titleXs', 'titleS', 'titleM', 'titleL', 'titleXl', 'title2xl', 'title3xl'],
|
|
21
|
+
description: 'The heading size type (responsive across mobile/tablet/desktop)',
|
|
22
|
+
},
|
|
23
|
+
as: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'The HTML element to render as (overrides default for each type)',
|
|
26
|
+
},
|
|
27
|
+
children: {
|
|
28
|
+
control: 'text',
|
|
29
|
+
description: 'The heading text content',
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
control: 'color',
|
|
33
|
+
description: 'Custom color for the heading',
|
|
34
|
+
},
|
|
35
|
+
align: {
|
|
36
|
+
control: { type: 'select' },
|
|
37
|
+
options: ['left', 'center', 'right'],
|
|
38
|
+
description: 'Text alignment',
|
|
39
|
+
},
|
|
40
|
+
italic: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
description: 'Apply italic style',
|
|
43
|
+
},
|
|
44
|
+
uppercase: {
|
|
45
|
+
control: 'boolean',
|
|
46
|
+
description: 'Transform text to uppercase',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
} as Meta<HeadingSharedProps>;
|
|
50
|
+
|
|
51
|
+
type Story = StoryObj<HeadingSharedProps>;
|
|
52
|
+
|
|
53
|
+
const StoryWrapper = styled.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 2rem;
|
|
57
|
+
padding: 2rem;
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
const HeadingShowcase = styled.div`
|
|
61
|
+
border-bottom: 1px solid #e0e0e0;
|
|
62
|
+
padding-bottom: 1rem;
|
|
63
|
+
|
|
64
|
+
small {
|
|
65
|
+
display: block;
|
|
66
|
+
color: #666;
|
|
67
|
+
font-size: 0.875rem;
|
|
68
|
+
margin-bottom: 0.5rem;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Default shared heading
|
|
74
|
+
*/
|
|
75
|
+
export const Default: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
type: 'titleL',
|
|
78
|
+
children: 'Shared Typography Heading',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* All shared heading sizes displayed together
|
|
84
|
+
*/
|
|
85
|
+
export const AllSizes: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<StoryWrapper>
|
|
88
|
+
<HeadingShowcase>
|
|
89
|
+
<small>title3xl (default: h1)</small>
|
|
90
|
+
<HeadingShared type="title3xl">Largest Shared Title</HeadingShared>
|
|
91
|
+
</HeadingShowcase>
|
|
92
|
+
<HeadingShowcase>
|
|
93
|
+
<small>title2xl (default: h1)</small>
|
|
94
|
+
<HeadingShared type="title2xl">Extra Large Shared Title</HeadingShared>
|
|
95
|
+
</HeadingShowcase>
|
|
96
|
+
<HeadingShowcase>
|
|
97
|
+
<small>titleXl (default: h2)</small>
|
|
98
|
+
<HeadingShared type="titleXl">Very Large Shared Title</HeadingShared>
|
|
99
|
+
</HeadingShowcase>
|
|
100
|
+
<HeadingShowcase>
|
|
101
|
+
<small>titleL (default: h3)</small>
|
|
102
|
+
<HeadingShared type="titleL">Large Shared Title</HeadingShared>
|
|
103
|
+
</HeadingShowcase>
|
|
104
|
+
<HeadingShowcase>
|
|
105
|
+
<small>titleM (default: h4)</small>
|
|
106
|
+
<HeadingShared type="titleM">Medium Shared Title</HeadingShared>
|
|
107
|
+
</HeadingShowcase>
|
|
108
|
+
<HeadingShowcase>
|
|
109
|
+
<small>titleS (default: h5)</small>
|
|
110
|
+
<HeadingShared type="titleS">Small Shared Title</HeadingShared>
|
|
111
|
+
</HeadingShowcase>
|
|
112
|
+
<HeadingShowcase>
|
|
113
|
+
<small>titleXs (default: h6)</small>
|
|
114
|
+
<HeadingShared type="titleXs">Extra Small Shared Title</HeadingShared>
|
|
115
|
+
</HeadingShowcase>
|
|
116
|
+
</StoryWrapper>
|
|
117
|
+
),
|
|
118
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { type ContentTextProps, TextContent } from './text_content.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Design Tokens/Typography/TextContent',
|
|
8
|
+
component: TextContent,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: '⚠️ **Internal Component**: This component is specifically designed for use within the SimpleMarkdown component.'
|
|
13
|
+
+ ' It provides content-specific text styles for markdown rendering (paragraphs and code snippets).'
|
|
14
|
+
+ ' For general text usage, use TextShared or TextMarketing instead.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: ['paragraph', 'snippet'],
|
|
22
|
+
description: 'Text type: paragraph for regular markdown text, snippet for inline code',
|
|
23
|
+
},
|
|
24
|
+
weight: {
|
|
25
|
+
control: { type: 'select' },
|
|
26
|
+
options: ['normal', 'bold'],
|
|
27
|
+
description: 'Font weight',
|
|
28
|
+
},
|
|
29
|
+
as: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'The HTML element to render as (default: p)',
|
|
32
|
+
},
|
|
33
|
+
children: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'The text content',
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
control: 'color',
|
|
39
|
+
description: 'Custom color for the text',
|
|
40
|
+
},
|
|
41
|
+
align: {
|
|
42
|
+
control: { type: 'select' },
|
|
43
|
+
options: ['left', 'center', 'right'],
|
|
44
|
+
description: 'Text alignment',
|
|
45
|
+
},
|
|
46
|
+
italic: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Apply italic style',
|
|
49
|
+
},
|
|
50
|
+
uppercase: {
|
|
51
|
+
control: 'boolean',
|
|
52
|
+
description: 'Transform text to uppercase',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
} as Meta<ContentTextProps>;
|
|
56
|
+
|
|
57
|
+
type Story = StoryObj<ContentTextProps>;
|
|
58
|
+
|
|
59
|
+
const StoryWrapper = styled.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 1.5rem;
|
|
63
|
+
padding: 2rem;
|
|
64
|
+
max-width: 800px;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const TextShowcase = styled.div`
|
|
68
|
+
padding: 1rem;
|
|
69
|
+
background: #f5f5f5;
|
|
70
|
+
border-radius: 4px;
|
|
71
|
+
|
|
72
|
+
small {
|
|
73
|
+
display: block;
|
|
74
|
+
color: #666;
|
|
75
|
+
font-size: 0.75rem;
|
|
76
|
+
margin-bottom: 0.5rem;
|
|
77
|
+
font-family: monospace;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const WarningBanner = styled.div`
|
|
82
|
+
background: #fff3cd;
|
|
83
|
+
border: 1px solid #ffc107;
|
|
84
|
+
border-radius: 4px;
|
|
85
|
+
padding: 1rem;
|
|
86
|
+
margin-bottom: 1.5rem;
|
|
87
|
+
|
|
88
|
+
strong {
|
|
89
|
+
color: #856404;
|
|
90
|
+
display: block;
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
p {
|
|
95
|
+
color: #856404;
|
|
96
|
+
margin: 0;
|
|
97
|
+
font-size: 0.875rem;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Default content text (used by SimpleMarkdown)
|
|
103
|
+
*
|
|
104
|
+
* ⚠️ This component is for internal use by SimpleMarkdown only
|
|
105
|
+
*/
|
|
106
|
+
export const Default: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
type: 'paragraph',
|
|
109
|
+
weight: 'normal',
|
|
110
|
+
children: 'Content text for markdown rendering.',
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* All content text variants as used in SimpleMarkdown component
|
|
116
|
+
*
|
|
117
|
+
* ⚠️ These text styles are specifically designed for markdown content rendering.
|
|
118
|
+
* For general application text, use TextShared or TextMarketing.
|
|
119
|
+
*/
|
|
120
|
+
export const AllVariants: Story = {
|
|
121
|
+
render: () => (
|
|
122
|
+
<StoryWrapper>
|
|
123
|
+
<WarningBanner>
|
|
124
|
+
<strong>⚠️ Internal Component</strong>
|
|
125
|
+
<p>
|
|
126
|
+
TextContent is used exclusively by the SimpleMarkdown component for rendering
|
|
127
|
+
markdown paragraphs and inline code snippets. For general text usage in your
|
|
128
|
+
application, use TextShared or TextMarketing components instead.
|
|
129
|
+
</p>
|
|
130
|
+
</WarningBanner>
|
|
131
|
+
|
|
132
|
+
<div>
|
|
133
|
+
<h3 style={{ marginTop: 0, marginBottom: '1rem' }}>Paragraph Type</h3>
|
|
134
|
+
<p style={{ fontSize: '0.875rem', color: '#666', marginBottom: '1rem' }}>
|
|
135
|
+
Used for regular text content in markdown documents
|
|
136
|
+
</p>
|
|
137
|
+
|
|
138
|
+
<TextShowcase>
|
|
139
|
+
<small>type=paragraph, weight=normal</small>
|
|
140
|
+
<TextContent type="paragraph" weight="normal">
|
|
141
|
+
This is a paragraph with normal weight, used for standard markdown text content.
|
|
142
|
+
It provides optimal readability for documentation and readme files.
|
|
143
|
+
</TextContent>
|
|
144
|
+
</TextShowcase>
|
|
145
|
+
|
|
146
|
+
<TextShowcase>
|
|
147
|
+
<small>type=paragraph, weight=bold</small>
|
|
148
|
+
<TextContent type="paragraph" weight="bold">
|
|
149
|
+
This is a paragraph with bold weight, used for **strong text** in markdown.
|
|
150
|
+
It creates emphasis for important information within the content.
|
|
151
|
+
</TextContent>
|
|
152
|
+
</TextShowcase>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div>
|
|
156
|
+
<h3 style={{ marginBottom: '1rem' }}>Snippet Type</h3>
|
|
157
|
+
<p style={{ fontSize: '0.875rem', color: '#666', marginBottom: '1rem' }}>
|
|
158
|
+
Used for inline code within markdown text (e.g., `code`)
|
|
159
|
+
</p>
|
|
160
|
+
|
|
161
|
+
<TextShowcase>
|
|
162
|
+
<small>type=snippet, weight=normal</small>
|
|
163
|
+
<TextContent type="snippet" weight="normal">
|
|
164
|
+
const inlineCode = "monospace text for code snippets";
|
|
165
|
+
</TextContent>
|
|
166
|
+
</TextShowcase>
|
|
167
|
+
|
|
168
|
+
<TextShowcase>
|
|
169
|
+
<small>type=snippet, weight=bold</small>
|
|
170
|
+
<TextContent type="snippet" weight="bold">
|
|
171
|
+
function boldCodeSnippet() { return "emphasized code"; }
|
|
172
|
+
</TextContent>
|
|
173
|
+
</TextShowcase>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div style={{ marginTop: '2rem', padding: '1.5rem', border: '1px solid #e0e0e0', borderRadius: '4px' }}>
|
|
177
|
+
<h4 style={{ marginTop: 0 }}>Example in Markdown Context</h4>
|
|
178
|
+
<TextContent type="paragraph" weight="normal" mb="space8">
|
|
179
|
+
The SimpleMarkdown component uses these styles to render markdown. For example,
|
|
180
|
+
when you write code like <TextContent type="snippet" weight="normal" as="span">npm install</TextContent> inline,
|
|
181
|
+
it uses the snippet type.
|
|
182
|
+
</TextContent>
|
|
183
|
+
<TextContent type="paragraph" weight="bold">
|
|
184
|
+
Bold text in markdown is rendered using paragraph with bold weight.
|
|
185
|
+
</TextContent>
|
|
186
|
+
</div>
|
|
187
|
+
</StoryWrapper>
|
|
188
|
+
),
|
|
189
|
+
};
|