@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,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;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ElementType, type ReactNode } from 'react';
6
+ import type { AlignContent, AlignItems, AutoFlow, BasePrimitiveProps, GapToken, JustifyContent, JustifyItems } from './types';
7
+ export type GridProps<T extends ElementType = 'div'> = {
8
+ /**
9
+ * The DOM element to render as the Flex. Defaults to `div`.
10
+ */
11
+ as?: 'div' | 'span' | 'ul' | 'ol';
12
+ /**
13
+ * Used to align children along the inline axis.
14
+ */
15
+ justifyContent?: JustifyContent;
16
+ /**
17
+ * Used to align the grid along the inline axis.
18
+ *
19
+ * @deprecated This prop is not hooked up and doesn't nothing!
20
+ */
21
+ justifyItems?: JustifyItems;
22
+ /**
23
+ * Used to align children along the block axis.
24
+ */
25
+ alignItems?: AlignItems;
26
+ /**
27
+ * Used to align the grid along the block axis.
28
+ */
29
+ alignContent?: AlignContent;
30
+ /**
31
+ * Represents the space between each column.
32
+ */
33
+ columnGap?: GapToken;
34
+ /**
35
+ * Represents the space between each child across both axes.
36
+ */
37
+ gap?: GapToken;
38
+ /**
39
+ * Represents the space between each row.
40
+ */
41
+ rowGap?: GapToken;
42
+ /**
43
+ * Specifies how auto-placed items get flowed into the grid. CSS `grid-auto-flow`.
44
+ */
45
+ autoFlow?: AutoFlow;
46
+ /**
47
+ * Elements to be rendered inside the grid. Required as a grid without children should not be a grid.
48
+ */
49
+ children: ReactNode;
50
+ /**
51
+ * HTML id attrubute.
52
+ */
53
+ id?: string;
54
+ /**
55
+ * Forwarded ref element.
56
+ */
57
+ ref?: React.ComponentPropsWithRef<T>['ref'];
58
+ } & BasePrimitiveProps;
59
+ /**
60
+ * __Grid__
61
+ *
62
+ * `Grid` is a primitive component that implements the CSS Grid API.
63
+ *
64
+ * - [Examples](https://atlassian.design/components/primitives/grid/examples)
65
+ * - [Code](https://atlassian.design/components/primitives/grid/code)
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * import { Grid, Box } from '@atlaskit/primitives'
70
+ *
71
+ * const Component = () => (
72
+ * <Grid gap="space.100" gridColumns="1fr 1fr">
73
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
74
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
75
+ * </Grid>
76
+ * )
77
+ * ```
78
+ */
79
+ declare const Grid: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<{
80
+ /**
81
+ * The DOM element to render as the Flex. Defaults to `div`.
82
+ */
83
+ as?: "div" | "ol" | "span" | "ul" | undefined;
84
+ /**
85
+ * Used to align children along the inline axis.
86
+ */
87
+ justifyContent?: JustifyContent | undefined;
88
+ /**
89
+ * Used to align the grid along the inline axis.
90
+ *
91
+ * @deprecated This prop is not hooked up and doesn't nothing!
92
+ */
93
+ justifyItems?: JustifyItems | undefined;
94
+ /**
95
+ * Used to align children along the block axis.
96
+ */
97
+ alignItems?: AlignItems | undefined;
98
+ /**
99
+ * Used to align the grid along the block axis.
100
+ */
101
+ alignContent?: AlignContent | undefined;
102
+ /**
103
+ * Represents the space between each column.
104
+ */
105
+ columnGap?: import("./types").PositiveSpaceToken | undefined;
106
+ /**
107
+ * Represents the space between each child across both axes.
108
+ */
109
+ gap?: import("./types").PositiveSpaceToken | undefined;
110
+ /**
111
+ * Represents the space between each row.
112
+ */
113
+ rowGap?: import("./types").PositiveSpaceToken | undefined;
114
+ /**
115
+ * Specifies how auto-placed items get flowed into the grid. CSS `grid-auto-flow`.
116
+ */
117
+ autoFlow?: AutoFlow | undefined;
118
+ /**
119
+ * Elements to be rendered inside the grid. Required as a grid without children should not be a grid.
120
+ */
121
+ children: ReactNode;
122
+ /**
123
+ * HTML id attrubute.
124
+ */
125
+ id?: string | undefined;
126
+ /**
127
+ * Forwarded ref element.
128
+ */
129
+ ref?: any;
130
+ } & BasePrimitiveProps, "gap" | "rowGap" | "columnGap" | "alignContent" | "alignItems" | "justifyContent" | "justifyItems" | "children" | "as" | "id" | "autoFlow" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
131
+ export default Grid;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ElementType, type ReactNode } from 'react';
6
+ import { type FlexProps } from './flex';
7
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
8
+ export type InlineProps<T extends ElementType = 'div'> = {
9
+ /**
10
+ * The DOM element to render as the Inline. Defaults to `div`.
11
+ */
12
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'li' | 'dl';
13
+ /**
14
+ * Used to align children along the block axis (typically vertical).
15
+ */
16
+ alignBlock?: AlignBlock;
17
+ /**
18
+ * Used to align children along the inline axis (typically horizontal).
19
+ */
20
+ alignInline?: AlignInline;
21
+ /**
22
+ * Used to set whether children are forced onto one line or will wrap onto multiple lines.
23
+ */
24
+ shouldWrap?: boolean;
25
+ /**
26
+ * Used to distribute the children along the main axis.
27
+ */
28
+ spread?: Spread;
29
+ /**
30
+ * Used to set whether the container should grow to fill the available space.
31
+ */
32
+ grow?: Grow;
33
+ /**
34
+ * Represents the space between each child.
35
+ */
36
+ space?: FlexProps['gap'];
37
+ /**
38
+ * Represents the space between rows when content wraps.
39
+ * Used to override the `space` value in between rows.
40
+ */
41
+ rowSpace?: FlexProps['rowGap'];
42
+ /**
43
+ * Renders a separator string between each child.
44
+ */
45
+ separator?: string;
46
+ /**
47
+ * Elements to be rendered inside the Inline.
48
+ */
49
+ children: ReactNode;
50
+ /**
51
+ * Forwarded ref element.
52
+ */
53
+ ref?: React.ComponentPropsWithRef<T>['ref'];
54
+ } & BasePrimitiveProps;
55
+ /**
56
+ * __Inline__
57
+ *
58
+ * Inline is a primitive component based on CSS Flexbox that manages the horizontal layout of direct children.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * <Inline>
63
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
64
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
65
+ * </Inline>
66
+ * ```
67
+ *
68
+ */
69
+ declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<{
70
+ /**
71
+ * The DOM element to render as the Inline. Defaults to `div`.
72
+ */
73
+ as?: "div" | "dl" | "li" | "ol" | "span" | "ul" | undefined;
74
+ /**
75
+ * Used to align children along the block axis (typically vertical).
76
+ */
77
+ alignBlock?: AlignBlock | undefined;
78
+ /**
79
+ * Used to align children along the inline axis (typically horizontal).
80
+ */
81
+ alignInline?: AlignInline | undefined;
82
+ /**
83
+ * Used to set whether children are forced onto one line or will wrap onto multiple lines.
84
+ */
85
+ shouldWrap?: boolean | undefined;
86
+ /**
87
+ * Used to distribute the children along the main axis.
88
+ */
89
+ spread?: "space-between" | undefined;
90
+ /**
91
+ * Used to set whether the container should grow to fill the available space.
92
+ */
93
+ grow?: Grow | undefined;
94
+ /**
95
+ * Represents the space between each child.
96
+ */
97
+ space?: FlexProps['gap'];
98
+ /**
99
+ * Represents the space between rows when content wraps.
100
+ * Used to override the `space` value in between rows.
101
+ */
102
+ rowSpace?: FlexProps['rowGap'];
103
+ /**
104
+ * Renders a separator string between each child.
105
+ */
106
+ separator?: string | undefined;
107
+ /**
108
+ * Elements to be rendered inside the Inline.
109
+ */
110
+ children: ReactNode;
111
+ /**
112
+ * Forwarded ref element.
113
+ */
114
+ ref?: any;
115
+ } & BasePrimitiveProps, "space" | "separator" | "children" | "as" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "rowSpace" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
116
+ export default Inline;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import type { BackgroundColorToken } from '../types';
3
+ /**
4
+ * __Surface context__
5
+ *
6
+ * A surface context provides context information on the current background (if set).
7
+ */
8
+ export declare const SurfaceContext: import("react").Context<BackgroundColorToken>;
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 declare const useSurface: () => BackgroundColorToken;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A list of all of the SVG-ish elements from JSX.IntrinsicElements
3
+ * as we typically want to remove these from allowed elements.
4
+ */
5
+ export type SVGElements = 'svg' | 'animate' | 'animateMotion' | 'animateTransform' | 'circle' | 'clipPath' | 'defs' | 'desc' | 'ellipse' | 'feBlend' | 'feColorMatrix' | 'feComponentTransfer' | 'feComposite' | 'feConvolveMatrix' | 'feDiffuseLighting' | 'feDisplacementMap' | 'feDistantLight' | 'feDropShadow' | 'feFlood' | 'feFuncA' | 'feFuncB' | 'feFuncG' | 'feFuncR' | 'feGaussianBlur' | 'feImage' | 'feMerge' | 'feMergeNode' | 'feMorphology' | 'feOffset' | 'fePointLight' | 'feSpecularLighting' | 'feSpotLight' | 'feTile' | 'feTurbulence' | 'filter' | 'foreignObject' | 'g' | 'image' | 'line' | 'linearGradient' | 'marker' | 'mask' | 'metadata' | 'mpath' | 'path' | 'pattern' | 'polygon' | 'polyline' | 'radialGradient' | 'rect' | 'stop' | 'switch' | 'symbol' | 'text' | 'textPath' | 'tspan' | 'use' | 'view';
@@ -0,0 +1,49 @@
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 { BasePrimitiveProps, StyleProp } from './types';
8
+ type BasePressableProps = {
9
+ /**
10
+ * Elements to be rendered inside the Pressable.
11
+ */
12
+ children?: ReactNode;
13
+ /**
14
+ * 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.
15
+ */
16
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void;
17
+ /**
18
+ * Whether the button is disabled.
19
+ */
20
+ isDisabled?: boolean;
21
+ /**
22
+ * 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).
23
+ */
24
+ interactionName?: string;
25
+ /**
26
+ * 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 'Pressable'.
27
+ */
28
+ componentName?: string;
29
+ /**
30
+ * Additional information to be included in the `context` of Atlaskit analytics events that come from pressable.
31
+ */
32
+ analyticsContext?: Record<string, any>;
33
+ /**
34
+ * Forwarded ref.
35
+ */
36
+ ref?: Ref<HTMLButtonElement>;
37
+ };
38
+ export type PressableProps = Omit<ComponentPropsWithoutRef<'button'>, 'disabled' | 'onClick' | 'style' | 'className'> & BasePrimitiveProps & StyleProp & BasePressableProps;
39
+ /**
40
+ * __Pressable__
41
+ *
42
+ * A primitive for building custom buttons.
43
+ *
44
+ * - [Examples](https://atlassian.design/components/primitives/pressable/examples)
45
+ * - [Code](https://atlassian.design/components/primitives/pressable/code)
46
+ * - [Usage](https://atlassian.design/components/primitives/pressable/usage)
47
+ */
48
+ declare const Pressable: import("react").ForwardRefExoticComponent<Pick<Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "style" | "disabled" | "className" | "onClick"> & BasePrimitiveProps & StyleProp & BasePressableProps, "color" | "translate" | "hidden" | "key" | "value" | "style" | "children" | "form" | "slot" | "title" | "name" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isDisabled" | "interactionName" | "componentName" | "analyticsContext" | keyof BasePrimitiveProps> & import("react").RefAttributes<HTMLButtonElement>>;
49
+ export default Pressable;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ElementType, type ReactNode } from 'react';
6
+ import { type FlexProps } from './flex';
7
+ import type { AlignBlock, AlignInline, BasePrimitiveProps, Grow, Spread } from './types';
8
+ export type StackProps<T extends ElementType = 'div'> = {
9
+ /**
10
+ * The DOM element to render as the Stack. Defaults to `div`.
11
+ */
12
+ as?: 'div' | 'span' | 'ul' | 'ol';
13
+ /**
14
+ * Used to align children along the block axis (typically vertical).
15
+ */
16
+ alignBlock?: Exclude<AlignBlock, 'baseline'>;
17
+ /**
18
+ * Used to align children along the inline axis (typically horizontal).
19
+ */
20
+ alignInline?: AlignInline;
21
+ /**
22
+ * Used to distribute the children along the main axis.
23
+ */
24
+ spread?: Spread;
25
+ /**
26
+ * Used to set whether the container should grow to fill the available space.
27
+ */
28
+ grow?: Grow;
29
+ /**
30
+ * Represents the space between each child.
31
+ */
32
+ space?: FlexProps['gap'];
33
+ /**
34
+ * Elements to be rendered inside the Stack.
35
+ */
36
+ children: ReactNode;
37
+ /**
38
+ * Forwarded ref element.
39
+ */
40
+ ref?: React.ComponentPropsWithRef<T>['ref'];
41
+ } & BasePrimitiveProps;
42
+ /**
43
+ * __Stack__
44
+ *
45
+ * Stack is a primitive component based on flexbox that manages the block layout of direct children.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <Stack>
50
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
51
+ * <Box padding="space.100" backgroundColor="neutral"></Box>
52
+ * </Stack>
53
+ * ```
54
+ *
55
+ */
56
+ declare const Stack: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<{
57
+ /**
58
+ * The DOM element to render as the Stack. Defaults to `div`.
59
+ */
60
+ as?: "div" | "ol" | "span" | "ul" | undefined;
61
+ /**
62
+ * Used to align children along the block axis (typically vertical).
63
+ */
64
+ alignBlock?: "center" | "stretch" | "end" | "start" | undefined;
65
+ /**
66
+ * Used to align children along the inline axis (typically horizontal).
67
+ */
68
+ alignInline?: AlignInline | undefined;
69
+ /**
70
+ * Used to distribute the children along the main axis.
71
+ */
72
+ spread?: "space-between" | undefined;
73
+ /**
74
+ * Used to set whether the container should grow to fill the available space.
75
+ */
76
+ grow?: Grow | undefined;
77
+ /**
78
+ * Represents the space between each child.
79
+ */
80
+ space?: FlexProps['gap'];
81
+ /**
82
+ * Elements to be rendered inside the Stack.
83
+ */
84
+ children: ReactNode;
85
+ /**
86
+ * Forwarded ref element.
87
+ */
88
+ ref?: any;
89
+ } & BasePrimitiveProps, "space" | "children" | "as" | "alignInline" | "alignBlock" | "spread" | "grow" | keyof BasePrimitiveProps> & import("react").RefAttributes<any>>>;
90
+ export default Stack;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
+ import type { BasePrimitiveProps, FontSize, FontWeight, TextAlign, TextColor } from './types';
7
+ declare const asAllowlist: readonly ["span", "p", "strong", "em"];
8
+ type AsElement = (typeof asAllowlist)[number];
9
+ type TextPropsBase<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
+ * Token representing text color with a built-in fallback value.
20
+ * Will apply inverse text color automatically if placed within a Box with bold background color.
21
+ * Defaults to `color.text` if not nested in other Text components.
22
+ */
23
+ color?: TextColor | 'inherit';
24
+ /**
25
+ * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
26
+ */
27
+ id?: string;
28
+ /**
29
+ * The number of lines to limit the provided text to. Text will be truncated with an ellipsis.
30
+ *
31
+ * When `maxLines={1}`, `wordBreak` defaults to `break-all` to match the behaviour of `text-overflow: ellipsis`.
32
+ */
33
+ maxLines?: number;
34
+ /**
35
+ * Text alignment.
36
+ */
37
+ align?: TextAlign;
38
+ /**
39
+ * Text size.
40
+ */
41
+ size?: FontSize;
42
+ /**
43
+ * The [HTML `font-weight` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight).
44
+ */
45
+ weight?: FontWeight;
46
+ /**
47
+ * Forwarded ref.
48
+ */
49
+ ref?: ComponentPropsWithRef<T>['ref'];
50
+ };
51
+ export type TextProps<T extends ElementType = 'span'> = TextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
52
+ export declare const inverseColorMap: {
53
+ readonly 'color.background.neutral.bold': "color.text.inverse";
54
+ readonly 'color.background.neutral.bold.hovered': "color.text.inverse";
55
+ readonly 'color.background.neutral.bold.pressed': "color.text.inverse";
56
+ readonly 'color.background.selected.bold': "color.text.inverse";
57
+ readonly 'color.background.selected.bold.hovered': "color.text.inverse";
58
+ readonly 'color.background.selected.bold.pressed': "color.text.inverse";
59
+ readonly 'color.background.brand.bold': "color.text.inverse";
60
+ readonly 'color.background.brand.bold.hovered': "color.text.inverse";
61
+ readonly 'color.background.brand.bold.pressed': "color.text.inverse";
62
+ readonly 'color.background.brand.boldest': "color.text.inverse";
63
+ readonly 'color.background.brand.boldest.hovered': "color.text.inverse";
64
+ readonly 'color.background.brand.boldest.pressed': "color.text.inverse";
65
+ readonly 'color.background.danger.bold': "color.text.inverse";
66
+ readonly 'color.background.danger.bold.hovered': "color.text.inverse";
67
+ readonly 'color.background.danger.bold.pressed': "color.text.inverse";
68
+ readonly 'color.background.warning.bold': "color.text.warning.inverse";
69
+ readonly 'color.background.warning.bold.hovered': "color.text.warning.inverse";
70
+ readonly 'color.background.warning.bold.pressed': "color.text.warning.inverse";
71
+ readonly 'color.background.success.bold': "color.text.inverse";
72
+ readonly 'color.background.success.bold.hovered': "color.text.inverse";
73
+ readonly 'color.background.success.bold.pressed': "color.text.inverse";
74
+ readonly 'color.background.discovery.bold': "color.text.inverse";
75
+ readonly 'color.background.discovery.bold.hovered': "color.text.inverse";
76
+ readonly 'color.background.discovery.bold.pressed': "color.text.inverse";
77
+ readonly 'color.background.information.bold': "color.text.inverse";
78
+ readonly 'color.background.information.bold.hovered': "color.text.inverse";
79
+ readonly 'color.background.information.bold.pressed': "color.text.inverse";
80
+ };
81
+ /**
82
+ * __Text__
83
+ *
84
+ * Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
85
+ * This includes considerations for text attributes such as color, font size, font weight, and line height.
86
+ * It renders a `span` by default.
87
+ *
88
+ * @internal
89
+ */
90
+ declare const Text: import("react").ForwardRefExoticComponent<Pick<TextPropsBase<ElementType> & Omit<BasePrimitiveProps, "xcss">, "color" | "maxLines" | "size" | "weight" | "children" | "as" | "id" | "role" | "align" | "testId" | "data-testid"> & import("react").RefAttributes<any>>;
91
+ export default Text;