@atlaskit/forge-react-types 0.42.8 → 0.42.9

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/types/components/__generated__/BadgeProps.codegen.d.ts +2 -7
  3. package/dist/types/components/__generated__/BoxProps.codegen.d.ts +2 -2
  4. package/dist/types/components/__generated__/CalendarProps.codegen.d.ts +128 -4
  5. package/dist/types/components/__generated__/CodeProps.codegen.d.ts +2 -2
  6. package/dist/types/components/__generated__/HeadingProps.codegen.d.ts +29 -3
  7. package/dist/types/components/__generated__/PressableProps.codegen.d.ts +2 -2
  8. package/dist/types/components/__generated__/RangeProps.codegen.d.ts +50 -5
  9. package/dist/types/components/__generated__/index.d.ts +0 -1
  10. package/dist/types/index.d.ts +1 -1
  11. package/dist/types-ts4.5/components/__generated__/BadgeProps.codegen.d.ts +2 -7
  12. package/dist/types-ts4.5/components/__generated__/BoxProps.codegen.d.ts +2 -2
  13. package/dist/types-ts4.5/components/__generated__/CalendarProps.codegen.d.ts +128 -4
  14. package/dist/types-ts4.5/components/__generated__/CodeProps.codegen.d.ts +2 -2
  15. package/dist/types-ts4.5/components/__generated__/HeadingProps.codegen.d.ts +29 -3
  16. package/dist/types-ts4.5/components/__generated__/PressableProps.codegen.d.ts +2 -2
  17. package/dist/types-ts4.5/components/__generated__/RangeProps.codegen.d.ts +50 -5
  18. package/dist/types-ts4.5/components/__generated__/index.d.ts +0 -1
  19. package/dist/types-ts4.5/index.d.ts +1 -1
  20. package/package.json +1 -4
  21. package/scripts/codegen/codeGenerator.ts +114 -24
  22. package/scripts/codegen/typeSerializer.ts +122 -70
  23. package/scripts/codegen/utils.ts +71 -0
  24. package/scripts/typechecker.ts +17 -2
  25. package/src/components/__generated__/BadgeProps.codegen.tsx +3 -7
  26. package/src/components/__generated__/CalendarProps.codegen.tsx +119 -4
  27. package/src/components/__generated__/CodeProps.codegen.tsx +2 -2
  28. package/src/components/__generated__/HeadingProps.codegen.tsx +31 -3
  29. package/src/components/__generated__/RangeProps.codegen.tsx +54 -5
  30. package/src/components/__generated__/index.ts +1 -2
  31. package/src/index.ts +0 -2
  32. package/dist/cjs/components/__generated__/BleedProps.codegen.js +0 -5
  33. package/dist/es2019/components/__generated__/BleedProps.codegen.js +0 -1
  34. package/dist/esm/components/__generated__/BleedProps.codegen.js +0 -1
  35. package/dist/types/components/__generated__/BleedProps.codegen.d.ts +0 -15
  36. package/dist/types-ts4.5/components/__generated__/BleedProps.codegen.d.ts +0 -15
  37. package/src/components/__generated__/BleedProps.codegen.tsx +0 -22
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - BadgeProps
5
5
  *
6
- * @codegen <<SignedSource::70958e2a60c7a0e1b3443db2d24003cc>>
6
+ * @codegen <<SignedSource::e4726fc9fc56127107db590dd21ef3f6>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::89ad3341c1b8ef4b6fc93df162ac91d3>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
- import React from 'react';
12
+ import type React from 'react';
13
13
 
14
14
  export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
15
15
  /**
@@ -26,11 +26,7 @@ type _PlatformBadgeProps = {
26
26
  * Affects the visual style of the badge.
27
27
  */
28
28
  appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
29
- /**
30
- * The value displayed within the badge. A badge should only be used in cases where you want to represent a number. Use a lozenge for non-numeric information.
31
- *
32
- * @type string | number
33
- */
29
+
34
30
  children?: React.ReactNode;
