@cloudscape-design/components 3.0.74 → 3.0.76

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 (143) hide show
  1. package/alert/interfaces.d.ts +5 -0
  2. package/alert/interfaces.d.ts.map +1 -1
  3. package/alert/interfaces.js.map +1 -1
  4. package/alert/internal.d.ts +1 -1
  5. package/alert/internal.d.ts.map +1 -1
  6. package/alert/internal.js +2 -2
  7. package/alert/internal.js.map +1 -1
  8. package/annotation-context/annotation/styles.css.js +24 -24
  9. package/annotation-context/annotation/styles.scoped.css +30 -30
  10. package/annotation-context/annotation/styles.selectors.js +24 -24
  11. package/app-layout/visual-refresh/styles.css.js +59 -59
  12. package/app-layout/visual-refresh/styles.scoped.css +218 -218
  13. package/app-layout/visual-refresh/styles.selectors.js +59 -59
  14. package/attribute-editor/interfaces.d.ts +7 -0
  15. package/attribute-editor/interfaces.d.ts.map +1 -1
  16. package/attribute-editor/interfaces.js.map +1 -1
  17. package/attribute-editor/internal.d.ts.map +1 -1
  18. package/attribute-editor/internal.js +2 -2
  19. package/attribute-editor/internal.js.map +1 -1
  20. package/attribute-editor/row.d.ts +2 -1
  21. package/attribute-editor/row.d.ts.map +1 -1
  22. package/attribute-editor/row.js +5 -10
  23. package/attribute-editor/row.js.map +1 -1
  24. package/calendar/grid/index.d.ts +15 -3
  25. package/calendar/grid/index.d.ts.map +1 -1
  26. package/calendar/grid/index.js +19 -17
  27. package/calendar/grid/index.js.map +1 -1
  28. package/calendar/internal.d.ts.map +1 -1
  29. package/calendar/internal.js +5 -17
  30. package/calendar/internal.js.map +1 -1
  31. package/calendar/styles.css.js +18 -18
  32. package/calendar/styles.scoped.css +40 -38
  33. package/calendar/styles.selectors.js +18 -18
  34. package/calendar/utils/intl.d.ts +2 -3
  35. package/calendar/utils/intl.d.ts.map +1 -1
  36. package/calendar/utils/intl.js +6 -5
  37. package/calendar/utils/intl.js.map +1 -1
  38. package/calendar/utils/navigation.d.ts +6 -0
  39. package/calendar/utils/navigation.d.ts.map +1 -0
  40. package/calendar/utils/navigation.js +38 -0
  41. package/calendar/utils/navigation.js.map +1 -0
  42. package/date-picker/index.d.ts.map +1 -1
  43. package/date-picker/index.js +11 -14
  44. package/date-picker/index.js.map +1 -1
  45. package/date-picker/styles.css.js +6 -7
  46. package/date-picker/styles.scoped.css +7 -13
  47. package/date-picker/styles.selectors.js +6 -7
  48. package/date-range-picker/calendar/grids/grid.d.ts +14 -0
  49. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  50. package/date-range-picker/calendar/grids/grid.js +10 -6
  51. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  52. package/date-range-picker/calendar/grids/index.d.ts +1 -3
  53. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  54. package/date-range-picker/calendar/grids/index.js +10 -11
  55. package/date-range-picker/calendar/grids/index.js.map +1 -1
  56. package/date-range-picker/calendar/grids/styles.css.js +25 -25
  57. package/date-range-picker/calendar/grids/styles.scoped.css +45 -42
  58. package/date-range-picker/calendar/grids/styles.selectors.js +25 -25
  59. package/date-range-picker/calendar/header/index.d.ts +2 -2
  60. package/date-range-picker/calendar/header/index.d.ts.map +1 -1
  61. package/date-range-picker/calendar/header/index.js +13 -9
  62. package/date-range-picker/calendar/header/index.js.map +1 -1
  63. package/date-range-picker/calendar/index.d.ts.map +1 -1
  64. package/date-range-picker/calendar/index.js +5 -7
  65. package/date-range-picker/calendar/index.js.map +1 -1
  66. package/date-range-picker/dropdown.js +1 -1
  67. package/date-range-picker/dropdown.js.map +1 -1
  68. package/date-range-picker/interfaces.d.ts +4 -0
  69. package/date-range-picker/interfaces.d.ts.map +1 -1
  70. package/date-range-picker/interfaces.js.map +1 -1
  71. package/flashbar/index.d.ts.map +1 -1
  72. package/flashbar/index.js +105 -34
  73. package/flashbar/index.js.map +1 -1
  74. package/flashbar/styles.css.js +29 -22
  75. package/flashbar/styles.scoped.css +208 -86
  76. package/flashbar/styles.selectors.js +29 -22
  77. package/form/interfaces.d.ts +5 -0
  78. package/form/interfaces.d.ts.map +1 -1
  79. package/form/interfaces.js.map +1 -1
  80. package/form/internal.d.ts +1 -1
  81. package/form/internal.d.ts.map +1 -1
  82. package/form/internal.js +10 -5
  83. package/form/internal.js.map +1 -1
  84. package/input/internal.d.ts +2 -1
  85. package/input/internal.d.ts.map +1 -1
  86. package/input/internal.js +4 -0
  87. package/input/internal.js.map +1 -1
  88. package/input/utils.js +1 -1
  89. package/input/utils.js.map +1 -1
  90. package/internal/components/autosuggest-input/index.js +1 -1
  91. package/internal/components/autosuggest-input/index.js.map +1 -1
  92. package/internal/components/live-region/index.d.ts +3 -2
  93. package/internal/components/live-region/index.d.ts.map +1 -1
  94. package/internal/components/live-region/index.js +5 -2
  95. package/internal/components/live-region/index.js.map +1 -1
  96. package/internal/components/live-region/styles.css.js +1 -1
  97. package/internal/components/live-region/styles.scoped.css +2 -92
  98. package/internal/components/live-region/styles.selectors.js +1 -1
  99. package/internal/components/screenreader-only/index.d.ts +22 -0
  100. package/internal/components/screenreader-only/index.d.ts.map +1 -0
  101. package/internal/components/screenreader-only/index.js +24 -0
  102. package/internal/components/screenreader-only/index.js.map +1 -0
  103. package/internal/components/screenreader-only/styles.css.js +6 -0
  104. package/internal/components/screenreader-only/styles.scoped.css +97 -0
  105. package/internal/components/screenreader-only/styles.selectors.js +7 -0
  106. package/internal/components/visual-context/index.d.ts +7 -0
  107. package/internal/components/visual-context/index.d.ts.map +1 -1
  108. package/internal/components/visual-context/index.js +10 -1
  109. package/internal/components/visual-context/index.js.map +1 -1
  110. package/internal/environment.js +1 -1
  111. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  112. package/internal/generated/custom-css-properties/index.js +26 -24
  113. package/internal/generated/custom-css-properties/index.js.map +1 -1
  114. package/package.json +1 -1
  115. package/select/parts/filter.js +1 -1
  116. package/select/parts/filter.js.map +1 -1
  117. package/tag-editor/index.d.ts.map +1 -1
  118. package/tag-editor/index.js +1 -1
  119. package/tag-editor/index.js.map +1 -1
  120. package/tutorial-panel/interfaces.d.ts +2 -1
  121. package/tutorial-panel/interfaces.d.ts.map +1 -1
  122. package/tutorial-panel/interfaces.js.map +1 -1
  123. package/wizard/interfaces.d.ts +3 -0
  124. package/wizard/interfaces.d.ts.map +1 -1
  125. package/wizard/interfaces.js.map +1 -1
  126. package/wizard/wizard-form.d.ts.map +1 -1
  127. package/wizard/wizard-form.js +1 -1
  128. package/wizard/wizard-form.js.map +1 -1
  129. package/wizard/wizard-navigation.d.ts.map +1 -1
  130. package/wizard/wizard-navigation.js +1 -1
  131. package/wizard/wizard-navigation.js.map +1 -1
  132. package/calendar/utils/move-focus-handler.d.ts +0 -7
  133. package/calendar/utils/move-focus-handler.d.ts.map +0 -1
  134. package/calendar/utils/move-focus-handler.js +0 -24
  135. package/calendar/utils/move-focus-handler.js.map +0 -1
  136. package/calendar/utils/rotate-day-indexes.d.ts +0 -3
  137. package/calendar/utils/rotate-day-indexes.d.ts.map +0 -1
  138. package/calendar/utils/rotate-day-indexes.js +0 -11
  139. package/calendar/utils/rotate-day-indexes.js.map +0 -1
  140. package/date-range-picker/calendar/get-base-date.d.ts +0 -3
  141. package/date-range-picker/calendar/get-base-date.d.ts.map +0 -1
  142. package/date-range-picker/calendar/get-base-date.js +0 -10
  143. package/date-range-picker/calendar/get-base-date.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __assign } from "tslib";
