@codecademy/styleguide 79.0.1-alpha.4aeb6d.0 → 79.0.1-alpha.5950e5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.storybook/components/Elements/DocsContainer.tsx +0 -4
  2. package/.storybook/components/Elements/Markdown.tsx +1 -0
  3. package/.storybook/preview.ts +0 -14
  4. package/.storybook/theming/GamutThemeProvider.tsx +1 -7
  5. package/CHANGELOG.md +1 -1
  6. package/package.json +2 -2
  7. package/src/lib/Foundations/System/About.mdx +1 -1
  8. package/src/lib/Foundations/System/Props.mdx +230 -0
  9. package/src/lib/Foundations/System/ResponsiveProperties/ResponsiveProperties.mdx +3 -3
  10. package/src/lib/Foundations/System/ResponsiveProperties/ResponsiveProperties.stories.tsx +0 -1
  11. package/src/lib/Foundations/shared/elements.tsx +19 -69
  12. package/src/lib/Meta/About.mdx +1 -3
  13. package/src/lib/Meta/Usage Guide.mdx +1 -6
  14. package/src/lib/Molecules/Tips/InfoTip/InfoTip.mdx +1 -1
  15. package/src/lib/Organisms/BarChart/BarChart.mdx +414 -0
  16. package/src/lib/Organisms/BarChart/BarChart.stories.tsx +378 -0
  17. package/src/static/meta/toolbar.png +0 -0
  18. package/src/lib/Foundations/System/Props/About.mdx +0 -81
  19. package/src/lib/Foundations/System/Props/Background.mdx +0 -30
  20. package/src/lib/Foundations/System/Props/Border.mdx +0 -53
  21. package/src/lib/Foundations/System/Props/Border.stories.tsx +0 -138
  22. package/src/lib/Foundations/System/Props/Color.mdx +0 -42
  23. package/src/lib/Foundations/System/Props/Color.stories.tsx +0 -47
  24. package/src/lib/Foundations/System/Props/Flex.mdx +0 -28
  25. package/src/lib/Foundations/System/Props/Grid.mdx +0 -31
  26. package/src/lib/Foundations/System/Props/Layout.mdx +0 -34
  27. package/src/lib/Foundations/System/Props/List.mdx +0 -38
  28. package/src/lib/Foundations/System/Props/Positioning.mdx +0 -29
  29. package/src/lib/Foundations/System/Props/Shadow.mdx +0 -31
  30. package/src/lib/Foundations/System/Props/Space.mdx +0 -44
  31. package/src/lib/Foundations/System/Props/Space.stories.tsx +0 -48
  32. package/src/lib/Foundations/System/Props/Typography.mdx +0 -28
  33. package/src/lib/Meta/Logical and physical CSS properties.mdx +0 -123
