@atlaskit/primitives 18.1.4 → 19.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 (83) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/codemods/compiled-fork-stage1/transform.tsx +178 -17
  3. package/components/flex/package.json +17 -0
  4. package/constellation/pressable/usage.mdx +2 -0
  5. package/dist/cjs/compiled/components/box.js +2 -2
  6. package/dist/cjs/compiled/components/text.compiled.css +0 -1
  7. package/dist/cjs/compiled/components/text.js +0 -1
  8. package/dist/cjs/components/box.js +2 -2
  9. package/dist/cjs/responsive/build-media-query-css.js +14 -71
  10. package/dist/cjs/responsive/hide.js +4 -3
  11. package/dist/cjs/responsive/media-helper.js +8 -37
  12. package/dist/cjs/responsive/media.js +31 -0
  13. package/dist/cjs/responsive/show.js +4 -3
  14. package/dist/cjs/responsive/unsafe-build-above-media-query-css.js +43 -0
  15. package/dist/cjs/responsive/unsafe-build-below-media-query-css.js +45 -0
  16. package/dist/cjs/utils/surface-context.js +13 -0
  17. package/dist/cjs/utils/surface-provider.js +10 -10
  18. package/dist/cjs/xcss/style-maps.partial.js +2 -5
  19. package/dist/es2019/compiled/components/box.js +1 -1
  20. package/dist/es2019/compiled/components/text.compiled.css +0 -1
  21. package/dist/es2019/compiled/components/text.js +0 -1
  22. package/dist/es2019/components/box.js +1 -1
  23. package/dist/es2019/responsive/build-media-query-css.js +2 -75
  24. package/dist/es2019/responsive/hide.js +2 -1
  25. package/dist/es2019/responsive/media-helper.js +3 -37
  26. package/dist/es2019/responsive/media.js +25 -0
  27. package/dist/es2019/responsive/show.js +2 -1
  28. package/dist/es2019/responsive/unsafe-build-above-media-query-css.js +38 -0
  29. package/dist/es2019/responsive/unsafe-build-below-media-query-css.js +42 -0
  30. package/dist/es2019/utils/surface-context.js +7 -0
  31. package/dist/es2019/utils/surface-provider.js +4 -9
  32. package/dist/es2019/xcss/style-maps.partial.js +2 -5
  33. package/dist/esm/compiled/components/box.js +1 -1
  34. package/dist/esm/compiled/components/text.compiled.css +0 -1
  35. package/dist/esm/compiled/components/text.js +0 -1
  36. package/dist/esm/components/box.js +1 -1
  37. package/dist/esm/responsive/build-media-query-css.js +2 -68
  38. package/dist/esm/responsive/hide.js +2 -1
  39. package/dist/esm/responsive/media-helper.js +3 -37
  40. package/dist/esm/responsive/media.js +25 -0
  41. package/dist/esm/responsive/show.js +2 -1
  42. package/dist/esm/responsive/unsafe-build-above-media-query-css.js +37 -0
  43. package/dist/esm/responsive/unsafe-build-below-media-query-css.js +39 -0
  44. package/dist/esm/utils/surface-context.js +7 -0
  45. package/dist/esm/utils/surface-provider.js +4 -9
  46. package/dist/esm/xcss/style-maps.partial.js +2 -5
  47. package/dist/types/compiled/components/types.d.ts +1 -1
  48. package/dist/types/responsive/build-media-query-css.d.ts +2 -63
  49. package/dist/types/responsive/media-helper.d.ts +1 -35
  50. package/dist/types/responsive/media.d.ts +25 -0
  51. package/dist/types/responsive/types.d.ts +1 -1
  52. package/dist/types/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
  53. package/dist/types/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
  54. package/dist/types/utils/surface-context.d.ts +8 -0
  55. package/dist/types/utils/surface-provider.d.ts +1 -7
  56. package/dist/types/xcss/style-maps.partial.d.ts +2 -4
  57. package/dist/types-ts4.5/compiled/components/types.d.ts +1 -1
  58. package/dist/types-ts4.5/responsive/build-media-query-css.d.ts +2 -63
  59. package/dist/types-ts4.5/responsive/media-helper.d.ts +1 -35
  60. package/dist/types-ts4.5/responsive/media.d.ts +25 -0
  61. package/dist/types-ts4.5/responsive/types.d.ts +1 -1
  62. package/dist/types-ts4.5/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
  63. package/dist/types-ts4.5/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
  64. package/dist/types-ts4.5/utils/surface-context.d.ts +8 -0
  65. package/dist/types-ts4.5/utils/surface-provider.d.ts +1 -7
  66. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +2 -4
  67. package/package.json +17 -17
  68. package/scripts/capitalize.tsx +2 -0
  69. package/scripts/color-codegen-template.tsx +3 -6
  70. package/scripts/compose.tsx +4 -0
  71. package/scripts/elevation-codegen-template.tsx +3 -6
  72. package/scripts/generate-type-defs.tsx +12 -0
  73. package/scripts/inverse-color-map-template.tsx +4 -1
  74. package/scripts/is-accent.tsx +1 -0
  75. package/scripts/is-hovered.tsx +1 -0
  76. package/scripts/is-pressed.tsx +1 -0
  77. package/scripts/pick.tsx +4 -0
  78. package/scripts/shape-codegen-template.tsx +3 -1
  79. package/scripts/spacing-codegen-template.tsx +2 -1
  80. package/scripts/text-codegen-template.tsx +3 -2
  81. package/scripts/typography-codegen-template.tsx +3 -1
  82. package/scripts/utils.tsx +7 -25
  83. package/offerings.json +0 -298
