@primer/react-brand 0.1.0-rc.0c7d40e → 0.1.0-rc.c341bbe

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/fonts/alliance-1.woff2 +0 -0
  3. package/fonts/alliance-2.woff2 +0 -0
  4. package/fonts/fonts.css +30 -0
  5. package/lib/Heading/Heading.d.ts +20 -0
  6. package/lib/Heading/index.d.ts +1 -0
  7. package/lib/Hero/Hero.d.ts +2 -1
  8. package/lib/MonaSans/MonaSans.d.ts +10 -0
  9. package/lib/MonaSans/index.d.ts +1 -0
  10. package/lib/Text/Text.d.ts +36 -0
  11. package/lib/Text/index.d.ts +1 -0
  12. package/lib/css/main.css +1458 -53
  13. package/lib/css/stylesheets.d.ts +8 -0
  14. package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
  15. package/lib/design-tokens/css/tokens/base/typography/typography.css +4 -1
  16. package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
  17. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
  18. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
  19. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
  20. package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
  21. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +166 -0
  22. package/lib/design-tokens/css/tokens/functional/typography/typography.css +59 -2
  23. package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
  24. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +57 -9
  25. package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
  26. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
  27. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
  28. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
  29. package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
  30. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
  31. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1950 -3
  32. package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
  33. package/lib/design-tokens/js/tokens/base/typography/typography.js +8 -5
  34. package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
  35. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
  36. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
  37. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
  38. package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
  39. package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
  40. package/lib/design-tokens/js/tokens/functional/typography/typography.js +59 -2
  41. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
  42. package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
  43. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +98 -5
  44. package/lib/design-tokens/ts/tokens/base/typography/typography.js +8 -5
  45. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
  46. package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
  47. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  48. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
  49. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  50. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
  51. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
  52. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
  53. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
  54. package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
  55. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
  56. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
  57. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +81 -2
  58. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +81 -2
  59. package/lib/index.d.ts +3 -0
  60. package/lib/index.js +1 -1
  61. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@
8
8
 
9
9
  ### Patch Changes
10
10
 
