@cloudscape-design/components-themeable 3.0.65 → 3.0.66

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 (120) hide show
  1. package/lib/internal/scss/internal/styles/typography/mixins.scss +9 -0
  2. package/lib/internal/scss/link/styles.scss +11 -1
  3. package/lib/internal/scss/popover/body.scss +0 -36
  4. package/lib/internal/scss/popover/container.scss +41 -0
  5. package/lib/internal/template/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  6. package/lib/internal/template/annotation-context/annotation/annotation-popover.js +2 -2
  7. package/lib/internal/template/annotation-context/annotation/annotation-popover.js.map +1 -1
  8. package/lib/internal/template/autosuggest/interfaces.d.ts +2 -2
  9. package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
  10. package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
  11. package/lib/internal/template/button-dropdown/tooltip.js +2 -2
  12. package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
  13. package/lib/internal/template/calendar/interfaces.d.ts +2 -1
  14. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
  15. package/lib/internal/template/calendar/interfaces.js.map +1 -1
  16. package/lib/internal/template/calendar/internal.d.ts +2 -1
  17. package/lib/internal/template/calendar/internal.d.ts.map +1 -1
  18. package/lib/internal/template/calendar/internal.js +8 -3
  19. package/lib/internal/template/calendar/internal.js.map +1 -1
  20. package/lib/internal/template/cards/index.d.ts.map +1 -1
  21. package/lib/internal/template/cards/index.js +15 -5
  22. package/lib/internal/template/cards/index.js.map +1 -1
  23. package/lib/internal/template/checkbox/base-checkbox.d.ts +1 -5
  24. package/lib/internal/template/checkbox/base-checkbox.d.ts.map +1 -1
  25. package/lib/internal/template/checkbox/base-checkbox.js.map +1 -1
  26. package/lib/internal/template/checkbox/internal.d.ts.map +1 -1
  27. package/lib/internal/template/checkbox/internal.js +3 -1
  28. package/lib/internal/template/checkbox/internal.js.map +1 -1
  29. package/lib/internal/template/container/internal.d.ts +2 -1
  30. package/lib/internal/template/container/internal.d.ts.map +1 -1
  31. package/lib/internal/template/container/internal.js +3 -2
  32. package/lib/internal/template/container/internal.js.map +1 -1
  33. package/lib/internal/template/date-input/index.d.ts.map +1 -1
  34. package/lib/internal/template/date-input/index.js +3 -4
  35. package/lib/internal/template/date-input/index.js.map +1 -1
  36. package/lib/internal/template/date-input/internal.d.ts.map +1 -1
  37. package/lib/internal/template/date-input/internal.js +2 -2
  38. package/lib/internal/template/date-input/internal.js.map +1 -1
  39. package/lib/internal/template/date-range-picker/calendar/index.js +2 -2
  40. package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
  41. package/lib/internal/template/form-field/internal.d.ts.map +1 -1
  42. package/lib/internal/template/form-field/internal.js +2 -2
  43. package/lib/internal/template/form-field/internal.js.map +1 -1
  44. package/lib/internal/template/index.d.ts +2 -0
  45. package/lib/internal/template/index.d.ts.map +1 -1
  46. package/lib/internal/template/index.js +2 -0
  47. package/lib/internal/template/index.js.map +1 -1
  48. package/lib/internal/template/input/interfaces.d.ts +11 -9
  49. package/lib/internal/template/input/interfaces.d.ts.map +1 -1
  50. package/lib/internal/template/input/interfaces.js.map +1 -1
  51. package/lib/internal/template/input/internal.d.ts +2 -2
  52. package/lib/internal/template/input/internal.d.ts.map +1 -1
  53. package/lib/internal/template/input/internal.js.map +1 -1
  54. package/lib/internal/template/internal/base-component/styles.scoped.css +2 -5
  55. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +2 -2
  56. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
  57. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  58. package/lib/internal/template/internal/components/chart-popover/index.js +2 -2
  59. package/lib/internal/template/internal/components/chart-popover/index.js.map +1 -1
  60. package/lib/internal/template/internal/components/checkbox-icon/styles.css.js +7 -7
  61. package/lib/internal/template/internal/components/checkbox-icon/styles.scoped.css +9 -9
  62. package/lib/internal/template/internal/components/checkbox-icon/styles.selectors.js +7 -7
  63. package/lib/internal/template/internal/environment.js +1 -1
  64. package/lib/internal/template/link/interfaces.d.ts +1 -1
  65. package/lib/internal/template/link/interfaces.d.ts.map +1 -1
  66. package/lib/internal/template/link/interfaces.js.map +1 -1
  67. package/lib/internal/template/link/styles.css.js +20 -19
  68. package/lib/internal/template/link/styles.scoped.css +75 -70
  69. package/lib/internal/template/link/styles.selectors.js +20 -19
  70. package/lib/internal/template/package.json +2 -0
  71. package/lib/internal/template/pie-chart/styles.css.js +27 -27
  72. package/lib/internal/template/pie-chart/styles.scoped.css +44 -44
  73. package/lib/internal/template/pie-chart/styles.selectors.js +27 -27
  74. package/lib/internal/template/popover/body.d.ts +1 -4
  75. package/lib/internal/template/popover/body.d.ts.map +1 -1
  76. package/lib/internal/template/popover/body.js +2 -4
  77. package/lib/internal/template/popover/body.js.map +1 -1
  78. package/lib/internal/template/popover/container.d.ts +4 -1
  79. package/lib/internal/template/popover/container.d.ts.map +1 -1
  80. package/lib/internal/template/popover/container.js +51 -37
  81. package/lib/internal/template/popover/container.js.map +1 -1
  82. package/lib/internal/template/popover/internal.js +2 -2
  83. package/lib/internal/template/popover/internal.js.map +1 -1
  84. package/lib/internal/template/popover/styles.css.js +49 -48
  85. package/lib/internal/template/popover/styles.scoped.css +209 -89
  86. package/lib/internal/template/popover/styles.selectors.js +49 -48
  87. package/lib/internal/template/popover/utils/positions.d.ts +1 -0
  88. package/lib/internal/template/popover/utils/positions.d.ts.map +1 -1
  89. package/lib/internal/template/popover/utils/positions.js +40 -14
  90. package/lib/internal/template/popover/utils/positions.js.map +1 -1
  91. package/lib/internal/template/radio-group/interfaces.d.ts +5 -0
  92. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  93. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  94. package/lib/internal/template/radio-group/styles.css.js +9 -9
  95. package/lib/internal/template/radio-group/styles.scoped.css +16 -16
  96. package/lib/internal/template/radio-group/styles.selectors.js +9 -9
  97. package/lib/internal/template/tag-editor/interfaces.d.ts +1 -1
  98. package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
  99. package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
  100. package/lib/internal/template/test-utils/dom/form-field/index.js +1 -1
  101. package/lib/internal/template/test-utils/dom/form-field/index.js.map +1 -1
  102. package/lib/internal/template/test-utils/dom/index.d.ts +6 -0
  103. package/lib/internal/template/test-utils/dom/index.js +18 -2
  104. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  105. package/lib/internal/template/test-utils/selectors/form-field/index.js +1 -1
  106. package/lib/internal/template/test-utils/selectors/form-field/index.js.map +1 -1
  107. package/lib/internal/template/test-utils/selectors/index.d.ts +6 -0
  108. package/lib/internal/template/test-utils/selectors/index.js +18 -2
  109. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  110. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  111. package/lib/internal/template/textarea/interfaces.d.ts +2 -2
  112. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  113. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  114. package/lib/internal/template/time-input/interfaces.d.ts +2 -2
  115. package/lib/internal/template/time-input/interfaces.d.ts.map +1 -1
  116. package/lib/internal/template/time-input/interfaces.js.map +1 -1
  117. package/lib/internal/template/toggle/internal.d.ts.map +1 -1
  118. package/lib/internal/template/toggle/internal.js +3 -1
  119. package/lib/internal/template/toggle/internal.js.map +1 -1
  120. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAExF,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,+BAA+B;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,yBAAiB,aAAa,CAAC;IAC7B,KAAY,SAAS,GAAG,aAAa,CAAC;IAEtC,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IACD,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1G,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,+BAA+B;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,yBAAiB,aAAa,CAAC;IAC7B,KAAY,SAAS,GAAG,aAAa,CAAC;IAEtC,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IACD,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseInputProps, InputAutoComplete, InputKeyEvents } from '../input/interfaces';\n\nexport interface TextareaProps\n extends BaseInputProps,\n InputKeyEvents,\n InputAutoComplete,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the number of lines of text to set the height to.\n */\n rows?: number;\n\n /**\n * Specifies whether to disable browser spellcheck feature.\n * If you set this to `true`, it disables native browser capability\n * that checks for spelling/grammar errors.\n * If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserSpellcheck?: boolean;\n}\n\nexport namespace TextareaProps {\n export type KeyDetail = BaseKeyDetail;\n\n export interface ChangeDetail {\n /**\n * The new value of this textarea.\n */\n value: string;\n }\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseInputProps, InputAutoCorrect, InputAutoComplete, InputKeyEvents } from '../input/interfaces';\n\nexport interface TextareaProps\n extends BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the number of lines of text to set the height to.\n */\n rows?: number;\n\n /**\n * Specifies whether to disable browser spellcheck feature.\n * If you set this to `true`, it disables native browser capability\n * that checks for spelling/grammar errors.\n * If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserSpellcheck?: boolean;\n}\n\nexport namespace TextareaProps {\n export type KeyDetail = BaseKeyDetail;\n\n export interface ChangeDetail {\n /**\n * The new value of this textarea.\n */\n value: string;\n }\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { BaseChangeDetail, BaseInputProps } from '../input/interfaces';
