@atlaskit/flag 15.6.5 → 15.7.1

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 15.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#118560](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/118560)
14
+ [`cca5dee6530a8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cca5dee6530a8) -
15
+ Accessibility improvements. Add `headingLevel` prop.
16
+
3
17
  ## 15.6.5
4
18
 
5
19
  ### Patch Changes
@@ -15,7 +15,7 @@ var _flagGroup = require("./flag-group");
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var packageName = "@atlaskit/flag";
18
- var packageVersion = "15.6.5";
18
+ var packageVersion = "15.7.1";
19
19
  var AUTO_DISMISS_SECONDS = exports.AUTO_DISMISS_SECONDS = 8;
20
20
 
21
21
  /**
package/dist/cjs/flag.js CHANGED
@@ -11,6 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
13
  var _primitives = require("@atlaskit/primitives");
14
+ var _heading = _interopRequireDefault(require("@atlaskit/heading"));
14
15
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
15
16
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
17
  var _constants = require("./constants");
@@ -55,7 +56,7 @@ var flagWrapperStyles = (0, _react2.css)({
55
56
  var analyticsAttributes = {
56
57
  componentName: 'flag',
57
58
  packageName: "@atlaskit/flag",
58
- packageVersion: "15.6.5"
59
+ packageVersion: "15.7.1"
59
60
  };
60
61
  var transitionStyles = (0, _react2.css)({
61
62
  flexGrow: 1,
@@ -92,7 +93,9 @@ var Flag = function Flag(props) {
92
93
  testId = props.testId,
93
94
  id = props.id,
94
95
  analyticsContext = props.analyticsContext,
95
- delayAnnouncement = props.delayAnnouncement;
96
+ delayAnnouncement = props.delayAnnouncement,
97
+ _props$headingLevel = props.headingLevel,
98
+ headingLevel = _props$headingLevel === void 0 ? 2 : _props$headingLevel;
96
99
  var _useState = (0, _react.useState)(false),
97
100
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
98
101
  isDelayToAnnounce = _useState2[0],
@@ -187,11 +190,13 @@ var Flag = function Flag(props) {
187
190
  space: "space.100",
188
191
  spread: "space-between"
189
192
  }, (0, _react2.jsx)(_primitives.Box, {
190
- paddingBlockStart: "space.025",
193
+ paddingBlockStart: "space.050",
194
+ paddingBlockEnd: "space.025",
191
195
  xcss: overflowWrapStyles
192
- }, (0, _react2.jsx)(_primitives.Text, {
193
- color: textColor,
194
- weight: "semibold"
196
+ }, (0, _react2.jsx)(_heading.default, {
197
+ as: "h".concat(headingLevel),
198
+ size: "xsmall",
199
+ color: textColor
195
200
  }, title)), isDismissable ? !(isBold && !description && !actions.length) && (0, _react2.jsx)(_internal.DismissButton, {
196
201
  testId: testId,
197
202
  appearance: appearance,
package/dist/cjs/theme.js CHANGED
@@ -26,14 +26,14 @@ var flagIconColor = exports.flagIconColor = {
26
26
  var flagTextColor = exports.flagTextColor = {
27
27
  error: 'color.text.inverse',
28
28
  info: 'color.text.inverse',
29
- normal: 'color.text.subtle',
29
+ normal: 'color.text',
30
30
  success: 'color.text.inverse',
31
31
  warning: 'color.text.warning.inverse'
32
32
  };
33
33
  var flagTextColorToken = exports.flagTextColorToken = {
34
34
  error: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
35
35
  info: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
36
- normal: "var(--ds-text-subtle, ".concat(_colors.N500, ")"),
36
+ normal: "var(--ds-text, ".concat(_colors.N800, ")"),
37
37
  success: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
38
38
  warning: "var(--ds-text-warning-inverse, ".concat(_colors.N700, ")")
39
39
  };
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  const packageName = "@atlaskit/flag";
8
- const packageVersion = "15.6.5";
8
+ const packageVersion = "15.7.1";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -7,7 +7,8 @@ import { useCallback, useEffect, useState } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { jsx, css } from '@emotion/react';
10
- import { Inline, Stack, Box, xcss, Text } from '@atlaskit/primitives';
10
+ import { Inline, Stack, Box, xcss } from '@atlaskit/primitives';
11
+ import Heading from '@atlaskit/heading';
11
12
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
12
13
  import noop from '@atlaskit/ds-lib/noop';
13
14
  import { DEFAULT_APPEARANCE } from './constants';
@@ -48,7 +49,7 @@ const flagWrapperStyles = css({
48
49
  const analyticsAttributes = {
49
50
  componentName: 'flag',
50
51
  packageName: "@atlaskit/flag",
51
- packageVersion: "15.6.5"
52
+ packageVersion: "15.7.1"
52
53
  };
53
54
  const transitionStyles = css({
54
55
  flexGrow: 1,
@@ -81,7 +82,8 @@ const Flag = props => {
81
82
  testId,
82
83
  id,
83
84
  analyticsContext,
84
- delayAnnouncement
85
+ delayAnnouncement,
86
+ headingLevel = 2
85
87
  } = props;
86
88
  const [isDelayToAnnounce, setIsDelayToAnnounce] = useState(false);
87
89
  const {
@@ -175,11 +177,13 @@ const Flag = props => {
175
177
  space: "space.100",
176
178
  spread: "space-between"
177
179
  }, jsx(Box, {
178
- paddingBlockStart: "space.025",
180
+ paddingBlockStart: "space.050",
181
+ paddingBlockEnd: "space.025",
179
182
  xcss: overflowWrapStyles
180
- }, jsx(Text, {
181
- color: textColor,
182
- weight: "semibold"
183
+ }, jsx(Heading, {
184
+ as: `h${headingLevel}`,
185
+ size: "xsmall",
186
+ color: textColor
183
187
  }, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
184
188
  testId: testId,
185
189
  appearance: appearance,
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
2
 
3
- import { B400, N0, N30A, N500, N700 } from '@atlaskit/theme/colors';
3
+ import { B400, N0, N30A, N500, N700, N800 } from '@atlaskit/theme/colors';
4
4
  export const flagBackgroundColor = {
5
5
  error: 'color.background.danger.bold',
6
6
  info: 'color.background.neutral.bold',
@@ -20,14 +20,14 @@ export const flagIconColor = {
20
20
  export const flagTextColor = {
21
21
  error: 'color.text.inverse',
22
22
  info: 'color.text.inverse',
23
- normal: 'color.text.subtle',
23
+ normal: 'color.text',
24
24
  success: 'color.text.inverse',
25
25
  warning: 'color.text.warning.inverse'
26
26
  };
27
27
  export const flagTextColorToken = {
28
28
  error: `var(--ds-text-inverse, ${N0})`,
29
29
  info: `var(--ds-text-inverse, ${N0})`,
30
- normal: `var(--ds-text-subtle, ${N500})`,
30
+ normal: `var(--ds-text, ${N800})`,
31
31
  success: `var(--ds-text-inverse, ${N0})`,
32
32
  warning: `var(--ds-text-warning-inverse, ${N700})`
33
33
  };
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  var packageName = "@atlaskit/flag";
8
- var packageVersion = "15.6.5";
8
+ var packageVersion = "15.7.1";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
package/dist/esm/flag.js CHANGED
@@ -11,7 +11,8 @@ import { useCallback, useEffect, useState } from 'react';
11
11
 
12
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
13
  import { jsx, css } from '@emotion/react';
14
- import { Inline, Stack, Box, xcss, Text } from '@atlaskit/primitives';
14
+ import { Inline, Stack, Box, xcss } from '@atlaskit/primitives';
15
+ import Heading from '@atlaskit/heading';
15
16
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
16
17
  import noop from '@atlaskit/ds-lib/noop';
17
18
  import { DEFAULT_APPEARANCE } from './constants';
@@ -52,7 +53,7 @@ var flagWrapperStyles = css({
52
53
  var analyticsAttributes = {
53
54
  componentName: 'flag',
54
55
  packageName: "@atlaskit/flag",
55
- packageVersion: "15.6.5"
56
+ packageVersion: "15.7.1"
56
57
  };
57
58
  var transitionStyles = css({
58
59
  flexGrow: 1,
@@ -89,7 +90,9 @@ var Flag = function Flag(props) {
89
90
  testId = props.testId,
90
91
  id = props.id,
91
92
  analyticsContext = props.analyticsContext,
92
- delayAnnouncement = props.delayAnnouncement;
93
+ delayAnnouncement = props.delayAnnouncement,
94
+ _props$headingLevel = props.headingLevel,
95
+ headingLevel = _props$headingLevel === void 0 ? 2 : _props$headingLevel;
93
96
  var _useState = useState(false),
94
97
  _useState2 = _slicedToArray(_useState, 2),
95
98
  isDelayToAnnounce = _useState2[0],
@@ -184,11 +187,13 @@ var Flag = function Flag(props) {
184
187
  space: "space.100",
185
188
  spread: "space-between"
186
189
  }, jsx(Box, {
187
- paddingBlockStart: "space.025",
190
+ paddingBlockStart: "space.050",
191
+ paddingBlockEnd: "space.025",
188
192
  xcss: overflowWrapStyles
189
- }, jsx(Text, {
190
- color: textColor,
191
- weight: "semibold"
193
+ }, jsx(Heading, {
194
+ as: "h".concat(headingLevel),
195
+ size: "xsmall",
196
+ color: textColor
192
197
  }, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
193
198
  testId: testId,
194
199
  appearance: appearance,
package/dist/esm/theme.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
2
 
3
- import { B400, N0, N30A, N500, N700 } from '@atlaskit/theme/colors';
3
+ import { B400, N0, N30A, N500, N700, N800 } from '@atlaskit/theme/colors';
4
4
  export var flagBackgroundColor = {
5
5
  error: 'color.background.danger.bold',
6
6
  info: 'color.background.neutral.bold',
@@ -20,14 +20,14 @@ export var flagIconColor = {
20
20
  export var flagTextColor = {
21
21
  error: 'color.text.inverse',
22
22
  info: 'color.text.inverse',
23
- normal: 'color.text.subtle',
23
+ normal: 'color.text',
24
24
  success: 'color.text.inverse',
25
25
  warning: 'color.text.warning.inverse'
26
26
  };
27
27
  export var flagTextColorToken = {
28
28
  error: "var(--ds-text-inverse, ".concat(N0, ")"),
29
29
  info: "var(--ds-text-inverse, ".concat(N0, ")"),
30
- normal: "var(--ds-text-subtle, ".concat(N500, ")"),
30
+ normal: "var(--ds-text, ".concat(N800, ")"),
31
31
  success: "var(--ds-text-inverse, ".concat(N0, ")"),
32
32
  warning: "var(--ds-text-warning-inverse, ".concat(N700, ")")
33
33
  };
@@ -1,12 +1,12 @@
1
- import { type BackgroundColor, type TextProps } from '@atlaskit/primitives';
2
- import { type AppearanceTypes } from './types';
1
+ import { type BackgroundColor } from '@atlaskit/primitives';
2
+ import { type AppearanceTypes, type HeadingColor } from './types';
3
3
  export declare const flagBackgroundColor: Record<AppearanceTypes, BackgroundColor>;
4
4
  export declare const flagIconColor: Record<AppearanceTypes, string>;
5
- export declare const flagTextColor: Record<AppearanceTypes, TextProps['color']>;
5
+ export declare const flagTextColor: Record<AppearanceTypes, HeadingColor>;
6
6
  export declare const flagTextColorToken: {
7
7
  error: "var(--ds-text-inverse)";
8
8
  info: "var(--ds-text-inverse)";
9
- normal: "var(--ds-text-subtle)";
9
+ normal: "var(--ds-text)";
10
10
  success: "var(--ds-text-inverse)";
11
11
  warning: "var(--ds-text-warning-inverse)";
12
12
  };
@@ -10,6 +10,7 @@ export type ActionType = {
10
10
  };
11
11
  export type ActionsType = Array<ActionType>;
12
12
  export type AppearanceTypes = 'error' | 'info' | 'success' | 'warning' | 'normal';
13
+ export type HeadingColor = 'color.text' | 'color.text.inverse' | 'color.text.warning.inverse';
13
14
  export declare const AppearanceArray: AppearanceTypes[];
14
15
  type FlagPropsId = {
15
16
  /**
@@ -75,6 +76,11 @@ type AutoDismissFlagPropsWithoutId = {
75
76
  * Additional information to be included in the `context` of analytics events that come from flag.
76
77
  */
77
78
  analyticsContext?: Record<string, any>;
79
+ /**
80
+ * Specifies the heading level in the document structure.
81
+ * If not specified, the default is `2`.
82
+ */
83
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
78
84
  };
79
85
  export interface AutoDismissFlagProps extends AutoDismissFlagPropsWithoutId, FlagPropsId {
80
86
  }
@@ -1,12 +1,12 @@
1
- import { type BackgroundColor, type TextProps } from '@atlaskit/primitives';
2
- import { type AppearanceTypes } from './types';
1
+ import { type BackgroundColor } from '@atlaskit/primitives';
2
+ import { type AppearanceTypes, type HeadingColor } from './types';
3
3
  export declare const flagBackgroundColor: Record<AppearanceTypes, BackgroundColor>;
4
4
  export declare const flagIconColor: Record<AppearanceTypes, string>;
5
- export declare const flagTextColor: Record<AppearanceTypes, TextProps['color']>;
5
+ export declare const flagTextColor: Record<AppearanceTypes, HeadingColor>;
6
6
  export declare const flagTextColorToken: {
7
7
  error: "var(--ds-text-inverse)";
8
8
  info: "var(--ds-text-inverse)";
9
- normal: "var(--ds-text-subtle)";
9
+ normal: "var(--ds-text)";
10
10
  success: "var(--ds-text-inverse)";
11
11
  warning: "var(--ds-text-warning-inverse)";
12
12
  };
@@ -10,6 +10,7 @@ export type ActionType = {
10
10
  };
11
11
  export type ActionsType = Array<ActionType>;
12
12
  export type AppearanceTypes = 'error' | 'info' | 'success' | 'warning' | 'normal';
13
+ export type HeadingColor = 'color.text' | 'color.text.inverse' | 'color.text.warning.inverse';
13
14
  export declare const AppearanceArray: AppearanceTypes[];
14
15
  type FlagPropsId = {
15
16
  /**
@@ -75,6 +76,11 @@ type AutoDismissFlagPropsWithoutId = {
75
76
  * Additional information to be included in the `context` of analytics events that come from flag.
76
77
  */
77
78
  analyticsContext?: Record<string, any>;
79
+ /**
80
+ * Specifies the heading level in the document structure.
81
+ * If not specified, the default is `2`.
82
+ */
83
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
78
84
  };
79
85
  export interface AutoDismissFlagProps extends AutoDismissFlagPropsWithoutId, FlagPropsId {
80
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.6.5",
3
+ "version": "15.7.1",
4
4
  "description": "A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -47,12 +47,13 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@atlaskit/analytics-next": "^9.3.0",
50
- "@atlaskit/button": "^18.0.0",
50
+ "@atlaskit/button": "^18.3.0",
51
51
  "@atlaskit/ds-lib": "^2.3.0",
52
- "@atlaskit/icon": "^22.5.0",
52
+ "@atlaskit/heading": "^2.4.0",
53
+ "@atlaskit/icon": "^22.6.0",
53
54
  "@atlaskit/motion": "^1.7.0",
54
55
  "@atlaskit/portal": "^4.6.0",
55
- "@atlaskit/primitives": "^10.0.0",
56
+ "@atlaskit/primitives": "^11.0.0",
56
57
  "@atlaskit/theme": "^12.11.0",
57
58
  "@atlaskit/tokens": "^1.53.0",
58
59
  "@atlaskit/visually-hidden": "^1.4.0",