@@ -7,7 +7,8 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { parseXcss } from '../xcss/xcss';
10
- import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
10
+ import { UNSAFE_buildAboveMediaQueryCSS } from './unsafe-build-above-media-query-css';
11
+ import { UNSAFE_buildBelowMediaQueryCSS } from './unsafe-build-below-media-query-css';
11
12
  var showAboveQueries = UNSAFE_buildAboveMediaQueryCSS({
12
13
  display: 'revert'
13
14
  });
@@ -0,0 +1,37 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
5
+ import { css } from '@emotion/react';
6
+ import { UNSAFE_BREAKPOINTS_ORDERED_LIST } from './constants';
7
+ import { media } from './media';
8
+ /**
9
+ * Build a map of breakpoints to css with media queries and nested styles.
10
+ *
11
+ * @internal Not intended to be used outside of DST at this stage.
12
+ * @experimental Not intended to be used outside of DST at this stage.
13
+ *
14
+ * @example
15
+ * A map to build optional `display:none` for consumption on a div.
16
+ * ```ts
17
+ * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
18
+ *
19
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
20
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
21
+ * }
22
+ * ```
23
+ *
24
+ * This roughly builds a map that will look roughly like this (if done manually):
25
+ * ```ts
26
+ * {
27
+ * xxs: css({ '@media all': { display: 'none' } }),
28
+ * xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
29
+ * sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
30
+ * }
31
+ * ```
32
+ */
33
+ export var UNSAFE_buildAboveMediaQueryCSS = function UNSAFE_buildAboveMediaQueryCSS(input) {
34
+ return UNSAFE_BREAKPOINTS_ORDERED_LIST.reduce(function (acc, breakpoint) {
35
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, breakpoint, css(_defineProperty({}, media.above[breakpoint], typeof input === 'function' ? input(breakpoint) : input))));
36
+ }, {});
37
+ };
@@ -0,0 +1,39 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
5
+ import { css } from '@emotion/react';
6
+ import { UNSAFE_BREAKPOINTS_ORDERED_LIST } from './constants';
7
+ import { UNSAFE_media } from './media-helper';
8
+ /**
9
+ * Build a map of breakpoints to css with media queries and nested styles.
10
+ *
11
+ * @internal Not intended to be used outside of DST at this stage.
12
+ * @experimental Not intended to be used outside of DST at this stage.
13
+ *
14
+ * @example
15
+ * A map to build optional `display:none` for consumption on a div.
16
+ * ```ts
17
+ * const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
18
+ *
19
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
20
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
21
+ * }
22
+ * ```
23
+ *
24
+ * This roughly builds a map that will look roughly like this (if done manually):
25
+ * ```ts
26
+ * {
27
+ * xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
28
+ * sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
29
+ * }
30
+ * ```
31
+ */
32
+ export var UNSAFE_buildBelowMediaQueryCSS = function UNSAFE_buildBelowMediaQueryCSS(input) {
33
+ return UNSAFE_BREAKPOINTS_ORDERED_LIST.reduce(function (acc, breakpoint) {
34
+ if (breakpoint === 'xxs') {
35
+ return acc;
36
+ }
37
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, breakpoint, css(_defineProperty({}, UNSAFE_media.below[breakpoint], typeof input === 'function' ? input(breakpoint) : input))));
38
+ }, {});
39
+ };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ * __Surface context__
4
+ *
5
+ * A surface context provides context information on the current background (if set).
6
+ */
7
+ export var SurfaceContext = /*#__PURE__*/createContext('elevation.surface');
@@ -1,11 +1,5 @@
1
- import { createContext, useContext } from 'react';
2
- /**
3
- * __Surface context__
4
- *
5
- * A surface context provides context information on the current background (if set).
6
- */
7
- export var SurfaceContext = /*#__PURE__*/createContext('elevation.surface');
8
-
1
+ import { useContext } from 'react';
2
+ import { SurfaceContext } from './surface-context';
9
3
  /**
10
4
  * __useSurface__
11
5
  *
@@ -16,4 +10,5 @@ export var SurfaceContext = /*#__PURE__*/createContext('elevation.surface');
16
10
  export var useSurface = function useSurface() {
17
11
  return useContext(SurfaceContext);
18
12
  };
