@primer/react-brand 0.5.0-rc.fc95189 → 0.5.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/Button/Button.d.ts +2 -0
- package/lib/SubdomainNavBar/NavigationVisbilityObserver.d.ts +6 -0
- package/lib/SubdomainNavBar/SubdomainNavBar.d.ts +63 -0
- package/lib/SubdomainNavBar/SubdomainNavBar.visual.spec.d.ts +1 -0
- package/lib/SubdomainNavBar/index.d.ts +1 -0
- package/lib/SubdomainNavBar/useVisibilityObserver.d.ts +5 -0
- package/lib/css/main.css +780 -31
- 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/button/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/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/hero/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/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +27 -0
- 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 +15 -15
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +11 -11
- 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/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/hero/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/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/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/hero/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/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/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/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 +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/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/forms/Checkbox/Checkbox.d.ts +1 -1
- package/lib/forms/Select/Select.d.ts +1 -1
- package/lib/forms/TextInput/TextInput.d.ts +9 -1
- package/lib/hooks/useKeyboardEscape.d.ts +1 -0
- package/lib/hooks/useOnClickOutside.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -264
package/lib/Button/Button.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ export declare type ButtonProps<C extends React.ElementType> = BaseProps<C> & {
|
|
|
5
5
|
as?: C;
|
|
6
6
|
variant?: 'primary' | 'secondary';
|
|
7
7
|
size?: 'medium' | 'large';
|
|
8
|
+
hasArrow?: boolean;
|
|
8
9
|
} & React.ComponentPropsWithoutRef<C>;
|
|
9
10
|
export declare const Button: React.ForwardRefExoticComponent<Pick<BaseProps<React.ElementType<any>> & {
|
|
10
11
|
as?: React.ElementType<any> | undefined;
|
|
11
12
|
variant?: "primary" | "secondary" | undefined;
|
|
12
13
|
size?: "medium" | "large" | undefined;
|
|
14
|
+
hasArrow?: boolean | undefined;
|
|
13
15
|
} & Pick<any, string | number | symbol>, string | number | symbol> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Design tokens
|
|
4
|
+
*/
|
|
5
|
+
import '../../lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css';
|
|
6
|
+
export declare type SubdomainNavBarProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Valid child elements are `SubdomainNavBar.Link`, `SubdomainNavBar.PrimaryAction`,
|
|
9
|
+
* `SubdomainNavBar.SecondaryAction` and `SubdomainNavBar.Search`
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode | React.ReactElement<LinkProps> | React.ReactElement<SearchProps> | React.ReactElement<CTAActionProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Forward a custom HTML class attribute
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Fixes the navigation bar to the top of the viewport. Defaults to `true`.
|
|
18
|
+
*/
|
|
19
|
+
fixed?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The title or name of the subdomain. Appears adjacent to the logo and is required for communicating content to assisitive technologies.
|
|
22
|
+
*/
|
|
23
|
+
title: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optionally change the URL of the logo
|
|
26
|
+
*/
|
|
27
|
+
logoHref?: string;
|
|
28
|
+
};
|
|
29
|
+
declare function Root({ children, fixed, logoHref, title, ...rest }: SubdomainNavBarProps): JSX.Element;
|
|
30
|
+
declare type LinkProps = {
|
|
31
|
+
href: string;
|
|
32
|
+
} & React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
|
|
33
|
+
declare function Link({ href, className, children, ...rest }: PropsWithChildren<LinkProps>): JSX.Element;
|
|
34
|
+
export declare type SubdomainNavBarSearchResultProps = {
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
url: string;
|
|
38
|
+
date: string;
|
|
39
|
+
category?: string;
|
|
40
|
+
};
|
|
41
|
+
declare type SearchProps = {
|
|
42
|
+
onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
43
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
44
|
+
ref: React.RefObject<HTMLInputElement>;
|
|
45
|
+
active?: boolean;
|
|
46
|
+
title?: string;
|
|
47
|
+
handlerFn?: () => void;
|
|
48
|
+
autoComplete?: boolean;
|
|
49
|
+
searchResults?: SubdomainNavBarSearchResultProps[];
|
|
50
|
+
searchTerm?: string;
|
|
51
|
+
};
|
|
52
|
+
declare type CTAActionProps = {
|
|
53
|
+
href: string;
|
|
54
|
+
};
|
|
55
|
+
declare function PrimaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
|
|
56
|
+
declare function SecondaryAction({ children, href, ...rest }: PropsWithChildren<CTAActionProps>): JSX.Element;
|
|
57
|
+
export declare const SubdomainNavBar: typeof Root & {
|
|
58
|
+
Link: typeof Link;
|
|
59
|
+
Search: React.ForwardRefExoticComponent<Pick<SearchProps, "title" | "onChange" | "onSubmit" | "autoComplete" | "active" | "searchResults" | "searchTerm" | "handlerFn"> & React.RefAttributes<unknown>>;
|
|
60
|
+
PrimaryAction: typeof PrimaryAction;
|
|
61
|
+
SecondaryAction: typeof SecondaryAction;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SubdomainNavBar';
|