@atlaskit/primitives 14.8.4 → 14.9.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 (48) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/constellation/anchor/examples.mdx +4 -4
  3. package/constellation/box/examples.mdx +7 -7
  4. package/constellation/box/usage.mdx +2 -2
  5. package/constellation/inline/examples.mdx +1 -1
  6. package/constellation/inline/usage.mdx +18 -4
  7. package/constellation/overview/index.mdx +1 -1
  8. package/constellation/pressable/examples.mdx +4 -4
  9. package/constellation/responsive/examples.mdx +18 -25
  10. package/constellation/stack/usage.mdx +1 -1
  11. package/constellation/text/examples.mdx +2 -2
  12. package/dist/cjs/compiled/components/metric-text.compiled.css +10 -0
  13. package/dist/cjs/compiled/components/metric-text.js +55 -0
  14. package/dist/cjs/compiled/index.js +7 -0
  15. package/dist/cjs/components/metric-text.js +66 -0
  16. package/dist/cjs/index.js +7 -0
  17. package/dist/cjs/xcss/style-maps.partial.js +14 -5
  18. package/dist/es2019/compiled/components/metric-text.compiled.css +10 -0
  19. package/dist/es2019/compiled/components/metric-text.js +46 -0
  20. package/dist/es2019/compiled/index.js +1 -0
  21. package/dist/es2019/components/metric-text.js +58 -0
  22. package/dist/es2019/index.js +1 -0
  23. package/dist/es2019/xcss/style-maps.partial.js +13 -4
  24. package/dist/esm/compiled/components/metric-text.compiled.css +10 -0
  25. package/dist/esm/compiled/components/metric-text.js +46 -0
  26. package/dist/esm/compiled/index.js +1 -0
  27. package/dist/esm/components/metric-text.js +58 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/xcss/style-maps.partial.js +13 -4
  30. package/dist/types/compiled/components/metric-text.d.ts +46 -0
  31. package/dist/types/compiled/components/stack.d.ts +1 -1
  32. package/dist/types/compiled/components/types.d.ts +1 -0
  33. package/dist/types/compiled/index.d.ts +1 -0
  34. package/dist/types/components/metric-text.d.ts +53 -0
  35. package/dist/types/index.d.ts +2 -0
  36. package/dist/types/xcss/style-maps.partial.d.ts +14 -2
  37. package/dist/types/xcss/xcss.d.ts +4 -1
  38. package/dist/types-ts4.5/compiled/components/metric-text.d.ts +49 -0
  39. package/dist/types-ts4.5/compiled/components/stack.d.ts +1 -1
  40. package/dist/types-ts4.5/compiled/components/types.d.ts +1 -0
  41. package/dist/types-ts4.5/compiled/index.d.ts +1 -0
  42. package/dist/types-ts4.5/components/metric-text.d.ts +56 -0
  43. package/dist/types-ts4.5/index.d.ts +2 -0
  44. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +14 -2
  45. package/dist/types-ts4.5/xcss/xcss.d.ts +4 -1
  46. package/package.json +10 -9
  47. package/scripts/text-codegen-template.tsx +13 -4
  48. package/scripts/typography-codegen-template.tsx +1 -0