4
+ import clsx from 'clsx';
5
+ import React from 'react';
6
+ import styles from './styles.css.js';
7
+ /**
8
+ * Makes content now shown on a screen but still announced by screen-reader users.
9
+ * The component is suitable when the aria-label cannot be used, e.g. to avoid elemnts being announced as "blank".
10
+ *
11
+ * To exclude screenreader-only content use `:not(.${screenreaderOnlyStyles.root})` selector, for example:
12
+ *
13
+ * ```
14
+ * import screenreaderOnlyStyles from '~internal/components/screenreader-only/styles.css.js'
15
+ *
16
+ * let visibleContent = wrapper.find(`${styles.label}`).find(`:not(.${screenreaderOnlyStyles.root})`).getElement().textContent
17
+ *
18
+ * let screenreaderContent = wrapper.find(`${styles.label}`).find(`.${screenreaderOnlyStyles.root}`).getElement().textContent
19
+ * ```
20
+ */
21
+ export default function ScreenreaderOnly(props) {
22
+ return React.createElement("div", __assign({}, props, { className: clsx(styles.root, props.className) }));
23
+ }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/screenreader-only/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,OAAO,wCAAS,KAAK,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;AAC3E,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\n\nexport interface ScreenreaderOnlyProps {\n id?: string;\n className?: string;\n children: React.ReactNode;\n}\n\n/**\n * Makes content now shown on a screen but still announced by screen-reader users.\n * The component is suitable when the aria-label cannot be used, e.g. to avoid elemnts being announced as \"blank\".\n *\n * To exclude screenreader-only content use `:not(.${screenreaderOnlyStyles.root})` selector, for example:\n *\n * ```\n * import screenreaderOnlyStyles from '~internal/components/screenreader-only/styles.css.js'\n *\n * let visibleContent = wrapper.find(`${styles.label}`).find(`:not(.${screenreaderOnlyStyles.root})`).getElement().textContent\n *\n * let screenreaderContent = wrapper.find(`${styles.label}`).find(`.${screenreaderOnlyStyles.root}`).getElement().textContent\n * ```\n */\nexport default function ScreenreaderOnly(props: ScreenreaderOnlyProps) {\n return <div {...props} className={clsx(styles.root, props.className)} />;\n}\n"]}
@@ -0,0 +1,6 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_xttbq_1yl3y_93"
5
+ };
6
+
@@ -0,0 +1,97 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
54
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
55
+ /*
56
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
57
+ SPDX-License-Identifier: Apache-2.0
58
+ */
59
+ /*
60
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
61
+ SPDX-License-Identifier: Apache-2.0
62
+ */
63
+ /*
64
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
65
+ SPDX-License-Identifier: Apache-2.0
66
+ */
67
+ /*
68
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
69
+ SPDX-License-Identifier: Apache-2.0
70
+ */
71
+ /*
72
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
+ SPDX-License-Identifier: Apache-2.0
74
+ */
75
+ /*
76
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
+ SPDX-License-Identifier: Apache-2.0
78
+ */
79
+ /*
80
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
+ SPDX-License-Identifier: Apache-2.0
82
+ */
83
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
84
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ .awsui_root_xttbq_1yl3y_93:not(#\9) {
94
+ position: absolute !important;
95
+ top: -9999px !important;
96
+ left: -9999px !important;
97
+ }
@@ -0,0 +1,7 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "root": "awsui_root_xttbq_1yl3y_93"
6
+ };
7
+
@@ -5,6 +5,13 @@ interface VisualContextProps {
5
5
  className?: string;
6
6
  children: React.ReactNode;
7
7
  }
8
+ /**
9
+ * This function returns only the className string needed to apply a
10
+ * visual context to the DOM. It is used by the default export but
11
+ * can also be imported directly for situations where the insertion
12
+ * of a <div> node creates style problems.
13
+ */
14
+ export declare function getVisualContextClassname(contextName: string): string;
8
15
  export default function VisualContext({ contextName, className, children }: VisualContextProps): JSX.Element;
9
16
  export {};
10
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/visual-context/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,gBAAgB,eAAgB,MAAM,SAAS,CAAC,WAAW,CAAC,WAQxE,CAAC;AAEF,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,kBAAkB,eAE7F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/visual-context/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,gBAAgB,eAAgB,MAAM,SAAS,CAAC,WAAW,CAAC,WAQxE,CAAC;AAEF,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,UAE5D;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,kBAAkB,eAE7F"}
@@ -13,8 +13,17 @@ export var useVisualContext = function (elementRef) {
13
13
  });
14
14
  return value;
15
15
  };
16
+ /**
17
+ * This function returns only the className string needed to apply a
18
+ * visual context to the DOM. It is used by the default export but
19
+ * can also be imported directly for situations where the insertion
20
+ * of a <div> node creates style problems.
21
+ */
22
+ export function getVisualContextClassname(contextName) {
23
+ return "awsui-context-".concat(contextName);
24
+ }
16
25
  export default function VisualContext(_a) {
17
26
  var contextName = _a.contextName, className = _a.className, children = _a.children;
18
- return React.createElement("div", { className: clsx("awsui-context-".concat(contextName), className) }, children);
27
+ return React.createElement("div", { className: clsx(getVisualContextClassname(contextName), className) }, children);
19
28
  }
