@atlaskit/atlassian-navigation 2.0.1 → 2.1.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 (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/common/styles.js +2 -2
  3. package/dist/cjs/components/AppSwitcher/index.js +3 -1
  4. package/dist/cjs/components/AtlassianNavigation/styles.js +2 -2
  5. package/dist/cjs/components/Create/index.js +3 -0
  6. package/dist/cjs/components/Create/styles.js +2 -2
  7. package/dist/cjs/components/Help/index.js +3 -1
  8. package/dist/cjs/components/IconButton/index.js +3 -1
  9. package/dist/cjs/components/IconButton/styles.js +2 -2
  10. package/dist/cjs/components/Notifications/index.js +3 -1
  11. package/dist/cjs/components/PrimaryButton/index.js +2 -2
  12. package/dist/cjs/components/PrimaryButton/styles.js +2 -2
  13. package/dist/cjs/components/ProductHome/custom-product-home.js +3 -2
  14. package/dist/cjs/components/ProductHome/product-home.js +3 -2
  15. package/dist/cjs/components/ProductHome/styles.js +2 -2
  16. package/dist/cjs/components/Search/index.js +3 -2
  17. package/dist/cjs/components/Search/styles.js +2 -2
  18. package/dist/cjs/components/Settings/index.js +3 -1
  19. package/dist/cjs/components/SignIn/index.js +3 -1
  20. package/dist/cjs/components/SkeletonCreateButton/styles.js +2 -2
  21. package/dist/cjs/components/SkeletonIconButton/styles.js +2 -2
  22. package/dist/cjs/components/SkeletonPrimaryButton/styles.js +2 -2
  23. package/dist/cjs/theme/defaultTheme.js +40 -40
  24. package/dist/cjs/theme/themeGenerator.js +2 -2
  25. package/dist/cjs/theme/themeHelpers.js +2 -2
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/components/Create/index.js +3 -0
  28. package/dist/es2019/theme/defaultTheme.js +40 -40
  29. package/dist/es2019/version.json +1 -1
  30. package/dist/esm/common/styles.js +2 -2
  31. package/dist/esm/components/AppSwitcher/index.js +2 -1
  32. package/dist/esm/components/AtlassianNavigation/styles.js +2 -2
  33. package/dist/esm/components/Create/index.js +3 -0
  34. package/dist/esm/components/Create/styles.js +2 -2
  35. package/dist/esm/components/Help/index.js +2 -1
  36. package/dist/esm/components/IconButton/index.js +2 -1
  37. package/dist/esm/components/IconButton/styles.js +2 -2
  38. package/dist/esm/components/Notifications/index.js +2 -1
  39. package/dist/esm/components/PrimaryButton/index.js +2 -1
  40. package/dist/esm/components/PrimaryButton/styles.js +2 -2
  41. package/dist/esm/components/ProductHome/custom-product-home.js +2 -1
  42. package/dist/esm/components/ProductHome/product-home.js +2 -1
  43. package/dist/esm/components/ProductHome/styles.js +2 -2
  44. package/dist/esm/components/Search/index.js +2 -1
  45. package/dist/esm/components/Search/styles.js +2 -2
  46. package/dist/esm/components/Settings/index.js +2 -1
  47. package/dist/esm/components/SignIn/index.js +2 -1
  48. package/dist/esm/components/SkeletonCreateButton/styles.js +2 -2
  49. package/dist/esm/components/SkeletonIconButton/styles.js +2 -2
  50. package/dist/esm/components/SkeletonPrimaryButton/styles.js +2 -2
  51. package/dist/esm/theme/defaultTheme.js +40 -40
  52. package/dist/esm/theme/themeGenerator.js +2 -2
  53. package/dist/esm/theme/themeHelpers.js +2 -2
  54. package/dist/esm/version.json +1 -1
  55. package/dist/types/components/Create/index.d.ts +1 -1
  56. package/dist/types/components/Create/types.d.ts +5 -1
  57. package/docs/05-create.tsx +8 -0
  58. package/package.json +6 -6
@@ -4,23 +4,23 @@ var defaultTheme = {
4
4
  mode: {
5
5
  create: {
6
6
  active: {
7
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
8
- backgroundColor: "var(--ds-background-boldBrand-pressed, ".concat(hexToRGBA(B400, 0.8), ")"),
7
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
8
+ backgroundColor: "var(--ds-background-brand-bold-pressed, ".concat(hexToRGBA(B400, 0.8), ")"),
9
9
  boxShadow: ''
10
10
  },
11
11
  default: {
12
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
13
- backgroundColor: "var(--ds-background-boldBrand-resting, ".concat(B400, ")"),
12
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
13
+ backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
14
14
  boxShadow: ''
15
15
  },
16
16
  focus: {
17
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
18
- backgroundColor: "var(--ds-background-boldBrand-resting, ".concat(B400, ")"),
19
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, rgb(128,169,230))")
17
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
18
+ backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
19
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, rgb(128,169,230))")
20
20
  },
21
21
  hover: {
22
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
23
- backgroundColor: "var(--ds-background-boldBrand-hover, ".concat(hexToRGBA(B400, 0.9), ")"),
22
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
23
+ backgroundColor: "var(--ds-background-brand-bold-hovered, ".concat(hexToRGBA(B400, 0.9), ")"),
24
24
  boxShadow: ''
25
25
  },
26
26
  selected: {
@@ -31,39 +31,39 @@ var defaultTheme = {
31
31
  },
32
32
  iconButton: {
33
33
  active: {
34
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
35
- backgroundColor: "var(--ds-background-subtleNeutral-pressed, ".concat(hexToRGBA(B50, 0.6), ")"),
34
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
35
+ backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.6), ")"),
36
36
  boxShadow: ''
37
37
  },
38
38
  default: {
39
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
39
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
40
40
  backgroundColor: 'transparent',
41
41
  boxShadow: ''
42
42
  },
43
43
  focus: {
44
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
45
- backgroundColor: "var(--ds-background-subtleBrand-hover, ".concat(hexToRGBA(B50, 0.5), ")"),
46
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, ".concat(B200, ")"))
44
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
45
+ backgroundColor: "var(--ds-background-brand-hovered, ".concat(hexToRGBA(B50, 0.5), ")"),
46
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
47
47
  },
48
48
  hover: {
49
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
50
- backgroundColor: "var(--ds-background-subtleNeutral-hover, ".concat(hexToRGBA(B50, 0.9), ")"),
49
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
50
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
51
51
  boxShadow: ''
52
52
  },
53
53
  selected: {
54
- color: "var(--ds-text-selected)",
55
- backgroundColor: "var(--ds-background-selected-resting)",
54
+ color: "var(--ds-text-brand)",
55
+ backgroundColor: "var(--ds-background-brand)",
56
56
  boxShadow: ''
57
57
  }
58
58
  },
