@cloudscape-design/components-themeable 3.0.1064 → 3.0.1065

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 (64) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/checkbox/styles.scss +11 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/scss/radio-group/styles.scss +11 -1
  5. package/lib/internal/scss/toggle/styles.scss +11 -1
  6. package/lib/internal/template/checkbox/interfaces.d.ts +45 -0
  7. package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
  8. package/lib/internal/template/checkbox/interfaces.js.map +1 -1
  9. package/lib/internal/template/checkbox/internal.d.ts.map +1 -1
  10. package/lib/internal/template/checkbox/internal.js +3 -2
  11. package/lib/internal/template/checkbox/internal.js.map +1 -1
  12. package/lib/internal/template/checkbox/style.d.ts +4 -0
  13. package/lib/internal/template/checkbox/style.d.ts.map +1 -0
  14. package/lib/internal/template/checkbox/style.js +41 -0
  15. package/lib/internal/template/checkbox/style.js.map +1 -0
  16. package/lib/internal/template/checkbox/styles.css.js +3 -3
  17. package/lib/internal/template/checkbox/styles.scoped.css +11 -10
  18. package/lib/internal/template/checkbox/styles.selectors.js +3 -3
  19. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  20. package/lib/internal/template/internal/components/abstract-switch/index.d.ts +17 -1
  21. package/lib/internal/template/internal/components/abstract-switch/index.d.ts.map +1 -1
  22. package/lib/internal/template/internal/components/abstract-switch/index.js +10 -4
  23. package/lib/internal/template/internal/components/abstract-switch/index.js.map +1 -1
  24. package/lib/internal/template/internal/components/checkbox-icon/index.d.ts +10 -1
  25. package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
  26. package/lib/internal/template/internal/components/checkbox-icon/index.js +4 -3
  27. package/lib/internal/template/internal/components/checkbox-icon/index.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/utils/style.d.ts +2 -0
  31. package/lib/internal/template/internal/utils/style.d.ts.map +1 -0
  32. package/lib/internal/template/internal/utils/style.js +22 -0
  33. package/lib/internal/template/internal/utils/style.js.map +1 -0
  34. package/lib/internal/template/radio-group/interfaces.d.ts +48 -0
  35. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  36. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  37. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  38. package/lib/internal/template/radio-group/internal.js +2 -2
  39. package/lib/internal/template/radio-group/internal.js.map +1 -1
  40. package/lib/internal/template/radio-group/radio-button.d.ts +1 -0
  41. package/lib/internal/template/radio-group/radio-button.d.ts.map +1 -1
  42. package/lib/internal/template/radio-group/radio-button.js +5 -4
  43. package/lib/internal/template/radio-group/radio-button.js.map +1 -1
  44. package/lib/internal/template/radio-group/style.d.ts +11 -0
  45. package/lib/internal/template/radio-group/style.d.ts.map +1 -0
  46. package/lib/internal/template/radio-group/style.js +50 -0
  47. package/lib/internal/template/radio-group/style.js.map +1 -0
  48. package/lib/internal/template/radio-group/styles.css.js +10 -10
  49. package/lib/internal/template/radio-group/styles.scoped.css +22 -21
  50. package/lib/internal/template/radio-group/styles.selectors.js +10 -10
  51. package/lib/internal/template/toggle/interfaces.d.ts +36 -0
  52. package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
  53. package/lib/internal/template/toggle/interfaces.js.map +1 -1
  54. package/lib/internal/template/toggle/internal.d.ts.map +1 -1
  55. package/lib/internal/template/toggle/internal.js +3 -2
  56. package/lib/internal/template/toggle/internal.js.map +1 -1
  57. package/lib/internal/template/toggle/style.d.ts +4 -0
  58. package/lib/internal/template/toggle/style.d.ts.map +1 -0
  59. package/lib/internal/template/toggle/style.js +37 -0
  60. package/lib/internal/template/toggle/style.js.map +1 -0
  61. package/lib/internal/template/toggle/styles.css.js +10 -10
  62. package/lib/internal/template/toggle/styles.scoped.css +23 -22
  63. package/lib/internal/template/toggle/styles.selectors.js +10 -10
  64. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (38348b21)",
