@atlaskit/primitives 11.0.2 → 11.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.
- package/CHANGELOG.md +8 -0
- package/constellation/anchor/code.mdx +5 -3
- package/constellation/anchor/examples.mdx +1 -2
- package/constellation/anchor/images/anchor-01a-do.png +0 -0
- package/constellation/anchor/images/anchor-01b-dont.png +0 -0
- package/constellation/anchor/images/anchor-02a-do.png +0 -0
- package/constellation/anchor/images/anchor-02b-dont.png +0 -0
- package/constellation/anchor/usage.mdx +61 -99
- package/constellation/box/code.mdx +3 -0
- package/constellation/pressable/code.mdx +5 -3
- package/constellation/pressable/usage.mdx +6 -4
- package/constellation/responsive/01-show/code.mdx +5 -3
- package/constellation/responsive/02-hide/code.mdx +5 -3
- package/dist/cjs/components/anchor.js +2 -2
- package/dist/cjs/components/bleed.js +1 -1
- package/dist/cjs/components/box.js +1 -1
- package/dist/cjs/components/flex.js +1 -1
- package/dist/cjs/components/grid.js +1 -1
- package/dist/cjs/components/inline.js +1 -1
- package/dist/cjs/components/pressable.js +2 -2
- package/dist/cjs/components/stack.js +1 -1
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/responsive/hide.js +1 -1
- package/dist/cjs/responsive/show.js +1 -1
- package/dist/es2019/components/anchor.js +2 -2
- package/dist/es2019/components/bleed.js +1 -1
- package/dist/es2019/components/box.js +1 -1
- package/dist/es2019/components/flex.js +1 -1
- package/dist/es2019/components/grid.js +1 -1
- package/dist/es2019/components/inline.js +1 -1
- package/dist/es2019/components/pressable.js +2 -2
- package/dist/es2019/components/stack.js +1 -1
- package/dist/es2019/components/text.js +1 -1
- package/dist/es2019/responsive/hide.js +1 -1
- package/dist/es2019/responsive/show.js +1 -1
- package/dist/esm/components/anchor.js +2 -2
- package/dist/esm/components/bleed.js +1 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/inline.js +1 -1
- package/dist/esm/components/pressable.js +2 -2
- package/dist/esm/components/stack.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/responsive/hide.js +1 -1
- package/dist/esm/responsive/show.js +1 -1
- package/dist/types/components/anchor.d.ts +1 -1
- package/dist/types/components/bleed.d.ts +1 -1
- package/dist/types/components/box.d.ts +1 -1
- package/dist/types/components/flex.d.ts +3 -3
- package/dist/types/components/grid.d.ts +1 -1
- package/dist/types/components/inline.d.ts +3 -3
- package/dist/types/components/pressable.d.ts +1 -1
- package/dist/types/components/stack.d.ts +3 -3
- package/dist/types/components/text.d.ts +1 -1
- package/dist/types/responsive/hide.d.ts +1 -1
- package/dist/types/responsive/show.d.ts +1 -1
- package/dist/types-ts4.5/components/anchor.d.ts +1 -1
- package/dist/types-ts4.5/components/bleed.d.ts +1 -1
- package/dist/types-ts4.5/components/box.d.ts +1 -1
- package/dist/types-ts4.5/components/flex.d.ts +3 -3
- package/dist/types-ts4.5/components/grid.d.ts +1 -1
- package/dist/types-ts4.5/components/inline.d.ts +3 -3
- package/dist/types-ts4.5/components/pressable.d.ts +1 -1
- package/dist/types-ts4.5/components/stack.d.ts +3 -3
- package/dist/types-ts4.5/components/text.d.ts +1 -1
- package/dist/types-ts4.5/responsive/hide.d.ts +1 -1
- package/dist/types-ts4.5/responsive/show.d.ts +1 -1
- package/package.json +2 -2
- package/extract-react-types/anchor-props.tsx +0 -120
- package/extract-react-types/bleed-props.tsx +0 -29
- package/extract-react-types/box-props.tsx +0 -89
- package/extract-react-types/flex-props.tsx +0 -80
- package/extract-react-types/grid-props.tsx +0 -102
- package/extract-react-types/hide-props.tsx +0 -48
- package/extract-react-types/inline-props.tsx +0 -89
- package/extract-react-types/pressable-props.tsx +0 -115
- package/extract-react-types/show-props.tsx +0 -48
- package/extract-react-types/stack-props.tsx +0 -73
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// TODO: Switch from ERT to ts-morph when this is completed and has reasonable adoption: https://product-fabric.atlassian.net/browse/DSP-10364
|
|
2
|
-
import type { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
import { type BasePrimitiveProps, type StyleProp } from '../src/components/types';
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
7
|
-
namespace Token {
|
|
8
|
-
// BoxProps['backgroundColor'] uses keyof, which ERT does not understand
|
|
9
|
-
export type BackgroundColor = 'BackgroundColor';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type Space =
|
|
13
|
-
| 'space.0'
|
|
14
|
-
| 'space.025'
|
|
15
|
-
| 'space.050'
|
|
16
|
-
| 'space.075'
|
|
17
|
-
| 'space.100'
|
|
18
|
-
| 'space.150'
|
|
19
|
-
| 'space.200'
|
|
20
|
-
| 'space.250'
|
|
21
|
-
| 'space.300'
|
|
22
|
-
| 'space.400'
|
|
23
|
-
| 'space.500'
|
|
24
|
-
| 'space.600'
|
|
25
|
-
| 'space.800'
|
|
26
|
-
| 'space.1000';
|
|
27
|
-
|
|
28
|
-
export default function Box(
|
|
29
|
-
_: {
|
|
30
|
-
/**
|
|
31
|
-
* The DOM element to render as the Box. Defaults to `div`.
|
|
32
|
-
*/
|
|
33
|
-
as?: ElementType;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
|
|
37
|
-
*/
|
|
38
|
-
padding?: Space;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Tokens representing CSS shorthand `paddingBlock`.
|
|
42
|
-
*/
|
|
43
|
-
paddingBlock?: Space;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Tokens representing CSS `paddingBlockStart`.
|
|
47
|
-
*/
|
|
48
|
-
paddingBlockStart?: Space;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Tokens representing CSS `paddingBlockEnd`.
|
|
52
|
-
*/
|
|
53
|
-
paddingBlockEnd?: Space;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Tokens representing CSS shorthand `paddingInline`.
|
|
57
|
-
*/
|
|
58
|
-
paddingInline?: Space;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Tokens representing CSS `paddingInlineStart`.
|
|
62
|
-
*/
|
|
63
|
-
paddingInlineStart?: Space;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Tokens representing CSS `paddingInlineEnd`.
|
|
67
|
-
*/
|
|
68
|
-
paddingInlineEnd?: Space;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* A token alias for background color. See:<br>
|
|
72
|
-
* [https://atlassian.design/components/tokens/all-tokens#color-background](https://atlassian.design/components/tokens/all-tokens#color-background)<br>
|
|
73
|
-
* When the background color is set to a [surface token](/components/tokens/all-tokens#elevation-surface),
|
|
74
|
-
* the [current surface](/components/tokens/code#current-surface-color) CSS variable will also be set to this value in the Box styles.
|
|
75
|
-
*/
|
|
76
|
-
backgroundColor?: Token.BackgroundColor;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Elements to be rendered inside the primitive.
|
|
80
|
-
*/
|
|
81
|
-
children?: ReactNode;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Forwarded ref element.
|
|
85
|
-
*/
|
|
86
|
-
ref?: ComponentPropsWithRef<ElementType>['ref'];
|
|
87
|
-
} & BasePrimitiveProps &
|
|
88
|
-
StyleProp,
|
|
89
|
-
) {}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { type ElementType, type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { type BasePrimitiveProps } from '../src/components/types';
|
|
4
|
-
|
|
5
|
-
type Space =
|
|
6
|
-
| 'space.0'
|
|
7
|
-
| 'space.025'
|
|
8
|
-
| 'space.050'
|
|
9
|
-
| 'space.075'
|
|
10
|
-
| 'space.100'
|
|
11
|
-
| 'space.150'
|
|
12
|
-
| 'space.200'
|
|
13
|
-
| 'space.250'
|
|
14
|
-
| 'space.300'
|
|
15
|
-
| 'space.400'
|
|
16
|
-
| 'space.500'
|
|
17
|
-
| 'space.600'
|
|
18
|
-
| 'space.800'
|
|
19
|
-
| 'space.1000';
|
|
20
|
-
|
|
21
|
-
type FlexProps<T extends ElementType = 'div'> = {
|
|
22
|
-
/**
|
|
23
|
-
* The DOM element to render as the Flex. Defaults to `div`.
|
|
24
|
-
*/
|
|
25
|
-
as?: 'div' | 'span' | 'ul' | 'ol' | 'li';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Used to align children along the main axis.
|
|
29
|
-
*/
|
|
30
|
-
justifyContent?:
|
|
31
|
-
| 'start'
|
|
32
|
-
| 'center'
|
|
33
|
-
| 'end'
|
|
34
|
-
| 'space-between'
|
|
35
|
-
| 'space-around'
|
|
36
|
-
| 'space-evenly'
|
|
37
|
-
| 'stretch';
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Used to align children along the cross axis.
|
|
41
|
-
*/
|
|
42
|
-
alignItems?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Represents the space between each child.
|
|
46
|
-
*/
|
|
47
|
-
columnGap?: Space;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Represents the space between each child.
|
|
51
|
-
*/
|
|
52
|
-
gap?: Space;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Represents the space between each child.
|
|
56
|
-
*/
|
|
57
|
-
rowGap?: Space;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Represents the flex direction property of CSS flexbox.
|
|
61
|
-
*/
|
|
62
|
-
direction?: 'row' | 'column';
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Represents the flex wrap property of CSS flexbox.
|
|
66
|
-
*/
|
|
67
|
-
wrap?: 'wrap' | 'nowrap';
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Elements to be rendered inside the Flex.
|
|
71
|
-
*/
|
|
72
|
-
children: ReactNode;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Forwarded ref element
|
|
76
|
-
*/
|
|
77
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
78
|
-
} & BasePrimitiveProps;
|
|
79
|
-
|
|
80
|
-
export default function Flex(_: FlexProps) {}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { type ElementType, type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { type BasePrimitiveProps } from '../src/components/types';
|
|
4
|
-
|
|
5
|
-
type Space =
|
|
6
|
-
| 'space.0'
|
|
7
|
-
| 'space.025'
|
|
8
|
-
| 'space.050'
|
|
9
|
-
| 'space.075'
|
|
10
|
-
| 'space.100'
|
|
11
|
-
| 'space.150'
|
|
12
|
-
| 'space.200'
|
|
13
|
-
| 'space.250'
|
|
14
|
-
| 'space.300'
|
|
15
|
-
| 'space.400'
|
|
16
|
-
| 'space.500'
|
|
17
|
-
| 'space.600'
|
|
18
|
-
| 'space.800'
|
|
19
|
-
| 'space.1000';
|
|
20
|
-
|
|
21
|
-
type GridProps<T extends ElementType = 'div'> = {
|
|
22
|
-
/**
|
|
23
|
-
* The DOM element to render as the Flex. Defaults to `div`.
|
|
24
|
-
*/
|
|
25
|
-
as?: 'div' | 'span' | 'ul' | 'ol' | 'li';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Used to align children along the main axis.
|
|
29
|
-
*/
|
|
30
|
-
justifyContent?:
|
|
31
|
-
| 'start'
|
|
32
|
-
| 'center'
|
|
33
|
-
| 'end'
|
|
34
|
-
| 'space-between'
|
|
35
|
-
| 'space-around'
|
|
36
|
-
| 'space-evenly'
|
|
37
|
-
| 'stretch';
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Used to align children along the cross axis.
|
|
41
|
-
*/
|
|
42
|
-
alignItems?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Represents the space between each child.
|
|
46
|
-
*/
|
|
47
|
-
columnGap?: Space;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Represents the space between each child.
|
|
51
|
-
*/
|
|
52
|
-
gap?: Space;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Represents the space between each child.
|
|
56
|
-
*/
|
|
57
|
-
rowGap?: Space;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Specifies how auto-placed items get flowed into the grid. CSS `grid-auto-flow`.
|
|
61
|
-
*/
|
|
62
|
-
autoFlow?: string;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* CSS `grid-template-rows`.
|
|
66
|
-
*/
|
|
67
|
-
templateRows?: string;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* CSS `grid-template-columns`.
|
|
71
|
-
*/
|
|
72
|
-
templateColumns?: string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* CSS `grid-template-areas`.
|
|
76
|
-
*
|
|
77
|
-
* Each item in the passed array is a grid row.
|
|
78
|
-
*/
|
|
79
|
-
templateAreas?: string[];
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Represents the flex direction property of CSS flexbox.
|
|
83
|
-
*/
|
|
84
|
-
direction?: 'row' | 'column';
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Represents the flex wrap property of CSS flexbox.
|
|
88
|
-
*/
|
|
89
|
-
wrap?: 'wrap' | 'nowrap';
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Elements to be rendered inside the Flex.
|
|
93
|
-
*/
|
|
94
|
-
children: ReactNode;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Forwarded ref element
|
|
98
|
-
*/
|
|
99
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
100
|
-
} & BasePrimitiveProps;
|
|
101
|
-
|
|
102
|
-
export default function Grid(_: GridProps) {}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { type Breakpoint } from '../src/responsive/types';
|
|
4
|
-
|
|
5
|
-
type As =
|
|
6
|
-
| 'article'
|
|
7
|
-
| 'aside'
|
|
8
|
-
| 'dialog'
|
|
9
|
-
| 'div'
|
|
10
|
-
| 'footer'
|
|
11
|
-
| 'header'
|
|
12
|
-
| 'li'
|
|
13
|
-
| 'main'
|
|
14
|
-
| 'nav'
|
|
15
|
-
| 'ol'
|
|
16
|
-
| 'section'
|
|
17
|
-
| 'span'
|
|
18
|
-
| 'ul';
|
|
19
|
-
|
|
20
|
-
type ResponsiveHideProps = {
|
|
21
|
-
/**
|
|
22
|
-
* The DOM element to render as the Box. Defaults to `div`.
|
|
23
|
-
*/
|
|
24
|
-
as?: As;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Elements to be rendered inside the primitive.
|
|
28
|
-
*/
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Apply CSS to hide this specifically **above** this breakpoint.
|
|
33
|
-
* The smallest breakpoint is not included as it would always be shown and this would not be performant.
|
|
34
|
-
*
|
|
35
|
-
* @important do not mix `above` and `below` (TypeScript should prevent this)
|
|
36
|
-
*/
|
|
37
|
-
above?: Exclude<Breakpoint, 'xxs'>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Apply CSS to hide this specifically **below** this breakpoint.
|
|
41
|
-
* The smallest breakpoint is not included as it would never be shown and this would not be performant.
|
|
42
|
-
*
|
|
43
|
-
* @important do not mix `above` and `below` (TypeScript should prevent this)
|
|
44
|
-
*/
|
|
45
|
-
below?: Exclude<Breakpoint, 'xxs'>;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default function Hide(_: ResponsiveHideProps) {}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { type ElementType, type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
AlignBlock,
|
|
5
|
-
AlignInline,
|
|
6
|
-
BasePrimitiveProps,
|
|
7
|
-
Grow,
|
|
8
|
-
Spread,
|
|
9
|
-
} from '../src/components/types';
|
|
10
|
-
|
|
11
|
-
type Space =
|
|
12
|
-
| 'space.0'
|
|
13
|
-
| 'space.025'
|
|
14
|
-
| 'space.050'
|
|
15
|
-
| 'space.075'
|
|
16
|
-
| 'space.100'
|
|
17
|
-
| 'space.150'
|
|
18
|
-
| 'space.200'
|
|
19
|
-
| 'space.250'
|
|
20
|
-
| 'space.300'
|
|
21
|
-
| 'space.400'
|
|
22
|
-
| 'space.500'
|
|
23
|
-
| 'space.600'
|
|
24
|
-
| 'space.800'
|
|
25
|
-
| 'space.1000';
|
|
26
|
-
|
|
27
|
-
type InlineProps<T extends ElementType = 'div'> = {
|
|
28
|
-
/**
|
|
29
|
-
* The DOM element to render as the Inline. Defaults to `div`.
|
|
30
|
-
*/
|
|
31
|
-
as?: 'div' | 'span' | 'ul' | 'ol';
|
|
32
|
-
/**
|
|
33
|
-
* Used to align children along the main axis.
|
|
34
|
-
*/
|
|
35
|
-
alignBlock?: AlignBlock;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Used to align children along the cross axis.
|
|
39
|
-
*/
|
|
40
|
-
alignInline?: AlignInline;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Used to set whether children are forced onto one line or will wrap onto multiple lines.
|
|
44
|
-
*/
|
|
45
|
-
shouldWrap?: boolean;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Used to distribute the children along the main axis.
|
|
49
|
-
*/
|
|
50
|
-
spread?: Spread;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Used to set whether the container should grow to fill the available space.
|
|
54
|
-
*/
|
|
55
|
-
grow?: Grow;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Represents the space between each child.
|
|
59
|
-
*/
|
|
60
|
-
space?: Space;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Represents the space between rows when content wraps.
|
|
64
|
-
* Used to override the `space` value in between rows.
|
|
65
|
-
*/
|
|
66
|
-
rowSpace?: Space;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Renders a separator string between each child.
|
|
70
|
-
*/
|
|
71
|
-
separator?: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
75
|
-
*/
|
|
76
|
-
testId?: string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Elements to be rendered inside the Inline.
|
|
80
|
-
*/
|
|
81
|
-
children: ReactNode;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Forwarded ref element
|
|
85
|
-
*/
|
|
86
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
87
|
-
} & BasePrimitiveProps;
|
|
88
|
-
|
|
89
|
-
export default function Inline(_: InlineProps) {}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// TODO: Switch from ERT to ts-morph when this is completed and has reasonable adoption: https://product-fabric.atlassian.net/browse/DSP-10364
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
|
|
6
|
-
import { type BasePrimitiveProps, type StyleProp } from '../src/components/types';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
9
|
-
namespace Token {
|
|
10
|
-
// BoxProps['backgroundColor'] uses keyof, which ERT does not understand
|
|
11
|
-
export type BackgroundColor = 'BackgroundColor';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
type Space =
|
|
15
|
-
| 'space.0'
|
|
16
|
-
| 'space.025'
|
|
17
|
-
| 'space.050'
|
|
18
|
-
| 'space.075'
|
|
19
|
-
| 'space.100'
|
|
20
|
-
| 'space.150'
|
|
21
|
-
| 'space.200'
|
|
22
|
-
| 'space.250'
|
|
23
|
-
| 'space.300'
|
|
24
|
-
| 'space.400'
|
|
25
|
-
| 'space.500'
|
|
26
|
-
| 'space.600'
|
|
27
|
-
| 'space.800'
|
|
28
|
-
| 'space.1000';
|
|
29
|
-
|
|
30
|
-
export default function Pressable(
|
|
31
|
-
_: {
|
|
32
|
-
/**
|
|
33
|
-
* Controls whether the button is disabled.
|
|
34
|
-
*/
|
|
35
|
-
isDisabled?: boolean;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The `type` attribute of the Button HTML element. Defaults to `button`.
|
|
39
|
-
*/
|
|
40
|
-
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Tokens representing CSS shorthand for `paddingBlock` and `paddingInline` together.
|
|
44
|
-
*/
|
|
45
|
-
padding?: Space;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Tokens representing CSS shorthand `paddingBlock`.
|
|
49
|
-
*/
|
|
50
|
-
paddingBlock?: Space;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Tokens representing CSS `paddingBlockStart`.
|
|
54
|
-
*/
|
|
55
|
-
paddingBlockStart?: Space;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Tokens representing CSS `paddingBlockEnd`.
|
|
59
|
-
*/
|
|
60
|
-
paddingBlockEnd?: Space;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Tokens representing CSS shorthand `paddingInline`.
|
|
64
|
-
*/
|
|
65
|
-
paddingInline?: Space;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Tokens representing CSS `paddingInlineStart`.
|
|
69
|
-
*/
|
|
70
|
-
paddingInlineStart?: Space;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Tokens representing CSS `paddingInlineEnd`.
|
|
74
|
-
*/
|
|
75
|
-
paddingInlineEnd?: Space;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* A token alias for background color. See [https://atlassian.design/components/tokens/all-tokens#color-background](background tokens) for a list of options.
|
|
79
|
-
* When the background color is set to a [surface token](/components/tokens/all-tokens#elevation-surface),
|
|
80
|
-
* the [current surface](/components/tokens/code#current-surface-color) CSS variable will also be set to this value in the Pressable styles.
|
|
81
|
-
*/
|
|
82
|
-
backgroundColor?: Token.BackgroundColor;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Handler called on click. You can use the second argument to fire Atlaskit analytics events on custom channels. They could then be routed to GASv3 analytics. See the code examples for information on [firing Atlaskit analytics events](https://atlassian.design/components/primitives/pressable/examples#atlaskit-analytics) or [routing these to GASv3 analytics](https://atlassian.design/components/primitives/pressable/examples#gasv3-analytics).
|
|
86
|
-
*/
|
|
87
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* An optional component name used to identify this component to Atlaskit analytics press listeners. This can be altered if a parent component's name is preferred rather than the default 'Pressable'. See [the code example](https://atlassian.design/components/primitives/pressable/examples#atlaskit-analytics) for more information.
|
|
91
|
-
*/
|
|
92
|
-
componentName?: string;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Additional information to be included in the `context` of Atlaskit analytics events that come from pressable. See [the code example](https://atlassian.design/components/primitives/pressable/examples#atlaskit-analytics) for more information.
|
|
96
|
-
*/
|
|
97
|
-
analyticsContext?: Record<string, any>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* An optional name used to identify the pressable to interaction content listeners. By default, pressable fires React UFO (Unified Frontend Observability) press interactions for available listeners. This helps Atlassian measure performance and reliability. See [the code example](https://atlassian.design/components/primitives/pressable/examples#react-ufo-press-interactions) for more information.
|
|
101
|
-
*/
|
|
102
|
-
interactionName?: string;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Elements to be rendered inside the primitive.
|
|
106
|
-
*/
|
|
107
|
-
children?: React.ReactNode;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Forwarded ref element.
|
|
111
|
-
*/
|
|
112
|
-
ref?: React.ComponentPropsWithRef<'button'>['ref'];
|
|
113
|
-
} & BasePrimitiveProps &
|
|
114
|
-
StyleProp,
|
|
115
|
-
) {}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { type Breakpoint } from '../src/responsive/types';
|
|
4
|
-
|
|
5
|
-
type As =
|
|
6
|
-
| 'article'
|
|
7
|
-
| 'aside'
|
|
8
|
-
| 'dialog'
|
|
9
|
-
| 'div'
|
|
10
|
-
| 'footer'
|
|
11
|
-
| 'header'
|
|
12
|
-
| 'li'
|
|
13
|
-
| 'main'
|
|
14
|
-
| 'nav'
|
|
15
|
-
| 'ol'
|
|
16
|
-
| 'section'
|
|
17
|
-
| 'span'
|
|
18
|
-
| 'ul';
|
|
19
|
-
|
|
20
|
-
type ResponsiveShowProps = {
|
|
21
|
-
/**
|
|
22
|
-
* The DOM element to render as the Box. Defaults to `div`.
|
|
23
|
-
*/
|
|
24
|
-
as?: As;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Elements to be rendered inside the primitive.
|
|
28
|
-
*/
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Apply CSS to show this specifically **above** this breakpoint.
|
|
33
|
-
* The smallest breakpoint is not included as it would always be shown and this would not be performant.
|
|
34
|
-
*
|
|
35
|
-
* @important do not mix `above` and `below` (TypeScript should prevent this)
|
|
36
|
-
*/
|
|
37
|
-
above?: Exclude<Breakpoint, 'xxs'>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Apply CSS to show this specifically **below** this breakpoint.
|
|
41
|
-
* The smallest breakpoint is not included as it would never be shown and this would not be performant.
|
|
42
|
-
*
|
|
43
|
-
* @important do not mix `above` and `below` (TypeScript should prevent this)
|
|
44
|
-
*/
|
|
45
|
-
below?: Exclude<Breakpoint, 'xxs'>;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default function Show(_: ResponsiveShowProps) {}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { type ElementType, type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
AlignBlock,
|
|
5
|
-
AlignInline,
|
|
6
|
-
BasePrimitiveProps,
|
|
7
|
-
Grow,
|
|
8
|
-
Spread,
|
|
9
|
-
} from '../src/components/types';
|
|
10
|
-
|
|
11
|
-
type Space =
|
|
12
|
-
| 'space.0'
|
|
13
|
-
| 'space.025'
|
|
14
|
-
| 'space.050'
|
|
15
|
-
| 'space.075'
|
|
16
|
-
| 'space.100'
|
|
17
|
-
| 'space.150'
|
|
18
|
-
| 'space.200'
|
|
19
|
-
| 'space.250'
|
|
20
|
-
| 'space.300'
|
|
21
|
-
| 'space.400'
|
|
22
|
-
| 'space.500'
|
|
23
|
-
| 'space.600'
|
|
24
|
-
| 'space.800'
|
|
25
|
-
| 'space.1000';
|
|
26
|
-
|
|
27
|
-
type StackProps<T extends ElementType = 'div'> = {
|
|
28
|
-
/**
|
|
29
|
-
* The DOM element to render as the Stack. Defaults to `div`.
|
|
30
|
-
*/
|
|
31
|
-
as?: 'div' | 'span' | 'ul' | 'ol';
|
|
32
|
-
/**
|
|
33
|
-
* Used to align children along the main axis.
|
|
34
|
-
*/
|
|
35
|
-
alignBlock?: Exclude<AlignBlock, 'baseline'>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Used to align children along the cross axis.
|
|
39
|
-
*/
|
|
40
|
-
alignInline?: AlignInline;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Used to distribute the children along the main axis.
|
|
44
|
-
*/
|
|
45
|
-
spread?: Spread;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Used to set whether the container should grow to fill the available space.
|
|
49
|
-
*/
|
|
50
|
-
grow?: Grow;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Represents the space between each child.
|
|
54
|
-
*/
|
|
55
|
-
space?: Space;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
59
|
-
*/
|
|
60
|
-
testId?: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Elements to be rendered inside the Stack.
|
|
64
|
-
*/
|
|
65
|
-
children: ReactNode;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Forwarded ref element
|
|
69
|
-
*/
|
|
70
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
71
|
-
} & BasePrimitiveProps;
|
|
72
|
-
|
|
73
|
-
export default function Stack(_: StackProps) {}
|