@cloudscape-design/components-themeable 3.0.1145 → 3.0.1147

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 (91) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/button-dropdown/item-element/styles.scss +34 -0
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/scss/radio-button/styles.scss +10 -0
  5. package/lib/internal/scss/radio-group/styles.scss +19 -3
  6. package/lib/internal/template/button-dropdown/interfaces.d.ts +11 -2
  7. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  8. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  9. package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
  10. package/lib/internal/template/button-dropdown/item-element/index.js +10 -5
  11. package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
  12. package/lib/internal/template/button-dropdown/item-element/styles.css.js +20 -16
  13. package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +57 -24
  14. package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +20 -16
  15. package/lib/internal/template/index.d.ts +1 -0
  16. package/lib/internal/template/index.d.ts.map +1 -1
  17. package/lib/internal/template/index.js +1 -0
  18. package/lib/internal/template/index.js.map +1 -1
  19. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  20. package/lib/internal/template/internal/components/option/utils/unflatten-options.js +1 -1
  21. package/lib/internal/template/internal/components/option/utils/unflatten-options.js.map +1 -1
  22. package/lib/internal/template/internal/components/radio-button/index.d.ts.map +1 -1
  23. package/lib/internal/template/internal/components/radio-button/index.js +6 -3
  24. package/lib/internal/template/internal/components/radio-button/index.js.map +1 -1
  25. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +2 -2
  26. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -1
  27. package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -1
  28. package/lib/internal/template/internal/environment.js +2 -2
  29. package/lib/internal/template/internal/environment.json +2 -2
  30. package/lib/internal/template/internal/plugins/widget/index.d.ts.map +1 -1
  31. package/lib/internal/template/internal/plugins/widget/index.js +8 -1
  32. package/lib/internal/template/internal/plugins/widget/index.js.map +1 -1
  33. package/lib/internal/template/package.json +1 -0
  34. package/lib/internal/template/radio-button/index.d.ts +9 -0
  35. package/lib/internal/template/radio-button/index.d.ts.map +1 -0
  36. package/lib/internal/template/radio-button/index.js +21 -0
  37. package/lib/internal/template/radio-button/index.js.map +1 -0
  38. package/lib/internal/template/radio-button/interfaces.d.ts +3 -0
  39. package/lib/internal/template/radio-button/interfaces.d.ts.map +1 -0
  40. package/lib/internal/template/radio-button/interfaces.js +2 -0
  41. package/lib/internal/template/radio-button/interfaces.js.map +1 -0
  42. package/lib/internal/template/radio-button/styles.css.js +6 -0
  43. package/lib/internal/template/radio-button/styles.scoped.css +175 -0
  44. package/lib/internal/template/radio-button/styles.selectors.js +7 -0
  45. package/lib/internal/template/radio-group/index.d.ts +1 -1
  46. package/lib/internal/template/radio-group/index.d.ts.map +1 -1
  47. package/lib/internal/template/radio-group/index.js +4 -1
  48. package/lib/internal/template/radio-group/index.js.map +1 -1
  49. package/lib/internal/template/radio-group/interfaces.d.ts +10 -1
  50. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  51. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  52. package/lib/internal/template/radio-group/internal.d.ts +1 -1
  53. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  54. package/lib/internal/template/radio-group/internal.js +3 -7
  55. package/lib/internal/template/radio-group/internal.js.map +1 -1
  56. package/lib/internal/template/radio-group/styles.css.js +5 -3
  57. package/lib/internal/template/radio-group/styles.scoped.css +15 -3
  58. package/lib/internal/template/radio-group/styles.selectors.js +5 -3
  59. package/lib/internal/template/table/selection/selection-control.d.ts +1 -1
  60. package/lib/internal/template/table/selection/selection-control.d.ts.map +1 -1
  61. package/lib/internal/template/table/selection/selection-control.js +2 -2
  62. package/lib/internal/template/table/selection/selection-control.js.map +1 -1
  63. package/lib/internal/template/test-utils/dom/collection-preferences/page-size-preference.d.ts +1 -1
  64. package/lib/internal/template/test-utils/dom/collection-preferences/page-size-preference.js.map +1 -1
  65. package/lib/internal/template/test-utils/dom/index.d.ts +20 -0
  66. package/lib/internal/template/test-utils/dom/index.js +15 -1
  67. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  68. package/lib/internal/template/test-utils/dom/{radio-group/radio-button.js → radio-button/index.js} +1 -1
  69. package/lib/internal/template/test-utils/dom/radio-button/index.js.map +1 -0
  70. package/lib/internal/template/test-utils/dom/radio-group/index.d.ts +1 -1
  71. package/lib/internal/template/test-utils/dom/radio-group/index.js +1 -1
  72. package/lib/internal/template/test-utils/dom/radio-group/index.js.map +1 -1
  73. package/lib/internal/template/test-utils/dom/tiles/tile.js +1 -1
  74. package/lib/internal/template/test-utils/dom/tiles/tile.js.map +1 -1
  75. package/lib/internal/template/test-utils/selectors/collection-preferences/page-size-preference.d.ts +1 -1
  76. package/lib/internal/template/test-utils/selectors/collection-preferences/page-size-preference.js.map +1 -1
  77. package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
  78. package/lib/internal/template/test-utils/selectors/index.js +15 -1
  79. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  80. package/lib/internal/template/test-utils/selectors/{radio-group/radio-button.js → radio-button/index.js} +1 -1
  81. package/lib/internal/template/test-utils/selectors/radio-button/index.js.map +1 -0
  82. package/lib/internal/template/test-utils/selectors/radio-group/index.d.ts +1 -1
  83. package/lib/internal/template/test-utils/selectors/radio-group/index.js +1 -1
  84. package/lib/internal/template/test-utils/selectors/radio-group/index.js.map +1 -1
  85. package/lib/internal/template/test-utils/selectors/tiles/tile.js +1 -1
  86. package/lib/internal/template/test-utils/selectors/tiles/tile.js.map +1 -1
  87. package/package.json +1 -1
  88. package/lib/internal/template/test-utils/dom/radio-group/radio-button.js.map +0 -1
  89. package/lib/internal/template/test-utils/selectors/radio-group/radio-button.js.map +0 -1
  90. /package/lib/internal/template/test-utils/dom/{radio-group/radio-button.d.ts → radio-button/index.d.ts} +0 -0
  91. /package/lib/internal/template/test-utils/selectors/{radio-group/radio-button.d.ts → radio-button/index.d.ts} +0 -0
