diff --git a/.changeset/brown-apricots-add.md b/.changeset/brown-apricots-add.md deleted file mode 100644 index 1ad0cb217e1..00000000000 --- a/.changeset/brown-apricots-add.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react": patch ---- - -fix(react): ShowPasswordButton should have aria-hidden="true" on icon diff --git a/.changeset/itchy-crabs-return.md b/.changeset/itchy-crabs-return.md deleted file mode 100644 index 76d12ace67b..00000000000 --- a/.changeset/itchy-crabs-return.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@aws-amplify/ui-react-storage": minor -"@aws-amplify/ui-react": minor -"@aws-amplify/ui": minor ---- - -feat(react): DropZone component - -```jsx -export default function DefaultDropZoneExample() { - const [files, setFiles] = React.useState([]); - return ( - <> - { - setFiles(files); - }} - > - Drag images here - - {files.map((file) => ( - {file.name} - ))} - - ); -} -``` - -The DropZone part of the StorageManager connected component has been updated to use the new DropZone component too! diff --git a/.changeset/long-sloths-buy.md b/.changeset/long-sloths-buy.md deleted file mode 100644 index 8a98f8934ce..00000000000 --- a/.changeset/long-sloths-buy.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@aws-amplify/ui-react-storage': minor -'@aws-amplify/ui-react': patch -'@aws-amplify/ui': patch ---- - -feat(ui-react-storage): Added upload actions and option to upload files on click. Usage: - -``` - -``` diff --git a/.changeset/nine-insects-pay.md b/.changeset/nine-insects-pay.md deleted file mode 100644 index 8696761e22f..00000000000 --- a/.changeset/nine-insects-pay.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@aws-amplify/ui-react": patch ---- - -feat(react): Add new Message primitive. - -Usage: -``` -Content of the message. -``` diff --git a/.changeset/ninety-laws-share.md b/.changeset/ninety-laws-share.md deleted file mode 100644 index c78c980961d..00000000000 --- a/.changeset/ninety-laws-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react-liveness": patch ---- - -chore(liveness): get oval fit timeout from server diff --git a/.changeset/poor-beans-exercise.md b/.changeset/poor-beans-exercise.md deleted file mode 100644 index 8fe2084ccf8..00000000000 --- a/.changeset/poor-beans-exercise.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@aws-amplify/ui-react-native": patch -"@aws-amplify/ui-react": patch -"@aws-amplify/ui": patch ---- - -chore(ui): adds info, warning, and success border tokens. updates background color tokens for info, warning, success and error. diff --git a/.changeset/three-baboons-chew.md b/.changeset/three-baboons-chew.md deleted file mode 100644 index 2dc9dff8526..00000000000 --- a/.changeset/three-baboons-chew.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -"@aws-amplify/ui": patch -"@aws-amplify/ui-react": patch ---- - -feat: Input and Label primitives - -```jx -export const InputLabelExample = () => ( - <> - - - -); -``` diff --git a/.changeset/two-walls-collect.md b/.changeset/two-walls-collect.md deleted file mode 100644 index 85eac25ab8f..00000000000 --- a/.changeset/two-walls-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui-react-core": patch ---- - -chore(ui-react-core): add named returned values to createContextUtilities diff --git a/.changeset/warm-cups-camp.md b/.changeset/warm-cups-camp.md deleted file mode 100644 index 66cdc7add0e..00000000000 --- a/.changeset/warm-cups-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@aws-amplify/ui": patch ---- - -chore(authenticator): add additional types for form fields diff --git a/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap b/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap index 9029e489d4b..36e985ea929 100644 --- a/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap +++ b/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap @@ -3142,6 +3142,78 @@ exports[`CSS Variables Table 1`] = ` \\"variable\\": \\"--amplify-components-fieldmessages-error-font-size\\", \\"value\\": \\"var(--amplify-font-sizes-small)\\" }, + { + \\"variable\\": \\"--amplify-components-fieldset-background-color\\", + \\"value\\": \\"transparent\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-border-radius\\", + \\"value\\": \\"var(--amplify-radii-xs)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-flex-direction\\", + \\"value\\": \\"column\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-gap\\", + \\"value\\": \\"var(--amplify-components-field-gap)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-large-gap\\", + \\"value\\": \\"var(--amplify-components-field-large-gap)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-color\\", + \\"value\\": \\"var(--amplify-colors-font-primary)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-font-size\\", + \\"value\\": \\"var(--amplify-components-field-font-size)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-font-weight\\", + \\"value\\": \\"var(--amplify-font-weights-bold)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-large-font-size\\", + \\"value\\": \\"var(--amplify-components-field-large-font-size)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-line-height\\", + \\"value\\": \\"var(--amplify-line-heights-medium)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-legend-small-font-size\\", + \\"value\\": \\"var(--amplify-components-field-small-font-size)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-border-color\\", + \\"value\\": \\"var(--amplify-colors-neutral-40)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-border-style\\", + \\"value\\": \\"solid\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-border-width\\", + \\"value\\": \\"var(--amplify-border-widths-small)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-large-padding\\", + \\"value\\": \\"var(--amplify-space-large)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-padding\\", + \\"value\\": \\"var(--amplify-space-medium)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-outlined-small-padding\\", + \\"value\\": \\"var(--amplify-space-small)\\" + }, + { + \\"variable\\": \\"--amplify-components-fieldset-small-gap\\", + \\"value\\": \\"var(--amplify-components-field-small-gap)\\" + }, { \\"variable\\": \\"--amplify-components-fileuploader-dropzone-active-background-color\\", \\"value\\": \\"var(--amplify-colors-brand-primary-10)\\" diff --git a/docs/__tests__/__snapshots__/props-table.test.ts.snap b/docs/__tests__/__snapshots__/props-table.test.ts.snap index 64f45d72302..1b4622299bf 100644 --- a/docs/__tests__/__snapshots__/props-table.test.ts.snap +++ b/docs/__tests__/__snapshots__/props-table.test.ts.snap @@ -3317,6 +3317,263 @@ exports[`Props Table 1`] = ` } ] }, + \\"Fieldset\\": { + \\"Fieldset\\": [ + { + \\"Main\\": { + \\"id\\": { + \\"name\\": \\"id\\", + \\"type\\": \\"string | undefined\\", + \\"description\\": \\"Unique identifier\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, + \\"children\\": { + \\"name\\": \\"children\\", + \\"type\\": \\"React.ReactNode\\", + \\"description\\": \\"Children to be rendered inside the component\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, + \\"className\\": { + \\"name\\": \\"className\\", + \\"type\\": \\"string | undefined\\", + \\"description\\": \\"Additional CSS class name for component\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, + \\"testId\\": { + \\"name\\": \\"testId\\", + \\"type\\": \\"string | undefined\\", + \\"description\\": \\"Used to provide a \`data-testid\` attribute for testing purposes\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean | undefined\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, + \\"legend\\": { + \\"name\\": \\"legend\\", + \\"type\\": \\"React.ReactNode\\", + \\"description\\": \\"Legend is the label for the Fieldset.\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": false + }, + \\"legendHidden\\": { + \\"name\\": \\"legendHidden\\", + \\"type\\": \\"boolean | undefined\\", + \\"description\\": \\"Visually hides the legend while making it still accessible to screenreaders.\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"variation\\": { + \\"name\\": \\"variation\\", + \\"type\\": \\"\\\\\\"outlined\\\\\\" | \\\\\\"plain\\\\\\" | undefined\\", + \\"description\\": \\"Adds plain or outlined variation to the Fieldset\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"size\\": { + \\"name\\": \\"size\\", + \\"type\\": \\"'small' | 'large'\\", + \\"description\\": \\"Changes the size of the Fieldset\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"isDisabled\\": { + \\"name\\": \\"isDisabled\\", + \\"type\\": \\"boolean | undefined\\", + \\"description\\": \\" Determines whether the Fieldset should be disabled. Default: false\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"name\\": { + \\"name\\": \\"name\\", + \\"type\\": \\"string | undefined\\", + \\"description\\": \\"Name of the Fieldset.\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"form\\": { + \\"name\\": \\"form\\", + \\"type\\": \\"string | undefined\\", + \\"description\\": \\"Form to associate the Fieldset with\\", + \\"category\\": \\"BaseFieldsetProps\\", + \\"isOptional\\": true + }, + \\"style\\": { + \\"name\\": \\"style\\", + \\"type\\": \\"React.CSSProperties | undefined\\", + \\"description\\": \\"Accepts a JavaScript object with camelCased properties rather than a CSS string.\\\\nThis is consistent with the DOM style JavaScript property, is more efficient, and prevents XSS security holes. See: [React docs](https://reactjs.org/docs/dom-elements.html#style)\\", + \\"category\\": \\"BaseViewProps\\", + \\"isOptional\\": true + } + } + }, + { + \\"Layout\\": { + \\"alignItems\\": { + \\"name\\": \\"alignItems\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Sets the align-self value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"alignContent\\": { + \\"name\\": \\"alignContent\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"justifyContent\\": { + \\"name\\": \\"justifyContent\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"gap\\": { + \\"name\\": \\"gap\\", + \\"type\\": \\"ResponsiveStyle>>> | undefined\\", + \\"description\\": \\"Controls the spacing between child components. Shorthand for rowGap and columnGap. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/gap)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"columnGap\\": { + \\"name\\": \\"columnGap\\", + \\"type\\": \\"ResponsiveStyle>>> | undefined\\", + \\"description\\": \\"Controls the spacing between Flex/Grid child columns See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"rowGap\\": { + \\"name\\": \\"rowGap\\", + \\"type\\": \\"ResponsiveStyle>>> | undefined\\", + \\"description\\": \\"Controls the spacing between Flex/Grid child rows See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap)\\", + \\"category\\": \\"CSSLayoutStyleProps\\", + \\"isOptional\\": true + }, + \\"direction\\": { + \\"name\\": \\"direction\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Sets how flex items are placed in the flex container defining the main axis\\\\nand the direction (normal or reversed). (maps to flex-direction CSS property)\\", + \\"category\\": \\"FlexContainerStyleProps\\", + \\"isOptional\\": true + }, + \\"wrap\\": { + \\"name\\": \\"wrap\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"The flexWrap property is set on containers and it controls what happens when\\\\nchildren overflow the size of the container along the main axis. By default,\\\\nchildren are forced into a single line (which can shrink elements). If\\\\nwrapping is allowed, items are wrapped into multiple lines along the main\\\\naxis if needed.\\\\n(maps to flex-wrap CSS property)\\", + \\"category\\": \\"FlexContainerStyleProps\\", + \\"isOptional\\": true + }, + \\"flex\\": { + \\"name\\": \\"flex\\", + \\"type\\": \\"ResponsiveStyle> | undefined\\", + \\"description\\": \\"Shorthand for flex grow / shrink / basis\\", + \\"category\\": \\"FlexItemStyleProps\\", + \\"isOptional\\": true + }, + \\"order\\": { + \\"name\\": \\"order\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Sets the order to lay out an item in a flex or grid container.\\", + \\"category\\": \\"FlexItemStyleProps\\", + \\"isOptional\\": true + }, + \\"grow\\": { + \\"name\\": \\"grow\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Ability for flex item to grow\\", + \\"category\\": \\"FlexItemStyleProps\\", + \\"isOptional\\": true + }, + \\"shrink\\": { + \\"name\\": \\"shrink\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Ability for flex item to shrink\\", + \\"category\\": \\"FlexItemStyleProps\\", + \\"isOptional\\": true + }, + \\"basis\\": { + \\"name\\": \\"basis\\", + \\"type\\": \\"ResponsiveStyle> | undefined\\", + \\"description\\": \\"Default size of element before remaining space is distributed\\", + \\"category\\": \\"FlexItemStyleProps\\", + \\"isOptional\\": true + }, + \\"area\\": { + \\"name\\": \\"area\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"column\\": { + \\"name\\": \\"column\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"columnEnd\\": { + \\"name\\": \\"columnEnd\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"columnSpan\\": { + \\"name\\": \\"columnSpan\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Makes it possible for an element to span across all columns when its value is set to all. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-span)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"columnStart\\": { + \\"name\\": \\"columnStart\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement. This start position defines the block-start edge of the grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"row\\": { + \\"name\\": \\"row\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's size and location within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"rowEnd\\": { + \\"name\\": \\"rowEnd\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"rowSpan\\": { + \\"name\\": \\"rowSpan\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + }, + \\"rowStart\\": { + \\"name\\": \\"rowStart\\", + \\"type\\": \\"ResponsiveStyle | undefined\\", + \\"description\\": \\"Specifies a grid item's start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start)\\", + \\"category\\": \\"GridItemStyleProps\\", + \\"isOptional\\": true + } + } + } + ] + }, \\"Flex\\": { \\"Flex\\": [ { diff --git a/docs/__tests__/__snapshots__/sitemap.test.ts.snap b/docs/__tests__/__snapshots__/sitemap.test.ts.snap index 2fba7dcbc48..ad30c0ec1b2 100644 --- a/docs/__tests__/__snapshots__/sitemap.test.ts.snap +++ b/docs/__tests__/__snapshots__/sitemap.test.ts.snap @@ -63,6 +63,7 @@ exports[`Sitemap Snapshot 1`] = ` /react/components/divider, /react/components/dropzone, /react/components/expander, +/react/components/fieldset, /react/components/flex, /react/components/grid, /react/components/heading, diff --git a/docs/package.json b/docs/package.json index ee76091aca7..59f6c578433 100644 --- a/docs/package.json +++ b/docs/package.json @@ -23,8 +23,8 @@ "test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts" }, "dependencies": { - "@aws-amplify/ui-react": "5.2.0", - "@aws-amplify/ui-react-storage": "2.2.0", + "@aws-amplify/ui-react": "5.3.0", + "@aws-amplify/ui-react-storage": "2.3.0", "@cucumber/gherkin": "^19.0.3", "@cucumber/messages": "^16.0.1", "@docsearch/react": "3", diff --git a/docs/src/data/links.tsx b/docs/src/data/links.tsx index dd7160cdee8..364f56a06f3 100644 --- a/docs/src/data/links.tsx +++ b/docs/src/data/links.tsx @@ -1,5 +1,6 @@ import { IconType } from 'react-icons/lib'; import { + MdFeedback, MdFormatSize, MdTextFormat, MdOutlineImage, @@ -259,8 +260,9 @@ export const feedbackComponents: ComponentNavItem[] = [ { href: '/components/message', label: 'Message', - body: `A message displays feedback to the user`, + body: `A Message can be used to display feedback to the user.`, platforms: ['react'], + icon: MdFeedback, }, { href: '/components/placeholder', @@ -286,6 +288,13 @@ export const inputComponents: ComponentNavItem[] = [ platforms: ['react'], icon: MdSearch, }, + { + href: '/components/fieldset', + label: 'Fieldset', + body: `Fieldsets are used to group related form fields.`, + platforms: ['react'], + icon: MdSearch, + }, { href: '/components/input', label: 'Input', diff --git a/docs/src/pages/[platform]/components/dropzone/index.page.mdx b/docs/src/pages/[platform]/components/dropzone/index.page.mdx index 4fc6ba93365..2280f4a0893 100644 --- a/docs/src/pages/[platform]/components/dropzone/index.page.mdx +++ b/docs/src/pages/[platform]/components/dropzone/index.page.mdx @@ -1,9 +1,8 @@ --- title: DropZone description: The Dropzone component captures files from user with drag and drop - -# themeSource: packages/ui/src/theme/tokens/components/dropZone.ts -# reactSource: packages/react/src/primitives/DropZone/DropZone.tsx +themeSource: packages/ui/src/theme/tokens/components/dropZone.ts +reactSource: packages/react/src/primitives/DropZone/DropZone.tsx htmlElement: div supportedFrameworks: react --- diff --git a/docs/src/pages/[platform]/components/dropzone/react.mdx b/docs/src/pages/[platform]/components/dropzone/react.mdx index b2da4e3c703..a1bc2299a36 100644 --- a/docs/src/pages/[platform]/components/dropzone/react.mdx +++ b/docs/src/pages/[platform]/components/dropzone/react.mdx @@ -1,6 +1,6 @@ import { Example, ExampleCode } from '@/components/Example' import { ComponentStyleDisplay } from '@/components/ComponentStyleDisplay' - +import ThemeExample from '@/components/ThemeExample.mdx'; import { AcceptRejectDropZoneExample, DefaultDropZoneExample, @@ -71,17 +71,16 @@ You can add a button to open the file picker by adding a hidden input and firing ## Styling -{/* Commenting this out to not break link checker */} -{/* */} - - - - - ```jsx file=./examples/DropZoneThemeExample.tsx - ``` - - -{/* */} + + + + + + ```jsx file=./examples/DropZoneThemeExample.tsx + ``` + + + ### Target classes diff --git a/docs/src/pages/[platform]/components/fieldset/FieldsetPropControls.tsx b/docs/src/pages/[platform]/components/fieldset/FieldsetPropControls.tsx new file mode 100644 index 00000000000..941420e89dc --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/FieldsetPropControls.tsx @@ -0,0 +1,111 @@ +import { + FieldsetProps, + Flex, + SelectField, + SwitchField, + TextField, +} from '@aws-amplify/ui-react'; +import * as React from 'react'; + +export interface FieldsetPropControlsProps extends FieldsetProps { + setDirection: ( + value: React.SetStateAction + ) => void; + setIsDisabled: ( + value: React.SetStateAction + ) => void; + setLegend: (value: React.SetStateAction) => void; + setLegendHidden: ( + value: React.SetStateAction + ) => void; + setSize: (value: React.SetStateAction) => void; + setVariation: ( + value: React.SetStateAction + ) => void; +} + +interface FieldsetPropControlsInterface { + (props: FieldsetPropControlsProps): JSX.Element; +} + +export const FieldsetPropControls: FieldsetPropControlsInterface = ({ + direction, + isDisabled, + legend, + legendHidden, + size, + variation, + setDirection, + setIsDisabled, + setLegend, + setLegendHidden, + setSize, + setVariation, +}) => { + return ( + + + setLegend(event.target.value as FieldsetProps['legend']) + } + /> + + setVariation(event.target.value as FieldsetProps['variation']) + } + > + + + + + setDirection(event.target.value as FieldsetProps['direction']) + } + > + + + + + + + setSize(event.target.value as FieldsetProps['size']) + } + > + + + + + { + setIsDisabled(event.target.checked as FieldsetProps['isDisabled']); + }} + /> + { + setLegendHidden( + event.target.checked as FieldsetProps['legendHidden'] + ); + }} + /> + + ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/demo.tsx b/docs/src/pages/[platform]/components/fieldset/demo.tsx new file mode 100644 index 00000000000..ac5a20883e4 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/demo.tsx @@ -0,0 +1,75 @@ +import * as React from 'react'; +import { Fieldset, CheckboxField, FieldsetProps } from '@aws-amplify/ui-react'; +import { Demo } from '@/components/Demo'; +import { FieldsetPropControls } from './FieldsetPropControls'; +import { useFieldsetProps } from './useFieldsetProps'; +import { demoState } from '@/utils/demoState'; +import { getPropString } from '../utils/getPropString'; + +const propsToCode = (props) => { + return ( + ` + + +` + ); +}; + +const defaultFieldsetProps: FieldsetProps = { + legend: 'Favorite fruits', + legendHidden: false, + isDisabled: false, + direction: 'column', + variation: 'outlined', +}; + +export const FieldsetDemo = () => { + const fieldsetProps = useFieldsetProps( + (demoState.get('Fieldset') as FieldsetProps) || defaultFieldsetProps + ); + + return ( + } + > +
+ + +
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/BasicFieldset.tsx b/docs/src/pages/[platform]/components/fieldset/examples/BasicFieldset.tsx new file mode 100644 index 00000000000..9f3a2bf61b1 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/BasicFieldset.tsx @@ -0,0 +1,5 @@ +import { Fieldset } from '@aws-amplify/ui-react'; + +export const BasicFieldset = () => { + return
Fieldset content
; +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldset.tsx b/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldset.tsx new file mode 100644 index 00000000000..24460bf7ade --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldset.tsx @@ -0,0 +1,19 @@ +import { Fieldset, Text, TextField } from '@aws-amplify/ui-react'; + +export const DisabledFieldset = () => { + return ( +
+ + The input in this fieldset is disabled because of the parent fieldset. + + +
+ + This input is also disabled because the fieldset above it is disabled, + even though its immediate parent fieldset is not disabled. + + +
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldsetTest.tsx b/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldsetTest.tsx new file mode 100644 index 00000000000..83d7e43352b --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/DisabledFieldsetTest.tsx @@ -0,0 +1,122 @@ +import { useRef, useEffect } from 'react'; +import { + Autocomplete, + Button, + CheckboxField, + PasswordField, + PhoneNumberField, + Radio, + RadioGroupField, + SearchField, + SelectField, + SliderField, + StepperField, + SwitchField, + TextAreaField, + TextField, + ToggleButton, + Flex, + Fieldset, +} from '@aws-amplify/ui-react'; + +export const DisabledFieldsetTest = () => { + const form1Ref = useRef(null); + + return ( + +
+ +
+
+ +
+ + + + + + + + + + + + + + Press me! + + + HTML + CSS + JavaScript + + + +
+
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/FieldsetDirection.tsx b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetDirection.tsx new file mode 100644 index 00000000000..86506b7a2f1 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetDirection.tsx @@ -0,0 +1,24 @@ +import { Flex, Fieldset, Text, CheckboxField } from '@aws-amplify/ui-react'; + +export const FieldsetDirection = () => { + return ( + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/FieldsetSizes.tsx b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetSizes.tsx new file mode 100644 index 00000000000..06d9ebdb442 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetSizes.tsx @@ -0,0 +1,17 @@ +import { Flex, Fieldset } from '@aws-amplify/ui-react'; + +export const FieldsetSizes = () => { + return ( + +
+ Small fieldset size content. +
+
+ Default fieldset size content. +
+
+ Large fieldset size content. +
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/FieldsetStylePropsExample.tsx b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetStylePropsExample.tsx new file mode 100644 index 00000000000..e13a82d9766 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetStylePropsExample.tsx @@ -0,0 +1,13 @@ +import { Fieldset } from '@aws-amplify/ui-react'; + +export const FieldsetStylePropsExample = () => { + return ( +
+ Fieldset content +
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/FieldsetThemeExample.tsx b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetThemeExample.tsx new file mode 100644 index 00000000000..b80ffe8cffc --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetThemeExample.tsx @@ -0,0 +1,30 @@ +import { Fieldset, ThemeProvider, createTheme } from '@aws-amplify/ui-react'; + +const theme = createTheme({ + name: 'fieldset-theme', + tokens: { + components: { + fieldset: { + outlined: { + borderStyle: 'dashed', + borderWidth: '2px', + borderColor: '{colors.brand.primary.20}', + padding: '{space.large}', + }, + legend: { + fontSize: '{fontSizes.large}', + color: '{colors.brand.primary.80}', + fontWeight: '400', + }, + }, + }, + }, +}); + +export const FieldsetThemeExample = () => ( + +
+ Some content of the fieldset. +
+
+); diff --git a/docs/src/pages/[platform]/components/fieldset/examples/FieldsetVariations.tsx b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetVariations.tsx new file mode 100644 index 00000000000..8adeef53d9c --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/FieldsetVariations.tsx @@ -0,0 +1,14 @@ +import { Flex, Fieldset } from '@aws-amplify/ui-react'; + +export const FieldsetVariations = () => { + return ( + +
+ Outlined fieldset variation content. +
+
+ Plain fieldset variation content. +
+
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/NameAttribute.tsx b/docs/src/pages/[platform]/components/fieldset/examples/NameAttribute.tsx new file mode 100644 index 00000000000..5854a75838f --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/NameAttribute.tsx @@ -0,0 +1,21 @@ +import { Flex, Fieldset, Text } from '@aws-amplify/ui-react'; +import { useRef, useEffect, useState } from 'react'; + +export const NameAttribute = () => { + const formRef = useRef(null); + const [fieldsetName, setFieldsetName] = useState(''); + + useEffect(() => { + if (formRef.current) { + setFieldsetName(formRef.current.elements[0].name); + } + }, [setFieldsetName]); + return ( + +
+ Fieldset content +
+ Fieldset name: {fieldsetName} +
+ ); +}; diff --git a/docs/src/pages/[platform]/components/fieldset/examples/index.ts b/docs/src/pages/[platform]/components/fieldset/examples/index.ts new file mode 100644 index 00000000000..ceedeb1f43d --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/examples/index.ts @@ -0,0 +1,8 @@ +export { BasicFieldset } from './BasicFieldset'; +export { FieldsetSizes } from './FieldsetSizes'; +export { FieldsetVariations } from './FieldsetVariations'; +export { FieldsetDirection } from './FieldsetDirection'; +export { DisabledFieldset } from './DisabledFieldset'; +export { NameAttribute } from './NameAttribute'; +export { FieldsetThemeExample } from './FieldsetThemeExample'; +export { FieldsetStylePropsExample } from './FieldsetStylePropsExample'; diff --git a/docs/src/pages/[platform]/components/fieldset/index.page.mdx b/docs/src/pages/[platform]/components/fieldset/index.page.mdx new file mode 100644 index 00000000000..612c99b1992 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/index.page.mdx @@ -0,0 +1,41 @@ +--- +title: Fieldset +description: Fieldsets are used to group related form fields. +reactSource: packages/react/src/primitives/Fieldset/Fieldset.tsx +themeSource: packages/ui/src/theme/tokens/components/fieldset.ts +mdnUrl: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset +htmlElement: fieldset +supportedFrameworks: react +--- + +import { Fragment } from '@/components/Fragment'; +import { PageTabLayout } from '@/components/Layout/PageTabLayout'; +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; +import { PropsTableTab } from '@/components/propsTable/PropsTableTab'; +import data from '@/data/props-table.json'; + +export async function getStaticPaths() { + return getCustomStaticPath(frontmatter.supportedFrameworks); +} + +{/* `getStaticProps` is required to prevent "Error: getStaticPaths was added without a getStaticProps. Without getStaticProps, getStaticPaths does nothing" */} + +export async function getStaticProps() { + return { props: {} } +} + +{({ platform }) => import(`./${platform}.mdx`)} + }, + { + title: "Props", + children: + }]} +/> diff --git a/docs/src/pages/[platform]/components/fieldset/react.mdx b/docs/src/pages/[platform]/components/fieldset/react.mdx new file mode 100644 index 00000000000..4d3e9278384 --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/react.mdx @@ -0,0 +1,224 @@ +import { Fragment } from '@/components/Fragment'; +import { Flex, Text, Button, View, Alert, Fieldset, Link } from '@aws-amplify/ui-react'; +import { FieldsetDemo } from './demo'; +import { Example, ExampleCode } from '@/components/Example'; +import { ComponentStyleDisplay } from '@/components/ComponentStyleDisplay'; +import ThemeExample from '@/components/ThemeExample.mdx'; +import { + BasicFieldset, + FieldsetSizes, + FieldsetVariations, + FieldsetDirection, + DisabledFieldset, + NameAttribute, + FieldsetThemeExample, + FieldsetStylePropsExample +} from './examples'; + +## Demo + + + +## Usage + + + + + + + +```jsx file=./examples/BasicFieldset.tsx + +``` + + + + +### Sizes +Fieldset size can be changed via the `size` prop. It affects the Fieldset's padding and gap size and the font size of its `legend` element. + + + + + + + +```jsx file=./examples/FieldsetSizes.tsx + +``` + + + + +### Variation +Fieldset by default uses the `outlined` variation which has a border and padding. Use the `plain` variation to remove the border and padding. + + + + + + + +```jsx file=./examples/FieldsetVariations.tsx + +``` + + + + +### Direction +Fieldset uses the [Flex](flex) primitive for layout which allows you to use Flex props to control the direction and alignment of the Fieldset. Use `direction="row|row-reverse|column|column-reverse"` to change the direction of the Fieldset. + + + + + + + +```jsx file=./examples/FieldsetDirection.tsx + +``` + + + + +### Disabled +Fieldset can be disabled by using `isDisabled={true}` prop which will apply the `[disabled]` attribute to the fieldset. Fieldset has no special disabled styles. + + Disabled fieldsets in HTML will disable all inputs nested within them; even those nested within fieldsets that are not disabled. This is default browser behavior that the Fieldset primitive supports. + + + + + + + + + +```jsx file=./examples/DisabledFieldset.tsx + +``` + + + + +### Name attribute +Fieldset supports the [name] attribute. Use the `name` prop to supply a name for your Fieldset. This can be useful if parsing form controls using the form.elements api + + + + + + + +```jsx file=./examples/NameAttribute.tsx + +``` + + + + +## Styling + + + + + + + + ```tsx file=./examples/FieldsetThemeExample.tsx + + ``` + + + + + +### Target classes + + + +### Global Styling + +To override styling on all Fieldsets, you can set the Amplify CSS variables or use the [target classes](#target-classes). + + + +
A Fieldset styled with CSS.
+
+ + + +```css +/* styles.css */ +:root { + --amplify-components-fieldset-border-radius: 12px; +} +/* OR */ +.amplify-fieldset { + border-radius: 12px; +} +``` + + +
+ +### Local styling + +To override styling on a specific Fieldset, you can use (in order of increasing specificity): a class selector or style props. + +#### Using a class selector + + +
+ This is a purple fieldset +
+ + +```css +/* styles.css */ +.purple-fieldset { + background-color: var(--amplify-colors-purple-10); + border-color: var(--amplify-colors-purple-60); +} +``` + + + + +```jsx +import './styles.css'; + +
+ This is a purple fieldset +
+``` + +
+
+ +#### Using style props + + + + + + +```jsx file=./examples/FieldsetStylePropsExample.tsx + +``` + + + + +## Accessibility + +ARIA attributes, roles, and other HTML attributes that are passed to Fieldset are passed to the parent DOM element which is a `
`. + +### Legend +Fieldset outputs a `` as the first nested element within the Fieldset. The `` element does not currently behave well as a flexbox child in browsers. To allow Fieldset to still operate well as a flex parent, Fieldset duplicates the contents of the `legend` prop: + +- the first is output as a VisuallyHidden `` which is accessible to screen readers. +- The second is output as a visible `
` element set to `aria-hidden={true}` so that the content is not repeated for screenreaders. + +This enables Fieldset to have a legend as the suggested way to accessibly label a fieldset. diff --git a/docs/src/pages/[platform]/components/fieldset/useFieldsetProps.ts b/docs/src/pages/[platform]/components/fieldset/useFieldsetProps.ts new file mode 100644 index 00000000000..6ec1214e47b --- /dev/null +++ b/docs/src/pages/[platform]/components/fieldset/useFieldsetProps.ts @@ -0,0 +1,59 @@ +import { demoState } from '@/utils/demoState'; +import { Fieldset, FieldsetProps } from '@aws-amplify/ui-react'; +import * as React from 'react'; + +import { FieldsetPropControlsProps } from './FieldsetPropControls'; + +interface UseFieldsetProps { + (initialValues: FieldsetProps): FieldsetPropControlsProps; +} + +export const useFieldsetProps: UseFieldsetProps = (initialValues) => { + const [direction, setDirection] = React.useState( + initialValues.direction + ); + const [isDisabled, setIsDisabled] = React.useState< + FieldsetProps['isDisabled'] + >(initialValues.isDisabled); + const [legend, setLegend] = React.useState( + initialValues.legend + ); + const [legendHidden, setLegendHidden] = React.useState< + FieldsetProps['legendHidden'] + >(initialValues.legendHidden); + const [size, setSize] = React.useState( + initialValues.size + ); + const [variation, setVariation] = React.useState( + initialValues.variation + ); + + React.useEffect(() => { + demoState.set(Fieldset.displayName, { + direction, + isDisabled, + legend, + legendHidden, + size, + variation, + }); + }, [direction, isDisabled, legend, legendHidden, size, variation]); + + return React.useMemo( + () => ({ + direction, + isDisabled, + legend, + legendHidden, + size, + variation, + setDirection, + setIsDisabled, + setLegend, + setLegendHidden, + setSize, + setVariation, + }), + [direction, isDisabled, legend, legendHidden, size, variation] + ); +}; diff --git a/docs/src/pages/[platform]/components/input/index.page.mdx b/docs/src/pages/[platform]/components/input/index.page.mdx index 0d308fce42e..572dce89633 100644 --- a/docs/src/pages/[platform]/components/input/index.page.mdx +++ b/docs/src/pages/[platform]/components/input/index.page.mdx @@ -1,7 +1,7 @@ --- title: Input description: Input allows users to enter text content. -# themeSource: packages/ui/src/theme/tokens/components/input.ts +themeSource: packages/ui/src/theme/tokens/components/input.ts reactSource: packages/react/src/primitives/Input/Input.tsx mdnUrl: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input htmlElement: input diff --git a/docs/src/pages/[platform]/components/input/react.mdx b/docs/src/pages/[platform]/components/input/react.mdx index 046941bc5eb..320a0926890 100644 --- a/docs/src/pages/[platform]/components/input/react.mdx +++ b/docs/src/pages/[platform]/components/input/react.mdx @@ -178,7 +178,7 @@ Input primitive comes styled for text input only (type `text`, `date`, `number`, ## Styling -{/* + @@ -190,7 +190,7 @@ Input primitive comes styled for text input only (type `text`, `date`, `number`, - */} + ### Global styling diff --git a/docs/src/pages/[platform]/components/message/index.page.mdx b/docs/src/pages/[platform]/components/message/index.page.mdx index 02f01be08e4..bd75804cad0 100644 --- a/docs/src/pages/[platform]/components/message/index.page.mdx +++ b/docs/src/pages/[platform]/components/message/index.page.mdx @@ -1,8 +1,8 @@ --- title: Message description: A Message can be used to display feedback to the user. -# themeSource: packages/ui/src/theme/tokens/components/message.ts -# reactSource: packages/react/src/primitives/Message/Message.tsx +themeSource: packages/ui/src/theme/tokens/components/message.ts +reactSource: packages/react/src/primitives/Message/Message.tsx mdnUrl: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div htmlElement: div supportedFrameworks: react diff --git a/docs/src/pages/[platform]/components/message/react.mdx b/docs/src/pages/[platform]/components/message/react.mdx index 70b9ddbef38..95d1ecfdcc1 100644 --- a/docs/src/pages/[platform]/components/message/react.mdx +++ b/docs/src/pages/[platform]/components/message/react.mdx @@ -77,7 +77,7 @@ Message accepts the `variation` prop which allows for different background and b ### Dismissable -Messages can be dismissed by setting `isDismissible={true}`. Additional dismiss behavior can be added by passing a function to the `onDismiss` prop. By default, we provide accessible button text that is hidden visually with [VisuallyHidden](./visuallyhidden); you can override this label by using the `dismissButtonLabel` prop. +Messages can be dismissed by setting `isDismissible={true}`. Additional dismiss behavior can be added by passing a function to the `onDismiss` prop. By default, we provide accessible button text that is hidden visually with [VisuallyHidden](./visuallyhidden); you can override this label by using the `dismissLabel` prop. For more control over the appearance and functionality of the dismiss button, consider [using Message as a composable component](#composable). @@ -93,17 +93,19 @@ For more control over the appearance and functionality of the dismiss button, co ## Styling -### Theme + + + + + - - - - ```jsx file=./examples/MessageThemeExample.tsx + ```tsx file=./examples/MessageThemeExample.tsx ``` - - + + + ### Target classes diff --git a/docs/src/styles/index.scss b/docs/src/styles/index.scss index b20dc900d54..45b29ed01ff 100644 --- a/docs/src/styles/index.scss +++ b/docs/src/styles/index.scss @@ -30,6 +30,7 @@ @import './primitives/collectionStyles.css'; @import './primitives/dividerStyles.css'; @import './primitives/expanderStyles.css'; +@import './primitives/fieldsetStyles.css'; @import './primitives/flexStyles.css'; @import './primitives/headingStyles.css'; @import './primitives/iconStyles.css'; diff --git a/docs/src/styles/primitives/fieldsetStyles.css b/docs/src/styles/primitives/fieldsetStyles.css new file mode 100644 index 00000000000..fa925035c59 --- /dev/null +++ b/docs/src/styles/primitives/fieldsetStyles.css @@ -0,0 +1,4 @@ +.purple-fieldset { + background-color: var(--amplify-colors-purple-10); + border-color: var(--amplify-colors-purple-60); +} diff --git a/examples/angular/package.json b/examples/angular/package.json index 7e746ea4eb8..08f83ba5264 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -20,7 +20,7 @@ "@angular/platform-browser": "^14.3.0", "@angular/platform-browser-dynamic": "^14.3.0", "@angular/router": "^14.3.0", - "@aws-amplify/ui-angular": "^4.0.7", + "@aws-amplify/ui-angular": "^4.0.8", "aws-amplify": "latest", "rxjs": "~6.6.0", "tslib": "^2.0.0", diff --git a/examples/next/package.json b/examples/next/package.json index cdcf7c43285..4f6a4a9122c 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -10,10 +10,10 @@ "lint": "next lint" }, "dependencies": { - "@aws-amplify/ui-react": "^5.2.0", - "@aws-amplify/ui-react-liveness": "^2.0.5", - "@aws-amplify/ui-react-storage": "^2.2.0", - "@aws-amplify/ui-react-notifications": "^1.0.11", + "@aws-amplify/ui-react": "^5.3.0", + "@aws-amplify/ui-react-liveness": "^2.0.6", + "@aws-amplify/ui-react-storage": "^2.3.0", + "@aws-amplify/ui-react-notifications": "^1.0.12", "@aws-amplify/ui-react-geo": "^1.0.2", "@aws-sdk/credential-providers": "^3.370.0", "aws-amplify": "latest", diff --git a/examples/vue/package.json b/examples/vue/package.json index 838615161ff..2ec0594fd05 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -10,7 +10,7 @@ "start": "vite preview --port 3000" }, "dependencies": { - "@aws-amplify/ui-vue": "^3.1.26", + "@aws-amplify/ui-vue": "^3.1.27", "aws-amplify": "latest", "vue": "^3.0.5", "vue-router": "4" diff --git a/packages/angular/projects/ui-angular/CHANGELOG.md b/packages/angular/projects/ui-angular/CHANGELOG.md index de1dbd2ed58..b5bffcca13b 100644 --- a/packages/angular/projects/ui-angular/CHANGELOG.md +++ b/packages/angular/projects/ui-angular/CHANGELOG.md @@ -1,5 +1,12 @@ # @aws-amplify/ui-angular +## 4.0.8 + +### Patch Changes + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui@5.8.0 + ## 4.0.7 ### Patch Changes diff --git a/packages/angular/projects/ui-angular/package.json b/packages/angular/projects/ui-angular/package.json index be76683906f..811c00202bd 100644 --- a/packages/angular/projects/ui-angular/package.json +++ b/packages/angular/projects/ui-angular/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-angular", - "version": "4.0.7", + "version": "4.0.8", "scripts": { "build": "yarn --cwd ../../ build", "dev": "yarn --cwd ../../ dev", @@ -19,7 +19,7 @@ "aws-amplify": "^5.0.1" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", + "@aws-amplify/ui": "5.8.0", "classnames": "2.3.1", "nanoid": "3.1.31", "qrcode": "1.5.0", diff --git a/packages/angular/projects/ui-angular/src/version.ts b/packages/angular/projects/ui-angular/src/version.ts index 353ac268e1f..d92c42eb3fa 100644 --- a/packages/angular/projects/ui-angular/src/version.ts +++ b/packages/angular/projects/ui-angular/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.0.7'; +export const VERSION = '4.0.8'; diff --git a/packages/e2e/features/ui/components/liveness/disable-start-screen.feature b/packages/e2e/features/ui/components/liveness/disable-start-screen.feature index 7a9a468c482..e27051c3fcd 100644 --- a/packages/e2e/features/ui/components/liveness/disable-start-screen.feature +++ b/packages/e2e/features/ui/components/liveness/disable-start-screen.feature @@ -13,6 +13,6 @@ Feature: Disable Start Screen Scenario: See camera module and instructions Then I see "liveness-detector" element Then I see "connecting" - Then I see "Face didn't fill oval within time limit." + Then I see "Face didn't fit inside oval in time limit." Then I click the "Try again" button Then I see "Loading" diff --git a/packages/e2e/features/ui/components/liveness/liveness-detector.feature b/packages/e2e/features/ui/components/liveness/liveness-detector.feature index 394ac07d2c2..1939c9a2c2c 100644 --- a/packages/e2e/features/ui/components/liveness/liveness-detector.feature +++ b/packages/e2e/features/ui/components/liveness/liveness-detector.feature @@ -24,6 +24,6 @@ Feature: Liveness Detector Then I see "liveness-detector" element Then I see "connecting" Then I see "Move closer" - Then I see "Face didn't fill oval within time limit." + Then I see "Face didn't fit inside oval in time limit." Then I click the "Try again" button Then I see the "Begin check" button diff --git a/packages/e2e/features/ui/components/liveness/start-screen.feature b/packages/e2e/features/ui/components/liveness/start-screen.feature index 08480ee088a..c3b0719d3bb 100644 --- a/packages/e2e/features/ui/components/liveness/start-screen.feature +++ b/packages/e2e/features/ui/components/liveness/start-screen.feature @@ -25,4 +25,4 @@ Feature: Liveness Start Screen Then I see "Make sure your face is not covered with sunglasses or a mask." Then I see "Move to a well-lit place that is not in direct sunlight." Then I see "Maximize your screen's brightness." - Then I see "When an oval appears, fill the oval with your face within 7 seconds." + Then I see "When an oval appears, follow the instructions to fit your face in it." diff --git a/packages/e2e/features/ui/components/liveness/with-credential-provider.feature b/packages/e2e/features/ui/components/liveness/with-credential-provider.feature index ab3b9a82195..6793f854712 100644 --- a/packages/e2e/features/ui/components/liveness/with-credential-provider.feature +++ b/packages/e2e/features/ui/components/liveness/with-credential-provider.feature @@ -17,6 +17,6 @@ Liveness component supports using a custom credential provider. Then I see "liveness-detector" element Then I see "connecting" Then I see "Move closer" - Then I see "Face didn't fill oval within time limit." + Then I see "Face didn't fit inside oval in time limit." Then I click the "Try again" button Then I see the "Begin check" button diff --git a/packages/e2e/package.json b/packages/e2e/package.json index 59fd2ebe362..3bcac07c3f0 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -30,7 +30,7 @@ ] }, "devDependencies": { - "@aws-amplify/ui": "^5.7.2", + "@aws-amplify/ui": "^5.8.0", "@badeball/cypress-cucumber-preprocessor": "^16.0.3", "@bahmutov/cypress-esbuild-preprocessor": "~2.2.0", "@cucumber/cucumber": "^9.3.0", diff --git a/packages/react-core-notifications/CHANGELOG.md b/packages/react-core-notifications/CHANGELOG.md index 4e5f5e71062..a9ac6cd7a7f 100644 --- a/packages/react-core-notifications/CHANGELOG.md +++ b/packages/react-core-notifications/CHANGELOG.md @@ -1,5 +1,13 @@ # @aws-amplify/ui-react-core-notifications +## 1.0.9 + +### Patch Changes + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`5bc0c8a32`](https://github.com/aws-amplify/amplify-ui/commit/5bc0c8a32d1552313df496f96b96738637d0b157), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui@5.8.0 + - @aws-amplify/ui-react-core@2.1.32 + ## 1.0.8 ### Patch Changes diff --git a/packages/react-core-notifications/package.json b/packages/react-core-notifications/package.json index eaf8aa65adc..a802454a04a 100644 --- a/packages/react-core-notifications/package.json +++ b/packages/react-core-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core-notifications", - "version": "1.0.8", + "version": "1.0.9", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -36,8 +36,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react-core": "2.1.31" + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react-core": "2.1.32" }, "peerDependencies": { "aws-amplify": "^5.0.1", diff --git a/packages/react-core/CHANGELOG.md b/packages/react-core/CHANGELOG.md index f93b21f8025..7d70a6a6982 100644 --- a/packages/react-core/CHANGELOG.md +++ b/packages/react-core/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-core +## 2.1.32 + +### Patch Changes + +- [#4381](https://github.com/aws-amplify/amplify-ui/pull/4381) [`5bc0c8a32`](https://github.com/aws-amplify/amplify-ui/commit/5bc0c8a32d1552313df496f96b96738637d0b157) Thanks [@calebpollman](https://github.com/calebpollman)! - chore(ui-react-core): add named returned values to createContextUtilities + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui@5.8.0 + ## 2.1.31 ### Patch Changes diff --git a/packages/react-core/package.json b/packages/react-core/package.json index d0d43503f0a..38e956eec4f 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-core", - "version": "2.1.31", + "version": "2.1.32", "main": "dist/index.js", "module": "dist/esm/index.mjs", "react-native": "dist/index.js", @@ -31,7 +31,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", + "@aws-amplify/ui": "5.8.0", "@xstate/react": "3.0.1", "lodash": "4.17.21", "xstate": "^4.33.6" diff --git a/packages/react-liveness/CHANGELOG.md b/packages/react-liveness/CHANGELOG.md index 9404e788bf7..faae33b0a0a 100644 --- a/packages/react-liveness/CHANGELOG.md +++ b/packages/react-liveness/CHANGELOG.md @@ -1,5 +1,15 @@ # @aws-amplify/ui-react-liveness +## 2.0.6 + +### Patch Changes + +- [#4392](https://github.com/aws-amplify/amplify-ui/pull/4392) [`60f21e0ab`](https://github.com/aws-amplify/amplify-ui/commit/60f21e0ab7761467268cd46ac8ee1e9752df33af) Thanks [@thaddmt](https://github.com/thaddmt)! - chore(liveness): update start screen text to remove 7 seconds + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`265f0b482`](https://github.com/aws-amplify/amplify-ui/commit/265f0b48249c89b004a40a1a06abc0c3551f45f7), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`5b6c9bfe4`](https://github.com/aws-amplify/amplify-ui/commit/5b6c9bfe4ef1c0727270bffacb5f9e8045a8325d), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`9471ea53a`](https://github.com/aws-amplify/amplify-ui/commit/9471ea53a2414879d197adb5f52c8dcb3e0df946), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui-react@5.3.0 + - @aws-amplify/ui@5.8.0 + ## 2.0.5 ### Patch Changes diff --git a/packages/react-liveness/package.json b/packages/react-liveness/package.json index bc8eea90a5b..5bb2669a924 100644 --- a/packages/react-liveness/package.json +++ b/packages/react-liveness/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-liveness", - "version": "2.0.5", + "version": "2.0.6", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -48,9 +48,9 @@ "react-dom": ">= 16.14.0" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react": "5.2.0", - "@aws-sdk/client-rekognitionstreaming": "3.398.0", + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react": "5.3.0", + "@aws-sdk/client-rekognitionstreaming": "3.360.0", "@tensorflow-models/blazeface": "0.0.7", "@tensorflow/tfjs-backend-cpu": "3.11.0", "@tensorflow/tfjs-backend-wasm": "3.11.0", diff --git a/packages/react-liveness/src/components/FaceLivenessDetector/displayText.ts b/packages/react-liveness/src/components/FaceLivenessDetector/displayText.ts index 7d80e9f32a2..6f2dfeefe1e 100644 --- a/packages/react-liveness/src/components/FaceLivenessDetector/displayText.ts +++ b/packages/react-liveness/src/components/FaceLivenessDetector/displayText.ts @@ -49,7 +49,7 @@ export type StreamDisplayText = { export const defaultErrorDisplayText = { timeoutHeaderText: 'Time out', timeoutMessageText: - "Face didn't fill oval within time limit. Try again and completely fill oval with face within 7 seconds.", + "Face didn't fit inside oval in time limit. Try again and completely fill the oval with face in it.", faceDistanceHeaderText: 'Forward movement detected', faceDistanceMessageText: 'Avoid moving closer when connecting.', multipleFacesHeaderText: 'Multiple faces detected', @@ -88,7 +88,7 @@ export const defaultLivenessDisplayText: Required = { tooFarAltText: "Illustration of a person's face inside of an oval; there is a gap between the perimeter of the face and the boundaries of the oval.", instructionListStepOneText: - 'When an oval appears, fill the oval with your face within 7 seconds.', + 'When an oval appears, follow the instructions to fit your face in it.', instructionListStepTwoText: "Maximize your screen's brightness.", instructionListStepThreeText: 'Make sure your face is not covered with sunglasses or a mask.', diff --git a/packages/react-liveness/src/components/FaceLivenessDetector/service/machine/index.ts b/packages/react-liveness/src/components/FaceLivenessDetector/service/machine/index.ts index 5d7fcca3824..b9a2e6583f2 100644 --- a/packages/react-liveness/src/components/FaceLivenessDetector/service/machine/index.ts +++ b/packages/react-liveness/src/components/FaceLivenessDetector/service/machine/index.ts @@ -48,7 +48,6 @@ import { import { STATIC_VIDEO_CONSTRAINTS } from '../../StartLiveness/helpers'; export const MIN_FACE_MATCH_TIME = 500; -const DEFAULT_FACE_FIT_TIMEOUT = 7000; // timer metrics variables let faceDetectedTimestamp: number; @@ -675,13 +674,7 @@ export const livenessMachine = createMachine( sendTimeoutAfterOvalMatchDelay: actions.send( { type: 'TIMEOUT' }, { - delay: (context) => { - return ( - context.serverSessionInformation?.Challenge - ?.FaceMovementAndLightChallenge?.ChallengeConfig - ?.OvalFitTimeout || DEFAULT_FACE_FIT_TIMEOUT - ); - }, + delay: 7000, id: 'ovalMatchTimeout', } ), diff --git a/packages/react-liveness/src/version.ts b/packages/react-liveness/src/version.ts index becdf4bbc3d..bf049c30482 100644 --- a/packages/react-liveness/src/version.ts +++ b/packages/react-liveness/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.0.5'; +export const VERSION = '2.0.6'; diff --git a/packages/react-native/CHANGELOG.md b/packages/react-native/CHANGELOG.md index 239a3a6e1c3..d178474e10b 100644 --- a/packages/react-native/CHANGELOG.md +++ b/packages/react-native/CHANGELOG.md @@ -1,5 +1,16 @@ # @aws-amplify/ui-react-native +## 1.2.27 + +### Patch Changes + +- [#4368](https://github.com/aws-amplify/amplify-ui/pull/4368) [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26) Thanks [@hbuchel](https://github.com/hbuchel)! - chore(ui): adds info, warning, and success border tokens. updates background color tokens for info, warning, success and error. + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`5bc0c8a32`](https://github.com/aws-amplify/amplify-ui/commit/5bc0c8a32d1552313df496f96b96738637d0b157), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui@5.8.0 + - @aws-amplify/ui-react-core@2.1.32 + - @aws-amplify/ui-react-core-notifications@1.0.9 + ## 1.2.26 ### Patch Changes diff --git a/packages/react-native/package.json b/packages/react-native/package.json index f5e2304a28f..45414e806f3 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-native", - "version": "1.2.26", + "version": "1.2.27", "main": "lib/index.js", "module": "dist/index.js", "react-native": "src/index.ts", @@ -40,9 +40,9 @@ "rimraf": "^3.0.2" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react-core": "2.1.31", - "@aws-amplify/ui-react-core-notifications": "1.0.8" + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react-core": "2.1.32", + "@aws-amplify/ui-react-core-notifications": "1.0.9" }, "peerDependencies": { "aws-amplify": "^5.0.1", diff --git a/packages/react-native/src/version.ts b/packages/react-native/src/version.ts index 7eaaea902ad..ef3681800dc 100644 --- a/packages/react-native/src/version.ts +++ b/packages/react-native/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.2.26'; +export const VERSION = '1.2.27'; diff --git a/packages/react-notifications/CHANGELOG.md b/packages/react-notifications/CHANGELOG.md index d94eee79193..ed01259e2fc 100644 --- a/packages/react-notifications/CHANGELOG.md +++ b/packages/react-notifications/CHANGELOG.md @@ -1,5 +1,14 @@ # @aws-amplify/ui-react-notifications +## 1.0.12 + +### Patch Changes + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`265f0b482`](https://github.com/aws-amplify/amplify-ui/commit/265f0b48249c89b004a40a1a06abc0c3551f45f7), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`5b6c9bfe4`](https://github.com/aws-amplify/amplify-ui/commit/5b6c9bfe4ef1c0727270bffacb5f9e8045a8325d), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`9471ea53a`](https://github.com/aws-amplify/amplify-ui/commit/9471ea53a2414879d197adb5f52c8dcb3e0df946), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui-react@5.3.0 + - @aws-amplify/ui@5.8.0 + - @aws-amplify/ui-react-core-notifications@1.0.9 + ## 1.0.11 ### Patch Changes diff --git a/packages/react-notifications/package.json b/packages/react-notifications/package.json index ba371c0d381..eedb8d0342b 100644 --- a/packages/react-notifications/package.json +++ b/packages/react-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-notifications", - "version": "1.0.11", + "version": "1.0.12", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -40,9 +40,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react": "5.2.0", - "@aws-amplify/ui-react-core-notifications": "1.0.8", + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react": "5.3.0", + "@aws-amplify/ui-react-core-notifications": "1.0.9", "classnames": "2.3.1", "tinycolor2": "1.4.2" }, diff --git a/packages/react-storage/CHANGELOG.md b/packages/react-storage/CHANGELOG.md index 15f5d38afbc..080f09027d5 100644 --- a/packages/react-storage/CHANGELOG.md +++ b/packages/react-storage/CHANGELOG.md @@ -1,5 +1,48 @@ # @aws-amplify/ui-react-storage +## 2.3.0 + +### Minor Changes + +- [#4359](https://github.com/aws-amplify/amplify-ui/pull/4359) [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - feat(react): DropZone component + + ```jsx + export default function DefaultDropZoneExample() { + const [files, setFiles] = React.useState([]); + return ( + <> + { + setFiles(files); + }} + > + Drag images here + + {files.map((file) => ( + {file.name} + ))} + + ); + } + ``` + +- [#4367](https://github.com/aws-amplify/amplify-ui/pull/4367) [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53) Thanks [@ioanabrooks](https://github.com/ioanabrooks)! - feat(ui-react-storage): Added upload actions and option to upload files on click. Usage: + + ``` + + ``` + +### Patch Changes + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`265f0b482`](https://github.com/aws-amplify/amplify-ui/commit/265f0b48249c89b004a40a1a06abc0c3551f45f7), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`5b6c9bfe4`](https://github.com/aws-amplify/amplify-ui/commit/5b6c9bfe4ef1c0727270bffacb5f9e8045a8325d), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`9471ea53a`](https://github.com/aws-amplify/amplify-ui/commit/9471ea53a2414879d197adb5f52c8dcb3e0df946), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`5bc0c8a32`](https://github.com/aws-amplify/amplify-ui/commit/5bc0c8a32d1552313df496f96b96738637d0b157), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui-react@5.3.0 + - @aws-amplify/ui@5.8.0 + - @aws-amplify/ui-react-core@2.1.32 + ## 2.2.0 ### Minor Changes diff --git a/packages/react-storage/package.json b/packages/react-storage/package.json index 581fa4a8abd..ab1718c9cd5 100644 --- a/packages/react-storage/package.json +++ b/packages/react-storage/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react-storage", - "version": "2.2.0", + "version": "2.3.0", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -40,9 +40,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react": "5.2.0", - "@aws-amplify/ui-react-core": "2.1.31", + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react": "5.3.0", + "@aws-amplify/ui-react-core": "2.1.32", "classnames": "2.3.1", "lodash": "4.17.21", "tslib": "2.4.1" diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 2437aa1456d..a93e2c7c808 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,82 @@ # @aws-amplify/ui-react +## 5.3.0 + +### Minor Changes + +- [#4348](https://github.com/aws-amplify/amplify-ui/pull/4348) [`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18) Thanks [@hbuchel](https://github.com/hbuchel)! - feat(react/ui): add new Fieldset Primitive + + Usage: + + ``` +
+ // Fieldset content/form controls +
+ ``` + +- [#4359](https://github.com/aws-amplify/amplify-ui/pull/4359) [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689) Thanks [@dbanksdesign](https://github.com/dbanksdesign)! - feat(react): DropZone component + + ```jsx + export default function DefaultDropZoneExample() { + const [files, setFiles] = React.useState([]); + return ( + <> + { + setFiles(files); + }} + > + Drag images here + + {files.map((file) => ( + {file.name} + ))} + + ); + } + ``` + +### Patch Changes + +- [#4372](https://github.com/aws-amplify/amplify-ui/pull/4372) [`265f0b482`](https://github.com/aws-amplify/amplify-ui/commit/265f0b48249c89b004a40a1a06abc0c3551f45f7) Thanks [@hbuchel](https://github.com/hbuchel)! - fix(react): ShowPasswordButton should have aria-hidden="true" on icon + +- [#4367](https://github.com/aws-amplify/amplify-ui/pull/4367) [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53) Thanks [@ioanabrooks](https://github.com/ioanabrooks)! - feat(ui-react-storage): Added upload actions and option to upload files on click. Usage: + + ``` + + ``` + +- [#4361](https://github.com/aws-amplify/amplify-ui/pull/4361) [`5b6c9bfe4`](https://github.com/aws-amplify/amplify-ui/commit/5b6c9bfe4ef1c0727270bffacb5f9e8045a8325d) Thanks [@hbuchel](https://github.com/hbuchel)! - feat(react): Add new Message primitive. + + Usage: + + ``` + Content of the message. + ``` + +- [#4368](https://github.com/aws-amplify/amplify-ui/pull/4368) [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26) Thanks [@hbuchel](https://github.com/hbuchel)! - chore(ui): adds info, warning, and success border tokens. updates background color tokens for info, warning, success and error. + +- [#4389](https://github.com/aws-amplify/amplify-ui/pull/4389) [`9471ea53a`](https://github.com/aws-amplify/amplify-ui/commit/9471ea53a2414879d197adb5f52c8dcb3e0df946) Thanks [@hbuchel](https://github.com/hbuchel)! - chore(react): update tests for disabled Fieldset + +- [#4384](https://github.com/aws-amplify/amplify-ui/pull/4384) [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066) Thanks [@reesscot](https://github.com/reesscot)! - feat: Input and Label primitives + + ```jx + export const InputLabelExample = () => ( + <> + + + + ); + ``` + +- Updated dependencies [[`276968530`](https://github.com/aws-amplify/amplify-ui/commit/276968530ba1049cfa4a9fd1efe8bd870b3e4b18), [`ec495a6f6`](https://github.com/aws-amplify/amplify-ui/commit/ec495a6f638c53970edd8706a0eeb5f95d142689), [`e1fc61119`](https://github.com/aws-amplify/amplify-ui/commit/e1fc61119224a92a4648d1d1673177647b1a8e53), [`14e402b6e`](https://github.com/aws-amplify/amplify-ui/commit/14e402b6eedab6bdef5cec21b0b084f230b0ce26), [`2407ac294`](https://github.com/aws-amplify/amplify-ui/commit/2407ac294270214bd20c414349d2423ab14b8066), [`5bc0c8a32`](https://github.com/aws-amplify/amplify-ui/commit/5bc0c8a32d1552313df496f96b96738637d0b157), [`64fba0fd2`](https://github.com/aws-amplify/amplify-ui/commit/64fba0fd2ec4a0c5061b461f527c8a45235eee13)]: + - @aws-amplify/ui@5.8.0 + - @aws-amplify/ui-react-core@2.1.32 + ## 5.2.0 ### Minor Changes diff --git a/packages/react/__tests__/__snapshots__/exports.ts.snap b/packages/react/__tests__/__snapshots__/exports.ts.snap index c9396cac39f..958a4f005b9 100644 --- a/packages/react/__tests__/__snapshots__/exports.ts.snap +++ b/packages/react/__tests__/__snapshots__/exports.ts.snap @@ -24,6 +24,7 @@ Array [ "ExpanderItem", "FieldGroupIcon", "FieldGroupIconButton", + "Fieldset", "FileUploader", "Flex", "Grid", @@ -4257,6 +4258,295 @@ Object { }, }, }, + "Fieldset": Object { + "properties": Object { + "alignContent": Object { + "type": "string", + }, + "alignItems": Object { + "type": "string", + }, + "alignSelf": Object { + "type": "string", + }, + "area": Object { + "type": "string", + }, + "ariaLabel": Object { + "type": "string", + }, + "ariaValuetext": Object { + "type": "string", + }, + "backgroundColor": Object { + "type": "string", + }, + "backgroundImage": Object { + "type": "string", + }, + "basis": Object { + "type": "string", + }, + "border": Object { + "type": "string", + }, + "borderColor": Object { + "type": "string", + }, + "borderRadius": Object { + "type": "string", + }, + "borderStyle": Object { + "type": "string", + }, + "borderWidth": Object { + "type": "string", + }, + "bottom": Object { + "type": "string", + }, + "boxShadow": Object { + "type": "string", + }, + "children": Object { + "type": "string", + }, + "className": Object { + "type": "string", + }, + "color": Object { + "type": "string", + }, + "column": Object { + "type": "string", + }, + "columnEnd": Object { + "type": "string", + }, + "columnGap": Object { + "type": "string", + }, + "columnSpan": Object { + "type": "string", + }, + "columnStart": Object { + "type": "string", + }, + "direction": Object { + "type": "string", + }, + "display": Object { + "type": "string", + }, + "flex": Object { + "type": "string", + }, + "fontFamily": Object { + "type": "string", + }, + "fontSize": Object { + "type": "string", + }, + "fontStyle": Object { + "type": "string", + }, + "fontWeight": Object { + "type": "string", + }, + "form": Object { + "type": "string", + }, + "gap": Object { + "type": "string", + }, + "grow": Object { + "type": "string", + }, + "height": Object { + "type": "string", + }, + "id": Object { + "type": "string", + }, + "inert": Object { + "type": "boolean", + }, + "isDisabled": Object { + "type": "boolean", + }, + "justifyContent": Object { + "type": "string", + }, + "left": Object { + "type": "string", + }, + "legend": Object { + "type": "string", + }, + "legendHidden": Object { + "type": "boolean", + }, + "letterSpacing": Object { + "type": "string", + }, + "lineHeight": Object { + "type": "string", + }, + "margin": Object { + "type": "string", + }, + "marginBlock": Object { + "type": "string", + }, + "marginBlockEnd": Object { + "type": "string", + }, + "marginBlockStart": Object { + "type": "string", + }, + "marginBottom": Object { + "type": "string", + }, + "marginInline": Object { + "type": "string", + }, + "marginInlineEnd": Object { + "type": "string", + }, + "marginInlineStart": Object { + "type": "string", + }, + "marginLeft": Object { + "type": "string", + }, + "marginRight": Object { + "type": "string", + }, + "marginTop": Object { + "type": "string", + }, + "maxHeight": Object { + "type": "string", + }, + "maxWidth": Object { + "type": "string", + }, + "minHeight": Object { + "type": "string", + }, + "minWidth": Object { + "type": "string", + }, + "name": Object { + "type": "string", + }, + "opacity": Object { + "type": "string", + }, + "order": Object { + "type": "string", + }, + "overflow": Object { + "type": "string", + }, + "padding": Object { + "type": "string", + }, + "paddingBlock": Object { + "type": "string", + }, + "paddingBlockEnd": Object { + "type": "string", + }, + "paddingBlockStart": Object { + "type": "string", + }, + "paddingBottom": Object { + "type": "string", + }, + "paddingInline": Object { + "type": "string", + }, + "paddingInlineEnd": Object { + "type": "string", + }, + "paddingInlineStart": Object { + "type": "string", + }, + "paddingLeft": Object { + "type": "string", + }, + "paddingRight": Object { + "type": "string", + }, + "paddingTop": Object { + "type": "string", + }, + "position": Object { + "type": "string", + }, + "right": Object { + "type": "string", + }, + "role": Object { + "type": "string", + }, + "row": Object { + "type": "string", + }, + "rowEnd": Object { + "type": "string", + }, + "rowGap": Object { + "type": "string", + }, + "rowSpan": Object { + "type": "string", + }, + "rowStart": Object { + "type": "string", + }, + "shrink": Object { + "type": "string", + }, + "size": Object { + "type": "string", + }, + "testId": Object { + "type": "string", + }, + "textAlign": Object { + "type": "string", + }, + "textDecoration": Object { + "type": "string", + }, + "textTransform": Object { + "type": "string", + }, + "top": Object { + "type": "string", + }, + "transform": Object { + "type": "string", + }, + "transformOrigin": Object { + "type": "string", + }, + "variation": Object { + "type": "string", + }, + "whiteSpace": Object { + "type": "string", + }, + "width": Object { + "type": "string", + }, + "wrap": Object { + "type": "string", + }, + }, + }, "Flex": Object { "properties": Object { "alignContent": Object { diff --git a/packages/react/package.json b/packages/react/package.json index 8feb413a46a..a6614c5f019 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-react", - "version": "5.2.0", + "version": "5.3.0", "main": "dist/index.js", "module": "dist/esm/index.mjs", "exports": { @@ -47,8 +47,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@aws-amplify/ui": "5.7.2", - "@aws-amplify/ui-react-core": "2.1.31", + "@aws-amplify/ui": "5.8.0", + "@aws-amplify/ui-react-core": "2.1.32", "@radix-ui/react-accordion": "1.0.0", "@radix-ui/react-direction": "1.0.0", "@radix-ui/react-dropdown-menu": "1.0.0", diff --git a/packages/react/src/primitives/Button/Button.tsx b/packages/react/src/primitives/Button/Button.tsx index 58e29afc57c..4ddaae35477 100644 --- a/packages/react/src/primitives/Button/Button.tsx +++ b/packages/react/src/primitives/Button/Button.tsx @@ -9,6 +9,8 @@ import { Primitive, } from '../types'; import { ComponentClassNames } from '../shared/constants'; + +import { useFieldset } from '../Fieldset/useFieldset'; import { Flex } from '../Flex'; import { Loader } from '../Loader'; import { View } from '../View'; @@ -40,6 +42,11 @@ const ButtonPrimitive: Primitive = ( ? `${variation ?? 'outlined'}--${colorTheme}` : undefined; + const { isFieldsetDisabled } = useFieldset(); + const shouldBeDisabled = isFieldsetDisabled + ? isFieldsetDisabled + : isDisabled ?? isLoading ?? rest['disabled']; + const componentClasses = classNames( ComponentClassNames.Button, ComponentClassNames.FieldGroupControl, @@ -49,7 +56,7 @@ const ButtonPrimitive: Primitive = ( classNameModifierByFlag( ComponentClassNames.Button, 'disabled', - isDisabled ?? isLoading ?? rest['disabled'] + shouldBeDisabled ), classNameModifierByFlag(ComponentClassNames.Button, 'loading', isLoading), classNameModifierByFlag( @@ -69,7 +76,7 @@ const ButtonPrimitive: Primitive = ( data-loading={isLoading} data-size={size} data-variation={variation} - isDisabled={isDisabled ?? isLoading} + isDisabled={shouldBeDisabled} type={type} {...rest} > diff --git a/packages/react/src/primitives/Button/__tests__/Button.test.tsx b/packages/react/src/primitives/Button/__tests__/Button.test.tsx index f75d30284f6..5ac42e0f0be 100644 --- a/packages/react/src/primitives/Button/__tests__/Button.test.tsx +++ b/packages/react/src/primitives/Button/__tests__/Button.test.tsx @@ -3,6 +3,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Button } from '../Button'; +import { Fieldset } from '../../Fieldset'; import { ButtonColorTheme } from '../../types'; import { ComponentClassNames } from '../../shared'; @@ -238,6 +239,20 @@ describe('Button test suite', () => { expect(button).toBeDisabled(); }); + it('should always be disabled if parent Fieldset isDisabled', async () => { + render( +
+
+ ); + + const button = await screen.findByTestId('button'); + const buttonDisabled = await screen.findByTestId('buttonWithDisabledProp'); + expect(button).toHaveAttribute('disabled'); + expect(buttonDisabled).toHaveAttribute('disabled'); + }); + it('should set loading state correctly if isLoading is set to true', async () => { render(