@atlaskit/primitives 12.2.7 → 13.1.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/anchor/package.json +3 -1
  3. package/box/package.json +3 -1
  4. package/compiled/package.json +17 -0
  5. package/dist/cjs/compiled/components/anchor.compiled.css +12 -0
  6. package/dist/cjs/compiled/components/anchor.js +130 -0
  7. package/dist/cjs/compiled/components/bleed.compiled.css +11 -0
  8. package/dist/cjs/compiled/components/bleed.js +49 -0
  9. package/dist/cjs/compiled/components/box.compiled.css +266 -0
  10. package/dist/cjs/compiled/components/box.js +367 -0
  11. package/dist/cjs/compiled/components/flex.compiled.css +46 -0
  12. package/dist/cjs/compiled/components/flex.js +119 -0
  13. package/dist/cjs/compiled/components/grid.compiled.css +54 -0
  14. package/dist/cjs/compiled/components/grid.js +129 -0
  15. package/dist/cjs/compiled/components/inline.compiled.css +8 -0
  16. package/dist/cjs/compiled/components/inline.js +83 -0
  17. package/dist/cjs/compiled/components/internal/surface-provider.js +25 -0
  18. package/dist/cjs/compiled/components/internal/types.js +1 -0
  19. package/dist/cjs/compiled/components/pressable.compiled.css +13 -0
  20. package/dist/cjs/compiled/components/pressable.js +87 -0
  21. package/dist/cjs/compiled/components/stack.compiled.css +3 -0
  22. package/dist/cjs/compiled/components/stack.js +64 -0
  23. package/dist/cjs/compiled/components/text.compiled.css +60 -0
  24. package/dist/cjs/compiled/components/text.js +177 -0
  25. package/dist/cjs/compiled/components/types.js +5 -0
  26. package/dist/cjs/compiled/index.js +83 -0
  27. package/dist/cjs/compiled/responsive/hide.compiled.css +11 -0
  28. package/dist/cjs/compiled/responsive/hide.js +46 -0
  29. package/dist/cjs/compiled/responsive/index.js +33 -0
  30. package/dist/cjs/compiled/responsive/media-helper.js +42 -0
  31. package/dist/cjs/compiled/responsive/show.compiled.css +11 -0
  32. package/dist/cjs/compiled/responsive/show.js +47 -0
  33. package/dist/cjs/compiled/responsive/types.js +5 -0
  34. package/dist/cjs/compiled/responsive/use-media-query.js +77 -0
  35. package/dist/cjs/components/anchor.js +1 -1
  36. package/dist/cjs/components/pressable.js +1 -1
  37. package/dist/cjs/index.js +0 -6
  38. package/dist/es2019/compiled/components/anchor.compiled.css +12 -0
  39. package/dist/es2019/compiled/components/anchor.js +117 -0
  40. package/dist/es2019/compiled/components/bleed.compiled.css +11 -0
  41. package/dist/es2019/compiled/components/bleed.js +43 -0
  42. package/dist/es2019/compiled/components/box.compiled.css +266 -0
  43. package/dist/es2019/compiled/components/box.js +351 -0
  44. package/dist/es2019/compiled/components/flex.compiled.css +46 -0
  45. package/dist/es2019/compiled/components/flex.js +110 -0
  46. package/dist/es2019/compiled/components/grid.compiled.css +54 -0
  47. package/dist/es2019/compiled/components/grid.js +121 -0
  48. package/dist/es2019/compiled/components/inline.compiled.css +8 -0
  49. package/dist/es2019/compiled/components/inline.js +71 -0
  50. package/dist/es2019/compiled/components/internal/surface-provider.js +19 -0
  51. package/dist/es2019/compiled/components/internal/types.js +0 -0
  52. package/dist/es2019/compiled/components/pressable.compiled.css +13 -0
  53. package/dist/es2019/compiled/components/pressable.js +75 -0
  54. package/dist/es2019/compiled/components/stack.compiled.css +3 -0
  55. package/dist/es2019/compiled/components/stack.js +54 -0
  56. package/dist/es2019/compiled/components/text.compiled.css +60 -0
  57. package/dist/es2019/compiled/components/text.js +164 -0
  58. package/dist/es2019/compiled/components/types.js +1 -0
  59. package/dist/es2019/compiled/index.js +13 -0
  60. package/dist/es2019/compiled/responsive/hide.compiled.css +11 -0
  61. package/dist/es2019/compiled/responsive/hide.js +37 -0
  62. package/dist/es2019/compiled/responsive/index.js +4 -0
  63. package/dist/es2019/compiled/responsive/media-helper.js +36 -0
  64. package/dist/es2019/compiled/responsive/show.compiled.css +11 -0
  65. package/dist/es2019/compiled/responsive/show.js +38 -0
  66. package/dist/es2019/compiled/responsive/types.js +1 -0
  67. package/dist/es2019/compiled/responsive/use-media-query.js +71 -0
  68. package/dist/es2019/components/anchor.js +1 -1
  69. package/dist/es2019/components/pressable.js +1 -1
  70. package/dist/es2019/index.js +1 -1
  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/types/compiled/components/anchor.d.ts +63 -0
  105. package/dist/types/compiled/components/bleed.d.ts +34 -0
  106. package/dist/types/compiled/components/box.d.ts +105 -0
  107. package/dist/types/compiled/components/flex.d.ts +111 -0
  108. package/dist/types/compiled/components/grid.d.ts +131 -0
  109. package/dist/types/compiled/components/inline.d.ts +116 -0
  110. package/dist/types/compiled/components/internal/surface-provider.d.ts +16 -0
  111. package/dist/types/compiled/components/internal/types.d.ts +5 -0
  112. package/dist/types/compiled/components/pressable.d.ts +49 -0
  113. package/dist/types/compiled/components/stack.d.ts +90 -0
  114. package/dist/types/compiled/components/text.d.ts +91 -0
  115. package/dist/types/compiled/components/types.d.ts +45 -0
  116. package/dist/types/compiled/index.d.ts +12 -0
  117. package/dist/types/compiled/responsive/hide.d.ts +39 -0
  118. package/dist/types/compiled/responsive/index.d.ts +5 -0
  119. package/dist/types/compiled/responsive/media-helper.d.ts +35 -0
  120. package/dist/types/compiled/responsive/show.d.ts +39 -0
  121. package/dist/types/compiled/responsive/types.d.ts +10 -0
  122. package/dist/types/compiled/responsive/use-media-query.d.ts +23 -0
  123. package/dist/types/index.d.ts +1 -1
  124. package/dist/types-ts4.5/compiled/components/anchor.d.ts +63 -0
  125. package/dist/types-ts4.5/compiled/components/bleed.d.ts +34 -0
  126. package/dist/types-ts4.5/compiled/components/box.d.ts +105 -0
  127. package/dist/types-ts4.5/compiled/components/flex.d.ts +111 -0
  128. package/dist/types-ts4.5/compiled/components/grid.d.ts +131 -0
  129. package/dist/types-ts4.5/compiled/components/inline.d.ts +116 -0
  130. package/dist/types-ts4.5/compiled/components/internal/surface-provider.d.ts +16 -0
  131. package/dist/types-ts4.5/compiled/components/internal/types.d.ts +5 -0
  132. package/dist/types-ts4.5/compiled/components/pressable.d.ts +49 -0
  133. package/dist/types-ts4.5/compiled/components/stack.d.ts +90 -0
  134. package/dist/types-ts4.5/compiled/components/text.d.ts +96 -0
  135. package/dist/types-ts4.5/compiled/components/types.d.ts +45 -0
  136. package/dist/types-ts4.5/compiled/index.d.ts +12 -0
  137. package/dist/types-ts4.5/compiled/responsive/hide.d.ts +39 -0
  138. package/dist/types-ts4.5/compiled/responsive/index.d.ts +5 -0
  139. package/dist/types-ts4.5/compiled/responsive/media-helper.d.ts +35 -0
  140. package/dist/types-ts4.5/compiled/responsive/show.d.ts +39 -0
  141. package/dist/types-ts4.5/compiled/responsive/types.d.ts +10 -0
  142. package/dist/types-ts4.5/compiled/responsive/use-media-query.d.ts +23 -0
  143. package/dist/types-ts4.5/index.d.ts +1 -1
  144. package/inline/package.json +3 -1
  145. package/package.json +8 -4
  146. package/pressable/package.json +3 -1
  147. package/responsive/package.json +3 -1
  148. package/stack/package.json +3 -1
  149. package/text/package.json +3 -1
  150. package/.eslintrc.js +0 -3
