@cloudscape-design/components-themeable 3.0.1139 → 3.0.1141

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 (62) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/components/radio-button/styles.scss +57 -0
  3. package/lib/internal/scss/internal/components/radio-button/test-classes/styles.scss +8 -0
  4. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  5. package/lib/internal/scss/radio-group/styles.scss +1 -56
  6. package/lib/internal/scss/radio-group/test-classes/styles.scss +8 -0
  7. package/lib/internal/scss/tree-view/tree-item/styles.scss +6 -2
  8. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  9. package/lib/internal/template/internal/components/radio-button/index.d.ts +6 -0
  10. package/lib/internal/template/internal/components/radio-button/index.d.ts.map +1 -0
  11. package/lib/internal/template/{radio-group/radio-button.js → internal/components/radio-button/index.js} +10 -10
  12. package/lib/internal/template/internal/components/radio-button/index.js.map +1 -0
  13. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +127 -0
  14. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -0
  15. package/lib/internal/template/internal/components/radio-button/interfaces.js +2 -0
  16. package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -0
  17. package/lib/internal/template/internal/components/radio-button/styles.css.js +12 -0
  18. package/lib/internal/template/internal/components/radio-button/styles.scoped.css +211 -0
  19. package/lib/internal/template/internal/components/radio-button/styles.selectors.js +13 -0
  20. package/lib/internal/template/internal/components/radio-button/test-classes/styles.css.js +6 -0
  21. package/lib/internal/template/internal/components/radio-button/test-classes/styles.scoped.css +7 -0
  22. package/lib/internal/template/internal/components/radio-button/test-classes/styles.selectors.js +7 -0
  23. package/lib/internal/template/internal/environment.js +2 -2
  24. package/lib/internal/template/internal/environment.json +2 -2
  25. package/lib/internal/template/radio-group/index.d.ts +1 -1
  26. package/lib/internal/template/radio-group/index.d.ts.map +1 -1
  27. package/lib/internal/template/radio-group/interfaces.d.ts +3 -50
  28. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  29. package/lib/internal/template/radio-group/interfaces.js +2 -0
  30. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  31. package/lib/internal/template/radio-group/internal.d.ts +1 -1
  32. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  33. package/lib/internal/template/radio-group/internal.js +10 -4
  34. package/lib/internal/template/radio-group/internal.js.map +1 -1
  35. package/lib/internal/template/radio-group/styles.css.js +3 -10
  36. package/lib/internal/template/radio-group/styles.scoped.css +3 -75
  37. package/lib/internal/template/radio-group/styles.selectors.js +3 -10
  38. package/lib/internal/template/radio-group/test-classes/styles.css.js +6 -0
  39. package/lib/internal/template/radio-group/test-classes/styles.scoped.css +7 -0
  40. package/lib/internal/template/radio-group/test-classes/styles.selectors.js +7 -0
  41. package/lib/internal/template/table/selection/selection-control.js +2 -2
  42. package/lib/internal/template/table/selection/selection-control.js.map +1 -1
  43. package/lib/internal/template/test-utils/dom/radio-group/index.js +4 -3
  44. package/lib/internal/template/test-utils/dom/radio-group/index.js.map +1 -1
  45. package/lib/internal/template/test-utils/dom/radio-group/radio-button.d.ts +1 -0
  46. package/lib/internal/template/test-utils/dom/radio-group/radio-button.js +2 -0
  47. package/lib/internal/template/test-utils/dom/radio-group/radio-button.js.map +1 -1
  48. package/lib/internal/template/test-utils/selectors/radio-group/index.js +4 -3
  49. package/lib/internal/template/test-utils/selectors/radio-group/index.js.map +1 -1
  50. package/lib/internal/template/test-utils/selectors/radio-group/radio-button.d.ts +1 -0
  51. package/lib/internal/template/test-utils/selectors/radio-group/radio-button.js +2 -0
  52. package/lib/internal/template/test-utils/selectors/radio-group/radio-button.js.map +1 -1
  53. package/lib/internal/template/tiles/tile.d.ts.map +1 -1
  54. package/lib/internal/template/tiles/tile.js +2 -2
  55. package/lib/internal/template/tiles/tile.js.map +1 -1
  56. package/lib/internal/template/tree-view/tree-item/styles.css.js +9 -9
  57. package/lib/internal/template/tree-view/tree-item/styles.scoped.css +16 -12
  58. package/lib/internal/template/tree-view/tree-item/styles.selectors.js +9 -9
  59. package/package.json +1 -1
  60. package/lib/internal/template/radio-group/radio-button.d.ts +0 -14
  61. package/lib/internal/template/radio-group/radio-button.d.ts.map +0 -1
  62. package/lib/internal/template/radio-group/radio-button.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_root_15oj2_1q93l_5:not(#\9) {
6
+ /*used in test-utils*/
7
+ }
@@ -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_15oj2_1q93l_5"
6
+ };
7
+
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (7af314dc)";
3
- export var GIT_SHA = "7af314dc";
2
+ export var PACKAGE_VERSION = "3.0.0 (a79c3a7f)";
3
+ export var GIT_SHA = "a79c3a7f";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "console";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (7af314dc)",
4
- "GIT_SHA": "7af314dc",
3
+ "PACKAGE_VERSION": "3.0.0 (a79c3a7f)",
4
+ "GIT_SHA": "a79c3a7f",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -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<RadioGroupProps.Ref>>;
4
+ declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<import("../internal/components/radio-button/interfaces").RadioButtonProps.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,6FAmBd,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,uJAmBd,CAAC;AAGH,eAAe,UAAU,CAAC"}
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { BaseComponentProps } from '../internal/base-component';
2
+ import { RadioButtonProps } from '../internal/components/radio-button/interfaces';
3
3
  import { FormFieldControlProps } from '../internal/context/form-field-context';
