@atlaskit/forge-react-types 0.42.7 → 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 (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/types/components/__generated__/BadgeProps.codegen.d.ts +19 -4
  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__/CodeBlockProps.codegen.d.ts +8 -8
  6. package/dist/types/components/__generated__/CodeProps.codegen.d.ts +4 -4
  7. package/dist/types/components/__generated__/HeadingProps.codegen.d.ts +29 -3
  8. package/dist/types/components/__generated__/PressableProps.codegen.d.ts +2 -2
  9. package/dist/types/components/__generated__/RangeProps.codegen.d.ts +50 -5
  10. package/dist/types/components/__generated__/index.d.ts +0 -1
  11. package/dist/types/index.d.ts +1 -1
  12. package/dist/types-ts4.5/components/__generated__/BadgeProps.codegen.d.ts +19 -4
  13. package/dist/types-ts4.5/components/__generated__/BoxProps.codegen.d.ts +2 -2
  14. package/dist/types-ts4.5/components/__generated__/CalendarProps.codegen.d.ts +128 -4
  15. package/dist/types-ts4.5/components/__generated__/CodeBlockProps.codegen.d.ts +8 -8
  16. package/dist/types-ts4.5/components/__generated__/CodeProps.codegen.d.ts +4 -4
  17. package/dist/types-ts4.5/components/__generated__/HeadingProps.codegen.d.ts +29 -3
  18. package/dist/types-ts4.5/components/__generated__/PressableProps.codegen.d.ts +2 -2
  19. package/dist/types-ts4.5/components/__generated__/RangeProps.codegen.d.ts +50 -5
  20. package/dist/types-ts4.5/components/__generated__/index.d.ts +0 -1
  21. package/dist/types-ts4.5/index.d.ts +1 -1
  22. package/package.json +4 -6
  23. package/scripts/codegen/codeGenerator.ts +134 -30
  24. package/scripts/codegen/componentPropTypes.ts +11 -4
  25. package/scripts/codegen/typeSerializer.ts +158 -95
  26. package/scripts/codegen/utils.ts +71 -0
  27. package/scripts/codegen-runner.ts +17 -0
  28. package/scripts/typechecker.ts +35 -0
  29. package/src/components/__generated__/BadgeProps.codegen.tsx +22 -4
  30. package/src/components/__generated__/CalendarProps.codegen.tsx +119 -4
  31. package/src/components/__generated__/CodeBlockProps.codegen.tsx +9 -9
  32. package/src/components/__generated__/CodeProps.codegen.tsx +5 -5
  33. package/src/components/__generated__/HeadingProps.codegen.tsx +31 -3
  34. package/src/components/__generated__/RangeProps.codegen.tsx +54 -5
  35. package/src/components/__generated__/index.ts +1 -2
  36. package/src/index.ts +0 -2
  37. package/dist/cjs/components/__generated__/BleedProps.codegen.js +0 -5
  38. package/dist/es2019/components/__generated__/BleedProps.codegen.js +0 -1
  39. package/dist/esm/components/__generated__/BleedProps.codegen.js +0 -1
  40. package/dist/types/components/__generated__/BleedProps.codegen.d.ts +0 -15
  41. package/dist/types-ts4.5/components/__generated__/BleedProps.codegen.d.ts +0 -15
  42. package/src/components/__generated__/BleedProps.codegen.tsx +0 -22
@@ -0,0 +1,71 @@
1
+ import {
2
+ type Symbol as TSSymbol,
3
+ type TypeReferenceNode,
4
+ type TypeNode,
5
+ SyntaxKind,
6
+ } from 'ts-morph';
7
+
8
+ export const getTypeNodeFromSymbol = (symbol: TSSymbol): TypeNode | null => {
9
+ const declaration = symbol.getDeclarations()[0];
10
+ if (!declaration) {
11
+ return null;
12
+ }
13
+
14
+ if (declaration.getKind() === SyntaxKind.TypeAliasDeclaration) {
15
+ return declaration.asKindOrThrow(SyntaxKind.TypeAliasDeclaration).getTypeNode() ?? null;
16
+ }
17
+
18
+ return null;
19
+ };
20
+
21
+ type TypeFinderPredicate = (node: TypeNode) => boolean;
22
+
23
+ export const makePickOrOmitPredicate = (
24
+ targetTypeName: 'Pick' | 'Omit',
25
+ baseClassNamePrefix: string,
26
+ ): TypeFinderPredicate => {
27
+ return (node: TypeNode) => {
28
+ const typeReferenceNode = node.asKind(SyntaxKind.TypeReference);
29
+ if (!typeReferenceNode) {
30
+ return false;
31
+ }
32
+ const typeName = typeReferenceNode.getTypeName().getText();
33
+ if (typeName !== targetTypeName) {
34
+ return false;
35
+ }
36
+ const baseNode = typeReferenceNode.getTypeArguments()[0]!;
37
+ return baseNode.getText().startsWith(baseClassNamePrefix);
38
+ };
39
+ };
40
+
41
+ export const findTypeReferenceFromUnionOrIntersect = (
42
+ node: TypeNode,
43
+ predicate: TypeFinderPredicate,
44
+ ): TypeReferenceNode | null => {
45
+ if (predicate(node)) {
46
+ return node.asKindOrThrow(SyntaxKind.TypeReference);
47
+ }
48
+ if (node.getKind() === SyntaxKind.UnionType) {
49
+ const unionNode = node.asKindOrThrow(SyntaxKind.UnionType);
50
+ return (
51
+ (unionNode.getTypeNodes().find((n) => {
52
+ if (n.isKind(SyntaxKind.TypeReference)) {
53
+ return predicate(n.asKindOrThrow(SyntaxKind.TypeReference));
54
+ }
55
+ return false;
56
+ }) as TypeReferenceNode) ?? null
57
+ );
58
+ } else if (node.getKind() === SyntaxKind.IntersectionType) {
59
+ const intersectionNode = node.asKindOrThrow(SyntaxKind.IntersectionType);
60
+ return (
61
+ (intersectionNode.getTypeNodes().find((n) => {
62
+ if (n.isKind(SyntaxKind.TypeReference)) {
63
+ return predicate(n.asKindOrThrow(SyntaxKind.TypeReference));
64
+ }
65
+ return false;
66
+ }) as TypeReferenceNode) ?? null
67
+ );
68
+ }
69
+
70
+ return null;
71
+ };
@@ -1,9 +1,26 @@
1
1
  import { generateComponentPropTypes } from './codegen';
2
2
 
3
+ const runTypeCheck = () => {
4
+ // execute yarn run check-types
5
+ const { execSync } = require('child_process');
6
+ try {
7
+ execSync('yarn run check-types', { stdio: 'inherit' });
8
+ // eslint-disable-next-line no-console
9
+ console.log('✅ 🚀 Type checks passed successfully for generated UIKit component types!');
10
+ } catch (error) {
11
+ // eslint-disable-next-line no-console
12
+ console.error('❌ Type checks failed:', error);
13
+ process.exit(1);
14
+ }
15
+ };
16
+
3
17
  if (process.argv.length < 3) {
4
18
  generateComponentPropTypes();
5
19
  } else {
6
20
  // e.g yarn workspace @atlaskit/forge-react-types codegen Button
21
+ // or yarn workspace @atlaskit/forge-react-types codegen Button,Code
7
22
  const componentPropTypeFilter = process.argv[2];
8
23
  generateComponentPropTypes(componentPropTypeFilter);
9
24
  }
25
+
26
+ runTypeCheck();
@@ -0,0 +1,35 @@
1
+ /* eslint-disable */
2
+ import {
3
+ type BadgeProps,
4
+ type CalendarProps,
5
+ type CodeBlockProps,
6
+ type CodeProps,
7
+ type HeadingProps,
8
+ type RangeProps,
9
+ } from '@atlassian/forge-ui/src/components/UIKit';
10
+ import { type BadgeProps as GeneratedBadgeProps } from '../src/components/__generated__/BadgeProps.codegen';
11
+ import { type CalendarProps as GeneratedCalendarProps } from '../src/components/__generated__/CalendarProps.codegen';
12
+ import { type CodeBlockProps as GeneratedCodeBlockProps } from '../src/components/__generated__/CodeBlockProps.codegen';
13
+ import { type CodeProps as GeneratedCodeProps } from '../src/components/__generated__/CodeProps.codegen';
14
+ import { type HeadingProps as GeneratedHeadingProps } from '../src/components/__generated__/HeadingProps.codegen';
15
+ import { type RangeProps as GeneratedRangeProps } from '../src/components/__generated__/RangeProps.codegen';
16
+
17
+ const assertAssignable = <A, B extends A>() => {};
18
+
19
+ assertAssignable<GeneratedBadgeProps, BadgeProps>();
20
+ assertAssignable<BadgeProps, GeneratedBadgeProps>();
21
+
22
+ assertAssignable<GeneratedCodeProps, CodeProps>();
23
+ assertAssignable<CodeProps, GeneratedCodeProps>();
24
+
25
+ assertAssignable<GeneratedCodeBlockProps, CodeBlockProps>();
26
+ assertAssignable<CodeBlockProps, GeneratedCodeBlockProps>();
27
+
28
+ assertAssignable<GeneratedHeadingProps, HeadingProps>();
29
+ assertAssignable<HeadingProps, GeneratedHeadingProps>();
30
+
31
+ assertAssignable<GeneratedRangeProps, RangeProps>();
32
+ assertAssignable<RangeProps, GeneratedRangeProps>();
33
+
34
+ assertAssignable<GeneratedCalendarProps, CalendarProps>();
35
+ assertAssignable<CalendarProps, GeneratedCalendarProps>();
@@ -3,16 +3,14 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - BadgeProps
5
5
  *
6
- * @codegen <<SignedSource::c3ed8f1b656c7e1c4a9aad0919de3f7d>>
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';
13
- import PlatformBadge from '@atlaskit/badge';
12
+ import type React from 'react';
14
13
 
15
- type _PlatformBadgeProps = React.ComponentProps<typeof PlatformBadge>;
16
14
  export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
17
15
  /**
18
16
  * 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.
@@ -22,6 +20,26 @@ export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
22
20
  children?: _PlatformBadgeProps['children'];
23
21
  }
24
22
 
23
+ // Serialized type
24
+ type _PlatformBadgeProps = {
25
+ /**
26
+ * Affects the visual style of the badge.
27
+ */
28
+ appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
29
+
30
+ children?: React.ReactNode;
31
+ /**
32
+ * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
33
+ * This value should be greater than 0. If set to `false` the original value will be displayed regardless of
34
+ * whether it is larger than the default maximum value.
35
+ */
36
+ max?: number | false;
37
+ /**
38
+ * 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
39
+ */
40
+ testId?: string;
41
+ };
42
+
25
43
  export type BadgeProps = Pick<
