@atlaskit/menu 7.0.0 → 8.0.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/menu-item/skeleton-heading-item.compiled.css +16 -0
  3. package/dist/cjs/menu-item/skeleton-heading-item.js +39 -57
  4. package/dist/cjs/menu-item/skeleton-item.compiled.css +38 -0
  5. package/dist/cjs/menu-item/skeleton-item.js +46 -121
  6. package/dist/es2019/menu-item/skeleton-heading-item.compiled.css +16 -0
  7. package/dist/es2019/menu-item/skeleton-heading-item.js +26 -50
  8. package/dist/es2019/menu-item/skeleton-item.compiled.css +38 -0
  9. package/dist/es2019/menu-item/skeleton-item.js +33 -117
  10. package/dist/esm/menu-item/skeleton-heading-item.compiled.css +16 -0
  11. package/dist/esm/menu-item/skeleton-heading-item.js +36 -56
  12. package/dist/esm/menu-item/skeleton-item.compiled.css +38 -0
  13. package/dist/esm/menu-item/skeleton-item.js +43 -122
  14. package/dist/types/index.d.ts +1 -1
  15. package/dist/types/menu-item/skeleton-heading-item.d.ts +2 -2
  16. package/dist/types/menu-item/skeleton-item.d.ts +2 -2
  17. package/dist/types/types.d.ts +10 -28
  18. package/dist/types-ts4.5/index.d.ts +1 -1
  19. package/dist/types-ts4.5/menu-item/skeleton-heading-item.d.ts +2 -2
  20. package/dist/types-ts4.5/menu-item/skeleton-item.d.ts +2 -2
  21. package/dist/types-ts4.5/types.d.ts +10 -28
  22. package/package.json +8 -9
  23. package/dist/cjs/internal/components/skeleton-shimmer.js +0 -73
  24. package/dist/es2019/internal/components/skeleton-shimmer.js +0 -65
  25. package/dist/esm/internal/components/skeleton-shimmer.js +0 -66
  26. package/dist/types/internal/components/skeleton-shimmer.d.ts +0 -27
  27. package/dist/types-ts4.5/internal/components/skeleton-shimmer.d.ts +0 -27
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type PropsWithChildren, type Ref } from 'react';
2
- import { type CSSObject } from '@emotion/react';
2
+ import { StrictXCSSProp } from '@atlaskit/css';
3
3
  import type { SpacingMode } from './internal/components/menu-context';
4
4
  export interface RenderFunction<TProps = {}> {
5
5
  (Component: ComponentType | string, props: TProps): React.ReactNode;
@@ -318,10 +318,14 @@ export interface SkeletonItemProps {
318
318
  */
319
319
  isShimmering?: boolean;
320
320
  /**
321
- * A function that overrides the styles of this component.
322
- * It receives the current styles and returns a customized styles object.
321
+ * When `true`, the size/spacing of the skeleton size/spacing is adjusted to match the side navigation menu item.
322
+ * @deprecated This API exists to support functionality in `@atlaskit/side-navigation` and should not be used. Once the new navigation is fully rolled out, this prop will be removed.
323
+ */
324
+ isSideNavSkeleton?: boolean;
325
+ /**
326
+ * Bounded style overrides.
323
327
  */
324
- cssFn?: StatelessCSSFn;
328
+ xcss?: StrictXCSSProp<'minHeight' | 'paddingBlock' | 'paddingInline' | 'paddingBlockStart' | 'paddingBlockEnd' | 'paddingInlineStart' | 'paddingInlineEnd', never>;
325
329
  }
326
330
  export interface HeadingItemProps {
327
331
  /**
@@ -364,29 +368,7 @@ export interface SkeletonHeadingItemProps {
364
368
  */
365
369
  isShimmering?: boolean;
366
370
  /**
367
- * A function that overrides the styles of this component.
368
- * It receives the current styles and returns a customized styles object.
369
- *
370
- * @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
371
+ * Bounded style overrides.
371
372
  */
372
- cssFn?: StatelessCSSFn;
373
- }
374
- export type ItemState = {
375
- isSelected: boolean;
376
- isDisabled: boolean;
377
- };
378
- /**
379
- * A function that overrides the styles of
380
- * menu components. It receives the current state
381
- * and should return a CSSObject.
382
- *
383
- * @see @atlaskit/menu/docs/85-overriding-item-styles
384
- * @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
385
- */
386
- export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
387
- (currentState: TState): CSSObject | CSSObject[];
373
+ xcss?: StrictXCSSProp<'paddingBlock' | 'paddingInline' | 'paddingBlockStart' | 'paddingBlockEnd' | 'paddingInlineStart' | 'paddingInlineEnd', never>;
388
374
  }
389
- /**
390
- * @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
391
- */
392
- export type StatelessCSSFn = CSSFn<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "A list of options to help users navigate, or perform actions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,18 +41,17 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@atlaskit/app-provider": "^2.1.0",
44
+ "@atlaskit/app-provider": "^2.2.0",
45
45
  "@atlaskit/css": "^0.10.0",