4
4
  import { NonCancelableEventHandler } from '../internal/events';
5
5
  export interface RadioGroupProps extends BaseComponentProps, FormFieldControlProps {
@@ -67,54 +67,7 @@ export declare namespace RadioGroupProps {
67
67
  interface ChangeDetail {
68
68
  value: string;
69
69
  }
70
- interface Ref {
71
- /**
72
- * Sets input focus onto the UI control.
73
- */
74
- focus(): void;
75
- }
76
- interface Style {
77
- input?: {
78
- fill?: {
79
- checked?: string;
80
- default?: string;
81
- disabled?: string;
82
- readOnly?: string;
83
- };
84
- stroke?: {
85
- default?: string;
86
- disabled?: string;
87
- readOnly?: string;
88
- };
89
- circle?: {
90
- fill?: {
91
- checked?: string;
92
- disabled?: string;
93
- readOnly?: string;
94
- };
95
- };
96
- focusRing?: {
97
- borderColor?: string;
98
- borderRadius?: string;
99
- borderWidth?: string;
100
- };
101
- };
102
- label?: {
103
- color?: {
104
- checked?: string;
105
- default?: string;
106
- disabled?: string;
107
- readOnly?: string;
108
- };
109
- };
110
- description?: {
111
- color?: {
112
- checked?: string;
113
- default?: string;
114
- disabled?: string;
115
- readOnly?: string;
116
- };
117
- };
118
- }
70
+ type Ref = RadioButtonProps.Ref;
71
+ type Style = RadioButtonProps.Style;
119
72
  }
120
73
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/radio-group/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,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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ACH,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,MAAM,CAAC;KACpB;IAED,UAAiB,YAAY;QAC3B,KAAK,EAAE,MAAM,CAAC;KACf;IAED,KAAY,GAAG,GAAG,gBAAgB,CAAC,GAAG,CAAC;IAEvC,KAAY,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC;CAC5C"}
@@ -1,2 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
1
3
  export {};
2
4
  //# sourceMappingURL=interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/radio-group/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';\n\nimport { BaseComponentProps } from '../internal/base-component';\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 interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface Style {\n input?: {\n fill?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n stroke?: {\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n circle?: {\n fill?: {\n checked?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n label?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n description?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n }\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\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,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<RadioGroupProps.Ref>>;
4
+ declare const InternalRadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & InternalBaseComponentProps & React.RefAttributes<import("../internal/components/radio-button/interfaces").RadioButtonProps.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;AAS1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HAmEvB,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,oLA4EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -5,25 +5,31 @@ import clsx from 'clsx';
5
5
  import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
6
6
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
7
  import { getBaseProps } from '../internal/base-component';
8
+ import RadioButton from '../internal/components/radio-button';
8
9
  import { useFormFieldContext } from '../internal/context/form-field-context';
10
+ import { fireNonCancelableEvent } from '../internal/events';
9
11
  import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';
10
- import RadioButton from './radio-button';
11
12
  import analyticsSelectors from './analytics-metadata/styles.css.js';
12
13
  import styles from './styles.css.js';
14
+ import testUtilStyles from './test-classes/styles.css.js';
13
15
  const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style, ...props }, ref) => {
14
16
  const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);