59
59
  navigation: {
60
- backgroundColor: "var(--ds-background-default, ".concat(N0, ")"),
61
- color: "var(--ds-text-lowEmphasis, ".concat(N200, ")")
60
+ backgroundColor: "var(--ds-surface, ".concat(N0, ")"),
61
+ color: "var(--ds-text-subtlest, ".concat(N200, ")")
62
62
  },
63
63
  productHome: {
64
64
  backgroundColor: "var(--ds-text-brand, ".concat(B400, ")"),
65
- color: "var(--ds-text-highEmphasis, ".concat(N700, ")"),
66
- borderRight: "1px solid ".concat("var(--ds-border-neutral, ".concat(hexToRGBA(N200, 0.3), ")")),
65
+ color: "var(--ds-text, ".concat(N700, ")"),
66
+ borderRight: "1px solid ".concat("var(--ds-border, ".concat(hexToRGBA(N200, 0.3), ")")),
67
67
  // TODO: (DSP-1256) These colors should be moved into the Logo package
68
68
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
69
69
  iconGradientStart: B400,
@@ -74,49 +74,49 @@ var defaultTheme = {
74
74
  },
75
75
  primaryButton: {
76
76
  active: {
77
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
78
- backgroundColor: "var(--ds-background-subtleNeutral-pressed, ".concat(hexToRGBA(B50, 0.7), ")"),
77
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
78
+ backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.7), ")"),
79
79
  boxShadow: ''
80
80
  },
81
81
  default: {
82
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
82
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
83
83
  backgroundColor: 'transparent',
84
84
  boxShadow: ''
85
85
  },
86
86
  focus: {
87
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
87
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
88
88
  backgroundColor: '',
89
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, ".concat(B200, ")"))
89
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
90
90
  },
91
91
  hover: {
92
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
93
- backgroundColor: "var(--ds-background-subtleNeutral-hover, ".concat(hexToRGBA(B50, 0.9), ")"),
92
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
93
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
94
94
  boxShadow: ''
95
95
  },