46
46
  "@atlaskit/ds-lib": "^4.0.0",
47
47
  "@atlaskit/focus-ring": "^3.0.0",
48
48
  "@atlaskit/interaction-context": "^3.0.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
- "@atlaskit/primitives": "^14.7.0",
50
+ "@atlaskit/primitives": "^14.8.0",
51
51
  "@atlaskit/theme": "^18.0.0",
52
- "@atlaskit/tokens": "^4.8.0",
52
+ "@atlaskit/tokens": "^4.9.0",
53
53
  "@babel/runtime": "^7.0.0",
54
- "@compiled/react": "^0.18.3",
55
- "@emotion/react": "^11.7.1"
54
+ "@compiled/react": "^0.18.3"
56
55
  },
57
56
  "peerDependencies": {
58
57
  "react": "^18.2.0",
@@ -62,12 +61,12 @@
62
61
  "@af/accessibility-testing": "workspace:^",
63
62
  "@af/integration-testing": "workspace:^",
64
63
  "@af/visual-regression": "workspace:^",
65
- "@atlaskit/button": "^23.0.0",
64
+ "@atlaskit/button": "^23.2.0",
66
65
  "@atlaskit/docs": "^10.0.0",
67
- "@atlaskit/icon": "^26.0.0",
66
+ "@atlaskit/icon": "^26.1.0",
68
67
  "@atlaskit/icon-file-type": "^7.0.0",
69
68
  "@atlaskit/icon-object": "^7.1.0",
70
- "@atlaskit/link": "^3.1.0",
69
+ "@atlaskit/link": "^3.2.0",
71
70
  "@atlaskit/section-message": "^8.2.0",
72
71
  "@atlaskit/visual-regression": "workspace:^",
73
72
  "@atlassian/feature-flags-test-utils": "^0.3.0",
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("@emotion/react");
8
- var _colors = require("@atlaskit/theme/colors");
9
- /**
10
- * @jsxRuntime classic
11
- * @jsx jsx
12
- */
13
-
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
-
16
- /**
17
- * These keyframes are mirrored in:
18
- * packages/design-system/theme/src/constants.tsx
19
- *
20
- * Please update both.
21
- */
22
- var shimmerKeyframes = (0, _react.keyframes)({
23
- from: {
24
- backgroundColor: "var(--ds-skeleton, ".concat(_colors.N20A, ")")
25
- },
26
- to: {
27
- backgroundColor: "var(--ds-skeleton-subtle, ".concat(_colors.N30A, ")")
28
- }
29
- });
30
-
31
- /**
32
- * These styles are mirrored in:
33
- * packages/design-system/theme/src/constants.tsx
34
- *
35
- * Please update both.
36
- */
37
- var shimmerStyles = (0, _react.css)({
38
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
39
- '::before, ::after': {
40
- animationDirection: 'alternate',
41
- animationDuration: '1.5s',
42
- animationIterationCount: 'infinite',
43
- animationName: "".concat(shimmerKeyframes),
44
- animationTimingFunction: 'linear',
45
- backgroundColor: "var(--ds-skeleton, ".concat(_colors.N20A, ")")
46
- }
47
- });
48
-
49
- /**
50
- * __Skeleton shimmer__
51
- *
52
- * A skeleton shimmer is the animation shown on loading skeletons for
53
- * perceived performance and user satisfaction.
54
- *
55
- * This component provides a `className` through render props. This value will
56
- * have type:
57
- * + `string`, when `isShimmering={true}`.
58
- * + `undefined`, when `isShimmering={false}`.
59
- *
60
- * @internal
61
- */
62
- var SkeletonShimmer = function SkeletonShimmer(_ref) {
63
- var children = _ref.children,
64
- _ref$isShimmering = _ref.isShimmering,
65
- isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering;
66
- return (0, _react.jsx)(_react.ClassNames, null, function (_ref2) {
67
- var css = _ref2.css;
68
- return children({
69
- className: isShimmering ? css(shimmerStyles) : undefined
70
- });
71
- });
72
- };
73
- var _default = exports.default = SkeletonShimmer;
@@ -1,65 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { ClassNames, css, jsx, keyframes } from '@emotion/react';
8
- import { N20A, N30A } from '@atlaskit/theme/colors';
9
- /**
10
- * These keyframes are mirrored in:
11
- * packages/design-system/theme/src/constants.tsx
12
- *
13
- * Please update both.
14
- */
15
- const shimmerKeyframes = keyframes({
16
- from: {
17
- backgroundColor: `var(--ds-skeleton, ${N20A})`
18
- },
19
- to: {
20
- backgroundColor: `var(--ds-skeleton-subtle, ${N30A})`
21
- }
22
- });
23
-
24
- /**
25
- * These styles are mirrored in:
26
- * packages/design-system/theme/src/constants.tsx
27
- *
28
- * Please update both.
29
- */
30
- const shimmerStyles = css({
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
32
- '::before, ::after': {
33
- animationDirection: 'alternate',
34
- animationDuration: '1.5s',
35
- animationIterationCount: 'infinite',
36
- animationName: `${shimmerKeyframes}`,
37
- animationTimingFunction: 'linear',
38
- backgroundColor: `var(--ds-skeleton, ${N20A})`
39
- }
40
- });
41
-
42
- /**
43
- * __Skeleton shimmer__
44
- *
45
- * A skeleton shimmer is the animation shown on loading skeletons for
46
- * perceived performance and user satisfaction.
47
- *
48
- * This component provides a `className` through render props. This value will
49
- * have type:
50
- * + `string`, when `isShimmering={true}`.
51
- * + `undefined`, when `isShimmering={false}`.
52
- *
53
- * @internal
54
- */
55
- const SkeletonShimmer = ({
56
- children,
57
- isShimmering = false
58
- }) => {
59
- return jsx(ClassNames, null, ({
60
- css
61
- }) => children({
62
- className: isShimmering ? css(shimmerStyles) : undefined
63
- }));
64
- };
65
- export default SkeletonShimmer;
@@ -1,66 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { ClassNames, css, jsx, keyframes } from '@emotion/react';
8
- import { N20A, N30A } from '@atlaskit/theme/colors';
9
- /**
10
- * These keyframes are mirrored in:
11
- * packages/design-system/theme/src/constants.tsx
12
- *
13
- * Please update both.
14
- */
15
- var shimmerKeyframes = keyframes({
16
- from: {
17
- backgroundColor: "var(--ds-skeleton, ".concat(N20A, ")")
18
- },
19
- to: {
20
- backgroundColor: "var(--ds-skeleton-subtle, ".concat(N30A, ")")
21
- }
22
- });
23
-
24
- /**
25
- * These styles are mirrored in:
26
- * packages/design-system/theme/src/constants.tsx
27
- *
28
- * Please update both.
29
- */
30
- var shimmerStyles = css({
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
32
- '::before, ::after': {
33
- animationDirection: 'alternate',
34
- animationDuration: '1.5s',
35
- animationIterationCount: 'infinite',
36
- animationName: "".concat(shimmerKeyframes),
37
- animationTimingFunction: 'linear',
38
- backgroundColor: "var(--ds-skeleton, ".concat(N20A, ")")
39
- }
40
- });
41
-
42
- /**
43
- * __Skeleton shimmer__
44
- *
45
- * A skeleton shimmer is the animation shown on loading skeletons for
46
- * perceived performance and user satisfaction.
47
- *
48
- * This component provides a `className` through render props. This value will
49
- * have type:
50
- * + `string`, when `isShimmering={true}`.
51
- * + `undefined`, when `isShimmering={false}`.
52
- *
53
- * @internal
54
- */
55
- var SkeletonShimmer = function SkeletonShimmer(_ref) {
56
- var children = _ref.children,
57
- _ref$isShimmering = _ref.isShimmering,
58
- isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering;
59
- return jsx(ClassNames, null, function (_ref2) {
60
- var css = _ref2.css;
61
- return children({
62
- className: isShimmering ? css(shimmerStyles) : undefined
63
- });
64
- });
65
- };
66
- export default SkeletonShimmer;
@@ -1,27 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
7
- type SkeletonShimmerProps = {
8
- children: ({ className }: {
9
- className?: string;
10
- }) => ReactNode;
11
- isShimmering?: boolean;
12
- };
13
- /**
14
- * __Skeleton shimmer__
15
- *
16
- * A skeleton shimmer is the animation shown on loading skeletons for
17
- * perceived performance and user satisfaction.
18
- *
19
- * This component provides a `className` through render props. This value will
20
- * have type:
21
- * + `string`, when `isShimmering={true}`.
22
- * + `undefined`, when `isShimmering={false}`.
23
- *
24
- * @internal
25
- */
26
- declare const SkeletonShimmer: ({ children, isShimmering }: SkeletonShimmerProps) => jsx.JSX.Element;
27
- export default SkeletonShimmer;
@@ -1,27 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
7
- type SkeletonShimmerProps = {
8
- children: ({ className }: {
9
- className?: string;
10
- }) => ReactNode;
11
- isShimmering?: boolean;
12
- };
13
- /**
14
- * __Skeleton shimmer__
15
- *
16
- * A skeleton shimmer is the animation shown on loading skeletons for
17
- * perceived performance and user satisfaction.
18
- *
19
- * This component provides a `className` through render props. This value will
20
- * have type:
21
- * + `string`, when `isShimmering={true}`.
22
- * + `undefined`, when `isShimmering={false}`.
23
- *
24
- * @internal
25
- */
26
- declare const SkeletonShimmer: ({ children, isShimmering }: SkeletonShimmerProps) => jsx.JSX.Element;
27
- export default SkeletonShimmer;