15
17
  const baseProps = getBaseProps(props);
16
18
  const generatedName = useUniqueId('awsui-radio-');
17
19
  const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
18
- 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, styles.root), ref: __internalRootRef }, items &&
19
- items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, label: item.label, description: item.description, disabled: item.disabled, onChange: onChange, 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']), 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
26
  ? {
21
27
  detail: {
22
28
  position: `${index + 1}`,
23
29
  value: item.value,
24
30
  },
25
31
  }
26
- : {}) })))));
32
+ : {}) }, item.label)))));
27
33
  });
28
34
  export default InternalRadioGroup;
29
35
  //# sourceMappingURL=internal.js.map
@@ -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,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAIpF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,k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AK,EAC7B,IAAI,EAAE,IAAI,IAAI,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,QAAQ,EAClB,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,GACD,CACH,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 { useFormFieldContext } from '../internal/context/form-field-context';\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';\nimport RadioButton from './radio-button';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './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, styles.root)}\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(item.value === value && analyticsSelectors.selected)}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n label={item.label}\n description={item.description}\n disabled={item.disabled}\n onChange={onChange}\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 ))}\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,OA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';\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,15 +1,8 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1mabk_1bq93_145",
5
- "radio": "awsui_radio_1mabk_1bq93_178",
6
- "radio--has-description": "awsui_radio--has-description_1mabk_1bq93_186",
7
- "radio-control": "awsui_radio-control_1mabk_1bq93_190",
8
- "outline": "awsui_outline_1mabk_1bq93_198",
9
- "styled-circle-border": "awsui_styled-circle-border_1mabk_1bq93_221",
10
- "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_1bq93_225",
11
- "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_1bq93_225",
12
- "styled-circle-fill": "awsui_styled-circle-fill_1mabk_1bq93_230",
13
- "styled-circle-checked": "awsui_styled-circle-checked_1mabk_1bq93_246"
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"
14
7
  };
15
8
 
@@ -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_root_1mabk_1bq93_145:not(#\9) {
145
+ .awsui_radio-group_1mabk_e257j_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -175,82 +175,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
175
175
  display: block;
176
176
  }
177
177
 