96
96
  selected: {
97
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
98
- backgroundColor: "var(--ds-background-selected-resting)",
97
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
98
+ backgroundColor: "var(--ds-background-brand)",
99
99
  boxShadow: '',
100
- borderColor: "var(--ds-iconBorder-brand, ".concat(B400, ")"),
101
- bordorBottom: "4px solid ".concat("var(--ds-iconBorder-brand, ".concat(B400, ")"))
100
+ borderColor: "var(--ds-border-brand, ".concat(B400, ")"),
101
+ bordorBottom: "4px solid ".concat("var(--ds-border-brand, ".concat(B400, ")"))
102
102
  }
103
103
  },
104
104
  search: {
105
105
  default: {
106
- backgroundColor: "var(--ds-background-default, ".concat(N0, ")"),
107
- color: "var(--ds-text-lowEmphasis, ".concat(N200, ")"),
108
- borderColor: "var(--ds-border-neutral, ".concat(N40, ")")
106
+ backgroundColor: "var(--ds-surface, ".concat(N0, ")"),
107
+ color: "var(--ds-text-subtlest, ".concat(N200, ")"),
108
+ borderColor: "var(--ds-border, ".concat(N40, ")")
109
109
  },
110
110
  focus: {
111
- borderColor: "var(--ds-border-focus, ".concat(B200, ")")
111
+ borderColor: "var(--ds-border-focused, ".concat(B200, ")")
112
112
  },
113
113
  hover: {
114
114
  color: "var(--ds-text-brand, ".concat(B400, ")"),
115
- backgroundColor: "var(--ds-background-default, ".concat(hexToRGBA(B50, 0.9), ")")
115
+ backgroundColor: "var(--ds-surface, ".concat(hexToRGBA(B50, 0.9), ")")
116
116
  }
117
117
  },
118
118
  skeleton: {
119
- backgroundColor: "var(--ds-background-subtleNeutral-resting, ".concat(N20, ")"),
119
+ backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
120
120
  opacity: 1
121
121
  }
122
122
  }
@@ -1,8 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
 
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  import defaultTheme, { DEFAULT_THEME_NAME } from './defaultTheme';
8
8
  import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './themeHelpers';
@@ -1,9 +1,9 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
 
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
 
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
 
8
8
  import chromatism from 'chromatism';
9
9
  export var hexToRGBA = function hexToRGBA(hex) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { CreateProps } from './types';
3
- export declare const Create: ({ onClick, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
3
+ export declare const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
4
4
  export default Create;
@@ -16,7 +16,11 @@ export interface CreateProps {
16
16
  * Click handler.
17
17
  * See @atlaskit/analytics-next for analyticsEvent type information
18
18
  */
19
- onClick: (e: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
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;
20
24
  /**
21
25
  * A `testId` prop is provided for specified elements,
22
26
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
@@ -20,6 +20,14 @@ import { Create } from '@atlaskit/atlassian-navigation';
20
20
  />
21
21
  )}
22
22
 
23
+ ${(
24
+ <Example
25
+ title="Create as a link"
26
+ Component={require('../examples/create-with-link.tsx').default}
27
+ source={require('!!raw-loader!../examples/create-with-link.tsx')}
28
+ />
29
+ )}
30
+
23
31
  ${(
24
32
  <Props
25
33
  heading="Props"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,13 +23,13 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@atlaskit/analytics-namespaced-context": "^6.3.0",
26
+ "@atlaskit/analytics-namespaced-context": "^6.4.0",
27
27
  "@atlaskit/button": "^16.0.0",
28
- "@atlaskit/icon": "^21.9.0",
28
+ "@atlaskit/icon": "^21.10.0",
29
29
  "@atlaskit/logo": "*",
30
- "@atlaskit/popup": "^1.2.0",
31
- "@atlaskit/theme": "^12.0.0",
32
- "@atlaskit/tokens": "^0.4.0",
30
+ "@atlaskit/popup": "^1.3.0",
31
+ "@atlaskit/theme": "^12.1.0",
32
+ "@atlaskit/tokens": "^0.6.0",
33
33
  "@atlaskit/tooltip": "^17.5.0",
34
34
  "@atlaskit/width-detector": "^3.0.0",
35
35
  "@babel/runtime": "^7.0.0",