@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/codemods/hypermod.config.tsx +5 -1
  3. package/constellation/anchor/usage.mdx +40 -38
  4. package/constellation/pressable/usage.mdx +23 -22
  5. package/dist/cjs/compiled/components/anchor.js +2 -4
  6. package/dist/cjs/compiled/components/box.js +1 -3
  7. package/dist/cjs/compiled/components/focusable.js +1 -3
  8. package/dist/cjs/compiled/components/pressable.js +2 -4
  9. package/dist/cjs/components/anchor.js +3 -5
  10. package/dist/cjs/components/bleed.js +1 -1
  11. package/dist/cjs/components/box.js +1 -3
  12. package/dist/cjs/components/pressable.js +1 -2
  13. package/dist/cjs/responsive/hide.js +1 -1
  14. package/dist/cjs/xcss/style-maps.partial.js +293 -292
  15. package/dist/es2019/compiled/components/anchor.js +2 -4
  16. package/dist/es2019/compiled/components/box.js +1 -3
  17. package/dist/es2019/compiled/components/focusable.js +1 -3
  18. package/dist/es2019/compiled/components/pressable.js +2 -4
  19. package/dist/es2019/components/anchor.js +3 -5
  20. package/dist/es2019/components/bleed.js +1 -1
  21. package/dist/es2019/components/box.js +1 -3
  22. package/dist/es2019/components/pressable.js +1 -2
  23. package/dist/es2019/responsive/hide.js +1 -1
  24. package/dist/es2019/xcss/style-maps.partial.js +293 -292
  25. package/dist/esm/compiled/components/anchor.js +2 -4
  26. package/dist/esm/compiled/components/box.js +1 -3
  27. package/dist/esm/compiled/components/focusable.js +1 -3
  28. package/dist/esm/compiled/components/pressable.js +2 -4
  29. package/dist/esm/components/anchor.js +3 -5
  30. package/dist/esm/components/bleed.js +1 -1
  31. package/dist/esm/components/box.js +1 -3
  32. package/dist/esm/components/pressable.js +1 -2
  33. package/dist/esm/responsive/hide.js +1 -1
  34. package/dist/esm/xcss/style-maps.partial.js +293 -292
  35. package/dist/types/compiled/components/flex.d.ts +2 -2
  36. package/dist/types/compiled/components/grid.d.ts +2 -2
  37. package/dist/types/compiled/components/inline.d.ts +2 -2
  38. package/dist/types/compiled/components/stack.d.ts +2 -2
  39. package/dist/types/compiled/index.d.ts +1 -1
  40. package/dist/types/components/flex.d.ts +19 -18
  41. package/dist/types/components/grid.d.ts +30 -29
  42. package/dist/types/components/inline.d.ts +1 -1
  43. package/dist/types/components/stack.d.ts +2 -2
  44. package/dist/types/components/text.d.ts +4 -3
  45. package/dist/types/responsive/build-media-query-css.d.ts +3 -3
  46. package/dist/types/responsive/media-helper.d.ts +17 -17
  47. package/dist/types/utils/has-text-ancestor-context.d.ts +2 -1
  48. package/dist/types/utils/surface-provider.d.ts +2 -1
  49. package/dist/types/xcss/style-maps.partial.d.ts +11 -11
  50. package/dist/types-ts4.5/compiled/components/flex.d.ts +2 -2
  51. package/dist/types-ts4.5/compiled/components/grid.d.ts +2 -2
  52. package/dist/types-ts4.5/compiled/components/inline.d.ts +2 -2
  53. package/dist/types-ts4.5/compiled/components/stack.d.ts +2 -2
  54. package/dist/types-ts4.5/compiled/index.d.ts +1 -1
  55. package/dist/types-ts4.5/components/flex.d.ts +19 -18
  56. package/dist/types-ts4.5/components/grid.d.ts +30 -29
  57. package/dist/types-ts4.5/components/inline.d.ts +1 -1
  58. package/dist/types-ts4.5/components/stack.d.ts +2 -2
  59. package/dist/types-ts4.5/components/text.d.ts +4 -3
  60. package/dist/types-ts4.5/responsive/build-media-query-css.d.ts +3 -3
  61. package/dist/types-ts4.5/responsive/media-helper.d.ts +17 -17
  62. package/dist/types-ts4.5/utils/has-text-ancestor-context.d.ts +2 -1
  63. package/dist/types-ts4.5/utils/surface-provider.d.ts +2 -1
  64. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +11 -11
  65. package/package.json +8 -8
  66. package/scripts/codegen-styles.tsx +6 -9
  67. package/scripts/color-codegen-template.tsx +8 -9
  68. package/scripts/elevation-codegen-template.tsx +8 -9
  69. package/scripts/inverse-color-map-template.tsx +1 -1
  70. package/scripts/misc-codegen-template.tsx +3 -1
  71. package/scripts/shape-codegen-template.tsx +3 -1
  72. package/scripts/spacing-codegen-template.tsx +1 -1
  73. package/scripts/text-codegen-template.tsx +2 -2
  74. package/scripts/typography-codegen-template.tsx +7 -4
  75. 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: "17.1.0",
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: "17.1.0",
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 -- Ignored via go/DSP-18766
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: "17.1.0",
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 -- Ignored via go/DSP-18766
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: "17.1.0",
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 -- Ignored via go/DSP-18766
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';