@primer/react-brand 0.17.0-rc.e3d3fb9 → 0.17.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/lib/Card/Card.d.ts +2 -1
- package/lib/Grid/Grid.d.ts +69 -0
- package/lib/Grid/Grid.visual.spec.d.ts +1 -0
- package/lib/Grid/index.d.ts +1 -0
- package/lib/Image/Image.d.ts +3 -1
- package/lib/SubdomainNavBar/SubdomainNavBar.d.ts +1 -1
- package/lib/css/main.css +789 -33
- 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 +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +13 -0
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +8 -0
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +25 -0
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.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 +1 -8
- 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 +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/control/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +31 -0
- package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +121 -0
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/control/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +6 -0
- package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +8 -0
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/control/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/control/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +15 -0
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +14 -0
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +17 -0
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +16 -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/image/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
- 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 +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- 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 +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/Card/Card.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { BaseProps } from '../component-helpers';
|
|
|
7
7
|
*/
|
|
8
8
|
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/card/base.css';
|
|
9
9
|
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css';
|
|
10
|
+
import { Icon as IconProps } from '@primer/octicons-react';
|
|
10
11
|
export declare const CardIconColors: readonly ["default", "blue", "coral", "green", "gray", "indigo", "lemon", "lime", "orange", "pink", "purple", "red", "teal", "yellow"];
|
|
11
12
|
export declare const defaultCardIconColor: "default";
|
|
12
13
|
export declare type CardProps = {
|
|
@@ -24,7 +25,7 @@ export declare type CardProps = {
|
|
|
24
25
|
ctaText?: string;
|
|
25
26
|
} & BaseProps<HTMLAnchorElement> & React.ComponentPropsWithoutRef<'a'>;
|
|
26
27
|
declare type CardIconProps = BaseProps<HTMLSpanElement> & {
|
|
27
|
-
icon: React.ReactNode;
|
|
28
|
+
icon: React.ReactNode | IconProps;
|
|
28
29
|
color?: typeof CardIconColors[number];
|
|
29
30
|
hasBackground?: boolean;
|
|
30
31
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BaseProps } from '../component-helpers';
|
|
3
|
+
/**
|
|
4
|
+
* Design tokens
|
|
5
|
+
*/
|
|
6
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/grid/grid.css';
|
|
7
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css';
|
|
8
|
+
declare type ResponsiveMap = {
|
|
9
|
+
xsmall?: GridColumnIndex;
|
|
10
|
+
small?: GridColumnIndex;
|
|
11
|
+
medium?: GridColumnIndex;
|
|
12
|
+
large?: GridColumnIndex;
|
|
13
|
+
xlarge?: GridColumnIndex;
|
|
14
|
+
xxlarge?: GridColumnIndex;
|
|
15
|
+
};
|
|
16
|
+
export declare type GridColumnIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
17
|
+
export declare type GridProps<T extends keyof JSX.IntrinsicElements = 'div'> = React.HTMLAttributes<T> & {
|
|
18
|
+
/**
|
|
19
|
+
* The HTML element used to render the grid.
|
|
20
|
+
*/
|
|
21
|
+
as?: T | 'div' | 'span' | 'section';
|
|
22
|
+
/**
|
|
23
|
+
* Visual aid to help with alignment.
|
|
24
|
+
*/
|
|
25
|
+
enableOverlay?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Test id for the root element.
|
|
28
|
+
*/
|
|
29
|
+
['data-testid']?: string;
|
|
30
|
+
} & (T extends 'span' ? BaseProps<HTMLSpanElement> : T extends 'section' ? BaseProps<HTMLElement> : BaseProps<HTMLDivElement>);
|
|
31
|
+
declare type GridColumnProps<T extends keyof JSX.IntrinsicElements = 'div'> = {
|
|
32
|
+
as?: T | 'div' | 'span' | 'section';
|
|
33
|
+
span?: GridColumnIndex | ResponsiveMap;
|
|
34
|
+
start?: GridColumnIndex | ResponsiveMap;
|
|
35
|
+
} & (T extends 'span' ? BaseProps<HTMLSpanElement> : T extends 'section' ? BaseProps<HTMLElement> : BaseProps<HTMLDivElement>);
|
|
36
|
+
/**
|
|
37
|
+
* Use Grid to create flexible and responsive grid-based layouts
|
|
38
|
+
* @see https://primer.style/brand/components/Grid
|
|
39
|
+
* @example
|
|
40
|
+
* <Grid>
|
|
41
|
+
* <Grid.Column span="6">
|
|
42
|
+
* ...
|
|
43
|
+
* </Grid.Column>
|
|
44
|
+
* </Grid>
|
|
45
|
+
*/
|
|
46
|
+
export declare const Grid: React.NamedExoticComponent<React.HTMLAttributes<"div"> & {
|
|
47
|
+
/**
|
|
48
|
+
* The HTML element used to render the grid.
|
|
49
|
+
*/
|
|
50
|
+
as?: "div" | "section" | "span" | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Visual aid to help with alignment.
|
|
53
|
+
*/
|
|
54
|
+
enableOverlay?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Test id for the root element.
|
|
57
|
+
*/
|
|
58
|
+
"data-testid"?: string | undefined;
|
|
59
|
+
} & BaseProps<HTMLDivElement> & {
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
}> & {
|
|
62
|
+
readonly type: ({ className, children, as, enableOverlay, ["data-testid"]: testId, ...rest }: PropsWithChildren<GridProps>) => JSX.Element;
|
|
63
|
+
} & {
|
|
64
|
+
Column: React.MemoExoticComponent<({ children, as, span, start, className, ...rest }: PropsWithChildren<GridColumnProps>) => JSX.Element>;
|
|
65
|
+
testIds: {
|
|
66
|
+
root: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Grid';
|
package/lib/Image/Image.d.ts
CHANGED
|
@@ -6,15 +6,17 @@ export declare type ImageProps = React.ImgHTMLAttributes<HTMLImageElement> & Bas
|
|
|
6
6
|
alt: string;
|
|
7
7
|
aspectRatio?: AspectRatio;
|
|
8
8
|
media?: string;
|
|
9
|
+
srcSet?: Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'srcSet'>;
|
|
9
10
|
} & ({
|
|
10
11
|
as?: 'img';
|
|
11
|
-
srcSet?: '
|
|
12
|
+
srcSet?: Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'srcSet'>;
|
|
12
13
|
} | {
|
|
13
14
|
as: 'picture';
|
|
14
15
|
sources?: {
|
|
15
16
|
srcset: string;
|
|
16
17
|
media: string;
|
|
17
18
|
}[];
|
|
19
|
+
srcSet?: undefined;
|
|
18
20
|
});
|
|
19
21
|
export declare const Image: ({ className, aspectRatio, as, ref, alt, width, height, media, srcSet, ...rest }: ImageProps) => JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -59,7 +59,7 @@ declare type SearchProps = {
|
|
|
59
59
|
};
|
|
60
60
|
declare type CTAActionProps = {
|
|
61
61
|
href: string;
|
|
62
|
-
}
|
|
62
|
+
} & React.HTMLAttributes<HTMLAnchorElement>;
|
|
63
63
|
declare function PrimaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
|
|
64
64
|
declare function SecondaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
|
|
65
65
|
export declare const SubdomainNavBar: typeof Root & {
|