1
+ import { BaseChangeDetail, BaseInputProps, InputAutoCorrect } from '../input/interfaces';
2
2
  import { BaseComponentProps } from '../internal/base-component';
3
3
  import { FormFieldValidationControlProps } from '../internal/context/form-field-context';
4
- export interface TimeInputProps extends BaseInputProps, FormFieldValidationControlProps, BaseComponentProps {
4
+ export interface TimeInputProps extends BaseInputProps, InputAutoCorrect, FormFieldValidationControlProps, BaseComponentProps {
5
5
  /**
6
6
  * Specifies the format of the time input.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/time-input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAEzF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,+BAA+B,EAAE,kBAAkB;IACzG;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,yBAAiB,cAAc,CAAC;IAC9B,KAAY,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC;IACjD,KAAY,YAAY,GAAG,gBAAgB,CAAC;IAE5C,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/time-input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAEzF,MAAM,WAAW,cACf,SAAQ,cAAc,EACpB,gBAAgB,EAChB,+BAA+B,EAC/B,kBAAkB;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,yBAAiB,cAAc,CAAC;IAC9B,KAAY,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC;IACjD,KAAY,YAAY,GAAG,gBAAgB,CAAC;IAE5C,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/time-input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseChangeDetail, BaseInputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\n\nexport interface TimeInputProps extends BaseInputProps, FormFieldValidationControlProps, BaseComponentProps {\n /**\n * Specifies the format of the time input.\n *\n * Use it to restrict the granularity of time that the user can enter.\n */\n format?: TimeInputProps.Format;\n\n /**\n * Specifies whether the component should use 12-hour or 24-hour format.\n * When using 12-hour format, there is no option for picking AM or PM.\n */\n use24Hour?: boolean;\n\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for\n * example, for security-sensitive fields). To use it correctly, set the `name` property.\n */\n autoComplete?: boolean;\n}\n\nexport namespace TimeInputProps {\n export type Format = 'hh' | 'hh:mm' | 'hh:mm:ss';\n export type ChangeDetail = BaseChangeDetail;\n\n export interface Ref {\n /**\n * Sets input focus on the input control.\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/time-input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseChangeDetail, BaseInputProps, InputAutoCorrect } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\n\nexport interface TimeInputProps\n extends BaseInputProps,\n InputAutoCorrect,\n FormFieldValidationControlProps,\n BaseComponentProps {\n /**\n * Specifies the format of the time input.\n *\n * Use it to restrict the granularity of time that the user can enter.\n */\n format?: TimeInputProps.Format;\n\n /**\n * Specifies whether the component should use 12-hour or 24-hour format.\n * When using 12-hour format, there is no option for picking AM or PM.\n */\n use24Hour?: boolean;\n\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for\n * example, for security-sensitive fields). To use it correctly, set the `name` property.\n */\n autoComplete?: boolean;\n}\n\nexport namespace TimeInputProps {\n export type Format = 'hh' | 'hh:mm' | 'hh:mm:ss';\n export type ChangeDetail = BaseChangeDetail;\n\n export interface Ref {\n /**\n * Sets input focus on the input control.\n */\n focus(): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,QAAA,MAAM,cAAc,kHAiEnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,QAAA,MAAM,cAAc,kHAgEnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -8,9 +8,11 @@ import useForwardFocus from '../internal/hooks/forward-focus';
8
8
  import { fireNonCancelableEvent } from '../internal/events';
9
9
  import { getBaseProps } from '../internal/base-component';
10
10
  import styles from './styles.css.js';
11
+ import { useFormFieldContext } from '../internal/context/form-field-context';
11
12
  var InternalToggle = React.forwardRef(function (_a, ref) {
12
13
  var _b, _c;
13
- var controlId = _a.controlId, checked = _a.checked, name = _a.name, disabled = _a.disabled, children = _a.children, description = _a.description, ariaLabel = _a.ariaLabel, ariaDescribedby = _a.ariaDescribedby, ariaLabelledby = _a.ariaLabelledby, onFocus = _a.onFocus, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.__internalRootRef, __internalRootRef = _d === void 0 ? null : _d, rest = __rest(_a, ["controlId", "checked", "name", "disabled", "children", "description", "ariaLabel", "ariaDescribedby", "ariaLabelledby", "onFocus", "onBlur", "onChange", "__internalRootRef"]);
14
+ var controlId = _a.controlId, checked = _a.checked, name = _a.name, disabled = _a.disabled, children = _a.children, description = _a.description, ariaLabel = _a.ariaLabel, onFocus = _a.onFocus, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.__internalRootRef, __internalRootRef = _d === void 0 ? null : _d, rest = __rest(_a, ["controlId", "checked", "name", "disabled", "children", "description", "ariaLabel", "onFocus", "onBlur", "onChange", "__internalRootRef"]);
15
+ var _e = useFormFieldContext(rest), ariaDescribedby = _e.ariaDescribedby, ariaLabelledby = _e.ariaLabelledby;
14
16
  var baseProps = getBaseProps(rest);
15
17
  var checkboxRef = useRef(null);
16
18
  useForwardFocus(ref, checkboxRef);
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,IAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,UACE,EAeC,EACD,GAAG;;IAfD,IAAA,SAAS,eAAA,EACT,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,WAAW,iBAAA,EACX,SAAS,eAAA,EACT,eAAe,qBAAA,EACf,cAAc,oBAAA,EACd,OAAO,aAAA,EACP,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACrB,IAAI,cAdT,+KAeC,CADQ;IAIT,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,IAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IACnD,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClC,OAAO,CACL,oBAAC,cAAc,eACT,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAC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eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ToggleProps } from './interfaces';\n\ntype InternalToggleProps = ToggleProps & InternalBaseComponentProps;\n\nconst InternalToggle = React.forwardRef<ToggleProps.Ref, InternalToggleProps>(\n (\n {\n controlId,\n checked,\n name,\n disabled,\n children,\n description,\n ariaLabel,\n ariaDescribedby,\n ariaLabelledby,\n onFocus,\n onBlur,\n onChange,\n __internalRootRef = null,\n ...rest\n },\n ref\n ) => {\n const baseProps = getBaseProps(rest);\n const checkboxRef = useRef<HTMLInputElement>(null);\n useForwardFocus(ref, checkboxRef);\n return (\n <AbstractSwitch\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n controlClassName={clsx(styles['toggle-control'], {\n [styles['toggle-control-checked']]: checked,\n [styles['toggle-control-disabled']]: disabled,\n })}\n outlineClassName={styles.outline}\n controlId={controlId}\n disabled={disabled}\n label={children}\n description={description}\n descriptionBottomPadding={true}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n ref={checkboxRef}\n type=\"checkbox\"\n checked={checked}\n name={name}\n onFocus={onFocus && (() => fireNonCancelableEvent(onFocus))}\n onBlur={onBlur && (() => fireNonCancelableEvent(onBlur))}\n onChange={onChange && (event => fireNonCancelableEvent(onChange, { checked: event.target.checked }))}\n />\n )}\n styledControl={\n /*Using span, not div for HTML validity*/\n <span\n className={clsx(styles['toggle-handle'], {\n [styles['toggle-handle-checked']]: checked,\n [styles['toggle-handle-disabled']]: disabled,\n })}\n />\n }\n __internalRootRef={__internalRootRef}\n />\n );\n }\n);\n\nexport default InternalToggle;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/toggle/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAI7E,IAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,UACE,EAaC,EACD,GAAG;;IAbD,IAAA,SAAS,eAAA,EACT,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,WAAW,iBAAA,EACX,SAAS,eAAA,EACT,OAAO,aAAA,EACP,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACrB,IAAI,cAZT,0IAaC,CADQ;IAIH,IAAA,KAAsC,mBAAmB,CAAC,IAAI,CAAC,EAA7D,eAAe,qBAAA,EAAE,cAAc,oBAA8B,CAAC;IACtE,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,IAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IACnD,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClC,OAAO,CACL,oBAAC,cAAc,eACT,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAA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,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ToggleProps } from './interfaces';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\n\ntype InternalToggleProps = ToggleProps & InternalBaseComponentProps;\n\nconst InternalToggle = React.forwardRef<ToggleProps.Ref, InternalToggleProps>(\n (\n {\n controlId,\n checked,\n name,\n disabled,\n children,\n description,\n ariaLabel,\n onFocus,\n onBlur,\n onChange,\n __internalRootRef = null,\n ...rest\n },\n ref\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n const checkboxRef = useRef<HTMLInputElement>(null);\n useForwardFocus(ref, checkboxRef);\n return (\n <AbstractSwitch\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n controlClassName={clsx(styles['toggle-control'], {\n [styles['toggle-control-checked']]: checked,\n [styles['toggle-control-disabled']]: disabled,\n })}\n outlineClassName={styles.outline}\n controlId={controlId}\n disabled={disabled}\n label={children}\n description={description}\n descriptionBottomPadding={true}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n ref={checkboxRef}\n type=\"checkbox\"\n checked={checked}\n name={name}\n onFocus={onFocus && (() => fireNonCancelableEvent(onFocus))}\n onBlur={onBlur && (() => fireNonCancelableEvent(onBlur))}\n onChange={onChange && (event => fireNonCancelableEvent(onChange, { checked: event.target.checked }))}\n />\n )}\n styledControl={\n /*Using span, not div for HTML validity*/\n <span\n className={clsx(styles['toggle-handle'], {\n [styles['toggle-handle-checked']]: checked,\n [styles['toggle-handle-disabled']]: disabled,\n })}\n />\n }\n __internalRootRef={__internalRootRef}\n />\n );\n }\n);\n\nexport default InternalToggle;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.65",
3
+ "version": "3.0.66",
4
4
  "files": [
5
5
  "lib",
6
6
  "package.json",