178
- .awsui_radio_1mabk_1bq93_178:not(#\9) {
179
- /*used in test-utils*/
180
- }
181
-
182
- .awsui_radio_1mabk_1bq93_178 + .awsui_radio_1mabk_1bq93_178:not(#\9) {
178
+ .awsui_radio_1mabk_e257j_145 + .awsui_radio_1mabk_e257j_145:not(#\9) {
183
179
  margin-block-start: var(--space-scaled-xxs-jatbiv, 4px);
184
180
  }
185
181
 
186
- .awsui_radio--has-description_1mabk_1bq93_186 + .awsui_radio_1mabk_1bq93_178:not(#\9) {
182
+ .awsui_radio--has-description_1mabk_e257j_182 + .awsui_radio_1mabk_e257j_145:not(#\9) {
187
183
  margin-block-start: var(--space-scaled-xs-sppte9, 8px);
188
- }
189
-
190
- .awsui_radio-control_1mabk_1bq93_190:not(#\9) {
191
- margin-block-start: calc((var(--line-height-body-m-bedeoh, 22px) - var(--size-control-lkpwjy, 14px)) / 2);
192
- min-block-size: var(--size-control-lkpwjy, 14px);
193
- min-inline-size: var(--size-control-lkpwjy, 14px);
194
- block-size: var(--size-control-lkpwjy, 14px);
195
- inline-size: var(--size-control-lkpwjy, 14px);
196
- }
197
-
198
- .awsui_outline_1mabk_1bq93_198:not(#\9) {
199
- --awsui-style-focus-ring-box-shadow-d43v8n: 0 0 0 var(--awsui-style-focus-ring-border-width-d43v8n, 2px) var(--awsui-style-focus-ring-border-color-d43v8n, var(--color-border-item-focused-r5f6xl, #0073bb));
200
- position: relative;
201
- }
202
- .awsui_outline_1mabk_1bq93_198:not(#\9) {
203
- outline: 2px dotted transparent;
204
- outline-offset: calc(2px - 1px);
205
- }
206
- .awsui_outline_1mabk_1bq93_198:not(#\9)::before {
207
- content: " ";
208
- display: block;
209
- position: absolute;
210
- inset-inline-start: calc(-1 * 2px);
211
- inset-block-start: calc(-1 * 2px);
212
- inline-size: calc(100% + 2px + 2px);
213
- block-size: calc(100% + 2px + 2px);
214
- border-start-start-radius: var(--awsui-style-focus-ring-border-radius-d43v8n, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
215
- border-start-end-radius: var(--awsui-style-focus-ring-border-radius-d43v8n, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
216
- border-end-start-radius: var(--awsui-style-focus-ring-border-radius-d43v8n, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
217
- border-end-end-radius: var(--awsui-style-focus-ring-border-radius-d43v8n, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
218
- box-shadow: var(--awsui-style-focus-ring-box-shadow-d43v8n);
219
- }
220
-
221
- .awsui_styled-circle-border_1mabk_1bq93_221:not(#\9) {
222
- stroke: var(--color-border-control-default-e686ow, #687078);
223
- fill: var(--color-background-control-default-wjdczs, #ffffff);
224
- }
225
- .awsui_styled-circle-border_1mabk_1bq93_221.awsui_styled-circle-disabled_1mabk_1bq93_225:not(#\9), .awsui_styled-circle-border_1mabk_1bq93_221.awsui_styled-circle-readonly_1mabk_1bq93_225:not(#\9) {
226
- fill: var(--color-background-control-disabled-2ixett, #d5dbdb);
227
- stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
228
- }
229
-
230
- .awsui_styled-circle-fill_1mabk_1bq93_230:not(#\9) {
231
- stroke: var(--color-background-control-checked-se0x0e, #0073bb);
232
- fill: var(--color-foreground-control-default-rf7v4a, #ffffff);
233
- opacity: 0;
234
- transition: opacity var(--motion-duration-transition-quick-ucajl5, 90ms) var(--motion-easing-transition-quick-034duw, linear);
235
- }
236
- @media (prefers-reduced-motion: reduce) {
237
- .awsui_styled-circle-fill_1mabk_1bq93_230:not(#\9) {
238
- animation: none;
239
- transition: none;
240
- }
241
- }
242
- .awsui-motion-disabled .awsui_styled-circle-fill_1mabk_1bq93_230:not(#\9), .awsui-mode-entering .awsui_styled-circle-fill_1mabk_1bq93_230:not(#\9) {
243
- animation: none;
244
- transition: none;
245
- }
246
- .awsui_styled-circle-fill_1mabk_1bq93_230.awsui_styled-circle-checked_1mabk_1bq93_246:not(#\9) {
247
- opacity: 1;
248
- }
249
- .awsui_styled-circle-fill_1mabk_1bq93_230.awsui_styled-circle-disabled_1mabk_1bq93_225:not(#\9) {
250
- fill: var(--color-foreground-control-disabled-kj751b, #ffffff);
251
- stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
252
- }
253
- .awsui_styled-circle-fill_1mabk_1bq93_230.awsui_styled-circle-readonly_1mabk_1bq93_225:not(#\9) {
254
- fill: var(--color-foreground-control-read-only-cgy3yn, #687078);
255
- stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
256
184
  }
@@ -2,15 +2,8 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_1mabk_1bq93_145",
6
- "radio": "awsui_radio_1mabk_1bq93_178",
7
- "radio--has-description": "awsui_radio--has-description_1mabk_1bq93_186",
8
- "radio-control": "awsui_radio-control_1mabk_1bq93_190",
9
- "outline": "awsui_outline_1mabk_1bq93_198",
10
- "styled-circle-border": "awsui_styled-circle-border_1mabk_1bq93_221",
11
- "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_1bq93_225",
12
- "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_1bq93_225",
13
- "styled-circle-fill": "awsui_styled-circle-fill_1mabk_1bq93_230",
14
- "styled-circle-checked": "awsui_styled-circle-checked_1mabk_1bq93_246"
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"
15
8
  };
16
9
 
@@ -0,0 +1,6 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_1np5w_1q93l_5"
5
+ };
6
+
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_root_1np5w_1q93l_5:not(#\9) {
6
+ /*used in test-utils*/
7
+ }
@@ -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_1np5w_1q93l_5"
6
+ };
7
+
@@ -5,8 +5,8 @@ import clsx from 'clsx';
5
5
  import { useSingleTabStopNavigation, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
6
6
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
7
  import InternalCheckbox from '../../checkbox/internal';
8
+ import RadioButton from '../../internal/components/radio-button';
8
9
  import { KeyCode } from '../../internal/keycode';
9
- import RadioButton from '../../radio-group/radio-button';
10
10
  import styles from './styles.css.js';
11
11
  export function SelectionControl({ selectionType, indeterminate = false, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent, rowIndex, itemKey, verticalAlign = 'middle', ...sharedProps }) {
12
12
  const controlId = useUniqueId();
@@ -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: '', label: '' }));
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: '' }));
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,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAGzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,MAAM,UAAU,gBAAgB,CAAC,EAC/B,aAAa,EACb,aAAa,GAAG,KAAK,EACrB,aAAa,EACb,SAAS,EACT,WAAW,EACX,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,QAAQ,EACxB,GAAG,WAAW,EACQ;IACtB,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;IAChC,MAAM,gBAAgB,GAAG,aAAa,KAAK,OAAO,CAAC;IACnD,MAAM,EAAE,gBAAgB,EAAE,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAE9D,MAAM,aAAa,GAAG,CAAC,KAAiC,EAAE,EAAE;QAC1D,IAAI,gBAAgB,EAAE,CAAC;YACrB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;I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AAgB,KAAK,mBAAmB,EACrD,SAAS,EAAE,SAAS,mBACN,mBAAmB,EACjC,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,WAAW,OAAK,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,GAAI,CACzF,CAAC;IAEF,OAAO,CACL;QACE,+BACE,SAAS,EAAE,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 { KeyCode } from '../../internal/keycode';\nimport RadioButton from '../../radio-group/radio-button';\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={''} label={''} />\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,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,MAAM,wBAAwB,CAAC;AAGjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,MAAM,UAAU,gBAAgB,CAAC,EAC/B,aAAa,EACb,aAAa,GAAG,KAAK,EACrB,aAAa,EACb,SAAS,EACT,WAAW,EACX,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,QAAQ,EACxB,GAAG,WAAW,EACQ;IACtB,MAAM,SAAS,GA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ACJ,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"]}
@@ -5,16 +5,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("./radio-button");
8
- const styles_selectors_js_1 = require("../../../radio-group/styles.selectors.js");
8
+ const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
9
10
  class RadioGroupWrapper extends dom_1.ComponentWrapper {
10
11
  findButtons() {
11
- return this.findAllByClassName(styles_selectors_js_1.default.radio).map(r => new radio_button_1.default(r.getElement()));
12
+ return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
12
13
  }
13
14
  findInputByValue(value) {
14
15
  const safeValue = (0, utils_1.escapeSelector)(value);
15
16
  return this.find(`input[value="${safeValue}"]`);
16
17
  }
17
18
  }
18
- RadioGroupWrapper.rootSelector = styles_selectors_js_1.default.root;
19
+ RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
19
20
  exports.default = RadioGroupWrapper;
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,iDAAgD;AAEhD,kFAA8D;AAE9D,MAAqB,iBAAkB,SAAQ,sBAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AATM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,iDAAgD;AAEhD,oHAA2G;AAC3G,+FAA2E;AAE3E,MAAqB,iBAAkB,SAAQ,sBAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AATM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
@@ -1,5 +1,6 @@
1
1
  import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
2
2
  export default class RadioButtonWrapper extends ComponentWrapper {
3
+ static rootSelector: string;
3
4
  private findAbstractSwitch;
4
5
  findLabel(): ElementWrapper;
5
6
  findNativeInput(): ElementWrapper<HTMLInputElement>;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
6
  const abstract_switch_1 = require("../internal/abstract-switch");
7
+ const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
7
8
  class RadioButtonWrapper extends dom_1.ComponentWrapper {
8
9
  findAbstractSwitch() {
9
10
  return new abstract_switch_1.default(this.getElement());
@@ -18,5 +19,6 @@ class RadioButtonWrapper extends dom_1.ComponentWrapper {
18
19
  return this.findAbstractSwitch().findDescription();
19
20
  }
20
21
  }
22
+ RadioButtonWrapper.rootSelector = styles_selectors_js_1.default.root;
21
23
  exports.default = RadioButtonWrapper;
22
24
  //# sourceMappingURL=radio-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/radio-button.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,iEAAgE;AAEhE,MAAqB,kBAAmB,SAAQ,sBAAgB;IACtD,kBAAkB;QACxB,OAAO,IAAI,yBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/C,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;CACF;AAhBD,qCAgBC"}
1
+ {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/radio-button.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,iEAAgE;AAEhE,oHAAgG;AAEhG,MAAqB,kBAAmB,SAAQ,sBAAgB;IAGtD,kBAAkB;QACxB,OAAO,IAAI,yBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/C,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;;AAhBM,+BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,kBAAkB"}
@@ -5,16 +5,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("./radio-button");
8
- const styles_selectors_js_1 = require("../../../radio-group/styles.selectors.js");
8
+ const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
9
10
  class RadioGroupWrapper extends selectors_1.ComponentWrapper {
10
11
  findButtons() {
11
- return this.findAllByClassName(styles_selectors_js_1.default.radio).map(r => new radio_button_1.default(r.getElement()));
12
+ return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
12
13
  }
13
14
  findInputByValue(value) {
14
15
  const safeValue = (0, utils_1.escapeSelector)(value);
15
16
  return this.find(`input[value="${safeValue}"]`);
16
17
  }
17
18
  }
18
- RadioGroupWrapper.rootSelector = styles_selectors_js_1.default.root;
19
+ RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
19
20
  exports.default = RadioGroupWrapper;
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,iDAAgD;AAChD,kFAA8D;AAC9D,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAPM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,iDAAgD;AAChD,oHAA2G;AAC3G,+FAA2E;AAC3E,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAPM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
@@ -1,5 +1,6 @@
1
1
  import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
2
  export default class RadioButtonWrapper extends ComponentWrapper {
3
+ static rootSelector: string;
3
4
  private findAbstractSwitch;
4
5
  findLabel(): ElementWrapper;
5
6
  findNativeInput(): ElementWrapper;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const abstract_switch_1 = require("../internal/abstract-switch");
7
+ const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
7
8
  class RadioButtonWrapper extends selectors_1.ComponentWrapper {
8
9
  findAbstractSwitch() {
9
10
  return new abstract_switch_1.default(this.getElement());
@@ -18,5 +19,6 @@ class RadioButtonWrapper extends selectors_1.ComponentWrapper {
18
19
  return this.findAbstractSwitch().findDescription();
19
20
  }
20
21
  }
22
+ RadioButtonWrapper.rootSelector = styles_selectors_js_1.default.root;
21
23
  exports.default = RadioButtonWrapper;
22
24
  //# sourceMappingURL=radio-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/radio-button.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,iEAAgE;AAChE,MAAqB,kBAAmB,SAAQ,4BAAgB;IACtD,kBAAkB;QACxB,OAAO,IAAI,yBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/C,CAAC;IACD,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;IACD,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;CACF;AAbD,qCAaC"}
1
+ {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/radio-button.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,iEAAgE;AAChE,oHAAgG;AAChG,MAAqB,kBAAmB,SAAQ,4BAAgB;IAEtD,kBAAkB;QACxB,OAAO,IAAI,yBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/C,CAAC;IACD,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;IACD,eAAe;QACb,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,eAAe,EAAE,CAAC;IACrD,CAAC;;AAZM,+BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/tiles/tile.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAOtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,UAAU,SAAS;IACjB,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,oFAmDhB,CAAC"}
1
+ {"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/tiles/tile.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,UAAU,SAAS;IACjB,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,oFAoDhB,CAAC"}