@codecademy/styleguide 79.1.0-alpha.70191a.0 → 79.1.0-alpha.986593.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/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [79.1.0-alpha.
|
|
6
|
+
## [79.1.0-alpha.986593.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.0.0...@codecademy/styleguide@79.1.0-alpha.986593.0) (2026-02-12)
|
|
7
7
|
|
|
8
8
|
### Features
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/styleguide",
|
|
3
3
|
"description": "Styleguide & Component library for codecademy.com",
|
|
4
|
-
"version": "79.1.0-alpha.
|
|
4
|
+
"version": "79.1.0-alpha.986593.0",
|
|
5
5
|
"author": "Codecademy Engineering",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"repository": "git@github.com:Codecademy/gamut.git",
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "896f89ffb9384706a1df3a1dad16f56b89f9cfc1"
|
|
12
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks';
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
2
|
|
|
3
3
|
import { AboutHeader, TokenTable } from '~styleguide/blocks';
|
|
4
4
|
|
|
5
5
|
import { defaultColumns, getPropRows } from '../../shared/elements';
|
|
6
|
+
import * as LayoutStories from './Layout.stories';
|
|
6
7
|
|
|
7
8
|
export const parameters = {
|
|
8
9
|
title: 'Layout',
|
|
@@ -11,7 +12,7 @@ export const parameters = {
|
|
|
11
12
|
status: 'updating',
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
<Meta title="Foundations/System/Props/Layout" />
|
|
15
|
+
<Meta title="Foundations/System/Props/Layout" of={LayoutStories} />
|
|
15
16
|
|
|
16
17
|
<AboutHeader {...parameters} />
|
|
17
18
|
|
|
@@ -31,4 +32,14 @@ const LayoutExample = styled.div(system.layout);
|
|
|
31
32
|
/>;
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
### Width
|
|
38
|
+
|
|
39
|
+
<Canvas of={LayoutStories.WidthExample} />
|
|
40
|
+
|
|
41
|
+
### Direction
|
|
42
|
+
|
|
43
|
+
<Canvas of={LayoutStories.DirectionExample} />
|
|
44
|
+
|
|
34
45
|
<TokenTable rows={getPropRows('layout')} columns={defaultColumns} />
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Box, Markdown } from '@codecademy/gamut';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Box> = {
|
|
5
|
+
title: 'Foundations/System/Props/Layout',
|
|
6
|
+
component: Box,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof Box>;
|
|
11
|
+
|
|
12
|
+
export const WidthExample: Story = {
|
|
13
|
+
render: () => (
|
|
14
|
+
<Box bg="background-selected" p={16}>
|
|
15
|
+
<Box
|
|
16
|
+
bg="primary"
|
|
17
|
+
color="background-contrast"
|
|
18
|
+
height="300px"
|
|
19
|
+
p={16}
|
|
20
|
+
width="50%"
|
|
21
|
+
>
|
|
22
|
+
This box has <Markdown text="`width='50%' and height='300px'`." />{' '}
|
|
23
|
+
Inspect the box to see the rendered CSS property.
|
|
24
|
+
</Box>
|
|
25
|
+
</Box>
|
|
26
|
+
),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const DirectionExample: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<Box display="flex" flexDirection="row" gap={16}>
|
|
32
|
+
<Box bg="background-selected" p={16} width="50%">
|
|
33
|
+
<Box bg="primary" color="background-contrast" direction="ltr" p={16}>
|
|
34
|
+
<Markdown text="`direction='ltr'`." /> Left-to-right text direction
|
|
35
|
+
(default for English).
|
|
36
|
+
</Box>
|
|
37
|
+
</Box>
|
|
38
|
+
<Box bg="background-selected" p={16} width="50%">
|
|
39
|
+
<Box bg="primary" color="background-contrast" direction="rtl" p={16}>
|
|
40
|
+
<Markdown text="`direction='rtl'`." /> Right-to-left text direction
|
|
41
|
+
(used for Arabic, Hebrew, etc.).
|
|
42
|
+
</Box>
|
|
43
|
+
</Box>
|
|
44
|
+
</Box>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
@@ -485,8 +485,8 @@ const TRANSFORM_COLUMN = {
|
|
|
485
485
|
size: 'fill',
|
|
486
486
|
render: ({ transform, resolveProperty }: any) => (
|
|
487
487
|
<>
|
|
488
|
-
{transform && <Code>{transform
|
|
489
|
-
{resolveProperty && <Code>{resolveProperty
|
|
488
|
+
{transform && <Code>{transform.name}</Code>}{' '}
|
|
489
|
+
{resolveProperty && <Code>{resolveProperty.name}</Code>}
|
|
490
490
|
</>
|
|
491
491
|
),
|
|
492
492
|
};
|