@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
|
@@ -56,7 +56,7 @@ const AnchorNoRef = ({
|
|
|
56
56
|
action: 'clicked',
|
|
57
57
|
componentName: componentName || 'Anchor',
|
|
58
58
|
packageName: "@atlaskit/primitives",
|
|
59
|
-
packageVersion: "
|
|
59
|
+
packageVersion: "0.0.0-development",
|
|
60
60
|
analyticsData: analyticsContext,
|
|
61
61
|
actionSubject: 'link'
|
|
62
62
|
});
|
|
@@ -86,9 +86,7 @@ const AnchorNoRef = ({
|
|
|
86
86
|
// @ts-expect-error we don't allow `a` on Focusable for makers as they should use Anchor instead
|
|
87
87
|
, _extends({
|
|
88
88
|
as: Component,
|
|
89
|
-
className: xcss
|
|
90
|
-
// 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
|
|
91
|
-
,
|
|
89
|
+
className: xcss,
|
|
92
90
|
style: style,
|
|
93
91
|
ref: ref
|
|
94
92
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -321,9 +321,7 @@ const Box = /*#__PURE__*/forwardRef(({
|
|
|
321
321
|
className: _spreadClass,
|
|
322
322
|
...safeHtmlAttributes
|
|
323
323
|
} = htmlAttributes;
|
|
324
|
-
const node = /*#__PURE__*/React.createElement(Component
|
|
325
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
326
|
-
, _extends({
|
|
324
|
+
const node = /*#__PURE__*/React.createElement(Component, _extends({
|
|
327
325
|
style: style
|
|
328
326
|
// @ts-ignore -- Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
329
327
|
,
|
|
@@ -30,9 +30,7 @@ const Focusable = /*#__PURE__*/forwardRef(({
|
|
|
30
30
|
return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
|
|
31
31
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
32
32
|
ref: ref,
|
|
33
|
-
className: ax(["_ymio1r31 _ypr0glyw _zcxs1o36 _mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss])
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
35
|
-
,
|
|
33
|
+
className: ax(["_ymio1r31 _ypr0glyw _zcxs1o36 _mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss]),
|
|
36
34
|
style: style,
|
|
37
35
|
"data-testid": testId
|
|
38
36
|
}), children);
|
|
@@ -48,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
48
48
|
action: 'clicked',
|
|
49
49
|
componentName: componentName || 'Pressable',
|
|
50
50
|
packageName: "@atlaskit/primitives",
|
|
51
|
-
packageVersion: "
|
|
51
|
+
packageVersion: "0.0.0-development",
|
|
52
52
|
analyticsData: analyticsContext,
|
|
53
53
|
actionSubject: 'button'
|
|
54
54
|
});
|
|
@@ -67,9 +67,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
67
67
|
// Adding a tabIndex of 0 to the button will allow it to be focused on click.
|
|
68
68
|
// This is a known issue in Safari that is meant to be "intended", see https://bugs.webkit.org/show_bug.cgi?id=22261
|
|
69
69
|
,
|
|
70
|
-
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined
|
|
71
|
-
// 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
|
|
72
|
-
,
|
|
70
|
+
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined,
|
|
73
71
|
style: style
|
|
74
72
|
}, safeHtmlAttributes, {
|
|
75
73
|
type: type,
|
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
*/
|
|
6
6
|
import { forwardRef, useCallback, useContext } 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
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import invariant from 'tiny-invariant';
|
|
11
11
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
@@ -94,7 +94,7 @@ const AnchorNoRef = ({
|
|
|
94
94
|
action: 'clicked',
|
|
95
95
|
componentName: componentName || 'Anchor',
|
|
96
96
|
packageName: "@atlaskit/primitives",
|
|
97
|
-
packageVersion: "
|
|
97
|
+
packageVersion: "0.0.0-development",
|
|
98
98
|
analyticsData: analyticsContext,
|
|
99
99
|
actionSubject: 'link'
|
|
100
100
|
});
|
|
@@ -121,9 +121,7 @@ const AnchorNoRef = ({
|
|
|
121
121
|
const hrefObjectUsedWithoutRouterLink = RouterLink === undefined && typeof href === 'object';
|
|
122
122
|
invariant(!hrefObjectUsedWithoutRouterLink, `@atlaskit/primitives: Anchor primitive cannot pass an object to 'href' unless a router link is configured in the AppProvider`);
|
|
123
123
|
const Component = isRouterLink ? RouterLink : 'a';
|
|
124
|
-
return jsx(Component
|
|
125
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
126
|
-
, _extends({
|
|
124
|
+
return jsx(Component, _extends({
|
|
127
125
|
style: style,
|
|
128
126
|
ref: ref
|
|
129
127
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
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, @atlaskit/ui-styling-standard/use-compiled
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { parseXcss } from '../xcss/xcss';
|
|
10
10
|
const baseStyles = css({
|
|
@@ -51,9 +51,7 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
51
51
|
const resolvedStyles = parseXcss(xcss);
|
|
52
52
|
const node =
|
|
53
53
|
// @ts-expect-error Expression produces a union type that is too complex to represent. I think this is unavoidable
|
|
54
|
-
jsx(Component
|
|
55
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
56
|
-
, _extends({
|
|
54
|
+
jsx(Component, _extends({
|
|
57
55
|
style: style
|
|
58
56
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
59
57
|
,
|
|
@@ -86,7 +86,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
86
86
|
action: 'clicked',
|
|
87
87
|
componentName: componentName || 'Pressable',
|
|
88
88
|
packageName: "@atlaskit/primitives",
|
|
89
|
-
packageVersion: "
|
|
89
|
+
packageVersion: "0.0.0-development",
|
|
90
90
|
analyticsData: analyticsContext,
|
|
91
91
|
actionSubject: 'button'
|
|
92
92
|
});
|
|
@@ -99,7 +99,6 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
99
99
|
} = htmlAttributes;
|
|
100
100
|
const resolvedStyles = parseXcss(xcss);
|
|
101
101
|
return jsx("button", _extends({
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
103
102
|
style: style,
|
|
104
103
|
ref: ref
|
|
105
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { parseXcss } from '../xcss/xcss';
|
|
9
9
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|