@@ -496,7 +496,7 @@ export const borderRadiusMap = {
496
496
 
497
497
  /**
498
498
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
499
- * @codegen <<SignedSource::b2a06338babbfbea48ed2205e34084fc>>
499
+ * @codegen <<SignedSource::2c0cffbebdab4e28fe2b45925623e523>>
500
500
  * @codegenId typography
501
501
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
502
502
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -515,7 +515,10 @@ export const fontMap = {
515
515
  'font.heading.xlarge': "var(--ds-font-heading-xlarge, normal 600 29px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
516
516
  'font.heading.xsmall': "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
517
517
  'font.heading.xxlarge': "var(--ds-font-heading-xxlarge, normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
518
- 'font.heading.xxsmall': "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
518
+ 'font.heading.xxsmall': "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
519
+ 'font.metric.large': "var(--ds-font-metric-large, normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
520
+ 'font.metric.medium': "var(--ds-font-metric-medium, normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
521
+ 'font.metric.small': "var(--ds-font-metric-small, normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
519
522
  };
520
523
  export const fontWeightMap = {
521
524
  'font.weight.bold': "var(--ds-font-weight-bold, 700)",
@@ -536,7 +539,7 @@ export const fontFamilyMap = {
536
539
 
537
540
  /**
538
541
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
539
- * @codegen <<SignedSource::159df661d29a2805a17ab6f52e842350>>
542
+ * @codegen <<SignedSource::c207cc4caf0794de5f13707a9c28451f>>
540
543
  * @codegenId text
541
544
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
542
545
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -554,6 +557,11 @@ export const textWeightMap = {
554
557
  regular: "var(--ds-font-weight-regular, 400)",
555
558
  semibold: "var(--ds-font-weight-semibold, 600)"
556
559
  };
560
+ export const metricTextSizeMap = {
561
+ large: "var(--ds-font-metric-large, normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
562
+ medium: "var(--ds-font-metric-medium, normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
563
+ small: "var(--ds-font-metric-small, normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
564
+ };
557
565
 
558
566
  /**
559
567
  * @codegenEnd
@@ -593,4 +601,5 @@ export const fontStylesMap = getSerializedStylesMap('font', fontMap);
593
601
  export const textSizeStylesMap = getSerializedStylesMap('font', textSizeMap);
594
602
  export const textWeightStylesMap = getSerializedStylesMap('fontWeight', textWeightMap);
595
603
  export const surfaceColorStylesMap = getSerializedStylesMap(CURRENT_SURFACE_CSS_VAR, surfaceColorMap);
596
- export const isSurfaceColorToken = color => surfaceColorMap[color] !== undefined;
604
+ export const isSurfaceColorToken = color => surfaceColorMap[color] !== undefined;
605
+ export const metricTextSizeStylesMap = getSerializedStylesMap('font', metricTextSizeMap);
@@ -0,0 +1,10 @@
1
+ ._11c81lu7{font:var(--ds-font-metric-medium,normal 653 24px/28px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._11c81r7r{font:var(--ds-font-metric-large,normal 653 28px/2pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
+ ._11c8h56o{font:var(--ds-font-metric-small,normal 653 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
4
+ ._18u0idpf{margin-left:0}
5
+ ._19pkidpf{margin-top:0}
6
+ ._2hwxidpf{margin-right:0}
7
+ ._otyridpf{margin-bottom:0}
8
+ ._y3gn1h6o{text-align:center}
9
+ ._y3gnh9n0{text-align:end}
10
+ ._y3gnv2br{text-align:start}
@@ -0,0 +1,46 @@
1
+ /* metric-text.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./metric-text.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { forwardRef } from 'react';
6
+ import invariant from 'tiny-invariant';
7
+ var asAllowlist = ['span', 'div'];
8
+ var styles = {
9
+ root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf",
10
+ 'textAlign.center': "_y3gn1h6o",
11
+ 'textAlign.end': "_y3gnh9n0",
12
+ 'textAlign.start': "_y3gnv2br"
13
+ };
14
+ var fontSizeMap = {
15
+ small: "_11c8h56o",
16
+ medium: "_11c81lu7",
17
+ large: "_11c81r7r"
18
+ };
19
+
20
+ /**
21
+ * __MetricText__
22
+ *
23
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
24
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
25
+ * It renders a `span` by default.
26
+ *
27
+ * @internal
28
+ */
29
+ var MetricText = /*#__PURE__*/forwardRef(function (_ref, ref) {
30
+ var _ref$as = _ref.as,
31
+ Component = _ref$as === void 0 ? 'span' : _ref$as,
32
+ align = _ref.align,
33
+ testId = _ref.testId,
34
+ id = _ref.id,
35
+ size = _ref.size,
36
+ children = _ref.children;
37
+ invariant(asAllowlist.includes(Component), "@atlaskit/primitives: MetricText received an invalid \"as\" value of \"".concat(Component, "\""));
38
+ var component = /*#__PURE__*/React.createElement(Component, {
39
+ ref: ref,
40
+ "data-testid": testId,
41
+ id: id,
42
+ className: ax([styles.root, size && fontSizeMap[size], align && styles["textAlign.".concat(align)]])
43
+ }, children);
44
+ return component;
45
+ });
46
+ export default MetricText;
@@ -5,6 +5,7 @@ export { default as Flex } from './components/flex';
5
5
  export { default as Grid } from './components/grid';
6
6
  export { default as Bleed } from './components/bleed';
7
7
  export { default as Text } from './components/text';
8
+ export { default as MetricText } from './components/metric-text';
8
9
  export { default as Pressable } from './components/pressable';
9
10
  export { default as Anchor } from './components/anchor';
10
11
  export { media, UNSAFE_useMediaQuery, Show, Hide } from './responsive';
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { forwardRef } from 'react';
6
+
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
+ import { css, jsx } from '@emotion/react';
9
+ import invariant from 'tiny-invariant';
10
+ import { metricTextSizeStylesMap } from '../xcss/style-maps.partial';
11
+ var asAllowlist = ['span', 'div'];
12
+ // We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
13
+ // Long term we should remove those instances from the reset - it should be a reset to 0.
14
+ // For now, at least we know <MetricText> will be unaffected by this.
15
+ var resetStyles = css({
16
+ margin: 0
17
+ });
18
+ var textAlignMap = {
19
+ center: css({
20
+ textAlign: 'center'
21
+ }),
22
+ end: css({
23
+ textAlign: 'end'
24
+ }),
25
+ start: css({
26
+ textAlign: 'start'
27
+ })
28
+ };
29
+
30
+ /**
31
+ * __MetricText__
32
+ *
33
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
34
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
35
+ * It renders a `span` by default.
36
+ *
37
+ * @internal
38
+ */
39
+ var MetricText = /*#__PURE__*/forwardRef(function (_ref, ref) {
40
+ var _ref$as = _ref.as,
41
+ Component = _ref$as === void 0 ? 'span' : _ref$as,
42
+ align = _ref.align,
43
+ testId = _ref.testId,
44
+ id = _ref.id,
45
+ size = _ref.size,
46
+ children = _ref.children;
47
+ invariant(asAllowlist.includes(Component), "@atlaskit/primitives: MetricText received an invalid \"as\" value of \"".concat(Component, "\""));
48
+ var component = jsx(Component, {
49
+ ref: ref,
50
+ css: [resetStyles,
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
52
+ size && metricTextSizeStylesMap[size], align && textAlignMap[align]],
53
+ "data-testid": testId,
54
+ id: id
55
+ }, children);
56
+ return component;
57
+ });
58
+ export default MetricText;
package/dist/esm/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as Flex } from './components/flex';
6
6
  export { default as Grid } from './components/grid';