4
- "GIT_SHA": "38348b21",
3
+ "PACKAGE_VERSION": "3.0.0 (8d13105b)",
4
+ "GIT_SHA": "8d13105b",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -0,0 +1,2 @@
1
+ export declare function getComputedAbstractSwitchState(checked: boolean | undefined, disabled: boolean | undefined, readOnly: boolean | undefined, indeterminate: boolean | undefined, defaultValue?: string): string;
2
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/style.ts"],"names":[],"mappings":"AAEA,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,EAClC,YAAY,GAAE,MAAkB,UAiBjC"}
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export function getComputedAbstractSwitchState(checked, disabled, readOnly, indeterminate, defaultValue = 'default') {
4
+ let computedState;
5
+ if (disabled) {
6
+ computedState = 'disabled';
7
+ }
8
+ else if (readOnly) {
9
+ computedState = 'readOnly';
10
+ }
11
+ else if (indeterminate) {
12
+ computedState = 'indeterminate';
13
+ }
14
+ else if (checked) {
15
+ computedState = 'checked';
16
+ }
17
+ else {
18
+ computedState = defaultValue;
19
+ }
20
+ return computedState;
21
+ }
22
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/internal/utils/style.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,MAAM,UAAU,8BAA8B,CAC5C,OAA4B,EAC5B,QAA6B,EAC7B,QAA6B,EAC7B,aAAkC,EAClC,eAAuB,SAAS;IAEhC,IAAI,aAAa,CAAC;IAElB,IAAI,QAAQ,EAAE;QACZ,aAAa,GAAG,UAAU,CAAC;KAC5B;SAAM,IAAI,QAAQ,EAAE;QACnB,aAAa,GAAG,UAAU,CAAC;KAC5B;SAAM,IAAI,aAAa,EAAE;QACxB,aAAa,GAAG,eAAe,CAAC;KACjC;SAAM,IAAI,OAAO,EAAE;QAClB,aAAa,GAAG,SAAS,CAAC;KAC3B;SAAM;QACL,aAAa,GAAG,YAAY,CAAC;KAC9B;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function getComputedAbstractSwitchState(\n checked: boolean | undefined,\n disabled: boolean | undefined,\n readOnly: boolean | undefined,\n indeterminate: boolean | undefined,\n defaultValue: string = 'default'\n) {\n let computedState;\n\n if (disabled) {\n computedState = 'disabled';\n } else if (readOnly) {\n computedState = 'readOnly';\n } else if (indeterminate) {\n computedState = 'indeterminate';\n } else if (checked) {\n computedState = 'checked';\n } else {\n computedState = defaultValue;\n }\n\n return computedState;\n}\n"]}
@@ -51,6 +51,11 @@ export interface RadioGroupProps extends BaseComponentProps, FormFieldControlPro
51
51
  * being included in a form submission. A read-only control is still focusable.
52
52
  */
53
53
  readOnly?: boolean;
54
+ /**
55
+ * Specifies an object of selectors and properties that are used to apply custom styles.
56
+ * @awsuiSystem core
57
+ */
58
+ style?: RadioGroupProps.Style;
54
59
  }
55
60
  export declare namespace RadioGroupProps {
56
61
  interface RadioButtonDefinition {
@@ -69,5 +74,48 @@ export declare namespace RadioGroupProps {
69
74
  */
70
75
  focus(): void;
71
76
  }
77
+ interface Style {
78
+ input?: {
79
+ fill?: {
80
+ checked?: string;
81
+ default?: string;
82
+ disabled?: string;
83
+ readOnly?: string;
84
+ };
85
+ stroke?: {
86
+ default?: string;
87
+ disabled?: string;
88
+ readOnly?: string;
89
+ };
90
+ circle?: {
91
+ fill?: {
92
+ checked?: string;
93
+ disabled?: string;
94
+ readOnly?: string;
95
+ };
96
+ };
97
+ focusRing?: {
98
+ borderColor?: string;
99
+ borderRadius?: string;
100
+ borderWidth?: string;
101
+ };
102
+ };
103
+ label?: {
104
+ color?: {
105
+ checked?: string;
106
+ default?: string;
107
+ disabled?: string;
108
+ readOnly?: string;
109
+ };
110
+ };
111
+ description?: {
112
+ color?: {
113
+ checked?: string;
114
+ default?: string;
115
+ disabled?: string;
116
+ readOnly?: string;
117
+ };
118
+ };
119
+ }
72
120
  }
73
121
  //# 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;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AAM,CAAC;gBACrB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;QACF,KAAK,CAAC,EAAE;YACN,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACH,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACH,CAAC;KACH;CACF"}
@@ -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\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"]}
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 * Specifies an object of selectors and properties that are used to apply custom styles.\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 +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;AAO/C,QAAA,MAAM,kBAAkB,+HAgEvB,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;AAS1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,QAAA,MAAM,kBAAkB,+HAkEvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -11,13 +11,13 @@ import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-gro
11
11
  import RadioButton from './radio-button';
12
12
  import styles from './styles.css.js';
13
13
  const InternalRadioGroup = React.forwardRef((_a, ref) => {
14
- var { name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef = null } = _a, props = __rest(_a, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "onChange", "readOnly", "__internalRootRef"]);
14
+ var { name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, style, __internalRootRef = null } = _a, props = __rest(_a, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "onChange", "readOnly", "style", "__internalRootRef"]);
15
15
  const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);
16
16
  const baseProps = getBaseProps(props);
17
17
  const generatedName = useUniqueId('awsui-radio-');
18
18
  const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
