@atlaskit/primitives 12.2.6 → 13.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 (150) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/compiled/package.json +15 -0
  3. package/dist/cjs/compiled/components/anchor.compiled.css +12 -0
  4. package/dist/cjs/compiled/components/anchor.js +130 -0
  5. package/dist/cjs/compiled/components/bleed.compiled.css +11 -0
  6. package/dist/cjs/compiled/components/bleed.js +49 -0
  7. package/dist/cjs/compiled/components/box.compiled.css +266 -0
  8. package/dist/cjs/compiled/components/box.js +367 -0
  9. package/dist/cjs/compiled/components/flex.compiled.css +46 -0
  10. package/dist/cjs/compiled/components/flex.js +119 -0
  11. package/dist/cjs/compiled/components/grid.compiled.css +54 -0
  12. package/dist/cjs/compiled/components/grid.js +129 -0
  13. package/dist/cjs/compiled/components/inline.compiled.css +8 -0
  14. package/dist/cjs/compiled/components/inline.js +83 -0
  15. package/dist/cjs/compiled/components/internal/surface-provider.js +25 -0
  16. package/dist/cjs/compiled/components/internal/types.js +1 -0
  17. package/dist/cjs/compiled/components/pressable.compiled.css +13 -0
  18. package/dist/cjs/compiled/components/pressable.js +87 -0
  19. package/dist/cjs/compiled/components/stack.compiled.css +3 -0
  20. package/dist/cjs/compiled/components/stack.js +64 -0
  21. package/dist/cjs/compiled/components/text.compiled.css +60 -0
  22. package/dist/cjs/compiled/components/text.js +177 -0
  23. package/dist/cjs/compiled/components/types.js +5 -0
  24. package/dist/cjs/compiled/index.js +83 -0
  25. package/dist/cjs/compiled/responsive/hide.compiled.css +11 -0
  26. package/dist/cjs/compiled/responsive/hide.js +46 -0
  27. package/dist/cjs/compiled/responsive/index.js +33 -0
  28. package/dist/cjs/compiled/responsive/media-helper.js +42 -0
  29. package/dist/cjs/compiled/responsive/show.compiled.css +11 -0
  30. package/dist/cjs/compiled/responsive/show.js +47 -0
  31. package/dist/cjs/compiled/responsive/types.js +5 -0
  32. package/dist/cjs/compiled/responsive/use-media-query.js +77 -0
  33. package/dist/cjs/components/anchor.js +1 -1
  34. package/dist/cjs/components/pressable.js +1 -1
  35. package/dist/cjs/index.js +0 -6
  36. package/dist/cjs/xcss/style-maps.partial.js +7 -6
  37. package/dist/es2019/compiled/components/anchor.compiled.css +12 -0
  38. package/dist/es2019/compiled/components/anchor.js +117 -0
  39. package/dist/es2019/compiled/components/bleed.compiled.css +11 -0
  40. package/dist/es2019/compiled/components/bleed.js +43 -0
  41. package/dist/es2019/compiled/components/box.compiled.css +266 -0
  42. package/dist/es2019/compiled/components/box.js +351 -0
  43. package/dist/es2019/compiled/components/flex.compiled.css +46 -0
  44. package/dist/es2019/compiled/components/flex.js +110 -0
  45. package/dist/es2019/compiled/components/grid.compiled.css +54 -0
  46. package/dist/es2019/compiled/components/grid.js +121 -0
  47. package/dist/es2019/compiled/components/inline.compiled.css +8 -0
  48. package/dist/es2019/compiled/components/inline.js +71 -0
  49. package/dist/es2019/compiled/components/internal/surface-provider.js +19 -0
  50. package/dist/es2019/compiled/components/internal/types.js +0 -0
  51. package/dist/es2019/compiled/components/pressable.compiled.css +13 -0
  52. package/dist/es2019/compiled/components/pressable.js +75 -0
  53. package/dist/es2019/compiled/components/stack.compiled.css +3 -0
  54. package/dist/es2019/compiled/components/stack.js +54 -0
  55. package/dist/es2019/compiled/components/text.compiled.css +60 -0
  56. package/dist/es2019/compiled/components/text.js +164 -0
  57. package/dist/es2019/compiled/components/types.js +1 -0
  58. package/dist/es2019/compiled/index.js +13 -0
  59. package/dist/es2019/compiled/responsive/hide.compiled.css +11 -0
  60. package/dist/es2019/compiled/responsive/hide.js +37 -0
  61. package/dist/es2019/compiled/responsive/index.js +4 -0
  62. package/dist/es2019/compiled/responsive/media-helper.js +36 -0
  63. package/dist/es2019/compiled/responsive/show.compiled.css +11 -0
  64. package/dist/es2019/compiled/responsive/show.js +38 -0
  65. package/dist/es2019/compiled/responsive/types.js +1 -0
  66. package/dist/es2019/compiled/responsive/use-media-query.js +71 -0
  67. package/dist/es2019/components/anchor.js +1 -1
  68. package/dist/es2019/components/pressable.js +1 -1
  69. package/dist/es2019/index.js +1 -1
  70. package/dist/es2019/xcss/style-maps.partial.js +7 -6
  71. package/dist/esm/compiled/components/anchor.compiled.css +12 -0
  72. package/dist/esm/compiled/components/anchor.js +120 -0
  73. package/dist/esm/compiled/components/bleed.compiled.css +11 -0
  74. package/dist/esm/compiled/components/bleed.js +42 -0
  75. package/dist/esm/compiled/components/box.compiled.css +266 -0
  76. package/dist/esm/compiled/components/box.js +358 -0
  77. package/dist/esm/compiled/components/flex.compiled.css +46 -0
  78. package/dist/esm/compiled/components/flex.js +110 -0
  79. package/dist/esm/compiled/components/grid.compiled.css +54 -0
  80. package/dist/esm/compiled/components/grid.js +120 -0
  81. package/dist/esm/compiled/components/inline.compiled.css +8 -0
  82. package/dist/esm/compiled/components/inline.js +73 -0
  83. package/dist/esm/compiled/components/internal/surface-provider.js +19 -0
  84. package/dist/esm/compiled/components/internal/types.js +0 -0
  85. package/dist/esm/compiled/components/pressable.compiled.css +13 -0
  86. package/dist/esm/compiled/components/pressable.js +77 -0
  87. package/dist/esm/compiled/components/stack.compiled.css +3 -0
  88. package/dist/esm/compiled/components/stack.js +54 -0
  89. package/dist/esm/compiled/components/text.compiled.css +60 -0
  90. package/dist/esm/compiled/components/text.js +167 -0
  91. package/dist/esm/compiled/components/types.js +1 -0
  92. package/dist/esm/compiled/index.js +13 -0
  93. package/dist/esm/compiled/responsive/hide.compiled.css +11 -0
  94. package/dist/esm/compiled/responsive/hide.js +37 -0
  95. package/dist/esm/compiled/responsive/index.js +4 -0
  96. package/dist/esm/compiled/responsive/media-helper.js +36 -0
  97. package/dist/esm/compiled/responsive/show.compiled.css +11 -0
  98. package/dist/esm/compiled/responsive/show.js +38 -0
  99. package/dist/esm/compiled/responsive/types.js +1 -0
  100. package/dist/esm/compiled/responsive/use-media-query.js +71 -0
  101. package/dist/esm/components/anchor.js +1 -1
  102. package/dist/esm/components/pressable.js +1 -1
  103. package/dist/esm/index.js +1 -1
  104. package/dist/esm/xcss/style-maps.partial.js +7 -6
  105. package/dist/types/compiled/components/anchor.d.ts +63 -0
  106. package/dist/types/compiled/components/bleed.d.ts +34 -0
  107. package/dist/types/compiled/components/box.d.ts +105 -0
  108. package/dist/types/compiled/components/flex.d.ts +111 -0
  109. package/dist/types/compiled/components/grid.d.ts +131 -0
  110. package/dist/types/compiled/components/inline.d.ts +116 -0
  111. package/dist/types/compiled/components/internal/surface-provider.d.ts +16 -0
  112. package/dist/types/compiled/components/internal/types.d.ts +5 -0
  113. package/dist/types/compiled/components/pressable.d.ts +49 -0
  114. package/dist/types/compiled/components/stack.d.ts +90 -0
  115. package/dist/types/compiled/components/text.d.ts +91 -0
  116. package/dist/types/compiled/components/types.d.ts +45 -0
  117. package/dist/types/compiled/index.d.ts +12 -0
  118. package/dist/types/compiled/responsive/hide.d.ts +39 -0
  119. package/dist/types/compiled/responsive/index.d.ts +5 -0
  120. package/dist/types/compiled/responsive/media-helper.d.ts +35 -0
  121. package/dist/types/compiled/responsive/show.d.ts +39 -0
  122. package/dist/types/compiled/responsive/types.d.ts +10 -0
  123. package/dist/types/compiled/responsive/use-media-query.d.ts +23 -0
  124. package/dist/types/index.d.ts +1 -1
  125. package/dist/types/xcss/style-maps.partial.d.ts +7 -6
  126. package/dist/types/xcss/xcss.d.ts +1 -0
  127. package/dist/types-ts4.5/compiled/components/anchor.d.ts +63 -0
  128. package/dist/types-ts4.5/compiled/components/bleed.d.ts +34 -0
  129. package/dist/types-ts4.5/compiled/components/box.d.ts +105 -0
  130. package/dist/types-ts4.5/compiled/components/flex.d.ts +111 -0
  131. package/dist/types-ts4.5/compiled/components/grid.d.ts +131 -0
  132. package/dist/types-ts4.5/compiled/components/inline.d.ts +116 -0
  133. package/dist/types-ts4.5/compiled/components/internal/surface-provider.d.ts +16 -0
  134. package/dist/types-ts4.5/compiled/components/internal/types.d.ts +5 -0
  135. package/dist/types-ts4.5/compiled/components/pressable.d.ts +49 -0
  136. package/dist/types-ts4.5/compiled/components/stack.d.ts +90 -0
  137. package/dist/types-ts4.5/compiled/components/text.d.ts +96 -0
  138. package/dist/types-ts4.5/compiled/components/types.d.ts +45 -0
  139. package/dist/types-ts4.5/compiled/index.d.ts +12 -0
  140. package/dist/types-ts4.5/compiled/responsive/hide.d.ts +39 -0
  141. package/dist/types-ts4.5/compiled/responsive/index.d.ts +5 -0
  142. package/dist/types-ts4.5/compiled/responsive/media-helper.d.ts +35 -0
  143. package/dist/types-ts4.5/compiled/responsive/show.d.ts +39 -0
  144. package/dist/types-ts4.5/compiled/responsive/types.d.ts +10 -0
  145. package/dist/types-ts4.5/compiled/responsive/use-media-query.d.ts +23 -0
  146. package/dist/types-ts4.5/index.d.ts +1 -1
  147. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +7 -6
  148. package/dist/types-ts4.5/xcss/xcss.d.ts +1 -0
  149. package/package.json +4 -2
  150. package/scripts/codegen-file-templates/layer.tsx +1 -0