7
7
  export { default as Bleed } from './components/bleed';
8
8
  export { default as Text } from './components/text';
9
+ export { default as MetricText } from './components/metric-text';
9
10
  export { default as Pressable } from './components/pressable';
10
11
  export { default as Anchor } from './components/anchor';
11
12
  export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
@@ -496,7 +496,7 @@ export var borderRadiusMap = {
496
496
 
497
497
  /**
498
498
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
499
- * @codegen <<SignedSource::b2a06338babbfbea48ed2205e34084fc>>
499
+ * @codegen <<SignedSource::2c0cffbebdab4e28fe2b45925623e523>>
500
500
  * @codegenId typography
501
501
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
502
502
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -515,7 +515,10 @@ export var fontMap = {
515
515
  'font.heading.xlarge': "var(--ds-font-heading-xlarge, normal 600 29px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
516
516
  'font.heading.xsmall': "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
517
517
  'font.heading.xxlarge': "var(--ds-font-heading-xxlarge, normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
518
- 'font.heading.xxsmall': "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
518
+ 'font.heading.xxsmall': "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
519
+ 'font.metric.large': "var(--ds-font-metric-large, normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
520
+ 'font.metric.medium': "var(--ds-font-metric-medium, normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
521
+ 'font.metric.small': "var(--ds-font-metric-small, normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
519
522
  };
520
523
  export var fontWeightMap = {
521
524
  'font.weight.bold': "var(--ds-font-weight-bold, 700)",
@@ -536,7 +539,7 @@ export var fontFamilyMap = {
536
539
 
537
540
  /**
538
541
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
539
- * @codegen <<SignedSource::159df661d29a2805a17ab6f52e842350>>
542
+ * @codegen <<SignedSource::c207cc4caf0794de5f13707a9c28451f>>
540
543
  * @codegenId text
541
544
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
542
545
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -554,6 +557,11 @@ export var textWeightMap = {
554
557
  regular: "var(--ds-font-weight-regular, 400)",
555
558
  semibold: "var(--ds-font-weight-semibold, 600)"
556
559
  };
560
+ export var metricTextSizeMap = {
561
+ large: "var(--ds-font-metric-large, normal 653 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
562
+ medium: "var(--ds-font-metric-medium, normal 653 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
563
+ small: "var(--ds-font-metric-small, normal 653 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
564
+ };
557
565
 
558
566
  /**
559
567
  * @codegenEnd
@@ -592,4 +600,5 @@ export var textWeightStylesMap = getSerializedStylesMap('fontWeight', textWeight
592
600
  export var surfaceColorStylesMap = getSerializedStylesMap(CURRENT_SURFACE_CSS_VAR, surfaceColorMap);
593
601
  export var isSurfaceColorToken = function isSurfaceColorToken(color) {
594
602
  return surfaceColorMap[color] !== undefined;
595
- };
603
+ };
604
+ export var metricTextSizeStylesMap = getSerializedStylesMap('font', metricTextSizeMap);
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
+ import type { BasePrimitiveProps, MetricTextFontSize, TextAlign } from './types';
7
+ declare const asAllowlist: readonly ["span", "div"];
8
+ type AsElement = (typeof asAllowlist)[number];
9
+ type MetricTextPropsBase<T extends ElementType = 'span'> = {
10
+ /**
11
+ * HTML tag to be rendered. Defaults to `span`.
12
+ */
13
+ as?: AsElement;
14
+ /**
15
+ * Elements rendered within the Text element.
16
+ */
17
+ children: ReactNode;
18
+ /**
19
+ * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
20
+ */
21
+ id?: string;
22
+ /**
23
+ * Text alignment.
24
+ */
25
+ align?: TextAlign;
26
+ /**
27
+ * Text size.
28
+ */
29
+ size: MetricTextFontSize;
30
+ /**
31
+ * Forwarded ref.
32
+ */
33
+ ref?: ComponentPropsWithRef<T>['ref'];
34
+ };
35
+ export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
36
+ /**
37
+ * __MetricText__
38
+ *
39
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
40
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
41
+ * It renders a `span` by default.
42
+ *
43
+ * @internal
44
+ */
45
+ declare const MetricText: import("react").ForwardRefExoticComponent<Omit<MetricTextProps<ElementType>, "ref"> & import("react").RefAttributes<any>>;
46
+ export default MetricText;
@@ -9,7 +9,7 @@ export type StackProps<T extends ElementType = 'div'> = {
9
9
  /**
10
10
  * The DOM element to render as the Stack. Defaults to `div`.
11
11
  */
12
- as?: 'div' | 'span' | 'ul' | 'ol';
12
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'dl';
13
13
  /**
14
14
  * Used to align children along the block axis (typically vertical).
15
15
  */
@@ -42,3 +42,4 @@ 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
43
  export type FontSize = 'small' | 'medium' | 'UNSAFE_small' | 'large';
44
44
  export type FontWeight = 'bold' | 'medium' | 'regular' | 'semibold';
45
+ export type MetricTextFontSize = 'small' | 'medium' | 'large';
@@ -5,6 +5,7 @@ export { default as Flex, type FlexProps } from './components/flex';
5
5
  export { default as Grid, type GridProps } from './components/grid';
6
6
  export { default as Bleed, type BleedProps } from './components/bleed';
7
7
  export { default as Text, type TextProps } from './components/text';
8
+ export { default as MetricText, type MetricTextProps } from './components/metric-text';
8
9
  export { default as Pressable, type PressableProps } from './components/pressable';
9
10
  export { default as Anchor, type AnchorProps } from './components/anchor';
10
11
  export { media, type Breakpoint, type MediaQuery, UNSAFE_useMediaQuery, Show, Hide, } from './responsive';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
+ import { type MetricTextSize } from '../xcss/style-maps.partial';
7
+ import type { BasePrimitiveProps } from './types';
8
+ declare const asAllowlist: readonly ["span", "div"];
9
+ type AsElement = (typeof asAllowlist)[number];
10
+ type MetricTextPropsBase<T extends ElementType = 'span'> = {
11
+ /**
12
+ * HTML tag to be rendered. Defaults to `span`.
13
+ */
14
+ as?: AsElement;
15
+ /**
16
+ * Elements rendered within the Text element.
17
+ */
18
+ children: ReactNode;
19
+ /**
20
+ * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
21
+ */
22
+ id?: string;
23
+ /**
24
+ * Text alignment.
25
+ */
26
+ align?: TextAlign;
27
+ /**
28
+ * Text size.
29
+ */
30
+ size: MetricTextSize;
31
+ /**
32
+ * Forwarded ref.
33
+ */
34
+ ref?: ComponentPropsWithRef<T>['ref'];
35
+ };
36
+ export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
37
+ type TextAlign = keyof typeof textAlignMap;
38
+ declare const textAlignMap: {
39
+ center: import("@emotion/react").SerializedStyles;
40
+ end: import("@emotion/react").SerializedStyles;
41
+ start: import("@emotion/react").SerializedStyles;
42
+ };
43
+ /**
44
+ * __MetricText__
45
+ *
46
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
47
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
48
+ * It renders a `span` by default.
49
+ *
50
+ * @internal
51
+ */
52
+ declare const MetricText: import("react").ForwardRefExoticComponent<Omit<MetricTextProps<ElementType>, "ref"> & import("react").RefAttributes<any>>;
53
+ export default MetricText;
@@ -15,6 +15,8 @@ export { default as Bleed } from './components/bleed';
15
15
  export type { BleedProps } from './components/bleed';
16
16
  export { default as Text } from './components/text';
17
17
  export type { TextProps } from './components/text';
18
+ export { default as MetricText } from './components/metric-text';
19
+ export type { MetricTextProps } from './components/metric-text';
18
20
  export { default as Pressable } from './components/pressable';
19
21
  export type { PressableProps } from './components/pressable';
20
22
  export { default as Anchor } from './components/anchor';
@@ -521,7 +521,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
521
521
  */
522
522
  /**
523
523
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
524
- * @codegen <<SignedSource::b2a06338babbfbea48ed2205e34084fc>>
524
+ * @codegen <<SignedSource::2c0cffbebdab4e28fe2b45925623e523>>
525
525
  * @codegenId typography
526
526
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
527
527
  * @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
@@ -541,6 +541,9 @@ export declare const fontMap: {
541
541
  'font.heading.xsmall': "var(--ds-font-heading-xsmall)";
542
542
  'font.heading.xxlarge': "var(--ds-font-heading-xxlarge)";
543
543
  'font.heading.xxsmall': "var(--ds-font-heading-xxsmall)";
544
+ 'font.metric.large': "var(--ds-font-metric-large)";
545
+ 'font.metric.medium': "var(--ds-font-metric-medium)";
546
+ 'font.metric.small': "var(--ds-font-metric-small)";
544
547
  };
545
548
  export type Font = keyof typeof fontMap;
546
549
  export declare const fontWeightMap: {
@@ -563,7 +566,7 @@ export type FontFamily = keyof typeof fontFamilyMap;
563
566
  */
564
567
  /**
565
568
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
566
- * @codegen <<SignedSource::159df661d29a2805a17ab6f52e842350>>
569
+ * @codegen <<SignedSource::c207cc4caf0794de5f13707a9c28451f>>
567
570
  * @codegenId text
568
571
  * @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
569
572
  * @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
@@ -583,6 +586,12 @@ export declare const textWeightMap: {
583
586
  semibold: "var(--ds-font-weight-semibold)";
584
587
  };
585
588
  export type TextWeight = keyof typeof textWeightMap;
589
+ export declare const metricTextSizeMap: {
590
+ large: "var(--ds-font-metric-large)";
591
+ medium: "var(--ds-font-metric-medium)";
592
+ small: "var(--ds-font-metric-small)";
593
+ };
594
+ export type MetricTextSize = keyof typeof metricTextSizeMap;
586
595
  /**
587
596
  * @codegenEnd
588
597
  */
@@ -699,6 +708,7 @@ type FontFamilyToken = keyof typeof fontFamilyMap;
699
708
  type FontToken = keyof typeof fontMap;
700
709
  type TextWeightToken = keyof typeof textWeightMap;
701
710
  type TextSizeToken = keyof typeof textSizeMap;
711
+ type MetricTextSizeToken = keyof typeof metricTextSizeMap;
702
712
  type SpacingStyleMap = Record<SpacingProperty, Record<SpacingToken, SerializedStyles>>;
703
713
  type BackgroundColorStyleMap = Record<BackgroundColorToken, SerializedStyles>;
704
714
  type SurfaceColorStyleMap = Record<SurfaceColorToken, SerializedStyles>;
@@ -708,6 +718,7 @@ type FontFamilyStyleMap = Record<FontFamilyToken, SerializedStyles>;
708
718
  type FontStyleMap = Record<FontToken, SerializedStyles>;
709
719
  type TextWeightStyleMap = Record<TextWeightToken, SerializedStyles>;
710
720
  type TextStyleMap = Record<TextSizeToken, SerializedStyles>;
721
+ type MetricTextStyleMap = Record<MetricTextSizeToken, SerializedStyles>;
711
722
  export declare const paddingStylesMap: SpacingStyleMap;
712
723
  export declare const spaceStylesMap: SpacingStyleMap;
713
724
  export declare const backgroundColorStylesMap: BackgroundColorStyleMap;
@@ -719,4 +730,5 @@ export declare const textSizeStylesMap: TextStyleMap;
719
730
  export declare const textWeightStylesMap: TextWeightStyleMap;
720
731
  export declare const surfaceColorStylesMap: SurfaceColorStyleMap;
721
732
  export declare const isSurfaceColorToken: (color: unknown) => color is "elevation.surface" | "elevation.surface.hovered" | "elevation.surface.pressed" | "elevation.surface.overlay" | "elevation.surface.overlay.hovered" | "elevation.surface.overlay.pressed" | "elevation.surface.raised" | "elevation.surface.raised.hovered" | "elevation.surface.raised.pressed" | "elevation.surface.sunken";
733
+ export declare const metricTextSizeStylesMap: MetricTextStyleMap;
722
734
  export {};
@@ -735,6 +735,9 @@ export declare const tokensMap: {
735
735
  'font.heading.xsmall': "var(--ds-font-heading-xsmall)";
736
736
  'font.heading.xxlarge': "var(--ds-font-heading-xxlarge)";
737
737
  'font.heading.xxsmall': "var(--ds-font-heading-xxsmall)";
738
+ 'font.metric.large': "var(--ds-font-metric-large)";
739
+ 'font.metric.medium': "var(--ds-font-metric-medium)";
740
+ 'font.metric.small': "var(--ds-font-metric-small)";
738
741
  };
739
742
  readonly fontFamily: {
740
743
  'font.family.body': "var(--ds-font-family-body)";
@@ -1682,7 +1685,7 @@ type AllMedia = MediaQuery | '@media screen and (forced-colors: active), screen
1682
1685
  type CSSMediaQueries = {
1683
1686
  [MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
1684
1687
  };
1685
- type ChainedCSSPseudos = ':visited:active' | ':visited:hover' | ':active:visited' | ':hover::before' | ':hover::after' | ':focus-visible::before' | ':focus-visible::after' | ':focus:not(:focus-visible)';
1688
+ type ChainedCSSPseudos = ':visited:active' | ':visited:hover' | ':active:visited' | ':hover::before' | ':focus::before' | ':hover::after' | ':focus-visible::before' | ':focus-visible::after' | ':focus:not(:focus-visible)';
1686
1689
  type CSSPseudos = {
1687
1690
  [Pseudo in CSS.Pseudos | ChainedCSSPseudos]?: Omit<SafeCSSObject, CSS.Pseudos | AllMedia>;
1688
1691
  };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
+ import type { BasePrimitiveProps, MetricTextFontSize, TextAlign } from './types';
7
+ declare const asAllowlist: readonly [
8
+ "span",
9
+ "div"
10
+ ];
11
+ type AsElement = (typeof asAllowlist)[number];
12
+ type MetricTextPropsBase<T extends ElementType = 'span'> = {
13
+ /**
14
+ * HTML tag to be rendered. Defaults to `span`.
15
+ */
16
+ as?: AsElement;
17
+ /**
18
+ * Elements rendered within the Text element.
19
+ */
20
+ children: ReactNode;
21
+ /**
22
+ * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
23
+ */
24
+ id?: string;
25
+ /**
26
+ * Text alignment.
27
+ */
28
+ align?: TextAlign;
29
+ /**
30
+ * Text size.
31
+ */
32
+ size: MetricTextFontSize;
33
+ /**
34
+ * Forwarded ref.
35
+ */
36
+ ref?: ComponentPropsWithRef<T>['ref'];
37
+ };
38
+ export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
39
+ /**
40
+ * __MetricText__
41
+ *
42
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
43
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
44
+ * It renders a `span` by default.
45
+ *
46
+ * @internal
47
+ */
48
+ declare const MetricText: import("react").ForwardRefExoticComponent<Omit<MetricTextProps<ElementType>, "ref"> & import("react").RefAttributes<any>>;
49
+ export default MetricText;
@@ -9,7 +9,7 @@ export type StackProps<T extends ElementType = 'div'> = {
9
9
  /**
10
10
  * The DOM element to render as the Stack. Defaults to `div`.
11
11
  */
12
- as?: 'div' | 'span' | 'ul' | 'ol';
12
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'dl';
13
13
  /**
14
14
  * Used to align children along the block axis (typically vertical).
15
15
  */
@@ -42,3 +42,4 @@ 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
43
  export type FontSize = 'small' | 'medium' | 'UNSAFE_small' | 'large';
44
44
  export type FontWeight = 'bold' | 'medium' | 'regular' | 'semibold';
45
+ export type MetricTextFontSize = 'small' | 'medium' | 'large';
@@ -5,6 +5,7 @@ export { default as Flex, type FlexProps } from './components/flex';
5
5
  export { default as Grid, type GridProps } from './components/grid';
6
6
  export { default as Bleed, type BleedProps } from './components/bleed';
7
7
  export { default as Text, type TextProps } from './components/text';
8
+ export { default as MetricText, type MetricTextProps } from './components/metric-text';
8
9
  export { default as Pressable, type PressableProps } from './components/pressable';
9
10
  export { default as Anchor, type AnchorProps } from './components/anchor';
10
11
  export { media, type Breakpoint, type MediaQuery, UNSAFE_useMediaQuery, Show, Hide, } from './responsive';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
+ import { type MetricTextSize } from '../xcss/style-maps.partial';
7
+ import type { BasePrimitiveProps } from './types';
8
+ declare const asAllowlist: readonly [
9
+ "span",
10
+ "div"
11
+ ];
12
+ type AsElement = (typeof asAllowlist)[number];
13
+ type MetricTextPropsBase<T extends ElementType = 'span'> = {
14
+ /**
15
+ * HTML tag to be rendered. Defaults to `span`.
16
+ */
17
+ as?: AsElement;
18
+ /**
19
+ * Elements rendered within the Text element.
20
+ */
21
+ children: ReactNode;
22
+ /**
23
+ * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
24
+ */
25
+ id?: string;
26
+ /**
27
+ * Text alignment.
28
+ */
29
+ align?: TextAlign;
30
+ /**
31
+ * Text size.
32
+ */
33
+ size: MetricTextSize;
34
+ /**
35
+ * Forwarded ref.
36
+ */
37
+ ref?: ComponentPropsWithRef<T>['ref'];
38
+ };
39
+ export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
40
+ type TextAlign = keyof typeof textAlignMap;
41
+ declare const textAlignMap: {
42
+ center: import("@emotion/react").SerializedStyles;
43
+ end: import("@emotion/react").SerializedStyles;
44
+ start: import("@emotion/react").SerializedStyles;
45
+ };
46
+ /**
47
+ * __MetricText__
48
+ *
49
+ * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
50
+ * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
51
+ * It renders a `span` by default.
52
+ *
53
+ * @internal
54
+ */
55
+ declare const MetricText: import("react").ForwardRefExoticComponent<Omit<MetricTextProps<ElementType>, "ref"> & import("react").RefAttributes<any>>;
56
+ export default MetricText;
@@ -15,6 +15,8 @@ export { default as Bleed } from './components/bleed';
15
15
  export type { BleedProps } from './components/bleed';
16
16
  export { default as Text } from './components/text';
17
17
  export type { TextProps } from './components/text';
18
+ export { default as MetricText } from './components/metric-text';
19
+ export type { MetricTextProps } from './components/metric-text';
18
20
  export { default as Pressable } from './components/pressable';
19
21
  export type { PressableProps } from './components/pressable';
20
22
  export { default as Anchor } from './components/anchor';