@primer/react-brand 0.1.0-rc.ae0dfda → 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 (63) hide show
  1. package/CHANGELOG.md +7 -1
  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/gh-variables.color.css +32 -8
  13. package/lib/css/main.css +1458 -53
  14. package/lib/css/stylesheets.d.ts +8 -0
  15. package/lib/design-tokens/css/tokens/base/size/size.css +24 -0
  16. package/lib/design-tokens/css/tokens/base/typography/typography.css +14 -0
  17. package/lib/design-tokens/css/tokens/functional/size/border.css +17 -0
  18. package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +13 -0
  19. package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +10 -0
  20. package/lib/design-tokens/css/tokens/functional/size/size-fine.css +10 -0
  21. package/lib/design-tokens/css/tokens/functional/size/size.css +54 -0
  22. package/lib/design-tokens/css/tokens/functional/size/viewport.css +6 -0
  23. package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +166 -0
  24. package/lib/design-tokens/css/tokens/functional/typography/typography.css +65 -0
  25. package/lib/design-tokens/js/module/tokens/base/size/size.js +266 -0
  26. package/lib/design-tokens/js/module/tokens/base/typography/typography.js +125 -0
  27. package/lib/design-tokens/js/module/tokens/functional/size/border.js +165 -0
  28. package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +101 -0
  29. package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +73 -0
  30. package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +73 -0
  31. package/lib/design-tokens/js/module/tokens/functional/size/size.js +824 -0
  32. package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +101 -0
  33. package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1973 -0
  34. package/lib/design-tokens/js/tokens/base/size/size.js +22 -0
  35. package/lib/design-tokens/js/tokens/base/typography/typography.js +12 -0
  36. package/lib/design-tokens/js/tokens/functional/size/border.js +15 -0
  37. package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +11 -0
  38. package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +8 -0
  39. package/lib/design-tokens/js/tokens/functional/size/size-fine.js +8 -0
  40. package/lib/design-tokens/js/tokens/functional/size/size.js +52 -0
  41. package/lib/design-tokens/js/tokens/functional/size/viewport.js +11 -0
  42. package/lib/design-tokens/js/tokens/functional/typography/typography.js +63 -0
  43. package/lib/design-tokens/ts/tokens/base/size/size.d.ts +29 -0
  44. package/lib/design-tokens/ts/tokens/base/size/size.js +28 -0
  45. package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +111 -0
  46. package/lib/design-tokens/ts/tokens/base/typography/typography.js +20 -0
  47. package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +26 -0
  48. package/lib/design-tokens/ts/tokens/functional/size/border.js +25 -0
  49. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +18 -0
  50. package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +17 -0
  51. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +27 -0
  52. package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +26 -0
  53. package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +27 -0
  54. package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +26 -0
  55. package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +101 -0
  56. package/lib/design-tokens/ts/tokens/functional/size/size.js +100 -0
  57. package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +18 -0
  58. package/lib/design-tokens/ts/tokens/functional/size/viewport.js +17 -0
  59. package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +92 -0
  60. package/lib/design-tokens/ts/tokens/functional/typography/typography.js +91 -0
  61. package/lib/index.d.ts +3 -0
  62. package/lib/index.js +1 -1
  63. package/package.json +12 -8
package/CHANGELOG.md CHANGED
@@ -8,7 +8,13 @@
8
8
 
9
9
  ### Patch Changes
10
10
 