35
31
  /**
36
32
  * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
@@ -3,16 +3,131 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - CalendarProps
5
5
  *
6
- * @codegen <<SignedSource::497faee84f851775b401af97ebfc5c12>>
6
+ * @codegen <<SignedSource::65f2be98c591eb5479ed6a1c399394b2>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/calendar/__generated__/index.partial.tsx <<SignedSource::3fb4c1249481ec420be5118220ebcd82>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
- import React from 'react';
13
- import PlatformCalendar from '@atlaskit/calendar';
12
+ import type React from 'react';
14
13
 
15
- type PlatformCalendarProps = React.ComponentProps<typeof PlatformCalendar>;
14
+
15
+ // Serialized type
16
+ type PlatformCalendarProps = {
17
+ /**
18
+ * The number of the day currently focused. Places border around the date. Enter `0` to highlight no date.
19
+ */
20
+ day?: number;
21
+ /**
22
+ * Sets the default value for `day`.
23
+ */
24
+ defaultDay?: number;
25
+ /**
26
+ * Sets the default value for `month`.
27
+ */
28
+ defaultMonth?: number;
29
+ /**
30
+ * Sets the default value for `previouslySelected`.
31
+ */
32
+ defaultPreviouslySelected?: string[];
33
+ /**
34
+ * Sets the default value for `selected`.
35
+ */
36
+ defaultSelected?: string[];
37
+ /**
38
+ * Sets the default value for `year`.
39
+ */
40
+ defaultYear?: number;
41
+ /**
42
+ * Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates provided are greyed out and not selectable.
43
+ */
44
+ disabled?: string[];
45
+ /**
46
+ * The latest enabled date. All dates in the future after this date will be disabled.
47
+ */
48
+ maxDate?: string;
49
+ /**
50
+ * The earliest enabled date. All dates in the past before this date will be disabled.
51
+ */
52
+ minDate?: string;
53
+ /**
54
+ * The aria-label attribute associated with the next month arrow, to describe it to assistive technology.
55
+ */
56
+ nextMonthLabel?: string;
57
+ /**
58
+ * Function which is called when the calendar is no longer focused.
59
+ */
60
+ onBlur?: React.FocusEventHandler<Element>;
61
+ /**
62
+ * Called when the calendar is navigated. This can be triggered by the keyboard, or by clicking the navigational buttons.
63
+ * The 'interface' property indicates the the direction the calendar was navigated whereas the 'iso' property is a string of the format YYYY-MM-DD.
64
+ */
65
+ onChange?: (event: { iso: string, type: 'left' | 'up' | 'right' | 'down' | 'prevMonth' | 'prevYear' | 'nextMonth' | 'nextYear', day: number, month: number, year: number }, analyticsEvent: any) => void;
66
+ /**
67
+ * Called when the calendar receives focus. This could be called from a mouse event on the container, or by tabbing into it.
68
+ */
69
+ onFocus?: React.FocusEventHandler<Element>;
70
+ /**
71
+ * Function called when a day is clicked on. Calls with an object that has
72
+ * a day, month and year property as numbers, representing the date just clicked.
73
+ * It also has an 'iso' property, which is a string of the selected date in the
74
+ * format YYYY-MM-DD.
75
+ */
76
+ onSelect?: (event: { iso: string, day: number, month: number, year: number }, analyticsEvent: any) => void;
77
+ /**
78
+ * Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
79
+ * provided are given a background color.
80
+ */
81
+ previouslySelected?: string[];
82
+ /**
83
+ * The aria-label attribute associated with the previous month arrow, to describe it to assistive technology.
84
+ */
85
+ previousMonthLabel?: string;
86
+ /**
87
+ * Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
88
+ * provided are given a background color.
89
+ */
90
+ selected?: string[];
91
+ /**
92
+ * Value of current day, as a string in the format 'YYYY-MM-DD'.
93
+ */
94
+ today?: string;
95
+ /**
96
+ * Year to display the calendar for.
97
+ */
98
+ year?: number;
99
+ /**
100
+ * BCP 47 language tag (e.g. `ja-JP`) that ensures dates are in the official format for the locale.
101
+ */
102
+ locale?: string;
103
+ /**
104
+ * Start day of the week for the calendar. The mapping between numbers and days of the week is as follows:
105
+ * - `0` Sunday (default value)
106
+ * - `1` Monday
107
+ * - `2` Tuesday
108
+ * - `3` Wednesday
109
+ * - `4` Thursday
110
+ * - `5` Friday
111
+ * - `6` Saturday
112
+ */
113
+ weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
114
+ /**
115
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
116
+ *
117
+ * - testId--container - Outermost container containing everything inside calendar
118
+ * - testId--month - Container containing all available days for the month
119
+ * - testId--previous-month - Button to show next month
120
+ * - testId--next-month - Button to show previous month
121
+ * - testId--current-month-year - Text containing the current month and year
122
+ * - testId--selected-day - The currently selected day (may be missing if a date isn’t selected)
123
+ */
124
+ testId?: string;
125
+ /**
126
+ * Indicates if the calendar can be focused by keyboard or only
127
+ * programmatically. Defaults to "0".
128
+ */
129
+ tabIndex?: 0 | -1;
130
+ };
16
131
 