@@ -0,0 +1,45 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { StrictXCSSProp, XCSSAllProperties, XCSSAllPseudos } from '@atlaskit/css';
3
+ export type BasePrimitiveProps = {
4
+ /**
5
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
6
+ */
7
+ testId?: string;
8
+ /**
9
+ * `data-testid` is strictly controlled through the `testId` prop.
10
+ * This lets consumers know that this data attribute will not be applied.
11
+ */
12
+ 'data-testid'?: never;
13
+ /**
14
+ * Apply a subset of permitted styles powered by Atlassian Design System design tokens.
15
+ */
16
+ xcss?: StrictXCSSProp<XCSSAllProperties, XCSSAllPseudos>;
17
+ /**
18
+ * Accessible role.
19
+ */
20
+ role?: string;
21
+ };
22
+ export type StyleProp = {
23
+ style?: CSSProperties;
24
+ };
25
+ export type AlignBlock = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
26
+ export type AlignContent = 'center' | 'start' | 'space-around' | 'space-between' | 'space-evenly' | 'stretch' | 'end';
27
+ export type AlignInline = 'start' | 'center' | 'end' | 'stretch';
28
+ export type AlignItems = 'center' | 'start' | 'stretch' | 'end' | 'baseline';
29
+ export type AutoFlow = 'column' | 'row' | 'dense' | 'row dense' | 'column dense';
30
+ export type Direction = 'column' | 'row';
31
+ export type Grow = 'hug' | 'fill';
32
+ export type JustifyContent = 'center' | 'start' | 'space-around' | 'space-between' | 'space-evenly' | 'stretch' | 'end';
33
+ export type JustifyItems = 'center' | 'start' | 'stretch' | 'end';
34
+ export type Spread = 'space-between';
35
+ export type Wrap = 'wrap' | 'nowrap';
36
+ export type BleedSpaceToken = 'space.025' | 'space.050' | 'space.100' | 'space.150' | 'space.200';
37
+ export type PositiveSpaceToken = 'space.0' | 'space.025' | 'space.050' | 'space.075' | 'space.100' | 'space.150' | 'space.200' | 'space.250' | 'space.300' | 'space.400' | 'space.500' | 'space.600' | 'space.800' | 'space.1000';
38
+ export type PaddingToken = PositiveSpaceToken;
39
+ export type GapToken = PositiveSpaceToken;
40
+ export type SurfaceColorToken = 'utility.elevation.surface.current' | 'elevation.surface' | 'elevation.surface.overlay' | 'elevation.surface.raised' | 'elevation.surface.sunken';
41
+ export type BackgroundColorToken = 'color.background.accent.lime.subtlest' | 'color.background.accent.lime.subtlest.hovered' | 'color.background.accent.lime.subtlest.pressed' | 'color.background.accent.lime.subtler' | 'color.background.accent.lime.subtler.hovered' | 'color.background.accent.lime.subtler.pressed' | 'color.background.accent.lime.subtle' | 'color.background.accent.lime.subtle.hovered' | 'color.background.accent.lime.subtle.pressed' | 'color.background.accent.lime.bolder' | 'color.background.accent.lime.bolder.hovered' | 'color.background.accent.lime.bolder.pressed' | 'color.background.accent.red.subtlest' | 'color.background.accent.red.subtlest.hovered' | 'color.background.accent.red.subtlest.pressed' | 'color.background.accent.red.subtler' | 'color.background.accent.red.subtler.hovered' | 'color.background.accent.red.subtler.pressed' | 'color.background.accent.red.subtle' | 'color.background.accent.red.subtle.hovered' | 'color.background.accent.red.subtle.pressed' | 'color.background.accent.red.bolder' | 'color.background.accent.red.bolder.hovered' | 'color.background.accent.red.bolder.pressed' | 'color.background.accent.orange.subtlest' | 'color.background.accent.orange.subtlest.hovered' | 'color.background.accent.orange.subtlest.pressed' | 'color.background.accent.orange.subtler' | 'color.background.accent.orange.subtler.hovered' | 'color.background.accent.orange.subtler.pressed' | 'color.background.accent.orange.subtle' | 'color.background.accent.orange.subtle.hovered' | 'color.background.accent.orange.subtle.pressed' | 'color.background.accent.orange.bolder' | 'color.background.accent.orange.bolder.hovered' | 'color.background.accent.orange.bolder.pressed' | 'color.background.accent.yellow.subtlest' | 'color.background.accent.yellow.subtlest.hovered' | 'color.background.accent.yellow.subtlest.pressed' | 'color.background.accent.yellow.subtler' | 'color.background.accent.yellow.subtler.hovered' | 'color.background.accent.yellow.subtler.pressed' | 'color.background.accent.yellow.subtle' | 'color.background.accent.yellow.subtle.hovered' | 'color.background.accent.yellow.subtle.pressed' | 'color.background.accent.yellow.bolder' | 'color.background.accent.yellow.bolder.hovered' | 'color.background.accent.yellow.bolder.pressed' | 'color.background.accent.green.subtlest' | 'color.background.accent.green.subtlest.hovered' | 'color.background.accent.green.subtlest.pressed' | 'color.background.accent.green.subtler' | 'color.background.accent.green.subtler.hovered' | 'color.background.accent.green.subtler.pressed' | 'color.background.accent.green.subtle' | 'color.background.accent.green.subtle.hovered' | 'color.background.accent.green.subtle.pressed' | 'color.background.accent.green.bolder' | 'color.background.accent.green.bolder.hovered' | 'color.background.accent.green.bolder.pressed' | 'color.background.accent.teal.subtlest' | 'color.background.accent.teal.subtlest.hovered' | 'color.background.accent.teal.subtlest.pressed' | 'color.background.accent.teal.subtler' | 'color.background.accent.teal.subtler.hovered' | 'color.background.accent.teal.subtler.pressed' | 'color.background.accent.teal.subtle' | 'color.background.accent.teal.subtle.hovered' | 'color.background.accent.teal.subtle.pressed' | 'color.background.accent.teal.bolder' | 'color.background.accent.teal.bolder.hovered' | 'color.background.accent.teal.bolder.pressed' | 'color.background.accent.blue.subtlest' | 'color.background.accent.blue.subtlest.hovered' | 'color.background.accent.blue.subtlest.pressed' | 'color.background.accent.blue.subtler' | 'color.background.accent.blue.subtler.hovered' | 'color.background.accent.blue.subtler.pressed' | 'color.background.accent.blue.subtle' | 'color.background.accent.blue.subtle.hovered' | 'color.background.accent.blue.subtle.pressed' | 'color.background.accent.blue.bolder' | 'color.background.accent.blue.bolder.hovered' | 'color.background.accent.blue.bolder.pressed' | 'color.background.accent.purple.subtlest' | 'color.background.accent.purple.subtlest.hovered' | 'color.background.accent.purple.subtlest.pressed' | 'color.background.accent.purple.subtler' | 'color.background.accent.purple.subtler.hovered' | 'color.background.accent.purple.subtler.pressed' | 'color.background.accent.purple.subtle' | 'color.background.accent.purple.subtle.hovered' | 'color.background.accent.purple.subtle.pressed' | 'color.background.accent.purple.bolder' | 'color.background.accent.purple.bolder.hovered' | 'color.background.accent.purple.bolder.pressed' | 'color.background.accent.magenta.subtlest' | 'color.background.accent.magenta.subtlest.hovered' | 'color.background.accent.magenta.subtlest.pressed' | 'color.background.accent.magenta.subtler' | 'color.background.accent.magenta.subtler.hovered' | 'color.background.accent.magenta.subtler.pressed' | 'color.background.accent.magenta.subtle' | 'color.background.accent.magenta.subtle.hovered' | 'color.background.accent.magenta.subtle.pressed' | 'color.background.accent.magenta.bolder' | 'color.background.accent.magenta.bolder.hovered' | 'color.background.accent.magenta.bolder.pressed' | 'color.background.accent.gray.subtlest' | 'color.background.accent.gray.subtlest.hovered' | 'color.background.accent.gray.subtlest.pressed' | 'color.background.accent.gray.subtler' | 'color.background.accent.gray.subtler.hovered' | 'color.background.accent.gray.subtler.pressed' | 'color.background.accent.gray.subtle' | 'color.background.accent.gray.subtle.hovered' | 'color.background.accent.gray.subtle.pressed' | 'color.background.accent.gray.bolder' | 'color.background.accent.gray.bolder.hovered' | 'color.background.accent.gray.bolder.pressed' | 'color.background.disabled' | 'color.background.input' | 'color.background.input.hovered' | 'color.background.input.pressed' | 'color.background.inverse.subtle' | 'color.background.inverse.subtle.hovered' | 'color.background.inverse.subtle.pressed' | 'color.background.neutral' | 'color.background.neutral.hovered' | 'color.background.neutral.pressed' | 'color.background.neutral.subtle' | 'color.background.neutral.subtle.hovered' | 'color.background.neutral.subtle.pressed' | 'color.background.neutral.bold' | 'color.background.neutral.bold.hovered' | 'color.background.neutral.bold.pressed' | 'color.background.selected' | 'color.background.selected.hovered' | 'color.background.selected.pressed' | 'color.background.selected.bold' | 'color.background.selected.bold.hovered' | 'color.background.selected.bold.pressed' | 'color.background.brand.subtlest' | 'color.background.brand.subtlest.hovered' | 'color.background.brand.subtlest.pressed' | 'color.background.brand.bold' | 'color.background.brand.bold.hovered' | 'color.background.brand.bold.pressed' | 'color.background.brand.boldest' | 'color.background.brand.boldest.hovered' | 'color.background.brand.boldest.pressed' | 'color.background.danger' | 'color.background.danger.hovered' | 'color.background.danger.pressed' | 'color.background.danger.bold' | 'color.background.danger.bold.hovered' | 'color.background.danger.bold.pressed' | 'color.background.warning' | 'color.background.warning.hovered' | 'color.background.warning.pressed' | 'color.background.warning.bold' | 'color.background.warning.bold.hovered' | 'color.background.warning.bold.pressed' | 'color.background.success' | 'color.background.success.hovered' | 'color.background.success.pressed' | 'color.background.success.bold' | 'color.background.success.bold.hovered' | 'color.background.success.bold.pressed' | 'color.background.discovery' | 'color.background.discovery.hovered' | 'color.background.discovery.pressed' | 'color.background.discovery.bold' | 'color.background.discovery.bold.hovered' | 'color.background.discovery.bold.pressed' | 'color.background.information' | 'color.background.information.hovered' | 'color.background.information.pressed' | 'color.background.information.bold' | 'color.background.information.bold.hovered' | 'color.background.information.bold.pressed' | 'color.blanket' | 'color.blanket.selected' | 'color.blanket.danger' | 'color.skeleton' | 'color.skeleton.subtle' | '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' | 'utility.elevation.surface.current';
42
+ export type TextAlign = 'center' | 'end' | 'start';
43
+ 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';
44
+ export type FontSize = 'small' | 'medium' | 'UNSAFE_small' | 'large';
45
+ export type FontWeight = 'bold' | 'medium' | 'regular' | 'semibold';
@@ -0,0 +1,12 @@
1
+ export { default as Box, type BoxProps } from './components/box';
2
+ export { default as Inline, type InlineProps } from './components/inline';
3
+ export { default as Stack, type StackProps } from './components/stack';
4
+ export { default as Flex, type FlexProps } from './components/flex';
5
+ export { default as Grid, type GridProps } from './components/grid';
6
+ export { default as Bleed, type BleedProps } from './components/bleed';
7
+ export { default as Text, type TextProps } from './components/text';
8
+ export { default as Pressable, type PressableProps } from './components/pressable';
9
+ export { default as Anchor, type AnchorProps } from './components/anchor';
10
+ export { media, type Breakpoint, type MediaQuery } from './responsive';
11
+ export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
12
+ export type { BackgroundColorToken as BackgroundColor, PositiveSpaceToken as Space, TextColor, } from './components/types';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import { type BasePrimitiveProps } from '../components/types';
7
+ import type { Breakpoint, ComponentAs } from './types';
8
+ type ResponsiveHideProps = {
9
+ as?: ComponentAs;
10
+ children: ReactNode;
11
+ } & ({
12
+ above?: never;
13
+ /**
14
+ * Apply CSS to hide this specifically **below** this breakpoint.
15
+ * The smallest breakpoint is not included as it would never be shown and this would not be performant.
16
+ *
17
+ * @important do not mix `above` and `below` (TypeScript should prevent this).
18
+ */
19
+ below: Exclude<Breakpoint, 'xxs'>;
20
+ } | {
21
+ /**
22
+ * Apply CSS to hide this specifically **above** this breakpoint.
23
+ * The smallest breakpoint is not included as it would always be shown and this would not be performant.
24
+ *
25
+ * @important do not mix `above` and `below` (TypeScript should prevent this).
26
+ */
27
+ above: Exclude<Breakpoint, 'xxs'>;
28
+ below?: never;
29
+ }) & Pick<BasePrimitiveProps, 'xcss'>;
30
+ /**
31
+ * Hides the content at a given breakpoint. By default, content is shown. The primary use case is for visual presentation.
32
+ * Mix `<Hide above="md">` with `<Show above="md">` to achieve content that shifts at a breakpoint.
33
+ *
34
+ * Please note:
35
+ * - This only uses `display: none` hide, it does not skip rendering of children trees.
36
+ * - As this is rendered at all times, there is little performance savings here (just that this is not painted).
37
+ */
38
+ export declare const Hide: ({ above, below, children, as: AsElement, xcss, }: ResponsiveHideProps) => JSX.Element;
39
+ export {};
@@ -0,0 +1,5 @@
1
+ export { media } from './media-helper';
2
+ export type { Breakpoint, MediaQuery } from './types';
3
+ export { UNSAFE_useMediaQuery } from './use-media-query';
4
+ export { Show } from './show';
5
+ export { Hide } from './hide';
@@ -0,0 +1,35 @@
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
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import { type BasePrimitiveProps } from '../components/types';
7
+ import type { Breakpoint, ComponentAs } from './types';
8
+ type ResponsiveShowProps = {
9
+ as?: ComponentAs;
10
+ children: ReactNode;
11
+ } & ({
12
+ above?: never;
13
+ /**
14
+ * Apply CSS to show this specifically **below** this breakpoint.
15
+ * The smallest breakpoint is not included as it would never be shown and this would not be performant.
16
+ *
17
+ * @important do not mix `above` and `below` (TypeScript should prevent this).
18
+ */
19
+ below: Exclude<Breakpoint, 'xxs'>;
20
+ } | {
21
+ /**
22
+ * Apply CSS to show this specifically **above** this breakpoint.
23
+ * The smallest breakpoint is not included as it would always be shown and this would not be performant.
24
+ *
25
+ * @important do not mix `above` and `below` (TypeScript should prevent this).
26
+ */
27
+ above: Exclude<Breakpoint, 'xxs'>;
28
+ below?: never;
29
+ }) & Pick<BasePrimitiveProps, 'xcss'>;
30
+ /**
31
+ * Shows the content at a given breakpoint. By default, content is hidden. The primary use case is for visual presentation.
32
+ * Mix `<Show above="md">` with `<Hide above="md">` to achieve content that shifts at a breakpoint.
33
+ *
34
+ * Please note:
35
+ * - This only uses `display: none` and `display: revert` to show/hide, it does not skip rendering of children trees.
36
+ * - As this is rendered at all times, there is little performance savings here (just that this is not painted).
37
+ */
38
+ export declare const Show: ({ above, below, children, as: AsElement, xcss, }: ResponsiveShowProps) => JSX.Element;
39
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type media } from './media-helper';
2
+ /**
3
+ * The breakpoints we have for responsiveness.
4
+ */
5
+ export type Breakpoint = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ /**
7
+ * All supported media queries for use as keys, eg. in `css({ [media.above.md]: { … } })`.
8
+ */
9
+ export type MediaQuery = (typeof media.above)[Breakpoint];
10
+ export type ComponentAs = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
@@ -0,0 +1,23 @@
1
+ import { media } from './media-helper';
2
+ type NestedQueryString = `above.${keyof typeof media.above}` | `below.${keyof typeof media.below}`;
3
+ /**
4
+ * A hook which returnes a `window.matchMedia` result to help you build responsively around breakpoints in JavaScript.
5
+ *
6
+ * The returning value **WILL NOT** update or react to change. You can use `mq.matches` to get the latest version and you can use the optional listener argument to react to changes as desired.
7
+ *
8
+ * @important
9
+ * - This will always be `null` in SSR and the event listener should not fire on SSR => clientside hydration.
10
+ * - `above.xxs` will always be truthy, your listener should never fire.
11
+ *
12
+ * @experimental This hook only works on the client-side and is not safe in an SSR environment as `window` is unavailable (and the user's viewport would be unknown)
13
+ *
14
+ * @example
15
+ * const mq = useMediaQuery('below.md', useCallback((event) => console.log('changed', event.matches)), []))
16
+ * const isMobile = mq?.matches;
17
+ *
18
+ * @returns
19
+ * - `MediaQueryList`, primarily used to get if that media query is currently
20
+ * - `null` when `matchMedia` is unavailable, eg. in SSR.
21
+ */
22
+ export declare const UNSAFE_useMediaQuery: (queryString: NestedQueryString, listener?: ((event: MediaQueryListEvent) => void) | undefined) => MediaQueryList | null;
23
+ export {};
@@ -29,5 +29,5 @@ export type {
29
29
  AnchorProps as UNSAFE_AnchorProps, AnchorProps, } from './components/anchor';
