Skip to content

Commit 20a1669

Browse files
author
Joseph Lozano
committed
prototype
1 parent d6f6bed commit 20a1669

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

packages/design-tokens/scripts/build-tokens.js

+1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ const colorModeFormat = require('../src/formats/color-mode-attributes')
206206
`tokens/functional/components/grid/colors.json`,
207207
`tokens/functional/components/logosuite/colors.json`,
208208
`tokens/functional/components/timeline/colors.json`,
209+
`tokens/functional/components/prose/colors.js`,
209210
]
210211

211212
for (const path of filesForColorModes) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
brand: {
3+
Prose: {
4+
listStyleImageUrl: {
5+
default: {
6+
value: `url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' role='img' viewBox='0 -3 16 16' width='16' height='16' fill='black' style='display: inline-block; vertical-align: text-bottom; overflow: visible;'%3e%3cpath d='M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z'%3e%3c/path%3e%3c/svg%3e ")`,
7+
dark: `url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' role='img' viewBox='0 -3 16 16' width='16' height='16' fill='white' style='display: inline-block; vertical-align: text-bottom; overflow: visible;'%3e%3cpath d='M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z'%3e%3c/path%3e%3c/svg%3e ")`,
8+
},
9+
},
10+
},
11+
},
12+
}

packages/react/src/Prose/Prose.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139

140140
.Prose ul {
141141
list-style-type: image;
142-
list-style-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false' role='img' viewBox='0 -3 16 16' width='16' height='16' fill='currentColor' style='display: inline-block; vertical-align: text-bottom; overflow: visible;'%3e%3cpath d='M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z'%3e%3c/path%3e%3c/svg%3e ");
142+
list-style-image: var(--brand-Prose-listStyleImageUrl-default);
143143
}
144144

145145
.Prose li {

packages/react/src/Prose/Prose.stories.tsx

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react'
2-
import {ComponentMeta, ComponentStory} from '@storybook/react'
2+
import {StoryFn, Meta} from '@storybook/react'
33
import {Prose} from './Prose'
44
import placeholderImage from '../fixtures/images/placeholder-600x400.png'
5+
import {ThemeProvider} from '../ThemeProvider'
56

67
export default {
78
title: 'Components/Prose',
@@ -17,7 +18,7 @@ export default {
1718
},
1819
},
1920
},
20-
} as ComponentMeta<typeof Prose>
21+
} as Meta
2122

2223
const ExampleHtmlMarkup = `
2324
<h2>Heading level 2</h2>
@@ -57,7 +58,27 @@ const ExampleHtmlMarkup = `
5758
<p>Nunc velit odio, posuere eu felis eget, consectetur fermentum nisi. Aenean tempor odio id ornare ultrices. Quisque blandit condimentum tellus, semper efficitur sapien dapibus nec. </p>
5859
`
5960

60-
export const Playground: ComponentStory<typeof Prose> = args => <Prose {...args} html={ExampleHtmlMarkup} />
61+
export const Playground: StoryFn = args => <Prose {...args} html={ExampleHtmlMarkup} />
6162

6263
export const Default = Playground.bind({})
64+
export const DarkTheme = Playground.bind({})
65+
DarkTheme.args = {
66+
darkMode: true,
67+
}
68+
DarkTheme.argTypes = {
69+
colorMode: {
70+
darkMode: 'boolean',
71+
},
72+
}
73+
DarkTheme.decorators = [
74+
(Story, {args: {darkMode}}) => (
75+
<>
76+
<div style={{backgroundColor: darkMode ? 'black' : 'white'}}>
77+
<ThemeProvider colorMode={darkMode ? 'dark' : 'light'}>
78+
<Story />
79+
</ThemeProvider>
80+
</div>
81+
</>
82+
),
83+
]
6384
Default.args = {}

packages/react/src/Prose/Prose.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import clsx from 'clsx'
33
import type {BaseProps} from '../component-helpers'
44
import styles from './Prose.module.css'
55
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/prose/base.css'
6+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css'
67
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/inline-link/base.css'
78

89
export type ProseProps = {

packages/react/src/SubdomainNavBar/SubdomainNavBar.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ function Root({
226226
{hasLinks && !menuHidden && (
227227
<NavigationVisbilityObserver
228228
showOnlyOnNarrow
229+
aria-controls={'menu-navigation'}
229230
className={clsx(styles['SubdomainNavBar-primary-nav-list--visible'])}
230231
>
231232
{menuItems}

0 commit comments

Comments
 (0)