@atlaskit/primitives 18.1.4 → 19.0.1
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 +19 -0
- package/codemods/compiled-fork-stage1/transform.tsx +178 -17
- package/components/flex/package.json +17 -0
- package/constellation/pressable/usage.mdx +2 -0
- package/dist/cjs/compiled/components/box.js +2 -2
- package/dist/cjs/compiled/components/text.compiled.css +0 -1
- package/dist/cjs/compiled/components/text.js +0 -1
- package/dist/cjs/components/box.js +2 -2
- package/dist/cjs/responsive/build-media-query-css.js +14 -71
- package/dist/cjs/responsive/hide.js +4 -3
- package/dist/cjs/responsive/media-helper.js +8 -37
- package/dist/cjs/responsive/media.js +31 -0
- package/dist/cjs/responsive/show.js +4 -3
- package/dist/cjs/responsive/unsafe-build-above-media-query-css.js +43 -0
- package/dist/cjs/responsive/unsafe-build-below-media-query-css.js +45 -0
- package/dist/cjs/utils/surface-context.js +13 -0
- package/dist/cjs/utils/surface-provider.js +10 -10
- package/dist/cjs/xcss/style-maps.partial.js +2 -5
- package/dist/es2019/compiled/components/box.js +1 -1
- package/dist/es2019/compiled/components/text.compiled.css +0 -1
- package/dist/es2019/compiled/components/text.js +0 -1
- package/dist/es2019/components/box.js +1 -1
- package/dist/es2019/responsive/build-media-query-css.js +2 -75
- package/dist/es2019/responsive/hide.js +2 -1
- package/dist/es2019/responsive/media-helper.js +3 -37
- package/dist/es2019/responsive/media.js +25 -0
- package/dist/es2019/responsive/show.js +2 -1
- package/dist/es2019/responsive/unsafe-build-above-media-query-css.js +38 -0
- package/dist/es2019/responsive/unsafe-build-below-media-query-css.js +42 -0
- package/dist/es2019/utils/surface-context.js +7 -0
- package/dist/es2019/utils/surface-provider.js +4 -9
- package/dist/es2019/xcss/style-maps.partial.js +2 -5
- package/dist/esm/compiled/components/box.js +1 -1
- package/dist/esm/compiled/components/text.compiled.css +0 -1
- package/dist/esm/compiled/components/text.js +0 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/responsive/build-media-query-css.js +2 -68
- package/dist/esm/responsive/hide.js +2 -1
- package/dist/esm/responsive/media-helper.js +3 -37
- package/dist/esm/responsive/media.js +25 -0
- package/dist/esm/responsive/show.js +2 -1
- package/dist/esm/responsive/unsafe-build-above-media-query-css.js +37 -0
- package/dist/esm/responsive/unsafe-build-below-media-query-css.js +39 -0
- package/dist/esm/utils/surface-context.js +7 -0
- package/dist/esm/utils/surface-provider.js +4 -9
- package/dist/esm/xcss/style-maps.partial.js +2 -5
- package/dist/types/compiled/components/types.d.ts +1 -1
- package/dist/types/responsive/build-media-query-css.d.ts +2 -63
- package/dist/types/responsive/media-helper.d.ts +1 -35
- package/dist/types/responsive/media.d.ts +25 -0
- package/dist/types/responsive/types.d.ts +1 -1
- package/dist/types/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
- package/dist/types/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
- package/dist/types/utils/surface-context.d.ts +8 -0
- package/dist/types/utils/surface-provider.d.ts +1 -7
- package/dist/types/xcss/style-maps.partial.d.ts +2 -4
- package/dist/types-ts4.5/compiled/components/types.d.ts +1 -1
- package/dist/types-ts4.5/responsive/build-media-query-css.d.ts +2 -63
- package/dist/types-ts4.5/responsive/media-helper.d.ts +1 -35
- package/dist/types-ts4.5/responsive/media.d.ts +25 -0
- package/dist/types-ts4.5/responsive/types.d.ts +1 -1
- package/dist/types-ts4.5/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
- package/dist/types-ts4.5/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
- package/dist/types-ts4.5/utils/surface-context.d.ts +8 -0
- package/dist/types-ts4.5/utils/surface-provider.d.ts +1 -7
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +2 -4
- package/package.json +17 -17
- package/scripts/capitalize.tsx +2 -0
- package/scripts/color-codegen-template.tsx +3 -6
- package/scripts/compose.tsx +4 -0
- package/scripts/elevation-codegen-template.tsx +3 -6
- package/scripts/generate-type-defs.tsx +12 -0
- package/scripts/inverse-color-map-template.tsx +4 -1
- package/scripts/is-accent.tsx +1 -0
- package/scripts/is-hovered.tsx +1 -0
- package/scripts/is-pressed.tsx +1 -0
- package/scripts/pick.tsx +4 -0
- package/scripts/shape-codegen-template.tsx +3 -1
- package/scripts/spacing-codegen-template.tsx +2 -1
- package/scripts/text-codegen-template.tsx +3 -2
- package/scripts/typography-codegen-template.tsx +3 -1
- package/scripts/utils.tsx +7 -25
- package/offerings.json +0 -298
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CSSObject, type SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { Breakpoint } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Build a map of breakpoints to css with media queries and nested styles.
|
|
5
|
+
*
|
|
6
|
+
* @internal Not intended to be used outside of DST at this stage.
|
|
7
|
+
* @experimental Not intended to be used outside of DST at this stage.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* A map to build optional `display:none` for consumption on a div.
|
|
11
|
+
* ```ts
|
|
12
|
+
* const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
|
|
13
|
+
*
|
|
14
|
+
* const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
|
|
15
|
+
* return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* This roughly builds a map that will look roughly like this (if done manually):
|
|
20
|
+
* ```ts
|
|
21
|
+
* {
|
|
22
|
+
* xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
|
|
23
|
+
* sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const UNSAFE_buildBelowMediaQueryCSS: (
|
|
28
|
+
/**
|
|
29
|
+
* The desired CSS to place inside of the media query.
|
|
30
|
+
* This can either be a css object directly or functional with `breakpoint` as the arg to return a css object.
|
|
31
|
+
*/
|
|
32
|
+
input: CSSObject | ((breakpoint: Breakpoint) => CSSObject)) => Required<Partial<Record<Breakpoint, SerializedStyles>>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Context } from 'react';
|
|
2
|
+
import type { BackgroundColorToken } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Surface context__
|
|
5
|
+
*
|
|
6
|
+
* A surface context provides context information on the current background (if set).
|
|
7
|
+
*/
|
|
8
|
+
export declare const SurfaceContext: Context<BackgroundColorToken>;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { type Context } from 'react';
|
|
2
1
|
import type { BackgroundColorToken } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* __Surface context__
|
|
5
|
-
*
|
|
6
|
-
* A surface context provides context information on the current background (if set).
|
|
7
|
-
*/
|
|
8
|
-
export declare const SurfaceContext: Context<BackgroundColorToken>;
|
|
9
2
|
/**
|
|
10
3
|
* __useSurface__
|
|
11
4
|
*
|
|
@@ -14,3 +7,4 @@ export declare const SurfaceContext: Context<BackgroundColorToken>;
|
|
|
14
7
|
* @see SurfaceContext
|
|
15
8
|
*/
|
|
16
9
|
export declare const useSurface: () => BackgroundColorToken;
|
|
10
|
+
export { SurfaceContext } from './surface-context';
|
|
@@ -542,7 +542,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
542
542
|
*/
|
|
543
543
|
/**
|
|
544
544
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
545
|
-
* @codegen <<SignedSource::
|
|
545
|
+
* @codegen <<SignedSource::6dffa08c1104af4093361cb0f7e37996>>
|
|
546
546
|
* @codegenId typography
|
|
547
547
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
548
548
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -551,7 +551,6 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
551
551
|
*/
|
|
552
552
|
export declare const fontMap: {
|
|
553
553
|
'font.body': 'var(--ds-font-body)';
|
|
554
|
-
'font.body.UNSAFE_small': 'var(--ds-font-body-UNSAFE_small)';
|
|
555
554
|
'font.body.large': 'var(--ds-font-body-large)';
|
|
556
555
|
'font.body.small': 'var(--ds-font-body-small)';
|
|
557
556
|
'font.code': 'var(--ds-font-code)';
|
|
@@ -587,7 +586,7 @@ export type FontFamily = keyof typeof fontFamilyMap;
|
|
|
587
586
|
*/
|
|
588
587
|
/**
|
|
589
588
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
590
|
-
* @codegen <<SignedSource::
|
|
589
|
+
* @codegen <<SignedSource::b67a50fa5abb078032598ba819a6f691>>
|
|
591
590
|
* @codegenId text
|
|
592
591
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
593
592
|
* @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
@@ -595,7 +594,6 @@ export type FontFamily = keyof typeof fontFamilyMap;
|
|
|
595
594
|
*/
|
|
596
595
|
export declare const textSizeMap: {
|
|
597
596
|
medium: 'var(--ds-font-body)';
|
|
598
|
-
UNSAFE_small: 'var(--ds-font-body-UNSAFE_small)';
|
|
599
597
|
large: 'var(--ds-font-body-large)';
|
|
600
598
|
small: 'var(--ds-font-body-small)';
|
|
601
599
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -140,12 +140,12 @@
|
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
143
|
-
"@atlaskit/app-provider": "^4.
|
|
143
|
+
"@atlaskit/app-provider": "^4.3.0",
|
|
144
144
|
"@atlaskit/css": "^0.19.0",
|
|
145
145
|
"@atlaskit/ds-lib": "^7.0.0",
|
|
146
146
|
"@atlaskit/interaction-context": "^3.1.0",
|
|
147
|
-
"@atlaskit/tokens": "^
|
|
148
|
-
"@atlaskit/visually-hidden": "^3.
|
|
147
|
+
"@atlaskit/tokens": "^13.0.0",
|
|
148
|
+
"@atlaskit/visually-hidden": "^3.1.0",
|
|
149
149
|
"@babel/runtime": "^7.0.0",
|
|
150
150
|
"@compiled/react": "^0.20.0",
|
|
151
151
|
"@emotion/react": "^11.7.1",
|
|
@@ -161,29 +161,29 @@
|
|
|
161
161
|
"@af/formatting": "workspace:^",
|
|
162
162
|
"@af/integration-testing": "workspace:^",
|
|
163
163
|
"@af/visual-regression": "workspace:^",
|
|
164
|
-
"@atlaskit/avatar": "^25.
|
|
164
|
+
"@atlaskit/avatar": "^25.14.0",
|
|
165
165
|
"@atlaskit/button": "^23.11.0",
|
|
166
166
|
"@atlaskit/checkbox": "^17.3.0",
|
|
167
|
-
"@atlaskit/code": "^17.
|
|
168
|
-
"@atlaskit/docs": "^11.
|
|
167
|
+
"@atlaskit/code": "^17.5.0",
|
|
168
|
+
"@atlaskit/docs": "^11.8.0",
|
|
169
169
|
"@atlaskit/dropdown-menu": "^16.8.0",
|
|
170
|
-
"@atlaskit/flag": "^17.
|
|
170
|
+
"@atlaskit/flag": "^17.11.0",
|
|
171
171
|
"@atlaskit/form": "^15.5.0",
|
|
172
172
|
"@atlaskit/heading": "^5.4.0",
|
|
173
|
-
"@atlaskit/icon": "^34.
|
|
174
|
-
"@atlaskit/icon-object": "^7.5.0",
|
|
173
|
+
"@atlaskit/icon": "^34.3.0",
|
|
175
174
|
"@atlaskit/image": "^3.0.0",
|
|
176
175
|
"@atlaskit/link": "^3.4.0",
|
|
177
|
-
"@atlaskit/logo": "^20.
|
|
178
|
-
"@atlaskit/lozenge": "^13.
|
|
179
|
-
"@atlaskit/motion": "^
|
|
180
|
-
"@atlaskit/
|
|
176
|
+
"@atlaskit/logo": "^20.1.0",
|
|
177
|
+
"@atlaskit/lozenge": "^13.8.0",
|
|
178
|
+
"@atlaskit/motion": "^6.2.0",
|
|
179
|
+
"@atlaskit/object": "^1.0.0",
|
|
180
|
+
"@atlaskit/range": "^10.1.0",
|
|
181
181
|
"@atlaskit/section-message": "^8.12.0",
|
|
182
182
|
"@atlaskit/textfield": "^8.3.0",
|
|
183
|
-
"@atlaskit/toggle": "^15.
|
|
184
|
-
"@atlaskit/tooltip": "^
|
|
183
|
+
"@atlaskit/toggle": "^15.6.0",
|
|
184
|
+
"@atlaskit/tooltip": "^22.0.0",
|
|
185
185
|
"@atlassian/analytics-bridge": "^0.8.0",
|
|
186
|
-
"@atlassian/codegen": "^0.
|
|
186
|
+
"@atlassian/codegen": "^0.2.0",
|
|
187
187
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
188
188
|
"@atlassian/ssr-tests": "workspace:^",
|
|
189
189
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { light as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
generateTypeDefs,
|
|
8
|
-
type ShadowDefinition,
|
|
9
|
-
} from './utils';
|
|
4
|
+
import { capitalize } from './capitalize';
|
|
5
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
6
|
+
import { constructTokenFunctionCall, type ShadowDefinition } from './utils';
|
|
10
7
|
|
|
11
8
|
type Token = {
|
|
12
9
|
token: string;
|
|
@@ -2,12 +2,9 @@ import format from '@af/formatting/sync';
|
|
|
2
2
|
import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
3
3
|
import { light as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
generateTypeDefs,
|
|
9
|
-
type ShadowDefinition,
|
|
10
|
-
} from './utils';
|
|
5
|
+
import { capitalize } from './capitalize';
|
|
6
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
7
|
+
import { constructTokenFunctionCall, type ShadowDefinition } from './utils';
|
|
11
8
|
|
|
12
9
|
type Token = {
|
|
13
10
|
token: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import tokens from '@atlaskit/tokens/token-names';
|
|
2
|
+
|
|
3
|
+
export const generateTypeDefs: (typedTokens: string[], tokenNames?: string[]) => string = (
|
|
4
|
+
typedTokens: string[],
|
|
5
|
+
tokenNames?: string[],
|
|
6
|
+
) => {
|
|
7
|
+
return typedTokens
|
|
8
|
+
.map((t, i) => {
|
|
9
|
+
return `'${Array.isArray(tokenNames) ? tokenNames[i] : t}': 'var(${tokens[t as keyof typeof tokens]})'`;
|
|
10
|
+
})
|
|
11
|
+
.join(';\n\t');
|
|
12
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { light as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import { compose
|
|
4
|
+
import { compose } from './compose';
|
|
5
|
+
import { isAccent } from './is-accent';
|
|
6
|
+
import { pick } from './pick';
|
|
7
|
+
import { not } from './utils';
|
|
5
8
|
|
|
6
9
|
type Token = {
|
|
7
10
|
token: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isAccent: (str: string) => boolean = (str: string) => str.includes('accent');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isHovered: (str: string) => boolean = (str: string) => str.includes('hovered');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isPressed: (str: string) => boolean = (str: string) => str.includes('pressed');
|
package/scripts/pick.tsx
ADDED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { shape as shapeTokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import { capitalize
|
|
4
|
+
import { capitalize } from './capitalize';
|
|
5
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
6
|
+
import { constructTokenFunctionCall } from './utils';
|
|
5
7
|
|
|
6
8
|
type Token = {
|
|
7
9
|
token: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { spacing as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
5
|
+
import { constructTokenFunctionCall } from './utils';
|
|
5
6
|
|
|
6
7
|
const spacingTokenPrefix = 'space.';
|
|
7
8
|
const negativeSuffix = '.negative';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { typography as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import { capitalize
|
|
4
|
+
import { capitalize } from './capitalize';
|
|
5
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
6
|
+
import { constructTokenFunctionCall } from './utils';
|
|
5
7
|
|
|
6
8
|
type Token = {
|
|
7
9
|
name: string;
|
|
@@ -38,7 +40,6 @@ const textProperties = [
|
|
|
38
40
|
|
|
39
41
|
const sizeMap = {
|
|
40
42
|
'body.small': 'small',
|
|
41
|
-
'body.UNSAFE_small': 'UNSAFE_small',
|
|
42
43
|
body: 'medium',
|
|
43
44
|
'body.large': 'large',
|
|
44
45
|
'metric.small': 'small',
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import format from '@af/formatting/sync';
|
|
2
2
|
import { typography as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
3
|
|
|
4
|
-
import { capitalize
|
|
4
|
+
import { capitalize } from './capitalize';
|
|
5
|
+
import { generateTypeDefs } from './generate-type-defs';
|
|
6
|
+
import { constructTokenFunctionCall } from './utils';
|
|
5
7
|
|
|
6
8
|
type Token = {
|
|
7
9
|
name: string;
|
package/scripts/utils.tsx
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import tokens from '@atlaskit/tokens/token-names';
|
|
2
|
-
|
|
3
1
|
export const constructTokenFunctionCall: (
|
|
4
2
|
token: string,
|
|
5
3
|
fallback: string | ShadowDefinition,
|
|
@@ -29,17 +27,6 @@ const constructShadow = (shadowObject: ShadowDefinition) => {
|
|
|
29
27
|
|
|
30
28
|
type BooleanCallback<T> = (args: T) => boolean;
|
|
31
29
|
|
|
32
|
-
export const compose: (...fns: ((...any: any[]) => any)[]) => (x: any) => any =
|
|
33
|
-
(...fns: ((...any: any[]) => any)[]) =>
|
|
34
|
-
(x: any) =>
|
|
35
|
-
fns.reduce((res, fn) => fn(res), x);
|
|
36
|
-
export const pick: <T extends any>(key: keyof T) => (obj: T) => T[keyof T] =
|
|
37
|
-
<T extends any>(key: keyof T) =>
|
|
38
|
-
(obj: T) =>
|
|
39
|
-
obj[key];
|
|
40
|
-
export const isAccent: (str: string) => boolean = (str: string) => str.includes('accent');
|
|
41
|
-
export const isPressed: (str: string) => boolean = (str: string) => str.includes('pressed');
|
|
42
|
-
export const isHovered: (str: string) => boolean = (str: string) => str.includes('hovered');
|
|
43
30
|
export const not: <T extends any>(cb: BooleanCallback<T>) => (val: T) => boolean =
|
|
44
31
|
<T extends any>(cb: BooleanCallback<T>) =>
|
|
45
32
|
(val: T) =>
|
|
@@ -48,16 +35,11 @@ export const or: <T extends any>(...fns: BooleanCallback<T>[]) => (val: T) => bo
|
|
|
48
35
|
<T extends any>(...fns: BooleanCallback<T>[]) =>
|
|
49
36
|
(val: T) =>
|
|
50
37
|
fns.some((fn) => fn(val));
|
|
51
|
-
export const capitalize: (str: string) => string = (str: string) =>
|
|
52
|
-
str.charAt(0).toUpperCase() + str.slice(1);
|
|
53
38
|
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
.join(';\n\t');
|
|
63
|
-
};
|
|
39
|
+
export { compose } from './compose';
|
|
40
|
+
export { pick } from './pick';
|
|
41
|
+
export { isAccent } from './is-accent';
|
|
42
|
+
export { isPressed } from './is-pressed';
|
|
43
|
+
export { isHovered } from './is-hovered';
|
|
44
|
+
export { capitalize } from './capitalize';
|
|
45
|
+
export { generateTypeDefs } from './generate-type-defs';
|
package/offerings.json
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "Anchor",
|
|
4
|
-
"package": "@atlaskit/primitives",
|
|
5
|
-
"import": {
|
|
6
|
-
"name": "Anchor",
|
|
7
|
-
"package": "@atlaskit/primitives/compiled",
|
|
8
|
-
"type": "named"
|
|
9
|
-
},
|
|
10
|
-
"keywords": ["anchor", "link", "navigation", "href", "url", "primitive", "compiled"],
|
|
11
|
-
"categories": ["primitive"],
|
|
12
|
-
"shortDescription": "A primitive Anchor component for navigation links with compiled styling support.",
|
|
13
|
-
"status": "general-availability",
|
|
14
|
-
"accessibilityGuidelines": [
|
|
15
|
-
"Provide clear link text that describes the destination",
|
|
16
|
-
"Use appropriate ARIA attributes for links",
|
|
17
|
-
"Ensure keyboard navigation support",
|
|
18
|
-
"Provide clear visual indicators for link state",
|
|
19
|
-
"Use descriptive link text for screen readers"
|
|
20
|
-
],
|
|
21
|
-
"usageGuidelines": [
|
|
22
|
-
"Use for navigation links to other pages or sections",
|
|
23
|
-
"Leverage compiled styling for performance",
|
|
24
|
-
"Use appropriate link styling and states",
|
|
25
|
-
"Consider link behavior and target attributes"
|
|
26
|
-
],
|
|
27
|
-
"contentGuidelines": [
|
|
28
|
-
"Use clear, descriptive link text",
|
|
29
|
-
"Maintain consistent link styling",
|
|
30
|
-
"Consider link context and destination"
|
|
31
|
-
],
|
|
32
|
-
"examples": ["./examples/ai/anchor.tsx"]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "Bleed",
|
|
36
|
-
"package": "@atlaskit/primitives",
|
|
37
|
-
"import": {
|
|
38
|
-
"name": "Bleed",
|
|
39
|
-
"package": "@atlaskit/primitives/compiled",
|
|
40
|
-
"type": "named"
|
|
41
|
-
},
|
|
42
|
-
"keywords": ["bleed", "layout", "margin", "spacing", "edge", "primitive", "compiled"],
|
|
43
|
-
"categories": ["primitive"],
|
|
44
|
-
"shortDescription": "A primitive Bleed component for extending content beyond container boundaries with compiled styling support.",
|
|
45
|
-
"status": "general-availability",
|
|
46
|
-
"usageGuidelines": [
|
|
47
|
-
"Use for extending content beyond container margins",
|
|
48
|
-
"Leverage compiled styling for performance",
|
|
49
|
-
"Use appropriate bleed directions and amounts",
|
|
50
|
-
"Consider responsive behavior and container constraints"
|
|
51
|
-
],
|
|
52
|
-
"contentGuidelines": [
|
|
53
|
-
"Use for appropriate layout bleeding",
|
|
54
|
-
"Maintain consistent bleeding patterns",
|
|
55
|
-
"Consider content hierarchy and visual flow"
|
|
56
|
-
],
|
|
57
|
-
"examples": ["./examples/ai/bleed.tsx"]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"name": "Box",
|
|
61
|
-
"package": "@atlaskit/primitives",
|
|
62
|
-
"import": {
|
|
63
|
-
"name": "Box",
|
|
64
|
-
"package": "@atlaskit/primitives/compiled",
|
|
65
|
-
"type": "named"
|
|
66
|
-
},
|
|
67
|
-
"keywords": ["box", "container", "div", "layout", "primitive", "compiled"],
|
|
68
|
-
"categories": ["primitive"],
|
|
69
|
-
"shortDescription": "A primitive Box component for layout and container purposes with compiled styling support.",
|
|
70
|
-
"status": "general-availability",
|
|
71
|
-
"usageGuidelines": [
|
|
72
|
-
"Use for basic layout and container needs",
|
|
73
|
-
"Leverage compiled styling for performance",
|
|
74
|
-
"Use appropriate spacing and layout props",
|
|
75
|
-
"Consider semantic HTML when possible"
|
|
76
|
-
],
|
|
77
|
-
"contentGuidelines": [
|
|
78
|
-
"Use for appropriate layout purposes",
|
|
79
|
-
"Maintain consistent spacing and layout patterns",
|
|
80
|
-
"Consider accessibility and semantic structure"
|
|
81
|
-
],
|
|
82
|
-
"examples": ["./examples/ai/box.tsx"]
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"name": "Flex",
|
|
86
|
-
"package": "@atlaskit/primitives",
|
|
87
|
-
"import": {
|
|
88
|
-
"name": "Flex",
|
|
89
|
-
"package": "@atlaskit/primitives/compiled",
|
|
90
|
-
"type": "named"
|
|
91
|
-
},
|
|
92
|
-
"keywords": ["flex", "layout", "flexbox", "alignment", "primitive", "compiled"],
|
|
93
|
-
"categories": ["primitive"],
|
|
94
|
-
"shortDescription": "A primitive Flex component for flexbox layout with compiled styling support.",
|
|
95
|
-
"status": "general-availability",
|
|
96
|
-
"usageGuidelines": [
|
|
97
|
-
"Use for flexbox layout needs",
|
|
98
|
-
"Leverage compiled styling for performance",
|
|
99
|
-
"Use appropriate flex properties and alignment",
|
|
100
|
-
"Consider responsive behavior"
|
|
101
|
-
],
|
|
102
|
-
"contentGuidelines": [
|
|
103
|
-
"Use for appropriate flex layout",
|
|
104
|
-
"Maintain consistent flex patterns",
|
|
105
|
-
"Consider content alignment and distribution"
|
|
106
|
-
],
|
|
107
|
-
"examples": ["./examples/ai/flex.tsx"]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "Focusable",
|
|
111
|
-
"package": "@atlaskit/primitives",
|
|
112
|
-
"import": {
|
|
113
|
-
"name": "Focusable",
|
|
114
|
-
"package": "@atlaskit/primitives/compiled",
|
|
115
|
-
"type": "named"
|
|
116
|
-
},
|
|
117
|
-
"keywords": ["focusable", "focus", "keyboard", "navigation", "accessibility", "primitive", "compiled"],
|
|
118
|
-
"categories": ["primitive"],
|
|
119
|
-
"shortDescription": "A primitive Focusable component for keyboard navigation and focus management with compiled styling support.",
|
|
120
|
-
"status": "general-availability",
|
|
121
|
-
"accessibilityGuidelines": [
|
|
122
|
-
"Provide clear focus indicators",
|
|
123
|
-
"Use appropriate tab order and navigation",
|
|
124
|
-
"Ensure keyboard accessibility",
|
|
125
|
-
"Provide clear visual feedback for focus state",
|
|
126
|
-
"Use appropriate ARIA attributes"
|
|
127
|
-
],
|
|
128
|
-
"usageGuidelines": [
|
|
129
|
-
"Use for elements that need keyboard focus",
|
|
130
|
-
"Leverage compiled styling for performance",
|
|
131
|
-
"Use appropriate focus management",
|
|
132
|
-
"Consider keyboard navigation patterns"
|
|
133
|
-
],
|
|
134
|
-
"contentGuidelines": [
|
|
135
|
-
"Use for appropriate focusable content",
|
|
136
|
-
"Maintain consistent focus patterns",
|
|
137
|
-
"Consider keyboard navigation flow"
|
|
138
|
-
],
|
|
139
|
-
"examples": ["./examples/ai/focusable.tsx"]
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "Grid",
|
|
143
|
-
"package": "@atlaskit/primitives",
|
|
144
|
-
"import": {
|
|
145
|
-
"name": "Grid",
|
|
146
|
-
"package": "@atlaskit/primitives/compiled",
|
|
147
|
-
"type": "named"
|
|
148
|
-
},
|
|
149
|
-
"keywords": ["grid", "layout", "css-grid", "alignment", "primitive", "compiled"],
|
|
150
|
-
"categories": ["primitive"],
|
|
151
|
-
"shortDescription": "A primitive Grid component for CSS Grid layout with compiled styling support.",
|
|
152
|
-
"status": "general-availability",
|
|
153
|
-
"usageGuidelines": [
|
|
154
|
-
"Use for CSS Grid layout needs",
|
|
155
|
-
"Leverage compiled styling for performance",
|
|
156
|
-
"Use appropriate grid properties and alignment",
|
|
157
|
-
"Consider responsive behavior"
|
|
158
|
-
],
|
|
159
|
-
"contentGuidelines": [
|
|
160
|
-
"Use for appropriate grid layout",
|
|
161
|
-
"Maintain consistent grid patterns",
|
|
162
|
-
"Consider content alignment and distribution"
|
|
163
|
-
],
|
|
164
|
-
"examples": ["./examples/ai/grid.tsx"]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "Inline",
|
|
168
|
-
"package": "@atlaskit/primitives",
|
|
169
|
-
"import": {
|
|
170
|
-
"name": "Inline",
|
|
171
|
-
"package": "@atlaskit/primitives/compiled",
|
|
172
|
-
"type": "named"
|
|
173
|
-
},
|
|
174
|
-
"keywords": ["inline", "layout", "horizontal", "spacing", "primitive", "compiled"],
|
|
175
|
-
"categories": ["primitive"],
|
|
176
|
-
"shortDescription": "A primitive Inline component for horizontal layout with consistent spacing.",
|
|
177
|
-
"status": "general-availability",
|
|
178
|
-
"usageGuidelines": [
|
|
179
|
-
"Use for horizontal layout needs",
|
|
180
|
-
"Leverage compiled styling for performance",
|
|
181
|
-
"Use appropriate spacing and alignment props",
|
|
182
|
-
"Consider wrapping behavior"
|
|
183
|
-
],
|
|
184
|
-
"contentGuidelines": [
|
|
185
|
-
"Use for appropriate horizontal grouping",
|
|
186
|
-
"Maintain consistent spacing patterns",
|
|
187
|
-
"Consider content flow and readability"
|
|
188
|
-
],
|
|
189
|
-
"examples": ["./examples/ai/inline.tsx"]
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"name": "MetricText",
|
|
193
|
-
"package": "@atlaskit/primitives",
|
|
194
|
-
"import": {
|
|
195
|
-
"name": "MetricText",
|
|
196
|
-
"package": "@atlaskit/primitives/compiled",
|
|
197
|
-
"type": "named"
|
|
198
|
-
},
|
|
199
|
-
"keywords": ["text", "typography", "font", "primitive", "compiled"],
|
|
200
|
-
"categories": ["primitive"],
|
|
201
|
-
"shortDescription": "A primitive Text component for typography with compiled styling support.",
|
|
202
|
-
"status": "general-availability",
|
|
203
|
-
"usageGuidelines": [
|
|
204
|
-
"Use for text content with consistent typography",
|
|
205
|
-
"Leverage compiled styling for performance",
|
|
206
|
-
"Use appropriate font size and weight props",
|
|
207
|
-
"Consider semantic HTML elements"
|
|
208
|
-
],
|
|
209
|
-
"contentGuidelines": [
|
|
210
|
-
"Use for appropriate text content",
|
|
211
|
-
"Maintain consistent typography patterns",
|
|
212
|
-
"Consider readability and hierarchy"
|
|
213
|
-
],
|
|
214
|
-
"examples": ["./examples/ai/metric-text.tsx"]
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"name": "Pressable",
|
|
218
|
-
"package": "@atlaskit/primitives",
|
|
219
|
-
"import": {
|
|
220
|
-
"name": "Pressable",
|
|
221
|
-
"package": "@atlaskit/primitives/compiled",
|
|
222
|
-
"type": "named"
|
|
223
|
-
},
|
|
224
|
-
"keywords": ["pressable", "interaction", "touch", "click", "primitive", "compiled"],
|
|
225
|
-
"categories": ["primitive"],
|
|
226
|
-
"shortDescription": "A primitive Pressable component for handling touch and click interactions with compiled styling support.",
|
|
227
|
-
"status": "general-availability",
|
|
228
|
-
"accessibilityGuidelines": [
|
|
229
|
-
"Provide clear visual feedback for press states",
|
|
230
|
-
"Ensure appropriate touch target sizes",
|
|
231
|
-
"Use appropriate ARIA attributes for interactive elements",
|
|
232
|
-
"Provide keyboard navigation support"
|
|
233
|
-
],
|
|
234
|
-
"usageGuidelines": [
|
|
235
|
-
"Use for interactive elements that need press feedback",
|
|
236
|
-
"Leverage compiled styling for performance",
|
|
237
|
-
"Use appropriate press states and feedback",
|
|
238
|
-
"Consider touch target accessibility"
|
|
239
|
-
],
|
|
240
|
-
"contentGuidelines": [
|
|
241
|
-
"Use for appropriate interactive content",
|
|
242
|
-
"Maintain consistent press patterns",
|
|
243
|
-
"Consider user interaction expectations"
|
|
244
|
-
],
|
|
245
|
-
"examples": ["./examples/ai/pressable.tsx"]
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"name": "Stack",
|
|
249
|
-
"package": "@atlaskit/primitives",
|
|
250
|
-
"import": {
|
|
251
|
-
"name": "Stack",
|
|
252
|
-
"package": "@atlaskit/primitives/compiled",
|
|
253
|
-
"type": "named"
|
|
254
|
-
},
|
|
255
|
-
"keywords": ["stack", "layout", "vertical", "horizontal", "spacing", "primitive", "compiled"],
|
|
256
|
-
"categories": ["primitive"],
|
|
257
|
-
"shortDescription": "A primitive Stack component for vertical and horizontal layout with consistent spacing.",
|
|
258
|
-
"status": "general-availability",
|
|
259
|
-
"usageGuidelines": [
|
|
260
|
-
"Use for consistent vertical or horizontal layouts",
|
|
261
|
-
"Leverage compiled styling for performance",
|
|
262
|
-
"Use appropriate spacing and alignment props",
|
|
263
|
-
"Consider responsive behavior"
|
|
264
|
-
],
|
|
265
|
-
"contentGuidelines": [
|
|
266
|
-
"Use for appropriate layout grouping",
|
|
267
|
-
"Maintain consistent spacing patterns",
|
|
268
|
-
"Consider content hierarchy and flow"
|
|
269
|
-
],
|
|
270
|
-
"examples": ["./examples/ai/stack.tsx"]
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"name": "Text",
|
|
274
|
-
"package": "@atlaskit/primitives",
|
|
275
|
-
"import": {
|
|
276
|
-
"name": "Text",
|
|
277
|
-
"package": "@atlaskit/primitives/compiled",
|
|
278
|
-
"type": "named"
|
|
279
|
-
},
|
|
280
|
-
"keywords": ["text", "typography", "font", "primitive", "compiled"],
|
|
281
|
-
"categories": ["primitive"],
|
|
282
|
-
"shortDescription": "A primitive Text component for typography with compiled styling support.",
|
|
283
|
-
"status": "general-availability",
|
|
284
|
-
"usageGuidelines": [
|
|
285
|
-
"Use for text content with consistent typography",
|
|
286
|
-
"Leverage compiled styling for performance",
|
|
287
|
-
"Use appropriate font size and weight props",
|
|
288
|
-
"Consider semantic HTML elements"
|
|
289
|
-
],
|
|
290
|
-
"contentGuidelines": [
|
|
291
|
-
"Use for appropriate text content",
|
|
292
|
-
"Maintain consistent typography patterns",
|
|
293
|
-
"Consider readability and hierarchy"
|
|
294
|
-
],
|
|
295
|
-
"generativeInstructions": "./docs/ai/text-instructions.md",
|
|
296
|
-
"examples": ["./examples/ai/text.tsx"]
|
|
297
|
-
}
|
|
298
|
-
]
|