@atlaskit/atlassian-navigation 2.2.7 → 2.2.9
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 +12 -0
- package/dist/cjs/components/PrimaryButton/styles.js +1 -1
- package/dist/cjs/theme/default-theme.js +12 -2
- package/dist/cjs/theme/theme-generator.js +7 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/PrimaryButton/styles.js +1 -1
- package/dist/es2019/theme/default-theme.js +12 -2
- package/dist/es2019/theme/theme-generator.js +7 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/PrimaryButton/styles.js +1 -1
- package/dist/esm/theme/default-theme.js +12 -2
- package/dist/esm/theme/theme-generator.js +7 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/common/styles.d.ts +1 -1
- package/dist/types/theme/types.d.ts +1 -0
- package/dist/types-ts4.0/common/constants.d.ts +6 -0
- package/dist/types-ts4.0/common/styles.d.ts +924 -0
- package/dist/types-ts4.0/components/AppSwitcher/index.d.ts +14 -0
- package/dist/types-ts4.0/components/AppSwitcher/types.d.ts +2 -0
- package/dist/types-ts4.0/components/AtlassianNavigation/index.d.ts +12 -0
- package/dist/types-ts4.0/components/AtlassianNavigation/skeleton.d.ts +17 -0
- package/dist/types-ts4.0/components/AtlassianNavigation/types.d.ts +107 -0
- package/dist/types-ts4.0/components/BadgeContainer/index.d.ts +3 -0
- package/dist/types-ts4.0/components/BadgeContainer/types.d.ts +6 -0
- package/dist/types-ts4.0/components/Create/index.d.ts +13 -0
- package/dist/types-ts4.0/components/Create/skeleton.d.ts +2 -0
- package/dist/types-ts4.0/components/Create/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/Create/types.d.ts +35 -0
- package/dist/types-ts4.0/components/Help/index.d.ts +13 -0
- package/dist/types-ts4.0/components/Help/types.d.ts +9 -0
- package/dist/types-ts4.0/components/IconButton/index.d.ts +14 -0
- package/dist/types-ts4.0/components/IconButton/skeleton.d.ts +3 -0
- package/dist/types-ts4.0/components/IconButton/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/IconButton/types.d.ts +100 -0
- package/dist/types-ts4.0/components/Notifications/index.d.ts +14 -0
- package/dist/types-ts4.0/components/Notifications/types.d.ts +9 -0
- package/dist/types-ts4.0/components/PrimaryButton/index.d.ts +18 -0
- package/dist/types-ts4.0/components/PrimaryButton/skeleton.d.ts +4 -0
- package/dist/types-ts4.0/components/PrimaryButton/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/PrimaryButton/types.d.ts +43 -0
- package/dist/types-ts4.0/components/PrimaryDropdownButton/index.d.ts +16 -0
- package/dist/types-ts4.0/components/PrimaryDropdownButton/types.d.ts +18 -0
- package/dist/types-ts4.0/components/PrimaryItemsContainer/index.d.ts +6 -0
- package/dist/types-ts4.0/components/PrimaryItemsContainer/skeleton.d.ts +3 -0
- package/dist/types-ts4.0/components/PrimaryItemsContainer/types.d.ts +10 -0
- package/dist/types-ts4.0/components/ProductHome/custom-product-home.d.ts +12 -0
- package/dist/types-ts4.0/components/ProductHome/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ProductHome/product-home.d.ts +15 -0
- package/dist/types-ts4.0/components/ProductHome/skeleton.d.ts +5 -0
- package/dist/types-ts4.0/components/ProductHome/types.d.ts +100 -0
- package/dist/types-ts4.0/components/ProductHome/utils.d.ts +1 -0
- package/dist/types-ts4.0/components/Profile/index.d.ts +17 -0
- package/dist/types-ts4.0/components/Profile/skeleton.d.ts +2 -0
- package/dist/types-ts4.0/components/Profile/types.d.ts +2 -0
- package/dist/types-ts4.0/components/Search/index.d.ts +12 -0
- package/dist/types-ts4.0/components/Search/skeleton.d.ts +2 -0
- package/dist/types-ts4.0/components/Search/types.d.ts +16 -0
- package/dist/types-ts4.0/components/Settings/index.d.ts +11 -0
- package/dist/types-ts4.0/components/Settings/types.d.ts +2 -0
- package/dist/types-ts4.0/components/SignIn/index.d.ts +12 -0
- package/dist/types-ts4.0/components/SignIn/skeleton.d.ts +2 -0
- package/dist/types-ts4.0/components/SignIn/types.d.ts +2 -0
- package/dist/types-ts4.0/components/SkeletonCreateButton/index.d.ts +13 -0
- package/dist/types-ts4.0/components/SkeletonCreateButton/types.d.ts +12 -0
- package/dist/types-ts4.0/components/SkeletonIconButton/index.d.ts +13 -0
- package/dist/types-ts4.0/components/SkeletonIconButton/types.d.ts +18 -0
- package/dist/types-ts4.0/components/SkeletonPrimaryButton/index.d.ts +13 -0
- package/dist/types-ts4.0/components/SkeletonPrimaryButton/types.d.ts +25 -0
- package/dist/types-ts4.0/controllers/overflow/index.d.ts +44 -0
- package/dist/types-ts4.0/controllers/overflow/types.d.ts +7 -0
- package/dist/types-ts4.0/index.d.ts +30 -0
- package/dist/types-ts4.0/skeleton-help-button.d.ts +19 -0
- package/dist/types-ts4.0/skeleton-notification-button.d.ts +19 -0
- package/dist/types-ts4.0/skeleton-settings-button.d.ts +19 -0
- package/dist/types-ts4.0/skeleton-switcher-button.d.ts +19 -0
- package/dist/types-ts4.0/skeleton.d.ts +5 -0
- package/dist/types-ts4.0/theme/default-theme.d.ts +6 -0
- package/dist/types-ts4.0/theme/index.d.ts +6 -0
- package/dist/types-ts4.0/theme/theme-generator.d.ts +3 -0
- package/dist/types-ts4.0/theme/theme-helpers.d.ts +5 -0
- package/dist/types-ts4.0/theme/theme-provider.d.ts +8 -0
- package/dist/types-ts4.0/theme/themes.d.ts +3 -0
- package/dist/types-ts4.0/theme/types.d.ts +74 -0
- package/dist/types-ts4.0/theme/use-theme.d.ts +1 -0
- package/package.json +12 -5
- package/skeleton/package.json +8 -1
- package/skeleton-help-button/package.json +8 -1
- package/skeleton-notification-button/package.json +8 -1
- package/skeleton-settings-button/package.json +8 -1
- package/skeleton-switcher-button/package.json +8 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AppSwitcherProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* _App switcher__
|
|
5
|
+
*
|
|
6
|
+
* An AppSwitcher button that can be passed into `AtlassianNavigation`'s
|
|
7
|
+
* `renderAppSwitcher` prop.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
|
|
10
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
11
|
+
*/
|
|
12
|
+
export declare const AppSwitcher: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
|
|
13
|
+
declare const _default: (props: AppSwitcherProps) => void;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AtlassianNavigationProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Atlassian navigation__
|
|
5
|
+
*
|
|
6
|
+
* The horizontal navigation component for Atlassian products.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/examples)
|
|
10
|
+
*/
|
|
11
|
+
export declare const AtlassianNavigation: (props: AtlassianNavigationProps) => JSX.Element;
|
|
12
|
+
export default AtlassianNavigation;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationSkeletonProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Navigation skeleton__
|
|
5
|
+
*
|
|
6
|
+
* Use loading skeletons to reduce the perceived loading time of heavier
|
|
7
|
+
* full-page experiences. This should only be used when the whole navigation is
|
|
8
|
+
* delayed; if there are only certain dynamically loaded navigation items that
|
|
9
|
+
* slow down the page, you should look into using
|
|
10
|
+
* [skeleton buttons](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
11
|
+
* instead.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
|
|
14
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
15
|
+
*/
|
|
16
|
+
export declare const NavigationSkeleton: ({ primaryItemsCount, secondaryItemsCount, theme, showSiteName, shouldShowSearch, testId, }: NavigationSkeletonProps) => JSX.Element;
|
|
17
|
+
export default NavigationSkeleton;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React, { ReactNode, ReactNodeArray } from 'react';
|
|
2
|
+
import { NavigationTheme } from '../../theme';
|
|
3
|
+
export interface AtlassianNavigationProps {
|
|
4
|
+
/**
|
|
5
|
+
* Describes the specific role of this navigation component for users viewing the page with a screen
|
|
6
|
+
* reader. Differentiates from other navigation components on a page.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Slot for the primary actions.
|
|
11
|
+
*/
|
|
12
|
+
primaryItems: ReactNodeArray;
|
|
13
|
+
/**
|
|
14
|
+
* Slot for the app switcher.
|
|
15
|
+
*/
|
|
16
|
+
renderAppSwitcher?: React.ComponentType<{}>;
|
|
17
|
+
/**
|
|
18
|
+
* Slot for the create call to action button.
|
|
19
|
+
*/
|
|
20
|
+
renderCreate?: React.ComponentType<{}>;
|
|
21
|
+
/**
|
|
22
|
+
* Slot for the help button.
|
|
23
|
+
*/
|
|
24
|
+
renderHelp?: React.ComponentType<{}>;
|
|
25
|
+
/**
|
|
26
|
+
* Slot for the notification button.
|
|
27
|
+
*/
|
|
28
|
+
renderNotifications?: React.ComponentType<{}>;
|
|
29
|
+
/**
|
|
30
|
+
* Slot for the product home logo which renders a product's brand.
|
|
31
|
+
*/
|
|
32
|
+
renderProductHome: React.ComponentType<{}>;
|
|
33
|
+
/**
|
|
34
|
+
* Slot for the profile button.
|
|
35
|
+
*/
|
|
36
|
+
renderProfile?: React.ComponentType<{}>;
|
|
37
|
+
/**
|
|
38
|
+
* Slot for the search textbox.
|
|
39
|
+
*/
|
|
40
|
+
renderSearch?: React.ComponentType<{}>;
|
|
41
|
+
/**
|
|
42
|
+
* Slot for the sign in button.
|
|
43
|
+
*/
|
|
44
|
+
renderSignIn?: React.ComponentType<{}>;
|
|
45
|
+
/**
|
|
46
|
+
* Slot for the settings button.
|
|
47
|
+
*/
|
|
48
|
+
renderSettings?: React.ComponentType<{}>;
|
|
49
|
+
/**
|
|
50
|
+
* Label used for the overflow menu button tooltip.
|
|
51
|
+
*/
|
|
52
|
+
moreLabel?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* __Slow and discouraged custom theme API.__
|
|
55
|
+
*/
|
|
56
|
+
theme?: NavigationTheme;
|
|
57
|
+
/**
|
|
58
|
+
A `testId` prop is provided for specified elements,
|
|
59
|
+
which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
60
|
+
serving as a hook for automated tests.
|
|
61
|
+
|
|
62
|
+
Will set these elements when defined:
|
|
63
|
+
|
|
64
|
+
- Header element - `{testId}-header`
|
|
65
|
+
- Primary actions container - `{testId}-primary-actions`
|
|
66
|
+
- Secondary actions container - `{testId}-secondary-actions`
|
|
67
|
+
- Overflow menu popup - `{testId}-overflow-menu-popup`
|
|
68
|
+
- Overflow menu button - `{testId}-overflow-menu-trigger`
|
|
69
|
+
*/
|
|
70
|
+
testId?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface NavigationSkeletonProps {
|
|
73
|
+
/**
|
|
74
|
+
* How many skeleton primary items to display.
|
|
75
|
+
*/
|
|
76
|
+
primaryItemsCount?: number;
|
|
77
|
+
/**
|
|
78
|
+
* How many skeleton secondary items to display.
|
|
79
|
+
*/
|
|
80
|
+
secondaryItemsCount?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Whether to display a skeleton for the site name.
|
|
83
|
+
*/
|
|
84
|
+
showSiteName?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether to display a skeleton for the search bar.
|
|
87
|
+
*/
|
|
88
|
+
shouldShowSearch?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* __Slow and discouraged custom theme API.__
|
|
91
|
+
*/
|
|
92
|
+
theme?: NavigationTheme;
|
|
93
|
+
/**
|
|
94
|
+
A `testId` prop is provided for specified elements,
|
|
95
|
+
which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
96
|
+
serving as a hook for automated tests.
|
|
97
|
+
|
|
98
|
+
Will set these elements when defined:
|
|
99
|
+
|
|
100
|
+
- Header element - `{testId}-header`
|
|
101
|
+
- Primary actions container - `{testId}-primary-actions`
|
|
102
|
+
- Secondary actions container - `{testId}-secondary-actions`
|
|
103
|
+
- Overflow menu popup - `{testId}-overflow-menu-popup`
|
|
104
|
+
- Overflow menu button - `{testId}-overflow-menu-trigger`
|
|
105
|
+
*/
|
|
106
|
+
testId?: string;
|
|
107
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CreateProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* _Create__
|
|
5
|
+
*
|
|
6
|
+
* A call to action button that can be passed into `AtlassianNavigation`'s
|
|
7
|
+
* `renderCreate` prop. It is shown after all other primary buttons.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
|
|
10
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
11
|
+
*/
|
|
12
|
+
export declare const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
|
|
13
|
+
export default Create;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ThemeProps, ThemeTokens } from '@atlaskit/button/types';
|
|
2
|
+
import { NavigationTheme } from '../../theme';
|
|
3
|
+
export declare const getCreateButtonTheme: ({ mode: { create } }: NavigationTheme) => (current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CreateProps {
|
|
3
|
+
/**
|
|
4
|
+
* Primary text for the call to action.
|
|
5
|
+
*/
|
|
6
|
+
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* Text for the button tooltip when seen on large viewports.
|
|
9
|
+
*/
|
|
10
|
+
buttonTooltip?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Text for the icon button tooltip when seen on small viewports.
|
|
13
|
+
*/
|
|
14
|
+
iconButtonTooltip?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Click handler.
|
|
17
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
18
|
+
*/
|
|
19
|
+
onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Causes the Create action to be rendered as a link. This is suitable for when the Create action is handled as a full page rather than in a modal-dialog.
|
|
22
|
+
*/
|
|
23
|
+
href?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A `testId` prop is provided for specified elements,
|
|
26
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
27
|
+
* serving as a hook for automated tests.
|
|
28
|
+
*
|
|
29
|
+
* Will set these elements when defined:
|
|
30
|
+
*
|
|
31
|
+
* - Create button shown on large screen sizes - `{testId}-button`
|
|
32
|
+
* - Create icon button shown on small screen sizes - `{testId}-icon-button`
|
|
33
|
+
*/
|
|
34
|
+
testId?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Help__
|
|
4
|
+
*
|
|
5
|
+
* A help button that can be passed into `AtlassianNavigation`'s `renderHelp` prop.
|
|
6
|
+
*
|
|
7
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
|
|
8
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
9
|
+
*/
|
|
10
|
+
export declare const Help: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
|
|
11
|
+
badge?: React.ComponentType<{}> | undefined;
|
|
12
|
+
} & React.RefAttributes<any>>;
|
|
13
|
+
export default Help;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BaseIconButtonProps } from '../IconButton/types';
|
|
3
|
+
export declare type HelpProps = BaseIconButtonProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Component to be used for the badge.
|
|
6
|
+
* Generally you'll want to use `NotificationIndicator` from [`@atlaskit/notification-indicator`](/packages/notifications/notification-indicator).
|
|
7
|
+
*/
|
|
8
|
+
badge?: ComponentType<{}>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Icon button__
|
|
4
|
+
*
|
|
5
|
+
* An icon button is used to create navigation items such as Help, Settings
|
|
6
|
+
* and Notifications. You can use this component to create your own items to
|
|
7
|
+
* pass into `AtlassianNavigation`'s render props, but where possible you should
|
|
8
|
+
* rely on the defaults.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare const IconButton: React.ForwardRefExoticComponent<import("./types").BaseIconButtonProps & {
|
|
12
|
+
icon: React.ReactChild | undefined;
|
|
13
|
+
theme?: ((current: (props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens, props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens) | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ThemeProps, ThemeTokens } from '@atlaskit/button/types';
|
|
2
|
+
import { NavigationTheme } from '../../theme';
|
|
3
|
+
export declare const getIconButtonTheme: ({ mode: { iconButton }, }: NavigationTheme) => (current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
3
|
+
export declare type IconButtonProps = BaseIconButtonProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Icon for the button.
|
|
6
|
+
*/
|
|
7
|
+
icon: CustomThemeButtonProps['iconBefore'];
|
|
8
|
+
/**
|
|
9
|
+
* Theme for the icon button.
|
|
10
|
+
*/
|
|
11
|
+
theme?: CustomThemeButtonProps['theme'];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* We aren't inheriting the types from button here because it blows up ERT.
|
|
15
|
+
*/
|
|
16
|
+
export interface BaseIconButtonProps {
|
|
17
|
+
/**
|
|
18
|
+
* Unique id for the button.
|
|
19
|
+
*/
|
|
20
|
+
id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* On click handler.
|
|
23
|
+
* Second argument is the instrumented analytics event.
|
|
24
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
25
|
+
*/
|
|
26
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
27
|
+
/**
|
|
28
|
+
* A `testId` prop is provided for specified elements,
|
|
29
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
30
|
+
* serving as a hook for automated tests
|
|
31
|
+
*/
|
|
32
|
+
testId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Text that will be displayed in the tooltip when hovered or focused on the button.
|
|
35
|
+
*/
|
|
36
|
+
tooltip: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Called when the mouse is initially clicked on the element.
|
|
39
|
+
*/
|
|
40
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the mouse enters the element container.
|
|
43
|
+
*/
|
|
44
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
|
45
|
+
/**
|
|
46
|
+
* Called when the mouse leaves the element container.
|
|
47
|
+
*/
|
|
48
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
|
49
|
+
/**
|
|
50
|
+
* Causes the button to be disabled.
|
|
51
|
+
*/
|
|
52
|
+
isDisabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* If wanting to link to another page you can define the href.
|
|
55
|
+
*/
|
|
56
|
+
href?: string;
|
|
57
|
+
/**
|
|
58
|
+
* If defining `href` you may want to define `target` as well.
|
|
59
|
+
*/
|
|
60
|
+
target?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Allows for overriding the component used to render the button.
|
|
63
|
+
*
|
|
64
|
+
* This is primarily intended for compatibility with custom
|
|
65
|
+
* routing libraries when using the `href` prop.
|
|
66
|
+
*
|
|
67
|
+
* For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <Settings
|
|
72
|
+
* component={CustomRouterLink}
|
|
73
|
+
* href="/path/to/url"
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
component?: CustomThemeButtonProps['component'];
|
|
78
|
+
/**
|
|
79
|
+
* Handler for the mouse up event.
|
|
80
|
+
*/
|
|
81
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement>;
|
|
82
|
+
/**
|
|
83
|
+
* Handler called when the button gains focus.
|
|
84
|
+
*/
|
|
85
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
86
|
+
/**
|
|
87
|
+
* Handler called when the button loses focus.
|
|
88
|
+
*/
|
|
89
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
90
|
+
/**
|
|
91
|
+
* Makes the element appear selected.
|
|
92
|
+
*/
|
|
93
|
+
isSelected?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface IconButtonSkeletonProps {
|
|
96
|
+
className?: string;
|
|
97
|
+
marginLeft?: number;
|
|
98
|
+
marginRight?: number;
|
|
99
|
+
size?: number;
|
|
100
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Notifications__
|
|
4
|
+
*
|
|
5
|
+
* A notifications button that can be passed into `AtlassianNavigation`'s
|
|
6
|
+
* `renderNotifications` prop.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
10
|
+
*/
|
|
11
|
+
export declare const Notifications: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
|
|
12
|
+
badge: React.ComponentType<{}>;
|
|
13
|
+
} & React.RefAttributes<any>>;
|
|
14
|
+
export default Notifications;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BaseIconButtonProps } from '../IconButton/types';
|
|
3
|
+
export declare type NotificationsProps = BaseIconButtonProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Component to be used for the badge.
|
|
6
|
+
* Generally you'll want to use `NotificationIndicator` from [`@atlaskit/notification-indicator`](/packages/notifications/notification-indicator).
|
|
7
|
+
*/
|
|
8
|
+
badge: ComponentType<{}>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* __Primary button__
|
|
4
|
+
*
|
|
5
|
+
* A primary button allows you to add top-level navigation items.
|
|
6
|
+
* Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
10
|
+
*/
|
|
11
|
+
export declare const PrimaryButton: import("react").ForwardRefExoticComponent<Omit<import("@atlaskit/button/custom-theme-button").CustomThemeButtonProps, "appearance" | "onClick"> & {
|
|
12
|
+
component?: import("react").ComponentType<import("react").AllHTMLAttributes<HTMLElement>> | import("react").ElementType<any> | undefined;
|
|
13
|
+
isHighlighted?: boolean | undefined;
|
|
14
|
+
testId?: string | undefined;
|
|
15
|
+
tooltip?: import("react").ReactNode;
|
|
16
|
+
onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>, analyticsEvent: any) => void) | undefined;
|
|
17
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
18
|
+
export default PrimaryButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ThemeProps, ThemeTokens } from '@atlaskit/button/types';
|
|
2
|
+
import { NavigationTheme } from '../../theme';
|
|
3
|
+
export declare const getPrimaryButtonTheme: ({ mode: { primaryButton }, }: NavigationTheme) => (current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AllHTMLAttributes, ComponentType, ElementType } from 'react';
|
|
2
|
+
import { CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
3
|
+
export declare type PrimaryButtonProps = Omit<CustomThemeButtonProps, 'appearance' | 'onClick'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Allows for overriding the component used to render the button.
|
|
6
|
+
*
|
|
7
|
+
* This is primarily intended for compatibility with custom
|
|
8
|
+
* routing libraries when using the `href` prop.
|
|
9
|
+
*
|
|
10
|
+
* For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Settings
|
|
15
|
+
* component={CustomRouterLink}
|
|
16
|
+
* href="/path/to/url"
|
|
17
|
+
* />
|
|
18
|
+
*```
|
|
19
|
+
*/
|
|
20
|
+
component?: ComponentType<AllHTMLAttributes<HTMLElement>> | ElementType<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Will set the appearance of the button to look highlighted.
|
|
23
|
+
*/
|
|
24
|
+
isHighlighted?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A `testId` prop is provided for specified elements,
|
|
27
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
28
|
+
* serving as a hook for automated tests
|
|
29
|
+
*/
|
|
30
|
+
testId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional text to show when the button is focused or hovered.
|
|
33
|
+
*/
|
|
34
|
+
tooltip?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* On click handler.
|
|
37
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
38
|
+
*/
|
|
39
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare type PrimaryButtonSkeletonProps = {
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* __Primary dropdown button__
|
|
4
|
+
*
|
|
5
|
+
* A primary dropdown button allows you to add dropdown menus to the navigation.
|
|
6
|
+
* Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#button)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
10
|
+
*/
|
|
11
|
+
export declare const PrimaryDropdownButton: import("react").ForwardRefExoticComponent<Omit<import("../..").PrimaryButtonProps, "iconAfter"> & {
|
|
12
|
+
isHighlighted?: boolean | undefined;
|
|
13
|
+
testId?: string | undefined;
|
|
14
|
+
tooltip?: import("react").ReactNode;
|
|
15
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
16
|
+
export default PrimaryDropdownButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PrimaryButtonProps } from '../PrimaryButton/types';
|
|
3
|
+
export declare type PrimaryDropdownButtonProps = Omit<PrimaryButtonProps, 'iconAfter'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Will set the appearance of the button to look highlighted.
|
|
6
|
+
*/
|
|
7
|
+
isHighlighted?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* A `testId` prop is provided for specified elements,
|
|
10
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
11
|
+
* serving as a hook for automated tests
|
|
12
|
+
*/
|
|
13
|
+
testId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional text to show when the button is focused or hovered.
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: React.ReactNode;
|
|
18
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavigationTheme } from '../../theme';
|
|
3
|
+
import { PrimaryItemsContainerProps } from './types';
|
|
4
|
+
export declare const PrimaryItemsContainer: ({ moreLabel, items, create: Create, theme, testId, }: PrimaryItemsContainerProps & {
|
|
5
|
+
theme: NavigationTheme;
|
|
6
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType, ReactNode, ReactNodeArray } from 'react';
|
|
2
|
+
export declare type PrimaryItemsContainerProps = {
|
|
3
|
+
moreLabel: ReactNode;
|
|
4
|
+
items: ReactNodeArray;
|
|
5
|
+
create?: ComponentType<{}>;
|
|
6
|
+
testId?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type PrimaryItemsContainerSkeletonProps = {
|
|
9
|
+
count: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomProductHomeProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Custom product home__
|
|
5
|
+
*
|
|
6
|
+
* Use `CustomProductHome` to provide a custom logo and icon with URLs.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
10
|
+
*/
|
|
11
|
+
declare const CustomProductHome: (props: CustomProductHomeProps) => JSX.Element;
|
|
12
|
+
export default CustomProductHome;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ProductHomeProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Product home__
|
|
5
|
+
*
|
|
6
|
+
* The ProductHome component displays the product visual identity composed of:
|
|
7
|
+
* logo, icon, and optional text. Values for logo and icon are never displayed
|
|
8
|
+
* at the same time, where icon is used only when space is restricted. Should be
|
|
9
|
+
* passed into `AtlassianNavigation`'s `renderProductHome` prop.
|
|
10
|
+
*
|
|
11
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
|
|
12
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
13
|
+
*/
|
|
14
|
+
declare const ProductHome: ({ icon: Icon, logo: Logo, siteTitle, onClick, href, onMouseDown, testId, logoMaxWidth, ...rest }: ProductHomeProps) => JSX.Element;
|
|
15
|
+
export default ProductHome;
|