@primer/doctocat-nextjs 0.3.0 → 0.4.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
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @primer/doctocat-nextjs
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#25](https://github.com/primer/doctocat-nextjs/pull/25) [`fd2d9a1`](https://github.com/primer/doctocat-nextjs/commit/fd2d9a1ffde630fd8c8548f6bdf30d8d7a07faaa) Thanks [@danielguillan](https://github.com/danielguillan)! - Add a `Note` component to display informative and warning messages.
|
|
8
|
+
|
|
9
|
+
E.g.
|
|
10
|
+
|
|
11
|
+
<pre>
|
|
12
|
+
```jsx
|
|
13
|
+
<Note variant="warning">Your note content here</Note>
|
|
14
|
+
```
|
|
15
|
+
</pre>
|
|
16
|
+
|
|
3
17
|
## 0.3.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.Note {
|
|
2
|
+
--Note-bgColor: var(--bgColor-neutral-muted);
|
|
3
|
+
--Note-borderColor: var(--borderColor-neutral-emphasis);
|
|
4
|
+
|
|
5
|
+
background-color: var(--Note-bgColor);
|
|
6
|
+
border-inline-start: var(--brand-borderRadius-small) solid var(--Note-borderColor);
|
|
7
|
+
border-radius: var(--brand-borderRadius-small);
|
|
8
|
+
padding: var(--base-size-16);
|
|
9
|
+
margin-block-end: var(--base-size-16);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.Note *:last-child {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.Note--info {
|
|
17
|
+
--Note-bgColor: var(--bgColor-accent-muted);
|
|
18
|
+
--Note-borderColor: var(--borderColor-accent-emphasis);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.Note--warning {
|
|
22
|
+
--Note-bgColor: var(--bgColor-attention-muted);
|
|
23
|
+
--Note-borderColor: var(--borderColor-attention-emphasis);
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, {PropsWithChildren} from 'react'
|
|
2
|
+
|
|
3
|
+
import styles from './Note.module.css'
|
|
4
|
+
|
|
5
|
+
type NoteProps = {
|
|
6
|
+
variant?: 'info' | 'warning'
|
|
7
|
+
} & PropsWithChildren
|
|
8
|
+
|
|
9
|
+
export function Note({children, variant = 'info'}: NoteProps) {
|
|
10
|
+
return <div className={`${styles.Note} ${styles[`Note--${variant}`]}`}>{children}</div>
|
|
11
|
+
}
|
package/components/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export {DoDontContainer, Do, Dont} from './content/dos-and-donts/DosAndDonts'
|
|
5
5
|
export {Caption} from './content/caption/Caption'
|
|
6
|
+
export {Note} from './content/note/Note'
|
|
6
7
|
export * from './library'
|
|
7
8
|
export {TableOfContents} from './layout/table-of-contents/TableOfContents'
|
|
8
9
|
export {Article} from './layout/article/Article'
|