@atlaskit/primitives 3.0.0 → 3.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 +12 -0
- package/constellation/text/examples.mdx +16 -9
- package/dist/cjs/components/anchor.js +4 -2
- package/dist/cjs/components/bleed.js +3 -2
- package/dist/cjs/components/box.js +5 -5
- package/dist/cjs/components/flex.js +3 -2
- package/dist/cjs/components/grid.js +3 -2
- package/dist/cjs/components/inline.js +8 -3
- package/dist/cjs/components/pressable.js +5 -1
- package/dist/cjs/components/stack.js +8 -3
- package/dist/cjs/components/text.js +37 -21
- package/dist/cjs/xcss/xcss.js +52 -14
- package/dist/es2019/components/anchor.js +4 -2
- package/dist/es2019/components/bleed.js +3 -2
- package/dist/es2019/components/box.js +5 -5
- package/dist/es2019/components/flex.js +3 -2
- package/dist/es2019/components/grid.js +3 -2
- package/dist/es2019/components/inline.js +8 -3
- package/dist/es2019/components/pressable.js +5 -1
- package/dist/es2019/components/stack.js +8 -3
- package/dist/es2019/components/text.js +25 -13
- package/dist/es2019/xcss/xcss.js +38 -8
- package/dist/esm/components/anchor.js +4 -2
- package/dist/esm/components/bleed.js +3 -2
- package/dist/esm/components/box.js +5 -5
- package/dist/esm/components/flex.js +3 -2
- package/dist/esm/components/grid.js +3 -2
- package/dist/esm/components/inline.js +8 -3
- package/dist/esm/components/pressable.js +5 -1
- package/dist/esm/components/stack.js +8 -3
- package/dist/esm/components/text.js +28 -13
- package/dist/esm/xcss/xcss.js +52 -10
- package/dist/types/components/flex.d.ts +2 -2
- package/dist/types/components/grid.d.ts +3 -3
- package/dist/types/components/pressable.d.ts +1 -1
- package/dist/types/components/stack.d.ts +1 -1
- package/dist/types/components/text.d.ts +3 -3
- package/dist/types/components/types.d.ts +3 -2
- package/dist/types/xcss/xcss.d.ts +11 -5
- package/dist/types-ts4.5/components/flex.d.ts +2 -2
- package/dist/types-ts4.5/components/grid.d.ts +3 -3
- package/dist/types-ts4.5/components/pressable.d.ts +1 -1
- package/dist/types-ts4.5/components/stack.d.ts +1 -1
- package/dist/types-ts4.5/components/text.d.ts +3 -3
- package/dist/types-ts4.5/components/types.d.ts +3 -2
- package/dist/types-ts4.5/xcss/xcss.d.ts +11 -5
- package/package.json +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { StrictXCSSProp, XCSSAllProperties, XCSSAllPseudos } from '@atlaskit/css';
|
|
2
3
|
import type { XCSS } from '../xcss/xcss';
|
|
3
4
|
export type BasePrimitiveProps = {
|
|
4
5
|
/**
|
|
@@ -11,9 +12,9 @@ export type BasePrimitiveProps = {
|
|
|
11
12
|
*/
|
|
12
13
|
'data-testid'?: never;
|
|
13
14
|
/**
|
|
14
|
-
* Apply a subset of permitted styles
|
|
15
|
+
* Apply a subset of permitted styles powered by Atlassian Design System design tokens.
|
|
15
16
|
*/
|
|
16
|
-
xcss?: XCSS | Array<XCSS | false | undefined>;
|
|
17
|
+
xcss?: XCSS | Array<XCSS | false | undefined> | StrictXCSSProp<XCSSAllProperties, XCSSAllPseudos>;
|
|
17
18
|
/**
|
|
18
19
|
* Accessible role.
|
|
19
20
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css as cssEmotion } from '@emotion/react';
|
|
2
1
|
import type { CSSPropertiesWithMultiValues, SerializedStyles } from '@emotion/serialize';
|
|
3
2
|
import type * as CSS from 'csstype';
|
|
3
|
+
import type { StrictXCSSProp, XCSSAllProperties, XCSSAllPseudos } from '@atlaskit/css';
|
|
4
4
|
import type { MediaQuery } from '../responsive/types';
|
|
5
5
|
import { TokenisedProps } from './style-maps.partial';
|
|
6
6
|
export declare const tokensMap: {
|
|
@@ -1627,11 +1627,17 @@ export declare const tokensMap: {
|
|
|
1627
1627
|
};
|
|
1628
1628
|
declare const uniqueSymbol: unique symbol;
|
|
1629
1629
|
/**
|
|
1630
|
-
*
|
|
1631
|
-
*
|
|
1630
|
+
* Picks out runtime XCSS objects and build-time XCSS strings. This is needed
|
|
1631
|
+
* to supported both Emotion and Compiled styles until we've fully migrated
|
|
1632
|
+
* to Compiled.
|
|
1633
|
+
*
|
|
1634
|
+
* @private
|
|
1635
|
+
* @deprecated
|
|
1632
1636
|
*/
|
|
1633
|
-
|
|
1634
|
-
|
|
1637
|
+
export declare const parseXcss: (args: XCSS | (XCSS | false | undefined)[] | undefined | StrictXCSSProp<XCSSAllProperties, XCSSAllPseudos>) => {
|
|
1638
|
+
emotion?: SerializedStyles[];
|
|
1639
|
+
static?: string;
|
|
1640
|
+
};
|
|
1635
1641
|
type AllMedia = MediaQuery | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)' | '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@media (prefers-reduced-motion: reduce)';
|
|
1636
1642
|
type CSSMediaQueries = {
|
|
1637
1643
|
[MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
|
|
@@ -100,11 +100,11 @@ declare const Flex: import("react").MemoExoticComponent<import("react").ForwardR
|
|
|
100
100
|
/**
|
|
101
101
|
* Used to align children along the main axis.
|
|
102
102
|
*/
|
|
103
|
-
justifyContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "
|
|
103
|
+
justifyContent?: "center" | "space-around" | "space-between" | "space-evenly" | "stretch" | "end" | "start" | undefined;
|
|
104
104
|
/**
|
|
105
105
|
* Used to align children along the cross axis.
|
|
106
106
|
*/
|
|
107
|
-
alignItems?: "
|
|
107
|
+
alignItems?: "center" | "stretch" | "end" | "start" | "baseline" | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* Represents the space between each child.
|
|
110
110
|
*/
|
|
@@ -136,11 +136,11 @@ declare const Grid: import("react").MemoExoticComponent<import("react").ForwardR
|
|
|
136
136
|
/**
|
|
137
137
|
* Used to align children along the inline axis.
|
|
138
138
|
*/
|
|
139
|
-
justifyContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "
|
|
139
|
+
justifyContent?: "center" | "space-around" | "space-between" | "space-evenly" | "stretch" | "end" | "start" | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* Used to align the grid along the inline axis.
|
|
142
142
|
*/
|
|
143
|
-
justifyItems?: "
|
|
143
|
+
justifyItems?: "center" | "stretch" | "end" | "start" | undefined;
|
|
144
144
|
/**
|
|
145
145
|
* Used to align children along the block axis.
|
|
146
146
|
*/
|
|
@@ -148,7 +148,7 @@ declare const Grid: import("react").MemoExoticComponent<import("react").ForwardR
|
|
|
148
148
|
/**
|
|
149
149
|
* Used to align the grid along the block axis.
|
|
150
150
|
*/
|
|
151
|
-
alignContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "
|
|
151
|
+
alignContent?: "center" | "space-around" | "space-between" | "space-evenly" | "stretch" | "end" | "start" | undefined;
|
|
152
152
|
/**
|
|
153
153
|
* Represents the space between each column.
|
|
154
154
|
*/
|
|
@@ -63,5 +63,5 @@ declare const UNSAFE_PRESSABLE: React.ForwardRefExoticComponent<Pick<Omit<BoxPro
|
|
|
63
63
|
* Additional information to be included in the `context` of analytics events that come from pressable.
|
|
64
64
|
*/
|
|
65
65
|
analyticsContext?: Record<string, any> | undefined;
|
|
66
|
-
}, "padding" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "backgroundColor" | "color" | "translate" | "
|
|
66
|
+
}, "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" | "testId" | "xcss" | "data-testid" | "isDisabled" | "interactionName" | "componentName" | "analyticsContext"> & React.RefAttributes<HTMLButtonElement>>;
|
|
67
67
|
export default UNSAFE_PRESSABLE;
|
|
@@ -58,7 +58,7 @@ declare const Stack: import("react").MemoExoticComponent<import("react").Forward
|
|
|
58
58
|
/**
|
|
59
59
|
* Used to align children along the block axis (typically vertical).
|
|
60
60
|
*/
|
|
61
|
-
alignBlock?: "
|
|
61
|
+
alignBlock?: "center" | "stretch" | "end" | "start" | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* Used to align children along the inline axis (typically horizontal).
|
|
64
64
|
*/
|
|
@@ -41,10 +41,10 @@ type TextPropsBase = {
|
|
|
41
41
|
children: ReactNode;
|
|
42
42
|
/**
|
|
43
43
|
* Token representing text color with a built-in fallback value.
|
|
44
|
-
* Will apply inverse text color automatically if placed within a Box with
|
|
45
|
-
*
|
|
44
|
+
* Will apply inverse text color automatically if placed within a Box with bold background color.
|
|
45
|
+
* Defaults to `text.color` if not nested in other Text components.
|
|
46
46
|
*/
|
|
47
|
-
color?: TextColor;
|
|
47
|
+
color?: TextColor | 'inherit';
|
|
48
48
|
/**
|
|
49
49
|
* The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
50
50
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { StrictXCSSProp, XCSSAllProperties, XCSSAllPseudos } from '@atlaskit/css';
|
|
2
3
|
import type { XCSS } from '../xcss/xcss';
|
|
3
4
|
export type BasePrimitiveProps = {
|
|
4
5
|
/**
|
|
@@ -11,9 +12,9 @@ export type BasePrimitiveProps = {
|
|
|
11
12
|
*/
|
|
12
13
|
'data-testid'?: never;
|
|
13
14
|
/**
|
|
14
|
-
* Apply a subset of permitted styles
|
|
15
|
+
* Apply a subset of permitted styles powered by Atlassian Design System design tokens.
|
|
15
16
|
*/
|
|
16
|
-
xcss?: XCSS | Array<XCSS | false | undefined>;
|
|
17
|
+
xcss?: XCSS | Array<XCSS | false | undefined> | StrictXCSSProp<XCSSAllProperties, XCSSAllPseudos>;
|
|
17
18
|
/**
|
|
18
19
|
* Accessible role.
|
|
19
20
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css as cssEmotion } from '@emotion/react';
|
|
2
1
|
import type { CSSPropertiesWithMultiValues, SerializedStyles } from '@emotion/serialize';
|
|
3
2
|
import type * as CSS from 'csstype';
|
|
3
|
+
import type { StrictXCSSProp, XCSSAllProperties, XCSSAllPseudos } from '@atlaskit/css';
|
|
4
4
|
import type { MediaQuery } from '../responsive/types';
|
|
5
5
|
import { TokenisedProps } from './style-maps.partial';
|
|
6
6
|
export declare const tokensMap: {
|
|
@@ -1627,11 +1627,17 @@ export declare const tokensMap: {
|
|
|
1627
1627
|
};
|
|
1628
1628
|
declare const uniqueSymbol: unique symbol;
|
|
1629
1629
|
/**
|
|
1630
|
-
*
|
|
1631
|
-
*
|
|
1630
|
+
* Picks out runtime XCSS objects and build-time XCSS strings. This is needed
|
|
1631
|
+
* to supported both Emotion and Compiled styles until we've fully migrated
|
|
1632
|
+
* to Compiled.
|
|
1633
|
+
*
|
|
1634
|
+
* @private
|
|
1635
|
+
* @deprecated
|
|
1632
1636
|
*/
|
|
1633
|
-
|
|
1634
|
-
|
|
1637
|
+
export declare const parseXcss: (args: XCSS | (XCSS | false | undefined)[] | undefined | StrictXCSSProp<XCSSAllProperties, XCSSAllPseudos>) => {
|
|
1638
|
+
emotion?: SerializedStyles[];
|
|
1639
|
+
static?: string;
|
|
1640
|
+
};
|
|
1635
1641
|
type AllMedia = MediaQuery | '@media screen and (forced-colors: active), screen and (-ms-high-contrast: active)' | '@media (prefers-color-scheme: dark)' | '@media (prefers-color-scheme: light)' | '@media (prefers-reduced-motion: reduce)';
|
|
1636
1642
|
type CSSMediaQueries = {
|
|
1637
1643
|
[MQ in AllMedia]?: Omit<SafeCSSObject, AllMedia>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"dependencies": {
|
|
125
125
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
126
126
|
"@atlaskit/app-provider": "^1.0.0",
|
|
127
|
+
"@atlaskit/css": "^0.0.3",
|
|
127
128
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
128
129
|
"@atlaskit/interaction-context": "^2.1.0",
|
|
129
130
|
"@atlaskit/tokens": "^1.38.0",
|