@codecademy/styleguide 79.0.1-alpha.a46571.0 → 79.0.1-alpha.d459d2.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 +1 -1
- package/package.json +2 -2
- package/src/lib/Foundations/System/Props/Border.mdx +4 -0
- package/src/lib/Foundations/System/Props/Border.stories.tsx +119 -25
- package/src/lib/Foundations/System/Props/Color.mdx +17 -3
- package/src/lib/Foundations/System/Props/Color.stories.tsx +47 -0
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.0.1-alpha.
|
|
6
|
+
### [79.0.1-alpha.d459d2.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.0.0...@codecademy/styleguide@79.0.1-alpha.d459d2.0) (2026-01-30)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @codecademy/styleguide
|
|
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.0.1-alpha.
|
|
4
|
+
"version": "79.0.1-alpha.d459d2.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": "17701302184386ae334b4add80c0b4ffaf573079"
|
|
12
12
|
}
|
|
@@ -46,4 +46,8 @@ These border props support both physical and logical CSS properties and will ren
|
|
|
46
46
|
|
|
47
47
|
<Canvas of={BorderStories.BorderWidthExample} />
|
|
48
48
|
|
|
49
|
+
<Canvas of={BorderStories.BorderRadiusExample} />
|
|
50
|
+
|
|
51
|
+
<Canvas of={BorderStories.BorderStyleExample} />
|
|
52
|
+
|
|
49
53
|
<TokenTable rows={getPropRows('border')} columns={defaultColumns} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box, Markdown } from '@codecademy/gamut';
|
|
1
|
+
import { Box, FlexBox, Markdown } from '@codecademy/gamut';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Box> = {
|
|
@@ -11,34 +11,128 @@ type Story = StoryObj<typeof Box>;
|
|
|
11
11
|
|
|
12
12
|
export const DirectionalBorderExample: Story = {
|
|
13
13
|
render: () => (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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>
|
|
26
38
|
),
|
|
27
39
|
};
|
|
28
40
|
|
|
29
41
|
export const BorderWidthExample: Story = {
|
|
30
42
|
render: () => (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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>
|
|
43
137
|
),
|
|
44
138
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks';
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
2
|
|
|
3
|
-
import { AboutHeader, TokenTable } from '~styleguide/blocks';
|
|
3
|
+
import { AboutHeader, Callout, TokenTable } from '~styleguide/blocks';
|
|
4
4
|
|
|
5
5
|
import { defaultColumns, getPropRows } from '../../shared/elements';
|
|
6
|
+
import * as ColorStories from './Color.stories';
|
|
6
7
|
|
|
7
8
|
export const parameters = {
|
|
8
9
|
title: 'Color',
|
|
@@ -10,7 +11,7 @@ export const parameters = {
|
|
|
10
11
|
status: 'current',
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
<Meta title="Foundations/System/Props/Color" />
|
|
14
|
+
<Meta of={ColorStories} title="Foundations/System/Props/Color" />
|
|
14
15
|
|
|
15
16
|
<AboutHeader {...parameters} />
|
|
16
17
|
|
|
@@ -25,4 +26,17 @@ const ColorExample = styled.div(system.color);
|
|
|
25
26
|
<ColorExample bg="navy" textColor="gray-100" borderColor="blue" />;
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
These color 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.
|
|
30
|
+
|
|
31
|
+
<Callout
|
|
32
|
+
text={
|
|
33
|
+
<>
|
|
34
|
+
You can use the <strong>LogicalProps</strong> button in the toolbar to
|
|
35
|
+
switch between modes.
|
|
36
|
+
</>
|
|
37
|
+
}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<Canvas of={ColorStories.BorderColorExample} />
|
|
41
|
+
|
|
28
42
|
<TokenTable rows={getPropRows('color')} columns={defaultColumns} />
|
|
@@ -0,0 +1,47 @@
|
|
|
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/Color',
|
|
6
|
+
component: Box,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof Box>;
|
|
11
|
+
|
|
12
|
+
export const BorderColorExample: Story = {
|
|
13
|
+
render: () => (
|
|
14
|
+
<FlexBox gap={16} row>
|
|
15
|
+
<Box
|
|
16
|
+
bg="background-selected"
|
|
17
|
+
border={1}
|
|
18
|
+
borderColorX="feedback-success"
|
|
19
|
+
borderColorY="feedback-error"
|
|
20
|
+
borderWidth="4px"
|
|
21
|
+
p={16}
|
|
22
|
+
textAlign="center"
|
|
23
|
+
>
|
|
24
|
+
This box has{' '}
|
|
25
|
+
<Markdown text="`borderColorX='feedback-success'` and `borderColorY='feedback-error'`." />{' '}
|
|
26
|
+
Inspect the example to see what CSS properties are rendered based on the
|
|
27
|
+
logical properties mode.
|
|
28
|
+
</Box>
|
|
29
|
+
<Box
|
|
30
|
+
bg="background-selected"
|
|
31
|
+
border={1}
|
|
32
|
+
borderColorBottom="feedback-warning"
|
|
33
|
+
borderColorLeft="feedback-success"
|
|
34
|
+
borderColorRight="feedback-error"
|
|
35
|
+
borderColorTop="interface"
|
|
36
|
+
borderWidth="4px"
|
|
37
|
+
p={16}
|
|
38
|
+
textAlign="center"
|
|
39
|
+
>
|
|
40
|
+
This box has{' '}
|
|
41
|
+
<Markdown text="`borderColorBottom='feedback-warning'` and `borderColorLeft='feedback-success'` and `borderColorRight='feedback-error'` and `borderColorTop='interface'`." />{' '}
|
|
42
|
+
Inspect the example to see what CSS properties are rendered based on the
|
|
43
|
+
logical properties mode.
|
|
44
|
+
</Box>
|
|
45
|
+
</FlexBox>
|
|
46
|
+
),
|
|
47
|
+
};
|