carbon-react 118.2.1 → 118.3.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.
Files changed (126) hide show
  1. package/esm/components/button-minor/button-minor.component.d.ts +5 -1
  2. package/esm/components/button-minor/button-minor.component.js +4 -1
  3. package/esm/components/button-minor/button-minor.style.d.ts +2 -1
  4. package/esm/components/button-minor/button-minor.style.js +17 -0
  5. package/esm/components/button-minor/index.d.ts +1 -1
  6. package/esm/components/i18n-provider/i18n-provider.component.js +4 -0
  7. package/esm/components/password/index.d.ts +2 -0
  8. package/esm/components/password/index.js +1 -0
  9. package/esm/components/password/password.component.d.ts +9 -0
  10. package/esm/components/password/password.component.js +580 -0
  11. package/esm/components/password/password.style.d.ts +5 -0
  12. package/esm/components/password/password.style.js +8 -0
  13. package/esm/components/text-editor/__internal__/decorators/index.d.ts +2 -2
  14. package/esm/components/text-editor/__internal__/decorators/link-decorator.d.ts +7 -6
  15. package/esm/components/text-editor/__internal__/editor-counter/editor-counter.component.d.ts +15 -0
  16. package/esm/components/text-editor/__internal__/editor-counter/editor-counter.component.js +5 -15
  17. package/esm/components/text-editor/__internal__/editor-counter/editor-counter.style.d.ts +5 -0
  18. package/esm/components/text-editor/__internal__/editor-counter/index.d.ts +2 -2
  19. package/esm/components/text-editor/__internal__/editor-link/editor-link.component.d.ts +9 -0
  20. package/esm/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
  21. package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +3 -0
  22. package/esm/components/text-editor/__internal__/editor-link/index.d.ts +2 -2
  23. package/esm/components/text-editor/__internal__/label-wrapper/index.d.ts +2 -2
  24. package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.component.d.ts +12 -0
  25. package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.component.js +4 -3
  26. package/esm/components/text-editor/__internal__/toolbar/index.d.ts +2 -2
  27. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/index.d.ts +2 -2
  28. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.d.ts +25 -0
  29. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +12 -23
  30. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.d.ts +6 -0
  31. package/esm/components/text-editor/__internal__/toolbar/toolbar.component.d.ts +16 -0
  32. package/esm/components/text-editor/__internal__/toolbar/toolbar.component.js +40 -36
  33. package/esm/components/text-editor/__internal__/toolbar/toolbar.style.d.ts +4 -0
  34. package/esm/components/text-editor/__internal__/utils/index.d.ts +1 -1
  35. package/esm/components/text-editor/__internal__/utils/utils.d.ts +27 -26
  36. package/esm/components/text-editor/__internal__/utils/utils.js +9 -10
  37. package/esm/components/text-editor/index.d.ts +2 -2
  38. package/esm/components/text-editor/text-editor.component.d.ts +36 -7
  39. package/esm/components/text-editor/text-editor.component.js +230 -87
  40. package/esm/components/text-editor/text-editor.style.d.ts +11 -3
  41. package/esm/components/text-editor/text-editor.style.js +1 -2
  42. package/esm/components/text-editor/types.d.ts +6 -0
  43. package/esm/components/text-editor/types.js +4 -0
  44. package/esm/components/textbox/textbox.component.js +1 -1
  45. package/esm/hooks/__internal__/useFloating/useFloating.js +6 -2
  46. package/esm/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.js +1 -1
  47. package/esm/locales/en-gb.js +4 -0
  48. package/esm/locales/locale.d.ts +4 -0
  49. package/esm/locales/pl-pl.js +4 -0
  50. package/esm/style/design-tokens/debug-theme.util.d.ts +17 -0
  51. package/esm/style/themes/sage/index.d.ts +17 -0
  52. package/lib/components/button-minor/button-minor.component.d.ts +5 -1
  53. package/lib/components/button-minor/button-minor.component.js +4 -1
  54. package/lib/components/button-minor/button-minor.style.d.ts +2 -1
  55. package/lib/components/button-minor/button-minor.style.js +17 -0
  56. package/lib/components/button-minor/index.d.ts +1 -1
  57. package/lib/components/i18n-provider/i18n-provider.component.js +4 -0
  58. package/lib/components/password/index.d.ts +2 -0
  59. package/lib/components/password/index.js +15 -0
  60. package/lib/components/password/package.json +6 -0
  61. package/lib/components/password/password.component.d.ts +9 -0
  62. package/lib/components/password/password.component.js +600 -0
  63. package/lib/components/password/password.style.d.ts +5 -0
  64. package/lib/components/password/password.style.js +21 -0
  65. package/lib/components/text-editor/__internal__/decorators/index.d.ts +2 -2
  66. package/lib/components/text-editor/__internal__/decorators/link-decorator.d.ts +7 -6
  67. package/lib/components/text-editor/__internal__/editor-counter/editor-counter.component.d.ts +15 -0
  68. package/lib/components/text-editor/__internal__/editor-counter/editor-counter.component.js +5 -15
  69. package/lib/components/text-editor/__internal__/editor-counter/editor-counter.style.d.ts +5 -0
  70. package/lib/components/text-editor/__internal__/editor-counter/index.d.ts +2 -2
  71. package/lib/components/text-editor/__internal__/editor-link/editor-link.component.d.ts +9 -0
  72. package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
  73. package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +3 -0
  74. package/lib/components/text-editor/__internal__/editor-link/index.d.ts +2 -2
  75. package/lib/components/text-editor/__internal__/label-wrapper/index.d.ts +2 -2
  76. package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.component.d.ts +12 -0
  77. package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.component.js +2 -8
  78. package/lib/components/text-editor/__internal__/toolbar/index.d.ts +2 -2
  79. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/index.d.ts +2 -2
  80. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.d.ts +25 -0
  81. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +13 -24
  82. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.d.ts +6 -0
  83. package/lib/components/text-editor/__internal__/toolbar/toolbar.component.d.ts +16 -0
  84. package/lib/components/text-editor/__internal__/toolbar/toolbar.component.js +50 -46
  85. package/lib/components/text-editor/__internal__/toolbar/toolbar.style.d.ts +4 -0
  86. package/lib/components/text-editor/__internal__/utils/index.d.ts +1 -1
  87. package/lib/components/text-editor/__internal__/utils/utils.d.ts +27 -26
  88. package/lib/components/text-editor/__internal__/utils/utils.js +10 -11
  89. package/lib/components/text-editor/index.d.ts +2 -2
  90. package/lib/components/text-editor/text-editor.component.d.ts +36 -7
  91. package/lib/components/text-editor/text-editor.component.js +231 -88
  92. package/lib/components/text-editor/text-editor.style.d.ts +11 -3
  93. package/lib/components/text-editor/text-editor.style.js +1 -2
  94. package/lib/components/text-editor/types.d.ts +6 -0
  95. package/lib/components/text-editor/types.js +14 -0
  96. package/lib/components/textbox/textbox.component.js +1 -1
  97. package/lib/hooks/__internal__/useFloating/useFloating.js +6 -2
  98. package/lib/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.js +1 -1
  99. package/lib/hooks/__internal__/useUniqueId/package.json +6 -0
  100. package/lib/locales/en-gb.js +4 -0
  101. package/lib/locales/locale.d.ts +4 -0
  102. package/lib/locales/pl-pl.js +4 -0
  103. package/lib/style/design-tokens/debug-theme.util.d.ts +17 -0
  104. package/lib/style/themes/sage/index.d.ts +17 -0
  105. package/package.json +6 -6
  106. package/esm/__internal__/DeprecationWarning.js +0 -20
  107. package/esm/__internal__/utils/storybook/partial-action.d.ts +0 -3
  108. package/esm/__internal__/utils/storybook/partial-action.js +0 -13
  109. package/esm/components/text-editor/__internal__/editor-counter/editor-counter.d.ts +0 -11
  110. package/esm/components/text-editor/__internal__/editor-link/editor-link.d.ts +0 -11
  111. package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.d.ts +0 -10
  112. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.d.ts +0 -20
  113. package/esm/components/text-editor/__internal__/toolbar/toolbar.d.ts +0 -13
  114. package/esm/components/text-editor/text-editor.d.ts +0 -40
  115. package/lib/__internal__/DeprecationWarning.js +0 -31
  116. package/lib/__internal__/utils/helpers/useUniqueId/package.json +0 -6
  117. package/lib/__internal__/utils/storybook/partial-action.d.ts +0 -3
  118. package/lib/__internal__/utils/storybook/partial-action.js +0 -21
  119. package/lib/components/text-editor/__internal__/editor-counter/editor-counter.d.ts +0 -11
  120. package/lib/components/text-editor/__internal__/editor-link/editor-link.d.ts +0 -11
  121. package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.d.ts +0 -10
  122. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.d.ts +0 -20
  123. package/lib/components/text-editor/__internal__/toolbar/toolbar.d.ts +0 -13
  124. package/lib/components/text-editor/text-editor.d.ts +0 -40
  125. /package/esm/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.d.ts +0 -0
  126. /package/lib/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.d.ts +0 -0