17
132
  export type CalendarProps = Pick<
18
133
  PlatformCalendarProps,
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - CodeProps
5
5
  *
6
- * @codegen <<SignedSource::e915d32433441373892842df5cce597e>>
6
+ * @codegen <<SignedSource::43cc01ed86828245cbe59920bda9cd4a>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/code/__generated__/code.partial.tsx <<SignedSource::6f210b052488fe7ece12d865706a551e>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
- import React from 'react';
12
+ import type React from 'react';
13
13
 
14
14
 
15
15
  // Serialized type
@@ -3,16 +3,44 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - HeadingProps
5
5
  *
6
- * @codegen <<SignedSource::0edc0326125b06e6a1280e81282d048d>>
6
+ * @codegen <<SignedSource::8ab3b3f5dd85c2eff37cf908d6e693ba>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/heading/__generated__/index.partial.tsx <<SignedSource::c7fa27d57c7e5695728bcfa2ffa634f9>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/heading/__generated__/index.partial.tsx <<SignedSource::b40904da638774634ed529b90c13d99d>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
- import type { HeadingProps as PlatformHeadingProps } from '@atlaskit/heading';
12
+ import type React from 'react';
13
13
 
14
14
  type Sizes = 'xxlarge' | 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall' | 'xxsmall';
15
15
 
16
+ // Serialized type
17
+ type PlatformHeadingProps = {
18
+ /**
19
+ * Allows the component to be rendered as the specified DOM element, overriding a default element set by `level` prop.
20
+ */
21
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span';
22
+ /**
23
+ * Token representing text color with a built-in fallback value.
24
+ * Will apply inverse text color automatically if placed within a Box with bold background color.
25
+ * Defaults to `color.text`.
26
+ */
27
+ color?: 'color.text' | 'color.text.inverse' | 'color.text.warning.inverse';
28
+ /**
29
+ * The text of the heading.
30
+ */
31
+ children: React.ReactNode;
32
+ /**
33
+ * Unique identifier for the heading DOM element.
34
+ */
35
+ id?: string;
36
+ /**
37
+ * A `testId` prop is provided for specified elements, which is a unique
38
+ * string that appears as a data attribute `data-testid` in the rendered code,
39
+ * serving as a hook for automated tests.
40
+ */
41
+ testId?: string;
42
+ };
43
+
16
44
  export type HeadingProps = Pick<
17
45
  PlatformHeadingProps,
18
46
  'children' | 'id' | 'testId' | 'as' | 'color'
@@ -3,17 +3,66 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - RangeProps
5
5
  *
6
- * @codegen <<SignedSource::8059d330e7cc4a21c671966f6c2496cc>>
6
+ * @codegen <<SignedSource::630c202e2564f5bfeac2d313285aad09>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/range/__generated__/index.partial.tsx <<SignedSource::66f3c55587192848bc42f9fc146e6c7e>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/range/__generated__/index.partial.tsx <<SignedSource::d9ea91886a193f2c5119bc1ed1b50c71>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
- import React from 'react';
13
- import PlatformRange from '@atlaskit/range';
14
12
  import type { EventHandlerProps } from './types.codegen';
15
13
 
16
- type PlatformRangeProps = React.ComponentProps<typeof PlatformRange>;
14
+
15
+ // Serialized type
16
+ type PlatformRangeProps = {
17
+ /**
18
+ * Sets the maximum value of the range.
19
+ */
20
+ max?: number;
21
+ /**
22
+ * Sets the minimum value of the range.
23
+ */
24
+ min?: number;
25
+
26
+ name?: string;
27
+ /**
28
+ * Sets the step value for the range.
29
+ */
30
+ step?: number;
31
+ /**
32
+ * Sets the value of the range.
33
+ */
34
+ value?: number;
35
+ /**
36
+ * Hook to be invoked on change of the range.
37
+ */
38
+ onChange?: (value: number) => void;
39
+ /**
40
+ * Sets the default value if range is not set.
41
+ */
42
+ defaultValue?: number;
43
+
44
+ id?: string;
45
+ /**
46
+ * Indicates the entered value does not conform to the format expected by the application.
47
+ * @see aria-errormessage.
48
+ */
49
+ "aria-invalid"?: false | true | 'false' | 'true' | 'grammar' | 'spelling';
50
+ /**
51
+ * Identifies the element (or elements) that labels the current element.
52
+ * @see aria-describedby.
53
+ */
54
+ "aria-labelledby"?: string;
55
+ /**
56
+ * Sets whether the field range is disabled.
57
+ */
58
+ isDisabled?: boolean;
59
+ /**
60
+ * A `testId` prop is provided for specific elements. This is a unique string
61
+ * that appears as a data attribute `data-testid` in the rendered code and
62
+ * serves as a hook for automated tests.
63
+ */
64
+ testId?: string;
65
+ };
17
66
 
