@atlaskit/primitives 17.1.1 → 18.0.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 +22 -0
- package/codemods/hypermod.config.tsx +5 -1
- package/constellation/anchor/usage.mdx +40 -38
- package/constellation/pressable/usage.mdx +23 -22
- package/dist/cjs/compiled/components/anchor.js +2 -4
- package/dist/cjs/compiled/components/box.js +1 -3
- package/dist/cjs/compiled/components/focusable.js +1 -3
- package/dist/cjs/compiled/components/pressable.js +2 -4
- package/dist/cjs/components/anchor.js +3 -5
- package/dist/cjs/components/bleed.js +1 -1
- package/dist/cjs/components/box.js +1 -3
- package/dist/cjs/components/pressable.js +1 -2
- package/dist/cjs/responsive/hide.js +1 -1
- package/dist/cjs/xcss/style-maps.partial.js +293 -292
- package/dist/es2019/compiled/components/anchor.js +2 -4
- package/dist/es2019/compiled/components/box.js +1 -3
- package/dist/es2019/compiled/components/focusable.js +1 -3
- package/dist/es2019/compiled/components/pressable.js +2 -4
- package/dist/es2019/components/anchor.js +3 -5
- package/dist/es2019/components/bleed.js +1 -1
- package/dist/es2019/components/box.js +1 -3
- package/dist/es2019/components/pressable.js +1 -2
- package/dist/es2019/responsive/hide.js +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +293 -292
- package/dist/esm/compiled/components/anchor.js +2 -4
- package/dist/esm/compiled/components/box.js +1 -3
- package/dist/esm/compiled/components/focusable.js +1 -3
- package/dist/esm/compiled/components/pressable.js +2 -4
- package/dist/esm/components/anchor.js +3 -5
- package/dist/esm/components/bleed.js +1 -1
- package/dist/esm/components/box.js +1 -3
- package/dist/esm/components/pressable.js +1 -2
- package/dist/esm/responsive/hide.js +1 -1
- package/dist/esm/xcss/style-maps.partial.js +293 -292
- package/dist/types/compiled/components/flex.d.ts +2 -2
- package/dist/types/compiled/components/grid.d.ts +2 -2
- package/dist/types/compiled/components/inline.d.ts +2 -2
- package/dist/types/compiled/components/stack.d.ts +2 -2
- package/dist/types/compiled/index.d.ts +1 -1
- package/dist/types/components/flex.d.ts +19 -18
- package/dist/types/components/grid.d.ts +30 -29
- package/dist/types/components/inline.d.ts +1 -1
- package/dist/types/components/stack.d.ts +2 -2
- package/dist/types/components/text.d.ts +4 -3
- package/dist/types/responsive/build-media-query-css.d.ts +3 -3
- package/dist/types/responsive/media-helper.d.ts +17 -17
- package/dist/types/utils/has-text-ancestor-context.d.ts +2 -1
- package/dist/types/utils/surface-provider.d.ts +2 -1
- package/dist/types/xcss/style-maps.partial.d.ts +11 -11
- package/dist/types-ts4.5/compiled/components/flex.d.ts +2 -2
- package/dist/types-ts4.5/compiled/components/grid.d.ts +2 -2
- package/dist/types-ts4.5/compiled/components/inline.d.ts +2 -2
- package/dist/types-ts4.5/compiled/components/stack.d.ts +2 -2
- package/dist/types-ts4.5/compiled/index.d.ts +1 -1
- package/dist/types-ts4.5/components/flex.d.ts +19 -18
- package/dist/types-ts4.5/components/grid.d.ts +30 -29
- package/dist/types-ts4.5/components/inline.d.ts +1 -1
- package/dist/types-ts4.5/components/stack.d.ts +2 -2
- package/dist/types-ts4.5/components/text.d.ts +4 -3
- package/dist/types-ts4.5/responsive/build-media-query-css.d.ts +3 -3
- package/dist/types-ts4.5/responsive/media-helper.d.ts +17 -17
- package/dist/types-ts4.5/utils/has-text-ancestor-context.d.ts +2 -1
- package/dist/types-ts4.5/utils/surface-provider.d.ts +2 -1
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +11 -11
- package/package.json +8 -8
- package/scripts/codegen-styles.tsx +6 -9
- package/scripts/color-codegen-template.tsx +8 -9
- package/scripts/elevation-codegen-template.tsx +8 -9
- package/scripts/inverse-color-map-template.tsx +1 -1
- package/scripts/misc-codegen-template.tsx +3 -1
- package/scripts/shape-codegen-template.tsx +3 -1
- package/scripts/spacing-codegen-template.tsx +1 -1
- package/scripts/text-codegen-template.tsx +2 -2
- package/scripts/typography-codegen-template.tsx +7 -4
- package/scripts/utils.tsx +17 -10
|
@@ -61,7 +61,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
61
61
|
action: 'clicked',
|
|
62
62
|
componentName: componentName || 'Anchor',
|
|
63
63
|
packageName: "@atlaskit/primitives",
|
|
64
|
-
packageVersion: "
|
|
64
|
+
packageVersion: "0.0.0-development",
|
|
65
65
|
analyticsData: analyticsContext,
|
|
66
66
|
actionSubject: 'link'
|
|
67
67
|
});
|
|
@@ -89,9 +89,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
89
89
|
// @ts-expect-error we don't allow `a` on Focusable for makers as they should use Anchor instead
|
|
90
90
|
, _extends({
|
|
91
91
|
as: Component,
|
|
92
|
-
className: xcss
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
94
|
-
,
|
|
92
|
+
className: xcss,
|
|
95
93
|
style: style,
|
|
96
94
|
ref: ref
|
|
97
95
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -328,9 +328,7 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
328
328
|
// @ts-ignore -- not using expect since it causes issues with help-center local consumption - className doesn't exist in the prop definition but we want to ensure it cannot be applied even if types are bypassed
|
|
329
329
|
var _spreadClass = htmlAttributes.className,
|
|
330
330
|
safeHtmlAttributes = _objectWithoutProperties(htmlAttributes, _excluded2);
|
|
331
|
-
var node = /*#__PURE__*/React.createElement(Component
|
|
332
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
333
|
-
, _extends({
|
|
331
|
+
var node = /*#__PURE__*/React.createElement(Component, _extends({
|
|
334
332
|
style: style
|
|
335
333
|
// @ts-ignore -- Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
336
334
|
,
|
|
@@ -31,9 +31,7 @@ var Focusable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
31
31
|
return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
|
|
32
32
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
33
33
|
ref: ref,
|
|
34
|
-
className: ax(["_ymio1r31 _ypr0glyw _zcxs1o36 _mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss])
|
|
35
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
36
|
-
,
|
|
34
|
+
className: ax(["_ymio1r31 _ypr0glyw _zcxs1o36 _mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss]),
|
|
37
35
|
style: style,
|
|
38
36
|
"data-testid": testId
|
|
39
37
|
}), children);
|
|
@@ -52,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
52
52
|
action: 'clicked',
|
|
53
53
|
componentName: componentName || 'Pressable',
|
|
54
54
|
packageName: "@atlaskit/primitives",
|
|
55
|
-
packageVersion: "
|
|
55
|
+
packageVersion: "0.0.0-development",
|
|
56
56
|
analyticsData: analyticsContext,
|
|
57
57
|
actionSubject: 'button'
|
|
58
58
|
});
|
|
@@ -69,9 +69,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
69
69
|
// Adding a tabIndex of 0 to the button will allow it to be focused on click.
|
|
70
70
|
// This is a known issue in Safari that is meant to be "intended", see https://bugs.webkit.org/show_bug.cgi?id=22261
|
|
71
71
|
,
|
|
72
|
-
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined
|
|
73
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
74
|
-
,
|
|
72
|
+
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined,
|
|
75
73
|
style: style
|
|
76
74
|
}, safeHtmlAttributes, {
|
|
77
75
|
type: type,
|
|
@@ -10,7 +10,7 @@ var _excluded = ["href", "children", "backgroundColor", "newWindowLabel", "paddi
|
|
|
10
10
|
*/
|
|
11
11
|
import { forwardRef, useCallback, useContext } from 'react';
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
15
|
import invariant from 'tiny-invariant';
|
|
16
16
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
@@ -99,7 +99,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
99
99
|
action: 'clicked',
|
|
100
100
|
componentName: componentName || 'Anchor',
|
|
101
101
|
packageName: "@atlaskit/primitives",
|
|
102
|
-
packageVersion: "
|
|
102
|
+
packageVersion: "0.0.0-development",
|
|
103
103
|
analyticsData: analyticsContext,
|
|
104
104
|
actionSubject: 'link'
|
|
105
105
|
});
|
|
@@ -124,9 +124,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
124
124
|
var hrefObjectUsedWithoutRouterLink = RouterLink === undefined && _typeof(href) === 'object';
|
|
125
125
|
invariant(!hrefObjectUsedWithoutRouterLink, "@atlaskit/primitives: Anchor primitive cannot pass an object to 'href' unless a router link is configured in the AppProvider");
|
|
126
126
|
var Component = isRouterLink ? RouterLink : 'a';
|
|
127
|
-
return jsx(Component
|
|
128
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
129
|
-
, _extends({
|
|
127
|
+
return jsx(Component, _extends({
|
|
130
128
|
style: style,
|
|
131
129
|
ref: ref
|
|
132
130
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -5,7 +5,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { parseXcss } from '../xcss/xcss';
|
|
11
11
|
var baseStyles = css({
|
|
@@ -52,9 +52,7 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
52
52
|
var resolvedStyles = parseXcss(xcss);
|
|
53
53
|
var node =
|
|
54
54
|
// @ts-expect-error Expression produces a union type that is too complex to represent. I think this is unavoidable
|
|
55
|
-
jsx(Component
|
|
56
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
|
-
, _extends({
|
|
55
|
+
jsx(Component, _extends({
|
|
58
56
|
style: style
|
|
59
57
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
60
58
|
,
|
|
@@ -91,7 +91,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
91
91
|
action: 'clicked',
|
|
92
92
|
componentName: componentName || 'Pressable',
|
|
93
93
|
packageName: "@atlaskit/primitives",
|
|
94
|
-
packageVersion: "
|
|
94
|
+
packageVersion: "0.0.0-development",
|
|
95
95
|
analyticsData: analyticsContext,
|
|
96
96
|
actionSubject: 'button'
|
|
97
97
|
});
|
|
@@ -102,7 +102,6 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
102
102
|
safeHtmlAttributes = _objectWithoutProperties(htmlAttributes, _excluded2);
|
|
103
103
|
var resolvedStyles = parseXcss(xcss);
|
|
104
104
|
return jsx("button", _extends({
|
|
105
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
106
105
|
style: style,
|
|
107
106
|
ref: ref
|
|
108
107
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -4,7 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { parseXcss } from '../xcss/xcss';
|
|
10
10
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|