@@ -0,0 +1,120 @@
1
+ /* grid.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./grid.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { forwardRef, memo } from 'react';
6
+ var rowGapMap = {
7
+ 'space.0': "_1p57ze3t",
8
+ 'space.025': "_1p57v77o",
9
+ 'space.050': "_1p571b66",
10
+ 'space.075': "_1p5712x7",
11
+ 'space.100': "_1p57u2gc",
12
+ 'space.150': "_1p57utpp",
13
+ 'space.200': "_1p57pxbi",
14
+ 'space.250': "_1p57v47k",
15
+ 'space.300': "_1p571ejb",
16
+ 'space.400': "_1p57xy5q",
17
+ 'space.500': "_1p571jfw",
18
+ 'space.600': "_1p57oahv",
19
+ 'space.800': "_1p57xncg",
20
+ 'space.1000': "_1p571epz"
21
+ };
22
+ var columnGapMap = {
23
+ 'space.0': "_gy1pze3t",
24
+ 'space.025': "_gy1pv77o",
25
+ 'space.050': "_gy1p1b66",
26
+ 'space.075': "_gy1p12x7",
27
+ 'space.100': "_gy1pu2gc",
28
+ 'space.150': "_gy1putpp",
29
+ 'space.200': "_gy1ppxbi",
30
+ 'space.250': "_gy1pv47k",
31
+ 'space.300': "_gy1p1ejb",
32
+ 'space.400': "_gy1pxy5q",
33
+ 'space.500': "_gy1p1jfw",
34
+ 'space.600': "_gy1poahv",
35
+ 'space.800': "_gy1pxncg",
36
+ 'space.1000': "_gy1p1epz"
37
+ };
38
+ var justifyContentMap = {
39
+ start: "_1bahv2br",
40
+ center: "_1bah1h6o",
41
+ end: "_1bahh9n0",
42
+ 'space-between': "_1bah1yb4",
43
+ 'space-around': "_1bah1b1v",
44
+ 'space-evenly': "_1bahitcz",
45
+ stretch: "_1bah1fhb"
46
+ };
47
+ var alignContentMap = {
48
+ start: "_ae4vv2br",
49
+ center: "_ae4v1h6o",
50
+ end: "_ae4vh9n0",
51
+ 'space-between': "_ae4v1yb4",
52
+ 'space-around': "_ae4v1b1v",
53
+ 'space-evenly': "_ae4vitcz",
54
+ stretch: "_ae4v1fhb"
55
+ };
56
+ var alignItemsMap = {
57
+ start: "_4cvrv2br",
58
+ center: "_4cvr1h6o",
59
+ baseline: "_4cvr1q9y",
60
+ end: "_4cvrh9n0",
61
+ stretch: "_4cvr1fhb"
62
+ };
63
+ var baseStyles = {
64
+ root: "_1e0c11p5 _vchhusvi"
65
+ };
66
+ var gridAutoFlowMap = {
67
+ row: "_wij2vrvc",
68
+ column: "_wij21bp4",
69
+ dense: "_wij218l3",
70
+ 'row dense': "_wij2j5tq",
71
+ 'column dense': "_wij2adhi"
72
+ };
73
+
74
+ /**
75
+ * __Grid__
76
+ *
77
+ * `Grid` is a primitive component that implements the CSS Grid API.
78
+ *
79
+ * - [Examples](https://atlassian.design/components/primitives/grid/examples)
80
+ * - [Code](https://atlassian.design/components/primitives/grid/code)
81
+ *
82
+ * @example
83
+ * ```tsx
84
+ * import { Grid, Box } from '@atlaskit/primitives'
85
+ *
86
+ * const Component = () => (
87
+ * <Grid gap="space.100" gridColumns="1fr 1fr">
88
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
89
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
90
+ * </Grid>
91
+ * )
92
+ * ```
93
+ */
94
+ var Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
95
+ var as = _ref.as,
96
+ alignItems = _ref.alignItems,
97
+ alignContent = _ref.alignContent,
98
+ justifyContent = _ref.justifyContent,
99
+ gap = _ref.gap,
100
+ columnGap = _ref.columnGap,
101
+ rowGap = _ref.rowGap,
102
+ children = _ref.children,
103
+ id = _ref.id,
104
+ role = _ref.role,
105
+ testId = _ref.testId,
106
+ autoFlow = _ref.autoFlow,
107
+ xcss = _ref.xcss;
108
+ var Component = as || 'div';
109
+ return /*#__PURE__*/React.createElement(Component, {
110
+ id: id,
111
+ role: role
112
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
113
+ ,
114
+ className: ax([baseStyles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], xcss]),
115
+ "data-testid": testId,
116
+ ref: ref
117
+ }, children);
118
+ }));
119
+ Grid.displayName = 'Grid';
120
+ export default Grid;
@@ -0,0 +1,8 @@
1
+
2
+ ._195g1i6y{margin-inline:var(--ds-space-negative-025,-2px)}
3
+ ._1mouze3t{margin-block:var(--ds-space-0,0)}._16jlidpf{flex-grow:0}
4
+ ._16jlkb7n{flex-grow:1}
5
+ ._1bsb1osq{width:100%}
6
+ ._lcxvglyw{pointer-events:none}
7
+ ._syazjjyb{color:var(--ds-text-subtle,#42526e)}
8
+ ._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
@@ -0,0 +1,73 @@
1
+ /* inline.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./inline.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { Children, forwardRef, Fragment, memo } from 'react';
6
+ import { cx } from '@atlaskit/css';
7
+ import Flex from './flex';
8
+ var styles = {
9
+ separator: "_syazjjyb _1mouze3t _195g1i6y _lcxvglyw _uiztglyw",
10
+ hug: "_16jlidpf",
11
+ fill: "_1bsb1osq _16jlkb7n"
12
+ };
13
+ var Separator = function Separator(_ref) {
14
+ var children = _ref.children;
15
+ return /*#__PURE__*/React.createElement("span", {
16
+ className: ax([styles.separator])
17
+ }, children);
18
+ };
19
+
20
+ /**
21
+ * __Inline__
22
+ *
23
+ * Inline is a primitive component based on CSS Flexbox that manages the horizontal layout of direct children.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Inline>
28
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
29
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
30
+ * </Inline>
31
+ * ```
32
+ *
33
+ */
34
+ var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
35
+ var as = _ref2.as,
36
+ alignInline = _ref2.alignInline,
37
+ _ref2$alignBlock = _ref2.alignBlock,
38
+ alignItems = _ref2$alignBlock === void 0 ? 'start' : _ref2$alignBlock,
39
+ _ref2$shouldWrap = _ref2.shouldWrap,
40
+ shouldWrap = _ref2$shouldWrap === void 0 ? false : _ref2$shouldWrap,
41
+ spread = _ref2.spread,
42
+ grow = _ref2.grow,
43
+ space = _ref2.space,
44
+ rowSpace = _ref2.rowSpace,
45
+ separator = _ref2.separator,
46
+ xcss = _ref2.xcss,
47
+ testId = _ref2.testId,
48
+ role = _ref2.role,
49
+ rawChildren = _ref2.children;
50
+ var separatorComponent = typeof separator === 'string' ? /*#__PURE__*/React.createElement(Separator, null, separator) : separator;
51
+ var children = separatorComponent ? Children.toArray(rawChildren).filter(Boolean).map(function (child, index) {
52
+ return /*#__PURE__*/React.createElement(Fragment, {
53
+ key: index
54
+ }, separator && index > 0 ? separatorComponent : null, child);
55
+ }) : rawChildren;
56
+ return /*#__PURE__*/React.createElement(Flex, {
57
+ as: as,
58
+ role: role,
59
+ alignItems: alignItems,
60
+ justifyContent: spread || alignInline,
61
+ direction: "row",
62
+ gap: space,
63
+ rowGap: rowSpace,
64
+ wrap: shouldWrap ? 'wrap' : undefined,
65
+ xcss: cx(grow === 'hug' && styles.hug, grow === 'fill' && styles.fill,
66
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- TODO: We need to handle pass-through `xcss` => `xcss` here.
67
+ xcss),
68
+ testId: testId,
69
+ ref: ref
70
+ }, children);
71
+ }));
72
+ Inline.displayName = 'Inline';
73
+ export default Inline;
@@ -0,0 +1,19 @@
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
+
9
+ /**
10
+ * __useSurface__
11
+ *
12
+ * Return the current surface. If no parent sets a surface color it falls back to the default surface.
13
+ *
14
+ * @see SurfaceContext
15
+ */
16
+ export var useSurface = function useSurface() {
17
+ return useContext(SurfaceContext);
18
+ };
19
+ SurfaceContext.displayName = 'SurfaceProvider';
File without changes
@@ -0,0 +1,13 @@
1
+ ._19itglyw{border:none}
2
+ ._80om13gf{cursor:not-allowed}
3
+ ._80omtlke{cursor:pointer}
4
+ ._r06hglyw{-webkit-appearance:none;appearance:none}
5
+ ._vchhusvi{box-sizing:border-box}
6
+ ._ymio1r31:focus:not(:focus-visible){outline-color:currentColor}
7
+ ._ypr0glyw:focus:not(:focus-visible){outline-style:none}
8
+ ._zcxs1o36:focus:not(:focus-visible){outline-width:medium}
9
+ ._1bg4v77o:focus, ._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
10
+ ._1hvw1bk5:focus, ._128m1bk5:focus-visible{outline-width:var(--ds-border-width-outline,2px)}
11
+ ._49pcnqa1:focus, ._ra3xnqa1:focus-visible{outline-style:solid}
12
+ ._nt751p6i:focus, ._mizu1p6i:focus-visible{outline-color:var(--ds-border-focused,#388bff)}
13
+ @media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._qa7m1r31:focus-visible{outline-color:currentColor}._1cvmnqa1:focus-visible{outline-style:solid}._4davt94y:focus-visible{outline-width:1px}}
@@ -0,0 +1,77 @@
1
+ /* pressable.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss"],
5
+ _excluded2 = ["className"];
6
+ import "./pressable.compiled.css";
7
+ import * as React from 'react';
8
+ import { ax, ix } from "@compiled/react/runtime";
9
+ import { forwardRef, useCallback, useContext } from 'react';
10
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
+ import noop from '@atlaskit/ds-lib/noop';
12
+ import InteractionContext from '@atlaskit/interaction-context';
13
+ var styles = {
14
+ root: "_vchhusvi _r06hglyw _19itglyw _80omtlke",
15
+ disabled: "_80om13gf",
16
+ focusRing: "_ymio1r31 _ypr0glyw _zcxs1o36 _nt751p6i _mizu1p6i _1bg4v77o _1ah3v77o _49pcnqa1 _ra3xnqa1 _1hvw1bk5 _128m1bk5 _qa7m1r31 _1cvmnqa1 _4davt94y"
17
+ };
18
+
19
+ /**
20
+ * __Pressable__
21
+ *
22
+ * A primitive for building custom buttons.
23
+ *
24
+ * - [Examples](https://atlassian.design/components/primitives/pressable/examples)
25
+ * - [Code](https://atlassian.design/components/primitives/pressable/code)
26
+ * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
27
+ */
28
+ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
29
+ var children = _ref.children,
30
+ isDisabled = _ref.isDisabled,
31
+ _ref$type = _ref.type,
32
+ type = _ref$type === void 0 ? 'button' : _ref$type,
33
+ _ref$onClick = _ref.onClick,
34
+ providedOnClick = _ref$onClick === void 0 ? noop : _ref$onClick,
35
+ interactionName = _ref.interactionName,
36
+ componentName = _ref.componentName,
37
+ analyticsContext = _ref.analyticsContext,
38
+ style = _ref.style,
39
+ testId = _ref.testId,
40
+ xcss = _ref.xcss,
41
+ htmlAttributes = _objectWithoutProperties(_ref, _excluded);
42
+ var interactionContext = useContext(InteractionContext);
43
+ var handleClick = useCallback(function (e, analyticsEvent) {
44
+ interactionContext && interactionContext.tracePress(interactionName, e.timeStamp);
45
+ providedOnClick(e, analyticsEvent);
46
+ }, [providedOnClick, interactionContext, interactionName]);
47
+ var onClick = usePlatformLeafEventHandler({
48
+ fn: handleClick,
49
+ action: 'clicked',
50
+ componentName: componentName || 'Pressable',
51
+ packageName: "@atlaskit/primitives",
52
+ packageVersion: "13.0.0",
53
+ analyticsData: analyticsContext,
54
+ actionSubject: 'button'
55
+ });
56
+
57
+ // This is to remove className from safeHtmlAttributes
58
+ // @ts-expect-error className doesn't exist in the prop definition but we want to ensure it cannot be applied even if types are bypassed
59
+ var _spreadClass = htmlAttributes.className,
60
+ safeHtmlAttributes = _objectWithoutProperties(htmlAttributes, _excluded2);
61
+ return /*#__PURE__*/React.createElement("button", _extends({
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
63
+ className: ax([styles.root, styles.focusRing, isDisabled && styles.disabled, xcss])
64
+ // 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
65
+ ,
66
+ style: style
67
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
68
+ }, safeHtmlAttributes, {
69
+ // eslint-disable-next-line react/button-has-type
70
+ type: type,
71
+ onClick: onClick,
72
+ disabled: isDisabled,
73
+ "data-testid": testId,
74
+ ref: ref
75
+ }), children);
76
+ });
77
+ export default Pressable;
@@ -0,0 +1,3 @@
1
+ ._16jlidpf{flex-grow:0}
2
+ ._16jlkb7n{flex-grow:1}
3
+ ._1bsb1osq{width:100%}
@@ -0,0 +1,54 @@
1
+ /* stack.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./stack.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { forwardRef, memo } from 'react';
6
+ import { cx } from '@atlaskit/css';
7
+ import Flex from './flex';
8
+ var styles = {
9
+ hug: "_16jlidpf",
10
+ fill: "_1bsb1osq _16jlkb7n"
11
+ };
12
+
13
+ /**
14
+ * __Stack__
15
+ *
16
+ * Stack is a primitive component based on flexbox that manages the block layout of direct children.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <Stack>
21
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
22
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
23
+ * </Stack>
24
+ * ```
25
+ *
26
+ */
27
+ var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
28
+ var as = _ref.as,
29
+ alignItems = _ref.alignInline,
30
+ _ref$alignBlock = _ref.alignBlock,
31
+ alignBlock = _ref$alignBlock === void 0 ? 'stretch' : _ref$alignBlock,
32
+ spread = _ref.spread,
33
+ grow = _ref.grow,
34
+ space = _ref.space,
35
+ children = _ref.children,
36
+ testId = _ref.testId,
37
+ xcss = _ref.xcss,
38
+ role = _ref.role;
39
+ return /*#__PURE__*/React.createElement(Flex, {
40
+ as: as,
41
+ role: role,
42
+ gap: space,
43
+ direction: "column",
44
+ alignItems: alignItems,
45
+ justifyContent: spread || alignBlock,
46
+ xcss: cx(grow === 'hug' && styles.hug, grow === 'fill' && styles.fill,
47
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- TODO: We need to handle pass-through `xcss` => `xcss` here.
48
+ xcss),
49
+ testId: testId,
50
+ ref: ref
51
+ }, children);
52
+ }));
53
+ Stack.displayName = 'Stack';
54
+ export default Stack;
@@ -0,0 +1,60 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._11c81vlj{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
4
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
5
+ ._18m915vq{overflow-y:hidden}
6
+ ._18u0idpf{margin-left:0}
7
+ ._19pkidpf{margin-top:0}
8
+ ._1e0ccj1k{display:-webkit-box}
9
+ ._1i4qfg65{overflow-wrap:anywhere}
10
+ ._1nmz9jpi{word-break:break-all}
11
+ ._1reo15vq{overflow-x:hidden}
12
+ ._2hwxidpf{margin-right:0}
13
+ ._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
14
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
15
+ ._k48p8n31{font-weight:bold}
16
+ ._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
17
+ ._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
18
+ ._otyridpf{margin-bottom:0}
19
+ ._sudp1e54{-webkit-box-orient:vertical}
20
+ ._syaz10m5{color:var(--ds-text-accent-purple,#5e4db2)}
21
+ ._syaz12v7{color:var(--ds-text-accent-teal-bolder,#164555)}
22
+ ._syaz131l{color:var(--ds-text-subtlest,#626f86)}
23
+ ._syaz14q2{color:var(--ds-link,#0c66e4)}
24
+ ._syaz15cr{color:var(--ds-text-inverse,#fff)}
25
+ ._syaz16c2{color:var(--ds-link-pressed,#05c)}
26
+ ._syaz17qg{color:var(--ds-text-accent-teal,#206a83)}
27
+ ._syaz1dyx{color:var(--ds-text-accent-gray,#44546f)}
28
+ ._syaz1e6v{color:var(--ds-text-brand,#0c66e4)}
29
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
30
+ ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
31
+ ._syaz1ik3{color:var(--ds-text-accent-lime-bolder,#37471f)}
32
+ ._syaz1lh4{color:var(--ds-text-disabled,#091e424f)}
33
+ ._syaz1q28{color:var(--ds-text-accent-orange,#a54800)}
34
+ ._syaz1qur{color:var(--ds-text-accent-magenta-bolder,#50253f)}
35
+ ._syaz1s8m{color:var(--ds-text-accent-magenta,#943d73)}
36
+ ._syaz1tco{color:var(--ds-text-accent-lime,#4c6b1f)}
37
+ ._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
38
+ ._syaz1vps{color:var(--ds-text-accent-orange-bolder,#702e00)}
39
+ ._syaz1x9z{color:var(--ds-text-accent-gray-bolder,#091e42)}
40
+ ._syaz1y78{color:var(--ds-text-accent-green-bolder,#164b35)}
41
+ ._syaz2ibx{color:var(--ds-text-accent-purple-bolder,#352c63)}
42
+ ._syaz9lu1{color:var(--ds-text-accent-red,#ae2e24)}
43
+ ._syazal3n{color:var(--ds-text-warning-inverse,#172b4d)}
44
+ ._syazaqb7{color:var(--ds-text-selected,#0c66e4)}
45
+ ._syaze0os{color:var(--ds-text-information,#05c)}
46
+ ._syazekll{color:var(--ds-text-accent-yellow-bolder,#533f04)}
47
+ ._syazfb2s{color:var(--ds-text-accent-yellow,#7f5f01)}
48
+ ._syazg3x0{color:var(--ds-link-visited-pressed,#352c63)}
49
+ ._syazh55r{color:var(--ds-text-accent-green,#216e4e)}
50
+ ._syazhwvp{color:var(--ds-text-accent-red-bolder,#5d1f1a)}
51
+ ._syazpnps{color:var(--ds-text-accent-blue,#05c)}
52
+ ._syazsc1o{color:var(--ds-text-accent-blue-bolder,#09326c)}
53
+ ._syazw7te{color:var(--ds-link-visited,#5e4db2)}
54
+ ._syazwx40{color:var(--ds-text-warning,#a54800)}
55
+ ._syazy73q{color:var(--ds-text-success,#216e4e)}
56
+ ._syazzjem{color:var(--ds-text-discovery,#5e4db2)}
57
+ ._y3gn1h6o{text-align:center}
58
+ ._y3gnh9n0{text-align:end}
59
+ ._y3gnv2br{text-align:start}
60
+ ._zg8l1m30{font-style:italic}
@@ -0,0 +1,167 @@
1
+ /* text.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./text.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { createContext, forwardRef, useContext } from 'react';
6
+ import invariant from 'tiny-invariant';
7
+ import { useSurface } from './internal/surface-provider';
8
+ var asAllowlist = ['span', 'p', 'strong', 'em'];
9
+ var HasTextAncestorContext = /*#__PURE__*/createContext(false);
10
+ var useHasTextAncestor = function useHasTextAncestor() {
11
+ return useContext(HasTextAncestorContext);
12
+ };
13
+
14
+ /**
15
+ * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
16
+ */
17
+ var useColor = function useColor(colorProp, hasTextAncestor) {
18
+ var surface = useSurface();
19
+
20
+ /*
21
+ * Where the color of the surface is inverted we always override the color
22
+ * as there is no valid choice that is not covered by the override.
23
+ */
24
+ if (surface in inverseColorMap) {
25
+ return inverseColorMap[surface];
26
+ }
27
+ if (colorProp === 'inherit') {
28
+ return undefined;
29
+ }
30
+ if (!colorProp && hasTextAncestor) {
31
+ return undefined;
32
+ }
33
+ return colorProp || 'color.text';
34
+ };
35
+ var styles = {
36
+ root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
37
+ 'as.strong': "_k48p8n31",
38
+ 'as.em': "_zg8l1m30",
39
+ 'textAlign.center': "_y3gn1h6o",
40
+ 'textAlign.end': "_y3gnh9n0",
41
+ 'textAlign.start': "_y3gnv2br",
42
+ truncation: "_1e0ccj1k _1reo15vq _18m915vq _sudp1e54",
43
+ breakAll: "_1nmz9jpi"
44
+ };
45
+ var fontSizeMap = {
46
+ medium: "_11c81oud",
47
+ UNSAFE_small: "_11c8qk37",
48
+ large: "_11c81doa",
49
+ small: "_11c81vlj"
50
+ };
51
+ var fontWeightMap = {
52
+ bold: "_k48pmoej",
53
+ medium: "_k48p1wq8",
54
+ regular: "_k48pi7a9",
55
+ semibold: "_k48p1pd9"
56
+ };
57
+ var textColorMap = {
58
+ 'color.text': "_syaz1fxt",
59
+ 'color.text.accent.lime': "_syaz1tco",
60
+ 'color.text.accent.lime.bolder': "_syaz1ik3",
61
+ 'color.text.accent.red': "_syaz9lu1",
62
+ 'color.text.accent.red.bolder': "_syazhwvp",
63
+ 'color.text.accent.orange': "_syaz1q28",
64
+ 'color.text.accent.orange.bolder': "_syaz1vps",
65
+ 'color.text.accent.yellow': "_syazfb2s",
66
+ 'color.text.accent.yellow.bolder': "_syazekll",
67
+ 'color.text.accent.green': "_syazh55r",
68
+ 'color.text.accent.green.bolder': "_syaz1y78",
69
+ 'color.text.accent.teal': "_syaz17qg",
70
+ 'color.text.accent.teal.bolder': "_syaz12v7",
71
+ 'color.text.accent.blue': "_syazpnps",
72
+ 'color.text.accent.blue.bolder': "_syazsc1o",
73
+ 'color.text.accent.purple': "_syaz10m5",
74
+ 'color.text.accent.purple.bolder': "_syaz2ibx",
75
+ 'color.text.accent.magenta': "_syaz1s8m",
76
+ 'color.text.accent.magenta.bolder': "_syaz1qur",
77
+ 'color.text.accent.gray': "_syaz1dyx",
78
+ 'color.text.accent.gray.bolder': "_syaz1x9z",
79
+ 'color.text.disabled': "_syaz1lh4",
80
+ 'color.text.inverse': "_syaz15cr",
81
+ 'color.text.selected': "_syazaqb7",
82
+ 'color.text.brand': "_syaz1e6v",
83
+ 'color.text.danger': "_syaz1tmw",
84
+ 'color.text.warning': "_syazwx40",
85
+ 'color.text.warning.inverse': "_syazal3n",
86
+ 'color.text.success': "_syazy73q",
87
+ 'color.text.discovery': "_syazzjem",
88
+ 'color.text.information': "_syaze0os",
89
+ 'color.text.subtlest': "_syaz131l",
90
+ 'color.text.subtle': "_syaz1gjq",
91
+ 'color.link': "_syaz14q2",
92
+ 'color.link.pressed': "_syaz16c2",
93
+ 'color.link.visited': "_syazw7te",
94
+ 'color.link.visited.pressed': "_syazg3x0"
95
+ };
96
+ export var inverseColorMap = {
97
+ 'color.background.neutral.bold': 'color.text.inverse',
98
+ 'color.background.neutral.bold.hovered': 'color.text.inverse',
99
+ 'color.background.neutral.bold.pressed': 'color.text.inverse',
100
+ 'color.background.selected.bold': 'color.text.inverse',
101
+ 'color.background.selected.bold.hovered': 'color.text.inverse',
102
+ 'color.background.selected.bold.pressed': 'color.text.inverse',
103
+ 'color.background.brand.bold': 'color.text.inverse',
104
+ 'color.background.brand.bold.hovered': 'color.text.inverse',
105
+ 'color.background.brand.bold.pressed': 'color.text.inverse',
106
+ 'color.background.brand.boldest': 'color.text.inverse',
107
+ 'color.background.brand.boldest.hovered': 'color.text.inverse',
108
+ 'color.background.brand.boldest.pressed': 'color.text.inverse',
109
+ 'color.background.danger.bold': 'color.text.inverse',
110
+ 'color.background.danger.bold.hovered': 'color.text.inverse',
111
+ 'color.background.danger.bold.pressed': 'color.text.inverse',
112
+ 'color.background.warning.bold': 'color.text.warning.inverse',
113
+ 'color.background.warning.bold.hovered': 'color.text.warning.inverse',
114
+ 'color.background.warning.bold.pressed': 'color.text.warning.inverse',
115
+ 'color.background.success.bold': 'color.text.inverse',
116
+ 'color.background.success.bold.hovered': 'color.text.inverse',
117
+ 'color.background.success.bold.pressed': 'color.text.inverse',
118
+ 'color.background.discovery.bold': 'color.text.inverse',
119
+ 'color.background.discovery.bold.hovered': 'color.text.inverse',
120
+ 'color.background.discovery.bold.pressed': 'color.text.inverse',
121
+ 'color.background.information.bold': 'color.text.inverse',
122
+ 'color.background.information.bold.hovered': 'color.text.inverse',
123
+ 'color.background.information.bold.pressed': 'color.text.inverse'
124
+ };
125
+
126
+ /**
127
+ * __Text__
128
+ *
129
+ * Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
130
+ * This includes considerations for text attributes such as color, font size, font weight, and line height.
131
+ * It renders a `span` by default.
132
+ *
133
+ * @internal
134
+ */
135
+ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
136
+ var _ref$as = _ref.as,
137
+ Component = _ref$as === void 0 ? 'span' : _ref$as,
138
+ colorProp = _ref.color,
139
+ align = _ref.align,
140
+ testId = _ref.testId,
141
+ id = _ref.id,
142
+ _ref$size = _ref.size,
143
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
144
+ weight = _ref.weight,
145
+ maxLines = _ref.maxLines,
146
+ children = _ref.children;
147
+ invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
148
+ var hasTextAncestor = useHasTextAncestor();
149
+ var color = useColor(colorProp, hasTextAncestor);
150
+ var component = /*#__PURE__*/React.createElement(Component, {
151
+ id: id,
152
+ style: {
153
+ WebkitLineClamp: maxLines
154
+ },
155
+ "data-testid": testId,
156
+ ref: ref,
157
+ className: ax([styles.root, fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
158
+ }, children);
159
+ if (hasTextAncestor) {
160
+ // no need to re-apply context if the text is already wrapped
161
+ return component;
162
+ }
163
+ return /*#__PURE__*/React.createElement(HasTextAncestorContext.Provider, {
164
+ value: true
165
+ }, component);
166
+ });
167
+ export default Text;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export { default as Box } from './components/box';
2
+ export { default as Inline } from './components/inline';
3
+ export { default as Stack } from './components/stack';
4
+ export { default as Flex } from './components/flex';
5
+ export { default as Grid } from './components/grid';
6
+ export { default as Bleed } from './components/bleed';
7
+ export { default as Text } from './components/text';
8
+ export { default as Pressable } from './components/pressable';
9
+ export { default as Anchor } from './components/anchor';
10
+ export { media } from './responsive';
11
+
12
+ // TODO: This is still not figured out from before…
13
+ export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
@@ -0,0 +1,11 @@
1
+
2
+ @media (min-width:30rem){._114bglyw{display:none}}
3
+ @media not all and (min-width:30rem){._1m0aglyw{display:none}}
4
+ @media (min-width:48rem){._181nglyw{display:none}}
5
+ @media not all and (min-width:48rem){._sugaglyw{display:none}}
6
+ @media (min-width:64rem){._dm25glyw{display:none}}
7
+ @media not all and (min-width:64rem){._1mjbglyw{display:none}}
8
+ @media (min-width:90rem){._je3oglyw{display:none}}
9
+ @media not all and (min-width:90rem){._liwcglyw{display:none}}
10
+ @media (min-width:110.5rem){._1uxvglyw{display:none}}
11
+ @media not all and (min-width:110.5rem){._14wzglyw{display:none}}