@@ -0,0 +1,175 @@
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
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /*
66
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
+ SPDX-License-Identifier: Apache-2.0
68
+ */
69
+ /*
70
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
71
+ SPDX-License-Identifier: Apache-2.0
72
+ */
73
+ /*
74
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
75
+ SPDX-License-Identifier: Apache-2.0
76
+ */
77
+ /*
78
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
79
+ SPDX-License-Identifier: Apache-2.0
80
+ */
81
+ /*
82
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
83
+ SPDX-License-Identifier: Apache-2.0
84
+ */
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
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ /*
98
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
+ SPDX-License-Identifier: Apache-2.0
100
+ */
101
+ /*
102
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
103
+ SPDX-License-Identifier: Apache-2.0
104
+ */
105
+ /*
106
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
107
+ SPDX-License-Identifier: Apache-2.0
108
+ */
109
+ /*
110
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
111
+ SPDX-License-Identifier: Apache-2.0
112
+ */
113
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
114
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
115
+ /*
116
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
+ SPDX-License-Identifier: Apache-2.0
118
+ */
119
+ /*
120
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
121
+ SPDX-License-Identifier: Apache-2.0
122
+ */
123
+ /*
124
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
125
+ SPDX-License-Identifier: Apache-2.0
126
+ */
127
+ /*
128
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
129
+ SPDX-License-Identifier: Apache-2.0
130
+ */
131
+ /*
132
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
133
+ SPDX-License-Identifier: Apache-2.0
134
+ */
135
+ /*
136
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
137
+ SPDX-License-Identifier: Apache-2.0
138
+ */
139
+ /*
140
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
141
+ SPDX-License-Identifier: Apache-2.0
142
+ */
143
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
144
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
+ .awsui_radio-button_zdbjz_1ul8q_145:not(#\9) {
146
+ border-collapse: separate;
147
+ border-spacing: 0;
148
+ box-sizing: border-box;
149
+ caption-side: top;
150
+ cursor: auto;
151
+ direction: inherit;
152
+ empty-cells: show;
153
+ font-family: serif;
154
+ font-style: normal;
155
+ font-variant: normal;
156
+ font-stretch: normal;
157
+ hyphens: none;
158
+ letter-spacing: normal;
159
+ list-style: disc outside none;
160
+ tab-size: 8;
161
+ text-align: start;
162
+ text-indent: 0;
163
+ text-shadow: none;
164
+ text-transform: none;
165
+ visibility: visible;
166
+ white-space: normal;
167
+ word-spacing: normal;
168
+ font-size: var(--font-size-body-m-vv54cm, 14px);
169
+ line-height: var(--line-height-body-m-bedeoh, 22px);
170
+ color: var(--color-text-body-default-5qid0u, #16191f);
171
+ font-weight: 400;
172
+ font-family: var(--font-family-base-8x5ngf, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
173
+ -webkit-font-smoothing: auto;
174
+ -moz-osx-font-smoothing: auto;
175
+ }
@@ -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
+ "radio-button": "awsui_radio-button_zdbjz_1ul8q_145"
6
+ };
7
+
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from './interfaces';
3
3
  export { RadioGroupProps };
4
- declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<import("../internal/components/radio-button/interfaces").RadioButtonProps.Ref>>;
4
+ declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<RadioGroupProps.Ref>>;
5
5
  export default RadioGroup;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,uJAmBd,CAAC;AAGH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAqBd,CAAC;AAGH,eAAe,UAAU,CAAC"}
@@ -8,7 +8,10 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
8
8
  import InternalRadioGroup from './internal';
9
9
  import analyticsSelectors from './analytics-metadata/styles.css.js';
10
10
  const RadioGroup = React.forwardRef((props, ref) => {
11
- const baseComponentProps = useBaseComponent('RadioGroup', { props: { readOnly: props.readOnly } });
11
+ var _a;
12
+ const baseComponentProps = useBaseComponent('RadioGroup', {
13
+ props: { readOnly: props.readOnly, direction: (_a = props.direction) !== null && _a !== void 0 ? _a : 'vertical' },
14
+ });
12
15
  return (React.createElement(InternalRadioGroup, { ref: ref, ...props, ...baseComponentProps, ...getAnalyticsMetadataAttribute({
13
16
  component: {
14
17
  name: 'awsui.RadioGroup',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAE5C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAsB,EAAE,GAAmC,EAAE,EAAE;IAClG,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACnG,OAAO,CACL,oBAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,KACJ,KAAK,KACL,kBAAkB,KAClB,6BAA6B,CAAC;YAChC,SAAS,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACvB,UAAU,EAAE;oBACV,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE;oBACvB,UAAU,EAAE,IAAI,kBAAkB,CAAC,QAAQ,EAAE;iBAC9C;aAC+C;SACnD,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataRadioGroupComponent } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\nimport InternalRadioGroup from './internal';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { RadioGroupProps };\n\nconst RadioGroup = React.forwardRef((props: RadioGroupProps, ref: React.Ref<RadioGroupProps.Ref>) => {\n const baseComponentProps = useBaseComponent('RadioGroup', { props: { readOnly: props.readOnly } });\n return (\n <InternalRadioGroup\n ref={ref}\n {...props}\n {...baseComponentProps}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.RadioGroup',\n label: { root: 'self' },\n properties: {\n value: `${props.value}`,\n valueLabel: `.${analyticsSelectors.selected}`,\n },\n } as GeneratedAnalyticsMetadataRadioGroupComponent,\n })}\n />\n );\n});\n\napplyDisplayName(RadioGroup, 'RadioGroup');\nexport default RadioGroup;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAE5C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAsB,EAAE,GAAmC,EAAE,EAAE;;IAClG,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE;QACxD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAA,KAAK,CAAC,SAAS,mCAAI,UAAU,EAAE;KAC9E,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,KACJ,KAAK,KACL,kBAAkB,KAClB,6BAA6B,CAAC;YAChC,SAAS,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACvB,UAAU,EAAE;oBACV,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE;oBACvB,UAAU,EAAE,IAAI,kBAAkB,CAAC,QAAQ,EAAE;iBAC9C;aAC+C;SACnD,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataRadioGroupComponent } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\nimport InternalRadioGroup from './internal';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { RadioGroupProps };\n\nconst RadioGroup = React.forwardRef((props: RadioGroupProps, ref: React.Ref<RadioGroupProps.Ref>) => {\n const baseComponentProps = useBaseComponent('RadioGroup', {\n props: { readOnly: props.readOnly, direction: props.direction ?? 'vertical' },\n });\n return (\n <InternalRadioGroup\n ref={ref}\n {...props}\n {...baseComponentProps}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.RadioGroup',\n label: { root: 'self' },\n properties: {\n value: `${props.value}`,\n valueLabel: `.${analyticsSelectors.selected}`,\n },\n } as GeneratedAnalyticsMetadataRadioGroupComponent,\n })}\n />\n );\n});\n\napplyDisplayName(RadioGroup, 'RadioGroup');\nexport default RadioGroup;\n"]}
@@ -55,6 +55,10 @@ export interface RadioGroupProps extends BaseComponentProps, FormFieldControlPro
55
55
  * @awsuiSystem core
56
56
  */
57
57
  style?: RadioGroupProps.Style;
58
+ /**
59
+ * Defines the direction in which the radio buttons are laid out.
60
+ */
61
+ direction?: 'horizontal' | 'vertical';
58
62
  }
59
63
  export declare namespace RadioGroupProps {
60
64
  interface RadioButtonDefinition {
@@ -67,7 +71,12 @@ export declare namespace RadioGroupProps {
67
71
  interface ChangeDetail {
68
72
  value: string;
69
73
  }
70
- type Ref = RadioButtonProps.Ref;
74
+ interface Ref {
75
+ /**
76
+ * Sets input focus onto the UI control.
77
+ */
78
+ focus(): void;
79
+ }
71
80
  type Style = RadioButtonProps.Style;
72
81
  }
73
82
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/radio-group/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,qBAAqB;IAChF;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAE7D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAEnE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC;CAC/B;AAED,yBAAiB,eAAe,CAAC;IAC/B,UAAiB,qBAAqB;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE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AAqB;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,YAAY;QAC3B,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;IAED,KAAY,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC;CAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/radio-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { RadioButtonProps } from '../internal/components/radio-button/interfaces';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface RadioGroupProps extends BaseComponentProps, FormFieldControlProps {\n /**\n * Specify a custom name for the radio buttons. If not provided, the radio group generates a random name.\n */\n name?: string;\n\n /**\n * Sets the value of the selected radio button.\n * If you want to clear the selection, use `null`.\n */\n value: string | null;\n\n /**\n * Specifies an array of radio buttons to display. Each of these objects have the following properties:\n *\n * - `value` (string) - Sets the value of the radio button. Assigned to the radio group when a user selects the radio button.\n * - `label` (ReactNode) - Specifies a label for the radio button.\n * - `description` (ReactNode) - (Optional) Specifies descriptive text that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the radio button is disabled, which prevents the user from selecting it.\n * - `controlId` (string) - (Optional) Sets the ID of the internal input. You can use it to relate a label element's `for` attribute to this control.\n * In general it's not recommended to set this because the ID is automatically set by the radio group component.\n */\n items?: ReadonlyArray<RadioGroupProps.RadioButtonDefinition>;\n\n /**\n * Adds `aria-label` to the group. If you are using this form element within a form field,\n * don't set this property because the form field component automatically sets the correct labels to make the component accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-required` to the group.\n */\n ariaRequired?: boolean;\n\n /**\n * Adds `aria-controls` attribute to the radio group.\n * If the radio group controls any secondary content (for example, another form field), use this to provide an ID referring to the secondary content.\n */\n ariaControls?: string;\n\n /**\n * Called when the user selects a different radio button. The event `detail` contains the current `value`.\n */\n onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;\n\n /**\n * @deprecated Has no effect.\n */\n controlId?: string;\n\n /**\n * Specifies if the whole group is read-only, which prevents the\n * user from modifying the value, but does not prevent the value from\n * being included in a form submission. A read-only control is still focusable.\n */\n readOnly?: boolean;\n\n /**\n * @awsuiSystem core\n */\n style?: RadioGroupProps.Style;\n}\n\nexport namespace RadioGroupProps {\n export interface RadioButtonDefinition {\n value: string;\n label: React.ReactNode;\n description?: React.ReactNode;\n disabled?: boolean;\n controlId?: string;\n }\n\n export interface ChangeDetail {\n value: string;\n }\n\n export type Ref = RadioButtonProps.Ref;\n\n export type Style = RadioButtonProps.Style;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/radio-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { RadioButtonProps } from '../internal/components/radio-button/interfaces';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface RadioGroupProps extends BaseComponentProps, FormFieldControlProps {\n /**\n * Specify a custom name for the radio buttons. If not provided, the radio group generates a random name.\n */\n name?: string;\n\n /**\n * Sets the value of the selected radio button.\n * If you want to clear the selection, use `null`.\n */\n value: string | null;\n\n /**\n * Specifies an array of radio buttons to display. Each of these objects have the following properties:\n *\n * - `value` (string) - Sets the value of the radio button. Assigned to the radio group when a user selects the radio button.\n * - `label` (ReactNode) - Specifies a label for the radio button.\n * - `description` (ReactNode) - (Optional) Specifies descriptive text that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the radio button is disabled, which prevents the user from selecting it.\n * - `controlId` (string) - (Optional) Sets the ID of the internal input. You can use it to relate a label element's `for` attribute to this control.\n * In general it's not recommended to set this because the ID is automatically set by the radio group component.\n */\n items?: ReadonlyArray<RadioGroupProps.RadioButtonDefinition>;\n\n /**\n * Adds `aria-label` to the group. If you are using this form element within a form field,\n * don't set this property because the form field component automatically sets the correct labels to make the component accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-required` to the group.\n */\n ariaRequired?: boolean;\n\n /**\n * Adds `aria-controls` attribute to the radio group.\n * If the radio group controls any secondary content (for example, another form field), use this to provide an ID referring to the secondary content.\n */\n ariaControls?: string;\n\n /**\n * Called when the user selects a different radio button. The event `detail` contains the current `value`.\n */\n onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;\n\n /**\n * @deprecated Has no effect.\n */\n controlId?: string;\n\n /**\n * Specifies if the whole group is read-only, which prevents the\n * user from modifying the value, but does not prevent the value from\n * being included in a form submission. A read-only control is still focusable.\n */\n readOnly?: boolean;\n\n /**\n * @awsuiSystem core\n */\n style?: RadioGroupProps.Style;\n\n /**\n * Defines the direction in which the radio buttons are laid out.\n */\n direction?: 'horizontal' | 'vertical';\n}\n\nexport namespace RadioGroupProps {\n export interface RadioButtonDefinition {\n value: string;\n label: React.ReactNode;\n description?: React.ReactNode;\n disabled?: boolean;\n controlId?: string;\n }\n\n export interface ChangeDetail {\n value: string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export type Style = RadioButtonProps.Style;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
3
  import { RadioGroupProps } from './interfaces';
4
- declare const InternalRadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & InternalBaseComponentProps & React.RefAttributes<import("../internal/components/radio-button/interfaces").RadioButtonProps.Ref>>;
4
+ declare const InternalRadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & InternalBaseComponentProps & React.RefAttributes<RadioGroupProps.Ref>>;
5
5
  export default InternalRadioGroup;
6
6
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,oLA4EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HA+EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -12,17 +12,13 @@ import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-gro
12
12
  import analyticsSelectors from './analytics-metadata/styles.css.js';
13
13
  import styles from './styles.css.js';
14
14
  import testUtilStyles from './test-classes/styles.css.js';
15
- const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style, ...props }, ref) => {
15
+ const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style, direction, ...props }, ref) => {
16
16
  const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);
17
17
  const baseProps = getBaseProps(props);
18
18
  const generatedName = useUniqueId('awsui-radio-');
19
19
  const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
20
- return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles['radio-group']), ref: __internalRootRef }, items &&
21
- items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onChange: ({ detail }) => {
22
- if (onChange && detail.checked) {
23
- fireNonCancelableEvent(onChange, { value: item.value });
24
- }
25
- }, controlId: item.controlId, readOnly: readOnly, style: style, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
20
+ return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
21
+ items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], direction === 'horizontal' && styles.horizontal, item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onSelect: () => fireNonCancelableEvent(onChange, { value: item.value }), controlId: item.controlId, readOnly: readOnly, style: style, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
26
22
  ? {
27
23
  detail: {
28
24
  position: `${index + 1}`,
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAKpF,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,GAAG,KAAK,EACgB,EAC1B,GAAmC,EACnC,EAAE;IACF,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAElD,MAAM,CAAC,cAAc,EAAE,mBAAmB,CAAC,GAAG,yBAAyB,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;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6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(baseProps.className, testUtilStyles.root, styles['radio-group'])}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onChange={({ detail }) => {\n if (onChange && detail.checked) {\n fireNonCancelableEvent(onChange, { value: item.value });\n }\n }}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,E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AAK,EACf,GAAG,EAAE,KAAK,KAAK,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAC/D,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,KAAK,EACZ,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,wBAAwB,CAAC,EACpD,SAAS,KAAK,YAAY,IAAI,MAAM,CAAC,UAAU,EAC/C,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,kBAAkB,CAAC,QAAQ,CACpD,EACD,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC7B,IAAI,EAAE,IAAI,IAAI,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EACvE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,KACR,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
@@ -1,8 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "radio-group": "awsui_radio-group_1mabk_e257j_145",
5
- "radio": "awsui_radio_1mabk_e257j_145",
6
- "radio--has-description": "awsui_radio--has-description_1mabk_e257j_182"
4
+ "radio-group": "awsui_radio-group_1mabk_1mpkt_145",
5
+ "horizontal-group": "awsui_horizontal-group_1mabk_1mpkt_176",
6
+ "radio": "awsui_radio_1mabk_1mpkt_145",
7
+ "horizontal": "awsui_horizontal_1mabk_1mpkt_176",
8
+ "radio--has-description": "awsui_radio--has-description_1mabk_1mpkt_190"
7
9
  };
8
10
 
@@ -142,7 +142,7 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_radio-group_1mabk_e257j_145:not(#\9) {
145
+ .awsui_radio-group_1mabk_1mpkt_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -172,13 +172,25 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
172
172
  font-family: var(--font-family-base-8x5ngf, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
173
173
  -webkit-font-smoothing: auto;
174
174
  -moz-osx-font-smoothing: auto;
175
+ }
176
+ .awsui_radio-group_1mabk_1mpkt_145:not(#\9):not(.awsui_horizontal-group_1mabk_1mpkt_176) {
175
177
  display: block;
176
178
  }
179
+ .awsui_radio-group_1mabk_1mpkt_145.awsui_horizontal-group_1mabk_1mpkt_176:not(#\9) {
180
+ display: flex;
181
+ align-items: start;
182
+ flex-wrap: wrap;
183
+ gap: var(--space-scaled-l-66n9sr, 20px);
184
+ }
177
185
 
178
- .awsui_radio_1mabk_e257j_145 + .awsui_radio_1mabk_e257j_145:not(#\9) {
186
+ .awsui_radio_1mabk_1mpkt_145 + .awsui_radio_1mabk_1mpkt_145:not(#\9):not(.awsui_horizontal_1mabk_1mpkt_176) {
179
187
  margin-block-start: var(--space-scaled-xxs-jatbiv, 4px);
180
188
  }
181
189
 
182
- .awsui_radio--has-description_1mabk_e257j_182 + .awsui_radio_1mabk_e257j_145:not(#\9) {
190
+ .awsui_radio--has-description_1mabk_1mpkt_190 + .awsui_radio_1mabk_1mpkt_145:not(#\9):not(.awsui_horizontal_1mabk_1mpkt_176) {
183
191
  margin-block-start: var(--space-scaled-xs-sppte9, 8px);
192
+ }
193
+
194
+ .awsui_radio_1mabk_1mpkt_145.awsui_horizontal_1mabk_1mpkt_176:not(#\9) {
195
+ max-inline-size: calc(16 * var(--space-scaled-xxl-9ur2is, 32px));
184
196
  }
@@ -2,8 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "radio-group": "awsui_radio-group_1mabk_e257j_145",
6
- "radio": "awsui_radio_1mabk_e257j_145",
7
- "radio--has-description": "awsui_radio--has-description_1mabk_e257j_182"
5
+ "radio-group": "awsui_radio-group_1mabk_1mpkt_145",
6
+ "horizontal-group": "awsui_horizontal-group_1mabk_1mpkt_176",
7
+ "radio": "awsui_radio_1mabk_1mpkt_145",
8
+ "horizontal": "awsui_horizontal_1mabk_1mpkt_176",
9
+ "radio--has-description": "awsui_radio--has-description_1mabk_1mpkt_190"
8
10
  };
9
11
 
@@ -11,5 +11,5 @@ export interface SelectionControlProps extends SelectionProps {
11
11
  itemKey?: string;
12
12
  verticalAlign?: 'middle' | 'top';
13
13
  }
14
- export declare function SelectionControl({ selectionType, indeterminate, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent, rowIndex, itemKey, verticalAlign, ...sharedProps }: SelectionControlProps): JSX.Element;
14
+ export declare function SelectionControl({ selectionType, indeterminate, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent, rowIndex, itemKey, verticalAlign, onChange, ...sharedProps }: SelectionControlProps): JSX.Element;
15
15
  //# sourceMappingURL=selection-control.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection-control.d.ts","sourceRoot":"","sources":["../../../../src/table/selection/selection-control.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAiB,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAS/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,aAAa,CAAC,CAAC,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACd,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAClC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,aAAqB,EACrB,aAAa,EACb,SAAS,EACT,WAAW,EACX,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAwB,EACxB,GAAG,WAAW,EACf,EAAE,qBAAqB,eAmFvB"}
1
+ {"version":3,"file":"selection-control.d.ts","sourceRoot":"","sources":["../../../../src/table/selection/selection-control.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAiB,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAS/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,aAAa,CAAC,CAAC,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACd,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAClC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,aAAqB,EACrB,aAAa,EACb,SAAS,EACT,WAAW,EACX,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAwB,EACxB,QAAQ,EACR,GAAG,WAAW,EACf,EAAE,qBAAqB,eAoFvB"}
@@ -8,7 +8,7 @@ import InternalCheckbox from '../../checkbox/internal';
8
8
  import RadioButton from '../../internal/components/radio-button';
9
9
  import { KeyCode } from '../../internal/keycode';
10
10
  import styles from './styles.css.js';
11
- export function SelectionControl({ selectionType, indeterminate = false, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent, rowIndex, itemKey, verticalAlign = 'middle', ...sharedProps }) {
11
+ export function SelectionControl({ selectionType, indeterminate = false, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent, rowIndex, itemKey, verticalAlign = 'middle', onChange, ...sharedProps }) {
12
12
  const controlId = useUniqueId();
13
13
  const isMultiSelection = selectionType === 'multi';
14
14
  const { navigationActive } = useSingleTabStopNavigation(null);
@@ -46,7 +46,7 @@ export function SelectionControl({ selectionType, indeterminate = false, onShift
46
46
  // Clicking on input, does not focus it on Firefox (AWSUI-11345)
47
47
  nativeInput === null || nativeInput === void 0 ? void 0 : nativeInput.focus();
48
48
  };
49
- const selector = isMultiSelection ? (React.createElement(InternalCheckbox, { ...sharedProps, showOutline: focusedComponent === 'selection-control', controlId: controlId, "data-focus-id": "selection-control", indeterminate: indeterminate })) : (React.createElement(RadioButton, { ...sharedProps, controlId: controlId, name: name, value: '' }));
49
+ const selector = isMultiSelection ? (React.createElement(InternalCheckbox, { ...sharedProps, onChange: onChange, showOutline: focusedComponent === 'selection-control', controlId: controlId, "data-focus-id": "selection-control", indeterminate: indeterminate })) : (React.createElement(RadioButton, { ...sharedProps, controlId: controlId, name: name, value: '', onSelect: onChange }));
50
50
  return (React.createElement(React.Fragment, null,
51
51
  React.createElement("label", { onKeyDown: handleKeyDown, onKeyUp: setShiftState, onMouseDown: onMouseDownHandler, onMouseUp: setShiftState, onClick: handleClick, htmlFor: controlId, className: clsx(styles.label, styles.root, verticalAlign === 'top' && styles['label-top']), "aria-label": ariaLabel, title: ariaLabel, ...(rowIndex !== undefined && !sharedProps.disabled
52
52
  ? getAnalyticsMetadataAttribute({
@@ -1 +1 @@
1
- {"version":3,"file":"selection-control.js","sourceRoot":"","sources":["../../../../src/table/selection/selection-control.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACxG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,M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AAC,QAAQ;gBAClD,CAAC,CAAC,6BAA6B,CAAC;oBAC5B,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,QAAQ,GAAG,CAAC,EAAE;wBAC3B,IAAI,EAAE,OAAO,IAAI,EAAE;qBACpB;iBACF,CAAC;gBACJ,CAAC,CAAC,EAAE,CAAC,IAEN,QAAQ,CACH;QACR,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAe,IAAI,aAExC,CACN,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEvent, KeyboardEventHandler, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\nimport { useSingleTabStopNavigation, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalCheckbox from '../../checkbox/internal';\nimport RadioButton from '../../internal/components/radio-button';\nimport { KeyCode } from '../../internal/keycode';\nimport { SelectionProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface SelectionControlProps extends SelectionProps {\n onShiftToggle?(shiftPressed: boolean): void;\n onFocusUp?: KeyboardEventHandler;\n onFocusDown?: KeyboardEventHandler;\n ariaLabel?: string;\n tabIndex?: -1;\n focusedComponent?: null | string;\n rowIndex?: number;\n itemKey?: string;\n verticalAlign?: 'middle' | 'top';\n}\n\nexport function SelectionControl({\n selectionType,\n indeterminate = false,\n onShiftToggle,\n onFocusUp,\n onFocusDown,\n name,\n ariaLabel,\n focusedComponent,\n rowIndex,\n itemKey,\n verticalAlign = 'middle',\n ...sharedProps\n}: SelectionControlProps) {\n const controlId = useUniqueId();\n const isMultiSelection = selectionType === 'multi';\n const { navigationActive } = useSingleTabStopNavigation(null);\n\n const setShiftState = (event: KeyboardEvent | MouseEvent) => {\n if (isMultiSelection) {\n onShiftToggle?.(event.shiftKey);\n }\n };\n\n const onMouseDownHandler = (event: MouseEvent) => {\n setShiftState(event);\n if (isMultiSelection) {\n // To overcome an issue\n // If you shift+click or ctrl+click on a label for a checkbox, checkbox is not checked.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=559506\n event.preventDefault();\n }\n };\n\n // native checkboxes do not have focus move via keyboard, we implement it here programmatically\n const handleKeyDown = (event: KeyboardEvent) => {\n setShiftState(event);\n if (isMultiSelection && !navigationActive) {\n if (event.keyCode === KeyCode.up) {\n event.preventDefault();\n onFocusUp?.(event);\n }\n if (event.keyCode === KeyCode.down) {\n event.preventDefault();\n onFocusDown?.(event);\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n const target = event.currentTarget;\n const nativeInput = (target.tagName === 'INPUT' ? target : target.querySelector('input')) as HTMLInputElement;\n // Clicking on input, does not focus it on Firefox (AWSUI-11345)\n nativeInput?.focus();\n };\n\n const selector = isMultiSelection ? (\n <InternalCheckbox\n {...sharedProps}\n showOutline={focusedComponent === 'selection-control'}\n controlId={controlId}\n data-focus-id=\"selection-control\"\n indeterminate={indeterminate}\n />\n ) : (\n <RadioButton {...sharedProps} controlId={controlId} name={name} value={''} />\n );\n\n return (\n <>\n <label\n onKeyDown={handleKeyDown}\n onKeyUp={setShiftState}\n onMouseDown={onMouseDownHandler}\n onMouseUp={setShiftState}\n onClick={handleClick}\n htmlFor={controlId}\n className={clsx(styles.label, styles.root, verticalAlign === 'top' && styles['label-top'])}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(rowIndex !== undefined && !sharedProps.disabled\n ? getAnalyticsMetadataAttribute({\n detail: {\n position: `${rowIndex + 1}`,\n item: itemKey || '',\n },\n })\n : {})}\n >\n {selector}\n </label>\n <span className={styles.stud} aria-hidden={true}>\n &nbsp;\n </span>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"selection-control.js","sourceRoot":"","sources":["../../../../src/table/selection/selection-control.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAA0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aAAa,EACxB,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,gBAC9E,SAAS,EACrB,KAAK,EAAE,SAAS,KACZ,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,QAAQ;gBAClD,CAAC,CAAC,6BAA6B,CAAC;oBAC5B,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,QAAQ,GAAG,CAAC,EAAE;wBAC3B,IAAI,EAAE,OAAO,IAAI,EAAE;qBACpB;iBACF,CAAC;gBACJ,CAAC,CAAC,EAAE,CAAC,IAEN,QAAQ,CACH;QACR,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,iBAAe,IAAI,aAExC,CACN,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEvent, KeyboardEventHandler, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\nimport { useSingleTabStopNavigation, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalCheckbox from '../../checkbox/internal';\nimport RadioButton from '../../internal/components/radio-button';\nimport { KeyCode } from '../../internal/keycode';\nimport { SelectionProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface SelectionControlProps extends SelectionProps {\n onShiftToggle?(shiftPressed: boolean): void;\n onFocusUp?: KeyboardEventHandler;\n onFocusDown?: KeyboardEventHandler;\n ariaLabel?: string;\n tabIndex?: -1;\n focusedComponent?: null | string;\n rowIndex?: number;\n itemKey?: string;\n verticalAlign?: 'middle' | 'top';\n}\n\nexport function SelectionControl({\n selectionType,\n indeterminate = false,\n onShiftToggle,\n onFocusUp,\n onFocusDown,\n name,\n ariaLabel,\n focusedComponent,\n rowIndex,\n itemKey,\n verticalAlign = 'middle',\n onChange,\n ...sharedProps\n}: SelectionControlProps) {\n const controlId = useUniqueId();\n const isMultiSelection = selectionType === 'multi';\n const { navigationActive } = useSingleTabStopNavigation(null);\n\n const setShiftState = (event: KeyboardEvent | MouseEvent) => {\n if (isMultiSelection) {\n onShiftToggle?.(event.shiftKey);\n }\n };\n\n const onMouseDownHandler = (event: MouseEvent) => {\n setShiftState(event);\n if (isMultiSelection) {\n // To overcome an issue\n // If you shift+click or ctrl+click on a label for a checkbox, checkbox is not checked.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=559506\n event.preventDefault();\n }\n };\n\n // native checkboxes do not have focus move via keyboard, we implement it here programmatically\n const handleKeyDown = (event: KeyboardEvent) => {\n setShiftState(event);\n if (isMultiSelection && !navigationActive) {\n if (event.keyCode === KeyCode.up) {\n event.preventDefault();\n onFocusUp?.(event);\n }\n if (event.keyCode === KeyCode.down) {\n event.preventDefault();\n onFocusDown?.(event);\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n const target = event.currentTarget;\n const nativeInput = (target.tagName === 'INPUT' ? target : target.querySelector('input')) as HTMLInputElement;\n // Clicking on input, does not focus it on Firefox (AWSUI-11345)\n nativeInput?.focus();\n };\n\n const selector = isMultiSelection ? (\n <InternalCheckbox\n {...sharedProps}\n onChange={onChange}\n showOutline={focusedComponent === 'selection-control'}\n controlId={controlId}\n data-focus-id=\"selection-control\"\n indeterminate={indeterminate}\n />\n ) : (\n <RadioButton {...sharedProps} controlId={controlId} name={name} value={''} onSelect={onChange} />\n );\n\n return (\n <>\n <label\n onKeyDown={handleKeyDown}\n onKeyUp={setShiftState}\n onMouseDown={onMouseDownHandler}\n onMouseUp={setShiftState}\n onClick={handleClick}\n htmlFor={controlId}\n className={clsx(styles.label, styles.root, verticalAlign === 'top' && styles['label-top'])}\n aria-label={ariaLabel}\n title={ariaLabel}\n {...(rowIndex !== undefined && !sharedProps.disabled\n ? getAnalyticsMetadataAttribute({\n detail: {\n position: `${rowIndex + 1}`,\n item: itemKey || '',\n },\n })\n : {})}\n >\n {selector}\n </label>\n <span className={styles.stud} aria-hidden={true}>\n &nbsp;\n </span>\n </>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
2
- import RadioButtonWrapper from '../radio-group/radio-button';
2
+ import RadioButtonWrapper from '../radio-button';
3
3
  export default class PageSizePreferenceWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
5
  findTitle(): ElementWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"page-size-preference.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/collection-preferences/page-size-preference.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,8CAA6C;AAC7C,gDAA+C;AAG/C,6FAAyE;AAEzE,MAAqB,yBAA0B,SAAQ,sBAAgB;IAGrE,SAAS;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,oBAAgB,CAAE,CAAC,SAAS,EAAG,CAAC;IAClG,CAAC;IACD,WAAW;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,uBAAuB,CAAC,EAAE,EAAE,qBAAiB,CAAE,CAAC,WAAW,EAAE,CAAC;IACrG,CAAC;;AAPM,sCAAY,GAAG,6BAAM,CAAC,WAAW,CAAC,CAAC;kBADvB,yBAAyB"}
1
+ {"version":3,"file":"page-size-preference.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/collection-preferences/page-size-preference.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,8CAA6C;AAE7C,gDAA+C;AAE/C,6FAAyE;AAEzE,MAAqB,yBAA0B,SAAQ,sBAAgB;IAGrE,SAAS;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,oBAAgB,CAAE,CAAC,SAAS,EAAG,CAAC;IAClG,CAAC;IACD,WAAW;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,uBAAuB,CAAC,EAAE,EAAE,qBAAiB,CAAE,CAAC,WAAW,EAAE,CAAC;IACrG,CAAC;;AAPM,sCAAY,GAAG,6BAAM,CAAC,WAAW,CAAC,CAAC;kBADvB,yBAAyB"}
@@ -57,6 +57,7 @@ import PopoverWrapper from './popover';
57
57
  import ProgressBarWrapper from './progress-bar';
58
58
  import PromptInputWrapper from './prompt-input';
59
59
  import PropertyFilterWrapper from './property-filter';
60
+ import RadioButtonWrapper from './radio-button';
60
61
  import RadioGroupWrapper from './radio-group';
61
62
  import S3ResourceSelectorWrapper from './s3-resource-selector';
62
63
  import SegmentedControlWrapper from './segmented-control';
@@ -141,6 +142,7 @@ export { PopoverWrapper };
141
142
  export { ProgressBarWrapper };
142
143
  export { PromptInputWrapper };
143
144
  export { PropertyFilterWrapper };
145
+ export { RadioButtonWrapper };
144
146
  export { RadioGroupWrapper };
145
147
  export { S3ResourceSelectorWrapper };
146
148
  export { SegmentedControlWrapper };
@@ -1196,6 +1198,24 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
1196
1198
  * @returns {Array<PropertyFilterWrapper>}
1197
1199
  */
1198
1200
  findAllPropertyFilters(selector?: string): Array<PropertyFilterWrapper>;
1201
+ /**
1202
+ * Returns the wrapper of the first RadioButton that matches the specified CSS selector.
1203
+ * If no CSS selector is specified, returns the wrapper of the first RadioButton.
1204
+ * If no matching RadioButton is found, returns `null`.
1205
+ *
1206
+ * @param {string} [selector] CSS Selector
1207
+ * @returns {RadioButtonWrapper | null}
1208
+ */
1209
+ findRadioButton(selector?: string): RadioButtonWrapper | null;
1210
+ /**
1211
+ * Returns an array of RadioButton wrapper that matches the specified CSS selector.
1212
+ * If no CSS selector is specified, returns all of the RadioButtons inside the current wrapper.
1213
+ * If no matching RadioButton is found, returns an empty array.
1214
+ *
1215
+ * @param {string} [selector] CSS Selector
1216
+ * @returns {Array<RadioButtonWrapper>}
1217
+ */
1218
+ findAllRadioButtons(selector?: string): Array<RadioButtonWrapper>;
1199
1219
  /**
1200
1220
  * Returns the wrapper of the first RadioGroup that matches the specified CSS selector.
1201
1221
  * If no CSS selector is specified, returns the wrapper of the first RadioGroup.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModalWrapper = exports.MixedLineBarChartWrapper = exports.LiveRegionWrapper = exports.ListWrapper = exports.LinkWrapper = exports.LineChartWrapper = exports.KeyValuePairsWrapper = exports.InputWrapper = exports.IconWrapper = exports.HotspotWrapper = exports.HelpPanelWrapper = exports.HeaderWrapper = exports.GridWrapper = exports.FormFieldWrapper = exports.FormWrapper = exports.FlashbarWrapper = exports.FileUploadWrapper = exports.FileTokenGroupWrapper = exports.FileInputWrapper = exports.FileDropzoneWrapper = exports.ExpandableSectionWrapper = exports.DrawerWrapper = exports.DateRangePickerWrapper = exports.DatePickerWrapper = exports.DateInputWrapper = exports.CopyToClipboardWrapper = exports.ContentLayoutWrapper = exports.ContainerWrapper = exports.ColumnLayoutWrapper = exports.CollectionPreferencesWrapper = exports.CodeEditorWrapper = exports.CheckboxWrapper = exports.CardsWrapper = exports.CalendarWrapper = exports.ButtonGroupWrapper = exports.ButtonDropdownWrapper = exports.ButtonWrapper = exports.BreadcrumbGroupWrapper = exports.BoxWrapper = exports.BarChartWrapper = exports.BadgeWrapper = exports.AutosuggestWrapper = exports.AttributeEditorWrapper = exports.AreaChartWrapper = exports.AppLayoutToolbarWrapper = exports.AppLayoutWrapper = exports.AnnotationWrapper = exports.AnchorNavigationWrapper = exports.AlertWrapper = exports.ElementWrapper = void 0;
4
- exports.WizardWrapper = exports.TutorialPanelWrapper = exports.TreeViewWrapper = exports.TopNavigationWrapper = exports.TokenGroupWrapper = exports.TokenWrapper = exports.ToggleButtonWrapper = exports.ToggleWrapper = exports.TimeInputWrapper = exports.TilesWrapper = exports.TextareaWrapper = exports.TextFilterWrapper = exports.TextContentWrapper = exports.TagEditorWrapper = exports.TabsWrapper = exports.TableWrapper = exports.StepsWrapper = exports.StatusIndicatorWrapper = exports.SplitPanelWrapper = exports.SpinnerWrapper = exports.SpaceBetweenWrapper = exports.SliderWrapper = exports.SideNavigationWrapper = exports.SelectWrapper = exports.SegmentedControlWrapper = exports.S3ResourceSelectorWrapper = exports.RadioGroupWrapper = exports.PropertyFilterWrapper = exports.PromptInputWrapper = exports.ProgressBarWrapper = exports.PopoverWrapper = exports.PieChartWrapper = exports.PaginationWrapper = exports.NavigableGroupWrapper = exports.MultiselectWrapper = void 0;
4
+ exports.WizardWrapper = exports.TutorialPanelWrapper = exports.TreeViewWrapper = exports.TopNavigationWrapper = exports.TokenGroupWrapper = exports.TokenWrapper = exports.ToggleButtonWrapper = exports.ToggleWrapper = exports.TimeInputWrapper = exports.TilesWrapper = exports.TextareaWrapper = exports.TextFilterWrapper = exports.TextContentWrapper = exports.TagEditorWrapper = exports.TabsWrapper = exports.TableWrapper = exports.StepsWrapper = exports.StatusIndicatorWrapper = exports.SplitPanelWrapper = exports.SpinnerWrapper = exports.SpaceBetweenWrapper = exports.SliderWrapper = exports.SideNavigationWrapper = exports.SelectWrapper = exports.SegmentedControlWrapper = exports.S3ResourceSelectorWrapper = exports.RadioGroupWrapper = exports.RadioButtonWrapper = exports.PropertyFilterWrapper = exports.PromptInputWrapper = exports.ProgressBarWrapper = exports.PopoverWrapper = exports.PieChartWrapper = exports.PaginationWrapper = exports.NavigableGroupWrapper = exports.MultiselectWrapper = void 0;
5
5
  exports.default = wrapper;
6
6
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  // SPDX-License-Identifier: Apache-2.0
@@ -122,6 +122,8 @@ const prompt_input_1 = require("./prompt-input");
122
122
  exports.PromptInputWrapper = prompt_input_1.default;
123
123
  const property_filter_1 = require("./property-filter");
124
124
  exports.PropertyFilterWrapper = property_filter_1.default;
125
+ const radio_button_1 = require("./radio-button");
126
+ exports.RadioButtonWrapper = radio_button_1.default;
125
127
  const radio_group_1 = require("./radio-group");
126
128
  exports.RadioGroupWrapper = radio_group_1.default;
127
129
  const s3_resource_selector_1 = require("./s3-resource-selector");
@@ -860,6 +862,18 @@ dom_1.ElementWrapper.prototype.findPropertyFilter = function (selector) {
860
862
  dom_1.ElementWrapper.prototype.findAllPropertyFilters = function (selector) {
861
863
  return this.findAllComponents(property_filter_1.default, selector);
862
864
  };
865
+ dom_1.ElementWrapper.prototype.findRadioButton = function (selector) {
866
+ let rootSelector = `.${radio_button_1.default.rootSelector}`;
867
+ if ("legacyRootSelector" in radio_button_1.default && radio_button_1.default.legacyRootSelector) {
868
+ rootSelector = `:is(.${radio_button_1.default.rootSelector}, .${radio_button_1.default.legacyRootSelector})`;
869
+ }
870
+ // casting to 'any' is needed to avoid this issue with generics
871
+ // https://github.com/microsoft/TypeScript/issues/29132
872
+ return this.findComponent(selector ? (0, utils_1.appendSelector)(selector, rootSelector) : rootSelector, radio_button_1.default);
873
+ };
874
+ dom_1.ElementWrapper.prototype.findAllRadioButtons = function (selector) {
875
+ return this.findAllComponents(radio_button_1.default, selector);
876
+ };
863
877
  dom_1.ElementWrapper.prototype.findRadioGroup = function (selector) {
864
878
  let rootSelector = `.${radio_group_1.default.rootSelector}`;
865
879
  if ("legacyRootSelector" in radio_group_1.default && radio_group_1.default.legacyRootSelector) {