18
67
  export type RangeProps = Pick<
19
68
  PlatformRangeProps,
@@ -1,5 +1,4 @@
1
1
  export type { BadgeProps, TBadge } from './BadgeProps.codegen';
2
- export type { BleedProps, TBleed } from './BleedProps.codegen';
3
2
  export type { BoxProps, TBox } from './BoxProps.codegen';
4
3
  export type { ButtonGroupProps, TButtonGroup } from './ButtonGroupProps.codegen';
5
4
  export type { ButtonProps, TButton } from './ButtonProps.codegen';
@@ -79,4 +78,4 @@ export type TText<T> = (props: TextProps) => T;
79
78
 
80
79
  export type { CommentEditorProps, TCommentEditor } from './CommentEditorProps.codegen';
81
80
  export type { ChromelessEditorProps, TChromelessEditor } from './ChromelessEditorProps.codegen';
82
- export type { PressableProps, TPressable } from './PressableProps.codegen';
81
+ export type { PressableProps, TPressable } from './PressableProps.codegen';
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export type {
2
2
  AdfRendererProps,
3
3
  BadgeProps,
4
- BleedProps,
5
4
  BoxProps,
6
5
  ButtonGroupProps,
7
6
  ButtonProps,
@@ -66,7 +65,6 @@ export type {
66
65
  CommentEditorProps,
67
66
  PressableProps,
68
67
  TBadge,
69
- TBleed,
70
68
  TBox,
71
69
  TButtonGroup,
72
70
  TButton,
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,15 +0,0 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- *
4
- * Extract component prop types from UIKit 2 components - BleedProps
5
- *
6
- * @codegen <<SignedSource::cc28f1caa57c117f8db064f643bfe56d>>
7
- * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/bleed/__generated__/index.partial.tsx <<SignedSource::406ffef6715a3dff3aa10511e2ec232c>>
9
- */
10
- import React from 'react';
11
- import { Bleed as PlatformBleed } from '@atlaskit/primitives';
12
- type PlatformBleedProps = React.ComponentProps<typeof PlatformBleed>;
13
- export type BleedProps = Pick<PlatformBleedProps, 'children' | 'all' | 'inline' | 'block' | 'testId' | 'role'>;
14
- export type TBleed<T> = (props: BleedProps) => T;
15
- export {};
@@ -1,15 +0,0 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- *
4
- * Extract component prop types from UIKit 2 components - BleedProps
5
- *
6
- * @codegen <<SignedSource::cc28f1caa57c117f8db064f643bfe56d>>
7
- * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/bleed/__generated__/index.partial.tsx <<SignedSource::406ffef6715a3dff3aa10511e2ec232c>>
9
- */
10
- import React from 'react';
11
- import { Bleed as PlatformBleed } from '@atlaskit/primitives';
12
- type PlatformBleedProps = React.ComponentProps<typeof PlatformBleed>;
13
- export type BleedProps = Pick<PlatformBleedProps, 'children' | 'all' | 'inline' | 'block' | 'testId' | 'role'>;
14
- export type TBleed<T> = (props: BleedProps) => T;
15
- export {};
@@ -1,22 +0,0 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- *
4
- * Extract component prop types from UIKit 2 components - BleedProps
5
- *
6
- * @codegen <<SignedSource::cc28f1caa57c117f8db064f643bfe56d>>
7
- * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/bleed/__generated__/index.partial.tsx <<SignedSource::406ffef6715a3dff3aa10511e2ec232c>>
9
- */
10
- /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
-
12
- import React from 'react';
13
- import { Bleed as PlatformBleed } from '@atlaskit/primitives';
14
-
15
- type PlatformBleedProps = React.ComponentProps<typeof PlatformBleed>;
16
-
17
- export type BleedProps = Pick<
18
- PlatformBleedProps,
19
- 'children' | 'all' | 'inline' | 'block' | 'testId' | 'role'
20
- >;
21
-
22
- export type TBleed<T> = (props: BleedProps) => T;