19
- SurfaceContext.displayName = 'SurfaceProvider';
13
+ SurfaceContext.displayName = 'SurfaceProvider';
14
+ export { SurfaceContext } from './surface-context';
@@ -515,7 +515,7 @@ export var borderRadiusMap = {
515
515
 
516
516
  /**
517
517
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
518
- * @codegen <<SignedSource::64331f0b8b5e2f090a3aad153d92deb6>>
518
+ * @codegen <<SignedSource::6dffa08c1104af4093361cb0f7e37996>>
519
519
  * @codegenId typography
520
520
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
521
521
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -524,8 +524,6 @@ export var borderRadiusMap = {
524
524
  */
525
525
  export var fontMap = {
526
526
  'font.body': "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
527
- // @deprecated
528
- 'font.body.UNSAFE_small': "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
529
527
  'font.body.large': "var(--ds-font-body-large, normal 400 16px/24px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
530
528
  'font.body.small': "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
531
529
  'font.code': "var(--ds-font-code, normal 400 0.875em/1 \"Atlassian Mono\", ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
@@ -559,7 +557,7 @@ export var fontFamilyMap = {
559
557
 
560
558
  /**
561
559
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
562
- * @codegen <<SignedSource::aeebc24b95e2189021f1d98f1715a6a0>>
560
+ * @codegen <<SignedSource::b67a50fa5abb078032598ba819a6f691>>
563
561
  * @codegenId text
564
562
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
565
563
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -567,7 +565,6 @@ export var fontFamilyMap = {
567
565
  */
568
566
  export var textSizeMap = {
569
567
  medium: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
570
- UNSAFE_small: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
571
568
  large: "var(--ds-font-body-large, normal 400 16px/24px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
572
569
  small: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
573
570
  };
@@ -40,6 +40,6 @@ export type GapToken = PositiveSpaceToken;
40
40
  export type SurfaceColorToken = 'utility.elevation.surface.current' | 'elevation.surface' | 'elevation.surface.overlay' | 'elevation.surface.raised' | 'elevation.surface.sunken';
41
41
  export type TextAlign = 'center' | 'end' | 'start';
42
42
  export type TextColor = 'color.text' | 'color.text.accent.lime' | 'color.text.accent.lime.bolder' | 'color.text.accent.red' | 'color.text.accent.red.bolder' | 'color.text.accent.orange' | 'color.text.accent.orange.bolder' | 'color.text.accent.yellow' | 'color.text.accent.yellow.bolder' | 'color.text.accent.green' | 'color.text.accent.green.bolder' | 'color.text.accent.teal' | 'color.text.accent.teal.bolder' | 'color.text.accent.blue' | 'color.text.accent.blue.bolder' | 'color.text.accent.purple' | 'color.text.accent.purple.bolder' | 'color.text.accent.magenta' | 'color.text.accent.magenta.bolder' | 'color.text.accent.gray' | 'color.text.accent.gray.bolder' | 'color.text.disabled' | 'color.text.inverse' | 'color.text.selected' | 'color.text.brand' | 'color.text.danger' | 'color.text.warning' | 'color.text.warning.inverse' | 'color.text.success' | 'color.text.discovery' | 'color.text.information' | 'color.text.subtlest' | 'color.text.subtle' | 'color.link' | 'color.link.pressed' | 'color.link.visited' | 'color.link.visited.pressed';
43
- export type FontSize = 'small' | 'medium' | 'UNSAFE_small' | 'large';
43
+ export type FontSize = 'small' | 'medium' | 'large';
44
44
  export type FontWeight = 'bold' | 'medium' | 'regular' | 'semibold';
45
45
  export type MetricTextFontSize = 'small' | 'medium' | 'large';
@@ -1,63 +1,2 @@
1
- import { type CSSObject, type SerializedStyles } from '@emotion/react';
2
- import type { Breakpoint } from './types';
3
- /**
4
- * Build a map of breakpoints to css with media queries and nested styles.
5
- *
6
- * @internal Not intended to be used outside of DST at this stage.
7
- * @experimental Not intended to be used outside of DST at this stage.
8
- *
9
- * @example
10
- * A map to build optional `display:none` for consumption on a div.
11
- * ```ts
12
- * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
13
- *
14
- * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
- * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
- * }
17
- * ```
18
- *
19
- * This roughly builds a map that will look roughly like this (if done manually):
20
- * ```ts
21
- * {
22
- * xxs: css({ '@media all': { display: 'none' } }),
23
- * xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
24
- * sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
25
- * }
26
- * ```
27
- */
28
- export declare const UNSAFE_buildAboveMediaQueryCSS: (
29
- /**
30
- * The desired CSS to place inside of the media query.
31
- * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
32
- */
33
- input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
34
- /**
35
- * Build a map of breakpoints to css with media queries and nested styles.
36
- *
37
- * @internal Not intended to be used outside of DST at this stage.
38
- * @experimental Not intended to be used outside of DST at this stage.
39
- *
40
- * @example
41
- * A map to build optional `display:none` for consumption on a div.
42
- * ```ts
43
- * const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
44
- *
45
- * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
46
- * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
47
- * }
48
- * ```
49
- *
50
- * This roughly builds a map that will look roughly like this (if done manually):
51
- * ```ts
52
- * {
53
- * xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
54
- * sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
55
- * }
56
- * ```
57
- */
58
- export declare const UNSAFE_buildBelowMediaQueryCSS: (
59
- /**
60
- * The desired CSS to place inside of the media query.
61
- * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
62
- */
63
- input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
1
+ export { UNSAFE_buildAboveMediaQueryCSS } from './unsafe-build-above-media-query-css';
2
+ export { UNSAFE_buildBelowMediaQueryCSS } from './unsafe-build-below-media-query-css';
@@ -1,38 +1,3 @@
1
- /**
2
- * This is an object of usable media query helpers using our internal breakpoints configuration.
3
- *
4
- * When using Compiled CSS-in-JS, please ensure that only a single declaration can take effect at a time.
5
- * This means that you should avoid multiple breakpoints taking effect at the same time,
6
- * eg. ```{ [media.above.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
7
- * Instead, make sure that only one breakpoint can take effect at a time,
8
- * e.g, ```{ [media.only.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
9
- * For more details, please see <https://compiledcssinjs.com/docs/atomic-css#selector-specificity>.
10
- */
11
- export declare const media: {
12
- above: {
13
- readonly xxs: "@media all";
14
- readonly xs: "@media (min-width: 30rem)";
15
- readonly sm: "@media (min-width: 48rem)";
16
- readonly md: "@media (min-width: 64rem)";
17
- readonly lg: "@media (min-width: 90rem)";
18
- readonly xl: "@media (min-width: 110.5rem)";
19
- };
20
- only: {
21
- readonly xxs: "@media (min-width: 0rem) and (max-width: 29.99rem)";
22
- readonly xs: "@media (min-width: 30rem) and (max-width: 47.99rem)";
23
- readonly sm: "@media (min-width: 48rem) and (max-width: 63.99rem)";
24
- readonly md: "@media (min-width: 64rem) and (max-width: 89.99rem)";
25
- readonly lg: "@media (min-width: 90rem) and (max-width: 110.49rem)";
26
- readonly xl: "@media (min-width: 110.5rem)";
27
- };
28
- below: {
29
- readonly xs: "@media not all and (min-width: 30rem)";
30
- readonly sm: "@media not all and (min-width: 48rem)";
31
- readonly md: "@media not all and (min-width: 64rem)";
32
- readonly lg: "@media not all and (min-width: 90rem)";
33
- readonly xl: "@media not all and (min-width: 110.5rem)";
34
- };
35
- };
36
1
  /**
37
2
  * Keep `UNSAFE_media` for backwards compatibility.
38
3
  */
@@ -61,3 +26,4 @@ export declare const UNSAFE_media: {
61
26
  readonly xl: '@media not all and (min-width: 110.5rem)';
62
27
  };
63
28
  };
29
+ export { media } from './media';
@@ -0,0 +1,25 @@
1
+ export declare const media: {
2
+ above: {
3
+ readonly xxs: "@media all";
4
+ readonly xs: "@media (min-width: 30rem)";
5
+ readonly sm: "@media (min-width: 48rem)";
6
+ readonly md: "@media (min-width: 64rem)";
7
+ readonly lg: "@media (min-width: 90rem)";
8
+ readonly xl: "@media (min-width: 110.5rem)";
9
+ };
10
+ only: {
11
+ readonly xxs: "@media (min-width: 0rem) and (max-width: 29.99rem)";
12
+ readonly xs: "@media (min-width: 30rem) and (max-width: 47.99rem)";
13
+ readonly sm: "@media (min-width: 48rem) and (max-width: 63.99rem)";
14
+ readonly md: "@media (min-width: 64rem) and (max-width: 89.99rem)";
15
+ readonly lg: "@media (min-width: 90rem) and (max-width: 110.49rem)";
16
+ readonly xl: "@media (min-width: 110.5rem)";
17
+ };
18
+ below: {
19
+ readonly xs: "@media not all and (min-width: 30rem)";
20
+ readonly sm: "@media not all and (min-width: 48rem)";
21
+ readonly md: "@media not all and (min-width: 64rem)";
22
+ readonly lg: "@media not all and (min-width: 90rem)";
23
+ readonly xl: "@media not all and (min-width: 110.5rem)";
24
+ };
25
+ };
@@ -1,5 +1,5 @@
1
1
  import { type SerializedStyles } from '@emotion/react';
2
- import { type media } from './media-helper';
2
+ import type { media } from './media';
3
3
  /**
4
4
  * The breakpoints we have for responsiveness.
5
5
  */
@@ -0,0 +1,33 @@
1
+ import { type CSSObject, type SerializedStyles } from '@emotion/react';
2
+ import type { Breakpoint } from './types';
3
+ /**
4
+ * Build a map of breakpoints to css with media queries and nested styles.
5
+ *
6
+ * @internal Not intended to be used outside of DST at this stage.
7
+ * @experimental Not intended to be used outside of DST at this stage.
8
+ *
9
+ * @example
10
+ * A map to build optional `display:none` for consumption on a div.
11
+ * ```ts
12
+ * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
13
+ *
14
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
+ * }
17
+ * ```
18
+ *
19
+ * This roughly builds a map that will look roughly like this (if done manually):
20
+ * ```ts
21
+ * {
22
+ * xxs: css({ '@media all': { display: 'none' } }),
23
+ * xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
24
+ * sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
25
+ * }
26
+ * ```
27
+ */
28
+ export declare const UNSAFE_buildAboveMediaQueryCSS: (
29
+ /**
30
+ * The desired CSS to place inside of the media query.
31
+ * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
32
+ */
33
+ input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
@@ -0,0 +1,32 @@
1
+ import { type CSSObject, type SerializedStyles } from '@emotion/react';
2
+ import type { Breakpoint } from './types';
3
+ /**
4
+ * Build a map of breakpoints to css with media queries and nested styles.
5
+ *
6
+ * @internal Not intended to be used outside of DST at this stage.
7
+ * @experimental Not intended to be used outside of DST at this stage.
8
+ *
9
+ * @example
10
+ * A map to build optional `display:none` for consumption on a div.
11
+ * ```ts
12
+ * const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
13
+ *
14
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
+ * }
17
+ * ```
18
+ *
19
+ * This roughly builds a map that will look roughly like this (if done manually):
20
+ * ```ts
21
+ * {
22
+ * xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
23
+ * sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
24
+ * }
25
+ * ```
26
+ */
27
+ export declare const UNSAFE_buildBelowMediaQueryCSS: (
28
+ /**
29
+ * The desired CSS to place inside of the media query.
30
+ * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
31
+ */
32
+ input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
@@ -0,0 +1,8 @@
1
+ import { type Context } from 'react';
2
+ import type { BackgroundColorToken } from './types';
3
+ /**
4
+ * __Surface context__
5
+ *
6
+ * A surface context provides context information on the current background (if set).
7
+ */
8
+ export declare const SurfaceContext: Context<BackgroundColorToken>;
@@ -1,11 +1,4 @@
1
- import { type Context } from 'react';
2
1
  import type { BackgroundColorToken } from './types';
3
- /**
4
- * __Surface context__
5
- *
6
- * A surface context provides context information on the current background (if set).
7
- */
8
- export declare const SurfaceContext: Context<BackgroundColorToken>;
9
2
  /**
10
3
  * __useSurface__
11
4
  *
@@ -14,3 +7,4 @@ export declare const SurfaceContext: Context<BackgroundColorToken>;
14
7
  * @see SurfaceContext
15
8
  */
16
9
  export declare const useSurface: () => BackgroundColorToken;
10
+ export { SurfaceContext } from './surface-context';
@@ -542,7 +542,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
542
542
  */
543
543
  /**
544
544
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
545
- * @codegen <<SignedSource::64331f0b8b5e2f090a3aad153d92deb6>>
545
+ * @codegen <<SignedSource::6dffa08c1104af4093361cb0f7e37996>>
546
546
  * @codegenId typography
547
547
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
548
548
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -551,7 +551,6 @@ export type BorderRadius = keyof typeof borderRadiusMap;
551
551
  */
552
552
  export declare const fontMap: {
553
553
  'font.body': 'var(--ds-font-body)';
554
- 'font.body.UNSAFE_small': 'var(--ds-font-body-UNSAFE_small)';
555
554
  'font.body.large': 'var(--ds-font-body-large)';
556
555
  'font.body.small': 'var(--ds-font-body-small)';
557
556
  'font.code': 'var(--ds-font-code)';
@@ -587,7 +586,7 @@ export type FontFamily = keyof typeof fontFamilyMap;
587
586
  */
588
587
  /**
589
588
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
590
- * @codegen <<SignedSource::aeebc24b95e2189021f1d98f1715a6a0>>
589
+ * @codegen <<SignedSource::b67a50fa5abb078032598ba819a6f691>>
591
590
  * @codegenId text
592
591
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
593
592
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -595,7 +594,6 @@ export type FontFamily = keyof typeof fontFamilyMap;
595
594
  */
596
595
  export declare const textSizeMap: {
597
596
  medium: 'var(--ds-font-body)';
598
- UNSAFE_small: 'var(--ds-font-body-UNSAFE_small)';
599
597
  large: 'var(--ds-font-body-large)';
600
598
  small: 'var(--ds-font-body-small)';
601
599
  };
@@ -40,6 +40,6 @@ export type GapToken = PositiveSpaceToken;
40
40
  export type SurfaceColorToken = 'utility.elevation.surface.current' | 'elevation.surface' | 'elevation.surface.overlay' | 'elevation.surface.raised' | 'elevation.surface.sunken';
41
41
  export type TextAlign = 'center' | 'end' | 'start';
42
42
  export type TextColor = 'color.text' | 'color.text.accent.lime' | 'color.text.accent.lime.bolder' | 'color.text.accent.red' | 'color.text.accent.red.bolder' | 'color.text.accent.orange' | 'color.text.accent.orange.bolder' | 'color.text.accent.yellow' | 'color.text.accent.yellow.bolder' | 'color.text.accent.green' | 'color.text.accent.green.bolder' | 'color.text.accent.teal' | 'color.text.accent.teal.bolder' | 'color.text.accent.blue' | 'color.text.accent.blue.bolder' | 'color.text.accent.purple' | 'color.text.accent.purple.bolder' | 'color.text.accent.magenta' | 'color.text.accent.magenta.bolder' | 'color.text.accent.gray' | 'color.text.accent.gray.bolder' | 'color.text.disabled' | 'color.text.inverse' | 'color.text.selected' | 'color.text.brand' | 'color.text.danger' | 'color.text.warning' | 'color.text.warning.inverse' | 'color.text.success' | 'color.text.discovery' | 'color.text.information' | 'color.text.subtlest' | 'color.text.subtle' | 'color.link' | 'color.link.pressed' | 'color.link.visited' | 'color.link.visited.pressed';
43
- export type FontSize = 'small' | 'medium' | 'UNSAFE_small' | 'large';
43
+ export type FontSize = 'small' | 'medium' | 'large';
44
44
  export type FontWeight = 'bold' | 'medium' | 'regular' | 'semibold';
45
45
  export type MetricTextFontSize = 'small' | 'medium' | 'large';
@@ -1,63 +1,2 @@
1
- import { type CSSObject, type SerializedStyles } from '@emotion/react';
2
- import type { Breakpoint } from './types';
3
- /**
4
- * Build a map of breakpoints to css with media queries and nested styles.
5
- *
6
- * @internal Not intended to be used outside of DST at this stage.
7
- * @experimental Not intended to be used outside of DST at this stage.
8
- *
9
- * @example
10
- * A map to build optional `display:none` for consumption on a div.
11
- * ```ts
12
- * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
13
- *
14
- * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
- * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
- * }
17
- * ```
18
- *
19
- * This roughly builds a map that will look roughly like this (if done manually):
20
- * ```ts
21
- * {
22
- * xxs: css({ '@media all': { display: 'none' } }),
23
- * xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
24
- * sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
25
- * }
26
- * ```
27
- */
28
- export declare const UNSAFE_buildAboveMediaQueryCSS: (
29
- /**
30
- * The desired CSS to place inside of the media query.
31
- * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
32
- */
33
- input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
34
- /**
35
- * Build a map of breakpoints to css with media queries and nested styles.
36
- *
37
- * @internal Not intended to be used outside of DST at this stage.
38
- * @experimental Not intended to be used outside of DST at this stage.
39
- *
40
- * @example
41
- * A map to build optional `display:none` for consumption on a div.
42
- * ```ts
43
- * const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
44
- *
45
- * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
46
- * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
47
- * }
48
- * ```
49
- *
50
- * This roughly builds a map that will look roughly like this (if done manually):
51
- * ```ts
52
- * {
53
- * xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
54
- * sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
55
- * }
56
- * ```
57
- */
58
- export declare const UNSAFE_buildBelowMediaQueryCSS: (
59
- /**
60
- * The desired CSS to place inside of the media query.
61
- * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
62
- */
63
- input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
1
+ export { UNSAFE_buildAboveMediaQueryCSS } from './unsafe-build-above-media-query-css';
2
+ export { UNSAFE_buildBelowMediaQueryCSS } from './unsafe-build-below-media-query-css';
@@ -1,38 +1,3 @@
1
- /**
2
- * This is an object of usable media query helpers using our internal breakpoints configuration.
3
- *
4
- * When using Compiled CSS-in-JS, please ensure that only a single declaration can take effect at a time.
5
- * This means that you should avoid multiple breakpoints taking effect at the same time,
6
- * eg. ```{ [media.above.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
7
- * Instead, make sure that only one breakpoint can take effect at a time,
8
- * e.g, ```{ [media.only.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
9
- * For more details, please see <https://compiledcssinjs.com/docs/atomic-css#selector-specificity>.
10
- */
11
- export declare const media: {
12
- above: {
13
- readonly xxs: "@media all";
14
- readonly xs: "@media (min-width: 30rem)";
15
- readonly sm: "@media (min-width: 48rem)";
16
- readonly md: "@media (min-width: 64rem)";
17
- readonly lg: "@media (min-width: 90rem)";
18
- readonly xl: "@media (min-width: 110.5rem)";
19
- };
20
- only: {
21
- readonly xxs: "@media (min-width: 0rem) and (max-width: 29.99rem)";
22
- readonly xs: "@media (min-width: 30rem) and (max-width: 47.99rem)";
23
- readonly sm: "@media (min-width: 48rem) and (max-width: 63.99rem)";
24
- readonly md: "@media (min-width: 64rem) and (max-width: 89.99rem)";
25
- readonly lg: "@media (min-width: 90rem) and (max-width: 110.49rem)";
26
- readonly xl: "@media (min-width: 110.5rem)";
27
- };
28
- below: {
29
- readonly xs: "@media not all and (min-width: 30rem)";
30
- readonly sm: "@media not all and (min-width: 48rem)";
31
- readonly md: "@media not all and (min-width: 64rem)";
32
- readonly lg: "@media not all and (min-width: 90rem)";
33
- readonly xl: "@media not all and (min-width: 110.5rem)";
34
- };
35
- };
36
1
  /**
37
2
  * Keep `UNSAFE_media` for backwards compatibility.
38
3
  */
@@ -61,3 +26,4 @@ export declare const UNSAFE_media: {
61
26
  readonly xl: '@media not all and (min-width: 110.5rem)';
62
27
  };
63
28
  };
29
+ export { media } from './media';
@@ -0,0 +1,25 @@
1
+ export declare const media: {
2
+ above: {
3
+ readonly xxs: "@media all";
4
+ readonly xs: "@media (min-width: 30rem)";
5
+ readonly sm: "@media (min-width: 48rem)";
6
+ readonly md: "@media (min-width: 64rem)";
7
+ readonly lg: "@media (min-width: 90rem)";
8
+ readonly xl: "@media (min-width: 110.5rem)";
9
+ };
10
+ only: {
11
+ readonly xxs: "@media (min-width: 0rem) and (max-width: 29.99rem)";
12
+ readonly xs: "@media (min-width: 30rem) and (max-width: 47.99rem)";
13
+ readonly sm: "@media (min-width: 48rem) and (max-width: 63.99rem)";
14
+ readonly md: "@media (min-width: 64rem) and (max-width: 89.99rem)";
15
+ readonly lg: "@media (min-width: 90rem) and (max-width: 110.49rem)";
16
+ readonly xl: "@media (min-width: 110.5rem)";
17
+ };
18
+ below: {
19
+ readonly xs: "@media not all and (min-width: 30rem)";
20
+ readonly sm: "@media not all and (min-width: 48rem)";
21
+ readonly md: "@media not all and (min-width: 64rem)";
22
+ readonly lg: "@media not all and (min-width: 90rem)";
23
+ readonly xl: "@media not all and (min-width: 110.5rem)";
24
+ };
25
+ };
@@ -1,5 +1,5 @@
1
1
  import { type SerializedStyles } from '@emotion/react';
2
- import { type media } from './media-helper';
2
+ import type { media } from './media';
3
3
  /**
4
4
  * The breakpoints we have for responsiveness.
5
5
  */
@@ -0,0 +1,33 @@
1
+ import { type CSSObject, type SerializedStyles } from '@emotion/react';
2
+ import type { Breakpoint } from './types';
3
+ /**
4
+ * Build a map of breakpoints to css with media queries and nested styles.
5
+ *
6
+ * @internal Not intended to be used outside of DST at this stage.
7
+ * @experimental Not intended to be used outside of DST at this stage.
8
+ *
9
+ * @example
10
+ * A map to build optional `display:none` for consumption on a div.
11
+ * ```ts
12
+ * const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
13
+ *
14
+ * const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
15
+ * return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
16
+ * }
17
+ * ```
18
+ *
19
+ * This roughly builds a map that will look roughly like this (if done manually):
20
+ * ```ts
21
+ * {
22
+ * xxs: css({ '@media all': { display: 'none' } }),
23
+ * xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
24
+ * sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
25
+ * }
26
+ * ```
27
+ */
28
+ export declare const UNSAFE_buildAboveMediaQueryCSS: (
29
+ /**
30
+ * The desired CSS to place inside of the media query.
31
+ * This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
32
+ */
33
+ input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;