@@ -22,6 +22,7 @@ declare const _default: {
22
22
  colorsUtilityYin065: string;
23
23
  colorsUtilityYin090: string;
24
24
  colorsUtilityYang100: string;
25
+ colorsUtilityYang080: string;
25
26
  colorsUtilityDisabled400: string;
26
27
  colorsUtilityDisabled500: string;
27
28
  colorsUtilityDisabled600: string;
@@ -68,6 +69,7 @@ declare const _default: {
68
69
  colorsActionReadOnly500: string;
69
70
  colorsActionReadOnly600: string;
70
71
  colorsSemanticNeutral200: string;
72
+ colorsSemanticNeutral400: string;
71
73
  colorsSemanticNeutral500: string;
72
74
  colorsSemanticNeutral600: string;
73
75
  colorsSemanticNeutralTransparent: string;
@@ -108,6 +110,7 @@ declare const _default: {
108
110
  colorsSemanticCautionYin090: string;
109
111
  colorsSemanticCautionYang100: string;
110
112
  colorsSemanticInfo150: string;
113
+ colorsSemanticInfo400: string;
111
114
  colorsSemanticInfo500: string;
112
115
  colorsSemanticInfo600: string;
113
116
  colorsSemanticInfoTransparent: string;
@@ -224,6 +227,7 @@ declare const _default: {
224
227
  sizing150: string;
225
228
  sizing175: string;
226
229
  sizing200: string;
230
+ sizing225: string;
227
231
  sizing250: string;
228
232
  sizing275: string;
229
233
  sizing300: string;
@@ -275,6 +279,7 @@ declare const _default: {
275
279
  borderWidth200: string;
276
280
  borderWidth300: string;
277
281
  borderWidth400: string;
282
+ borderWidth600: string;
278
283
  borderWidth000: string;
279
284
  fontSizes100: string;
280
285
  fontSizes200: string;
@@ -395,6 +400,9 @@ declare const _default: {
395
400
  typographyLinkTextS: string;
396
401
  typographyLinkTextM: string;
397
402
  typographyLinkTextL: string;
403
+ typographyLinkTextFocusS: string;
404
+ typographyLinkTextFocusM: string;
405
+ typographyLinkTextFocusL: string;
398
406
  typographyMenuLabelM: string;
399
407
  typographyMenuLabelL: string;
400
408
  typographyMenuSegmentTitleM: string;
@@ -467,8 +475,17 @@ declare const _default: {
467
475
  typographyTableCellTextL: string;
468
476
  typographyTableCellTextXl: string;
469
477
  typographyTileParagraphM: string;
478
+ typographyTileSubscriptionTitleM: string;
479
+ typographyTileSubscriptionParagraphM: string;
480
+ typographyTileSubscriptionParagraphBoldM: string;
481
+ typographyTileSubscriptionPriceM: string;
470
482
  typographyTooltipTextM: string;
471
483
  typographyTooltipTextL: string;
484
+ typographyNoteEditorNameM: string;
485
+ typographyNoteDateM: string;
486
+ typographyNoteParagraphM: string;
487
+ typographyNoteParagraphListM: string;
488
+ typographyNoteTitleM: string;
472
489
  opacity300: string;
473
490
  opacity600: string;
474
491
  opacity800: string;
@@ -22,6 +22,7 @@ declare var _default: {
22
22
  colorsUtilityYin065: string;
23
23
  colorsUtilityYin090: string;
24
24
  colorsUtilityYang100: string;
25
+ colorsUtilityYang080: string;
25
26
  colorsUtilityDisabled400: string;
26
27
  colorsUtilityDisabled500: string;
27
28
  colorsUtilityDisabled600: string;
@@ -68,6 +69,7 @@ declare var _default: {
68
69
  colorsActionReadOnly500: string;
69
70
  colorsActionReadOnly600: string;
70
71
  colorsSemanticNeutral200: string;
72
+ colorsSemanticNeutral400: string;
71
73
  colorsSemanticNeutral500: string;
72
74
  colorsSemanticNeutral600: string;
73
75
  colorsSemanticNeutralTransparent: string;
@@ -108,6 +110,7 @@ declare var _default: {
108
110
  colorsSemanticCautionYin090: string;
109
111
  colorsSemanticCautionYang100: string;
110
112
  colorsSemanticInfo150: string;
113
+ colorsSemanticInfo400: string;
111
114
  colorsSemanticInfo500: string;
112
115
  colorsSemanticInfo600: string;
113
116
  colorsSemanticInfoTransparent: string;
@@ -224,6 +227,7 @@ declare var _default: {
224
227
  sizing150: string;
225
228
  sizing175: string;
226
229
  sizing200: string;
230
+ sizing225: string;
227
231
  sizing250: string;
228
232
  sizing275: string;
229
233
  sizing300: string;
@@ -275,6 +279,7 @@ declare var _default: {
275
279
  borderWidth200: string;
276
280
  borderWidth300: string;
277
281
  borderWidth400: string;
282
+ borderWidth600: string;
278
283
  borderWidth000: string;
279
284
  fontSizes100: string;
280
285
  fontSizes200: string;
@@ -395,6 +400,9 @@ declare var _default: {
395
400
  typographyLinkTextS: string;
396
401
  typographyLinkTextM: string;
397
402
  typographyLinkTextL: string;
403
+ typographyLinkTextFocusS: string;
404
+ typographyLinkTextFocusM: string;
405
+ typographyLinkTextFocusL: string;
398
406
  typographyMenuLabelM: string;
399
407
  typographyMenuLabelL: string;
400
408
  typographyMenuSegmentTitleM: string;
@@ -467,8 +475,17 @@ declare var _default: {
467
475
  typographyTableCellTextL: string;
468
476
  typographyTableCellTextXl: string;
469
477
  typographyTileParagraphM: string;
478
+ typographyTileSubscriptionTitleM: string;
479
+ typographyTileSubscriptionParagraphM: string;
480
+ typographyTileSubscriptionParagraphBoldM: string;
481
+ typographyTileSubscriptionPriceM: string;
470
482
  typographyTooltipTextM: string;
471
483
  typographyTooltipTextL: string;
484
+ typographyNoteEditorNameM: string;
485
+ typographyNoteDateM: string;
486
+ typographyNoteParagraphM: string;
487
+ typographyNoteParagraphListM: string;
488
+ typographyNoteTitleM: string;
472
489
  opacity300: string;
473
490
  opacity600: string;
474
491
  opacity800: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "118.2.1",
3
+ "version": "118.3.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -13,8 +13,7 @@
13
13
  "start:debug-theme": "cross-env STORYBOOK_DEBUG_THEME=true npm run start",
14
14
  "test": "jest --config=./jest.config.json",
15
15
  "test-update": "jest --config=./jest.config.json --updateSnapshot",
16
- "test:cypress": "npx cypress open --e2e",
17
- "cypress:react": "npx cypress open --component",
16
+ "cypress:react": "npx cypress open --component --browser chrome",
18
17
  "format": "prettier --write './src/**/*.{js,jsx,ts,tsx}'",
19
18
  "lint": "eslint ./src",
20
19
  "build": "node ./scripts/build.js",
@@ -45,7 +44,7 @@
45
44
  },
46
45
  "homepage": "https://carbon.sage.com",
47
46
  "peerDependencies": {
48
- "@sage/design-tokens": "^2.65.0",
47
+ "@sage/design-tokens": "^4.17.0",
49
48
  "draft-js": "^0.11.5",
50
49
  "react": "^17.0.2",
51
50
  "react-dom": "^17.0.2",
@@ -63,7 +62,8 @@
63
62
  "@babel/types": "^7.16.0",
64
63
  "@commitlint/cli": "^11.0.0",
65
64
  "@commitlint/config-conventional": "^11.0.0",
66
- "@sage/design-tokens": "^2.65.0",
65
+ "@dlgshi/cypress-plugin-designtokens": "^0.0.1-development",
66
+ "@sage/design-tokens": "^4.17.0",
67
67
  "@semantic-release/changelog": "^6.0.1",
68
68
  "@semantic-release/exec": "^6.0.2",
69
69
  "@semantic-release/git": "^10.0.1",
@@ -116,7 +116,7 @@
116
116
  "css-loader": "4.0.0",
117
117
  "cypress": "^12.7.0",
118
118
  "cypress-axe": "^1.4.0",
119
- "cypress-each": "^1.13.1",
119
+ "cypress-each": "^1.13.3",
120
120
  "cypress-plugin-tab": "^1.0.5",
121
121
  "cypress-real-events": "^1.7.6",
122
122
  "cz-conventional-changelog": "^3.3.0",
@@ -1,20 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- const DeprecationWarning = ({
5
- children
6
- }) => /*#__PURE__*/React.createElement("div", {
7
- style: {
8
- backgroundColor: "red",
9
- textAlign: "center",
10
- color: "white",
11
- padding: 20,
12
- fontWeight: "bold",
13
- marginBottom: 10
14
- }
15
- }, children);
16
-
17
- DeprecationWarning.propTypes = {
18
- children: PropTypes.node.isRequired
19
- };
20
- export default DeprecationWarning;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare function partialAction(actionName: string): (eventObj?: string | React.SyntheticEvent<Element, Event> | undefined, ...args: string[]) => void;
3
- export default partialAction;
@@ -1,13 +0,0 @@
1
- import { action } from "@storybook/addon-actions";
2
-
3
- function partialAction(actionName) {
4
- return (eventObj, ...args) => {
5
- action(actionName)(typeof eventObj === "string" ? {
6
- view: undefined
7
- } : { ...eventObj,
8
- view: undefined
9
- }, ...args);
10
- };
11
- }
12
-
13
- export default partialAction;
@@ -1,11 +0,0 @@
1
- export interface EditorCounterProps {
2
- count: number;
3
- limit: number;
4
- error?: string;
5
- warning?: string;
6
- info?: string;
7
- }
8
-
9
- declare function EditorCounter(props: EditorCounterProps): JSX.Element;
10
-
11
- export default EditorCounter;
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface EditorLinkProps {
4
- children: React.ReactNode;
5
- contentState: Record<string, unknown>;
6
- entityKey?: string;
7
- }
8
-
9
- declare function EditorLink(props: EditorLinkProps): JSX.Element;
10
-
11
- export default EditorLink;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface LabelWrapperProps {
4
- children: React.ReactNode;
5
- onClick: () => void;
6
- }
7
-
8
- declare function LabelWrapper(props: LabelWrapperProps): JSX.Element;
9
-
10
- export default LabelWrapper;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ToolbarButtonProps {
4
- ariaLabel?: string;
5
- children: React.ReactNode;
6
- activated?: boolean;
7
- onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
8
- onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
9
- onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void;
10
- onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void;
11
- onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
12
- onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
13
- tabbable?: boolean;
14
- }
15
-
16
- declare function ToolbarButton(
17
- props: ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>
18
- ): JSX.Element;
19
-
20
- export default ToolbarButton;
@@ -1,13 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ToolbarProps {
4
- activeControls: Record<string, unknown>;
5
- /** Additional elements to be rendered, e.g. Save and Cancel Button */
6
- toolbarElements?: React.ReactNode;
7
- setInlineStyle: (args: number) => any;
8
- setBlockStyle: (args: number) => any;
9
- }
10
-
11
- declare function Toolbar(props: ToolbarProps): JSX.Element;
12
-
13
- export default Toolbar;
@@ -1,40 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { Editor, EditorState, ContentState } from "draft-js";
4
-
5
- export interface TextEditorProps extends MarginProps {
6
- /** The maximum characters that the input will accept */
7
- characterLimit?: number;
8
- /** The text for the editor's label */
9
- labelText: string;
10
- /** onChange callback to control value updates */
11
- onChange: (event: EditorState) => void;
12
- /** Additional elements to be rendered in the Editor Toolbar, e.g. Save and Cancel Button */
13
- toolbarElements?: React.ReactNode;
14
- /** The value of the input, this is an EditorState immutable object */
15
- value: EditorState;
16
- /** Flag to configure component as mandatory */
17
- required?: boolean;
18
- /** Message to be displayed when there is an error */
19
- error?: string;
20
- /** Message to be displayed when there is a warning */
21
- warning?: string;
22
- /** Message to be displayed when there is an info */
23
- info?: string;
24
- /** Number greater than 2 multiplied by line-height (21px) to override the default min-height of the editor */
25
- rows?: number;
26
- /** The previews to display of any links added to the Editor */
27
- previews?: React.ReactNode[];
28
- /** Callback to report a url when a link is added */
29
- onLinkAdded?: (url: string) => void;
30
- }
31
-
32
- declare function TextEditor(
33
- props: TextEditorProps & React.RefAttributes<Editor>
34
- ): JSX.Element;
35
-
36
- export {
37
- EditorState as TextEditorState,
38
- ContentState as TextEditorContentState,
39
- };
40
- export default TextEditor;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const DeprecationWarning = ({
15
- children
16
- }) => /*#__PURE__*/_react.default.createElement("div", {
17
- style: {
18
- backgroundColor: "red",
19
- textAlign: "center",
20
- color: "white",
21
- padding: 20,
22
- fontWeight: "bold",
23
- marginBottom: 10
24
- }
25
- }, children);
26
-
27
- DeprecationWarning.propTypes = {
28
- children: _propTypes.default.node.isRequired
29
- };
30
- var _default = DeprecationWarning;
31
- exports.default = _default;
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "../../../../../esm/__internal__/utils/helpers/useUniqueId/index.js",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare function partialAction(actionName: string): (eventObj?: string | React.SyntheticEvent<Element, Event> | undefined, ...args: string[]) => void;
3
- export default partialAction;
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _addonActions = require("@storybook/addon-actions");
9
-
10
- function partialAction(actionName) {
11
- return (eventObj, ...args) => {
12
- (0, _addonActions.action)(actionName)(typeof eventObj === "string" ? {
13
- view: undefined
14
- } : { ...eventObj,
15
- view: undefined
16
- }, ...args);
17
- };
18
- }
19
-
20
- var _default = partialAction;
21
- exports.default = _default;
@@ -1,11 +0,0 @@
1
- export interface EditorCounterProps {
2
- count: number;
3
- limit: number;
4
- error?: string;
5
- warning?: string;
6
- info?: string;
7
- }
8
-
9
- declare function EditorCounter(props: EditorCounterProps): JSX.Element;
10
-
11
- export default EditorCounter;
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface EditorLinkProps {
4
- children: React.ReactNode;
5
- contentState: Record<string, unknown>;
6
- entityKey?: string;
7
- }
8
-
9
- declare function EditorLink(props: EditorLinkProps): JSX.Element;
10
-
11
- export default EditorLink;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface LabelWrapperProps {
4
- children: React.ReactNode;
5
- onClick: () => void;
6
- }
7
-
8
- declare function LabelWrapper(props: LabelWrapperProps): JSX.Element;
9
-
10
- export default LabelWrapper;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ToolbarButtonProps {
4
- ariaLabel?: string;
5
- children: React.ReactNode;
6
- activated?: boolean;
7
- onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
8
- onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
9
- onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void;
10
- onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void;
11
- onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
12
- onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
13
- tabbable?: boolean;
14
- }
15
-
16
- declare function ToolbarButton(
17
- props: ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>
18
- ): JSX.Element;
19
-
20
- export default ToolbarButton;
@@ -1,13 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ToolbarProps {
4
- activeControls: Record<string, unknown>;
5
- /** Additional elements to be rendered, e.g. Save and Cancel Button */
6
- toolbarElements?: React.ReactNode;
7
- setInlineStyle: (args: number) => any;
8
- setBlockStyle: (args: number) => any;
9
- }
10
-
11
- declare function Toolbar(props: ToolbarProps): JSX.Element;
12
-
13
- export default Toolbar;
@@ -1,40 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { Editor, EditorState, ContentState } from "draft-js";
4
-
5
- export interface TextEditorProps extends MarginProps {
6
- /** The maximum characters that the input will accept */
7
- characterLimit?: number;
8
- /** The text for the editor's label */
9
- labelText: string;
10
- /** onChange callback to control value updates */
11
- onChange: (event: EditorState) => void;
12
- /** Additional elements to be rendered in the Editor Toolbar, e.g. Save and Cancel Button */
13
- toolbarElements?: React.ReactNode;
14
- /** The value of the input, this is an EditorState immutable object */
15
- value: EditorState;
16
- /** Flag to configure component as mandatory */
17
- required?: boolean;
18
- /** Message to be displayed when there is an error */
19
- error?: string;
20
- /** Message to be displayed when there is a warning */
21
- warning?: string;
22
- /** Message to be displayed when there is an info */
23
- info?: string;
24
- /** Number greater than 2 multiplied by line-height (21px) to override the default min-height of the editor */
25
- rows?: number;
26
- /** The previews to display of any links added to the Editor */
27
- previews?: React.ReactNode[];
28
- /** Callback to report a url when a link is added */
29
- onLinkAdded?: (url: string) => void;
30
- }
31
-
32
- declare function TextEditor(
33
- props: TextEditorProps & React.RefAttributes<Editor>
34
- ): JSX.Element;
35
-
36
- export {
37
- EditorState as TextEditorState,
38
- ContentState as TextEditorContentState,
39
- };
40
- export default TextEditor;