30
30
  export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
31
31
  export type { Breakpoint, MediaQuery } from './responsive';
32
- export { useSurface as UNSAFE_useSurface, SurfaceContext as UNSAFE_SurfaceContext, } from './components/internal/surface-provider';
32
+ export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
33
33
  export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';
6
+ import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
+ import { type RouterLinkComponentProps } from '@atlaskit/app-provider';
8
+ import type { BasePrimitiveProps, StyleProp } from './types';
9
+ type BaseAnchorProps = {
10
+ /**
11
+ * Elements to be rendered inside the Anchor.
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Handler called on click. The second argument provides an Atlaskit UI analytics event that can be fired to a listening channel. See the ['analytics-next' package](https://atlaskit.atlassian.com/packages/analytics/analytics-next) documentation for more information.
16
+ */
17
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement>, analyticsEvent: UIAnalyticsEvent) => void;
18
+ /**
19
+ * An optional name used to identify events for [React UFO (Unified Frontend Observability) press interactions](https://developer.atlassian.com/platform/ufo/react-ufo/react-ufo/getting-started/#quick-start--press-interactions). For more information, see [React UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
20
+ */
21
+ interactionName?: string;
22
+ /**
23
+ * An optional component name used to identify this component in Atlaskit analytics events. This can be used if a parent component's name is preferred over the default 'Anchor'.
24
+ */
25
+ componentName?: string;
26
+ /**
27
+ * Additional information to be included in the `context` of Atlaskit analytics events that come from anchor.
28
+ */
29
+ analyticsContext?: Record<string, any>;
30
+ /**
31
+ * Override the default text to signify that a link opens in a new window.
32
+ * This is appended to the `aria-label` attribute when the `target` prop is set to `_blank`.
33
+ */
34
+ opensInNewWindowLabel?: string;
35
+ /**
36
+ * Forwarded ref.
37
+ */
38
+ ref?: Ref<HTMLAnchorElement>;
39
+ };
40
+ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<ComponentPropsWithoutRef<'a'>, 'href' | 'onClick' | 'style' | 'className'> & BasePrimitiveProps & StyleProp & BaseAnchorProps;
41
+ /**
42
+ * __Anchor__
43
+ *
44
+ * A primitive for building custom anchor links.
45
+ *
46
+ * - [Examples](https://atlassian.design/components/primitives/anchor/examples)
47
+ * - [Code](https://atlassian.design/components/primitives/anchor/code)
48
+ * - [Usage](https://atlassian.design/components/primitives/anchor/usage)
49
+ */
50
+ declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style, target, testId, xcss, opensInNewWindowLabel, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref?: Ref<HTMLAnchorElement>) => JSX.Element;
51
+ /**
52
+ * __Anchor__
53
+ *
54
+ * Anchor is a primitive for building custom anchor links. It's a wrapper around the HTML `<a>` element that provides a consistent API for handling client-side routing and Atlassian Design System styling.
55
+ *
56
+ * - [Examples](https://atlassian.design/components/primitives/anchor/examples)
57
+ * - [Code](https://atlassian.design/components/primitives/anchor/code)
58
+ * - [Usage](https://atlassian.design/components/primitives/anchor/usage)
59
+ */
60
+ declare const Anchor: <RouterLinkConfig extends Record<string, any> = never>(props: AnchorProps<RouterLinkConfig> & {
61
+ ref?: Ref<HTMLAnchorElement>;
62
+ }) => ReturnType<typeof AnchorNoRef>;
63
+ export default Anchor;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React, { type ReactNode } from 'react';
6
+ import type { BasePrimitiveProps, BleedSpaceToken } from './types';
7
+ export type BleedProps = {
8
+ /**
9
+ * Elements to be rendered inside the Flex.
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Bleed along both axis.
14
+ */
15
+ all?: BleedSpaceToken;
16
+ /**
17
+ * Bleed along the inline axis.
18
+ */
19
+ inline?: BleedSpaceToken;
20
+ /**
21
+ * Bleed along the block axis
22
+ */
23
+ block?: BleedSpaceToken;
24
+ } & BasePrimitiveProps;
25
+ /**
26
+ * __Bleed__
27
+ *
28
+ * `Bleed` is a primitive layout component that controls negative whitespace.
29
+ *
30
+ * - [Examples](https://atlassian.design/components/primitives/bleed/examples)
31
+ * - [Code](https://atlassian.design/components/primitives/bleed/code)
32
+ */
33
+ declare const Bleed: React.MemoExoticComponent<({ children, testId, inline, block, all, xcss }: BleedProps) => JSX.Element>;
34
+ export default Bleed;
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactElement, type ReactNode } from 'react';
6
+ import { type StrictXCSSProp, type XCSSAllProperties, type XCSSAllPseudos } from '@atlaskit/css';
7
+ import { type SVGElements } from './internal/types';
8
+ import type { BackgroundColorToken, BasePrimitiveProps, PaddingToken, StyleProp, SurfaceColorToken } from './types';
9
+ type AllowedElements = Exclude<keyof JSX.IntrinsicElements, SVGElements | 'button' | 'a'>;
10
+ type CustomElementType<P = any> = {
11
+ [K in AllowedElements]: P extends JSX.IntrinsicElements[K] ? K : never;
12
+ }[AllowedElements];
13
+ export type BoxProps<T extends CustomElementType> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & Omit<BasePrimitiveProps, 'xcss' | 'style'> & BaseBoxProps<T>;
14
+ type BaseBoxProps<T extends CustomElementType> = {
15
+ /**
16
+ * The DOM element to render as the Box. Defaults to `div`.
17
+ */
18
+ as?: T;
19
+ /**
20
+ * Elements to be rendered inside the Box.
21
+ */
22
+ children?: ReactNode;
23
+ /**
24
+ * Token representing background color with a built-in fallback value.
25
+ */
26
+ backgroundColor?: SurfaceColorToken | BackgroundColorToken;
27
+ /**
28
+ * Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
29
+ *
30
+ * @see paddingBlock
31
+ * @see paddingInline
32
+ * @private
33
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
34
+ */
35
+ padding?: PaddingToken;
36
+ /**
37
+ * Tokens representing CSS shorthand `paddingBlock`.
38
+ *
39
+ * @see paddingBlockStart
40
+ * @see paddingBlockEnd
41
+ * @private
42
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
43
+ */
44
+ paddingBlock?: PaddingToken;
45
+ /**
46
+ * Tokens representing CSS `paddingBlockStart`.
47
+ * @private
48
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
49
+ */
50
+ paddingBlockStart?: PaddingToken;
51
+ /**
52
+ * Tokens representing CSS `paddingBlockEnd`.
53
+ * @private
54
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
55
+ */
56
+ paddingBlockEnd?: PaddingToken;
57
+ /**
58
+ * Tokens representing CSS shorthand `paddingInline`.
59
+ * @private
60
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
61
+ *
62
+ * @see paddingInlineStart
63
+ * @see paddingInlineEnd
64
+ */
65
+ paddingInline?: PaddingToken;
66
+ /**
67
+ * Tokens representing CSS `paddingInlineStart`.
68
+ * @private
69
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
70
+ */
71
+ paddingInlineStart?: PaddingToken;
72
+ /**
73
+ * Tokens representing CSS `paddingInlineEnd`.
74
+ * @private
75
+ * @deprecated – Do not use shorthand props, use `props.xcss` instead as these will be deprecated in the future.
76
+ */
77
+ paddingInlineEnd?: PaddingToken;
78
+ /**
79
+ * Forwarded ref.
80
+ */
81
+ ref?: ComponentPropsWithRef<T>['ref'];
82
+ /**
83
+ * Inline styles to be applied to the Box. Only apply as a last resort, or where
84
+ * styles cannot otherwise be calculated outside of the runtime of the component they're applied.
85
+ */
86
+ style?: Omit<StyleProp['style'], 'backgroundColor'>;
87
+ /**
88
+ * Apply a subset of permitted styles powered by Atlassian Design System design tokens.
89
+ * Note that `backgroundColor` is not allowed, use the `backgroundColor` prop instead for surface awareness.
90
+ */
91
+ xcss?: StrictXCSSProp<Exclude<XCSSAllProperties, 'background' | 'backgroundColor'>, XCSSAllPseudos>;
92
+ };
93
+ type BoxComponent = <T extends CustomElementType>(props: BoxProps<T>) => ReactElement | null;
94
+ /**
95
+ * __Box__
96
+ *
97
+ * A Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
98
+ * Renders a `div` by default.
99
+ *
100
+ * - [Examples](https://atlassian.design/components/primitives/box/examples)
101
+ * - [Code](https://atlassian.design/components/primitives/box/code)
102
+ * - [Usage](https://atlassian.design/components/primitives/box/usage)
103
+ */
104
+ export declare const Box: BoxComponent;
105
+ export default Box;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ElementType, type ReactNode } from 'react';
6
+ import type { AlignItems, BasePrimitiveProps, Direction, GapToken, JustifyContent, Wrap } from './types';
7
+ export type FlexProps<T extends ElementType = 'div'> = {
8
+ /**
9
+ * The DOM element to render as the Flex. Defaults to `div`.
10
+ */
11
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'li' | 'dl';
12
+ /**
13
+ * Used to align children along the main axis.
14
+ */
15
+ justifyContent?: JustifyContent;
16
+ /**
17
+ * Used to align children along the cross axis.
18
+ */
19
+ alignItems?: AlignItems;
20
+ /**
21
+ * Represents the space between each child.
22
+ */
23
+ columnGap?: GapToken;
24
+ /**
25
+ * Represents the space between each child.
26
+ */
27
+ gap?: GapToken;
28
+ /**
29
+ * Represents the space between each child.
30
+ */
31
+ rowGap?: GapToken;
32
+ /**
33
+ * Represents the flex direction property of CSS flexbox.
34
+ */
35
+ direction?: Direction;
36
+ /**
37
+ * Represents the flex wrap property of CSS flexbox.
38
+ */
39
+ wrap?: Wrap;
40
+ /**
41
+ * Elements to be rendered inside the Flex.
42
+ */
43
+ children: ReactNode;
44
+ /**
45
+ * Forwarded ref element.
46
+ */
47
+ ref?: React.ComponentPropsWithRef<T>['ref'];
48
+ } & BasePrimitiveProps;
49
+ /**
50
+ * __Flex__
51
+ *
52
+ * `Flex` is a primitive component that implements the CSS Flexbox API.
53
+ *
54
+ * - [Examples](https://atlassian.design/components/primitives/flex/examples)
55
+ * - [Code](https://atlassian.design/components/primitives/flex/code)
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * import { Flex, Box } from '@atlaskit/primitives'
60
+ *
61
+ * const Component = () => (
62
+ * <Flex direction="column">
63
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
64
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
65
+ * </Flex>
66
+ * )
67
+ * ```
68
+ */
69
+ declare const Flex: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<{
70
+ /**
71
+ * The DOM element to render as the Flex. Defaults to `div`.
72
+ */
73
+ as?: "div" | "dl" | "li" | "ol" | "span" | "ul" | undefined;
74
+ /**
75
+ * Used to align children along the main axis.
76
+ */
77
+ justifyContent?: JustifyContent | undefined;
78
+ /**
79
+ * Used to align children along the cross axis.
80
+ */
81
+ alignItems?: AlignItems | undefined;
82
+ /**
83
+ * Represents the space between each child.
84
+ */
85
+ columnGap?: import("./types").PositiveSpaceToken | undefined;
86
+ /**
87
+ * Represents the space between each child.
88
+ */
89
+ gap?: import("./types").PositiveSpaceToken | undefined;
90
+ /**
91
+ * Represents the space between each child.
92
+ */
93
+ rowGap?: import("./types").PositiveSpaceToken | undefined;
94
+ /**
95
+ * Represents the flex direction property of CSS flexbox.
96
+ */
97
+ direction?: Direction | undefined;
98
+ /**
99
+ * Represents the flex wrap property of CSS flexbox.
100
+ */
101
+ wrap?: Wrap | undefined;
102
+ /**
103
+ * Elements to be rendered inside the Flex.
104
+ */
105
+ children: ReactNode;
106
+ /**
107
+ * Forwarded ref element.
108
+ */
109
+ ref?: any;
110
+ } & BasePrimitiveProps, "gap" | "rowGap" | "columnGap" | "alignItems" | "direction" | "justifyContent" | "wrap" | "children" | "as" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
111
+ export default Flex;