@atlaskit/atlassian-navigation 2.5.1 → 2.6.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/components/AtlassianNavigation/index.js +11 -1
  3. package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +2 -2
  4. package/dist/cjs/components/PrimaryItemsContainerV2/index.js +149 -0
  5. package/dist/cjs/components/ProductHome/custom-product-home.js +6 -1
  6. package/dist/cjs/components/ProductHome/product-home.js +7 -1
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/es2019/components/AtlassianNavigation/index.js +11 -1
  9. package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -3
  10. package/dist/es2019/components/PrimaryItemsContainerV2/index.js +129 -0
  11. package/dist/es2019/components/ProductHome/custom-product-home.js +9 -1
  12. package/dist/es2019/components/ProductHome/product-home.js +10 -1
  13. package/dist/es2019/version.json +1 -1
  14. package/dist/esm/components/AtlassianNavigation/index.js +11 -1
  15. package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -3
  16. package/dist/esm/components/PrimaryItemsContainerV2/index.js +138 -0
  17. package/dist/esm/components/ProductHome/custom-product-home.js +6 -1
  18. package/dist/esm/components/ProductHome/product-home.js +7 -1
  19. package/dist/esm/version.json +1 -1
  20. package/dist/types/components/PrimaryItemsContainer/skeleton.d.ts +2 -1
  21. package/dist/types/components/PrimaryItemsContainerV2/index.d.ts +8 -0
  22. package/dist/types-ts4.5/common/constants.d.ts +9 -0
  23. package/dist/types-ts4.5/common/styles.d.ts +10 -0
  24. package/dist/types-ts4.5/components/AppSwitcher/index.d.ts +14 -0
  25. package/dist/types-ts4.5/components/AppSwitcher/types.d.ts +2 -0
  26. package/dist/types-ts4.5/components/AtlassianNavigation/index.d.ts +13 -0
  27. package/dist/types-ts4.5/components/AtlassianNavigation/skeleton.d.ts +18 -0
  28. package/dist/types-ts4.5/components/AtlassianNavigation/types.d.ts +107 -0
  29. package/dist/types-ts4.5/components/BadgeContainer/index.d.ts +4 -0
  30. package/dist/types-ts4.5/components/BadgeContainer/types.d.ts +6 -0
  31. package/dist/types-ts4.5/components/Create/index.d.ts +13 -0
  32. package/dist/types-ts4.5/components/Create/skeleton.d.ts +2 -0
  33. package/dist/types-ts4.5/components/Create/styles.d.ts +3 -0
  34. package/dist/types-ts4.5/components/Create/types.d.ts +35 -0
  35. package/dist/types-ts4.5/components/Help/index.d.ts +13 -0
  36. package/dist/types-ts4.5/components/Help/types.d.ts +9 -0
  37. package/dist/types-ts4.5/components/IconButton/index.d.ts +14 -0
  38. package/dist/types-ts4.5/components/IconButton/skeleton.d.ts +4 -0
  39. package/dist/types-ts4.5/components/IconButton/styles.d.ts +3 -0
  40. package/dist/types-ts4.5/components/IconButton/types.d.ts +100 -0
  41. package/dist/types-ts4.5/components/Notifications/index.d.ts +14 -0
  42. package/dist/types-ts4.5/components/Notifications/types.d.ts +9 -0
  43. package/dist/types-ts4.5/components/PrimaryButton/index.d.ts +18 -0
  44. package/dist/types-ts4.5/components/PrimaryButton/skeleton.d.ts +4 -0
  45. package/dist/types-ts4.5/components/PrimaryButton/styles.d.ts +3 -0
  46. package/dist/types-ts4.5/components/PrimaryButton/types.d.ts +43 -0
  47. package/dist/types-ts4.5/components/PrimaryDropdownButton/index.d.ts +16 -0
  48. package/dist/types-ts4.5/components/PrimaryDropdownButton/types.d.ts +18 -0
  49. package/dist/types-ts4.5/components/PrimaryItemsContainer/index.d.ts +6 -0
  50. package/dist/types-ts4.5/components/PrimaryItemsContainer/skeleton.d.ts +4 -0
  51. package/dist/types-ts4.5/components/PrimaryItemsContainer/types.d.ts +10 -0
  52. package/dist/types-ts4.5/components/PrimaryItemsContainerV2/index.d.ts +8 -0
  53. package/dist/types-ts4.5/components/ProductHome/custom-product-home.d.ts +12 -0
  54. package/dist/types-ts4.5/components/ProductHome/index.d.ts +2 -0
  55. package/dist/types-ts4.5/components/ProductHome/product-home.d.ts +15 -0
  56. package/dist/types-ts4.5/components/ProductHome/skeleton.d.ts +5 -0
  57. package/dist/types-ts4.5/components/ProductHome/types.d.ts +100 -0
  58. package/dist/types-ts4.5/components/ProductHome/utils.d.ts +1 -0
  59. package/dist/types-ts4.5/components/Profile/index.d.ts +17 -0
  60. package/dist/types-ts4.5/components/Profile/skeleton.d.ts +2 -0
  61. package/dist/types-ts4.5/components/Profile/types.d.ts +2 -0
  62. package/dist/types-ts4.5/components/Search/index.d.ts +12 -0
  63. package/dist/types-ts4.5/components/Search/skeleton.d.ts +2 -0
  64. package/dist/types-ts4.5/components/Search/types.d.ts +16 -0
  65. package/dist/types-ts4.5/components/Settings/index.d.ts +11 -0
  66. package/dist/types-ts4.5/components/Settings/types.d.ts +2 -0
  67. package/dist/types-ts4.5/components/SignIn/index.d.ts +12 -0
  68. package/dist/types-ts4.5/components/SignIn/skeleton.d.ts +2 -0
  69. package/dist/types-ts4.5/components/SignIn/types.d.ts +2 -0
  70. package/dist/types-ts4.5/components/SkeletonCreateButton/index.d.ts +14 -0
  71. package/dist/types-ts4.5/components/SkeletonCreateButton/types.d.ts +12 -0
  72. package/dist/types-ts4.5/components/SkeletonIconButton/index.d.ts +14 -0
  73. package/dist/types-ts4.5/components/SkeletonIconButton/types.d.ts +18 -0
  74. package/dist/types-ts4.5/components/SkeletonPrimaryButton/index.d.ts +14 -0
  75. package/dist/types-ts4.5/components/SkeletonPrimaryButton/types.d.ts +25 -0
  76. package/dist/types-ts4.5/controllers/overflow/index.d.ts +44 -0
  77. package/dist/types-ts4.5/controllers/overflow/types.d.ts +7 -0
  78. package/dist/types-ts4.5/index.d.ts +30 -0
  79. package/dist/types-ts4.5/skeleton-help-button.d.ts +19 -0
  80. package/dist/types-ts4.5/skeleton-notification-button.d.ts +19 -0
  81. package/dist/types-ts4.5/skeleton-settings-button.d.ts +19 -0
  82. package/dist/types-ts4.5/skeleton-switcher-button.d.ts +19 -0
  83. package/dist/types-ts4.5/skeleton.d.ts +5 -0
  84. package/dist/types-ts4.5/theme/default-theme.d.ts +6 -0
  85. package/dist/types-ts4.5/theme/index.d.ts +6 -0
  86. package/dist/types-ts4.5/theme/theme-generator.d.ts +3 -0
  87. package/dist/types-ts4.5/theme/theme-helpers.d.ts +5 -0
  88. package/dist/types-ts4.5/theme/theme-provider.d.ts +8 -0
  89. package/dist/types-ts4.5/theme/themes.d.ts +3 -0
  90. package/dist/types-ts4.5/theme/types.d.ts +69 -0
  91. package/dist/types-ts4.5/theme/use-theme.d.ts +1 -0
  92. package/package.json +12 -2
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export type SkeletonSettingsButtonProps = {
3
+ /**
4
+ * Describes the specific role of this navigation component for users viewing the page with a screen
5
+ * reader. Differentiates from other navigation buttons on a page.
6
+ */
7
+ label: string;
8
+ };
9
+ /**
10
+ * __Skeleton settings button__
11
+ *
12
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
13
+ * their heavier interactive counterparts, for use when elements of the
14
+ * navigation are loaded dynamically. This one represents the Settings button.
15
+ *
16
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
17
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
18
+ */
19
+ export declare const SkeletonSettingsButton: ({ label, }: SkeletonSettingsButtonProps) => JSX.Element;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export type SkeletonSwitcherButtonProps = {
3
+ /**
4
+ * Describes the specific role of this navigation component for users viewing the page with a screen
5
+ * reader. Differentiates from other navigation buttons on a page.
6
+ */
7
+ label: string;
8
+ };
9
+ /**
10
+ * __Skeleton switcher button__
11
+ *
12
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
13
+ * their heavier interactive counterparts, for use when elements of the
14
+ * navigation are loaded dynamically. This one represents the AppSwitcher button.
15
+ *
16
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
17
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
18
+ */
19
+ export declare const SkeletonSwitcherButton: ({ label, }: SkeletonSwitcherButtonProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ export { NavigationSkeleton } from './components/AtlassianNavigation/skeleton';
2
+ export type { NavigationSkeletonProps } from './components/AtlassianNavigation/types';
3
+ export { SkeletonCreateButton } from './components/SkeletonCreateButton';
4
+ export { SkeletonIconButton } from './components/SkeletonIconButton';
5
+ export { SkeletonPrimaryButton } from './components/SkeletonPrimaryButton';
@@ -0,0 +1,6 @@
1
+ import { Mode } from './types';
2
+ declare const defaultTheme: {
3
+ mode: Mode;
4
+ };
5
+ export declare const DEFAULT_THEME_NAME = "atlassian";
6
+ export default defaultTheme;
@@ -0,0 +1,6 @@
1
+ export { generateTheme } from './theme-generator';
2
+ export { ThemeProvider } from './theme-provider';
3
+ export { atlassianTheme, defaultTheme } from './themes';
4
+ export type { CreateCSS, IconButtonCSS, Mode, NavigationCSS, NavigationTheme, PrimaryButtonCSS, SearchCSS, ProductHomeCSS, SkeletonCSS, Colors, GenerateThemeArgs, } from './types';
5
+ export { useTheme } from './use-theme';
6
+ export { hexToRGBA } from './theme-helpers';
@@ -0,0 +1,3 @@
1
+ import { GenerateThemeArgs, NavigationTheme } from './types';
2
+ export declare const generateTheme: (themeColors: GenerateThemeArgs) => NavigationTheme;
3
+ export default generateTheme;
@@ -0,0 +1,5 @@
1
+ export declare const hexToRGBA: (hex: string, opacity?: number) => string;
2
+ export declare const getBoxShadow: (color: string) => string;
3
+ export declare const convertHexShorthand: (color: string) => string;
4
+ export declare const generateTextColor: (color: string) => string;
5
+ export declare const getContrastColor: (contrastValue: number, opacityValue: number, color: string) => string;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const ThemeContext: import("react").Context<import("./types").NavigationTheme>;
3
+ /**
4
+ * __Theme provider__
5
+ *
6
+ * A provider for the theme context used by all navigation components.
7
+ */
8
+ export declare const ThemeProvider: import("react").Provider<import("./types").NavigationTheme>;
@@ -0,0 +1,3 @@
1
+ import { NavigationTheme } from './types';
2
+ export declare const atlassianTheme: NavigationTheme;
3
+ export declare const defaultTheme: NavigationTheme;
@@ -0,0 +1,69 @@
1
+ import { CSSObject } from '@emotion/react';
2
+ export type CSSProperties = CSSObject & {
3
+ backgroundColor: string;
4
+ color: string;
5
+ };
6
+ export type ButtonCSSProperties = CSSProperties & {
7
+ boxShadow: string;
8
+ };
9
+ export type ButtonCSSContext = {
10
+ default: ButtonCSSProperties;
11
+ hover: ButtonCSSProperties;
12
+ focus: ButtonCSSProperties;
13
+ active: ButtonCSSProperties;
14
+ selected: ButtonCSSProperties;
15
+ selectedHover?: ButtonCSSProperties;
16
+ };
17
+ export type CreateCSS = ButtonCSSContext;
18
+ export type IconButtonCSS = ButtonCSSContext;
19
+ export type PrimaryButtonCSS = ButtonCSSContext;
20
+ export type NavigationCSS = CSSProperties;
21
+ type LogoStyleProps = {
22
+ iconGradientStart?: string;
23
+ iconGradientStop?: string;
24
+ iconColor?: string;
25
+ textColor?: string;
26
+ };
27
+ export type ProductHomeCSS = CSSProperties & LogoStyleProps;
28
+ export type SearchCSS = {
29
+ default: CSSProperties;
30
+ focus: CSSObject;
31
+ hover: CSSObject;
32
+ };
33
+ export type SkeletonCSS = CSSObject & {
34
+ backgroundColor: string;
35
+ opacity: number;
36
+ };
37
+ export type Mode = {
38
+ create: CreateCSS;
39
+ iconButton: IconButtonCSS;
40
+ navigation: NavigationCSS;
41
+ primaryButton: PrimaryButtonCSS;
42
+ productHome: ProductHomeCSS;
43
+ search: SearchCSS;
44
+ skeleton: SkeletonCSS;
45
+ };
46
+ export type NavigationTheme = {
47
+ mode: Mode;
48
+ };
49
+ export type Colors = {
50
+ backgroundColor: string;
51
+ color: string;
52
+ };
53
+ export type GenerateThemeArgs = {
54
+ /**
55
+ * Name of the theme.
56
+ * If you pass in "atlassian" will return the default atlassian theme and not
57
+ * use any of the colors you pass in.
58
+ */
59
+ name?: string;
60
+ /**
61
+ * Main background color of the horizontal navigation bar.
62
+ */
63
+ backgroundColor: string;
64
+ /**
65
+ * Highlight color for the navigation actions.
66
+ */
67
+ highlightColor: string;
68
+ };
69
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useTheme: () => import("./types").NavigationTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,9 @@
37
37
  "@atlaskit/ds-lib": "^2.2.0",
38
38
  "@atlaskit/icon": "^21.12.0",
39
39
  "@atlaskit/logo": "*",
40
+ "@atlaskit/platform-feature-flags": "^0.2.0",
40
41
  "@atlaskit/popup": "^1.6.0",
42
+ "@atlaskit/primitives": "^0.9.2",
41
43
  "@atlaskit/theme": "^12.5.0",
42
44
  "@atlaskit/tokens": "^1.4.0",
43
45
  "@atlaskit/tooltip": "^17.8.0",
@@ -63,6 +65,8 @@
63
65
  "@atlaskit/spinner": "*",
64
66
  "@atlaskit/visual-regression": "*",
65
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
68
+ "@atlassian/feature-flags-test-utils": "^0.1.1",
69
+ "@atlassian/gemini-visual-regression": "*",
66
70
  "@atlassian/switcher": "*",
67
71
  "@atlassian/switcher-test-utils": "*",
68
72
  "@testing-library/react": "^12.1.5",
@@ -70,6 +74,7 @@
70
74
  "jest-axe": "^4.0.0",
71
75
  "jest-emotion": "^10.0.32",
72
76
  "react": "^16.8.0",
77
+ "react-dom": "^16.8.0",
73
78
  "react-intl-next": "npm:react-intl@^5.18.1",
74
79
  "typescript": "~4.9.5"
75
80
  },
@@ -93,5 +98,10 @@
93
98
  }
94
99
  },
95
100
  "homepage": "https://atlassian.design/components/atlassian-navigation/",
96
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
101
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
102
+ "platform-feature-flags": {
103
+ "platform.design-system-team.navigation-v2-no-jank_5yhbd": {
104
+ "type": "boolean"
105
+ }
106
+ }
97
107
  }