@atlaskit/primitives 6.1.0 → 6.1.2
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 +17 -0
- package/constellation/pressable/code.mdx +1 -1
- package/constellation/pressable/examples.mdx +69 -8
- package/constellation/pressable/usage.mdx +1 -1
- package/dist/cjs/components/anchor.js +1 -1
- package/dist/cjs/components/pressable.js +2 -4
- package/dist/cjs/components/text.js +7 -1
- package/dist/cjs/index.js +15 -1
- package/dist/cjs/xcss/style-maps.partial.js +5 -2
- package/dist/es2019/components/anchor.js +1 -1
- package/dist/es2019/components/pressable.js +2 -4
- package/dist/es2019/components/text.js +7 -1
- package/dist/es2019/index.js +3 -1
- package/dist/es2019/xcss/style-maps.partial.js +5 -2
- package/dist/esm/components/anchor.js +1 -1
- package/dist/esm/components/pressable.js +2 -4
- package/dist/esm/components/text.js +7 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/xcss/style-maps.partial.js +5 -2
- package/dist/types/components/pressable.d.ts +9 -15
- package/dist/types/components/text.d.ts +3 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/types/xcss/style-maps.partial.d.ts +4 -1
- package/dist/types-ts4.5/components/pressable.d.ts +9 -15
- package/dist/types-ts4.5/components/text.d.ts +3 -3
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 6.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98149](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98149)
|
|
8
|
+
[`45101e24202a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/45101e24202a) -
|
|
9
|
+
Internal change only; update generated styles.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 6.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#97580](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97580)
|
|
17
|
+
[`496e5da89b3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/496e5da89b3b) -
|
|
18
|
+
Export unsafe surface APIs for use in heading component.
|
|
19
|
+
|
|
3
20
|
## 6.1.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Pressable
|
|
3
|
-
description: A pressable is a primitive
|
|
3
|
+
description: A pressable is a primitive for building custom buttons.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import PressableDefault from '../../examples/constellation/pressable/default';
|
|
8
8
|
import PressableBasic from '../../examples/constellation/pressable/basic';
|
|
9
9
|
import PressableStyled from '../../examples/constellation/pressable/styled';
|
|
10
|
+
import PressableWithoutVisibleLabels from '../../examples/constellation/pressable/without-visible-labels';
|
|
10
11
|
import PressableDisabled from '../../examples/constellation/pressable/disabled';
|
|
12
|
+
import PressableHtmlAttributes from '../../examples/constellation/pressable/html-attributes';
|
|
13
|
+
import PressablePressTracing from '../../examples/constellation/pressable/press-tracing';
|
|
14
|
+
import PressableAnalytics from '../../examples/constellation/pressable/analytics';
|
|
15
|
+
import PressableAnalyticsGASv3 from '../../examples/constellation/pressable/analytics-gasv3';
|
|
11
16
|
|
|
12
17
|
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
13
18
|
import SectionMessage from '@atlaskit/section-message';
|
|
@@ -18,7 +23,7 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
18
23
|
directoryName="primitives"
|
|
19
24
|
/>
|
|
20
25
|
|
|
21
|
-
Pressable is a primitive used for building custom buttons with Atlassian Design System styling and built-in event tracking.
|
|
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.
|
|
22
27
|
|
|
23
28
|
Only use Pressable when existing components such as [Button](/components/button/examples) are unsuitable and unable to be customized to fit your needs.
|
|
24
29
|
|
|
@@ -33,9 +38,7 @@ Pressable is unstyled by default.
|
|
|
33
38
|
|
|
34
39
|
## Basic styling with XCSS
|
|
35
40
|
|
|
36
|
-
Pressable can be styled using XCSS. Ensure styling indicates the interaction state using `:hover` and `:active` pseudo-classes.
|
|
37
|
-
|
|
38
|
-
By default, pressable includes consistent Atlassian Design System `:focus` styles so it's unnecessary to add your own.
|
|
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.
|
|
39
42
|
|
|
40
43
|
For more information on XCSS, see the dedicated [XCSS documentation](/components/primitives/xcss).
|
|
41
44
|
|
|
@@ -44,6 +47,16 @@ For more information on XCSS, see the dedicated [XCSS documentation](/components
|
|
|
44
47
|
packageName="@atlaskit/primitives/pressable"
|
|
45
48
|
/>
|
|
46
49
|
|
|
50
|
+
## Advanced styling
|
|
51
|
+
|
|
52
|
+
Use a combination of XCSS and other primitives for more complex designs.
|
|
53
|
+
|
|
54
|
+
<Example
|
|
55
|
+
Component={PressableStyled}
|
|
56
|
+
packageName="@atlaskit/primitives/pressable"
|
|
57
|
+
backgroundColor="white"
|
|
58
|
+
/>
|
|
59
|
+
|
|
47
60
|
## Disabled
|
|
48
61
|
|
|
49
62
|
Pressable can be disabled using the `isDisabled` prop. Disabled styles should be conditionally applied and defined using XCSS.
|
|
@@ -53,12 +66,60 @@ Pressable can be disabled using the `isDisabled` prop. Disabled styles should be
|
|
|
53
66
|
packageName="@atlaskit/primitives/pressable"
|
|
54
67
|
/>
|
|
55
68
|
|
|
56
|
-
##
|
|
69
|
+
## Buttons without visible labels
|
|
57
70
|
|
|
58
|
-
|
|
71
|
+
For buttons without visible labels such as icon buttons, ensure an accessible label is still available by using [the visually hidden component](/components/visually-hidden/examples). This will render hidden text inside the button, which is preferable over the `aria-label` attribute because not all screen readers translate this between languages.
|
|
72
|
+
|
|
73
|
+
Provide a tooltip to help sighted users understand the button's purpose rather than relying on iconography alone.
|
|
59
74
|
|
|
60
75
|
<Example
|
|
61
|
-
Component={
|
|
76
|
+
Component={PressableWithoutVisibleLabels}
|
|
62
77
|
packageName="@atlaskit/primitives/pressable"
|
|
63
78
|
backgroundColor="white"
|
|
64
79
|
/>
|
|
80
|
+
|
|
81
|
+
## HTML attributes
|
|
82
|
+
|
|
83
|
+
Pressable passes through all valid HTML attributes to the underlying `<button>` element. It will default the `type` attribute to `button` to prevent buttons unintentionally submitting forms.
|
|
84
|
+
|
|
85
|
+
<Example
|
|
86
|
+
Component={PressableHtmlAttributes}
|
|
87
|
+
packageName="@atlaskit/primitives/pressable"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
## Event tracking
|
|
91
|
+
|
|
92
|
+
Pressable has utilities to make tracking events easier. Events will not be captured unless listeners are setup to handle them.
|
|
93
|
+
|
|
94
|
+
### React UFO press interactions
|
|
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
|
|
104
|
+
|
|
105
|
+
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
|
+
|
|
107
|
+
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 'Pressable') and `analyticsContext` for passing other metadata.
|
|
108
|
+
|
|
109
|
+
See the event data in the console.
|
|
110
|
+
|
|
111
|
+
<Example
|
|
112
|
+
Component={PressableAnalytics}
|
|
113
|
+
packageName="@atlaskit/primitives/pressable"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
### GASv3 analytics
|
|
117
|
+
|
|
118
|
+
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
|
+
|
|
120
|
+
See the event data in the console.
|
|
121
|
+
|
|
122
|
+
<Example
|
|
123
|
+
Component={PressableAnalyticsGASv3}
|
|
124
|
+
packageName="@atlaskit/primitives/pressable"
|
|
125
|
+
/>
|
|
@@ -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.1.
|
|
79
|
+
packageVersion: "6.1.2",
|
|
80
80
|
analyticsData: analyticsContext,
|
|
81
81
|
actionSubject: 'link'
|
|
82
82
|
});
|
|
@@ -41,9 +41,7 @@ var focusRingStyles = (0, _xcss.xcss)({
|
|
|
41
41
|
/**
|
|
42
42
|
* __Pressable__
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* A Pressable is a primitive component that renders a `<button>`.
|
|
44
|
+
* A primitive for building custom buttons.
|
|
47
45
|
*
|
|
48
46
|
* - [Examples](https://atlassian.design/components/primitives/pressable/examples)
|
|
49
47
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
@@ -80,7 +78,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
80
78
|
action: 'clicked',
|
|
81
79
|
componentName: componentName || 'Pressable',
|
|
82
80
|
packageName: "@atlaskit/primitives",
|
|
83
|
-
packageVersion: "6.1.
|
|
81
|
+
packageVersion: "6.1.2",
|
|
84
82
|
analyticsData: analyticsContext,
|
|
85
83
|
actionSubject: 'button'
|
|
86
84
|
});
|
|
@@ -99,7 +99,13 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
99
99
|
var color = useColor(colorProp, hasTextAncestor);
|
|
100
100
|
var component = (0, _react2.jsx)(Component, {
|
|
101
101
|
ref: ref,
|
|
102
|
-
css: [resetStyles,
|
|
102
|
+
css: [resetStyles,
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
104
|
+
_styleMaps.fontStylesMap[size],
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
106
|
+
color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
108
|
+
weight && _styleMaps.fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
|
|
103
109
|
style: {
|
|
104
110
|
WebkitLineClamp: maxLines
|
|
105
111
|
},
|
package/dist/cjs/index.js
CHANGED
|
@@ -64,12 +64,24 @@ Object.defineProperty(exports, "UNSAFE_BREAKPOINTS_CONFIG", {
|
|
|
64
64
|
return _responsive.UNSAFE_BREAKPOINTS_CONFIG;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "UNSAFE_inverseColorMap", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _styleMaps.inverseColorMap;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
67
73
|
Object.defineProperty(exports, "UNSAFE_media", {
|
|
68
74
|
enumerable: true,
|
|
69
75
|
get: function get() {
|
|
70
76
|
return _responsive.UNSAFE_media;
|
|
71
77
|
}
|
|
72
78
|
});
|
|
79
|
+
Object.defineProperty(exports, "UNSAFE_useSurface", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function get() {
|
|
82
|
+
return _surfaceProvider.useSurface;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
73
85
|
Object.defineProperty(exports, "media", {
|
|
74
86
|
enumerable: true,
|
|
75
87
|
get: function get() {
|
|
@@ -98,4 +110,6 @@ var _bleed = _interopRequireDefault(require("./components/bleed"));
|
|
|
98
110
|
var _text = _interopRequireDefault(require("./components/text"));
|
|
99
111
|
var _pressable = _interopRequireDefault(require("./components/pressable"));
|
|
100
112
|
var _anchor = _interopRequireDefault(require("./components/anchor"));
|
|
101
|
-
var _responsive = require("./responsive");
|
|
113
|
+
var _responsive = require("./responsive");
|
|
114
|
+
var _surfaceProvider = require("./components/internal/surface-provider");
|
|
115
|
+
var _styleMaps = require("./xcss/style-maps.partial");
|
|
@@ -497,7 +497,7 @@ var borderRadiusMap = exports.borderRadiusMap = {
|
|
|
497
497
|
|
|
498
498
|
/**
|
|
499
499
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
500
|
-
* @codegen <<SignedSource::
|
|
500
|
+
* @codegen <<SignedSource::01b50b6fc795db50002edbeb24634575>>
|
|
501
501
|
* @codegenId typography
|
|
502
502
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
503
503
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -517,8 +517,11 @@ var fontWeightMap = exports.fontWeightMap = {
|
|
|
517
517
|
semibold: "var(--ds-font-weight-semibold, 600)"
|
|
518
518
|
};
|
|
519
519
|
var fontFamilyMap = exports.fontFamilyMap = {
|
|
520
|
+
'font.family.body': "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
520
521
|
'font.family.brand.body': "var(--ds-font-family-brand-body, \"Charlie Text\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
521
|
-
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
522
|
+
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
523
|
+
'font.family.code': "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
524
|
+
'font.family.heading': "var(--ds-font-family-heading, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
522
525
|
};
|
|
523
526
|
|
|
524
527
|
/**
|
|
@@ -28,9 +28,7 @@ const focusRingStyles = xcss({
|
|
|
28
28
|
/**
|
|
29
29
|
* __Pressable__
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* A Pressable is a primitive component that renders a `<button>`.
|
|
31
|
+
* A primitive for building custom buttons.
|
|
34
32
|
*
|
|
35
33
|
* - [Examples](https://atlassian.design/components/primitives/pressable/examples)
|
|
36
34
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
@@ -66,7 +64,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
66
64
|
action: 'clicked',
|
|
67
65
|
componentName: componentName || 'Pressable',
|
|
68
66
|
packageName: "@atlaskit/primitives",
|
|
69
|
-
packageVersion: "6.1.
|
|
67
|
+
packageVersion: "6.1.2",
|
|
70
68
|
analyticsData: analyticsContext,
|
|
71
69
|
actionSubject: 'button'
|
|
72
70
|
});
|
|
@@ -88,7 +88,13 @@ const Text = /*#__PURE__*/forwardRef(({
|
|
|
88
88
|
const color = useColor(colorProp, hasTextAncestor);
|
|
89
89
|
const component = jsx(Component, {
|
|
90
90
|
ref: ref,
|
|
91
|
-
css: [resetStyles,
|
|
91
|
+
css: [resetStyles,
|
|
92
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
93
|
+
fontStylesMap[size],
|
|
94
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
95
|
+
color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
97
|
+
weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
|
|
92
98
|
style: {
|
|
93
99
|
WebkitLineClamp: maxLines
|
|
94
100
|
},
|
package/dist/es2019/index.js
CHANGED
|
@@ -8,4 +8,6 @@ export { default as Bleed } from './components/bleed';
|
|
|
8
8
|
export { default as Text } from './components/text';
|
|
9
9
|
export { default as Pressable } from './components/pressable';
|
|
10
10
|
export { default as UNSAFE_ANCHOR } from './components/anchor';
|
|
11
|
-
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
11
|
+
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
12
|
+
export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
|
|
13
|
+
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
|
@@ -491,7 +491,7 @@ export const borderRadiusMap = {
|
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
494
|
-
* @codegen <<SignedSource::
|
|
494
|
+
* @codegen <<SignedSource::01b50b6fc795db50002edbeb24634575>>
|
|
495
495
|
* @codegenId typography
|
|
496
496
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
497
497
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -511,8 +511,11 @@ export const fontWeightMap = {
|
|
|
511
511
|
semibold: "var(--ds-font-weight-semibold, 600)"
|
|
512
512
|
};
|
|
513
513
|
export const fontFamilyMap = {
|
|
514
|
+
'font.family.body': "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
514
515
|
'font.family.brand.body': "var(--ds-font-family-brand-body, \"Charlie Text\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
515
|
-
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
516
|
+
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
517
|
+
'font.family.code': "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
518
|
+
'font.family.heading': "var(--ds-font-family-heading, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
516
519
|
};
|
|
517
520
|
|
|
518
521
|
/**
|
|
@@ -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.1.
|
|
69
|
+
packageVersion: "6.1.2",
|
|
70
70
|
analyticsData: analyticsContext,
|
|
71
71
|
actionSubject: 'link'
|
|
72
72
|
});
|
|
@@ -31,9 +31,7 @@ var focusRingStyles = xcss({
|
|
|
31
31
|
/**
|
|
32
32
|
* __Pressable__
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* A Pressable is a primitive component that renders a `<button>`.
|
|
34
|
+
* A primitive for building custom buttons.
|
|
37
35
|
*
|
|
38
36
|
* - [Examples](https://atlassian.design/components/primitives/pressable/examples)
|
|
39
37
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
@@ -70,7 +68,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
68
|
action: 'clicked',
|
|
71
69
|
componentName: componentName || 'Pressable',
|
|
72
70
|
packageName: "@atlaskit/primitives",
|
|
73
|
-
packageVersion: "6.1.
|
|
71
|
+
packageVersion: "6.1.2",
|
|
74
72
|
analyticsData: analyticsContext,
|
|
75
73
|
actionSubject: 'button'
|
|
76
74
|
});
|
|
@@ -91,7 +91,13 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
91
91
|
var color = useColor(colorProp, hasTextAncestor);
|
|
92
92
|
var component = jsx(Component, {
|
|
93
93
|
ref: ref,
|
|
94
|
-
css: [resetStyles,
|
|
94
|
+
css: [resetStyles,
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
96
|
+
fontStylesMap[size],
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
98
|
+
color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
100
|
+
weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
|
|
95
101
|
style: {
|
|
96
102
|
WebkitLineClamp: maxLines
|
|
97
103
|
},
|
package/dist/esm/index.js
CHANGED
|
@@ -8,4 +8,6 @@ export { default as Bleed } from './components/bleed';
|
|
|
8
8
|
export { default as Text } from './components/text';
|
|
9
9
|
export { default as Pressable } from './components/pressable';
|
|
10
10
|
export { default as UNSAFE_ANCHOR } from './components/anchor';
|
|
11
|
-
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
11
|
+
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
12
|
+
export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
|
|
13
|
+
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
|
@@ -491,7 +491,7 @@ export var borderRadiusMap = {
|
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
494
|
-
* @codegen <<SignedSource::
|
|
494
|
+
* @codegen <<SignedSource::01b50b6fc795db50002edbeb24634575>>
|
|
495
495
|
* @codegenId typography
|
|
496
496
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
497
497
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -511,8 +511,11 @@ export var fontWeightMap = {
|
|
|
511
511
|
semibold: "var(--ds-font-weight-semibold, 600)"
|
|
512
512
|
};
|
|
513
513
|
export var fontFamilyMap = {
|
|
514
|
+
'font.family.body': "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
514
515
|
'font.family.brand.body': "var(--ds-font-family-brand-body, \"Charlie Text\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
515
|
-
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
516
|
+
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
517
|
+
'font.family.code': "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
518
|
+
'font.family.heading': "var(--ds-font-family-heading, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
516
519
|
};
|
|
517
520
|
|
|
518
521
|
/**
|
|
@@ -9,30 +9,26 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Handler to be called on click. The second argument can be
|
|
12
|
+
* Handler to be 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
|
/**
|
|
16
|
-
* An optional name used to identify
|
|
17
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
16
|
+
* 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).
|
|
18
17
|
*/
|
|
19
18
|
interactionName?: string;
|
|
20
19
|
/**
|
|
21
|
-
* An optional component name used to identify this component
|
|
22
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
20
|
+
* 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'.
|
|
23
21
|
*/
|
|
24
22
|
componentName?: string;
|
|
25
23
|
/**
|
|
26
|
-
* Additional information to be included in the `context` of analytics events that come from pressable.
|
|
24
|
+
* Additional information to be included in the `context` of Atlaskit analytics events that come from pressable.
|
|
27
25
|
*/
|
|
28
26
|
analyticsContext?: Record<string, any>;
|
|
29
27
|
};
|
|
30
28
|
/**
|
|
31
29
|
* __Pressable__
|
|
32
30
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* A Pressable is a primitive component that renders a `<button>`.
|
|
31
|
+
* A primitive for building custom buttons.
|
|
36
32
|
*
|
|
37
33
|
* - [Examples](https://atlassian.design/components/primitives/pressable/examples)
|
|
38
34
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
@@ -46,21 +42,19 @@ declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"but
|
|
|
46
42
|
children: ReactNode;
|
|
47
43
|
isDisabled?: boolean | undefined;
|
|
48
44
|
/**
|
|
49
|
-
* Handler to be called on click. The second argument can be
|
|
45
|
+
* Handler to be 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.
|
|
50
46
|
*/
|
|
51
47
|
onClick?: ((e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void) | undefined;
|
|
52
48
|
/**
|
|
53
|
-
* An optional name used to identify
|
|
54
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
49
|
+
* 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).
|
|
55
50
|
*/
|
|
56
51
|
interactionName?: string | undefined;
|
|
57
52
|
/**
|
|
58
|
-
* An optional component name used to identify this component
|
|
59
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
53
|
+
* 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'.
|
|
60
54
|
*/
|
|
61
55
|
componentName?: string | undefined;
|
|
62
56
|
/**
|
|
63
|
-
* Additional information to be included in the `context` of analytics events that come from pressable.
|
|
57
|
+
* Additional information to be included in the `context` of Atlaskit analytics events that come from pressable.
|
|
64
58
|
*/
|
|
65
59
|
analyticsContext?: Record<string, any> | undefined;
|
|
66
60
|
}, "padding" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "backgroundColor" | "color" | "translate" | "hidden" | "key" | "value" | "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" | keyof import("./types").BasePrimitiveProps | "isDisabled" | "interactionName" | "componentName" | "analyticsContext"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
|
-
import { FontSize, FontWeight, TextColor } from '../xcss/style-maps.partial';
|
|
2
|
+
import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
|
|
3
|
+
import { type FontSize, type FontWeight, type TextColor } from '../xcss/style-maps.partial';
|
|
4
4
|
import type { BasePrimitiveProps } from './types';
|
|
5
5
|
declare const asAllowlist: readonly ["span", "p", "strong", "em"];
|
|
6
6
|
type AsElement = (typeof asAllowlist)[number];
|
|
@@ -16,7 +16,7 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Token representing text color with a built-in fallback value.
|
|
18
18
|
* Will apply inverse text color automatically if placed within a Box with bold background color.
|
|
19
|
-
* Defaults to `text
|
|
19
|
+
* Defaults to `color.text` if not nested in other Text components.
|
|
20
20
|
*/
|
|
21
21
|
color?: TextColor | 'inherit';
|
|
22
22
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,3 +21,5 @@ export { default as UNSAFE_ANCHOR } from './components/anchor';
|
|
|
21
21
|
export type { AnchorProps as UNSAFE_AnchorProps } from './components/anchor';
|
|
22
22
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
23
23
|
export type { Breakpoint, MediaQuery } from './responsive';
|
|
24
|
+
export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
|
|
25
|
+
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
|
@@ -516,7 +516,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
516
516
|
*/
|
|
517
517
|
/**
|
|
518
518
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
519
|
-
* @codegen <<SignedSource::
|
|
519
|
+
* @codegen <<SignedSource::01b50b6fc795db50002edbeb24634575>>
|
|
520
520
|
* @codegenId typography
|
|
521
521
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
522
522
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -538,8 +538,11 @@ export declare const fontWeightMap: {
|
|
|
538
538
|
};
|
|
539
539
|
export type FontWeight = keyof typeof fontWeightMap;
|
|
540
540
|
export declare const fontFamilyMap: {
|
|
541
|
+
'font.family.body': "var(--ds-font-family-body)";
|
|
541
542
|
'font.family.brand.body': "var(--ds-font-family-brand-body)";
|
|
542
543
|
'font.family.brand.heading': "var(--ds-font-family-brand-heading)";
|
|
544
|
+
'font.family.code': "var(--ds-font-family-code)";
|
|
545
|
+
'font.family.heading': "var(--ds-font-family-heading)";
|
|
543
546
|
};
|
|
544
547
|
export type FontFamily = keyof typeof fontFamilyMap;
|
|
545
548
|
/**
|
|
@@ -9,30 +9,26 @@ export type PressableProps = Omit<BoxProps<'button'>, 'disabled' | 'as' | 'child
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Handler to be called on click. The second argument can be
|
|
12
|
+
* Handler to be 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
|
/**
|
|
16
|
-
* An optional name used to identify
|
|
17
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
16
|
+
* 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).
|
|
18
17
|
*/
|
|
19
18
|
interactionName?: string;
|
|
20
19
|
/**
|
|
21
|
-
* An optional component name used to identify this component
|
|
22
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
20
|
+
* 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'.
|
|
23
21
|
*/
|
|
24
22
|
componentName?: string;
|
|
25
23
|
/**
|
|
26
|
-
* Additional information to be included in the `context` of analytics events that come from pressable.
|
|
24
|
+
* Additional information to be included in the `context` of Atlaskit analytics events that come from pressable.
|
|
27
25
|
*/
|
|
28
26
|
analyticsContext?: Record<string, any>;
|
|
29
27
|
};
|
|
30
28
|
/**
|
|
31
29
|
* __Pressable__
|
|
32
30
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* A Pressable is a primitive component that renders a `<button>`.
|
|
31
|
+
* A primitive for building custom buttons.
|
|
36
32
|
*
|
|
37
33
|
* - [Examples](https://atlassian.design/components/primitives/pressable/examples)
|
|
38
34
|
* - [Code](https://atlassian.design/components/primitives/pressable/code)
|
|
@@ -46,21 +42,19 @@ declare const Pressable: React.ForwardRefExoticComponent<Pick<Omit<BoxProps<"but
|
|
|
46
42
|
children: ReactNode;
|
|
47
43
|
isDisabled?: boolean | undefined;
|
|
48
44
|
/**
|
|
49
|
-
* Handler to be called on click. The second argument can be
|
|
45
|
+
* Handler to be 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.
|
|
50
46
|
*/
|
|
51
47
|
onClick?: ((e: React.MouseEvent<HTMLButtonElement>, analyticsEvent: UIAnalyticsEvent) => void) | undefined;
|
|
52
48
|
/**
|
|
53
|
-
* An optional name used to identify
|
|
54
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
49
|
+
* 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).
|
|
55
50
|
*/
|
|
56
51
|
interactionName?: string | undefined;
|
|
57
52
|
/**
|
|
58
|
-
* An optional component name used to identify this component
|
|
59
|
-
* see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
|
|
53
|
+
* 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'.
|
|
60
54
|
*/
|
|
61
55
|
componentName?: string | undefined;
|
|
62
56
|
/**
|
|
63
|
-
* Additional information to be included in the `context` of analytics events that come from pressable.
|
|
57
|
+
* Additional information to be included in the `context` of Atlaskit analytics events that come from pressable.
|
|
64
58
|
*/
|
|
65
59
|
analyticsContext?: Record<string, any> | undefined;
|
|
66
60
|
}, "padding" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "backgroundColor" | "color" | "translate" | "hidden" | "key" | "value" | "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" | keyof import("./types").BasePrimitiveProps | "isDisabled" | "interactionName" | "componentName" | "analyticsContext"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
|
-
import { FontSize, FontWeight, TextColor } from '../xcss/style-maps.partial';
|
|
2
|
+
import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
|
|
3
|
+
import { type FontSize, type FontWeight, type TextColor } from '../xcss/style-maps.partial';
|
|
4
4
|
import type { BasePrimitiveProps } from './types';
|
|
5
5
|
declare const asAllowlist: readonly [
|
|
6
6
|
"span",
|
|
@@ -21,7 +21,7 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
21
21
|
/**
|
|
22
22
|
* Token representing text color with a built-in fallback value.
|
|
23
23
|
* Will apply inverse text color automatically if placed within a Box with bold background color.
|
|
24
|
-
* Defaults to `text
|
|
24
|
+
* Defaults to `color.text` if not nested in other Text components.
|
|
25
25
|
*/
|
|
26
26
|
color?: TextColor | 'inherit';
|
|
27
27
|
/**
|
|
@@ -21,3 +21,5 @@ export { default as UNSAFE_ANCHOR } from './components/anchor';
|
|
|
21
21
|
export type { AnchorProps as UNSAFE_AnchorProps } from './components/anchor';
|
|
22
22
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
23
23
|
export type { Breakpoint, MediaQuery } from './responsive';
|
|
24
|
+
export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
|
|
25
|
+
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
|
@@ -516,7 +516,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
516
516
|
*/
|
|
517
517
|
/**
|
|
518
518
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
519
|
-
* @codegen <<SignedSource::
|
|
519
|
+
* @codegen <<SignedSource::01b50b6fc795db50002edbeb24634575>>
|
|
520
520
|
* @codegenId typography
|
|
521
521
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
522
522
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -538,8 +538,11 @@ export declare const fontWeightMap: {
|
|
|
538
538
|
};
|
|
539
539
|
export type FontWeight = keyof typeof fontWeightMap;
|
|
540
540
|
export declare const fontFamilyMap: {
|
|
541
|
+
'font.family.body': "var(--ds-font-family-body)";
|
|
541
542
|
'font.family.brand.body': "var(--ds-font-family-brand-body)";
|
|
542
543
|
'font.family.brand.heading': "var(--ds-font-family-brand-heading)";
|
|
544
|
+
'font.family.code': "var(--ds-font-family-code)";
|
|
545
|
+
'font.family.heading': "var(--ds-font-family-heading)";
|
|
543
546
|
};
|
|
544
547
|
export type FontFamily = keyof typeof fontFamilyMap;
|
|
545
548
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -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.47.0",
|
|
132
132
|
"@atlaskit/visually-hidden": "^1.3.0",
|
|
133
133
|
"@babel/runtime": "^7.0.0",
|
|
134
134
|
"@emotion/react": "^11.7.1",
|