19
19
  return (React.createElement("div", Object.assign({ 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 &&
20
- items.map((item, index) => (React.createElement(RadioButton, Object.assign({ key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, 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 }, getAnalyticsMetadataAttribute(!item.disabled && !readOnly
20
+ items.map((item, index) => (React.createElement(RadioButton, Object.assign({ key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, 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
21
21
  ? {
22
22
  detail: {
23
23
  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,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AAO,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,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,IACd,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;YACzB,CAAC,CAAC;gBACE,MAAM,EAAE;oBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;oBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;iBAC+C;aACnE;YACH,CAAC,CAAC,EAAE,CACP,EACD,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 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 = null,\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 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 {...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,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,yBAAyB,M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,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,IACR,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;YACzB,CAAC,CAAC;gBACE,MAAM,EAAE;oBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;oBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;iBAC+C;aACnE;YACH,CAAC,CAAC,EAAE,CACP,EACD,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 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 style,\n __internalRootRef = null,\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 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"]}
@@ -7,6 +7,7 @@ interface RadioButtonProps extends RadioGroupProps.RadioButtonDefinition {
7
7
  onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;
8
8
  readOnly?: boolean;
9
9
  className?: string;
10
+ style?: RadioGroupProps.Style;
10
11
  }
11
12
  declare const _default: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
12
13
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,gBAAiB,SAAQ,eAAe,CAAC,qBAAqB;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;;AAED,wBAgFG"}
1
+ {"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,UAAU,gBAAiB,SAAQ,eAAe,CAAC,qBAAqB;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC;CAC/B;;AAED,wBAoFG"}
@@ -8,13 +8,14 @@ import { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-too
8
8
  import AbstractSwitch from '../internal/components/abstract-switch';
9
9
  import { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';
10
10
  import { fireNonCancelableEvent } from '../internal/events';
11
+ import { getAbstractSwitchStyles, getInnerCircleStyle, getOuterCircleStyle } from './style';
11
12
  import styles from './styles.css.js';
12
13
  export default React.forwardRef(function RadioButton(_a, ref) {
13
- var { name, label, value, checked, description, disabled, controlId, onChange, readOnly, className } = _a, rest = __rest(_a, ["name", "label", "value", "checked", "description", "disabled", "controlId", "onChange", "readOnly", "className"]);
14
+ var { name, label, value, checked, description, disabled, controlId, onChange, readOnly, className, style } = _a, rest = __rest(_a, ["name", "label", "value", "checked", "description", "disabled", "controlId", "onChange", "readOnly", "className", "style"]);
14
15
  const radioButtonRef = useRef(null);
15
16
  const mergedRefs = useMergeRefs(radioButtonRef, ref);
16
17
  const { tabIndex } = useSingleTabStopNavigation(radioButtonRef);
17
- return (React.createElement(AbstractSwitch, Object.assign({ className: clsx(styles.radio, description && styles['radio--has-description'], className), controlClassName: styles['radio-control'], outlineClassName: styles.outline, label: label, description: description, disabled: disabled, readOnly: readOnly, controlId: controlId }, copyAnalyticsMetadataAttribute(rest), { nativeControl: nativeControlProps => (React.createElement("input", Object.assign({}, nativeControlProps, { tabIndex: tabIndex, type: "radio", ref: mergedRefs, name: name, value: value, checked: checked, "aria-disabled": readOnly && !disabled ? 'true' : undefined,
18
+ return (React.createElement(AbstractSwitch, Object.assign({ className: clsx(styles.radio, description && styles['radio--has-description'], className), controlClassName: styles['radio-control'], outlineClassName: styles.outline, label: label, description: description, disabled: disabled, readOnly: readOnly, controlId: controlId, style: getAbstractSwitchStyles(style, checked, disabled, readOnly) }, copyAnalyticsMetadataAttribute(rest), { nativeControl: nativeControlProps => (React.createElement("input", Object.assign({}, nativeControlProps, { tabIndex: tabIndex, type: "radio", ref: mergedRefs, name: name, value: value, checked: checked, "aria-disabled": readOnly && !disabled ? 'true' : undefined,
18
19
  // empty handler to suppress React controllability warning
19
20
  onChange: () => { } }))), onClick: () => {
20
21
  var _a;
@@ -27,11 +28,11 @@ export default React.forwardRef(function RadioButton(_a, ref) {
27
28
  React.createElement("circle", { className: clsx(styles['styled-circle-border'], {
28
29
  [styles['styled-circle-disabled']]: disabled,
29
30
  [styles['styled-circle-readonly']]: readOnly,
30
- }), strokeWidth: 6.25, cx: 50, cy: 50, r: 46 }),
31
+ }), strokeWidth: 6.25, cx: 50, cy: 50, r: 46, style: getOuterCircleStyle(style, checked, disabled, readOnly) }),
31
32
  React.createElement("circle", { className: clsx(styles['styled-circle-fill'], {
32
33
  [styles['styled-circle-disabled']]: disabled,
33
34
  [styles['styled-circle-checked']]: checked,
34
35
  [styles['styled-circle-readonly']]: readOnly,
35
- }), strokeWidth: 30, cx: 50, cy: 50, r: 35 })) })));
36
+ }), strokeWidth: 30, cx: 50, cy: 50, r: 35, style: getInnerCircleStyle(style, checked, disabled, readOnly) })) })));
36
37
  });
37
38
  //# sourceMappingURL=radio-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AAGvF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAClD,EAYmB,EACnB,GAAgC;QAbhC,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,OAEQ,EADd,IAAI,cAXT,kHAYC,CADQ;IAIT,MAAM,cAAc,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,YAAY,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAErD,MAAM,EAAE,QAAQ,EAAE,GAAG,0BAA0B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AAQ;iBAC7C,CAAC,EACF,WAAW,EAAE,IAAI,EACjB,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,EAAE,GACL;YACF,gCACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE;oBAC5C,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,EAAE,QAAQ;oBAC5C,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,OAAO;oBAC1C,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,EAAE,QAAQ;iBAC7C,CAAC,EACF,WAAW,EAAE,EAAE,EACf,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,EAAE,GACL,CACE,IAER,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { RadioGroupProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface RadioButtonProps extends RadioGroupProps.RadioButtonDefinition {\n name: string;\n checked: boolean;\n onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;\n readOnly?: boolean;\n className?: string;\n}\n\nexport default React.forwardRef(function RadioButton(\n {\n name,\n label,\n value,\n checked,\n description,\n disabled,\n controlId,\n onChange,\n readOnly,\n className,\n ...rest\n }: RadioButtonProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const radioButtonRef = useRef<HTMLInputElement>(null);\n const mergedRefs = useMergeRefs(radioButtonRef, ref);\n\n const { tabIndex } = useSingleTabStopNavigation(radioButtonRef);\n\n return (\n <AbstractSwitch\n className={clsx(styles.radio, description && styles['radio--has-description'], className)}\n controlClassName={styles['radio-control']}\n outlineClassName={styles.outline}\n label={label}\n description={description}\n disabled={disabled}\n readOnly={readOnly}\n controlId={controlId}\n {...copyAnalyticsMetadataAttribute(rest)}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n tabIndex={tabIndex}\n type=\"radio\"\n ref={mergedRefs}\n name={name}\n value={value}\n checked={checked}\n aria-disabled={readOnly && !disabled ? 'true' : undefined}\n // empty handler to suppress React controllability warning\n onChange={() => {}}\n />\n )}\n onClick={() => {\n radioButtonRef.current?.focus();\n if (checked) {\n return;\n }\n fireNonCancelableEvent(onChange, { value });\n }}\n styledControl={\n <svg viewBox=\"0 0 100 100\" focusable=\"false\" aria-hidden=\"true\">\n <circle\n className={clsx(styles['styled-circle-border'], {\n [styles['styled-circle-disabled']]: disabled,\n [styles['styled-circle-readonly']]: readOnly,\n })}\n strokeWidth={6.25}\n cx={50}\n cy={50}\n r={46}\n />\n <circle\n className={clsx(styles['styled-circle-fill'], {\n [styles['styled-circle-disabled']]: disabled,\n [styles['styled-circle-checked']]: checked,\n [styles['styled-circle-readonly']]: readOnly,\n })}\n strokeWidth={30}\n cx={50}\n cy={50}\n r={35}\n />\n </svg>\n }\n />\n );\n});\n"]}
1
+ {"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,O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EAAE,EAAE,EACN,CAAC,EAAE,EAAE,EACL,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAC9D,CACE,IAER,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { RadioGroupProps } from './interfaces';\nimport { getAbstractSwitchStyles, getInnerCircleStyle, getOuterCircleStyle } from './style';\n\nimport styles from './styles.css.js';\n\ninterface RadioButtonProps extends RadioGroupProps.RadioButtonDefinition {\n name: string;\n checked: boolean;\n onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;\n readOnly?: boolean;\n className?: string;\n style?: RadioGroupProps.Style;\n}\n\nexport default React.forwardRef(function RadioButton(\n {\n name,\n label,\n value,\n checked,\n description,\n disabled,\n controlId,\n onChange,\n readOnly,\n className,\n style,\n ...rest\n }: RadioButtonProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const radioButtonRef = useRef<HTMLInputElement>(null);\n const mergedRefs = useMergeRefs(radioButtonRef, ref);\n\n const { tabIndex } = useSingleTabStopNavigation(radioButtonRef);\n\n return (\n <AbstractSwitch\n className={clsx(styles.radio, description && styles['radio--has-description'], className)}\n controlClassName={styles['radio-control']}\n outlineClassName={styles.outline}\n label={label}\n description={description}\n disabled={disabled}\n readOnly={readOnly}\n controlId={controlId}\n style={getAbstractSwitchStyles(style, checked, disabled, readOnly)}\n {...copyAnalyticsMetadataAttribute(rest)}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n tabIndex={tabIndex}\n type=\"radio\"\n ref={mergedRefs}\n name={name}\n value={value}\n checked={checked}\n aria-disabled={readOnly && !disabled ? 'true' : undefined}\n // empty handler to suppress React controllability warning\n onChange={() => {}}\n />\n )}\n onClick={() => {\n radioButtonRef.current?.focus();\n if (checked) {\n return;\n }\n fireNonCancelableEvent(onChange, { value });\n }}\n styledControl={\n <svg viewBox=\"0 0 100 100\" focusable=\"false\" aria-hidden=\"true\">\n <circle\n className={clsx(styles['styled-circle-border'], {\n [styles['styled-circle-disabled']]: disabled,\n [styles['styled-circle-readonly']]: readOnly,\n })}\n strokeWidth={6.25}\n cx={50}\n cy={50}\n r={46}\n style={getOuterCircleStyle(style, checked, disabled, readOnly)}\n />\n <circle\n className={clsx(styles['styled-circle-fill'], {\n [styles['styled-circle-disabled']]: disabled,\n [styles['styled-circle-checked']]: checked,\n [styles['styled-circle-readonly']]: readOnly,\n })}\n strokeWidth={30}\n cx={50}\n cy={50}\n r={35}\n style={getInnerCircleStyle(style, checked, disabled, readOnly)}\n />\n </svg>\n }\n />\n );\n});\n"]}
@@ -0,0 +1,11 @@
1
+ import { RadioGroupProps } from './interfaces';
2
+ export declare function getOuterCircleStyle(style: RadioGroupProps.Style | undefined, checked: boolean | undefined, disabled: boolean | undefined, readOnly: boolean | undefined): {
3
+ fill: string | undefined;
4
+ stroke: string | undefined;
5
+ } | undefined;
6
+ export declare function getInnerCircleStyle(style: RadioGroupProps.Style | undefined, checked: boolean | undefined, disabled: boolean | undefined, readOnly: boolean | undefined): {
7
+ fill: string | undefined;
8
+ stroke: string | undefined;
9
+ } | undefined;
10
+ export declare function getAbstractSwitchStyles(style: RadioGroupProps.Style | undefined, checked: boolean | undefined, disabled: boolean | undefined, readOnly: boolean | undefined): {};
11
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/radio-group/style.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,SAAS,EACxC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS;;;cAc9B;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,SAAS,EACxC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS;;;cAc9B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,SAAS,EACxC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,MAwB9B"}
@@ -0,0 +1,50 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { SYSTEM } from '../internal/environment';
4
+ import { getComputedAbstractSwitchState } from '../internal/utils/style';
5
+ export function getOuterCircleStyle(style, checked, disabled, readOnly) {
6
+ var _a, _b;
7
+ let properties;
8
+ if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.input)) {
9
+ const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);
10
+ properties = {
11
+ fill: ((_a = style.input) === null || _a === void 0 ? void 0 : _a.fill) && style.input.fill[computedState],
12
+ stroke: ((_b = style.input) === null || _b === void 0 ? void 0 : _b.stroke) && style.input.stroke[computedState],
13
+ };
14
+ }
15
+ return properties;
16
+ }
17
+ export function getInnerCircleStyle(style, checked, disabled, readOnly) {
18
+ var _a, _b, _c;
19
+ let properties;
20
+ if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.input)) {
21
+ const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);
22
+ properties = {
23
+ fill: ((_b = (_a = style.input) === null || _a === void 0 ? void 0 : _a.circle) === null || _b === void 0 ? void 0 : _b.fill) && style.input.circle.fill[computedState],
24
+ stroke: ((_c = style.input) === null || _c === void 0 ? void 0 : _c.fill) && style.input.fill[computedState],
25
+ };
26
+ }
27
+ return properties;
28
+ }
29
+ export function getAbstractSwitchStyles(style, checked, disabled, readOnly) {
30
+ var _a, _b, _c, _d, _e, _f, _g, _h;
31
+ let properties = {};
32
+ if (SYSTEM === 'core' && ((style === null || style === void 0 ? void 0 : style.label) || (style === null || style === void 0 ? void 0 : style.description) || (style === null || style === void 0 ? void 0 : style.input))) {
33
+ const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);
34
+ properties = {
35
+ label: {
36
+ color: ((_a = style === null || style === void 0 ? void 0 : style.label) === null || _a === void 0 ? void 0 : _a.color) && style.label.color[computedState],
37
+ },
38
+ description: {
39
+ color: ((_b = style === null || style === void 0 ? void 0 : style.description) === null || _b === void 0 ? void 0 : _b.color) && style.description.color[computedState],
40
+ },
41
+ focusRing: {
42
+ borderColor: (_d = (_c = style === null || style === void 0 ? void 0 : style.input) === null || _c === void 0 ? void 0 : _c.focusRing) === null || _d === void 0 ? void 0 : _d.borderColor,
43
+ borderRadius: (_f = (_e = style === null || style === void 0 ? void 0 : style.input) === null || _e === void 0 ? void 0 : _e.focusRing) === null || _f === void 0 ? void 0 : _f.borderRadius,
44
+ borderWidth: (_h = (_g = style === null || style === void 0 ? void 0 : style.input) === null || _g === void 0 ? void 0 : _g.focusRing) === null || _h === void 0 ? void 0 : _h.borderWidth,
45
+ },
46
+ };
47
+ }
48
+ return properties;
49
+ }
50
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/radio-group/style.tsx"],"names":[],"mappings":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ClD;SACF,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport { getComputedAbstractSwitchState } from '../internal/utils/style';\nimport { RadioGroupProps } from './interfaces';\n\nexport function getOuterCircleStyle(\n style: RadioGroupProps.Style | undefined,\n checked: boolean | undefined,\n disabled: boolean | undefined,\n readOnly: boolean | undefined\n) {\n let properties;\n\n if (SYSTEM === 'core' && style?.input) {\n const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);\n\n properties = {\n fill: style.input?.fill && style.input.fill[computedState as keyof typeof style.input.fill],\n stroke: style.input?.stroke && style.input.stroke[computedState as keyof typeof style.input.stroke],\n };\n }\n\n return properties;\n}\n\nexport function getInnerCircleStyle(\n style: RadioGroupProps.Style | undefined,\n checked: boolean | undefined,\n disabled: boolean | undefined,\n readOnly: boolean | undefined\n) {\n let properties;\n\n if (SYSTEM === 'core' && style?.input) {\n const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);\n\n properties = {\n fill: style.input?.circle?.fill && style.input.circle.fill[computedState as keyof typeof style.input.circle.fill],\n stroke: style.input?.fill && style.input.fill[computedState as keyof typeof style.input.fill],\n };\n }\n\n return properties;\n}\n\nexport function getAbstractSwitchStyles(\n style: RadioGroupProps.Style | undefined,\n checked: boolean | undefined,\n disabled: boolean | undefined,\n readOnly: boolean | undefined\n) {\n let properties = {};\n\n if (SYSTEM === 'core' && (style?.label || style?.description || style?.input)) {\n const computedState = getComputedAbstractSwitchState(checked, disabled, readOnly, undefined);\n\n properties = {\n label: {\n color: style?.label?.color && style.label.color[computedState as keyof typeof style.label.color],\n },\n description: {\n color:\n style?.description?.color && style.description.color[computedState as keyof typeof style.description.color],\n },\n focusRing: {\n borderColor: style?.input?.focusRing?.borderColor,\n borderRadius: style?.input?.focusRing?.borderRadius,\n borderWidth: style?.input?.focusRing?.borderWidth,\n },\n };\n }\n\n return properties;\n}\n"]}
@@ -1,15 +1,15 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1mabk_xvogc_145",
5
- "radio": "awsui_radio_1mabk_xvogc_178",
6
- "radio--has-description": "awsui_radio--has-description_1mabk_xvogc_186",
7
- "radio-control": "awsui_radio-control_1mabk_xvogc_190",
8
- "outline": "awsui_outline_1mabk_xvogc_198",
9
- "styled-circle-border": "awsui_styled-circle-border_1mabk_xvogc_220",
10
- "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_xvogc_224",
11
- "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_xvogc_224",
12
- "styled-circle-fill": "awsui_styled-circle-fill_1mabk_xvogc_229",
13
- "styled-circle-checked": "awsui_styled-circle-checked_1mabk_xvogc_245"
4
+ "root": "awsui_root_1mabk_1undf_145",
5
+ "radio": "awsui_radio_1mabk_1undf_178",
6
+ "radio--has-description": "awsui_radio--has-description_1mabk_1undf_186",
7
+ "radio-control": "awsui_radio-control_1mabk_1undf_190",
8
+ "outline": "awsui_outline_1mabk_1undf_198",
9
+ "styled-circle-border": "awsui_styled-circle-border_1mabk_1undf_221",
10
+ "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_1undf_225",
11
+ "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_1undf_225",
12
+ "styled-circle-fill": "awsui_styled-circle-fill_1mabk_1undf_230",
13
+ "styled-circle-checked": "awsui_styled-circle-checked_1mabk_1undf_246"
14
14
  };
15
15
 
@@ -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_xvogc_145:not(#\9) {
145
+ .awsui_root_1mabk_1undf_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -175,19 +175,19 @@ 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_xvogc_178:not(#\9) {
178
+ .awsui_radio_1mabk_1undf_178:not(#\9) {
179
179
  /*used in test-utils*/
180
180
  }
181
181
 
182
- .awsui_radio_1mabk_xvogc_178 + .awsui_radio_1mabk_xvogc_178:not(#\9) {
182
+ .awsui_radio_1mabk_1undf_178 + .awsui_radio_1mabk_1undf_178:not(#\9) {
183
183
  margin-block-start: var(--space-scaled-xxs-jatbiv, 4px);
184
184
  }
185
185
 
186
- .awsui_radio--has-description_1mabk_xvogc_186 + .awsui_radio_1mabk_xvogc_178:not(#\9) {
186
+ .awsui_radio--has-description_1mabk_1undf_186 + .awsui_radio_1mabk_1undf_178:not(#\9) {
187
187
  margin-block-start: var(--space-scaled-xs-sppte9, 8px);
188
188
  }
189
189
 
190
- .awsui_radio-control_1mabk_xvogc_190:not(#\9) {
190
+ .awsui_radio-control_1mabk_1undf_190:not(#\9) {
191
191
  margin-block-start: calc((var(--line-height-body-m-bedeoh, 22px) - var(--size-control-lkpwjy, 14px)) / 2);
192
192
  min-block-size: var(--size-control-lkpwjy, 14px);
193
193
  min-inline-size: var(--size-control-lkpwjy, 14px);
@@ -195,14 +195,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
195
195
  inline-size: var(--size-control-lkpwjy, 14px);
196
196
  }
197
197
 
198
- .awsui_outline_1mabk_xvogc_198:not(#\9) {
198
+ .awsui_outline_1mabk_1undf_198:not(#\9) {
199
+ --awsui-style-focus-ring-box-shadow-kcc2gu: 0 0 0 var(--awsui-style-focus-ring-border-width-kcc2gu, 2px) var(--awsui-style-focus-ring-border-color-kcc2gu, var(--color-border-item-focused-r5f6xl, #0073bb));
199
200
  position: relative;
200
201
  }
201
- .awsui_outline_1mabk_xvogc_198:not(#\9) {
202
+ .awsui_outline_1mabk_1undf_198:not(#\9) {
202
203
  outline: 2px dotted transparent;
203
204
  outline-offset: calc(2px - 1px);
204
205
  }
205
- .awsui_outline_1mabk_xvogc_198:not(#\9)::before {
206
+ .awsui_outline_1mabk_1undf_198:not(#\9)::before {
206
207
  content: " ";
207
208
  display: block;
208
209
  position: absolute;
@@ -210,46 +211,46 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
210
211
  inset-block-start: calc(-1 * 2px);
211
212
  inline-size: calc(100% + 2px + 2px);
212
213
  block-size: calc(100% + 2px + 2px);
213
- border-start-start-radius: var(--border-radius-control-circular-focus-ring-0v2apg, 50%);
214
- border-start-end-radius: var(--border-radius-control-circular-focus-ring-0v2apg, 50%);
215
- border-end-start-radius: var(--border-radius-control-circular-focus-ring-0v2apg, 50%);
216
- border-end-end-radius: var(--border-radius-control-circular-focus-ring-0v2apg, 50%);
217
- box-shadow: 0 0 0 2px var(--color-border-item-focused-r5f6xl, #0073bb);
214
+ border-start-start-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
215
+ border-start-end-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
216
+ border-end-start-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
217
+ border-end-end-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
218
+ box-shadow: var(--awsui-style-focus-ring-box-shadow-kcc2gu);
218
219
  }
219
220
 
220
- .awsui_styled-circle-border_1mabk_xvogc_220:not(#\9) {
221
+ .awsui_styled-circle-border_1mabk_1undf_221:not(#\9) {
221
222
  stroke: var(--color-border-control-default-e686ow, #687078);
222
223
  fill: var(--color-background-control-default-wjdczs, #ffffff);
223
224
  }
224
- .awsui_styled-circle-border_1mabk_xvogc_220.awsui_styled-circle-disabled_1mabk_xvogc_224:not(#\9), .awsui_styled-circle-border_1mabk_xvogc_220.awsui_styled-circle-readonly_1mabk_xvogc_224:not(#\9) {
225
+ .awsui_styled-circle-border_1mabk_1undf_221.awsui_styled-circle-disabled_1mabk_1undf_225:not(#\9), .awsui_styled-circle-border_1mabk_1undf_221.awsui_styled-circle-readonly_1mabk_1undf_225:not(#\9) {
225
226
  fill: var(--color-background-control-disabled-2ixett, #d5dbdb);
226
227
  stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
227
228
  }
228
229
 
229
- .awsui_styled-circle-fill_1mabk_xvogc_229:not(#\9) {
230
+ .awsui_styled-circle-fill_1mabk_1undf_230:not(#\9) {
230
231
  stroke: var(--color-background-control-checked-se0x0e, #0073bb);
231
232
  fill: var(--color-foreground-control-default-rf7v4a, #ffffff);
232
233
  opacity: 0;
233
234
  transition: opacity var(--motion-duration-transition-quick-ucajl5, 90ms) var(--motion-easing-transition-quick-034duw, linear);
234
235
  }
235
236
  @media (prefers-reduced-motion: reduce) {
236
- .awsui_styled-circle-fill_1mabk_xvogc_229:not(#\9) {
237
+ .awsui_styled-circle-fill_1mabk_1undf_230:not(#\9) {
237
238
  animation: none;
238
239
  transition: none;
239
240
  }
240
241
  }
241
- .awsui-motion-disabled .awsui_styled-circle-fill_1mabk_xvogc_229:not(#\9), .awsui-mode-entering .awsui_styled-circle-fill_1mabk_xvogc_229:not(#\9) {
242
+ .awsui-motion-disabled .awsui_styled-circle-fill_1mabk_1undf_230:not(#\9), .awsui-mode-entering .awsui_styled-circle-fill_1mabk_1undf_230:not(#\9) {
242
243
  animation: none;
243
244
  transition: none;
244
245
  }
245
- .awsui_styled-circle-fill_1mabk_xvogc_229.awsui_styled-circle-checked_1mabk_xvogc_245:not(#\9) {
246
+ .awsui_styled-circle-fill_1mabk_1undf_230.awsui_styled-circle-checked_1mabk_1undf_246:not(#\9) {
246
247
  opacity: 1;
247
248
  }
248
- .awsui_styled-circle-fill_1mabk_xvogc_229.awsui_styled-circle-disabled_1mabk_xvogc_224:not(#\9) {
249
+ .awsui_styled-circle-fill_1mabk_1undf_230.awsui_styled-circle-disabled_1mabk_1undf_225:not(#\9) {
249
250
  fill: var(--color-foreground-control-disabled-kj751b, #ffffff);
250
251
  stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
251
252
  }
252
- .awsui_styled-circle-fill_1mabk_xvogc_229.awsui_styled-circle-readonly_1mabk_xvogc_224:not(#\9) {
253
+ .awsui_styled-circle-fill_1mabk_1undf_230.awsui_styled-circle-readonly_1mabk_1undf_225:not(#\9) {
253
254
  fill: var(--color-foreground-control-read-only-cgy3yn, #687078);
254
255
  stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
255
256
  }
@@ -2,15 +2,15 @@
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_xvogc_145",
6
- "radio": "awsui_radio_1mabk_xvogc_178",
7
- "radio--has-description": "awsui_radio--has-description_1mabk_xvogc_186",
8
- "radio-control": "awsui_radio-control_1mabk_xvogc_190",
9
- "outline": "awsui_outline_1mabk_xvogc_198",
10
- "styled-circle-border": "awsui_styled-circle-border_1mabk_xvogc_220",
11
- "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_xvogc_224",
12
- "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_xvogc_224",
13
- "styled-circle-fill": "awsui_styled-circle-fill_1mabk_xvogc_229",
14
- "styled-circle-checked": "awsui_styled-circle-checked_1mabk_xvogc_245"
5
+ "root": "awsui_root_1mabk_1undf_145",
6
+ "radio": "awsui_radio_1mabk_1undf_178",
7
+ "radio--has-description": "awsui_radio--has-description_1mabk_1undf_186",
8
+ "radio-control": "awsui_radio-control_1mabk_1undf_190",
9
+ "outline": "awsui_outline_1mabk_1undf_198",
10
+ "styled-circle-border": "awsui_styled-circle-border_1mabk_1undf_221",
11
+ "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_1undf_225",
12
+ "styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_1undf_225",
13
+ "styled-circle-fill": "awsui_styled-circle-fill_1mabk_1undf_230",
14
+ "styled-circle-checked": "awsui_styled-circle-checked_1mabk_1undf_246"
15
15
  };
16
16
 
@@ -8,6 +8,11 @@ export interface ToggleProps extends BaseCheckboxProps {
8
8
  */
9
9
  children?: React.ReactNode;
10
10
  onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>;
11
+ /**
12
+ * Specifies an object of selectors and properties that are used to apply custom styles.
13
+ * @awsuiSystem core
14
+ */
15
+ style?: ToggleProps.Style;
11
16
  }
12
17
  export declare namespace ToggleProps {
13
18
  interface Ref {
@@ -19,5 +24,36 @@ export declare namespace ToggleProps {
19
24
  interface ChangeDetail {
20
25
  checked: boolean;
21
26
  }
27
+ interface Style {
28
+ input: {
29
+ background?: {
30
+ checked?: string;
31
+ default?: string;
32
+ disabled?: string;
33
+ readOnly?: string;
34
+ };
35
+ handle?: {
36
+ background?: {
37
+ checked?: string;
38
+ default?: string;
39
+ disabled?: string;
40
+ readOnly?: string;
41
+ };
42
+ };
43
+ focusRing?: {
44
+ borderColor?: string;
45
+ borderRadius?: string;
46
+ borderWidth?: string;
47
+ };
48
+ };
49
+ label?: {
50
+ color?: {
51
+ checked?: string;
52
+ default?: string;
53
+ disabled?: string;
54
+ readOnly?: string;
55
+ };
56
+ };
57
+ }
22
58
  }
23
59
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/toggle/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CA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oBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;iBACnB,CAAC;aACH,CAAC;YACF,SAAS,CAAC,EAAE;gBACV,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;QACF,KAAK,CAAC,EAAE;YACN,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACH,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/toggle/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 { BaseCheckboxProps } from '../checkbox/base-checkbox';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface ToggleProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the toggle. Clicking this will invoke a state change.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /*\n * Called when the user changes their selection.\n * The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>;\n}\n\nexport namespace ToggleProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/toggle/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 { BaseCheckboxProps } from '../checkbox/base-checkbox';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface ToggleProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the toggle. Clicking this will invoke a state change.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /*\n * Called when the user changes their selection.\n * The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>;\n\n /**\n * Specifies an object of selectors and properties that are used to apply custom styles.\n * @awsuiSystem core\n */\n style?: ToggleProps.Style;\n}\n\nexport namespace ToggleProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n }\n\n export interface Style {\n input: {\n background?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n handle?: {\n background?: {\n checked?: string;\n default?: 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 }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAatC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,UAAU,mBAAoB,SAAQ,WAAW,EAAE,0BAA0B;IAC3E,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED,QAAA,MAAM,cAAc,6FAgGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAatC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,UAAU,mBAAoB,SAAQ,WAAW,EAAE,0BAA0B;IAC3E,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED,QAAA,MAAM,cAAc,6FAmGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}