20
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/visual-context/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,UAAwC;IACvE,IAAM,YAAY,GAAG,wBAAwB,CAAC;IACxC,IAAA,KAAoB,QAAQ,CAAC,EAAE,CAAC,EAA/B,KAAK,QAAA,EAAE,QAAQ,QAAgB,CAAC;IACvC,mBAAmB,CAAC,UAAU,EAAE,UAAA,IAAI;QAClC,IAAM,aAAa,GAAG,WAAW,CAAC,IAAI,EAAE,UAAA,IAAI,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAApC,CAAoC,CAAC,CAAC;QACtF,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAQF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAwD;QAAtD,WAAW,iBAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA;IACtE,OAAO,6BAAK,SAAS,EAAE,IAAI,CAAC,wBAAiB,WAAW,CAAE,EAAE,SAAS,CAAC,IAAG,QAAQ,CAAO,CAAC;AAC3F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState } from 'react';\nimport { useMutationObserver } from '../../hooks/use-mutation-observer';\nimport { findUpUntil } from '../../utils/dom';\n\nexport const useVisualContext = (elementRef: React.RefObject<HTMLElement>) => {\n const contextMatch = /awsui-context-([\\w-]+)/;\n const [value, setValue] = useState('');\n useMutationObserver(elementRef, node => {\n const contextParent = findUpUntil(node, node => !!node.className.match(contextMatch));\n setValue(contextParent ? contextParent.className.match(contextMatch)![1] : '');\n });\n return value;\n};\n\ninterface VisualContextProps {\n contextName: string;\n className?: string;\n children: React.ReactNode;\n}\n\nexport default function VisualContext({ contextName, className, children }: VisualContextProps) {\n return <div className={clsx(`awsui-context-${contextName}`, className)}>{children}</div>;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/visual-context/index.tsx"],"names":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identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState } from 'react';\nimport { useMutationObserver } from '../../hooks/use-mutation-observer';\nimport { findUpUntil } from '../../utils/dom';\n\nexport const useVisualContext = (elementRef: React.RefObject<HTMLElement>) => {\n const contextMatch = /awsui-context-([\\w-]+)/;\n const [value, setValue] = useState('');\n useMutationObserver(elementRef, node => {\n const contextParent = findUpUntil(node, node => !!node.className.match(contextMatch));\n setValue(contextParent ? contextParent.className.match(contextMatch)![1] : '');\n });\n return value;\n};\n\ninterface VisualContextProps {\n contextName: string;\n className?: string;\n children: React.ReactNode;\n}\n\n/**\n * This function returns only the className string needed to apply a\n * visual context to the DOM. It is used by the default export but\n * can also be imported directly for situations where the insertion\n * of a <div> node creates style problems.\n */\nexport function getVisualContextClassname(contextName: string) {\n return `awsui-context-${contextName}`;\n}\n\nexport default function VisualContext({ contextName, className, children }: VisualContextProps) {\n return <div className={clsx(getVisualContextClassname(contextName), className)}>{children}</div>;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
 
2
- export var PACKAGE_VERSION = '3.0.0 (ec2e8e0)';
2
+ export var PACKAGE_VERSION = '3.0.0 (9d27ffe)';
3
3
  export var THEME = 'open-source-visual-refresh';
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyBlD,CAAC;AACF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2BlD,CAAC;AACF,eAAe,sBAAsB,CAAC"}
@@ -1,28 +1,30 @@
1
1
  var customCSSPropertiesMap = {
2
- offsetTop: '--awsui-offset-top-ujkcpl',
3
- offsetTopWithNotifications: '--awsui-offset-top-with-notifications-ujkcpl',
4
- contentGapLeft: '--awsui-content-gap-left-ujkcpl',
5
- contentGapRight: '--awsui-content-gap-right-ujkcpl',
6
- contentHeight: '--awsui-content-height-ujkcpl',
7
- defaultMaxContentWidth: '--awsui-default-max-content-width-ujkcpl',
8
- defaultMinContentWidth: '--awsui-default-min-content-width-ujkcpl',
9
- footerHeight: '--awsui-footer-height-ujkcpl',
10
- headerHeight: '--awsui-header-height-ujkcpl',
11
- layoutWidth: '--awsui-layout-width-ujkcpl',
12
- mainOffsetLeft: '--awsui-main-offset-left-ujkcpl',
13
- maxContentWidth: '--awsui-max-content-width-ujkcpl',
14
- minContentWidth: '--awsui-min-content-width-ujkcpl',
15
- notificationsHeight: '--awsui-notifications-height-ujkcpl',
16
- overlapHeight: '--awsui-overlap-height-ujkcpl',
17
- navigationWidth: '--awsui-navigation-width-ujkcpl',
18
- splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-ujkcpl',
19
- splitPanelReportedSize: '--awsui-split-panel-reported-size-ujkcpl',
20
- splitPanelMinWidth: '--awsui-split-panel-min-width-ujkcpl',
21
- splitPanelMaxWidth: '--awsui-split-panel-max-width-ujkcpl',
22
- toolsMaxWidth: '--awsui-tools-max-width-ujkcpl',
23
- toolsWidth: '--awsui-tools-width-ujkcpl',
24
- toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-ujkcpl',
25
- contentScrollMargin: '--awsui-content-scroll-margin-ujkcpl'
2
+ offsetTop: '--awsui-offset-top-f9jj7p',
3
+ offsetTopWithNotifications: '--awsui-offset-top-with-notifications-f9jj7p',
4
+ contentGapLeft: '--awsui-content-gap-left-f9jj7p',
5
+ contentGapRight: '--awsui-content-gap-right-f9jj7p',
6
+ contentHeight: '--awsui-content-height-f9jj7p',
7
+ defaultMaxContentWidth: '--awsui-default-max-content-width-f9jj7p',
8
+ defaultMinContentWidth: '--awsui-default-min-content-width-f9jj7p',
9
+ footerHeight: '--awsui-footer-height-f9jj7p',
10
+ headerHeight: '--awsui-header-height-f9jj7p',
11
+ layoutWidth: '--awsui-layout-width-f9jj7p',
12
+ mainOffsetLeft: '--awsui-main-offset-left-f9jj7p',
13
+ maxContentWidth: '--awsui-max-content-width-f9jj7p',
14
+ minContentWidth: '--awsui-min-content-width-f9jj7p',
15
+ notificationsHeight: '--awsui-notifications-height-f9jj7p',
16
+ overlapHeight: '--awsui-overlap-height-f9jj7p',
17
+ navigationWidth: '--awsui-navigation-width-f9jj7p',
18
+ splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-f9jj7p',
19
+ splitPanelReportedSize: '--awsui-split-panel-reported-size-f9jj7p',
20
+ splitPanelMinWidth: '--awsui-split-panel-min-width-f9jj7p',
21
+ splitPanelMaxWidth: '--awsui-split-panel-max-width-f9jj7p',
22
+ toolsMaxWidth: '--awsui-tools-max-width-f9jj7p',
23
+ toolsWidth: '--awsui-tools-width-f9jj7p',
24
+ toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-f9jj7p',
25
+ contentScrollMargin: '--awsui-content-scroll-margin-f9jj7p',
26
+ flashbarStackDepth: '--awsui-flashbar-stack-depth-f9jj7p',
27
+ flashbarStackIndex: '--awsui-flashbar-stack-index-f9jj7p'
26
28
  };
27
29
  export default customCSSPropertiesMap;
28
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,IAAM,sBAAsB,GAA2B;IACrD,SAAS,EAAE,2BAA2B;IACtC,0BAA0B,EAAE,8CAA8C;IAC1E,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,+BAA+B;IAC9C,sBAAsB,EAAE,0CAA0C;IAClE,sBAAsB,EAAE,0CAA0C;IAClE,YAAY,EAAE,8BAA8B;IAC5C,YAAY,EAAE,8BAA8B;IAC5C,WAAW,EAAE,6BAA6B;IAC1C,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,eAAe,EAAE,kCAAkC;IACnD,mBAAmB,EAAE,qCAAqC;IAC1D,aAAa,EAAE,+BAA+B;IAC9C,eAAe,EAAE,iCAAiC;IAClD,4BAA4B,EAAE,iDAAiD;IAC/E,sBAAsB,EAAE,0CAA0C;IAClE,kBAAkB,EAAE,sCAAsC;IAC1D,kBAAkB,EAAE,sCAAsC;IAC1D,aAAa,EAAE,gCAAgC;IAC/C,UAAU,EAAE,4BAA4B;IACxC,6BAA6B,EAAE,iDAAiD;IAChF,mBAAmB,EAAE,sCAAsC;CAC5D,CAAC;AACF,eAAe,sBAAsB,CAAC","sourcesContent":["const customCSSPropertiesMap: Record<string, string> = {\n offsetTop: '--awsui-offset-top-ujkcpl',\n offsetTopWithNotifications: '--awsui-offset-top-with-notifications-ujkcpl',\n contentGapLeft: '--awsui-content-gap-left-ujkcpl',\n contentGapRight: '--awsui-content-gap-right-ujkcpl',\n contentHeight: '--awsui-content-height-ujkcpl',\n defaultMaxContentWidth: '--awsui-default-max-content-width-ujkcpl',\n defaultMinContentWidth: '--awsui-default-min-content-width-ujkcpl',\n footerHeight: '--awsui-footer-height-ujkcpl',\n headerHeight: '--awsui-header-height-ujkcpl',\n layoutWidth: '--awsui-layout-width-ujkcpl',\n mainOffsetLeft: '--awsui-main-offset-left-ujkcpl',\n maxContentWidth: '--awsui-max-content-width-ujkcpl',\n minContentWidth: '--awsui-min-content-width-ujkcpl',\n notificationsHeight: '--awsui-notifications-height-ujkcpl',\n overlapHeight: '--awsui-overlap-height-ujkcpl',\n navigationWidth: '--awsui-navigation-width-ujkcpl',\n splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-ujkcpl',\n splitPanelReportedSize: '--awsui-split-panel-reported-size-ujkcpl',\n splitPanelMinWidth: '--awsui-split-panel-min-width-ujkcpl',\n splitPanelMaxWidth: '--awsui-split-panel-max-width-ujkcpl',\n toolsMaxWidth: '--awsui-tools-max-width-ujkcpl',\n toolsWidth: '--awsui-tools-width-ujkcpl',\n toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-ujkcpl',\n contentScrollMargin: '--awsui-content-scroll-margin-ujkcpl',\n};\nexport default customCSSPropertiesMap;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/generated/custom-css-properties/index.ts"],"names":[],"mappings":"AAAA,IAAM,sBAAsB,GAA2B;IACrD,SAAS,EAAE,2BAA2B;IACtC,0BAA0B,EAAE,8CAA8C;IAC1E,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,+BAA+B;IAC9C,sBAAsB,EAAE,0CAA0C;IAClE,sBAAsB,EAAE,0CAA0C;IAClE,YAAY,EAAE,8BAA8B;IAC5C,YAAY,EAAE,8BAA8B;IAC5C,WAAW,EAAE,6BAA6B;IAC1C,cAAc,EAAE,iCAAiC;IACjD,eAAe,EAAE,kCAAkC;IACnD,eAAe,EAAE,kCAAkC;IACnD,mBAAmB,EAAE,qCAAqC;IAC1D,aAAa,EAAE,+BAA+B;IAC9C,eAAe,EAAE,iCAAiC;IAClD,4BAA4B,EAAE,iDAAiD;IAC/E,sBAAsB,EAAE,0CAA0C;IAClE,kBAAkB,EAAE,sCAAsC;IAC1D,kBAAkB,EAAE,sCAAsC;IAC1D,aAAa,EAAE,gCAAgC;IAC/C,UAAU,EAAE,4BAA4B;IACxC,6BAA6B,EAAE,iDAAiD;IAChF,mBAAmB,EAAE,sCAAsC;IAC3D,kBAAkB,EAAE,qCAAqC;IACzD,kBAAkB,EAAE,qCAAqC;CAC1D,CAAC;AACF,eAAe,sBAAsB,CAAC","sourcesContent":["const customCSSPropertiesMap: Record<string, string> = {\n offsetTop: '--awsui-offset-top-f9jj7p',\n offsetTopWithNotifications: '--awsui-offset-top-with-notifications-f9jj7p',\n contentGapLeft: '--awsui-content-gap-left-f9jj7p',\n contentGapRight: '--awsui-content-gap-right-f9jj7p',\n contentHeight: '--awsui-content-height-f9jj7p',\n defaultMaxContentWidth: '--awsui-default-max-content-width-f9jj7p',\n defaultMinContentWidth: '--awsui-default-min-content-width-f9jj7p',\n footerHeight: '--awsui-footer-height-f9jj7p',\n headerHeight: '--awsui-header-height-f9jj7p',\n layoutWidth: '--awsui-layout-width-f9jj7p',\n mainOffsetLeft: '--awsui-main-offset-left-f9jj7p',\n maxContentWidth: '--awsui-max-content-width-f9jj7p',\n minContentWidth: '--awsui-min-content-width-f9jj7p',\n notificationsHeight: '--awsui-notifications-height-f9jj7p',\n overlapHeight: '--awsui-overlap-height-f9jj7p',\n navigationWidth: '--awsui-navigation-width-f9jj7p',\n splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-f9jj7p',\n splitPanelReportedSize: '--awsui-split-panel-reported-size-f9jj7p',\n splitPanelMinWidth: '--awsui-split-panel-min-width-f9jj7p',\n splitPanelMaxWidth: '--awsui-split-panel-max-width-f9jj7p',\n toolsMaxWidth: '--awsui-tools-max-width-f9jj7p',\n toolsWidth: '--awsui-tools-width-f9jj7p',\n toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-f9jj7p',\n contentScrollMargin: '--awsui-content-scroll-margin-f9jj7p',\n flashbarStackDepth: '--awsui-flashbar-stack-depth-f9jj7p',\n flashbarStackIndex: '--awsui-flashbar-stack-index-f9jj7p',\n};\nexport default customCSSPropertiesMap;\n"]}
package/package.json CHANGED
@@ -113,6 +113,6 @@
113
113
  "./internal/base-component/index.js",
114
114
  "./internal/base-component/styles.css.js"
115
115
  ],
116
- "version": "3.0.74",
116
+ "version": "3.0.76",
117
117
  "license": "Apache-2.0"
118
118
  }
@@ -9,7 +9,7 @@ var Filter = React.forwardRef(function (_a, ref) {
9
9
  if (filteringType === 'none') {
10
10
  return null;
11
11
  }
12
- return (React.createElement(InternalInput, __assign({ ref: ref, type: "search", className: styles.filter, autoComplete: false, disableBrowserAutocorrect: true, invalid: false, __noBorderRadius: true }, filterProps, { __nativeAttributes: __assign({ 'aria-expanded': true, 'aria-haspopup': true, role: 'combobox', autoCorrect: 'off', autoCapitalize: 'off' }, filterProps.__nativeAttributes) })));
12
+ return (React.createElement(InternalInput, __assign({ ref: ref, type: "visualSearch", className: styles.filter, autoComplete: false, disableBrowserAutocorrect: true, invalid: false, __noBorderRadius: true }, filterProps, { __nativeAttributes: __assign({ 'aria-expanded': true, 'aria-haspopup': true, role: 'combobox', autoCorrect: 'off', autoCapitalize: 'off' }, filterProps.__nativeAttributes) })));
13
13
  });
14
14
  export default Filter;