11
- - [#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.
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
+
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
16
+
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.
12
18
 
13
19
  ## 0.0.3
14
20
 
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';
@@ -275,6 +275,14 @@
275
275
  --gh-color-actionListItem-danger-hoverBg: rgba(255, 235, 233, 0.64);
276
276
  --gh-color-actionListItem-danger-activeBg: #ffebe9;
277
277
  --gh-color-actionListItem-danger-hoverText: #cf222e;
278
+ --gh-color-switchTrack-bg: #eaeef2;
279
+ --gh-color-switchTrack-border: #afb8c1;
280
+ --gh-color-switchTrack-checked-bg: #ddf4ff;
281
+ --gh-color-switchTrack-checked-hoverBg: #b6e3ff;
282
+ --gh-color-switchTrack-checked-activeBg: #80ccff;
283
+ --gh-color-switchTrack-checked-border: #54aeff;
284
+ --gh-color-switchKnob-checked-bg: #0969da;
285
+ --gh-color-switchKnob-checked-disabledBg: #6e7781;
278
286
  --gh-color-fg-default: #24292f;
279
287
  --gh-color-fg-muted: #57606a;
280
288
  --gh-color-fg-subtle: #6e7781;
@@ -617,6 +625,14 @@
617
625
  --gh-color-actionListItem-danger-hoverBg: rgba(255, 235, 233, 0.64);
618
626
  --gh-color-actionListItem-danger-activeBg: #ffebe9;
619
627
  --gh-color-actionListItem-danger-hoverText: #cf222e;
628
+ --gh-color-switchTrack-bg: #eaeef2;
629
+ --gh-color-switchTrack-border: #afb8c1;
630
+ --gh-color-switchTrack-checked-bg: #ddf4ff;
631
+ --gh-color-switchTrack-checked-hoverBg: #b6e3ff;
632
+ --gh-color-switchTrack-checked-activeBg: #80ccff;
633
+ --gh-color-switchTrack-checked-border: #54aeff;
634
+ --gh-color-switchKnob-checked-bg: #0969da;
635
+ --gh-color-switchKnob-checked-disabledBg: #6e7781;
620
636
  --gh-color-fg-default: #24292f;
621
637
  --gh-color-fg-muted: #57606a;
622
638
  --gh-color-fg-subtle: #6e7781;
@@ -738,7 +754,7 @@
738
754
  --gh-color-codemirror-bg: #0d1117;
739
755
  --gh-color-codemirror-guttersBg: #0d1117;
740
756
  --gh-color-codemirror-guttermarkerText: #0d1117;
741
- --gh-color-codemirror-guttermarkerSubtleText: #484f58;
757
+ --gh-color-codemirror-guttermarkerSubtleText: #6e7681;
742
758
  --gh-color-codemirror-linenumberText: #8b949e;
743
759
  --gh-color-codemirror-cursor: #c9d1d9;
744
760
  --gh-color-codemirror-selectionBg: rgba(56, 139, 253, 0.4);
@@ -763,7 +779,7 @@
763
779
  --gh-color-checks-btnHoverIcon: #c9d1d9;
764
780
  --gh-color-checks-btnHoverBg: rgba(110, 118, 129, 0.1);
765
781
  --gh-color-checks-inputText: #8b949e;
766
- --gh-color-checks-inputPlaceholderText: #484f58;
782
+ --gh-color-checks-inputPlaceholderText: #6e7681;
767
783
  --gh-color-checks-inputFocusText: #c9d1d9;
768
784
  --gh-color-checks-inputBg: #161b22;
769
785
  --gh-color-checks-inputShadow: 0 0 0 1px (obj) => get_1.default(obj, path);
@@ -785,8 +801,8 @@
785
801
  --gh-color-checks-headerBorder: #21262d;
786
802
  --gh-color-checks-headerIcon: #8b949e;
787
803
  --gh-color-checks-lineText: #8b949e;
788
- --gh-color-checks-lineNumText: #484f58;
789
- --gh-color-checks-lineTimestampText: #484f58;
804
+ --gh-color-checks-lineNumText: #6e7681;
805
+ --gh-color-checks-lineTimestampText: #6e7681;
790
806
  --gh-color-checks-lineHoverBg: rgba(110, 118, 129, 0.1);
791
807
  --gh-color-checks-lineSelectedBg: rgba(56, 139, 253, 0.15);
792
808
  --gh-color-checks-lineSelectedNumText: #58a6ff;
@@ -799,10 +815,10 @@
799
815
  --gh-color-checks-stepErrorText: #f85149;
800
816
  --gh-color-checks-stepWarningText: #d29922;
801
817
  --gh-color-checks-loglineText: #8b949e;
802
- --gh-color-checks-loglineNumText: #484f58;
818
+ --gh-color-checks-loglineNumText: #6e7681;
803
819
  --gh-color-checks-loglineDebugText: #a371f7;
804
820
  --gh-color-checks-loglineErrorText: #8b949e;
805
- --gh-color-checks-loglineErrorNumText: #484f58;
821
+ --gh-color-checks-loglineErrorNumText: #6e7681;
806
822
  --gh-color-checks-loglineErrorBg: rgba(248, 81, 73, 0.15);
807
823
  --gh-color-checks-loglineWarningText: #8b949e;
808
824
  --gh-color-checks-loglineWarningNumText: #d29922;
@@ -948,7 +964,7 @@
948
964
  --gh-color-btn-danger-focusShadow: 0 0 0 3px rgba(248, 81, 73, 0.4);
949
965
  --gh-color-btn-danger-counterBg: rgba(218, 54, 51, 0.1);
950
966
  --gh-color-btn-danger-icon: #f85149;
951
- --gh-color-underlinenav-icon: #484f58;
967
+ --gh-color-underlinenav-icon: #6e7681;
952
968
  --gh-color-underlinenav-borderHover: rgba(110, 118, 129, 0.4);
953
969
  --gh-color-actionListItem-inlineDivider: rgba(48, 54, 61, 0.48);
954
970
  --gh-color-actionListItem-default-hoverBg: rgba(177, 186, 196, 0.12);
@@ -959,9 +975,17 @@
959
975
  --gh-color-actionListItem-danger-hoverBg: rgba(248, 81, 73, 0.16);
960
976
  --gh-color-actionListItem-danger-activeBg: rgba(248, 81, 73, 0.24);
961
977
  --gh-color-actionListItem-danger-hoverText: #ff7b72;
978
+ --gh-color-switchTrack-bg: #010409;
979
+ --gh-color-switchTrack-border: #6e7681;
980
+ --gh-color-switchTrack-checked-bg: rgba(31, 111, 235, 0.35);
981
+ --gh-color-switchTrack-checked-hoverBg: rgba(31, 111, 235, 0.5);
982
+ --gh-color-switchTrack-checked-activeBg: rgba(31, 111, 235, 0.65);
983
+ --gh-color-switchTrack-checked-border: #58a6ff;
984
+ --gh-color-switchKnob-checked-bg: #1f6feb;
985
+ --gh-color-switchKnob-checked-disabledBg: #484f58;
962
986
  --gh-color-fg-default: #c9d1d9;
963
987
  --gh-color-fg-muted: #8b949e;
964
- --gh-color-fg-subtle: #484f58;
988
+ --gh-color-fg-subtle: #6e7681;
965
989
  --gh-color-fg-onEmphasis: #ffffff;
966
990
  --gh-color-canvas-default: #0d1117;
967
991
  --gh-color-canvas-overlay: #161b22;