11
+ - [#23](https://github.com/primer/react-brand/pull/23) [`77abf53`](https://github.com/primer/react-brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - add Text and Heading components
12
+
13
+ * [#23](https://github.com/primer/react-brand/pull/23) [`77abf53`](https://github.com/primer/react-brand/commit/77abf535e77ef26fa29fb09d6d2dfb746f4bc383) Thanks [@rezrah](https://github.com/rezrah)! - forward className in Hero
14
+
11
15
  - [#25](https://github.com/primer/react-brand/pull/25) [`4b00b72`](https://github.com/primer/react-brand/commit/4b00b72f5dbf5e578351ea77e1e74cddc69833e7) Thanks [@rezrah](https://github.com/rezrah)! - adds baseline tokens
12
16
 
13
17
  * [#21](https://github.com/primer/react-brand/pull/21) [`ab06cce`](https://github.com/primer/react-brand/commit/ab06cceb6ed3b2eaca70f9738b9708343b4e6db9) Thanks [@rezrah](https://github.com/rezrah)! - Remove fixed background color from `Hero` to allow underlying customisation to be surfaced.
Binary file
Binary file
@@ -0,0 +1,30 @@
1
+ @font-face {
2
+ font-family: 'Alliance1';
3
+ src: url('./alliance-1.woff2') format('woff2 supports variations'),
4
+ url('./alliance-1.woff2') format('woff2-variations');
5
+ font-weight: 200 900;
6
+ font-display: swap;
7
+ font-synthesis: none;
8
+ }
9
+
10
+ @font-face {
11
+ font-family: 'Alliance1Fallback';
12
+ size-adjust: 104.5%;
13
+ ascent-override: 71%;
14
+ src: local(Arial);
15
+ }
16
+
17
+ @font-face {
18
+ font-family: 'Alliance1HeaderFallback';
19
+ size-adjust: 103.1%;
20
+ ascent-override: 70%;
21
+ src: local(Arial Bold);
22
+ }
23
+
24
+ @font-face {
25
+ font-family: 'Alliance2';
26
+ src: url('./alliance-2.woff2') format('woff2 supports variations'),
27
+ url('./alliance-2.woff2') format('woff2-variations');
28
+ font-weight: 200 900;
29
+ font-display: swap;
30
+ }
@@ -0,0 +1,20 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ export declare const HeadingSizes: readonly ["1", "2", "3", "4", "5", "6"];
3
+ export declare const HeadingTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
4
+ export declare const defaultHeadingTag: "h2";
5
+ export declare const classMap: {
6
+ h1: "1";
7
+ h2: "2";
8
+ h3: "3";
9
+ h4: "4";
10
+ h5: "5";
11
+ h6: "6";
12
+ };
13
+ declare type HeadingTags = {
14
+ as?: typeof HeadingTags[number];
15
+ } & React.HTMLAttributes<HTMLHeadingElement>;
16
+ declare type HeadingProps = {
17
+ className?: string;
18
+ } & HeadingTags;
19
+ export declare function Heading({ className, children, as, ...rest }: PropsWithChildren<HeadingProps>): JSX.Element;
20
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Heading';
@@ -4,6 +4,7 @@ declare type Action = {
4
4
  href: string;
5
5
  };
6
6
  export declare type HeroProps = {
7
+ className?: string;
7
8
  heading: string | React.ReactElement;
8
9
  description?: string | React.ReactElement;
9
10
  primaryAction: Action;
@@ -11,5 +12,5 @@ export declare type HeroProps = {
11
12
  align?: 'start' | 'center';
12
13
  size?: 'small' | 'large';
13
14
  };
14
- export declare function Hero({ heading, description, primaryAction, secondaryAction, align, size }: HeroProps): JSX.Element;
15
+ export declare function Hero({ className, heading, description, primaryAction, secondaryAction, align, size }: HeroProps): JSX.Element;
15
16
  export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare type MonaSansProps = {
3
+ children: string | React.ReactElement;
4
+ italic?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10';
5
+ size?: number;
6
+ weight?: number;
7
+ width?: number;
8
+ };
9
+ export declare function MonaSans({ children, italic, size, weight, width }: MonaSansProps): JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from './MonaSans';
@@ -0,0 +1,36 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ export declare const TextSizes: readonly ["700", "600", "500", "400", "300", "200", "100"];
3
+ export declare const TextTags: readonly ["p", "span", "div"];
4
+ export declare const TextVariants: readonly ["default", "muted"];
5
+ export declare const defaultTextTag: "span";
6
+ export declare const defaultTextSize: "400";
7
+ export declare const defaultTextVariant: "default";
8
+ declare type RestrictedPolymorphism = (React.HTMLAttributes<HTMLParagraphElement> & {
9
+ as?: 'p';
10
+ }) | (React.HTMLAttributes<HTMLSpanElement> & {
11
+ as?: 'span';
12
+ }) | (React.HTMLAttributes<HTMLDivElement> & {
13
+ as?: 'div';
14
+ });
15
+ declare type TextTags = {
16
+ /**
17
+ * Applies the underlying HTML element
18
+ */
19
+ as?: typeof TextTags[number];
20
+ } & RestrictedPolymorphism;
21
+ declare type TextProps = {
22
+ /**
23
+ * Forward a custom HTML class attribute
24
+ */
25
+ className?: string;
26
+ /**
27
+ * Specify the text size
28
+ */
29
+ size?: typeof TextSizes[number];
30
+ /**
31
+ * Specify alternative text appearance
32
+ */
33
+ variant?: typeof TextVariants[number];
34
+ } & TextTags;
35
+ export declare function Text({ as, className, children, size, variant, ...rest }: PropsWithChildren<TextProps>): JSX.Element;
36
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Text';