26
44
  PlatformBadgeProps,
27
45
  'appearance' | 'children' | 'max' | 'testId'
@@ -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,7 +3,7 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - CodeBlockProps
5
5
  *
6
- * @codegen <<SignedSource::8fded8a55e24b0312739eb3ab66f63ca>>
6
+ * @codegen <<SignedSource::65085e024d4b564b666c598596566f73>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/code/__generated__/codeblock.partial.tsx <<SignedSource::88ed38fdfc47db0938e7801195a00403>>
9
9
  */
@@ -20,12 +20,12 @@ type PlatformCodeBlockProps = {
20
20
  * A unique string that appears as a data attribute `data-testid` in the
21
21
  * rendered code. Serves as a hook for automated tests.
22
22
  */
23
- testId: string;
23
+ testId?: string;
24
24
  /**
25
25
  * Sets whether to display code line numbers or not.
26
26
  * @default true
27
27
  */
28
- showLineNumbers: boolean;
28
+ showLineNumbers?: boolean;
29
29
  /**
30
30
  * Language reference designed to be populated from `SUPPORTED_LANGUAGES` in
31
31
  * `design-system/code`. Run against language grammars from PrismJS (full list
@@ -36,7 +36,7 @@ type PlatformCodeBlockProps = {
36
36
  *
37
37
  * @default 'text'
38
38
  */
39
- language: "text" | "PHP" | "php" | "php3" | "php4" | "php5" | "Java" | "java" | "CSharp" | "csharp" | "c#" | "Python" | "python" | "py" | "JavaScript" | "javascript" | "js" | "Html" | "html" | "xml" | "C++" | "c++" | "cpp" | "clike" | "Ruby" | "ruby" | "rb" | "duby" | "Objective-C" | "objective-c" | "objectivec" | "obj-c" | "objc" | "C" | "c" | "Swift" | "swift" | "TeX" | "tex" | "latex" | "Shell" | "shell" | "bash" | "sh" | "ksh" | "zsh" | "Scala" | "scala" | "Go" | "go" | "ActionScript" | "actionscript" | "actionscript3" | "as" | "ColdFusion" | "coldfusion" | "JavaFX" | "javafx" | "jfx" | "VbNet" | "vbnet" | "vb.net" | "vfp" | "clipper" | "xbase" | "JSON" | "json" | "MATLAB" | "matlab" | "Groovy" | "groovy" | "SQL" | "sql" | "postgresql" | "postgres" | "plpgsql" | "psql" | "postgresql-console" | "postgres-console" | "tsql" | "t-sql" | "mysql" | "sqlite" | "R" | "r" | "Perl" | "perl" | "pl" | "Lua" | "lua" | "Pascal" | "pas" | "pascal" | "objectpascal" | "delphi" | "XML" | "TypeScript" | "typescript" | "ts" | "CoffeeScript" | "coffeescript" | "coffee-script" | "coffee" | "Haskell" | "haskell" | "hs" | "Puppet" | "puppet" | "Arduino" | "arduino" | "Fortran" | "fortran" | "Erlang" | "erlang" | "erl" | "PowerShell" | "powershell" | "posh" | "ps1" | "psm1" | "Haxe" | "haxe" | "hx" | "hxsl" | "Elixir" | "elixir" | "ex" | "exs" | "Verilog" | "verilog" | "v" | "Rust" | "rust" | "VHDL" | "vhdl" | "Sass" | "sass" | "OCaml" | "ocaml" | "Dart" | "dart" | "CSS" | "css" | "reStructuredText" | "restructuredtext" | "rst" | "rest" | "Kotlin" | "kotlin" | "D" | "d" | "Octave" | "octave" | "QML" | "qbs" | "qml" | "Prolog" | "prolog" | "FoxPro" | "foxpro" | "purebasic" | "Scheme" | "scheme" | "scm" | "CUDA" | "cuda" | "cu" | "Julia" | "julia" | "jl" | "Racket" | "racket" | "rkt" | "Ada" | "ada" | "ada95" | "ada2005" | "Tcl" | "tcl" | "Mathematica" | "mathematica" | "mma" | "nb" | "Autoit" | "autoit" | "StandardML" | "standardmL" | "sml" | "standardml" | "Objective-J" | "objective-j" | "objectivej" | "obj-j" | "objj" | "Smalltalk" | "smalltalk" | "squeak" | "st" | "Vala" | "vala" | "vapi" | "LiveScript" | "livescript" | "live-script" | "XQuery" | "xquery" | "xqy" | "xq" | "xql" | "xqm" | "PlainText" | "plaintext" | "Yaml" | "yaml" | "yml" | "GraphQL" | "graphql" | "AppleScript" | "applescript" | "Clojure" | "clojure" | "Diff" | "diff" | "VisualBasic" | "visualbasic" | "JSX" | "jsx" | "TSX" | "tsx" | "SplunkSPL" | "splunk-spl" | "Dockerfile" | "docker" | "dockerfile" | "HCL" | "hcl" | "terraform" | "NGINX" | "nginx" | "Protocol Buffers" | "protobuf" | "proto" | "Handlebars" | "handlebars" | "mustache" | "Gherkin" | "gherkin" | "cucumber" | "ABAP" | "abap";
39
+ language?: 'text' | 'PHP' | 'php' | 'php3' | 'php4' | 'php5' | 'Java' | 'java' | 'CSharp' | 'csharp' | 'c#' | 'Python' | 'python' | 'py' | 'JavaScript' | 'javascript' | 'js' | 'Html' | 'html' | 'xml' | 'C++' | 'c++' | 'cpp' | 'clike' | 'Ruby' | 'ruby' | 'rb' | 'duby' | 'Objective-C' | 'objective-c' | 'objectivec' | 'obj-c' | 'objc' | 'C' | 'c' | 'Swift' | 'swift' | 'TeX' | 'tex' | 'latex' | 'Shell' | 'shell' | 'bash' | 'sh' | 'ksh' | 'zsh' | 'Scala' | 'scala' | 'Go' | 'go' | 'ActionScript' | 'actionscript' | 'actionscript3' | 'as' | 'ColdFusion' | 'coldfusion' | 'JavaFX' | 'javafx' | 'jfx' | 'VbNet' | 'vbnet' | 'vb.net' | 'vfp' | 'clipper' | 'xbase' | 'JSON' | 'json' | 'MATLAB' | 'matlab' | 'Groovy' | 'groovy' | 'SQL' | 'sql' | 'postgresql' | 'postgres' | 'plpgsql' | 'psql' | 'postgresql-console' | 'postgres-console' | 'tsql' | 't-sql' | 'mysql' | 'sqlite' | 'R' | 'r' | 'Perl' | 'perl' | 'pl' | 'Lua' | 'lua' | 'Pascal' | 'pas' | 'pascal' | 'objectpascal' | 'delphi' | 'XML' | 'TypeScript' | 'typescript' | 'ts' | 'CoffeeScript' | 'coffeescript' | 'coffee-script' | 'coffee' | 'Haskell' | 'haskell' | 'hs' | 'Puppet' | 'puppet' | 'Arduino' | 'arduino' | 'Fortran' | 'fortran' | 'Erlang' | 'erlang' | 'erl' | 'PowerShell' | 'powershell' | 'posh' | 'ps1' | 'psm1' | 'Haxe' | 'haxe' | 'hx' | 'hxsl' | 'Elixir' | 'elixir' | 'ex' | 'exs' | 'Verilog' | 'verilog' | 'v' | 'Rust' | 'rust' | 'VHDL' | 'vhdl' | 'Sass' | 'sass' | 'OCaml' | 'ocaml' | 'Dart' | 'dart' | 'CSS' | 'css' | 'reStructuredText' | 'restructuredtext' | 'rst' | 'rest' | 'Kotlin' | 'kotlin' | 'D' | 'd' | 'Octave' | 'octave' | 'QML' | 'qbs' | 'qml' | 'Prolog' | 'prolog' | 'FoxPro' | 'foxpro' | 'purebasic' | 'Scheme' | 'scheme' | 'scm' | 'CUDA' | 'cuda' | 'cu' | 'Julia' | 'julia' | 'jl' | 'Racket' | 'racket' | 'rkt' | 'Ada' | 'ada' | 'ada95' | 'ada2005' | 'Tcl' | 'tcl' | 'Mathematica' | 'mathematica' | 'mma' | 'nb' | 'Autoit' | 'autoit' | 'StandardML' | 'standardmL' | 'sml' | 'standardml' | 'Objective-J' | 'objective-j' | 'objectivej' | 'obj-j' | 'objj' | 'Smalltalk' | 'smalltalk' | 'squeak' | 'st' | 'Vala' | 'vala' | 'vapi' | 'LiveScript' | 'livescript' | 'live-script' | 'XQuery' | 'xquery' | 'xqy' | 'xq' | 'xql' | 'xqm' | 'PlainText' | 'plaintext' | 'Yaml' | 'yaml' | 'yml' | 'GraphQL' | 'graphql' | 'AppleScript' | 'applescript' | 'Clojure' | 'clojure' | 'Diff' | 'diff' | 'VisualBasic' | 'visualbasic' | 'JSX' | 'jsx' | 'TSX' | 'tsx' | 'SplunkSPL' | 'splunk-spl' | 'Dockerfile' | 'docker' | 'dockerfile' | 'HCL' | 'hcl' | 'terraform' | 'NGINX' | 'nginx' | 'Protocol Buffers' | 'protobuf' | 'proto' | 'Handlebars' | 'handlebars' | 'mustache' | 'Gherkin' | 'gherkin' | 'cucumber' | 'ABAP' | 'abap';
40
40
  /**
41
41
  * Comma delimited lines to highlight.
42
42
  *
@@ -45,22 +45,22 @@ type PlatformCodeBlockProps = {
45
45
  * - To highlight a group of lines `highlight="1-5"`
46
46
  * - To highlight multiple groups `highlight="1-5,7,10,15-20"`
47
47
  */
48
- highlight: string;
48
+ highlight?: string;
49
49
  /**
50
50
  * Screen reader text for the start of a highlighted line.
51
51
  */
52
- highlightedStartText: string;
52
+ highlightedStartText?: string;
53
53
  /**
54
54
  * Screen reader text for the end of a highlighted line.
55
55
  */
56
- highlightedEndText: string;
56
+ highlightedEndText?: string;
57
57
  /**
58
58
  * Sets whether long lines will create a horizontally scrolling container.
59
59
  * When set to `true`, these lines will visually wrap instead.
60
60
  * @default false
61
61
  */
62
- shouldWrapLongLines: boolean;
63
- }
62
+ shouldWrapLongLines?: boolean;
63
+ };
64
64
 
65
65
  export type CodeBlockProps = Pick<
66
66
  PlatformCodeBlockProps,
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - CodeProps
5
5
  *
6
- * @codegen <<SignedSource::7ea0b6ee7be9f3e5454b38e528c0753f>>
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 { type ReactNode } from 'react';
12
+ import type React from 'react';
13
13
 
14
14
 
15
15
  // Serialized type
@@ -18,12 +18,12 @@ type PlatformCodeProps = {
18
18
  * A unique string that appears as a data attribute `data-testid`
19
19
  * in the rendered code. Serves as a hook for automated tests.
20
20
  */
21
- testId: string;
21
+ testId?: string;
22
22
  /**
23
23
  * Content to be rendered in the inline code block.
24
24
  */
25
- children: ReactNode;
26
- }
25
+ children?: React.ReactNode;
26
+ };
27
27
 
28
28
  export type CodeProps = Pick<
29
29
  PlatformCodeProps,
@@ -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 {};