@cloudscape-design/components 3.0.820 → 3.0.822

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 (65) hide show
  1. package/app-layout/utils/use-drawers.d.ts.map +1 -1
  2. package/app-layout/utils/use-drawers.js +5 -1
  3. package/app-layout/utils/use-drawers.js.map +1 -1
  4. package/file-upload/internal.d.ts.map +1 -1
  5. package/file-upload/internal.js +4 -4
  6. package/file-upload/internal.js.map +1 -1
  7. package/icon/generated/icons.d.ts +26 -0
  8. package/icon/generated/icons.d.ts.map +1 -1
  9. package/icon/generated/icons.js +81 -4
  10. package/icon/generated/icons.js.map +1 -1
  11. package/icon/interfaces.d.ts +1 -1
  12. package/icon/interfaces.d.ts.map +1 -1
  13. package/icon/interfaces.js.map +1 -1
  14. package/internal/components/file-input/index.d.ts +6 -0
  15. package/internal/components/file-input/index.d.ts.map +1 -0
  16. package/{file-upload → internal/components}/file-input/index.js +24 -16
  17. package/internal/components/file-input/index.js.map +1 -0
  18. package/internal/components/file-input/interfaces.d.ts +53 -0
  19. package/internal/components/file-input/interfaces.d.ts.map +1 -0
  20. package/internal/components/file-input/interfaces.js +2 -0
  21. package/internal/components/file-input/interfaces.js.map +1 -0
  22. package/internal/components/file-input/styles.css.js +10 -0
  23. package/{file-upload → internal/components}/file-input/styles.scoped.css +9 -12
  24. package/internal/components/file-input/styles.selectors.js +11 -0
  25. package/internal/environment.js +1 -1
  26. package/internal/environment.json +1 -1
  27. package/internal/manifest.json +1 -1
  28. package/package.json +1 -1
  29. package/s3-resource-selector/s3-modal/index.d.ts.map +1 -1
  30. package/s3-resource-selector/s3-modal/index.js +2 -1
  31. package/s3-resource-selector/s3-modal/index.js.map +1 -1
  32. package/s3-resource-selector/test-classes/styles.css.js +6 -0
  33. package/s3-resource-selector/test-classes/styles.scoped.css +7 -0
  34. package/s3-resource-selector/test-classes/styles.selectors.js +7 -0
  35. package/table/body-cell/disabled-inline-editor.d.ts +1 -1
  36. package/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  37. package/table/body-cell/disabled-inline-editor.js +4 -4
  38. package/table/body-cell/disabled-inline-editor.js.map +1 -1
  39. package/table/body-cell/index.d.ts +0 -1
  40. package/table/body-cell/index.d.ts.map +1 -1
  41. package/table/body-cell/index.js +4 -4
  42. package/table/body-cell/index.js.map +1 -1
  43. package/table/body-cell/styles.css.js +46 -47
  44. package/table/body-cell/styles.scoped.css +301 -331
  45. package/table/body-cell/styles.selectors.js +46 -47
  46. package/test-utils/dom/file-upload/index.js +16 -16
  47. package/test-utils/dom/file-upload/index.js.map +1 -1
  48. package/test-utils/dom/internal/file-input.d.ts +7 -0
  49. package/test-utils/dom/internal/file-input.js +18 -0
  50. package/test-utils/dom/internal/file-input.js.map +1 -0
  51. package/test-utils/dom/s3-resource-selector/index.js +2 -1
  52. package/test-utils/dom/s3-resource-selector/index.js.map +1 -1
  53. package/test-utils/selectors/file-upload/index.js +16 -16
  54. package/test-utils/selectors/file-upload/index.js.map +1 -1
  55. package/test-utils/selectors/internal/file-input.d.ts +7 -0
  56. package/test-utils/selectors/internal/file-input.js +18 -0
  57. package/test-utils/selectors/internal/file-input.js.map +1 -0
  58. package/test-utils/selectors/s3-resource-selector/index.js +2 -1
  59. package/test-utils/selectors/s3-resource-selector/index.js.map +1 -1
  60. package/test-utils/tsconfig.tsbuildinfo +1 -1
  61. package/file-upload/file-input/index.d.ts +0 -14
  62. package/file-upload/file-input/index.d.ts.map +0 -1
  63. package/file-upload/file-input/index.js.map +0 -1
  64. package/file-upload/file-input/styles.css.js +0 -9
  65. package/file-upload/file-input/styles.selectors.js +0 -10
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { FormFieldValidationControlProps } from '../../internal/context/form-field-context';
3
- import { FileUploadProps } from '../interfaces';
4
- interface FileInputProps extends FormFieldValidationControlProps {
5
- accept?: string;
6
- ariaRequired?: boolean;
7
- multiple: boolean;
8
- value: readonly File[];
9
- onChange: (files: File[]) => void;
10
- children: React.ReactNode;
11
- }
12
- declare const _default: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<FileUploadProps.Ref>>;
13
- export default _default;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file-upload/file-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAI5F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD,UAAU,cAAe,SAAQ,+BAA+B;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;;AAED,wBAA2C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/file-upload/file-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,MAAM,MAAM,iBAA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Ae,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,EACpF,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,IAExD,QAAQ,CACM;QAGjB,oBAAC,gBAAgB,IAAC,EAAE,EAAE,mBAAmB,IAAG,QAAQ,CAAoB,CACpE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ChangeEvent, ForwardedRef, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalButton from '../../button/internal';\nimport { useFormFieldContext } from '../../contexts/form-field';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { joinStrings } from '../../internal/utils/strings';\nimport { FileUploadProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\ninterface FileInputProps extends FormFieldValidationControlProps {\n accept?: string;\n ariaRequired?: boolean;\n multiple: boolean;\n value: readonly File[];\n onChange: (files: File[]) => void;\n children: React.ReactNode;\n}\n\nexport default React.forwardRef(FileInput);\n\nfunction FileInput(\n { accept, ariaRequired, multiple, value, onChange, children, ...restProps }: FileInputProps,\n ref: ForwardedRef<FileUploadProps.Ref>\n) {\n const uploadInputRef = useRef<HTMLInputElement>(null);\n const uploadButtonLabelId = useUniqueId('upload-button-label');\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('upload-input');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n useForwardFocus(ref, uploadInputRef);\n\n const [isFocused, setIsFocused] = useState(false);\n\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n\n const onUploadInputFocus = () => setIsFocused(true);\n\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n onChange(target.files ? Array.from(target.files) : []);\n };\n\n const nativeAttributes: React.HTMLAttributes<HTMLInputElement> = {\n 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),\n 'aria-describedby': formFieldContext.ariaDescribedby,\n };\n if (formFieldContext.invalid) {\n nativeAttributes['aria-invalid'] = true;\n }\n if (ariaRequired) {\n nativeAttributes['aria-required'] = true;\n }\n\n // Synchronizing component's value with the native file input state.\n useEffect(() => {\n // The DataTransfer is not available in jsdom.\n if (window.DataTransfer) {\n const dataTransfer = new DataTransfer();\n for (const file of value) {\n dataTransfer.items.add(file);\n }\n uploadInputRef.current!.files = dataTransfer.files;\n }\n if (uploadInputRef.current) {\n uploadInputRef.current.value = ''; // reset value to allow calling onChange when the same file is uploaded again\n }\n }, [value]);\n\n return (\n <div className={styles['file-input-container']}>\n {/* This is the actual interactive and accessible file-upload element. */}\n {/* It is visually hidden to achieve the desired UX design. */}\n <input\n id={controlId}\n ref={uploadInputRef}\n type=\"file\"\n hidden={false}\n multiple={multiple}\n accept={accept}\n onChange={onUploadInputChange}\n onFocus={onUploadInputFocus}\n onBlur={onUploadInputBlur}\n className={styles['upload-input']}\n {...nativeAttributes}\n />\n\n {/* The button is decorative. It dispatches clicks to the file input and is ARIA-hidden. */}\n {/* When the input is focused the focus outline is forced on the button. */}\n <InternalButton\n iconName=\"upload\"\n formAction=\"none\"\n onClick={onUploadButtonClick}\n className={clsx(styles['upload-button'], isFocused && styles['force-focus-outline'])}\n __nativeAttributes={{ tabIndex: -1, 'aria-hidden': true }}\n >\n {children}\n </InternalButton>\n\n {/* The file input needs to be labelled with provided content. Can't use the button because it is ARIA-hidden. */}\n <ScreenreaderOnly id={uploadButtonLabelId}>{children}</ScreenreaderOnly>\n </div>\n );\n}\n"]}
@@ -1,9 +0,0 @@
1
-
2
- import './styles.scoped.css';
3
- export default {
4
- "upload-button": "awsui_upload-button_4xu1k_1u2yz_181",
5
- "upload-input": "awsui_upload-input_4xu1k_1u2yz_182",
6
- "file-input-container": "awsui_file-input-container_4xu1k_1u2yz_186",
7
- "force-focus-outline": "awsui_force-focus-outline_4xu1k_1u2yz_195"
8
- };
9
-
@@ -1,10 +0,0 @@
1
-
2
- // es-module interop with Babel and Typescript
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- module.exports.default = {
5
- "upload-button": "awsui_upload-button_4xu1k_1u2yz_181",
6
- "upload-input": "awsui_upload-input_4xu1k_1u2yz_182",
7
- "file-input-container": "awsui_file-input-container_4xu1k_1u2yz_186",
8
- "force-focus-outline": "awsui_force-focus-outline_4xu1k_1u2yz_195"
9
- };
10
-