@primer/react-brand 0.3.0-rc.7c3326c → 0.3.1-rc.9ad887b
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 +15 -1
- package/lib/Accordion/Accordion.d.ts +29 -0
- package/lib/Accordion/Accordion.visual.spec.d.ts +1 -0
- package/lib/Accordion/index.d.ts +1 -0
- package/lib/Button/Button.visual.spec.d.ts +1 -0
- package/lib/ExpandableArrow/ExpandableArrow.visual.spec.d.ts +1 -0
- package/lib/FAQ/FAQ.d.ts +37 -0
- package/lib/FAQ/FAQ.visual.spec.d.ts +1 -0
- package/lib/FAQ/index.d.ts +1 -0
- package/lib/Heading/Heading.visual.spec.d.ts +1 -0
- package/lib/Hero/Hero.visual.spec.d.ts +1 -0
- package/lib/InlineLink/InlineLink.d.ts +24 -0
- package/lib/InlineLink/InlineLink.visual.spec.d.ts +1 -0
- package/lib/InlineLink/index.d.ts +1 -0
- package/lib/Link/Link.visual.spec.d.ts +1 -0
- package/lib/MonaSans/MonaSans.visual.spec.d.ts +1 -0
- package/lib/River/River.d.ts +6 -1
- package/lib/River/River.visual.spec.d.ts +1 -0
- package/lib/Text/Text.visual.spec.d.ts +1 -0
- package/lib/ThemeProvider/ThemeProvider.visual.spec.d.ts +1 -0
- package/lib/css/main.css +361 -21
- package/lib/css/stylesheets.d.ts +1 -0
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/color-scales.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +16 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +6 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +19 -0
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +9 -0
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +16 -0
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +8 -0
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +19 -0
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +9 -0
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +19 -7
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/color-scales.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +92 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +47 -0
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +31 -0
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +49 -0
- package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +173 -0
- package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/base/colors/color-scales.js +1 -1
- package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/functional/colors/global.js +7 -2
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +7 -0
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +6 -0
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +7 -0
- package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +9 -0
- package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/color-scales.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/color-scales.js +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +9 -2
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +9 -2
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +18 -0
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +17 -0
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +15 -0
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +14 -0
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +16 -0
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +15 -0
- package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +18 -0
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +17 -0
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +1 -1
- package/lib/index.js.LICENSE.txt +9 -0
- package/package.json +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
# @primer/react-brand
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59](https://github.com/primer/react-brand/pull/59) [`fdc731b`](https://github.com/primer/react-brand/commit/fdc731bda050aaef7041aafe6aaa7857c49ea03b) Thanks [@rezrah](https://github.com/rezrah)! - Added `fillMedia` prop to River.Visual
|
|
8
|
+
|
|
9
|
+
Previously, all image and video children were automatically styled to fit the parent elements dimensions.
|
|
10
|
+
|
|
11
|
+
This isn't ideal in all situations, so the ability to toggle-off this behaviour is now available through an `fillMedia` prop.
|
|
12
|
+
|
|
3
13
|
## 0.3.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
6
16
|
|
|
7
|
-
- [
|
|
17
|
+
- [`c8609a8`](https://github.com/primer/react-brand/commit/c8609a8d35ea80192d85e97794390207f4624e63) Thanks [@rezrah](https://github.com/rezrah)! - added an FAQ component, which displays a list of questions and answers relating to a particular subject.
|
|
18
|
+
|
|
19
|
+
[See usage examples](https://primer.style/react-brand/components/FAQ)
|
|
20
|
+
|
|
21
|
+
* [#45](https://github.com/primer/react-brand/pull/45) [`2fb6924`](https://github.com/primer/react-brand/commit/2fb6924a834ddcbad34cfb97ecfc1659d54f4ed5) Thanks [@rezrah](https://github.com/rezrah)! - > **Warning**
|
|
8
22
|
|
|
9
23
|
> This is a breaking change, but as the library is a pre-v1 release we are publishing this update as a `minor` change.
|
|
10
24
|
> Please read the following instructions carefully before updating:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Design tokens
|
|
4
|
+
*/
|
|
5
|
+
import '../../lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css';
|
|
6
|
+
export declare type AccordionRootProps = {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
children: React.ReactElement<AccordionHeadingProps | AccordionContentProps>[];
|
|
10
|
+
} & React.HTMLAttributes<HTMLDetailsElement>;
|
|
11
|
+
export declare function AccordionRoot({ children, className, open, ...rest }: AccordionRootProps): JSX.Element;
|
|
12
|
+
declare type AccordionHeadingProps = {
|
|
13
|
+
className?: string;
|
|
14
|
+
children: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function AccordionHeading({ children, className }: AccordionHeadingProps): JSX.Element;
|
|
17
|
+
declare type AccordionContentProps = {
|
|
18
|
+
className?: string;
|
|
19
|
+
children: React.ReactElement | React.ReactElement[];
|
|
20
|
+
};
|
|
21
|
+
export declare function AccordionContent({ children, className }: AccordionContentProps): JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* Branded Accordion component
|
|
24
|
+
*/
|
|
25
|
+
export declare const Accordion: typeof AccordionRoot & {
|
|
26
|
+
Content: typeof AccordionContent;
|
|
27
|
+
Heading: typeof AccordionHeading;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Accordion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/FAQ/FAQ.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccordionHeading, AccordionContent, AccordionRoot, AccordionRootProps } from '..';
|
|
3
|
+
/**
|
|
4
|
+
* Design tokens
|
|
5
|
+
*/
|
|
6
|
+
import '../../lib/design-tokens/css/tokens/functional/components/faq/base.css';
|
|
7
|
+
import '../../lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css';
|
|
8
|
+
declare type FAQRootProps = {
|
|
9
|
+
className?: string;
|
|
10
|
+
children: React.ReactElement<FAQHeadingProps | FAQSubheadingProps | AccordionRootProps>[];
|
|
11
|
+
};
|
|
12
|
+
declare function FAQRoot({ children, className }: FAQRootProps): JSX.Element;
|
|
13
|
+
declare type FAQHeadingProps = {
|
|
14
|
+
className?: string;
|
|
15
|
+
size?: 'medium' | 'large';
|
|
16
|
+
align?: 'start' | 'center';
|
|
17
|
+
children: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FAQHeading({ children, className, size, align }: FAQHeadingProps): JSX.Element;
|
|
20
|
+
declare type FAQSubheadingProps = {
|
|
21
|
+
align?: 'start' | 'center';
|
|
22
|
+
className?: string;
|
|
23
|
+
children: string;
|
|
24
|
+
};
|
|
25
|
+
declare function FAQSubheading({ children, className }: FAQSubheadingProps): JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* FAQ component:
|
|
28
|
+
* {@link https://primer.style/react-brand/components/FAQ/ See usage examples}.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FAQ: typeof FAQRoot & {
|
|
31
|
+
Subheading: typeof FAQSubheading;
|
|
32
|
+
Heading: typeof FAQHeading;
|
|
33
|
+
Item: typeof AccordionRoot;
|
|
34
|
+
Question: typeof AccordionHeading;
|
|
35
|
+
Answer: typeof AccordionContent;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FAQ';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { TextSizes } from '../';
|
|
3
|
+
/**
|
|
4
|
+
* Design tokens
|
|
5
|
+
*/
|
|
6
|
+
import '../../lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css';
|
|
7
|
+
export declare type InlineLinkProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Forward a custom HTML class attribute
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Specify the links destination
|
|
14
|
+
*/
|
|
15
|
+
href: string;
|
|
16
|
+
/**
|
|
17
|
+
* Specify the text size
|
|
18
|
+
*/
|
|
19
|
+
size?: typeof TextSizes[number];
|
|
20
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
21
|
+
/**
|
|
22
|
+
* A HTML anchor link component that renders inline with adjacent text.
|
|
23
|
+
*/
|
|
24
|
+
export declare function InlineLink({ className, size, children, href, ...rest }: PropsWithChildren<InlineLinkProps>): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InlineLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/River/River.d.ts
CHANGED
|
@@ -51,6 +51,11 @@ declare type RiverContentProps = {
|
|
|
51
51
|
export declare const getHeadingWarning: (size: (typeof HeadingTags)[number]) => string;
|
|
52
52
|
declare function Content({ children, leadingComponent: LeadingComponent, trailingComponent: TrailingComponent }: RiverContentProps): JSX.Element;
|
|
53
53
|
declare type RiverVisualProps = {
|
|
54
|
+
/**
|
|
55
|
+
* Applies automatic size constraints to child images and video.
|
|
56
|
+
* This can be disabled by setting this prop to `false`.
|
|
57
|
+
*/
|
|
58
|
+
fillMedia?: boolean;
|
|
54
59
|
className?: string;
|
|
55
60
|
/**
|
|
56
61
|
* `img` and `video` elements will apply a shadow by default.
|
|
@@ -58,7 +63,7 @@ declare type RiverVisualProps = {
|
|
|
58
63
|
*/
|
|
59
64
|
hasShadow?: boolean;
|
|
60
65
|
};
|
|
61
|
-
declare function Visual({ children, className, hasShadow }: React.PropsWithChildren<RiverVisualProps>): JSX.Element;
|
|
66
|
+
declare function Visual({ fillMedia, children, className, hasShadow }: React.PropsWithChildren<RiverVisualProps>): JSX.Element;
|
|
62
67
|
/**
|
|
63
68
|
* Alternating text and image pairs.
|
|
64
69
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|