@atlaskit/primitives 6.1.2 → 6.2.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/examples.mdx +87 -5
- package/constellation/pressable/examples.mdx +15 -13
- package/constellation/text/examples.mdx +50 -18
- package/constellation/text/usage.mdx +11 -1
- package/constellation/xcss/usage.mdx +12 -6
- package/dist/cjs/components/anchor.js +2 -2
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/cjs/responsive/hide.js +6 -2
- package/dist/cjs/responsive/show.js +6 -2
- package/dist/es2019/components/anchor.js +2 -2
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/responsive/hide.js +6 -2
- package/dist/es2019/responsive/show.js +6 -2
- package/dist/esm/components/anchor.js +2 -2
- package/dist/esm/components/pressable.js +1 -1
- package/dist/esm/responsive/hide.js +6 -2
- package/dist/esm/responsive/show.js +6 -2
- package/dist/types/components/anchor.d.ts +2 -2
- package/dist/types/components/pressable.d.ts +2 -2
- package/dist/types/responsive/hide.d.ts +5 -4
- package/dist/types/responsive/show.d.ts +4 -3
- package/dist/types-ts4.5/components/anchor.d.ts +2 -2
- package/dist/types-ts4.5/components/pressable.d.ts +2 -2
- package/dist/types-ts4.5/responsive/hide.d.ts +5 -4
- package/dist/types-ts4.5/responsive/show.d.ts +4 -3
- package/extract-react-types/anchor-props.tsx +34 -8
- package/extract-react-types/pressable-props.tsx +14 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#100442](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100442)
|
|
8
|
+
[`6b3630addb05`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b3630addb05) -
|
|
9
|
+
Add `xcss` to responsive components `Show` and `Hide`.
|
|
10
|
+
|
|
3
11
|
## 6.1.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -5,7 +5,13 @@ order: 0
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import AnchorDefault from '../../examples/constellation/anchor/default';
|
|
8
|
+
import AnchorBasic from '../../examples/constellation/anchor/basic';
|
|
8
9
|
import AnchorStyled from '../../examples/constellation/anchor/styled';
|
|
10
|
+
import AnchorHtmlAttributes from '../../examples/constellation/anchor/html-attributes';
|
|
11
|
+
import AnchorRouterLinkConfiguration from '../../examples/constellation/anchor/router-link-configuration';
|
|
12
|
+
import AnchorPressTracing from '../../examples/constellation/anchor/press-tracing';
|
|
13
|
+
import AnchorAnalytics from '../../examples/constellation/anchor/analytics';
|
|
14
|
+
import AnchorAnalyticsGASv3 from '../../examples/constellation/anchor/analytics-gasv3';
|
|
9
15
|
|
|
10
16
|
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
11
17
|
import SectionMessage from '@atlaskit/section-message';
|
|
@@ -16,18 +22,94 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
16
22
|
directoryName="primitives"
|
|
17
23
|
/>
|
|
18
24
|
|
|
19
|
-
Anchor is a primitive used for building custom
|
|
25
|
+
Anchor is a primitive used for building custom links with Atlassian Design System styling, routing support, and built-in event tracking. Ultimately it renders an anchor `<a>` element.
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
Only use anchor when existing components such as [link](/components/link/examples) or [link button](/components/button/link-button/examples) are unsuitable and unable to be customized to fit your needs.
|
|
22
28
|
|
|
23
29
|
## Default
|
|
24
30
|
|
|
25
|
-
Anchor
|
|
31
|
+
Anchor is unstyled besides a default underline. If you are using the [CSS reset](/components/css-reset/examples), it will also inherit some global styles.
|
|
26
32
|
|
|
27
33
|
<Example Component={AnchorDefault} packageName="@atlaskit/primitives/anchor" />
|
|
28
34
|
|
|
29
|
-
##
|
|
35
|
+
## Basic styling with XCSS
|
|
30
36
|
|
|
31
|
-
Anchor
|
|
37
|
+
Anchor can be styled using XCSS. It includes consistent Atlassian Design System `:focus` styles, so it's unnecessary to add your own.
|
|
38
|
+
|
|
39
|
+
For more information on XCSS, see the [XCSS documentation](/components/primitives/xcss).
|
|
40
|
+
|
|
41
|
+
<Example Component={AnchorBasic} packageName="@atlaskit/primitives/anchor" />
|
|
42
|
+
|
|
43
|
+
## Advanced styling
|
|
44
|
+
|
|
45
|
+
Use a combination of XCSS and other primitives for more complex designs.
|
|
32
46
|
|
|
33
47
|
<Example Component={AnchorStyled} packageName="@atlaskit/primitives/anchor" />
|
|
48
|
+
|
|
49
|
+
## HTML attributes
|
|
50
|
+
|
|
51
|
+
Anchor passes through all valid HTML attributes to the underlying `<a>` element.
|
|
52
|
+
|
|
53
|
+
<Example
|
|
54
|
+
Component={AnchorHtmlAttributes}
|
|
55
|
+
packageName="@atlaskit/primitives/anchor"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
## Router links
|
|
59
|
+
|
|
60
|
+
Routing libraries often supply their own link components enhanced with routing support. This can be configured in the [AppProvider context](/components/app-provider/examples#router-links), and anchor will automatically use it.
|
|
61
|
+
|
|
62
|
+
This example shows a configuration for [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any routing library can be used.
|
|
63
|
+
|
|
64
|
+
Using this method, anchor accepts `href` as a string for standard usage. For advanced usage, an object can be passed.
|
|
65
|
+
|
|
66
|
+
Anchor will only render a router link if:
|
|
67
|
+
|
|
68
|
+
- a link component is set in the app provider
|
|
69
|
+
- it's not an external link (starting with `http://` or `https://`)
|
|
70
|
+
- it's not a non-HTTP-based link (e.g. emails, phone numbers, hash links etc.).
|
|
71
|
+
|
|
72
|
+
<Example
|
|
73
|
+
Component={AnchorRouterLinkConfiguration}
|
|
74
|
+
packageName="@atlaskit/primitives/anchor"
|
|
75
|
+
appearance="source-only"
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
## Event tracking
|
|
79
|
+
|
|
80
|
+
Anchor has utilities to make tracking events easier. Events will not be captured unless listeners are setup to handle them.
|
|
81
|
+
|
|
82
|
+
### Track events for any analytics provider
|
|
83
|
+
|
|
84
|
+
Anchor comes with built-in Atlaskit analytics support using the [Analytics next package](https://atlaskit.atlassian.com/packages/analytics/analytics-next), and fires events for available listeners. Currently this is only available for `onClick`.
|
|
85
|
+
|
|
86
|
+
It always fires events on the `atlaskit` channel. To also fire events on other channels, use the provided `analyticsEvent` in `onClick`. To configure event data, use `componentName` (defaults to 'Anchor') and `analyticsContext` for passing other metadata.
|
|
87
|
+
|
|
88
|
+
See the event data in the console.
|
|
89
|
+
|
|
90
|
+
<Example
|
|
91
|
+
Component={AnchorAnalytics}
|
|
92
|
+
packageName="@atlaskit/primitives/anchor"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
### Track events for Atlassian internal services
|
|
96
|
+
|
|
97
|
+
#### GASv3 analytics
|
|
98
|
+
|
|
99
|
+
The Atlassian analytics bridge makes Atlaskit analytics events compatible with GASv3 (Global Analytics Service). This can also inject an `actionSubjectId` to the event if required.
|
|
100
|
+
|
|
101
|
+
See the event data in the console.
|
|
102
|
+
|
|
103
|
+
<Example
|
|
104
|
+
Component={AnchorAnalyticsGASv3}
|
|
105
|
+
packageName="@atlaskit/primitives/anchor"
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
#### React UFO press interactions
|
|
109
|
+
|
|
110
|
+
By default, anchor fires [React UFO (Unified Frontend Observability) press interactions](https://developer.atlassian.com/platform/ufo/react-ufo/react-ufo/getting-started/#quick-start--press-interactions) for available listeners. This helps Atlassian measure performance and reliability. Additional detail can be provided using the `interactionName` prop.
|
|
111
|
+
|
|
112
|
+
<Example
|
|
113
|
+
Component={AnchorPressTracing}
|
|
114
|
+
packageName="@atlaskit/primitives/anchor"
|
|
115
|
+
/>
|
|
@@ -25,7 +25,7 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
25
25
|
|
|
26
26
|
Pressable is a primitive used for building custom buttons with Atlassian Design System styling and built-in event tracking. It renders a `<button>` element.
|
|
27
27
|
|
|
28
|
-
Only use Pressable when existing components such as [
|
|
28
|
+
Only use Pressable when existing components such as [button](/components/button/examples) are unsuitable and unable to be customized to fit your needs.
|
|
29
29
|
|
|
30
30
|
## Default
|
|
31
31
|
|
|
@@ -40,7 +40,7 @@ Pressable is unstyled by default.
|
|
|
40
40
|
|
|
41
41
|
Pressable can be styled using XCSS. Ensure styling indicates the interaction state using `:hover` and `:active` pseudo-classes. Pressable includes consistent Atlassian Design System `:focus` styles, so it's unnecessary to add your own.
|
|
42
42
|
|
|
43
|
-
For more information on XCSS, see the
|
|
43
|
+
For more information on XCSS, see the [XCSS documentation](/components/primitives/xcss).
|
|
44
44
|
|
|
45
45
|
<Example
|
|
46
46
|
Component={PressableBasic}
|
|
@@ -91,16 +91,7 @@ Pressable passes through all valid HTML attributes to the underlying `<button>`
|
|
|
91
91
|
|
|
92
92
|
Pressable has utilities to make tracking events easier. Events will not be captured unless listeners are setup to handle them.
|
|
93
93
|
|
|
94
|
-
###
|
|
95
|
-
|
|
96
|
-
By default, pressable fires [React UFO (Unified Frontend Observability) press interactions](https://developer.atlassian.com/platform/ufo/react-ufo/react-ufo/getting-started/#quick-start--press-interactions) for available listeners. This helps Atlassian measure performance and reliability. Additional detail can be provided using the `interactionName` prop.
|
|
97
|
-
|
|
98
|
-
<Example
|
|
99
|
-
Component={PressablePressTracing}
|
|
100
|
-
packageName="@atlaskit/primitives/pressable"
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
### Atlaskit analytics
|
|
94
|
+
### Track events for any analytics provider
|
|
104
95
|
|
|
105
96
|
Pressable comes with built-in Atlaskit analytics support using the [Analytics next package](https://atlaskit.atlassian.com/packages/analytics/analytics-next), and fires events for available listeners. Currently this is only available for `onClick`.
|
|
106
97
|
|
|
@@ -113,7 +104,9 @@ See the event data in the console.
|
|
|
113
104
|
packageName="@atlaskit/primitives/pressable"
|
|
114
105
|
/>
|
|
115
106
|
|
|
116
|
-
###
|
|
107
|
+
### Track events for Atlassian internal services
|
|
108
|
+
|
|
109
|
+
#### GASv3 analytics
|
|
117
110
|
|
|
118
111
|
The Atlassian analytics bridge makes Atlaskit analytics events compatible with GASv3 (Global Analytics Service). This can also inject an `actionSubjectId` to the event if required.
|
|
119
112
|
|
|
@@ -123,3 +116,12 @@ See the event data in the console.
|
|
|
123
116
|
Component={PressableAnalyticsGASv3}
|
|
124
117
|
packageName="@atlaskit/primitives/pressable"
|
|
125
118
|
/>
|
|
119
|
+
|
|
120
|
+
#### React UFO press interactions
|
|
121
|
+
|
|
122
|
+
By default, pressable fires [React UFO (Unified Frontend Observability) press interactions](https://developer.atlassian.com/platform/ufo/react-ufo/react-ufo/getting-started/#quick-start--press-interactions) for available listeners. This helps Atlassian measure performance and reliability. Additional detail can be provided using the `interactionName` prop.
|
|
123
|
+
|
|
124
|
+
<Example
|
|
125
|
+
Component={PressablePressTracing}
|
|
126
|
+
packageName="@atlaskit/primitives/pressable"
|
|
127
|
+
/>
|
|
@@ -4,40 +4,72 @@ description: Text is a token-backed typography component to display body text.
|
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
7
|
+
import TextBasic from '../../examples/constellation/text/text-basic';
|
|
8
|
+
import TextColorInverse from '../../examples/constellation/text/text-color-inverse';
|
|
9
|
+
import TextColorInherit from '../../examples/constellation/text/text-color-inherit';
|
|
10
|
+
import TextWeight from '../../examples/constellation/text/text-weight';
|
|
11
|
+
import TextAlign from '../../examples/constellation/text/text-align';
|
|
12
|
+
import TextAsElement from '../../examples/constellation/text/text-as-element';
|
|
13
|
+
import TextSpacing from '../../examples/constellation/text/text-spacing';
|
|
14
|
+
import TextTruncation from '../../examples/constellation/text/text-truncation';
|
|
12
15
|
|
|
13
16
|
## Basic
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
Use a Text component for main content. Text typically appears after headings or subheadings as detailed descriptions and messages, but also as standalone text in components.
|
|
16
19
|
|
|
17
|
-
The `size` prop expresses the visual appearance of the text element
|
|
20
|
+
The `size` prop expresses the visual appearance of the text element:
|
|
21
|
+
- `'large'` is for long-form content. Use this size for a comfortable reading experience such as in blogs.
|
|
22
|
+
- `'medium'` is the default size in components or where space is limited, for detailed or descriptive content such as primary descriptions in flags.
|
|
23
|
+
- `'small'` should be used sparingly and is for secondary level content such as fine print or semantic messaging.
|
|
18
24
|
|
|
19
|
-
<Example Component={
|
|
25
|
+
<Example Component={TextBasic} packageName="@atlaskit/primitives" />
|
|
20
26
|
|
|
21
27
|
## Color
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Text uses the `color.text` token which automatically switches colors to be legible across both light and dark modes.
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
Text will automatically apply the correct inverse color token if placed within a [box component](/components/primitives/box) with a bold background color.
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
<Example Component={TextColorInverse} packageName="@atlaskit/primitives" />
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
The `color` prop can be used with any text color token. If Text is nested inside another Text component, color will automatically inherit from its parent.
|
|
30
36
|
|
|
31
|
-
<Example Component={
|
|
37
|
+
<Example Component={TextColorInherit} packageName="@atlaskit/primitives" />
|
|
38
|
+
|
|
39
|
+
## Font weight
|
|
40
|
+
|
|
41
|
+
Font weight defaults to regular (400) and can be set using the `weight` prop.
|
|
42
|
+
More information about the available weights can be found on the [typography foundations page](/foundations/typography-beta/#body-font-weight).
|
|
43
|
+
|
|
44
|
+
Note: Text supports the semibold weight, however due to differences between font stacks across different operating systems, semibold text may render as bold.
|
|
45
|
+
We recommend using regular, medium, and bold for the best results.
|
|
46
|
+
|
|
47
|
+
<Example Component={TextWeight} packageName="@atlaskit/primitives" />
|
|
32
48
|
|
|
33
49
|
## Alignment
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
Text can be aligned using the `align` prop.
|
|
52
|
+
|
|
53
|
+
<Example Component={TextAlign} packageName="@atlaskit/primitives" />
|
|
54
|
+
|
|
55
|
+
## Rendered HTML element
|
|
56
|
+
|
|
57
|
+
Text renders a HTML `<span>` element by default. Use the `as` prop to change the rendered HTML element.
|
|
58
|
+
|
|
59
|
+
<Example Component={TextAsElement} packageName="@atlaskit/primitives" />
|
|
60
|
+
|
|
61
|
+
## Arrangement with other text styles
|
|
62
|
+
|
|
63
|
+
Text does not apply any vertical margin or spacing. To control space between text and other content, use a [stack component](/components/primitives/stack).
|
|
64
|
+
|
|
65
|
+
The available values for paragraph spacing are outlined in the [Typography foundations](/foundations/typography-beta/#body) page.
|
|
66
|
+
|
|
67
|
+
<Example Component={TextSpacing} packageName="@atlaskit/primitives" />
|
|
36
68
|
|
|
37
|
-
|
|
69
|
+
## Truncation
|
|
38
70
|
|
|
39
|
-
|
|
71
|
+
Truncation in product experiences [should be avoided](/content/language-and-grammar/#truncation).
|
|
40
72
|
|
|
41
|
-
|
|
73
|
+
However if truncation cannot be avoided, for example when displaying user-generated content, use the `maxLines` prop to indicate how text should be truncated.
|
|
42
74
|
|
|
43
|
-
<Example Component={
|
|
75
|
+
<Example Component={TextTruncation} packageName="@atlaskit/primitives" />
|
|
@@ -6,4 +6,14 @@ order: 2
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
Use
|
|
9
|
+
Use the text component for all non-heading text, including main content, detailed descriptions, and text in components.
|
|
10
|
+
|
|
11
|
+
For each size, a specific line height is automatically set ensuring text is compliant with accessibility standards.
|
|
12
|
+
|
|
13
|
+
Read more usage guidance for body text in our [Typography foundations](/foundations/typography-beta#body).
|
|
14
|
+
|
|
15
|
+
## Accessibility
|
|
16
|
+
|
|
17
|
+
### Color contrast
|
|
18
|
+
|
|
19
|
+
Text should be a minimum of 4.5:1 color contrast.
|
|
@@ -8,17 +8,23 @@ import { MediaQueriesTable } from '@af/design-system-docs-ui';
|
|
|
8
8
|
|
|
9
9
|
XCSS is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives/overview).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
To ensure future compliance with XCSS as it evolves over time, we highly recommend you enable our ESLint plugins and adhere to the [UI Styling Standard](/components/eslint-plugin-ui-styling-standard) guidelines by writing local, type-safe, static styles.
|
|
12
|
+
|
|
13
|
+
- [@atlaskit/eslint-plugin-design-system](/components/eslint-plugin-design-system)
|
|
14
|
+
- [@atlaskit/eslint-plugin-ui-styling-standard](/components/eslint-plugin-ui-styling-standard)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
The XCSS utility behaves similarly to the `css` utility in libraries like `styled-components`, `@compiled` or `@emotion`, and is built off of `@emotion/react` today. If you've used these libraries, XCSS will feel familiar, with a few additional features and constraints.
|
|
12
18
|
|
|
13
19
|
Familiar features:
|
|
14
20
|
|
|
15
|
-
- XCSS
|
|
16
|
-
- XCSS
|
|
21
|
+
- XCSS is applied as an Emotion `className` to our primitive components
|
|
22
|
+
- XCSS works with the basic CSS object interface found elsewhere
|
|
17
23
|
- XCSS supports style precedence and conditional styles
|
|
18
24
|
|
|
19
25
|
Key differences:
|
|
20
26
|
|
|
21
|
-
- XCSS has type-safety that ensures token name usage for all CSS properties represented by design tokens
|
|
27
|
+
- XCSS has type-safety that ensures token name usage for all CSS properties represented by design tokens
|
|
22
28
|
- XCSS restricts nested selectors completely from usage
|
|
23
29
|
|
|
24
30
|
## Usage
|
|
@@ -115,7 +121,7 @@ The only limitation is that a media query can't contain another media query. Thi
|
|
|
115
121
|
|
|
116
122
|
Additionally, pseudo-selectors can't contain media queries. To use media queries and pseudos, the media query must contain the pseudo.
|
|
117
123
|
|
|
118
|
-
```
|
|
124
|
+
```tsx
|
|
119
125
|
import { xcss } from '@atlaskit/primitives';
|
|
120
126
|
import { media } from '@atlaskit/primitives/responsive';
|
|
121
127
|
|
|
@@ -127,7 +133,7 @@ const someStyles = xcss({
|
|
|
127
133
|
}
|
|
128
134
|
},
|
|
129
135
|
|
|
130
|
-
// This is not okay,
|
|
136
|
+
// This is not okay, we don't allow pseudos to contain media queries
|
|
131
137
|
':hover': {
|
|
132
138
|
[media.above.md]: {
|
|
133
139
|
backgroundColor: 'color.background.primary.hovered'
|
|
@@ -76,7 +76,7 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
76
76
|
action: 'clicked',
|
|
77
77
|
componentName: componentName || 'Anchor',
|
|
78
78
|
packageName: "@atlaskit/primitives",
|
|
79
|
-
packageVersion: "6.
|
|
79
|
+
packageVersion: "6.2.0",
|
|
80
80
|
analyticsData: analyticsContext,
|
|
81
81
|
actionSubject: 'link'
|
|
82
82
|
});
|
|
@@ -94,7 +94,7 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
94
94
|
*
|
|
95
95
|
* - a link component is set in the app provider
|
|
96
96
|
* - it's not an external link (starting with `http://` or `https://`)
|
|
97
|
-
* - it's not a non-HTTP-based link (e.g.
|
|
97
|
+
* - it's not a non-HTTP-based link (e.g. emails, phone numbers, hash links etc.).
|
|
98
98
|
*/
|
|
99
99
|
var isRouterLink = RouterLink && !isExternal && !isNonHttpBased;
|
|
100
100
|
var hrefObjectUsedWithoutRouterLink = RouterLink === undefined && (0, _typeof2.default)(href) === 'object';
|
|
@@ -78,7 +78,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
78
78
|
action: 'clicked',
|
|
79
79
|
componentName: componentName || 'Pressable',
|
|
80
80
|
packageName: "@atlaskit/primitives",
|
|
81
|
-
packageVersion: "6.
|
|
81
|
+
packageVersion: "6.2.0",
|
|
82
82
|
analyticsData: analyticsContext,
|
|
83
83
|
actionSubject: 'button'
|
|
84
84
|
});
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Hide = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _xcss = require("../xcss/xcss");
|
|
8
9
|
var _buildMediaQueryCss = require("./build-media-query-css");
|
|
9
10
|
/** @jsx jsx */
|
|
10
11
|
|
|
@@ -27,8 +28,11 @@ var Hide = exports.Hide = function Hide(_ref) {
|
|
|
27
28
|
below = _ref.below,
|
|
28
29
|
children = _ref.children,
|
|
29
30
|
_ref$as = _ref.as,
|
|
30
|
-
AsElement = _ref$as === void 0 ? 'div' : _ref$as
|
|
31
|
+
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
32
|
+
xcss = _ref.xcss;
|
|
33
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
31
34
|
return (0, _react.jsx)(AsElement, {
|
|
32
|
-
|
|
35
|
+
className: resolvedStyles.static,
|
|
36
|
+
css: [above && hideAboveQueries[above], below && hideBelowQueries[below], resolvedStyles.emotion]
|
|
33
37
|
}, children);
|
|
34
38
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Show = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _xcss = require("../xcss/xcss");
|
|
8
9
|
var _buildMediaQueryCss = require("./build-media-query-css");
|
|
9
10
|
/** @jsx jsx */
|
|
10
11
|
|
|
@@ -30,8 +31,11 @@ var Show = exports.Show = function Show(_ref) {
|
|
|
30
31
|
below = _ref.below,
|
|
31
32
|
children = _ref.children,
|
|
32
33
|
_ref$as = _ref.as,
|
|
33
|
-
AsElement = _ref$as === void 0 ? 'div' : _ref$as
|
|
34
|
+
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
35
|
+
xcss = _ref.xcss;
|
|
36
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
34
37
|
return (0, _react.jsx)(AsElement, {
|
|
35
|
-
|
|
38
|
+
className: resolvedStyles.static,
|
|
39
|
+
css: [defaultHiddenStyles, above && showAboveQueries[above], below && showBelowQueries[below], resolvedStyles.emotion]
|
|
36
40
|
}, children);
|
|
37
41
|
};
|
|
@@ -62,7 +62,7 @@ const Anchor = ({
|
|
|
62
62
|
action: 'clicked',
|
|
63
63
|
componentName: componentName || 'Anchor',
|
|
64
64
|
packageName: "@atlaskit/primitives",
|
|
65
|
-
packageVersion: "6.
|
|
65
|
+
packageVersion: "6.2.0",
|
|
66
66
|
analyticsData: analyticsContext,
|
|
67
67
|
actionSubject: 'link'
|
|
68
68
|
});
|
|
@@ -80,7 +80,7 @@ const Anchor = ({
|
|
|
80
80
|
*
|
|
81
81
|
* - a link component is set in the app provider
|
|
82
82
|
* - it's not an external link (starting with `http://` or `https://`)
|
|
83
|
-
* - it's not a non-HTTP-based link (e.g.
|
|
83
|
+
* - it's not a non-HTTP-based link (e.g. emails, phone numbers, hash links etc.).
|
|
84
84
|
*/
|
|
85
85
|
const isRouterLink = RouterLink && !isExternal && !isNonHttpBased;
|
|
86
86
|
const hrefObjectUsedWithoutRouterLink = RouterLink === undefined && typeof href === 'object';
|
|
@@ -64,7 +64,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
action: 'clicked',
|
|
65
65
|
componentName: componentName || 'Pressable',
|
|
66
66
|
packageName: "@atlaskit/primitives",
|
|
67
|
-
packageVersion: "6.
|
|
67
|
+
packageVersion: "6.2.0",
|
|
68
68
|
analyticsData: analyticsContext,
|
|
69
69
|
actionSubject: 'button'
|
|
70
70
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { parseXcss } from '../xcss/xcss';
|
|
4
5
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|
|
5
6
|
const hideAboveQueries = UNSAFE_buildAboveMediaQueryCSS({
|
|
6
7
|
display: 'none'
|
|
@@ -20,9 +21,12 @@ export const Hide = ({
|
|
|
20
21
|
above,
|
|
21
22
|
below,
|
|
22
23
|
children,
|
|
23
|
-
as: AsElement = 'div'
|
|
24
|
+
as: AsElement = 'div',
|
|
25
|
+
xcss
|
|
24
26
|
}) => {
|
|
27
|
+
const resolvedStyles = parseXcss(xcss);
|
|
25
28
|
return jsx(AsElement, {
|
|
26
|
-
|
|
29
|
+
className: resolvedStyles.static,
|
|
30
|
+
css: [above && hideAboveQueries[above], below && hideBelowQueries[below], resolvedStyles.emotion]
|
|
27
31
|
}, children);
|
|
28
32
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { parseXcss } from '../xcss/xcss';
|
|
4
5
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|
|
5
6
|
const showAboveQueries = UNSAFE_buildAboveMediaQueryCSS({
|
|
6
7
|
display: 'revert'
|
|
@@ -23,9 +24,12 @@ export const Show = ({
|
|
|
23
24
|
above,
|
|
24
25
|
below,
|
|
25
26
|
children,
|
|
26
|
-
as: AsElement = 'div'
|
|
27
|
+
as: AsElement = 'div',
|
|
28
|
+
xcss
|
|
27
29
|
}) => {
|
|
30
|
+
const resolvedStyles = parseXcss(xcss);
|
|
28
31
|
return jsx(AsElement, {
|
|
29
|
-
|
|
32
|
+
className: resolvedStyles.static,
|
|
33
|
+
css: [defaultHiddenStyles, above && showAboveQueries[above], below && showBelowQueries[below], resolvedStyles.emotion]
|
|
30
34
|
}, children);
|
|
31
35
|
};
|
|
@@ -66,7 +66,7 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
66
66
|
action: 'clicked',
|
|
67
67
|
componentName: componentName || 'Anchor',
|
|
68
68
|
packageName: "@atlaskit/primitives",
|
|
69
|
-
packageVersion: "6.
|
|
69
|
+
packageVersion: "6.2.0",
|
|
70
70
|
analyticsData: analyticsContext,
|
|
71
71
|
actionSubject: 'link'
|
|
72
72
|
});
|
|
@@ -84,7 +84,7 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
84
84
|
*
|
|
85
85
|
* - a link component is set in the app provider
|
|
86
86
|
* - it's not an external link (starting with `http://` or `https://`)
|
|
87
|
-
* - it's not a non-HTTP-based link (e.g.
|
|
87
|
+
* - it's not a non-HTTP-based link (e.g. emails, phone numbers, hash links etc.).
|
|
88
88
|
*/
|
|
89
89
|
var isRouterLink = RouterLink && !isExternal && !isNonHttpBased;
|
|
90
90
|
var hrefObjectUsedWithoutRouterLink = RouterLink === undefined && _typeof(href) === 'object';
|
|
@@ -68,7 +68,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
68
68
|
action: 'clicked',
|
|
69
69
|
componentName: componentName || 'Pressable',
|
|
70
70
|
packageName: "@atlaskit/primitives",
|
|
71
|
-
packageVersion: "6.
|
|
71
|
+
packageVersion: "6.2.0",
|
|
72
72
|
analyticsData: analyticsContext,
|
|
73
73
|
actionSubject: 'button'
|
|
74
74
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { parseXcss } from '../xcss/xcss';
|
|
4
5
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|
|
5
6
|
var hideAboveQueries = UNSAFE_buildAboveMediaQueryCSS({
|
|
6
7
|
display: 'none'
|
|
@@ -21,8 +22,11 @@ export var Hide = function Hide(_ref) {
|
|
|
21
22
|
below = _ref.below,
|
|
22
23
|
children = _ref.children,
|
|
23
24
|
_ref$as = _ref.as,
|
|
24
|
-
AsElement = _ref$as === void 0 ? 'div' : _ref$as
|
|
25
|
+
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
26
|
+
xcss = _ref.xcss;
|
|
27
|
+
var resolvedStyles = parseXcss(xcss);
|
|
25
28
|
return jsx(AsElement, {
|
|
26
|
-
|
|
29
|
+
className: resolvedStyles.static,
|
|
30
|
+
css: [above && hideAboveQueries[above], below && hideBelowQueries[below], resolvedStyles.emotion]
|
|
27
31
|
}, children);
|
|
28
32
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { parseXcss } from '../xcss/xcss';
|
|
4
5
|
import { UNSAFE_buildAboveMediaQueryCSS, UNSAFE_buildBelowMediaQueryCSS } from './build-media-query-css';
|
|
5
6
|
var showAboveQueries = UNSAFE_buildAboveMediaQueryCSS({
|
|
6
7
|
display: 'revert'
|
|
@@ -24,8 +25,11 @@ export var Show = function Show(_ref) {
|
|
|
24
25
|
below = _ref.below,
|
|
25
26
|
children = _ref.children,
|
|
26
27
|
_ref$as = _ref.as,
|
|
27
|
-
AsElement = _ref$as === void 0 ? 'div' : _ref$as
|
|
28
|
+
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
29
|
+
xcss = _ref.xcss;
|
|
30
|
+
var resolvedStyles = parseXcss(xcss);
|
|
28
31
|
return jsx(AsElement, {
|
|
29
|
-
|
|
32
|
+
className: resolvedStyles.static,
|
|
33
|
+
css: [defaultHiddenStyles, above && showAboveQueries[above], below && showBelowQueries[below], resolvedStyles.emotion]
|
|
30
34
|
}, children);
|
|
31
35
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type RouterLinkComponentProps } from '@atlaskit/app-provider';
|
|
4
4
|
import { type BoxProps } from './box';
|
|
5
5
|
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | 'children' | 'style' | 'onClick'> & {
|
|
@@ -8,7 +8,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
|
|
|
8
8
|
*/
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
/**
|
|
11
|
-
* Handler
|
|
11
|
+
* Handler called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details.
|
|
12
12
|
*/
|
|
13
13
|
onClick?: (e: React.MouseEvent<HTMLAnchorElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
14
14
|
/**
|
|
@@ -9,7 +9,7 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Handler
|
|
12
|
+
* 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.
|
|
13
13
|
*/
|
|
14
14
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
15
15
|
/**
|
|
@@ -42,7 +42,7 @@ declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"but
|
|
|
42
42
|
children: ReactNode;
|
|
43
43
|
isDisabled?: boolean | undefined;
|
|
44
44
|
/**
|
|
45
|
-
* Handler
|
|
45
|
+
* 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.
|
|
46
46
|
*/
|
|
47
47
|
onClick?: ((e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void) | undefined;
|
|
48
48
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type
|
|
4
|
+
import { type BasePrimitiveProps } from '../components/types';
|
|
5
|
+
import { type Breakpoint } from './types';
|
|
5
6
|
type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
|
|
6
7
|
type ResponsiveHideProps = {
|
|
7
8
|
as?: As;
|
|
@@ -24,7 +25,7 @@ type ResponsiveHideProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
above: Exclude<Breakpoint, 'xxs'>;
|
|
26
27
|
below?: never;
|
|
27
|
-
})
|
|
28
|
+
}) & Pick<BasePrimitiveProps, 'xcss'>;
|
|
28
29
|
/**
|
|
29
30
|
* Hides the content at a given breakpoint. By default, content is shown. The primary use case is for visual presentation.
|
|
30
31
|
* Mix `<Hide above="md">` with `<Show above="md">` to achieve content that shifts at a breakpoint.
|
|
@@ -33,5 +34,5 @@ type ResponsiveHideProps = {
|
|
|
33
34
|
* - This only uses `display: none` hide, it does not skip rendering of children trees.
|
|
34
35
|
* - As this is rendered at all times, there is little performance savings here (just that this is not painted).
|
|
35
36
|
*/
|
|
36
|
-
export declare const Hide: ({ above, below, children, as: AsElement, }: ResponsiveHideProps) => jsx.JSX.Element;
|
|
37
|
+
export declare const Hide: ({ above, below, children, as: AsElement, xcss, }: ResponsiveHideProps) => jsx.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { type BasePrimitiveProps } from '../components/types';
|
|
4
5
|
import type { Breakpoint } from './types';
|
|
5
6
|
type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
|
|
6
7
|
type ResponsiveShowProps = {
|
|
@@ -24,7 +25,7 @@ type ResponsiveShowProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
above: Exclude<Breakpoint, 'xxs'>;
|
|
26
27
|
below?: never;
|
|
27
|
-
})
|
|
28
|
+
}) & Pick<BasePrimitiveProps, 'xcss'>;
|
|
28
29
|
/**
|
|
29
30
|
* Shows the content at a given breakpoint. By default, content is hidden. The primary use case is for visual presentation.
|
|
30
31
|
* Mix `<Show above="md">` with `<Hide above="md">` to achieve content that shifts at a breakpoint.
|
|
@@ -33,5 +34,5 @@ type ResponsiveShowProps = {
|
|
|
33
34
|
* - This only uses `display: none` and `display: revert` to show/hide, it does not skip rendering of children trees.
|
|
34
35
|
* - As this is rendered at all times, there is little performance savings here (just that this is not painted).
|
|
35
36
|
*/
|
|
36
|
-
export declare const Show: ({ above, below, children, as: AsElement, }: ResponsiveShowProps) => jsx.JSX.Element;
|
|
37
|
+
export declare const Show: ({ above, below, children, as: AsElement, xcss, }: ResponsiveShowProps) => jsx.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import { type RouterLinkComponentProps } from '@atlaskit/app-provider';
|
|
4
4
|
import { type BoxProps } from './box';
|
|
5
5
|
export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> = RouterLinkComponentProps<RouterLinkConfig> & Omit<BoxProps<'a'>, 'href' | 'as' | 'children' | 'style' | 'onClick'> & {
|
|
@@ -8,7 +8,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
|
|
|
8
8
|
*/
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
/**
|
|
11
|
-
* Handler
|
|
11
|
+
* Handler called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details.
|
|
12
12
|
*/
|
|
13
13
|
onClick?: (e: React.MouseEvent<HTMLAnchorElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
14
14
|
/**
|
|
@@ -9,7 +9,7 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Handler
|
|
12
|
+
* 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.
|
|
13
13
|
*/
|
|
14
14
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
15
15
|
/**
|
|
@@ -42,7 +42,7 @@ declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"but
|
|
|
42
42
|
children: ReactNode;
|
|
43
43
|
isDisabled?: boolean | undefined;
|
|
44
44
|
/**
|
|
45
|
-
* Handler
|
|
45
|
+
* 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.
|
|
46
46
|
*/
|
|
47
47
|
onClick?: ((e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void) | undefined;
|
|
48
48
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type
|
|
4
|
+
import { type BasePrimitiveProps } from '../components/types';
|
|
5
|
+
import { type Breakpoint } from './types';
|
|
5
6
|
type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
|
|
6
7
|
type ResponsiveHideProps = {
|
|
7
8
|
as?: As;
|
|
@@ -24,7 +25,7 @@ type ResponsiveHideProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
above: Exclude<Breakpoint, 'xxs'>;
|
|
26
27
|
below?: never;
|
|
27
|
-
})
|
|
28
|
+
}) & Pick<BasePrimitiveProps, 'xcss'>;
|
|
28
29
|
/**
|
|
29
30
|
* Hides the content at a given breakpoint. By default, content is shown. The primary use case is for visual presentation.
|
|
30
31
|
* Mix `<Hide above="md">` with `<Show above="md">` to achieve content that shifts at a breakpoint.
|
|
@@ -33,5 +34,5 @@ type ResponsiveHideProps = {
|
|
|
33
34
|
* - This only uses `display: none` hide, it does not skip rendering of children trees.
|
|
34
35
|
* - As this is rendered at all times, there is little performance savings here (just that this is not painted).
|
|
35
36
|
*/
|
|
36
|
-
export declare const Hide: ({ above, below, children, as: AsElement, }: ResponsiveHideProps) => jsx.JSX.Element;
|
|
37
|
+
export declare const Hide: ({ above, below, children, as: AsElement, xcss, }: ResponsiveHideProps) => jsx.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { type BasePrimitiveProps } from '../components/types';
|
|
4
5
|
import type { Breakpoint } from './types';
|
|
5
6
|
type As = 'article' | 'aside' | 'dialog' | 'div' | 'footer' | 'header' | 'li' | 'main' | 'nav' | 'ol' | 'section' | 'span' | 'ul';
|
|
6
7
|
type ResponsiveShowProps = {
|
|
@@ -24,7 +25,7 @@ type ResponsiveShowProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
above: Exclude<Breakpoint, 'xxs'>;
|
|
26
27
|
below?: never;
|
|
27
|
-
})
|
|
28
|
+
}) & Pick<BasePrimitiveProps, 'xcss'>;
|
|
28
29
|
/**
|
|
29
30
|
* Shows the content at a given breakpoint. By default, content is hidden. The primary use case is for visual presentation.
|
|
30
31
|
* Mix `<Show above="md">` with `<Hide above="md">` to achieve content that shifts at a breakpoint.
|
|
@@ -33,5 +34,5 @@ type ResponsiveShowProps = {
|
|
|
33
34
|
* - This only uses `display: none` and `display: revert` to show/hide, it does not skip rendering of children trees.
|
|
34
35
|
* - As this is rendered at all times, there is little performance savings here (just that this is not painted).
|
|
35
36
|
*/
|
|
36
|
-
export declare const Show: ({ above, below, children, as: AsElement, }: ResponsiveShowProps) => jsx.JSX.Element;
|
|
37
|
+
export declare const Show: ({ above, below, children, as: AsElement, xcss, }: ResponsiveShowProps) => jsx.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
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 React
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
type BasePrimitiveProps,
|
|
8
|
+
type StyleProp,
|
|
9
|
+
} from '../src/components/types';
|
|
5
10
|
|
|
6
11
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
7
12
|
namespace Token {
|
|
@@ -30,19 +35,17 @@ export default function Anchor<
|
|
|
30
35
|
>(
|
|
31
36
|
_: {
|
|
32
37
|
/**
|
|
33
|
-
* A link can be provided as a string
|
|
34
|
-
* it can be mapped to the underlying router link component,
|
|
35
|
-
* or optionally a custom object defined in the generic type for advanced use.
|
|
38
|
+
* A link can be provided as a string If a router link configuration is set in the [app provider](https://atlassian.design/components/app-provider/examples), this can be mapped to an underlying router link component. For advanced usage an object can be passed. See [the code examples](https://atlassian.design/components/primitives/anchor/examples#router-links) for more information.
|
|
36
39
|
*/
|
|
37
40
|
href: string | RouterLinkConfig;
|
|
38
41
|
|
|
39
42
|
/**
|
|
40
|
-
* The `target` attribute of the anchor HTML element.
|
|
43
|
+
* The `target` attribute of the anchor HTML element.
|
|
41
44
|
*/
|
|
42
45
|
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
43
46
|
|
|
44
47
|
/**
|
|
45
|
-
* The `rel` attribute of the anchor HTML element.
|
|
48
|
+
* The `rel` attribute of the anchor HTML element.
|
|
46
49
|
*/
|
|
47
50
|
rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>['rel'];
|
|
48
51
|
|
|
@@ -81,6 +84,29 @@ export default function Anchor<
|
|
|
81
84
|
*/
|
|
82
85
|
paddingInlineEnd?: Space;
|
|
83
86
|
|
|
87
|
+
/**
|
|
88
|
+
* 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/anchor/examples#atlaskit-analytics) or [routing these to GASv3 analytics](https://atlassian.design/components/primitives/anchor/examples#gasv3-analytics).
|
|
89
|
+
*/
|
|
90
|
+
onClick?: (
|
|
91
|
+
e: React.MouseEvent<HTMLButtonElement>,
|
|
92
|
+
analyticsEvent: UIAnalyticsEvent,
|
|
93
|
+
) => void;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 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 'Anchor'. See [the code example](https://atlassian.design/components/primitives/anchor/examples#atlaskit-analytics) for more information.
|
|
97
|
+
*/
|
|
98
|
+
componentName?: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Additional information to be included in the `context` of Atlaskit analytics events that come from anchor. See [the code example](https://atlassian.design/components/primitives/anchor/examples#atlaskit-analytics) for more information.
|
|
102
|
+
*/
|
|
103
|
+
analyticsContext?: Record<string, any>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* An optional name used to identify the anchor to interaction content listeners. By default, anchor 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/anchor/examples#react-ufo-press-interactions) for more information.
|
|
107
|
+
*/
|
|
108
|
+
interactionName?: string;
|
|
109
|
+
|
|
84
110
|
/**
|
|
85
111
|
* A token alias for background color. See:<br>
|
|
86
112
|
* [https://atlassian.design/components/tokens/all-tokens#color-background](https://atlassian.design/components/tokens/all-tokens#color-background)<br>
|
|
@@ -92,7 +118,7 @@ export default function Anchor<
|
|
|
92
118
|
/**
|
|
93
119
|
* Elements to be rendered inside the primitive.
|
|
94
120
|
*/
|
|
95
|
-
children: ReactNode;
|
|
121
|
+
children: React.ReactNode;
|
|
96
122
|
|
|
97
123
|
/**
|
|
98
124
|
* Forwarded ref element.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
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 React
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type BasePrimitiveProps,
|
|
8
|
+
type StyleProp,
|
|
9
|
+
} from '../src/components/types';
|
|
7
10
|
|
|
8
11
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
9
12
|
namespace Token {
|
|
@@ -82,7 +85,7 @@ export default function Pressable(
|
|
|
82
85
|
backgroundColor?: Token.BackgroundColor;
|
|
83
86
|
|
|
84
87
|
/**
|
|
85
|
-
* Handler
|
|
88
|
+
* 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
89
|
*/
|
|
87
90
|
onClick?: (
|
|
88
91
|
e: React.MouseEvent<HTMLButtonElement>,
|
|
@@ -90,24 +93,24 @@ export default function Pressable(
|
|
|
90
93
|
) => void;
|
|
91
94
|
|
|
92
95
|
/**
|
|
93
|
-
* An optional name used to identify
|
|
96
|
+
* 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.
|
|
94
97
|
*/
|
|
95
|
-
|
|
98
|
+
componentName?: string;
|
|
96
99
|
|
|
97
100
|
/**
|
|
98
|
-
*
|
|
101
|
+
* 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.
|
|
99
102
|
*/
|
|
100
|
-
|
|
103
|
+
analyticsContext?: Record<string, any>;
|
|
101
104
|
|
|
102
105
|
/**
|
|
103
|
-
*
|
|
106
|
+
* 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.
|
|
104
107
|
*/
|
|
105
|
-
|
|
108
|
+
interactionName?: string;
|
|
106
109
|
|
|
107
110
|
/**
|
|
108
111
|
* Elements to be rendered inside the primitive.
|
|
109
112
|
*/
|
|
110
|
-
children: ReactNode;
|
|
113
|
+
children: React.ReactNode;
|
|
111
114
|
|
|
112
115
|
/**
|
|
113
116
|
* Forwarded ref element.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"slug": "primitives/text",
|
|
95
95
|
"id": "@atlaskit/primitives/text",
|
|
96
96
|
"status": {
|
|
97
|
-
"type": "
|
|
97
|
+
"type": "beta"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
{
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"@atlaskit/css": "^0.1.0",
|
|
129
129
|
"@atlaskit/ds-lib": "^2.3.0",
|
|
130
130
|
"@atlaskit/interaction-context": "^2.1.0",
|
|
131
|
-
"@atlaskit/tokens": "^1.
|
|
131
|
+
"@atlaskit/tokens": "^1.48.0",
|
|
132
132
|
"@atlaskit/visually-hidden": "^1.3.0",
|
|
133
133
|
"@babel/runtime": "^7.0.0",
|
|
134
134
|
"@emotion/react": "^11.7.1",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"@af/formatting": "*",
|
|
145
145
|
"@atlaskit/ssr": "*",
|
|
146
146
|
"@atlaskit/toggle": "^13.1.0",
|
|
147
|
-
"@atlaskit/tooltip": "^18.
|
|
147
|
+
"@atlaskit/tooltip": "^18.4.0",
|
|
148
148
|
"@atlaskit/visual-regression": "*",
|
|
149
149
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
150
150
|
"@atlassian/codegen": "^0.1.0",
|