@@ -0,0 +1,378 @@
1
+ import {
2
+ BarChart,
3
+ BarProps,
4
+ Box,
5
+ PartialBarChartTranslations,
6
+ } from '@codecademy/gamut';
7
+ import {
8
+ BookFlipPageIcon,
9
+ DataScienceIcon,
10
+ TerminalIcon,
11
+ } from '@codecademy/gamut-icons';
12
+ import { action } from '@storybook/addon-actions';
13
+ import type { Meta, StoryObj } from '@storybook/react';
14
+
15
+ const meta: Meta<typeof BarChart> = {
16
+ component: BarChart,
17
+ args: {
18
+ title: 'Skills experience chart',
19
+ description: 'Chart showing programming language experience levels',
20
+ minRange: 0,
21
+ maxRange: 2000,
22
+ unit: 'XP',
23
+ },
24
+ parameters: {
25
+ docs: {
26
+ description: {
27
+ component:
28
+ 'BarChart supports i18n via the `translations` prop. Accessibility keys (`gainedNowAt`, `inLabel`, `inOnly`) may be strings (fragments in the built-in template) or functions that receive scoped context (values, label, unit, locale) and return the full accessibility summary—useful for pluralization, word order, or locale-specific phrasing.',
29
+ },
30
+ },
31
+ },
32
+ };
33
+
34
+ export default meta;
35
+ type Story = StoryObj<typeof BarChart>;
36
+
37
+ const simpleBarData: BarProps[] = [
38
+ { yLabel: 'Python', seriesOneValue: 1500 },
39
+ { yLabel: 'JavaScript', seriesOneValue: 2000 },
40
+ { yLabel: 'HTML/CSS', seriesOneValue: 800 },
41
+ { yLabel: 'SQL', seriesOneValue: 600 },
42
+ { yLabel: 'React', seriesOneValue: 450 },
43
+ ];
44
+
45
+ const stackedBarData: BarProps[] = [
46
+ { yLabel: 'Python', seriesOneValue: 200, seriesTwoValue: 1500 },
47
+ {
48
+ yLabel: 'JavaScript',
49
+ icon: TerminalIcon,
50
+ seriesOneValue: 1800,
51
+ seriesTwoValue: 2000,
52
+ },
53
+ { yLabel: 'HTML/CSS', seriesOneValue: 600, seriesTwoValue: 800 },
54
+ { yLabel: 'SQL', seriesOneValue: 550, seriesTwoValue: 600 },
55
+ { yLabel: 'React', seriesOneValue: 300, seriesTwoValue: 450 },
56
+ ];
57
+
58
+ const accessibilityBarData: BarProps[] = [
59
+ { yLabel: 'Python', seriesOneValue: 200, seriesTwoValue: 1500 },
60
+ {
61
+ yLabel: 'JavaScript',
62
+ seriesOneValue: 1800,
63
+ seriesTwoValue: 2000,
64
+ href: '/javascript',
65
+ },
66
+ { yLabel: 'HTML/CSS', seriesOneValue: 600, seriesTwoValue: 800 },
67
+ { yLabel: 'SQL', seriesOneValue: 550, href: '/sql' },
68
+ { yLabel: 'Rust', seriesOneValue: 400 },
69
+ { yLabel: 'React', seriesOneValue: 300, seriesTwoValue: 450 },
70
+ ];
71
+
72
+ const accessibilityTranslations: PartialBarChartTranslations = {
73
+ accessibility: {
74
+ gainedNowAt: (ctx) =>
75
+ `${ctx.seriesOneValue} ${ctx.unit} gained — now at ${ctx.seriesTwoValue} ${ctx.unit} in ${ctx.yLabel}`,
76
+ inLabel: (ctx) => `${ctx.value} ${ctx.unit} in ${ctx.yLabel}`,
77
+ inOnly: (ctx) => `${ctx.value} ${ctx.unit}`.trim(),
78
+ },
79
+ locale: 'en',
80
+ };
81
+
82
+ const barDataWithIcons: BarProps[] = [
83
+ {
84
+ yLabel: 'Python',
85
+ seriesOneValue: 200,
86
+ seriesTwoValue: 1500,
87
+ icon: TerminalIcon,
88
+ },
89
+ {
90
+ yLabel: 'JavaScript',
91
+ seriesOneValue: 150,
92
+ seriesTwoValue: 2000,
93
+ icon: TerminalIcon,
94
+ },
95
+ {
96
+ yLabel: 'Data Science',
97
+ seriesOneValue: 100,
98
+ seriesTwoValue: 800,
99
+ icon: DataScienceIcon,
100
+ },
101
+ {
102
+ yLabel: 'Backend',
103
+ seriesOneValue: 50,
104
+ seriesTwoValue: 600,
105
+ icon: TerminalIcon,
106
+ },
107
+ {
108
+ yLabel: 'Reading',
109
+ seriesOneValue: 75,
110
+ seriesTwoValue: 450,
111
+ icon: BookFlipPageIcon,
112
+ },
113
+ ];
114
+
115
+ export const Default: Story = {
116
+ args: {
117
+ barValues: simpleBarData,
118
+ title: 'Skills experience chart',
119
+ description: 'Chart showing programming language experience levels',
120
+ },
121
+ };
122
+
123
+ export const Stacked: Story = {
124
+ args: {
125
+ barValues: stackedBarData,
126
+ title: 'Skills progress chart',
127
+ description: 'Progress toward total goals for each programming language',
128
+ },
129
+ };
130
+
131
+ export const WithIcons: Story = {
132
+ args: {
133
+ barValues: barDataWithIcons,
134
+ title: 'Skills progress with icons',
135
+ description: 'Skills progress with visual icons for each category',
136
+ },
137
+ };
138
+
139
+ export const Animated: Story = {
140
+ args: {
141
+ barValues: stackedBarData,
142
+ animate: true,
143
+ title: 'Animated skills chart',
144
+ description: 'Animated chart showing progress with entrance animations',
145
+ },
146
+ };
147
+
148
+ export const Interactive: Story = {
149
+ args: {
150
+ barValues: simpleBarData.map((bar) => ({
151
+ ...bar,
152
+ onClick: action(`Clicked ${bar.yLabel}`),
153
+ })),
154
+ title: 'Interactive skills chart',
155
+ description: 'Click on any row to view detailed course information',
156
+ },
157
+ };
158
+
159
+ export const WithLinks: Story = {
160
+ args: {
161
+ barValues: simpleBarData.map((bar) => ({
162
+ ...bar,
163
+ href: `#${bar.yLabel.toLowerCase().replace(/\s+/g, '-')}`,
164
+ })),
165
+ title: 'Skills chart with links',
166
+ description: 'Each row links to its corresponding course page',
167
+ },
168
+ };
169
+
170
+ export const WithVisualTitleAndDescription: Story = {
171
+ args: {
172
+ barValues: simpleBarData,
173
+ title: 'Programming Skills Overview',
174
+ description:
175
+ 'Experience points earned across different programming languages',
176
+ },
177
+ };
178
+
179
+ export const WithHiddenTitleAndDescription: Story = {
180
+ render: () => {
181
+ return (
182
+ <BarChart
183
+ barValues={simpleBarData}
184
+ description="Experience points earned across different programming languages"
185
+ hideDescription
186
+ hideTitle
187
+ maxRange={2000}
188
+ minRange={0}
189
+ title="Programming Skills Overview"
190
+ unit="XP"
191
+ />
192
+ );
193
+ },
194
+ };
195
+
196
+ export const WithExternalTitle: Story = {
197
+ render: () => {
198
+ return (
199
+ <>
200
+ <Box
201
+ as="h2"
202
+ bg="paleBlue"
203
+ border={1}
204
+ borderRadius="lg"
205
+ id="external-chart-title"
206
+ p={16}
207
+ textAlign="right"
208
+ >
209
+ Programming Skills Overview
210
+ </Box>
211
+ <BarChart
212
+ aria-labelledby="external-title"
213
+ barValues={simpleBarData}
214
+ description="Experience points earned across different programming languages"
215
+ hideDescription={false}
216
+ maxRange={2000}
217
+ minRange={0}
218
+ unit="XP"
219
+ />
220
+ </>
221
+ );
222
+ },
223
+ };
224
+
225
+ export const WithSorting: Story = {
226
+ args: {
227
+ barValues: simpleBarData,
228
+ sortFns: ['alphabetically', 'numerically', 'none'],
229
+ title: 'Skills experience chart',
230
+ description: 'Use the dropdown to sort bars by different criteria',
231
+ },
232
+ };
233
+
234
+ const customSortingBarValues = [
235
+ {
236
+ yLabel: 'Python',
237
+ seriesOneValue: 1500,
238
+ dateAdded: new Date('2023-01-15'),
239
+ },
240
+ {
241
+ yLabel: 'JavaScript',
242
+ seriesOneValue: 2000,
243
+ dateAdded: new Date('2023-03-20'),
244
+ },
245
+ {
246
+ yLabel: 'React',
247
+ seriesOneValue: 450,
248
+ dateAdded: new Date('2023-06-10'),
249
+ },
250
+ {
251
+ yLabel: 'TypeScript',
252
+ seriesOneValue: 300,
253
+ dateAdded: new Date('2023-08-05'),
254
+ },
255
+ {
256
+ yLabel: 'SQL',
257
+ seriesOneValue: 600,
258
+ dateAdded: new Date('2023-02-28'),
259
+ },
260
+ ];
261
+
262
+ export const WithCustomSorting: Story = {
263
+ args: {
264
+ barValues: customSortingBarValues,
265
+ sortFns: [
266
+ 'none',
267
+ {
268
+ label: 'Recently Added',
269
+ value: 'recent',
270
+ sortFn: (bars) => {
271
+ return [...bars].sort((a, b) => {
272
+ // TypeScript infers the type from barValues, so dateAdded is properly typed
273
+ const aDate = a.dateAdded as Date | undefined;
274
+ const bDate = b.dateAdded as Date | undefined;
275
+ if (!aDate && !bDate) return 0;
276
+ if (!aDate) return 1;
277
+ if (!bDate) return -1;
278
+ return bDate.getTime() - aDate.getTime();
279
+ });
280
+ },
281
+ },
282
+ {
283
+ label: 'Oldest First',
284
+ value: 'oldest',
285
+ sortFn: (bars) => {
286
+ return [...bars].sort((a, b) => {
287
+ // TypeScript infers the type from barValues, so dateAdded is properly typed
288
+ const aDate = a.dateAdded as Date | undefined;
289
+ const bDate = b.dateAdded as Date | undefined;
290
+ if (!aDate && !bDate) return 0;
291
+ if (!aDate) return 1;
292
+ if (!bDate) return -1;
293
+ return aDate.getTime() - bDate.getTime();
294
+ });
295
+ },
296
+ },
297
+ ],
298
+ title: 'Skills chart with date sorting',
299
+ description:
300
+ 'Custom sort functions can access additional properties on BarProps, such as dates',
301
+ },
302
+ };
303
+
304
+ /**
305
+ * Bar chart with custom styling
306
+ */
307
+ export const CustomStyles: Story = {
308
+ args: {
309
+ barValues: stackedBarData,
310
+ styleConfig: {
311
+ seriesTwoBarColor: 'text',
312
+ seriesOneBarColor: 'primary',
313
+ textColor: 'primary',
314
+ seriesOneLabel: 'feedback-error',
315
+ seriesTwoLabel: 'feedback-success',
316
+ },
317
+ title: 'Custom styled skills chart',
318
+ description: 'Custom color scheme applied to chart elements',
319
+ },
320
+ };
321
+
322
+ /**
323
+ * Bar chart with custom xScale interval
324
+ */
325
+ export const CustomScale: Story = {
326
+ args: {
327
+ barValues: simpleBarData,
328
+ maxRange: 2000,
329
+ xScale: 250,
330
+ title: 'Skills chart with custom scale',
331
+ description: 'Custom scale intervals for more granular value display',
332
+ },
333
+ };
334
+
335
+ /**
336
+ * Bar chart with string-based translations (e.g. Spanish).
337
+ * Partial translations are merged with defaults.
338
+ */
339
+ export const WithStringTranslations: Story = {
340
+ args: {
341
+ barValues: stackedBarData,
342
+ sortFns: ['alphabetically', 'numerically', 'none'],
343
+ title: 'Gráfico de habilidades',
344
+ description: 'Progreso hacia los objetivos totales por lenguaje',
345
+ unit: 'XP',
346
+ translations: {
347
+ locale: 'es',
348
+ sortLabel: 'Ordenar por:',
349
+ sortOptions: {
350
+ none: 'Ninguno',
351
+ labelAsc: 'Etiqueta (A-Z)',
352
+ labelDesc: 'Etiqueta (Z-A)',
353
+ valueAsc: 'Valor (Bajo-Alto)',
354
+ valueDesc: 'Valor (Alto-Bajo)',
355
+ },
356
+ accessibility: {
357
+ gainedNowAt: 'ganado - ahora en',
358
+ inLabel: 'en',
359
+ inOnly: 'en ',
360
+ },
361
+ },
362
+ },
363
+ };
364
+
365
+ /**
366
+ * Bar chart with function-based accessibility translations.
367
+ * Exercises gainedNowAt (stacked), inLabel (link/button single bar), and inOnly (non-interactive single bar).
368
+ */
369
+ export const WithFunctionTranslations: Story = {
370
+ args: {
371
+ barValues: accessibilityBarData,
372
+ description:
373
+ 'Custom aria-label summaries via translation functions (stacked, link, and non-interactive bars)',
374
+ title: 'Skills experience (accessibility functions)',
375
+ translations: accessibilityTranslations,
376
+ unit: 'XP',
377
+ },
378
+ };
Binary file
@@ -1,81 +0,0 @@
1
- import { Meta } from '@storybook/blocks';
2
-
3
- import {
4
- AboutHeader,
5
- addParentPath,
6
- TableOfContents,
7
- } from '~styleguide/blocks';
8
-
9
- import { parameters as backgroundParameters } from './Background.mdx';
10
- import { parameters as borderParameters } from './Border.mdx';
11
- import { parameters as colorParameters } from './Color.mdx';
12
- import { parameters as flexParameters } from './Flex.mdx';
13
- import { parameters as gridParameters } from './Grid.mdx';
14
- import { parameters as layoutParameters } from './Layout.mdx';
15
- import { parameters as listParameters } from './List.mdx';
16
- import { parameters as positioningParameters } from './Positioning.mdx';
17
- import { parameters as shadowParameters } from './Shadow.mdx';
18
- import { parameters as spaceParameters } from './Space.mdx';
19
- import { parameters as typographyParameters } from './Typography.mdx';
20
-
21
- export const parameters = {
22
- id: 'Foundations/System/Props',
23
- title: 'Props',
24
- subtitle:
25
- 'Reusable CSS-in-JS props with predictable behaviors and a consistent API for responsive CSS.',
26
- status: 'current',
27
- source: {
28
- repo: 'gamut-styles',
29
- githubLink:
30
- 'https://github.com/Codecademy/gamut/blob/main/packages/gamut-styles/src/variance/config.ts',
31
- },
32
- };
33
-
34
- <Meta title="Foundations/System/Props/About" />
35
-
36
- <AboutHeader {...parameters} />
37
-
38
- We provide a set of out of style functions out of the box through `@codecademy/gamut-styles` that are standardized throughout all of our components. These props are strongly typed and can be included as necessary on any styled component.
39
-
40
- System props have a few facets that are important to note:
41
-
42
- - They can some times represent multiple properties.
43
- - They may be restricted to specific token scales but will always have access to global css values like `initial` and `none`.
44
- - They may have a function that transforms the given value into a standardized value (e.g. `width={.5}` => `width: 50%`)
45
-
46
- We've grouped these into a few main groups that affect simliar behaviors: `layout`, `space`, `color`, `border`, `background`, `typography`, `positioning`, `grid`, `flex`, `shadow`.
47
-
48
- You may import these groups directly from `gamut-styles`.
49
-
50
- ```tsx
51
- import { variance } from '@codecademy/variance';
52
- import { system } from '@codecademy/gamut-styles';
53
-
54
- const ExampleContainer = styled.div(
55
- variance.compose(system.layout, system.positioning)
56
- );
57
-
58
- <ExampleContainer position="absolute" width="50px" height="50px" />;
59
- ```
60
-
61
- Each system prop has 3 important features:
62
-
63
- - `properties`: Any number of CSS Properties this prop is responsible for.
64
- - `scale`: A set of values that determines valid inputs for each prop based on the selected theme and that theme's typing (e.g. if the `lxStudio` theme is being used, a scale of `colors` will restrict to the `lxStudio` theme's colors). These are generally aliases for more verbose or opaque CSS properties allowing you to specify a human readable name in your props. If a prop doesn't have a scale that means it accepts all valid `CSSType` values as props, however if it does have a scale it will only accept global values and keys of the provided scale.
65
- - `transform`: A function that changes the prop / scale value prior to adding it to the stylehseet. This allows us to add / change units for properties like `width` and `height`. Or ensure extra defaults or fallbacks are added dynamically.
66
-
67
- <TableOfContents
68
- links={addParentPath(parameters.id, [
69
- layoutParameters,
70
- spaceParameters,
71
- typographyParameters,
72
- colorParameters,
73
- borderParameters,
74
- flexParameters,
75
- gridParameters,
76
- backgroundParameters,
77
- positioningParameters,
78
- shadowParameters,
79
- listParameters,
80
- ])}
81
- />
@@ -1,30 +0,0 @@
1
- import { Meta } from '@storybook/blocks';
2
-
3
- import { AboutHeader, TokenTable } from '~styleguide/blocks';
4
-
5
- import { defaultColumns, getPropRows } from '../../shared/elements';
6
-
7
- export const parameters = {
8
- title: 'Background',
9
- subtitle:
10
- 'Props for background manipulation (sizing / repitition / images), for background color see `colors`.',
11
- status: 'current',
12
- };
13
-
14
- <Meta title="Foundations/System/Props/Background" />
15
-
16
- <AboutHeader {...parameters} />
17
-
18
- Background props control how background images and patterns are displayed on elements. These properties give you control over image sizing, positioning, and repetition behavior. For solid background colors, use the color props which connect to the theme's color palette.
19
-
20
- ```tsx
21
- import styled from '@emotion/styled';
22
- import { system } from '@codecademy/gamut-styles';
23
- import myBg from './myBg.png';
24
-
25
- const BackgroundExample = styled.div(system.background);
26
-
27
- <BackgroundExample background={`url(${myBg}`} backgroundSize="cover" />;
28
- ```
29
-
30
- <TokenTable rows={getPropRows('background')} columns={defaultColumns} />
@@ -1,53 +0,0 @@
1
- import { Canvas, Meta } from '@storybook/blocks';
2
-
3
- import { AboutHeader, Callout, TokenTable } from '~styleguide/blocks';
4
-
5
- import { defaultColumns, getPropRows } from '../../shared/elements';
6
- import * as BorderStories from './Border.stories';
7
-
8
- export const parameters = {
9
- title: 'Border',
10
- subtitle: 'Border styles',
11
- status: 'updating',
12
- };
13
-
14
- <Meta of={BorderStories} title="Foundations/System/Props/Border" />
15
-
16
- <AboutHeader {...parameters} />
17
-
18
- Border props enable you to add and style borders on any side of an element. These properties support directional borders (top, right, bottom, left) as well as convenient shorthands for horizontal and vertical borders. Border radius values connect to the theme's `borderRadii` scale for consistent corner rounding.
19
-
20
- ```tsx
21
- import styled from '@emotion/styled';
22
- import { system } from '@codecademy/gamut-styles';
23
-
24
- const BorderExample = styled.div(system.border);
25
-
26
- <BorderExample
27
- border={1}
28
- borderLeft="none"
29
- borderRightStyle="dotted"
30
- borderRadius="md"
31
- />;
32
- ```
33
-
34
- These border props support both physical and logical CSS properties and will render the appropriate properties based on `useLogicalProperties`'s value passed into the `<GamutProvider>` at the root of your application.
35
-
36
- <Callout
37
- text={
38
- <>
39
- You can use the <strong>LogicalProps</strong> button in the toolbar to
40
- switch between modes.
41
- </>
42
- }
43
- />
44
-
45
- <Canvas of={BorderStories.DirectionalBorderExample} />
46
-
47
- <Canvas of={BorderStories.BorderWidthExample} />
48
-
49
- <Canvas of={BorderStories.BorderRadiusExample} />
50
-
51
- <Canvas of={BorderStories.BorderStyleExample} />
52
-
53
- <TokenTable rows={getPropRows('border')} columns={defaultColumns} />
@@ -1,138 +0,0 @@
1
- import { Box, FlexBox, Markdown } from '@codecademy/gamut';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
-
4
- const meta: Meta<typeof Box> = {
5
- title: 'Foundations/System/Props/Border',
6
- component: Box,
7
- };
8
-
9
- export default meta;
10
- type Story = StoryObj<typeof Box>;
11
-
12
- export const DirectionalBorderExample: Story = {
13
- render: () => (
14
- <FlexBox gap={16} row>
15
- <Box
16
- bg="background-selected"
17
- borderX={2}
18
- borderY={1}
19
- p={16}
20
- textAlign="center"
21
- >
22
- This box has <Markdown text="`borderX={2}`, `borderY={1}`." /> Inspect
23
- the example to see what CSS properties are rendered based on the logical
24
- properties mode.
25
- </Box>
26
- <Box
27
- bg="background-selected"
28
- borderLeft={2}
29
- borderRight={1}
30
- p={16}
31
- textAlign="center"
32
- >
33
- This box has <Markdown text="`borderLeft={2}`, `borderRight={1}`." />{' '}
34
- Inspect the example to see what CSS properties are rendered based on the
35
- logical properties mode.
36
- </Box>
37
- </FlexBox>
38
- ),
39
- };
40
-
41
- export const BorderWidthExample: Story = {
42
- render: () => (
43
- <FlexBox gap={16} row>
44
- <Box
45
- bg="background-selected"
46
- border={1}
47
- borderWidthX="4px"
48
- borderWidthY="10px"
49
- p={16}
50
- textAlign="center"
51
- >
52
- This box has{' '}
53
- <Markdown text="`borderWidthX='4px'` and `borderWidthY='10px'`." />{' '}
54
- Inspect the example to see what CSS properties are rendered based on the
55
- logical properties mode.
56
- </Box>
57
- <Box
58
- bg="background-selected"
59
- border={1}
60
- borderWidthRight="10px"
61
- borderWidthTop="4px"
62
- p={16}
63
- textAlign="center"
64
- >
65
- This box has{' '}
66
- <Markdown text="`borderWidthTop='4px'` and `borderWidthRight='10px'`." />{' '}
67
- Inspect the example to see what CSS properties are rendered based on the
68
- logical properties mode.
69
- </Box>
70
- </FlexBox>
71
- ),
72
- };
73
-
74
- export const BorderRadiusExample: Story = {
75
- render: () => (
76
- <FlexBox gap={16} row>
77
- <Box
78
- bg="background-selected"
79
- border={1}
80
- borderRadiusLeft="lg"
81
- borderRadiusRight="none"
82
- p={16}
83
- textAlign="center"
84
- >
85
- This box has{' '}
86
- <Markdown text="`borderRadiusLeft='lg'` and `borderRadiusRight='none'`." />{' '}
87
- Inspect the example to see what CSS properties are rendered based on the
88
- logical properties mode.
89
- </Box>
90
- <Box
91
- bg="background-selected"
92
- border={1}
93
- borderRadiusBottomLeft="xl"
94
- borderRadiusTopRight="xl"
95
- p={16}
96
- textAlign="center"
97
- >
98
- This box has{' '}
99
- <Markdown text="`borderRadiusTopRight='xl'` and `borderRadiusBottomLeft='xl'`." />{' '}
100
- Inspect the example to see what CSS properties are rendered based on the
101
- logical properties mode.
102
- </Box>
103
- </FlexBox>
104
- ),
105
- };
106
-
107
- export const BorderStyleExample: Story = {
108
- render: () => (
109
- <FlexBox gap={16} row>
110
- <Box
111
- bg="background-selected"
112
- border={1}
113
- borderStyleX="dashed"
114
- borderStyleY="dotted"
115
- p={16}
116
- textAlign="center"
117
- >
118
- This box has{' '}
119
- <Markdown text="`borderStyleX='dashed'` and `borderStyleY='dotted'`." />{' '}
120
- Inspect the example to see what CSS properties are rendered based on the
121
- logical properties mode.
122
- </Box>
123
- <Box
124
- bg="background-selected"
125
- border={1}
126
- borderStyleBottom="dotted"
127
- borderStyleLeft="dashed"
128
- p={16}
129
- textAlign="center"
130
- >
131
- This box has{' '}
132
- <Markdown text="`borderStyleBottom='dotted'` and `borderStyleLeft='dashed'`." />{' '}
133
- Inspect the example to see what CSS properties are rendered based on the
134
- logical properties mode.
135
- </Box>
136
- </FlexBox>
137
- ),
138
- };