@atlaskit/primitives 7.0.2 → 7.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.
- package/CHANGELOG.md +45 -0
- package/dist/cjs/components/anchor.js +17 -4
- package/dist/cjs/components/box.js +20 -2
- package/dist/cjs/components/flex.js +7 -1
- package/dist/cjs/components/grid.js +7 -1
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/es2019/components/anchor.js +16 -3
- package/dist/es2019/components/box.js +20 -2
- package/dist/es2019/components/flex.js +7 -1
- package/dist/es2019/components/grid.js +7 -1
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/responsive/build-media-query-css.js +2 -1
- package/dist/es2019/xcss/style-maps.partial.js +1 -0
- package/dist/es2019/xcss/xcss.js +1 -0
- package/dist/esm/components/anchor.js +17 -4
- package/dist/esm/components/box.js +20 -2
- package/dist/esm/components/flex.js +7 -1
- package/dist/esm/components/grid.js +7 -1
- package/dist/esm/components/pressable.js +1 -1
- package/dist/types/components/anchor.d.ts +3 -7
- package/dist/types/components/pressable.d.ts +3 -13
- package/dist/types/xcss/style-maps.partial.d.ts +12 -12
- package/dist/types-ts4.5/components/anchor.d.ts +3 -7
- package/dist/types-ts4.5/components/pressable.d.ts +3 -13
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +12 -12
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#110702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110702)
|
|
8
|
+
[`b8c2eefeb195b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8c2eefeb195b) - -
|
|
9
|
+
Anchor and Pressable primitives no longer require `children`, so labels can be supplied through
|
|
10
|
+
aria attributes if required
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#110702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110702)
|
|
15
|
+
[`b8c2eefeb195b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8c2eefeb195b) - -
|
|
16
|
+
Fixed a bug with Anchor, where the "(opens new window)" label was not being automatically appended
|
|
17
|
+
to `aria-label` or `aria-labelledby`.
|
|
18
|
+
|
|
19
|
+
## 7.0.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#110975](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110975)
|
|
24
|
+
[`c462a22b33940`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c462a22b33940) -
|
|
25
|
+
Removed type hinting for size values in the following properties in XCSS:
|
|
26
|
+
|
|
27
|
+
- blockSize
|
|
28
|
+
- height
|
|
29
|
+
- inlineSize
|
|
30
|
+
- maxBlockSize
|
|
31
|
+
- maxHeight
|
|
32
|
+
- maxInlineSize
|
|
33
|
+
- maxWidth
|
|
34
|
+
- minBlockSize
|
|
35
|
+
- minHeight
|
|
36
|
+
- minInlineSize
|
|
37
|
+
- minWidth
|
|
38
|
+
- width
|
|
39
|
+
|
|
40
|
+
These properties optionally accept size values like `width: 'size.100'`. However `size` will be
|
|
41
|
+
deprecated in the future. Therefore, the type hinting that displayed `size.XXX` has been removed
|
|
42
|
+
to discourage its usage until it is officially deprecated.
|
|
43
|
+
|
|
44
|
+
No changes in functionality have been introduced. The syntax `width: 'size.100'` remains valid for
|
|
45
|
+
now, so existing code will not be broken. However, consumers are encouraged to use hard-coded
|
|
46
|
+
values, like `width: '8px'`, instead.
|
|
47
|
+
|
|
3
48
|
## 7.0.2
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _reactUid = require("react-uid");
|
|
14
15
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
15
16
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
17
|
var _appProvider = require("@atlaskit/app-provider");
|
|
@@ -19,7 +20,7 @@ var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-
|
|
|
19
20
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
20
21
|
var _xcss = require("../xcss/xcss");
|
|
21
22
|
var _box = _interopRequireDefault(require("./box"));
|
|
22
|
-
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext"];
|
|
23
|
+
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby"];
|
|
23
24
|
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); }
|
|
24
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(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; }
|
|
25
26
|
// TODO: Duplicated FocusRing styles due to lack of `xcss` support
|
|
@@ -46,6 +47,7 @@ var focusRingStyles = (0, _xcss.xcss)({
|
|
|
46
47
|
});
|
|
47
48
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
48
49
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
50
|
+
var OPENS_NEW_WINDOW_LABEL = '(opens new window)';
|
|
49
51
|
var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
50
52
|
var href = _ref.href,
|
|
51
53
|
children = _ref.children,
|
|
@@ -65,18 +67,25 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
65
67
|
interactionName = _ref.interactionName,
|
|
66
68
|
componentName = _ref.componentName,
|
|
67
69
|
analyticsContext = _ref.analyticsContext,
|
|
70
|
+
ariaLabel = _ref['aria-label'],
|
|
71
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
68
72
|
htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
69
73
|
var interactionContext = (0, _react.useContext)(_interactionContext.default);
|
|
70
74
|
var handleClick = (0, _react.useCallback)(function (e, analyticsEvent) {
|
|
71
75
|
interactionContext && interactionContext.tracePress(interactionName, e.timeStamp);
|
|
72
76
|
providedOnClick(e, analyticsEvent);
|
|
73
77
|
}, [providedOnClick, interactionContext, interactionName]);
|
|
78
|
+
// TODO: Use React 18's useId() hook when we update.
|
|
79
|
+
// eslint-disable-next-line @repo/internal/react/disallow-unstable-values
|
|
80
|
+
var opensNewWindowLabelId = (0, _reactUid.uid)({
|
|
81
|
+
ariaLabelledBy: ariaLabelledBy
|
|
82
|
+
});
|
|
74
83
|
var onClick = (0, _analyticsNext.usePlatformLeafEventHandler)({
|
|
75
84
|
fn: handleClick,
|
|
76
85
|
action: 'clicked',
|
|
77
86
|
componentName: componentName || 'Anchor',
|
|
78
87
|
packageName: "@atlaskit/primitives",
|
|
79
|
-
packageVersion: "7.0
|
|
88
|
+
packageVersion: "7.1.0",
|
|
80
89
|
analyticsData: analyticsContext,
|
|
81
90
|
actionSubject: 'link'
|
|
82
91
|
});
|
|
@@ -117,11 +126,15 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
117
126
|
paddingInline: paddingInline,
|
|
118
127
|
paddingInlineStart: paddingInlineStart,
|
|
119
128
|
paddingInlineEnd: paddingInlineEnd,
|
|
120
|
-
onClick: onClick
|
|
129
|
+
onClick: onClick,
|
|
130
|
+
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(OPENS_NEW_WINDOW_LABEL) : ariaLabel,
|
|
131
|
+
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy
|
|
121
132
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
122
133
|
,
|
|
123
134
|
xcss: styles
|
|
124
|
-
}), children, target === '_blank' && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default,
|
|
135
|
+
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
|
|
136
|
+
id: opensNewWindowLabelId
|
|
137
|
+
}, OPENS_NEW_WINDOW_LABEL));
|
|
125
138
|
};
|
|
126
139
|
|
|
127
140
|
// Workarounds to support generic types with forwardRef
|
|
@@ -65,8 +65,26 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
65
65
|
className: resolvedStyles.static
|
|
66
66
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
67
67
|
}, safeHtmlAttributes, {
|
|
68
|
-
css: [baseStyles,
|
|
69
|
-
// eslint-disable-next-line @atlaskit/
|
|
68
|
+
css: [baseStyles,
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
|
+
backgroundColor && _styleMaps.backgroundColorStylesMap[backgroundColor],
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
72
|
+
(0, _styleMaps.isSurfaceColorToken)(backgroundColor) && _styleMaps.surfaceColorStylesMap[backgroundColor],
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
74
|
+
padding && _styleMaps.paddingStylesMap.padding[padding],
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
76
|
+
paddingBlock && _styleMaps.paddingStylesMap.paddingBlock[paddingBlock],
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
78
|
+
paddingBlockStart && _styleMaps.paddingStylesMap.paddingBlockStart[paddingBlockStart],
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
80
|
+
paddingBlockEnd && _styleMaps.paddingStylesMap.paddingBlockEnd[paddingBlockEnd],
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
82
|
+
paddingInline && _styleMaps.paddingStylesMap.paddingInline[paddingInline],
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
84
|
+
paddingInlineStart && _styleMaps.paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
85
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
86
|
+
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
87
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
70
88
|
resolvedStyles.emotion],
|
|
71
89
|
"data-testid": testId
|
|
72
90
|
}), children);
|
|
@@ -111,7 +111,13 @@ var Flex = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
111
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
112
112
|
,
|
|
113
113
|
className: resolvedStyles.static,
|
|
114
|
-
css: [baseStyles,
|
|
114
|
+
css: [baseStyles,
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
116
|
+
gap && _styleMaps.spaceStylesMap.gap[gap],
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
118
|
+
columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap],
|
|
119
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
120
|
+
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
115
121
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
116
122
|
resolvedStyles.emotion],
|
|
117
123
|
"data-testid": testId,
|
|
@@ -177,7 +177,13 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
177
177
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
178
178
|
,
|
|
179
179
|
className: resolvedStyles.static,
|
|
180
|
-
css: [baseStyles,
|
|
180
|
+
css: [baseStyles,
|
|
181
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
182
|
+
gap && _styleMaps.spaceStylesMap.gap[gap],
|
|
183
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
184
|
+
columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap],
|
|
185
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
186
|
+
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
181
187
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
188
|
resolvedStyles.emotion],
|
|
183
189
|
"data-testid": testId,
|
|
@@ -78,7 +78,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
78
78
|
action: 'clicked',
|
|
79
79
|
componentName: componentName || 'Pressable',
|
|
80
80
|
packageName: "@atlaskit/primitives",
|
|
81
|
-
packageVersion: "7.0
|
|
81
|
+
packageVersion: "7.1.0",
|
|
82
82
|
analyticsData: analyticsContext,
|
|
83
83
|
actionSubject: 'button'
|
|
84
84
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
3
|
+
import { uid } from 'react-uid';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
5
6
|
import { useRouterLink } from '@atlaskit/app-provider';
|
|
@@ -32,6 +33,7 @@ const focusRingStyles = xcss({
|
|
|
32
33
|
});
|
|
33
34
|
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
34
35
|
const IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
36
|
+
const OPENS_NEW_WINDOW_LABEL = '(opens new window)';
|
|
35
37
|
const AnchorNoRef = ({
|
|
36
38
|
href,
|
|
37
39
|
children,
|
|
@@ -50,6 +52,8 @@ const AnchorNoRef = ({
|
|
|
50
52
|
interactionName,
|
|
51
53
|
componentName,
|
|
52
54
|
analyticsContext,
|
|
55
|
+
'aria-label': ariaLabel,
|
|
56
|
+
'aria-labelledby': ariaLabelledBy,
|
|
53
57
|
...htmlAttributes
|
|
54
58
|
}, ref) => {
|
|
55
59
|
const interactionContext = useContext(InteractionContext);
|
|
@@ -57,12 +61,17 @@ const AnchorNoRef = ({
|
|
|
57
61
|
interactionContext && interactionContext.tracePress(interactionName, e.timeStamp);
|
|
58
62
|
providedOnClick(e, analyticsEvent);
|
|
59
63
|
}, [providedOnClick, interactionContext, interactionName]);
|
|
64
|
+
// TODO: Use React 18's useId() hook when we update.
|
|
65
|
+
// eslint-disable-next-line @repo/internal/react/disallow-unstable-values
|
|
66
|
+
const opensNewWindowLabelId = uid({
|
|
67
|
+
ariaLabelledBy
|
|
68
|
+
});
|
|
60
69
|
const onClick = usePlatformLeafEventHandler({
|
|
61
70
|
fn: handleClick,
|
|
62
71
|
action: 'clicked',
|
|
63
72
|
componentName: componentName || 'Anchor',
|
|
64
73
|
packageName: "@atlaskit/primitives",
|
|
65
|
-
packageVersion: "7.0
|
|
74
|
+
packageVersion: "7.1.0",
|
|
66
75
|
analyticsData: analyticsContext,
|
|
67
76
|
actionSubject: 'link'
|
|
68
77
|
});
|
|
@@ -103,11 +112,15 @@ const AnchorNoRef = ({
|
|
|
103
112
|
paddingInline: paddingInline,
|
|
104
113
|
paddingInlineStart: paddingInlineStart,
|
|
105
114
|
paddingInlineEnd: paddingInlineEnd,
|
|
106
|
-
onClick: onClick
|
|
115
|
+
onClick: onClick,
|
|
116
|
+
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? `${ariaLabel} ${OPENS_NEW_WINDOW_LABEL}` : ariaLabel,
|
|
117
|
+
"aria-labelledby": ariaLabelledBy && target === '_blank' ? `${ariaLabelledBy} ${opensNewWindowLabelId}` : ariaLabelledBy
|
|
107
118
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
108
119
|
,
|
|
109
120
|
xcss: styles
|
|
110
|
-
}), children, target === '_blank' && /*#__PURE__*/React.createElement(VisuallyHidden,
|
|
121
|
+
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
122
|
+
id: opensNewWindowLabelId
|
|
123
|
+
}, OPENS_NEW_WINDOW_LABEL));
|
|
111
124
|
};
|
|
112
125
|
|
|
113
126
|
// Workarounds to support generic types with forwardRef
|
|
@@ -58,8 +58,26 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
58
58
|
className: resolvedStyles.static
|
|
59
59
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
60
60
|
}, safeHtmlAttributes, {
|
|
61
|
-
css: [baseStyles,
|
|
62
|
-
// eslint-disable-next-line @atlaskit/
|
|
61
|
+
css: [baseStyles,
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
63
|
+
backgroundColor && backgroundColorStylesMap[backgroundColor],
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
65
|
+
isSurfaceColorToken(backgroundColor) && surfaceColorStylesMap[backgroundColor],
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
67
|
+
padding && paddingStylesMap.padding[padding],
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
69
|
+
paddingBlock && paddingStylesMap.paddingBlock[paddingBlock],
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
71
|
+
paddingBlockStart && paddingStylesMap.paddingBlockStart[paddingBlockStart],
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
73
|
+
paddingBlockEnd && paddingStylesMap.paddingBlockEnd[paddingBlockEnd],
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
75
|
+
paddingInline && paddingStylesMap.paddingInline[paddingInline],
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
77
|
+
paddingInlineStart && paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
79
|
+
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
80
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
63
81
|
resolvedStyles.emotion],
|
|
64
82
|
"data-testid": testId
|
|
65
83
|
}), children);
|
|
@@ -104,7 +104,13 @@ const Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
104
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
105
105
|
,
|
|
106
106
|
className: resolvedStyles.static,
|
|
107
|
-
css: [baseStyles,
|
|
107
|
+
css: [baseStyles,
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
109
|
+
gap && spaceStylesMap.gap[gap],
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
111
|
+
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
113
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
108
114
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
109
115
|
resolvedStyles.emotion],
|
|
110
116
|
"data-testid": testId,
|
|
@@ -168,7 +168,13 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
168
168
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
169
169
|
,
|
|
170
170
|
className: resolvedStyles.static,
|
|
171
|
-
css: [baseStyles,
|
|
171
|
+
css: [baseStyles,
|
|
172
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
173
|
+
gap && spaceStylesMap.gap[gap],
|
|
174
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
175
|
+
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
176
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
177
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
172
178
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
173
179
|
resolvedStyles.emotion],
|
|
174
180
|
"data-testid": testId,
|
|
@@ -64,7 +64,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
action: 'clicked',
|
|
65
65
|
componentName: componentName || 'Pressable',
|
|
66
66
|
packageName: "@atlaskit/primitives",
|
|
67
|
-
packageVersion: "7.0
|
|
67
|
+
packageVersion: "7.1.0",
|
|
68
68
|
analyticsData: analyticsContext,
|
|
69
69
|
actionSubject: 'button'
|
|
70
70
|
});
|
|
@@ -30,6 +30,7 @@ export const UNSAFE_buildAboveMediaQueryCSS = input => {
|
|
|
30
30
|
return UNSAFE_BREAKPOINTS_ORDERED_LIST.reduce((acc, breakpoint) => ({
|
|
31
31
|
...acc,
|
|
32
32
|
[breakpoint]: css({
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
33
34
|
[media.above[breakpoint]]: typeof input === 'function' ? input(breakpoint) : input
|
|
34
35
|
})
|
|
35
36
|
}), {});
|
|
@@ -67,7 +68,7 @@ export const UNSAFE_buildBelowMediaQueryCSS = input => {
|
|
|
67
68
|
return {
|
|
68
69
|
...acc,
|
|
69
70
|
[breakpoint]: css({
|
|
70
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
71
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
71
72
|
[UNSAFE_media.below[breakpoint]]: typeof input === 'function' ? input(breakpoint) : input
|
|
72
73
|
})
|
|
73
74
|
};
|
|
@@ -531,6 +531,7 @@ const spacingProperties = [
|
|
|
531
531
|
const getSerializedStylesMap = (cssProperty, tokenMap) => {
|
|
532
532
|
return Object.keys(tokenMap).reduce((emotionSpacingMap, token) => {
|
|
533
533
|
emotionSpacingMap[token] = css({
|
|
534
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
534
535
|
[cssProperty]: tokenMap[token]
|
|
535
536
|
});
|
|
536
537
|
return emotionSpacingMap;
|
package/dist/es2019/xcss/xcss.js
CHANGED
|
@@ -136,6 +136,7 @@ const transformStyles = styleObj => {
|
|
|
136
136
|
const baseXcss = style => {
|
|
137
137
|
const transformedStyles = transformStyles(style);
|
|
138
138
|
return {
|
|
139
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
139
140
|
[uniqueSymbol]: cssEmotion(transformedStyles)
|
|
140
141
|
};
|
|
141
142
|
};
|
|
@@ -2,8 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext"];
|
|
5
|
+
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby"];
|
|
6
6
|
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
7
|
+
import { uid } from 'react-uid';
|
|
7
8
|
import invariant from 'tiny-invariant';
|
|
8
9
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
9
10
|
import { useRouterLink } from '@atlaskit/app-provider';
|
|
@@ -36,6 +37,7 @@ var focusRingStyles = xcss({
|
|
|
36
37
|
});
|
|
37
38
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
38
39
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
40
|
+
var OPENS_NEW_WINDOW_LABEL = '(opens new window)';
|
|
39
41
|
var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
40
42
|
var href = _ref.href,
|
|
41
43
|
children = _ref.children,
|
|
@@ -55,18 +57,25 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
55
57
|
interactionName = _ref.interactionName,
|
|
56
58
|
componentName = _ref.componentName,
|
|
57
59
|
analyticsContext = _ref.analyticsContext,
|
|
60
|
+
ariaLabel = _ref['aria-label'],
|
|
61
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
58
62
|
htmlAttributes = _objectWithoutProperties(_ref, _excluded);
|
|
59
63
|
var interactionContext = useContext(InteractionContext);
|
|
60
64
|
var handleClick = useCallback(function (e, analyticsEvent) {
|
|
61
65
|
interactionContext && interactionContext.tracePress(interactionName, e.timeStamp);
|
|
62
66
|
providedOnClick(e, analyticsEvent);
|
|
63
67
|
}, [providedOnClick, interactionContext, interactionName]);
|
|
68
|
+
// TODO: Use React 18's useId() hook when we update.
|
|
69
|
+
// eslint-disable-next-line @repo/internal/react/disallow-unstable-values
|
|
70
|
+
var opensNewWindowLabelId = uid({
|
|
71
|
+
ariaLabelledBy: ariaLabelledBy
|
|
72
|
+
});
|
|
64
73
|
var onClick = usePlatformLeafEventHandler({
|
|
65
74
|
fn: handleClick,
|
|
66
75
|
action: 'clicked',
|
|
67
76
|
componentName: componentName || 'Anchor',
|
|
68
77
|
packageName: "@atlaskit/primitives",
|
|
69
|
-
packageVersion: "7.0
|
|
78
|
+
packageVersion: "7.1.0",
|
|
70
79
|
analyticsData: analyticsContext,
|
|
71
80
|
actionSubject: 'link'
|
|
72
81
|
});
|
|
@@ -107,11 +116,15 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
107
116
|
paddingInline: paddingInline,
|
|
108
117
|
paddingInlineStart: paddingInlineStart,
|
|
109
118
|
paddingInlineEnd: paddingInlineEnd,
|
|
110
|
-
onClick: onClick
|
|
119
|
+
onClick: onClick,
|
|
120
|
+
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(OPENS_NEW_WINDOW_LABEL) : ariaLabel,
|
|
121
|
+
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy
|
|
111
122
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
112
123
|
,
|
|
113
124
|
xcss: styles
|
|
114
|
-
}), children, target === '_blank' && /*#__PURE__*/React.createElement(VisuallyHidden,
|
|
125
|
+
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
126
|
+
id: opensNewWindowLabelId
|
|
127
|
+
}, OPENS_NEW_WINDOW_LABEL));
|
|
115
128
|
};
|
|
116
129
|
|
|
117
130
|
// Workarounds to support generic types with forwardRef
|
|
@@ -59,8 +59,26 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
59
59
|
className: resolvedStyles.static
|
|
60
60
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
61
61
|
}, safeHtmlAttributes, {
|
|
62
|
-
css: [baseStyles,
|
|
63
|
-
// eslint-disable-next-line @atlaskit/
|
|
62
|
+
css: [baseStyles,
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
64
|
+
backgroundColor && backgroundColorStylesMap[backgroundColor],
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
66
|
+
isSurfaceColorToken(backgroundColor) && surfaceColorStylesMap[backgroundColor],
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
68
|
+
padding && paddingStylesMap.padding[padding],
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
|
+
paddingBlock && paddingStylesMap.paddingBlock[paddingBlock],
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
72
|
+
paddingBlockStart && paddingStylesMap.paddingBlockStart[paddingBlockStart],
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
74
|
+
paddingBlockEnd && paddingStylesMap.paddingBlockEnd[paddingBlockEnd],
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
76
|
+
paddingInline && paddingStylesMap.paddingInline[paddingInline],
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
78
|
+
paddingInlineStart && paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
80
|
+
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
81
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
64
82
|
resolvedStyles.emotion],
|
|
65
83
|
"data-testid": testId
|
|
66
84
|
}), children);
|
|
@@ -104,7 +104,13 @@ var Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
105
105
|
,
|
|
106
106
|
className: resolvedStyles.static,
|
|
107
|
-
css: [baseStyles,
|
|
107
|
+
css: [baseStyles,
|
|
108
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
109
|
+
gap && spaceStylesMap.gap[gap],
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
111
|
+
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
113
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
108
114
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
109
115
|
resolvedStyles.emotion],
|
|
110
116
|
"data-testid": testId,
|
|
@@ -169,7 +169,13 @@ var Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
169
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
170
170
|
,
|
|
171
171
|
className: resolvedStyles.static,
|
|
172
|
-
css: [baseStyles,
|
|
172
|
+
css: [baseStyles,
|
|
173
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
174
|
+
gap && spaceStylesMap.gap[gap],
|
|
175
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
176
|
+
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
177
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
178
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
173
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
174
180
|
resolvedStyles.emotion],
|
|
175
181
|
"data-testid": testId,
|
|
@@ -68,7 +68,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
68
68
|
action: 'clicked',
|
|
69
69
|
componentName: componentName || 'Pressable',
|
|
70
70
|
packageName: "@atlaskit/primitives",
|
|
71
|
-
packageVersion: "7.0
|
|
71
|
+
packageVersion: "7.1.0",
|
|
72
72
|
analyticsData: analyticsContext,
|
|
73
73
|
actionSubject: 'button'
|
|
74
74
|
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import React, { type
|
|
1
|
+
import React, { type Ref } from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type RouterLinkComponentProps } from '@atlaskit/app-provider';
|
|
4
4
|
import { type BoxProps } from './box';
|
|
5
|
-
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | '
|
|
6
|
-
/**
|
|
7
|
-
* `children` should be defined to ensure links have text.
|
|
8
|
-
*/
|
|
9
|
-
children: ReactNode;
|
|
5
|
+
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | 'style' | 'onClick'> & {
|
|
10
6
|
/**
|
|
11
7
|
* Handler called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details.
|
|
12
8
|
*/
|
|
@@ -26,7 +22,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
|
|
|
26
22
|
*/
|
|
27
23
|
analyticsContext?: Record<string, any>;
|
|
28
24
|
};
|
|
29
|
-
declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
25
|
+
declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
30
26
|
/**
|
|
31
27
|
* __Anchor__
|
|
32
28
|
*
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type BoxProps } from './box';
|
|
4
|
-
export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | '
|
|
5
|
-
/**
|
|
6
|
-
* `children` should be defined to ensure buttons are not empty,
|
|
7
|
-
* because they should have labels.
|
|
8
|
-
*/
|
|
9
|
-
children: ReactNode;
|
|
4
|
+
export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'style' | 'onClick'> & {
|
|
10
5
|
isDisabled?: boolean;
|
|
11
6
|
/**
|
|
12
7
|
* Handler called on click. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the ['analytics-next' package](https://atlaskit.atlassian.com/packages/analytics/analytics-next) documentation for more information.
|
|
@@ -34,12 +29,7 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
34
29
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
35
30
|
* - [Usage](https://atlassian.design/components/primitives/pressable/usage)
|
|
36
31
|
*/
|
|
37
|
-
declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"button">, "style" | "disabled" | "
|
|
38
|
-
/**
|
|
39
|
-
* `children` should be defined to ensure buttons are not empty,
|
|
40
|
-
* because they should have labels.
|
|
41
|
-
*/
|
|
42
|
-
children: ReactNode;
|
|
32
|
+
declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"button">, "style" | "disabled" | "as" | "onClick"> & {
|
|
43
33
|
isDisabled?: boolean | undefined;
|
|
44
34
|
/**
|
|
45
35
|
* Handler called on click. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the ['analytics-next' package](https://atlaskit.atlassian.com/packages/analytics/analytics-next) documentation for more information.
|
|
@@ -552,7 +552,7 @@ type MarginSpace = AllSpace | 'auto';
|
|
|
552
552
|
type AutoComplete<T extends string> = T | Omit<string, T>;
|
|
553
553
|
export type TokenisedProps = {
|
|
554
554
|
backgroundColor?: BackgroundColor;
|
|
555
|
-
blockSize?:
|
|
555
|
+
blockSize?: Dimension | string;
|
|
556
556
|
borderBlockColor?: AutoComplete<BorderColor>;
|
|
557
557
|
borderBlockEndColor?: AutoComplete<BorderColor>;
|
|
558
558
|
borderBlockEndWidth?: BorderWidth | string;
|
|
@@ -589,8 +589,8 @@ export type TokenisedProps = {
|
|
|
589
589
|
color?: TextColor;
|
|
590
590
|
columnGap?: Space;
|
|
591
591
|
gap?: Space;
|
|
592
|
-
height?:
|
|
593
|
-
inlineSize?:
|
|
592
|
+
height?: Dimension | string;
|
|
593
|
+
inlineSize?: Dimension | string;
|
|
594
594
|
inset?: AutoComplete<AllSpace>;
|
|
595
595
|
insetBlock?: AutoComplete<AllSpace>;
|
|
596
596
|
insetBlockEnd?: AutoComplete<AllSpace>;
|
|
@@ -610,14 +610,14 @@ export type TokenisedProps = {
|
|
|
610
610
|
marginLeft?: AutoComplete<MarginSpace>;
|
|
611
611
|
marginRight?: AutoComplete<MarginSpace>;
|
|
612
612
|
marginTop?: AutoComplete<MarginSpace>;
|
|
613
|
-
maxBlockSize?:
|
|
614
|
-
maxHeight?:
|
|
615
|
-
maxInlineSize?:
|
|
616
|
-
maxWidth?:
|
|
617
|
-
minBlockSize?:
|
|
618
|
-
minHeight?:
|
|
619
|
-
minInlineSize?:
|
|
620
|
-
minWidth?:
|
|
613
|
+
maxBlockSize?: Dimension | string;
|
|
614
|
+
maxHeight?: Dimension | string;
|
|
615
|
+
maxInlineSize?: Dimension | string;
|
|
616
|
+
maxWidth?: Dimension | string;
|
|
617
|
+
minBlockSize?: Dimension | string;
|
|
618
|
+
minHeight?: Dimension | string;
|
|
619
|
+
minInlineSize?: Dimension | string;
|
|
620
|
+
minWidth?: Dimension | string;
|
|
621
621
|
opacity?: AutoComplete<Opacity> | number;
|
|
622
622
|
outlineColor?: BorderColor;
|
|
623
623
|
outlineOffset?: Space;
|
|
@@ -636,7 +636,7 @@ export type TokenisedProps = {
|
|
|
636
636
|
right?: AutoComplete<AllSpace>;
|
|
637
637
|
rowGap?: Space;
|
|
638
638
|
top?: AutoComplete<AllSpace>;
|
|
639
|
-
width?:
|
|
639
|
+
width?: Dimension | string;
|
|
640
640
|
zIndex?: Layer;
|
|
641
641
|
};
|
|
642
642
|
declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "gap", "rowGap", "columnGap"];
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import React, { type
|
|
1
|
+
import React, { type Ref } from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type RouterLinkComponentProps } from '@atlaskit/app-provider';
|
|
4
4
|
import { type BoxProps } from './box';
|
|
5
|
-
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | '
|
|
6
|
-
/**
|
|
7
|
-
* `children` should be defined to ensure links have text.
|
|
8
|
-
*/
|
|
9
|
-
children: ReactNode;
|
|
5
|
+
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | 'style' | 'onClick'> & {
|
|
10
6
|
/**
|
|
11
7
|
* Handler called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details.
|
|
12
8
|
*/
|
|
@@ -26,7 +22,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
|
|
|
26
22
|
*/
|
|
27
23
|
analyticsContext?: Record<string, any>;
|
|
28
24
|
};
|
|
29
|
-
declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
25
|
+
declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
30
26
|
/**
|
|
31
27
|
* __Anchor__
|
|
32
28
|
*
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type BoxProps } from './box';
|
|
4
|
-
export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | '
|
|
5
|
-
/**
|
|
6
|
-
* `children` should be defined to ensure buttons are not empty,
|
|
7
|
-
* because they should have labels.
|
|
8
|
-
*/
|
|
9
|
-
children: ReactNode;
|
|
4
|
+
export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'style' | 'onClick'> & {
|
|
10
5
|
isDisabled?: boolean;
|
|
11
6
|
/**
|
|
12
7
|
* Handler called on click. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the ['analytics-next' package](https://atlaskit.atlassian.com/packages/analytics/analytics-next) documentation for more information.
|
|
@@ -34,12 +29,7 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
34
29
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
35
30
|
* - [Usage](https://atlassian.design/components/primitives/pressable/usage)
|
|
36
31
|
*/
|
|
37
|
-
declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"button">, "style" | "disabled" | "
|
|
38
|
-
/**
|
|
39
|
-
* `children` should be defined to ensure buttons are not empty,
|
|
40
|
-
* because they should have labels.
|
|
41
|
-
*/
|
|
42
|
-
children: ReactNode;
|
|
32
|
+
declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"button">, "style" | "disabled" | "as" | "onClick"> & {
|
|
43
33
|
isDisabled?: boolean | undefined;
|
|
44
34
|
/**
|
|
45
35
|
* Handler called on click. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the ['analytics-next' package](https://atlaskit.atlassian.com/packages/analytics/analytics-next) documentation for more information.
|
|
@@ -552,7 +552,7 @@ type MarginSpace = AllSpace | 'auto';
|
|
|
552
552
|
type AutoComplete<T extends string> = T | Omit<string, T>;
|
|
553
553
|
export type TokenisedProps = {
|
|
554
554
|
backgroundColor?: BackgroundColor;
|
|
555
|
-
blockSize?:
|
|
555
|
+
blockSize?: Dimension | string;
|
|
556
556
|
borderBlockColor?: AutoComplete<BorderColor>;
|
|
557
557
|
borderBlockEndColor?: AutoComplete<BorderColor>;
|
|
558
558
|
borderBlockEndWidth?: BorderWidth | string;
|
|
@@ -589,8 +589,8 @@ export type TokenisedProps = {
|
|
|
589
589
|
color?: TextColor;
|
|
590
590
|
columnGap?: Space;
|
|
591
591
|
gap?: Space;
|
|
592
|
-
height?:
|
|
593
|
-
inlineSize?:
|
|
592
|
+
height?: Dimension | string;
|
|
593
|
+
inlineSize?: Dimension | string;
|
|
594
594
|
inset?: AutoComplete<AllSpace>;
|
|
595
595
|
insetBlock?: AutoComplete<AllSpace>;
|
|
596
596
|
insetBlockEnd?: AutoComplete<AllSpace>;
|
|
@@ -610,14 +610,14 @@ export type TokenisedProps = {
|
|
|
610
610
|
marginLeft?: AutoComplete<MarginSpace>;
|
|
611
611
|
marginRight?: AutoComplete<MarginSpace>;
|
|
612
612
|
marginTop?: AutoComplete<MarginSpace>;
|
|
613
|
-
maxBlockSize?:
|
|
614
|
-
maxHeight?:
|
|
615
|
-
maxInlineSize?:
|
|
616
|
-
maxWidth?:
|
|
617
|
-
minBlockSize?:
|
|
618
|
-
minHeight?:
|
|
619
|
-
minInlineSize?:
|
|
620
|
-
minWidth?:
|
|
613
|
+
maxBlockSize?: Dimension | string;
|
|
614
|
+
maxHeight?: Dimension | string;
|
|
615
|
+
maxInlineSize?: Dimension | string;
|
|
616
|
+
maxWidth?: Dimension | string;
|
|
617
|
+
minBlockSize?: Dimension | string;
|
|
618
|
+
minHeight?: Dimension | string;
|
|
619
|
+
minInlineSize?: Dimension | string;
|
|
620
|
+
minWidth?: Dimension | string;
|
|
621
621
|
opacity?: AutoComplete<Opacity> | number;
|
|
622
622
|
outlineColor?: BorderColor;
|
|
623
623
|
outlineOffset?: Space;
|
|
@@ -636,7 +636,7 @@ export type TokenisedProps = {
|
|
|
636
636
|
right?: AutoComplete<AllSpace>;
|
|
637
637
|
rowGap?: Space;
|
|
638
638
|
top?: AutoComplete<AllSpace>;
|
|
639
|
-
width?:
|
|
639
|
+
width?: Dimension | string;
|
|
640
640
|
zIndex?: Layer;
|
|
641
641
|
};
|
|
642
642
|
declare const spacingProperties: readonly [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"@emotion/react": "^11.7.1",
|
|
135
135
|
"@emotion/serialize": "^1.1.0",
|
|
136
136
|
"bind-event-listener": "^3.0.0",
|
|
137
|
+
"react-uid": "^2.2.0",
|
|
137
138
|
"tiny-invariant": "^1.2.0"
|
|
138
139
|
},
|
|
139
140
|
"peerDependencies": {
|