15
15
  //# sourceMappingURL=filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/select/parts/filter.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAqC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,IAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,UAAC,EAA8C,EAAE,GAAgC;IAA9E,IAAA,aAAa,mBAAA,EAAK,WAAW,cAA/B,iBAAiC,CAAF;IAC9D,IAAI,aAAa,KAAK,MAAM,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,oBAAC,aAAa,aACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,YAAY,EAAE,KAAK,EACnB,yBAAyB,EAAE,IAAI,EAC/B,OAAO,EAAE,KAAK,EACd,gBAAgB,EAAE,IAAI,IAClB,WAAW,IACf,kBAAkB,aAChB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,EACrB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAE,KAAK,IAClB,WAAW,CAAC,kBAAkB,KAEnC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalInput, { InternalInputProps } from '../../input/internal';\nimport { SelectProps } from '../interfaces';\nimport styles from './styles.css.js';\n\nexport interface FilterProps extends InternalInputProps {\n ref?: React.Ref<HTMLInputElement>;\n filteringType: SelectProps.FilteringType;\n}\n\nconst Filter = React.forwardRef(({ filteringType, ...filterProps }: FilterProps, ref: React.Ref<HTMLInputElement>) => {\n if (filteringType === 'none') {\n return null;\n }\n\n return (\n <InternalInput\n ref={ref}\n type=\"search\"\n className={styles.filter}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n invalid={false}\n __noBorderRadius={true}\n {...filterProps}\n __nativeAttributes={{\n 'aria-expanded': true,\n 'aria-haspopup': true,\n role: 'combobox',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n ...filterProps.__nativeAttributes,\n }}\n />\n );\n});\n\nexport default Filter;\n"]}
1
+ {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/select/parts/filter.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAqC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,IAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,UAAC,EAA8C,EAAE,GAAgC;IAA9E,IAAA,aAAa,mBAAA,EAAK,WAAW,cAA/B,iBAAiC,CAAF;IAC9D,IAAI,aAAa,KAAK,MAAM,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,oBAAC,aAAa,aACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,cAAc,EACnB,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,YAAY,EAAE,KAAK,EACnB,yBAAyB,EAAE,IAAI,EAC/B,OAAO,EAAE,KAAK,EACd,gBAAgB,EAAE,IAAI,IAClB,WAAW,IACf,kBAAkB,aAChB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,EACrB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAE,KAAK,IAClB,WAAW,CAAC,kBAAkB,KAEnC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalInput, { InternalInputProps } from '../../input/internal';\nimport { SelectProps } from '../interfaces';\nimport styles from './styles.css.js';\n\nexport interface FilterProps extends InternalInputProps {\n ref?: React.Ref<HTMLInputElement>;\n filteringType: SelectProps.FilteringType;\n}\n\nconst Filter = React.forwardRef(({ filteringType, ...filterProps }: FilterProps, ref: React.Ref<HTMLInputElement>) => {\n if (filteringType === 'none') {\n return null;\n }\n\n return (\n <InternalInput\n ref={ref}\n type=\"visualSearch\"\n className={styles.filter}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n invalid={false}\n __noBorderRadius={true}\n {...filterProps}\n __nativeAttributes={{\n 'aria-expanded': true,\n 'aria-haspopup': true,\n role: 'combobox',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n ...filterProps.__nativeAttributes,\n }}\n />\n );\n});\n\nexport default Filter;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAgBlG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAS1B,QAAA,MAAM,SAAS,2FAkPd,CAAC;AAGF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAgBlG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAS1B,QAAA,MAAM,SAAS,2FAmPd,CAAC;AAGF,eAAe,SAAS,CAAC"}
@@ -146,7 +146,7 @@ var TagEditor = React.forwardRef(function (_a, ref) {
146
146
  React.createElement(InternalStatusIndicator, { className: styles.loading, type: "loading" }, i18nStrings.loading)));
147
147
  }
148
148
  var baseProps = getBaseProps(restProps);
149
- return (React.createElement(InternalAttributeEditor, __assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: i18nStrings.addButton, removeButtonText: i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18nStrings.emptyTags, additionalInfo: React.createElement("div", { "aria-live": "polite" }, remainingTags < 0 ? (React.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, (_b = i18nStrings.tagLimitExceeded(tagLimit)) !== null && _b !== void 0 ? _b : '')) : remainingTags === 0 ? ((_c = i18nStrings.tagLimitReached(tagLimit)) !== null && _c !== void 0 ? _c : '') : (i18nStrings.tagLimit(remainingTags, tagLimit))), definition: definition })));
149
+ return (React.createElement(InternalAttributeEditor, __assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: i18nStrings.addButton, removeButtonText: i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18nStrings.emptyTags, additionalInfo: React.createElement("div", { "aria-live": "polite" }, remainingTags < 0 ? (React.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, (_b = i18nStrings.tagLimitExceeded(tagLimit)) !== null && _b !== void 0 ? _b : '')) : remainingTags === 0 ? ((_c = i18nStrings.tagLimitReached(tagLimit)) !== null && _c !== void 0 ? _c : '') : (i18nStrings.tagLimit(remainingTags, tagLimit))), definition: definition, i18nStrings: i18nStrings })));
150
150
  });
151
151
  applyDisplayName(TagEditor, 'TagEditor');
152
152
  export default TagEditor;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAA4B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAKnF,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AASpE,IAAM,eAAe,GAAG,UAAC,EAAoB;QAAlB,GAA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AAQ,CAAC,mCAAI,EAAE,CAC9B,CAClB,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CACxB,MAAA,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAC5C,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC9C,CACG,EAER,UAAU,EAAE,UAAU,IACtB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent } from '../internal/events';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\n\nimport { InputProps } from '../input/interfaces';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { AttributeEditorProps } from '../attribute-editor/interfaces';\nimport InternalAttributeEditor from '../attribute-editor/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport InternalBox from '../box/internal';\nimport { FormFieldError } from '../form-field/internal';\n\nimport { TagControl, UndoButton } from './internal';\nimport { TagEditorProps } from './interfaces';\nimport { validate, ValidationError } from './validation';\nimport { findIndex, useMemoizedArray } from './utils';\n\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { TagEditorProps };\n\ninterface InternalTag {\n tag: TagEditorProps.Tag;\n error?: ValidationError;\n}\n\nconst isItemRemovable = ({ tag }: InternalTag) => !tag.markedForRemoval;\n\nconst TagEditor = React.forwardRef(\n (\n {\n tags = [],\n i18nStrings,\n loading = false,\n tagLimit = 50,\n allowedCharacterPattern,\n keysRequest,\n valuesRequest,\n onChange,\n ...restProps\n }: TagEditorProps,\n ref: React.Ref<TagEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('TagEditor');\n\n const remainingTags = tagLimit - tags.filter(tag => !tag.markedForRemoval).length;\n\n const attributeEditorRef = useRef<AttributeEditorProps.Ref>(null);\n const keyInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const valueInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const undoButtonRefs = useRef<(HTMLAnchorElement | undefined | null)[]>([]);\n\n const initialKeyOptionsRef = useRef<AutosuggestProps.Options>([]);\n const keyDirtyStateRef = useRef<boolean[]>([]);\n const focusEventRef = useRef<() => void>();\n\n useLayoutEffect(() => {\n focusEventRef.current?.apply(undefined);\n focusEventRef.current = undefined;\n });\n\n const errors = validate(\n tags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n );\n\n const internalTags = useMemoizedArray(\n tags.map((tag, i) => ({ tag, error: errors[i] })),\n (prev, next) => {\n return prev.tag === next.tag && prev.error?.key === next.error?.key && prev.error?.value === next.error?.value;\n }\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus() {\n const errorIndex = findIndex(internalTags, ({ error }) => error?.key || error?.value);\n if (errorIndex !== -1) {\n const refArray = internalTags[errorIndex].error?.key ? keyInputRefs : valueInputRefs;\n refArray.current[errorIndex]?.focus();\n }\n },\n }),\n [internalTags]\n );\n\n const validateAndFire = useCallback(\n (newTags: ReadonlyArray<TagEditorProps.Tag>) => {\n fireNonCancelableEvent(onChange, {\n tags: newTags,\n valid: !validate(\n newTags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n ).some(error => error),\n });\n },\n [onChange, i18nStrings, allowedCharacterPattern]\n );\n\n const onAddButtonClick = () => {\n validateAndFire([...tags, { key: '', value: '', existing: false }]);\n focusEventRef.current = () => {\n keyInputRefs.current[tags.length]?.focus();\n };\n };\n\n const onRemoveButtonClick = useStableEventHandler(\n ({ detail }: NonCancelableCustomEvent<AttributeEditorProps.RemoveButtonClickDetail>) => {\n const existing = tags[detail.itemIndex].existing;\n validateAndFire([\n ...tags.slice(0, detail.itemIndex),\n ...(existing ? [{ ...tags[detail.itemIndex], markedForRemoval: true }] : []),\n ...tags.slice(detail.itemIndex + 1),\n ]);\n if (existing) {\n focusEventRef.current = () => {\n undoButtonRefs.current[detail.itemIndex]?.focus();\n };\n } else {\n keyDirtyStateRef.current.splice(detail.itemIndex, 1);\n keyInputRefs.current[detail.itemIndex]?.focus();\n }\n }\n );\n\n const onKeyChange = useStableEventHandler((value: string, row: number) => {\n keyDirtyStateRef.current[row] = true;\n validateAndFire([...tags.slice(0, row), { ...tags[row], key: value }, ...tags.slice(row + 1)]);\n });\n\n const onKeyBlur = useStableEventHandler((row: number) => {\n keyDirtyStateRef.current[row] = true;\n // Force re-render by providing a new array reference\n validateAndFire([...tags]);\n });\n\n const onValueChange = useStableEventHandler((value: string, row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], value }, ...tags.slice(row + 1)]);\n });\n\n const onUndoRemoval = useStableEventHandler((row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], markedForRemoval: false }, ...tags.slice(row + 1)]);\n focusEventRef.current = () => {\n attributeEditorRef.current?.focusRemoveButton(row);\n };\n });\n\n const definition = useMemo(\n () => [\n {\n label: i18nStrings.keyHeader,\n control: ({ tag }: InternalTag, row: number) => (\n <TagControl\n row={row}\n value={tag.key}\n readOnly={tag.existing}\n limit={200}\n defaultOptions={[]}\n placeholder={i18nStrings.keyPlaceholder}\n errorText={i18nStrings.keysSuggestionError}\n loadingText={i18nStrings.keysSuggestionLoading}\n suggestionText={i18nStrings.keySuggestion}\n tooManySuggestionText={i18nStrings.tooManyKeysSuggestion}\n enteredTextLabel={i18nStrings.enteredKeyLabel}\n onRequest={keysRequest}\n onChange={onKeyChange}\n onBlur={onKeyBlur}\n initialOptionsRef={initialKeyOptionsRef}\n ref={ref => {\n keyInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.key,\n },\n {\n label: (\n <>\n {i18nStrings.valueHeader} - <i>{i18nStrings.optional}</i>\n </>\n ),\n control: ({ tag }: InternalTag, row: number) =>\n tag.markedForRemoval ? (\n <div role=\"alert\">\n <InternalBox margin={{ top: 'xxs' }}>\n {i18nStrings.undoPrompt}{' '}\n <UndoButton\n onClick={() => onUndoRemoval(row)}\n ref={elem => {\n undoButtonRefs.current[row] = elem;\n }}\n >\n {i18nStrings.undoButton}\n </UndoButton>\n </InternalBox>\n </div>\n ) : (\n <TagControl\n row={row}\n value={tag.value}\n readOnly={false}\n limit={200}\n defaultOptions={tag.valueSuggestionOptions ?? []}\n placeholder={i18nStrings.valuePlaceholder}\n errorText={i18nStrings.valuesSuggestionError}\n loadingText={i18nStrings.valuesSuggestionLoading}\n suggestionText={i18nStrings.valueSuggestion}\n tooManySuggestionText={i18nStrings.tooManyValuesSuggestion}\n enteredTextLabel={i18nStrings.enteredValueLabel}\n filteringKey={tag.key}\n onRequest={valuesRequest && (value => valuesRequest(tag.key, value))}\n onChange={onValueChange}\n ref={ref => {\n valueInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.value,\n },\n ],\n [i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]\n );\n\n if (loading) {\n return (\n <div className={styles.root} ref={baseComponentProps.__internalRootRef}>\n <InternalStatusIndicator className={styles.loading} type=\"loading\">\n {i18nStrings.loading}\n </InternalStatusIndicator>\n </div>\n );\n }\n\n const baseProps = getBaseProps(restProps);\n return (\n <InternalAttributeEditor<InternalTag>\n {...baseProps}\n {...baseComponentProps}\n ref={attributeEditorRef}\n className={clsx(styles.root, baseProps.className)}\n items={internalTags}\n isItemRemovable={isItemRemovable}\n onAddButtonClick={onAddButtonClick}\n onRemoveButtonClick={onRemoveButtonClick}\n addButtonText={i18nStrings.addButton}\n removeButtonText={i18nStrings.removeButton}\n disableAddButton={remainingTags <= 0}\n empty={i18nStrings.emptyTags}\n additionalInfo={\n <div aria-live=\"polite\">\n {remainingTags < 0 ? (\n <FormFieldError errorIconAriaLabel={i18nStrings.errorIconAriaLabel}>\n {i18nStrings.tagLimitExceeded(tagLimit) ?? ''}\n </FormFieldError>\n ) : remainingTags === 0 ? (\n i18nStrings.tagLimitReached(tagLimit) ?? ''\n ) : (\n i18nStrings.tagLimit(remainingTags, tagLimit)\n )}\n </div>\n }\n definition={definition}\n />\n );\n }\n);\n\napplyDisplayName(TagEditor, 'TagEditor');\nexport default TagEditor;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAA4B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAKnF,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,MAAM,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ACZ,0CAAe,QAAQ,IACpB,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CACnB,oBAAC,cAAc,IAAC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,IAC/D,MAAA,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAC9B,CAClB,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CACxB,MAAA,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAC5C,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC9C,CACG,EAER,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,IACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent } from '../internal/events';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\n\nimport { InputProps } from '../input/interfaces';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { AttributeEditorProps } from '../attribute-editor/interfaces';\nimport InternalAttributeEditor from '../attribute-editor/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport InternalBox from '../box/internal';\nimport { FormFieldError } from '../form-field/internal';\n\nimport { TagControl, UndoButton } from './internal';\nimport { TagEditorProps } from './interfaces';\nimport { validate, ValidationError } from './validation';\nimport { findIndex, useMemoizedArray } from './utils';\n\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { TagEditorProps };\n\ninterface InternalTag {\n tag: TagEditorProps.Tag;\n error?: ValidationError;\n}\n\nconst isItemRemovable = ({ tag }: InternalTag) => !tag.markedForRemoval;\n\nconst TagEditor = React.forwardRef(\n (\n {\n tags = [],\n i18nStrings,\n loading = false,\n tagLimit = 50,\n allowedCharacterPattern,\n keysRequest,\n valuesRequest,\n onChange,\n ...restProps\n }: TagEditorProps,\n ref: React.Ref<TagEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('TagEditor');\n\n const remainingTags = tagLimit - tags.filter(tag => !tag.markedForRemoval).length;\n\n const attributeEditorRef = useRef<AttributeEditorProps.Ref>(null);\n const keyInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const valueInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const undoButtonRefs = useRef<(HTMLAnchorElement | undefined | null)[]>([]);\n\n const initialKeyOptionsRef = useRef<AutosuggestProps.Options>([]);\n const keyDirtyStateRef = useRef<boolean[]>([]);\n const focusEventRef = useRef<() => void>();\n\n useLayoutEffect(() => {\n focusEventRef.current?.apply(undefined);\n focusEventRef.current = undefined;\n });\n\n const errors = validate(\n tags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n );\n\n const internalTags = useMemoizedArray(\n tags.map((tag, i) => ({ tag, error: errors[i] })),\n (prev, next) => {\n return prev.tag === next.tag && prev.error?.key === next.error?.key && prev.error?.value === next.error?.value;\n }\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus() {\n const errorIndex = findIndex(internalTags, ({ error }) => error?.key || error?.value);\n if (errorIndex !== -1) {\n const refArray = internalTags[errorIndex].error?.key ? keyInputRefs : valueInputRefs;\n refArray.current[errorIndex]?.focus();\n }\n },\n }),\n [internalTags]\n );\n\n const validateAndFire = useCallback(\n (newTags: ReadonlyArray<TagEditorProps.Tag>) => {\n fireNonCancelableEvent(onChange, {\n tags: newTags,\n valid: !validate(\n newTags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n ).some(error => error),\n });\n },\n [onChange, i18nStrings, allowedCharacterPattern]\n );\n\n const onAddButtonClick = () => {\n validateAndFire([...tags, { key: '', value: '', existing: false }]);\n focusEventRef.current = () => {\n keyInputRefs.current[tags.length]?.focus();\n };\n };\n\n const onRemoveButtonClick = useStableEventHandler(\n ({ detail }: NonCancelableCustomEvent<AttributeEditorProps.RemoveButtonClickDetail>) => {\n const existing = tags[detail.itemIndex].existing;\n validateAndFire([\n ...tags.slice(0, detail.itemIndex),\n ...(existing ? [{ ...tags[detail.itemIndex], markedForRemoval: true }] : []),\n ...tags.slice(detail.itemIndex + 1),\n ]);\n if (existing) {\n focusEventRef.current = () => {\n undoButtonRefs.current[detail.itemIndex]?.focus();\n };\n } else {\n keyDirtyStateRef.current.splice(detail.itemIndex, 1);\n keyInputRefs.current[detail.itemIndex]?.focus();\n }\n }\n );\n\n const onKeyChange = useStableEventHandler((value: string, row: number) => {\n keyDirtyStateRef.current[row] = true;\n validateAndFire([...tags.slice(0, row), { ...tags[row], key: value }, ...tags.slice(row + 1)]);\n });\n\n const onKeyBlur = useStableEventHandler((row: number) => {\n keyDirtyStateRef.current[row] = true;\n // Force re-render by providing a new array reference\n validateAndFire([...tags]);\n });\n\n const onValueChange = useStableEventHandler((value: string, row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], value }, ...tags.slice(row + 1)]);\n });\n\n const onUndoRemoval = useStableEventHandler((row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], markedForRemoval: false }, ...tags.slice(row + 1)]);\n focusEventRef.current = () => {\n attributeEditorRef.current?.focusRemoveButton(row);\n };\n });\n\n const definition = useMemo(\n () => [\n {\n label: i18nStrings.keyHeader,\n control: ({ tag }: InternalTag, row: number) => (\n <TagControl\n row={row}\n value={tag.key}\n readOnly={tag.existing}\n limit={200}\n defaultOptions={[]}\n placeholder={i18nStrings.keyPlaceholder}\n errorText={i18nStrings.keysSuggestionError}\n loadingText={i18nStrings.keysSuggestionLoading}\n suggestionText={i18nStrings.keySuggestion}\n tooManySuggestionText={i18nStrings.tooManyKeysSuggestion}\n enteredTextLabel={i18nStrings.enteredKeyLabel}\n onRequest={keysRequest}\n onChange={onKeyChange}\n onBlur={onKeyBlur}\n initialOptionsRef={initialKeyOptionsRef}\n ref={ref => {\n keyInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.key,\n },\n {\n label: (\n <>\n {i18nStrings.valueHeader} - <i>{i18nStrings.optional}</i>\n </>\n ),\n control: ({ tag }: InternalTag, row: number) =>\n tag.markedForRemoval ? (\n <div role=\"alert\">\n <InternalBox margin={{ top: 'xxs' }}>\n {i18nStrings.undoPrompt}{' '}\n <UndoButton\n onClick={() => onUndoRemoval(row)}\n ref={elem => {\n undoButtonRefs.current[row] = elem;\n }}\n >\n {i18nStrings.undoButton}\n </UndoButton>\n </InternalBox>\n </div>\n ) : (\n <TagControl\n row={row}\n value={tag.value}\n readOnly={false}\n limit={200}\n defaultOptions={tag.valueSuggestionOptions ?? []}\n placeholder={i18nStrings.valuePlaceholder}\n errorText={i18nStrings.valuesSuggestionError}\n loadingText={i18nStrings.valuesSuggestionLoading}\n suggestionText={i18nStrings.valueSuggestion}\n tooManySuggestionText={i18nStrings.tooManyValuesSuggestion}\n enteredTextLabel={i18nStrings.enteredValueLabel}\n filteringKey={tag.key}\n onRequest={valuesRequest && (value => valuesRequest(tag.key, value))}\n onChange={onValueChange}\n ref={ref => {\n valueInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.value,\n },\n ],\n [i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]\n );\n\n if (loading) {\n return (\n <div className={styles.root} ref={baseComponentProps.__internalRootRef}>\n <InternalStatusIndicator className={styles.loading} type=\"loading\">\n {i18nStrings.loading}\n </InternalStatusIndicator>\n </div>\n );\n }\n\n const baseProps = getBaseProps(restProps);\n return (\n <InternalAttributeEditor<InternalTag>\n {...baseProps}\n {...baseComponentProps}\n ref={attributeEditorRef}\n className={clsx(styles.root, baseProps.className)}\n items={internalTags}\n isItemRemovable={isItemRemovable}\n onAddButtonClick={onAddButtonClick}\n onRemoveButtonClick={onRemoveButtonClick}\n addButtonText={i18nStrings.addButton}\n removeButtonText={i18nStrings.removeButton}\n disableAddButton={remainingTags <= 0}\n empty={i18nStrings.emptyTags}\n additionalInfo={\n <div aria-live=\"polite\">\n {remainingTags < 0 ? (\n <FormFieldError errorIconAriaLabel={i18nStrings.errorIconAriaLabel}>\n {i18nStrings.tagLimitExceeded(tagLimit) ?? ''}\n </FormFieldError>\n ) : remainingTags === 0 ? (\n i18nStrings.tagLimitReached(tagLimit) ?? ''\n ) : (\n i18nStrings.tagLimit(remainingTags, tagLimit)\n )}\n </div>\n }\n definition={definition}\n i18nStrings={i18nStrings}\n />\n );\n }\n);\n\napplyDisplayName(TagEditor, 'TagEditor');\nexport default TagEditor;\n"]}
@@ -92,7 +92,7 @@ export declare namespace TutorialPanelProps {
92
92
  * tutorial object), the content of `prerequisitesAlert` will be shown in the
93
93
  * tutorial list underneath the tutorial title.
94
94
  *
95
- * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`
95
+ * @deprecated Use alert component inside description property directly
96
96
  */
97
97
  prerequisitesAlert?: React.ReactNode;
98
98
  /**
@@ -145,6 +145,7 @@ export declare namespace TutorialPanelProps {
145
145
  /**
146
146
  * If this field is present, a warning alert will be displayed inside
147
147
  * the step's popover, showing this field's content. Can be JSX or plain text.
148
+ * @deprecated Use alert component inside content property directly
148
149
  */
149
150
  warningAlert?: React.ReactNode;
150
151
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tutorial-panel/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,E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AAC;QAEzB;;;;WAIG;QACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAE/B;;;;;;;WAOG;QACH,SAAS,EAAE,MAAM,CAAC;KACnB;IAED,UAAiB,WAAW;QAC1B,WAAW,EAAE,MAAM,CAAC;QAEpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC;QACzC,4BAA4B,EAAE,MAAM,CAAC;QAErC,qBAAqB,EAAE,MAAM,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAE1B,uBAAuB,EAAE,MAAM,CAAC;QAChC,yBAAyB,EAAE,MAAM,CAAC;QAElC,qBAAqB,EAAE,MAAM,CAAC;QAE9B,gBAAgB,EAAE,MAAM,CAAC;QACzB,yBAAyB,EAAE,MAAM,CAAC;QAElC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAC5D,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAE5D,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;QACpD,0BAA0B,EAAE,MAAM,CAAC;QAEnC,gBAAgB,EAAE;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,aAAa,EAAE,MAAM,CAAC;YACtB,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tutorial-panel/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TutorialPanelProps extends BaseComponentProps {\n /**\n * Whether the content of the panel is currently loading. If this property\n * is set to `true`, the panel displays a spinner and the loadingText that is\n * specified in the `i18nStrings` property.\n */\n loading?: boolean;\n\n /**\n * List of all available tutorials. An array of objects with the following properties:\n *\n * * `title` (string) - Name of the tutorial\n *\n * * `description` (ReactNode) - Short description of the tutorial's content.\n *\n * * `tasks` - Array of tasks (in intended order). Each Task has the following properties:\n * * `title` (string) - Name of this task. This is shown in the task list overview of the tutorial's detail view.\n * * `steps` - Array of steps in this task (in intended order). Each step has the following properties:\n * * `title` (string) - Title of this step. This is shown in the step list in the tutorial's detail view.\n * * `content` (ReactNode) - Content to be shown in the popover of this step. Can be JSX or plain text.\n * * `warningAlert` (ReactNode) - (Optional) If this field is present, a warning alert will be displayed\n * inside the step's popover, showing this field's content. Can be JSX or plain text.\n * * `hotspotId` (string) - ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application and represents a location\n * in the application that a tutorial step can be attached to. It can be re-used by multiple tutorials. Hotspot\n * IDs need to be unique in the scope of the whole application that uses this tutorial.\n *\n * * `completedScreenDescription` (ReactNode) - Description to be shown on the last page of the tutorial, when the\n * user has successfully completed the tutorial.\n *\n * * `prerequisitesAlert` (ReactNode) - (Optional) If the application determines that the user cannot start the tutorial\n * yet (by specifying the property `prerequisitesNeeded` on the tutorial object), the content of `prerequisitesAlert`\n * will be shown in the tutorial list underneath the tutorial title.\n *\n * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`\n *\n * * `prerequisitesNeeded` (boolean) - (Optional) If this property is set to `true`, the tutorial list will disable the\n * `Start tutorial` button for this tutorial, and it will show the contents of the tutorial's `prerequisitesAlert` field\n * in an alert underneath the tutorial title.\n *\n * * `learnMoreUrl` (string | null) - (Optional) If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n *\n * * `completed` (boolean) - Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list will show a status indicator underneath the tutorial title with\n * a message that indicates that this tutorial has already been completed by the user (e.g. \"Tutorial completed\"), and\n * the \"Start tutorial\" button will be replaced by a \"Restart tutorial\" button.\n */\n tutorials: ReadonlyArray<TutorialPanelProps.Tutorial>;\n\n /**\n * The link to a file documenting all tutorials (usually a PDF).\n */\n downloadUrl: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TutorialPanelProps.I18nStrings;\n\n /**\n * Fired when the user clicks on the feedback link at the end of a tutorial.\n */\n onFeedbackClick: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;\n\n /*\n Filtering is not available in the Beta release.\n\n filteringFunction?: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n */\n}\n\nexport namespace TutorialPanelProps {\n export interface TutorialDetail {\n tutorial: Tutorial;\n }\n\n export interface Tutorial {\n /**\n * Title of the tutorial\n * */\n title: string;\n\n /**\n * Short description of the tutorial's content. This is displayed in the tutorial list.\n */\n description: React.ReactNode;\n\n /**\n * List of tasks (in intended order)\n */\n tasks: ReadonlyArray<Task>;\n\n /**\n * Description to be shown on the last page of the tutorial, when the user has\n * successfully completed the tutorial.\n */\n completedScreenDescription: React.ReactNode;\n\n /**\n * If the application determines that the user cannot start\n * the tutorial yet (by specifying the property `prerequisitesNeeded` on the\n * tutorial object), the content of `prerequisitesAlert` will be shown in the\n * tutorial list underneath the tutorial title.\n *\n * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`\n */\n prerequisitesAlert?: React.ReactNode;\n\n /**\n * If this property is set to `true`, the tutorial list\n * will disable the `Start tutorial` button for this\n * tutorial, and it will show the contents of the\n * tutorial's `prerequisitesAlert` field in an alert underneath\n * the tutorial title.\n */\n prerequisitesNeeded?: boolean;\n\n /**\n * If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n */\n learnMoreUrl?: string | null;\n\n /**\n * Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list\n * will show a status indicator underneath the tutorial\n * title with a message that indicates that this tutorial\n * has already been completed by the user (e.g.\n * \"Tutorial completed\"), and the \"Start tutorial\" button\n * will be replaced by a \"Restart tutorial\" button.\n *\n */\n completed: boolean;\n }\n\n export interface Task {\n /**\n * Title of this task. This is shown in the task list overview of the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Steps in this task (in intended order)\n */\n steps: ReadonlyArray<Step>;\n }\n\n export interface Step {\n /**\n * Title of this step. This is shown in the step list in the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Content to be shown in the popover of this step. Can be JSX or plain text.\n */\n content: React.ReactNode;\n\n /**\n * If this field is present, a warning alert will be displayed inside\n * the step's popover, showing this field's content. Can be JSX or plain text.\n */\n warningAlert?: React.ReactNode;\n\n /**\n * ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application\n * and represents a location in the application that a tutorial step can be\n * attached to. It can be re-used by multiple tutorials. Hotspot IDs need\n * to be unique in the scope of the whole application that uses this tutorial.\n */\n hotspotId: string;\n }\n\n export interface I18nStrings {\n loadingText: string;\n\n tutorialListTitle: string;\n tutorialListDescription: React.ReactNode;\n tutorialListDownloadLinkText: string;\n\n tutorialCompletedText: string;\n learnMoreLinkText: string;\n\n startTutorialButtonText: string;\n restartTutorialButtonText: string;\n\n completionScreenTitle: string;\n\n feedbackLinkText: string;\n dismissTutorialButtonText: string;\n\n taskTitle: (taskIndex: number, taskTitle: string) => string;\n stepTitle: (stepIndex: number, stepTitle: string) => string;\n\n labelExitTutorial: string;\n labelTotalSteps: (totalStepCount: number) => string;\n labelLearnMoreExternalIcon: string;\n\n labelsTaskStatus: {\n pending: string;\n 'in-progress': string;\n success: string;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tutorial-panel/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TutorialPanelProps extends BaseComponentProps {\n /**\n * Whether the content of the panel is currently loading. If this property\n * is set to `true`, the panel displays a spinner and the loadingText that is\n * specified in the `i18nStrings` property.\n */\n loading?: boolean;\n\n /**\n * List of all available tutorials. An array of objects with the following properties:\n *\n * * `title` (string) - Name of the tutorial\n *\n * * `description` (ReactNode) - Short description of the tutorial's content.\n *\n * * `tasks` - Array of tasks (in intended order). Each Task has the following properties:\n * * `title` (string) - Name of this task. This is shown in the task list overview of the tutorial's detail view.\n * * `steps` - Array of steps in this task (in intended order). Each step has the following properties:\n * * `title` (string) - Title of this step. This is shown in the step list in the tutorial's detail view.\n * * `content` (ReactNode) - Content to be shown in the popover of this step. Can be JSX or plain text.\n * * `warningAlert` (ReactNode) - (Optional) If this field is present, a warning alert will be displayed\n * inside the step's popover, showing this field's content. Can be JSX or plain text.\n * * `hotspotId` (string) - ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application and represents a location\n * in the application that a tutorial step can be attached to. It can be re-used by multiple tutorials. Hotspot\n * IDs need to be unique in the scope of the whole application that uses this tutorial.\n *\n * * `completedScreenDescription` (ReactNode) - Description to be shown on the last page of the tutorial, when the\n * user has successfully completed the tutorial.\n *\n * * `prerequisitesAlert` (ReactNode) - (Optional) If the application determines that the user cannot start the tutorial\n * yet (by specifying the property `prerequisitesNeeded` on the tutorial object), the content of `prerequisitesAlert`\n * will be shown in the tutorial list underneath the tutorial title.\n *\n * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`\n *\n * * `prerequisitesNeeded` (boolean) - (Optional) If this property is set to `true`, the tutorial list will disable the\n * `Start tutorial` button for this tutorial, and it will show the contents of the tutorial's `prerequisitesAlert` field\n * in an alert underneath the tutorial title.\n *\n * * `learnMoreUrl` (string | null) - (Optional) If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n *\n * * `completed` (boolean) - Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list will show a status indicator underneath the tutorial title with\n * a message that indicates that this tutorial has already been completed by the user (e.g. \"Tutorial completed\"), and\n * the \"Start tutorial\" button will be replaced by a \"Restart tutorial\" button.\n */\n tutorials: ReadonlyArray<TutorialPanelProps.Tutorial>;\n\n /**\n * The link to a file documenting all tutorials (usually a PDF).\n */\n downloadUrl: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TutorialPanelProps.I18nStrings;\n\n /**\n * Fired when the user clicks on the feedback link at the end of a tutorial.\n */\n onFeedbackClick: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;\n\n /*\n Filtering is not available in the Beta release.\n\n filteringFunction?: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n */\n}\n\nexport namespace TutorialPanelProps {\n export interface TutorialDetail {\n tutorial: Tutorial;\n }\n\n export interface Tutorial {\n /**\n * Title of the tutorial\n * */\n title: string;\n\n /**\n * Short description of the tutorial's content. This is displayed in the tutorial list.\n */\n description: React.ReactNode;\n\n /**\n * List of tasks (in intended order)\n */\n tasks: ReadonlyArray<Task>;\n\n /**\n * Description to be shown on the last page of the tutorial, when the user has\n * successfully completed the tutorial.\n */\n completedScreenDescription: React.ReactNode;\n\n /**\n * If the application determines that the user cannot start\n * the tutorial yet (by specifying the property `prerequisitesNeeded` on the\n * tutorial object), the content of `prerequisitesAlert` will be shown in the\n * tutorial list underneath the tutorial title.\n *\n * @deprecated Use alert component inside description property directly\n */\n prerequisitesAlert?: React.ReactNode;\n\n /**\n * If this property is set to `true`, the tutorial list\n * will disable the `Start tutorial` button for this\n * tutorial, and it will show the contents of the\n * tutorial's `prerequisitesAlert` field in an alert underneath\n * the tutorial title.\n */\n prerequisitesNeeded?: boolean;\n\n /**\n * If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n */\n learnMoreUrl?: string | null;\n\n /**\n * Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list\n * will show a status indicator underneath the tutorial\n * title with a message that indicates that this tutorial\n * has already been completed by the user (e.g.\n * \"Tutorial completed\"), and the \"Start tutorial\" button\n * will be replaced by a \"Restart tutorial\" button.\n *\n */\n completed: boolean;\n }\n\n export interface Task {\n /**\n * Title of this task. This is shown in the task list overview of the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Steps in this task (in intended order)\n */\n steps: ReadonlyArray<Step>;\n }\n\n export interface Step {\n /**\n * Title of this step. This is shown in the step list in the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Content to be shown in the popover of this step. Can be JSX or plain text.\n */\n content: React.ReactNode;\n\n /**\n * If this field is present, a warning alert will be displayed inside\n * the step's popover, showing this field's content. Can be JSX or plain text.\n * @deprecated Use alert component inside content property directly\n */\n warningAlert?: React.ReactNode;\n\n /**\n * ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application\n * and represents a location in the application that a tutorial step can be\n * attached to. It can be re-used by multiple tutorials. Hotspot IDs need\n * to be unique in the scope of the whole application that uses this tutorial.\n */\n hotspotId: string;\n }\n\n export interface I18nStrings {\n loadingText: string;\n\n tutorialListTitle: string;\n tutorialListDescription: React.ReactNode;\n tutorialListDownloadLinkText: string;\n\n tutorialCompletedText: string;\n learnMoreLinkText: string;\n\n startTutorialButtonText: string;\n restartTutorialButtonText: string;\n\n completionScreenTitle: string;\n\n feedbackLinkText: string;\n dismissTutorialButtonText: string;\n\n taskTitle: (taskIndex: number, taskTitle: string) => string;\n stepTitle: (stepIndex: number, stepTitle: string) => string;\n\n labelExitTutorial: string;\n labelTotalSteps: (totalStepCount: number) => string;\n labelLearnMoreExternalIcon: string;\n\n labelsTaskStatus: {\n pending: string;\n 'in-progress': string;\n success: string;\n };\n }\n}\n"]}
@@ -39,6 +39,7 @@ export interface WizardProps extends BaseComponentProps {
39
39
  * - `stepsCount` (number) - The total number of steps in the wizard.
40
40
  * - `skipToButtonLabel`: ((targetStep: WizardProps.Step, targetStepNumber: number) => string) - An optional function that accepts the target step object
41
41
  * and the target step number (1-based indexing), and returns a string to be used as the *skip-to* button label. For example, "Skip to Step 2" or "Skip to end".
42
+ * - `navigationAriaLabel` (string) - The aria label for the navigation pane.
42
43
  * - `cancelButton` (string) - The text of the button that enables the user to exit the flow.
43
44
  * - `previousButton` (string) - The text of the button that enables the user to return to the previous step.
44
45
  * - `nextButton` (string) - The text of the button that enables the user to move to the next step.
@@ -101,6 +102,8 @@ export declare namespace WizardProps {
101
102
  stepNumberLabel(stepNumber: number): string;
102
103
  collapsedStepsLabel(stepNumber: number, stepsCount: number): string;
103
104
  skipToButtonLabel?(targetStep: WizardProps.Step, targetStepNumber: number): string;
105
+ navigationAriaLabel?: string;
106
+ errorIconAriaLabel?: string;
104
107
  cancelButton: string;
105
108
  previousButton: string;
106
109
  nextButton: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/wizard/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;;;;;;;;;OAYG;IACH,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;IAErC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEnC;;;OAGG;IACH,QAAQ,CAA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gB,EAAE,MAAM,GAAG,MAAM,CAAC;QACnF,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAED,UAAiB,cAAc;QAC7B,kBAAkB,EAAE,MAAM,CAAC;QAC3B,MAAM,EAAE,WAAW,CAAC,gBAAgB,CAAC;KACtC;IAED,KAAY,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;CACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/wizard/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface WizardProps extends BaseComponentProps {\n /**\n * Array of step objects. Each object represents a step in the wizard with the following properties:\n *\n * - `title` (string) - Text that's displayed as the title in the navigation pane and form header.\n * - `info` (ReactNode) - (Optional) Area for a page level info link that's displayed in the form header.\n * The page level info link should trigger the default help panel content for the step. Use the [link component](/components/link/) to display the link.\n * - `description` (ReactNode) - (Optional) Area below the form header for a page level description text to further explain the purpose, goal, or main actions of the step.\n * - `content` (ReactNode) - Main content area to display form sections, form fields, and controls.\n * - `errorText` (ReactNode) - (Optional) Error text that's displayed in a page level error alert.\n * Use this for rendering actionable server-side validation failure messages.\n * - `isOptional` (boolean) - Specifies whether the step is optional or required. If set to `true`, the text from `i18nStrings.optional`\n * is rendered next to the `title` in the navigation step label and the form header title.\n */\n steps: ReadonlyArray<WizardProps.Step>;\n\n /**\n * Index of the step that's currently displayed. The first step has an index of zero (0).\n *\n * If you don't set this property, the component starts on the first step and switches step automatically\n * when a user navigates using the buttons or an enabled step link in the navigation pane (that is, uncontrolled behavior).\n *\n * If you provide a value for this property, you must also set an `onNavigate` listener to update the property when\n * a user navigates (that is, controlled behavior).\n *\n * If you set it to a value that exceeds the maximum value (that is, the number of steps minus 1), its value is ignored and the component uses the maximum value.\n */\n activeStepIndex?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * - `stepNumberLabel` ((stepNumber: number) => string) - A function that accepts a number (1-based indexing),\n * and returns a human-readable, localized string displaying the step number in the navigation pane. For example, \"Step 1\" or \"Step 2\".\n * - `collapsedStepsLabel` ((stepNumber: number, stepsCount: number) => string) - A function that accepts two number parameters (1-based indexing),\n * and returns a string responsible for the navigation summary on smaller screens. For example, \"Step 1 of 3\". The parameters are as follows:\n * - `stepNumber` (number) - The step number that the user is currently on.\n * - `stepsCount` (number) - The total number of steps in the wizard.\n * - `skipToButtonLabel`: ((targetStep: WizardProps.Step, targetStepNumber: number) => string) - An optional function that accepts the target step object\n * and the target step number (1-based indexing), and returns a string to be used as the *skip-to* button label. For example, \"Skip to Step 2\" or \"Skip to end\".\n * - `cancelButton` (string) - The text of the button that enables the user to exit the flow.\n * - `previousButton` (string) - The text of the button that enables the user to return to the previous step.\n * - `nextButton` (string) - The text of the button that enables the user to move to the next step.\n * - `submitButton` (string) - The text of the button that enables the user to submit the form.\n * - `optional` (string) - The text displayed next to the step title and form header title when a step is declared optional.\n */\n i18nStrings: WizardProps.I18nStrings;\n\n /**\n * Renders the *next* or *submit* button in a loading state.\n *\n * Use this if you need to wait for a response from the server before the user can proceed to the next step, such as during server-side validation or retrieving the next step's information.\n */\n isLoadingNextStep?: boolean;\n\n /**\n * When set to `false`, the *skip-to* button is never shown.\n * When set to `true`, the *skip-to* button may appear to offer faster navigation for the user.\n *\n * The *skip-to* button only allows to skip optional steps. It is shown when there is one or more optional\n * steps ahead having no required steps in-between.\n *\n * Note: the *skip-to* button requires the function i18nStrings.skipToButtonLabel to be defined.\n *\n * Defaults to `false`.\n */\n allowSkipTo?: boolean;\n\n /**\n * Specifies left-aligned secondary actions for the wizard. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Called when a user clicks the *cancel* button.\n * If a user has entered data in the form, you should prompt the user with a modal before exiting the wizard flow.\n */\n onCancel?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *submit* button.\n */\n onSubmit?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *next* button, the *previous* button, or an enabled step link in the navigation pane.\n *\n * The event `detail` includes the following:\n * - `requestedStepIndex` - The index of the requested step.\n * - `reason` - The user action that triggered the navigation event. It can be `next` (when the user clicks the *next* button),\n * `previous` (when the user clicks the *previous* button), `step` (an enabled step link in the navigation pane),\n * or `skip` (when navigated using navigation pane or the *skip-to* button to the previously unvisited step).\n */\n onNavigate?: NonCancelableEventHandler<WizardProps.NavigateDetail>;\n}\n\nexport namespace WizardProps {\n export interface Step {\n title: string;\n info?: React.ReactNode;\n description?: React.ReactNode;\n content: React.ReactNode;\n errorText?: React.ReactNode;\n isOptional?: boolean;\n }\n\n export interface I18nStrings {\n stepNumberLabel(stepNumber: number): string;\n collapsedStepsLabel(stepNumber: number, stepsCount: number): string;\n skipToButtonLabel?(targetStep: WizardProps.Step, targetStepNumber: number): string;\n cancelButton: string;\n previousButton: string;\n nextButton: string;\n submitButton: string;\n optional?: string;\n }\n\n export interface NavigateDetail {\n requestedStepIndex: number;\n reason: WizardProps.NavigationReason;\n }\n\n export type NavigationReason = 'next' | 'previous' | 'step' | 'skip';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/wizard/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface WizardProps extends BaseComponentProps {\n /**\n * Array of step objects. Each object represents a step in the wizard with the following properties:\n *\n * - `title` (string) - Text that's displayed as the title in the navigation pane and form header.\n * - `info` (ReactNode) - (Optional) Area for a page level info link that's displayed in the form header.\n * The page level info link should trigger the default help panel content for the step. Use the [link component](/components/link/) to display the link.\n * - `description` (ReactNode) - (Optional) Area below the form header for a page level description text to further explain the purpose, goal, or main actions of the step.\n * - `content` (ReactNode) - Main content area to display form sections, form fields, and controls.\n * - `errorText` (ReactNode) - (Optional) Error text that's displayed in a page level error alert.\n * Use this for rendering actionable server-side validation failure messages.\n * - `isOptional` (boolean) - Specifies whether the step is optional or required. If set to `true`, the text from `i18nStrings.optional`\n * is rendered next to the `title` in the navigation step label and the form header title.\n */\n steps: ReadonlyArray<WizardProps.Step>;\n\n /**\n * Index of the step that's currently displayed. The first step has an index of zero (0).\n *\n * If you don't set this property, the component starts on the first step and switches step automatically\n * when a user navigates using the buttons or an enabled step link in the navigation pane (that is, uncontrolled behavior).\n *\n * If you provide a value for this property, you must also set an `onNavigate` listener to update the property when\n * a user navigates (that is, controlled behavior).\n *\n * If you set it to a value that exceeds the maximum value (that is, the number of steps minus 1), its value is ignored and the component uses the maximum value.\n */\n activeStepIndex?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * - `stepNumberLabel` ((stepNumber: number) => string) - A function that accepts a number (1-based indexing),\n * and returns a human-readable, localized string displaying the step number in the navigation pane. For example, \"Step 1\" or \"Step 2\".\n * - `collapsedStepsLabel` ((stepNumber: number, stepsCount: number) => string) - A function that accepts two number parameters (1-based indexing),\n * and returns a string responsible for the navigation summary on smaller screens. For example, \"Step 1 of 3\". The parameters are as follows:\n * - `stepNumber` (number) - The step number that the user is currently on.\n * - `stepsCount` (number) - The total number of steps in the wizard.\n * - `skipToButtonLabel`: ((targetStep: WizardProps.Step, targetStepNumber: number) => string) - An optional function that accepts the target step object\n * and the target step number (1-based indexing), and returns a string to be used as the *skip-to* button label. For example, \"Skip to Step 2\" or \"Skip to end\".\n * - `navigationAriaLabel` (string) - The aria label for the navigation pane.\n * - `cancelButton` (string) - The text of the button that enables the user to exit the flow.\n * - `previousButton` (string) - The text of the button that enables the user to return to the previous step.\n * - `nextButton` (string) - The text of the button that enables the user to move to the next step.\n * - `submitButton` (string) - The text of the button that enables the user to submit the form.\n * - `optional` (string) - The text displayed next to the step title and form header title when a step is declared optional.\n */\n i18nStrings: WizardProps.I18nStrings;\n\n /**\n * Renders the *next* or *submit* button in a loading state.\n *\n * Use this if you need to wait for a response from the server before the user can proceed to the next step, such as during server-side validation or retrieving the next step's information.\n */\n isLoadingNextStep?: boolean;\n\n /**\n * When set to `false`, the *skip-to* button is never shown.\n * When set to `true`, the *skip-to* button may appear to offer faster navigation for the user.\n *\n * The *skip-to* button only allows to skip optional steps. It is shown when there is one or more optional\n * steps ahead having no required steps in-between.\n *\n * Note: the *skip-to* button requires the function i18nStrings.skipToButtonLabel to be defined.\n *\n * Defaults to `false`.\n */\n allowSkipTo?: boolean;\n\n /**\n * Specifies left-aligned secondary actions for the wizard. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Called when a user clicks the *cancel* button.\n * If a user has entered data in the form, you should prompt the user with a modal before exiting the wizard flow.\n */\n onCancel?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *submit* button.\n */\n onSubmit?: NonCancelableEventHandler;\n\n /**\n * Called when a user clicks the *next* button, the *previous* button, or an enabled step link in the navigation pane.\n *\n * The event `detail` includes the following:\n * - `requestedStepIndex` - The index of the requested step.\n * - `reason` - The user action that triggered the navigation event. It can be `next` (when the user clicks the *next* button),\n * `previous` (when the user clicks the *previous* button), `step` (an enabled step link in the navigation pane),\n * or `skip` (when navigated using navigation pane or the *skip-to* button to the previously unvisited step).\n */\n onNavigate?: NonCancelableEventHandler<WizardProps.NavigateDetail>;\n}\n\nexport namespace WizardProps {\n export interface Step {\n title: string;\n info?: React.ReactNode;\n description?: React.ReactNode;\n content: React.ReactNode;\n errorText?: React.ReactNode;\n isOptional?: boolean;\n }\n\n export interface I18nStrings {\n stepNumberLabel(stepNumber: number): string;\n collapsedStepsLabel(stepNumber: number, stepsCount: number): string;\n skipToButtonLabel?(targetStep: WizardProps.Step, targetStepNumber: number): string;\n navigationAriaLabel?: string;\n errorIconAriaLabel?: string;\n cancelButton: string;\n previousButton: string;\n nextButton: string;\n submitButton: string;\n optional?: string;\n }\n\n export interface NavigateDetail {\n requestedStepIndex: number;\n reason: WizardProps.NavigationReason;\n }\n\n export type NavigationReason = 'next' | 'previous' | 'step' | 'skip';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,UAAU,eAAe;IACvB,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,GACd,EAAE,eAAe,eAqDjB"}
1
+ {"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,UAAU,eAAe;IACvB,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,GACd,EAAE,eAAe,eAsDjB"}
@@ -24,7 +24,7 @@ export default function WizardForm(_a) {
24
24
  React.createElement(InternalHeader, { className: styles['form-header-component'], variant: "h1", description: description, info: info },
25
25
  title,
26
26
  isOptional && React.createElement("i", null, " - ".concat(i18nStrings.optional)))),
27
- React.createElement(InternalForm, { className: clsx(styles['form-component']), actions: React.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton, previousButtonText: i18nStrings.previousButton, onCancelClick: onCancelClick, onPreviousClick: onPreviousClick, onPrimaryClick: onPrimaryClick, onSkipToClick: function () { return onSkipToClick(skipToTargetIndex); }, showPrevious: activeStepIndex !== 0, isPrimaryLoading: isPrimaryLoading, showSkipTo: showSkipTo, skipToButtonText: skipToButtonText }), secondaryActions: secondaryActions, errorText: errorText }, content)));
27
+ React.createElement(InternalForm, { className: clsx(styles['form-component']), actions: React.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton, previousButtonText: i18nStrings.previousButton, onCancelClick: onCancelClick, onPreviousClick: onPreviousClick, onPrimaryClick: onPrimaryClick, onSkipToClick: function () { return onSkipToClick(skipToTargetIndex); }, showPrevious: activeStepIndex !== 0, isPrimaryLoading: isPrimaryLoading, showSkipTo: showSkipTo, skipToButtonText: skipToButtonText }), secondaryActions: secondaryActions, errorText: errorText, errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, content)));
28
28
  }
29
29
  function findSkipToTargetIndex(steps, activeStepIndex) {
30
30
  var nextRequiredStepIndex = activeStepIndex;